{"version":3,"sources":["@webhare/env/src/envbackend.ts","@webhare/dompack/src/tree.ts","@webhare/std/src/quacks.ts","@webhare/std/src/datetime.ts","@webhare/std/src/promises.ts","@webhare/std/src/finmath.ts","@webhare/std/src/money.ts","@webhare/std/src/types.ts","@webhare/std/src/strings.ts","@webhare/std/src/platformbased.ts","@webhare/std/src/collections.ts","@webhare/std/src/utils.ts","@webhare/std/src/localmutex.ts","@webhare/std/src/std.ts","@webhare/tsrun/src/polyfills.ts","@webhare/env/src/navigation.ts","@webhare/env/src/fetchdebug.ts","@webhare/env/src/whglobal.ts","@webhare/env/src/env.ts","mod::system/js/dompack/src/events.ts","@webhare/dompack/src/busy.ts","mod::system/js/dompack/src/tree.ts","mod::system/js/dompack/src/create.ts","mod::system/js/dompack/src/components.ts","@webhare/dompack/src/cookiebuilder.ts","@webhare/dompack/src/storage.ts","@webhare/dompack/src/preload.ts","@webhare/dompack/src/browser.ts","@webhare/dompack/src/dompack.ts","@webhare/dompack/reset.css","@webhare/forms/styling/functional.css","mod::tech42_website/webdesigns/tech42v3/frontend/frontend.scss","mod::system/js/dompack/browserfix/focus.ts","mod::system/js/dompack/extra/merge.ts","mod::publisher/js/forms/internal/merge.ts","mod::system/js/dompack/index.ts","mod::system/js/dompack/types/datetime.ts","node_modules/stacktrace-parser/dist/stack-trace-parser.esm.js","@webhare/js-api-tools/src/stacktracing.ts","@webhare/js-api-tools/src/levenshtein.ts","@webhare/js-api-tools/src/js-api-tools.ts","@webhare/jsonrpc-client/src/jsonrpc-client.ts","@webhare/forms/src/formservice.ts","@webhare/forms/src/address.ts","@webhare/gettid/src/hooks.ts","@webhare/gettid/src/internal.ts","@webhare/gettid/src/gettid.ts","@webhare/forms/src/jsformelement.ts","@webhare/forms/src/domsupport.ts","mod::publisher/js/forms/internal/customvalidation.ts","mod::publisher/js/forms/fields/addressfield.ts","mod::publisher/js/forms/internal/datehelpers.ts","mod::publisher/js/forms/internal/webharefields.tsx","mod::publisher/js/forms/internal/requiredstyles.css","@webhare/forms/src/registeredfield.ts","mod::publisher/js/forms/fields/arrayfield.css","mod::publisher/js/forms/fields/arrayfield.ts","@webhare/forms/src/fieldmap.ts","mod::publisher/js/forms/formbase.ts","mod::publisher/js/forms/internal/emailvalidation.tsx","mod::system/js/dompack/src/debug.ts","mod::system/js/dompack/extra/browser.ts","mod::system/js/dompack/extra/keyboard.ts","mod::system/js/dompack/api/dialog.ts","@webhare/upload/src/upload.ts","mod::publisher/js/captcha/__captcha.lang.json","mod::publisher/js/captcha/api.ts","mod::publisher/js/forms/fields/captchafield.ts","@webhare/forms/src/registration.ts","mod::publisher/js/forms/rpc.ts","mod::publisher/js/forms/internal/form.lang.json","mod::publisher/js/forms/fields/fileeditbase.ts","mod::publisher/js/forms/fields/upload.css","mod::publisher/js/forms/fields/upload.tsx","mod::publisher/js/forms/fields/imgedit.ts","mod::publisher/js/forms/internal/datepicker.tsx","mod::publisher/js/forms/internal/datetime-valueprops.ts","mod::publisher/js/forms/fields/datetime.tsx","mod::publisher/js/captcha/google-recaptcha.tsx","@webhare/forms/src/friendly-captcha.ts","@webhare/forms/src/forms.ts","mod::tech42_website/webdesigns/tech42v3/frontend/lib/components.ts","mod::tech42_website/node_modules/gsap/gsap-core.js","mod::tech42_website/node_modules/gsap/CSSPlugin.js","mod::tech42_website/node_modules/gsap/index.js","mod::tech42_website/node_modules/gsap/Observer.js","mod::tech42_website/node_modules/gsap/ScrollTrigger.js","mod::tech42_website/node_modules/gsap/SplitText.js","mod::tech42_website/webdesigns/tech42v3/frontend/lib/motion.ts","mod::tech42_website/webdesigns/tech42v3/frontend/lib/perfstats.ts","mod::tech42_website/webdesigns/tech42v3/frontend/lib/arrival.ts","mod::tech42_website/webdesigns/tech42v3/frontend/lib/leads.ts","mod::tech42_website/node_modules/lenis/package.json","mod::tech42_website/node_modules/lenis/packages/core/src/maths.ts","mod::tech42_website/node_modules/lenis/packages/core/src/animate.ts","mod::tech42_website/node_modules/lenis/packages/core/src/debounce.ts","mod::tech42_website/node_modules/lenis/packages/core/src/dimensions.ts","mod::tech42_website/node_modules/lenis/packages/core/src/emitter.ts","mod::tech42_website/node_modules/lenis/packages/core/src/virtual-scroll.ts","mod::tech42_website/node_modules/lenis/packages/core/src/lenis.ts","mod::tech42_website/node_modules/lenis/dist/lenis.css","mod::tech42_website/webdesigns/tech42v3/frontend/lib/scroll.ts","mod::tech42_website/webdesigns/tech42v3/frontend/components/app.ts","mod::tech42_website/node_modules/delegate-it/delegate.js","mod::tech42_website/node_modules/delegate-it/one-event.js","mod::tech42_website/node_modules/delegate-it/index.js","mod::tech42_website/node_modules/swup/src/helpers/classify.ts","mod::tech42_website/node_modules/swup/src/helpers/getCurrentUrl.ts","mod::tech42_website/node_modules/swup/src/helpers/history.ts","mod::tech42_website/node_modules/swup/src/helpers/delegateEvent.ts","mod::tech42_website/node_modules/swup/src/helpers/Location.ts","mod::tech42_website/node_modules/swup/src/helpers/matchPath.ts","mod::tech42_website/node_modules/swup/src/modules/fetchPage.ts","mod::tech42_website/node_modules/swup/src/modules/Cache.ts","mod::tech42_website/node_modules/swup/src/utils/index.ts","mod::tech42_website/node_modules/swup/src/modules/Classes.ts","mod::tech42_website/node_modules/swup/src/modules/Visit.ts","mod::tech42_website/node_modules/swup/src/modules/Hooks.ts","mod::tech42_website/node_modules/swup/src/modules/getAnchorElement.ts","mod::tech42_website/node_modules/swup/src/modules/awaitAnimations.ts","mod::tech42_website/node_modules/swup/src/modules/navigate.ts","mod::tech42_website/node_modules/swup/src/modules/animatePageOut.ts","mod::tech42_website/node_modules/swup/src/modules/replaceContent.ts","mod::tech42_website/node_modules/swup/src/modules/scrollToContent.ts","mod::tech42_website/node_modules/swup/src/modules/animatePageIn.ts","mod::tech42_website/node_modules/swup/src/modules/renderPage.ts","mod::tech42_website/node_modules/swup/src/modules/plugins.ts","mod::tech42_website/node_modules/swup/src/modules/resolveUrl.ts","mod::tech42_website/node_modules/swup/src/Swup.ts","mod::tech42_website/node_modules/@swup/plugin/src/versionSatisfies.ts","mod::tech42_website/node_modules/@swup/plugin/src/index.ts","mod::tech42_website/node_modules/@swup/plugin/src/pluginRequirements.ts","mod::tech42_website/node_modules/@swup/head-plugin/src/mergeHeadContents.ts","mod::tech42_website/node_modules/@swup/head-plugin/src/updateAttributes.ts","mod::tech42_website/node_modules/@swup/head-plugin/src/waitForAssets.ts","mod::tech42_website/node_modules/@swup/head-plugin/src/index.ts","mod::tech42_website/webdesigns/tech42v3/frontend/components/transitions.ts","mod::tech42_website/webdesigns/tech42v3/frontend/lib/intro.ts","mod::tech42_website/webdesigns/tech42v3/frontend/components/intro-curtain.ts","mod::tech42_website/webdesigns/tech42v3/frontend/lib/dock.ts","mod::tech42_website/webdesigns/tech42v3/frontend/components/site-header.ts","mod::tech42_website/webdesigns/tech42v3/frontend/components/language-selector.ts","mod::tech42_website/webdesigns/tech42v3/frontend/lib/assets.ts","mod::tech42_website/webdesigns/tech42v3/frontend/lib/liquid.ts","mod::tech42_website/webdesigns/tech42v3/frontend/components/hero-section.ts","mod::tech42_website/webdesigns/tech42v3/frontend/components/hero-contact.ts","mod::tech42_website/webdesigns/tech42v3/frontend/components/client-strip.ts","mod::tech42_website/webdesigns/tech42v3/frontend/components/why-section.ts","mod::tech42_website/webdesigns/tech42v3/frontend/components/cycle-section.ts","mod::tech42_website/webdesigns/tech42v3/frontend/components/services-section.ts","mod::tech42_website/webdesigns/tech42v3/frontend/components/products-section.ts","mod::tech42_website/webdesigns/tech42v3/frontend/components/how-section.ts","mod::tech42_website/webdesigns/tech42v3/frontend/lib/cursorHint.ts","mod::tech42_website/webdesigns/tech42v3/frontend/components/team-section.ts","mod::tech42_website/webdesigns/tech42v3/frontend/components/contact-section.ts","mod::tech42_website/webdesigns/tech42v3/frontend/components/service-page.ts","mod::tech42_website/webdesigns/tech42v3/frontend/components/budget-section.ts","mod::tech42_website/webdesigns/tech42v3/frontend/components/job-page.ts","mod::tech42_website/webdesigns/tech42v3/frontend/components/apply-cta.ts","mod::tech42_website/webdesigns/tech42v3/frontend/components/blog-page.ts","mod::tech42_website/webdesigns/tech42v3/frontend/components/article-page.ts","mod::tech42_website/webdesigns/tech42v3/frontend/components/info-page.ts","mod::tech42_website/webdesigns/tech42v3/frontend/components/policy-page.ts","mod::tech42_website/webdesigns/tech42v3/frontend/components/site-footer.ts","mod::tech42_website/webdesigns/tech42v3/frontend/components/contact-modal.ts","mod::tech42_website/webdesigns/tech42v3/frontend/components/apply-modal.ts","mod::tech42_website/webdesigns/tech42v3/frontend/frontend.ts","@webhare/frontend/src/init.ts","@webhare/env/src/init-browser.ts","mod::publisher/js/internal/polyfills/all.ts","mod::publisher/js/internal/polyfills/iterator-helpers.ts","mod::publisher/js/internal/polyfills/publisher-integration.ts","/entrypoint.js"],"sourcesContent":["//We implement the backend version of getWHDebugFlags so bridge can access us without going through a recursive dep\n\nimport type { DTAPStage } from \"./concepts\";\n\n/// List global polyfills currently active. This may be needed to align TypeScript hosts configuration\nexport const globalPolyfills: string[] = [];\n\n/// An object with string keys and typed values\nexport interface WellKnownFlags {\n  /** Log RPcs */\n  rpc?: boolean;\n  /** Log web traffic */\n  wrq?: boolean;\n  /** Autoprofile */\n  apr?: boolean;\n  /** IPC */\n  ipc?: boolean;\n  /** async */\n  async?: boolean;\n}\nexport type DebugFlags = WellKnownFlags & { [key: string]: boolean | undefined };\n\nexport type DebugConfig = {\n  tags: readonly string[];\n  outputsession: string;\n  context: string;\n};\n\n/// Empty or no parameter lang is get, otherwise it's a set\nexport type GetSetAssetBase = (assetBase?: string | null) => string | null;\n\nexport type EnvHooks = {\n  currentAssetBase: GetSetAssetBase;\n};\n\n\nconst settingschangedcallbacks = new Array<() => void>;\n\n/* Global debug flags are set by `wh debug`, local flags are prefilled by environment variables.\n   Edits to the debug flags will be applied to the local flags (unless setDebugFlagsOverrideCB returns\n   override records).\n*/\nconst globalDebugFlags: DebugFlags = {}, localDebugFlags: DebugFlags = {};\n\n/** Returns the flag override records. The first record is examined first, then the second, etc. */\nlet debugFlagsOverridesCB: undefined | (() => DebugFlags[]);\n\n/** Override the debug flag override getter. */\nexport function setDebugFlagsOverrideCB(cb: undefined | (() => DebugFlags[])) {\n  debugFlagsOverridesCB = cb;\n}\n\n/* Proxy handler for the published debug flags. Uses the override records (with the first record\n   examined first, then the second, etc.) to override the flags from baseDebugFlags. Setting to `true` sets\n   the flag, `false` disables it and setting to `undefined` has the same effect as deleting the property in the\n   current top record (exposing any value from a lower record, like the debug settings from `wh debug`).\n*/\nclass DebugFlagsProxyHandler implements ProxyHandler<DebugFlags> {\n  private getRecordList(): DebugFlags[] {\n    return [...debugFlagsOverridesCB?.() ?? [], localDebugFlags, globalDebugFlags];\n  }\n\n  get(target: DebugFlags, p: string) {\n    for (const record of this.getRecordList())\n      if (p in record && typeof record[p] !== \"undefined\")\n        return record[p];\n    return undefined;\n  }\n  has(target: DebugFlags, p: string): boolean {\n    return this.get(target, p) !== undefined;\n  }\n  ownKeys(target: DebugFlags): Array<string | symbol> {\n    const keys = new Array<string | symbol>;\n    for (const record of this.getRecordList())\n      for (const key of Reflect.ownKeys(record))\n        if (typeof key === \"string\" && record[key] !== undefined && !keys.includes(key))\n          keys.push(key);\n    return keys;\n  }\n  set(target: DebugFlags, p: string, newValue: boolean | undefined): boolean {\n    const toModify = this.getRecordList()[0];\n    if (typeof newValue === \"boolean\")\n      toModify[p] = newValue;\n    else\n      delete toModify[p];\n\n    runSettingsCallbacks();\n    return true;\n  }\n  deleteProperty(target: DebugFlags, p: string): boolean {\n    const toModify = this.getRecordList()[0];\n    delete toModify[p];\n\n    runSettingsCallbacks();\n    return true;\n  }\n  getOwnPropertyDescriptor(target: DebugFlags, p: string): PropertyDescriptor | undefined {\n    const value = this.get(target, p);\n    return value !== undefined ? { enumerable: true, value, configurable: true } : undefined;\n  }\n}\n\nexport const debugFlags = new Proxy<DebugFlags>({\n  [Symbol.for('nodejs.util.inspect.custom')]: formatForConsoleLogs\n}, new DebugFlagsProxyHandler());\n\nfunction formatForConsoleLogs() {\n  return `DebugFlags [${[...Object.keys(debugFlags)].filter(key => debugFlags[key]).join(\", \")}]`;\n}\n\nfunction runSettingsCallbacks() {\n  for (const cb of [...settingschangedcallbacks]) {\n    try {\n      cb();\n    } catch (e) {\n      console.error(\"Error invoking settings change callback\", cb?.name, e);\n      //ignore, debugFlags can change due to external updates so they're basically signal handlers and there's no real point in crashing whatever was really running\n    }\n  }\n}\n\n/** Update the debugconfig as present in the system configuration record\n    @param settings - debugconfig cell of the system configuration record\n*/\nexport function updateDebugConfig(settings: DebugConfig | null) {\n  const oldenabledflags = Object.keys(globalDebugFlags).sort();\n  const newenabledflags = settings?.tags ? [...settings.tags].sort() : [];\n\n  if (oldenabledflags.join(\",\") !== newenabledflags.join(\",\")) {\n    for (const flag of newenabledflags)\n      globalDebugFlags[flag] = true;\n    for (const flag of oldenabledflags)\n      if (!newenabledflags.includes(flag))\n        delete globalDebugFlags[flag];\n\n    runSettingsCallbacks();\n  }\n  if (debugFlags.async && Error.stackTraceLimit < 100)\n    Error.stackTraceLimit = 100;\n}\n\nexport function registerDebugConfigChangedCallback(cb: () => void) {\n  settingschangedcallbacks.push(cb);\n}\n\nexport function updateLocalDebugFlags(mode: \"enable\" | \"disable\" | \"clear\", flags: string[]): DebugFlags {\n  switch (mode) {\n    case \"enable\":\n    case \"disable\":\n      for (const flag of flags)\n        localDebugFlags[flag] = mode === \"enable\";\n      break;\n    case \"clear\":\n      for (const flag of Object.keys(localDebugFlags))\n        delete localDebugFlags[flag];\n  }\n  runSettingsCallbacks();\n  return { ...globalDebugFlags, ...localDebugFlags };\n}\n\n/** DTAP stage set for this WebHare */\nlet dtapStage: DTAPStage = \"production\";\n\n/** @deprecated We now recommend checking dtapStage against production/acceptance Explicitly */\nlet isLive: boolean = dtapStage === \"production\" || dtapStage === \"acceptance\";\n\n/** The backend base URL. Used for eg. autoconfiguring JSON/RPC */\nlet backendBase = \"\";\n\n/** The global assetbase */\nlet assetBase: string | null = null;\n\n//deprecated variants\n/** @deprecated For WH5.4 and up use 'dtapStage' */\nlet dtapstage: DTAPStage = dtapStage;\n/** @deprecated For WH5.4 and up compare 'dtapStage' for production or acceptance */\nlet islive: boolean = isLive;\n\nlet hooks: EnvHooks | undefined;\nlet hookFactory: (() => EnvHooks) | undefined;\nlet gotHooks = false;\n\nexport function initEnv(setDtapStage: DTAPStage, setBackendBase: string) {\n  dtapStage = setDtapStage;\n  isLive = dtapStage === \"production\" || dtapStage === \"acceptance\";\n  backendBase = setBackendBase;\n\n  dtapstage = dtapStage;\n  islive = isLive;\n}\n\nexport function setEnvHooksFactory(newHookFactory: () => EnvHooks) {\n  if (gotHooks)\n    throw new Error(`The call to setEnvHooksFactory was too late - hooks have already been retrieved once`);\n  hookFactory = newHookFactory;\n}\n\nexport function getEnvHooks() {\n  gotHooks = true;\n  return hookFactory?.();\n}\n\nfunction ensureHooks(): EnvHooks {\n  return hooks ??= getEnvHooks?.() ?? {\n    currentAssetBase: (newAssetBase) => {\n      if (newAssetBase !== undefined)\n        assetBase = newAssetBase;\n      return assetBase;\n    }\n  };\n}\n\n/** Get the base url for assets. This may point towards eg. a CDN\n * @returns The base url for assets, ending with a '/'. null if not set\n */\nexport function getAssetBase(): string | null {\n  return ensureHooks().currentAssetBase();\n}\n\n/** Get the base url for a module's public assets (those located in the module's `public` folder)\n */\nexport function getModulePublicAssetBase(module: string) {\n  return `${getAssetBase() || \"/\"}.wh/mod/${encodeURIComponent(module)}/public/`;\n}\n\n/** Set the base url for assets */\nexport function setAssetBase(base: string | null): void {\n  if (base && !base.endsWith(\"/\"))\n    throw new Error(`Asset base must end with a '/'`);\n\n  ensureHooks().currentAssetBase(base);\n}\n\nexport { dtapStage, isLive, backendBase, localDebugFlags };\nexport { dtapstage, islive }; //deprecated variants\n","/** Rect describing an elements position */\nexport type Rect = {\n  top: number;\n  bottom: number;\n  left: number;\n  right: number;\n  width: number;\n  height: number;\n};\n\n/** Elements you can set a value on and would have to trigger change and/or input events */\nexport type FormControlElement = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;\n\n/** Types that support querySelector(All) */\ntype QuerySelectorAble = ParentNode | ShadowRoot;\n\nexport function qS<E extends Element = HTMLElement>(startnode: QuerySelectorAble, selector: string): E | null;\nexport function qS<E extends Element = HTMLElement>(selector: string): E | null;\n\n/** Match the first element using a CSS selector\n * @param node_or_selector - The starting node or selector\n * @param selector - The selector to match if the starting node was specified\n * @returns The first matching element or null\n */\nexport function qS<E extends Element>(node_or_selector: QuerySelectorAble | string, selector?: string): E | null {\n  if (typeof node_or_selector === 'string')\n    return document.querySelector<E>(node_or_selector);\n  else if (selector)\n    return node_or_selector.querySelector<E>(selector);\n  return null;\n}\n\n\nexport function qR<E extends Element = HTMLElement>(startnode: QuerySelectorAble, selector: string): E;\nexport function qR<E extends Element = HTMLElement>(selector: string): E;\n\n/** Match a specific element using a CSS selector, requiring it to exist and be unique\n * @param node_or_selector - The starting node or selector\n * @param selector - The selector to match if the starting node was specified\n * @returns The requested element. Throw it the selector doesn't match exactly one element\n */\nexport function qR<E extends Element>(node_or_selector: QuerySelectorAble | string, selector?: string): E {\n  const matches = qSA<E>(node_or_selector as QuerySelectorAble, selector as string);\n  if (matches.length === 1)\n    return matches[0];\n\n  if (typeof node_or_selector !== 'string') {\n    console.error(`${matches.length} elements match selector \\`${selector}\\` with startingpoint`, node_or_selector, matches);\n    throw new Error(`${matches.length} elements match selector \\`${selector}\\` given startingpoint '${node_or_selector.nodeName}'`);\n  } else {\n    console.error(`${matches.length} elements match selector \\`${node_or_selector}\\` in the document`, matches);\n    throw new Error(`${matches.length} elements match selector \\`${node_or_selector}\\` in the document`);\n  }\n}\n\nexport function qSA<E extends Element = HTMLElement>(startnode: QuerySelectorAble, selector: string): E[];\nexport function qSA<E extends Element = HTMLElement>(selector: string): E[];\n\n/** Find multiple elements using a CSS selector\n * @param node_or_selector - The starting node or selector\n * @param selector - The selector to match if the starting node was specified\n * @returns The requested elements.\n */\nexport function qSA<E extends Element>(node_or_selector: QuerySelectorAble | string, selector?: string): E[] {\n  if (typeof node_or_selector === 'string')\n    return Array.from(document.querySelectorAll(node_or_selector));\n  else if (selector)\n    return Array.from(node_or_selector.querySelectorAll(selector));\n\n  return [];\n}\n\n/** Return whether the passed element is a FormControlElement */\nexport function isFormControl(field: Element): field is FormControlElement {\n  return isHTMLElement(field) && [\"INPUT\", \"SELECT\", \"TEXTAREA\"].includes(field.tagName);\n}\n\n/** Return whether the passed element is an editable text field */\nexport function isEditControl(field: Element): field is HTMLElement {\n  return isHTMLElement(field) && ([\"INPUT\", \"TEXTAREA\"].includes(field.tagName) || field.isContentEditable);\n}\n\n/** Test whether node is an Element, even if it's in a different iframe */\nexport function isElement(node: unknown): node is Element {\n  //TODO What is actually going on if defaultView is missing?\n  if (!node || typeof node !== \"object\")\n    return false;\n\n  /* Getting the proto doesn't always work:\n  const proto = (node as Element).ownerDocument.defaultView?.Element;\n  (because our iframes derive off about? not sure) so until someone finds the real answer, we'll do a heuristic\n  */\n\n  /** Analyzing node.constructor.name doesn't work because custom elements don't necessarily have their constructor's name ending in Element\n  return Boolean(\"ownerDocument\" in node && node.constructor.name.match(/Element$/));\n  */\n\n  return Boolean(\"ownerDocument\" in node && (node as Element).nodeType === 1);\n\n}\n\n/** Test whether node is a HTMLElement, even if it's in a different iframe */\nexport function isHTMLElement(node: unknown): node is HTMLElement {\n  return isElement(node) && node.namespaceURI === \"http://www.w3.org/1999/xhtml\";\n}\n\n/** Test whether node is a SVGElement, even if it's in a different iframe */\nexport function isSVGElement(node: unknown): node is SVGElement {\n  return isElement(node) && node.namespaceURI === \"http://www.w3.org/2000/svg\";\n}\n\n/**\n * get the relative bound difference between two elements, and return a writable copy\n *\n * @param node - The node for which you need coordinates\n * @param relativeto - Optional reference point. If not set, you just get a 'normal' coordinate object\n */\nexport function getRelativeBounds(node: Element, relativeto?: Element): Rect {\n  if (!relativeto)\n    relativeto = node.ownerDocument.documentElement;\n\n  const nodecoords = node.getBoundingClientRect();\n  const relcoords = relativeto.getBoundingClientRect();\n  return {\n    top: nodecoords.top - relcoords.top,\n    left: nodecoords.left - relcoords.left,\n    right: nodecoords.right - relcoords.left,\n    bottom: nodecoords.bottom - relcoords.top,\n    width: nodecoords.width,\n    height: nodecoords.height\n  };\n}\n\nexport type ParsedLanguageTag = {\n  /** The full tag, eg en-US */\n  tag: string;\n  /** The language code, eg 'en' */\n  language: string;\n  region?: string;\n  /** The script, eg 'Hant' */\n  script?: string;\n};\n\n/** Parse a BCP47 language tag */\nexport function parseLanguageTag(languageTag: string): ParsedLanguageTag {\n  /* https://datatracker.ietf.org/doc/html/rfc5646#section-2.1\n     langtag       = language\n                 [\"-\" script]\n                 [\"-\" region]\n                 *(\"-\" variant)\n                 *(\"-\" extension)\n                 [\"-\" privateuse]\n     BUT: we're limiting ourselves to language, script and region for now\n\n     language      = 2*3ALPHA           ; shortest ISO 639 code\n                    [\"-\" extlang]       ; sometimes followed by\n                                          extended language subtags\n\n                                           extlang       = 3ALPHA              ; selected ISO 639 codes\n                 *2(\"-\" 3ALPHA)      ; permanently reserved\n\n      script        = 4ALPHA              ; ISO 15924 code\n\n      region        = 2ALPHA              ; ISO 3166-1 code\n                    / 3DIGIT              ; UN M.49 code\n\n     Note that we're not yet fully implementing the spec, just the parts we expect to encounter in practice\n  */\n  const match = languageTag.match(/^([a-z]{2,}(-[a-z]{3})?)(-[A-Za-z]{4,})?(-[A-Z]{2}|-\\d{3})?$/);\n  if (!match)\n    throw new Error(`Invalid language tag: ${languageTag}`);\n\n  return {\n    tag: languageTag,\n    language: match[1],\n    ...(match[3] ? { script: match[3].substring(1) } : {}),\n    ...(match[4] ? { region: match[4].substring(1) } : {})\n  };\n}\n\n/** Get the effective language for an element (or the document)\n * @param node - The element for which to get the effective language. If not specified, the documentElement and finally the browser is used\n * @returns The language code, eg. \"nl\" or \"en-GB\"\n */\nexport function getLang(node?: Element): ParsedLanguageTag {\n  if (!node && typeof document !== \"undefined\")\n    node = document.documentElement;\n  const tag = (node?.closest('[lang]')?.getAttribute(\"lang\") || navigator.language || \"en\");\n  return parseLanguageTag(tag);\n}\n","//TODO can we replace ourselves with nodejs util.types in a pure NodeJS environment?\n\nimport type { Money } from \"./money.ts\";\n\nexport function getWHType(obj: unknown): string | null { //not exporting this directly as we hope JS comes up with better solutions for instanceOf not being compatible with realms/reloading\n  // Ideally we'd use symbol but it breaks tree shaking in esbuild, so this is our workaround. Reported as https://github.com/evanw/esbuild/issues/3940\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Can't cleanly type this it seems and it's low level anyway\n  return (obj as any)?.constructor?.[\"__ $whTypeSymbol\"] ?? null;\n}\n\nfunction isCrossRealm(value: unknown): value is object {\n  return Boolean(value // it's not null\n    && typeof value === \"object\" //and it's an object\n    && !(value instanceof Object)); //and it's not an instance of our Object\n}\n\n/** Test whether a value looks like an instance of Money */\nexport function isMoney(value: unknown): value is Money {\n  return getWHType(value) === \"Money\";\n}\n\n/** Test whether a value looks like an instance of Temporal.Instant */\nexport function isTemporalInstant(value: unknown): value is Temporal.Instant {\n  return Boolean(value && typeof value === \"object\" && Symbol.toStringTag in value && value?.[Symbol.toStringTag] === 'Temporal.Instant');\n}\n\n/** Test whether a value looks like an instance of Temporal.PlainDateTime */\nexport function isTemporalPlainDateTime(value: unknown): value is Temporal.PlainDateTime {\n  return Boolean(value && typeof value === \"object\" && Symbol.toStringTag in value && value?.[Symbol.toStringTag] === 'Temporal.PlainDateTime');\n}\n\n/** Test whether a value looks like an instance of Temporal.PlainDate */\nexport function isTemporalPlainDate(value: unknown): value is Temporal.PlainDate {\n  return Boolean(value && typeof value === \"object\" && Symbol.toStringTag in value && value?.[Symbol.toStringTag] === 'Temporal.PlainDate');\n}\n\n/** Test whether a value looks like an instance of Temporal.PlainTime */\nexport function isTemporalPlainTime(value: unknown): value is Temporal.PlainTime {\n  return Boolean(value && typeof value === \"object\" && Symbol.toStringTag in value && value?.[Symbol.toStringTag] === 'Temporal.PlainTime');\n}\n\n/** Test whether a value looks like an instance of Temporal.ZonedDateTime */\nexport function isTemporalZonedDateTime(value: unknown): value is Temporal.ZonedDateTime {\n  return Boolean(value && typeof value === \"object\" && Symbol.toStringTag in value && value?.[Symbol.toStringTag] === 'Temporal.ZonedDateTime');\n}\n\n/** Test whether a value looks like an instance of Date (assumes no subclasses) */\nexport function isDate(value: unknown): value is Date {\n  return value instanceof Date || (isCrossRealm(value) && value.constructor.name === \"Date\");\n}\n\n/** Test whether a value appears to implement the Blob interface */\nexport function isBlob(value: unknown): value is Blob {\n  return value instanceof Blob || Boolean(value && typeof value === \"object\" && \"size\" in value && \"type\" in value && \"slice\" in value && typeof value.slice === \"function\" && \"stream\" in value && typeof value.stream === \"function\");\n}\n\n/** Test whether a value appears to implement the File interface */\nexport function isFile(value: unknown): value is File {\n  return isBlob(value) && \"name\" in value;\n}\n\n/** Check if the object is probably an Error object. Can't use 'instanceof Error' as an Error might come from a different frame */\nexport function isError(e: unknown): e is Error {\n  return e instanceof Error || (isCrossRealm(e) && \"name\" in e && \"stack\" in e && \"message\" in e);\n}\n\n/** Check if the object looks like a promise */\nexport function isPromise<T>(e: T | Promise<T>): e is Promise<Awaited<T>> {\n  return Boolean(e && typeof (e as Promise<unknown>).then === \"function\" && typeof (e as Promise<unknown>).catch === \"function\");\n}\n\n/** Check the type of a value, return its JS or STD type\n * @param value - The value to check\n * @returns The type of the value. If the value is an object but recognized as any of Money, Date, Blob, Temporal.Instant/PlainDate/PlainDateTime, that type is returned.\n */\nexport function stdTypeOf(value: unknown): \"string\" | \"number\" | \"boolean\" | \"null\" | \"symbol\" | \"bigint\" | \"function\" | \"object\" | \"undefined\" | \"Date\" | \"Money\" | \"Array\" | \"Instant\" | \"PlainDate\" | \"PlainDateTime\" | \"PlainTime\" | \"ZonedDateTime\" | \"File\" | \"Blob\" {\n  const t = typeof value;\n  if (t === \"object\") {\n    if (!value)\n      return \"null\";\n    if (Array.isArray(value))\n      return \"Array\";\n    if (isMoney(value))\n      return \"Money\";\n    if (isBlob(value))\n      return isFile(value) ? \"File\" : \"Blob\";\n    if (isDate(value))\n      return \"Date\";\n    if (isTemporalInstant(value))\n      return \"Instant\";\n    if (isTemporalPlainTime(value))\n      return \"PlainTime\";\n    if (isTemporalPlainDate(value))\n      return \"PlainDate\";\n    if (isTemporalPlainDateTime(value))\n      return \"PlainDateTime\";\n    if (isTemporalZonedDateTime(value))\n      return \"ZonedDateTime\";\n  }\n  return t;\n}\n","import { isDate, isTemporalInstant } from \"./quacks.ts\";\n\n/** A tolerant JS date parameter */\nexport type FlexibleInstant = Date | Temporal.Instant | Temporal.ZonedDateTime;\n\n/** A relative (up to a week) or absolute wait period. Use 0 for 'polling' and Infinity to indicate an endless waits. Numbers are interpreted to be in milliseconds, a string is interpreted as a ISO8601 duration */\nexport type WaitPeriod = 0 | number | string | FlexibleInstant;\nexport interface Duration {\n  sign: \"+\" | \"-\";\n  years: number;\n  months: number;\n  weeks: number;\n  days: number;\n  hours: number;\n  minutes: number;\n  seconds: number;\n  milliseconds: number;\n}\n\nfunction parseMS(ms: string): number {\n  if (ms.length === 2) //.5\n    return parseInt(ms.substring(1)) * 100;\n  if (ms.length === 3) //.54\n    return parseInt(ms.substring(1)) * 10;\n  return parseInt(ms.substring(1, 4));\n}\n\n/** Parse an ISO8601 duration\n * @param duration - ISO8601 duration string (e.g. \"P1Y2M3DT4H5M6S\")\n */\nexport function parseDuration(duration: string): Duration {\n  // const matches = duration.match(/(-)?P(?:([.,\\d]+)Y)?(?:([.,\\d]+)M)?(?:([.,\\d]+)W)?(?:([.,\\d]+)D)?T(?:([.,\\d]+)H)?(?:([.,\\d]+)M)?(?:([.,\\d]+)S)?/);\n  const matches = duration.match(/^(-)?P(?:(\\d+)Y)?(?:(\\d+)M)?(?:(\\d+)W)?(?:(\\d+)D)?(?:T(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+)(\\.\\d+)?S)?)?$/);\n  if (!matches ||\n    (matches[4] && (matches[2] || matches[3] || matches[5])) || //can't have weeks and years/months/days\n    !(matches[2] || matches[3] || matches[4] || matches[5] || matches[6] || matches[7] || matches[8])) //one component must be present\n    throw new Error(`Invalid ISO8601 duration '${duration}'`);\n\n  return {\n    sign: matches[1] ? '-' : '+',\n    years: parseInt(matches[2]) || 0,\n    months: parseInt(matches[3]) || 0,\n    weeks: parseInt(matches[4]) || 0,\n    days: parseInt(matches[5]) || 0,\n    hours: parseInt(matches[6]) || 0,\n    minutes: parseInt(matches[7]) || 0,\n    seconds: parseInt(matches[8]) || 0,\n    milliseconds: matches[9] ? parseMS(matches[9]) : 0\n  };\n}\n\n/** Add a duration (time) to a date\n * @param startingdate - Date to start from\n * @param duration - Duration to add (as object or as ISO8601 duration string, eg \"P1Y2M3DT4H5M6S\")\n */\nexport function addDuration(startingdate: Date, duration: Partial<Duration> | string): Date;\nexport function addDuration(startingdate: Temporal.Instant, duration: Partial<Duration> | string): Temporal.Instant;\n\nexport function addDuration(startingdate: Date | Temporal.Instant, duration: Partial<Duration> | string): Date | Temporal.Instant {\n  if (isTemporalInstant(startingdate))\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any -- if you pass a Temporal.Instant, we should be able to create new ones from Temporal.\n    return (globalThis as any).Temporal.Instant.fromEpochMilliseconds(addDuration(new Date(startingdate.epochMilliseconds), duration).getTime());\n\n  //we cannot take timezones (flexible instant) yet? as we do not timezone correct day/week/month calculations\n  if (typeof duration === \"string\")\n    duration = parseDuration(duration);\n\n  const direction = duration.sign === \"-\" ? -1 : 1;\n  const date = new Date(startingdate.getTime());\n  if (duration.years)\n    date.setUTCFullYear(date.getUTCFullYear() + direction * duration.years);\n  if (duration.months)\n    date.setUTCMonth(date.getUTCMonth() + direction * duration.months);\n\n  const modifydays = (duration.days ?? 0) + (duration.weeks ?? 0) * 7;\n  if (modifydays)\n    date.setUTCDate(date.getUTCDate() + direction * modifydays);\n\n  const timeoffset = (duration.hours ?? 0) * 60 * 60 * 1000 + (duration.minutes ?? 0) * 60 * 1000 + (duration.seconds ?? 0) * 1000 + (duration.milliseconds ?? 0);\n  date.setTime(date.getTime() + direction * timeoffset);\n\n  return date;\n}\n\n/** Subtract a duration (time) from a date\n * @param startingdate - Date to start from\n * @param duration - Duration to subtract (as object or as ISO8601 duration string, eg \"P1Y2M3DT4H5M6S\")\n */\nexport function subtractDuration(startingdate: Date, duration: Partial<Duration> | string): Date;\nexport function subtractDuration(startingdate: Temporal.Instant, duration: Partial<Duration> | string): Temporal.Instant;\n\nexport function subtractDuration(startingdate: Date | Temporal.Instant, duration: Partial<Duration> | string): Date | Temporal.Instant {\n  if (isTemporalInstant(startingdate))\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any -- if you pass a Temporal.Instant, we should be able to create new ones from Temporal.\n    return (globalThis as any).Temporal.Instant.fromEpochMilliseconds(subtractDuration(new Date(startingdate.epochMilliseconds), duration).getTime());\n\n  if (typeof duration === \"string\")\n    duration = parseDuration(duration);\n\n  return addDuration(startingdate, { ...duration, sign: duration?.sign === \"-\" ? \"+\" : \"-\" });\n}\n\n/** Convert a flexible instant to a date\n * @param input - Date, Temporal.Instant or Temporal.ZonedDateTime value to convert\n * @returns The converted date (or null if the input is null)\n */\nexport function convertFlexibleInstantToDate(input: FlexibleInstant): Date;\nexport function convertFlexibleInstantToDate(input: null | undefined): null;\nexport function convertFlexibleInstantToDate(input: FlexibleInstant | null | undefined): Date | null;\n\nexport function convertFlexibleInstantToDate(input: FlexibleInstant | null | undefined): Date | null {\n  return input ? \"epochMilliseconds\" in input ? new Date(input.epochMilliseconds) : input : null;\n}\n\nexport function convertWaitPeriodToDate(wait: WaitPeriod, options: { relativeTo: Temporal.Instant }): Temporal.Instant;\nexport function convertWaitPeriodToDate(wait: WaitPeriod, options?: { relativeTo?: Date }): Date;\n\n/** Convert a WaitPeriod parameter to a Date\n * @param wait - Wait time as milliseconds or a Date\n * @param options - Options for conversion\n * @param options.relativeTo - Date to use as a reference for relative waits\n*/\nexport function convertWaitPeriodToDate(wait: WaitPeriod, options?: { relativeTo?: Date | Temporal.Instant }): Date | Temporal.Instant {\n  if (options?.relativeTo && isTemporalInstant(options?.relativeTo)) { //then our caller expects a Temporal.Instant\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any -- if you pass a Temporal.Instant, we should be able to create new ones from Temporal.\n    return (globalThis as any).Temporal.Instant.fromEpochMilliseconds(\n      convertWaitPeriodToDate(wait, { relativeTo: new Date(options?.relativeTo.epochMilliseconds) }).getTime()\n    );\n  }\n\n  if (isDate(wait)) {\n    return wait;\n  } else if (typeof wait === \"string\") {\n    return addDuration(convertFlexibleInstantToDate(options?.relativeTo) ?? new Date(), wait); //NOTE that \"P1D\" here adds \"24 hours\" which is *not* correct for a TimeZonedDate - which is why convertWaitPeriodToDate cannot yet accept these\n  } else if (typeof wait === \"number\") {\n    if (wait === 0)\n      return new Date(-864000 * 1000 * 10000000);\n    if (wait === Infinity)\n      return new Date(864000 * 1000 * 10000000);\n    if (wait > 0) //note: options?.relativeTo can't be instant, we already eliminated that above\n      return new Date(((options?.relativeTo as Date | undefined)?.getTime() ?? Date.now()) + wait);\n  } else if (wait && \"epochMilliseconds\" in wait) { //Instant or ZonedDateTime\n    return new Date(wait.epochMilliseconds);\n  }\n\n  throw new Error(\"Invalid wait duration - it must either be an absolute date, 0, a number of milliseconds or Infinity\");\n}\n\n/** Check whether the specified parts make a valid and reasonable (usually 1600+) date */\nexport function isValidDate(year: number, month: number, day: number, { minYear = 1601 } = {}) {\n  if (!(year >= minYear && year <= 9999 && month >= 1 && month <= 12 && day >= 1 && day <= 31\n    && Number.isSafeInteger(year) && Number.isSafeInteger(month) && Number.isSafeInteger(day)))\n    return false;\n  if ([4, 6, 9, 11].includes(month) && day > 30) //handle april, june, sep, nov\n    return false;\n  const isleapyear = (year % 400) === 0 || ((year % 100) !== 0 && (year % 4) === 0);\n  if (month === 2 && day > (isleapyear ? 29 : 28))\n    return false;\n  return true;\n}\n\n/** Check whether the specified parts make a reasonable time (does not consider the leap second a valid time) */\nexport function isValidTime(hour: number, minute: number, second: number, msec: number) {\n  return hour >= 0 && hour <= 23 && minute >= 0 && minute <= 59 && second >= 0 && second <= 59 && msec >= 0 && msec <= 999\n    && Number.isSafeInteger(hour) && Number.isSafeInteger(minute) && Number.isSafeInteger(second) && Number.isSafeInteger(msec);\n}\n\n/** Returns a string containing a formatted date and time.\n * @param format  A string that specifies the format of the output string. The string can contain the following:\n%%  Character %\n%a  Abbreviated weekday name\n%A  Full weekday name\n%b  Abbreviated month name\n%B  Full month name\n%d  Two-digit day of month (01 - 31)\n%#d Two-digit day of month, remove any leading zeros\n%H  Hour of the day, 24 hour day\n%#H Hour of the day, 24 hour day, remove any leading zeros\n%I  Two-digit hour, 12 hour day (01 - 12)\n%#I Two-digit hour, 12 hour day, remove any leading zeros\n%j  Three-digit day of year (001 - 366)\n%#j Three-digit day of year, remove any leading zeros\n%m  Two-digit month number (01 - 12)\n%#m Two-digit month number, remove any leading zeros\n%M  2-digit minute (00 - 59)\n%#M 2-digit minute, remove leading any zeros\n%Q  Three-digit millisecond (000-999)\n%#Q Three-digit millisecond, remove any leading zeros\n%p  AM or PM\n%S  Two-digit second (00 - 59)\n%#S Two-digit second, remove leading any zeros\n%V  Two-digot week number (00 - 52)\n%#V One-digit week number (0 - 52)\n%y  Two-digit year without century (00 to 99)\n%#y Two-digit year without century, remove any leading zeros\n%Y  Year with century\n%#Y Year with century, remove any leading zeros\n   @param zdt          The date/time value to format.\n   @example\n// The current date and time in German in the format: 01 Januar 2005\nconst example1 = formatDateTime(\"%d %B %Y\", Temporal.Instant.now(), { locale: \"de-DE\" });\n\n// The current day of the week in the Dutch language, using the\n// parameter datetexts as language switch.\n// The date format is <abbreviated> - <full>.\nconst example2 = formatDateTime(\"%a - %B \", new Date, { locale: \"nl-NL\" });\n*/\n\nexport function formatDateTime(format: string, zdt: Temporal.ZonedDateTime, options?: { locale: string }): string {\n  //TODO consider allowing Date & Instant too? might avoid users going for things like toString().replace(\"T\", \" \").replace(\"Z\", \"\")\n  //const zdt: Temporal.ZonedDateTime = date instanceof Date ? date.toTemporalInstant().toZonedDateTimeISO('UTC') : \"year\" in date ? date : date.toZonedDateTimeISO('UTC');\n  const locale = options?.locale || 'en-US';\n  let stripZeroes = false;\n\n  function formatNumber(num: number, length: number): string {\n    return stripZeroes ? num.toString() : num.toString().padStart(length, '0');\n  }\n\n  function formatPart(spec: string): string {\n    switch (spec) {\n      case 'a': //dayofweek name, abbreviated\n        return zdt.toLocaleString(locale, { weekday: 'short' });\n      case 'A': //dayofweek name, full\n        return zdt.toLocaleString(locale, { weekday: 'long' });\n      case 'b':  //month name, abbreviated\n        return zdt.toLocaleString(locale, { month: 'short' });\n      case 'B': //month name, abbreviated\n        return zdt.toLocaleString(locale, { month: 'long' });\n      case 'C': //century number\n        return formatNumber(Math.floor(zdt.year / 100), 2);\n      case 'd':  //day of month\n        return formatNumber(zdt.day, 2);\n      case 'H':  //hour of the day (24 hours format)\n        return formatNumber(zdt.hour, 2);\n      case 'I'://hour of the day (12 hours format)\n        return formatNumber((zdt.hour % 12) || 12, 2);\n      case 'j'://day of the year (three-digit)\n        return formatNumber(zdt.dayOfYear, 3);\n      case 'M'://two digit minute\n        return formatNumber(zdt.minute, 2);\n      case 'm'://two digit month\n        return formatNumber(zdt.month, 2);\n      case 'p'://am/pm\n        //Unfortunately this doesn't return am/pm: return zdt.toLocaleString(locale, { dayPeriod: 'narrow', hourCycle: \"h12\" });\n        return zdt.hour < 12 ? \"am\" : \"pm\";\n      case 'Q'://three digit millisecond\n        return formatNumber(Math.floor(zdt.millisecond), 3);\n      case 'S'://two digit second\n        return formatNumber(zdt.second, 2);\n      case 'V'://week number\n        if (zdt.weekOfYear === undefined)\n          throw new Error(\"Week of year is not defined for this calendar\");\n        return formatNumber(zdt.weekOfYear, 2);\n      case 'Y'://year, with century\n        return formatNumber(zdt.year, 4);\n      case 'y'://year, without century\n        return formatNumber(zdt.year % 100, 2);\n      default:\n        throw new Error(`Invalid date format specifier '%${spec}'`);\n    }\n  }\n\n  let out = '', inSpecifier = false;\n  for (const spec of [...format]) {\n    if (inSpecifier) {\n      if (spec === '#') {\n        stripZeroes = true;\n        continue; //get the next char\n      }\n\n      inSpecifier = false;\n      if (spec === '%') {\n        out += '%';\n        continue;\n      }\n      out += formatPart(spec);\n    } else {\n      if (spec === '%') {\n        inSpecifier = true;\n        stripZeroes = false; //reset it\n        continue;\n      }\n      out += spec;\n    }\n  }\n  if (inSpecifier)\n    throw new Error(\"Invalid date format string, ends with single %\");\n\n  return out;\n}\n","import { type WaitPeriod, convertWaitPeriodToDate } from \"./datetime.ts\";\nimport { isPromise } from \"./quacks.ts\";\n\n//TODO Deprecate once everyone is WH5.5+\nexport type DeferredPromise<T> = PromiseWithResolvers<T>;\n\n/** A promise that sleeps for the specified number of milliseconds\n *  @param duration - Relative (milliseconds, but not Infinity) or absolute (Date) wait duration. May not be Infinity\n *  @param options - Options - `signal` to set an AbortSignal which will cancel this sleep\n*/\nexport function sleep(duration: WaitPeriod, options?: { signal?: AbortSignal }): Promise<void> {\n  if (duration === Infinity)\n    throw new Error(`A sleep may not be infinite`);\n\n  const until = convertWaitPeriodToDate(duration);\n  return new Promise(resolve => {\n    const timeoutid = setTimeout(resolve, Math.max(0, until.getTime() - Date.now()));\n    if (options?.signal)\n      options.signal.addEventListener(\"abort\", () => clearTimeout(timeoutid));\n  });\n}\n\n/** @deprecated Use Promise.withResolvers instead */\nexport function createDeferred<T>(): PromiseWithResolvers<T> {\n  return Promise.withResolvers<T>();\n}\n\n/** Wrap a promise in a timeout\n * @param promise - Promise to wrap\n * @param timeout - Timeout in milliseconds or as a Date\n * @param rejectWith - Error to reject with if the timeout expires (string, Error, or a callback returning one)\n*/\nexport function wrapInTimeout<T>(promise: Promise<T>, timeout: WaitPeriod, rejectWith: string | Error | (() => string | Error)): Promise<T> {\n  if (timeout === Infinity)\n    return promise;\n\n  const until = convertWaitPeriodToDate(timeout);\n  const timeoutpromise = new Promise<T>((resolve, reject) => {\n    const timer = setTimeout(() => {\n      //this approach allows to delay actual Error object construction\n      const error: string | Error = typeof rejectWith === \"function\" ? rejectWith() : rejectWith;\n      reject(typeof error === \"object\" ? error : new Error(error));\n    }, until.getTime() - Date.now());\n\n    //ensure timer cancellation. No need to wait on this promise\n    promise = promise.finally(() => clearTimeout(timer));\n  });\n\n  return Promise.race([promise, timeoutpromise]);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- we need to accept any callback.\ntype CallbackFunctionVariadic<RetType> = (...args: any[]) => Promise<RetType>;\n\nexport interface SerializeOptions {\n  ///Coalescing will ignore intermediate calls if the original call has not completed yet. Eg when invoking functions 1,2,3 in succession, only 3 will run, calls 1 and 2 will be merged into that call\n  coalesce?: boolean;\n}\n\nclass Coalescer<RetVal> {\n  private queue: Array<PromiseWithResolvers<RetVal>> = [];\n  private call: CallbackFunctionVariadic<RetVal> | null = null;\n  private readonly fn: CallbackFunctionVariadic<RetVal>;\n\n  //invoke is the actual entry point for incoming calls (ie C++'s operator() )\n  readonly invoke: CallbackFunctionVariadic<RetVal>;\n\n  constructor(fn: CallbackFunctionVariadic<RetVal>) {\n    this.invoke = this.onInvoke.bind(this);\n    this.fn = fn;\n  }\n  private onInvoke(...args: unknown[]): Promise<RetVal> {\n    //overwrite the call to execute\n    this.call = () => this.fn(...args); //TODO just queueing the parameters might do?\n\n    if (!this.queue.length) //schedule a flush of the queue\n      setTimeout(() => void this.flush(), 0);\n\n    this.queue.push(Promise.withResolvers<RetVal>());\n    return this.queue[this.queue.length - 1].promise;\n  }\n\n  private async flush() {\n    for (let startpos = 0; this.queue && startpos < this.queue?.length;) {\n      const currentpos = this.queue?.length;\n\n      try {\n        //invoke the last known call. *NOTE* new calls may be added to the queue now\n        const result = await this.call!();\n        for (let i = startpos; i < currentpos; i++)\n          this.queue[i].resolve(result);\n      } catch (e) {\n        for (let i = startpos; i < currentpos; i++)\n          this.queue[i].reject(e as Error);\n      }\n      startpos = currentpos;\n    }\n    //empty the queue\n    this.queue.splice(0, this.queue.length);\n  }\n}\n\n// export function<Fn extends (...args: any[]) => Promise<any>>(fn: Fn, options?: SerializeOptions): Fn {\n// type RetVal = ReturnType<Fn>;\n\n/** Wrap a function in a serializer */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- we need to accept any callback.\nexport function wrapSerialized<Fn extends (...args: any[]) => Promise<any>>(fn: Fn, options?: SerializeOptions): Fn {\n  type RetVal = ReturnType<Fn>;\n  if (options?.coalesce)\n    return (new Coalescer<RetVal>(fn)).invoke as Fn;\n\n  let queue = Promise.resolve() as Promise<unknown>;\n  return ((...args: unknown[]): Promise<RetVal> => {\n    const res = queue.then(() => fn(...args));\n    queue = res.catch(() => { /* ignore errors */ });\n    return res;\n  }) as Fn;\n}\n\n//TODO abandon the name 'serialize' for now so it's free and safe to use once JS Decorators land (so we can use @serialize there)\n/** @deprecated Use wrapSerialized instead */\nexport function serialize<RetVal>(fn: (...args: unknown[]) => Promise<RetVal>, context: unknown) {\n  return wrapSerialized(fn, undefined);\n}\n\n/** Attempt to run code that may throw. If it throws anything, the fallback is returned\n\n   This allows you to replace:\n   ```\n   let url;\n     try {\n    url = new URL(inurl);\n  } catch (e) {\n    return null;\n  }```\n\n  with\n\n  ```\n  const url = attempt(() => new URL(inurl));\n  ```\n*/\nexport function attempt<T>(toTry: Promise<T> | (() => Promise<T>)): Promise<T | undefined>;\nexport function attempt<T, F>(toTry: Promise<T> | (() => Promise<T>), fallback: F): Promise<T | F>;\nexport function attempt<T>(toTry: () => T): T | undefined;\nexport function attempt<T, F>(toTry: () => T, fallback: F): T | F;\n\nexport function attempt<T, F>(toTry: (() => T) | Promise<T> | (() => Promise<T>), fallback?: F): T | F | Promise<T | F> {\n  try {\n    const retval = typeof toTry === \"function\" ? toTry() : toTry;\n    if (isPromise(retval))\n      return (retval as Promise<T>).catch(() => fallback as F);\n    return retval as T;\n  } catch (e) {\n    return fallback as F;\n  }\n}\n","/* A math library for safe calculation with money amounts in JS. If you don't\n   know why we need this, try to predict what the following code would print:\n   var cents=0;for(var i=0;i<100;++i)cents+=0.01;cents-=1;console.log(cents);\n   and think twice about whether you want to code anything financial in JS.\n\n   Money values supplied from HareScript should be formatted using FormatJSFinmathMoney\n*/\n\nexport type FinmathInput = string | number;\n\nexport type RoundMode = \"none\" | \"toward-zero\" | \"down\" | \"up\" | \"half-toward-zero\" | \"half-down\" | \"half-up\" | \"toward-infinity\" | \"half-toward-infinity\";\n\nexport interface SplitNumber {\n  num: number;\n  decimals: number;\n}\n\n//a 'price' is a string of the form \"nnn[.NNNN]\"\n\nfunction stripUnneededDecimals(num: number, decimals: number) {\n  //we have a maximum of 5 digits of external precision\n  if (decimals > 5) {\n    // math.round rounds toward positive infinity\n    const isneg = num < 0;\n    if (isneg)\n      num = -num;\n\n    while (decimals > 6) { //truncate excess digits\n      num = Math.floor(num / 10);\n      --decimals;\n    }\n    //round up if 6th decimal >= 5\n    num = Math.round(num / 10);\n    decimals = 5;\n\n    if (isneg)\n      num = -num;\n  }\n\n  //strip unneeded decimals\n  while (decimals > 0 && !(num % 10)) {\n    num /= 10;\n    --decimals;\n  }\n\n  return { num, decimals };\n}\n\nfunction toText(amount: SplitNumber, decimalpoint: string, mindecimals: number) {\n  if (!Number.isSafeInteger(amount.num))\n    throw new Error(\"Result would overflow the safe value range\");\n\n  let num, decimals;\n  ({ num, decimals } = stripUnneededDecimals(amount.num, amount.decimals));\n\n  // Strip sign from number, may need to prefix it\n  const isnegative = num < 0;\n  if (isnegative)\n    num = -num;\n\n  let astext = String(num);\n\n  // Ensure we have enough leading 0's to render the first integer digit\n  if (astext.length <= decimals)\n    astext = '00000000000000000000'.substr(0, decimals + 1 - astext.length) + astext;\n  // make sure we have enough 0's to show mindecimals\n  if (decimals < mindecimals) {\n    astext += '00000000000000000000'.substr(0, mindecimals - decimals);\n    decimals = mindecimals;\n  }\n\n  // insert decimal point if needed\n  if (decimals)\n    astext = astext.substr(0, astext.length - decimals) + decimalpoint + astext.substr(-decimals);\n\n  // add sign if needed\n  astext = (isnegative ? \"-\" : \"\") + astext;\n  return astext;\n}\n\n/** Convert a money of any format to a split number object\n    @param money - Either an integer number or string with a number\n    @returns Split number object\n*/\nfunction splitValue(money: FinmathInput): SplitNumber {\n  if (typeof money === 'number') {\n    if (money !== Math.floor(money))\n      throw new Error(\"Non-integer number passed\");\n    if (!Number.isSafeInteger(money))\n      throw new Error(`The value ${money} is outside the safe value range`);\n    return { num: money, decimals: 0 };\n  }\n  if (typeof money !== 'string')\n    throw new Error(\"Number or string expected, got \" + money);\n\n  const split = money.match(/^(-)?([0-9]*)(\\.([0-9]{0,5})([0-9]*))?$/);\n  if (!split)\n    throw new Error(`Illegal money value received: '${money}'`);\n\n  const sign = split[1] === '-' ? -1 : 1;\n  const decimals = split[3] ? split[4].length : 0;\n  // If there are more than 5 decimals, round up (using halfExpand strategy)\n  const num = sign * (parseInt(split[2] || \"0\") * Math.pow(10, decimals) + (parseInt((split[4] || '')) || 0) + (split[5]?.[0] >= '5' ? 1 : 0));\n  if (!Number.isSafeInteger(num))\n    throw new Error(`The value '${money}' is outside the safe value range`);\n\n  return stripUnneededDecimals(num, decimals);\n}\n\n/** Convert split number into a string\n*/\nfunction joinPrice(parts: SplitNumber): string {\n  return toText(parts, '.', 0);\n}\n\nfunction adjustDecimals(amount: SplitNumber, requiredecimals: number) {\n  const toadd = requiredecimals - amount.decimals;\n  if (toadd <= 0)\n    return;\n\n  let multiplier = 1;\n  for (let idx = 0; idx < toadd; ++idx)\n    multiplier *= 10;\n\n  if (!Number.isSafeInteger(amount.num * multiplier))\n    throw new Error(\"adjustDecimals would overflow the safe value range\");\n\n  amount.num *= multiplier;\n  amount.decimals += toadd;\n}\n\n/** Returns if a price string is valid\n*/\nexport function isValidPrice(money: string) {\n  if (typeof money !== 'string' || !money.match(/[0-9]+(\\.[0-9]{0,5})?$/))\n    return false;\n  return true;\n}\n\nfunction __add(lhs: SplitNumber, rhs: SplitNumber) {\n  //equalize # of decimals, and then it's a simple addition\n  const requiredecimals = Math.max(lhs.decimals, rhs.decimals);\n  adjustDecimals(lhs, requiredecimals);\n  adjustDecimals(rhs, requiredecimals);\n  return { num: lhs.num + rhs.num, decimals: requiredecimals };\n}\n\n/** Adds two numbers together\n*/\nexport function add(amount1: FinmathInput, amount2: FinmathInput): string {\n  return joinPrice(__add(splitValue(amount1), splitValue(amount2)));\n}\n\n/** Subtracts a number from another number\n*/\nexport function subtract(amount: FinmathInput, tosubtract: FinmathInput) {\n  const lhs = splitValue(amount), rhs = splitValue(tosubtract);\n  rhs.num = -rhs.num;\n  return joinPrice(__add(lhs, rhs));\n}\n\nfunction __multiply(lhs: SplitNumber, rhs: SplitNumber) {\n  //ADDME the naive 'add decimals, multiple nums' approach gets you out of the safe range real fast. needs tests\n  return { num: lhs.num * rhs.num, decimals: lhs.decimals + rhs.decimals };\n}\n\n/** Multiplies two numbers together\n*/\nexport function multiply(amount1: FinmathInput, amount2: FinmathInput): string {\n  const lhs = splitValue(amount1), rhs = splitValue(amount2);\n  return joinPrice(__multiply(lhs, rhs));\n}\n\n/** Compares two numbers\n    @param amount1 - Left hand value\n    @param amount2 - Right hand value\n    @returns Returns 0 if amount1 === amount2, -1 if amount1 \\< amount2, 1 if amount1 \\> amount2\n*/\nexport function cmp(amount1: FinmathInput, amount2: FinmathInput) {\n  const diff = __add(splitValue(amount1), __multiply(splitValue(amount2), { num: -1, decimals: 0 }));\n  return diff.num < 0 ? -1 : diff.num === 0 ? 0 : 1;\n}\n\n/** Returns a percentage of an amount\n    @param amount - Original amount\n    @param perc - Percentage of the amount to return\n    @returns Percentage of the amount\n*/\nexport function getPercentageOfAmount(amount: FinmathInput, perc: FinmathInput) {\n  const lhs = splitValue(amount), rhs = splitValue(perc);\n  const result = __multiply(lhs, rhs);\n  result.decimals += 2;\n  return joinPrice(normalize(result));\n}\n\nfunction normalize(amount: SplitNumber) {\n  while (amount.decimals && (amount.num % 10) === 0) {\n    amount.num /= 10;\n    --amount.decimals;\n  }\n  return amount;\n}\n\n/// format a price amount. extend # of decimals to specified # if not enough\nexport function formatPrice(money: FinmathInput, decimalpoint: string, decimals: number) {\n  return toText(splitValue(money), decimalpoint, decimals);\n}\n\n/** Rounds integer to multiple, exposed for testing only\n*/\nexport function __roundIntegerToMultiple(value: number, roundunit: number, mode: RoundMode) {\n  switch (mode) {\n    case \"none\":\n      {\n        // no rounding\n      } break;\n    case \"toward-zero\":\n      {\n        value = Math.trunc(value / roundunit) * roundunit;\n      } break;\n    case \"toward-infinity\":\n      {\n        if (value > 0)\n          value = Math.trunc((value + roundunit - 1) / roundunit) * roundunit;\n        else\n          value = Math.trunc((value - roundunit + 1) / roundunit) * roundunit;\n      } break;\n    case \"down\":\n      {\n        if (value > 0)\n          value = Math.trunc(value / roundunit) * roundunit;\n        else\n          value = Math.trunc((value - roundunit + 1) / roundunit) * roundunit;\n      } break;\n    case \"up\":\n      {\n        if (value > 0)\n          value = Math.trunc((value + roundunit - 1) / roundunit) * roundunit;\n        else\n          value = Math.trunc(value / roundunit) * roundunit;\n      } break;\n    case \"half-toward-zero\":\n      {\n        if (value > 0)\n          value = Math.trunc((value + (roundunit - 1) / 2) / roundunit) * roundunit;\n        else\n          value = Math.trunc((value - (roundunit - 1) / 2) / roundunit) * roundunit;\n      } break;\n    case \"half-toward-infinity\":\n      {\n        if (value > 0)\n          value = Math.trunc((value + roundunit / 2) / roundunit) * roundunit;\n        else\n          value = Math.trunc((value - roundunit / 2) / roundunit) * roundunit;\n      } break;\n    case \"half-down\":\n      {\n        if (value > 0)\n          value = Math.trunc((value + (roundunit - 1) / 2) / roundunit) * roundunit;\n        else\n          value = Math.trunc((value - roundunit / 2) / roundunit) * roundunit;\n      } break;\n    case \"half-up\":\n      {\n        if (value > 0)\n          value = Math.trunc((value + roundunit / 2) / roundunit) * roundunit;\n        else\n          value = Math.trunc((value - (roundunit - 1) / 2) / roundunit) * roundunit;\n      } break;\n    default:\n      {\n        throw new Error(`Unknown rounding mode ${mode}`);\n      }\n  }\n  return value;\n}\n\n/** Rounds a value to a multiple of a unit, with a specific rounding mode\n    @param value - Value to round\n    @param unit - The value will be rounded to a mulitple of this unit (except when rounding mode is 'none')\n    @param mode - Rounding mode. Possible values:\n      <ul>\n        <li>none: No rounding</li>\n        <li>toward-zero: Round toward zero</li>\n        <li>down: Round toward negative infity</li>\n        <li>up: Round toward positive infity</li>\n        <li>half-toward-zero: Round nearest multiple, round half of a multiple toward zero</li>\n        <li>half-down: Round nearest multiple, round half of a multiple toward negative infinity</li>\n        <li>half-up: Round nearest multiple, round half of a multiple toward positive infity</li>\n      </ul>\n    @returns The rounded value\n*/\nexport function roundToMultiple(value: FinmathInput, unit: FinmathInput, mode: RoundMode) {\n  const split_value = splitValue(value);\n  const split_unit = splitValue(unit);\n\n  const requiredecimals = Math.max(split_value.decimals, split_unit.decimals);\n  adjustDecimals(split_value, requiredecimals);\n  adjustDecimals(split_unit, requiredecimals);\n\n  const result = { num: __roundIntegerToMultiple(split_value.num, split_unit.num, mode), decimals: split_value.decimals };\n  return joinPrice(result);\n}\n\n/** Returns the minimum of all the arguments\n    @param amount - First value\n    @param amounts - Rest of the values\n    @returns The lowest value among amount and amounts\n*/\nexport function min(amount: FinmathInput, ...amounts: FinmathInput[]) {\n  for (const val of amounts)\n    if (cmp(amount, val) > 0)\n      amount = val;\n  return joinPrice(splitValue(amount));\n}\n\n/** Returns the maximum of all the arguments\n    @param amount - First value\n    @param amounts - Rest of the values\n    @returns The highest value among amount and amounts\n*/\nexport function max(amount: FinmathInput, ...amounts: FinmathInput[]) {\n  for (const val of amounts)\n    if (cmp(amount, val) < 0)\n      amount = val;\n  return joinPrice(splitValue(amount));\n}\n\n/** Returns a power of 10\n    @param exp - Integer power, must be 0 or bigger\n    @returns Requested power of 10\n*/\nfunction getNonNegativePowerOf10(exp: number) {\n  let retval = 1, running_exp = 10;\n  while (exp) {\n    if (exp & 1)\n      retval *= running_exp;\n    running_exp *= running_exp;\n    exp = exp >> 1;\n  }\n  return retval;\n}\n\n/** Divides two values, with 5 decimals of precision\n    @param value - Value To divide\n    @param divisor - Divisor\n    @returns Divided value, with 5 decimals of precision\n*/\nexport function divide(value: FinmathInput, divisor: FinmathInput) {\n  const lhs = splitValue(value), rhs = splitValue(divisor);\n  const mul10exp = lhs.decimals - rhs.decimals - 5;\n  const mulfactor = mul10exp < 0 ? getNonNegativePowerOf10(-mul10exp) : 1;\n  const roundunit = mul10exp > 0 ? getNonNegativePowerOf10(mul10exp) : 1;\n  return joinPrice({ num: __roundIntegerToMultiple(mulfactor * lhs.num / rhs.num, roundunit, \"half-toward-infinity\"), decimals: 5 });\n}\n\nexport function moneyDivide(value: FinmathInput, divisor: FinmathInput) { //divide was added in 5.0. remove this old name eventually\n  return divide(value, divisor);\n}\n\n/** Test whether two values have a specific relation\n    @param lhs - Left hand value\n    @param relation - One of '\\<', '\\<=', '==', '!=', '\\>', '\\>=''\n    @param rhs - Right hand value\n    @returns TRUE if the relation holds\n    @example\n      console.log(finmath.test(1, '\\<', 2)); // prints 'true'\n*/\nexport function test(lhs: FinmathInput, relation: \"<\" | \"<=\" | \"==\" | \"!=\" | \">\" | \">=\", rhs: FinmathInput) {\n  const compareresult = cmp(lhs, rhs);\n  switch (relation) {\n    case '<': return compareresult < 0;\n    case '<=': return compareresult <= 0;\n    case '==': return compareresult === 0;\n    case '!=': return compareresult !== 0;\n    case '>': return compareresult > 0;\n    case '>=': return compareresult >= 0;\n  }\n  throw Error(`Cannot test for unknown relation '${relation}'`);\n}\n","/* A Money type library for safe calculation with money amounts in JS. If you don't\n   know why we need this, try to predict what the following code would print:\n   var cents=0;for(var i=0;i<100;++i)cents+=0.01;cents-=1;console.log(cents);\n   and think twice about whether you want to code anything financial in JS.\n\n   We haven't decideded yet what range Money should support. To keep our options open and keep HS compatbility for now\n   we will fix ourselves to 5 digits (HS compat) and not allow values bigger than 900_000_000 (2**53 / 100000 'number' compatbiility clamped to a more readable number)\n\n  Users should not rely on JS Money keeping this smaller range in the future. Money values supplied from HareScript should be formatted using FormatJSFinmathMoney\n*/\n\nimport * as finmath from \"./finmath.ts\"; //TODO absorb into us as soon as noone externally depends on finmath anymore\nimport { isMoney } from \"./quacks.ts\";\n\nexport type MoneyRoundingMode = \"none\" | \"toward-zero\" | \"down\" | \"up\" | \"half-toward-zero\" | \"half-down\" | \"half-up\" | \"toward-infinity\" | \"half-toward-infinity\";\nexport type MoneyTestTypes = \"<\" | \"<=\" | \"==\" | \"!=\" | \">\" | \">=\";\n\ntype MoneyParameter = Money | string;\n\ninterface SplitNumber {\n  num: number;\n  decimals: number;\n}\n\nexport interface MoneyFormatOptions {\n  //thousand separator. defaults to \"\"\n  thousandsSeparator?: string;\n  //decimal separator. defaults to \".\"\n  decimalSeparator?: string;\n  //minimum # of decimals. defaults to 2\n  minDecimals?: number;\n}\n\nfunction stripUnneededDecimals(num: number, decimals: number) {\n  //we have a maximum of 5 digits of external precision\n  if (decimals > 5) {\n    // math.round rounds toward positive infinity\n    const isneg = num < 0;\n    if (isneg)\n      num = -num;\n\n    while (decimals > 6) { //truncate excess digits\n      num = Math.floor(num / 10);\n      --decimals;\n    }\n    //round up if 6th decimal >= 5\n    num = Math.round(num / 10);\n    decimals = 5;\n\n    if (isneg)\n      num = -num;\n  }\n\n  //strip unneeded decimals\n  while (decimals > 0 && !(num % 10)) {\n    num /= 10;\n    --decimals;\n  }\n\n  return { num, decimals };\n}\n\n/** Convert a money of any format to a split number object\n    @param money - Either an integer number or string with a number\n    @returns Split number object\n*/\nfunction splitValue(money: MoneyParameter): SplitNumber {\n  if (typeof money === 'number') {\n    if (money !== Math.floor(money))\n      throw new Error(\"Non-integer number passed\");\n    if (!Number.isSafeInteger(money))\n      throw new Error(`The value ${money} is outside the safe value range`);\n    return { num: money, decimals: 0 };\n  }\n  if (typeof money !== 'string')\n    throw new Error(\"Number or string expected, got \" + money);\n\n  const split = money.match(/^(-)?([0-9]*)(\\.([0-9]{0,5})([0-9]*))?$/);\n  if (!split)\n    throw new Error(`Illegal money value received: '${money}'`);\n\n  const sign = split[1] === '-' ? -1 : 1;\n  const decimals = split[3] ? split[4].length : 0;\n  // If there are more than 5 decimals, round up (using halfExpand strategy)\n  const num = sign * (parseInt(split[2] || \"0\") * Math.pow(10, decimals) + (parseInt((split[4] || '')) || 0) + (split[5]?.[0] >= '5' ? 1 : 0));\n  if (!Number.isSafeInteger(num))\n    throw new Error(`The value '${money}' is outside the safe value range`);\n\n  return stripUnneededDecimals(num, decimals);\n}\n\nfunction toText(amount: SplitNumber, decimalpoint: string, mindecimals: number, thousandpoint: string) {\n  if (!Number.isSafeInteger(amount.num))\n    throw new Error(\"Result would overflow the safe value range\");\n\n  let { num, decimals } = stripUnneededDecimals(amount.num, amount.decimals);\n\n  // Strip sign from number, may need to prefix it\n  const isnegative = num < 0;\n  if (isnegative)\n    num = -num;\n\n  let astext = String(num);\n\n  // Ensure we have enough leading 0's to render the first integer digit\n  if (astext.length <= decimals)\n    astext = '00000000000000000000'.substring(0, decimals + 1 - astext.length) + astext;\n  // make sure we have enough 0's to show mindecimals\n  if (decimals < mindecimals) {\n    astext += '00000000000000000000'.substring(0, mindecimals - decimals);\n    decimals = mindecimals;\n  }\n\n  let beforepoint = astext.substring(0, astext.length - decimals);\n  const afterpoint = astext.substring(astext.length - decimals);\n\n  // Add thouands points if neeed\n  if (thousandpoint)\n    beforepoint = beforepoint.replaceAll(/\\B(?=(\\d{3})+(?!\\d))/g, thousandpoint);\n\n  return (isnegative ? \"-\" : \"\") + beforepoint + (afterpoint.length ? decimalpoint + afterpoint : \"\");\n}\n\n/** A decimal based JS money type*/\nexport class Money {\n  /** finmath-compatible value */\n  readonly value: string;\n  private static \"__ $whTypeSymbol\" = \"Money\";\n\n  constructor(value: MoneyParameter = \"0\") {\n    this.value = Money.parseParameter(value);\n\n    const intvalue = parseInt(this.value);\n    //We need the number to be in the safe range even after adding 5 decimals\n    if (intvalue <= (Number.MIN_SAFE_INTEGER / 100000) || intvalue >= (Number.MAX_SAFE_INTEGER / 100000))\n      throw new TypeError(`Money value '${value}' is out of range`);\n  }\n\n  private static parseParameter(param: MoneyParameter): string {\n    if (typeof param === \"string\")\n      return toText(splitValue(param), \".\", 0, \"\");\n    if (Money.isMoney(param))\n      return (param as unknown as { value: string }).value;\n\n    throw new TypeError(`Money cannot be constructed out of a value of type ${typeof param}`);\n  }\n\n  static isMoney(value: unknown): value is Money {\n    return isMoney(value);\n  }\n\n  static fromNumber(value: number): Money {\n    return new Money(String(value));\n  }\n\n  /** Adds numbers together\n  */\n  static add(left: MoneyParameter, ...right: MoneyParameter[]): Money {\n    let sum = Money.parseParameter(left);\n    for (const item of right)\n      sum = finmath.add(sum, Money.parseParameter(item));\n    return new Money(sum);\n  }\n\n  /** Subtracts a number from another number\n  */\n  static subtract(left: MoneyParameter, right: MoneyParameter): Money {\n    return new Money(finmath.subtract(Money.parseParameter(left), Money.parseParameter(right)));\n  }\n\n  /** Rounds a value to a multiple of a unit, with a specific rounding mode\n      @param amount - Value to round\n      @param roundto - The value will be rounded to a mulitple of this unit (except when rounding mode is 'none')\n      @param mode - Rounding mode. Possible values:<br>\n        <ul>\n          <li>none: No rounding</li>\n          <li>toward-zero: Round toward zero</li>\n          <li>down: Round toward negative infity</li>\n          <li>up: Round toward positive infity</li>\n          <li>half-toward-zero: Round nearest multiple, round half of a multiple toward zero</li>\n          <li>half-down: Round nearest multiple, round half of a multiple toward negative infinity</li>\n          <li>half-up: Round nearest multiple, round half of a multiple toward positive infity</li>\n        </ul>\n      @returns The rounded value\n  */\n  static roundToMultiple(amount: MoneyParameter, roundto: MoneyParameter, mode: MoneyRoundingMode): Money {\n    return new Money(finmath.roundToMultiple(Money.parseParameter(amount), Money.parseParameter(roundto), mode));\n  }\n\n  /** Compares two numbers\n      @param lhs - Left hand value\n      @param rhs - Right hand value\n      @returns Returns 0 if amount1 === amount2, -1 if amount1 \\< amount2, 1 if amount1 \\> amount2\n  */\n  static cmp(lhs: MoneyParameter, rhs: MoneyParameter): -1 | 0 | 1 {\n    return finmath.cmp(Money.parseParameter(lhs), Money.parseParameter(rhs));\n  }\n\n  /** Test whether two values have a specific relation\n      @param lhs - Left hand value\n      @param relation - One of '\\<', '\\<=', '==', '!=', '\\>', '\\>=''\n      @param rhs - Right hand value\n      @returns TRUE if the relation holds\n      @example\n        console.log(Money.check(1, '\\<', 2)); // prints 'true'\n  */\n  static check(lhs: MoneyParameter, relation: MoneyTestTypes, rhs: MoneyParameter): boolean {\n    return finmath.test(Money.parseParameter(lhs), relation, Money.parseParameter(rhs));\n  }\n\n  /** Multiplies two numbers together\n  */\n  static multiply(left: MoneyParameter, right: MoneyParameter): Money {\n    return new Money(finmath.multiply(Money.parseParameter(left), Money.parseParameter(right)));\n  }\n\n  /** Returns a percentage of an amount\n      @param amount - Original amount\n      @param percentage - Percentage of the amount to return\n      @returns Percentage of the amount\n  */\n  static getPercentage(amount: MoneyParameter, percentage: MoneyParameter): Money {\n    return new Money(finmath.getPercentageOfAmount(Money.parseParameter(amount), Money.parseParameter(percentage)));\n  }\n\n  /** Divides two values, (currently with up to 5 decimals of precision)\n      @param numerator - Value to divide\n      @param divisor - Divisor\n      @returns Divided value\n  */\n  static divide(numerator: MoneyParameter, divisor: MoneyParameter): Money {\n    return new Money(finmath.divide(Money.parseParameter(numerator), Money.parseParameter(divisor)));\n  }\n  /** Returns the minimum of all the arguments\n      @param amount - First value\n      @param amounts - Rest of the values\n      @returns The lowest value among amount and amounts\n  */\n  static min(amount: MoneyParameter, ...amounts: MoneyParameter[]): Money {\n    return new Money(finmath.min(Money.parseParameter(amount), ...(amounts.map(Money.parseParameter))));\n\n  }\n\n  /** Returns the maximum of all the arguments\n      @param amount - First value\n      @param amounts - Rest of the values\n      @returns The highest value among amount and amounts\n  */\n  static max(amount: MoneyParameter, ...amounts: MoneyParameter[]): Money {\n    return new Money(finmath.max(Money.parseParameter(amount), ...(amounts.map(Money.parseParameter))));\n  }\n\n  /** format a price amount. extend # of decimals to specified # if not enough */\n  format(format?: MoneyFormatOptions): string {\n    return toText(splitValue(this.value),\n      format?.decimalSeparator ?? \".\",\n      format?.minDecimals ?? 2,\n      format?.thousandsSeparator ?? \"\");\n  }\n\n  toJSON(): string {\n    return this.value;\n  }\n\n  toString(): string {\n    return this.value;\n  }\n\n  toNumber(): number {\n    return parseFloat(this.value);\n  }\n}\n","import { Money } from \"./money.ts\";\nimport { isBlob, isDate, isMoney, isPromise, isTemporalInstant, isTemporalPlainDate, isTemporalPlainDateTime, isTemporalPlainTime, isTemporalZonedDateTime, stdTypeOf } from \"./quacks.ts\";\n\n/// Returns T or a promise resolving to T\nexport type MaybePromise<T> = Promise<T> | T;\n\nexport type ComparableType = number | null | bigint | string | Date | Money | boolean | Uint8Array | Temporal.Instant | Temporal.PlainDate | Temporal.PlainTime | Temporal.ZonedDateTime;\n\ntype CamelCase<S extends string> = S extends `${infer P1}_${infer P2}${infer P3}`\n  ? `${Lowercase<P1>}${Uppercase<P2>}${CamelCase<P3>}`\n  : Lowercase<S>;\n\ntype KeysToCamelCase<T> = {\n  [K in keyof T as CamelCase<string & K>]: ToCamelCase<T[K]>;\n};\n\ntype CamelToSnakeCase<S extends string> = S extends `${infer T}${infer U}` ?\n  `${T extends Capitalize<T> ? \"_\" : \"\"}${Lowercase<T>}${CamelToSnakeCase<U>}` :\n  S;\n\ntype KeysToSnakeCase<T> = {\n  [K in keyof T as CamelToSnakeCase<string & K>]: ToSnakeCase<T[K]>\n};\n\ntype NonRecordTypes = Date | Money | Blob | Temporal.Instant | Temporal.PlainDate | Temporal.PlainDateTime | Temporal.ZonedDateTime;\n\nexport type ToSnakeCase<T> =\n  T extends unknown[] ? Array<ToSnakeCase<T[number]>> :\n  T extends NonRecordTypes ? T :\n  T extends object ? KeysToSnakeCase<T> :\n  T;\n\nexport type ToCamelCase<T> =\n  T extends unknown[] ? Array<ToCamelCase<T[number]>> :\n  T extends NonRecordTypes ? T :\n  T extends object ? KeysToCamelCase<T> :\n  T;\n\n/** Convert a snake_case_name to its corresponding camelCaseName\n * @param name - Name to convert\n * @returns Converted name\n*/\nexport function nameToCamelCase(name: string) {\n  return name.replaceAll(/_[a-z]/g, c => c[1].toUpperCase());\n}\n\n/** Convert a camelCaseName to corresponding snake_case_name\n * @param name - Name to convert\n * @returns Converted name\n*/\nexport function nameToSnakeCase(name: string) {\n  return name.replaceAll(/[A-Z]/g, c => '_' + c.toLowerCase());\n}\n\n/// Should we rewrite the key/values in this object?\nfunction recodeObject(inp: object) {\n  return !isDate(inp) && !isMoney(inp) && !isBlob(inp) && !isTemporalInstant(inp) && !isTemporalPlainDate(inp) && !isTemporalPlainDateTime(inp) && !isTemporalZonedDateTime(inp);\n}\n\nfunction recursiveToSnakeCase<T>(inp: T): ToSnakeCase<T> {\n  if (Array.isArray(inp))\n    return inp.map(toSnakeCase) as ToSnakeCase<T>;\n  if (inp && typeof inp === \"object\" && recodeObject(inp))\n    return Object.fromEntries(Object.entries(inp).map(([key, value]) => [nameToSnakeCase(key), recursiveToSnakeCase(value)])) as ToSnakeCase<T>;\n  return inp as ToSnakeCase<T>;\n}\n\nfunction recursiveToCamelCase<T>(inp: T): ToCamelCase<T> {\n  if (Array.isArray(inp))\n    return inp.map(toCamelCase) as ToCamelCase<T>;\n  if (inp && typeof inp === \"object\" && recodeObject(inp))\n    return Object.fromEntries(Object.entries(inp).map(([key, value]) => [nameToCamelCase(key), recursiveToCamelCase(value)])) as ToCamelCase<T>;\n  return inp as ToCamelCase<T>;\n}\n\n/** Convert all keys to camel case recursively\n * @param inp - Array or object to convert\n * @returns Converted object\n*/\nexport function toSnakeCase<T extends object | object[] | null | undefined>(inp: T): ToSnakeCase<T> {\n  return recursiveToSnakeCase(inp);\n}\n\n/** Convert all keys to snake case recursively\n * @param inp - Array or object to convert\n * @returns Converted object\n*/\nexport function toCamelCase<T extends object | object[] | null | undefined>(inp: T): ToCamelCase<T> {\n  return recursiveToCamelCase(inp);\n}\n\n// TODO make this a quack if we're sure Uint8array is what we want to support - this is here basically to give Buffer support to be compatible with hscompat' compare\nfunction isUInt8Array(value: unknown): value is Uint8Array {\n  return value !== null && typeof value === \"object\" && \"length\" in value && (value as Uint8Array).BYTES_PER_ELEMENT === 1;\n}\n\ntype AwaitedValues<T extends readonly unknown[]> = { -readonly [K in keyof T]: Awaited<T[K]> };\n\n/** Resolve an array of potential promises, returning an array with resolved results\n * @param array - Array of values or promises\n * @returns An array of resolved values, or a promise resolving to that array if any input was a promise\n*/\nexport function maybePromiseAll<const T extends readonly unknown[]>(array: T): MaybePromise<AwaitedValues<T>> {\n  const resolved: Array<Awaited<T[number]>> = [];\n  for (const item of array) {\n    if (isPromise(item))\n      return Promise.all(array) as Promise<AwaitedValues<T>>;\n    resolved.push(item as Awaited<T[number]>);\n  }\n  return resolved as AwaitedValues<T>;\n}\n\n/** Call a function on the value of a potential promise, return the result\n * @param value - Value or promise\n * @param cb - Callback to call on the value\n * @returns The result of the callback, or a promise resolving to that result if the input was a promise\n*/\nexport function mapMaybePromise<T, U>(value: T, cb: (arg: Awaited<T>) => U): U | Promise<U> {\n  return isPromise(value) ? value.then(t => cb(t as Awaited<T>)) : cb(value as Awaited<T>);\n}\n\n/** Compare two values of std-supported types\n * @param left - First value\n * @param right - Second value\n * @returns -1 if left \\< right, 0 if equal, 1 if left \\> right\n */\nexport function compare(left: ComparableType, right: ComparableType): -1 | 0 | 1 {\n  if (left === null)\n    return right === null ? 0 : -1;\n  else if (right === null)\n    return 1;\n\n  switch (typeof left) {\n    case \"boolean\": {\n      if (typeof right === \"boolean\")\n        return left !== right ? left < right ? -1 : 1 : 0;\n    } break;\n    case \"number\": {\n      switch (typeof right) {\n        case \"bigint\": {\n          const right_number = Number(right);\n          return left !== right_number ? left < right_number ? -1 : 1 : 0;\n        }\n        case \"number\": {\n          return left !== right ? left < right ? -1 : 1 : 0;\n        }\n        case \"object\": {\n          if (Money.isMoney(right))\n            return Money.cmp(left.toString(), right);\n        }\n      }\n    } break;\n    case \"bigint\": {\n      switch (typeof right) {\n        case \"bigint\": {\n          return left !== right ? left < right ? -1 : 1 : 0;\n        }\n        case \"number\": {\n          const left_number = Number(left);\n          return left_number !== right ? left_number < right ? -1 : 1 : 0;\n        }\n        case \"object\": {\n          if (Money.isMoney(right)) {\n            return Money.cmp(left.toString(), right);\n          }\n        }\n      }\n    } break;\n    case \"string\": {\n      if (typeof right === \"string\")\n        return left === right ? 0 : left < right ? -1 : 1;\n    } break;\n    case \"object\": {\n      if (Money.isMoney(left)) {\n        switch (typeof right) {\n          case \"number\":\n          case \"bigint\":\n            return Money.cmp(left, right.toString());\n          case \"object\": {\n            if (right === null) {\n              return 1;\n            } else if (Money.isMoney(right))\n              return Money.cmp(left, right);\n          }\n        }\n      } else if (isDate(left)) {\n        if (isTemporalInstant(right)) {\n          const left_value = Number(left);\n          const right_value = right.epochMilliseconds;\n          return left_value !== right_value ? left_value < right_value ? -1 : 1 : 0;\n        } else if (isDate(right)) {\n          const left_value = Number(left);\n          const right_value = Number(right);\n          return left_value !== right_value ? left_value < right_value ? -1 : 1 : 0;\n        }\n      } else if (isUInt8Array(left) && isUInt8Array(right)) {\n        const compareLength = Math.min(left.length, right.length);\n        for (let i = 0; i < compareLength; i++) {\n          if (left[i] !== right[i])\n            return left[i] < right[i] ? -1 : 1;\n        }\n        return left.length !== right.length ? left.length < right.length ? -1 : 1 : 0;\n      } else if (isTemporalInstant(left)) {\n        if (isDate(right)) {\n          const left_value = left.epochMilliseconds;\n          const right_value = Number(right);\n          return left_value !== right_value ? left_value < right_value ? -1 : 1 : 0;\n        } else if (isTemporalInstant(right)) {\n          const left_value = left.epochMilliseconds;\n          const right_value = right.epochMilliseconds;\n          return left_value !== right_value ? left_value < right_value ? -1 : 1 : 0;\n        }\n      } else if (isTemporalPlainDate(left) && isTemporalPlainDate(right)) {\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any -- we're not loading Temporal types when packaging @webhare/std separately\n        return (globalThis as any).Temporal.PlainDate.compare(left, right);\n      } else if (isTemporalPlainTime(left) && isTemporalPlainTime(right)) {\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any -- we're not loading Temporal types when packaging @webhare/std separately\n        return (globalThis as any).Temporal.PlainTime.compare(left, right);\n      } else if (isTemporalZonedDateTime(left) && isTemporalZonedDateTime(right)) {\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any -- we're not loading Temporal types when packaging @webhare/std separately\n        return (globalThis as any).Temporal.ZonedDateTime.compare(left, right);\n      }\n    } break;\n  }\n  throw new Error(`Cannot compare a ${stdTypeOf(left)} with a ${stdTypeOf(right)}`);\n}\n\n/** Returns all property keys of an object type whose value is comparable */\ntype ComparableFields<E extends object, K extends keyof E = keyof E> = K extends keyof E ? E[K] extends ComparableType ? K : never : never;\n\n/** Type of array elements for keys in `compareProperties` */\ntype ComparePropertiesArrayElement<E extends object> = ComparableFields<E> | [ComparableFields<E>, \"asc\" | \"desc\"];\n\n/** All possible types of object keys */\ntype AnyKey = string | symbol | number;\n\n/** Extracts the property name from an array element of CompareProperties */\ntype GetPropertyFromComparePropertiesArrayElement<T> = T extends AnyKey ? T : T extends [infer A, \"asc\" | \"desc\"] ? A : never;\n\n/** Get the list of properties referenced in the `compareProperties` keys list */\ntype GetPropertiesFromComparePropertiesKeys<K extends AnyKey | Array<AnyKey | [AnyKey, \"asc\" | \"desc\"]>> = K extends AnyKey ? K : K extends Array<infer T> ? GetPropertyFromComparePropertiesArrayElement<T> : never;\n\n/** Get all proper prefixes of a tuple, excluding the empty tuple and the source tuple */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype TuplePrefixes<K extends AnyKey | [...any[]]> = K extends [any] ? never : K extends [infer A, ...infer B] ? [A] | [A, ...TuplePrefixes<B>] : never;\n\n/** Template for possible keys value (needed to make TS understand that a tuple prefix of the keys is also a valid keys list */\ntype PossibleFields<E extends object> = ComparableFields<E> | [ComparePropertiesArrayElement<E>, ...Array<ComparePropertiesArrayElement<E>>];\n\n/**\n * Build a comparator function for objects using one or more comparable properties.\n * This is extremely useful as a type-safe comparator for sort/toSorted APIs, especially\n * when dealing with multiple or non-string keys.\n *\n * Keys can be provided as:\n * - a single property key\n * - a tuple/array of keys\n * - a tuple/array with sort direction entries in the form [key, \"asc\" | \"desc\"]\n *\n * Comparison is performed in order until the first non-zero result.\n *\n * @param fields - Field selector(s) defining compare priority and optional direction.\n * @returns A compare callback suitable for Array.prototype.sort, extended with\n * `partialCompare(...)` to create a comparator for a prefix of the same key sequence.\n * @throws Error if any configured property is undefined on either compared object.\n * @example\n * ```ts\n * const byName = compareProperties(\"name\");\n * users.sort(byName);\n * ```\n *\n * @example\n * ```ts\n * const byPriorityThenDate = compareProperties([\n *   [\"priority\", \"desc\"],\n *   [\"createdAt\", \"asc\"]\n * ] as const);\n * items.sort(byPriorityThenDate);\n * ```\n *\n * @example\n * ```ts\n * const byCountryCityStreet = compareProperties([\"country\", \"city\", \"street\"] as const);\n * const byCountryCity = byCountryCityStreet.partialCompare([\"country\", \"city\"] as const);\n * addresses.sort(byCountryCity);\n * ```\n */\nexport function compareProperties<const K extends ComparableFields<E> | [...Array<ComparePropertiesArrayElement<E>>], E extends object = Record<GetPropertiesFromComparePropertiesKeys<K>, ComparableType>>(fields: K) {\n  const compareList = (Array.isArray(fields) ? fields : [fields]).map((field): [keyof E, 1 | -1] => Array.isArray(field) ? [field[0], field[1] === \"desc\" ? -1 : 1] : [field, 1]);\n  const retval: (lhs: E, rhs: E) => number = (a, b) => {\n    for (const [field, negate] of compareList) {\n      if (a[field] === undefined || b[field] === undefined)\n        throw new Error(`Property '${String(field)}' does not exist`);\n      const res = negate * compare(a[field] as ComparableType, b[field] as ComparableType);\n      if (res)\n        return res;\n    }\n    return 0;\n  };\n  return Object.assign(retval, {\n    partialCompare: <T extends TuplePrefixes<K> & PossibleFields<E>>(partialFields: T) => compareProperties<T, E>(partialFields)\n  });\n}\n\nlet enumReverseMaps: WeakMap<Record<string, string | number>, Record<string | number, string>> | undefined;\n\ntype EnumEntries<T extends Record<string, string | number>, F extends number, K extends keyof T = keyof T> = K extends keyof T ? T[K] extends F ? [K, T[K]] : never : never;\n\n/** Returns the reverse mapping of a value of an const object used as enum. Can only be used for numbers.\n * @param enumObj - The enum object to reverse map.\n * @param value - The value to look up in the reverse map.\n * @returns The key corresponding to the given value in the enum object.\n * @example\n * ```ts\n * const Color = {\n *   Red: 1,\n *   Green: 2,\n *   Blue: 3\n * } as const;\n * const key = enumReverseMap(Color, 2); // \"Green\"\n * ```\n */\nexport function enumReverseMap<const T extends Record<string, string | number>, const V extends EnumEntries<T, number>[1]>(enumObj: T, value: V): EnumEntries<T, V>[0] {\n  enumReverseMaps ??= new WeakMap<Record<string, string | number>, Record<string | number, string>>();\n  let reverse = enumReverseMaps.get(enumObj);\n  if (!reverse) {\n    reverse = {} as Record<string | number, string>;\n    for (const [key, v] of Object.entries(enumObj))\n      if (typeof v === \"number\")\n        reverse[enumObj[key]] = key;\n    enumReverseMaps.set(enumObj, reverse);\n  }\n  return reverse[value];\n}\n","import { stdTypeOf } from \"./quacks.ts\";\nimport { Money } from \"./money.ts\";\n\nexport type WildcardTypes = \"?*\";\n\n/** Encode string for use in a regexp\n * @param text - Text to encode\n * @param options - Options for encoding\n * @param options.wildcards - Type of wildcards to encode (defaults to none)\n * @returns Encoded for safe use in a RegExp\n*/\nexport function escapeRegExp(text: string, options?: { wildcards?: WildcardTypes }): string {\n  let mask = text.replaceAll(/[/\\-\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'); // $& means the whole matched string\n  if (options?.wildcards === \"?*\") {\n    mask = mask.replaceAll(\"\\\\*\", \".*\");\n    mask = mask.replaceAll(\"\\\\?\", \".\");\n  }\n  return mask;\n}\n\n/** Create a regular expression from one or more wildcard masks\n * @param masks - One or more masks with '?' and/or '*' wildcards\n * @returns Regular expression string\n*/\nexport function regExpFromWildcards(masks: string | string[], options?: { wildcards?: WildcardTypes; caseInsensitive?: boolean }): RegExp {\n  if (Array.isArray(masks) && masks.length === 0)\n    throw new Error(\"Empty mask list\");\n\n  const code = Array.isArray(masks)\n    ? `^(${masks.map(mask => escapeRegExp(mask, { wildcards: options?.wildcards || \"?*\" })).join('|')})$`\n    : `^${escapeRegExp(masks, { wildcards: options?.wildcards || \"?*\" })}$`;\n  return new RegExp(code, options?.caseInsensitive ? \"i\" : undefined);\n}\n\nfunction isHTMLUnrepresentableChar(curch: number) {\n  return (curch < 32 && curch !== 9 && curch !== 10 && curch !== 13)\n    || (curch >= 128 && curch <= 159);\n}\n\nfunction encodeEntities(str: string, html: boolean) {\n  let s = \"\";\n  for (const char of str) {\n    const curch = char.codePointAt(0);\n    if (curch === undefined || isHTMLUnrepresentableChar(curch))\n      continue;\n    if (curch >= 32 && curch < 128 && curch !== 38 && curch !== 60 && curch !== 62 && (html || curch !== 34 && curch !== 39)) {\n      s += String.fromCodePoint(curch);\n      continue;\n    }\n\n    switch (curch) {\n      case 10:\n        {\n          if (html) {\n            s += \"<br>\";\n            continue;\n          }\n          break;\n        }\n      case 13:\n        {\n          if (html)\n            continue;\n          break;\n        }\n      case 34:\n        {\n          s += \"&quot;\";\n          continue;\n        }\n      case 38:\n        {\n          s += \"&amp;\";\n          continue;\n        }\n      case 39:\n        {\n          s += \"&apos;\";\n          continue;\n        }\n      case 60:\n        {\n          s += \"&lt;\";\n          continue;\n        }\n      case 62:\n        {\n          s += \"&gt;\";\n          continue;\n        }\n    }\n\n    s += \"&#\" + curch + \";\";\n  }\n  return s;\n}\n\nfunction decodeEntities(str: string, html: boolean) {\n  if (html)\n    str = str.replace(/<br *\\/?>/g, \"\\n\");\n\n  str = str.replace(/&#(\\d+);/g, (_, dec) => String.fromCharCode(dec))\n    .replace(/&lt;/g, \"<\")\n    .replace(/&gt;/g, \">\")\n    .replace(/&quot;/g, '\"')\n    .replace(/&apos;/g, \"'\")\n    .replace(/&amp;/g, \"&\");\n\n  return str;\n}\n\nexport type StringEncodings = \"base64url\" | \"attribute\" | \"html\";\n\nexport function encodeString(str: string, encoding: StringEncodings): string {\n  if (encoding === \"base64url\")\n    return btoa(str).replaceAll(\"=\", \"\").replaceAll(\"+\", \"-\").replaceAll(\"/\", \"_\");\n  if (encoding === \"attribute\")\n    return encodeEntities(str, false);\n  if (encoding === \"html\")\n    return encodeEntities(str, true);\n\n  throw new Error(`Invalid encoding '${encoding}'`);\n}\n\nexport function decodeString(str: string, encoding: StringEncodings): string {\n  if (encoding === \"base64url\")\n    return atob(str.replaceAll(\"-\", \"+\").replaceAll(\"_\", \"/\"));\n  if (encoding === \"attribute\")\n    return decodeEntities(str, false);\n  if (encoding === \"html\")\n    return decodeEntities(str, true);\n\n  throw new Error(`Invalid encoding '${encoding}'`);\n}\n\ntype JSONReplacerArgument = ((this: unknown, key: string, value: unknown) => unknown) | undefined;\n\nexport interface StringifyOptions {\n  replacer?: JSONReplacerArgument;\n  space?: string | number;\n  stable?: boolean;\n  ///Encode with types (preserve Money, Date, BigInt). Needs std.parseTyped\n  typed?: boolean;\n  ///What to target: string (like JSON.stringify), script (escapes '/') or attribute (escapes '/' and applies attribute encoding)\n  target?: \"string\" | \"script\" | \"attribute\";\n}\n\n/** Improved JSON encoder\n * @param arg - Object to encode\n * @param options - Encoding options\n*/\nexport function stringify(arg: unknown, options?: StringifyOptions) {\n  const usereplacer: JSONReplacerArgument = options?.stable || options?.typed ? (function (this: unknown, key: string, value: unknown) {\n    if (options.typed) {\n      const origvalue = (this as Record<string, unknown>)[key]; //We can't use 'value' as .toJSON() will already have been invoked\n      const type = stdTypeOf(origvalue);\n      switch (type) {\n        case \"function\":\n          throw new Error(`Cannot stringify property '${key}' of type \"${type}'`);\n        case \"Date\":\n          value = { \"$stdType\": \"Date\", date: (origvalue as Date).toISOString() };\n          break;\n        case \"Money\":\n        case \"bigint\":\n        case \"Instant\":\n        case \"PlainDate\":\n        case \"PlainTime\":\n        case \"PlainDateTime\":\n        case \"ZonedDateTime\":\n          value = { \"$stdType\": type, [type.toLowerCase()]: (origvalue as { toString: () => string }).toString() };\n          break;\n        case \"object\":\n          if (\"$stdType\" in (origvalue as { \"$stdType\": string }))\n            throw new Error(`Cannot encode objects with already embedded '$stdType's`);\n        //fallthrough\n      }\n    }\n    if (options.stable && value && typeof value === \"object\" && !Array.isArray(value))\n      value = Object.fromEntries(Object.entries(value).sort((lhs, rhs) => lhs < rhs ? -1 : lhs === rhs ? 0 : 1));\n    if (options.replacer)\n      value = options.replacer.call(this, key, value);\n    return value;\n  }) : options?.replacer ?? undefined;\n\n  let result = JSON.stringify(arg, usereplacer, options?.space);\n  if (options?.target && [\"script\", \"attribute\"].includes(options.target)) {\n    result = result.replaceAll(\"/\", \"\\\\/\");\n    if (options.target === \"attribute\")\n      result = encodeEntities(result, false);\n  }\n  return result;\n}\n\n/** Decode JSON with types (Generated using stringify with typed:true ) */\nexport function parseTyped(input: string) {\n  return JSON.parse(input, (key, value) => {\n    switch (value?.[\"$stdType\"]) {\n      case \"Money\":\n        return new Money(value.money);\n      case \"Date\":\n        return new Date(value.date);\n      case \"bigint\":\n      case \"BigInt\": //pre wh5.7 spelling\n        return BigInt(value.bigint as string);\n      case \"Instant\":\n      case \"PlainDate\":\n      case \"PlainTime\":\n      case \"PlainDateTime\":\n      case \"ZonedDateTime\":\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any -- we just assume/require you to have Temporal installed if you expect to receive/decode Temporal types. browsers should catch up eventually\n        if (!(globalThis as any).Temporal)\n          throw new Error(`Temporal is not available in this environment, cannot deserialize value of type Temporal.${value[\"$stdType\"]}. Load eg. @webhare/deps/temporal-polyfill to use Temporal types in browsers`);\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any -- we just assume/require you to have Temporal installed if you expect to receive/decode Temporal types. browsers should catch up eventually\n        return (globalThis as any).Temporal[value[\"$stdType\"]].from(value[value[\"$stdType\"].toLowerCase()]);\n      case undefined:\n        return value;\n      default:\n        throw new Error(`Unrecognized type '${value[\"$stdType\"]}'`);\n    }\n  });\n}\n\n/** Generate a slug from a (suggested) (file)name\n * @param text - Text to convert\n * @param options - Options for slugification\n * @param options.separator - Separator to use between words (defaults to '-')\n * @param options.keep - Set of characters to keep in addition to a-z0-9\n * @returns Slugified text or null if we couldn't generate anything reeadable\n */\nexport function slugify(text: string, { separator = \"-\", keep = \"\" }: {\n  separator?: string;\n  keep?: string;\n} = {}): string | null {\n  //This function mixes HS getSafeName with a few more modern approaches\n  const keepclass = `[^a-z0-9${escapeRegExp(keep)}]`;\n  text = text\n    .normalize('NFD')                   // split an accented letter in the base letter and the acent\n    // eslint-disable-next-line no-control-regex\n    .replaceAll(/[\\u0000-\\u001F]/g, '')\n    .replaceAll(/[\\u0300-\\u036f]/g, '')   // remove all previously split accents\n    .replaceAll(/ß/g, 'ss')               // german ss\n    .toLowerCase()\n    .replace(new RegExp(`^${keepclass}+`), \"\") //replace bad characters at the start\n    .replace(new RegExp(`${keepclass}+$`), \"\") //.. and end\n    .replaceAll(new RegExp(`${keepclass}+`, \"g\"), separator); // replace all non alphanumeric/space with a single dash\n\n  return text || null; //we return 'null' on purpose so callers realize we won't necessarily give them a string!\n}\n\n/** Check if an email address is valid in modern times (an emailcheck much closer to what a browser would do, with additional sanity checks. No attempt to allow all legacy styles supported by the RFCs but 99.9%+ sure to be an error if seen submitted in a form\n    @returns True if the email address appears to be a well-formed email address to a non-greybeard\n*/\nexport function isValidEmail(email: string): boolean {\n  if (email.length > 254) //TODO count bytes instead of characters\n    return false;\n\n  return /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]{1,64}@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*(?:\\.[a-zA-Z0-9-]{2,})$/.test(email);\n}\n\n/** Uppercases a string using the C-locale (so only the ASCII characters a-z are uppercased)\n * @param str - String to uppercase\n * @returns Uppercased string\n */\nexport function toCLocaleUppercase(str: string) {\n  return str.replaceAll(/[a-z]+/g, part => part.toUpperCase());\n}\n\n/** Lowercases a string using the C-locale (so only the ASCII characters A-Z are lowercased)\n * @param str - String to lowercase\n * @returns Lowercased string\n */\nexport function toCLocaleLowercase(str: string) {\n  return str.replaceAll(/[A-Z]+/g, part => part.toLowerCase());\n}\n\n/** Calculate the levenshtein distance between two strings */\nexport function levenshteinDistance(a: string, b: string): number {\n  /* calculateLevenshteinDistance is adopted from https://github.com/gustf/js-levenshtein/blob/master/index.js, licensed MIT © Gustaf Andersson\n    Picked over fastest-levenshtein because a permanent 256KB memory area for a bit more speed doesn't seem worth it\n  */\n  function _min(d0: number, d1: number, d2: number, bx: number, ay: number) {\n    return d0 < d1 || d2 < d1\n      ? d0 > d2\n        ? d2 + 1\n        : d0 + 1\n      : bx === ay\n        ? d1\n        : d1 + 1;\n  }\n\n  if (a === b) {\n    return 0;\n  }\n\n  if (a.length > b.length) {\n    const tmp = a;\n    a = b;\n    b = tmp;\n  }\n\n  let la = a.length;\n  let lb = b.length;\n\n  while (la > 0 && (a.charCodeAt(la - 1) === b.charCodeAt(lb - 1))) {\n    la--;\n    lb--;\n  }\n\n  let offset = 0;\n\n  while (offset < la && (a.charCodeAt(offset) === b.charCodeAt(offset))) {\n    offset++;\n  }\n\n  la -= offset;\n  lb -= offset;\n\n  if (la === 0 || lb < 3) {\n    return lb;\n  }\n\n  let x = 0;\n  let y, d0, d1, d2, d3, dd = 0, dy, ay, bx0, bx1, bx2, bx3;\n\n  const vector: number[] = [];\n\n  for (y = 0; y < la; y++) {\n    vector.push(y + 1);\n    vector.push(a.charCodeAt(offset + y));\n  }\n\n  const len = vector.length - 1;\n\n  for (; x < lb - 3;) {\n    bx0 = b.charCodeAt(offset + (d0 = x));\n    bx1 = b.charCodeAt(offset + (d1 = x + 1));\n    bx2 = b.charCodeAt(offset + (d2 = x + 2));\n    bx3 = b.charCodeAt(offset + (d3 = x + 3));\n    dd = (x += 4);\n    for (y = 0; y < len; y += 2) {\n      dy = vector[y];\n      ay = vector[y + 1];\n      d0 = _min(dy, d0, d1, bx0, ay);\n      d1 = _min(d0, d1, d2, bx1, ay);\n      d2 = _min(d1, d2, d3, bx2, ay);\n      dd = _min(d2, d3, dd, bx3, ay);\n      vector[y] = dd;\n      d3 = d2;\n      d2 = d1;\n      d1 = d0;\n      d0 = dy;\n    }\n  }\n\n  for (; x < lb;) {\n    bx0 = b.charCodeAt(offset + (d0 = x));\n    dd = ++x;\n    for (y = 0; y < len; y += 2) {\n      dy = vector[y];\n      vector[y] = dd = _min(dy, d0, dd, bx0, vector[y + 1]);\n      d0 = dy;\n    }\n  }\n\n  return dd;\n}\n\n/** Return the length of the string in bytes when UTF-8 encoded */\nexport function getUTF8Length(str: string) {\n  return new TextEncoder().encode(str).length;\n}\n\n/** Truncate the string so it's at most len UTF-8 bytes long */\nexport function limitUTF8Length(str: string, len: number) {\n  // TextEncoder.encodeInto writes into the given array until there's no more room to add more valid UTF-8 sequences from the\n  // source. We can use this property to limit the number of bytes by creating an array that has room for at most the given\n  // number of bytes.\n  const utf8array = new Uint8Array(len);\n  // This function returns the actual number of bytes written to the array\n  const { written } = new TextEncoder().encodeInto(str, utf8array);\n  // Decode only the actually written bytes\n  return new TextDecoder().decode(utf8array.subarray(0, written));\n}\n\n/** Update the search parameters in a URL\n * @param inUrl - URL to update\n * @param updates - Updates to apply, use 'null' to delete a variable\n * @returns Updated URL\n */\nexport function updateURL(inUrl: string | URL, updates: Record<string, string | null>): URL {\n  const u = new URL(inUrl);\n  for (const [k, v] of Object.entries(updates)) {\n    if (v === null) {\n      u.searchParams.delete(k);\n    } else {\n      u.searchParams.set(k, v);\n    }\n  }\n  return u;\n}\n","/** Test whether a string looks like a valid random id */\nexport function isLikeRandomId(input: string): boolean { //TODO add encoding parameter/bytes support ?\n  return Boolean(input.match(/^[A-Za-z0-9_-]{22}$/));\n}\n\n/** Test whether a string is a valid hex UUID\n * @param input - uuid in hex format to verify. you may need to lowercase the uuid first\n * @param format - optional, if set to \"v4\" it will only accept UUIDv4 format\n*/\nexport function isValidUUID(input: string, format?: \"v4\"): boolean {\n  //we'll require you to lowercase the uuid first to increase the chance that you'll actually be storing/matching it in lowercase too\n\n  if (format === \"v4\")\n    return Boolean(input.match(/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/));\n  else if (format !== undefined)\n    throw new Error(`Unsupported format '${format}'`);\n  else\n    return Boolean(input.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/));\n}\n\n/** Generate a configurable random id (the default settings, base64url and 16 bytes, match HareScript's GenerateUFS128BitId)\n * @param encoding - Encoding to use, base64url, hex or uuidv4. Default is base64url\n * @param bytes - Number of bytes to generate. Default is 16\n * @returns An encoded ID. With the default settings it will be a url (and filename) safe string of 22 characters in length\n */\nexport function generateRandomId(encoding: \"base64url\" | \"hex\" | \"uuidv4\" = \"base64url\", bytes: number = 16): string {\n  if (encoding === \"uuidv4\") {\n    if (bytes !== 16)\n      throw new Error(\"UUIDv4 encoding only supports 16 bytes\");\n\n    if (crypto.randomUUID) //NOTE: not available in non-secure contexts so the fallback can never go away\n      return crypto.randomUUID();\n  }\n\n  const u8array = new Uint8Array(bytes);\n  crypto.getRandomValues(u8array);\n\n  if (encoding === \"uuidv4\") {\n    u8array[6] = (u8array[6] & 0x0f) | 0x40;\n    u8array[8] = (u8array[8] & 0x3f) | 0x80;\n    return [...u8array.values()].map(x => x.toString(16).padStart(2, \"0\")).join(\"\").replace(/^(.{8})(.{4})(.{4})(.{4})(.{12})$/, \"$1-$2-$3-$4-$5\");\n  }\n\n  if (encoding === \"base64url\")\n    return btoa(String.fromCharCode.apply(null, u8array as unknown as number[])).replaceAll(\"=\", \"\").replaceAll(\"+\", \"-\").replaceAll(\"/\", \"_\");\n\n  if (encoding === \"hex\")\n    return [...u8array.values()].map(x => x.toString(16).padStart(2, \"0\")).join(\"\");\n\n  throw new Error(`Invalid encoding '${encoding}'`);\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any -- Cannot specify this without using any */\n\nexport interface EmplaceHandler<ValueType> {\n  insert?: () => ValueType;\n  update?: (current: ValueType) => ValueType;\n}\n\nfunction binarySearchImpl<A, K>(compareFn: (element: A, key: K) => number, contents: A[], searchfor: K, upper_bound: boolean): { present: boolean; index: number } {\n  let first = 0;\n  let len = contents.length;\n  let present = false;\n\n  const cmpbound = upper_bound ? 1 : 0;\n  let unsorted_cmp = 0; // if this is non-0 and cmp is this value, we have an unsorted list\n  while (len > 0) {\n    const half = Math.floor(len / 2);\n    const middle = first + half;\n    const cmp = compareFn(contents[middle], searchfor);\n    if (cmp === 0) {\n      present = true;\n      unsorted_cmp = upper_bound ? -1 : 1;\n    } else if (cmp === unsorted_cmp)\n      throw new Error(`The provided array was not properly sorted!`);\n\n    if (cmp < cmpbound) {\n      first = middle + 1;\n      len -= half;\n      --len;\n    } else {\n      len = half;\n    }\n  }\n  return { present, index: first };\n}\n\n//emplace is based on https://github.com/tc39/proposal-upsert (a Map.prototype.emplace)\n/** Place a value into a Map\n * @param map - The map to place the value into\n * @param key - The key to add/replace\n * @param handler - Callbacks for inserting or updating the value\n * @returns The value that was placed into the map.\n * @throws If the key is not found and no insert handler is provided\n */\nexport function emplace<T extends Map<any, any> | WeakMap<any, any>>(\n  map: T,\n  key: T extends Map<infer K, any> ? K : T extends WeakMap<infer K, any> ? K : never,\n  handler?: T extends Map<any, infer V> ? EmplaceHandler<V> : T extends WeakMap<any, infer V> ? EmplaceHandler<V> : never):\n  T extends Map<any, infer V> ? V : T extends WeakMap<any, infer V> ? V : never {\n  let current = map.get(key);\n  if (current !== undefined) {\n    if (handler?.update) {\n      current = handler.update(current);\n      map.set(key, current);\n    }\n    return current;\n  }\n\n  if (!handler?.insert)\n    throw new Error(\"Key not found and no insert handler provided\");\n\n  const setvalue = handler.insert();\n  map.set(key, setvalue);\n  return setvalue;\n}\n\n// the `| keyof X` is needed to be able to use a `keyof X` type as key parameter in DistributedPick or DistributedOmit in generics\nexport type DistributedKeys<X extends object> = (X extends object ? keyof X : never) | keyof X;\n\n/** Applies Pick to all types in a union. Allows all keys that are present in any object in the union. Warning: You might not be\n    able to use all keys of the union if TypeScript has narrowed the union to a specific type. Eg:\n```typescript\ntype A = { x: number; t: \"a\"; a: number } | { x: number; t: \"b\"; b: number };\nconst a: A = { t: \"a\", a: 1 };\nconst b = pick(a, [\"t\", \"a\", \"b\"]); // No overload matches this call. <snip> Type '\"b\"' is not assignable to type '\"a\" | \"t\" | \"d\"'.\n```\n    @typeParam T - Type of the supplied object\n    @typeParam K - Type of the property keys to return\n    @returns Type with only the specified keys (distributed over the union if present)\n*/\nexport type DistributedPick<X extends object, Y extends DistributedKeys<X>> = X extends object ? Pick<X, keyof X & Y> : never;\n\n/** Applies Omit to all types in a union. Allows all keys that are not present in any object in the union. Warning: You might not be\n    able to use all keys of the union if TypeScript has narrowed the union to a specific type. Eg:\n```typescript\ntype A = { x: number; t: \"a\"; a: number } | { x: number; t: \"b\"; b: number };\nconst a: A = { t: \"a\", a: 1 };\nconst b = omit(a, [\"b\"]); // No overload matches this call. <snip> Type '\"b\"' is not assignable to type '\"a\" | \"t\" | \"d\"'.\n```\n    @typeParam T - Type of the supplied object\n    @typeParam K - Type of the property keys to leave out\n    @returns Type with only the specified keys left out (distributed over the union if present)\n*/\nexport type DistributedOmit<X extends object, Y extends DistributedKeys<X>> = X extends object ? Omit<X, keyof X & Y> : never;\n\n/** Returns an object with a selection of properties\n    @typeParam T - Type of the supplied object\n    @typeParam K - Type of the property keys to return\n    @param obj - Object to pick properties out of\n    @param keys - Names of the properties to pick\n    @returns Resulting object\n*/\nexport function pick<T extends object, K extends string & NoInfer<DistributedKeys<T>>>(obj: T, keys: readonly K[]): DistributedPick<T, K>;\n\n/** Returns an array with a selection of properties\n    @typeParam T - Type of the supplied array\n    @typeParam K - Type of the property keys to return\n    @param arr - Array to pick properties out of\n    @param keys - Names of the properties to pick\n    @returns Resulting array\n*/\nexport function pick<T extends object, K extends string & NoInfer<DistributedKeys<T>>>(arr: T[], keys: readonly K[]): Array<DistributedPick<T, K>>;\n\nexport function pick<T extends object, K extends string & NoInfer<DistributedKeys<T>>>(value: T | T[], keys: readonly K[]): DistributedPick<T, K> | Array<DistributedPick<T, K>> {\n  if (Array.isArray(value))\n    return value.map((elt: T) => pick(elt, keys));\n  const ret = {} as T;\n  keys.forEach((key: K) => {\n    if (key in value)\n      ret[key] = value[key];\n  });\n  return ret as object as DistributedPick<T, K>;\n}\n\n/** Returns an object with a selection of properties left out\n    @typeParam T - Type of the supplied object\n    @typeParam K - Type of the property keys to leave out\n    @param obj - Object to leave properties out of\n    @param keys - Names of the properties to remove\n    @returns Resulting object\n*/\nexport function omit<T extends object, K extends string & NoInfer<DistributedKeys<T>>>(obj: T, keys: readonly K[]): DistributedOmit<T, K>;\n\n/** Returns an array with a selection of properties left out\n    @typeParam T - Type of the supplied array\n    @typeParam K - Type of the property keys to leave out\n    @param arr - Array to leave properties out of\n    @param keys - Names of the properties to leave out\n    @returns Resulting array\n*/\nexport function omit<T extends object, K extends string & NoInfer<DistributedKeys<T>>>(arr: T[], keys: readonly K[]): Array<DistributedOmit<T, K>>;\n\nexport function omit<T extends object, K extends string & NoInfer<DistributedKeys<T>>>(value: T | T[], keys: readonly K[]): DistributedOmit<T, K> | Array<DistributedOmit<T, K>> {\n  if (Array.isArray(value))\n    return value.map((elt: T) => omit(elt, keys));\n  const ret = {} as T;\n  for (const [key, val] of Object.entries(value)) {\n    if (!keys.includes(key as K))\n      ret[key as K] = val;\n  }\n  return ret as object as DistributedOmit<T, K>;\n}\n\n/** Shuffle an array in-place\n * @param array - Array to shuffle\n * @returns The shuffled array\n*/\nexport function shuffle<T>(array: T[]): T[] {\n  for (let i = array.length - 1; i > 0; i--) {\n    const j = Math.floor(Math.random() * (i + 1));\n    [array[i], array[j]] = [array[j], array[i]];\n  }\n  return array;\n}\n\n/** Returns (and TypeScript-asserts) that the specified function is truthy. Handy for adjusting the type of an array when\n * filtering out falsy values\n * @example\n * const myarray: Array&lt;number | null&gt; = [0, null];\n * const filtered: number[] = myarray.filter(isTruthy);\n **/\nexport function isTruthy<T>(a: T): a is (T & {}) {\n  return Boolean(a);\n}\n\n/** Append to array, without overflowing the stack (eg V8 overflows at more than 32K entries)\n * @param array - Array to append to\n * @param values - Values to append\n*/\nexport function appendToArray<T>(array: T[], values: ReadonlyArray<NoInfer<T>>): void {\n  if (values.length < 1000)\n    array.push(...values); //push should be safe enough\n  else for (const value of values) //performance wise this appears just as fast as tricks with pushing blocks of slices\n    array.push(value);\n\n  //not returning the original array to make it clear we're not creating a new one\n}\n\ntype TypedEntriesInternal<T extends object, K extends keyof T> = K extends keyof T ? [K, T[K]] : never;\n\n/** Returns a union of [ key, value ] types for an object */\nexport type TypedEntries<T extends object> = T extends object ? TypedEntriesInternal<T, keyof T & string> : never;\n\n/** Returns an array of key/values of the enumerable own properties of an object, with exact types. Use when\n * no extra properties are expected on the object. Exists because Object.entries returns always string as key type.\n * @param obj - Object that contains the properties and methods\n */\nexport function typedEntries<T extends object>(obj: T): Array<TypedEntries<T>> {\n  return Object.entries(obj) as Array<TypedEntries<T>>;\n}\n\n/** Returns an array of keys of the enumerable own properties of an object, with exact types. Use when\n * no extra properties are expected on the object. Exists because Object.keys returns always string as key type.\n * @param obj - Object that contains the properties and methods\n */\nexport function typedKeys<T extends object>(obj: T): Array<keyof T & string> {\n  return Object.keys(obj) as Array<keyof T & string>;\n}\n\n/** Given a union of [key, value] types, returns the object constructed from those pairs. Exists because\n *  Object.fromEntries does not take the type of the keys and values into account.\n * @typeParam T - Union of [key, value] pairs\n */\nexport type TypedFromEntries<T extends [string, unknown]> = { [C in T as C[0]]: C[1] };\n\n/** Returns an object from an iterable of [key, value] pairs, with exact types. Exists because Object.fromEntries\n * doesn't take the type of the keys and values into account.\n * @param entries - Iterable of [key, value] pairs\n * @returns An object with the same keys and values as the input\n */\nexport function typedFromEntries<T extends [string, unknown]>(entries: Iterable<T>): TypedFromEntries<T> {\n  return Object.fromEntries(entries) as TypedFromEntries<T>;\n}\n\n\nexport class SortedMultiSet<V> {\n  private contents: V[] = [];\n  private compareFn;\n\n  constructor(compareFn: (lhs: V, rhs: V) => number, contents?: V[]) {\n    this.compareFn = compareFn;\n    if (contents)\n      this.addMultiple(contents);\n  }\n\n  get size() {\n    return this.contents.length;\n  }\n\n  at(index: number): V | undefined {\n    return this.contents.at(index);\n  }\n\n  add(value: V): number {\n    const pos = this.upperBound(value);\n    this.contents.splice(pos, 0, value);\n    return pos;\n  }\n\n  addMultiple(values: V[]): void {\n    for (const value of values) {\n      this.add(value);\n    }\n  }\n\n  delete(key: V): void {\n    const [start, limit] = this.range(key);\n    this.contents.splice(start, limit - start);\n  }\n\n  clear() {\n    this.contents.splice(0, this.contents.length);\n  }\n\n  lowerBound(key: Readonly<V>): { present: boolean; index: number } {\n    return binarySearchImpl(this.compareFn, this.contents, key, false);\n  }\n\n  upperBound(key: Readonly<V>): number {\n    return binarySearchImpl(this.compareFn, this.contents, key, true).index;\n  }\n\n  range(key: Readonly<V>): [number, number] {\n    return [this.lowerBound(key).index, this.upperBound(key)];\n  }\n\n  slice(start: number, limit: number): V[] {\n    return this.contents.slice(start, limit);\n  }\n\n  *#sliceIterator(start: number, limit: number): Generator<V, void> {\n    for (let idx = start; idx < limit; ++idx)\n      yield this.contents[idx];\n  }\n\n  sliceRange(key: Readonly<V>): V[] {\n    const [start, limit] = this.range(key);\n    return this.slice(start, limit);\n  }\n\n  rangeIterator(key: Readonly<V>): Iterable<V> {\n    const [start, limit] = this.range(key);\n    return this.#sliceIterator(start, limit);\n  }\n}\n\nexport class SortedMultiMap<K, V> {\n  private compareFn;\n  private contents: Array<[K, V]> = [];\n\n  constructor(compareFn: (lhs: K, rhs: K) => number, contents?: Array<[K, V]>) {\n    this.compareFn = (element: [K, V], key: K) => compareFn(element[0], key);\n    if (contents)\n      this.addMultiple(contents);\n  }\n\n  get size() {\n    return this.contents.length;\n  }\n\n  at(index: number): [K, V] | undefined {\n    return this.contents.at(index);\n  }\n\n  add(key: K, value: V): number {\n    const pos = this.upperBound(key);\n    this.contents.splice(pos, 0, [key, value]);\n    return pos;\n  }\n\n  addMultiple(values: Array<[K, V]>) {\n    for (const [key, value] of values) {\n      this.add(key, value);\n    }\n  }\n\n  delete(key: K): void {\n    const [start, limit] = this.range(key);\n    this.contents.splice(start, limit - start);\n  }\n\n  clear() {\n    this.contents.splice(0, this.contents.length);\n  }\n\n  lowerBound(key: Readonly<K>): { present: boolean; index: number } {\n    return binarySearchImpl(this.compareFn, this.contents, key, false);\n  }\n\n  upperBound(key: Readonly<K>): number {\n    return binarySearchImpl(this.compareFn, this.contents, key, true).index;\n  }\n\n  range(key: Readonly<K>): [number, number] {\n    return [this.lowerBound(key).index, this.upperBound(key)];\n  }\n\n  slice(start: number, limit: number): Array<[K, V]> {\n    return this.contents.slice(start, limit);\n  }\n\n  *#sliceIterator(start: number, limit: number): Generator<[K, V], void> {\n    for (let idx = start; idx < limit; ++idx)\n      yield this.contents[idx];\n  }\n\n  sliceRange(key: Readonly<K>): Array<[K, V]> {\n    const [start, limit] = this.range(key);\n    return this.slice(start, limit);\n  }\n\n  rangeIterator(key: Readonly<K>): Iterable<[K, V]> {\n    const [start, limit] = this.range(key);\n    return this.#sliceIterator(start, limit);\n  }\n}\n","import { isPromise } from \"./quacks.ts\";\n\nfunction propagateAbort(signal: AbortSignal, cb: ((reason: typeof signal[\"reason\"]) => void) | AbortController) {\n  if (signal.aborted) {\n    if (\"abort\" in cb)\n      cb.abort(signal.reason);\n    else\n      cb(signal.reason);\n  } else signal.addEventListener(\"abort\", () => {\n    if (\"abort\" in cb)\n      cb.abort(signal.reason);\n    else\n      cb(signal.reason);\n  });\n}\n\nexport type AbortSignals = Iterable<AbortSignal | Promise<AbortSignal> | undefined | null> | AbortSignal | Promise<AbortSignal> | null | undefined;\n\n/** Calls the callback when any of the passed abort signals is (or already was) aborted. Use\n * this instead of addEventListener when it is possible that any of the abortsignals was already aborted.\n*/\nexport function whenAborted(signals: AbortSignals, cb: ((reason: AbortSignal[\"reason\"]) => void) | AbortController): void {\n  propagateAbort(combineAbortSignals(signals), cb);\n}\n\n/** Combines abort signals (or promises for abort signals) into one abort signal. More generic version of AbortSignal.any() */\nexport function combineAbortSignals(signals: AbortSignals): AbortSignal {\n  if (!signals || !(Symbol.iterator in signals))\n    signals = [signals];\n  const abortController = new AbortController;\n  for (const signal of signals) {\n    if (signal) {\n      if (\"then\" in signal) {\n        // Convert promise errors to abort\n        void signal.then(s => propagateAbort(s, abortController), e => abortController.abort(e));\n      } else\n        propagateAbort(signal, abortController);\n    }\n  }\n  return abortController.signal;\n}\n\n/** Returns a signal that can be used like `using signal = getScopeSignal()` and will be aborted when going out of scope */\nexport function getScopeSignal(): AbortSignal & { [Symbol.dispose](): void } {\n  const ctrl = new AbortController();\n  const signal = ctrl.signal as AbortSignal & { [Symbol.dispose](): void };\n  signal[Symbol.dispose] = () => ctrl.abort();\n  return signal;\n}\n\ntype PipeReturn<PFinal, PAll extends readonly unknown[]> = Extract<PAll[number], Promise<unknown>> extends never ? PFinal : Promise<Awaited<PFinal>>;\n\n/** @hidden */\nexport function pipe<P1>(f1: P1 | ((a: void) => P1)): PipeReturn<P1, [P1]>;\nexport function pipe<P1, P2>(f1: P1 | ((a: void) => P1), f2: (b: Awaited<P1>) => P2): PipeReturn<P2, [P1, P2]>;\nexport function pipe<P1, P2, P3>(f1: P1 | ((a: void) => P1), f2: (b: Awaited<P1>) => P2, f3: (c: Awaited<P2>) => P3): PipeReturn<P3, [P1, P2, P3]>;\nexport function pipe<P1, P2, P3, P4>(f1: P1 | ((a: void) => P1), f2: (b: Awaited<P1>) => P2, f3: (c: Awaited<P2>) => P3, f4: (d: Awaited<P3>) => P4): PipeReturn<P4, [P1, P2, P3, P4]>;\nexport function pipe<P1, P2, P3, P4, P5>(f1: P1 | ((a: void) => P1), f2: (b: Awaited<P1>) => P2, f3: (c: Awaited<P2>) => P3, f4: (d: Awaited<P3>) => P4, f5: (e: Awaited<P4>) => P5): PipeReturn<P5, [P1, P2, P3, P4, P5]>;\nexport function pipe<P1, P2, P3, P4, P5, P6>(f1: P1 | ((a: void) => P1), f2: (b: Awaited<P1>) => P2, f3: (c: Awaited<P2>) => P3, f4: (d: Awaited<P3>) => P4, f5: (e: Awaited<P4>) => P5, f6: (f: Awaited<P5>) => P6): PipeReturn<P6, [P1, P2, P3, P4, P5, P6]>;\nexport function pipe<P1, P2, P3, P4, P5, P6, P7>(f1: P1 | ((a: void) => P1), f2: (b: Awaited<P1>) => P2, f3: (c: Awaited<P2>) => P3, f4: (d: Awaited<P3>) => P4, f5: (e: Awaited<P4>) => P5, f6: (f: Awaited<P5>) => P6, f7: (g: Awaited<P6>) => P7): PipeReturn<P7, [P1, P2, P3, P4, P5, P6, P7]>;\nexport function pipe<P1, P2, P3, P4, P5, P6, P7, P8>(f1: P1 | ((a: void) => P1), f2: (b: Awaited<P1>) => P2, f3: (c: Awaited<P2>) => P3, f4: (d: Awaited<P3>) => P4, f5: (e: Awaited<P4>) => P5, f6: (f: Awaited<P5>) => P6, f7: (g: Awaited<P6>) => P7, f8: (h: Awaited<P7>) => P8): PipeReturn<P8, [P1, P2, P3, P4, P5, P6, P7, P8]>;\nexport function pipe<P1, P2, P3, P4, P5, P6, P7, P8, P9>(f1: P1 | ((a: void) => P1), f2: (b: Awaited<P1>) => P2, f3: (c: Awaited<P2>) => P3, f4: (d: Awaited<P3>) => P4, f5: (e: Awaited<P4>) => P5, f6: (f: Awaited<P5>) => P6, f7: (g: Awaited<P6>) => P7, f8: (h: Awaited<P7>) => P8, f9: (i: Awaited<P8>) => P9): PipeReturn<P9, [P1, P2, P3, P4, P5, P6, P7, P8, P9]>;\nexport function pipe<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10>(f1: P1 | ((a: void) => P1), f2: (b: Awaited<P1>) => P2, f3: (c: Awaited<P2>) => P3, f4: (d: Awaited<P3>) => P4, f5: (e: Awaited<P4>) => P5, f6: (f: Awaited<P5>) => P6, f7: (g: Awaited<P6>) => P7, f8: (h: Awaited<P7>) => P8, f9: (i: Awaited<P8>) => P9, f10: (j: Awaited<P9>) => P10): PipeReturn<P10, [P1, P2, P3, P4, P5, P6, P7, P8, P9, P10]>;\nexport function pipe<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11>(f1: P1 | ((a: void) => P1), f2: (b: Awaited<P1>) => P2, f3: (c: Awaited<P2>) => P3, f4: (d: Awaited<P3>) => P4, f5: (e: Awaited<P4>) => P5, f6: (f: Awaited<P5>) => P6, f7: (g: Awaited<P6>) => P7, f8: (h: Awaited<P7>) => P8, f9: (i: Awaited<P8>) => P9, f10: (j: Awaited<P9>) => P10, f11: (k: Awaited<P10>) => P11): PipeReturn<P11, [P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11]>;\nexport function pipe<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12>(f1: P1 | ((a: void) => P1), f2: (b: Awaited<P1>) => P2, f3: (c: Awaited<P2>) => P3, f4: (d: Awaited<P3>) => P4, f5: (e: Awaited<P4>) => P5, f6: (f: Awaited<P5>) => P6, f7: (g: Awaited<P6>) => P7, f8: (h: Awaited<P7>) => P8, f9: (i: Awaited<P8>) => P9, f10: (j: Awaited<P9>) => P10, f11: (k: Awaited<P10>) => P11, f12: (l: Awaited<P11>) => P12): PipeReturn<P12, [P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12]>;\nexport function pipe<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13>(f1: P1 | ((a: void) => P1), f2: (b: Awaited<P1>) => P2, f3: (c: Awaited<P2>) => P3, f4: (d: Awaited<P3>) => P4, f5: (e: Awaited<P4>) => P5, f6: (f: Awaited<P5>) => P6, f7: (g: Awaited<P6>) => P7, f8: (h: Awaited<P7>) => P8, f9: (i: Awaited<P8>) => P9, f10: (j: Awaited<P9>) => P10, f11: (k: Awaited<P10>) => P11, f12: (l: Awaited<P11>) => P12, f13: (m: Awaited<P12>) => P13): PipeReturn<P13, [P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13]>;\nexport function pipe<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14>(f1: P1 | ((a: void) => P1), f2: (b: Awaited<P1>) => P2, f3: (c: Awaited<P2>) => P3, f4: (d: Awaited<P3>) => P4, f5: (e: Awaited<P4>) => P5, f6: (f: Awaited<P5>) => P6, f7: (g: Awaited<P6>) => P7, f8: (h: Awaited<P7>) => P8, f9: (i: Awaited<P8>) => P9, f10: (j: Awaited<P9>) => P10, f11: (k: Awaited<P10>) => P11, f12: (l: Awaited<P11>) => P12, f13: (m: Awaited<P12>) => P13, f14: (n: Awaited<P13>) => P14): PipeReturn<P14, [P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14]>;\nexport function pipe<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15>(f1: P1 | ((a: void) => P1), f2: (b: Awaited<P1>) => P2, f3: (c: Awaited<P2>) => P3, f4: (d: Awaited<P3>) => P4, f5: (e: Awaited<P4>) => P5, f6: (f: Awaited<P5>) => P6, f7: (g: Awaited<P6>) => P7, f8: (h: Awaited<P7>) => P8, f9: (i: Awaited<P8>) => P9, f10: (j: Awaited<P9>) => P10, f11: (k: Awaited<P10>) => P11, f12: (l: Awaited<P11>) => P12, f13: (m: Awaited<P12>) => P13, f14: (n: Awaited<P13>) => P14, f15: (o: Awaited<P14>) => P15): PipeReturn<P15, [P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15]>;\nexport function pipe<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16>(f1: P1 | ((a: void) => P1), f2: (b: Awaited<P1>) => P2, f3: (c: Awaited<P2>) => P3, f4: (d: Awaited<P3>) => P4, f5: (e: Awaited<P4>) => P5, f6: (f: Awaited<P5>) => P6, f7: (g: Awaited<P6>) => P7, f8: (h: Awaited<P7>) => P8, f9: (i: Awaited<P8>) => P9, f10: (j: Awaited<P9>) => P10, f11: (k: Awaited<P10>) => P11, f12: (l: Awaited<P11>) => P12, f13: (m: Awaited<P12>) => P13, f14: (n: Awaited<P13>) => P14, f15: (o: Awaited<P14>) => P15, f16: (p: Awaited<P15>) => P16): PipeReturn<P16, [P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16]>;\n\n/** Chain together (possibly async) function calls, each receiving the resolved (awaited) output of the previous one. The first parameter may be a value, all further parameters must be functions.\n *  Type safe up to 16 parameters\n */\nexport function pipe(fn0: unknown, ...fns: Array<(x: unknown) => unknown>): unknown;\n\nexport function pipe(fn0: unknown, ...fns: Array<(x: unknown) => unknown>): unknown {\n  let result = typeof fn0 === \"function\" ? fn0() : fn0;\n\n  if (isPromise(result)) { //switch to full async handling immediately\n    return (async () => {\n      let asyncResult = await result;\n      for (const fn of fns)\n        asyncResult = await fn(asyncResult);\n      return asyncResult;\n    })();\n  }\n\n  for (let idx = 0; idx < fns.length; ++idx) {\n    const next = fns[idx](result);\n    if (isPromise(next)) { //switch to async as soon as we hit a promise\n      return (async () => {\n        let asyncResult = await next;\n        for (let asyncIdx = idx + 1; asyncIdx < fns.length; ++asyncIdx)\n          asyncResult = await fns[asyncIdx](asyncResult);\n        return asyncResult;\n      })();\n    }\n    result = next;\n  }\n\n  return result;\n}\n","const unlock = Symbol(\"unlock\");\n\n/** A mutex which is only visible in the current JavaScript VM\n\n    @example\n```ts\nconst mutex = new LocalMutex;\n\nusing lock = await mutex.lock();\nlock.release();\n\n// If you'll be relying on automatic release\nusing lock = await mutex.lock();\nvoid(lock);\n```\n\n*/\nexport class LocalMutex {\n  private locked = false;\n  private unlockList = new Array<() => void>;\n\n  /** Lock this mutex\n   * @returns Lock object. Use with `using` to ensure automatic unlock\n   */\n  async lock() {\n    if (this.locked) {\n      const defer = Promise.withResolvers<void>();\n      this.unlockList.push(() => defer.resolve());\n      await defer.promise;\n    } else {\n      this.locked = true;\n    }\n    return new LocalLock(this);\n  }\n\n  [unlock](): void {\n    if (this.unlockList.length > 0)\n      (this.unlockList.shift()!)(); //we're fair... unlock longest waiter\n    else\n      this.locked = false;\n  }\n}\n\n/** Instance of a LocalMutex lock */\nclass LocalLock implements Disposable {\n  private mutex: LocalMutex | null;\n\n  constructor(mutex: LocalMutex) {\n    this.mutex = mutex;\n  }\n  /** Explicitly release the lock\n   * @throws Error if the lock is already released\n  */\n  release() {\n    if (!this.mutex)\n      throw new Error(\"Lock already released\");\n\n    this.mutex[unlock]();\n    this.mutex = null;\n  }\n  [Symbol.dispose]() {\n    this.mutex?.[unlock]();\n  }\n}\n\nexport type { LocalLock };\n","// This gets TypeScript to refer to us by our @webhare/... name in auto imports:\ndeclare module \"@webhare/std\" {\n}\n\n// Adding APIs may also require an update to https://www.webhare.dev/manuals/typescript/harescript-conversion-guide/\nexport { attempt, sleep, createDeferred, wrapInTimeout, serialize, wrapSerialized, type DeferredPromise, type SerializeOptions } from \"./promises.ts\";\n\nexport { compare, compareProperties, enumReverseMap, nameToCamelCase, nameToSnakeCase, toSnakeCase, toCamelCase, maybePromiseAll, mapMaybePromise } from \"./types.ts\";\nexport type { ToSnakeCase, ToCamelCase, ComparableType, MaybePromise } from \"./types.ts\";\n\nexport { encodeString, decodeString, escapeRegExp, regExpFromWildcards, stringify, parseTyped, slugify, isValidEmail, type StringEncodings, toCLocaleLowercase, toCLocaleUppercase, levenshteinDistance, getUTF8Length, limitUTF8Length, updateURL } from \"./strings.ts\";\nexport { generateRandomId, isLikeRandomId, isValidUUID } from \"./platformbased.ts\";\n\nexport { shuffle, emplace, pick, omit, isTruthy, appendToArray, typedEntries, typedFromEntries, typedKeys, SortedMultiSet, SortedMultiMap, type TypedEntries, type TypedFromEntries } from \"./collections.ts\";\nexport type { EmplaceHandler, DistributedKeys, DistributedOmit, DistributedPick } from \"./collections.ts\";\n\nexport { Money, type MoneyRoundingMode, type MoneyFormatOptions } from \"./money.ts\";\n\nexport { addDuration, parseDuration, subtractDuration, convertWaitPeriodToDate, isValidDate, isValidTime, convertFlexibleInstantToDate, formatDateTime } from \"./datetime.ts\";\nexport type { Duration, WaitPeriod, FlexibleInstant } from \"./datetime.ts\";\n\nexport { stdTypeOf, isDate, isBlob, isFile, isError, isPromise, isMoney, isTemporalInstant, isTemporalPlainDate, isTemporalPlainDateTime, isTemporalZonedDateTime, isTemporalPlainTime } from \"./quacks.ts\";\n\nexport { combineAbortSignals, getScopeSignal, whenAborted, pipe } from \"./utils.ts\";\n\nexport { LocalMutex, type LocalLock } from \"./localmutex.ts\";\n\n/** Throw an error with the specified message. This function allows you to throw inside expressions\n * @param err - The error message\n * @returns This function never returns\n * @throws An error with the specified message\n */\nexport function throwError(err: Error | string): never {\n  //TODO remove ourselves from the stack ?\n  throw err instanceof Error ? err : new Error(err);\n}\n","// Set up dispose symbols - https://github.com/evanw/esbuild/pull/3192 \"you'll need to polyfill Symbol.dispose if it's not present before you use it.\n\n//@ts-expect-error -- It's marked readonly\nSymbol.dispose ||= Symbol.for('Symbol.dispose');\n//@ts-expect-error -- It's marked readonly\nSymbol.asyncDispose ||= Symbol.for('Symbol.asyncDispose');\n\n// Set up promise resolvers (ES2024)\nPromise.withResolvers ||= function <T>(): PromiseWithResolvers<T> {\n  let resolve: (value: T | PromiseLike<T>) => void;\n  let reject: (reason: Error) => void;\n  const promise = new Promise<T>((_resolve, _reject) => { resolve = _resolve; reject = _reject; });\n  // @ts-expect-error `resolve` and `reject` are assigned synchronously, which isn't picked up by the TypeScript compiler (see\n  // https://github.com/Microsoft/TypeScript/issues/30053)\n  return { promise, resolve, reject };\n};\n\n// Polyfills for https://caniuse.com/?search=groupby - needed until we can assume safari 17.4 as global baseline\nif (!Map.groupBy)\n  Map.groupBy = function <Item, Key>(items: Iterable<Item>, callbackfn: (item: Item, idx: number) => Key): Map<Key, Item[]> {\n    const retval = new Map<Key, Item[]>;\n    let idx = 0;\n    for (const item of items) {\n      const key = callbackfn(item, idx++);\n      let list = retval.get(key);\n      if (!list)\n        retval.set(key, list = []);\n      list.push(item);\n    }\n    return retval;\n  };\n\nif (!Object.groupBy)\n  Object.groupBy = function <Item, Key extends string | number | symbol>(items: Iterable<Item>, callbackfn: (item: Item, idx: number) => Key): Partial<Record<Key, Item[]>> {\n    return Object.fromEntries(Map.groupBy(items, callbackfn).entries()) as Partial<Record<Key, Item[]>>;\n  };\n","type FormValueList = Array<{ name: string; value: string }>;\n\n/** A navigation instruction encapsulates the next step that a client has to take in eg. a login, payment or wizard flow.\n * Use navigateTo to execute a navigation in a browser\n*/\n\nexport type NavigateInstruction =\n  {\n    type: \"redirect\";\n    url: string;\n  } | {\n    type: \"form\";\n    form: {\n      action: string;\n      vars: FormValueList;\n      method?: \"POST\";\n    };\n  } | {\n    type: \"reload\";\n  } | {\n    type: \"postmessage\";\n    message: unknown;\n    target?: \"parent\" | \"opener\";\n  } | {\n    type: \"close\";\n  };\n\nfunction submitForm(action: string, values: FormValueList, method = \"POST\") {\n  const form = document.createElement(\"form\");\n  form.method = method;\n  form.action = action;\n  form.append(...values.map(item => {\n    const input = document.createElement(\"input\");\n    input.type = \"hidden\";\n    input.name = item.name;\n    input.value = item.value;\n    return input;\n  }));\n  document.body.appendChild(form);\n  form.submit();\n}\n\n/** Navigate to a specific URL (may be hookable by other scripts)\n* @param navigation - Target URL or NavigateInstruction\n*/\nexport function navigateTo(navigation: string | NavigateInstruction) {\n  if (typeof window === \"undefined\")\n    throw new Error(`navigateTo() is not available in this environment`);\n\n  if (typeof navigation === \"string\")\n    navigation = { type: \"redirect\", url: navigation };\n\n  switch (navigation.type) {\n    case \"redirect\":\n      {\n        location.href = navigation.url;\n      } break;\n\n    case \"form\":\n      {\n        submitForm(navigation.form.action, navigation.form.vars, navigation.form.method);\n      } break;\n\n    case \"reload\":\n      {\n        window.location.reload();\n      } break;\n\n    case \"postmessage\":\n      {\n        if (!navigation.target || navigation.target === \"parent\")\n          window.parent.postMessage(navigation.message, \"*\");\n        else if (navigation.target === \"opener\") {\n          window.opener.postMessage(navigation.message, \"*\");\n          window.close();\n        } else\n          throw Error(\"Unknown postmessage target '\" + navigation.target + \"' received\");\n      } break;\n\n    case \"close\":\n      {\n        window.close();\n      } break;\n\n    default:\n      throw new Error(`Unknown navigation type '${(navigation as { type: string }).type}'`);\n  }\n}\n","import { debugFlags, registerDebugConfigChangedCallback } from \"./envbackend\";\nimport { generateRandomId } from \"@webhare/std\";\n\nlet hookedfetch = false;\n\nfunction sanitizeBody(body: unknown) {\n  if (body instanceof ArrayBuffer) {\n    const view = new Uint8Array(body.slice(0, 5000)); //show the bytes but filter unprintable as '.'\n    return Array.from(view).map(v => v >= 32 && v < 127 ? String.fromCharCode(v) : \".\").join(\"\");\n  }\n  if (body instanceof URLSearchParams)\n    return body.toString();\n  if (typeof body !== 'string') {\n    return `[${typeof body}]`;\n  }\n  body = body.substring(0, 5000).replaceAll(\"\\r\", \" \").replaceAll(\"\\n\", \" \");\n  return body;\n}\n\nfunction getResponseSummary(response: Pick<Response, \"headers\">) {\n  const toks = [];\n  if (response.headers.get(\"Content-Type\"))\n    toks.push(response.headers.get(\"Content-Type\"));\n  if (response.headers.get(\"Content-Length\"))\n    toks.push(response.headers.get(\"Content-Length\") + \" bytes\");\n  if (response.headers.get(\"Transfer-Encoding\"))\n    toks.push(response.headers.get(\"Transfer-Encoding\"));\n  if (response.headers.get(\"Content-Encoding\"))\n    toks.push(response.headers.get(\"Content-Encoding\"));\n\n  return toks.length ? `(${toks.join(\", \")})` : \"\";\n}\n\nfunction headersToString(headers: Headers) {\n  return JSON.stringify(Object.fromEntries(headers.entries()));\n}\n\nexport function extractRequestInfo(input: RequestInfo | URL, init?: RequestInit) {\n  const method = (init?.method || (input as Request)?.method || \"GET\");\n  const url = input instanceof URL ? input.toString() : typeof input === \"string\" ? input : input.url;\n  const headers = new Headers(typeof input === \"object\" && !(input instanceof URL) ? input.headers : init?.headers);\n  const body = typeof input === \"object\" && !(input instanceof URL) ? input.body : init?.body;\n  return { method, url, headers, body };\n}\n\nexport async function extractRequestBody(body: BodyInit): Promise<XMLHttpRequestBodyInit> {\n  if (!(body instanceof ReadableStream))\n    return body;\n\n  //convert the ReadableStream to ArrayBuffer so we can print AND send it (TODO ideally 'tee' the stream and just grab the first 5K bytes)\n  const reader = body.getReader();\n  const chunks = [];\n  for (; ;) {\n    const { done, value } = await reader.read();\n    if (done)\n      break;\n    chunks.push(value);\n  }\n  return await new Blob(chunks).arrayBuffer();\n}\n\nexport function logWrqRequest(method: string, url: string, headers: Headers, body: XMLHttpRequestBodyInit | undefined | null) {\n  const debugrequestid = generateRandomId();\n\n  console.log(`[wrq] ${debugrequestid} ${method.padEnd(7)} ${url}`);\n  console.log(`[wrq] ${debugrequestid} headers ${headersToString(headers)}`);\n  if (body) {\n    console.log(`[wrq] ${debugrequestid} body    ${sanitizeBody(body)}`);\n  }\n\n  return debugrequestid;\n}\n\nexport async function logWrqResponse(debugrequestid: string, fetchresult: Pick<Response, \"ok\" | \"status\" | \"statusText\" | \"headers\" | \"json\" | \"text\" | \"arrayBuffer\" | \"clone\">) {\n  console.log(`[wrq] ${debugrequestid} result  ${fetchresult.status} ${fetchresult.statusText} ${getResponseSummary(fetchresult)}`);\n  console.log(`[wrq] ${debugrequestid} headers ${headersToString(fetchresult.headers)}`);\n\n  const ct = fetchresult.headers.get(\"Content-Type\");\n  if (ct && [\"text/html\", \"text/plain\", \"application/json\"].includes(ct?.split(';')[0])) {\n    const responsebody = await fetchresult.clone().text();\n    console.log(`[wrq] ${debugrequestid} body    ${sanitizeBody(responsebody)}`);\n  }\n}\n\nasync function debuggableFetch(originalfetch: typeof fetch, input: RequestInfo | URL, init?: RequestInit) {\n  if (!debugFlags.wrq)\n    return originalfetch(input, init);\n\n  let { method, url, headers, body } = extractRequestInfo(input, init);\n  if (body) {\n    body = await extractRequestBody(body);\n    init = { ...init, body };\n  }\n\n  const debugrequestid = logWrqRequest(method, url, headers, body);\n\n  const fetchresult = await originalfetch(input, init); //TODO log responses as well (if safe/applicable, eg not binary or Very Long... and we probably should wait for the first json()/text()/body() call? but at least log the status and time!)\n  await logWrqResponse(debugrequestid, fetchresult);\n\n  return fetchresult;\n}\n\nexport function hookFetch() {\n  if (hookedfetch)\n    return;\n\n  globalThis.fetch = debuggableFetch.bind(null, globalThis.fetch);\n  hookedfetch = true;\n}\n\nexport function enableFetchDebugging() {\n  // Hook global fetch if requested\n  if (globalThis[\"fetch\"]) {\n    if (debugFlags.wrq)\n      hookFetch();\n\n    registerDebugConfigChangedCallback(() => {\n      if (debugFlags.wrq)\n        hookFetch();\n    });\n  }\n}\n","/* Manages the $wh global, an API for just-in-time debugging */\nimport type { DebugRegistry } from \"@webhare/env\";\nimport { debugFlags } from \"./envbackend\";\n\nlet debugRegFinalizer: FinalizationRegistry<{ type: keyof DebugRegistry; key: string }> | undefined;\n\nexport type WHGlobal = DebugRegistry & {\n  debugFlags: typeof debugFlags;\n  /** Global counter to avoid HMRs from duplicating IDs */\n  nextId: number;\n};\n\ndeclare global {\n  var $wh: WHGlobal;\n}\n\nglobalThis.$wh = {\n  debugFlags,\n  nextId: 1\n} satisfies WHGlobal;\n\nexport function addToDebugRegistry<T extends keyof DebugRegistry>(type: T, key: string, value: NonNullable<ReturnType<NonNullable<DebugRegistry[T]>[string][\"deref\"]>>) {\n  const debugRegistry = globalThis.$wh as unknown as DebugRegistry;\n  //@ts-ignore prevents '>   Type '{}' is not assignable to type 'never'. in jssdk builds, probably because noone yet extends DebugRegistry there\n  debugRegistry[type] ||= {};\n  debugRegFinalizer ||= new FinalizationRegistry(({ type: t, key: k }) => {\n    delete debugRegistry![t]?.[k];\n  });\n\n  if (debugRegistry[type][key])\n    console.error(`Debug registry key ${key} already exists, overwriting it`);\n\n  (debugRegistry[type] as Record<string, unknown>)[key] = new WeakRef(value);\n  debugRegFinalizer.register(value, { type, key });\n}\n","// This gets TypeScript to refer to us by our @webhare/... name in auto imports:\ndeclare module \"@webhare/env\" {\n  interface DebugRegistry {\n  }\n}\n\nimport { debugFlags, dtapStage, isLive, backendBase, getAssetBase, setAssetBase, getModulePublicAssetBase } from \"./envbackend\";\nimport type { DTAPStage } from \"./concepts\";\n\nexport { type NavigateInstruction, navigateTo } from \"./navigation\";\nexport { enableFetchDebugging } from \"./fetchdebug\";\nexport { addToDebugRegistry } from \"./whglobal\";\nexport { updateDebugConfig } from \"./envbackend\";\nexport { type DTAPStage, dtapStage, debugFlags, isLive, backendBase, getAssetBase, setAssetBase, getModulePublicAssetBase };\n\n//user locale *which Tollium and sites should start to use to define localization, and perhaps gettid too?)\nexport type UserLocale = {\n  /** The language code, eg 'en' including optional country, eg en-US */\n  lang: string;\n  //TODO regional settings\n};\n\n//export deprecated variants\nexport { dtapstage, islive } from \"./envbackend\";\n\n/** @deprecated For WH5.4 and up use 'debugFlags' */\nexport const flags = debugFlags;\n","import type { FormControlElement } from \"@webhare/dompack\";\n\nexport const CustomEvent = globalThis.CustomEvent;\n/** Wrap an event to ensure it's target is a HTMLElement\n * @typeParam EventType - The expected event type\n * @typeParam CurrentTargetType - The type of the elemnt you're binding the event to. Optional, defaults to HTMLElement\n * @typeParam RelatedTargetType - The type of the elemnt you're binding the event to. Optional, defaults to HTMLElement\n*/\nexport type DocEvent<EventType extends Event, CurrentTargetType extends HTMLElement = HTMLElement, RelatedTargetType extends HTMLElement = HTMLElement> = EventType & {\n  target: HTMLElement;\n  currentTarget: CurrentTargetType;\n  relatedTarget: RelatedTargetType | null;\n};\n\nexport type DomEventOptions =\n  {\n    bubbles?: boolean;\n    cancelable?: boolean;\n    relatedTarget?: EventTarget;\n    detail?: object;\n  };\n\n/** @deprecated Browsers finally have cross-platform event dispatching. Use element.dispatchEvent(new MouseEvent/FocusEvent/CustomEvent) */\nexport function dispatchDomEvent(element: EventTarget, eventtype: string, options?: DomEventOptions) {\n  //see here https://developer.mozilla.org/en-US/docs/Web/Events whether an event is bubbles/cancelabel\n  options = {\n    bubbles: [\n      \"input\", \"change\", \"click\", \"contextmenu\", \"dblclick\",\n      \"reset\", \"submit\"\n    ].includes(eventtype),\n    cancelable: [\n      \"animationstart\", \"animationcancel\", \"animationend\", \"animationiteration\",\n      \"beforeunload\",\n      \"click\", \"contextmenu\", \"dblclick\",\n      \"reset\", \"submit\",\n      \"transitionstart\", \"transitioncancel\", \"transitionend\", \"transitionrun\"\n    ].includes(eventtype),\n    ...options\n  };\n\n  if (!element || !(element as Node).ownerDocument)\n    return true; //the element has left the dom... so there's no more bubbling. just drop it\n\n  //FIXME the load/scroll is buggy and we should be probably be using new Event (but an earlier attempt at that triggered quite a few test failures)\n  const createtype = /*[\"load\",\"scroll\"].includes(eventtype) === \"load\" ? \"UIEvents\" :*/[\"focus\", \"blur\", \"focusin\", \"focusout\"].includes(eventtype) ? \"FocusEvent\" : eventtype === \"click\" ? \"MouseEvents\" : \"HTMLEvents\";\n  //we verified its non-null ness above but TS doesn't really understand that\n  const evt = (element as Node).ownerDocument!.createEvent(createtype);\n  evt.initEvent(eventtype, options.bubbles, options.cancelable);\n  if (options.detail)\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any -- we should just rewrite to new Event\n    (evt as any).detail = options.detail;\n  if (options.relatedTarget) //its a readonly prop, so redefine it\n    Object.defineProperty(evt, 'relatedTarget', { value: options.relatedTarget, writable: false });\n\n  //TODO: Should we keep this code?\n  // @ts-expect-error IScroll is a custom Window property set by IScroll\n  if (eventtype === 'click' && window.IScroll)\n    // @ts-expect-error _constructed is a custom Event property used by IScroll\n    evt._constructed = true; //ensure IScroll doesn't blindly cancel our synthetic clicks\n\n  return element.dispatchEvent(evt);\n}\n\n/** Fire the proper modified events (input and/or change) on the element after changing its value\n * @param element - Element to receive event\n * @deprecated Use changeValue so we can figure out the proper events to fire\n */\nexport function fireModifiedEvents(element: FormControlElement) {\n  element.dispatchEvent(new InputEvent(\"input\"));\n  element.dispatchEvent(new Event(\"change\"));\n}\n\n/** @deprecated Browsers finally have cross-platform event dispatching. Use element.dispatchEvent(new MouseEvent/FocusEvent/CustomEvent) */\nexport function fireHTMLEvent(element: EventTarget, type: string, options?: DomEventOptions) {\n  return dispatchDomEvent(element, type, options);\n}\n\ntype CustomEventParams =\n  {\n    /** Whether this event should bubble up in the DOM */\n    bubbles: boolean;\n    /** Whether this event can be cancelled */\n    cancelable: boolean;\n    /** Custom event information */\n    detail?: unknown;\n    /** Handler to execute if the default isn't prevented by a event listener */\n    defaulthandler?: (evt: CustomEvent) => void;\n  };\n\n/** Fire a custom event\n    @param node - node to fire the event on\n    @param event - event type. You should add this event to the GlobalEventHandlersEventMap for validation in dispatchCustomEvent calls and addEventListener callbacks.\n    @param params - Event options\n    @returns true if the default wasn't prevented\n */\n\nexport function dispatchCustomEvent<K extends string>(\n  node: EventTarget,\n  event: K,\n  params: CustomEventParams & (K extends keyof GlobalEventHandlersEventMap ?\n    GlobalEventHandlersEventMap[K] extends CustomEvent ?\n    { detail: GlobalEventHandlersEventMap[K][\"detail\"] } : unknown : unknown)) {\n\n  if (!params)\n    throw new Error(`Missing dispatchCustomEvent params`);\n  ['bubbles', 'cancelable'].forEach(prop => {\n    if (!(prop in params))\n      throw new Error(`Missing '${prop}' in dispatchCustomEvent params`);\n  });\n\n  const evt = new CustomEvent(event, {\n    bubbles: params.bubbles,\n    cancelable: params.cancelable,\n    detail: params.detail\n  });\n  let defaultaction = true;\n  try {\n    if (!node.dispatchEvent(evt))\n      defaultaction = false; //defaultPrevented is unreliable on IE11, so double check\n  } finally {\n    if (!evt.defaultPrevented && params.defaulthandler && defaultaction) {\n      params.defaulthandler(evt);\n    }\n  }\n  return defaultaction && !evt.defaultPrevented;\n}\n\n/**\n     Change the value of a form element, and fire the correct events as if it were a user change\n *\n    @param element - Element to change\n    @param newvalue - New value\n */\nexport function changeValue(element: FormControlElement, newvalue: string | number | boolean) {\n  if (element.matches(`input[type=radio], input[type=checkbox]`)) {\n    if (Boolean((element as HTMLInputElement).checked) === Boolean(newvalue))\n      return;\n    (element as HTMLInputElement).checked = Boolean(newvalue);\n  } else {\n    //FIXME it's not really clean to assume that this element is changeable - throw for non input/select..\n    const asString = String(newvalue);\n    if ((element as HTMLInputElement).value === asString)\n      return;\n\n    (element as HTMLInputElement).value = String(newvalue);\n  }\n  dispatchDomEvent(element as EventTarget, 'input');\n  dispatchDomEvent(element as EventTarget, 'change');\n}\n\nlet keydata: { mapping: { [key: string]: string } };\n\nfunction initKeyMapping() {\n  keydata =\n  {\n    // Mapping from keyIdentifier/key to key. If not found, translate U+XXXX to the unicode char and return that.\n\n    // List of all current key mappings (and current inconsistencies\n    // at https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values\n    mapping:\n    {\n      \"Del\": \"Delete\", // IE/edge use 'Del' instead of 'Delete'\n      \"Esc\": \"Escape\", // IE/edge use 'Esc' instead of 'Escape'\n      \"OS\": \"Meta\", // Meta key is called OS on IE 9 and Firefox (tested v50)\n      \"Win\": \"Meta\", // Meta key is called Win on IE/Edge\n      \"Scroll\": \"ScrollLock\", // More IE/Edge, from tests\n      \"PrintScreen\": \"Print\", // More IE/Edge, from tests\n      \"MozHomeScreen\": \"GoHome\", // Prior to Firefox 37, the Home button generated a key code of \"Exit\". Starting in Firefox 37, the button generates the key code \"MozHomeScreen\".\n\n      // Internet Explorer 9 and Firefox 36 and earlier return \"Left\", \"Right\", \"Up\", and \"Down\" for the arrow keys, instead of \"ArrowLeft\", \"ArrowRight\", \"ArrowUp\", and \"ArrowDown\".\n      \"Left\": \"ArrowLeft\",\n      \"Right\": \"ArrowRight\",\n      \"Up\": \"ArrowUp\",\n      \"Down\": \"ArrowDown\",\n      // More IE and old Firefox stuff\n      \"Crsel\": \"CrSel\",\n      \"Exsel\": \"ExSel\",\n      \"Nonconvert\": \"NonConvert\",\n      // Internet Explorer 9 and Firefox 36 and earlier report \"Apps\" instead of \"ContextMenu\" for the context menu key.\n      \"Apps\": \"ContextMenu\",\n      // Internet Explorer 9 and Firefox 36 and earlier use \"MediaNextTrack\" and \"MediaPreviousTrack\" instead of \"MediaTrackNext\" and \"MediaTrackPrevious\".\n      \"MediaNextTrack\": \"MediaTrackNext\",\n      \"MediaPreviousTrack\": \"MediaTrackPrevious\",\n      // In Internet Explorer 9, and prior to Firefox 49, \"AudioVolumeUp\", \"AudioVolumeDown\", and \"AudioVolumeMute\" were \"VolumeUp\", \"VolumeDown\", and \"VolumeMute\".\n      // In Firefox 49 they were updated to match the latest specification. The old names are still used on Boot to Gecko.\n      \"VolumeUp\": \"AudioVolumeUp\",\n      \"VolumeDown\": \"AudioVolumeDown\",\n      \"VolumeMute\": \"AudioVolumeMute\",\n      // Firefox added proper support for the \"TV\" key in Firefox 37; before that, this key generated the key code \"Live\".\n      \"Live\": \"TV\",\n      // Internet Explorer 9 and Firefox 36 and earlier identify the zoom toggle button as \"Zoom\". Firefox 37 corrects this to \"ZoomToggle\".\n      \"Zoom\": \"ZoomToggle\",\n      // Internet Explorer 9 and Firefox 36 and earlier use \"SelectMedia\" instead of \"LaunchMediaPlayer\". Firefox 37 through Firefox 48 use \"MediaSelect\". Firefox 49 has been updated to match the latest specification, and to return \"LaunchMediaPlayer\".\n      \"SelectMedia\": \"LaunchMediaPlayer\",\n      \"MediaSelect\": \"LaunchMediaPlayer\",\n      // Google Chrome returns \"LaunchCalculator\" instead of \"LaunchApplication1\". See Chromium bug 612743 for more information.\n      // Google Chrome returns \"LaunchMyComputer\" instead of \"LaunchApplication2\". See Chromium bug 612743 for more information.\n      // (LaunchCalculator and LaunchMyComputer are valid too, so no translation)\n\n      // While older browsers used words like \"Add\", \"Decimal\", \"Multiply\", and so forth modern browsers identify these using the actual character (\"+\", \".\", \"*\", and so forth).\n      \"Multiply\": \"*\",\n      \"Add\": \"+\",\n      \"Divide\": \"/\",\n      \"Subtract\": \"-\",\n      \"Decimal\": \".\", // (mozilla Key_Values doc says depends on region)\n      \"Separator\": \".\", // (mozilla Key_Values doc says depends on region)\n\n      // keyIdenfier spec mapping of non-printable keys: https://www.w3.org/TR/2009/WD-DOM-Level-3-Events-20090908/#keyset-keyidentifiers\n      // Used in safari\n      \"U+0008\": \"Backspace\",\n      \"U+0009\": \"Tab\",\n      \"U+000D\": \"Enter\",\n      \"U+0018\": \"Cancel\",\n      \"U+001B\": \"Escape\",\n      \"U+007F\": \"Delete\",\n      \"U+0300\": \"DeadGrave\",\n      \"U+0301\": \"DeadEacute\",\n      \"U+0302\": \"DeadCircumflex\",\n      \"U+0303\": \"DeadTilde\",\n      \"U+0304\": \"DeadMacron\",\n      \"U+0306\": \"DeadBreve\",\n      \"U+0307\": \"DeadAboveDot\",\n      \"U+0308\": \"DeadUmlaut\",\n      \"U+030A\": \"DeadAboveRing\",\n      \"U+030B\": \"DeadDoubleacute\",\n      \"U+030C\": \"DeadCaron\",\n      \"U+0327\": \"DeadCedilla\",\n      \"U+0328\": \"DeadOgonek\",\n      \"U+0345\": \"DeadIota\",\n      \"U+3099\": \"DeadVoicedSound\",\n      \"U+309A\": \"DeadSemivoicedSound\",\n\n      // keyIdenfier spec mapping to characters: https://www.w3.org/TR/2009/WD-DOM-Level-3-Events-20090908/#keyset-keyidentifiers\n      \"Exclamation\": \"!\",\n      \"DoubleQuote\": \"\\\"\",\n      \"Hash\": \"#\",\n      \"Dollar\": \"$\",\n      \"Ampersand\": \"&\",\n      \"LeftParen\": \"(\",\n      \"RightParen\": \")\",\n      \"Asterisk\": \"*\",\n      \"Plus\": \"+\",\n      \"Percent\": \"%\",\n      \"Comma\": \",\",\n      \"HyphenMinus\": \"-\",\n      \"Period\": \".\",\n      \"Solidus\": \"/\",\n      \"Colon\": \":\",\n      \"Semicolon\": \";\",\n      \"LessThan\": \"<\",\n      \"Equals\": \"=\",\n      \"GreaterThan\": \">\",\n      \"QuestionMark\": \"?\",\n      \"At\": \"@\",\n      \"LeftSquareBracket\": \"[\",\n      \"Backslash\": \"\\\\\",\n      \"RightSquareBracket\": \"]\",\n      \"Circumflex\": \"^\",\n      \"Underscore\": \"_\",\n      \"Grave\": \"`\",\n      \"LeftCurlyBracket\": \"{\",\n      \"Pipe\": \"|\",\n      \"RightCurlyBracket\": \"}\",\n      \"Euro\": \"€\",\n      \"InvertedExclamation\": \"¡\",\n\n      // Safari fixes: viewed in local tests\n      \"U+0010\": \"ContextMenu\"\n    }\n  };\n}\n\nexport type NormalizedKeyboardEvent =\n  {\n    type: string;\n    target: EventTarget | null;\n    key: string;\n    code: string;\n    ctrlKey: boolean;\n    altKey: boolean;\n    location: number;\n    shiftKey: boolean;\n    metaKey: boolean;\n    repeat: boolean;\n    isComposing: boolean;\n  };\n\n/**\n     Returns normalized keyboard event properties, following the current W3C UI Events spec\n *\n    @param evt - Keyboard event\n    @returns Normalized keyboard event data\n */\nexport function normalizeKeyboardEventData(evt: KeyboardEvent): NormalizedKeyboardEvent {\n  // event.key is supported from chrome:51, edge, ff: 29, ie: 9, not in safari\n  // event.keyIdentifier in chrome 26-54, opera 15-41, safara: 5.1\n  // safari doesn't provide either in keypress events, use U+evt.keyCode (uppercase 4-byte hex)\n\n  let key = evt.key;\n  if (!keydata)\n    initKeyMapping();\n  if (keydata.mapping[key])\n    key = keydata.mapping[key];\n  else if (key.startsWith(\"U+\")) // U+xxxx code\n    key = String.fromCodePoint(parseInt(key.substring(2), 16));\n\n  // Seen in chrome 56.0.2924.76 on linux, numpad '.' without numlock returns key \"\\u0000\"\n  if (evt.key === \"\\u0000\" && evt.code === \"NumpadDecimal\")\n    key = \".\";\n\n  return (\n    {\n      type: evt.type,\n      target: evt.target,\n      key: key,\n      code: evt.code || \"Unidentified\",\n      ctrlKey: evt.ctrlKey,\n      altKey: evt.altKey,\n      location: evt.location,\n      shiftKey: evt.shiftKey,\n      metaKey: evt.metaKey,\n      repeat: evt.repeat,\n      isComposing: evt.isComposing\n    });\n}\n\n/**\n * Stop, fully, an event\n *\n * @param event - Event to stop\n */\nexport function stop(event: Event) {\n  event.preventDefault();\n  event.stopImmediatePropagation();\n}\n\n/** Add an event listener to HTMLElements inside a document (which allows us to ensure that 'target' is a HTMLElement for easier typings) */\nexport function addDocEventListener<CurrentTargetType extends HTMLElement, Type extends keyof HTMLElementEventMap>(node: CurrentTargetType, type: Type, listener: (this: CurrentTargetType, ev: DocEvent<HTMLElementEventMap[Type], CurrentTargetType>) => void | Promise<void>, options?: AddEventListenerOptions): void;\nexport function addDocEventListener<CurrentTargetType extends HTMLElement>(node: CurrentTargetType, type: string, listener: (this: CurrentTargetType, evt: DocEvent<Event, CurrentTargetType>) => void | Promise<void>, options?: AddEventListenerOptions): void;\n\nexport function addDocEventListener<CurrentTargetType extends HTMLElement>(node: CurrentTargetType, type: string, listener: (this: CurrentTargetType, evt: DocEvent<Event, CurrentTargetType>) => void | Promise<void>, options?: AddEventListenerOptions): void {\n  node.addEventListener(type, listener as EventListener, options);\n}\n","import { debugFlags } from '@webhare/env';\nimport * as domevents from '../../../modules/system/js/dompack/src/events';\nimport \"@webhare/tsrun/src/polyfills\";\n\nlet locallocks: BusyLock[] = [];\nlet modallocked = false;\nlet uiwatcher: NodeJS.Timeout | null = null;\nlet installedanticancelhandler = false;\n\nlet currentbusymodaldialog: HTMLDialogElement | null = null;\nlet currentbusymodaluserdialog: HTMLDialogElement | null = null;\nlet busymodalcontent: string | HTMLElement | HTMLDialogElement | undefined;\nlet mylockmgr: LockManager | undefined;\n\nexport type BusyModalEvent = CustomEvent<{ show: boolean }>;\n\n// As 'Lock' already exists on the Web (https://developer.mozilla.org/docs/Web/API/Lock) and it's seldom used just use a longer name. Available since WH 5.4\nexport interface UIBusyLock extends Disposable {\n  release(): void;\n  [Symbol.dispose](): void;\n}\n\ndeclare global {\n  interface GlobalEventHandlersEventMap {\n    \"dompack:busymodal\": BusyModalEvent;\n  }\n  interface Window {\n    __dompack_busylockmanager?: LockManager;\n  }\n\n  // __dompack_busylockmanager: LockManager | undefined;  //\n}\n\nfunction getLockmgr(): LockManager {\n  if (!mylockmgr) {\n    mylockmgr = getParentLockManager() || new LockManager;\n    if (typeof window !== \"undefined\")\n      window.__dompack_busylockmanager = mylockmgr;\n  }\n  return mylockmgr;\n}\n\nfunction anyModalLocks() {\n  return locallocks.some(l => l.modal);\n}\n\n/* scheduleCheckUIFree is invoked by release() or when waitUIFree is explicitly called. the call from release() should\n   be a 'fast' path. We schedule a full check for the next tick if there's a chance it might actually find a free UI */\nfunction scheduleCheckUIFree() {\n  if (!uiwatcher && locallocks.length === 0)\n    uiwatcher = setTimeout(() => checkUIFree(), 0);\n}\n\n/* check if the UI is actually free. if so, remove busymodals and resolve waitUIFrees for the benefit of testfw  */\nfunction checkUIFree() {\n  uiwatcher = null;\n\n  if (modallocked && !anyModalLocks()) { //did the last frame-level *modal* lock just get released?\n    modallocked = false;\n    toggleBusyModal(false);\n  }\n\n  if (locallocks.length === 0) {\n    const lockmgr = getLockmgr();\n    lockmgr.busyframes.delete(window); //we won't release our block in the lockmanager until we've had a chance to remove our modal layer\n    lockmgr.checkUIFree(); //to resolve any waitUIFrees. runs in the top-level frame. note that lockmgr cares about ALL ui locks, not just modals\n  }\n}\n\nfunction isDialogElement(el: unknown): boolean {\n  return typeof el === \"object\" && (el as HTMLElement).matches?.(\"dialog\") || false;\n}\n\nfunction checkCancelEvent(evt: Event) {\n  if (modallocked)\n    evt.preventDefault();\n}\n\nfunction toggleBusyModal(show: boolean) {\n  //'islock' is legacy non-camel version. TypeScript typing should help us transition (since 5.3). 'as' shuts up the warning TODO remove 'islock' and the 'as'\n  if (!domevents.dispatchCustomEvent(window, 'dompack:busymodal', { bubbles: true, cancelable: true, detail: { show: show, islock: show } as BusyModalEvent['detail'] }))\n    return; //cancelled!\n\n  if (!installedanticancelhandler) {\n    //capture cancel, as it doesn't bubble up\n    addEventListener(\"cancel\", evt => checkCancelEvent(evt), { capture: true });\n    installedanticancelhandler = true;\n  }\n\n  if (show) {\n    if (isDialogElement(busymodalcontent)) { //the user provided us with an element\n      currentbusymodaluserdialog = busymodalcontent as HTMLDialogElement;\n      currentbusymodaluserdialog.showModal();\n    } else if (busymodalcontent) { //we'll create our own dialog\n      const dialog = document.createElement('dialog');\n      const toembed = typeof busymodalcontent === \"string\" ? document.createTextNode(busymodalcontent) : busymodalcontent.cloneNode(true);\n      dialog.className = \"dompack-busydialog\";\n      dialog.role = \"status\";\n      dialog.ariaLive = \"off\";\n      dialog.append(toembed);\n      document.body.appendChild(dialog);\n      currentbusymodaldialog = dialog;\n      dialog.showModal();\n      return;\n    }\n\n    document.documentElement.classList.add(\"dompack--busymodal\");\n    return;\n  }\n\n  //hiding\n  document.documentElement.classList.remove(\"dompack--busymodal\");\n  if (currentbusymodaluserdialog)\n    currentbusymodaluserdialog.close();\n  if (currentbusymodaldialog) { //we added a dialog to the dom\n    currentbusymodaldialog.close();\n    document.body.removeChild(currentbusymodaldialog);\n    currentbusymodaldialog = null;\n  }\n}\n\nclass LockManager {\n  locks: BusyLock[];\n  busyframes: Set<Window> = new Set;\n  busycounter: number;\n  deferreduipromise: PromiseWithResolvers<boolean> | null;\n\n  //this object is not for external consumption\n  constructor() {\n    this.locks = [];\n    this.busycounter = 0;\n    this.deferreduipromise = null;\n  }\n  add(lock: BusyLock) {\n    this.locks.push(lock);\n    const returnvalue = this.busycounter++;\n    return returnvalue;\n  }\n  release(lock: BusyLock) {\n    const pos = this.locks.indexOf(lock);\n    if (pos === -1) {\n      if (debugFlags.bus) {\n        console.error(\"Duplicate release of busy lock #\" + lock.locknum);\n        console.log(\"Lock allocated:\");\n        console.log(lock.acquirestack);\n        console.log(\"Lock first released:\");\n        console.log(lock.releasestack);\n      }\n      throw new Error(\"Duplicate release of busy lock\");\n    }\n\n    this.locks.splice(pos, 1);\n  }\n  getNumLocks() {\n    return this.locks.length;\n  }\n  //used by child windows to schedule a check in *our* frame (eg before they themselves are unloaded)\n  scheduleCheckUIFree() {\n    scheduleCheckUIFree();\n  }\n  checkUIFree() {\n    if (this.locks.length === 0 && this.busyframes.size === 0 && this.deferreduipromise) {\n      this.deferreduipromise.resolve(true);\n      this.deferreduipromise = null;\n    }\n  }\n  waitUIFree() {\n    if (!this.deferreduipromise)\n      this.deferreduipromise = Promise.withResolvers();\n\n    scheduleCheckUIFree(); //ensures uiwait is released at next tick if no locks are present at all\n    return this.deferreduipromise.promise;\n  }\n  logLocks() {\n    this.locks.forEach(lock => console.log('[bus] lock #' + lock.locknum, lock.acquirestack, lock));\n    console.log(\"[bus] total \" + this.locks.length + \" locks\");\n  }\n  getLockIds() {\n    return this.locks.map(l => \"#\" + l.locknum).join(\", \");\n  }\n}\n\n/** Configure an (accessible) modal dialog\n * @param bmc - What to show in the dialog: either a text or DOM fragment to clone.\n *              If a <dialog> element is passed, this dialog will be used instead of creating a new one.\n */\nexport function setupBusyModal(bmc: NonNullable<typeof busymodalcontent>) {\n  busymodalcontent = bmc;\n}\n\ninterface LockOptions {\n  ///Whether this lock should enable a modality laayer\n  modal?: boolean;\n}\n\nclass BusyLock implements UIBusyLock {\n  modal: boolean;\n  locknum: number;\n  acquirestack: string | undefined;\n  releasestack: string | undefined;\n\n  constructor(options?: LockOptions) {\n    //legacy non-camel name is 'ismodal'\n    this.modal = options?.modal ?? (options as { ismodal?: boolean })?.ismodal ?? false;\n\n    const lockmgr = getLockmgr();\n    this.locknum = lockmgr.add(this);\n    lockmgr.busyframes.add(window);\n    locallocks.push(this);\n\n    if (this.modal && !modallocked) {\n      modallocked = true;\n      toggleBusyModal(true);\n    }\n\n    if (debugFlags.bus) {\n      this.acquirestack = (new Error).stack;\n      console.trace('[bus] Busy lock #' + this.locknum + ' taken. ' + lockmgr.getNumLocks() + \" locks active now: \" + lockmgr.getLockIds());\n    }\n  }\n\n  [Symbol.dispose]() {\n    if (debugFlags.bus)\n      this.releasestack = (new Error).stack;\n\n    const lockmgr = getLockmgr();\n    lockmgr.release(this);\n    const lockpos = locallocks.indexOf(this);\n    locallocks.splice(lockpos, 1);\n\n    if (debugFlags.bus) {\n      console.trace('[bus] Busy lock #' + this.locknum + ' released. ' + lockmgr.getNumLocks() + \" locks active now: \" + lockmgr.getLockIds());\n    }\n\n    scheduleCheckUIFree();\n  }\n\n  release() {\n    this[Symbol.dispose]();\n  }\n}\n\n/** Return a promise resolving as soon as the UI (any accessible frame) is free for at least one tick */\nexport function waitUIFree() {\n  return getLockmgr().waitUIFree();\n}\n\n/**\n     flag userinterface as busy. tests then know not to interact with the UI until the busy flag is released\n *\n    @param options - Options.<br>\n                   - modal: true/false - Whether the lock is a modal lock\n */\nexport function flagUIBusy(options?: LockOptions): UIBusyLock {\n  return new BusyLock(options);\n}\n\nexport function getUIBusyCounter() {\n  return getLockmgr().busycounter;\n}\n\nfunction getParentLockManager(): LockManager | null {\n  try { //we're accessing a parent window, so we may hit security exceptions\n    if (!(window.parent?.__dompack_busylockmanager))\n      return null;\n\n    //if we connected to a parent...  deregister our locks, eg. if parent navigated our frame away\n    window.addEventListener(\"pagehide\", () => {\n      if (debugFlags.bus)\n        console.log(\"[bus] Frame unloading, \" + locallocks.length + \" locks pending.\", locallocks.map(l => \"#\" + l.locknum).join(\", \"), locallocks);\n\n      //switch to local instance in case anyone still tries to touch these locks during unload\n      const lockmgr = getLockmgr();\n      const locallockmgr = new LockManager;\n      locallocks.forEach(lock => { lockmgr.release(lock); locallockmgr.add(lock); });\n      locallocks = [];\n\n      lockmgr.busyframes.delete(window); //explicitly remove us so we won't be waited upon\n      lockmgr.scheduleCheckUIFree();\n      mylockmgr = locallockmgr;\n    });\n\n    return window.parent.__dompack_busylockmanager;\n  } catch (e) {\n    return null;\n  }\n}\n","\n/* Regex to identify dimensionless style sttributes. copied from old version of preact/src/constants.js (MIT)\n   meant to capture:\n  { boxFlex:1, boxFlexGroup:1, columnCount:1, fillOpacity:1, flex:1, flexGrow:1,\n    flexPositive:1, flexShrink:1, flexNegative:1, fontWeight:1, lineClamp:1, lineHeight:1,\n    opacity:1, order:1, orphans:1, strokeOpacity:1, widows:1, zIndex:1, zoom:1\n*/\nconst IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;\n\nexport { qS, qSA } from '@webhare/dompack/src/tree.ts';\n\nfunction generateInsertList(nodes: Array<string | Node>) {\n  if (nodes.length === 1)\n    return typeof nodes[0] === 'string' ? document.createTextNode(nodes[0]) : nodes[0];\n\n  const frag = document.createDocumentFragment();\n  nodes.forEach(node => frag.appendChild(typeof node === 'string' ? document.createTextNode(node) : node));\n  return frag;\n}\n\n/** @deprecated Use node.matches() */\nexport function matches(node: Element, selector: string): boolean {\n  //only invoke 'matches' if it exists. it *should* but past versions of dompack.matches would check for it too (and thus not fail if you passed in a string instead of a Node)\n  return node.matches?.(selector);\n}\n/** @deprecated Use node.closest() */\nexport function closest(node: Element, selector: string) {\n  if (node.closest)\n    return node.closest(selector);\n  //TODO: Warn about out-of-date browser?\n  let testNode: Element | null = node;\n  for (; testNode && !matches(testNode, selector); testNode = testNode.parentElement)\n    /*iterate*/;\n  return testNode;\n}\n//implements contains. TODO we only really need this on IE11, which doesn't consider a text node a child, we can probably fall back to native elsewhere ?\n/** @deprecated Use node.contains() */\nexport function contains(ancestor: Node, child: Node) {\n  if (ancestor.contains)\n    return ancestor.contains(child);\n  //TODO: Warn about out-of-date browser?\n  for (let testNode: Node | null = child; testNode; testNode = testNode.parentNode)\n    if (testNode === ancestor)\n      return true;\n  return false;\n}\n//insert a range of nodes before a node: https://dom.spec.whatwg.org/#dom-childnode-before\n/** @deprecated Use node.before() */\nexport function before(node: ChildNode, ...nodes: Array<string | Node>) {\n  if (node.before) {\n    node.before(...nodes);\n    return;\n  }\n  //TODO: Warn about out-of-date browser?\n  if (node.parentNode)\n    node.parentNode.insertBefore(generateInsertList(nodes), node);\n}\n//insert a range of nodes after a node: https://dom.spec.whatwg.org/#dom-childnode-after\n/** @deprecated Use node.after() */\nexport function after(node: ChildNode, ...nodes: Array<string | Node>) {\n  if (node.after) {\n    node.after(...nodes);\n    return;\n  }\n  //TODO: Warn about out-of-date browser?\n  if (node.parentNode)\n    node.parentNode.insertBefore(generateInsertList(nodes), node.nextSibling);\n}\n//replace node with a set of nodes : https://dom.spec.whatwg.org/#dom-childnode-replacewith\n/** @deprecated Use node.replaceWith() */\nexport function replaceWith(node: ChildNode, ...nodes: Array<string | Node>) {\n  if (node.replaceWith) {\n    node.replaceWith(...nodes);\n    return;\n  }\n  //TODO: Warn about out-of-date browser?\n  if (node.parentNode)\n    node.parentNode.replaceChild(generateInsertList(nodes), node);\n}\n//remove node with a set of nodes : https://dom.spec.whatwg.org/#dom-childnode-remove\n/** @deprecated Use node.remove() */\nexport function remove(node: ChildNode) {\n  if (node.remove) {\n    node.remove();\n    return;\n  }\n  //TODO: Warn about out-of-date browser?\n  if (node.parentNode)\n    node.parentNode.removeChild(node);\n}\n//insert nodes at start: https://dom.spec.whatwg.org/#dom-parentnode-prepend\n/** @deprecated Use node.prepend() */\nexport function prepend(node: ParentNode, ...nodes: Array<string | Node>) {\n  if (node.prepend) {\n    node.prepend(...nodes);\n    return;\n  }\n  //TODO: Warn about out-of-date browser?\n  node.insertBefore(generateInsertList(nodes), node.firstChild);\n}\n//insert nodes at end: https://dom.spec.whatwg.org/#dom-parentnode-append\n/** @deprecated Use node.append() */\nexport function append(node: ParentNode, ...nodes: Array<string | Node>) {\n  if (node.append) {\n    node.append(...nodes);\n    return;\n  }\n  //TODO: Warn about out-of-date browser?\n  node.appendChild(generateInsertList(nodes));\n}\n\n/**\n * Toggle a single class\n *\n * @param node - Node to modify\n * @param classname - Class to toggle\n * @param settoggle - true to enable, false to disable, undefined to toggle\n * @deprecated Just use classList.toggle on the node itself\n */\n/** @deprecated Use classList.toggle() */\nexport function toggleClass(node: Element, classname: string, settoggle?: boolean) {\n  if (arguments.length === 2) //in old dompack, 2 argument version toggled and 3 argument version toggled off. match that behavior\n    node.classList.toggle(classname);\n  else\n    node.classList.toggle(classname, settoggle);\n}\n\n/**\n     Toggle classes in a node\n *\n    @param node - Node which classes to toggle\n    @param toggles - Object, all keys will be added/removed based on the truthyness of their values\n */\nexport function toggleClasses(node: Element, toggles: { [key: string]: boolean }) {\n  if (typeof (toggles) !== \"object\")\n    throw new Error(\"Expected an object with keys as classnames\");\n  Object.keys(toggles).forEach(key => node.classList[toggles[key] ? \"add\" : \"remove\"](key));\n}\n\n/* remove the contents of an existing node */\n/** @deprecated Use node.replaceChildren() */\nexport function empty(node: Element) {\n  if (node.replaceChildren) {\n    node.replaceChildren();\n    return;\n  }\n  //TODO: Warn about out-of-date browser?\n  while (node.lastChild)\n    node.removeChild(node.lastChild);\n}\n\nexport function isDomReady() {\n  //ensure no domready events can run if there will never be a dom\n  return typeof document !== \"undefined\" && (document.readyState === \"interactive\" || document.readyState === \"complete\");\n}\n\n/* run the specified function 'on ready'. adds to DOMContentLoaded if dom is not ready yet. Exceptions/rejections from the ready handler will not be fatal to the rest of code execution */\nexport function onDomReady(callback: () => unknown | Promise<unknown>) {\n  if (isDomReady()) {\n    try {\n      void callback(); //Ignore unhandled rejections\n    } catch (e) { // We don't want our caller to 'stop' due to a domready exception as its usually the toplevel initialization code, so log the exception ourselves\n      void Promise.reject(new Error(\"Synchronous onDomReady handler failed\", { cause: e })); //Let it propagate as a standard unhandled rejection\n    }\n  } else\n    document.addEventListener(\"DOMContentLoaded\", () => void callback());\n}\n\n//parse JSON data, throw with more info on parse failure\nexport function getJSONAttribute<T>(node: Element, attributename: string): T | null {\n  try {\n    if (node.hasAttribute(attributename))\n      return JSON.parse(node.getAttribute(attributename) as string);\n  } catch (e) {\n    console.error(\"JSON parse failure on attribute '\" + attributename + \"' of node\", node);\n    throw e;\n  }\n  return null;\n}\n\n/**\n     Get the base URI of the current document. IE11 doesn't implement document.baseURI\n *\n    @param doc - Document to query. Defaults to window.document\n    @deprecated Use document.baseURI\n */\nexport function getBaseURI(doc: Document | undefined) {\n  if (!doc)\n    doc = window.document;\n  if (doc.baseURI)\n    return doc.baseURI;\n\n  const base = doc.querySelector('base');\n  if (base && base.href)\n    return base.href;\n  return doc.URL;\n}\n\n/**\n     Sets multiple styles on a node, automatically adding 'px' to numbers when appropriate\n    (can be used as replacement for Mootools .setStyles)\n *\n * @param node - Node to update\n * @param value - Styles to set\n */\nexport function setStyles(node: HTMLElement, value?: string | { [key: string]: string | number }) {\n  if (!value)\n    node.style.cssText = '';\n  else if (typeof value === 'string')\n    node.style.cssText = value || '';\n  else {\n    for (const [key, propvalue] of Object.entries(value)) {\n      // for numbers, add 'px' if the constant isn't dimensionless (eg zIndex)\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any -- we don't know which keys will be set\n      (node.style as any)[key] = typeof value[key] === 'number' && IS_NON_DIMENSIONAL.test(key) === false\n        ? propvalue + 'px'\n        : propvalue;\n    }\n  }\n}\n","import { append, setStyles } from './tree';\n\n// This will assign the `any` type to the list of accepted attributes for elements constructed via JSX syntax.\ndeclare global {\n  // eslint-disable-next-line @typescript-eslint/no-namespace\n  namespace JSX {\n    interface IntrinsicElements {\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      [eleName: string]: any;\n    }\n  }\n}\n\ntype CreateAttributes = {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  [key: string]: any;\n  on?: {\n    [key in keyof GlobalEventHandlersEventMap]?: (evt: GlobalEventHandlersEventMap[key]) => void;\n  };\n};\n\ntype CreateElementFunction = (attributes: CreateAttributes, _1?: null, _2?: null) => HTMLElement;\n\nfunction flattenArray<T>(list: T[]): T[] {\n  return list.reduce((acc: T[], elt) => acc.concat(Array.isArray(elt) ? flattenArray(elt) : elt), []);\n}\n\nfunction setClassName(node: Element, value?: string | string[] | { [key: string]: boolean }) {\n  if (!value)\n    node.className = '';\n  else if (typeof value === 'string')\n    node.className = value || '';\n  else if (Array.isArray(value))\n    node.className = value.filter(elt => elt && typeof elt === 'string').join(\" \");\n  else if (typeof value === \"object\") {\n    let str = \"\";\n    Object.keys(value).forEach((key, idx) => { if (value[key]) str += (idx ? \" \" : \"\") + key; });\n    node.className = str;\n  }\n}\n\n/**\n     Matches non-first uppercase characters\n    (when the second char is uppercases, the first char is passed too)\n */\nconst MATCH_UPCASE = /([A-Z])/g;\nconst MATCH_DASH_AND_CHAR = /-([a-zA-Z])/g;\n\n/**\n Convert a camelCased identifier to a dashed string\n *\n * @param value - identifier to convert\n */\nexport function toDashed(value: string) {\n  if (value)\n    return (value.substring(0, 1) + value.substring(1).replace(MATCH_UPCASE, \"-$1\")).toLowerCase();\n  return \"\";\n}\n\n/**\n Convert a dashed string to a camelCase identifier\n *\n * @param value - identifier to convert\n */\nexport function toCamel(value: string) {\n  return value.replace(MATCH_DASH_AND_CHAR, (_, match_1) => match_1.toUpperCase());\n}\n\nfunction attrHasBooleanValue(propname: string) {\n  return ['disabled', 'checked', 'selected', 'readonly', 'multiple', 'ismap'].includes(propname);\n}\n\nexport function createElement(elementname: string, attributes?: CreateAttributes, toattrs?: boolean) {\n  const node = document.createElement(elementname);\n  if (attributes) {\n    Object.keys(attributes).forEach(attrname => {\n      if (attrname === 'events')\n        throw new Error(\"Use 'on' instead of 'events' in dompack.create\");\n      if (attrname === 'styles')\n        throw new Error(\"Use 'style' instead of 'styles' in dompack.create\");\n      if (attrname === 'children') {\n        // allow null 'children' property for jsxcreate, property delete is detrimental to performance.\n        if (attributes[attrname])\n          throw new Error(\"Use 'childNodes' instead of 'children' in dompack.create\");\n        return;\n      }\n\n      const value = attributes[attrname];\n\n      if (attrname === 'on') //create event listeners\n        return void Object.keys(value).forEach(eventname => node.addEventListener(eventname, value[eventname], false));\n      else if (attrname.startsWith(\"on\"))\n        return void node.addEventListener(toDashed(attrname.substring(2)), value, false);\n\n      if (attrname === \"className\" || attrname === \"class\") {\n        if (node.className) // already modified the class?\n          throw new Error(\"Specify either 'className' or 'class' to dompack.create, but not both\");\n        setClassName(node, value);\n        return;\n      }\n\n      if (attrname === 'style')\n        return void setStyles(node, value);\n\n      if (attrname === 'dataset') //explicitly assign\n        return void Object.assign(node[attrname], value);\n\n      if (attrname === 'childNodes') //append as children\n        return void append(node, ...attributes.childNodes.filter((child: Node | string | number | boolean | null) => child !== null && child !== true && child !== false && child !== undefined));\n\n      if (toattrs && attrHasBooleanValue(attrname)) {\n        if (value)\n          node.setAttribute(attrname, \"\");\n        else\n          node.removeAttribute(attrname);\n        return;\n      }\n\n      if (toattrs && !attrname.startsWith(\"prop\")) {\n        if (value !== null && value !== undefined) {\n          if (value && typeof value === \"object\")\n            throw new Error(\"Cannot store non-null objects in attributes, use a property starting with 'prop'\");\n          node.setAttribute(attrname, attributes[attrname]);\n        }\n      } else {\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any -- we don't know which keys will be set\n        (node as any)[attrname] = attributes[attrname];\n      }\n    });\n  }\n  return node;\n}\n\n/* create elements. sets properties (not attributes!) immediately.\n   everything inside 'on' is added as an addEventListener without capture\n   everything inside 'childNodes' is appended to the node. nulls are ignored inside childNodes\n\n   Examples:\n   domtools.create(\"input\", { type:\"file\", className: \"myupload\", style: { display: \"none\" }));\n\n*/\nexport function create<K extends keyof HTMLElementTagNameMap>(elementname: K, attributes?: CreateAttributes, children?: Array<Node | string>): HTMLElementTagNameMap[K];\nexport function create(elementname: string, attributes?: CreateAttributes, children?: Array<Node | string>): HTMLElement;\n\nexport function create(elementname: string, attributes?: CreateAttributes, children?: Array<Node | string>) {\n  const el = createElement(elementname, attributes, false);\n  if (children?.length)\n    el.append(...children);\n  return el;\n}\n\n/** Function to create for jsx, create elements directly (instead of virtual dom nodes).\n\n    import * as dompack from 'dompack';\n\n    /* \\@jsx dompack.jsxcreate *\\/\n    /* \\@jsxFrag dompack.jsxfragment *\\/\n    your code\n\n    @param element - Name of the element to create\n    @param childNodes - Any child nodes to add immediately\n*/\nexport function jsxcreate<K extends keyof HTMLElementTagNameMap>(element: K, attributes: CreateAttributes, ...childNodes: Array<Node | string | number>): HTMLElementTagNameMap[K];\nexport function jsxcreate(element: string | CreateElementFunction, attributes: CreateAttributes, ...childNodes: Array<Node | string | number>): HTMLElement;\n\nexport function jsxcreate(element: string | CreateElementFunction, attributes: CreateAttributes, ...childNodes: Array<Node | string | number>): HTMLElement {\n  // Ensure attributes\n  attributes = attributes || {};\n  // Flatten childnodes arrays, convert numbers to strings. Also support children property (React uses that)\n  let parts: Array<Node | string | number> = (attributes.childNodes || []).concat(attributes.children || []).concat(childNodes);\n  if (attributes.children)\n    attributes.children = null;\n  parts = flattenArray(parts);\n  parts = parts.map((elt) => typeof elt === \"number\" ? String(elt) : elt);\n  // Create the element\n  attributes.childNodes = parts;\n  if (typeof element === \"function\")\n    return element(attributes, null, null);\n  return createElement(element, attributes, true);\n}\n\nexport function jsxfragment(inp: Node): DocumentFragment {\n  const frag = document.createDocumentFragment();\n  frag.append(...inp.childNodes);\n  return frag;\n}\n","import * as domtree from './tree';\nimport * as domevents from './events';\n\nexport type TakeFocusEvent = CustomEvent<{ options?: FocusOptions }>;\n\ndeclare global {\n  interface GlobalEventHandlersEventMap {\n    \"dompack:takefocus\": TakeFocusEvent;\n  }\n}\n\ntype RegistrationHandler<E extends Element = HTMLElement> = (node: E, index?: number) => void;\ntype ComponentRegistration<E extends Element = HTMLElement> =\n  {\n    selector: string;\n    handler: RegistrationHandler<E>;\n    index: number;\n    num: number;\n    afterdomready: boolean;\n  };\n\nconst components: Array<ComponentRegistration<Element>> = [];\nconst map = new WeakMap();\n\n//is a node completely in the dom? if we can find a sibling anywhere, it must be closed\nfunction isNodeCompletelyInDom(node: Element | null) {\n  for (; node; node = node.parentElement)\n    if (node.nextSibling)\n      return true;\n  return false;\n}\nfunction processRegistration<E extends Element>(item: E, reg: ComponentRegistration<E>, domready: boolean) {\n  if (!domready && !isNodeCompletelyInDom(item))\n    return; //not safe to register\n\n  if (!map.has(item))\n    map.set(item, [reg.num]);\n  else {\n    const list = map.get(item);\n    if (list.includes(reg.num))\n      return;\n    list.push(reg.num);\n  }\n  reg.handler(item, reg.index++); //note: if an exception is reported from Object.handler,\n}\nfunction applyRegistration<E extends Element>(reg: ComponentRegistration<E>, startnode?: Element) {\n  const domready = domtree.isDomReady();\n  if (reg.afterdomready && !domready)\n    return;\n\n  const items = Array.from((startnode || document).querySelectorAll(reg.selector)) as E[];\n  if (startnode?.matches(reg.selector))\n    items.unshift(startnode as E); //if startnode matches it has to be an E\n\n  items.forEach(item => {\n    try {\n      processRegistration<E>(item, reg, domready);\n    } catch (e) {\n      console.error(\"Exception handling registration of\", item, \"for rule\", reg.selector);\n      console.log(\"Registration\", reg);\n      if (e instanceof Error) {\n        console.log(e, e.stack);\n        if (window.onerror) {\n          // Send to onerror to trigger exception reporting\n          try {\n            // @ts-expect-error: fileName, lineNumber and columnNumber are non-standard\n            window.onerror(e.message, e.fileName || \"\", e.lineNumber || 1, e.columNumber || 1, e);\n          } catch (e2) { }\n        }\n      } else\n        console.log(e);\n    }\n  });\n}\n\n/* A focus implementation that allows the node to intercept focused, allowing eg\n   radio/checkbox replacements to redirect focus but also explicitly preventing\n   focus of a disabled element\n   Returns true when the focus operation was successfull or handled by an event handler.\n   @param node Node to focus\n   @param options.preventScroll Prevent scroll to focused element\n*/\nexport function focus(node: Element, options?: FocusOptions) {\n  if (!domevents.dispatchCustomEvent(node, 'dompack:takefocus', { bubbles: true, cancelable: true, detail: { options } }))\n    return true;\n\n  if (typeof (node as HTMLElement).focus !== \"function\" || (node as HTMLInputElement).disabled)\n    return false;\n\n  (node as HTMLInputElement).focus(options);\n  return true;\n}\n\n/**\n * @param node - Node to show\n * @param options - Scroll options\n * @deprecated invoke scrollIntoView directly  on the nodes\n */\nexport function scrollIntoView(node: Element, options?: ScrollIntoViewOptions) {\n  node.scrollIntoView(options);\n  return true;\n}\n\n/**\n    Register a component for auto-initialization.\n\n    @param selector - Selector the component must match\n    @param handler - Handler\n    @param options - Any unrecognized options are passed to the handler\n\n    The handler will be invoked with two parameters\n    - the node to register\n    - the index of the node (a unique counter for this selector - first is 0)\n */\n\nexport function register<E extends Element = HTMLElement>(selector: string, handler: RegistrationHandler<E>, options?: { afterdomready: boolean }) {\n  const newreg: ComponentRegistration<E> =\n  {\n    selector: selector,\n    handler: handler,\n    index: 0,\n    num: components.length,\n    afterdomready: !options || options.afterdomready\n  };\n  if (components.length === 0 && !domtree.isDomReady()) //first component... we'll need a ready handler\n    domtree.onDomReady(() => registerMissed());\n\n  components.push(newreg as ComponentRegistration<Element>);\n  applyRegistration(newreg);\n}\n\n// register any components we missed on previous scans\nexport function registerMissed(startnode?: Element) {\n  const todo = components.slice(0);\n  todo.forEach(item => applyRegistration(item, startnode));\n}\n","export type CookieOptions = {\n  path?: string;\n  domain?: string | null;\n  expires?: Date | Temporal.Instant | null;\n  duration?: number | null;\n  secure?: boolean;\n  sameSite?: \"Strict\" | \"Lax\" | \"None\";\n};\n\nexport type ServersideCookieOptions = CookieOptions & {\n  httpOnly?: boolean;\n};\n\nexport function buildCookieHeader(name: string, value: string, options?: ServersideCookieOptions) {\n  let header = `${name}=${encodeURIComponent(value)}`;\n  if (options?.domain)\n    header += ';domain=' + options?.domain;\n  header += ';path=' + (options?.path || '/');\n  if (!value) //clearing a cookie, so ignore expires/duration and just set 1970\n    header += ';expires=Thu, 01 Jan 1970 00:00:00 GMT';\n  else if (options?.expires) //we need toUTCString to give us the proper Date formatting\n    header += ';expires=' + (\"epochMilliseconds\" in options.expires ? new Date(options.expires.epochMilliseconds) : options.expires).toUTCString();\n  else if (options?.duration) {\n    const date = new Date();\n    date.setTime(date.getTime() + options?.duration * 24 * 60 * 60 * 1000);\n    header += ';expires=' + date.toUTCString();\n  }\n  if (options?.secure)\n    header += ';secure';\n  if (options?.sameSite)\n    header += ';SameSite=' + options?.sameSite;\n  if (options?.httpOnly) //NOTE browsers cannot effectively set this\n    header += ';HttpOnly';\n  return header;\n}\n","import { buildCookieHeader, type CookieOptions } from '@webhare/dompack/src/cookiebuilder';\nimport { escapeRegExp, parseTyped, stringify } from '@webhare/std';\n\nconst backup: {\n  sessionStorage?: Record<string, string>;\n  localStorage?: Record<string, string>;\n} = {};\ntype BrowserStorage = keyof typeof backup;\n\nexport function listCookies() {\n  return document.cookie.split(';').map(cookie => {\n    const parts = cookie.split('=');\n    return { name: decodeURIComponent(parts[0].trim()), value: decodeURIComponent(parts[1] || '') };\n  });\n}\n\nexport function setCookie(key: string, value: string, options?: CookieOptions) {\n  document.cookie = buildCookieHeader(key, value, options);\n}\n\nexport function getCookie(key: string): string | null {\n  const value = document.cookie.match('(?:^|;)\\\\s*' + escapeRegExp(key) + '=([^;]*)');\n  return (value) ? decodeURIComponent(value[1]) : null;\n}\n\nexport function deleteCookie(key: string, options?: CookieOptions) {\n  setCookie(key, '', { ...options, duration: -1, expires: undefined });\n}\n\nfunction get(storage: BrowserStorage, key: string): unknown | null {\n  let foundvalue: string | undefined | null = backup[storage]?.[key];\n  if (foundvalue) //if it's in the backups storage encoding can't fail either\n    return parseTyped(foundvalue);\n\n  try {\n    foundvalue = window[storage].getItem(key);\n    if (foundvalue)\n      return parseTyped(foundvalue);\n  } catch (e) {\n    //we ignore parse failures\n  }\n  return null;\n}\n\nfunction set(storage: BrowserStorage, key: string, value: unknown) {\n  const tostore = value !== null && value !== undefined ? stringify(value, { typed: true }) : null;\n  try {\n    if (tostore !== null)\n      window[storage].setItem(key, tostore);\n    else\n      window[storage].removeItem(key);\n    return;\n  } catch (e) {\n    //ignore\n  }\n\n  const store = (backup[storage] ||= {});\n  if (tostore !== null)\n    store[key] = tostore;\n  else\n    delete store[key];\n}\n\nexport function getSession<T>(key: string): T | null {\n  return get(\"sessionStorage\", key) as T | null;\n}\nexport function setSession<T>(key: string, value: T | null) {\n  set(\"sessionStorage\", key, value);\n}\nexport function getLocal<T>(key: string): T | null {\n  return get(\"localStorage\", key) as T | null;\n}\nexport function setLocal<T>(key: string, value: T | null) {\n  set(\"localStorage\", key, value);\n}\nexport function listSessionKeys() {\n  try {\n    return Object.keys(window.sessionStorage);\n  } catch (e) {\n    return Object.keys(backup.sessionStorage || {});\n  }\n}\nexport function listLocalKeys() {\n  try {\n    return Object.keys(window.localStorage);\n  } catch (e) {\n    return Object.keys(backup.localStorage || {});\n  }\n}\n","/** Load an image\n * @param imgsrc - The image source URL\n * @returns A promise resolving to the image node\n */\nexport function loadImage(imgsrc: string): Promise<HTMLImageElement> {\n  return new Promise((resolve, reject) => {\n    const img = new Image;\n    img.onload = () => {\n      resolve(img);\n    };\n    img.onerror = reject;\n    img.src = imgsrc;\n  });\n}\n\n/** Load a JavaScript file and add it to the DOM\n * @param scriptsrc - The script source URL\n * @param options.module - Load as module\n * @returns A promise resolving to the script node\n */\nexport function loadScript(scriptsrc: string, options?: { module?: boolean; doc?: Document }): Promise<HTMLScriptElement> {\n  return new Promise((resolve, reject) => {\n    const doc = options?.doc ?? document;\n    const scripttag = doc.createElement('script');\n    scripttag.onload = () => {\n      resolve(scripttag);\n    };\n    scripttag.onerror = reject;\n    scripttag.src = scriptsrc;\n    if (options?.module)\n      scripttag.type = \"module\";\n\n    doc.querySelector('head,body')?.appendChild(scripttag);\n  });\n}\n\n/** Load a CSS file and add it to the DOM\n * @param src - The CSS source URL\n * @returns A promise resolving to the link node\n*/\nexport function loadCSS(src: string, options?: { doc?: Document }): Promise<HTMLLinkElement> {\n  const doc = options?.doc ?? document;\n  const element = doc.createElement('link');\n  element.type = 'text/css';\n  element.rel = 'stylesheet';\n  element.href = src;\n\n  const retval = new Promise<HTMLLinkElement>((resolve, reject) => {\n    element.onload = () => resolve(element);\n    element.onerror = reject;\n  });\n\n  doc.querySelector('head,body')?.appendChild(element);\n  return retval;\n}\n","/* Identify devices for the purpose of analytics/tracing\n   NOT a library for feature detection!\n   Originally based on Mootools.Browser\n*/\n\nexport type Platform = \"windows\" | \"ios\" | \"webos\" | \"android\" | \"linux\" | \"mac\" | \"other\";\nexport type Device = \"desktop\" | \"mobile\" | \"tablet\" | \"\";\n\n/** Valid KeyboardEvent.key values (next to 'plain' keys)\n    This list was built from https://www.w3.org/TR/uievents-key/\n    using `console.log([...new Set([...document.querySelectorAll(\".key-table-key .key\")].map(_ => _.textContent))].toSorted().join(' | '))`\n*/\nexport type KeyAttributeValue = \"AVRInput\" | \"AVRPower\" | \"Accept\" | \"Again\" | \"AllCandidates\" | \"Alphanumeric\" | \"Alt\" | \"AltGraph\" | \"AppSwitch\" | \"ArrowDown\" | \"ArrowLeft\" | \"ArrowRight\" | \"ArrowUp\" | \"Attn\" | \"AudioBalanceLeft\" | \"AudioBalanceRight\" | \"AudioBassBoostDown\" | \"AudioBassBoostToggle\" | \"AudioBassBoostUp\" | \"AudioFaderFront\" | \"AudioFaderRear\" | \"AudioSurroundModeNext\" | \"AudioTrebleDown\" | \"AudioTrebleUp\" | \"AudioVolumeDown\" | \"AudioVolumeMute\" | \"AudioVolumeUp\" | \"Backspace\" | \"BrightnessDown\" | \"BrightnessUp\" | \"BrowserBack\" | \"BrowserFavorites\" | \"BrowserForward\" | \"BrowserHome\" | \"BrowserRefresh\" | \"BrowserSearch\" | \"BrowserStop\" | \"Call\" | \"Camera\" | \"CameraFocus\" | \"Cancel\" | \"CapsLock\" | \"ChannelDown\" | \"ChannelUp\" | \"Clear\" | \"Close\" | \"ClosedCaptionToggle\" | \"CodeInput\" | \"ColorF0Red\" | \"ColorF1Green\" | \"ColorF2Yellow\" | \"ColorF3Blue\" | \"ColorF4Grey\" | \"ColorF5Brown\" | \"Compose\" | \"ContextMenu\" | \"Control\" | \"Convert\" | \"Copy\" | \"CrSel\" | \"Cut\" | \"DVR\" | \"Dead\" | \"Delete\" | \"Dimmer\" | \"DisplaySwap\" | \"Eisu\" | \"Eject\" | \"End\" | \"EndCall\" | \"Enter\" | \"EraseEof\" | \"Escape\" | \"ExSel\" | \"Execute\" | \"Exit\" | \"F1\" | \"F10\" | \"F11\" | \"F12\" | \"F2\" | \"F3\" | \"F4\" | \"F5\" | \"F6\" | \"F7\" | \"F8\" | \"F9\" | \"FavoriteClear0\" | \"FavoriteClear1\" | \"FavoriteClear2\" | \"FavoriteClear3\" | \"FavoriteRecall0\" | \"FavoriteRecall1\" | \"FavoriteRecall2\" | \"FavoriteRecall3\" | \"FavoriteStore0\" | \"FavoriteStore1\" | \"FavoriteStore2\" | \"FavoriteStore3\" | \"FinalMode\" | \"Find\" | \"Fn\" | \"FnLock\" | \"GoBack\" | \"GoHome\" | \"GroupFirst\" | \"GroupLast\" | \"GroupNext\" | \"GroupPrevious\" | \"Guide\" | \"GuideNextDay\" | \"GuidePreviousDay\" | \"HangulMode\" | \"HanjaMode\" | \"Hankaku\" | \"HeadsetHook\" | \"Help\" | \"Hibernate\" | \"Hiragana\" | \"HiraganaKatakana\" | \"Home\" | \"Hyper\" | \"Info\" | \"Insert\" | \"InstantReplay\" | \"JunjaMode\" | \"KanaMode\" | \"KanjiMode\" | \"Katakana\" | \"Key11\" | \"Key12\" | \"LastNumberRedial\" | \"LaunchApplication1\" | \"LaunchApplication2\" | \"LaunchCalendar\" | \"LaunchContacts\" | \"LaunchMail\" | \"LaunchMediaPlayer\" | \"LaunchMusicPlayer\" | \"LaunchPhone\" | \"LaunchScreenSaver\" | \"LaunchSpreadsheet\" | \"LaunchWebBrowser\" | \"LaunchWebCam\" | \"LaunchWordProcessor\" | \"Link\" | \"ListProgram\" | \"LiveContent\" | \"Lock\" | \"LogOff\" | \"MailForward\" | \"MailReply\" | \"MailSend\" | \"MannerMode\" | \"MediaApps\" | \"MediaAudioTrack\" | \"MediaClose\" | \"MediaFastForward\" | \"MediaLast\" | \"MediaNextTrack\" | \"MediaPause\" | \"MediaPlay\" | \"MediaPlayPause\" | \"MediaPreviousTrack\" | \"MediaRecord\" | \"MediaRewind\" | \"MediaSkipBackward\" | \"MediaSkipForward\" | \"MediaStepBackward\" | \"MediaStepForward\" | \"MediaStop\" | \"MediaTopMenu\" | \"MediaTrackNext\" | \"MediaTrackPrevious\" | \"Meta\" | \"MicrophoneToggle\" | \"MicrophoneVolumeDown\" | \"MicrophoneVolumeMute\" | \"MicrophoneVolumeUp\" | \"ModeChange\" | \"NavigateIn\" | \"NavigateNext\" | \"NavigateOut\" | \"NavigatePrevious\" | \"New\" | \"NextCandidate\" | \"NextFavoriteChannel\" | \"NextUserProfile\" | \"NonConvert\" | \"Notification\" | \"NumLock\" | \"OnDemand\" | \"Open\" | \"PageDown\" | \"PageUp\" | \"Pairing\" | \"Paste\" | \"Pause\" | \"PinPDown\" | \"PinPMove\" | \"PinPToggle\" | \"PinPUp\" | \"Play\" | \"PlaySpeedDown\" | \"PlaySpeedReset\" | \"PlaySpeedUp\" | \"Power\" | \"PowerOff\" | \"PreviousCandidate\" | \"Print\" | \"PrintScreen\" | \"Process\" | \"Props\" | \"RandomToggle\" | \"RcLowBattery\" | \"RecordSpeedNext\" | \"Redo\" | \"RfBypass\" | \"Romaji\" | \"STBInput\" | \"STBPower\" | \"Save\" | \"ScanChannelsToggle\" | \"ScreenModeNext\" | \"ScrollLock\" | \"Select\" | \"Settings\" | \"Shift\" | \"SingleCandidate\" | \"Soft1\" | \"Soft2\" | \"Soft3\" | \"Soft4\" | \"SpeechCorrectionList\" | \"SpeechInputToggle\" | \"SpellCheck\" | \"SplitScreenToggle\" | \"Standby\" | \"Subtitle\" | \"Super\" | \"Symbol\" | \"SymbolLock\" | \"TV\" | \"TV3DMode\" | \"TVAntennaCable\" | \"TVAudioDescription\" | \"TVAudioDescriptionMixDown\" | \"TVAudioDescriptionMixUp\" | \"TVContentsMenu\" | \"TVDataService\" | \"TVInput\" | \"TVInputComponent1\" | \"TVInputComponent2\" | \"TVInputComposite1\" | \"TVInputComposite2\" | \"TVInputHDMI1\" | \"TVInputHDMI2\" | \"TVInputHDMI3\" | \"TVInputHDMI4\" | \"TVInputVGA1\" | \"TVMediaContext\" | \"TVNetwork\" | \"TVNumberEntry\" | \"TVPower\" | \"TVRadioService\" | \"TVSatellite\" | \"TVSatelliteBS\" | \"TVSatelliteCS\" | \"TVSatelliteToggle\" | \"TVTerrestrialAnalog\" | \"TVTerrestrialDigital\" | \"TVTimer\" | \"Tab\" | \"Teletext\" | \"Undo\" | \"Unidentified\" | \"VideoModeNext\" | \"VoiceDial\" | \"WakeUp\" | \"Wink\" | \"Zenkaku\" | \"ZenkakuHankaku\" | \"ZoomIn\" | \"ZoomOut\" | \"ZoomToggle\";\n\nexport type UserAgentInfo =\n  {\n    /** Browser name, eg 'chrome' or 'firefox' */\n    name: string;\n    /** Browser numeric version (eg 97) */\n    version: number;\n    /** Platform the browser is running on (eg 'windows') */\n    platform: Platform;\n    /** Type of device (eg 'desktop' or 'tablet' for an iPad) */\n    device: Device;\n    /** platform-browsername-version eg ios-safari-11 */\n    triplet: string;\n  };\n\nexport function parseUserAgent(ua: string): UserAgentInfo {\n  ua = ua.toLowerCase();\n\n  // chrome is included in the edge UA, so need to check for edge first, before checking if it's chrome.\n  // safari is included in the miuibrowser UA, so need to check for miuibrowser first, before checking if it's safari.\n  let UA: RegExpMatchArray | null = ua.match(/(edge|miuibrowser)[\\s/:]([\\w\\d.]+)/);\n  if (!UA)\n    UA = ua.match(/(opera|ie|firefox|chrome|trident|crios|version)[\\s/:]([\\w\\d.]+)?.*?(safari|(?:rv[\\s/:]|version[\\s/:])([\\w\\d.]+)|$)/);\n  if (!UA) { //try ios 11.4.1\n    UA = ua.match(/; cpu os ([\\d]+)/);\n    if (UA)\n      UA = ['', 'safari', UA[1]];\n  }\n  if (!UA)\n    UA = ['', 'unknown', \"0\"];\n\n  if (UA[1] === 'trident') {\n    UA[1] = 'ie';\n    if (UA[4]) UA[2] = UA[4];\n  } else if (UA[1] === 'crios') {\n    UA[1] = 'chrome';\n  }\n\n  let platform = ua.match(/ip(?:ad|od|hone)/) ? 'ios' : (ua.match(/(?:webos|android)/) || ua.match(/mac|win|linux/) || ['other'])[0];\n  if (platform === 'win')\n    platform = 'windows';\n\n  const name = (UA[1] === 'version') ? UA[3] : UA[1];\n  const version = parseInt((UA[1] === 'opera' && UA[4]) ? UA[4] : UA[2]);\n  const device = ua.match(/ipad/) ? 'tablet' : ['ios', 'webos', 'android'].includes(platform) ? 'mobile' : ['mac', 'windows', 'linux'].includes(platform) ? 'desktop' : '';\n\n  return {\n    name,\n    version,\n    platform: platform as Platform,\n    device,\n    triplet: platform + '-' + name + '-' + version\n  };\n}\n\n/**\n * Is the native 'multiselect' modifier for this platform pressed? (Cmd for Mac, Ctrl for Windows/Linux)\n *\n * @param event - Event to check\n */\nexport function isMultiSelectKey(event: KeyboardEvent | MouseEvent): boolean {\n  return getBrowser().platform === 'mac' ? event.metaKey : event.ctrlKey;\n}\n\n/**\n * Is the native 'copy' modifier for this platform pressed?\n *\n * @param event - Event to check\n */\nexport function isCopyKey(event: KeyboardEvent | MouseEvent): boolean {\n  return getBrowser().platform === 'mac' ? event.altKey : event.ctrlKey;\n}\n\nlet browser: Readonly<UserAgentInfo> | undefined;\n\n/** Get browser information */\nexport function getBrowser(): Readonly<UserAgentInfo> {\n  browser ||= Object.freeze(parseUserAgent(globalThis.navigator?.userAgent || \"\"));\n  //Offer this as a function to improve treeshakability\n  return browser;\n}\n\n//CSS Query used to find valid submittors\nexport const submitselector = 'input[type=submit],input[type=image],button[type=submit],button:not([type])';\n//Must match possible types returned by the submitselector\nexport type SubmitSelectorType = HTMLInputElement | HTMLButtonElement;\n","// This gets TypeScript to refer to us by our @webhare/... name in auto imports:\ndeclare module \"@webhare/dompack\" {\n}\n\n/* This is our public api */\nexport { flagUIBusy, setupBusyModal } from './busy';\nexport type { UIBusyLock, BusyModalEvent } from './busy';\nexport { dispatchCustomEvent, dispatchDomEvent, fireModifiedEvents, changeValue, stop, addDocEventListener } from '../../../modules/system/js/dompack/src/events';\nexport type { DocEvent, DomEventOptions } from '../../../modules/system/js/dompack/src/events';\nexport { qS, qR, qSA, isFormControl, isEditControl, isElement, isHTMLElement, isSVGElement, getRelativeBounds, getLang } from './tree';\nexport type { FormControlElement, Rect } from './tree';\nexport { isDomReady, onDomReady } from '../../../modules/system/js/dompack/src/tree';\nexport { create, jsxcreate, jsxfragment } from '../../../modules/system/js/dompack/src/create';\nexport { focus, register, registerMissed } from '../../../modules/system/js/dompack/src/components';\nexport type { TakeFocusEvent } from '../../../modules/system/js/dompack/src/components';\nexport { getLocal, setLocal, getSession, setSession, listCookies, getCookie, setCookie, deleteCookie, listLocalKeys, listSessionKeys } from './storage';\nexport { loadImage, loadScript, loadCSS } from \"./preload\";\nexport { getBrowser, isMultiSelectKey, isCopyKey } from './browser';\nexport type { KeyAttributeValue, UserAgentInfo, Platform, Device } from './browser';\n\n/** @deprecated As 'Lock' conflicts, in WH5.4+ you can safely switch to UIBusyLock */\nimport type { UIBusyLock } from './busy';\nexport type Lock = UIBusyLock;\n","/* Note: we avoid resetting eg. ul,ol,li as that takes a lot more 'repair' work (ie the bullets would overlap with text without further chnages) */\nhtml, body, p, h1, h2, h3, h4, h5, h6, form\n{\n  padding: 0;\n  margin: 0;\n}\nimg { border: none; }\ndatalist, template { display: none; }\n\n*, *::before, *::after\n{\n  box-sizing: border-box;\n}\n\nbody\n{\n  -moz-text-size-adjust: none; /* Firefox for Android */\n  -webkit-text-size-adjust: none; /* iOS Safari */\n  text-size-adjust: none;\n}\n","/* Required form rules */\n\n/* Hide explicitly hidden pages and groups\n   Initially hide second and further pages, unless explicitly marked as visible (better for initial rendering\n   fhn debugflag should show eveything but we shouldn't increase specificity over what it once was */\n\n   :is(html:not(.dompack--debug-fnh)) .wh-form__page ~ .wh-form__page:not(.wh-form__page--visible)\n   , :is(html:not(.dompack--debug-fnh)) .wh-form__page--hidden\n   , :is(html:not(.dompack--debug-fnh)) .wh-form__fieldgroup--hidden\n   , :is(html:not(.dompack--debug-fnh)) .wh-form__fieldline--hidden\n   {\n     display:none;\n   }\n\n     :is(html.dompack--debug-fnh) .wh-form__page ~ .wh-form__page:not(.wh-form__page--visible)\n   , :is(html.dompack--debug-fnh) .wh-form__page--hidden\n   , :is(html.dompack--debug-fnh) .wh-form__fieldgroup--hidden\n   , :is(html.dompack--debug-fnh) .wh-form__fieldline--hidden\n   {\n     opacity: 0.5;\n   }\n\n   .wh-form:not(.wh-form--allowprevious) .wh-form__button--previous\n   , .wh-form:not(.wh-form--allownext) .wh-form__button--next\n   , .wh-form:not(.wh-form--allowsubmit) .wh-form__button--submit\n   , .wh-form:not(.wh-form--allowsubmit) .wh-form__captchapage\n   {\n     display:none;\n   }\n","@charset \"UTF-8\";\n/* Global rules first, then per component, in the order tech42v2 loaded them (its frontend.scss, then the scoped\n   styles of the Vue components) */\n/* Global rules, from tech42v2 frontend/frontend.scss */\n:root {\n  --c-ink: #171f1c;\n  --c-paper: #f5f8f6;\n  --c-mist: #e0e8e3;\n  --c-orange: #ff7700;\n  --c-soft: #c0cfc6;\n  --c-muted: #3a4b44;\n  --c-footer: #3b4a45;\n  --c-line: #d1d6d4;\n  --font: \"Stack Sans Text\", \"Stack Sans Fallback\", ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", sans-serif;\n  /* One side margin for the navigation and every section, so content lines up and fills large screens */\n  --gutter: clamp(20px, 4vw, 51px);\n  /* For blocks that already sit inside a 24px outer frame (contact card, footer card) */\n  --gutter-inset: max(20px, calc(var(--gutter) - 24px));\n  --section-space: clamp(112px, 12vw, 176px);\n}\n\nhtml {\n  background: var(--c-ink);\n  color: var(--c-paper);\n  font-family: var(--font);\n  -webkit-font-smoothing: antialiased;\n  text-rendering: optimizeLegibility;\n}\n\nbody {\n  margin: 0;\n}\n\n/* The page's own parts outside <main> that swup swaps along (shell.witty); they must not form a box of their own */\n.swup-slot {\n  display: contents;\n}\n\n/* Until the entrance animations have set their starting point (see the script in the page head), the parts they\n   bring in stay out of sight, and the hero background already has the zoom it settles from */\n.motion-pending :is(.header, .hero__inner, .sp-hero__inner) {\n  visibility: hidden;\n}\n\n.motion-pending .hero__bg {\n  transform: scale(1.25);\n}\n\n/* Stand-in for the intro curtain until the script takes over (intro-curtain.ts): the same dark frosted glass the\n   reveal starts from, so the page never shows sharp first */\n.intro-pending body::after {\n  content: \"\";\n  position: fixed;\n  inset: 0;\n  z-index: 100;\n  pointer-events: none;\n  background: rgba(23, 31, 28, 0.85);\n  backdrop-filter: blur(32px);\n  -webkit-backdrop-filter: blur(32px);\n}\n\n/* An element the script shows later starts with the hidden attribute; component rules such as display: flex must not\n   bring it back */\n[hidden] {\n  display: none !important;\n}\n\nimg {\n  display: block;\n  max-width: 100%;\n}\n\n/* A photo sits in a <picture> only to offer it as AVIF; the <img> lays out as if the wrapper were not there */\npicture {\n  display: contents;\n}\n\n/* Without this a <source> becomes a grid item of its own once the wrapper is gone, and pushes the photo a cell on */\npicture > source {\n  display: none;\n}\n\na {\n  color: inherit;\n}\n\n/* Shared building blocks used by several sections */\n.wrap {\n  width: 100%;\n  margin-inline: auto;\n  padding-inline: var(--gutter);\n  box-sizing: border-box;\n}\n\n/* Android flashes a blue-grey box over anything you tap; on the rounded glass buttons that reads as a stray shadow.\n   Every link and button here has its own pressed or opened state */\na,\nbutton {\n  -webkit-tap-highlight-color: transparent;\n}\n\n.btn {\n  display: inline-flex;\n  align-items: center;\n  gap: 18px;\n  padding: 6px 6px 6px 24px;\n  border: 1px solid rgba(255, 255, 255, 0.2);\n  border-radius: 999px;\n  /* Lightly frosted orange with white text (brand choice; white on this orange is about 2.5:1) */\n  background: rgba(255, 119, 0, 0.72);\n  backdrop-filter: blur(12px);\n  color: #fff;\n  font-size: 14px;\n  font-weight: 500;\n  line-height: 1;\n  letter-spacing: -0.01em;\n  text-decoration: none;\n  transition: background-color 0.3s ease;\n}\n.btn:hover {\n  background: rgba(255, 119, 0, 0.9);\n}\n.btn:focus-visible {\n  outline: 2px solid var(--c-paper);\n  outline-offset: 3px;\n}\n\n.btn__icon {\n  display: grid;\n  width: 40px;\n  height: 40px;\n  place-items: center;\n  border-radius: 50%;\n  background: #fff;\n  color: var(--c-ink);\n  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);\n}\n\n.btn:hover .btn__icon {\n  transform: rotate(-45deg);\n}\n\n/* A button whose link is not known yet keeps its look but cannot be used */\n.btn[aria-disabled=true] {\n  cursor: default;\n}\n\n.visually-hidden {\n  position: absolute;\n  width: 1px;\n  height: 1px;\n  overflow: hidden;\n  clip: rect(0 0 0 0);\n  white-space: nowrap;\n}\n\n/* \"Explore\" label that follows the cursor near round buttons (lib/cursorHint.ts); GSAP moves and scales it */\n.cursor-hint {\n  position: absolute;\n  top: 0;\n  left: 0;\n  z-index: 3;\n  margin: 18px 0 0 18px;\n  padding: 9px 16px;\n  border-radius: 999px;\n  background: var(--c-ink);\n  color: var(--c-paper);\n  font-size: 14px;\n  line-height: 1;\n  white-space: nowrap;\n  pointer-events: none;\n  transform-origin: top left;\n}\n\n/* From tech42v2 App.vue */\n/* Split lines sit in a mask wrapper from SplitText that clips them. The wrapper (not the line) gets extra room\n   below, taken back with a negative margin, so descenders like g and y are not cut off with tight line heights */\n:has(> .split-line) {\n  padding-bottom: 0.2em;\n  margin-bottom: -0.2em;\n}\n\n/* Apply: a big card on the turning brand gradient */\n.jp-apply {\n  padding: 24px;\n  background: var(--c-ink);\n}\n\n.jp-apply__card {\n  position: relative;\n  display: flex;\n  min-height: min(720px, 90svh);\n  align-items: flex-end;\n  overflow: hidden;\n  border-radius: 28px;\n  background: var(--c-ink);\n  color: var(--c-paper);\n}\n\n.jp-apply__bg {\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  /* Square and larger than the card's diagonal (also on tall phone cards), so turning never shows a corner */\n  width: max(130%, 1100px);\n  aspect-ratio: 1;\n  background-position: center;\n  background-size: cover;\n  translate: -50% -50%;\n  rotate: 90deg;\n}\n\n.jp-apply__content {\n  position: relative;\n  width: 100%;\n  padding: 0 var(--gutter-inset) 64px;\n  box-sizing: border-box;\n}\n\n.jp-apply__title {\n  margin: 0;\n  font-size: clamp(72px, 15vw, 260px);\n  font-weight: 400;\n  line-height: 1;\n  letter-spacing: -0.05em;\n}\n\n.jp-apply__foot {\n  display: flex;\n  flex-wrap: wrap;\n  align-items: flex-end;\n  justify-content: space-between;\n  gap: 32px;\n  margin-top: 40px;\n  padding-top: 32px;\n  border-top: 1px solid rgba(245, 248, 246, 0.25);\n}\n\n.jp-apply__lead {\n  max-width: 22em;\n  margin: 0 0 12px;\n  font-size: clamp(20px, 1.8vw, 28px);\n  line-height: 1.2;\n  letter-spacing: -0.02em;\n}\n\n.jp-apply__text {\n  max-width: 32em;\n  margin: 0;\n  color: rgba(245, 248, 246, 0.85);\n  font-size: clamp(16px, 1.3vw, 19px);\n  font-weight: 300;\n  line-height: 1.55;\n}\n\n.jp-apply__actions {\n  display: grid;\n  justify-items: start;\n  gap: 14px;\n}\n\n.jp-apply__mail {\n  margin: 0;\n  color: rgba(245, 248, 246, 0.7);\n  font-size: 13px;\n  font-weight: 300;\n}\n\n.jp-apply__mail a {\n  color: var(--c-paper);\n}\n\n/* From tech42v2 ArrowIcon.vue */\n.arrow {\n  flex: none;\n  stroke: currentColor;\n  stroke-width: 1.2;\n  stroke-linecap: round;\n  stroke-linejoin: round;\n}\n\n.art-hero {\n  background: linear-gradient(180deg, rgba(23, 31, 28, 0.2), var(--c-ink) 85%), var(--art-hero-bg) right top/cover no-repeat, var(--c-ink);\n  color: var(--c-paper);\n}\n\n.art-hero__inner {\n  display: flex;\n  min-height: min(70svh, 640px);\n  flex-direction: column;\n  padding-block: 140px 56px;\n  box-sizing: border-box;\n}\n\n.art-back {\n  display: inline-flex;\n  align-self: flex-start;\n  align-items: center;\n  gap: 8px;\n  color: var(--c-soft);\n  font-size: 14px;\n  text-decoration: none;\n  transition: color 0.3s ease;\n}\n\n.art-back:hover {\n  color: var(--c-paper);\n}\n\n.art-hero__title {\n  max-width: 16em;\n  margin: auto 0 0;\n  padding-top: 48px;\n  font-size: clamp(40px, 5.6vw, 96px);\n  font-weight: 400;\n  line-height: 1;\n  letter-spacing: -0.04em;\n  text-wrap: balance;\n}\n\n.art-meta {\n  display: flex;\n  flex-wrap: wrap;\n  align-items: center;\n  gap: 8px 24px;\n  margin-top: 32px;\n  color: var(--c-soft);\n  font-size: 14px;\n}\n\n.art-meta__author {\n  display: inline-flex;\n  align-items: center;\n  gap: 10px;\n  color: var(--c-paper);\n}\n\n.art-meta__avatar {\n  width: 36px;\n  height: 36px;\n  border-radius: 50%;\n  object-fit: cover;\n}\n\n.art-cover {\n  padding-bottom: calc(var(--section-space) * 0.4);\n  background: var(--c-ink);\n}\n\n.art-cover__frame {\n  height: clamp(260px, 42vw, 620px);\n  overflow: hidden;\n  border-radius: 20px;\n}\n\n.art-cover__img {\n  width: 100%;\n  height: 100%;\n  object-fit: cover;\n}\n\n/* Article text: one readable column */\n.art-body {\n  padding-block: calc(var(--section-space) * 0.7) var(--section-space);\n  background: var(--c-paper);\n  color: var(--c-ink);\n}\n\n.art-prose {\n  max-width: 720px;\n  margin-inline: auto;\n  font-size: clamp(17px, 1.25vw, 19px);\n  font-weight: 300;\n  line-height: 1.65;\n}\n\n.art-prose :is(p, ul, ol) {\n  margin: 0 0 1.1em;\n}\n\n.art-prose :is(h2, h3) {\n  font-weight: 400;\n  letter-spacing: -0.025em;\n  text-wrap: balance;\n}\n\n.art-prose h2 {\n  margin: 0.6em 0 0.5em;\n  font-size: clamp(28px, 2.6vw, 38px);\n  line-height: 1.1;\n}\n\n.art-prose h3 {\n  margin: 1.6em 0 0.4em;\n  font-size: clamp(21px, 1.7vw, 25px);\n  line-height: 1.2;\n}\n\n.art-prose :is(ul, ol) {\n  padding-left: 1.3em;\n}\n\n.art-prose li {\n  margin-bottom: 0.45em;\n  padding-left: 0.3em;\n}\n\n.art-prose li::marker {\n  color: var(--c-orange);\n}\n\n/* No .art-prose strong rule: in tech42v2 it was scoped and never reached the bold text (BlogSegments is a\n   fragment), so bold text there is the browser's bolder (400). Same here, so both versions look the same */\n.art-prose hr {\n  margin: 2.4em 0;\n  border: 0;\n  border-top: 1px solid var(--c-line);\n}\n\n/* Reading progress bar: fixed along the very top, above the header */\n.art-progress {\n  position: fixed;\n  inset: 0 0 auto;\n  z-index: 20;\n  height: 3px;\n  pointer-events: none;\n}\n\n.art-progress__bar {\n  height: 100%;\n  background: var(--c-orange);\n  transform: scaleX(0);\n  transform-origin: left center;\n}\n\n.art-end {\n  max-width: 720px;\n  margin-inline: auto;\n}\n\n/* Share row under the article */\n.art-share {\n  display: flex;\n  flex-wrap: wrap;\n  align-items: center;\n  gap: 12px 20px;\n  margin-top: 56px;\n  padding-top: 28px;\n  border-top: 1px solid var(--c-line);\n}\n\n.art-share__label {\n  font-size: 15px;\n  font-weight: 400;\n}\n\n.art-share__list {\n  display: flex;\n  gap: 8px;\n  margin: 0;\n  padding: 0;\n  list-style: none;\n}\n\n.art-share__button {\n  display: grid;\n  width: 44px;\n  height: 44px;\n  place-items: center;\n  border: 1px solid var(--c-line);\n  border-radius: 50%;\n  background: #fff;\n  color: var(--c-ink);\n  cursor: pointer;\n  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;\n}\n\n.art-share__button:hover {\n  border-color: var(--c-orange);\n  background: var(--c-orange);\n  color: #fff;\n}\n\n.art-share__button svg {\n  width: 18px;\n  height: 18px;\n  fill: currentColor;\n}\n\n.art-share__button .art-share__line {\n  fill: none;\n  stroke: currentColor;\n  stroke-width: 1.7;\n  stroke-linecap: round;\n  stroke-linejoin: round;\n}\n\n.art-share__status {\n  color: var(--c-muted);\n  font-size: 13px;\n}\n\n/* Writer card: photo, name, role and a direct line */\n.art-author {\n  display: grid;\n  grid-template-columns: 150px minmax(0, 1fr);\n  gap: 28px;\n  margin-top: 40px;\n  padding: 28px;\n  border-radius: 20px;\n  background: var(--c-mist);\n}\n\n/* Portrait photo that fills the height of the card */\n.art-author__photo {\n  width: 150px;\n  height: 100%;\n  min-height: 210px;\n  border-radius: 16px;\n  object-fit: cover;\n  object-position: center 20%;\n}\n\n.art-author__text {\n  display: flex;\n  flex-direction: column;\n}\n\n.art-author__label {\n  color: var(--c-muted);\n  font-size: 13px;\n}\n\n.art-author__name {\n  margin-top: 4px;\n  font-size: 24px;\n  font-weight: 400;\n  letter-spacing: -0.02em;\n}\n\n.art-author__role {\n  color: var(--c-muted);\n  font-size: 14px;\n}\n\n.art-author__invite {\n  margin: 16px 0 0;\n  font-size: 16px;\n  line-height: 1.5;\n}\n\n.art-author__actions {\n  display: flex;\n  flex-wrap: wrap;\n  align-items: center;\n  gap: 12px 20px;\n  margin-top: 20px;\n}\n\n.art-author__call {\n  color: var(--c-ink);\n  font-size: 14px;\n}\n\n/* Other articles as link rows; lies on top of the contact section like the team block on the homepage */\n.art-more {\n  position: relative;\n  z-index: 2;\n  padding-block: calc(var(--section-space) * 0.6);\n  border-radius: 0 0 28px 28px;\n  background: var(--c-mist);\n  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);\n  color: var(--c-ink);\n}\n\n.art-more__title {\n  margin: 0 0 28px;\n  font-size: clamp(30px, 3.2vw, 48px);\n  font-weight: 400;\n  letter-spacing: -0.04em;\n}\n\n.art-more__list {\n  display: grid;\n  gap: 12px;\n  margin: 0;\n  padding: 0;\n  list-style: none;\n}\n\n.art-more__link {\n  display: grid;\n  grid-template-columns: minmax(0, 1fr) 48px;\n  grid-template-areas: \"meta icon\" \"name icon\";\n  align-items: center;\n  column-gap: 24px;\n  row-gap: 6px;\n  padding: 24px 28px;\n  border: 1px solid var(--c-line);\n  border-radius: 16px;\n  background: #fff;\n  color: inherit;\n  text-decoration: none;\n  transition: box-shadow 0.4s ease, translate 0.4s cubic-bezier(0.16, 1, 0.3, 1);\n}\n\n.art-more__link:hover {\n  box-shadow: 0 18px 40px rgba(23, 31, 28, 0.08);\n  translate: 0 -2px;\n}\n\n.art-more__meta {\n  grid-area: meta;\n  color: var(--c-muted);\n  font-size: 13px;\n}\n\n.art-more__name {\n  grid-area: name;\n  font-size: clamp(20px, 2vw, 28px);\n  letter-spacing: -0.025em;\n}\n\n.art-more__icon {\n  display: grid;\n  width: 48px;\n  height: 48px;\n  grid-area: icon;\n  place-items: center;\n  border: 1px solid var(--c-line);\n  border-radius: 50%;\n  transition: background-color 0.2s ease, border-color 0.2s ease;\n}\n\n.art-more__link:hover .art-more__icon {\n  border-color: var(--c-orange);\n  background: var(--c-orange);\n}\n\n@media (max-width: 560px) {\n  .art-author {\n    grid-template-columns: minmax(0, 1fr);\n    gap: 20px;\n    padding: 20px;\n  }\n  .art-author__photo {\n    width: 140px;\n    height: 180px;\n    min-height: 0;\n  }\n}\n@media (max-width: 860px) {\n  .art-hero__inner {\n    padding-block: 120px 40px;\n  }\n  .art-more__link {\n    padding: 20px;\n  }\n}\n.blog-hero {\n  background: linear-gradient(180deg, rgba(23, 31, 28, 0.2), var(--c-ink) 85%), var(--blog-hero-bg) right top/cover no-repeat, var(--c-ink);\n  color: var(--c-paper);\n}\n\n.blog-hero__inner {\n  display: flex;\n  min-height: min(70svh, 640px);\n  flex-direction: column;\n  justify-content: flex-end;\n  padding-block: 140px 72px;\n  box-sizing: border-box;\n}\n\n.blog-hero__title {\n  margin: 0;\n  font-size: clamp(64px, 11vw, 180px);\n  font-weight: 400;\n  line-height: 1;\n  letter-spacing: -0.05em;\n}\n\n.blog-hero__intro {\n  max-width: 30em;\n  margin: 28px 0 0;\n  color: var(--c-soft);\n  font-size: clamp(17px, 1.4vw, 20px);\n  font-weight: 300;\n  line-height: 1.5;\n}\n\n/* Lies on top of the contact section, which slides out from behind it (as below the team on the homepage) */\n.blog-list {\n  position: relative;\n  z-index: 2;\n  padding-block: calc(var(--section-space) * 0.6) var(--section-space);\n  border-radius: 0 0 28px 28px;\n  background: var(--c-mist);\n  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);\n  color: var(--c-ink);\n}\n\n.blog-list__grid {\n  display: grid;\n  grid-template-columns: repeat(2, minmax(0, 1fr));\n  gap: 24px;\n  margin: 0;\n  padding: 0;\n  list-style: none;\n}\n\n/* Photo runs edge to edge across the top of the card, like the product cards */\n.post__link {\n  display: flex;\n  height: 100%;\n  flex-direction: column;\n  overflow: hidden;\n  padding: 0 0 28px;\n  border-radius: 20px;\n  background: #fff;\n  box-sizing: border-box;\n  color: inherit;\n  text-decoration: none;\n  transition: box-shadow 0.4s ease, translate 0.4s cubic-bezier(0.16, 1, 0.3, 1);\n}\n\n.post__link:hover {\n  box-shadow: 0 18px 40px rgba(23, 31, 28, 0.08);\n  translate: 0 -3px;\n}\n\n.post__media {\n  display: block;\n  aspect-ratio: 3/2;\n  overflow: hidden;\n}\n\n.post__image {\n  width: 100%;\n  height: 100%;\n  object-fit: cover;\n  transition: scale 0.8s cubic-bezier(0.16, 1, 0.3, 1);\n}\n\n.post__link:hover .post__image {\n  scale: 1.04;\n}\n\n.post__meta {\n  margin: 24px 28px 0;\n  color: var(--c-muted);\n  font-size: 13px;\n}\n\n.post__title {\n  margin: 10px 28px 0;\n  font-size: clamp(24px, 2.2vw, 32px);\n  line-height: 1.1;\n  letter-spacing: -0.03em;\n  text-wrap: balance;\n}\n\n.post__excerpt {\n  margin: 12px 28px 0;\n  color: var(--c-muted);\n  font-size: 15px;\n  font-weight: 300;\n  line-height: 1.5;\n}\n\n.post__foot {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: 16px;\n  margin: auto 28px 0;\n  padding-top: 24px;\n}\n\n.post__author {\n  display: inline-flex;\n  align-items: center;\n  gap: 10px;\n  font-size: 14px;\n}\n\n.post__avatar {\n  width: 32px;\n  height: 32px;\n  border-radius: 50%;\n  object-fit: cover;\n}\n\n.post__icon {\n  display: grid;\n  width: 44px;\n  height: 44px;\n  place-items: center;\n  border: 1px solid var(--c-line);\n  border-radius: 50%;\n  transition: background-color 0.2s ease, border-color 0.2s ease;\n}\n\n.post__link:hover .post__icon {\n  border-color: var(--c-orange);\n  background: var(--c-orange);\n}\n\n@media (max-width: 860px) {\n  .blog-hero__inner {\n    padding-block: 120px 48px;\n  }\n  .blog-list__grid {\n    grid-template-columns: minmax(0, 1fr);\n  }\n}\n/* From tech42v2 BrandLogo.vue */\n.logo {\n  display: block;\n  width: 150px;\n  height: auto;\n}\n\n.budget {\n  padding-block: var(--section-space);\n  background: var(--c-ink);\n  color: var(--c-paper);\n}\n\n.budget__grid {\n  display: grid;\n  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);\n  align-items: start;\n  gap: 64px;\n}\n\n.budget__title {\n  max-width: 9em;\n  margin: 0;\n  font-size: clamp(44px, 5.4vw, 76.8px);\n  font-weight: 400;\n  line-height: 1;\n  letter-spacing: -0.04em;\n}\n\n.budget__body {\n  max-width: 420px;\n  margin: 32px 0 0;\n  color: var(--c-soft);\n  font-size: 16px;\n  font-weight: 300;\n  line-height: 1.55;\n}\n\n.budget__head,\n.budget__row {\n  display: grid;\n  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);\n  gap: 32px;\n}\n\n.budget__head {\n  padding-bottom: 16px;\n  color: var(--c-soft);\n  font-size: 14px;\n}\n\n.budget__head span:last-child {\n  color: var(--c-orange);\n}\n\n.budget__rows {\n  margin: 0;\n}\n\n/* The rule above each row draws in from the left (--rule goes 0 → 1) */\n.budget__row {\n  --rule: 1;\n  position: relative;\n  padding: 28px 0;\n}\n\n.budget__row::before {\n  position: absolute;\n  inset: 0 0 auto;\n  height: 1px;\n  background: rgba(245, 248, 246, 0.2);\n  content: \"\";\n  transform: scaleX(var(--rule));\n  transform-origin: left;\n}\n\n.budget__from {\n  color: rgba(245, 248, 246, 0.5);\n  font-size: clamp(18px, 1.5vw, 22px);\n  font-weight: 300;\n  line-height: 1.3;\n}\n\n.budget__to {\n  display: flex;\n  gap: 12px;\n  margin: 0;\n  font-size: clamp(18px, 1.5vw, 22px);\n  line-height: 1.3;\n}\n\n.budget__arrow {\n  flex-shrink: 0;\n  margin-top: 0.15em;\n  color: var(--c-orange);\n}\n\n.budget__note {\n  max-width: 34em;\n  margin: 8px 0 0;\n  padding-top: 24px;\n  border-top: 1px solid rgba(245, 248, 246, 0.2);\n  color: var(--c-soft);\n  font-size: 14px;\n  font-weight: 300;\n  line-height: 1.5;\n}\n\n.visually-hidden {\n  position: absolute;\n  width: 1px;\n  height: 1px;\n  overflow: hidden;\n  clip-path: inset(50%);\n  white-space: nowrap;\n}\n\n@media (max-width: 860px) {\n  .budget__grid {\n    grid-template-columns: minmax(0, 1fr);\n    gap: 48px;\n  }\n  .budget__head {\n    display: none;\n  }\n  /* Stacked: the old way above, the Tech_42 way below it */\n  .budget__row {\n    grid-template-columns: minmax(0, 1fr);\n    gap: 10px;\n    padding: 22px 0;\n  }\n}\n/* From tech42v2 ClientStrip.vue */\n.clients {\n  display: grid;\n  grid-template-columns: minmax(0, 342px) minmax(0, 1fr);\n  align-items: center;\n  gap: 48px;\n  padding-block: 64px;\n}\n\n.clients__text {\n  margin: 0;\n  color: var(--c-paper);\n  font-size: 16px;\n  font-weight: 300;\n  line-height: 1.5;\n}\n\n/* Endless strip, fading out at both edges */\n.clients__track {\n  display: flex;\n  overflow: hidden;\n  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);\n}\n\n.clients__logos {\n  display: flex;\n  flex-shrink: 0;\n  align-items: center;\n  gap: 64px;\n  margin: 0;\n  padding: 0 64px 0 0;\n  list-style: none;\n  animation: clients-marquee 40s linear infinite;\n}\n\n.clients__track:hover .clients__logos {\n  animation-play-state: paused;\n}\n\n.clients__logos img {\n  display: block;\n  height: auto;\n}\n\n@keyframes clients-marquee {\n  to {\n    transform: translateX(-100%);\n  }\n}\n@media (prefers-reduced-motion: reduce) {\n  .clients__track {\n    mask-image: none;\n  }\n  .clients__logos {\n    flex-wrap: wrap;\n    flex-shrink: 1;\n    gap: 24px 32px;\n    padding: 0;\n    animation: none;\n  }\n  .clients__logos[aria-hidden] {\n    display: none;\n  }\n}\n@media (max-width: 860px) {\n  .clients {\n    grid-template-columns: minmax(0, 1fr);\n    gap: 28px;\n  }\n  .clients__logos {\n    gap: 40px;\n    padding-right: 40px;\n  }\n}\n/* tech42v2 ContactModal.vue, scoped styles unchanged; the Vue form's own field rules are replaced by the ones on the\n   WebHare form classes at the bottom, with the same values */\n.cm {\n  position: fixed;\n  inset: 0;\n  z-index: 90;\n  display: grid;\n  place-items: center;\n  padding: 24px;\n  overflow-y: auto;\n}\n\n.cm__backdrop {\n  position: fixed;\n  inset: 0;\n  background: rgba(23, 31, 28, 0.55);\n  backdrop-filter: blur(10px);\n  -webkit-backdrop-filter: blur(10px);\n}\n\n.cm__panel {\n  position: relative;\n  display: grid;\n  width: min(1080px, 100%);\n  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);\n  overflow: hidden;\n  border-radius: 28px;\n  background: var(--c-paper);\n  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.45);\n  color: var(--c-ink);\n}\n\n/* Left: on the slowly turning brand gradient */\n.cm__side {\n  position: relative;\n  display: flex;\n  min-height: 560px;\n  align-items: flex-end;\n  overflow: hidden;\n  background: var(--c-ink);\n  color: var(--c-paper);\n}\n\n.cm__side-bg {\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  width: 180%;\n  aspect-ratio: 1;\n  background: var(--cm-bg) center/cover;\n  translate: -50% -50%;\n  animation: cm-turn 60s linear infinite;\n}\n\n@keyframes cm-turn {\n  to {\n    rotate: 360deg;\n  }\n}\n.cm__side-content {\n  position: relative;\n  padding: 36px;\n}\n\n.cm__heading {\n  margin: 0;\n  font-size: clamp(36px, 3.6vw, 52px);\n  line-height: 1;\n  letter-spacing: -0.04em;\n}\n\n.cm__sub {\n  margin: 14px 0 0;\n  color: rgba(245, 248, 246, 0.8);\n  font-size: 15px;\n  font-weight: 300;\n  line-height: 1.45;\n}\n\n.cm__options {\n  display: grid;\n  gap: 4px;\n  margin: 28px 0 0;\n  padding: 0;\n  list-style: none;\n}\n\n.cm__option {\n  display: grid;\n  grid-template-columns: 40px minmax(0, 1fr);\n  align-items: center;\n  gap: 12px;\n  margin-inline: -10px;\n  padding: 10px;\n  border-radius: 16px;\n  color: #fff;\n  text-decoration: none;\n  transition: background-color 0.25s ease;\n}\n\n.cm__option:hover {\n  background: rgba(255, 255, 255, 0.12);\n}\n\n.cm__icon {\n  display: grid;\n  width: 40px;\n  height: 40px;\n  place-items: center;\n  border-radius: 50%;\n  background: #fff;\n  color: var(--c-ink);\n}\n\n.cm__icon svg {\n  width: 18px;\n  height: 18px;\n  fill: none;\n  stroke: currentColor;\n  stroke-width: 1.6;\n  stroke-linecap: round;\n  stroke-linejoin: round;\n}\n\n.cm__text {\n  display: grid;\n  gap: 2px;\n}\n\n.cm__label {\n  font-size: 15px;\n  font-weight: 500;\n}\n\n.cm__detail {\n  color: rgba(245, 248, 246, 0.8);\n  font-size: 13px;\n  font-weight: 300;\n}\n\n/* Right: the form */\n.cm__main {\n  position: relative;\n  padding: 44px 48px 40px;\n}\n\n.cm__close {\n  position: absolute;\n  top: 20px;\n  right: 20px;\n  z-index: 1;\n  display: grid;\n  width: 44px;\n  height: 44px;\n  place-items: center;\n  border: 1px solid var(--c-line);\n  border-radius: 50%;\n  background: #fff;\n  cursor: pointer;\n  transition: background-color 0.2s ease, border-color 0.2s ease, rotate 0.4s cubic-bezier(0.16, 1, 0.3, 1);\n}\n\n.cm__close:hover {\n  border-color: var(--c-orange);\n  background: var(--c-orange);\n  rotate: 90deg;\n}\n\n.cm__close span,\n.cm__close span::before {\n  display: block;\n  width: 16px;\n  height: 1.5px;\n  background: var(--c-ink);\n  rotate: 45deg;\n}\n\n.cm__close span::before {\n  rotate: 90deg;\n  content: \"\";\n}\n\n.cm__title {\n  margin: 0 0 8px;\n  padding-right: 52px;\n  font-size: clamp(28px, 2.8vw, 40px);\n  font-weight: 400;\n  line-height: 1;\n  letter-spacing: -0.035em;\n}\n\n.cm__note a {\n  color: inherit;\n}\n\n.cm__note {\n  max-width: 24em;\n  margin: 0;\n  color: var(--c-muted);\n  font-size: 13px;\n  font-weight: 300;\n  line-height: 1.45;\n}\n\n/* The contact page shows the panel in the page instead of over it */\n.cm--page {\n  position: static;\n  padding: 140px 24px 96px;\n}\n\n/* After sending, the form's thank-you page takes the place of the title and the note */\n.cm--sent .cm__title,\n.cm--sent .cm__note {\n  display: none;\n}\n\n/* tech42v2 had the title inside the form's grid (gap 18px) and centered its thank-you text. Padding, not margin:\n   the title's margin would collapse into it */\n.cm__form {\n  padding-top: 18px;\n}\n\n.cm--sent .cm__main {\n  display: grid;\n  align-content: center;\n}\n\n/* The WebHare form, with the field rules of tech42v2 (.field, .field__label, .field__input) */\n.cm__form .wh-form__page {\n  display: grid;\n  grid-template-columns: repeat(2, minmax(0, 1fr));\n  gap: 18px;\n}\n\n.cm__form .wh-form__fieldgroup--pulldown,\n.cm__form .wh-form__fieldgroup--textarea,\n.cm__form .wh-form__fieldgroup--richtext {\n  grid-column: 1/-1;\n}\n\n.cm__form .wh-form__fieldgroup {\n  display: grid;\n  gap: 8px;\n}\n\n.cm__form .wh-form__label {\n  font-size: 13px;\n}\n\n/* tech42v2 marked the optional fields instead of the required ones */\n.cm__form .wh-form__page .wh-form__fieldgroup:not(.wh-form__fieldgroup--required, .wh-form__fieldgroup--richtext) .wh-form__label::after {\n  color: var(--c-muted);\n  font-weight: 300;\n  content: \" optional\";\n}\n\n.cm__form .wh-form__page .wh-form__fieldgroup:not(.wh-form__fieldgroup--required, .wh-form__fieldgroup--richtext) .wh-form__label:lang(nl)::after {\n  content: \" optioneel\";\n}\n\n.cm__form .wh-form__pulldown {\n  padding-right: 40px;\n  appearance: none;\n  background: #fff url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5L5 6.5L8 3.5' fill='none' stroke='%23171f1c' stroke-width='1.4'/%3E%3C/svg%3E\") no-repeat right 16px center;\n}\n\n.cm__form .wh-form__textinput,\n.cm__form .wh-form__pulldown,\n.cm__form .wh-form__textarea {\n  width: 100%;\n  padding: 14px 16px;\n  border: 1px solid var(--c-line);\n  border-radius: 12px;\n  background-color: #fff;\n  color: var(--c-ink);\n  font: 300 16px/1.4 var(--font);\n  box-sizing: border-box;\n  transition: border-color 0.2s ease, box-shadow 0.2s ease;\n}\n.cm__form .wh-form__textinput:focus,\n.cm__form .wh-form__pulldown:focus,\n.cm__form .wh-form__textarea:focus {\n  border-color: var(--c-orange);\n  outline: none;\n  box-shadow: 0 0 0 4px rgba(255, 119, 0, 0.15);\n}\n\n/* rows=\"5\" of the tech42v2 textarea; block, or the inline baseline adds a gap below it */\n.cm__form .wh-form__textarea {\n  display: block;\n  min-height: calc(5lh + 30px);\n  resize: vertical;\n}\n\n.cm__form .wh-form__fieldgroup--error :is(.wh-form__textinput, .wh-form__pulldown, .wh-form__textarea) {\n  border-color: #b3401a;\n}\n\n.cm__form .wh-form__error {\n  margin: 0;\n  color: #b3401a;\n  font-size: 14px;\n}\n\n/* tech42v2's .cm__actions: the note sits beside the send button (moved in by the script) */\n.cm__form .wh-form__buttongroup {\n  display: flex;\n  flex-wrap: wrap;\n  align-items: center;\n  gap: 16px 24px;\n  margin-top: 18px;\n}\n\n/* The thank-you page reads like the title it replaces */\n.cm__form .wh-form__richtext h2 {\n  margin: 0 0 20px;\n  font-size: clamp(28px, 2.8vw, 40px);\n  font-weight: 400;\n  line-height: 1;\n  letter-spacing: -0.035em;\n}\n.cm__form .wh-form__richtext p {\n  max-width: 30em;\n  margin: 0;\n  color: var(--c-muted);\n  font-size: 17px;\n  font-weight: 300;\n  line-height: 1.55;\n}\n\n@media (max-width: 860px) {\n  .cm {\n    align-items: start;\n    padding: 12px;\n  }\n  .cm--page {\n    padding: 96px 12px 48px;\n  }\n  .cm__panel {\n    grid-template-columns: minmax(0, 1fr);\n  }\n  .cm__side {\n    min-height: 0;\n  }\n  .cm__side-content {\n    padding: 28px;\n  }\n  .cm__main {\n    padding: 32px 20px 24px;\n  }\n  .cm__form .wh-form__page {\n    grid-template-columns: minmax(0, 1fr);\n  }\n}\n/* tech42v2 ApplyModal.vue, scoped styles unchanged; the Vue form's own field rules (.apply__form, .apply__row,\n   .field, .apply__actions, .apply__done) are replaced by the WebHare form, styled by the contact form's cm__form rules */\n.apply {\n  position: fixed;\n  inset: 0;\n  z-index: 90;\n  display: grid;\n  place-items: center;\n  padding: 24px;\n  overflow-y: auto;\n}\n\n.apply__backdrop {\n  position: fixed;\n  inset: 0;\n  background: rgba(23, 31, 28, 0.55);\n  backdrop-filter: blur(10px);\n  -webkit-backdrop-filter: blur(10px);\n}\n\n.apply__panel {\n  position: relative;\n  display: grid;\n  width: min(1120px, 100%);\n  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);\n  overflow: hidden;\n  border-radius: 28px;\n  background: var(--c-paper);\n  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.45);\n  color: var(--c-ink);\n}\n\n/* Left: role on the slowly turning brand gradient */\n.apply__side {\n  position: relative;\n  display: flex;\n  min-height: 600px;\n  align-items: flex-end;\n  overflow: hidden;\n  background: var(--c-ink);\n  color: var(--c-paper);\n}\n\n.apply__side-bg {\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  width: max(180%, var(--apply-diagonal, 0px));\n  aspect-ratio: 1;\n  background: var(--apply-bg) center/cover;\n  translate: -50% -50%;\n  animation: apply-turn 60s linear infinite;\n}\n\n@keyframes apply-turn {\n  to {\n    rotate: 360deg;\n  }\n}\n.apply__side-content {\n  position: relative;\n  padding: 40px;\n}\n\n.apply__facts {\n  display: flex;\n  flex-wrap: wrap;\n  gap: 8px;\n  margin: 0;\n  padding: 0;\n  list-style: none;\n}\n\n.apply__facts li {\n  padding: 7px 12px;\n  border: 1px solid rgba(245, 248, 246, 0.35);\n  border-radius: 999px;\n  font-size: 12px;\n}\n\n.apply__role {\n  margin: 20px 0 0;\n  font-size: clamp(32px, 3.4vw, 48px);\n  line-height: 1;\n  letter-spacing: -0.04em;\n}\n\n/* The three steps of applying */\n.apply__steps {\n  display: grid;\n  gap: 12px;\n  margin: 32px 0 0;\n  padding: 24px 0 0;\n  border-top: 1px solid rgba(245, 248, 246, 0.25);\n  list-style: none;\n}\n\n.apply__steps li {\n  display: flex;\n  align-items: center;\n  gap: 12px;\n  font-size: 15px;\n  font-weight: 300;\n}\n\n.apply__steps span {\n  display: grid;\n  width: 26px;\n  height: 26px;\n  flex-shrink: 0;\n  place-items: center;\n  border-radius: 50%;\n  background: var(--c-orange);\n  color: #fff;\n  font-size: 12px;\n  font-weight: 500;\n}\n\n.apply__main {\n  position: relative;\n  display: grid;\n  align-content: start;\n  gap: 18px;\n  padding: 44px 48px 40px;\n}\n\n.apply__close {\n  position: absolute;\n  top: 20px;\n  right: 20px;\n  z-index: 1;\n  display: grid;\n  width: 44px;\n  height: 44px;\n  place-items: center;\n  border: 1px solid var(--c-line);\n  border-radius: 50%;\n  background: #fff;\n  cursor: pointer;\n  transition: background-color 0.2s ease, border-color 0.2s ease, rotate 0.4s cubic-bezier(0.16, 1, 0.3, 1);\n}\n\n.apply__close:hover {\n  border-color: var(--c-orange);\n  background: var(--c-orange);\n  rotate: 90deg;\n}\n\n/* A cross drawn from two lines */\n.apply__close span,\n.apply__close span::before {\n  display: block;\n  width: 16px;\n  height: 1.5px;\n  background: var(--c-ink);\n  rotate: 45deg;\n}\n\n.apply__close span::before {\n  rotate: 90deg;\n  content: \"\";\n}\n\n.apply__title {\n  max-width: 13em;\n  margin: 0;\n  font-size: clamp(28px, 2.8vw, 42px);\n  font-weight: 400;\n  line-height: 1;\n  letter-spacing: -0.035em;\n}\n\n/* The three video questions as numbered rows */\n.apply__questions {\n  display: grid;\n  gap: 8px;\n  margin: 4px 0 0;\n  padding: 0;\n  counter-reset: question;\n  list-style: none;\n}\n\n.apply__questions li {\n  display: flex;\n  align-items: baseline;\n  gap: 12px;\n  font-size: 15px;\n  line-height: 1.4;\n  counter-increment: question;\n}\n\n.apply__questions li::before {\n  flex-shrink: 0;\n  color: var(--c-orange);\n  font-size: 12px;\n  font-weight: 500;\n  content: counter(question, decimal-leading-zero);\n}\n\n/* Recorder: a 16:9 stage with its controls laid over the bottom */\n.rec {\n  position: relative;\n  display: grid;\n  aspect-ratio: 16/9;\n  place-items: center;\n  overflow: hidden;\n  border-radius: 18px;\n  background: var(--c-ink);\n  color: var(--c-paper);\n}\n\n.rec__video {\n  position: absolute;\n  inset: 0;\n  width: 100%;\n  height: 100%;\n  object-fit: cover;\n  background: #000;\n}\n\n/* The live preview is mirrored, like looking in a mirror */\n.rec__video--live {\n  scale: -1 1;\n}\n\n.rec__idle {\n  position: relative;\n  display: grid;\n  justify-items: center;\n  gap: 12px;\n  padding: 24px;\n  text-align: center;\n}\n\n.rec__hint {\n  max-width: 28em;\n  margin: 0;\n  color: rgba(245, 248, 246, 0.7);\n  font-size: 13px;\n  font-weight: 300;\n}\n\n.rec__hint--strong {\n  color: var(--c-paper);\n  font-size: 16px;\n  font-weight: 400;\n}\n\n.rec__hint a {\n  color: var(--c-paper);\n}\n\n.rec__start,\n.rec__record {\n  display: inline-flex;\n  align-items: center;\n  gap: 10px;\n  padding: 14px 22px;\n  border: 1px solid rgba(255, 255, 255, 0.3);\n  border-radius: 999px;\n  background: rgba(23, 31, 28, 0.55);\n  backdrop-filter: blur(12px);\n  color: #fff;\n  font: 500 14px/1 var(--font);\n  cursor: pointer;\n  transition: background-color 0.2s ease;\n}\n\n.rec__start:hover,\n.rec__record:hover {\n  background: rgba(23, 31, 28, 0.8);\n}\n\n.rec__dot {\n  width: 10px;\n  height: 10px;\n  border-radius: 50%;\n  background: var(--c-orange);\n}\n\n.rec--live .rec__dot {\n  animation: rec-pulse 1.4s ease-in-out infinite;\n}\n\n@keyframes rec-pulse {\n  50% {\n    scale: 1.5;\n    opacity: 0.6;\n  }\n}\n.rec__controls,\n.rec__retake {\n  position: absolute;\n  inset: auto 0 16px;\n  display: flex;\n  justify-content: center;\n}\n\n.rec__retake {\n  inset: 16px 16px auto auto;\n}\n\n.rec__ring {\n  width: 22px;\n  height: 22px;\n  rotate: -90deg;\n}\n\n.rec__ring circle {\n  fill: none;\n  stroke: rgba(255, 255, 255, 0.25);\n  stroke-width: 4;\n}\n\n.rec__ring .rec__ring-progress {\n  stroke: var(--c-orange);\n  stroke-dasharray: 113.1;\n  transition: stroke-dashoffset 1s linear;\n}\n\n.rec__link {\n  padding: 8px 14px;\n  border: 0;\n  border-radius: 999px;\n  background: rgba(23, 31, 28, 0.6);\n  color: #fff;\n  font: 400 13px/1 var(--font);\n  text-decoration: underline;\n  text-underline-offset: 0.3em;\n  cursor: pointer;\n}\n\n.rec__hint .rec__link {\n  padding: 0;\n  background: none;\n  font-size: inherit;\n}\n\n.apply__error {\n  margin: 0;\n  color: #b3401a;\n  font-size: 14px;\n}\n\n.apply__alt {\n  margin: 0;\n  padding-top: 16px;\n  border-top: 1px solid var(--c-line);\n  color: var(--c-muted);\n  font-size: 13px;\n  font-weight: 300;\n}\n\n.apply__alt a {\n  color: var(--c-ink);\n}\n\n/* The application page: the panel in the page instead of over it */\n.apply--page {\n  position: static;\n  padding: 140px 24px 96px;\n}\n\n/* The main column's grid gap already separates the recorder from the form */\n.apply__form {\n  padding-top: 0;\n}\n\n/* The WebHare form: name and email side by side. The video field only shows when the browser can't record (or when\n   it reports an error); otherwise the recorder above fills it */\n.apply__form .wh-form__fieldgroup--upload {\n  display: none;\n  grid-column: 1/-1;\n}\n\n.apply--upload .apply__form .wh-form__fieldgroup--upload,\n.apply__form .wh-form__fieldgroup--upload.wh-form__fieldgroup--error {\n  display: grid;\n}\n\n.apply__note {\n  margin: 0;\n  color: var(--c-muted);\n  font-size: 13px;\n  font-weight: 300;\n}\n\n/* After sending, the form's thank-you page is all that's left of the main column */\n.apply--sent :is(.apply__title, .apply__questions, .rec, .apply__error, .apply__note, .apply__alt) {\n  display: none;\n}\n\n.apply--sent .apply__main {\n  align-content: center;\n}\n\n@media (max-width: 860px) {\n  .apply {\n    align-items: start;\n    padding: 12px;\n  }\n  .apply__panel {\n    grid-template-columns: minmax(0, 1fr);\n  }\n  .apply__side {\n    min-height: 0;\n  }\n  .apply__side-content {\n    padding: 28px;\n  }\n  .apply__steps {\n    margin-top: 20px;\n    padding-top: 16px;\n  }\n  .apply__main {\n    padding: 32px 20px 24px;\n  }\n  .apply__title {\n    padding-right: 52px;\n  }\n}\n/* From tech42v2 ContactSection.vue */\n/* Sits underneath the team section (z-index 2) so it can be revealed from behind it */\n.contact {\n  position: relative;\n  z-index: 1;\n  padding: 24px;\n  background: var(--c-ink);\n}\n\n.contact__card {\n  position: relative;\n  display: flex;\n  min-height: min(560px, 80svh);\n  align-items: flex-end;\n  overflow: hidden;\n  border-radius: 28px;\n  background: var(--c-ink);\n}\n\n/* Same gradient as the hero, turned around and oversized so it can rotate */\n.contact__bg {\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  /* Square and larger than the card's diagonal, so rotating never shows a corner */\n  width: max(130%, 900px);\n  aspect-ratio: 1;\n  background-position: center;\n  background-size: cover;\n  translate: -50% -50%;\n  rotate: 180deg;\n}\n\n.contact__content {\n  position: relative;\n  padding: 0 var(--gutter-inset) 72px;\n}\n\n.contact__title {\n  margin: 0;\n  color: var(--c-paper);\n  font-size: clamp(48px, 8vw, 104px);\n  font-weight: 400;\n  line-height: 1;\n  letter-spacing: -0.04em;\n}\n\n.contact__word {\n  white-space: nowrap;\n}\n\n.contact__word-mask {\n  overflow-clip-margin: 0.15em;\n}\n\n.contact__body {\n  margin: 32px 0 56px;\n  color: #ccd9d1;\n  font-size: 16px;\n  font-weight: 300;\n  line-height: 1.55;\n}\n\n/* With a person the card has two sides: the portrait on the left, the text to the right of it */\n.contact__card--person {\n  flex-direction: row-reverse;\n  justify-content: flex-end;\n  gap: clamp(32px, 5vw, 80px);\n}\n\n.contact__card--person .contact__content {\n  padding-left: 0;\n}\n\n.contact__person {\n  position: relative;\n  flex: 0 0 auto;\n  width: clamp(280px, 28vw, 420px);\n  aspect-ratio: 4/5;\n  margin: 48px 0 48px var(--gutter-inset);\n  overflow: hidden;\n  border-radius: 20px;\n}\n\n.contact__photo {\n  display: block;\n  width: 100%;\n  height: 100%;\n  object-fit: cover;\n  object-position: center top;\n}\n\n/* Name and role over the foot of the photo, on a soft dark fade so they stay readable on any photo */\n.contact__who {\n  position: absolute;\n  inset: auto 0 0;\n  display: grid;\n  gap: 4px;\n  padding: 56px 20px 20px;\n  background: linear-gradient(transparent, rgba(23, 31, 28, 0.8));\n}\n\n.contact__name {\n  grid-column: 1;\n  color: var(--c-paper);\n  font-size: 20px;\n}\n\n.contact__role {\n  grid-column: 1;\n  color: #ccd9d1;\n  font-size: 14px;\n  font-weight: 300;\n}\n\n.contact__linkedin {\n  grid-area: 1/2/span 2;\n  place-self: end;\n  display: grid;\n  place-items: center;\n  width: 44px;\n  height: 44px;\n  border-radius: 50%;\n  background: var(--c-paper);\n  color: var(--c-ink);\n  transition: background-color 0.2s ease;\n}\n\n@media (hover: hover) {\n  .contact__linkedin:hover {\n    background-color: var(--c-orange);\n  }\n}\n.contact__linkedin:focus-visible {\n  background-color: var(--c-orange);\n  outline: 2px solid var(--c-paper);\n  outline-offset: 3px;\n}\n\n/* Narrower screens: the portrait comes first, the text below it */\n@media (max-width: 900px) {\n  .contact__card--person {\n    flex-direction: column-reverse;\n    align-items: stretch;\n    gap: 0;\n  }\n  .contact__card--person .contact__content {\n    padding-left: var(--gutter-inset);\n  }\n  .contact__person {\n    width: auto;\n    max-width: 420px;\n    margin: var(--gutter-inset) var(--gutter-inset) 40px;\n  }\n}\n@media (max-width: 640px) {\n  .contact {\n    padding: 12px;\n  }\n  .contact__card {\n    min-height: 460px;\n  }\n  .contact__bg {\n    width: 220%;\n  }\n  .contact__content {\n    padding: 0 24px 40px;\n  }\n}\n/* From tech42v2 CycleSection.vue */\n.cycle {\n  position: relative;\n  overflow: hidden;\n  padding-block: var(--section-space) 0;\n  background: var(--c-ink);\n}\n\n/* A faint warm glow along the bottom edge */\n.cycle::after {\n  position: absolute;\n  inset: auto 0 0;\n  height: 45%;\n  background: radial-gradient(ellipse 70% 100% at 50% 100%, rgba(255, 119, 0, 0.14), transparent 70%);\n  content: \"\";\n  pointer-events: none;\n}\n\n.cycle__title {\n  position: relative;\n  z-index: 1;\n  width: max-content;\n  margin: 0;\n  color: var(--c-paper);\n  font-size: clamp(96px, 18vw, 230px);\n  font-weight: 400;\n  line-height: 1;\n  letter-spacing: -0.03em;\n  white-space: nowrap;\n  will-change: transform;\n}\n\n.cycle__accent {\n  color: var(--c-orange);\n}\n\n/* Pulled up under the heading, so the sliding title runs across the outer ring */\n.cycle__stage {\n  display: grid;\n  margin-top: calc(clamp(96px, 18vw, 230px) * -0.55);\n  padding-block: 0 var(--section-space);\n  place-items: center;\n  overflow: hidden;\n}\n\n.cycle__diagram {\n  position: relative;\n  width: min(1024px, 120vw);\n  aspect-ratio: 1;\n  /* Lets the labels use cqw to sit exactly on the inner ring */\n  container-type: inline-size;\n}\n\n.cycle__rings {\n  position: absolute;\n  inset: 0;\n  width: 100%;\n  height: 100%;\n  overflow: visible;\n}\n\n.cycle__ring {\n  fill: none;\n  stroke: rgb(245, 248, 246);\n  stroke-width: 1;\n}\n\n.cycle__centre {\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  width: min(280px, 30%);\n  text-align: center;\n  translate: -50% -50%;\n}\n\n.cycle__mvp {\n  margin: 0 0 14px;\n  color: var(--c-orange);\n  font-size: 22px;\n  font-weight: 600;\n}\n\n.cycle__text {\n  margin: 0;\n  color: var(--c-paper);\n  font-size: 16px;\n  font-weight: 300;\n  line-height: 1.5;\n}\n\n.cycle__orbit {\n  position: absolute;\n  inset: 0;\n  pointer-events: none;\n}\n\n/* Each label is centred on the diagram, turned to its spot and pushed out to the inner ring (radius 19.9% of the\n   diagram width); top faces outward. cycle-section.ts adds the spin to the same transform. Its own layer, so turning\n   it does not repaint the text in the centre */\n.cycle__label {\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  translate: -50% -50%;\n  transform: rotate(var(--a)) translateY(-19.9cqw);\n  will-change: transform;\n  padding: 12px 22px;\n  border: 1px solid rgba(245, 248, 246, 0.6);\n  border-radius: 999px;\n  background: var(--c-ink);\n  color: var(--c-paper);\n  font-size: 18px;\n  line-height: 1;\n  white-space: nowrap;\n}\n\n@media (max-width: 860px) {\n  /* Wider than the screen (the outer rings run off the edges), centred with negative margins */\n  .cycle__diagram {\n    width: 150vw;\n    margin-inline: calc(50% - 75vw);\n  }\n  /* On phones only the text sits in the inner ring, smaller; the heading above it is left out */\n  .cycle__centre {\n    width: 26%;\n  }\n  .cycle__mvp {\n    display: none;\n  }\n  .cycle__text {\n    font-size: 12px;\n    line-height: 1.4;\n  }\n  .cycle__label {\n    padding: 8px 14px;\n    font-size: 14px;\n  }\n}\n/* From tech42v2 HeroContact.vue */\n.hc {\n  position: relative;\n  display: inline-flex;\n}\n\n.hc__button {\n  position: relative;\n  z-index: 1;\n  transition: background-color 0.3s ease;\n}\n\n/* A phone shouldn't tilt like the arrow on other buttons does */\n.hc__button:hover .btn__icon {\n  transform: none;\n}\n\n.hc__phone {\n  width: 18px;\n  height: 18px;\n  fill: none;\n  stroke: currentColor;\n  stroke-width: 1.7;\n  stroke-linecap: round;\n  stroke-linejoin: round;\n}\n\n/* Floating (service pages): fixed to the bottom right, above the page and below the header and popups. Over light\n   sections the glass needs more orange to stay readable */\n.hc--floating {\n  position: fixed;\n  right: clamp(16px, 3vw, 32px);\n  bottom: calc(clamp(16px, 3vw, 32px) + env(safe-area-inset-bottom, 0px));\n  z-index: 9;\n  opacity: 0;\n  translate: 0 12px;\n  pointer-events: none;\n  transition: opacity 0.6s ease, translate 0.6s cubic-bezier(0.16, 1, 0.3, 1);\n}\n\n.hc--floating.hc--shown {\n  opacity: 1;\n  translate: 0 0;\n  pointer-events: auto;\n}\n\n.hc--floating .hc__button {\n  background: rgba(255, 119, 0, 0.92);\n  box-shadow: 0 12px 32px rgba(23, 31, 28, 0.25);\n  /* The shadow lets go while the panel opens, instead of vanishing at once */\n  transition: background-color 0.3s ease, box-shadow 0.3s ease;\n}\n\n.hc--floating.hc--open .hc__button {\n  box-shadow: none;\n}\n\n.hc--floating .hc__panel {\n  background: linear-gradient(160deg, rgba(255, 140, 40, 0.94), rgba(255, 100, 0, 0.9));\n}\n\n/* Compact (header): a round phone button in the same dark glass as the menu button; the panel opens below it */\n.hc--compact .hc__button {\n  width: 40px;\n  height: 40px;\n  justify-content: center;\n  padding: 0;\n  gap: 0;\n  border-color: rgba(255, 255, 255, 0.22);\n  background: rgba(23, 31, 28, 0.35);\n  backdrop-filter: blur(16px);\n}\n\n.hc--compact .hc__button:hover {\n  border-color: rgba(255, 255, 255, 0.4);\n}\n\n.hc--compact .hc__button .btn__icon {\n  width: 30px;\n  height: 30px;\n  background: transparent;\n  color: var(--c-orange);\n  transition: background-color 0.3s ease, color 0.3s ease;\n}\n\n/* Open over the orange panel, the phone gets its white circle back so it stays visible */\n.hc--compact.hc--open .hc__button .btn__icon {\n  background: #fff;\n  color: var(--c-ink);\n}\n\n/* The panel reaches 6px past the phone circle on the top and right, so its rounded corner wraps the circle\n   evenly instead of hugging it */\n.hc--compact .hc__panel {\n  top: -6px;\n  right: -6px;\n  bottom: auto;\n  left: auto;\n  padding: 6px 8px 10px;\n  border-radius: 26px;\n  /* Over the page's darker sections the glass needs more orange, or it turns brown */\n  background: linear-gradient(160deg, rgba(255, 140, 40, 0.9), rgba(255, 100, 0, 0.82));\n}\n\n/* In the header the title sits on the button's row, left of the phone */\n.hc--compact .hc__title {\n  display: flex;\n  align-items: center;\n  min-height: 40px;\n  margin: 0 58px 4px 16px;\n}\n\n/* While open, the panel carries the orange, so the button blends into it */\n.hc--open .hc__button {\n  background: transparent;\n  backdrop-filter: none;\n  border-color: transparent;\n}\n\n.hc__panel {\n  position: absolute;\n  right: 0;\n  bottom: 0;\n  width: 340px;\n  padding: 22px 8px 66px;\n  border: 1px solid rgba(255, 255, 255, 0.2);\n  border-radius: 28px;\n  /* Frosted orange glass: the hero shows through, softened */\n  background: linear-gradient(160deg, rgba(255, 140, 40, 0.55), rgba(255, 100, 0, 0.42));\n  backdrop-filter: blur(22px) saturate(1.3);\n  -webkit-backdrop-filter: blur(22px) saturate(1.3);\n  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);\n  box-sizing: border-box;\n  color: #fff;\n  visibility: hidden;\n}\n\n/* Without motion the panel simply appears */\n.hc--open .hc__panel {\n  visibility: visible;\n}\n\n.hc__title {\n  margin: 0 16px 10px;\n  color: rgba(255, 255, 255, 0.8);\n  font-size: 12px;\n  letter-spacing: 0.02em;\n}\n\n.hc__list {\n  display: grid;\n  gap: 2px;\n  margin: 0;\n  padding: 0;\n  list-style: none;\n}\n\n.hc__option {\n  display: grid;\n  grid-template-columns: 40px minmax(0, 1fr) 18px;\n  align-items: center;\n  gap: 12px;\n  padding: 10px 14px 10px 10px;\n  border-radius: 18px;\n  color: #fff;\n  text-decoration: none;\n  transition: background-color 0.25s ease;\n}\n\n.hc__option:hover,\n.hc__option:focus-visible {\n  background: rgba(255, 255, 255, 0.16);\n}\n\n.hc__icon {\n  display: grid;\n  width: 40px;\n  height: 40px;\n  place-items: center;\n  border-radius: 50%;\n  background: #fff;\n  color: var(--c-ink);\n}\n\n.hc__icon svg {\n  width: 18px;\n  height: 18px;\n  fill: none;\n  stroke: currentColor;\n  stroke-width: 1.6;\n  stroke-linecap: round;\n  stroke-linejoin: round;\n}\n\n.hc__text {\n  display: grid;\n  gap: 2px;\n}\n\n.hc__label {\n  font-size: 15px;\n  font-weight: 500;\n}\n\n.hc__detail {\n  color: rgba(255, 255, 255, 0.85);\n  font-size: 13px;\n  font-weight: 300;\n}\n\n.hc__arrow {\n  opacity: 0;\n  translate: -6px 0;\n  transition: opacity 0.25s ease, translate 0.35s cubic-bezier(0.16, 1, 0.3, 1);\n}\n\n.hc__option:hover .hc__arrow,\n.hc__option:focus-visible .hc__arrow {\n  opacity: 1;\n  translate: 0 0;\n}\n\n/* The flying stand-in, fixed to the screen. Its own spot (0 by 0) is the right end, vertically centred, of the pill\n   inside it: only that spot follows the scroll, so the pill can shrink without moving the phone icon */\n.hc-fly {\n  position: fixed;\n  top: 0;\n  left: 0;\n  z-index: 11;\n  width: 0;\n  height: 0;\n  pointer-events: none;\n  visibility: hidden;\n}\n\n/* Same orange glass pill as the button */\n.hc-fly__pill {\n  position: absolute;\n  top: 0;\n  right: 0;\n  transform: translateY(-50%);\n  display: flex;\n  align-items: center;\n  justify-content: flex-end;\n  overflow: hidden;\n  padding: 6px;\n  border: 1px solid rgba(255, 255, 255, 0.2);\n  border-radius: 999px;\n  background: rgba(255, 119, 0, 0.72);\n  backdrop-filter: blur(12px);\n  -webkit-backdrop-filter: blur(12px);\n  box-sizing: border-box;\n  color: #fff;\n}\n\n.hc-fly__label {\n  overflow: hidden;\n  flex: 1;\n  font-size: 14px;\n  font-weight: 500;\n  white-space: nowrap;\n}\n\n.hc-fly__icon {\n  display: grid;\n  flex-shrink: 0;\n  place-items: center;\n  border-radius: 50%;\n  background: #fff;\n  color: var(--c-ink);\n}\n\n@media (max-width: 640px) {\n  .hc__panel {\n    width: min(340px, 100vw - 40px);\n  }\n}\n/* From tech42v2 HeroSection.vue */\n.hero {\n  position: relative;\n  display: flex;\n  min-height: 100svh;\n  align-items: flex-end;\n  overflow: hidden;\n  border-radius: 0 0 24px 24px;\n  background: var(--c-ink);\n}\n\n.hero__bg {\n  position: absolute;\n  inset: -6%;\n  background-position: 50% 50%;\n  background-size: cover;\n  will-change: transform;\n}\n\n.hero__liquid {\n  position: absolute;\n  inset: 0;\n  width: 100%;\n  height: 100%;\n  opacity: 0;\n  transition: opacity 1.2s ease;\n}\n\n.hero__liquid--on {\n  opacity: 1;\n}\n\n/* Darken the top for the header and the bottom for the text */\n.hero::before {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  z-index: 1;\n  background: linear-gradient(180deg, rgba(23, 31, 28, 0.25) 0%, rgba(23, 31, 28, 0) 30%, rgba(23, 31, 28, 0) 50%, rgba(23, 31, 28, 0.55) 100%);\n}\n\n.hero__inner {\n  position: relative;\n  z-index: 2;\n  padding-block: 160px 70px;\n}\n\n.hero__title {\n  margin: 0;\n  color: var(--c-paper);\n  /* Fluid: scales with the browser width, capped by the height so three lines always fit the hero */\n  font-size: clamp(40px, min(7.4vw, 12.5svh), 240px);\n  font-weight: 500;\n  line-height: 1.05;\n  letter-spacing: -0.066em;\n}\n\n/* Each line masks its own text so it can rise into view */\n.hero__line {\n  display: block;\n  clip-path: inset(-40% -20% -16% -2%);\n}\n\n.hero__word {\n  display: inline-block;\n}\n\n.hero__highlight {\n  position: relative;\n  /* Keeps the line's z-index inside this word group */\n  isolation: isolate;\n  white-space: nowrap;\n}\n\n/* A thin, straight line under \"digital muscle\", behind the letters so the g's tail runs over it */\n.hero__underline {\n  position: absolute;\n  z-index: -1;\n  right: 0;\n  bottom: 0.19em;\n  left: 0;\n  height: max(3px, 0.04em);\n  border-radius: 2px;\n  background: var(--c-orange);\n  transform-origin: left center;\n}\n\n.hero__row {\n  display: flex;\n  flex-wrap: wrap;\n  align-items: flex-end;\n  justify-content: space-between;\n  gap: 24px;\n  margin-top: 56px;\n}\n\n/* Stays on the right, also when it wraps below the text on phones */\n.hero__cta {\n  margin-left: auto;\n}\n\n.hero__lead {\n  max-width: 34em;\n  margin: 0;\n  color: var(--c-soft);\n  font-size: clamp(16px, 0.55vw + 10px, 22px);\n  font-weight: 300;\n  line-height: 1.45;\n}\n\n/* From tech42v2 HowSection.vue */\n.how {\n  padding-block: var(--section-space);\n  background: var(--c-orange);\n  color: var(--c-ink);\n}\n\n.how__head {\n  display: flex;\n  flex-wrap: wrap;\n  align-items: flex-end;\n  justify-content: space-between;\n  gap: 32px;\n}\n\n.how__title {\n  margin: 0;\n  font-size: clamp(48px, 6.3vw, 80.6px);\n  font-weight: 400;\n  line-height: 1;\n  letter-spacing: -0.04em;\n}\n\n.how__body {\n  max-width: 425px;\n  margin: 0;\n  font-size: 16px;\n  font-weight: 300;\n  line-height: 1.55;\n}\n\n/* One joined strip: shared outer border with rounded outer corners, thin dividers between the steps */\n.how__steps {\n  display: grid;\n  grid-template-columns: repeat(3, minmax(0, 1fr));\n  margin: 112px 0 0;\n  padding: 0;\n  overflow: hidden;\n  border: 1px solid rgba(23, 31, 28, 0.18);\n  border-radius: 24px;\n  list-style: none;\n}\n\n.step {\n  display: flex;\n  min-height: 368px;\n  flex-direction: column;\n  padding: 32px;\n  box-sizing: border-box;\n  transition: background-color 0.4s ease;\n}\n\n.step + .step {\n  border-left: 1px solid rgba(23, 31, 28, 0.18);\n}\n\n.step:hover {\n  background: rgba(23, 31, 28, 0.06);\n}\n\n.step__title {\n  overflow: hidden;\n}\n\n.step__num {\n  font-size: clamp(18px, 1.5vw, 24px);\n  font-weight: 500;\n  letter-spacing: -0.01em;\n}\n\n.step__title {\n  margin: auto 0 0;\n  font-size: clamp(32px, 3.5vw, 44.8px);\n  font-weight: 400;\n  line-height: 1.5;\n  letter-spacing: -0.025em;\n}\n\n/* All three titles break into two even lines, and the texts reserve the same height,\n   so titles and texts line up across the strip */\n.step__title {\n  text-wrap: balance;\n}\n\n.step__text {\n  max-width: 340px;\n  min-height: 5.8em;\n  margin: 32px 0 0;\n  font-size: 15px;\n  font-weight: 300;\n  line-height: 1.45;\n}\n\n@media (max-width: 860px) {\n  .how__steps {\n    grid-template-columns: 1fr;\n  }\n  .step {\n    min-height: 0;\n    gap: 0;\n  }\n  .step__title {\n    margin-top: 28px;\n  }\n  .step__text {\n    min-height: 0;\n    margin-top: 12px;\n    font-size: 15px;\n  }\n  /* Stacked: dividers run horizontally */\n  .step + .step {\n    border-top: 1px solid rgba(23, 31, 28, 0.18);\n    border-left: 0;\n  }\n}\n.info-hero {\n  background: linear-gradient(180deg, rgba(23, 31, 28, 0.2), var(--c-ink) 85%), var(--info-hero-bg) right top/cover no-repeat, var(--c-ink);\n  color: var(--c-paper);\n}\n\n.info-hero__inner {\n  display: flex;\n  min-height: min(64svh, 600px);\n  flex-direction: column;\n  justify-content: flex-end;\n  padding-block: 140px 72px;\n  box-sizing: border-box;\n}\n\n.info-back {\n  display: inline-flex;\n  align-self: flex-start;\n  align-items: center;\n  gap: 8px;\n  margin-bottom: auto;\n  color: var(--c-soft);\n  font-size: 14px;\n  text-decoration: none;\n  transition: color 0.3s ease;\n}\n\n.info-back:hover {\n  color: var(--c-paper);\n}\n\n.info-hero__title {\n  max-width: 13em;\n  margin: 0;\n  font-size: clamp(44px, 6.4vw, 110px);\n  font-weight: 400;\n  line-height: 1;\n  letter-spacing: -0.045em;\n  text-wrap: balance;\n}\n\n.info-hero__intro {\n  max-width: 34em;\n  margin: 28px 0 0;\n  color: var(--c-soft);\n  font-size: clamp(17px, 1.4vw, 20px);\n  font-weight: 300;\n  line-height: 1.5;\n}\n\n/* Facts as outlined chips, like the vacancy facts */\n.info-hero__facts {\n  display: flex;\n  flex-wrap: wrap;\n  gap: 8px;\n  margin: 28px 0 0;\n  padding: 0;\n  list-style: none;\n}\n\n.info-hero__facts li {\n  padding: 8px 14px;\n  border: 1px solid rgba(245, 248, 246, 0.25);\n  border-radius: 999px;\n  font-size: 14px;\n}\n\n/* Lies on top of the contact section, like the blog list */\n.info-body {\n  position: relative;\n  z-index: 2;\n  padding-block: calc(var(--section-space) * 0.6) var(--section-space);\n  border-radius: 0 0 28px 28px;\n  background: var(--c-paper);\n  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);\n  color: var(--c-ink);\n}\n\n/* Photo band on the dark hero background, like the service pages */\n.info-photo {\n  padding-bottom: calc(var(--section-space) * 0.5);\n  background: var(--c-ink);\n}\n\n.info-photo__frame {\n  height: clamp(280px, 42vw, 640px);\n  overflow: hidden;\n  border-radius: 20px;\n}\n\n.info-photo__img {\n  display: block;\n  width: 100%;\n  height: 100%;\n  object-fit: cover;\n}\n\n.info-body__inner {\n  display: grid;\n  gap: var(--section-space);\n}\n\n/* Who the page is for: numbered cards side by side */\n.info-cards__list {\n  display: grid;\n  grid-template-columns: repeat(3, minmax(0, 1fr));\n  gap: 16px;\n  margin: 0;\n  padding: 0;\n  list-style: none;\n}\n\n.info-card {\n  display: flex;\n  flex-direction: column;\n  gap: 14px;\n  padding: clamp(24px, 2.6vw, 36px);\n  border-radius: 20px;\n  background: rgba(23, 31, 28, 0.05);\n}\n\n/* The card's drawing brings its own soft green background */\n.info-card__img {\n  display: block;\n  width: 100%;\n  height: auto;\n  border-radius: 12px;\n}\n\n.info-card__num {\n  color: var(--c-orange);\n  font-size: 14px;\n  font-variant-numeric: tabular-nums;\n}\n\n.info-card__title {\n  margin: 0 0 4px;\n  font-size: clamp(22px, 2vw, 30px);\n  font-weight: 400;\n  line-height: 1.1;\n  letter-spacing: -0.025em;\n  text-wrap: balance;\n}\n\n.info-card__text {\n  margin: 0;\n  color: var(--c-muted);\n  font-size: 16px;\n  font-weight: 300;\n  line-height: 1.55;\n}\n\n/* Two-column parts with a line on top, like the service pages */\n.info-part {\n  display: grid;\n  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);\n  gap: 24px clamp(32px, 5vw, 96px);\n  padding-block: clamp(28px, 3vw, 44px);\n  border-top: 1px solid var(--c-line);\n}\n\n.info-part:last-child {\n  border-bottom: 1px solid var(--c-line);\n}\n\n.info-part__title {\n  margin: 0;\n  font-size: clamp(30px, 3.2vw, 48px);\n  font-weight: 400;\n  line-height: 1;\n  letter-spacing: -0.035em;\n  text-wrap: balance;\n}\n\n.info-prose {\n  grid-column: -2;\n  max-width: 640px;\n  font-size: clamp(17px, 1.2vw, 19px);\n  font-weight: 300;\n  line-height: 1.65;\n}\n\n.info-prose :is(p, ul, ol) {\n  margin: 0 0 1.1em;\n}\n\n.info-prose > :last-child {\n  margin-bottom: 0;\n}\n\n.info-prose :is(ul, ol) {\n  padding-left: 1.3em;\n}\n\n.info-prose li {\n  margin-bottom: 0.45em;\n  padding-left: 0.3em;\n}\n\n.info-prose li::marker {\n  color: var(--c-orange);\n}\n\n/* No .info-prose strong rule: in tech42v2 it was scoped and never reached the bold text (BlogSegments is a\n   fragment), so bold text there is the browser's bolder (400). Same here, so both versions look the same */\n/* Darker than the brand orange, which is too light to read as text on paper */\n.info-prose__motto {\n  color: #b34700;\n}\n\n/* Photos side by side, the first one twice as wide; they close the part above, so that one loses its bottom line */\n.info-gallery {\n  display: grid;\n  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);\n  gap: 16px;\n  padding-top: clamp(28px, 3vw, 44px);\n}\n\n.info-gallery__img,\n.info-links__photo {\n  display: block;\n  width: 100%;\n  height: clamp(240px, 32vw, 460px);\n  border-radius: 20px;\n  object-fit: cover;\n}\n\n.info-links__photo {\n  margin-bottom: 24px;\n}\n\n/* The portraits over the content width, as large as on the homepage on a laptop; capped so they don't grow on a wide\n   monitor (at 60% they were too small on a laptop) */\n.info-team__grid {\n  display: grid;\n  grid-template-columns: repeat(4, minmax(0, 1fr));\n  gap: 16px;\n  max-width: 1400px;\n  margin: 0;\n  padding: 0;\n  list-style: none;\n}\n\n/* Smaller portraits, so the label gets the sizes the homepage uses on phones */\n.info-team .member__name {\n  font-size: 15px;\n  line-height: 1.2;\n}\n\n.info-team .member__role {\n  font-size: 12px;\n}\n\n.info-team .member__label {\n  padding: 48px 14px 14px;\n}\n\n.info-links__title {\n  margin: 0 0 24px;\n  font-size: clamp(30px, 3.2vw, 48px);\n  font-weight: 400;\n  line-height: 1;\n  letter-spacing: -0.035em;\n}\n\n.info-links__list {\n  display: grid;\n  grid-template-columns: repeat(2, minmax(0, 1fr));\n  gap: 16px;\n  margin: 0;\n  padding: 0;\n  list-style: none;\n}\n\n/* Outlined cards with the round arrow, like the jobs on the homepage */\n.info-link {\n  display: flex;\n  height: 100%;\n  align-items: center;\n  justify-content: space-between;\n  gap: 24px;\n  padding: 24px 24px 24px 28px;\n  border: 1px solid var(--c-line);\n  border-radius: 20px;\n  box-sizing: border-box;\n  color: inherit;\n  text-decoration: none;\n  transition: border-color 0.3s ease;\n}\n\n.info-link:hover {\n  border-color: var(--c-orange);\n}\n\n.info-link__text {\n  display: grid;\n  gap: 6px;\n}\n\n.info-link__title {\n  font-size: clamp(20px, 1.7vw, 26px);\n  line-height: 1.15;\n  letter-spacing: -0.02em;\n}\n\n.info-link__sub {\n  color: var(--c-muted);\n  font-size: 15px;\n  font-weight: 300;\n  line-height: 1.4;\n}\n\n.info-link__meta {\n  color: var(--c-muted);\n  font-size: 13px;\n}\n\n.info-link__icon {\n  display: grid;\n  width: 44px;\n  height: 44px;\n  flex: none;\n  place-items: center;\n  border: 1px solid var(--c-line);\n  border-radius: 50%;\n  transition: background-color 0.2s ease, border-color 0.2s ease;\n}\n\n.info-link:hover .info-link__icon {\n  border-color: var(--c-orange);\n  background: var(--c-orange);\n}\n\n@media (max-width: 860px) {\n  .info-hero__inner {\n    padding-block: 120px 48px;\n  }\n  .info-links__list {\n    grid-template-columns: minmax(0, 1fr);\n  }\n  .info-part,\n  .info-gallery,\n  .info-cards .info-cards__list {\n    grid-template-columns: minmax(0, 1fr);\n  }\n  .info-team__grid {\n    grid-template-columns: repeat(2, minmax(0, 1fr));\n    gap: 12px;\n    max-width: none;\n  }\n}\n.info-cards__list--four {\n  grid-template-columns: repeat(4, minmax(0, 1fr));\n}\n\n/* Four cards go two by two on smaller screens */\n@media (min-width: 861px) and (max-width: 1200px) {\n  .info-cards__list--four {\n    grid-template-columns: repeat(2, minmax(0, 1fr));\n  }\n}\n.intro {\n  position: fixed;\n  inset: 0;\n  z-index: 100;\n  display: grid;\n  place-items: center;\n  --intro-alpha: 1;\n  --intro-blur: 40px;\n  background: rgb(23, 31, 28, var(--intro-alpha));\n  backdrop-filter: blur(var(--intro-blur));\n  -webkit-backdrop-filter: blur(var(--intro-blur));\n}\n\n/* Same width as the old loader logo; the animation keeps its own 374 × 75 proportions.\n   The letters wait just outside the frame before they slide in; in logo-loader.json they start 68 units out\n   (the original 61–63 left their edges a hairline inside the frame, visible light-on-dark) */\n.intro--reveal {\n  pointer-events: none;\n}\n\n.intro__logo {\n  width: clamp(200px, 32vw, 420px);\n  aspect-ratio: 374/75;\n}\n\n/* From tech42v2 JobPage.vue */\n.jp-hero {\n  background: linear-gradient(180deg, rgba(23, 31, 28, 0.2), var(--c-ink) 85%), var(--jp-hero-bg) right top/cover no-repeat, var(--c-ink);\n  color: var(--c-paper);\n}\n\n.jp-hero__inner {\n  display: flex;\n  min-height: min(90svh, 860px);\n  flex-direction: column;\n  padding-block: 140px 80px;\n  box-sizing: border-box;\n}\n\n.jp-back {\n  display: inline-flex;\n  align-self: flex-start;\n  align-items: center;\n  gap: 8px;\n  color: var(--c-soft);\n  font-size: 14px;\n  text-decoration: none;\n  transition: color 0.3s ease;\n}\n\n.jp-back:hover {\n  color: var(--c-paper);\n}\n\n.jp-facts {\n  display: flex;\n  flex-wrap: wrap;\n  gap: 8px;\n  margin: auto 0 0;\n  padding: 0;\n  list-style: none;\n}\n\n.jp-facts li {\n  padding: 8px 14px;\n  border: 1px solid rgba(245, 248, 246, 0.3);\n  border-radius: 999px;\n  font-size: 13px;\n}\n\n.jp-hero__title {\n  margin: 20px 0 0;\n  font-size: clamp(48px, 8vw, 148px);\n  font-weight: 400;\n  line-height: 1;\n  letter-spacing: -0.045em;\n}\n\n.jp-hero__tagline {\n  max-width: 30em;\n  margin: 32px 0 0;\n  color: var(--c-orange);\n  font-size: clamp(22px, 2.2vw, 34px);\n  line-height: 1.15;\n  letter-spacing: -0.02em;\n}\n\n/* Photo: rounded and wide, on the same dark as the hero */\n.jp-photo {\n  background: var(--c-ink);\n}\n\n.jp-photo__frame {\n  height: clamp(280px, 42vw, 640px);\n  overflow: hidden;\n  border-radius: 20px;\n}\n\n.jp-photo__img {\n  width: 100%;\n  height: 100%;\n  object-fit: cover;\n}\n\n/* Intro: the opening lines as one large statement */\n.jp-intro {\n  padding-block: calc(var(--section-space) * 0.6) var(--section-space);\n  background: var(--c-ink);\n  color: var(--c-paper);\n}\n\n.jp-intro__inner {\n  max-width: 1100px;\n}\n\n.jp-intro__line {\n  margin: 0 0 0.6em;\n  font-size: clamp(24px, 2.6vw, 40px);\n  line-height: 1.2;\n  letter-spacing: -0.02em;\n}\n\n/* The last light block of the page: rounded at the foot and lying over the dark block that follows, like the\n   closing light block on the other pages */\n.jp-body {\n  position: relative;\n  z-index: 2;\n  border-radius: 0 0 28px 28px;\n  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);\n  padding-block: var(--section-space);\n  background: var(--c-mist);\n  color: var(--c-ink);\n}\n\n.jp-part {\n  display: grid;\n  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);\n  gap: 48px;\n  padding-block: 48px;\n  border-top: 1px solid rgba(23, 31, 28, 0.15);\n}\n\n.jp-part:first-child {\n  padding-top: 0;\n  border-top: 0;\n}\n\n.jp-part__title {\n  margin: 0;\n  font-size: clamp(30px, 3.2vw, 48px);\n  font-weight: 400;\n  line-height: 1;\n  letter-spacing: -0.035em;\n}\n\n.jp-part__text {\n  max-width: 36em;\n  margin: 0 0 1em;\n  color: var(--c-muted);\n  font-size: clamp(16px, 1.2vw, 19px);\n  font-weight: 300;\n  line-height: 1.55;\n}\n\n.jp-part__text:last-child {\n  margin-bottom: 0;\n}\n\n/* Tasks as numbered rows under thin rules */\n.jp-list {\n  margin: 0 0 1em;\n  padding: 0;\n  counter-reset: task;\n  list-style: none;\n}\n\n.jp-list li {\n  display: grid;\n  grid-template-columns: 40px 1fr;\n  max-width: 36em;\n  padding: 14px 0;\n  border-top: 1px solid rgba(23, 31, 28, 0.15);\n  font-size: clamp(16px, 1.2vw, 19px);\n  font-weight: 300;\n  line-height: 1.45;\n  counter-increment: task;\n}\n\n.jp-list li::before {\n  color: var(--c-orange);\n  font-size: 12px;\n  font-weight: 500;\n  line-height: 2;\n  content: counter(task, decimal-leading-zero);\n}\n\n/* Floating apply button: fixed in the bottom right, slides in from below */\n.jp-float {\n  position: fixed;\n  right: var(--gutter-inset);\n  bottom: 24px;\n  z-index: 20;\n  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);\n  opacity: 0;\n  pointer-events: none;\n  translate: 0 24px;\n  transition: opacity 0.4s ease, translate 0.5s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease;\n}\n\n.jp-float--shown {\n  opacity: 1;\n  pointer-events: auto;\n  translate: 0 0;\n}\n\n@media (max-width: 860px) {\n  .jp-hero__inner {\n    padding-block: 120px 56px;\n  }\n  .jp-part {\n    grid-template-columns: minmax(0, 1fr);\n    gap: 20px;\n  }\n}\n/* From tech42v2 LanguageSelector.vue */\n.lang {\n  position: relative;\n}\n\n.lang__trigger {\n  display: inline-flex;\n  align-items: center;\n  gap: 8px;\n  padding: 12px 14px;\n  border: 1px solid rgba(255, 255, 255, 0.22);\n  border-radius: 999px;\n  background: rgba(23, 31, 28, 0.35);\n  backdrop-filter: blur(16px);\n  color: var(--c-paper);\n  font: 500 14px/1 var(--font);\n  cursor: pointer;\n}\n\n.lang--open .lang__trigger {\n  border-color: rgba(255, 255, 255, 0.4);\n}\n\n.lang__globe {\n  width: 18px;\n  height: auto;\n}\n\n.lang__chevron {\n  fill: none;\n  stroke: var(--c-soft);\n  stroke-width: 1.4;\n  stroke-linecap: round;\n  stroke-linejoin: round;\n  transition: transform 0.15s ease;\n}\n\n.lang--open .lang__chevron {\n  transform: rotate(180deg);\n}\n\n.lang__menu {\n  position: absolute;\n  top: 100%;\n  right: 0;\n  margin: 6px 0 0;\n  padding: 6px;\n  list-style: none;\n  border: 1px solid rgba(255, 255, 255, 0.18);\n  border-radius: 16px;\n  background: rgba(23, 31, 28, 0.7);\n  backdrop-filter: blur(24px);\n  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);\n}\n\n/* Invisible bridge so the menu stays open while the pointer moves from trigger to menu */\n.lang__menu::before {\n  content: \"\";\n  position: absolute;\n  inset: -8px 0 auto;\n  height: 8px;\n}\n\n.lang__option {\n  display: flex;\n  width: 168px;\n  align-items: center;\n  justify-content: space-between;\n  padding: 10px 12px;\n  border: 0;\n  border-radius: 10px;\n  background: none;\n  color: var(--c-soft);\n  font: 400 14px/1.2 var(--font);\n  cursor: pointer;\n  /* A link in v3 (a button in tech42v2): no underline, and the focus ring of a button, which sits on the edge */\n  text-decoration: none;\n  outline-offset: 0;\n}\n\n.lang__option:disabled {\n  color: rgba(192, 207, 198, 0.6);\n  cursor: default;\n}\n\n.lang__option:not(:disabled):hover,\n.lang__option--active {\n  background: rgba(255, 255, 255, 0.08);\n  color: var(--c-paper);\n}\n\n.lang__option--active {\n  font-weight: 500;\n}\n\n.lang__code {\n  font-size: 12px;\n  font-weight: 500;\n}\n\n.lang__option--active .lang__code {\n  color: var(--c-orange);\n}\n\n/* From tech42v2 PolicyPage.vue */\n.policy-hero {\n  background: linear-gradient(180deg, rgba(23, 31, 28, 0.2), var(--c-ink) 85%), var(--policy-hero-bg) right top/cover no-repeat, var(--c-ink);\n  color: var(--c-paper);\n}\n\n.policy-hero__inner {\n  display: flex;\n  min-height: min(60svh, 560px);\n  flex-direction: column;\n  justify-content: flex-end;\n  padding-block: 140px 72px;\n  box-sizing: border-box;\n}\n\n/* Subtle way back, as on the blog articles */\n.policy-back {\n  display: inline-flex;\n  align-self: flex-start;\n  align-items: center;\n  gap: 8px;\n  margin-bottom: auto;\n  color: var(--c-soft);\n  font-size: 14px;\n  text-decoration: none;\n  transition: color 0.3s ease;\n}\n\n.policy-back:hover {\n  color: var(--c-paper);\n}\n\n.policy-hero__title {\n  max-width: 12em;\n  margin: 0;\n  font-size: clamp(48px, 7vw, 120px);\n  font-weight: 400;\n  line-height: 1;\n  letter-spacing: -0.045em;\n  text-wrap: balance;\n}\n\n.policy-hero__intro {\n  max-width: 32em;\n  margin: 28px 0 0;\n  color: var(--c-soft);\n  font-size: clamp(17px, 1.4vw, 20px);\n  font-weight: 300;\n  line-height: 1.5;\n}\n\n/* Lies on top of the contact section, like the blog list */\n.policy-body {\n  position: relative;\n  z-index: 2;\n  padding-block: calc(var(--section-space) * 0.6) var(--section-space);\n  border-radius: 0 0 28px 28px;\n  background: var(--c-paper);\n  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);\n  color: var(--c-ink);\n}\n\n.policy-body__grid {\n  display: grid;\n  grid-template-columns: minmax(200px, 1fr) minmax(0, 720px) minmax(0, 1fr);\n  gap: 48px;\n}\n\n.policy-side {\n  position: sticky;\n  top: 120px;\n  align-self: start;\n}\n\n.policy-side__updated {\n  margin: 0 0 20px;\n  color: var(--c-muted);\n  font-size: 13px;\n}\n\n.policy-side__nav {\n  display: grid;\n  gap: 4px;\n}\n\n.policy-side__nav a {\n  padding: 6px 0;\n  color: var(--c-muted);\n  font-size: 15px;\n  text-decoration: none;\n  transition: color 0.3s ease;\n}\n\n.policy-side__nav a:hover,\n.policy-side__nav a[aria-current=page] {\n  color: var(--c-ink);\n}\n\n.policy-side__nav a[aria-current=page]::before {\n  display: inline-block;\n  width: 6px;\n  height: 6px;\n  margin-right: 10px;\n  border-radius: 50%;\n  background: var(--c-orange);\n  content: \"\";\n  vertical-align: 2px;\n}\n\n.policy-prose {\n  font-size: clamp(17px, 1.2vw, 18px);\n  font-weight: 300;\n  line-height: 1.65;\n}\n\n.policy-prose :is(p, ul, ol) {\n  margin: 0 0 1.1em;\n}\n\n.policy-prose h2 {\n  margin: 1.8em 0 0.5em;\n  font-size: clamp(24px, 2vw, 30px);\n  font-weight: 400;\n  line-height: 1.15;\n  letter-spacing: -0.025em;\n  text-wrap: balance;\n}\n\n.policy-prose h2:first-child {\n  margin-top: 0;\n}\n\n.policy-prose :is(ul, ol) {\n  padding-left: 1.3em;\n}\n\n.policy-prose li {\n  margin-bottom: 0.45em;\n  padding-left: 0.3em;\n}\n\n.policy-prose li::marker {\n  color: var(--c-orange);\n}\n\n/* No .policy-prose strong rule: in tech42v2 it was scoped and never reached the bold text (BlogSegments is a\n   fragment), so bold text there is the browser's bolder (400). Same here, so both versions look the same */\n/* A photo beside the text it belongs to; the section's own text flows around it */\n.policy-figure {\n  float: right;\n  width: 40%;\n  margin: 0.3em 0 24px 32px;\n  aspect-ratio: 4/5;\n  border-radius: 20px;\n  object-fit: cover;\n}\n\n.policy-prose::after {\n  display: block;\n  clear: both;\n  content: \"\";\n}\n\n/* The downloadable terms, as an outlined row */\n.policy-download {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: 16px;\n  margin-top: 32px;\n  padding: 16px 16px 16px 24px;\n  border: 1px solid var(--c-line);\n  border-radius: 999px;\n  color: inherit;\n  font-size: 16px;\n  font-weight: 400;\n  text-decoration: none;\n  transition: border-color 0.3s ease;\n}\n\n.policy-download__icon {\n  display: grid;\n  width: 40px;\n  height: 40px;\n  flex: none;\n  place-items: center;\n  border-radius: 50%;\n  background: var(--c-orange);\n  color: var(--c-paper);\n}\n\n.policy-download:hover {\n  border-color: var(--c-orange);\n}\n\n@media (max-width: 1100px) {\n  .policy-body__grid {\n    grid-template-columns: minmax(0, 1fr);\n    gap: 32px;\n  }\n  .policy-side {\n    position: static;\n  }\n  .policy-side__nav {\n    display: flex;\n    flex-wrap: wrap;\n    gap: 4px 20px;\n  }\n}\n@media (max-width: 860px) {\n  .policy-figure {\n    float: none;\n    width: 100%;\n    max-width: 420px;\n    margin: 0 0 24px;\n  }\n  .policy-hero__inner {\n    padding-block: 120px 48px;\n  }\n}\n/* From tech42v2 ProductsSection.vue */\n.products {\n  padding-block: var(--section-space);\n  background: var(--c-mist);\n  color: var(--c-ink);\n}\n\n.products__head {\n  display: flex;\n  flex-wrap: wrap;\n  align-items: flex-end;\n  justify-content: space-between;\n  gap: 32px;\n}\n\n.products__title {\n  margin: 0;\n  font-size: clamp(44px, 6vw, 76.8px);\n  font-weight: 400;\n  line-height: 1;\n  letter-spacing: -0.04em;\n}\n\n.products__body {\n  max-width: 399px;\n  margin: 0;\n  color: var(--c-muted);\n  font-size: 16px;\n  font-weight: 300;\n  line-height: 1.55;\n}\n\n.products__grid {\n  display: grid;\n  grid-template-columns: repeat(2, minmax(0, 1fr));\n  gap: 24px;\n  margin-top: 64px;\n}\n\n.product {\n  display: flex;\n  flex-direction: column;\n  overflow: hidden;\n  border-radius: 16px;\n}\n\n.product--locata {\n  background: var(--c-ink);\n  color: var(--c-paper);\n}\n\n.product--velkom {\n  background: var(--c-orange);\n  color: var(--c-ink);\n}\n\n.product__media {\n  height: 436px;\n  overflow: hidden;\n}\n\n.product__image {\n  width: 100%;\n  height: 100%;\n  object-fit: cover;\n  transition: filter 0.6s ease;\n}\n\n.product:hover .product__image {\n  filter: saturate(1.15) brightness(1.05);\n}\n\n.product__panel {\n  display: flex;\n  flex: 1;\n  flex-direction: column;\n  padding: 36px 36px 28px;\n  box-sizing: border-box;\n}\n\n.product__meta {\n  display: flex;\n  flex-wrap: wrap;\n  align-items: center;\n  justify-content: space-between;\n  gap: 16px;\n}\n\n.product__logo {\n  height: 26px;\n  width: auto;\n}\n\n.product__name {\n  font-size: 24px;\n  font-weight: 600;\n}\n\n/* Category in sentence case, as a quiet pill next to the name */\n.product__category {\n  padding: 7px 12px;\n  border: 1px solid color-mix(in srgb, currentColor 28%, transparent);\n  border-radius: 999px;\n  font-size: 13px;\n  white-space: nowrap;\n}\n\n.product__text {\n  max-width: 24em;\n  margin: 28px 0 0;\n  font-size: clamp(20px, 1.7vw, 26px);\n  font-weight: 300;\n  line-height: 1.25;\n  letter-spacing: -0.015em;\n}\n\n.product__foot {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: 16px;\n  margin-top: auto;\n  padding-top: 40px;\n}\n\n/* Plain text link with a larger arrow, in the card's own text colour */\n.product__cta {\n  display: inline-flex;\n  align-self: flex-start;\n  align-items: center;\n  gap: 6px;\n  color: inherit;\n  font-size: 18px;\n  font-weight: 400;\n  letter-spacing: -0.01em;\n  /* Taller tap area without moving the text */\n  padding-block: 8px;\n  margin-block: -8px;\n  text-decoration: underline;\n  text-decoration-thickness: 1px;\n  text-underline-offset: 0.3em;\n}\n\n.product__cta .arrow {\n  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);\n}\n\n.product__cta:hover .arrow {\n  transform: translate(3px, -3px);\n}\n\n/* Same quiet pill as the category, so it reads as a status and not as a link */\n.product__soon {\n  padding: 7px 12px;\n  border: 1px solid color-mix(in srgb, currentColor 28%, transparent);\n  border-radius: 999px;\n  font-size: 15px;\n}\n\n@media (max-width: 860px) {\n  .products__grid {\n    grid-template-columns: 1fr;\n  }\n  .product__media {\n    height: 300px;\n  }\n}\n/* Hero: dark, with the brand gradient glowing in from the top right */\n.sp-hero {\n  position: relative;\n  overflow: hidden;\n  background: linear-gradient(180deg, rgba(23, 31, 28, 0.2), var(--c-ink) 85%), var(--sp-hero-bg) right top/cover no-repeat, var(--c-ink);\n  color: var(--c-paper);\n}\n\n.sp-hero__inner {\n  display: flex;\n  min-height: min(100svh, 980px);\n  flex-direction: column;\n  padding-block: 140px 96px;\n  box-sizing: border-box;\n}\n\n.sp-back {\n  display: inline-flex;\n  align-self: flex-start;\n  align-items: center;\n  gap: 8px;\n  color: var(--c-soft);\n  font-size: 14px;\n  text-decoration: none;\n  transition: color 0.3s ease;\n}\n\n.sp-back:hover {\n  color: var(--c-paper);\n}\n\n.sp-hero__num {\n  margin-top: auto;\n  color: var(--c-orange);\n  font-size: clamp(18px, 1.5vw, 24px);\n  font-weight: 500;\n}\n\n.sp-hero__title {\n  max-width: 12em;\n  margin: 16px 0 0;\n  font-size: clamp(48px, 8vw, 148px);\n  font-weight: 400;\n  line-height: 1;\n  letter-spacing: -0.045em;\n}\n\n/* Landing pages have no number above the title, so the title itself takes the free space and sits as low as on a main service */\n.sp-back + .sp-hero__title {\n  margin-top: auto;\n}\n\n.sp-hero__foot {\n  display: grid;\n  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);\n  align-items: start;\n  gap: 48px;\n  margin-top: 64px;\n  padding-top: 32px;\n  border-top: 1px solid rgba(245, 248, 246, 0.2);\n}\n\n.sp-hero__headline {\n  max-width: 16em;\n  margin: 0;\n  font-size: clamp(24px, 2.4vw, 36px);\n  line-height: 1.15;\n  letter-spacing: -0.02em;\n}\n\n.sp-hero__intro {\n  max-width: 34em;\n  margin: 0;\n  color: var(--c-soft);\n  font-size: 16px;\n  font-weight: 300;\n  line-height: 1.55;\n}\n\n/* Photo: rounded, wide, on the same dark as the hero so it reads as part of it */\n.sp-photo {\n  padding-bottom: calc(var(--section-space) * 0.5);\n  background: var(--c-ink);\n}\n\n.sp-photo__frame {\n  height: clamp(280px, 42vw, 640px);\n  overflow: hidden;\n  border-radius: 20px;\n}\n\n.sp-photo__img {\n  width: 100%;\n  height: 100%;\n  object-fit: cover;\n}\n\n/* Steps: orange band with one joined strip */\n.sp-steps {\n  padding-block: calc(var(--section-space) * 0.6);\n  background: var(--c-orange);\n  color: var(--c-ink);\n}\n\n.sp-steps__list {\n  display: grid;\n  grid-template-columns: repeat(3, minmax(0, 1fr));\n  margin: 0;\n  padding: 0;\n  overflow: hidden;\n  border: 1px solid rgba(23, 31, 28, 0.18);\n  border-radius: 24px;\n  list-style: none;\n}\n\n.sp-step {\n  display: flex;\n  min-height: 300px;\n  flex-direction: column;\n  padding: 32px;\n  box-sizing: border-box;\n}\n\n.sp-step + .sp-step {\n  border-left: 1px solid rgba(23, 31, 28, 0.18);\n}\n\n.sp-step__num {\n  font-size: clamp(18px, 1.5vw, 24px);\n  font-weight: 500;\n}\n\n.sp-step__title {\n  margin: auto 0 0;\n  font-size: clamp(26px, 2.6vw, 38px);\n  font-weight: 400;\n  line-height: 1.1;\n  letter-spacing: -0.025em;\n}\n\n.sp-step__text {\n  max-width: 320px;\n  margin: 20px 0 0;\n  font-size: 15px;\n  font-weight: 300;\n  line-height: 1.5;\n}\n\n/* Body: a large opening, then the other parts in a grid of two columns */\n.sp-body {\n  padding-block: var(--section-space);\n  background: var(--c-mist);\n  color: var(--c-ink);\n}\n\n.sp-lead--art {\n  display: grid;\n  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);\n  gap: clamp(40px, 7vw, 120px);\n  align-items: center;\n}\n\n.sp-lead__art {\n  margin: 0;\n}\n\n/* Never taller than --art-max, so a tall drawing does not outgrow the wide ones. The width is spelled out from the\n   drawing's ratio, so the page keeps the room before the image loads */\n.sp-lead__img {\n  --art-max: 440px;\n  display: block;\n  width: min(100%, var(--art-max) * var(--art-ratio));\n  height: auto;\n}\n\n.sp-lead__title {\n  margin: 0 0 28px;\n  font-size: clamp(36px, 4.4vw, 68px);\n  font-weight: 400;\n  line-height: 1;\n  letter-spacing: -0.04em;\n}\n\n.sp-lead__text {\n  max-width: 30em;\n  margin: 0;\n  font-size: clamp(19px, 1.6vw, 24px);\n  font-weight: 300;\n  line-height: 1.45;\n}\n\n.sp-parts {\n  display: grid;\n  grid-template-columns: repeat(2, minmax(0, 1fr));\n  gap: clamp(48px, 5vw, 80px) clamp(40px, 7vw, 120px);\n  margin-top: clamp(72px, 8vw, 128px);\n  padding-top: clamp(48px, 5vw, 80px);\n  border-top: 1px solid rgba(23, 31, 28, 0.15);\n}\n\n.sp-part__num {\n  color: var(--c-orange);\n  font-size: 12px;\n}\n\n.sp-part__title {\n  margin: 16px 0 14px;\n  font-size: clamp(24px, 2.2vw, 32px);\n  font-weight: 400;\n  line-height: 1.1;\n  letter-spacing: -0.03em;\n}\n\n.sp-part__text {\n  max-width: 36em;\n  margin: 0;\n  color: var(--c-muted);\n  font-size: clamp(17px, 1.3vw, 20px);\n  font-weight: 300;\n  line-height: 1.5;\n}\n\n@media (max-width: 860px) {\n  .sp-lead--art,\n  .sp-parts {\n    grid-template-columns: minmax(0, 1fr);\n  }\n}\n.sp-prices {\n  margin-top: 48px;\n  padding: clamp(28px, 3vw, 40px);\n  border-radius: 20px;\n  background: var(--c-paper);\n}\n\n.sp-prices__title {\n  margin: 0 0 20px;\n  font-size: clamp(26px, 2.4vw, 36px);\n  font-weight: 400;\n  line-height: 1;\n  letter-spacing: -0.03em;\n}\n\n.sp-prices__list {\n  display: grid;\n  margin: 0;\n}\n\n.sp-price {\n  display: flex;\n  align-items: baseline;\n  justify-content: space-between;\n  gap: 24px;\n  padding-block: 16px;\n  border-top: 1px solid rgba(23, 31, 28, 0.12);\n}\n\n.sp-price__label {\n  font-size: clamp(17px, 1.4vw, 20px);\n}\n\n.sp-price__amount {\n  margin: 0;\n  color: var(--c-orange);\n  font-size: clamp(24px, 2.2vw, 32px);\n  letter-spacing: -0.02em;\n  white-space: nowrap;\n}\n\n/* \"excl. VAT\" small and quiet behind each price, so every amount says for itself what it is */\n.sp-vat {\n  margin-left: 8px;\n  color: var(--c-muted);\n  font-size: 13px;\n  font-weight: 300;\n  letter-spacing: 0;\n}\n\n.sp-trainings {\n  margin-top: 48px;\n}\n\n.sp-trainings__title {\n  margin: 0 0 24px;\n  font-size: clamp(30px, 3.2vw, 48px);\n  font-weight: 400;\n  line-height: 1;\n  letter-spacing: -0.035em;\n}\n\n.sp-trainings__list {\n  display: grid;\n  grid-template-columns: repeat(2, minmax(0, 1fr));\n  gap: 16px;\n  margin: 0;\n  padding: 0;\n  list-style: none;\n}\n\n/* White cards without lines, like the cards of the service's parts */\n.sp-training {\n  padding: 28px;\n  border-radius: 20px;\n  background: #fff;\n}\n\n.sp-training__title {\n  margin: 0 0 10px;\n  font-size: clamp(20px, 1.6vw, 24px);\n  font-weight: 400;\n  line-height: 1.2;\n  letter-spacing: -0.02em;\n}\n\n.sp-training {\n  display: flex;\n  flex-direction: column;\n}\n\n.sp-training__text {\n  margin: 0;\n  color: var(--c-muted);\n  font-size: 16px;\n  font-weight: 300;\n  line-height: 1.5;\n}\n\n/* Length and price at the foot of the card, lined up across cards of different text lengths */\n.sp-training__meta {\n  display: flex;\n  align-items: baseline;\n  justify-content: space-between;\n  gap: 16px;\n  margin: auto 0 0;\n  padding-top: 20px;\n}\n\n.sp-training__duration {\n  padding: 6px 12px;\n  background: var(--c-mist);\n  border-radius: 999px;\n  font-size: 14px;\n}\n\n.sp-training__price {\n  color: var(--c-orange);\n  font-size: clamp(22px, 1.9vw, 28px);\n  letter-spacing: -0.02em;\n  white-space: nowrap;\n}\n\n.sp-faq {\n  margin-top: var(--section-space);\n}\n\n.sp-faq__title {\n  margin: 0 0 24px;\n  font-size: clamp(30px, 3.2vw, 48px);\n  font-weight: 400;\n  line-height: 1;\n  letter-spacing: -0.035em;\n}\n\n.sp-faq__item {\n  border-top: 1px solid rgba(23, 31, 28, 0.15);\n}\n\n.sp-faq__item:last-child {\n  border-bottom: 1px solid rgba(23, 31, 28, 0.15);\n}\n\n.sp-faq__question {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: 24px;\n  padding-block: 24px;\n  font-size: clamp(19px, 1.6vw, 24px);\n  line-height: 1.25;\n  letter-spacing: -0.015em;\n  list-style: none;\n  cursor: pointer;\n}\n\n.sp-faq__question::-webkit-details-marker {\n  display: none;\n}\n\n/* A plus that turns into a minus when open */\n.sp-faq__icon {\n  position: relative;\n  width: 18px;\n  height: 18px;\n  flex: none;\n}\n\n.sp-faq__icon::before,\n.sp-faq__icon::after {\n  position: absolute;\n  top: 50%;\n  left: 0;\n  width: 100%;\n  height: 1.5px;\n  background: var(--c-orange);\n  content: \"\";\n  transition: rotate 0.3s ease;\n}\n\n.sp-faq__icon::after {\n  rotate: 90deg;\n}\n\n.sp-faq__item[open] .sp-faq__icon::after {\n  rotate: 0deg;\n}\n\n.sp-faq__answer {\n  max-width: 44em;\n  margin: 0;\n  padding-bottom: 28px;\n  color: var(--c-muted);\n  font-size: clamp(17px, 1.3vw, 19px);\n  font-weight: 300;\n  line-height: 1.55;\n}\n\n/* A landing page that belongs to this service, as a wide card with an orange edge */\n.sp-highlights {\n  margin-top: var(--section-space);\n}\n\n.sp-highlights__title {\n  margin: 0 0 24px;\n  font-size: clamp(30px, 3.2vw, 48px);\n  font-weight: 400;\n  line-height: 1;\n  letter-spacing: -0.035em;\n}\n\n/* Side by side: three parts fill the row, two share it */\n.sp-highlights__list {\n  display: grid;\n  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));\n  gap: 16px;\n  margin: 0;\n  padding: 0;\n  list-style: none;\n}\n\n/* A single part doesn't stretch over the full width */\n.sp-highlights__list--single {\n  grid-template-columns: minmax(0, 560px);\n}\n\n.sp-highlights__list > li {\n  display: flex;\n}\n\n/* A card without a border: number, name and one line of promise, with the arrow at its foot. It turns dark when\n   pointed at, like the services on the homepage */\n.sp-highlight {\n  display: flex;\n  flex: 1;\n  flex-direction: column;\n  min-height: 280px;\n  padding: clamp(24px, 2.4vw, 32px);\n  border-radius: 20px;\n  background: #fff;\n  color: inherit;\n  text-decoration: none;\n  transition: background-color 0.45s ease, color 0.45s ease, box-shadow 0.45s ease, translate 0.45s cubic-bezier(0.16, 1, 0.3, 1);\n}\n\n.sp-highlight__num {\n  color: var(--c-orange);\n  font-size: 12px;\n}\n\n/* A fixed height for every card, so the titles line up; the drawing keeps its own ratio inside it and sits in the\n   middle of the card, below the number */\n.sp-highlight__art {\n  position: relative;\n  display: block;\n  width: min(100%, 250px * var(--art-ratio));\n  aspect-ratio: var(--art-ratio);\n  margin: 16px auto 0;\n}\n\n.sp-highlight__img {\n  position: absolute;\n  inset: 0;\n  display: block;\n  width: 100%;\n  height: 100%;\n}\n\n.sp-highlight__img--dark {\n  opacity: 0;\n  transition: opacity 0.45s ease;\n}\n\n/* Until the script sets src some browsers draw a broken-image icon in the reserved room */\n.sp-lead__img:not([src]),\n.sp-highlight__img:not([src]) {\n  visibility: hidden;\n}\n\n.sp-highlight__title {\n  margin-top: 40px;\n  font-size: clamp(26px, 2.2vw, 34px);\n  line-height: 1.1;\n  letter-spacing: -0.03em;\n}\n\n.sp-highlight__headline {\n  /* Keeps the arrow off the text on a card with little room */\n  margin: 16px 0 32px;\n  color: var(--c-muted);\n  font-size: 17px;\n  font-weight: 300;\n  line-height: 1.4;\n  transition: color 0.45s ease;\n}\n\n.sp-highlight__icon {\n  display: grid;\n  width: 48px;\n  height: 48px;\n  flex: none;\n  place-items: center;\n  align-self: flex-end;\n  margin-top: auto;\n  border-radius: 50%;\n  /* A soft fill instead of an outline, so the card has no lines at all */\n  background: var(--c-mist);\n  transition: background-color 0.45s ease, color 0.45s ease;\n}\n\n.sp-highlight__icon .arrow {\n  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);\n}\n\n@media (hover: hover) {\n  .sp-highlight:hover {\n    background: var(--c-ink);\n    color: var(--c-paper);\n    box-shadow: 0 24px 48px rgba(23, 31, 28, 0.18);\n    translate: 0 -4px;\n  }\n  .sp-highlight:hover .sp-highlight__headline {\n    color: #ccd9d1;\n  }\n  .sp-highlight:hover .sp-highlight__img--dark {\n    opacity: 1;\n  }\n  .sp-highlight:hover .sp-highlight__icon {\n    background: var(--c-orange);\n    color: var(--c-ink);\n  }\n  .sp-highlight:hover .sp-highlight__icon .arrow {\n    transform: rotate(45deg);\n  }\n}\n/* Without hover the arrow is orange from the start, so the card reads as a link */\n@media (hover: none) {\n  .sp-highlight {\n    min-height: 0;\n  }\n  .sp-highlight__icon {\n    background: var(--c-orange);\n  }\n}\n/* Closing statement on dark */\n.sp-closing {\n  padding-block: var(--section-space);\n  background: var(--c-ink);\n  color: var(--c-paper);\n}\n\n.sp-closing__text {\n  max-width: 14em;\n  margin: 0;\n  font-size: clamp(40px, 5.6vw, 96px);\n  line-height: 1;\n  letter-spacing: -0.04em;\n}\n\n/* Other services as large link rows */\n/* Lies on top of the contact section, which slides out from behind it (as below the team on the homepage) */\n.sp-others {\n  position: relative;\n  z-index: 2;\n  border-radius: 0 0 28px 28px;\n  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);\n  padding-block: var(--section-space);\n  background: var(--c-paper);\n  color: var(--c-ink);\n}\n\n.sp-others__title {\n  margin: 0 0 40px;\n  font-size: clamp(36px, 4.4vw, 64px);\n  font-weight: 400;\n  line-height: 1;\n  letter-spacing: -0.04em;\n}\n\n.sp-others__list {\n  display: grid;\n  gap: 12px;\n  margin: 0;\n  padding: 0;\n  list-style: none;\n}\n\n.sp-other {\n  display: grid;\n  grid-template-columns: 64px 1fr 48px;\n  align-items: center;\n  padding: 28px;\n  border: 1px solid var(--c-line);\n  border-radius: 16px;\n  background: #fff;\n  color: inherit;\n  text-decoration: none;\n  transition: box-shadow 0.4s ease, translate 0.4s cubic-bezier(0.16, 1, 0.3, 1);\n}\n\n.sp-other:hover {\n  box-shadow: 0 18px 40px rgba(23, 31, 28, 0.08);\n  translate: 0 -2px;\n}\n\n.sp-other__num {\n  color: var(--c-orange);\n  font-size: 11.2px;\n}\n\n.sp-other__title {\n  font-size: clamp(22px, 2.4vw, 32px);\n  line-height: 1.2;\n  letter-spacing: -0.025em;\n}\n\n.sp-other__icon {\n  display: grid;\n  width: 48px;\n  height: 48px;\n  place-items: center;\n  border: 1px solid var(--c-line);\n  border-radius: 50%;\n  transition: background-color 0.2s ease, border-color 0.2s ease;\n}\n\n.sp-other:hover .sp-other__icon {\n  border-color: var(--c-orange);\n  background: var(--c-orange);\n}\n\n@media (max-width: 860px) {\n  .sp-hero__inner {\n    padding-block: 120px 64px;\n  }\n  .sp-hero__foot {\n    grid-template-columns: minmax(0, 1fr);\n    gap: 20px;\n  }\n  .sp-steps__list,\n  .sp-trainings__list {\n    grid-template-columns: minmax(0, 1fr);\n  }\n  .sp-step {\n    min-height: 220px;\n  }\n  .sp-step + .sp-step {\n    border-top: 1px solid rgba(23, 31, 28, 0.18);\n    border-left: 0;\n  }\n  .sp-other {\n    grid-template-columns: 40px 1fr 48px;\n    padding: 20px;\n  }\n}\n/* From tech42v2 ServicesSection.vue */\n.services {\n  position: relative;\n  /* Keeps the cursor label from widening the page near the right edge */\n  overflow: clip;\n  color: var(--c-ink);\n  background: linear-gradient(rgba(245, 248, 246, 0.5), rgba(245, 248, 246, 0.5)), var(--services-bg) center/cover no-repeat, var(--c-paper);\n}\n\n.services__grid {\n  display: grid;\n  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);\n  justify-content: space-between;\n  gap: 48px;\n  padding-block: var(--section-space);\n}\n\n.services__title {\n  margin: 0;\n  font-size: clamp(40px, 5vw, 64px);\n  font-weight: 400;\n  line-height: 0.87;\n  letter-spacing: -0.04em;\n}\n\n.services__body {\n  max-width: 416px;\n  margin: 24px 0 0;\n  color: var(--c-muted);\n  font-size: 16px;\n  font-weight: 300;\n  line-height: 1.55;\n}\n\n.services__list {\n  display: flex;\n  flex-direction: column;\n  gap: 12px;\n  margin: 0;\n  padding: 0;\n  list-style: none;\n}\n\n.service {\n  border: 1px solid var(--c-line);\n  border-radius: 16px;\n  background: #fff;\n}\n\n.service__toggle {\n  display: grid;\n  width: 100%;\n  grid-template-columns: 64px minmax(0, 1fr) 48px;\n  align-items: center;\n  padding: 32px 28px;\n  border: 0;\n  border-radius: 16px;\n  background: none;\n  color: inherit;\n  font: inherit;\n  text-align: left;\n  cursor: pointer;\n}\n\n.service__num {\n  color: var(--c-orange);\n  font-size: 12px;\n}\n\n.service__heading {\n  margin: 0;\n  font: inherit;\n}\n\n.service__title {\n  font-size: clamp(26px, 3vw, 38.4px);\n  line-height: 1.2;\n  letter-spacing: -0.025em;\n}\n\n/* The arrow points up and to the right on every row; the open row shows by its orange circle */\n.service__icon {\n  display: grid;\n  width: 48px;\n  height: 48px;\n  place-items: center;\n  border: 1px solid var(--c-line);\n  border-radius: 50%;\n  transition: background-color 0.45s ease, border-color 0.45s ease, color 0.45s ease;\n}\n\n/* The open row's arrow is orange, so you see at a glance which one is open */\n.service--open .service__icon,\n.service__toggle:hover .service__icon {\n  border-color: var(--c-orange);\n  background: var(--c-orange);\n  color: var(--c-ink);\n}\n\n.service__body {\n  overflow: hidden;\n  padding: 0 28px 32px 92px;\n}\n\n.service {\n  /* `translate` (not transform) so the hover lift does not fight GSAP's reveal */\n  transition: box-shadow 0.4s ease, translate 0.4s cubic-bezier(0.16, 1, 0.3, 1);\n}\n\n.service:hover {\n  box-shadow: 0 18px 40px rgba(23, 31, 28, 0.08);\n  translate: 0 -2px;\n}\n\n.service__text {\n  max-width: 34em;\n  margin: 0;\n  color: var(--c-muted);\n  font-size: 16px;\n  font-weight: 300;\n  line-height: 1.5;\n}\n\n/* Pills on the left, the button to the service's page on the right */\n.service__foot {\n  display: flex;\n  flex-wrap: wrap;\n  align-items: flex-end;\n  justify-content: space-between;\n  gap: 24px;\n  margin-top: 28px;\n}\n\n/* On white the frosted orange would wash out, so here the button is solid */\n/* Also on hover: in tech42v2 this scoped rule outweighed the global .btn:hover */\n.service__cta,\n.service__cta:hover {\n  margin-left: auto;\n  border-color: transparent;\n  background: var(--c-orange);\n  backdrop-filter: none;\n}\n\n.service__tags {\n  display: flex;\n  flex-wrap: wrap;\n  gap: 8px;\n  margin: 0;\n  padding: 0;\n  list-style: none;\n}\n\n/* Each pill leads to the page about it: its own landing page, or else its service */\n.service__tag {\n  display: flex;\n  align-items: center;\n  gap: 4px;\n  padding: 9px 10px 9px 12px;\n  border: 1px solid var(--c-line);\n  border-radius: 999px;\n  color: inherit;\n  font-size: 12px;\n  text-decoration: none;\n  transition: border-color 0.2s ease, background-color 0.2s ease;\n}\n\n.service__tag:hover {\n  border-color: var(--c-orange);\n  background: rgba(255, 119, 0, 0.1);\n}\n\n/* The small arrow tells that a pill is a link, before you hover it */\n.service__tag-arrow {\n  opacity: 0.5;\n  transition: transform 0.2s ease, opacity 0.2s ease, color 0.2s ease;\n}\n\n.service__tag:hover .service__tag-arrow {\n  color: var(--c-orange);\n  opacity: 1;\n  transform: translateX(2px);\n}\n\n@media (max-width: 960px) {\n  .services__grid {\n    grid-template-columns: 1fr;\n  }\n}\n@media (max-width: 560px) {\n  .service__toggle {\n    grid-template-columns: 28px minmax(0, 1fr) 40px;\n    gap: 10px;\n    padding: 24px 20px;\n  }\n  .service__icon {\n    width: 40px;\n    height: 40px;\n  }\n  /* A long single word (\"Softwareontwikkeling\") may break with a hyphen instead of running under the arrow */\n  .service__title {\n    font-size: 21px;\n    hyphens: auto;\n    overflow-wrap: anywhere;\n  }\n  .service__body {\n    padding: 0 20px 24px;\n  }\n}\n/* From tech42v2 SiteFooter.vue */\n.footer {\n  padding: 0 24px 24px;\n  background: var(--c-ink);\n}\n\n.footer__card {\n  overflow: hidden;\n  padding: 48px var(--gutter-inset) 0;\n  border-radius: 12px;\n  background: var(--c-footer);\n  color: var(--c-paper);\n}\n\n/* Equal outer columns keep the tagline in the true centre of the card */\n/* The tagline on the left, the two columns of details together on the right */\n.footer__top {\n  display: grid;\n  grid-template-columns: 1fr auto auto;\n  align-items: start;\n  gap: 32px clamp(48px, 7vw, 120px);\n}\n\n.footer__tagline {\n  margin: 0;\n  font-size: clamp(32px, 3.5vw, 44.8px);\n  line-height: 1;\n  letter-spacing: -0.02em;\n}\n\n.footer__col {\n  display: flex;\n  flex-direction: column;\n  gap: 8px;\n  font-size: 12.8px;\n  font-style: normal;\n  line-height: 1.5;\n}\n\n.footer__col a {\n  text-decoration: none;\n}\n\n.footer__label {\n  margin-bottom: 4px;\n  color: var(--c-soft);\n}\n\n/* The address opens Google Maps; the arrow marks it as a link */\n.footer__address {\n  display: inline-flex;\n  align-self: flex-start;\n  align-items: flex-end;\n  gap: 4px;\n  color: inherit;\n}\n\n.footer__address-arrow {\n  flex-shrink: 0;\n  transition: translate 0.3s ease;\n}\n\n/* LinkedIn sits with the contact details; the arrow marks it as an outside link, like the address */\n.footer__social {\n  display: inline-flex;\n  align-self: flex-start;\n  align-items: center;\n  gap: 4px;\n  color: inherit;\n}\n\n.footer__social:hover .footer__address-arrow,\n.footer__address:hover .footer__address-arrow {\n  translate: 2px -2px;\n}\n\n.footer__bar {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: 24px;\n  margin-top: 72px;\n  padding-top: 28px;\n  border-top: 1px solid rgba(245, 248, 246, 0.2);\n  font-size: 10.4px;\n}\n\n.footer__links {\n  display: flex;\n  gap: 32px;\n}\n\n.footer__links a {\n  text-decoration: none;\n}\n\n.footer__links a:hover {\n  color: var(--c-orange);\n}\n\n/* The logo SVG scales to the card width, so the wordmark always fits edge to edge */\n.footer__wordmark {\n  margin: 56px 0 28px;\n}\n\n.footer__wordmark-logo {\n  width: 100% !important;\n  overflow: hidden;\n  color: var(--c-paper);\n}\n\n@media (max-width: 860px) {\n  .footer__top {\n    grid-template-columns: 1fr 1fr;\n  }\n  .footer__tagline {\n    grid-column: 1/-1;\n  }\n  .footer__bar {\n    flex-wrap: wrap;\n  }\n}\n@media (max-width: 640px) {\n  .footer {\n    padding: 0 12px 12px;\n  }\n  /* On phones the two columns stack, so the address keeps its two lines */\n  .footer__top {\n    grid-template-columns: 1fr;\n  }\n  .footer__card {\n    padding: 32px 24px 0;\n  }\n}\n/* From tech42v2 SiteHeader.vue */\n/* Stays at the top of the screen while the page scrolls underneath */\n.header {\n  position: fixed;\n  inset: 8px 0 auto;\n  z-index: 10;\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  padding: 20px var(--gutter);\n}\n\n/* Glass behind the header once scrolled: a light blur with a touch of extra colour and a faint sheen,\n   strongest at the very top and fading out towards the page below */\n.header::before,\n.header::after {\n  position: absolute;\n  inset: -8px 0 -32px;\n  z-index: -1;\n  content: \"\";\n  opacity: 0;\n  pointer-events: none;\n  transition: opacity 0.5s ease;\n}\n\n.header::before {\n  backdrop-filter: blur(0.75px) saturate(1.1);\n  -webkit-backdrop-filter: blur(0.75px) saturate(1.1);\n  mask-image: linear-gradient(to bottom, #000 30%, transparent);\n}\n\n.header::after {\n  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.03), transparent);\n  backdrop-filter: blur(2px) saturate(1.25);\n  -webkit-backdrop-filter: blur(2px) saturate(1.25);\n  mask-image: linear-gradient(to bottom, #000 10%, transparent 60%);\n}\n\n.header--scrolled::before,\n.header--scrolled::after {\n  opacity: 1;\n}\n\n.header__logo {\n  --egg: 0;\n  position: relative;\n  color: #f7f7ff;\n  transition: color 0.4s ease;\n  -webkit-touch-callout: none;\n  user-select: none;\n}\n\n/* The same logo in orange on top, revealed from left to right as --egg goes from 0 to 1 */\n.header__logo-fill {\n  position: absolute;\n  inset: 0;\n  color: var(--c-orange);\n  clip-path: inset(0 calc((1 - var(--egg)) * 100%) 0 0);\n  pointer-events: none;\n}\n\n.header--on-light .header__logo {\n  color: var(--c-ink);\n}\n\n.header__actions {\n  display: flex;\n  align-items: flex-start;\n  gap: 8px;\n}\n\n/* The phone's spot, right of the menu. --call-dock goes 0 → 1 while the hero button flies up, so the spot opens\n   and the menu slides one place left as the button arrives. The swap itself is instant: the flyer lands exactly here */\n.header__call {\n  margin-left: calc(-48px * (1 - var(--call-dock, 1)));\n  visibility: hidden;\n}\n\n.header__call--shown {\n  visibility: visible;\n}\n\n/* Over light sections the glass buttons get darker, so their white text stays readable */\n.header__menu,\n.header .lang__trigger,\n.header .hc--compact .hc__button {\n  transition: background-color 0.4s ease;\n}\n\n.header--on-light .header__menu,\n.header--on-light .lang__trigger,\n.header--on-light .hc--compact:not(.hc--open) .hc__button {\n  background: rgba(23, 31, 28, 0.78);\n}\n\n/* Touch screens: no blur on anything that stays fixed while the page scrolls under it. A backdrop-filter there is\n   redrawn every scroll frame, which made phones stutter (measured: about 3x the frame rate without it).\n   A tinted layer stands in for the glass, and the buttons get a denser fill instead */\n@media (hover: none) {\n  .header::before,\n  .header::after,\n  .header__menu,\n  .header .lang__trigger,\n  .header .hc--compact .hc__button {\n    backdrop-filter: none;\n    -webkit-backdrop-filter: none;\n  }\n  .header::before {\n    background: rgba(23, 31, 28, 0.55);\n  }\n  .header--on-light::before {\n    background: rgba(245, 248, 246, 0.6);\n  }\n  .header__menu,\n  .header .lang__trigger,\n  .header .hc--compact:not(.hc--open) .hc__button {\n    background: rgba(23, 31, 28, 0.7);\n  }\n}\n/* On phones there is no room for both: with the phone in the header, the language selector steps aside */\n@media (max-width: 640px) {\n  .header--call .lang {\n    display: none;\n  }\n}\n/* Once you scroll down, the language selector steps aside */\n.header .lang {\n  transition: opacity 0.4s ease, visibility 0.4s, translate 0.4s ease;\n}\n\n.header--scrolled .lang {\n  opacity: 0;\n  visibility: hidden;\n  translate: 0 -8px;\n}\n\n.header__menu {\n  display: inline-flex;\n  align-items: center;\n  gap: 10px;\n  padding: 12px 20px 12px 18px;\n  border: 1px solid rgba(255, 255, 255, 0.22);\n  border-radius: 999px;\n  background: rgba(23, 31, 28, 0.35);\n  backdrop-filter: blur(16px);\n  color: var(--c-paper);\n  font: 500 14px/1 var(--font);\n  cursor: pointer;\n}\n\n.header__dots {\n  display: grid;\n  grid-template-columns: repeat(2, 3px);\n  gap: 4px;\n}\n\n.header__dots i {\n  width: 3px;\n  height: 3px;\n  border-radius: 50%;\n  background: var(--c-orange);\n}\n\n@media (max-width: 640px) {\n  .header__logo .logo {\n    width: 110px;\n  }\n}\n/* Teleported to <body>, so these cannot be scoped */\n.menu {\n  position: fixed;\n  inset: 0;\n  z-index: 80;\n  display: flex;\n  flex-direction: column;\n  justify-content: center;\n  padding: var(--gutter);\n  background: var(--c-ink);\n  color: var(--c-paper);\n  font-family: var(--font);\n}\n\n/* The logo stays where it is in the header */\n.menu__logo {\n  position: absolute;\n  top: var(--logo-top, 28px);\n  left: var(--logo-left, var(--gutter));\n  color: #f7f7ff;\n}\n\n.menu__close {\n  position: absolute;\n  top: 28px;\n  right: var(--gutter);\n  padding: 12px 20px;\n  border: 1px solid rgba(255, 255, 255, 0.22);\n  border-radius: 999px;\n  background: none;\n  color: var(--c-paper);\n  font: 500 14px/1 var(--font);\n  cursor: pointer;\n}\n\n.menu__list {\n  margin: 0;\n  padding: 0;\n  list-style: none;\n}\n\n.menu__item {\n  overflow: hidden;\n}\n\n.menu__link {\n  display: inline-flex;\n  align-items: baseline;\n  gap: 20px;\n  padding: 4px 0;\n  color: var(--c-paper);\n  font-size: clamp(44px, 8vw, 104px);\n  line-height: 1.05;\n  letter-spacing: -0.04em;\n  text-decoration: none;\n  transition: color 0.2s ease;\n}\n\n/* GSAP moves .menu__link itself, so the hover shift lives on the label */\n.menu__label {\n  display: inline-block;\n  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);\n}\n\n.menu__link:hover {\n  color: var(--c-orange);\n}\n\n.menu__link:hover .menu__label {\n  transform: translateX(16px);\n}\n\n.menu__index {\n  color: var(--c-orange);\n  font-size: 12px;\n  letter-spacing: 0;\n}\n\n/* Menu layout: big links on the left, one outlined panel on the right */\n.menu__layout {\n  display: grid;\n  grid-template-columns: minmax(0, 1fr) minmax(380px, 520px);\n  align-items: center;\n  gap: 64px;\n  width: 100%;\n}\n\n/* The panel: one rounded outline, its parts divided by thin lines (like the joined steps on the homepage).\n   It simply fades in and out with the menu */\n.menu__aside {\n  display: grid;\n  overflow: hidden;\n  border: 1px solid rgba(245, 248, 246, 0.18);\n  border-radius: 24px;\n}\n\n.menu__card {\n  display: block;\n  margin: 0;\n  padding: 24px 28px;\n  color: var(--c-paper);\n  text-decoration: none;\n}\n\n.menu__card + .menu__card {\n  border-top: 1px solid rgba(245, 248, 246, 0.18);\n}\n\n.menu__card-label {\n  display: flex;\n  align-items: center;\n  gap: 10px;\n  margin: 0;\n  color: var(--c-soft);\n  font-size: 14px;\n}\n\n/* Blog part: the article's photo large across the top, the title below */\n.menu__blog {\n  display: grid;\n  grid-template-columns: minmax(0, 1fr) 20px;\n  align-items: end;\n  gap: 16px 20px;\n  padding-top: 12px;\n  padding-inline: 12px;\n}\n\n.menu__blog-image {\n  width: 100%;\n  height: clamp(140px, 20vh, 220px);\n  grid-column: 1/-1;\n  border-radius: 14px;\n  object-fit: cover;\n  transition: scale 0.8s cubic-bezier(0.16, 1, 0.3, 1);\n}\n\n.menu__blog-text {\n  display: grid;\n  gap: 6px;\n  padding-left: 16px;\n}\n\n.menu__blog-title {\n  font-size: clamp(19px, 1.5vw, 22px);\n  line-height: 1.25;\n  letter-spacing: -0.01em;\n  text-wrap: balance;\n  transition: color 0.3s ease;\n}\n\n.menu__blog:hover .menu__blog-title {\n  color: var(--c-orange);\n}\n\n.menu__card-arrow {\n  margin: 0 16px 4px 0;\n  transition: translate 0.3s ease, color 0.3s ease;\n}\n\n.menu__blog:hover .menu__card-arrow {\n  color: var(--c-orange);\n  translate: 2px -2px;\n}\n\n/* Rows of links inside a card */\n.menu__rows {\n  display: grid;\n  margin: 10px 0 0;\n  padding: 0;\n  list-style: none;\n}\n\n.menu__row {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: 12px;\n  padding: 12px 0;\n  border-top: 1px solid rgba(245, 248, 246, 0.1);\n  color: var(--c-paper);\n  font-size: clamp(17px, 1.3vw, 20px);\n  text-decoration: none;\n  transition: color 0.3s ease;\n}\n\n.menu__rows li:first-child .menu__row {\n  border-top: 0;\n}\n\n.menu__row:hover {\n  color: var(--c-orange);\n}\n\n.menu__pulse {\n  position: relative;\n  width: 8px;\n  height: 8px;\n  border-radius: 50%;\n  background: var(--c-orange);\n}\n\n.menu__pulse::after {\n  position: absolute;\n  inset: 0;\n  border-radius: 50%;\n  background: var(--c-orange);\n  content: \"\";\n  animation: menu-pulse 2s ease-out infinite;\n}\n\n@keyframes menu-pulse {\n  to {\n    opacity: 0;\n    scale: 3;\n  }\n}\n@media (max-width: 640px) {\n  .menu__logo .logo {\n    width: 110px;\n  }\n}\n/* Phones and tablets: the links, with only the ways to reach us below them. The newest article and the open roles\n   are left out here: on a small screen the menu is for getting around */\n@media (max-width: 860px) {\n  .menu {\n    justify-content: flex-start;\n    overflow-y: auto;\n    padding-top: 112px;\n  }\n  .menu__layout {\n    grid-template-columns: minmax(0, 1fr);\n    gap: 36px;\n  }\n  .menu__card {\n    padding: 20px;\n  }\n  .menu__blog,\n  .menu__jobs {\n    display: none;\n  }\n  /* The contact card is the first one left, so it needs no dividing line above it */\n  .menu__jobs + .menu__card {\n    border-top: 0;\n  }\n  .menu__link {\n    font-size: clamp(40px, 12vw, 64px);\n  }\n}\n/* From tech42v2 TeamSection.vue */\n/* Lies on top of the contact section, which is revealed from behind it while scrolling */\n.team {\n  position: relative;\n  z-index: 2;\n  border-radius: 0 0 28px 28px;\n  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);\n  display: grid;\n  /* Photos 5/9 of the width, as on a laptop, but at most 860px: on a wide monitor they grew too big */\n  grid-template-columns: min(860px, (100% - 48px) * 5 / 9) minmax(0, 1fr);\n  align-items: center;\n  justify-content: space-between;\n  gap: 48px;\n  padding: calc(var(--section-space) * 0.5) var(--gutter);\n  background: var(--c-mist);\n  color: var(--c-ink);\n}\n\n.team__grid {\n  display: grid;\n  grid-template-columns: repeat(2, minmax(0, 1fr));\n  gap: 12px;\n  margin: 0;\n  padding: 0;\n  list-style: none;\n}\n\n.member {\n  position: relative;\n  aspect-ratio: 297/434;\n  overflow: hidden;\n  border-radius: 20px;\n}\n\n.member__photo {\n  width: 100%;\n  height: 100%;\n  object-fit: cover;\n}\n\n.member__photo {\n  transition: filter 0.6s ease;\n}\n\n.member:hover .member__photo {\n  filter: saturate(1.2);\n}\n\n/* Name and role over the foot of the photo, on a soft dark fade so they stay readable on any photo */\n.member__label {\n  position: absolute;\n  inset: auto 0 0;\n  padding: 64px 20px 18px;\n  background: linear-gradient(transparent, rgba(23, 31, 28, 0.8));\n}\n\n.member__name {\n  margin: 0;\n  color: #f5f7f5;\n  font-size: 20px;\n  font-weight: 500;\n}\n\n.member__role {\n  margin: 2px 0 0;\n  color: #bfcfc7;\n  font-size: 13px;\n}\n\n.team__title {\n  margin: 0;\n  font-size: clamp(48px, 6.3vw, 80.6px);\n  font-weight: 400;\n  line-height: 1;\n  letter-spacing: -0.04em;\n}\n\n.team__body {\n  margin: 40px 0 0;\n  color: var(--c-muted);\n  font-size: 16px;\n  font-weight: 300;\n  line-height: 1.55;\n}\n\n@media (max-width: 960px) {\n  .team {\n    grid-template-columns: 1fr;\n    padding: 24px var(--gutter) 96px;\n  }\n  .team__text {\n    order: -1;\n    padding-top: 72px;\n  }\n  .jobs {\n    margin-top: 48px;\n  }\n}\n@media (max-width: 480px) {\n  .member__name {\n    font-size: 15px;\n    line-height: 1.2;\n  }\n  .member__role {\n    font-size: 12px;\n  }\n  .member__label {\n    padding: 48px 12px 12px;\n  }\n}\n/* Open roles: light outlined boxes; the round button turns orange on hover */\n.jobs {\n  margin-top: 56px;\n}\n\n.jobs__title {\n  margin: 0 0 16px;\n  font-size: clamp(22px, 1.8vw, 28px);\n  font-weight: 400;\n  letter-spacing: -0.02em;\n}\n\n.jobs__list {\n  display: grid;\n  gap: 10px;\n  margin: 0;\n  padding: 0;\n  list-style: none;\n}\n\n.job {\n  position: relative;\n  display: grid;\n  grid-template-columns: minmax(0, 1fr) 48px;\n  align-items: center;\n  column-gap: 16px;\n  overflow: hidden;\n  padding: 20px 20px 20px 24px;\n  border: 1px solid rgba(23, 31, 28, 0.2);\n  border-radius: 16px;\n  color: var(--c-ink);\n  text-decoration: none;\n  transition: border-color 0.3s ease, background-color 0.3s ease;\n}\n\n.job:hover {\n  border-color: rgba(23, 31, 28, 0.45);\n  background: rgba(255, 255, 255, 0.5);\n}\n\n.job__facts {\n  display: flex;\n  flex-wrap: wrap;\n  gap: 6px;\n  margin-bottom: 14px;\n  grid-column: 1;\n}\n\n.job__facts span {\n  padding: 5px 10px;\n  border: 1px solid rgba(23, 31, 28, 0.2);\n  border-radius: 999px;\n  font-size: 12px;\n}\n\n.job__title {\n  grid-column: 1;\n  font-size: clamp(22px, 1.9vw, 28px);\n  line-height: 1.1;\n  letter-spacing: -0.025em;\n}\n\n.job__tagline {\n  grid-column: 1;\n  margin-top: 6px;\n  color: var(--c-muted);\n  font-size: 14px;\n  font-weight: 300;\n}\n\n.job__icon {\n  display: grid;\n  width: 48px;\n  height: 48px;\n  grid-column: 2;\n  grid-row: 1/span 3;\n  place-items: center;\n  border: 1px solid rgba(23, 31, 28, 0.2);\n  border-radius: 50%;\n  transition: background-color 0.2s ease, border-color 0.2s ease, rotate 0.4s cubic-bezier(0.16, 1, 0.3, 1);\n}\n\n.job:hover .job__icon {\n  border-color: var(--c-orange);\n  background: var(--c-orange);\n  rotate: 45deg;\n}\n\n.job--open .job__title {\n  color: var(--c-orange);\n}\n\n/* From tech42v2 WhySection.vue */\n.why {\n  position: relative;\n  overflow: hidden;\n  background: var(--c-ink);\n}\n\n/* Sized to the screen height so the whole 42 fits inside the stage: no hard cut at the top while it scrolls in */\n.why__42 {\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  width: auto;\n  height: 80svh;\n  aspect-ratio: 1354/887;\n  max-width: none;\n  translate: -30% -50%;\n  pointer-events: none;\n}\n\n.why__stage {\n  position: relative;\n  display: grid;\n  align-content: center;\n  gap: 1.2em;\n  overflow: clip;\n  padding-block: var(--section-space);\n  font-size: clamp(30px, 3.8vw, 58px);\n}\n\n/* With motion, the stage fills the screen and the two steps take turns in one spot */\n.why--animated .why__stage {\n  height: 100svh;\n  padding-block: 0;\n  box-sizing: border-box;\n}\n\n/* Each step is centred on its own, so the shorter first text does not hang at the top of the shared cell */\n.why--animated .why__text--one,\n.why--animated .why__step {\n  grid-area: 1/1;\n  align-self: center;\n}\n\n.why__step {\n  position: relative;\n}\n\n/* With motion the tagline hangs below the text without taking room, so the text alone is centred until it arrives */\n.why--animated .why__tag {\n  position: absolute;\n  top: 100%;\n  left: 0;\n}\n\n.why__text {\n  position: relative;\n  max-width: 20em;\n  margin: 0;\n  color: var(--c-paper);\n  font-size: 1em;\n  line-height: 1.1;\n  letter-spacing: -0.03em;\n}\n\n/* The tagline closes the second text: same size and rhythm, so it reads on from the text, set apart by orange\n   and a little air. Sized in em, it keeps that relation at every screen width */\n.why__tag {\n  margin: 0.8em 0 0;\n}\n\n/* Small lead-in above the tagline */\n.why__tag-label {\n  margin: 0 0 12px;\n  color: var(--c-soft);\n  font-size: clamp(13px, 1vw, 15px);\n  letter-spacing: 0;\n}\n\n.why__tagline {\n  position: relative;\n  margin: 0;\n  color: var(--c-orange);\n  font-size: 1em;\n  line-height: 1.1;\n  letter-spacing: -0.03em;\n}\n\n@media (max-width: 860px) {\n  /* On phones the 42 is big and centred, running off both edges of the screen */\n  .why__42 {\n    left: 50%;\n    width: 170vw;\n    height: auto;\n    translate: -50% -50%;\n  }\n}","export function getActiveElement(doc: Document | null): HTMLElement | null {\n  return doc?.activeElement as HTMLElement || null;\n}\n\nexport function getToplevelWindow() {\n  let toplevelwindow: Window = window;\n  while (toplevelwindow.frameElement)\n    toplevelwindow = toplevelwindow.parent;\n  return toplevelwindow;\n}\n\nexport function asIframe(node: Element | null): HTMLIFrameElement | null {\n  return node && (node as HTMLElement)?.matches?.('iframe') ? node as HTMLIFrameElement : null;\n}\n\n/**\n     Find the currently focused element\n *\n    @param limitdoc - If set, only return compontents in the specified document (prevents editable iframes from returning subframes)\n    @returns The element or null\n */\nexport function getCurrentlyFocusedElement(limitdoc?: Document): HTMLElement | null {\n  try {\n    let focused = getActiveElement(getToplevelWindow().document);\n    for (; ;) {\n      const frame = asIframe(focused);\n      if (frame && (!limitdoc || frame.ownerDocument !== limitdoc))\n        focused = getActiveElement(frame.contentDocument);\n      else\n        break;\n    }\n    if (focused && limitdoc && focused.ownerDocument !== limitdoc)\n      return null;\n    return focused;\n  } catch (e) {\n    return null;\n  }\n}\n\n/** Return whether the node is reachable for focus by keyboard navigation\n   (because tabIndex === -1 will be seen a non(keyboard)focusable by this function)\n\n    @param node - Node to test\n    @param ignoreInert - Ignore the inert attribute\n*/\nexport function canFocusTo(node: Element, { ignoreInertAttribute = false } = {}): node is HTMLElement { //returns if a -visible- node is focusable (this function does not check for visibility itself)\n  if (!node.closest) //callers are not necessarily calling us with HTMLElement, eg getClosestValidFocusTarget might supply a document\n    return false;\n  if (!ignoreInertAttribute && node.closest('[inert]'))\n    return false;\n\n  if ((node as HTMLElement).contentEditable === \"true\")\n    return true;\n  if (node.shadowRoot?.delegatesFocus)\n    return true;\n\n  return (node as HTMLElement).tabIndex >= 0 && !(node as HTMLInputElement).disabled && !(node.tagName === 'A' && !(node as HTMLAnchorElement).href);\n}\n\nexport function getFocusableComponents(startnode: Element | null, options?: boolean | { recurseFrames?: boolean; ignoreInertAttribute?: boolean }): HTMLElement[] {\n  if (typeof options !== \"object\") {\n    options = { recurseFrames: options };\n  }\n  let focusable: HTMLElement[] = [];\n  if (!startnode)\n    return focusable;\n  for (const currentnode of startnode.children) {\n    // Get current style (avoid mootools due to cross-frame issues)\n    const currentstyle = getComputedStyle(currentnode);\n    if (!currentstyle || currentstyle.display === \"none\" || currentstyle.visibility === \"hidden\") {\n      //if(currentnode.getStyle) console.log(\"getFocusableComponents skipping\",currentnode, $(currentnode).getStyle(\"display\"), currentnode.getStyle(\"visibility\"))\n      continue;\n    }\n\n    let iframe;\n    if (options?.recurseFrames && (iframe = asIframe(currentnode))) { //might contain more things to focus\n      try {\n        const subnodes = getFocusableComponents(iframe.contentDocument!.documentElement, options);\n        if (subnodes.length)\n          focusable = focusable.concat(subnodes);\n      } catch {\n        //assume permission error\n      }\n    } else if (canFocusTo(currentnode, options)) {\n      focusable.push(currentnode);\n    }\n\n    if ((currentnode as HTMLElement).isContentEditable)\n      continue; //don't look for further focusable nodes inside, the whole RTE counts as an editable component\n\n    const subnodes = getFocusableComponents(currentnode, options);\n    if (subnodes.length)\n      focusable = focusable.concat(subnodes);\n  }\n  return focusable;\n}\n\nexport function getAllFocusableComponents() {\n  return getFocusableComponents(getToplevelWindow().document.documentElement, true);\n}\n","// eslint-disable-next-line @typescript-eslint/no-explicit-any -- we can't know the types passed to merge call\ntype FormatFunction = (value: any) => string | number;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- we can't know the types passed to merge call\ntype UpdateFunction = (node: HTMLElement, value: any) => void;\nconst formatters: { [key: string]: FormatFunction } = {};\nconst updaters: { [key: string]: UpdateFunction } = {};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- we can't know the types passed to merge call\nfunction mergeNode(node: HTMLElement, set: string, data: any) {\n  const parts = set.split(\":\");\n  const isNodeFunc = parts.length === 1;\n  if (parts.length > 2) {\n    console.error(`Illegal merge expression: '${set}'`, node);\n    return;\n  }\n\n  let func = \"\";\n  let exprpath = (isNodeFunc ? parts[0] : parts[1]).trim();\n\n  const callparts = exprpath.split(\"(\");\n  if (callparts.length > 1) {\n    if (callparts.length !== 2) {\n      console.error(`Illegal merge value: '${set}'`, node);\n      return;\n    }\n\n    func = callparts[0].trim();\n    const funcrest = callparts[1].split(\")\");\n    if (funcrest.length !== 2 || funcrest[1] !== \"\") {\n      console.error(`Illegal merge value: '${set}'`, node);\n      return;\n    }\n    exprpath = funcrest[0].trim();\n  }\n\n  let value = data;\n  if (exprpath !== \"*\") {\n    const exprpathparts = exprpath.split(\".\");\n    for (let i = 0; i < exprpathparts.length; ++i) {\n      value = value[exprpathparts[i].trim()];\n      if (typeof value === \"undefined\")\n        return;\n    }\n  }\n\n  if (isNodeFunc) {\n    if (func && updaters[func])\n      updaters[func](node, value);\n    else if (func)\n      console.error(`Unknown updating function '${func}' in '${set}'`, node);\n    else\n      console.error(`A function is required for merges without a property (in '${set}')`, node);\n    return;\n  }\n\n  const prop = parts[0].trim();\n  if (func) {\n    if (formatters[func])\n      value = formatters[func](value);\n    else {\n      console.error(`Unknown formatting function '${func}' in '${set}'`, node);\n      return;\n    }\n  }\n\n  if (typeof value !== \"string\" && typeof value !== \"number\") {\n    console.error(`Got a value of type ${typeof value} in '${set}'`, node);\n    return;\n  }\n\n  switch (prop) {\n    case 'events':\n    case 'styles':\n    case 'children':\n    case 'on':\n    case \"className\":\n    case \"class\":\n    case 'style':\n    case 'dataset':\n    case 'childNodes':\n      {\n        console.error(`Cannot modify '${prop}' with merge`, node);\n        return;\n      }\n    default:\n      {\n        // 1-to-1 name to property mapping\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any -- we don't know which keys will be set\n        (node as any)[prop] = value;\n        return;\n      }\n  }\n}\n\n/**\n     Apply all merge fields within a node, recursively\n *\n    @param mergenode - Root node to start merging\n    @param data - Merge data\n    @param options - filter: If set, a function that will be called for every node with merge functions. If it returns a falsy value, the node will be skipped.\n */\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- we can't know the types passed to merge call\nexport async function run(mergenode: ParentNode, data: any, { filter }: { filter?: (node: Element) => boolean } = {}) {\n  const nodes = mergenode.querySelectorAll('*[data-merge],*[data-wh-merge]') as NodeListOf<HTMLElement>;\n  for (const node of Array.from(nodes)) { //FIXME drop support for data-wh-merge as soon as we've completed the phase out\n    if (node.nodeType !== 1 || (filter && !filter(node)))\n      continue;\n\n    // Parse 'a=b;c=d(e)'\n    const sets = ((node as HTMLElement).dataset.merge || (node as HTMLElement).dataset.whMerge)?.split(\";\");\n    if (sets)\n      for (const set of sets)\n        mergeNode(node, set, data);\n  }\n}\n\n/**\n     Register a formatter function.\n *\n    @param name - Name of the formatter function\n    @param callback - Formatter function. Called with parameter (value), must return a formatted value to write to the property.\n */\nexport function registerFormatter(name: string, callback: FormatFunction) {\n  formatters[name] = callback;\n}\n\n/**\n     Register an updater function (used to update multiple properties of a node at once)\n *\n    @param name - Name of the updater function\n    @param callback - Updater function. Called with parameters (node: HTMLElement, value: Any).\n */\nexport function registerUpdater(name: string, callback: UpdateFunction) {\n  updaters[name] = callback;\n}\n","export { run, registerFormatter } from 'dompack/extra/merge';\n","/* This is our public api. Any direct inclusions from src/.... not mentioned here are not a stable API\n*/\n\nexport { createDeferred } from '@webhare/std';\nexport { flagUIBusy, getRelativeBounds, type Rect } from '@webhare/dompack';\nexport {\n  dispatchCustomEvent, dispatchDomEvent, fireModifiedEvents, changeValue, normalizeKeyboardEventData,\n  stop\n} from './src/events';\nexport {\n  qS, qSA, contains, closest, matches,\n  empty, isDomReady, onDomReady, getJSONAttribute,\n  before, after, replaceWith, remove, prepend, append,\n  toggleClass, toggleClasses,\n  setStyles,\n  getBaseURI,\n} from './src/tree';\nexport { create, jsxcreate, jsxfragment } from './src/create';\nexport { focus, register, registerMissed, scrollIntoView } from './src/components';\nexport type { TakeFocusEvent } from './src/components';\n\nimport { debugFlags } from \"@webhare/env\";\n\n/** @deprecated You should use debugFlags from \\@webhare/env */\nexport const debugflags = debugFlags;\n","/**\n * Get ISO-formatted local date from a date (getISOString returns an UTC datetime)\n *\n * @param date - Date to return\n * @returns Date as a YYYY-MM-DD string\n */\nexport function getISOLocalDate(date: Date) {\n  return date.getFullYear() + '-' + ('0' + (date.getMonth() + 1)).slice(-2) + '-' + ('0' + date.getDate()).slice(-2);\n}\n","var UNKNOWN_FUNCTION = '<unknown>';\n/**\n * This parses the different stack traces and puts them into one format\n * This borrows heavily from TraceKit (https://github.com/csnover/TraceKit)\n */\n\nfunction parse(stackString) {\n  var lines = stackString.split('\\n');\n  return lines.reduce(function (stack, line) {\n    var parseResult = parseChrome(line) || parseWinjs(line) || parseGecko(line) || parseNode(line) || parseJSC(line);\n\n    if (parseResult) {\n      stack.push(parseResult);\n    }\n\n    return stack;\n  }, []);\n}\nvar chromeRe = /^\\s*at (.*?) ?\\(((?:file|https?|blob|chrome-extension|native|eval|webpack|rsc|<anonymous>|\\/|[a-z]:\\\\|\\\\\\\\).*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i;\nvar chromeEvalRe = /\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/;\n\nfunction parseChrome(line) {\n  var parts = chromeRe.exec(line);\n\n  if (!parts) {\n    return null;\n  }\n\n  var isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line\n\n  var isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line\n\n  var submatch = chromeEvalRe.exec(parts[2]);\n\n  if (isEval && submatch != null) {\n    // throw out eval line/column and use top-most line/column number\n    parts[2] = submatch[1]; // url\n\n    parts[3] = submatch[2]; // line\n\n    parts[4] = submatch[3]; // column\n  }\n\n  return {\n    file: !isNative ? parts[2] : null,\n    methodName: parts[1] || UNKNOWN_FUNCTION,\n    arguments: isNative ? [parts[2]] : [],\n    lineNumber: parts[3] ? +parts[3] : null,\n    column: parts[4] ? +parts[4] : null\n  };\n}\n\nvar winjsRe = /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:file|ms-appx|https?|webpack|rsc|blob):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\n\nfunction parseWinjs(line) {\n  var parts = winjsRe.exec(line);\n\n  if (!parts) {\n    return null;\n  }\n\n  return {\n    file: parts[2],\n    methodName: parts[1] || UNKNOWN_FUNCTION,\n    arguments: [],\n    lineNumber: +parts[3],\n    column: parts[4] ? +parts[4] : null\n  };\n}\n\nvar geckoRe = /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)((?:file|https?|blob|chrome|webpack|rsc|resource|\\[native).*?|[^@]*bundle)(?::(\\d+))?(?::(\\d+))?\\s*$/i;\nvar geckoEvalRe = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i;\n\nfunction parseGecko(line) {\n  var parts = geckoRe.exec(line);\n\n  if (!parts) {\n    return null;\n  }\n\n  var isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n  var submatch = geckoEvalRe.exec(parts[3]);\n\n  if (isEval && submatch != null) {\n    // throw out eval line/column and use top-most line number\n    parts[3] = submatch[1];\n    parts[4] = submatch[2];\n    parts[5] = null; // no column when eval\n  }\n\n  return {\n    file: parts[3],\n    methodName: parts[1] || UNKNOWN_FUNCTION,\n    arguments: parts[2] ? parts[2].split(',') : [],\n    lineNumber: parts[4] ? +parts[4] : null,\n    column: parts[5] ? +parts[5] : null\n  };\n}\n\nvar javaScriptCoreRe = /^\\s*(?:([^@]*)(?:\\((.*?)\\))?@)?(\\S.*?):(\\d+)(?::(\\d+))?\\s*$/i;\n\nfunction parseJSC(line) {\n  var parts = javaScriptCoreRe.exec(line);\n\n  if (!parts) {\n    return null;\n  }\n\n  return {\n    file: parts[3],\n    methodName: parts[1] || UNKNOWN_FUNCTION,\n    arguments: [],\n    lineNumber: +parts[4],\n    column: parts[5] ? +parts[5] : null\n  };\n}\n\nvar nodeRe = /^\\s*at (?:((?:\\[object object\\])?[^\\\\/]+(?: \\[as \\S+\\])?) )?\\(?(.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\n\nfunction parseNode(line) {\n  var parts = nodeRe.exec(line);\n\n  if (!parts) {\n    return null;\n  }\n\n  return {\n    file: parts[2],\n    methodName: parts[1] || UNKNOWN_FUNCTION,\n    arguments: [],\n    lineNumber: +parts[3],\n    column: parts[4] ? +parts[4] : null\n  };\n}\n\nexport { parse };\n","import * as stacktrace_parser from \"stacktrace-parser\";\n\nexport type StackTraceItem = {\n  filename: string;\n  line: number;\n  col: number;\n  func: string;\n};\n\nexport type StackTrace = StackTraceItem[];\n\nexport function parseTrace(e: Error): StackTrace {\n  if (!e?.stack)\n    return [];\n\n  const trace = stacktrace_parser.parse(e.stack);\n  return trace.map(i => ({ filename: i.file || \"\", line: i.lineNumber || 1, col: i.column || 1, func: (i.methodName || \"\") }));\n}\n\nexport function getStackTrace(): StackTrace {\n  return parseTrace(new Error()).slice(1);\n}\n\nexport function formatTrace(trace: StackTraceItem[]): string {\n  return trace.map(e =>\n    `    at ${e.func} (${e.filename}:${e.line}:${e.col})`).join(\"\\n\");\n}\n\nexport function prependStackTrace(error: Error, trace: StackTrace) {\n  if (!error.stack)\n    return; //no stack to manipulate\n\n  const stacklines = error.stack?.split(\"\\n\") || [];\n  const tracelines = formatTrace(trace);\n  error.stack = (stacklines[0] ? stacklines[0] + \"\\n\" : \"\") + tracelines + '\\n' + (stacklines.slice(1).join(\"\\n\"));\n  return error;\n}\n","import { levenshteinDistance } from \"@webhare/std\";\n\n/** Find the best match for a string fiven a list of alternatives. Defaults to case insensitive match.\n    @param name - Name to search\n    @param alternatives - Alternatives to choose from\n    @param matchCase - Do a case sensitive compare (defaults to FALSE)\n    @returns Best match or null if none found\n*/\nexport function getBestMatch(name: string, alternatives: readonly string[], { matchCase = false } = {}): string | null {\n  if (!matchCase)\n    name = name.toLowerCase();\n\n  const threshold = name.length < 3 ? 1 : 2;\n  const matches = alternatives.\n    map((value) => ({ value, distance: levenshteinDistance(name, matchCase ? value : value.toLowerCase()) })).\n    filter((match) => match.distance <= threshold).\n    sort((a, b) => a.distance - b.distance);\n\n  return matches[0]?.value || null;\n}\n\n/** Return match info as text to append to the end of a message\n    @param name - Name to search\n    @param alternatives - Alternatives to choose from\n    @param matchCase - Do a case sensitive compare (defaults to FALSE)\n    @returns Returns \", did you mean 'XXX'?\" text if a better match was found, otherwise an empty string\n    @example throw new Error(`${libname} does not export '${name}'${addBestMatch(name, Object.keys(lib))}`);\n\n*/\nexport function addBestMatch(name: string, alternatives: string[], { matchCase = false } = {}): string {\n  const match = getBestMatch(name, alternatives, { matchCase });\n  return match ? `, did you mean '${match}'?` : \"\";\n}\n","// This gets TypeScript to refer to us by our @webhare/... name in auto imports:\ndeclare module \"@webhare/js-api-tools\" {\n}\n\nexport { parseTrace, getStackTrace, prependStackTrace } from \"./stacktracing\";\nexport { getBestMatch, addBestMatch } from \"./levenshtein\";\nexport type { StackTrace, StackTraceItem } from \"./stacktracing\";\nexport type { DisallowExtraPropsRecursive, RecursiveReadonly, PromisifyFunctionReturnType, PromisifyInterface, RecursivePartial } from \"./utility-types\";\n\nimport type { RecursiveReadonly } from \"./utility-types\";\n/** @deprecated Switch to RecursiveReadonly in WH5.6 (matches TS Readonly casing) */\nexport type RecursiveReadOnly<T> = RecursiveReadonly<T>;\n","// This gets TypeScript to refer to us by our @webhare/... name in auto imports:\ndeclare module \"@webhare/jsonrpc-client\" {\n}\n\nimport { debugFlags, backendBase } from \"@webhare/env\";\nimport { type StackTrace, parseTrace, prependStackTrace, type PromisifyInterface } from \"@webhare/js-api-tools\";\n\n//just number RPCs globally instead of per server, makes debug ouput more useful\nlet globalseqnr = 0;\n\nexport interface RPCCallOptions {\n  /** Append function name to URLs. Purely for better logging/visibility as the WebHare JSONRPC server will ignore it */\n  addfunctionname?: boolean;\n  /** Custom URL marker */\n  urlappend?: string;\n  /** Call timeout */\n  timeout?: number;\n  /** Abort signal to cancel the RPC */\n  signal?: AbortSignal;\n  /** Retry on 429 */\n  retry429?: boolean;\n  /** Silent - do not log errors */\n  silent?: boolean;\n  /** Debug (Follows 'rpc' debugflag if not explicity specified) */\n  debug?: boolean;\n  /** Wrap result with response info */\n  wrapresult?: boolean;\n  keepalive?: boolean;\n  /** Headers to submit (Eg Authorization) */\n  headers?: Record<string, string>;\n  /** Base URL for service paths */\n  baseUrl?: string;\n  /** Overide fetch credentials option (defaults to same-origin) */\n  credentials?: RequestCredentials;\n}\n\nexport type RequestID = number | string | null;\n\nexport interface JSONRPCBaseResponse {\n  id: RequestID;\n  debug?: {\n    consoleLog: Array<{\n      //TODO this is Serialized<ConsoleLogItem[]> - should probably rename it to SerializedToJSON and move to std or env ?\n      /** Date when console function was called */\n      when: string;\n      /** `console` method that was called (eg 'log') */\n      method: string;\n      /** Logged data */\n      data: string;\n      /** Location of caller */\n      location?: {\n        filename: string;\n        line: number;\n        col: number;\n        func: string;\n      };\n      /** Codecontext */\n      codeContextId?: string;\n    }>;\n  };\n}\n\nexport interface JSONRPCSuccesfulResponse extends JSONRPCBaseResponse {\n  error: null;\n  result: unknown;\n}\n\nexport interface JSONRPCErrorResponse extends JSONRPCBaseResponse {\n  result: null;\n  error: {\n    code: number;\n    message: string;\n    data?: {\n      trace?: StackTrace;\n    };\n  };\n}\n\nexport type JSONRPCResponse = JSONRPCSuccesfulResponse | JSONRPCErrorResponse;\n\nfunction getDebugAppend() {\n  if (typeof window !== \"undefined\" && typeof window.location !== \"undefined\") {\n    const urldebugvar = new URL(window.location.href).searchParams.get(\"wh-debug\");\n    if (urldebugvar)\n      return '?wh-debug=' + encodeURIComponent(urldebugvar);\n  }\n  return '';\n}\n\nclass ControlledCall {\n  client: RPCClient;\n  options: RPCCallOptions;\n  abortcontroller: AbortController;\n  timeout?: number;\n  _callurl: string;\n  _fetchoptions: RequestInit;\n  promise: Promise<unknown>;\n  timedout?: boolean;\n  aborted?: boolean;\n\n  constructor(client: RPCClient, method: string, stack: StackTrace | null, id: number, options: RPCCallOptions, callurl: string, fetchoptions: RequestInit) {\n    this.client = client;\n    this.options = options;\n\n    // if(options.timeout || options.signal) //as long as rpcResolve exists, we'll ALWAYS need to setup a controller\n    {\n      this.abortcontroller = new AbortController;\n      fetchoptions.signal = this.abortcontroller.signal;\n\n      if (options.timeout && options.timeout > 0) {\n        this.timeout = options.timeout;\n        setTimeout(() => this._handleTimeout(), options.timeout);\n      }\n      if (options.signal) {\n        options.signal.addEventListener(\"abort\", () => this._abort());\n      }\n    }\n\n    this._callurl = callurl;\n    this._fetchoptions = fetchoptions;\n\n    const fetchpromise = fetch(this._callurl, this._fetchoptions);\n    this.promise = this._completeCall(method, stack, id, fetchpromise) as Promise<unknown>;\n  }\n  _handleTimeout() {\n    this.timedout = true;\n    this.abortcontroller.abort();\n  }\n  _abort() {\n    this.aborted = true;\n    this.abortcontroller.abort();\n  }\n\n  async _completeCall(method: string, requestStack: StackTrace | null, id: number, fetchpromise: Promise<Response>) {\n    let response;\n    try {\n      for (; ;) { //loop to handle \"429 Conflict\"s\n        response = await fetchpromise;\n        if (response.status === 429 && !(\"retry429\" in this.options && !this.options.retry429) && response.headers.get(\"Retry-After\")) {\n          const retryafter = parseInt(response.headers.get(\"Retry-After\") || \"\");\n          if (this.client.debug)\n            console.warn(`[rpc] We are being throttled (429 Too Many Requests) - retrying after ${retryafter} seconds`);\n\n          await new Promise(resolve => setTimeout(resolve, retryafter * 1000));\n          fetchpromise = fetch(this._callurl, this._fetchoptions);\n          continue;\n        }\n        break;\n      }\n    } catch (exception) {\n      if (this.client.debug)\n        console.log(`[rpc] #${id} Exception invoking '${method}'`, exception);\n\n      if (this.aborted)\n        throw new Error(`RPC Aborted`);\n      else if (this.timedout)\n        throw new Error(`RPC Timeout: timeout was set to ${this.timeout} milliseconds`);\n      else\n        throw new Error(`RPC Failed: exception: ` + exception);\n    }\n\n    let jsonresponse;\n    try {\n      jsonresponse = await response.json() as JSONRPCResponse;\n      if (jsonresponse?.debug) {\n        if (jsonresponse.debug.consoleLog) {\n          for (const logitem of jsonresponse.debug.consoleLog) {\n            //should we log 'when'? it's getting more and more noisy then though....\n            //TODO should we match the remote's method (after validating) or just keep eveyrthing at 'log' ?\n            console.log(`[remote:${logitem.method}] ${logitem.location ? `${logitem.location.filename.split(\"/\").at(-1)}:${logitem.location.line}: ` : ''}${logitem.data}`);\n          }\n        }\n\n        delete jsonresponse.debug; //reduce noise in later logs\n      }\n\n      if (this.client.debug)\n        console.log(`[rpc] #${id} Received response to '${method}'`, jsonresponse);\n    } catch (exception) {\n      if (this.client.debug)\n        console.warn(`[rpc] #${id} Response was not valid JSON`, exception);\n    }\n\n    if (!jsonresponse)\n      throw new Error(\"RPC Failed: Invalid JSON/RPC response received\");\n\n    if (jsonresponse?.error) {\n      const err = new Error(\"RPC Error: \" + (jsonresponse.error.message || \"Unknown error\"));\n      if (jsonresponse.error.data?.trace) {\n        try {\n          prependStackTrace(err, jsonresponse.error.data.trace);\n        } catch (err2) {\n          //ignore stacktrace manipulation error\n        }\n      }\n\n      if (!this.options.silent)\n        this.client._tryLogError(requestStack, err);\n      throw err;\n    }\n\n    if (response.status === 200 && jsonresponse && jsonresponse.id !== id)\n      throw new Error(\"RPC Failed: Invalid JSON/RPC response received\");\n\n    if (this.options.wrapresult) {\n      return {\n        status: response.status,\n        result: jsonresponse.result || null,\n        error: jsonresponse.error || null,\n        retryafter: response.headers.get(\"Retry-After\") ? parseInt(response.headers.get(\"Retry-After\") || \"\") : null\n      };\n    }\n\n    return jsonresponse.result;\n  }\n}\n\n/** Invokes (WebHare) JSON/RPC\n    @param url - URL to invoke (leave empty or pass no parameters at all to callback to the current page)\n    */\nclass RPCClient {\n  url: string;\n  addfunctionname: boolean;\n  urlappend: string;\n  options: RPCCallOptions;\n  whservicematch: RegExpMatchArray | null;\n\n  constructor(url: string, options?: RPCCallOptions) {\n    this.options = {\n      timeout: 0,\n      debug: false,\n      ...options\n    };\n\n    if (!url)\n      throw new Error(`You must specify either a WebHare service name or a full URL`);\n\n    this.url = url;\n    this.whservicematch = this.url.match(/^([a-z0-9_]+):([a-z0-9_]+)$/);\n    //if shorthand syntax is used, we know we're talking to our local webhare. add function names and the profiling flag if needed\n    this.addfunctionname = this.options.addfunctionname !== undefined ? this.options.addfunctionname : Boolean(this.whservicematch);\n    this.urlappend = this.options.urlappend !== undefined ? this.options.urlappend : this.whservicematch ? getDebugAppend() : \"\";\n  }\n\n  get debug() {\n    return this.options.debug || debugFlags.rpc;\n  }\n\n  _tryLogError(requestStack: StackTrace | null, error: Error) {\n    console.group();\n    console.warn(\"RPC failed:\", error);\n    if (requestStack) {\n      console.warn(\"Stack at calling point\");\n      console.log(requestStack);\n    }\n    console.groupEnd();\n  }\n\n  //calculate the final URL. delayed here so services can be created on import (getDefaultRPCBase may require waiting for service.ready)\n  private getURL() {\n    //wh_services are always in the root (and soon inside /.wh)\n    const url = this.whservicematch ? `/wh_services/${this.whservicematch[1]}/${this.whservicematch[2]}` : this.url;\n    if (url.match(/^https?:\\/\\//))\n      return url;\n\n    if (this.options.baseUrl)\n      return new URL(url, this.options.baseUrl).toString();\n    else if (backendBase)\n      return backendBase + (backendBase.endsWith('/') && url.startsWith('/') ? url.substring(1) : url);\n    else\n      throw new Error(`You must set the baseUrl option when using the JSONRPC Client without a full URL outside Webhare`);\n  }\n\n  invoke(method: string, params: unknown[]) {\n    //build the URL, add profiling and function parameters where needed\n    let callurl = this.getURL();\n    if (this.addfunctionname) //simplifies log analysis, ignored by the server\n      callurl += `/${method}`;\n    callurl += this.urlappend;\n\n    const id = ++globalseqnr;\n    let requestStack: StackTrace | null = null;\n\n    if (this.debug) {\n      requestStack = parseTrace(new Error);\n      console.log(`[rpc] #${id} Invoking '${method}'`, params, callurl);\n    }\n\n    const fetchoptions: RequestInit = {\n      method: \"POST\",\n      credentials: this.options.credentials || 'same-origin', //this is the default since 2017-08-25, but Edge pre-18 is still around and will fail here\n      headers: {\n        \"Accept\": \"application/json\",\n        \"Content-Type\": \"application/json; charset=utf-8\",\n        ...this.options.headers\n      },\n      body: JSON.stringify(\n        {\n          id: id,\n          method: method,\n          params: params || []\n        }),\n      keepalive: Boolean(this.options.keepalive)\n    };\n\n    return new ControlledCall(this, method, requestStack, id, this.options, callurl, fetchoptions).promise;\n  }\n}\n\ntype ServiceBase<T> = {\n  withOptions(options: RPCCallOptions): T & ServiceBase<T>;\n};\n\nclass ServiceProxy<T> {\n  client: RPCClient;\n\n  constructor(client: RPCClient) {\n    this.client = client;\n  }\n\n  get(target: object, prop: string, receiver: unknown) {\n    if (prop === 'withOptions') { //create a withOptions function\n      return (options: RPCCallOptions) => {\n        const newoptions = {\n          ...this.client.options,\n          ...options,\n          headers: { ...this.client.options.headers, ...options.headers }\n        };\n        return createClient<T>(this.client.url, newoptions);\n      };\n    }\n\n    return (...args: unknown[]) => this.client.invoke(prop, args);\n  }\n}\n\n\n/** Creates an async version of the functions in a class\n * @typeParam ServiceType - Type definition of the service class that implements this service.\n*/\ntype ConvertToRPCInterface<ServiceType> = PromisifyInterface<ServiceType, `_${string}` | \"close\" | \"emit\">;\n\n/** Get the client interface type as would be returned by createClient */\nexport type GetClientInterface<Client> = ConvertToRPCInterface<Client> & ServiceBase<ConvertToRPCInterface<Client>>;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- If you don't care to type the service, just assume it can do anything\nexport function createClient<Client = any>(servicename: string, options?: RPCCallOptions): GetClientInterface<Client> {\n  const rpcclient = new RPCClient(servicename, options);\n  return new Proxy({}, new ServiceProxy<Client>(rpcclient)) as GetClientInterface<Client>;\n}\n","import { createClient, type GetClientInterface } from \"@webhare/jsonrpc-client\";\nimport type { AddressValidationOptions, AddressValidationStatus } from \"./address\";\nimport type { FormSubmitResult } from \"@mod-publisher/js/forms/formbase\";\nimport type { EmailValidationResult, RPCFormTarget, RPCFormInvokeRPC, RPCFormSubmission, RPCFormMessage } from \"./types\";\nimport type { FormService } from \"@mod-publisher/lib/internal/forms/service\";\nimport type { AddressValue } from \"@webhare/address\";\nimport type { CaptchaProvider } from \"@mod-publisher/js/captcha/api\";\n\n\n/// HareScript uses 'nr_detail' instead of 'houseNumber'\nexport type HareScriptAddressValue = Omit<AddressValue, \"houseNumber\"> & { nr_detail?: string };\n\nexport interface HareScriptAddressValidationResult {\n  status: AddressValidationStatus;\n  errors: Array<{\n    ///Fields affected by the error\n    fields: string[];\n    ///Error message in the requested language\n    message: string;\n  }>;\n  corrections: Partial<Record<keyof HareScriptAddressValue, string>> | null;\n}\n\nexport interface PublisherFormService {\n  /** Validate an email address for validity (including against server configured correction/blacklists)\n   *\n   * @param langcode - Language code for messages\n   * @param emailaddress - Address to validate\n   * @returns Validation result\n   */\n  validateEmail(langcode: string, emailaddress: string): Promise<EmailValidationResult>;\n\n  formValidateEmail(target: RPCFormTarget & { field: string }, emailaddress: string): Promise<EmailValidationResult>;\n\n  /** Get an image from a remote URL */\n  getImgFromRemoteURL(imageurl: string): Promise<string>;\n\n  /** Get the final image URL to use */\n  getUploadedFileFinalURL(uploadurl: string): Promise<string>;\n\n  validateEmbeddedObjects(objrefs: string[]): Promise<{ tokill: string[] }>;\n\n  /** Verify address */\n  verifyAddress(url: string, address: HareScriptAddressValue, options: AddressValidationOptions): Promise<HareScriptAddressValidationResult>;\n\n  formSubmit(submitinfo: RPCFormSubmission): Promise<FormSubmitResult>;\n\n  formInvoke(submitinfo: RPCFormInvokeRPC): Promise<{\n    messages: RPCFormMessage[];\n    result: unknown;\n  }>;\n\n  requestBuiltinForm(submitinfo: RPCFormTarget, filename: string, formname: string): Promise<{ html: string }>;\n\n  /** Get captcha configuration. This is needed when the form will preactivate captchas (if form submission requests a captcha it will transmit provider setting in the error metadata) */\n  getCaptchaConfiguration(submitinfo: RPCFormTarget): Promise<CaptchaProvider | null>;\n}\n\nlet hsformservice: GetClientInterface<PublisherFormService> | undefined;\nlet tsformservice: GetClientInterface<FormService> | undefined;\n\nexport function getFormService(): GetClientInterface<PublisherFormService> {\n  hsformservice ||= createClient<PublisherFormService>(\"publisher:forms\");\n  return hsformservice;\n}\n\nexport function getTSFormService(): GetClientInterface<FormService> {\n  tsformservice ||= createClient<FormService>(\"publisher:formsts\");\n  return tsformservice;\n}\n","import type { AddressValue } from \"@webhare/address\";\nimport { stringify, emplace, omit } from \"@webhare/std\";\nimport { getFormService, type HareScriptAddressValidationResult, type HareScriptAddressValue } from \"./formservice\";\n\nexport type { HareScriptAddressValue, HareScriptAddressValidationResult } from \"./formservice\";\n\nexport type AddressChecks = \"nl-zip-suggest\" | \"nl-zip-force\";\n\nexport type AddressValidationStatus = \"ok\" | \"unknown\" | \"error\";\n// not_supported\" | \"ok\" | \"not_enough_data\" | \"invalid_city\" | \"invalid_zip\" | \"invalid_nr_detail\" | \"zip_not_found\" | \"address_not_found\" | \"different_citystreet\" | \"incomplete\" | \"lookup_failed\";\n\nexport interface AddressValidationOptions {\n  checks?: AddressChecks[];\n  lang?: string;\n}\n\nexport interface AddressValidationResult {\n  status: AddressValidationStatus;\n  errors: Array<{\n    ///Fields affected by the error\n    fields: string[];\n    ///Error message in the requested language\n    message: string;\n  }>;\n  corrections: Partial<Record<keyof AddressValue, string>> | null;\n}\n\nlet lookupcache: Map<string, Promise<AddressValidationResult>> | undefined;\n\nexport async function verifyHareScriptAddress(address: HareScriptAddressValue, options: AddressValidationOptions = {}): Promise<HareScriptAddressValidationResult> {\n  if (!lookupcache)\n    lookupcache = new Map<string, Promise<AddressValidationResult>>;\n\n  const lookupkey = stringify({ address, options }, { stable: true });\n  const lookup = emplace(lookupcache, lookupkey, {\n    insert: () => getFormService().verifyAddress(location.pathname, address, options)\n  });\n  return await lookup;\n}\n\nexport async function verifyAddress(address: AddressValue, options: AddressValidationOptions = {}): Promise<AddressValidationResult> {\n  if (!lookupcache)\n    lookupcache = new Map<string, Promise<AddressValidationResult>>;\n\n  // convert houseNumber to nr_detail\n  const hsAddress = { ...omit(address, [\"houseNumber\"]), nr_detail: address.houseNumber };\n\n  const hsresult = await verifyHareScriptAddress(hsAddress, options);\n\n  // back-convert nr_detail to houseNumber\n  let corrections: AddressValidationResult[\"corrections\"] = null;\n  if (hsresult.corrections) {\n    corrections = {};\n    for (const [key, value] of Object.entries(hsresult.corrections) as Array<[keyof HareScriptAddressValue, string]>) {\n      corrections[key === \"nr_detail\" ? \"houseNumber\" as const : key] = value;\n    }\n  }\n  return {\n    status: hsresult.status,\n    errors: hsresult.errors.map(error => ({ fields: error.fields.map(f => f === \"houseNumber\" ? \"nr_detail\" : f), message: error.message })),\n    corrections,\n  };\n}\n","import type { GetTidHooks } from \"./types.js\";\n\nlet hookFactory: (() => GetTidHooks) | undefined;\nlet gotHooks = false;\n\nexport function setGetTidHooksFactory(newHookFactory: () => GetTidHooks) {\n  if (gotHooks)\n    throw new Error(`The call to setGetTidHooksFactory was too late - hooks have already been retrieved once`);\n  hookFactory = newHookFactory;\n}\n\nexport function getGetTidHooks() {\n  gotHooks = true;\n  return hookFactory?.();\n}\n","import { decodeString, encodeString } from '@webhare/std';\nimport type { CompiledLanguageFile, GetTidHooks, LanguagePart, LanguageText, RecursiveLanguageTexts, TidAllowedHTMLTags, TidParam } from './types';\nimport { getGetTidHooks } from './hooks';\nimport { debugFlags, dtapStage } from '@webhare/env';\nimport { getLang } from '@webhare/dompack/src/tree';\n\n\n\nlet hooks: GetTidHooks | undefined;\nlet browserSetLanguage = getLang().language;\nconst defaultLanguage = \"en\";\n\nfunction ensureHooks(): GetTidHooks {\n  return hooks ??= getGetTidHooks?.() ?? {\n    loader: null,\n    currentLanguage: (lang) => {\n      if (lang)\n        browserSetLanguage = lang;\n      return browserSetLanguage;\n    }\n  };\n}\n\nexport function getTidLanguage(): string {\n  return ensureHooks().currentLanguage() || defaultLanguage;\n}\n\nexport function setTidLanguage(newLanguage: string): void {\n  ensureHooks().currentLanguage(newLanguage.toLowerCase());\n}\n\nconst langFileCache: Record<string, CompiledLanguageFile> = {};\n\nfunction getLanguageFile(moduleName: string, langCode: string): CompiledLanguageFile | undefined {\n  const langkey = `${moduleName}:${langCode}`;\n  let compiled = langFileCache[langkey];\n  if (!compiled || !compiled.resource) {\n    const { loader, addResourceChangeListener } = ensureHooks();\n    if (loader) {\n      try {\n        const loaded = compiled = loader(moduleName, langCode, compiled?.registered ?? new Map);\n        // Reload the language file on the next lookup when it has been modified\n        addResourceChangeListener?.(module, loaded.resource, () => {\n          loaded.resource = \"\";\n          loaded.texts.clear();\n        });\n      } catch (e) {\n        // loading failed, erase the loaded texts (keep the registered texts, though)\n        if (dtapStage !== \"production\" || debugFlags.gtd) {\n          console.error(e);\n        }\n        const texts = compiled?.registered ?? new Map;\n        compiled = { resource: \"\", fallbackLanguage: \"\", langCode, texts, registered: texts };\n      }\n      langFileCache[langkey] = compiled;\n    }\n  }\n  if (!compiled && (dtapStage !== \"production\" || debugFlags.gtd)) {\n    console.warn(`No language texts found for module '${moduleName}' and language '${langCode}'`);\n  }\n  return compiled;\n}\n\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- needed for generics\nexport type GetTidRenderFunc<Result extends object = object> = ((tag: TidAllowedHTMLTags, props: { children?: any[]; href?: string }, ...childNodes: any[]) => Result);\nexport type GetTidOptions = { langCode?: string; render?: GetTidRenderFunc | \"fragment\" };\n\ntype GetTidArgumentTypes = [GetTidOptions?] | [TidParam[], GetTidOptions?] | [TidParam?, TidParam?, TidParam?, TidParam?];\n\nfunction toHTMLNode(tag: string, props: { href?: string; children?: Array<string | Node> }): Node {\n  const node = document.createElement(tag);\n  if (props.href)\n    node.setAttribute(\"href\", props.href);\n  if (props.children)\n    node.append(...props.children);\n  return node;\n}\n\nfunction wrapInFragment(children: Array<string | Node>): DocumentFragment {\n  const fragment = document.createDocumentFragment();\n  fragment.append(...children);\n  return fragment;\n}\n\n\nfunction getTidInternal(tid: string, params: TidParam[], options?: GetTidOptions): string | Array<string | object> | DocumentFragment {\n  if (tid === \"\") {\n    return \"\";\n  }\n\n  if (tid.startsWith(\":\")) {\n    return tid.substring(1);\n  } else if (tid.startsWith(\"<>\")) {\n    return decodeString(tid.substring(2), \"html\");\n  }\n\n  const langCode = options?.langCode?.toLowerCase() || getTidLanguage();\n  if (options?.render) {\n    if (options.render === \"fragment\") {\n      const nodes = calcTIDForLanguage(langCode, tid, params, true, toHTMLNode) as Array<string | Node>;\n      return wrapInFragment(nodes);\n    }\n    return calcTIDForLanguage(langCode, tid, params, true, options.render);\n  } else\n    return calcTIDForLanguage(langCode, tid, params, false, null).join(\"\");\n}\n\nexport function getTid(tid: string, options?: GetTidOptions & { render?: undefined }): string;\nexport function getTid<VNode extends object>(tid: string, options?: GetTidOptions & { render?: GetTidRenderFunc<VNode> }): string | Array<string | VNode>;\nexport function getTid(tid: string, options?: GetTidOptions & { render?: \"fragment\" }): DocumentFragment;\nexport function getTid(tid: string, param: TidParam[], options?: GetTidOptions & { render?: undefined }): string;\nexport function getTid<VNode extends object>(tid: string, param: TidParam[], options?: GetTidOptions & { render?: GetTidRenderFunc<VNode> }): string | Array<string | VNode>;\nexport function getTid(tid: string, param: TidParam[], options?: GetTidOptions & { render?: \"fragment\" }): DocumentFragment;\nexport function getTid(tid: string, p1?: TidParam, p2?: TidParam, p3?: TidParam, p4?: TidParam): string;\n\nexport function getTid(tid: string, ...p: GetTidArgumentTypes): string | Array<string | object> | DocumentFragment {\n  if (Array.isArray(p[0])) // case: param: TidParam[], options?: GetTidOptions)\n    return getTidInternal(tid, p[0], p[1] as GetTidOptions);\n  if (p[0] && typeof p[0] === \"object\") // case: options: GetTidOptions\n    return getTidInternal(tid, [], p[0]);\n  return getTidInternal(tid, p as Array<TidParam | undefined>, {});\n}\n\nexport function getTidForLanguage(langCode: string, tid: string, p1: TidParam = null, p2: TidParam = null, p3: TidParam = null, p4: TidParam = null): string {\n  return getTid(tid, [p1, p2, p3, p4], { langCode });\n}\n\nexport function getHTMLTid(tid: string, ...params: TidParam[]): string {\n  return getHTMLTidForLanguage(getTidLanguage(), tid, ...params);\n}\n\nexport function getHTMLTidForLanguage(langCode: string, tid: string, ...params: TidParam[]): string {\n  if (tid === \"\") {\n    return \"\";\n  }\n\n  if (tid.startsWith(\":\")) {\n    return encodeString(tid.substring(1), \"html\");\n  } else if (tid.startsWith(\"<>\")) {\n    return tid.substring(2);\n  }\n\n  return calcTIDForLanguage(langCode, tid, params, true, null).join(\"\");\n}\n\nexport function getTIDListForLanguage(langcode: string, gid: string) {\n  gid = getCanonicalTid(gid.toLowerCase());\n  langcode = langcode.toLowerCase();\n\n  const modsep = gid.indexOf(':');\n  if (modsep === -1) {\n    if (dtapStage !== \"production\" || debugFlags.gtd)\n      console.warn(`Missing module name in call for gid '${gid}'`);\n    return `(cannot find textnode: ${gid})`;\n  }\n\n  const module = gid.substring(0, modsep);\n  const lookup = gid.substring(modsep + 1).replace(/ /g, \"_\") + \".\";\n\n  const compiled = getLanguageFile(module, langcode);\n  const result: string[] = [];\n  if (compiled) {\n    for (const key of compiled.texts.keys()) {\n      if (key.startsWith(lookup) && key.indexOf(\".\", lookup.length) === -1)\n        result.push(`${module}:${key}`);\n    }\n    if (compiled.fallbackLanguage) {\n      const fallback = getLanguageFile(module, compiled.fallbackLanguage);\n      if (fallback) {\n        for (const key of fallback.texts.keys()) {\n          if (key.startsWith(lookup) && key.indexOf(\".\", lookup.length) === -1 && !result.includes(`${module}:${key}`))\n            result.push(`${module}:${key}`);\n        }\n      }\n    }\n  }\n\n  return result;\n}\n\nfunction cannotFind(tid: string) {\n  if (debugFlags.sut)\n    return [tid.substring(tid.lastIndexOf(\".\"))];\n\n  return [`(cannot find text: ${tid})`];\n}\nfunction calcTIDForLanguage(langcode: string, tid: string, rawParams: TidParam[], rich: boolean, render: null): string[];\nfunction calcTIDForLanguage(langcode: string, tid: string, rawParams: TidParam[], rich: boolean, render: GetTidRenderFunc): Array<string | object>;\n\n\nfunction calcTIDForLanguage(langcode: string, tid: string, rawParams: TidParam[], rich: boolean, render: GetTidRenderFunc | null): Array<string | object> {\n  tid = getCanonicalTid(tid.toLowerCase());\n  if (langcode.match(/^[a-z]{2}-/)) //truncate country codes from language identifiers (eg en-GB) until we have actual support for those, so we don't break when en-GB is passed straight from eg. document.documentElement.lang\n    langcode = langcode.substring(0, 2);\n\n  if (tid === \"tollium:tilde.locale.datetimestrings\") {\n    return [getLanguageDatetimeStrings(langcode)];\n  }\n\n  // convert null to \"\", numbers to strings\n  const params = rawParams.map(p => (typeof p === \"number\" ? p.toString() : (p ?? \"\")));\n\n  const modsep = tid.indexOf(':');\n  if (modsep === -1) {\n    if (dtapStage !== \"production\" || debugFlags.gtd)\n      console.warn(`Missing module name in call for tid '${tid}'`);\n    return [`(missing module name in tid: ${tid})`];\n  }\n\n  const module = tid.substring(0, modsep);\n  const lookup = tid.substring(modsep + 1).replace(/ /g, \"_\");\n  tid = `${module}:${lookup}`;\n\n  if (langcode === \"debug\") {\n    const debugtid = `{${[tid, ...params].join(\"|\")}}`;\n    return [rich ? encodeString(debugtid, \"html\") : debugtid];\n  }\n\n  const compiled = getLanguageFile(module, langcode);\n  const match = compiled?.texts.get(lookup);\n  if (!match && compiled?.fallbackLanguage) {\n    const fallback = getLanguageFile(module, compiled.fallbackLanguage);\n    const fallbackMatch = fallback?.texts.get(lookup);\n    if (!fallbackMatch && (dtapStage !== \"production\" || debugFlags.gtd)) {\n      console.warn(`Cannot find text ${tid} for language ${langcode}, also tried fallback language '${compiled.fallbackLanguage}'`);\n    }\n    return fallbackMatch ? executeCompiledTidText(fallbackMatch, params, rich, render) : cannotFind(tid);\n  }\n\n  if (!match && (dtapStage !== \"production\" || debugFlags.gtd)) {\n    console.warn(`Cannot find text ${tid} for language ${langcode}, no fallback language`);\n  }\n  return match ? executeCompiledTidText(match, params, rich, render) : cannotFind(tid);\n}\n\nfunction getCanonicalTid(tid: string) {\n  if (tid.startsWith(\"tollium:common.buttons.\") || tid.startsWith(\"tollium:common.actions.\") || tid.startsWith(\"tollium:common.labels.\")) {\n    return `tollium:tilde.${tid.substring(tid.indexOf(\".\") + 1)}`;\n  } else if (tid.startsWith(\"~\")) {\n    return `tollium:tilde.${tid.substring(1)}`;\n  }\n\n  return tid;\n}\n\nfunction renderString(tok: string, rich: boolean, render: GetTidRenderFunc | null) {\n  return rich ?\n    render ?\n      tok.split(/(\\n)/).map(part => part !== \"\\n\" ? part : render(\"br\", {})).filter(_ => _) :\n      [encodeString(tok, \"html\")] :\n    [tok];\n}\n\nfunction executeCompiledTidText(text: string | LanguagePart[], params: string[], rich: boolean, render: GetTidRenderFunc | null): Array<object | string> {\n  if (typeof text === \"string\")\n    return renderString(text, rich, render);\n\n  const parts = new Array<object | string>;\n  for (const tok of text) {\n    if (typeof tok === \"string\") {\n      parts.push(...renderString(tok, rich, render));\n    } else if (typeof tok === \"number\") {\n      if (tok >= 1) {\n        const get_param = params[tok - 1];\n        if (get_param) {\n          parts.push(...renderString(get_param, rich, render));\n        }\n      }\n    } else if (tok.t === \"tag\") {\n      const sub = executeCompiledTidText(tok.subs, params, rich, render);\n      if (rich && render)\n        parts.push(render(tok.tag, { children: sub }));\n      else\n        parts.push(...(rich ? [`<${tok.tag}>`, ...sub, `</${tok.tag}>`] : sub));\n    } else if (tok.t === \"ifparam\") {\n      const get_param = params[tok.p - 1] || \"\";\n      parts.push(...executeCompiledTidText(get_param.toUpperCase() === tok.value.toUpperCase() ? tok.subs : tok.subselse, params, rich, render));\n    } else if (tok.t === \"a\") {\n      const sub = executeCompiledTidText(tok.subs, params, rich, render);\n      if (rich) {\n        let link = tok.link;\n        if (tok.linkparam > 0 && tok.linkparam <= params.length) {\n          link = params[tok.linkparam - 1] || link;\n        }\n        if (link) {\n          if (render)\n            parts.push(render(\"a\", { href: link, children: sub }));\n          else\n            parts.push(`<a href=\"${encodeString(link, \"attribute\")}\">`, ...sub, `</a>`);\n        } else {\n          parts.push(...sub);\n        }\n      } else {\n        parts.push(...sub);\n      }\n    }\n  }\n  return parts;\n}\n\nfunction flattenRecursiveLanguageTexts(text: RecursiveLanguageTexts, pathsofar: string, result: Map<string, LanguageText>): void {\n  if (typeof text === \"string\" || Array.isArray(text))\n    result.set(pathsofar, text);\n  else\n    for (const [name, value] of Object.entries(text))\n      flattenRecursiveLanguageTexts(value, `${pathsofar}${pathsofar && name ? \".\" : \"\"}${name}`, result);\n}\n\nexport function registerTexts(module: string, langCode: string, tids: RecursiveLanguageTexts) {\n  const langkey = `${module}:${langCode}`;\n  let compiledFile = langFileCache[langkey];\n  if (!compiledFile) {\n    const texts = new Map;\n    langFileCache[langkey] = compiledFile = { resource: \"\", fallbackLanguage: \"\", langCode, texts, registered: texts };\n  }\n  flattenRecursiveLanguageTexts(tids, \"\", compiledFile.registered);\n  if (compiledFile.texts !== compiledFile.registered) {\n    for (const [key, value] of compiledFile.registered)\n      compiledFile.texts.set(key, value);\n  }\n}\n\nfunction getLanguageDatetimeStrings(langCode: string) {\n  switch (langCode.substring(0, 2)) {\n    case \"nl\": return \"am;pm;januari;februari;maart;april;mei;juni;juli;augustus;september;oktober;november;december;maandag;dinsdag;woensdag;donderdag;vrijdag;zaterdag;zondag;jan;feb;mrt;apr;mei;jun;jul;aug;sep;okt;nov;dec;ma;di;wo;do;vr;za;zo\";\n    case \"de\": return \"am;pm;Januar;Februar;März;April;Mai;Juni;Juli;August;September;Oktober;November;Dezember;Montag;Dienstag;Mittwoch;Donnerstag;Freitag;Samstag;Sonntag;Jan.;Febr.;März;Apr.;Mai;Juni;Juli;Aug.;Sept.;Okt.;Nov.;Dez.;Mo;Di;Mi;Do;Fr;Sa;So\";\n    case \"fr\": return \"am;pm;Janvier;Février;Mars;Avril;Mai;Juin;Juillet;Août;Septembre;Octobre;Novembre;Décembre;Lundi;Mardi;Mercredi;Jeudi;Vendredi;Samedi;Dimanche;Janv;Févr;Mars;Avril;Mai;Juin;Juil;Août;Sept;Oct;Nov;Déc;Lun;Mar;Mer;Jeu;Ven;Sam;Dim\";\n    case \"jp\": {\n      return Buffer.from(\"5Y2I5YmNO+WNiOW+jDvvvJHmnIg777yS5pyIO++8k+aciDvvvJTmnIg777yV5pyIO++8luaciDvvvJfmnIg777yY5pyIO++8meaciDvvvJHvvJDmnIg777yR77yR5pyIO++8ke+8kuaciDvmnIjmm5zml6U754Gr5puc5pelO+awtOabnOaXpTvmnKjmm5zml6U76YeR5puc5pelO+Wcn+abnOaXpTvml6Xmm5zml6U777yR5pyIO++8kuaciDvvvJPmnIg777yU5pyIO++8leaciDvvvJbmnIg777yX5pyIO++8mOaciDvvvJnmnIg777yR77yQ5pyIO++8ke+8keaciDvvvJHvvJLmnIg75pyIO+eBqzvmsLQ75pyoO+mHkTvlnJ875pel\", \"base64\").toString();\n    }\n  }\n\n  // \"en\" is the default\n  return \"am;pm;January;February;March;April;May;June;July;August;September;October;November;December;Monday;Tuesday;Wednesday;Thursday;Friday;Saturday;Sunday;Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec;Mon;Tue;Wed;Thu;Fri;Sat;Sun\";\n}\n","// This gets TypeScript to refer to us by our @webhare/... name in auto imports:\ndeclare module \"@webhare/gettid\" {\n}\n\nexport {\n  getTidLanguage,\n  setTidLanguage,\n  getTid,\n  getTidForLanguage,\n  getHTMLTid,\n  getHTMLTidForLanguage,\n  getTIDListForLanguage\n} from \"./internal\";\n","export interface FormFieldLike extends HTMLElement {\n  disabled: boolean;\n  name: string;\n  required: boolean;\n  value: unknown;\n}\n\n/** Base class for customElements that need to act as WebHare (Publisher) form elements */\nexport abstract class JSFormElement<ValueType> extends HTMLElement implements FormFieldLike {\n  static formAssociated = true;\n  static observedAttributes = [\"required\", \"disabled\"];\n\n  // #internals = this.attachInternals();\n\n  constructor() {\n    super();\n  }\n\n  get name() {\n    return this.getAttribute('name') || '';\n  }\n  set name(newname: string) {\n    this.setAttribute('name', newname);\n  }\n  get required(): boolean {\n    return this.hasAttribute('required');\n  }\n  set required(required: boolean) {\n    if (required)\n      this.setAttribute(\"required\", \"\");\n    else\n      this.removeAttribute(\"required\");\n\n    this.refreshState();\n  }\n\n  get disabled(): boolean {\n    return this.hasAttribute('disabled');\n  }\n  set disabled(disable: boolean) {\n    if (disable)\n      this.setAttribute(\"disabled\", \"\");\n    else\n      this.removeAttribute(\"disabled\");\n\n    this.refreshState();\n  }\n\n  abstract value: ValueType;\n\n  /** Invoked whenever disabled/required states change */\n  protected refreshState() {\n  }\n\n  attributeChangedCallback(name: string, oldValue: unknown, newValue: unknown) {\n    if ([\"disabled\", \"required\"].includes(name))\n      this.refreshState();\n  }\n}\n","/* Support APIs to deal with DOM native form elements (eg input, select, textarea) */\n\nimport type FormBase from '@mod-publisher/js/forms/formbase';\nimport { reformatDate } from \"@mod-publisher/js/forms/internal/webharefields\";\nimport { getTid } from \"@webhare/gettid\";\nimport { isFormControl, isHTMLElement, qSA, type FormControlElement } from \"@webhare/dompack\";\nimport type { FormCondition } from \"./types\";\nimport { JSFormElement, type FormFieldLike } from \"./jsformelement\";\nimport { throwError } from '@webhare/std';\n\nexport type ConstrainedRadioNodeList = RadioNodeList & NodeListOf<HTMLInputElement>;\n\n//Query elements that are likely to be formfieldlike. Anything with a [name] but not eg button (and not data-wh-form-name which usually relies on getformvalue events)\nexport const queryFormFieldLike = `[name]:not(button):not(a):not(output)`;\n\nexport function isInputElement(field: Element): field is HTMLInputElement {\n  return isHTMLElement(field) && field.tagName === 'INPUT';\n}\n\n/// Implements required, disabled, ..\nexport function isFormFieldLike(control: HTMLElement): control is FormFieldLike {\n  return isFormControl(control as HTMLElement) || control instanceof JSFormElement;\n}\n\nexport function isRadioOrCheckbox(field: Element): field is HTMLInputElement {\n  return isInputElement(field) && [\"radio\", \"checkbox\"].includes(field.type);\n}\n\n// Constrains the RadioNodeList type to only return HTMLInputElements. reduces number of casts we need\nexport function isRadioNodeList(el: RadioNodeList | Element): el is ConstrainedRadioNodeList {\n  return el instanceof RadioNodeList;\n}\n\nexport function getFieldName(field: HTMLElement): string {\n  return field.dataset.whFormName || (field as HTMLInputElement).name || '';\n}\n\nexport function setFieldName(field: HTMLElement, newname: string) {\n  if (field.dataset.whFormName !== undefined)\n    field.dataset.whFormName = newname;\n  else if ((field as HTMLInputElement).name !== undefined)\n    (field as HTMLInputElement).name = newname;\n  else\n    throw new Error('Cannot set name on field without existing name');\n}\n\nexport function getFieldDisplayName(field: HTMLElement | ConstrainedRadioNodeList): string {\n  if (isRadioNodeList(field))\n    return `radiogroup '${(field.item(0) as HTMLInputElement)?.name || (field.item(0) as HTMLElement)?.id || '<unnamed>'}'`;\n  if (isFormControl(field))\n    return `native field '${field.name || field.id || '<unnamed>'}'`;\n  if (field.dataset.whFormName)\n    return `custom field '${field.dataset.whFormName || field.id || '<unnamed>'}'`;\n  if (field.classList.contains('wh-form__fieldgroup'))\n    return `field group '${field.dataset.whFormGroupFor || field.id || '<unnamed>'}'`;\n  return `${field.tagName} element '${field.id || '<unnamed>'}'`;\n}\n\n/** The WH Form rendering generates wh-fileedit elements. If no handler is detected for them, we downgrade them to input type=file before\n *  the form actually sets up its handler (it's still safe to rewrite top level form elements then)\n*/\nexport function downgradeUploadFields(form: HTMLElement) {\n  for (const uploadfield of qSA(form, \"wh-fileedit\")) {\n    const input = document.createElement(\"input\");\n    input.type = \"file\";\n    for (const attr of uploadfield.attributes)\n      input.setAttribute(attr.name, attr.value);\n\n    uploadfield.replaceWith(input);\n  }\n}\n\nexport function getErrorForValidity(field: FormControlElement): string {\n  const validity = field.validity;\n  if (validity.customError && field.validationMessage)\n    return field.validationMessage;\n\n  if (validity.valueMissing)\n    return getTid(\"publisher:site.forms.commonerrors.required\");\n  if (field instanceof HTMLInputElement) {\n    if (validity.rangeOverflow) {\n      const max = field.type === 'date' ? reformatDate(field.max) : field.max;\n      return getTid(\"publisher:site.forms.commonerrors.max\", max);\n    }\n    if (validity.rangeUnderflow) {\n      const min = field.type === 'date' ? reformatDate(field.min) : field.min;\n      return getTid(\"publisher:site.forms.commonerrors.min\", min);\n    }\n    if (validity.tooShort)\n      return getTid(\"publisher:site.forms.commonerrors.minlength\", field.minLength);\n    if (validity.tooLong)\n      return getTid(\"publisher:site.forms.commonerrors.maxlength\", field.maxLength);\n    if (validity.stepMismatch)\n      if (!field.step || parseInt(field.step) === 1)\n        return getTid(\"publisher:site.forms.commonerrors.step1mismatch\");\n      else\n        return getTid(\"publisher:site.forms.commonerrors.stepmismatch\", field.step);\n  }\n\n  if (validity.badInput)\n    return getTid(\"publisher:site.forms.commonerrors.default\");\n  if (validity.typeMismatch)\n    if ([\"email\", \"url\", \"number\"].includes(field.type))\n      return getTid(\"publisher:site.forms.commonerrors.\" + field.type);\n\n  for (const key of [\"badInput\", \"customError\", \"patternMismatch\", \"rangeOverflow\", \"rangeUnderflow\", \"stepMismatch\", \"typeMismatch\", \"valueMissing\"] as const)\n    if (validity[key])\n      return key;\n\n  return '?';\n}\n\nexport function isFieldNativeErrored(field: HTMLElement): field is FormControlElement {\n  return isFormControl(field) && !field.hasAttribute(\"data-wh-form-skipnativevalidation\") && !field.checkValidity();\n}\n\nexport function getFieldNativeError(field: HTMLElement) {\n  if (isFieldNativeErrored(field))\n    return getErrorForValidity(field);\n\n  return null;\n}\n\n\nexport function parseCondition(conditiontext: string): FormCondition {\n  interface FormConditionWrapper {\n    c: FormCondition;\n  }\n\n  return (JSON.parse(conditiontext) as FormConditionWrapper).c;\n}\n\nexport function getFormElementCandidates(basenode: HTMLElement, namePrefix: string) {\n  const parentForm = basenode.closest('form');\n  if (!parentForm)\n    throw new Error('No form found for element');\n\n  const candidates = qSA<HTMLElement>(basenode, queryFormFieldLike).filter(el => !(\"form\" in el) || el.form === parentForm);\n  if (namePrefix)\n    return candidates.filter(el => getFieldName(el).startsWith(namePrefix + '.'));\n  else\n    return candidates;\n}\n\n/** Get the handler for a form element */\nexport function getFormHandler<FormType extends FormBase<object> = FormBase>(node: HTMLFormElement, options: { allowMissing: true }): FormType | null;\nexport function getFormHandler<FormType extends FormBase<object> = FormBase>(node: HTMLFormElement, options?: { allowMissing?: boolean }): FormType;\n\nexport function getFormHandler<FormType extends FormBase<object> = FormBase>(node: HTMLFormElement, { allowMissing = false } = {}): FormType | null {\n  //FIXME convert to Symbol? but make sure we work cross-realm (ie tests)\n  return (node.propWhFormhandler as FormType) || (allowMissing ? null : throwError('No form handler found for form'));\n}\n\n/** Get the data for a form element. Shorthand for getFormHandler\\<FormBase\\<Shape\\>\\>(xx).data */\nexport function getFormData<DataShape extends object = Record<string, unknown>>(node: HTMLFormElement, options: { allowMissing: true }): DataShape | null;\nexport function getFormData<DataShape extends object = Record<string, unknown>>(node: HTMLFormElement, options?: { allowMissing?: boolean }): DataShape;\n\nexport function getFormData<DataShape extends object = Record<string, unknown>>(node: HTMLFormElement, { allowMissing = false } = {}): DataShape | null {\n  return getFormHandler<FormBase<DataShape>>(node, { allowMissing })?.data;\n}\n","import * as dompack from '@webhare/dompack';\nimport type { FieldErrorOptions, FormFrontendMessage } from '../formbase';\nimport { debugFlags } from '@webhare/env';\nimport { getFieldDisplayName, getFieldNativeError } from '@webhare/forms/src/domsupport';\n\n///Fired at nodes to apply error\nexport type SetFieldErrorData = {\n  error: FormFrontendMessage;\n  reportimmediately: boolean;\n  serverside: boolean;\n  metadata: unknown;\n};\n\nexport type FieldValidator<E extends HTMLElement = HTMLElement> = (node: E) => Promise<FormFrontendMessage | undefined> | FormFrontendMessage | undefined;\n\nfunction setupServerErrorClear(field: HTMLElement) {\n  const group = field.closest<HTMLElement>('.wh-form__fieldgroup') || field;\n  field.propWhCleanupFunction = () => {\n    group.removeEventListener(\"change\", field.propWhCleanupFunction!, true);\n    group.removeEventListener(\"input\", field.propWhCleanupFunction!, true);\n    group.removeEventListener(\"blur\", field.propWhCleanupFunction!, true);\n    setFieldError(field, '', { serverside: true });\n    field.propWhCleanupFunction = undefined;\n  };\n\n  // to be rightly paranoid (plugins and JS directly editing other fields) we'll blur when anything anywhere seems to change\n  // eg wrd.testwrdauth-emailchange would fail on Chrome without this if the browser window was not currently focused\n  group.addEventListener(\"change\", field.propWhCleanupFunction, true);\n  group.addEventListener(\"input\", field.propWhCleanupFunction, true);\n  if (!field.closest('form[novalidate]')) //if we're doing html5 validation, errors will block submit, so let's already clear on blur\n    group.addEventListener(\"blur\", field.propWhCleanupFunction, true);\n}\n\nclass ComponentValidationState {\n  el: HTMLElement;\n\n  /** Explicitly set error */\n  explicit: {\n    error: FormFrontendMessage;\n    serverside: boolean;\n    reportimmediately: boolean;\n    metadata?: unknown;\n\n  } | null = null;\n\n  /** Dynamic errors (generated by the validation steps, refreshable instead of waiting for explciit errors) */\n  dynamicError: FormFrontendMessage | null = null;\n\n  validators: FieldValidator[] = [];\n\n  constructor(el: HTMLElement) {\n    this.el = el;\n  }\n\n  getState(): { error: FormFrontendMessage; suggested?: never } | { error?: never; suggested: FormFrontendMessage } | null {\n    const err = this.getError();\n    if (err)\n      return { error: err };\n\n    if (this.el.propWhValidationSuggestion)\n      return { suggested: this.el.propWhValidationSuggestion };\n\n    return null;\n  }\n\n  getError(): FormFrontendMessage | null {\n    return this.explicit?.error || this.dynamicError || getFieldNativeError(this.el) || null;\n  }\n\n  hasError(): boolean {\n    return Boolean(this.getError());\n  }\n}\n\nconst validations = new WeakMap<HTMLElement, ComponentValidationState>();\n\nexport function getValidationState(field: HTMLElement) {\n\n  const state = validations.get(field);\n  if (state)\n    return state;\n\n  const newstate = new ComponentValidationState(field);\n  validations.set(field, newstate);\n  return newstate;\n}\n\n/* TODO Are we sure we should expose this API? A form-level setupValidator might be better as we can then re-validate at the proper point in time\n   instead of relying on an external user to enable and shutdown the error. We're mixing two completely different systems with setupValidator (which\n   works nicely with our focusout hadling) and setFieldError (which is extremely stateful and relies on the error-setter managing all the edge cases)\n\n   Oh and serverside errors float somewhere halfway that spectrum.. as we setup explicit clearing callbacks to remove the state we created ourselves.\n*/\nexport function setFieldError(field: Element, error: FormFrontendMessage, options?: Partial<FieldErrorOptions>) {\n  if (!dompack.isHTMLElement(field))\n    throw new Error(`Field is not a valid target for handling errors`);\n\n  const state = getValidationState(field);\n  if (!error) {  //clearing\n    if (!state.explicit)\n      return; //no change\n\n    state.explicit = null;\n    if (debugFlags.fhv)\n      console.log(`[fhv] Clearing error state for ${getFieldDisplayName(field)}`, field, error, options);\n  } else { //changing ?\n    if (debugFlags.fhv)\n      console.log(`[fhv] ${state.explicit ? 'Updating' : 'Setting'} error state for ${getFieldDisplayName(field)}`, field, error, options);\n\n    state.explicit = {\n      error,\n      serverside: options?.serverside || false,\n      reportimmediately: options?.reportimmediately || false,\n      metadata: options?.metadata\n    };\n\n    if (options?.serverside)\n      setupServerErrorClear(field);\n  }\n\n  updateFieldError(field);\n}\n\nexport function updateFieldError(field: HTMLElement) {\n  const state = getValidationState(field);\n\n  dompack.dispatchCustomEvent(field, 'wh:form-setfielderror', //this is where parsley hooks in and cancels to handle the rendering of faults itself\n    {\n      bubbles: true,\n      cancelable: true,\n      detail: {\n        error: state.explicit?.error || getFieldNativeError(field) || '',\n        reportimmediately: state.explicit?.reportimmediately || false,\n        serverside: state.explicit?.serverside || false,\n        metadata: state.explicit?.metadata\n      }\n    });\n}\n\n/** Set up a custom validator\n * @param node - Form element to validate\n * @param checker - Sync or async function that returns a string with an error message or undefined if the field is valid.\n*/\nexport function setupValidator<NodeType extends HTMLElement>(node: NodeType, checker: FieldValidator<NodeType>): void {\n  getValidationState(node).validators.push(checker as FieldValidator);\n\n  //if the checker as a name, we'll add it. otherwise we'll ensure that data-wh-form-custom-validator is set so we can scan for it (and it's probably nice to see it in the dom)\n  node.dataset.whFormCustomValidator = ((node.dataset.whFormCustomValidator || \"\") + \" \" + (checker.name || \"?\")).trim();\n}\n","/* eslint-disable @typescript-eslint/no-floating-promises -- FIXME: needs API rework */\n\nimport * as dompack from \"@webhare/dompack\";\nimport FormBase from \"../formbase\";\nimport { debugFlags } from \"@webhare/env\";\nimport { verifyHareScriptAddress, type HareScriptAddressValidationResult, type AddressChecks, type HareScriptAddressValue } from \"@webhare/forms/src/address\";\nimport { setFieldError } from \"../internal/customvalidation\";\nimport { throwError } from \"@webhare/std\";\n\nclass SubField {\n  node;\n  fieldgroup: HTMLElement;\n  pos: number;\n\n  constructor(node: dompack.FormControlElement, pos: number) {\n    this.node = node;\n    this.pos = pos;\n    this.fieldgroup = node.closest(\".wh-form__fieldgroup\") ?? throwError(\"Could not find fieldgroup for field\");\n  }\n}\n\ninterface OrderingData {\n  countries: string[];\n  fieldorder: string[];\n}\n\nexport default class AddressField {\n  numvaliditycalls = 0;\n  node: HTMLElement;\n  formnode: HTMLFormElement;\n  countryNode: HTMLSelectElement;\n  currentcountry: string;\n  fieldName: string;\n  orderingData: OrderingData[];\n  allFields = new Map<string, SubField>;\n  _updatingFields = false;\n\n  constructor(node: HTMLElement) {\n    this.node = node;\n    //We won't FormBase.getForNode yet here so we're not too dependent on registration ordering\n    this.formnode = node.closest(\"form\") ?? throwError(\"Could not find form for addressfield\");\n\n    // AddressField is initialized for the address's country field, so first find the other fields\n    this.countryNode = dompack.qR(this.node, \"select.wh-form__pulldown\"); //TODO why aren't we targetting by ID ? this will work but seems ambiguous\n    if (!this.countryNode)\n      throw new Error(\"Could not find country select node\");\n    if (!this.countryNode.dataset.orderingdata)\n      throw new Error(\"Addressfield not properly configured\");\n\n    this.currentcountry = this.countryNode.value;\n    this.fieldName = this.countryNode.name.substr(0, this.countryNode.name.lastIndexOf(\".\"));\n    this.orderingData = JSON.parse(this.countryNode.dataset.orderingdata) as OrderingData[];\n    const prefixLength = this.fieldName.length + 1; // fieldName + \".\"\n    this.allFields = new Map();\n    let fieldpos = 0;\n    this.allFields.set(this.countryNode.name.substr(prefixLength), new SubField(this.countryNode, ++fieldpos));\n\n    for (const field of dompack.qSA<HTMLInputElement | HTMLTextAreaElement>(this.formnode, `[name^='${this.fieldName}.']`)) {\n      this.allFields.set(field.name.substring(prefixLength), new SubField(field, ++fieldpos));\n\n      field.addEventListener(\"change\", event => this._gotFieldChange(event));\n    }\n\n    if (this.orderingData) {\n      this.countryNode.addEventListener(\"change\", () => this._reconfigureFieldOrdering());\n      this._reconfigureFieldOrdering();\n    }\n  }\n\n  _gotFieldChange(event: Event) {\n    if (this._updatingFields)\n      return; // We're updating our own fields\n\n    if (event.target === this.countryNode && this.currentcountry !== this.countryNode.value) {\n      //country changed. clear errors on all fields before revalidating.. otherwise the errors will just seem to 'linger' for a while after switching\n      this._clearErrors();\n      this.currentcountry = this.countryNode.value;\n    }\n\n    if (this._getFieldValue(\"country\") === \"NL\") {\n      if (!this._getFieldValue(\"zip\") || !this._getFieldValue(\"nr_detail\"))\n        return;\n    }\n    this._checkValidity(event);\n  }\n\n  _getFieldValue(fieldname: string) {\n    const data = this.allFields.get(fieldname);\n    if (data)\n      return data.node.value;\n    return \"\";\n  }\n\n  _getFirstCountrySpecificField() {\n    let firstfield = null;\n    for (const [key, field] of this.allFields.entries())\n      if (key !== \"country\" && !field.fieldgroup.classList.contains(\"wh-form__fieldgroup--hidden\") && (!firstfield || firstfield.pos > field.pos))\n        firstfield = field;\n\n    return firstfield ?? throwError(\"Cannot find field for error\");\n  }\n\n  _reconfigureFieldOrdering() {\n    const country = this.countryNode.value;\n    if (country) {\n      const ordering = this.orderingData.find(e => e.countries.length === 0 || e.countries.includes(country));\n      if (ordering) {\n        let prevgroup;\n        for (let idx = 0; idx < ordering.fieldorder.length; ++idx) {\n          const item = this.allFields.get(ordering.fieldorder[idx]);\n          if (!item)\n            continue; //ordering may appear to fields that have not been rendered, eg 'state'\n\n          item.pos = idx + 1;\n          const fieldgroup = item.fieldgroup;\n          if (prevgroup) {\n            const compareres = prevgroup!.compareDocumentPosition(fieldgroup);\n            if (compareres & Node.DOCUMENT_POSITION_PRECEDING)\n              prevgroup!.parentNode!.insertBefore(fieldgroup, prevgroup!.nextSibling);\n          }\n          prevgroup = fieldgroup;\n        }\n      }\n    }\n\n    //street + city should skip client side validation for NL, we will be looking it up server side (FIXME we should consider overwriting our validation to delay validation until address lookups are complete)\n    for (const fieldname of ['street', 'city']) {\n      const field = this.allFields.get(fieldname);\n      if (field)\n        if (country.toUpperCase() === 'NL')\n          field.node.setAttribute(\"data-wh-form-skipnativevalidation\", \"\");\n        else\n          field.node.removeAttribute(\"data-wh-form-skipnativevalidation\");\n    }\n  }\n\n  _clearErrors() {\n    this.allFields.forEach(field => setFieldError(field.node, \"\", { reportimmediately: true }));\n  }\n\n  _getCurState() {\n    const value: HareScriptAddressValue = { country: \"\" };\n    const visiblefields: HTMLElement[] = [];\n    let anyset = false, allrequiredset = true;\n    this.allFields.forEach((field, key) => {\n      if (!field.fieldgroup.classList.contains(\"wh-form__fieldgroup--hidden\")) {\n        visiblefields.push(field.node.closest(\".wh-form__fieldgroup\")!);\n        value[key as keyof HareScriptAddressValue] = field.node.value;\n\n        if (!anyset && key !== 'country' && field.node.value)\n          anyset = true;\n        if (field.node.required && !field.node.value && !field.node.hasAttribute(\"data-wh-form-skipnativevalidation\"))\n          allrequiredset = false;\n      }\n    });\n\n    return { value, visiblefields, anyset, allrequiredset, lookupkey: JSON.stringify(value) };\n  }\n\n  async _checkValidity(event: Event) {\n    const form = FormBase.getForNode(this.formnode) ?? throwError(\"Parent form for address field not yet initialized\");\n    /* we used to clear fields that are no longer visible after a country change, add visible fields to the value we're checking\n       but not sure why. ignoring those fields should be okay? and this is a very eager trigger, so if we really do this, do\n       this on base of the country actually changing, not an external checkbox controlling visibility of the whole country field\n       and a stray update event\n       */\n    const curstate = this._getCurState();\n    if (!curstate.anyset) { //fields are empty..\n      this._clearErrors();\n      return; //then don't validate\n    }\n    if (!curstate.allrequiredset)\n      return; //no need to validate if we don't even have the required fields in place\n\n    let result: HareScriptAddressValidationResult;\n    const lock = dompack.flagUIBusy();\n    try {\n      curstate.visiblefields.forEach(el => el.classList.add(\"wh-form__fieldgroup--addresslookup\"));\n      ++this.numvaliditycalls;\n      result = await verifyHareScriptAddress(curstate.value as HareScriptAddressValue, {\n        lang: form.getLangCode(),\n        checks: (this.node.dataset.checks?.split(' ') ?? []) as AddressChecks[]\n      });\n    } catch (e) {\n      console.error(`Error while validating value: ${e}`);\n      return;\n    } finally {\n      if (--this.numvaliditycalls === 0) //we're the last call\n        curstate.visiblefields.forEach(el => el.classList.remove(\"wh-form__fieldgroup--addresslookup\"));\n\n      lock.release();\n    }\n    if (this._getCurState().lookupkey !== curstate.lookupkey)\n      return; //abandon this _checkValidity call, the field has already changed.\n\n    if (debugFlags.fhv)\n      console.log(`[fhv] Validation result for address '${this.fieldName}': ${result.status}`);\n\n    if (debugFlags.fdv) {\n      if ([\"different_citystreet\", \"incomplete\"].includes(result.status))\n        console.warn(`[fdv] Address validation was performed, processing incomplete address (status: '${result.status}')`);\n      else {\n        console.warn(`[fdv] Ignoring return status '${result.status}' of address validation`);\n        result.status = \"ok\";\n      }\n    }\n\n    this._clearErrors();\n\n    for (const err of result.errors) {\n      const field = this.allFields.get(err.fields[0]) ?? this._getFirstCountrySpecificField();\n      if (field)\n        form.setFieldError(field.node, err.message, { reportimmediately: true });\n    }\n\n    if (result.corrections) {\n      let anychanges = false;\n      this._updatingFields = true;\n\n      for (const [key, newvalue] of Object.entries(result.corrections)) {\n        const field = this.allFields.get(key);\n        if (field && field.node.value !== newvalue) {\n          dompack.changeValue(field.node, newvalue);\n          anychanges = true;\n        }\n      }\n\n      this._updatingFields = false;\n      if (anychanges)\n        form.refreshConditions();\n    }\n  }\n}\n","import { isValidDate, isValidTime } from '@webhare/std';\n\nexport function formatDate(dateformat: string, year: number, month: number, day: number): string {\n  if (!isValidDate(year, month, day, { minYear: 1 }))\n    return '';\n\n  let output = '';\n\n  for (const c of dateformat.split(\"\")) {\n    switch (c.toUpperCase()) {\n      case \"Y\":\n        output += ('000' + year).slice(-4);\n        break;\n      case \"M\":\n        output += ('0' + month).slice(-2);\n        break;\n      case \"D\":\n        output += ('0' + day).slice(-2);\n        break;\n      default:\n        output += c;\n        break;\n    }\n  }\n  return output;\n}\n\nexport function formatISODate(year: number, month: number, date: number) {\n  return formatDate(\"Y-M-D\", year, month, date);\n}\n\nexport function formatISOTime(hour: number, minute: number, second: number | null, msec: number | null) {\n  if (!isValidTime(hour, minute, second !== null ? second : 0, msec !== null ? msec : 0))\n    return '';\n\n  let time = ('0' + hour).slice(-2) + ':' + ('0' + minute).slice(-2);\n  if (second !== null)\n    time += ':' + ('0' + second).slice(-2);\n  if (msec !== null)\n    time += '.' + ('00' + msec).slice(-3);\n  return time;\n}\n\nexport interface DateParts {\n  day: number;\n  month: number;\n  year: number;\n}\n\nexport function parseDate(format: string, newdate: string, options?: { nofail: boolean }): DateParts | null {\n  if (!newdate) //empty\n    return null;\n\n  //replace . and / with -\n  const setdate = newdate.replace(/[./]/g, '-');\n  const parts = setdate.split('-');\n\n  if (parts.length === 3) { //parseable\n    format = format.toLowerCase();\n    const dayoffset = format.indexOf('d');\n    const monthoffset = format.indexOf('m');\n    const yearoffset = format.indexOf('y');\n\n    const daypos = 0 + (dayoffset > monthoffset ? 1 : 0) + (dayoffset > yearoffset ? 1 : 0);\n    const monthpos = 0 + (monthoffset > dayoffset ? 1 : 0) + (monthoffset > yearoffset ? 1 : 0);\n    const yearpos = 0 + (yearoffset > dayoffset ? 1 : 0) + (yearoffset > monthoffset ? 1 : 0);\n\n    const day = parseInt(parts[daypos], 0);\n    const month = parseInt(parts[monthpos], 0);\n    const year = parseInt(parts[yearpos], 0);\n\n    // The browser will always add 1900 for years 0-99, so handle years < 100\n    // if (year >= 0 && year < 100 && this.options.cutoffyear > 0)\n    // {\n    //   if (year < this.options.cutoffyear)\n    //     year += 2000;\n    //   else\n    //     year += 1900;\n    // }\n    if (isValidDate(year, month, day))\n      return { year, month, day };\n  }\n  if (options && options.nofail)\n    return null;\n\n  throw new Error(`Invalid date value: '${newdate}'`);\n}\n\n//compare two dates. return -1 if lhs<rhs, 0 if lhs==rhs, 1 if lhs>rhs\nexport function compareDate(lhs: DateParts | null, rhs: DateParts | null) {\n  if (!lhs)\n    return rhs ? -1 : 0; //if rhs is set, <null> is before anything. oterhwise equal\n  else if (!rhs)\n    return 1; //lhs must be set, so lhs>rhs\n\n  return lhs.year < rhs.year ? -1\n    : lhs.year > rhs.year ? 1\n      : lhs.month < rhs.month ? -1\n        : lhs.month > rhs.month ? 1\n          : lhs.day < rhs.day ? -1\n            : lhs.day > rhs.day ? 1\n              : 0;\n}\n\nexport function parseISODate(newdate: string, options?: { nofail: boolean }) {\n  return parseDate('y-m-d', newdate, options);\n}\n\nexport function getLocalToday(): DateParts {\n  const today = new Date;\n  return { year: today.getFullYear(), month: 1 + today.getMonth(), day: today.getDate() };\n}\n\nexport function parseISOTime(intime: string, { nofail = false } = {}) {\n  const split = intime.match(/^([0-9]+):([0-9]+)(:([0-9]+))?(\\.([0-9]+))?$/);\n  if (split) {\n    const hour = parseInt(split[1], 10);\n    const minute = parseInt(split[2], 10);\n    const second = parseInt(split[4] || \"0\", 10);\n    const msec = parseInt(split[6] || \"0\", 10);\n    return { hour, minute, second, msec };\n  }\n  if (nofail)\n    return undefined;\n\n  throw new Error(`Invalid time value: '${intime}'`);\n}\n\nexport function getWeekNumber(jsdate: Date) {\n  jsdate = new Date(jsdate); //don't modify the caller's date!\n  jsdate.setHours(0, 0, 0, 0);\n  // Thursday in current week decides the year.\n  jsdate.setDate(jsdate.getDate() + 3 - (jsdate.getDay() + 6) % 7);\n  // January 4 is always in week 1.\n  const week1 = new Date(jsdate.getFullYear(), 0, 4);\n  // Adjust to Thursday in week 1 and count number of weeks from jsdate to week1.\n  return 1 + Math.round(((jsdate.getTime() - week1.getTime()) / 86400000 - 3 + (week1.getDay() + 6) % 7) / 7);\n}\n\nexport function makeJSUTCDate(dateparts: DateParts) {\n  return new Date(Date.UTC(dateparts.year, dateparts.month - 1, dateparts.day));\n}\n\nexport function formatJSUTCISODate(dateobj: Date) {\n  return dateobj.getUTCFullYear() + '-' + ('0' + (dateobj.getUTCMonth() + 1)).slice(-2) + '-' + ('0' + dateobj.getUTCDate()).slice(-2);\n}\n","import * as dompack from 'dompack';\nimport { qSA } from 'dompack';\nimport * as datetime from 'dompack/types/datetime';\nimport AddressField from '@mod-publisher/js/forms/fields/addressfield';\nimport { setupValidator } from './customvalidation';\n\nimport { getTid } from \"@webhare/gettid\";\nimport { formatDate, parseISODate } from './datehelpers';\nimport { isValidDate } from '@webhare/std';\n\nfunction validateCheckboxGroup(groupnode: HTMLElement) {\n  const nodes = dompack.qSA<HTMLInputElement>(groupnode, \"input[type='checkbox']\");\n  const min = Number(groupnode.dataset.whMin) || 0;\n  const max = Number(groupnode.dataset.whMax) || 0;\n\n  const anyenabled = nodes.some(node => !node.disabled);\n  const numChecked = nodes.filter(node => node.checked).length;\n\n  if (anyenabled) {\n    if (numChecked < min)\n      return getTid(\"publisher:site.forms.commonerrors.mincheck\", min);\n    else if (max > 0 && numChecked > max)\n      return getTid(\"publisher:site.forms.commonerrors.maxcheck\", max);\n  }\n}\n\nfunction validateRadioGroup(groupnode: HTMLElement) {\n  const nodes = dompack.qSA<HTMLInputElement>(groupnode, \"input[type='radio']\");\n  const isrequired = nodes.some(node => node.required);\n\n  if (isrequired) {\n    const isanychecked = nodes.some(node => node.checked && !node.disabled);\n    if (!isanychecked)\n      return getTid(\"publisher:site.forms.commonerrors.required\");\n  }\n}\n\nexport function reformatDate(datestr: string): string {\n  const parsed = parseISODate(datestr);\n  return parsed ? formatDate(\"D-M-Y\", parsed.year, parsed.month, parsed.day) : \"\";\n}\n\nfunction validateDate(date: HTMLInputElement) {\n  if (date.getAttribute('type') !== 'date') //it's no longer a date field\n    return '';\n  if (!date.value) //any required checks should be handled by the HTML5 compat layer, nothing for us to check\n    return '';\n\n  const dateparts = date.value.match(/^([0-9]+)-([0-9]+)-([0-9]+)$/) || [];\n  const year = parseInt(dateparts[1]), month = parseInt(dateparts[2]), day = parseInt(dateparts[3]);\n  if (!isValidDate(year, month, day))\n    return getTid(\"publisher:site.forms.commonerrors.default\");\n\n  const normalizeddate = ('0000' + year).substr(-4) + '-' + ('00' + month).substr(-2) + '-' + ('00' + day).substr(-2);\n  const min = date.getAttribute(\"min\"), max = date.getAttribute(\"max\");\n  if (min && normalizeddate < min)\n    return getTid(\"publisher:site.forms.commonerrors.min\", reformatDate(min));\n  if (max && normalizeddate > max)\n    return getTid(\"publisher:site.forms.commonerrors.max\", reformatDate(max));\n\n  return '';\n}\n\nfunction validateTime(time: HTMLInputElement) {\n  if (time.getAttribute('type') !== 'time') //it's no longer a time field\n    return '';\n  if (!time.value) //any required checks should be handled by the HTML5 compat layer, nothing for us to check\n    return '';\n\n  const timeparts = time.value.match(/^([0-9]+):([0-9]+)(:([0-9]+))?$/) || [];\n  const hours = parseInt(timeparts[1]), minutes = parseInt(timeparts[2]), seconds = parseInt(timeparts[3]);\n  if (isNaN(hours) || isNaN(minutes) || hours < 0 || hours > 23 || minutes < 0 || minutes > 59 || (!isNaN(seconds) && (seconds < 0 || seconds > 59)))\n    return getTid(\"publisher:site.forms.commonerrors.default\");\n\n  return '';\n}\n\nexport function setup(form: HTMLElement) {\n  for (const datecontrol of qSA<HTMLInputElement>(form, 'input[type=date]')) {\n    for (const field of ['whMin', 'whMax', 'whValue'])\n      if (datecontrol.dataset[field]) {\n        //parse 'now' or 'now+5d'. be able to extract '+5d'\n        const datematch = datecontrol.dataset[field]!.match(/^now((\\+|-)\\d+d)?$/);\n\n        if (datematch) {\n          const propname = field.substr(2).toLowerCase();\n          let thedate;\n          if (datematch[1])\n            thedate = new Date(Date.now() + parseInt(datematch[1]) * 86400 * 1000);\n          else\n            thedate = new Date;\n\n          (datecontrol as unknown as Record<string, string>)[propname] = datetime.getISOLocalDate(thedate);\n        }\n      }\n\n    if (datecontrol.type !== 'date' && !datecontrol.whValidationPolyfilled) { //this browser doesn't natively support date fields\n      datecontrol.whValidationPolyfilled = true;\n      //ADDME some sort of global validator would be better so we don't get confused by fields that change their type\n      setupValidator(datecontrol, validateDate);\n    }\n  }\n\n  for (const timecontrol of qSA<HTMLInputElement>(form, 'input[type=time][data-wh-value]')) {\n    //parse 'now'\n    //ADDME: Support for stuff like 'now + 15 minutes' 'next whole hour + 2.5 hours'?\n    const timematch = timecontrol.dataset.whValue!.match(/^now$/);\n\n    if (timematch) {\n      const thedate = new Date;\n\n      let propvalue = ('0' + thedate.getHours()).substr(-2) + '-' + ('0' + thedate.getMinutes()).substr(-2);\n      if (parseInt(timecontrol.getAttribute(\"step\") || '0') % 60) //step not multiple of 60? seconds\n        propvalue += '-' + ('0' + thedate.getSeconds()).substr(-2);\n      timecontrol.value = propvalue;\n    }\n\n    if (timecontrol.type !== 'time' && !timecontrol.whValidationPolyfilled) { //this browser doesn't natively support time fields\n      timecontrol.whValidationPolyfilled = true;\n      //ADDME some sort of global validator would be better so we don't get confused by fields that change their type\n      setupValidator(timecontrol, validateTime);\n    }\n  }\n\n  // Setup checkbox group (min/max checked) validation\n  for (const checkboxgroup of qSA(form, \".wh-form__fieldgroup--checkboxgroup\"))\n    setupValidator(checkboxgroup, validateCheckboxGroup);\n\n  // Setup radio group (hidden/disabled) validation\n  for (const radiogroup of qSA(form, \".wh-form__fieldgroup--radiogroup\")) {\n    setupValidator(radiogroup, validateRadioGroup);\n\n    //we should probably disable by name (or form.elements[name] but validate() and form isn't really tracking name either...\n    dompack.qSA<HTMLInputElement>(radiogroup, `input[type='radio']`).forEach(\n      node => node.dataset.whFormSkipnativevalidation = \"true\"); //don't handle by both RadioGroupField *and* native validation\n\n  }\n\n  // Setup address field validation\n  for (const addresscontrol of qSA(form, \".wh-form__fieldgroup--addressfield\"))\n    new AddressField(addresscontrol);\n}\n","@import \"../../../../../jssdk/forms/styling/functional.css\";\n","export const rfSymbol = Symbol('RegisteredField');\n\ndeclare global {\n  interface HTMLElement {\n    [rfSymbol]?: FormFieldAPI;\n  }\n}\n\nexport interface FormFieldAPI {\n  getValue(): unknown;\n  setValue(newvalue: unknown): void;\n}\n",".wh-form__arrayinput\n{\n  height: 1px;\n  opacity: 0;\n  overflow: hidden;\n  pointer-events: none;\n  position: absolute;\n  width: 100%;\n}\n","/* eslint-disable @typescript-eslint/no-floating-promises -- FIXME: needs API rework */\n\nimport { getTid } from \"@webhare/gettid\";\nimport \"./arrayfield.css\";\nimport { throwError } from \"@webhare/std\";\nimport { addDocEventListener, qS, qSA, type DocEvent, registerMissed, stop } from \"@webhare/dompack\";\nimport { getFieldName, getFormElementCandidates, getFormHandler, parseCondition, setFieldName } from \"@webhare/forms/src/domsupport\";\nimport type { FormCondition } from \"@webhare/forms/src/types\";\nimport { RecordFieldHandler, type FormParent } from \"@webhare/forms/src/fieldmap\";\nimport type FormBase from \"../formbase\";\nimport { setup } from \"../internal/webharefields\";\n\n\nfunction fixupConditionRecursive(node: HTMLElement, condition: FormCondition, mapping: Map<string, string>): boolean {\n  switch (condition.matchtype) {\n    case \"AND\":\n    case \"OR\":\n      {\n        let anychanges = false;\n        for (const subcondition of condition.conditions)\n          anychanges = fixupConditionRecursive(node, subcondition, mapping) || anychanges;\n        return anychanges;\n      }\n    case \"NOT\":\n      {\n        return fixupConditionRecursive(node, condition.condition, mapping);\n      }\n    default:\n      {\n        const newName = mapping.get(condition.field);\n        if (newName && node.querySelector(`[name=\"${newName}\"]`)) {\n          condition.field = newName;\n          return true;\n        }\n      }\n  }\n  return false;\n}\n\ntype NewType = FormParent;\n\nexport default class ArrayField {\n  valueNode: HTMLInputElement;\n  nextrowid = 0;\n  template;\n  insertPoint: HTMLElement;\n  arrayBaseName;\n  handler: NewType;\n  node: HTMLElement;\n  name: string;\n\n  constructor(handler: NewType, node: HTMLElement, items: HTMLElement[], name: string) {\n    this.handler = handler;\n    this.node = node;\n    this.name = name;\n    this.arrayBaseName = node.dataset.whFormGroupFor || throwError(\"Missing array base name\");\n\n    // The template for new rows. If we have arrays-in-array, it will still be the first <template>\n    this.template = qS<HTMLTemplateElement>(node, \"template\") || throwError(\"Missing array template\");\n    // The node before which to add new rows\n    this.insertPoint = this.template.parentNode!.lastElementChild! as HTMLElement;\n    if (!this.insertPoint.matches(\".wh-form__arrayadd\"))\n      throw new Error(\"Missing array insert point\");\n\n    // Event handler for add/delete button clicks\n    this.insertPoint.addEventListener(\"click\", event => this.onAddRow(event));\n    addDocEventListener(node, \"click\", event => this._onClick(event));\n\n    // Proxy node for getting/setting properties and receiving events\n    this.valueNode = qS<HTMLInputElement>(node, \"input.wh-form__arrayinput\") ?? throwError(\"Missing array input\");\n    this.valueNode.whUseFormGetValue = true;\n    this.valueNode.addEventListener(\"wh:form-getvalue\", event => this._onGetValue(event));\n    //@ts-expect-error wh:form-setvalue isn't defined - but it'll go away anyway\n    this.valueNode.addEventListener(\"wh:form-setvalue\", event => this._onSetValue(event));\n\n    // Initialize initial value rows\n    for (const rownode of qSA(this.node, \".wh-form__arrayrow\"))\n      this._fixupRowNode(rownode);\n\n    this._checkValidity();\n  }\n\n  get form(): FormBase {\n    const form = getFormHandler(this.node.closest(\"form\") ?? throwError(\"Could not find <form>\")) ?? throwError(\"Could not find form for arrayfield\");\n    if (!form._getFieldsToValidate) //avoid calling into formbase from our constructor, it may not be there yet...\n      throw new Error(\"The <form> is not ready yet\");\n    return form;\n  }\n\n  addRow(): HTMLElement {\n    // Instatiate a new row\n    const newrow = this.template.content.cloneNode(true) as HTMLElement;\n    (newrow.firstElementChild! as HTMLElement).dataset.whFormRowid = String(this.nextrowid++);\n\n    // Insert the new row\n    this.insertPoint.parentNode!.insertBefore(newrow, this.insertPoint);\n    const addedrow = this.insertPoint.previousElementSibling! as HTMLElement;\n\n    /* If the form is relying on legacy dompack.register to go through ImgEditField and do the actual\n       customElements.define call.... then the 'name' attributes won't actually work on the 'new' elements.\n       therefore dompack.registerMissed must run before _fixupRowNode */\n    registerMissed(addedrow);\n    setup(addedrow);\n\n    this._fixupRowNode(addedrow as HTMLElement);\n    this._checkValidity();\n    this.form.__scheduleUpdateConditions();\n    return this.insertPoint.previousSibling as HTMLElement;\n  }\n\n  /* seems a unused API ?.  .. if we need to provide this, just let people pass us a row node instead of understanding IDs\n    removeRow(id)\n    {\n      // Remove a row by id\n      let node = this.node.querySelector(`.wh-form__arrayrow[data-row-id=${id}]`);\n      if (node)\n        this._removeRowNode(node);\n    }\n  */\n\n  private onAddRow(event: Event) {\n    stop(event);\n    this.addRow();\n  }\n  _onClick(event: DocEvent<MouseEvent>) {\n    // Check if a delete button was clicked\n    const delNode = event.target.closest(\".wh-form__arraydelete\");\n    if (delNode) {\n      event.preventDefault();\n      this._removeRowNode(delNode.closest(\".wh-form__arrayrow\")!);\n    }\n  }\n\n  getRowHandler(row: HTMLElement): RecordFieldHandler {\n    const rowBaseName = this.valueNode.name + \".\" + row.dataset.whFormRowid;\n    const rowFields = getFormElementCandidates(row, rowBaseName).filter(_ => _.dataset.whFormCellname !== \"row_uid\"); //row_uid points back to us, so requesting that triggers a loop\n    return new RecordFieldHandler(this.handler, rowBaseName, rowFields);\n  }\n\n  getValue() {\n    const rows = [];\n    for (const row of qSA(this.node, \".wh-form__arrayrow\").filter(n => n.parentNode === this.template.parentNode)) {\n      const handler = this.getRowHandler(row);\n      const rowval = handler.getValue();\n      rows.push(rowval);\n    }\n    return rows;\n  }\n\n  _onGetValue(event: CustomEvent<{ deferred: PromiseWithResolvers<unknown> }>) {\n    // We're using the deferred promise to return our value\n    event.preventDefault();\n    event.stopPropagation();\n\n    // Create a promise for each row that resolves with the combined value of all fields in the row\n    const valuePromises = [];\n    for (const row of qSA(this.node, \".wh-form__arrayrow\").filter(n => n.parentNode === this.template.parentNode)) {\n      const rowFields = this._queryAllFields(row);\n      // Create a promise for each of the row's subfields to get its value\n      const rowPromises = rowFields.map(field => (this.form as FormBase)._getQueryiedFieldValue(field)); //FIXME get rid of 'as FormBase' to support array-in-array\n      // Add an all promise for the value promises and add it to the list of row promises\n      valuePromises.push(Promise.all(rowPromises).then(values => {\n        // Combine the values into a value object for this row\n        const rowValue: Record<string, unknown> = { formrowid: row.dataset.whFormRowid };\n        values.forEach((value, idx) => {\n          // The values are returned in the order that the promises were added to the list of value promises, so we can use\n          // the index of the value to get the original field\n          const rowField = rowFields[idx];\n          const firstnode = rowField.multi ? rowField.nodes[0] : rowField.node;\n          rowValue[firstnode.dataset.whFormCellname!] = value;\n        });\n        return rowValue;\n      }));\n    }\n    // Wait for all the row promises (which resolves with a list of promise resolution values, which will be the final value\n    // of the array field)\n    Promise.all(valuePromises).then(valueRows => event.detail.deferred.resolve(valueRows));\n  }\n\n  setValue(newvalue: unknown[]) {\n    if (!Array.isArray(newvalue))\n      throw new Error(`Invalid value for array field '${this.name}': ${JSON.stringify(newvalue)}`);\n\n    // Remove all current rows (TODO optimize)\n    while (this.insertPoint.previousElementSibling?.classList.contains(\"wh-form__arrayrow\"))\n      this._removeRowNode(this.insertPoint.previousElementSibling);\n\n    // Check if we have an array value\n    for (const value of newvalue) {\n      // Add a row\n      const row = this.addRow();\n      const handler = this.getRowHandler(row);\n      handler.setValue(value);\n    }\n    this._checkValidity();\n  }\n\n  _onSetValue(event: CustomEvent<{ value: unknown }>) {\n    event.preventDefault();\n    event.stopPropagation();\n\n    // Remove all current rows\n    while (this.insertPoint.previousElementSibling?.classList.contains(\"wh-form__arrayrow\"))\n      this._removeRowNode(this.insertPoint.previousElementSibling);\n\n    // Check if we have an array value\n    if (Array.isArray(event.detail.value)) {\n      for (const value of event.detail.value) {\n        // Add a row\n        const row = this.addRow();\n        // Initialize the row's fields\n        for (const field of this._queryAllFields(row)) {\n          for (const fieldnode of (field.multi ? field.nodes : [field.node])) {\n            if (fieldnode.dataset.whFormCellname && fieldnode.dataset.whFormCellname in value) {\n              (this.form as FormBase).setFieldValue(fieldnode, value[fieldnode.dataset.whFormCellname]); //FIXME get rid of 'as FormBase' to support array-in-array\n            }\n          }\n        }\n      }\n    }\n    this._checkValidity();\n  }\n\n  _fixupRowNode(node: HTMLElement) {\n    const rowid = node.dataset.whFormRowid;\n\n    // Rename all fields to avoid duplicate field names\n    const mapping = new Map<string, string>;\n    for (const fieldnode of getFormElementCandidates(node, this.arrayBaseName)) {\n\n      // Leave embedded arrayfields alone! Except if this is specifically the wh-form__arrayinput one level down\n      const nodeArray = fieldnode.closest(\".wh-form__fieldgroup--array\");\n      if (nodeArray && nodeArray !== this.node && !(fieldnode.matches(\".wh-form__arrayinput\") && (nodeArray.parentNode! as HTMLElement).closest(\".wh-form__fieldgroup--array\") === this.node)) {\n        // console.log(\"Skipping\", fieldnode, \"as it's not in our array\");\n        continue;\n      }\n\n      // Rename fields\n      const fieldname = getFieldName(fieldnode);\n      // When rendering, the fields simply have their arrayname prefixed in their name=, see InstantiateField in array.whlib (TODO seems dangerous, eg preset radio buttons interfering with each other?\n      // So we'll just take the part after the first dot as the cellname\n      fieldnode.dataset.whFormCellname ||= fieldname.substring(this.arrayBaseName.length + 1);\n\n      const cellname: string = fieldnode.dataset.whFormCellname;\n      const subname = this.valueNode.name + \".\" + rowid + \".\" + cellname;\n      // console.log(\"for\", this.name, \"rename\", fieldname, \"to\", subname, fieldnode);\n      setFieldName(fieldnode, subname);\n      mapping.set(fieldname, subname);\n\n      // Rename id's to make them unique; update the labels within the field's fieldgroup to point to the new id\n      if (fieldnode.id) {\n        const labelnodes = qSA<HTMLLabelElement>(node, `label[for=\"${fieldnode.id}\"]`);\n        fieldnode.id += \"-\" + rowid;\n        for (const labelnode of labelnodes)\n          labelnode.htmlFor = fieldnode.id;\n      }\n\n      // Rewrite conditions after all fields have been renamed\n      for (const type of [\"visible\", \"enabled\", \"required\"]) {\n        for (const conditionnode of qSA(node, `[data-wh-form-${type}-if]`)) {\n          const condition = parseCondition(conditionnode.dataset[`whForm${type[0].toUpperCase() + type.slice(1)}If`]!);\n          if (fixupConditionRecursive(node, condition, mapping))\n            conditionnode.dataset[`whForm${type[0].toUpperCase() + type.slice(1)}If`] = JSON.stringify({ c: condition });\n        }\n      }\n    }\n\n    this.getRowHandler(node); //initializes deeper arrays. fieldmap should probably be handling this and build a full mapping top to botom...\n  }\n\n  _removeRowNode(node: Element) {\n    // Remove the row node\n    node.remove();\n    this._checkValidity();\n  }\n\n  _checkValidity() {\n    const minRows = parseInt(this.valueNode.dataset.whMin || \"0\");\n    const maxRows = parseInt(this.valueNode.dataset.whMax || \"0\");\n\n    const numRows = this.node.querySelectorAll(\".wh-form__arrayrow\").length;\n    if (numRows < minRows)\n      this.valueNode.setCustomValidity(getTid(\"publisher:site.forms.commonerrors.minarray\", minRows));\n    else if (maxRows > 0 && numRows > maxRows)\n      this.valueNode.setCustomValidity(getTid(\"publisher:site.forms.commonerrors.maxarray\", maxRows));\n    else\n      this.valueNode.setCustomValidity(\"\");\n\n    // Disable the add button if the maximum number of rows is reached\n    if (maxRows > 0 && numRows >= maxRows)\n      this.node.classList.add(\"wh-form__array--maxrows\");\n    else\n      this.node.classList.remove(\"wh-form__array--maxrows\");\n  }\n\n  _queryAllFields(node: HTMLElement) {\n    return (this.form as FormBase)._queryAllFields({ startnode: node, skipfield: this.valueNode });  //FIXME get rid of 'as FormBase' to support array-in-array\n  }\n}\n","import { getFieldName } from \"./domsupport\";\nimport { rfSymbol, type FormFieldAPI } from \"./registeredfield\";\nimport ArrayField from \"@mod-publisher/js/forms/fields/arrayfield\";\nimport type { AddressValue } from \"@webhare/address\";\nimport { omit, nameToSnakeCase, nameToCamelCase, throwError, isDate } from \"@webhare/std\";\nimport type { RecursivePartial } from \"@webhare/js-api-tools\";\nimport type { FormFieldLike } from \"./jsformelement\";\n\nexport interface FormParent {\n  __scheduleUpdateConditions(): void;\n}\n\n\ninterface FormField {\n  getValue(): unknown;\n\n  /** Set a value\n   * @param newvalue - The new value to set\n   * @param ignoreInvalid - Do not throw if the value is invalid. Used for eg. prefills which can't usefully handle it anyway\n   * @returns True if succesfully set */\n\n  setValue(newvalue: unknown): void;\n}\n\ntype ValueType = \"number\" | \"boolean\" | \"date\";\n\nfunction unmapFieldName(camelCaseName: string) {\n  return camelCaseName.startsWith(\"__formfield\") ? camelCaseName : nameToSnakeCase(camelCaseName);\n\n}\nfunction mapFieldName(htmlName: string) {\n  return htmlName.startsWith(\"__formfield\") ? htmlName : nameToCamelCase(htmlName);\n}\n\nfunction mapValue(type: ValueType, invalue: string) {\n  switch (type) {\n    case \"number\":\n      return parseFloat(invalue);\n    case \"boolean\":\n      return invalue === \"true\";\n    case \"date\":\n      return new Date(invalue);\n  }\n}\n\nfunction unmapValue(type: ValueType | undefined, invalue: unknown, fieldDescr: string) {\n  switch (type) {\n    case null:\n      if (typeof invalue !== \"string\")\n        throw new Error(`Invalid type ${typeof invalue} for string field ${fieldDescr}: ${invalue}`);\n      return invalue;\n\n    case \"number\":\n      if (typeof invalue !== \"number\")\n        throw new Error(`Invalid type ${typeof invalue} for number field ${fieldDescr}: ${invalue}`);\n      return String(invalue);\n\n    case \"boolean\":\n      if (typeof invalue !== \"boolean\")\n        throw new Error(`Invalid type ${typeof invalue} for boolean field ${fieldDescr}: ${invalue}`);\n      return String(invalue);\n\n    case \"date\":\n      if (!isDate(invalue))\n        throw new Error(`Invalid type ${typeof invalue} for date field ${fieldDescr}: ${invalue}`);\n      return invalue.toISOString();\n  }\n}\n\nclass HTMLFormFieldHandler implements FormField {\n  valuetype?: ValueType;\n  private form: FormParent;\n  private readonly field: FormFieldLike;\n\n  constructor(form: FormParent, field: FormFieldLike) {\n    this.form = form;\n    this.field = field;\n    this.valuetype = field.dataset.whFormValueType as undefined | ValueType;\n    if (!this.valuetype && field.matches('input[type=number]'))\n      this.valuetype = \"number\";\n  }\n\n  getValue(): unknown {\n    if (this.field.matches('input[type=checkbox]'))\n      return (this.field as HTMLInputElement).checked;\n    if (this.field.matches('input[type=date]'))\n      return (this.field as HTMLInputElement).valueAsDate;\n\n    if (this.field.tagName === \"SELECT\") {\n      const selectedrow = (this.field as HTMLSelectElement).selectedOptions[0];\n      if (!selectedrow || selectedrow.dataset.placeholder !== undefined)\n        return null; //didn't select a 'real' option\n\n      return this.valuetype ? mapValue(this.valuetype, selectedrow.value) : selectedrow.value;\n    }\n\n    return this.valuetype ? mapValue(this.valuetype, this.field.value as string) : this.field.value;\n  }\n\n  setValue(newvalue: unknown): void {\n    if (this.field.matches('input[type=checkbox]')) {\n      //For convenience we're interpreting setting a checkbox as 'truthy' instead of explicit true/false\n      const setvalue = Boolean(newvalue);\n      if (setvalue === (this.field as HTMLInputElement).checked)\n        return;\n\n      (this.field as HTMLInputElement).checked = setvalue;\n    } else if (this.field.matches('input[type=date]')) {\n      if ((this.field as HTMLInputElement)?.valueAsDate?.getTime() === (newvalue as Date | null)?.getTime())\n        return;\n      (this.field as HTMLInputElement).valueAsDate = newvalue as Date;\n    } else if (this.field.tagName === \"SELECT\" && newvalue === null) { //'null' resets the select to 'no value', so figure out if there's a placeholder row\n      const setvalue = (this.field as HTMLSelectElement).options[0]?.dataset.placeholder !== undefined ? 0 : -1;\n      if ((this.field as HTMLSelectElement).selectedIndex === setvalue)\n        return;\n      (this.field as HTMLSelectElement).selectedIndex = setvalue;\n    } else {\n      const setvalue = this.valuetype ? unmapValue(this.valuetype, newvalue, this.field.name) : newvalue;\n      if (this.field.value === setvalue)\n        return;\n      this.field.value = setvalue;\n    }\n    this.form.__scheduleUpdateConditions();\n  }\n}\n\nclass RadioFormFieldHandler implements FormField {\n  valuetype?: ValueType;\n  private form: FormParent;\n  private readonly name: string;\n  private readonly rnodes: HTMLInputElement[];\n\n  constructor(form: FormParent, name: string, rnodes: HTMLInputElement[]) {\n    this.form = form;\n    this.name = name;\n    this.rnodes = rnodes;\n    const group = rnodes[0].closest<HTMLElement>(\".wh-form__fieldgroup\");\n    if (!group) { //value metadata is stored at the fieldgroup level, so reject these\n      console.error(\"Missing group for radiofield \", group);\n      console.error('if a radio field does not want to participate in the form, it should set attribute form=\"\"');\n    } else {\n      this.valuetype = group.dataset.whFormValueType as undefined | ValueType;\n    }\n  }\n  getValue(): unknown {\n    const node = this.rnodes.find(_ => _.checked);\n    return (node ? this.valuetype ? mapValue(this.valuetype, node.value) : node.value : null);\n  }\n  setValue(newvalue: unknown): void {\n    if (newvalue === null) {\n      for (const node of this.rnodes)\n        node.checked = false;\n\n      this.form.__scheduleUpdateConditions();\n      return;\n    }\n\n    const myname = `radio group ${this.name}`;\n    const setvalue = unmapValue(this.valuetype, newvalue, myname);\n\n    const node = this.rnodes.find(_ => _.value === setvalue);\n    if (!node)\n      throw new Error(`No such value '${setvalue}' in radio group '${this.name}`);\n\n    node.checked = true;\n    this.form.__scheduleUpdateConditions();\n  }\n}\n\nclass CheckboxGroupHandler implements FormField {\n  valuetype?: ValueType;\n  private form: FormParent;\n  private readonly name: string;\n  private readonly cboxes: HTMLInputElement[];\n\n  constructor(form: FormParent, name: string, cboxes: HTMLInputElement[]) {\n    this.form = form;\n    this.name = name;\n    this.cboxes = cboxes;\n    this.valuetype = (cboxes[0].closest<HTMLElement>(\".wh-form__fieldgroup\") ?? throwError(\"RadioFormFieldHandler: Missing group\")).dataset.whFormValueType as undefined | ValueType;\n  }\n  getValue(): unknown {\n    return this.cboxes.filter(_ => _.checked).map(_ => this.valuetype ? mapValue(this.valuetype, _.value) : _.value);\n  }\n  setValue(newvalue: unknown): void {\n    const myname = `checkbox group '${this.name}'`;\n    if (!Array.isArray(newvalue))\n      throw new Error(`Value for ${myname} should be an array, got '${JSON.stringify(newvalue)}'`);\n\n    const toset = newvalue.map(_ => unmapValue(this.valuetype, _, myname));\n\n    this.cboxes.forEach(_ => _.checked = toset.includes(_.value));\n    this.form.__scheduleUpdateConditions();\n\n    //in case the error is caught and ignored (eg prefill), we'll update what we can\n    const missing = toset.filter(_ => !this.cboxes.some(cbox => cbox.value === _));\n    if (missing.length)\n      throw new Error(`Invalid value(s) for ${myname}: ${missing.join(', ')}`);\n  }\n}\n\nclass RegisteredFieldHandler implements FormField {\n  protected form: FormParent;\n  private readonly field: FormFieldAPI;\n\n  constructor(form: FormParent, field: FormFieldAPI) {\n    this.form = form;\n    this.field = field;\n  }\n\n  getValue(): unknown {\n    return this.field.getValue();\n  }\n  setValue(newvalue: unknown): void {\n    this.field.setValue(newvalue);\n  }\n}\n\nexport class ArrayFieldHandler extends RegisteredFieldHandler implements FormField {\n  private node: HTMLElement;\n\n  constructor(form: FormParent, node: HTMLElement, items: HTMLElement[]) {\n    node[rfSymbol] ||= new ArrayField(form, node, items, getFieldName(items[0]));\n    super(form, node[rfSymbol]);\n    this.node = node;\n  }\n\n  __scheduleUpdateConditions() {\n    this.form.__scheduleUpdateConditions();\n  }\n}\n\n/** The FormFieldMap exposes a multi-level (ie unflattened) view of the form values. Internally it works with the\n   original names because generated fields names, eg __formfieldbbbwVsWih_0DrJOc0beS7Q_, cannot be assumed to be snake_case and convertable */\nexport abstract class FormFieldMap<DataShape> {\n  /** Field mapping. Uses original names */\n  protected fieldmap = new Map<string, FormField>();\n  protected fieldName: string;\n\n  constructor(fieldName: string, nodes: HTMLElement[]) {\n    this.fieldName = fieldName;\n    const subpos = fieldName ? fieldName.length + 1 : 0;\n    const groups = Map.groupBy(nodes, _ => getFieldName(_).substring(subpos).split('.')[0]);\n\n    for (const [name, items] of groups) {\n      const fullName = (fieldName ? fieldName + '.' : '') + name;\n      if (!name) {\n        console.error(`There are fields without a name:`, items);\n        continue;\n      }\n\n      if (items[0].matches('input[type=radio]')) {\n        this.fieldmap.set(name, new RadioFormFieldHandler(this, fullName, items as HTMLInputElement[]));\n        continue;\n      }\n\n      if (items[0].matches('.wh-form__arrayinput')) {\n        const arraygroup = items[0].closest<HTMLElement>('.wh-form__fieldgroup--array');\n        if (arraygroup) {\n          this.fieldmap.set(name, new ArrayFieldHandler(this, arraygroup, items));\n          continue;\n        }\n      }\n\n      const hasGroupLeader = getFieldName(items[0]) === fullName; //ie name has no followup '.xx'\n      if (hasGroupLeader) { //if no subname, it's the group leader ?\n        if (items[0].matches('input[type=checkbox]')) {//is it a checkbox group?\n          const cboxgroup = items[0].closest(\".wh-form__fieldgroup--checkboxgroup\");\n          if (cboxgroup) {\n            this.fieldmap.set(name, new CheckboxGroupHandler(this, fullName, items as HTMLInputElement[]));\n            continue;\n          }\n        }\n\n        this.fieldmap.set(name, new HTMLFormFieldHandler(this, items[0] as FormFieldLike));\n        continue;\n      }\n\n      //We're an implicit record (even if with just one member)\n      if (items[0].matches('select[name$=\".country\"][data-orderingdata]')) //looks like address.whlib\n        this.fieldmap.set(name, new AddressFieldHandler(this, fullName, items));\n      else\n        this.fieldmap.set(name, new RecordFieldHandler(this, fullName, items));\n    }\n  }\n\n  abstract __scheduleUpdateConditions(): void;\n\n  /** Get a field handler by name */\n  getField(name: string, options: { allowMissing: true }): FormField | null;\n  getField(name: string, options?: { allowMissing?: boolean }): FormField;\n\n  getField(name: string, options?: { allowMissing?: boolean }): FormField | null {\n    const mapName = unmapFieldName(name);\n    const match = this.fieldmap.get(mapName);\n    if (match)\n      return match;\n    if (options?.allowMissing)\n      return null;\n\n    throw new Error(`Field '${name}' not found in this form`); //TODO report the fukll anme\n  }\n\n  getFieldNames(): string[] {\n    return [...this.fieldmap.keys()].map(mapFieldName);\n  }\n\n  /** Set a value for multiple fields\n   * @param data - The data to set\n   * @param ignoreUnknownFields - Do not throw if a field is not found in the form. This is the default\n   */\n  assign(data: RecursivePartial<DataShape>, { ignoreUnknownFields = true } = {}) {\n    for (const [key, value] of Object.entries(data as object)) {\n      const field = this.getField(key, { allowMissing: ignoreUnknownFields });\n      if (field)\n        field.setValue(value);\n    }\n  }\n}\n\nexport class RecordFieldHandler extends FormFieldMap<object> implements FormField {\n  private form: FormParent;\n\n  constructor(form: FormParent, baseName: string, nodes: HTMLElement[]) {\n    super(baseName, nodes);\n    this.form = form;\n  }\n\n  getValue(): unknown {\n    const retval: Record<string, unknown> = {};\n    for (const [name, field] of this.fieldmap) {\n      const val = field.getValue();\n      if (val !== undefined) //Suppress undefined values (where we cannot safely re-set them, eg images in Object.keys\n        retval[mapFieldName(name)] = val;\n    }\n\n    return retval;\n  }\n\n  setValue(newvalue: unknown): void {\n    if (typeof newvalue !== 'object' || newvalue === null)\n      throw new Error(`Invalid value for record field '${this.fieldName}': ${newvalue}`);\n\n    for (const [name, field] of this.fieldmap) {\n      const prettyName = mapFieldName(name);\n      if (prettyName in newvalue)\n        field.setValue((newvalue as Record<string, unknown>)[prettyName]);\n    }\n  }\n\n  __scheduleUpdateConditions() {\n    this.form.__scheduleUpdateConditions();\n  }\n}\n\n/* TODO cleanup... this is a workaround to translate nr_detail to houseNumber. ideally the server would just send house_number as field\n        name but that transition will take time. also we need a nice way to 'take over' addressifelds rather than fieldmapper special casing\n        its detection\n*/\ntype OldAddressValue = Omit<AddressValue, \"houseNumber\"> & { nrDetail?: string };\n\nclass AddressFieldHandler extends RecordFieldHandler {\n  constructor(form: FormParent, baseName: string, nodes: HTMLElement[]) {\n    super(form, baseName, nodes);\n  }\n\n  getValue(): unknown {\n    const val = super.getValue() as OldAddressValue;\n    if (!val?.country)\n      return null;\n\n    return val?.nrDetail !== undefined ? { ...omit(val, [\"nrDetail\"]), houseNumber: val.nrDetail } : val;\n  }\n\n  setValue(val: unknown) {\n    if (val === null) {\n      super.setValue({ country: null, city: \"\", street: \"\", zip: \"\", nrDetail: \"\", state: \"\" });\n      return;\n    }\n\n    ///@ts-expect-error ugly hack, not really worth overwriting with as\n    super.setValue(val?.houseNumber !== undefined ? { ...omit(val, [\"houseNumber\"]), nrDetail: val.houseNumber } : val);\n  }\n}\n\nexport class FieldMapDataProxy implements ProxyHandler<object> {\n  private readonly form: FormFieldMap<object>;\n\n  constructor(form: FormFieldMap<object>) {\n    this.form = form;\n  }\n  get(target: object, p: string | symbol) {\n    //Don't attempt to validate getters... it will break various introspection calls (eg requesting constructor, checking for 'then'...)\n    const field = typeof p === \"string\" ? this.form.getField(p, { allowMissing: true }) : null;\n    return field ? field.getValue() : (target as Record<string | symbol, unknown>)[p];\n  }\n  set(target: unknown, p: string, value: unknown): boolean {\n    this.form.getField(p).setValue(value);\n    return true;\n  }\n  ownKeys(target: object): ArrayLike<string | symbol> {\n    return this.form.getFieldNames();\n  }\n  getOwnPropertyDescriptor(target: unknown, prop: string) { // allows ownKeys to actually return to Object.keys\n    return { enumerable: true, configurable: true };\n  }\n}\n","/* eslint-disable @typescript-eslint/no-floating-promises -- FIXME: needs API rework */\n\nimport * as dompack from '@webhare/dompack';\nimport { type DocEvent, type FormControlElement, type TakeFocusEvent, addDocEventListener, isFormControl } from '@webhare/dompack';\nimport * as domfocus from 'dompack/browserfix/focus';\nimport * as webharefields from './internal/webharefields';\nimport * as merge from './internal/merge';\nimport './internal/requiredstyles.css';\nimport { type SetFieldErrorData, getValidationState, setFieldError, setupValidator, updateFieldError } from './internal/customvalidation';\nimport { generateRandomId, isPromise, wrapSerialized } from '@webhare/std';\nimport { debugFlags, dtapStage, navigateTo, type NavigateInstruction } from '@webhare/env';\nimport { getFieldDisplayName, isFieldNativeErrored, isRadioOrCheckbox, isRadioNodeList, type ConstrainedRadioNodeList, parseCondition, getFormElementCandidates, isFormFieldLike, queryFormFieldLike, getFieldName } from '@webhare/forms/src/domsupport';\nimport { rfSymbol } from '@webhare/forms/src/registeredfield';\nimport type { FormAnalyticsEventData, FormAnalyticsSubEvents, FormCondition, FormFileValue, RPCFormMessage } from '@webhare/forms/src/types';\nimport { FieldMapDataProxy, FormFieldMap } from '@webhare/forms/src/fieldmap';\nimport { submitselector, type SubmitSelectorType } from '@webhare/dompack/src/browser';\nimport type { FormSubmitDetails } from './rpc';\nimport type { FormConfiguration } from '@webhare/forms';\n\n//Suggestion or error messages\nexport type FormFrontendMessage = HTMLElement | string;\n\ndeclare global {\n  interface HTMLElement {\n    //TODO Clean this up, these are internal. Move to a dataset, safer against DOM manipulation eg as done by slimselect\n    //Used by formgroups:\n    propWhFormInitialRequired?: boolean;\n    propWhFormCurrentEnabled?: boolean;\n    propWhFormCurrentRequired?: boolean;\n    propWhFormCurrentVisible?: boolean;\n    //Used by formlines:\n    propWhFormlineCurrentVisible?: boolean;\n    propWhValidationSuggestion?: FormFrontendMessage | null;\n    propWhCleanupFunction?: () => void;\n    /** @deprecated Use `getFormHandler` or `getFormData` from `@webhare/forms` to access the form's API */\n    propWhFormhandler?: FormBase<object>;\n    whFormsApiChecker?: () => Promise<void> | void;\n    whUseFormGetValue?: boolean;\n    whValidationPolyfilled?: boolean;\n    __didPlaceholderWarning?: boolean;\n  }\n\n  interface GlobalEventHandlersEventMap {\n    \"wh:form-enable\": CustomEvent<{ enabled: boolean }>;\n    \"wh:form-require\": CustomEvent<{ required: boolean }>;\n    \"wh:form-getvalue\": CustomEvent<{ deferred: PromiseWithResolvers<unknown> }>;\n    \"wh:form-setfielderror\": CustomEvent<SetFieldErrorData>; //TODO can we phase this out? it's a too deep integration\n    \"wh:form-configure\": CustomEvent<FormConfiguration>;\n    \"wh:form-pagechange\": CustomEvent<{\n      formHandler: FormBase<object>;\n      /** TODO Add numPages and currentPage, but we'd need to figure out how to properly account for Captcha pages (you don't want either numPages or currentPage to count that one)\n      numPages: number;\n      currentPage: number;\n      */\n    }>;\n    \"wh:form-preparesubmit\": CustomEvent<{ extrasubmit: Record<string, unknown> }>;\n    \"wh:form-response\": CustomEvent<FormSubmitResult>;\n    \"wh:form-submitted\": CustomEvent<FormSubmitDetails>;\n  }\n}\n\ntype ExtraData = unknown;\n\ntype FormControlDescription = {\n  name: string;\n  multi: false;\n  node: HTMLElement;\n} | {\n  name: string;\n  multi: true;\n  nodes: HTMLInputElement[];\n};\n\nexport type FormResultValue = Record<string, unknown>;\n\n/** The result returned to onSubmitSuccess */\nexport type FormSubmitEmbeddedResult<UserResult = { [key: string]: unknown }> = UserResult & {\n  //webtool submit additions. TODO a future API shouldn't mix these at the same level but allow them in the FormSubmitResult\n  submittype?: string;\n  richvalues?: RichValues;\n  resultsguid?: string;\n  submitinstruction?: NavigateInstruction;\n};\n\nexport interface FormSubmitMessage {\n  name: string;\n  message: string;\n  metadata: unknown;\n}\n\nexport interface FormSubmitResult {\n  success: boolean;\n  //TODO a next form iteration should not mix all these additional props into the form user's 'result'\n  result: FormSubmitEmbeddedResult;\n  errors: FormSubmitMessage[];\n  warnings: FormSubmitMessage[];\n  messages: RPCFormMessage[];\n}\n\ntype RichValues = Array<{ field: string; value: string }>;\n\nexport interface FieldErrorOptions {\n  serverside: boolean;\n  reportimmediately: boolean;\n  metadata?: unknown;\n}\n\ntype LimitSet = undefined | HTMLElement | HTMLElement[];\n\ninterface ValidationOptions {\n  // focusfailed Focus the first invalid element (defaults to true)\n  focusfailed?: boolean;\n  iffailedbefore?: boolean;\n}\n\ninterface FormValidationResult {\n  /// True if the fields successfuly validated\n  valid: boolean;\n  failed: HTMLElement[];\n  firstfailed: HTMLElement | null;\n}\n\ninterface ValidationQueueElement {\n  limitset?: LimitSet;\n  options?: ValidationOptions;\n  defer: PromiseWithResolvers<FormValidationResult>;\n}\n\ninterface PageState {\n  pages: HTMLElement[];\n  curpage: number;\n}\n\nlet delayvalidation = false, validationpendingfor: EventTarget | null = null;\nlet didGlobalHandlers: true | undefined;\n\n/** Convert linefeeds to BR tags */\nfunction lineFeedsToBreaks(text: string): DocumentFragment {\n  const frag = new DocumentFragment;\n  for (const part of text.split(/\\r?\\n/)) {\n    if (frag.childNodes.length)\n      frag.appendChild(document.createElement(\"br\"));\n    frag.append(part);\n  }\n  return frag;\n}\n\nfunction getPageIdx(state: PageState, page: number | HTMLElement) {\n  if (typeof page === 'number') {\n    if (page < 0 || page >= state.pages.length)\n      throw new Error(`Cannot navigate to nonexisting page #${page}`);\n    return page;\n  }\n\n  const idx = state.pages.indexOf(page);\n  if (idx === -1) {\n    console.error(`Cannot find page by element`, page);\n    throw new Error(`Cannot find page`);\n  }\n\n  return idx;\n}\n\nfunction getErrorFields(validationresult: FormValidationResult) {\n  return validationresult.failed.map(field => getFieldName(field) || field.dataset.whFormGroupFor || \"?\")\n    .sort()\n    .filter((value, index, self) => self.indexOf(value) === index) //unique filter\n    .join(\" \");\n}\nfunction hasEverFailed(field: HTMLElement) {\n  if (field.matches(\"input[type=radio],input[type=checkbox]\")) //these are handled by their group, so do the failed check there\n    return field.closest(\".wh-form__fieldgroup\")?.classList.contains('wh-form__field--everfailed');\n\n  return field.classList.contains('wh-form__field--everfailed');\n}\nfunction doValidation(field: EventTarget | null, iffailedbefore: boolean) {\n  if (iffailedbefore || validationpendingfor)\n    releasePendingValidations(); //release any earlier validation. this also cancels 'delayvalidation' but better safe than sorry if we double-run here\n\n  if (delayvalidation) { //Can't be \"iffailedbefore\" as that would have been cleared above\n    if (debugFlags.fhv)\n      console.log(\"[fhv] doValidation: validations are delayed. now pending: \", field);\n    validationpendingfor = field;\n    return;\n  }\n\n  const form = (field as HTMLElement).closest?.('form');\n  if (!form || !form.propWhFormhandler)\n    return;\n\n  const formhandler = form.propWhFormhandler;\n  formhandler.validate([field as HTMLElement], { focusfailed: false, iffailedbefore: iffailedbefore });\n}\n\n\nfunction doDelayValidation() {\n  if (delayvalidation)\n    releasePendingValidations();\n\n  delayvalidation = true;\n}\n\nfunction releasePendingValidations() {\n  if (!delayvalidation)\n    return;\n\n  delayvalidation = false;\n\n  if (validationpendingfor) {\n    const tovalidate = validationpendingfor;\n    if (debugFlags.fhv)\n      console.log(\"[fhv] releasePendingValidations: \", tovalidate);\n    validationpendingfor = null;\n    doValidation(tovalidate, false);\n  }\n}\n\n/* Browser extensions such as 1Password interfere with the event model and may\n   cause focusout to not fire for email and password fields. They don't seem\n   to break focusin so we'll watch focusin to detect missed focusout events */\nlet lastfocusout: EventTarget | null = null;\nfunction handleFocusOutEvent(event: FocusEvent) {\n  lastfocusout = event.target;\n  doValidation(event.target, false);\n}\nfunction handleFocusInEvent(event: FocusEvent) {\n  if (event.relatedTarget && lastfocusout !== event.relatedTarget)\n    doValidation(event.relatedTarget, false);\n}\n\nfunction handleValidateAfterEvent(event: Event) {\n  doValidation(event.target, true);\n}\n\nexport default class FormBase<DataShape extends object = Record<string, unknown>> extends FormFieldMap<DataShape> {\n  /** @deprecated Use node.elements if you want a true HTMLFormControlsCollection, use getElementByName since WH5.4+ for properly typed elements */\n  readonly elements: HTMLFormControlsCollection;\n  private _formsessionid = generateRandomId();\n  private _firstinteraction: number | undefined;\n  protected _submitstart: number | undefined;\n  private validationqueue = new Array<ValidationQueueElement>;\n  private _submitter: SubmitSelectorType | null = null;\n  private _submittimeout: NodeJS.Timeout | undefined;\n  /** Is the form currently interactive? Used to ignore changes done by code/setFieldValue */\n  private isInteractive = true;\n  /** Did we warn about old style form controls? */\n  private didLegacyWarning = false;\n  /** Are we currently in the _submit handler? (prevent duplicate submit attemps while eg. inside onBeforeSubmit) */\n  private inSubmit = false;\n  /** Where should the exitButton navigate to? */\n  private exitButtonNavigateTo?: NavigateInstruction;\n  /** Name of last focused element */\n  #lastFocused = \"\";\n\n  readonly data = new Proxy<DataShape>({} as DataShape, new FieldMapDataProxy(this));\n\n  readonly node: HTMLFormElement;\n\n  constructor(node: HTMLFormElement) {\n    if (node.nodeName !== 'FORM')\n      throw new Error(\"Specified node is not a <form>\"); //we want our clients to be able to assume 'this.node.elements' works\n\n    super(\"\", getFormElementCandidates(node, ''));\n\n    this.node = node;\n\n    this.elements = node.elements;\n    if (this.node.propWhFormhandler)\n      throw new Error(\"Specified node already has an attached form handler\");\n    this.node.propWhFormhandler = this;\n\n    //TODO Can we scope these handlers to the form ? Or register only once needed?\n    if (!didGlobalHandlers) {\n      didGlobalHandlers = true;\n      window.addEventListener(\"mouseup\", releasePendingValidations, true);\n      window.addEventListener(\"focusin\", handleFocusInEvent, true);\n    }\n\n    //Implement webhare fields extensions, eg 'now' for date fields or 'enablecomponents'\n    webharefields.setup(this.node);\n    //Implement page navigation\n    addDocEventListener(this.node, \"click\", evt => this._checkClick(evt));\n    addDocEventListener(this.node, \"dompack:takefocus\", evt => this._onTakeFocus(evt));\n    addDocEventListener(this.node, \"input\", evt => this._onInputChange(), { capture: true });\n    addDocEventListener(this.node, \"change\", evt => this._onInputChange(), { capture: true });\n    addDocEventListener(this.node, 'submit', evt => this._submit(evt, null));\n    addDocEventListener(this.node, 'wh:form-dosubmit', evt => { throw new Error(`wh:form-dosubmit is no longer supported`); });\n    addDocEventListener(this.node, \"wh:form-setfielderror\", evt => this._doSetFieldError(evt));\n    addDocEventListener(this.node, \"mousedown\", doDelayValidation);\n    addDocEventListener(this.node, \"focusout\", handleFocusOutEvent, { capture: true });\n    addDocEventListener(this.node, \"input\", handleValidateAfterEvent, { capture: true });\n    addDocEventListener(this.node, \"change\", handleValidateAfterEvent, { capture: true });\n    addDocEventListener(this.node, \"focusin\", this.#recordLastFocus, { capture: true });\n    this.node.noValidate = true;\n\n    this._rewriteEnableOn();\n    this._updateConditions(true); //Update required etc handlers\n    this._applyPrefills();\n\n    //Update page navigation\n    const pagestate = this._getPageState();\n    this._updatePageVisibility(pagestate.pages, 0);\n    this._updatePageNavigation();\n  }\n\n  static getForNode<DataShape extends object = Record<string, unknown>>(node: HTMLElement): FormBase<DataShape> | null {\n    return (node.propWhFormhandler as FormBase<DataShape>) || null;\n  }\n\n  ///like namedItem but improves on the types returned. does *not* lookup by data-wh-form-name!\n  getElementByName(name: string): FormControlElement | ConstrainedRadioNodeList | null {\n    return this.node.elements.namedItem(name) as FormControlElement | ConstrainedRadioNodeList | null;\n  }\n\n  /** Get language for this form */\n  getLangCode() {\n    return this.node.closest<HTMLElement>('[lang]')?.lang ?? 'en';\n  }\n\n  #recordLastFocus = (evt: dompack.DocEvent<FocusEvent>) => {\n    if (this.node.contains(evt.target)) {\n      const name = getFieldName(evt.target) || evt.target.dataset.whFormGroupFor;\n      if (name)\n        this.#lastFocused = name;\n    }\n  };\n\n  #onUnload = () => {\n    this.sendFormEvent({\n      event: 'abandoned',\n      lastfocused: this.#lastFocused,\n      pagenum: this.getCurrentPageNumber()\n    });\n  };\n\n  protected __formStarted() {\n  }\n\n  protected sendFormEvent(event?: FormAnalyticsSubEvents) {\n    const now = Date.now();\n    if (event?.event === 'submitted')\n      removeEventListener(\"pagehide\", this.#onUnload);\n\n    if (!this._firstinteraction) {   //The user hasn't interacted with the form yet\n      if (!this.isInteractive) { //ignore events triggered by code, eg a form prefill\n        if (event?.event && debugFlags.anl)\n          console.log(`[anl] Form is supressing broadcast of '${event?.event}' because it hasn't been interacted with yet`);\n        return;\n      }\n\n      //The user has interacted, start the clock!\n      this._firstinteraction = now; //set for calculation base *and* to prevent endless loops\n      this.sendFormEvent({ event: \"started\" });\n      addEventListener(\"pagehide\", this.#onUnload);\n    }\n\n    if (!event)\n      return; //we were only triggered to signal First Interaction\n    this._firstinteraction ||= now;\n\n    const pagestate = this._getPageState();\n    const eventdata: FormAnalyticsEventData = {\n      ...event,\n      id: this.node.dataset.whFormId || '',\n      session: this._formsessionid,\n      pagetitle: this._getPageTitle(pagestate.curpage),\n      pagenum: pagestate.curpage + 1,\n      time: now - this._firstinteraction,\n      objref: this.node.dataset.whFormObjref || ''\n    };\n\n    if (this._submitstart) //is set during a pending submission\n      eventdata.waittime = Date.now() - this._submitstart;\n\n    dompack.dispatchCustomEvent(this.node, \"wh:form-analytics\", { bubbles: true, cancelable: false, detail: eventdata });\n  }\n\n  _rewriteEnableOn() { //ADDME move this to webhare server\n    // EnablingComponents may set data-wh-form-enable. input(radio/checkbox) and option qualify\n    type EnablingComponent = HTMLInputElement | HTMLOptionElement;\n\n    // This is the initialization, check the enable components for all elements within the form\n    for (const control of dompack.qSA<EnablingComponent>(this.node, \"*[data-wh-form-enable]\"))\n      for (const element of control.dataset.whFormEnable!.split(\" \")) {\n        const target = this.getElementByName(element);\n        if (target && target instanceof HTMLElement) {\n          const name = (control instanceof HTMLOptionElement ? control.closest<HTMLSelectElement>(\"select\") : control)?.name;\n          if (!name) //duplicated node?\n            continue;\n\n          let ourcondition: FormCondition = { field: name, matchtype: \"IN\", value: control.value };\n          if (target.dataset.whFormEnabledIf) //append to existing criterium\n            ourcondition = { conditions: [parseCondition(target.dataset.whFormEnabledIf), ourcondition], matchtype: \"AND\" };\n          target.dataset.whFormEnabledIf = JSON.stringify({ c: ourcondition });\n        }\n      }\n  }\n\n  _applyPrefills() {\n    //Apply prefills. Set in field order, so controls-enabling-controls things will generally work\n    const searchparams = new URL(location.href).searchParams;\n    for (const field of this._queryAllFields()) {\n      const allvalues = searchparams.getAll(field.name);\n      if (!allvalues.length)\n        continue;\n\n      if (field.multi && field.nodes[0].type === 'checkbox') {\n        for (const node of field.nodes) {\n          const shouldbechecked = allvalues.includes(node.value);\n          if (shouldbechecked !== node.checked) //NOTE: used to read 'field.checked' which doesn't exist so this if() would always evaluate to true\n            this.setFieldValue(node, shouldbechecked);\n        }\n      } else if (field.multi) { //implies radio\n        const tocheck = field.nodes.filter(_ => _.value === allvalues[allvalues.length - 1])[0];\n        if (tocheck && !tocheck.checked)\n          this.setFieldValue(tocheck, true);\n        if (!tocheck)\n          field.nodes.filter(_ => _.checked).forEach(_ => this.setFieldValue(_, false));\n      } else if (field.node.matches(\"input:not([type=file]),select,textarea\")) { //Limit URL prefills to simple elements - TODO allow custom components to decide on this themselves OR *explicitly* require fields to opt-in to being prefillable\n        if (!this._isNowSettable(field.node))\n          continue;\n        this.setFieldValue(field.node, allvalues[allvalues.length - 1]); //last value wins\n      }\n    }\n  }\n\n  /**\n   * Set or update the message for the specified field\n   * @param field - node on which the validation triggered\n   * @param type - type of the message (\"error\" or \"suggestion\") - a field or group can have both an \"error\" and \"suggestion\" visible\n   * @param getError - function which returns a reference to the error node (or DocumentFragment) or a text\n   *\n   * .wh-form__field--error      - Used to indicate this element has an error\n   * .wh-form__field--suggestion - Used to indicate this element has an suggestion\n   * .wh-form__error             - The error message container\n   * .wh-form_suggestion         - The suggestion message container\n   */\n  _updateFieldGroupMessageState(field: HTMLElement, type: \"error\" | \"suggestion\", getError: (field: HTMLElement) => FormFrontendMessage | null) {\n    //Please note that _updateFieldGroupMessageState doesn't *validate* anything - it takes the current error/suggestion status and updates the DOM accordingly\n\n    /*\n    ADDME: ability to show multiple messages in case both the toplevel and a subfield have an error/suggestion.\n           Example: a checkboxgroup in which too many options are selected AND the required textfield of a selected option is empty.\n\n    ADDME: how should an error message reference a required nested textfield?\n\n    ADDME: Support progressive enhancements such as splitdatetime which use a native form element\n           to store the value. (it's probably confusing that aria-described by ends up on an\n           element which needs receives focus and cannot be used to influence/fix the value).\n           (such as the splitdatetime)\n\n           Suggestion for possible solution:\n           - have the progressive enchancement code add an attribute to the native form element\n             with the ID of the (group)element.\n    */\n    const fieldgroup = field.closest<HTMLElement>(\".wh-form__fieldgroup\");\n    //console.log(\"_updateFieldGroupMessageState\", field, fieldgroup);\n    if (!fieldgroup)\n      return;\n\n    /* Within the group this field belongs to we lookup the first node we can find which is marked as having the\n       type of message we want (\"error\" or \"suggestion\").\n       First we'll see if the fieldgroup wants to report something (radio & checkboxes handle their errors at the group level)\n       otherwise whe'll look for the first node which has a message.\n    */\n    const field_with_message = fieldgroup.classList.contains(\"wh-form__field--\" + type) ? fieldgroup : fieldgroup.querySelector<HTMLElement>(\".wh-form__field--\" + type);\n    //Do not pick up errors from deeper groups (array rows)\n    const error = (field_with_message && field_with_message.closest(\".wh-form__fieldgroup\") === fieldgroup ? getError(field_with_message) : null) || null;\n\n    // Now mark the whole .wh-form__fieldgroup as having an error/suggestion\n    fieldgroup.classList.toggle(\"wh-form__fieldgroup--\" + type, Boolean(error));\n\n    // Lookup the error message from the field metadata\n    if (error) { //mark the field has having failed at one point. we will now switch to faster updating error state\n      if (!field.classList.contains('wh-form__field--everfailed')) {\n        if (debugFlags.fhv)\n          console.log('[fhv] marking as everfailed', field, 'because of error', error);\n        field.classList.add('wh-form__field--everfailed');\n      }\n    }\n\n    // Determine the contextnode to set ARIA attributes on\n\n    // ADDME: before looking up a group, check if there an attribute specifying\n    //        another element with role=\"group\" handled the input.\n\n    // Find the first role=\"group\" we can find\n    // (ineither the .wh-form__subfield or .wh-form__field)\n    const potentialgroupnode = field.closest<HTMLElement>(\"[role=group],.wh-form__subfield,wh-form__fieldgroup\");\n    const group = potentialgroupnode?.role === \"group\" ? potentialgroupnode : null;\n    const contextnode = group ?? field;\n\n    let messageid = \"\";\n    let messagenode = fieldgroup.querySelector(\".wh-form__\" + type); //either wh-form__error or wh-form__suggestion\n\n    // Create a container for the suggestion or error\n    if (messagenode) {\n      messageid = messagenode.id; // reuse the existing messagenode\n    } else {\n      if (!error)\n        return; //nothing to do\n\n      // Generate a temporary id for the message which we can use in\n      // the aria-describedby to point to the message.\n      const random = Math.floor((1 + Math.random()) * 0x10000000).toString(16);\n      messageid = \"whform-msg-\" + random; // `${fieldname}-${random}`;\n\n      const suggestionholder = field.closest('.wh-form__fields') || fieldgroup.querySelector('.wh-form__fields') || fieldgroup;\n      messagenode = dompack.create(\"div\", { className: \"wh-form__\" + type }); // add a wh-form__error or wh-form__suggestion message container\n      messagenode.id = messageid; // id to reference to in the aria-describedby\n      suggestionholder.appendChild(messagenode);\n    }\n\n    if (error) { // Do we show a message?\n      messagenode.replaceChildren(typeof error === \"string\" ? lineFeedsToBreaks(error) : error);\n      this._addDescribedBy(contextnode, messageid);\n\n      if (type === \"error\")\n        contextnode.setAttribute(\"aria-invalid\", \"true\");\n    } else {\n      messagenode.replaceChildren(); // remove previous errors/suggestions texts from the errornode\n      this._removeDescribedBy(contextnode, messageid);\n      contextnode.removeAttribute(\"aria-invalid\");\n    }\n\n  }\n\n  // add the specified id of the message element to the list of elements in aria-describedby\n  _addDescribedBy(contextnode: HTMLElement, messageid: string) {\n    const describedby = contextnode.getAttribute(\"aria-describedby\") ?? \"\";\n    const describedby_fields = describedby !== \"\" ? describedby.split(\" \") : [];\n\n    if (describedby_fields.indexOf(messageid) === -1) {\n\n      describedby_fields.push(messageid);\n      contextnode.setAttribute(\"aria-describedby\", describedby_fields.join(\" \"));\n    }\n  }\n\n  // remove the specified id of the message element from the list of elements in aria-describedby\n  _removeDescribedBy(contextnode: HTMLElement, messageid: string) {\n    const describedby = contextnode.getAttribute(\"aria-describedby\") ?? \"\";\n    const describedby_fields = describedby !== \"\" ? describedby.split(\" \") : [];\n\n    for (let idx = 0; idx < describedby_fields.length; idx++) {\n      if (describedby_fields[idx] === messageid) {\n        describedby_fields.splice(idx, 1); // remove that item\n        break;\n      }\n    }\n\n    if (describedby_fields.length > 0)\n      contextnode.setAttribute(\"aria-describedby\", describedby_fields.join(\" \"));\n    else\n      contextnode.removeAttribute(\"aria-describedby\");\n  }\n\n  _updateFieldGroupErrorState(field: HTMLElement) {\n    this._updateFieldGroupMessageState(field, 'error', failedfield => getValidationState(failedfield).getError());\n  }\n\n  _updateFieldGroupSuggestionState(field: HTMLElement) {\n    this._updateFieldGroupMessageState(field, 'suggestion', failedfield => failedfield.propWhValidationSuggestion || '');\n  }\n\n  _doSetFieldError(evt: DocEvent<CustomEvent<SetFieldErrorData>>) {\n    //FIXME properly handle multiple fields in this group reporting errors\n    dompack.stop(evt);\n\n\n    this._reportFieldValidity(evt.target);\n  }\n\n  /** @returns false on error */\n  _reportFieldValidity(node: HTMLElement): boolean {\n    const state = getValidationState(node).getState();\n    node.classList.toggle(\"wh-form__field--error\", Boolean(state?.error));\n    node.classList.toggle(\"wh-form__field--suggestion\", Boolean(state?.suggested));\n\n    this._updateFieldGroupErrorState(node);\n    this._updateFieldGroupSuggestionState(node);\n    return !(state && \"error\" in state);\n  }\n\n  //validate and submit. normal submissions should use this function, directly calling submit() skips validation and busy locking\n  async validateAndSubmit(extradata: ExtraData) {\n    await this._submit(null, extradata);\n  }\n\n  /** Override beforeSubmit to have a last chance to block/confirm actual form submission\n   * @returns true to continue submitting\n  */\n  beforeSubmit(extradata: ExtraData): boolean | Promise<boolean> {\n    return true;\n  }\n\n  async _submit(evt: SubmitEvent | null, extradata: ExtraData) {\n    if (this.node.classList.contains('wh-form--submitting') || this.inSubmit) { //already submitting\n      evt?.preventDefault(); //avoid 'No RPC handler installed' noise during 429 errors\n      return;\n    }\n\n    //A form element's default button is the first submit button in tree order whose form owner is that form element.\n    const submitter = this._submitter || this.node.querySelector(submitselector);\n    this._submitter = null;\n\n    if (debugFlags.fhv)\n      console.log('[fhv] received submit event, submitter:', submitter);\n\n    let tempbutton = null;\n    if (submitter) { //temporarily add a hidden field representing the selected button\n      tempbutton = document.createElement('input');\n      tempbutton.name = submitter.name;\n      tempbutton.value = submitter.value;\n      tempbutton.type = \"hidden\";\n      this.node.appendChild(tempbutton);\n    }\n\n    try {\n      this.inSubmit = true;\n      const beforeResult = this.beforeSubmit(extradata);\n      if (!beforeResult || (isPromise(beforeResult) && !await beforeResult))\n        return;\n\n      /* DEPRECATED - Switch to onBeforeSubmit in 5.7+ */\n      if (!dompack.dispatchCustomEvent(this.node, 'wh:form-beforesubmit', { bubbles: true, cancelable: true })) { //allow parsley to hook into us\n        console.error(\"The use of wh:form-beforesubmit is deprecated and will be removed in a future version. Use onBeforeSubmit instead\");\n        return;\n      }\n\n      await this._doSubmit(evt, extradata);\n    } finally {\n      tempbutton?.remove();\n      this.inSubmit = false;\n    }\n  }\n\n  private _shouldValidateField(el: HTMLElement) {\n    //TODO maybe we can get rid of the data attributes by checking for explicit symbols like whFormsApiChecker\n    return (el.whFormsApiChecker || el.matches(`${queryFormFieldLike},*[data-wh-form-name],*[data-wh-form-custom-validator`)) &&\n      this._isPartOfForm(el);\n  }\n\n  _getFieldsToValidate(startingpoint?: HTMLElement) {\n    return dompack.qSA<HTMLElement>(startingpoint ?? this.node, \"*\").filter(el => this._shouldValidateField(el));\n  }\n\n  //reset any serverside generated errors (generally done when preparing a new submission)\n  resetServerSideErrors() {\n    for (const field of this._getFieldsToValidate()) {\n      const state = getValidationState(field);\n      if (state?.explicit?.serverside && field.propWhCleanupFunction)\n        field.propWhCleanupFunction();\n    }\n  }\n\n  async _doSubmit(evt: SubmitEvent | null, extradata: ExtraData) {\n    if (evt)\n      evt.preventDefault();\n\n    const lock = dompack.flagUIBusy({ modal: true });\n    this._submitstart = Date.now();\n    this._submittimeout = setTimeout(() => this._submitHasTimedOut(), 5000);\n    this.node.classList.add('wh-form--submitting');\n\n    try {\n      this.resetServerSideErrors();\n\n      const validationresult = await this.validate();\n      if (validationresult.valid) {\n        const result = await this.submit(extradata);\n        if (result.result && result.result.submittype && result.result.submittype !== this._getVariableValueForConditions(\"formsubmittype\")) {\n          this.node.setAttribute(\"data-wh-form-var-formsubmittype\", result.result.submittype);\n          this._updateConditions(false);\n        }\n      } else {\n        this.sendFormEvent({ event: \"failed\", errorfields: getErrorFields(validationresult), errorsource: 'client' });\n      }\n    } finally {\n      lock.release();\n      this.node.classList.remove('wh-form--submitting');\n      if (this._submittimeout) {\n        clearTimeout(this._submittimeout);\n        this._submittimeout = undefined;\n      }\n      this._submitstart = undefined;\n    }\n  }\n\n  _submitHasTimedOut() { //TODO extend this to (background) RPCs too, and make waitfor more specific. also check whether we're stuck on client or server side\n    this.sendFormEvent({ event: \"slow\", waitfor: \"submit\" });\n  }\n\n  //default submission function. eg. RPC will override this\n  async submit(extradata?: ExtraData): Promise<{ result?: FormSubmitEmbeddedResult }> {\n    this.node.submit();\n    return {};\n  }\n\n  _onTakeFocus(evt: DocEvent<TakeFocusEvent>) {\n    const containingpage = evt.target.closest('.wh-form__page');\n    if (containingpage && containingpage.classList.contains('wh-form__page--hidden')) {\n      //make sure the page containing the errored component is visible\n      const pagenum = dompack.qSA(this.node, '.wh-form__page').findIndex(page => page === containingpage);\n      if (pagenum >= 0)\n        this.gotoPage(pagenum);\n    }\n  }\n\n  _checkClick(evt: DocEvent<MouseEvent>) {\n    const actionnode = evt.target?.closest<HTMLElement>(\"*[data-wh-form-action]\");\n    if (!actionnode) {\n      const submitter = evt.target.closest<SubmitSelectorType>(submitselector);\n      if (submitter?.form === this.node) { //if we found the submit buton AND it's for *this* form. don't intercept otherwise\n        if (!this.node.classList.contains('wh-form--allowsubmit')) { //we're not allowed to submit yet (not on a final page)\n          dompack.stop(evt);\n          if (this.node.classList.contains('wh-form--allownext'))  //but we can convert your action to a NextPage! which is likely what you intended\n            this.executeFormAction('next');\n          return;\n        }\n\n        this._submitter = submitter; //store as submitter in case a submit event actually occurs\n        setTimeout(() => this._submitter = null); //but clear it as soon as event processing ends\n      }\n      return;\n    }\n\n    dompack.stop(evt);\n    this.executeFormAction(actionnode.dataset.whFormAction!);\n  }\n\n  private _getPageState(): PageState {\n    const pages = dompack.qSA<HTMLElement>(this.node, '.wh-form__page');\n    const curpage = pages.findIndex(page => !page.classList.contains('wh-form__page--hidden'));\n    return { pages, curpage };\n  }\n\n  _updatePageVisibility(pagelist: HTMLElement[], currentpage: number) {\n    pagelist.forEach((page, idx) => {\n      page.classList.toggle('wh-form__page--hidden', idx !== currentpage);\n      page.classList.toggle('wh-form__page--visible', idx === currentpage);\n    });\n  }\n\n  ///Get the currently opened page (page node)\n  getCurrentPage() {\n    const state = this._getPageState();\n    return state.curpage >= 0 ? state.pages[state.curpage] : null;\n  }\n\n  /** Position the specified element's group or the form itself into view, using `.wh-anchor` nodes to correct for fixed headers\n      @param scrollto -  Element to position into view. If not set, the form it scrolled into view */\n  scrollIntoView(scrollto?: HTMLElement) {\n    const origscrollto = scrollto;\n    scrollto = (scrollto ? scrollto.closest<HTMLElement>('.wh-form__fieldgroup') : undefined) || this.node;\n    scrollto = scrollto.querySelector<HTMLElement>('.wh-anchor') || scrollto;\n    if (origscrollto && scrollto !== origscrollto && debugFlags.fhv)\n      console.log('[fhv] Modified scroll target from ', origscrollto, ' to anchor ', scrollto);\n    else if (debugFlags.fhv)\n      console.log('[fhv] Scroll to ', scrollto);\n\n    scrollto.scrollIntoView();\n  }\n\n  /** Get the current page number\n      @returns 0-based index of page to jump to */\n  getCurrentPageNumber() {\n    return this._getPageState().curpage;\n  }\n\n  /** Goto a specific page\n      @param page - 0-based index of page or the HTML element of the page to jump to */\n  async gotoPage(page: number | HTMLElement, { __isSubmit = false } = {}): Promise<void> {\n    const state = this._getPageState();\n    const pageidx = getPageIdx(state, page);\n    if (state.curpage === pageidx)\n      return;\n\n    const goingforward = pageidx > state.curpage;\n    if (!__isSubmit)\n      this.sendFormEvent({\n        event: goingforward ? __isSubmit ? 'submitted' : 'nextpage' : 'previouspage',\n        targetpagenum: pageidx + 1,\n        targetpagetitle: this._getPageTitle(pageidx)\n      });\n\n    this._updatePageVisibility(state.pages, pageidx);\n    if (goingforward) //only makes sense to update if we're making progress\n      merge.run(state.pages[pageidx], { form: await this.getFormValue() });\n\n    this._updatePageNavigation();\n\n    //scroll back up\n    this.scrollIntoView();\n\n    /* tell the page it's now visible - note that we specifically don't fire this on init, as it's very likely\n       users would 'miss' the event anyway - registerHandler usually executes faster than your wh:form-pagechange\n       registrations, if you wrapped those in a dompack.register */\n    dompack.dispatchCustomEvent(state.pages[pageidx], \"wh:form-pagechange\", { bubbles: true, cancelable: false, detail: { formHandler: this } });\n  }\n\n  private _getDestinationPage(pagestate: PageState, direction: number) {\n    let pagenum = pagestate.curpage + direction;\n    //TODO \"captcha\" should no longer exist since WH5.9 - unless there are still some static published forms around, so keep skipping them for a while\n    while (pagenum >= 0 && pagenum < pagestate.pages.length && (pagestate.pages[pagenum].propWhFormCurrentVisible === false || pagestate.pages[pagenum].dataset.whFormPagerole === \"captcha\"))\n      pagenum = pagenum + direction;\n    if (pagenum < 0 || pagenum >= pagestate.pages.length)\n      return -1;\n    return pagenum;\n  }\n\n  _getPageTitle(pagenum: number) {\n    const pagenode = this._getPageState().pages[pagenum];\n    if (!pagenode)\n      return \"\";\n    return pagenode.dataset.whFormPagetitle || (\"#\" + (pagenum + 1));\n  }\n\n  async executeFormAction(action: string) {\n    switch (action) {\n      case 'previous':\n        {\n          if (this.node.classList.contains('wh-form--allowprevious')) {\n            const pagestate = this._getPageState();\n            if (pagestate.curpage > 0)\n              this.gotoPage(this._getDestinationPage(pagestate, -1));\n            else if (this.node.dataset.whFormBacklink)\n              navigateTo({ type: \"redirect\", url: this.node.dataset.whFormBacklink });\n          }\n          return;\n        }\n      case 'next':\n        {\n          const pagestate = this._getPageState();\n          if (this.node.classList.contains('wh-form--allownext')) {\n            this.resetServerSideErrors();\n\n            const validationstatus = await this.validate(pagestate.pages[pagestate.curpage]);\n            if (validationstatus.valid) {\n              this.gotoPage(this._getDestinationPage(pagestate, +1));\n            } else {\n              this.sendFormEvent({ event: \"failed\", errorfields: getErrorFields(validationstatus), errorsource: 'nextpage' });\n            }\n          }\n          return;\n        }\n      case 'exit': {\n        if (!this.exitButtonNavigateTo)\n          throw new Error(\"No exit navigation target set for this form\");\n\n        navigateTo(this.exitButtonNavigateTo);\n        return;\n      }\n      default: {\n        console.error(`Unknown form action '${action}'`);\n      }\n    }\n  }\n\n  async refreshConditions() {\n    await this._updateConditions(false);\n  }\n\n  _onInputChange() {\n    this.sendFormEvent(); //only trigger implicit _firstinteraction event\n    this._updateConditions(false);\n  }\n\n  async _updateConditions(isinit: boolean) {\n    // Check pages visibility\n    const hiddenPages = [];\n    const mergeNodes = [];\n    let anychanges = false;\n\n    for (const formpage of dompack.qSA(this.node, \".wh-form__page\")) {\n      let visible = true;\n      if (formpage.dataset.whFormVisibleIf) {\n        visible = this._matchesCondition(formpage.dataset.whFormVisibleIf);\n        if (!visible)\n          hiddenPages.push(formpage); // We don't have to check fields on this page any further\n\n        if (visible !== formpage.propWhFormCurrentVisible) {\n          anychanges = true;\n          formpage.propWhFormCurrentVisible = visible;\n          mergeNodes.push(formpage);\n        }\n      }\n    }\n    if (anychanges)\n      this._updatePageNavigation();\n\n    const tovalidate = new Array<HTMLElement>;\n    const hiddengroups = [], enabledgroups = [], requiredgroups = [];\n    for (const formgroup of dompack.qSA(this.node, \".wh-form__fieldgroup\")) {\n      const groupPage = formgroup.closest<HTMLElement>(\".wh-form__page\");\n      const visible = (!groupPage || !hiddenPages.includes(groupPage)) && this._matchesCondition(formgroup.dataset.whFormVisibleIf);\n      if (!visible)\n        hiddengroups.push(formgroup);\n\n      const enabled = visible\n        && this._matchesCondition(formgroup.dataset.whFormEnabledIf);\n\n      if (enabled)\n        enabledgroups.push(formgroup);\n\n      //load initial status?\n      if (formgroup.propWhFormInitialRequired === undefined)\n        formgroup.propWhFormInitialRequired = formgroup.classList.contains(\"wh-form__fieldgroup--required\");\n\n      const required = enabled\n        && (formgroup.dataset.whFormRequiredIf ? this._matchesCondition(formgroup.dataset.whFormRequiredIf) : formgroup.propWhFormInitialRequired);\n\n      if (required)\n        requiredgroups.push(formgroup);\n\n      if (visible !== formgroup.propWhFormCurrentVisible // These are initially undefined, so this code will always run first time\n        || enabled !== formgroup.propWhFormCurrentEnabled\n        || required !== formgroup.propWhFormCurrentRequired) {\n        formgroup.propWhFormCurrentVisible = visible;\n        formgroup.propWhFormCurrentEnabled = enabled;\n        formgroup.propWhFormCurrentRequired = required;\n\n        formgroup.classList.toggle(\"wh-form__fieldgroup--disabled\", !enabled);\n        formgroup.classList.toggle(\"wh-form__fieldgroup--hidden\", !visible);\n        formgroup.classList.toggle(\"wh-form__fieldgroup--required\", required);\n\n        mergeNodes.push(formgroup);\n      }\n    }\n\n    for (const formline of dompack.qSA(this.node, \".wh-form__fieldline\")) {\n      const formgroup = formline.closest<HTMLElement>(\".wh-form__fieldgroup\");\n      if (!formgroup)\n        continue;\n      const visible = !hiddengroups.includes(formgroup) && this._matchesCondition(formline.dataset.whFormVisibleIf);\n      const enabled = visible && enabledgroups.includes(formgroup) && this._matchesCondition(formline.dataset.whFormEnabledIf);\n      const required = enabled && requiredgroups.includes(formgroup);\n\n      if (visible !== formline.propWhFormlineCurrentVisible) {  // These are initially undefined, so this code will always run first time\n        formline.propWhFormlineCurrentVisible = visible;\n        formline.classList.toggle(\"wh-form__fieldline--hidden\", !visible);\n      }\n\n      // Look for nodes that are explicit enable state (enablee/require) listeners, or that need to do so because they're real input controls\n      const inputtargets = dompack.qSA(formline, `${queryFormFieldLike},[data-wh-form-state-listener='true']`);\n\n      for (const node of inputtargets) {\n        //Record initial states\n        if (!node.dataset.whFormSavedEnabled)\n          node.dataset.whFormSavedEnabled = (\"disabled\" in node ? !node.disabled : !(\"whFormDisabled\" in node.dataset)).toString();\n\n        if (!node.dataset.whFormSavedRequired)\n          node.dataset.whFormSavedRequired = Boolean(\"required\" in node && node.required).toString();\n\n        // The field is enabled if all of these are matched:\n        // - we're setting it to enabled now\n        // - it hasn't been disabled explicitly (set initially on the node)\n        // - it hasn't been disabled through enablecomponents\n        const node_enabled = enabled && node.dataset.whFormSavedEnabled === \"true\" && this._matchesCondition(node.dataset.whFormEnabledIf);\n\n        /* TODO ideally we'd eliminate 'current enabled/required' states, but we need them as long as some components intercept wh:form-enable and wh:form-require events\n                to know the state we told them to put the component in. we may be able to eliminate those events */\n        //if node.dataset.whFormCurrentEnabled is unset, we may still need to apply disabled state to a fresh field\n        if (!node.dataset.whFormCurrentEnabled || node_enabled !== (node.dataset.whFormCurrentEnabled === \"true\")) {\n          node.dataset.whFormCurrentEnabled = node_enabled ? \"true\" : \"false\";\n\n          // Give the formgroup a chance to handle it\n          if (dompack.dispatchCustomEvent(node, \"wh:form-enable\", { bubbles: true, cancelable: true, detail: { enabled: node_enabled } })) {\n            // Not cancelled, so run our default handler\n            if (isFormFieldLike(node)) //For true html5 inputs we'll use the native attributes. formstatelisteners: we use data attributes\n              node.disabled = !node_enabled;\n            else if (node_enabled)\n              node.removeAttribute(\"data-wh-form-disabled\");\n            else\n              node.setAttribute(\"data-wh-form-disabled\", \"\");\n          }\n\n          if (!isinit && !node_enabled && !tovalidate.includes(node))\n            tovalidate.push(node); // to clear errors for this disabled field\n        }\n\n        const node_required = (node.dataset.whFormSavedRequired === \"true\" || required) && node_enabled && visible;\n        //if node.dataset.whFormCurrentEnabled is unset, we may still need to apply disabled state to a fresh field\n        //if node.dataset.whFormCurrentRequired is unset, we may still need to apply required state to a fresh field\n        if (!node.dataset.whFormCurrentRequired || node.dataset.whFormCurrentRequired !== (node_required ? \"true\" : \"false\")) {\n          node.dataset.whFormCurrentRequired = node_required ? \"true\" : \"false\";\n\n          // Give the formgroup a chance to handle it\n          if (dompack.dispatchCustomEvent(node, \"wh:form-require\", { bubbles: true, cancelable: true, detail: { required: node_required } })) {\n            // Not cancelled, so run our default handler\n            if (isFormFieldLike(node)) { //For true html5 inputs we'll use the native attributes. formstatelisteners: we use data attributes\n              if (!isFormControl(node) || node.type !== 'checkbox') //don't set required on checkboxes, that doesn't do what you want\n                node.required = node_required;\n            } else if (node_required)\n              node.setAttribute(\"data-wh-form-required\", \"\");\n            else\n              node.removeAttribute(\"data-wh-form-required\");\n          }\n\n          if (!isinit && !node_required && formgroup.classList.contains(\"wh-form__fieldgroup--error\") && !tovalidate.includes(node))\n            tovalidate.push(node); // to clear errors for this now optional field\n        }\n      }\n    }\n\n    for (const option of dompack.qSA<HTMLOptionElement>(this.node, \".wh-form__fieldgroup select option\")) {\n      const visible = this._matchesCondition(option.dataset.whFormVisibleIf);\n\n      //Record initial states\n      if (!option.dataset.whFormSavedEnabled)\n        option.dataset.whFormSavedEnabled = (!option.disabled).toString();\n      if (!option.dataset.whFormSavedHidden)\n        option.dataset.whFormSavedHidden = option.hidden.toString();\n\n      const option_enabled = visible && option.dataset.whFormSavedEnabled === \"true\";\n      const option_hidden = !visible || option.dataset.whFormSavedHidden === \"true\";\n\n      if (option_enabled !== (option.dataset.whFormCurrentEnabled === \"true\") || option_hidden !== (option.dataset.whFormCurrentHidden === \"true\")) {\n        option.dataset.whFormCurrentEnabled = option_enabled ? \"true\" : \"false\";\n        option.dataset.whFormCurrentHidden = option_hidden ? \"true\" : \"false\";\n        option.disabled = !option_enabled;\n        option.hidden = option_hidden;\n\n        // If this option was the selected option, but is now disabled (but not the placeholder), reset the select's value\n        const selectnode = option.closest<HTMLSelectElement>(\"select\");\n        if (selectnode && option.selected && (!option_enabled || option_hidden) && option.dataset.placeholder === undefined) {\n          if (selectnode.options[0].dataset.placeholder !== undefined) { //we have a placeholder...\n            selectnode.selectedIndex = 0;\n          } else {\n            selectnode.selectedIndex = -1;\n            if (!selectnode.__didPlaceholderWarning) {\n              selectnode.__didPlaceholderWarning = true;\n              console.warn(\"This <select> lacks an explicit placeholder so we had to set selectedIndex to -1\", selectnode);\n            }\n          }\n        }\n\n        if (selectnode && !isinit && !tovalidate.includes(selectnode))\n          tovalidate.push(selectnode); // to clear errors for this option's select field\n      }\n    }\n\n    if (tovalidate.length)\n      await this.validate(tovalidate, { focusfailed: false, iffailedbefore: true });\n\n    this.fixupMergeFields(mergeNodes);\n  }\n\n  // eslint-disable-next-line @typescript-eslint/no-misused-promises -- FIXME: needs API rework\n  __scheduleUpdateConditions = wrapSerialized(() => this._updateConditions(false), { coalesce: true });\n\n  async fixupMergeFields(nodes: HTMLElement[]) {\n    // Rename the data-wh-merge attribute to data-wh-dont-merge on hidden pages and within hidden formgroups to prevent\n    // merging invisible nodes\n    // FIXME 'merge' has a filter option now - convert to that!\n    const formvalue = await this.getFormValue();\n    for (const node of nodes) {\n      if (node.propWhFormCurrentVisible) {\n        for (const mergeNode of dompack.qSA(node, '*[data-wh-dont-merge]')) {\n          mergeNode.dataset.merge = mergeNode.dataset.whDontMerge;\n          mergeNode.removeAttribute(\"data-wh-dont-merge\");\n        }\n        merge.run(node, { form: formvalue });\n      } else {\n        for (const mergeNode of dompack.qSA(node, '*[data-merge]')) {\n          mergeNode.dataset.whDontMerge = mergeNode.dataset.merge;\n          mergeNode.removeAttribute(\"data-merge\");\n        }\n      }\n    }\n  }\n\n  _matchesCondition(conditiontext: string | undefined) {\n    if (!conditiontext)\n      return true;\n\n    return this._matchesConditionRecursive(parseCondition(conditiontext));\n  }\n\n  _getConditionRawValue(fieldname: string, options?: { checkdisabled?: boolean }) {\n    if (this.node.hasAttribute(\"data-wh-form-var-\" + fieldname))\n      return this.node.getAttribute(\"data-wh-form-var-\" + fieldname);\n\n    const matchfield = this.getElementByName(fieldname);\n    if (!matchfield) {\n      console.error(`No match for conditional required field '${fieldname}'`);\n      return null;\n    }\n\n    if (isRadioNodeList(matchfield)) {\n      let currentvalue = null;\n\n      for (const field of matchfield)\n        if (((options && options.checkdisabled) || this._isNowSettable(field)) && field.checked) {\n          if (field.type !== \"checkbox\")\n            return field.value;\n\n          if (!currentvalue)\n            currentvalue = [];\n          currentvalue.push(field.value);\n        }\n      return currentvalue;\n    } else {\n      //Can we set this field?\n      if ((!options || !options.checkdisabled) && !this._isNowSettable(matchfield))\n        return null;\n    }\n\n    if (matchfield.type === \"checkbox\")\n      return (matchfield as HTMLInputElement).checked ? [matchfield.value] : null;\n\n    if (matchfield.type === \"radio\")\n      return (matchfield as HTMLInputElement).checked ? matchfield.value : null;\n\n    return matchfield.value;\n  }\n\n  _getVariableValueForConditions(conditionfield: string, options?: { matchcase?: boolean; checkdisabled?: boolean }) {\n    if (this.node.hasAttribute(\"data-wh-form-var-\" + conditionfield))\n      return this.node.getAttribute(\"data-wh-form-var-\" + conditionfield);\n\n    const fields = conditionfield.split(\"$\");\n\n    if (fields.length > 1) {\n      // If the condition field has a subfield, check if it's available through a form var\n      // The '$' in the attribute name is replaced with '.' to make the attribute name valid\n      const attrname = fields.join(\".\");\n      if (this.node.hasAttribute(\"data-wh-form-var-\" + attrname))\n        return this.node.getAttribute(\"data-wh-form-var-\" + attrname);\n    }\n\n    let currentvalue = this._getConditionRawValue(fields[0], options);\n    if (fields.length === 1 || currentvalue === null) //no subs to process\n      return currentvalue;\n\n    // Look for an extrafield match\n    const matchfield = this.getElementByName(fields[0]);\n    if (!matchfield) {\n      console.error(`No match for conditional required field '${conditionfield}'`);\n      return null;\n    }\n\n    if (matchfield instanceof HTMLSelectElement) {\n      if (Array.isArray(currentvalue)) {\n        const selectedvalue = currentvalue;\n        currentvalue = [];\n        for (const val of selectedvalue) {\n          const selected = dompack.qS<HTMLOptionElement>(matchfield, `option[value=\"${CSS.escape(val)}\"]`);\n          if (!selected?.dataset.__extrafields)\n            return null;\n          const extrafields = JSON.parse(selected.dataset.__extrafields);\n          currentvalue.push(extrafields[fields[1]]);\n        }\n      } else {\n        const selected = dompack.qS<HTMLOptionElement>(matchfield, `option[value=\"${CSS.escape(currentvalue)}\"]`);\n        if (!selected?.dataset.__extrafields)\n          return null;\n        const extrafields = JSON.parse(selected.dataset.__extrafields);\n        currentvalue = extrafields[fields[1]];\n      }\n      return currentvalue;\n    } else {\n      console.error(\"Subfield matching not supported for non-select fields\");\n      return null;\n    }\n  }\n\n\n  _matchesConditionRecursive(condition: FormCondition): boolean {\n    switch (condition.matchtype) {\n      case \"AND\":\n        for (const subcondition of condition.conditions)\n          if (!this._matchesConditionRecursive(subcondition))\n            return false;\n        return true;\n\n      case \"OR\":\n        for (const subcondition of condition.conditions)\n          if (this._matchesConditionRecursive(subcondition))\n            return true;\n        return false;\n\n      case \"NOT\":\n        return !this._matchesConditionRecursive(condition.condition);\n\n      case \"AGE<\":\n      case \"AGE>=\": {\n        const currentvalue = this._getVariableValueForConditions(condition.field);\n        if (!currentvalue)\n          return false;\n\n        const now = new Date, birthdate = new Date(Array.isArray(currentvalue) ? currentvalue[0] : currentvalue); //should never be an array, but _getVariableValueForConditions is generic\n        let age = now.getFullYear() - birthdate.getFullYear();\n        //birthdate not hit yet this year? then you lose a year\n        if (now.getMonth() < birthdate.getMonth()\n          || (now.getMonth() === birthdate.getMonth() && now.getDate() < birthdate.getDate())) {\n          --age;\n        }\n\n        return (condition.matchtype === 'AGE<' ? age < condition.value : age >= condition.value);\n      }\n    }\n\n    const currentvalue = this._getVariableValueForConditions(condition.field, condition.options);\n\n    if (condition.matchtype === \"HASVALUE\")\n      return Boolean(currentvalue) === Boolean(condition.value);\n\n    if ([\"IN\", \"HAS\", \"IS\"].includes(condition.matchtype)) {\n      const matchcase = condition.options?.matchcase !== false; // Defaults to true\n      const compareagainst = Array.isArray(condition.value) ? condition.value : condition.value ? [condition.value] : [];\n      const currentValArray: string[] = Array.isArray(currentvalue) ? currentvalue : currentvalue ? [currentvalue] : [];\n\n      // If the match is not case-sensitive, the condition value is already uppercased, so we only have to uppercase the\n      // current value(s) when checking\n      if (!matchcase)\n        currentValArray.forEach((_, idx) => currentValArray[idx] = currentValArray[idx].toUpperCase());\n\n      // The current value and the condition value should (at least) overlap\n      if (!currentValArray.some(value => compareagainst.includes(value)))\n        return false;\n\n      // For \"HAS\" and \"IS\" conditions, all of the required values should be selected (there shouldn't be required values\n      // that are not selected)\n      if ((condition.matchtype === \"HAS\" || condition.matchtype === \"IS\") && compareagainst.some(value => !currentValArray.includes(value)))\n        return false;\n\n      // For an \"IS\" condition, all of the selected values should be required (there shouldn't be selected values that are\n      // not required)\n      if (condition.matchtype === \"IS\" && currentValArray.some(value => !compareagainst.includes(value)))\n        return false;\n\n      return true;\n    }\n\n    return console.error(`No support for conditional type '${condition.matchtype}'`), false;\n  }\n\n  _updatePageNavigation() {\n    const pagestate = this._getPageState();\n    const nextpage = this._getDestinationPage(pagestate, +1);\n    const morepages = nextpage !== -1;\n    const curpagerole = pagestate.pages[pagestate.curpage] ? pagestate.pages[pagestate.curpage].dataset.whFormPagerole : '';\n    const nextpagerole = morepages ? pagestate.pages[nextpage].dataset.whFormPagerole : \"\";\n\n    this.node.classList.toggle(\"wh-form--allowprevious\", Boolean((pagestate.curpage > 0 && curpagerole !== 'thankyou') || (pagestate.curpage <= 0 && this.node.dataset.whFormBacklink)));\n    this.node.classList.toggle(\"wh-form--allownext\", morepages && nextpagerole !== 'thankyou');\n    this.node.classList.toggle(\"wh-form--allowsubmit\", curpagerole === 'thankyou'\n      ? pagestate.pages[pagestate.curpage].dataset.whFormExitButton !== undefined\n      : (!morepages || nextpagerole === 'thankyou'));\n\n    // Also handle the thank you page preparation (changing submit labels, redirecting if necessary)\n    this._prepareThankYouPage(pagestate.curpage);\n  }\n\n  _prepareThankYouPage(nextpage: number) {\n    const state = this._getPageState();\n    if (nextpage !== -1 && state.pages[nextpage] && state.pages[nextpage].dataset.whFormPagerole === 'thankyou') {\n      const rawNavigateTo = state.pages[nextpage].dataset.whFormNavigateTo;\n      const exitButton = state.pages[nextpage].dataset.whFormExitButton;\n      const parsedNavTo = rawNavigateTo ? JSON.parse(rawNavigateTo) : null;\n      if (parsedNavTo)\n        this.exitButtonNavigateTo = parsedNavTo;\n\n      const redirectdelay = parseInt(state.pages[nextpage].dataset.whFormPageredirectDelay ?? \"\");\n\n      if (exitButton) {\n        const submitButton = this.node.querySelector<HTMLElement>(\".wh-form__button--submit\");\n        const submitButtonLabel = submitButton?.querySelector<HTMLElement>(\".wh-form__buttonlabel\");\n        if (submitButton && submitButtonLabel) {\n          submitButton.dataset.whFormAction = \"exit\";\n          submitButtonLabel.textContent = exitButton;\n        } else {\n          console.error(`Unable to find the submit button '.wh-form__button--submit .wh-form__buttonlabel' - I need to replace its label with '${exitButton}'!`);\n        }\n      }\n\n      if (parsedNavTo && !(redirectdelay >= 0) && !exitButton) {\n        navigateTo(parsedNavTo);\n        return;\n      }\n\n      if (parsedNavTo && redirectdelay >= 0) {\n        // If redirectdelay==0 (redirect immediately, while showing the thank you page), redirect after a small delay to\n        // give the browser time to hide the busy layer\n        // Might be caused by this: https://stackoverflow.com/a/60439478\n        setTimeout(() => navigateTo(parsedNavTo), redirectdelay * 1000 || 100);\n      }\n    }\n  }\n\n  _navigateToThankYou(richvalues?: RichValues) {\n    const state = this._getPageState();\n\n    if (state.curpage >= 0) {\n      const nextpage = this._getDestinationPage(state, +1);\n      if (nextpage !== -1 && state.pages[nextpage] && state.pages[nextpage].dataset.whFormPagerole === 'thankyou') {\n        this.updateRichValues(state.pages[nextpage], richvalues);\n        this.gotoPage(nextpage, { __isSubmit: true });\n      }\n    }\n  }\n  updateRichValues(page: HTMLElement, richvalues?: RichValues) {\n    if (richvalues) {\n      for (const { field, value } of richvalues) {\n        const node = page.querySelector(`.wh-form__fieldgroup--richtext[data-wh-form-group-for=\"${CSS.escape(field)}\"] .wh-form__richtext`);\n        if (node) {\n          node.innerHTML = value;\n          dompack.registerMissed(node);\n        }\n      }\n    }\n  }\n\n  private ensureLegacyWarning(field: HTMLElement) {\n    if (!this.didLegacyWarning && dtapStage !== \"production\")\n      console.warn(`[form] ${getFieldDisplayName(field)} is using wh:form-getvalue/wh:form-setvalue events. It should switch to JSFormElement`);\n\n    this.didLegacyWarning = true;\n  }\n\n  /* Override this to overwrite the processing of individual fields. Note that\n     radio and checkboxes are not passed through getFieldValue, and that\n     getFieldValue may return undefined or a promise. */\n  async getFieldValue(field: HTMLElement) {\n    if (field[rfSymbol])\n      return field[rfSymbol].getValue();\n\n    if (field.hasAttribute('data-wh-form-name') || field.whUseFormGetValue) {\n      //create a deferred promise for the field to fulfill\n      const deferred = Promise.withResolvers<unknown>();\n      //if cancelled, we'll assume the promise is taken over\n      if (!dompack.dispatchCustomEvent(field, 'wh:form-getvalue', { bubbles: true, cancelable: true, detail: { deferred } })) {\n        this.ensureLegacyWarning(field);\n        return deferred.promise;\n      }\n    }\n    if (!isFormFieldLike(field)) {\n      /* Can't fail on these, weird embeddings do weird things. Eg google's recaptcha v2 triggers this because it assigns a random name=\n         to the iframe it injects and then we pick that up.. (may need to move this error behind a debugflag if that's the only likely cause) */\n      if (debugFlags.fhv)\n        console.log(`[fhv] Cannot get value on non-FormControl`, field);\n      return undefined; //TODO throw? but wasn't currently fatal\n    }\n\n    if (field.matches('input[type=file]')) //We don't care for multiple yet, as our form RPC APIs don't support that either\n      return [...(field as HTMLInputElement).files || []].map(file => ({ fileName: file.name, file: file, link: null })) satisfies FormFileValue[];\n\n    return field.value;\n  }\n\n  /* Override this to overwrite the setting of individual fields. In contrast\n     to getFieldValue, this function will also be invoked for radio and checkboxes */\n  setFieldValue(fieldnode: HTMLElement, value: unknown) {\n    if (fieldnode[rfSymbol])\n      return fieldnode[rfSymbol].setValue(value);\n\n    if (fieldnode.hasAttribute('data-wh-form-name')) {\n      if (!dompack.dispatchCustomEvent(fieldnode, 'wh:form-setvalue', { bubbles: true, cancelable: true, detail: { value } })) {\n        this.ensureLegacyWarning(fieldnode);\n        return;\n      }\n      // Event is not cancelled, set node value directly\n    }\n\n    if (!isFormFieldLike(fieldnode)) {\n      console.error(`Cannot set value on non-FormControl`, fieldnode, value);\n      return; //TODO throw? but wasn't currently fatal\n    }\n\n    //NOTE this blocks a lot of 'new sets' being done through setFieldValue, eg resetting an array by setting it to []. which is fine for me, just use the data proxy..\n    if (typeof value !== \"string\" && typeof value !== \"number\" && typeof value !== \"boolean\") {\n      console.error(`Setting value of type ${typeof value} on a FormControl`, fieldnode, value);\n      return; //TODO throw? but wasn't currently fatal\n    }\n\n    const saveInteractive = this.isInteractive;\n    try {\n      this.isInteractive = false;\n      if (isFormControl(fieldnode))\n        dompack.changeValue(fieldnode, value);\n      else\n        fieldnode.value = value;\n    } finally {\n      this.isInteractive = saveInteractive;\n    }\n  }\n\n  _isPartOfForm(el: HTMLElement) {\n    //In HTML terms, an input must either have *no* form attribute or explicitly point to us. eg <input form> is *outside* a form\n    //However nodes may live in fragments (eg arrayedits) that are not in the DOM and not attached anywhere, so we also consider anything outside the DOM to be in our form...\n    return !(\"form\" in el) || el.form === this.node || !document.contains(el)\n      || (!this.node && !el.hasAttribute(\"form\")); //FIXME remove this workaround needed now to work around form init race where arrayfields try to use _queryAllFields\n  }\n\n  _queryAllFields(options?: {\n    skiparraymembers?: boolean;\n    skipfield?: HTMLElement;\n    onlysettable?: boolean;\n    startnode?: HTMLElement;\n  }): FormControlDescription[] {\n    const foundfields = new Array<FormControlDescription>;\n    const skiparraymembers = options && options.skiparraymembers;\n\n    for (const field of this._getFieldsToValidate(options?.startnode)) {\n      if (options && field === options.skipfield) //arrayfield.es needs it\n        continue;\n      if (!this._isPartOfForm(field))\n        continue;\n      if (options && options.onlysettable && !this._isNowSettable(field))\n        continue;\n      if (skiparraymembers && field.closest(\".wh-form__arrayrow\"))\n        continue;\n\n      const name = getFieldName(field);\n      if (!name)\n        continue;\n\n      let addto = foundfields.find(_ => _.name === name);\n      if (isRadioOrCheckbox(field)) { //expect multiple inputs with this name?\n        if (!addto) {\n          addto = { name: name, multi: true, nodes: [] };\n          foundfields.push(addto);\n        } else if (!addto.multi) {\n          console.error(`[fhv] Encountered duplicate field '${name}'`, field);\n          continue;\n        }\n        addto.nodes.push(field);\n      } else {\n        if (addto) {\n          console.error(`[fhv] Encountered duplicate field '${name}'`, field);\n          continue;\n        }\n\n        foundfields.push({ name: name, multi: false, node: field });\n      }\n    }\n\n    return foundfields;\n  }\n\n  /** Return the names of all form elements */\n  getFormElementNames() {\n    return this._queryAllFields().map(_ => _.name);\n  }\n\n  /** getValue from a field as returned by _queryAllFields (supporting both multilevel and plain fields)\n      @returns promise */\n  _getQueryiedFieldValue(field: FormControlDescription) {\n    if (!field.multi)\n      return this.getFieldValue(field.node);\n\n    return field.nodes.filter(node => node.checked).map(node => node.value);\n  }\n\n  /** Return a promise resolving to the submittable form value */\n  async getFormValue(): Promise<FormResultValue> {\n    const outdata: FormResultValue = {};\n    const fieldpromises = new Array<Promise<void>>;\n\n    for (const field of this._queryAllFields({ onlysettable: true, skiparraymembers: true }))\n      this._processFieldValue(outdata, fieldpromises, field.name, this._getQueryiedFieldValue(field));\n\n    await Promise.all(fieldpromises);\n    return outdata;\n  }\n\n  _isNowSettable(node: HTMLElement) {\n    // If the node is disabled, it's not settable\n    if (\"disabled\" in node && node.disabled)\n      return false;\n\n    // If the node's field group is disabled or hidden, it's not settable\n    const formgroup = node.closest(\".wh-form__fieldgroup\");\n    if (formgroup) {\n      if (formgroup.classList.contains(\"wh-form__fieldgroup--disabled\"))\n        return false;\n      if (formgroup.classList.contains(\"wh-form__fieldgroup--hidden\"))\n        return false;\n    }\n\n    // If the node's form page is hidden dynamically, it's not settable\n    const formpage = node.closest<HTMLElement>(\".wh-form__page\");\n    if (formpage) {\n      if (formpage.propWhFormCurrentVisible === false)\n        return false;\n    }\n    // The node is settable\n    return true;\n  }\n\n  _processFieldValue(outdata: FormResultValue, fieldpromises: Array<Promise<void>>, fieldname: string, receivedvalue: unknown) {\n    if (receivedvalue === undefined)\n      return;\n    if (isPromise(receivedvalue)) {\n      fieldpromises.push(new Promise<void>((resolve, reject) => {\n        receivedvalue.then(result => {\n          if (result !== undefined)\n            outdata[fieldname] = result;\n\n          resolve();\n        }).catch(e => reject(e as Error));\n      }));\n    } else {\n      outdata[fieldname] = receivedvalue;\n    }\n  }\n\n  //get the option lines associated with a specific radio/checkbox group\n  getOptions(name: string) {\n    const nodes = this.getElementByName(name);\n    if (!(nodes instanceof RadioNodeList))\n      return [];\n\n    return [...nodes].map(node => ({\n      inputnode: node,\n      fieldline: node.closest<HTMLElement>('.wh-form__fieldline'),\n      value: node.value\n    }));\n  }\n\n  /** gets the selected option associated with a radio/checkbox group as an array\n      */\n  getSelectedOptions(name: string) {\n    let opts = this.getOptions(name);\n    opts = opts.filter(node => node.inputnode.checked);\n    return opts;\n  }\n\n  /** get the selected option associated with a radio/checkbox group. returns an object that's either null or the first selected option\n      */\n  getSelectedOption(name: string) {\n    const opts = this.getSelectedOptions(name);\n    return opts.length ? opts[0] : null;\n  }\n\n  /** get the fieldgroup for an element */\n  getFieldGroup(name: string): HTMLElement | null {\n    let node = this.getElementByName(name);\n    if (node instanceof RadioNodeList)\n      node = node[0];\n\n    return node ? node.closest<HTMLElement>('.wh-form__fieldgroup') : null;\n  }\n\n  /** get the values of the currently selected radio/checkbox group */\n  private getValues(name: string) {\n    return this.getSelectedOptions(name).map(node => node.value);\n  }\n  /** get the value of the first currently selected radio/checkbox group */\n  private getValue(name: string) {\n    const vals = this.getValues(name);\n    return vals.length ? vals[0] : null;\n  }\n\n  /** @deprecated Just import setupValidator from \\@mod-publisher/js/forms */\n  static setupValidator(node: HTMLElement, checker: (node: HTMLElement) => Promise<string> | string) {\n    setupValidator(node, checker);\n  }\n\n  /** @deprecated Just import setFieldError from \\@mod-publisher/js/forms */\n  static setFieldError(field: HTMLElement, error: string, options?: Partial<FieldErrorOptions>) {\n    setFieldError(field, error, options);\n  }\n\n  setFieldError(field: HTMLElement, error: string, options?: Partial<FieldErrorOptions>) {\n    setFieldError(field, error, options);\n  }\n\n  async validateSingleFormField(field: HTMLElement): Promise<boolean> {\n    return true;\n  }\n\n  async _validateSingleFieldOurselves(field: HTMLElement): Promise<boolean> {\n    const state = getValidationState(field);\n\n    if (!state.explicit && isFieldNativeErrored(field)) {\n      //browser checks go first, any additional checks are always additive (just disable browserchecks you don't want to apply)\n      updateFieldError(field);\n      return this._reportFieldValidity(field);\n    }\n\n    //TODO we probably *shouldn't* be bothering running our validations if state.explicit is set, but then setFieldError needs to rerun the checks once the explicit error is dropped\n    state.dynamicError = null;\n    await this.validateSingleFormField(field);\n\n    if (!state.dynamicError)\n      for (const validator of state.validators) {\n        state.dynamicError = await validator(field) || null;\n        if (state.dynamicError)\n          break; //one is enough\n      }\n\n    if (!state.dynamicError && field.whFormsApiChecker)\n      await field.whFormsApiChecker();\n\n    return this._reportFieldValidity(field);\n  }\n\n  /** validate the form\n      @param limitset - A single element, nodelist or array of elements to validate (or their children)\n      @returns a promise that will fulfill when the form is validated\n       */\n  async validate(limitset?: LimitSet, options?: ValidationOptions): Promise<FormValidationResult> {\n    if (debugFlags.fdv) {\n      console.warn(`[fdv] Validation of form was skipped`);\n      return { valid: true, failed: [], firstfailed: null };\n    }\n\n    //Overlapping validations are dangerous, because we can't evaluate 'hasEverFailed' too early... if an earlier validation is still running it may still decide to mark fields as failed.\n    const defer = Promise.withResolvers<FormValidationResult>();\n    this.validationqueue.push({ defer, limitset, options });\n    if (this.validationqueue.length === 1)\n      this._executeNextValidation(); //we're first on the queue so process it\n\n    return defer.promise;\n  }\n\n  async _executeNextValidation() {\n    while (this.validationqueue.length) {\n      const item = this.validationqueue[0];\n      try {\n        const result = await this._executeQueuedValidation(item.limitset, item.options);\n        item.defer.resolve(result);\n      } catch (error) {\n        item.defer.reject(error as Error);\n      }\n      this.validationqueue.shift(); //remove the top item\n    }\n  }\n\n  async _executeQueuedValidation(limitset?: LimitSet, options?: ValidationOptions): Promise<FormValidationResult> {\n    const original = limitset;\n    if (!limitset)  //validate entire form if unspecified what to validate\n      limitset = this._getFieldsToValidate();\n\n    const tovalidate = new Set<HTMLElement>;\n    for (const node of Array.isArray(limitset) ? limitset : [limitset]) {\n      /* If you're explicitly validating a radio/checkbox, we need to validate its group (but not recurse down) as that's where radiogroup.es and checkboxgroup.es attach their validations\n         If you're targeting a group, we'll end up validating both the radio/checkbox (directly attached here) and any eg. embedded textedits  */\n      if (node.matches(`input[type=radio],input[type=checkbox]`)) {\n        const group = node.closest<HTMLElement>(\".wh-form__fieldgroup\");\n        if (group)\n          tovalidate.add(group);\n        continue;\n      }\n\n      if (this._shouldValidateField(node))\n        tovalidate.add(node);\n      for (const subnode of this._getFieldsToValidate(node)) //TODO this is overly recursive esp. if limitset is empty...\n        tovalidate.add(subnode);\n    }\n\n    /* This was:\n    tovalidate = Array.from(tovalidate); //we need an array now for further processing\n       but that breaks on some old mootools integrations, see https://gitlab.webhare.com/webharebv/codekloppers/-/issues/677#note_146801\n       wokaround: */\n    let tovalidatelist = [...tovalidate]; //we need an array now for further processing\n\n    if (options && options.iffailedbefore)\n      tovalidatelist = tovalidatelist.filter(node => hasEverFailed(node));\n\n    if (debugFlags.fhv)\n      console.log(\"[fhv] Validation of %o expanded to %d elements: %o\", original, tovalidatelist.length, [...tovalidatelist]);\n\n    const lock = dompack.flagUIBusy();\n    try {\n      if (!tovalidatelist.length)\n        return { valid: true, failed: [], firstfailed: null };\n\n      const validationresults = await Promise.all(tovalidatelist.map(fld => this._validateSingleFieldOurselves(fld)));\n      //remove the elements from validate for which the promise failed\n      const failed = tovalidatelist.filter((fld, idx) => !validationresults[idx]);\n      const result: FormValidationResult = {\n        valid: failed.length === 0,\n        failed: failed,\n        firstfailed: null\n      };\n\n      result.firstfailed = result.failed.length ? result.failed[0] : null;\n      if (result.firstfailed && (!options || options.focusfailed)) {\n        //FIXME shouldn't getFocusableComponents also return startnode if focusable?\n        const tofocus = domfocus.canFocusTo(result.firstfailed) ? result.firstfailed : domfocus.getFocusableComponents(result.firstfailed)[0];\n        if (tofocus)\n          dompack.focus(tofocus, { preventScroll: true });\n\n        this.scrollIntoView(result.firstfailed);\n      }\n\n      if (debugFlags.fhv)\n        console.log(`[fhv] Validation of ${tovalidatelist.length} fields done, ${result.failed.length} failed`, result);\n\n      return result;\n    } finally {\n      lock.release();\n    }\n  }\n\n  async reset() {\n    this.node.reset();\n    if (this.getCurrentPageNumber() > 0)\n      await this.gotoPage(0);\n  }\n}\n","import * as dompack from 'dompack';\nimport { getTid, getTidLanguage } from \"@webhare/gettid\";\nimport { getFormService } from \"@webhare/forms/src/formservice\";\nimport { isValidEmail, wrapInTimeout } from '@webhare/std';\nimport { setFieldError } from './customvalidation';\nimport type { EmailValidationResult } from '@webhare/forms/src/types';\nimport type FormBase from '../formbase';\nimport type RPCFormBase from '../rpc';\nimport { debugFlags } from '@webhare/env';\n\nconst cache:\n  {\n    [key: string]: Promise<EmailValidationResult>;\n  } = {};\n\nfunction mayValidateField(field: HTMLInputElement) {\n  if (field.disabled || field.readOnly) //FIXME shouldn't we just decide not to validate at a much higher level if something cannot be changed ?\n    return false;\n\n  if (field.autocomplete && field.autocomplete.split(' ').includes(\"username\")) //Well, we shouldn't *force* usernames as a blacklisted domain might still have been explicitly added as login. but suggestions are still useful?\n    return false;\n  return true;\n}\n\nfunction acceptEmailSuggestion<DataShape extends object = Record<string, unknown>>(evt: Event, form: FormBase<DataShape>, field: HTMLInputElement, suggestion: string) {\n  dompack.stop(evt);\n  field.value = suggestion;\n  field.propWhValidationSuggestion = null;\n  form._reportFieldValidity(field);\n}\n\nexport async function validateField<DataShape extends object = Record<string, unknown>>(form: FormBase<DataShape> | RPCFormBase<DataShape>, field: HTMLInputElement) {\n  if (field.dataset.whFormEmailBlocked) {\n    delete field.dataset.whFormEmailBlocked;\n    setFieldError(field, \"\"); //explicitly clear our earlier setFieldError, but only if we set it. FIXME To really cleanly solve this we need better integration with rpc.ts - we want to be in the setupValidation chain and simply return errors instead of being explictly invoked\n  }\n\n  const checkvalue: string = field.value;\n  if (!checkvalue || !mayValidateField(field)) {\n    return true; //not a problem\n  }\n\n  if (!isValidEmail(checkvalue)) {\n    //TODO why aren't we just returning the error like a validator callback? may also help avoid the whFormEamailBlocked hack..\n    field.dataset.whFormEmailBlocked = \"true\";\n    setFieldError(field, getTid(\"publisher:site.forms.commonerrors.email\"));\n    return false;\n  }\n\n  //user is 'done' with email field apparently. remotely validate it\n  const key = \"e_\" + field.name + \".\" + checkvalue; //e_ prefix protects against funny people using 'constructor' etc. TODO just switch to a Map<> or similar. TODO only include field.name if needed, and also bind to the form then\n  if (cache[key] === undefined) {\n    const rpcCall = \"getRPCFormIdentifier\" in form ?\n      //TODO rendering.whlib should add a data attribute if there are form+field-specific checks, perhaps we can even generalize that for all fields instead of just email whenever they need to do direct validation\n      getFormService().formValidateEmail({ ...form.getRPCFormIdentifier(), field: field.name }, checkvalue)\n      : getFormService().validateEmail(getTidLanguage(), checkvalue);\n\n    //wrap in timeout\n    cache[key] = wrapInTimeout(rpcCall, 3000, \"Timeout\");\n  }\n\n  //TODO should we ever clear the cache? only relevant probably if someone is on the frontend testing emails and doesn't want to refresh\n  let result: EmailValidationResult | undefined;\n\n  try {\n    result = await cache[key];\n  } catch (e) { //timeout or other error, or offline form (PWA?)\n    if (debugFlags.fhv)\n      console.log('[fhv] Email validation error or timeout for value', checkvalue, e);\n  }\n\n  if (checkvalue !== field.value || !mayValidateField(field))\n    return true; //the field already changed, don't report about old errors\n\n  if (result?.blocked) {\n    field.dataset.whFormEmailBlocked = \"true\";\n    setFieldError(field, result.blocked);\n    return false;\n  }\n\n  if (result?.force) {\n    field.value = result.force;\n\n    //we should be able to assume we won't have to revalidate a server-provided suggestion\n    cache[\"e_\" + field.name + \".\" + result.force] = Promise.resolve<EmailValidationResult>({});\n\n    return true;\n  } else if (result?.suggestion) {\n    const suggestion = getTid(\"publisher:site.forms.commonerrors.email_suggestion\", \"___SUGGESTION___\").split(\"___SUGGESTION___\");\n\n    //we should be able to assume we won't have to revalidate a server-provided suggestion\n    cache[\"e_\" + field.name + \".\" + result.suggestion] = Promise.resolve<EmailValidationResult>({});\n\n    field.propWhValidationSuggestion =\n      <span class=\"wh-form__emailcorrection\">\n        {suggestion[0]}\n        <a href=\"#\" class=\"wh-form__emailcorrected\" on={{ click: (evt: Event) => acceptEmailSuggestion(evt, form, field, result.suggestion as string) }}>{result.suggestion}</a>\n        {suggestion[1]}\n      </span>;\n    return true;\n  }\n  return true;\n}\n","import { debugFlags } from \"@webhare/env\";\n\n/** @deprecated  Use debugFlags from \\@webhare/env */\nconst debugflags = debugFlags;\nexport { debugflags };\n\n//Add all flags as a dompack-debug-- class\nif (typeof document !== 'undefined')\n  document.documentElement.classList.add(...Object.keys(debugFlags).map(flagname => \"dompack--debug-\" + flagname));\nif (debugFlags.dompack)\n  console.log('[dompack] debugging flags: ' + Object.keys(debugFlags).join(', '));\n","/* @recommendedimport: import * as browser from 'dompack/extra/browser';\n\n   Identify devices for the purpose of analytics/tracing\n   NOT a library for feature detection!\n\n   Based on Mootools.Browser\n*/\n/* eslint no-useless-escape: off */\n\ntype Platform = \"windows\" | \"ios\" | \"webos\" | \"android\" | \"linux\" | \"mac\" | \"other\";\n\nexport type UserAgentInfo =\n  {\n    name: string;\n    version: number;\n    platform: Platform;\n    device: \"desktop\" | \"mobile\" | \"tablet\" | \"\";\n  };\n\nexport function parseUserAgent(ua: string): UserAgentInfo {\n  ua = ua.toLowerCase();\n\n  // chrome is included in the edge UA, so need to check for edge first, before checking if it's chrome.\n  // safari is included in the miuibrowser UA, so need to check for miuibrowser first, before checking if it's safari.\n  let UA: RegExpMatchArray | null = ua.match(/(edge|miuibrowser)[\\s\\/:]([\\w\\d\\.]+)/);\n  if (!UA)\n    UA = ua.match(/(opera|ie|firefox|chrome|trident|crios|version)[\\s\\/:]([\\w\\d\\.]+)?.*?(safari|(?:rv[\\s\\/:]|version[\\s\\/:])([\\w\\d\\.]+)|$)/);\n  if (!UA) { //try ios 11.4.1\n    UA = ua.match(/; cpu os ([\\d]+)/);\n    if (UA)\n      UA = ['', 'safari', UA[1]];\n  }\n  if (!UA)\n    UA = ['', 'unknown', \"0\"];\n\n  if (UA[1] === 'trident') {\n    UA[1] = 'ie';\n    if (UA[4]) UA[2] = UA[4];\n  } else if (UA[1] === 'crios') {\n    UA[1] = 'chrome';\n  }\n\n  let platform = ua.match(/ip(?:ad|od|hone)/) ? 'ios' : (ua.match(/(?:webos|android)/) || ua.match(/mac|win|linux/) || ['other'])[0];\n  if (platform === 'win') platform = 'windows';\n\n  const ret: UserAgentInfo =\n  {\n    name: (UA[1] === 'version') ? UA[3] : UA[1],\n    version: parseInt((UA[1] === 'opera' && UA[4]) ? UA[4] : UA[2]),\n    platform: platform as Platform,\n    device: ua.match(/ipad/) ? 'tablet' : ['ios', 'webos', 'android'].includes(platform) ? 'mobile' : ['mac', 'windows', 'linux'].includes(platform) ? 'desktop' : ''\n  };\n\n  return ret;\n}\n\n//module.exports =\nconst browser = parseUserAgent(globalThis.navigator?.userAgent || \"\");\n\nexport function getName() {\n  return browser.name;\n}\nexport function getVersion() {\n  return browser.version;\n}\nexport function getPlatform() {\n  return browser.platform;\n}\nexport function getDevice() {\n  return browser.device;\n}\nexport function getTriplet() {\n  return browser.platform + '-' + browser.name + '-' + browser.version;\n}\n","/* All keynames should be mixed-cased, as done here: http://www.w3.org/TR/DOM-Level-3-Events-key/\n\n   Modifiers should be in the ordering Alt+Control+Meta+Shift+key (ie alphabetical)\n\n   To simply prevent keys from propagating up (ie to keep Enter inside its textarea)\n   new KeyboardHandler(this.textarea, {}, { dontpropagate: ['Enter']});\n*/\n\nimport { type NormalizedKeyboardEvent, normalizeKeyboardEventData } from '../src/events';\nimport { debugflags } from '../src/debug';\nimport { getPlatform } from './browser';\nconst IS_MAC_PLATFORM = getPlatform() === \"mac\";\n\nconst propnames = {\n  shiftKey: \"Shift\",\n  ctrlKey: IS_MAC_PLATFORM ? \"Control\" : [\"Accel\", \"Control\"],\n  metaKey: IS_MAC_PLATFORM ? [\"Accel\", \"Meta\"] : \"Meta\",\n  altKey: \"Alt\"\n};\n\nfunction getFinalKey(event: NormalizedKeyboardEvent) { //get the name for the 'final' key, eg the 'D' in 'alt+control+d'\n  if (event.code?.startsWith('Key') && event.code.length === 4)\n    return event.code.substring(3, 4).toUpperCase();\n  if (event.code?.startsWith('Digit') && event.code.length === 6)\n    return event.code.substring(5, 6).toUpperCase();\n  return event.key.length === 1 ? event.key.toUpperCase() : event.key;\n}\n\nfunction getKeyNames(event: NormalizedKeyboardEvent) {\n  let names: string[][] = [[]];\n\n  /*\n    // Firefix under selenium on linux always says 'Unidentified' as key. Backup for some keys.\n    if (basekey === \"Unidentified\")\n      basekey = selenium_backup[event.keyCode];\n  */\n  // Create the modifiers in the names array (omit the basekey, so we can sort on modifier first)\n  (Object.keys(propnames) as Array<keyof typeof propnames>).forEach(propname => {\n    if (event[propname]) {\n      // The key is pressed. Add the modifier name to all current names.\n      const modifier: string | string[] = propnames[propname];\n      if (!Array.isArray(modifier))\n        names.forEach(function (arr) { arr.push(modifier); });\n      else {\n        // Multiple modifiers map to this key, duplicate all result sequences for every modifier\n        const newkeys: string[][] = [];\n        modifier.forEach(function (singlemodifier) {\n          names.forEach(function (arr) {\n            newkeys.push(arr.concat([singlemodifier]));\n          });\n        });\n        names = newkeys;\n      }\n    }\n  });\n\n  return names.map(function (arr) {\n    // Sort the modifier names\n    arr = arr.sort();\n    arr.push(getFinalKey(event));\n    return arr.join(\"+\");\n  });\n}\n\nfunction validateKeyName(key: string) {\n  const modifiers = key.split(\"+\");\n  modifiers.pop();\n\n  // Check for allowed modifiers\n  modifiers.forEach(function (mod) {\n    if (![\"Accel\", \"Alt\", \"Control\", \"Meta\", \"Shift\"].includes(mod))\n      throw new Error(\"Illegal modifier name '\" + mod + \"' in key '\" + key + \"'\");\n  });\n\n  const original_order = modifiers.join('+');\n  modifiers.sort();\n  if (modifiers.join('+') !== original_order)\n    throw new Error(\"Illegal key name \" + key + \", modifiers must be sorted alphabetically\");\n}\n\ntype KeyboardMappingHandler = (event: KeyboardEvent) => boolean | void;\ntype KeyboardMapping = { [key: string]: KeyboardMappingHandler };\ntype KeyPressHandler = (event: KeyboardEvent, key: string) => boolean | void;\ntype KeyboardEventHandler = (event: Event) => void;\ntype KeyboardHandlerOptions =\n  {\n    stopmapped?: boolean;\n    dontpropagate?: string[];\n    onkeypress?: KeyPressHandler;\n    captureunsafekeys?: boolean;\n    listenoptions?: AddEventListenerOptions;\n  };\n\n/**\n     node: The node to attach to\n    keymap: Keymap\n    options.stopmapped - preventDefault and stopPropagation on any key we have in our map\n    options.dontpropagate - string array of keys not to propagate out of this object\n    options.onkeypress - when set, call for all keypresses. signature: function (event, key). Should always return true and preventDefault (and/or stop) the event to cancel its handling\n    options.listenoptions - addEventListener options (eg \\{capture:true\\})\n */\nexport default class KeyboardHandler {\n  node: EventTarget;\n  keymap: KeyboardMapping;\n  stopmapped: boolean;\n  dontpropagate: string[];\n  onkeypress?: KeyPressHandler;\n  captureunsafekeys: boolean;\n  private _listenoptions?: AddEventListenerOptions;\n  private _onkeydown: KeyboardEventHandler;\n  private _onkeypress: KeyboardEventHandler;\n\n  constructor(node: EventTarget, keymap: KeyboardMapping, options?: KeyboardHandlerOptions) {\n    this.node = node;\n    this.keymap = {};\n    this.stopmapped = options?.stopmapped ?? false;\n    this.dontpropagate = options?.dontpropagate ? [...options.dontpropagate].map(name => name.toUpperCase()) : [];\n    this.onkeypress = options?.onkeypress;\n    this.captureunsafekeys = options?.captureunsafekeys ?? false;\n    this._listenoptions = options?.listenoptions;\n\n    Object.keys(keymap).forEach(keyname => {\n      if (debugflags.key)\n        validateKeyName(keyname);\n      this.keymap[keyname.toUpperCase()] = keymap[keyname];\n    });\n\n    this._onkeydown = (event) => this._onKeyDown(event);\n    this._onkeypress = (event) => this._onKeyPress(event);\n    node.addEventListener('keydown', this._onkeydown, this._listenoptions);\n    node.addEventListener('keypress', this._onkeypress, this._listenoptions);\n  }\n\n  destroy() {\n    this.node.removeEventListener('keydown', this._onkeydown, this._listenoptions);\n    this.node.removeEventListener('keypress', this._onkeypress, this._listenoptions);\n  }\n\n  /**\n       Returns thether the current pressed special key should be ignored for the current target node\n      Used to detect input/textarea/rte's\n   *\n      @param target - Current target node for keyboard event\n      @param key - Parsed key\n      @param keynames - Potential names for the keys (as returned by GetKeyNames)\n      @returns Whether the key must be ignored by KeyboardHandler, default browser behaviour should be triggered.\n   */\n  private _mustIgnoreKey(target: EventTarget | null, key: string, keynames: string[]) {\n    if (!(target instanceof Node))\n      return false;\n    const tag = target.nodeName.toLowerCase();\n    if (tag === \"select\") {\n      if ([\"ArrowUp\", \"ArrowDown\", \"Home\", \"End\", \"PageUp\", \"PageDown\"].indexOf(key) !== -1)\n        return true;\n    } else if (tag === \"input\" || tag === \"textarea\" || (target instanceof HTMLElement && target.isContentEditable)) {\n      // These keys we ignore, regardless of the modifier\n      if ([\n        \"ArrowLeft\", \"ArrowRight\", \"ArrowUp\", \"ArrowDown\",\n        \"PageUp\", \"PageDown\",\n        \"Home\", \"End\",\n        \"Insert\", \"Delete\", \"Backspace\"\n      ].indexOf(key) !== -1)\n        return true;\n\n      let is_special_combo = false;\n\n      // only input doesn't want exact combo 'Enter', the rest does\n      if (tag !== \"input\" && keynames.indexOf(\"Enter\") !== -1)\n        is_special_combo = true;\n\n      // Only contenteditable wants \"Shift+Enter\"\n      if (target instanceof HTMLElement && target.isContentEditable && keynames.indexOf(\"Shift+Enter\") !== -1)\n        is_special_combo = true;\n\n      // These exact combo's are wanted by all inputs\n      [\"Accel+A\", \"Accel+V\", \"Accel+C\", \"Accel+X\"].forEach(function (name) {\n        is_special_combo = is_special_combo || keynames.indexOf(name) !== -1;\n      });\n      return is_special_combo;\n    }\n    return false;\n  }\n\n  addKey(keybinding: string, handler: KeyboardMappingHandler) {\n    if (debugflags.key) {\n      validateKeyName(keybinding);\n      console.log(\"[key] KeyDown handler registered for \" + keybinding);\n    }\n    this.keymap[keybinding.toUpperCase()] = handler;\n  }\n  removeKey(keybinding: string) {\n    delete this.keymap[keybinding.toUpperCase()];\n  }\n  _onKeyDown(event: Event) { // We're a key event handler, so we know the event is a KeyboardEvent\n    const keydata = normalizeKeyboardEventData(event as KeyboardEvent);\n\n    // Get all possible names for this key\n    const keynames = getKeyNames(keydata);\n    if (!keydata.key || !keynames.length) {\n      if (debugflags.key)\n        console.log(\"[key] KeyDown handler for \", this.node, \" did not recognize key from event\", event);\n      return true;\n    }\n\n    if (debugflags.key)\n      console.log(\"[key] KeyDown handler for \", this.node, \" got key \", keydata.key, \" with target \", event.target, \" keynames:\", keynames);\n\n    /* Some keys we ignore, unless we're explicitly bound to a node, so we don't inadvertly break eg a <input> node inside\n       a listview we're handling or otherwise break a user's expectation. Set the option 'captureunsafekeys' if you explicitly\n       want to be able to capture any key */\n\n    if (!this.captureunsafekeys && this._mustIgnoreKey(event.target, keydata.key, keynames)) {\n      if (debugflags.key)\n        console.log(\"[key] KeyDown event will not be intercepted, it's an unsafe key to intercept\");\n      return true;\n    }\n\n    if (this.dontpropagate) {\n      keynames.forEach(keyname => {\n        if (this.dontpropagate.includes(keyname)) {\n          if (debugflags.key)\n            console.log(\"[key] KeyDown event will not bubbleup because of our dontpropagate option (but may still trigger a default action)\");\n          event.stopPropagation();\n        }\n      });\n    }\n\n    for (let i = 0; i < keynames.length; ++i) {\n      const mapping = this.keymap[keynames[i].toUpperCase()];\n      if (!mapping)\n        continue;\n\n      if (this.stopmapped) {\n        if (debugflags.key)\n          console.log(\"[key] KeyDown event will not bubbleup or trigger default, because we're configured to block any mapped key\");\n        event.stopPropagation();\n        event.preventDefault();\n      }\n\n      const ishandled = mapping.apply(this.node, [event as KeyboardEvent]);\n      if (ishandled && !event.defaultPrevented) {\n        console.warn(`The key handler for '${keynames[i]}' should preventDefault (or dompack.stop) the event to block fruther propagation`);\n        event.stopPropagation();\n        event.preventDefault();\n        if (debugflags.key)\n          console.log(\"[key] KeyDown event will not bubbleup or trigger default, because the keyhandler indicated the key was handled\");\n      }\n\n      if (!event.defaultPrevented && debugflags.key)\n        console.log(\"[key] KeyDown event was not blocked by its explicitly configured handler\");\n    }\n    return true;\n  }\n  _onKeyPress(event: Event) { // We're a key event handler, so we know the event is a KeyboardEvent\n    const keydata = normalizeKeyboardEventData(event as KeyboardEvent);\n\n    if (this.onkeypress) {\n      if (!this.onkeypress.apply(this.node, [event as KeyboardEvent, keydata.key])) {\n        if (!event.defaultPrevented)\n          console.warn(\"The onkeypress handler should preventDefault (or dompack.stop) the event to block fruther propagation\");\n        event.stopPropagation();\n        event.preventDefault();\n      }\n    }\n  }\n}\n\nexport function getEventKeyNames(event: KeyboardEvent) {\n  const keydata = normalizeKeyboardEventData(event);\n  return getKeyNames(keydata);\n}\n","/* Dialogapi offers an API to which dialog providers cannot connect. It does\n   not implement the dialogs themselves\n*/\n\nimport * as dompack from 'dompack';\nimport * as domfocus from 'dompack/browserfix/focus';\nimport KeyboardHandler from \"dompack/extra/keyboard\";\n\nexport type DialogOptions =\n  {\n    /**  Allow the dialog to be cancelled by clicking outside the dialog. Defaults to true if no choices are specified */\n    allowcancel?: boolean;\n    /**  Element to focus on closing the dialog */\n    focusonclose?: HTMLElement;\n    /**  An AbortSignal which if set will close the dialog and resolve it with a null response */\n    signal?: EventTarget;\n    /**  Additional class to set on the dialog */\n    messageboxclassbase?: string;\n\n    borrow?: Element | string;\n  };\ntype DialogConstructor = (options?: DialogOptions) => DialogBase;\n\nconst dialogstack: DialogBase[] = [];\nlet keyhandler: KeyboardHandler | null = null;\nlet dialogconstructor: DialogConstructor | null = null;\nlet dialogoptions: DialogOptions | null = null;\n\nfunction onEscape(event: KeyboardEvent) {\n  if (!dialogstack.length)\n    return;\n\n  dompack.stop(event);\n  if (dialogstack[dialogstack.length - 1].options.allowcancel)\n    dialogstack[dialogstack.length - 1].resolve(null);\n}\n\nfunction onTab(event: KeyboardEvent, direction: number) {\n  if (!dialogstack.length)\n    return;\n\n  dompack.stop(event);\n\n  const focusable = domfocus.getFocusableComponents(dialogstack[dialogstack.length - 1].contentnode, true);\n  const el = domfocus.getCurrentlyFocusedElement();\n  const tofocusidx = el ? focusable.indexOf(el) + direction : -1;\n  const tofocus = tofocusidx < 0 ? focusable[focusable.length - 1] : tofocusidx >= focusable.length ? focusable[0] : focusable[tofocusidx];\n  if (tofocus)\n    dompack.focus(tofocus);\n}\n\nexport class DialogBase {\n  options: DialogOptions;\n  private _borrowedfrom: Element | null = null;\n  private _borrowednext: Element | null = null;\n  contentnode: Element | null; //FIXME a successor to DialogBase should not allow these to be | null. have our child inform us through super() about the contentnode and buttonsnode so we can ensure it's set\n  buttonsnode: Element | null = null;\n  private _deferred: PromiseWithResolvers<string | null>;\n  open: boolean;\n  private _previousfocus: Element | null = null;\n\n  constructor(options?: DialogOptions) {\n    this.options = {\n      allowcancel: true,\n      ...options\n    };\n\n    if (this.options.borrow && typeof this.options.borrow === 'string') {\n      const borrow = document.querySelector(this.options.borrow);\n      if (!borrow)\n        throw new Error(\"Invalid 'borrow' selectior: \" + this.options.borrow);\n      this.options.borrow = borrow;\n    }\n    // At this point, if this.options.borrow was a string, it's been resolved to an Element\n\n    if (this.options.borrow) {\n      this._borrowedfrom = (this.options.borrow as Element).parentElement;\n      this._borrowednext = (this.options.borrow as Element).nextElementSibling;\n    }\n\n    if (this.options.signal)\n      this.options.signal.addEventListener(\"abort\", () => { this.resolve(null); });\n\n    this.contentnode = null;\n    this._deferred = Promise.withResolvers();\n    this.open = false;\n  }\n\n  async runModal() {\n    if (this.open)\n      throw new Error(\"Attempting to re-open already opened dialog\");\n\n    if (!keyhandler)\n      keyhandler = new KeyboardHandler(window, {\n        \"Escape\": (evt: KeyboardEvent) => onEscape(evt),\n        \"Tab\": (evt: KeyboardEvent) => onTab(evt, +1),\n        \"Shift+Tab\": (evt: KeyboardEvent) => onTab(evt, -1)\n      }, { captureunsafekeys: true, listenoptions: { capture: true } });\n\n    this._previousfocus = domfocus.getCurrentlyFocusedElement();\n    this._openDialog();\n\n    this.open = true;\n    dialogstack.push(this);\n\n    try {\n      this.afterShow();\n      this._checkFocus();\n      return await this._deferred.promise;\n    } finally {\n      if (this.open)\n        this.closeDialog();\n    }\n  }\n\n  _openDialog() {\n    throw new Error(\"_openDialog not overridden by dialog class\");\n  }\n\n  _checkFocus() {\n    const focusable = domfocus.getFocusableComponents(this.contentnode, true);\n    if (focusable.length !== 0)\n      dompack.focus(focusable[0]);\n    else\n      dompack.focus(document.body);\n  }\n\n  //close the dialog. this may be invoked even when inside runModal to ensure synchronous dialog cleanup\n  closeDialog() {\n    if (!this.open)\n      return;\n\n    const myoffset = dialogstack.indexOf(this);\n    if (myoffset >= 0)\n      dialogstack.splice(myoffset, 1);\n\n    this.open = false;\n    if (this.options.borrow)\n      if (this._borrowedfrom)\n        this._borrowedfrom.insertBefore(this.options.borrow as Element, this._borrowednext);\n      else\n        this._borrowednext?.remove();\n\n    if (this.options.focusonclose)\n      dompack.focus(this.options.focusonclose);\n    else if (this._previousfocus)\n      dompack.focus(this._previousfocus as HTMLElement);\n\n    if (dialogstack.length === 0 && keyhandler) {\n      keyhandler.destroy();\n      keyhandler = null;\n    }\n  }\n\n  /**\n   * resolve the dialog with the specified answer\n   *\n   * @param response - Response (or choice) to return. null if the dialog was simply cancelled\n   */\n  resolve(response: string | null) {\n    if (this.open)\n      this.closeDialog();\n    this._deferred.resolve(response);\n  }\n\n  afterShow() {\n    // supposed to be empty but extenders can override\n  }\n}\n\nexport function setupDialogs(newdialogconstructor: DialogConstructor, options?: DialogOptions) {\n  if (dialogconstructor) {\n    console.error(\"Duplicate setupDialogs call!\");\n    return;\n  }\n\n  dialogconstructor = newdialogconstructor;\n  dialogoptions = { messageboxclassbase: 'dompack-messagebox__', ...options };\n}\n\n/** Verify whether the dialog api is initialized */\nexport function isCreateDialogAvailable(): boolean {\n  return Boolean(dialogconstructor);\n}\n\n/**\n * Create a dialog\n *\n * @param options - dialog settings\n */\nexport function createDialog(options?: DialogOptions) {\n  if (!dialogconstructor)\n    throw new Error(\"Cannot create dialog, no dialog class defined\");\n\n  const dialog = dialogconstructor(options);\n  if (dialog.options.borrow)\n    dialog.contentnode?.appendChild(dialog.options.borrow as Element);\n  return dialog;\n}\n\ntype DialogChoice =\n  {\n    /** Title for the choice */\n    title: string;\n    /** Override result to return if clicked (otherwise you'll just receive the title) */\n    result?: string;\n    className?: string;\n  };\n\n\n/**\n                     @param question - if a string, will be wrapped as textContent into a <p> and presented as the question\n                    - if a html node, will appear as the question (allowing you to insert html)\n                    - if an array of nodes, all these nodes will be inserted\n    @param choices - Buttons (choices) the message box will offer, eg Ok and Cancel\n    @param options - Dialog options\n */\nexport async function runMessageBox(question: string | HTMLElement | HTMLElement[], choices: DialogChoice[], options?: DialogOptions) {\n  choices = choices || [];\n  options = { allowcancel: choices.length === 0, ...options };\n\n  const dialog = createDialog(options);\n  const choicebuttons = choices.map(choice =>\n    dompack.create(\"button\", {\n      type: \"button\",\n      className: dialogoptions ? dialogoptions.messageboxclassbase + \"button \" + (choice.className || \"\") : \"\",\n      textContent: choice.title,\n      on: { click: () => dialog.resolve(choice.result || choice.title) },\n      dataset: { messageboxResult: choice.result || choice.title }\n    }));\n\n  if (typeof question === 'string')\n    question = dompack.create(\"p\", { textContent: question });\n\n  if (Array.isArray(question))\n    dialog.contentnode?.append(...question);\n  else\n    dialog.contentnode?.append(question);\n\n  if (dialog.buttonsnode) //this dialog has a separte node for the button area\n    dialog.buttonsnode.append(...choicebuttons);\n  else\n    dialog.contentnode?.append(dompack.create(\"div\", {\n      className: dialogoptions ? dialogoptions.messageboxclassbase + \"buttongroup\" : \"\",\n      childNodes: choicebuttons\n    }));\n\n  return dialog.runModal();\n}\n","// This gets TypeScript to refer to us by our @webhare/... name in auto imports:\ndeclare module \"@webhare/upload\" {\n}\n\nimport * as dompack from \"@webhare/dompack\";\n\n/* Note: you can't really build a FileList yourself, but FileList doesn't satisfy File[] and neither the reverse works. (noone is really happy with that though)\n   So we'll just accept both types */\n\ndeclare global {\n  interface GlobalEventHandlersEventMap {\n    \"wh:requestfiles\": CustomEvent<{\n      /** Callback to invoke with the list of files to upload */\n      resolve: (files: File[]) => void;\n    } & Required<UploadRequestOptions>>;\n  }\n}\n\nexport interface UploadRequestOptions {\n  ///List of mimetypes to accept, supports wildcards (eg `image/*`)\n  accept?: string[];\n  ///Allow multiple files to be selected. By default determined by whether you use requestFiles or requestFile, but can be set to false to force requestFiles to only accept one file\n  multiple?: boolean;\n}\n\nexport interface UploadProgressStatus {\n  uploadedBytes: number;\n  totalBytes: number;\n  uploadedFiles: number;\n  totalFiles: number;\n  //Upload speed in bytes/sec.\n  uploadSpeed: number;\n}\n\nexport interface UploadOptions {\n  onProgress?: (progress: UploadProgressStatus) => void;\n  signal?: AbortSignal;\n}\n\nexport interface UploadResult {\n  name: string;\n  size: number;\n  type: string;\n  token: string;\n}\n\nexport interface UploadManifest {\n  files: Array<{\n    name: string;\n    size: number;\n    type: string;\n  }>;\n}\n\nexport interface UploadInstructions {\n  baseUrl: string;\n  sessionId: string;\n  chunkSize: number;\n  signal?: AbortSignal;\n}\n\nexport type ResourceDescriptorCompatible = {\n  resource: Blob;\n  mediaType: string;\n  fileName: string | null;\n};\n\nexport interface UploaderBase {\n  readonly manifest: UploadManifest;\n  upload(instructions: UploadInstructions, options?: UploadOptions): Promise<UploadResult | UploadResult[]>;\n}\n\nfunction isRealBlob(data: Blob) { return data instanceof Blob; }\nasync function convertToRealBlob(data: Blob): Promise<Blob> { return new Blob([await data.arrayBuffer()]); }\n\nexport class MultiFileUploader implements UploaderBase {\n  readonly #files: Array<{ name: string; size: number; type: string; data: Blob }>;\n  readonly manifest: UploadManifest;\n\n  constructor(files: Array<File | Blob | ResourceDescriptorCompatible>, signal?: AbortSignal) {\n    if (!files.length)\n      throw new Error(\"No files to upload\");\n\n    this.#files = files.map(item => (\n      \"resource\" in item ? {\n        name: item.fileName ?? \"upload\",\n        size: item.resource.size,\n        type: item.mediaType || \"application/octet-stream\",\n        data: item.resource,\n      } : {\n        name: \"name\" in item ? item.name : \"upload\",\n        size: item.size,\n        type: item.type || \"application/octet-stream\",\n        data: item\n      }));\n    this.manifest = {\n      files: this.#files.map(file => ({ name: file.name, size: file.size, type: file.type }))\n    };\n  }\n\n  async upload(instructions: UploadInstructions, options?: UploadOptions): Promise<UploadResult[]> {\n    const outfiles: UploadResult[] = [];\n    let uploadedBytes = 0, uploadedFiles = 0;\n    const totalBytes = this.#files.reduce((acc, file) => acc + file.size, 0);\n    const totalFiles = this.#files.length;\n    const start = Date.now();\n\n    function fireProgressEvent(partialbytes: number) {\n      const curUploaded = uploadedBytes + partialbytes;\n      const timeElapsed = Date.now() - start;\n      options?.onProgress?.({ uploadedBytes: curUploaded, totalBytes, uploadedFiles, totalFiles, uploadSpeed: timeElapsed ? curUploaded / (timeElapsed / 1000) : 0 });\n    }\n\n    fireProgressEvent(0);\n\n    for (const [idx, file] of this.#files.entries()) {\n      for (let offset = 0; offset < file.size; offset += instructions.chunkSize) {\n        let data = file.data.slice(offset, offset + instructions.chunkSize);\n        // Data needs to be a real Blob for XMLHttpRequest to work\n        if (!isRealBlob(data))\n          data = await convertToRealBlob(data);\n        const uploadurl = `${instructions.baseUrl}&offset=${offset}&file=${idx}`;\n\n\n        /* we can't use fetch as we can't do progress tracking there!\n           there's https://stackoverflow.com/questions/35711724/upload-progress-indicators-for-fetch but it requires duplex: half which requires QUIC/H2\n\n           https://fetch.spec.whatwg.org/#fetch-api says\n           The fetch() method is relatively low-level API for fetching resources. It covers slightly more ground than XMLHttpRequest, although it is currently lacking when it comes to request progression (not response progression).\n\n        let bytesUploaded = 0;\n        const progressTrackingStream = new TransformStream<Uint8Array, Uint8Array>({\n          transform(chunk: Uint8Array, controller: TransformStreamDefaultController<Uint8Array>) {\n            controller.enqueue(chunk);\n            bytesUploaded += chunk.byteLength;\n            console.log(\"upload progress:\", bytesUploaded / data.size);\n            // uploadProgress.value = bytesUploaded / totalBytes;\n          },\n          flush(controller: TransformStreamDefaultController<Uint8Array>) {\n            console.log(\"completed stream\");\n          },\n        });\n           */\n        if (options?.signal?.aborted)\n          throw new Error(\"Upload has been aborted\");\n\n        if (globalThis.XMLHttpRequest) { //let's hope by the time browsers drop XMLHttpRequest, fetch finally has proper progress\n          const defer = Promise.withResolvers<void>();\n          const xmlhttp = new globalThis.XMLHttpRequest;\n          xmlhttp.overrideMimeType(\"application/octet-stream\");\n          xmlhttp.upload.addEventListener('progress', ev => fireProgressEvent(ev.loaded));\n          xmlhttp.addEventListener('abort', (ev: ProgressEvent<XMLHttpRequestEventTarget>) => defer.reject(new Error(\"Upload has been aborted\")));\n          xmlhttp.addEventListener('error', (ev: ProgressEvent<XMLHttpRequestEventTarget>) => defer.reject(new Error(\"Error\")));\n          xmlhttp.addEventListener('load', () => defer.resolve()); //invoked on success\n          xmlhttp.addEventListener('loadend', (ev: ProgressEvent<XMLHttpRequestEventTarget>) => { //invoked after either abort/error/load\n          });\n          xmlhttp.open(\"POST\", uploadurl, true);\n          xmlhttp.send(data);\n\n          const doAbort = () => xmlhttp.abort();\n          options?.signal?.addEventListener(\"abort\", doAbort);\n          await defer.promise;\n          options?.signal?.removeEventListener(\"abort\", doAbort);\n        } else { //fallback to fetch(). needed on Node, but it'll break progress reporting\n          const uploadresult = await fetch(uploadurl, {\n            method: \"POST\",\n            headers: { \"Content-Type\": \"application/octet-stream\" },\n            body: data // At some point... .stream().pipeThrough(progressTrackingStream) - but see above why it won't work yet\n          });\n\n          if (!uploadresult.ok)\n            throw new Error(`Upload failed`);\n        }\n\n        uploadedBytes += data.size;\n      }\n\n      outfiles.push({ ...this.manifest.files[idx], token: instructions.sessionId + '#' + idx });\n      ++uploadedFiles;\n      fireProgressEvent(0);\n    }\n\n    return outfiles;\n  }\n}\n\nexport class SingleFileUploader implements UploaderBase {\n  uploader;\n\n  get manifest() {\n    return this.uploader.manifest;\n  }\n\n  constructor(file: File | Blob | ResourceDescriptorCompatible) {\n    this.uploader = new MultiFileUploader([file]);\n  }\n\n  async upload(instructions: UploadInstructions, options?: UploadOptions): Promise<UploadResult> {\n    return (await this.uploader.upload(instructions, options))[0];\n  }\n}\n\nasync function getFilelistFromUser(multiple: boolean, accept: string[]): Promise<File[]> {\n  const defer = Promise.withResolvers<File[]>();\n  if (dompack.dispatchCustomEvent(window, \"wh:requestfiles\", { bubbles: true, cancelable: true, detail: { resolve: defer.resolve, multiple, accept } })) {\n    const input = document.createElement('input');\n    input.type = \"file\";\n    input.multiple = multiple;\n\n    if (accept.length)\n      input.accept = accept.join(\",\");\n    input.addEventListener(\"change\", () => defer.resolve([...input.files || []]));\n    input.addEventListener(\"cancel\", () => defer.resolve([]));\n    input.showPicker();\n  }\n\n  const list = await defer.promise;\n  if (!multiple && list.length > 1)\n    throw new Error(`wh:requestfiles intercepter selected multiple files, but only one was requested`);\n  return list;\n}\n\nexport async function requestFiles(options?: UploadRequestOptions): Promise<File[] | null> {\n  const files = await getFilelistFromUser(!(options?.multiple === false), options?.accept || []);\n  if (!files.length)\n    return null;\n\n  return files;\n}\n\n// We're adding a separate interface for single-file uploads as it's quite annoying to have to deal with interfaces generalized for multiple files if you really, really know you only ever wanted one file anyway\nexport async function requestFile(options?: UploadRequestOptions): Promise<File | null> {\n  const files = await getFilelistFromUser(false, options?.accept || []);\n  if (files.length !== 1)\n    return null;\n\n  return files[0];\n}\n\n/** Convert a file to a data: URL\n * @param file - The file to convert\n * @returns A promise that resolves to the data: URL\n*/\nexport function getFileAsDataURL(file: File): Promise<string> {\n  return new Promise((resolve, reject) => {\n    const reader = new FileReader;\n    // MDN: When the read operation is finished… the loadend event is triggered.\n    reader.addEventListener(\"loadend\", () => {\n      //At that time, the result attribute contains the data as a data: URL representing the file's data as a base64 encoded string.\n      resolve(reader.result as string);\n    });\n    reader.addEventListener(\"error\", () => reject(new Error(\"Failed to load file\")));\n    reader.readAsDataURL(file);\n  });\n}\n","// Auto-generated language file from /opt/wh/whtree/modules/publisher/js/captcha/__captcha.lang.json\nvar registerTexts = require(\"@webhare/gettid/src/internal\").registerTexts;\nregisterTexts(\"publisher\",\"en\",{\"site\":{\"captcha\":{\"explain\":\"Please check the box below\",\"title\":\"Verification\"}}});\nregisterTexts(\"publisher\",\"nl\",{\"site\":{\"captcha\":{\"explain\":\"Vink het vakje hieronder aan\",\"title\":\"Verificatie\"}}});\n// Adding dependency: /opt/wh/whtree/modules/publisher/language/default.xml\n// Adding dependency: /opt/wh/whtree/modules/publisher/language/nl.xml\n","import { getTid } from \"@webhare/gettid\";\nimport \"./__captcha.lang.json\";\n\nexport interface CaptchaProvider {\n  name: string;\n  apikey: string;\n}\n\nexport interface CaptchaSettings {\n  title: string;\n  onResponse: (response: string) => void;\n}\n\nexport interface CaptchaProviderRegistration {\n  initialize: (provider: CaptchaProvider, injectInto: HTMLElement, settings: CaptchaSettings) => Promise<void>;\n}\n\nexport const captcharegistry: Record<string, CaptchaProviderRegistration> = {};\n\n\nexport async function initializeCaptcha(provider: CaptchaProvider, injectInto: HTMLElement, settings?: Partial<CaptchaSettings>): Promise<void> {\n  if (!captcharegistry[provider.name])\n    throw new Error(`Captcha provider '${provider.name}' not registered`);\n  if (!settings?.onResponse)\n    throw new Error(\"onResponse callback is required\");\n\n  const finalsettings: CaptchaSettings = {\n    title: settings?.title ?? getTid(\"publisher:site.captcha.title\"),\n    onResponse: settings?.onResponse ?? (() => { }),\n  };\n\n  await captcharegistry[provider.name].initialize(provider, injectInto, finalsettings);\n}\n","import * as dompack from '@webhare/dompack';\nimport { initializeCaptcha, type CaptchaProvider } from \"@mod-publisher/js/captcha/api\";\nimport { setFieldError, type SetFieldErrorData } from '../internal/customvalidation';\n\nimport \"../../captcha/__captcha.lang.json\"; //TODO or have forms send this tid (so it can also be overridden there)\nimport { JSFormElement } from '@webhare/forms';\nimport { getTid } from '@webhare/gettid';\nimport type RPCFormBase from '../rpc';\n\ndeclare global {\n  interface HTMLElementTagNameMap {\n    \"wh-captcha\": CaptchaField;\n  }\n}\n\nexport default class CaptchaField extends JSFormElement<string> {\n  value = '';\n  provider: CaptchaProvider | null = null;\n\n  constructor() {\n    super();\n    this.addEventListener('wh:form-setfielderror', evt => void this._setFieldError(evt));\n    this.whFormsApiChecker = () => this.check();\n\n    const form = this.closest('form');\n    if (form)\n      form.addEventListener('reset', () => this.onReset());\n  }\n\n  check(): void {\n    if (!this.value)\n      setFieldError(this, getTid(\"publisher:site.forms.commonerrors.required\"), { reportimmediately: false });\n    else\n      setFieldError(this, \"\", { reportimmediately: false });\n  }\n\n  setup(provider: CaptchaProvider) {\n    if (this.provider)\n      throw new Error(\"CaptchaField is already setup\");\n\n    this.provider = provider;\n    this.initialize();\n  }\n\n  private initialize() {\n    this.value = '';\n    this.replaceChildren();\n    void initializeCaptcha(this.provider!, this, {\n      onResponse: (result: string) => { this.value = result; }\n    });\n  }\n\n  private onReset() {\n    void this.initialize();\n  }\n\n  async _setFieldError(evt: CustomEvent<SetFieldErrorData>) {\n    dompack.stop(evt);\n    if (!evt.detail.error) //error cleared\n      return;\n\n    if (this.value) { //we were already sending a response!\n      console.log(\"Captcha response was rejected, resetting\");\n      this.onReset(); //better restart the control, timeout or duplicate submission\n    }\n  }\n}\n\nexport function setupCaptchaFieldGroup(form: RPCFormBase<object>, provider: CaptchaProvider): CaptchaField {\n  /* Setup a page-less holder for the captcha field\n\n    <div class=\"wh-form__page wh-form__page--visible\">\n      <div class=\"wh-form__fieldgroup\" data-wh-form-group-for=\"__form_captcha\">\n        ...\n    */\n\n  const captchaControl = dompack.create(\"wh-captcha\", { class: \"wh-form__captcha\", dataset: { whFormName: \"__form_captcha\", whFormRequired: \"true\" } });\n\n  const virtualCaptchaPage = dompack.create(\"div\", { class: \"wh-form__captchapage\" }, [\n    dompack.create(\"div\", { class: \"wh-form__fieldgroup\", dataset: { whFormGroupFor: \"__form_captcha\" } }, [\n      dompack.create(\"label\", { class: \"wh-form__label\" }, [getTid(\"publisher:site.captcha.title\")]),\n      dompack.create(\"div\", { class: \"wh-form__fields\" },\n        [dompack.create(\"div\", { class: \"wh-form__fieldline\" }, [captchaControl])]\n      )\n    ])\n  ]);\n\n  //Position it before the navbuttons, but if they are missing for whatever reason, just add to the end of the form\n  const buttonarea = dompack.qS(form.node, \".wh-form__navbuttons\");\n  if (buttonarea)\n    buttonarea.before(virtualCaptchaPage);\n  else\n    form.node.appendChild(virtualCaptchaPage);\n\n  void captchaControl.setup(provider);\n\n  return captchaControl;\n}\n\n\ncustomElements.define(\"wh-captcha\", CaptchaField);\n","import FormBase from '@mod-publisher/js/forms/rpc';\nimport type { FormConfiguration, FormHandlerFactory } from \"@webhare/forms\";\nimport { dispatchCustomEvent, flagUIBusy, qSA, register } from \"@webhare/dompack\";\nimport { emplace, sleep } from \"@webhare/std\";\nimport { downgradeUploadFields } from \"./domsupport\";\n\nlet formConfiguration: FormConfiguration | undefined;\nlet handlers: Map<string, FormHandlerFactory | PromiseWithResolvers<FormHandlerFactory>> | undefined;\nlet configuredRegistrations: true | undefined;\nconst firstWarningMs = 150, warningIntervalMs = 5000;\n\nasync function scheduleFormSetup(form: HTMLFormElement, factory: FormHandlerFactory) {\n  using lock = flagUIBusy();\n  void (lock);\n\n  //Ensure any custom elements in the form are actually registered or our communication with these elements may fail\n  const customEls = [...new Set(qSA(form, \"[name]\").map(_ => _.tagName.toLowerCase()))].filter(_ => _.includes(\"-\"));\n  if (customEls.length) {\n    const initPromise = Promise.all(customEls.map(_ => customElements.whenDefined(_))).then(() => ({ timeout: false }));\n\n    let nextWarning = Date.now() + firstWarningMs;\n    for (; ;) {\n      const timeoutPromise = sleep(new Date(nextWarning)).then(() => ({ timeout: true }));\n      const result = await Promise.race([initPromise, timeoutPromise]);\n      if (!result.timeout)\n        break;\n\n      const missing = customEls.filter(tag => !customElements.get(tag)).join(\", \");\n      if (missing === 'wh-fileedit') {\n        console.warn(`Developers: we recommend explicitly registering a component for \".wh-form__upload\"`);\n        downgradeUploadFields(form);\n        break;\n      }\n      console.warn(`Still waiting for the following custom elements to be defined in form ${form.id ?? form.dataset.whFormId}:`, missing);\n      nextWarning = Date.now() + warningIntervalMs;\n    }\n  }\n  factory(form);\n}\n\nexport function configureForms(setup: FormConfiguration) {\n  if (!Object.keys(setup).length)\n    return;\n\n  formConfiguration = { ...formConfiguration, ...setup };\n  dispatchCustomEvent(window, \"wh:form-configure\", { bubbles: true, cancelable: false, detail: formConfiguration });\n}\n\nexport function registerHandlers(addHandlers: Record<string, FormHandlerFactory>) {\n  if (!handlers) { //register initial handlers (now that form support is activated)\n    //we want to stop distinguishing between these, not worth the effort/complexity seperating  them\n    const defaultHandler = (form: HTMLFormElement) => new FormBase(form);\n    addHandlers = {\n      \"publisher:form\": defaultHandler,\n      \"publisher:rpc\": defaultHandler,\n      ...addHandlers\n    };\n    handlers = new Map;\n  }\n\n  //Configure the handlers. If there's a resolvable promise waiting for us, resolve it, otherwise directly insert the handler\n  for (const [handlername, handler] of Object.entries(addHandlers))\n    emplace(handlers, handlername, {\n      insert: () => handler,\n      update: current => {\n        if (\"promise\" in current) {\n          current.resolve(handler);\n          return current;\n        } else\n          throw new Error(`Handler '${handlername}' is already registered`);\n      }\n    });\n\n  //Set up a registration for form elements, but ensure they only go through one scheduleFormSetup ever\n  if (!configuredRegistrations) { //register for forms that have yet to appear\n    register<HTMLFormElement>(\"form[data-wh-form-handler]\", form => {\n      //Get the current handler or set up a promise that will receive the handler\n      const handler = emplace(handlers!, form.dataset.whFormHandler!, { insert: () => Promise.withResolvers<FormHandlerFactory>() });\n      if (\"promise\" in handler)\n        void handler.promise.then(factory => scheduleFormSetup(form, factory));\n      else\n        void scheduleFormSetup(form, handler);\n\n    });\n    configuredRegistrations = true;\n  }\n}\n\nexport function registerHandler(handlername: string, handler: FormHandlerFactory) {\n  registerHandlers({ [handlername]: handler });\n}\n\nexport function getFormConfiguration(): FormConfiguration | undefined {\n  return formConfiguration;\n}\n","/* eslint-disable @typescript-eslint/no-floating-promises -- FIXME: needs API rework */\n\nimport * as dompack from '@webhare/dompack';\nimport * as focus from 'dompack/browserfix/focus';\nimport * as merge from './internal/merge';\nimport FormBase, { type FormResultValue, type FormSubmitEmbeddedResult, type FormSubmitMessage, type FormSubmitResult } from './formbase';\nimport { getFormService, getTSFormService, type PublisherFormService } from \"@webhare/forms/src/formservice\";\nimport * as emailvalidation from './internal/emailvalidation';\nimport { runMessageBox } from 'dompack/api/dialog';\nimport { debugFlags, isLive, navigateTo, type NavigateInstruction } from \"@webhare/env\";\nimport { isBlob, pick } from '@webhare/std';\nimport { setFieldError } from './internal/customvalidation';\nimport type { RPCFormTarget, RPCFormInvokeBase, RPCFormSubmission } from '@webhare/forms/src/types';\nimport { SingleFileUploader, type UploadResult } from '@webhare/upload';\nimport { createClient } from '@webhare/jsonrpc-client';\nimport { setupCaptchaFieldGroup } from './fields/captchafield';\nimport { getFormConfiguration } from '@webhare/forms/src/registration';\nimport type { CaptchaProvider } from '../captcha/api';\n\nfunction unpackObject(formvalue: FormResultValue): RPCFormInvokeBase[\"vals\"] {\n  return Object.entries(formvalue).map(_ => ({ name: _[0], value: _[1] }));\n}\n\nexport interface FormSubmitDetails<DataShape extends object = Record<string, unknown>> {\n  form: HTMLElement;\n  rpchandler: RPCFormBase<DataShape>;\n  extrasubmitdata?: unknown;\n  submitted: FormResultValue;\n  result: unknown;\n  errors: FormSubmitMessage[];\n}\n\ntype UploadCache = WeakMap<Blob, UploadResult>;\n\nfunction buildTarget(target: string): RPCFormTarget {\n  return { target, url: location.href.split('/').slice(3).join('/') };\n}\n\nclass FormSubmitter {\n  private readonly target;\n  private readonly cache: UploadCache;\n  private readonly offline: boolean;\n\n  constructor(target: string, cache: UploadCache | null, offline: boolean) {\n    this.target = buildTarget(target);\n    this.cache = cache || new WeakMap();\n    this.offline = offline;\n  }\n\n  private async uploadFile(file: Blob) {\n    if (this.offline)\n      throw new Error(\"Cannot upload files in offline mode\"); //TODO convert to dataurl and test it\n\n    //TODO what if the server discarded the token? we should negotiate with the server which files it (still) wants\n    const completed = this.cache.get(file);\n    if (completed)\n      return completed;\n\n    const uploader = new SingleFileUploader(file);\n    //Ask the server if it's okay to upload these files\n    const uploadinstructions = await getTSFormService().requestUpload(this.target, uploader.manifest);\n    //Run the actual upload. Options: onProgress, signal\n    const uploadedfile: UploadResult = await uploader.upload(uploadinstructions);\n    this.cache.set(file, uploadedfile);\n    return uploadedfile;\n  }\n\n  private async convertSubmittable(formvalue: unknown): Promise<unknown> {\n    //TODO combine multiple uploads into one\n    if (Array.isArray(formvalue))\n      return await Promise.all(formvalue.map(file => this.getSubmittable(file)));\n\n    if (formvalue && typeof formvalue === 'object') {\n      if (isBlob(formvalue))\n        return await this.uploadFile(formvalue as Blob);\n\n      const result: Record<string, unknown> = {};\n      for (const [key, value] of Object.entries(formvalue)) {\n        result[key] = await this.getSubmittable(value);\n        //console.log(key, value, result[key]);\n      }\n      return result;\n    }\n    return formvalue;\n  }\n\n  async getSubmittable(formvalue: object): Promise<FormResultValue> {\n    return await this.convertSubmittable(formvalue) as FormResultValue;\n  }\n}\n\n/** Directly submit a RPC form to WebHare\n *  @param target - Formtarget as obtained from\n * @deprecated Switch to \\@webhare/forms submitForm and buildFormSubmission\n */\nexport async function submitForm(target: string, formvalue: FormResultValue, options?: { extrasubmit: unknown }): Promise<FormSubmitResult> {\n  const submitparameters = await buildRPCFormSubmission(target, formvalue, { extraSubmit: options?.extrasubmit || null, });\n  return await submitRPCForm(submitparameters);\n}\n\n/** Return a value safe for RPC submission or typed serialization */\nexport async function buildRPCFormSubmission<DataShape extends object = Record<string, unknown>>(target: string, formValue: DataShape, options?:\n  {\n    extraSubmit?: unknown;\n    offline?: boolean;\n    uploadCache?: WeakMap<Blob, UploadResult>;\n    __setupEvent?: FormSubmitDetails<DataShape>;\n  }): Promise<RPCFormSubmission> {\n  const submitter = new FormSubmitter(target, options?.uploadCache || null, options?.offline || false);\n\n  const vals = await submitter.getSubmittable(formValue);\n\n  if (options?.__setupEvent) {\n    const eventdetail = options.__setupEvent;\n    eventdetail.extrasubmitdata = options.extraSubmit || null;\n    eventdetail.submitted = vals;\n  }\n\n  const submitparameters: RPCFormSubmission = {\n    ...buildTarget(target),\n    vals: unpackObject(vals),\n    extrasubmit: options?.extraSubmit || null\n  };\n  return submitparameters;\n}\n\nexport async function submitRPCForm(submission: RPCFormSubmission): Promise<FormSubmitResult> {\n  // TODO switch over to typed rpc, allow rpc options that make sense to be specified as options to submitRPCForm\n  const client = createClient<PublisherFormService>(\"publisher:forms\");\n  return await client.formSubmit(submission);\n}\n\nexport default class RPCFormBase<DataShape extends object = Record<string, unknown>> extends FormBase<DataShape> {\n  __formhandler = {\n    errors: [],\n    warnings: [],\n    formid: \"\",\n    url: \"\",\n    target: \"\",\n    submitting: false\n  };\n\n  #hadFocus = false;\n  #completedUploads = new WeakMap<Blob, UploadResult>;\n  #settingUpCaptcha = false;\n\n  pendingrpcs = new Array<Promise<unknown>>;\n\n  constructor(formnode: HTMLFormElement) {\n    super(formnode);\n    this.__formhandler.formid = formnode.dataset.whFormId || ''; //needed for 'old' __formwidget: stuff\n    this.__formhandler.url = location.href.split('/').slice(3).join('/');\n    this.__formhandler.target = formnode.dataset.whFormTarget || '';\n    window.addEventListener(\"wh:form-configure\", () => this.checkCaptcha());\n    this.node.addEventListener(\"focusin\", this.#onFirstFocus, true);\n\n    if (!this.__formhandler.target) {\n      if (this.__formhandler.formid) {\n        console.error(\"This page needs to be republished!\");\n      } else {\n        if (!isLive)\n          console.error(\"Missing data-wh-form-target on form, did your witty apply '[form.formattributes]' to the <form> tag ?\", formnode);\n        throw new Error(\"Form does not appear to be a WebHare form\");\n      }\n    }\n\n    this.checkCaptcha();\n  }\n\n  getRPCFormIdentifier(): RPCFormTarget { //submitinfo as required by some RPCs\n    return buildTarget(this.__formhandler.target);\n  }\n\n  async #getSubmitVals(): Promise<FormResultValue> {\n    const formvalue = await this.getFormValue();\n    const submitter = new FormSubmitter(this.__formhandler.target, this.#completedUploads, false);\n    return await submitter.getSubmittable(formvalue);\n  }\n\n  //Invoke a function on the form on the server\n  async _invokeRPC(background: boolean, methodname: string, args: unknown[]) {\n    const waiter = Promise.withResolvers<void>();\n\n    if (!background)\n      this.onRPC(waiter.promise);\n\n    const lock = dompack.flagUIBusy({ modal: !background });\n    try {\n      const rpc = getFormService().formInvoke({\n        ...this.getRPCFormIdentifier(),\n        vals: unpackObject(await this.#getSubmitVals()),\n        methodname,\n        args\n      });\n      this.pendingrpcs.push(rpc);\n      const result = await rpc;\n      this._processMessages(result.messages);\n      return result.result;\n    } finally {\n      lock.release();\n      waiter.resolve();\n    }\n  }\n\n  /* Override this to implement support for incoming field messages */\n  processFieldMessage(field: string, prop: string, value: unknown) {\n    if (field === \"#form\") {\n      if (prop === \"dataset\") {\n        for (const [key, keyValue] of Object.entries(value || {})) {\n          this.node.setAttribute(`data-${key}`, String(keyValue));\n        }\n        return;\n      }\n      console.warn(\"Message for non-existing form field: %s, prop: %s, value: %s\", field, prop, String(value));\n      return;\n    }\n    if (field.startsWith(\"#page.\")) {\n      const matchpage = field === \"#page.thankyou\" ? this.node.querySelector<HTMLElement>(`.wh-form__page[data-wh-form-pagerole=thankyou]`) : null;\n      if (!matchpage) { //we currently don't have anything to edit on other pages than thankyou\n        console.warn(\"Message for non-page field: %s, prop: %s, value: %s\", field, prop, String(value));\n        return;\n      }\n\n      if (prop === 'data') {\n        const dataval = value as { redirect: NavigateInstruction | null; exitbutton: string };\n        matchpage.dataset.whFormNavigateTo = dataval.redirect ? JSON.stringify(dataval.redirect) : undefined;\n        matchpage.dataset.whFormExitButton = dataval.exitbutton;\n      }\n    } else {\n      const fieldnode = this.node.querySelector<HTMLElement>(`*[name=\"${CSS.escape(field)}\"], *[data-wh-form-name=\"${CSS.escape(field)}\"]`);\n      if (!fieldnode) {\n        console.warn(\"Message for non-existent field: %s, prop: %s, value: %s\", field, prop, String(value));\n        return;\n      }\n      if (prop === 'value') {\n        this.setFieldValue(fieldnode, value);\n        return;\n      } else if (prop === 'richvalue') {\n        if (!fieldnode.classList.contains(\"wh-form__richtext\"))\n          console.warn(\"Message for non-richtext field: %s, prop: %s, value: %s\", field, prop, String(value));\n        else {\n          fieldnode.innerHTML = value as string;\n          dompack.registerMissed(fieldnode);\n        }\n        return;\n      }\n    }\n    console.warn(\"Unknown field message: field: %s, prop: %s, value: %s\", field, prop, String(value));\n  }\n\n  //Override this function to easily submit extra fields\n  getFormExtraSubmitData(): object | Promise<object> {\n    return {};\n  }\n\n  //Invoked when RPC is occuring. Is passed a promise that will resolve on completion\n  //onRPC is DEPRECATED, switching to event based api\n  onRPC(promise: Promise<void>) {\n  }\n\n  /** Invoke a function on the form on the server\n      @param methodname - Name of the function on the form\n      @param args - Arguments for the function\n      @returns Promise that resolves to the result of the rpc call\n  */\n  invokeRPC(methodname: string, ...args: unknown[]) {\n    return this._invokeRPC(false, methodname, args);\n  }\n\n  /** Invoke a function on the form on the server, doesn't call .onRPC or request modality layers\n      @param methodname - Name of the function on the form\n      @param args - Arguments for the function\n      @returns Promise that resolves to the result of the rpc call\n  */\n  invokeBackgroundRPC(methodname: string, ...args: unknown[]) {\n    return this._invokeRPC(true, methodname, args);\n  }\n\n  _processMessages(messages: Array<{ field: string; prop: string; data: unknown }>) {\n    for (const msg of messages) {\n      this.processFieldMessage(msg.field, msg.prop, msg.data);\n    }\n    this.refreshConditions();\n  }\n\n  async _flushPendingRPCs() {\n    while (this.pendingrpcs.length) {\n      try {\n        await this.pendingrpcs.pop();\n      } catch (ignore) {\n        //*we* can't handle those...\n      }\n    }\n  }\n\n  async buildFormSubmission(extradata?: object, options?: { __setupEvent?: FormSubmitDetails<DataShape> }): Promise<RPCFormSubmission> {\n    //Request extrasubmit first, so that if it returns a promise, it can execute in parallel with getFormValue\n    const extraSubmitAwaitable = this.getFormExtraSubmitData();\n    //FIXME we want getFormValue to be sync (and just use 'this.data' here) - who is still sending promises our way? too much to sort out for a backport\n    const formvalue = await this.getFormValue() as DataShape;\n    const extraSubmit = { ...extradata, ...(await extraSubmitAwaitable as Record<string, unknown>) };\n\n    await this._flushPendingRPCs();\n    dompack.dispatchCustomEvent(this.node, \"wh:form-preparesubmit\", {\n      bubbles: true, cancelable: false, detail: {\n        extrasubmit: extraSubmit\n      }\n    });\n\n    const submitparameters = await buildRPCFormSubmission<DataShape>(this.__formhandler.target, formvalue, {\n      extraSubmit,\n      offline: false,\n      uploadCache: this.#completedUploads,\n      //hack because we need to record the 'vars' value before unpackObject flattens it for safe HareScript RPC\n      __setupEvent: options?.__setupEvent\n    });\n\n    return submitparameters;\n  }\n\n  #onFirstFocus = () => {\n    this.#hadFocus = true;\n    this.checkCaptcha();\n  };\n\n  private checkCaptcha() {\n    //Checks whether to show captcha based on configuration. Note that even if *we* think it's not needed, form submission may still require a captcha\n    const config = getFormConfiguration();\n    const shouldShow = config?.captcha === \"onLoad\" || (config?.captcha === \"onActivate\" && this.#hadFocus);\n    if (shouldShow && this.node.dataset.whFormCaptcha !== undefined && !this.#settingUpCaptcha && !this.getElementByName(\"__form_captcha\")) {\n      this.#settingUpCaptcha = true;\n      void getFormService().getCaptchaConfiguration(this.getRPCFormIdentifier()).then(captchaConfig => {\n        if (captchaConfig) {\n          setupCaptchaFieldGroup(this, captchaConfig);\n        }\n      });\n    }\n  }\n\n  async submitForm(parameters: RPCFormSubmission): Promise<FormSubmitResult> {\n    return await submitRPCForm(parameters);\n  }\n\n  async submit(extradata?: object): Promise<{ result?: FormSubmitEmbeddedResult }> {\n    //ADDME timeout and free the form after some time\n    if (this.__formhandler.submitting) //throwing is the safest solution... having the caller register a second resolve is too dangerous\n      throw new Error(\"The form is already being submitted\");\n\n    const waiter = Promise.withResolvers<void>();\n    let insubmitrpc = false;\n    this.onRPC(waiter.promise);\n\n    const eventdetail: FormSubmitDetails<DataShape> = {\n      form: this.node,\n      rpchandler: this,\n      submitted: {},\n      errors: [],\n      result: null\n    };\n\n    try {\n      this.__formhandler.submitting = true;\n\n      const submitparameters = await this.buildFormSubmission(extradata, { __setupEvent: eventdetail });\n\n      if (debugFlags.fhv)\n        console.log('[fhv] start submission', submitparameters);\n\n      insubmitrpc = true; //so we can easily determine exception source\n      const result = await this.submitForm(submitparameters);\n      insubmitrpc = false;\n\n      if (debugFlags.fhv)\n        console.log('[fhv] received response', result);\n\n      this._processMessages(result.messages);\n\n      if (!dompack.dispatchCustomEvent(this.node, \"wh:form-response\", { bubbles: true, cancelable: true, detail: result }))\n        return result;\n\n      eventdetail.result = result.result;\n      eventdetail.errors = result.errors;\n\n      let didfirstfocus = false;\n      const globalerrors = [];\n      for (const error of result.errors) {\n        if (!error.name) {\n          globalerrors.push(error);\n          continue;\n        }\n\n        let failednode = this.node.querySelector('[name=\"' + error.name + '\"], [data-wh-form-name=\"' + error.name + '\"]');\n        if (!failednode) {\n          if (error.name === \"__form_captcha\") { //created on demand\n            const serverMetadata = error.metadata as { provider: CaptchaProvider };\n            failednode = setupCaptchaFieldGroup(this, serverMetadata.provider);\n          } else {\n            console.error(\"[fhv] Unable to find node '\" + error.name + \"' which caused error:\" + error.message);\n            continue;\n          }\n        }\n        if (!didfirstfocus) {\n          dompack.focus(failednode);\n          didfirstfocus = true;\n        }\n        setFieldError(failednode, error.message, { reportimmediately: true, serverside: true, metadata: error.metadata });\n      }\n\n      if (result.success) {\n        this.sendFormEvent({ event: 'submitted' });\n        if (dompack.dispatchCustomEvent(this.node, \"wh:form-submitted\", { bubbles: true, cancelable: true, detail: eventdetail as FormSubmitDetails<Record<string, unknown>> })) {\n          merge.run(this.node, { form: await this.getFormValue() });\n\n          //FIXME why is going to 'thank you' not in the formbase?\n          this._navigateToThankYou(result.result && result.result.richvalues);\n          this.onSubmitSuccess(result.result);\n        }\n      } else {\n        const failedfields = result.errors.map(error => error.name || \"*\").sort().join(\" \");\n        this.sendFormEvent({ event: 'failed', errorfields: failedfields, errorsource: 'server' });\n\n        if (globalerrors.length) {\n          if (dompack.dispatchCustomEvent(this.node, \"wh:form-globalerrors\", { bubbles: true, cancelable: true, detail: { globalerrors } }))\n            this.displayGlobalErrors(globalerrors);\n        }\n\n        if (dompack.dispatchCustomEvent(this.node, \"wh:form-failed\", { bubbles: true, cancelable: true, detail: eventdetail }))\n          this.onSubmitFailed(result.errors, result.result);\n      }\n      return pick(result, [\"result\"]);\n    } catch (e) {\n      this.sendFormEvent({ event: 'exception', exception: String(e), errorsource: insubmitrpc ? 'server' : 'client' });\n\n      if (dompack.dispatchCustomEvent(this.node, \"wh:form-exception\", { bubbles: true, cancelable: true, detail: eventdetail }))\n        this.onSubmitException(e as Error);\n\n      throw e;\n    } finally {\n      waiter.resolve();\n      this.__formhandler.submitting = false;\n    }\n  }\n\n  displayGlobalErrors(globalerrors: FormSubmitMessage[]) {\n    try {\n      const errors = globalerrors.map(error => dompack.create(\"p\", { textContent: error.message }));\n      runMessageBox(errors, [{ title: \"OK\" }]); //TODO: language?\n    } catch (e) {\n      console.error(\"runMessageBox failed\", e);\n      // eslint-disable-next-line no-alert -- alert is our fallback without message boxes\n      alert(globalerrors.map(error => error.message).join(\"\\n\"));\n    }\n  }\n\n  //Get the first group that failed error handling\n  getFirstFailedGroup() {\n    return this.node.querySelector(\".wh-form__fieldgroup-error\");\n  }\n\n  //override this to deal with succesful submissions\n  onSubmitSuccess(result: FormSubmitEmbeddedResult<unknown>) {\n    const formpos = this.node.getBoundingClientRect();\n    if (formpos.top < 0)\n      this.node.scrollIntoView({ block: 'start', behavior: 'smooth' });\n\n    if (result && result.resultsguid)\n      this.node.dataset.whFormResultguid = result.resultsguid;\n\n    if (result && result.submitinstruction)\n      navigateTo(result.submitinstruction);\n  }\n\n  //override this to deal with failed submissions\n  onSubmitFailed(errors: FormSubmitMessage[], result: unknown) {\n  }\n\n  //override this to deal with form exceptions\n  onSubmitException(e: Error) {\n  }\n\n  async validateSingleFormField(field: HTMLElement): Promise<boolean> {\n    if (field instanceof HTMLInputElement && field.type === \"email\") { //TODO perhaps move this to webharefields.es ?\n      if (focus.getCurrentlyFocusedElement() === field) { //TODO clearing suggestion on change should probably be generalized\n        if (field.propWhValidationSuggestion) {\n          field.propWhValidationSuggestion = null;\n        }\n      }\n\n      //Just because it's focused doesn't mean we shouldn't validate it\n      const validation = emailvalidation.validateField(this, field);\n      this.pendingrpcs.push(validation);\n      if (!(await validation))\n        return false;\n    }\n    return true;\n  }\n}\n","// Auto-generated language file from /opt/wh/whtree/modules/publisher/js/forms/internal/form.lang.json\nvar registerTexts = require(\"@webhare/gettid/src/internal\").registerTexts;\nregisterTexts(\"publisher\",\"en\",{\"site\":{\"forms\":{\"imgedit-explain-upload\":\"Drag and drop files here or click to upload\",\"imgedit-groupelement-replace\":[1,\", Replace image\"],\"imgedit-groupelement-upload\":[1,\", Upload image\"],\"imgedit-remove\":\"Remove image\",\"nextpage\":\"Next\",\"previouspage\":\"Previous\",\"selectfile\":\"Select file\",\"splitdatetime-day-arialabel\":\"day\",\"splitdatetime-hours-arialabel\":\"hour\",\"splitdatetime-minutes-arialabel\":\"minute\",\"splitdatetime-month-arialabel\":\"month\",\"splitdatetime-seconds-arialabel\":\"second\",\"splitdatetime-year-arialabel\":\"year\",\"starsrequired\":\"* indicates a required field\",\"submit\":\"Submit\",\"upload-emptytext\":\"No file chosen\",\"upload-filename\":[\"Uploaded file is \",1],\"upload-remove\":\"Remove file\",\"addressfield\":{\"address_not_found\":\"The address could not be found.\",\"invalid_nr_detail\":\"Invalid house number.\",\"invalid_zip\":\"Invalid ZIP or postal code.\",\"zip_not_found\":\"Unknown combination of postal code and house number.\"},\"commonerrors\":{\"alphanum\":\"This value should be alphanumeric.\",\"badfiletype\":\"This file type is not allowed\",\"cannotprocessfile\":\"This file looks suspicious and can unfortunately not be uploaded\",\"check\":[\"You must select between \",1,\" and \",2,\" choices.\"],\"date\":\"This is not a valid date\",\"default\":\"This value seems to be invalid.\",\"digits\":\"This value should be digits.\",\"email\":\"This value should be a valid email.\",\"email_baddomain\":[\"Due to difficulties with mailing to \",1,\" email addresses we kindly request you to use an alternative email provider.\"],\"email_suggestion\":[\"Did you mean \",1,\"?\"],\"equalto\":\"This value should be the same.\",\"formunavailable\":\"This form is currently unavailable\",\"integer\":\"This value should be a valid integer.\",\"length\":[\"This value length is invalid. It should be between \",1,\" and \",2,\" characters long.\"],\"max\":[\"This value should be lower than or equal to \",1,\".\"],\"maxarray\":[\"You can add at most \",{\"t\":\"ifparam\",\"p\":1,\"value\":\"1\",\"subs\":[\"1 item\"],\"subselse\":[1,\" items\"]},\".\"],\"maxcheck\":[\"You must select \",{\"t\":\"ifparam\",\"p\":1,\"value\":\"1\",\"subs\":[\"1 choice\"],\"subselse\":[1,\" choices\"]},\" or fewer.\"],\"maxheight\":[\"The image is too big. It should be at most \",2,\" pixels high.\"],\"maxlength\":[\"This value is too long. It should have \",{\"t\":\"ifparam\",\"p\":1,\"value\":\"1\",\"subs\":[\"1 character\"],\"subselse\":[1,\" characters\"]},\" or fewer.\"],\"maxsignupsreached\":\"The maximum number of signups has been reached\",\"maxwidth\":[\"The image is too big. It should be at most \",2,\" pixels wide.\"],\"min\":[\"This value should be greater than or equal to \",1,\".\"],\"minarray\":[\"You must add at least \",{\"t\":\"ifparam\",\"p\":1,\"value\":\"1\",\"subs\":[\"1 item\"],\"subselse\":[1,\" items\"]},\".\"],\"mincheck\":[\"You must select at least \",{\"t\":\"ifparam\",\"p\":1,\"value\":\"1\",\"subs\":[\"1 choice\"],\"subselse\":[1,\" choices\"]},\".\"],\"minheight\":[\"The image is too small. It should be at least \",2,\" pixels high.\"],\"minlength\":[\"This value is too short. It should have \",{\"t\":\"ifparam\",\"p\":1,\"value\":\"1\",\"subs\":[\"1 character\"],\"subselse\":[1,\" characters\"]},\" or more.\"],\"minwidth\":[\"The image is too small. It should be at least \",2,\" pixels wide.\"],\"notblank\":\"This value should not be blank.\",\"number\":\"This value should be a valid number.\",\"pattern\":\"This value seems to be invalid.\",\"range\":[\"This value should be between \",1,\" and \",2,\".\"],\"required\":\"This value is required.\",\"step1mismatch\":\"The value must be a whole number\",\"stepmismatch\":[\"The value should be a multiple of \",1,\".\"],\"time\":\"This is not a valid time\",\"unacceptableemail\":\"This email address is not acceptable here\",\"upload_cannotcheck\":\"This file cannot be uploaded as we are currently unable to verify it\",\"upload_suspicious\":\"This file looks suspicious and can unfortunately not be uploaded\",\"url\":\"This value should be a valid url.\"}}}});\nregisterTexts(\"publisher\",\"nl\",{\"site\":{\"forms\":{\"imgedit-explain-upload\":\"Sleep bestanden hier of klik om te uploaden\",\"imgedit-groupelement-replace\":[1,\", Vervang afbeelding\"],\"imgedit-groupelement-upload\":[1,\", Upload afbeelding\"],\"imgedit-remove\":\"Verwijder afbeelding\",\"nextpage\":\"Volgende\",\"previouspage\":\"Vorige\",\"selectfile\":\"Selecteer bestand\",\"splitdatetime-day-arialabel\":\"dag\",\"splitdatetime-hours-arialabel\":\"uur\",\"splitdatetime-minutes-arialabel\":\"minuut\",\"splitdatetime-month-arialabel\":\"maand\",\"splitdatetime-seconds-arialabel\":\"seconde\",\"splitdatetime-year-arialabel\":\"jaar\",\"starsrequired\":\"* betekent dat een veld verplicht is\",\"submit\":\"Versturen\",\"upload-emptytext\":\"Geen bestand geselecteerd\",\"upload-filename\":[\"Geselecteerde bestand is \",1],\"upload-remove\":\"Verwijder bestand\",\"addressfield\":{\"address_not_found\":\"Het adres kon niet worden gevonden.\",\"invalid_nr_detail\":\"Ongeldig huisnummer.\",\"invalid_zip\":\"Ongeldige postcode.\",\"zip_not_found\":\"Combinatie van postcode en huisnummer komt niet voor.\"},\"commonerrors\":{\"alphanum\":\"De waarde moet alfanumeriek zijn.\",\"badfiletype\":\"Dit bestandstype is niet toegestaan\",\"check\":[\"Kies minimaal \",1,\" en maximaal \",2,\" items.\"],\"date\":\"Dit is geen geldige datum.\",\"default\":\"Deze waarde is onjuist.\",\"digits\":\"De waarde moet numeriek zijn.\",\"email\":\"Dit is geen geldig e-mailadres.\",\"email_baddomain\":[\"Vanwege problemen met het e-mailen naar \",1,\" e-mailadressen, willen we je vragen om een alternatief e-mailadres te gebruiken.\"],\"email_suggestion\":[\"Bedoel je \",1,\"?\"],\"equalto\":\"De waardes moeten identiek zijn.\",\"formunavailable\":\"Dit formulier is momenteel niet beschikbaar\",\"integer\":\"De waarde moet een nummer zijn.\",\"length\":[\"De waarde moet tussen \",1,\" en \",2,\" karakters lang zijn.\"],\"max\":[\"De waarde mag niet groter zijn dan \",1,\".\"],\"maxarray\":[\"U kunt maximaal \",{\"t\":\"ifparam\",\"p\":1,\"value\":\"1\",\"subs\":[\"1 onderdeel\"],\"subselse\":[1,\" onderdelen\"]},\" toevoegen.\"],\"maxcheck\":[\"Kies maximaal \",{\"t\":\"ifparam\",\"p\":1,\"value\":\"1\",\"subs\":[\"1 item\"],\"subselse\":[1,\" items\"]},\".\"],\"maxheight\":[\"De afbeelding is te groot. Deze mag maximaal \",2,\" pixels hoog zijn.\"],\"maxlength\":[\"De waarde is te lang. Deze mag maximaal \",{\"t\":\"ifparam\",\"p\":1,\"value\":\"1\",\"subs\":[\"1 karakter\"],\"subselse\":[1,\" karakters\"]},\" lang zijn.\"],\"maxwidth\":[\"De afbeelding is te groot. Deze mag maximaal \",2,\" pixels breed zijn.\"],\"min\":[\"De waarde mag niet lager zijn dan \",1,\".\"],\"minarray\":[\"U moet minimaal \",{\"t\":\"ifparam\",\"p\":1,\"value\":\"1\",\"subs\":[\"1 onderdeel\"],\"subselse\":[1,\" onderdelen\"]},\" toevoegen.\"],\"mincheck\":[\"Kies minimaal \",{\"t\":\"ifparam\",\"p\":1,\"value\":\"1\",\"subs\":[\"1 item\"],\"subselse\":[1,\" items\"]},\".\"],\"minheight\":[\"De afbeelding is te klein. Deze moet minimaal \",2,\" pixels hoog zijn.\"],\"minlength\":[\"De tekst is te kort. Deze moet uit minimaal \",{\"t\":\"ifparam\",\"p\":1,\"value\":\"1\",\"subs\":[\"1 karakter\"],\"subselse\":[1,\" karakters\"]},\" bestaan.\"],\"minwidth\":[\"De afbeelding is te klein. Deze moet minimaal \",2,\" pixels breed zijn.\"],\"notblank\":\"De waarde mag niet leeg zijn.\",\"number\":\"De waarde moet een nummer zijn.\",\"pattern\":\"De waarde is onjuist.\",\"range\":[\"De waarde moet tussen \",1,\" en \",2,\" liggen.\"],\"required\":\"Dit veld is verplicht.\",\"step1mismatch\":\"De waarde moet een geheel getal zijn\",\"stepmismatch\":[\"De waarde moet een meervoud zijn van \",1,\".\"],\"time\":\"Dit is geen geldige tijd.\",\"unacceptableemail\":\"Dit e-mailadres is hier niet toegestaan\",\"upload_cannotcheck\":\"Dit bestand kan niet geüpload worden omdat we het momenteel niet kunnen verifiëren\",\"upload_suspicious\":\"Dit bestand ziet er verdacht uit en kan helaas niet geüpload worden\",\"url\":\"Dit is geen geldige URL.\"}}}});\n// Adding dependency: /opt/wh/whtree/modules/publisher/language/default.xml\n// Adding dependency: /opt/wh/whtree/modules/publisher/language/nl.xml\n","/* eslint-disable @typescript-eslint/no-floating-promises -- FIXME: needs API rework */\n\nimport * as dompack from 'dompack';\nimport { requestFile } from \"@webhare/upload\";\n\nimport { getTid } from \"@webhare/gettid\";\nimport { setFieldError } from '@mod-publisher/js/forms/internal/customvalidation';\nimport { getFieldDisplayName } from '@webhare/forms/src/domsupport';\nimport { JSFormElement } from '@webhare/forms/src/jsformelement';\nimport type { FormFileValue } from '@webhare/forms/src/types';\nimport \"@mod-publisher/js/forms/internal/form.lang.json\"; //we need eg publisher:site.forms.selectfile\n\nfunction isAcceptableType(fileType: string, masks: string[]) {\n  if (masks.includes(fileType))\n    return true;\n\n  const basetype = fileType.split('/')[0];\n  if (['image', 'video', 'audio'].includes(basetype) && masks.includes(basetype + '/*'))\n    return true;\n\n  return false;\n}\n\n\nexport abstract class FileEditElement extends JSFormElement<FormFileValue[]> {\n  root;\n  maindiv;\n  readonly group: HTMLElement | null;\n\n  /** The current uploaded files */\n  protected currentFiles = new Array<FormFileValue>;\n  /** Maximum number of files */\n  protected maxFiles;\n\n  constructor() {\n    super();\n    this.root = this.attachShadow({ mode: 'open', delegatesFocus: true });\n    this.maindiv = document.createElement(\"div\");\n    this.maindiv.inert = this.disabled;\n\n    const csslink = document.createElement(\"link\");\n    csslink.rel = \"stylesheet\";\n    csslink.href = \"/.wh/ea/p/forms/controls.css\";\n    this.root.append(csslink, this.maindiv);\n\n    this.group = this.closest<HTMLElement>(\".wh-form__fieldgroup\");\n    this.whFormsApiChecker = async () => { await this._check(); };\n    this.maxFiles = parseInt(this.getAttribute(\"max-files\")!) || 1;\n    if (this.getAttribute(\"value\"))\n      this.#setValue(JSON.parse(this.getAttribute(\"value\")!));\n\n    if (this.group) {\n      this.group.addEventListener(\"dragover\", evt => evt.preventDefault());\n      this.group.addEventListener(\"dragenter\", evt => evt.preventDefault());\n      this.group.addEventListener(\"drop\", evt => this.doDrop(evt));\n    }\n  }\n  abstract refresh(): void;\n  isSet(): boolean {\n    return this.currentFiles.length > 0;\n  }\n  async _check() {\n    const error = this.required && !this.isSet();\n    if (error)\n      setFieldError(this, getTid(\"publisher:site.forms.commonerrors.required\"), { reportimmediately: false });\n    else\n      setFieldError(this, \"\", { reportimmediately: false });\n    return error;\n  }\n\n  protected refreshState() {\n    this.maindiv.inert = this.disabled;\n  }\n\n  get value(): FormFileValue[] {\n    return this.currentFiles;\n  }\n\n  set value(value: FormFileValue[]) {\n    this.#setValue(value);\n    this.refresh();\n  }\n\n  #setValue(value: Array<Partial<FormFileValue>>) { //taking a partial so we can do a better job at fixing missing fields from incorrect callers\n    //updates the value but does not fire events/refresh()\n    const toset: FormFileValue[] = [];\n\n    for (const row of value) {\n      if (row?.file) {\n        if (!this._isAcceptableType(row.file.type))\n          throw new Error(`File type ${row.file.type} is not acceptable for ${getFieldDisplayName(this)}`);\n        toset.push({ fileName: row.fileName || row.file.name, file: row.file, link: null });\n      } else if (row?.link) {\n        toset.push({ fileName: row.fileName || \"\", file: null, link: row.link });\n      } else {\n        throw new Error(`Incorrect value type received for ${getFieldDisplayName(this)} - expect 'file' or 'link' to be set`);\n      }\n\n      if (toset.length >= this.maxFiles)\n        break;\n    }\n    this.currentFiles = toset;\n  }\n\n  _isAcceptableType(mimetype: string) {\n    const accept = this.getAttribute(\"accept\")?.split(',').map(mask => mask.trim()) ?? [];\n    return !accept.length || isAcceptableType(mimetype, accept);\n  }\n\n  private doDrop(evt: DragEvent) {\n    //FIXME check 'accept' - or can the drag handlers do that?\n    evt.preventDefault();\n\n    const files = evt.dataTransfer?.files;\n    if (files)\n      this.processUpload(files[0]);\n  }\n\n  async uploadFile(evt: Event) {\n    evt.preventDefault();\n\n    if (this.disabled || this.currentFiles.length >= this.maxFiles)\n      return; //should not even have been offered?\n\n    const accept = this.getAttribute(\"accept\")?.split(',') ?? [];\n    using lock = dompack.flagUIBusy();\n    void (lock);\n\n    const file = await requestFile({ accept });\n    if (!file)\n      return;\n\n    await this.processUpload(file);\n  }\n\n  private async processUpload(file: File) {\n    if (this.disabled || this.currentFiles.length >= this.maxFiles)\n      return; //should not even have been offered?\n\n    if (!this._isAcceptableType(file.type)) {\n      //TODO tell server it can destroy the file immediately (should have told uploadsession at the start?\n      const msg = this.dataset.whAccepterror || getTid(\"publisher:site.forms.commonerrors.badfiletype\");\n      setFieldError(this, msg, { reportimmediately: true });\n      return;\n    }\n\n    this.currentFiles.push({ fileName: file.name, file: file, link: null });\n    this.refresh();\n    dompack.dispatchCustomEvent(this, 'change', { bubbles: true, cancelable: false });\n  }\n\n  protected deleteFile(evt: Event, idx: number) {\n    if (evt)\n      dompack.stop(evt);\n\n    this.currentFiles.splice(idx, 1);\n    this.refresh();\n    dompack.dispatchCustomEvent(this, 'change', { bubbles: true, cancelable: false });\n  }\n\n  protected setupUploadButton(button: HTMLElement) {\n    button.addEventListener(\"click\", evt => void this.uploadFile(evt));\n  }\n\n  protected setupDeleteButton(button: HTMLElement, idx: number) {\n    button.addEventListener(\"click\", evt => this.deleteFile(evt, idx));\n    button.ariaLabel = getTid(\"publisher:site.forms.imgedit-remove\");\n  }\n}\n","div.wh-form__uploadfield + input.wh-form__upload\n{\n  display:none;\n}\n.wh-form__uploadfieldinputholder\n{\n  position:relative;\n}\n","import * as dompack from 'dompack';\nimport { getTid } from \"@webhare/gettid\";\nimport { FileEditElement as FileEditElementBase } from './fileeditbase';\nimport './upload.css';\nimport { isFile } from '@webhare/std';\n\n\n\n//FIXME nicer class name? eg add form or field to these (and imgedit) class names?\nexport class FileUploadFormElement extends FileEditElementBase {\n  constructor() {\n    super();\n    this.refresh();\n  }\n\n  #constructFileHolder() {\n    const fileholder = document.createElement(\"div\");\n    fileholder.classList.add('file');\n    return fileholder;\n  }\n\n  refresh() {\n    const nodes = [];\n\n    for (const [idx, file] of this.currentFiles.entries()) {\n      const fileholder = this.#constructFileHolder();\n\n      // const label = getLabelText(this.node);\n      // aria-label={label}\n      const filename = isFile(file) ? file.name : file.fileName;\n      /* for ease of 'form like' presentation, we're currently using an <input>. but quite hacky, eg. we need readonly to have it not interfere with clicks. */\n      const filenamefield =\n        <input part=\"filename\" class=\"file__name\" type=\"text\" value={filename} readonly />;\n\n      const deletebutton = <button part=\"button deletebutton\" class=\"deletebutton file__deletebutton\" />;\n      this.setupDeleteButton(deletebutton, idx);\n\n      fileholder.append(filenamefield, deletebutton);\n      nodes.push(fileholder);\n    }\n\n    if (this.currentFiles.length < this.maxFiles) {\n      const fileholder = this.#constructFileHolder();\n      fileholder.classList.add('file--placeholder');\n\n      const filenamefield =\n        <input part=\"filename\" class=\"file__name\" type=\"text\" value=\"\" placeholder={getTid(\"publisher:site.forms.upload-emptytext\")} disabled readonly />;\n\n      const uploadbutton = <button part=\"button selectbutton\" type=\"button\" class=\"wh-form__uploadfieldselect wh-form__button\"><span class=\"wh-form__buttonlabel\">{getTid(\"publisher:site.forms.selectfile\")}</span></button>;\n      this.setupUploadButton(fileholder);\n      fileholder.append(filenamefield, uploadbutton);\n      nodes.push(fileholder);\n    }\n\n    this.maindiv.replaceChildren(...nodes);\n  }\n}\n\n//////// Legacy version. We expect existing users to migrate to the version above\n\nexport default class UploadField {\n  constructor(node: HTMLElement) {\n    if (!customElements.get(\"wh-fileedit\"))\n      customElements.define(\"wh-fileedit\", FileUploadFormElement);\n  }\n}\n","/* import ImgEditField from '@mod-publisher/js/forms/fields/imgedit';\n*/\nimport * as dompack from '@webhare/dompack';\nimport { FileEditElement } from './fileeditbase';\nimport { emplace } from '@webhare/std';\nimport { getTid } from '@webhare/gettid';\nimport { getFileAsDataURL } from '@webhare/upload';\nimport { setFieldError } from '@mod-publisher/js/forms/internal/customvalidation';\n\nlet revoker: FinalizationRegistry<string> | undefined;\nconst cachedURLs = new WeakMap<File, string>();\n\nfunction createFileURL(file: File): string {\n  return emplace(cachedURLs, file, {\n    insert: () => {\n      const newurl = URL.createObjectURL(file);\n      //setup a finalizer to revoke object urls\n      revoker ||= new FinalizationRegistry<string>((oldurl) => URL.revokeObjectURL(oldurl));\n      //as soon as file is lost to us\n      revoker.register(file, newurl);\n      return newurl;\n    }\n  });\n}\n\nasync function getImageDimensions(file: File): Promise<{ width: number; height: number }> {\n  const img = await dompack.loadImage(await getFileAsDataURL(file));\n  return { width: img.naturalWidth, height: img.naturalHeight };\n}\n\ninterface ImgEditTexts {\n  explainUpload?: string;\n}\n\nexport class ImgEditElement extends FileEditElement {\n  static observedAttributes = [\"min-width\", \"max-width\", \"min-height\", \"max-height\"];\n\n  private static texts: ImgEditTexts | null = null;\n\n  minWidth: number;\n  maxWidth: number;\n  minHeight: number;\n  maxHeight: number;\n\n  constructor() {\n    super();\n    // this.addEventListener(\"keypress\", evt => this.checkForUploadOrClear(evt)); // handle space+enter to active\n\n    this.maindiv.classList.add(\"images\");\n\n    this.minWidth = parseInt(this.getAttribute(\"min-width\") || \"0\") || 0;\n    this.maxWidth = parseInt(this.getAttribute(\"max-width\") || \"0\") || 0;\n    this.minHeight = parseInt(this.getAttribute(\"min-height\") || \"0\") || 0;\n    this.maxHeight = parseInt(this.getAttribute(\"max-height\") || \"0\") || 0;\n\n    this.refresh();\n  }\n\n  attributeChangedCallback(name: string, _oldValue: string, newValue: string) {\n    const value = parseInt(newValue);\n    if (isNaN(value))\n      return;\n    switch (name) {\n      case \"min-width\": {\n        this.minWidth = value;\n        break;\n      }\n      case \"max-width\": {\n        this.maxWidth = value;\n        break;\n      }\n      case \"min-height\": {\n        this.minHeight = value;\n        break;\n      }\n      case \"max-height\": {\n        this.maxHeight = value;\n        break;\n      }\n    }\n  }\n\n  static setTexts(textupdate: ImgEditTexts) {\n    if (!ImgEditElement.texts)\n      ImgEditElement.texts = {};\n\n    Object.assign(ImgEditElement.texts, textupdate);\n    dompack.qSA<ImgEditElement>(\"wh-imgedit\").forEach(node => node.refresh()); //update any existing nodes\n  }\n\n  async _check() {\n    const error = await super._check();\n    if (!error && this.isSet() && (this.minWidth || this.maxWidth || this.minHeight || this.maxHeight)) {\n      for (const file of this.currentFiles) {\n        if (file.file) {\n          const size = await getImageDimensions(file.file);\n          if (this.minWidth && size.width < this.minWidth)\n            setFieldError(this, getTid(\"publisher:site.forms.commonerrors.minwidth\", size.width, this.minWidth), { reportimmediately: false });\n          else if (this.maxWidth && size.width > this.maxWidth)\n            setFieldError(this, getTid(\"publisher:site.forms.commonerrors.maxwidth\", size.width, this.maxWidth), { reportimmediately: false });\n          else if (this.minHeight && size.height < this.minHeight)\n            setFieldError(this, getTid(\"publisher:site.forms.commonerrors.minheight\", size.height, this.minHeight), { reportimmediately: false });\n          else if (this.maxHeight && size.height > this.maxHeight)\n            setFieldError(this, getTid(\"publisher:site.forms.commonerrors.maxheight\", size.height, this.maxHeight), { reportimmediately: false });\n        }\n      }\n    }\n    return error;\n  }\n\n  refresh() {\n    const nodes = [];\n    for (const [idx, file] of this.currentFiles.entries()) {\n      const imgholder = dompack.create(\"div\", { class: \"image\", part: \"image\" });\n      const img = dompack.create(\"img\", { class: 'image__img', src: file.link ?? createFileURL(file.file) });\n\n      const deletebutton = dompack.create(\"button\", { part: \"button deletebutton\", class: \"deletebutton image__deletebutton\" });\n      this.setupDeleteButton(deletebutton, idx);\n\n      imgholder.append(img, deletebutton);\n      nodes.push(imgholder);\n    }\n\n    if (this.currentFiles.length < this.maxFiles) {\n      //add an extra 'image' which is the placeholder for additional uploads\n      const imgholder = dompack.create(\"div\", { class: \"image image--placeholder\", part: \"image placeholder\" });\n      const contentwrapper = dompack.create(\"div\", { class: \"image__content\" });\n      const uploadicon = dompack.create(\"div\", { class: \"image__uploadicon\", part: \"uploadicon\" });\n      const explain = dompack.create(\"div\", {\n        class: \"image__explain\",\n        textContent: ImgEditElement.texts?.explainUpload || getTid(\"publisher:site.forms.imgedit-explain-upload\")\n      });\n      imgholder.append(contentwrapper);\n      contentwrapper.append(uploadicon, explain);\n      imgholder.tabIndex = 0;\n      this.setupUploadButton(imgholder);\n      nodes.push(imgholder);\n    }\n\n    /* FIXME aria label, currently set at group level, should be per image?\n\n          // Set the aria-label to a combined label of the field together with the action which activating it through click/enter/space will perform\n          this.node.setAttribute(\"aria-label\", getTid(\"publisher:site.forms.imgedit-groupelement-upload\", this.node.dataset.arialabel));\n\n                    // Set the aria-label to a combined label of the field together with the action which activating it through click/enter/space will perform\n          this.node.setAttribute(\"aria-label\", getTid(\"publisher:site.forms.imgedit-groupelement-replace\", this.node.dataset.arialabel));\n*/\n\n    this.maindiv.replaceChildren(...nodes);\n  }\n}\n\n//////// Legacy version. We expect existing users to migrate to the version above\n\nexport default class ImgEditField {\n  constructor(node: HTMLElement) {\n    if (!customElements.get(\"wh-imgedit\"))\n      customElements.define(\"wh-imgedit\", ImgEditElement);\n  }\n}\n","/* eslint-disable */\n/// @ts-nocheck -- Bulk rename to enable TypeScript validation\n\nimport * as dompack from 'dompack';\nimport KeyboardHandler from \"dompack/extra/keyboard\";\nimport * as datehelpers from \"./datehelpers\";\nimport { getLang } from '@webhare/dompack/src/tree';\n// import \"./datestrings.lang.json\";\n//import { getTid } from \"@webhare/gettid\";\n\n// FIXME work with backend\nconst langcodes =\n{\n  \"nl\": \"am;pm;januari;februari;maart;april;mei;juni;juli;augustus;september;oktober;november;december;maandag;dinsdag;woensdag;donderdag;vrijdag;zaterdag;zondag;jan;feb;mrt;apr;mei;jun;jul;aug;sep;okt;nov;dec;ma;di;wo;do;vr;za;zo\",\n  \"de\": \"am;pm;Januar;Februar;März;April;Mai;Juni;Juli;August;September;Oktober;November;Dezember;Montag;Dienstag;Mittwoch;Donnerstag;Freitag;Samstag;Sonntag;Jan.;Febr.;März;Apr.;Mai;Juni;Juli;Aug.;Sept.;Okt.;Nov.;Dez.;Mo;Di;Mi;Do;Fr;Sa;So\",\n  \"en\": \"am;pm;January;February;March;April;May;June;July;August;September;October;November;December;Monday;Tuesday;Wednesday;Thursday;Friday;Saturday;Sunday;Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec;Mon;Tue;Wed;Thu;Fri;Sat;Sun\"\n};\n\n//Load any needed localizations yourself: frameworks.mootools.more.locale.nl-nl.date, frameworks.mootools.more.locale.es-es.date, frameworks.mootools.more.locale.de-de.date, frameworks.mootools.more.locale.fr-fr.date\n\n/*\n\nConverting calendar.js code to calendar2.js\n\n    Changed classes\n      - .-wh-calendar-popup   ->   .wh-datepicker > .value\n      - .-wh-calendar-icon    ->   .wh-datepicker > .arrow\n\n    Changed <input> attributes:\n      - data-formatting -> data-format\n      - data-empty -> placeholder\n\n    Load:\n      LOAD: wh.ui.calendar2\n      LOAD: wh.locale.common.de-de.date\n      LOAD: wh.locale.common.en-us.date\n      LOAD: wh.locale.common.nl-nl.date\n\n    Taal instellen:\n      Locale.use(\"de-DE\");\n      Locale.use(\"en-US\");\n      Locale.use(\"nl-NL\");\n*/\n\n\n/////////////////////\n//\n//\n\n//NOTE preparing to sync this with dompack selectlist.es\n\nclass ComponentOverlay {\n  constructor() {\n    this._boundGlobalEvents = null;\n  }\n  _startOverlayDismissCapture() {\n    //set up capturing handlers to kill our pulldowns asap when something else is clicked\n    if (!this._boundGlobalEvents)\n      this._boundGlobalEvents = evt => this._globalEvents(evt);\n\n    if (!dompack.debugflags.meo) {\n      window.addEventListener(\"keyup\", this._boundGlobalEvents, true);\n      window.addEventListener(\"mousedown\", this._boundGlobalEvents, true);\n      window.addEventListener(\"touchstart\", this._boundGlobalEvents, true);\n    }\n  }\n  _endOverlayDismissCapture() {\n    window.removeEventListener(\"keyup\", this._boundGlobalEvents, true);\n    window.removeEventListener(\"mousedown\", this._boundGlobalEvents, true);\n    window.removeEventListener(\"touchstart\", this._boundGlobalEvents, true);\n  }\n  _globalEvents(evt) {\n    if (evt && evt.type === \"keyup\") {\n      if (evt.keyCode === 27)\n        this._dismissOverlay();\n      return;\n    }\n\n    if (!dompack.contains(this._anchornode, evt.target) && !dompack.contains(this._items, evt.target))\n      this._dismissOverlay();\n  }\n}\n\n\n\n//\n//\n////////////////////\n\n\n\n/*\n * $wh.CalendarTable\n * Builds a plain calendar table based on mootools locale settings\n *\n */\n\nclass CalendarTable extends ComponentOverlay {\n  constructor() {\n    super();\n    this.options = {\n      weeknumbers: false,\n      header_weeknr: '', //weeknr.\n      min: null, //minimal date\n      max: null //maximal date (out of range gets disabled class\n    };\n    this.cdate = null;\n    this.showdate = null;\n  }\n\n  _onDayClick(evt) {\n    const clickedday = evt.target.closest(`.${this.options.baseclass}__day--selectable`);\n    // console.error(clickedday, clickedday.dataset.whDatepickerDate);\n    if (!clickedday)\n      return;\n\n    dompack.stop(evt);\n    this._dismissOverlay();\n\n    dompack.changeValue(this._datenode, clickedday.dataset.whDatepickerDate);\n  }\n\n  getTable(showdate, options) {\n    this.options = { ...this.options, options };\n\n    const caltable = dompack.create('table', {\n      className: this.options.baseclass + '__days',\n      on: { click: evt => this._onDayClick(evt) }\n    });\n    const calbody = dompack.create('tbody');\n    caltable.appendChild(calbody);\n\n    //Build week rows\n    const rownode = <tr class={this.options.baseclass + '__weekdays'}></tr>;\n    if (this.options.weeknumbers)\n      rownode.appendChild(<td></td>); //placeholder for upperleft corner\n\n    for (let w = 0; w < 7; ++w) {\n      rownode.appendChild(<th scope=\"column\" class={this.options.baseclass + '__weekday'}><span>{this._languagetexts[w + 33]}</span></th>);\n    }\n    calbody.appendChild(rownode);\n\n    const mindate = this.options.min ? {\n      day: this.options.min.getUTCDay(),\n      month: this.options.min.getUTCMonth(),\n      year: this.options.min.getUTCFullYear()\n    } : null;\n\n    const maxdate = this.options.max ? {\n      day: this.options.max.getUTCDay(),\n      month: this.options.max.getUTCMonth(),\n      year: this.options.max.getUTCFullYear()\n    } : null;\n\n    //What is the weekday for the first day of the selected month ?\n    const startofmonth = datehelpers.makeJSUTCDate({ ...showdate, day: 1 });\n    const showmonth = startofmonth.getUTCMonth();\n    const showyear = startofmonth.getUTCFullYear();\n\n    //    console.log(startofmonth);\n    const startofmonth_weekday = startofmonth.getUTCDay(); //0-6 where 0=Sunday\n\n    //Work backwards to a monday (start of the week)\n    const backwardsdays = startofmonth_weekday === 0 ? 6 : startofmonth_weekday - 1;\n    let currentgriddate = startofmonth.getTime() - (backwardsdays * 86400 * 1000);\n\n    //Build the grid!\n    for (let week = 0; week < 6; ++week) {\n      const rownode = dompack.create('tr', { className: this.options.baseclass + '__week' });\n\n      for (let day = 0; day < 7; ++day) {\n        const date = new Date(currentgriddate);\n        if (this.options.weeknumbers && day === 0)\n          rownode.appendChild(<th class={this.options.baseclass + '__weeknr'} scope=\"row\"><span>{datehelpers.getWeekNumber(date)}</span></th>);\n\n        const dateY = date.getUTCFullYear();\n        const dateM = date.getUTCMonth();\n        const dateD = date.getUTCDate();\n\n        const celldate = { year: dateY, month: dateM + 1, day: dateD };\n\n        const dayclass = ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'][day];\n        const daynode = dompack.create('td', {\n          className: `${this.options.baseclass}__day ${this.options.baseclass}__day--${dayclass}`,\n          childNodes: [dompack.create(\"span\", { textContent: date.getUTCDate() })],\n          dataset: { whDatepickerDate: datehelpers.formatJSUTCISODate(date) }\n        });\n\n        if (dateM !== showmonth || dateY !== showyear)\n          daynode.classList.add(this.options.baseclass + '__day--othermonth');\n\n        if ((mindate && dateY < mindate.year && dateM < mindate.month && dateD < mindate.day)\n          || (maxdate && dateY > maxdate.year && dateM > maxdate.month && dateD > maxdate.day)) {\n          daynode.classList.add(this.options.baseclass + '__day--disabled');\n        } else {\n          daynode.setAttribute(\"tabindex\", \"0\");\n          daynode.classList.add(this.options.baseclass + '__day--selectable');\n        }\n\n        if (datehelpers.compareDate(this.today, celldate) === 0)\n          daynode.classList.add(this.options.baseclass + '__day--today');\n\n        if (this.date && datehelpers.compareDate(this.date, celldate) === 0)\n          daynode.classList.add(this.options.baseclass + '__day--selected');\n\n        rownode.appendChild(daynode);\n        currentgriddate += 86400 * 1000;\n      }\n      calbody.appendChild(rownode);\n    }\n\n    return caltable;\n  }\n}\n\nclass Calendar2 extends CalendarTable {\n  constructor(options) {\n    super();\n    this.options = {\n      weeknumbers: false,\n      date: null,   // initial value\n      min: null,\n      max: null,\n      ...options\n    };\n    this.node = null;\n    this.tablenode = null;\n    this.yearspinner = null;\n    this.monthselectnode = null;\n    this.date = null; //selected date\n    this.keys = null;\n    this.focusednode = null;\n  }\n\n  _onYearMonthChange(evt) {\n    this.options.date = {\n      year: this.yearspinner.value,\n      month: this.monthselectnode.value,\n      day: this._currentdate ? this._currentdate.day : 1\n    };\n\n    this._currentdate.month = parseInt(this.monthselectnode.value);\n    this._currentdate.year = parseInt(this.yearspinner.value);\n\n    this.setMonthTable(this.options.date);\n  }\n\n  readDateNode() {\n    this.mindate = datehelpers.parseISODate(this._datenode.min, { nofail: true });\n    this.maxdate = datehelpers.parseISODate(this._datenode.max, { nofail: true });\n    this.date = datehelpers.parseISODate(this._datenode.value, { nofail: true });\n    const suggestion = datehelpers.parseISODate(this._datenode.dataset.suggestion, { nofail: true });\n    const max = datehelpers.parseISODate(this._datenode.max);\n    this.today = datehelpers.getLocalToday();\n\n    this.yearspinner.min = this.mindate ? this.mindate.year : 1901;\n    this.yearspinner.max = this.maxdate ? this.maxdate.year : 2099;\n\n    let showdate = this.date ?? suggestion ?? this.today;\n    if (this.mindate && datehelpers.makeJSUTCDate(showdate) < datehelpers.makeJSUTCDate(this.mindate))\n      showdate = this.mindate;\n    if (this.maxdate && datehelpers.makeJSUTCDate(showdate) > datehelpers.makeJSUTCDate(this.maxdate))\n      showdate = this.maxdate;\n\n    if (!this._currentdate)\n      this._currentdate = showdate;\n\n    this.setMonthTable(showdate);\n  }\n\n  _addMeToNode(container) {\n    this.node = container;\n\n    this.yearspinner = <input type=\"number\" class={`${this.options.baseclass}__yearselect`} step=\"1\" on={{ change: evt => this._onYearMonthChange(evt) }} />;\n    this.monthselectnode = <select class={`${this.options.baseclass}__monthselect`} on={{ change: evt => this._onYearMonthChange(evt) }} />;\n\n    this.readDateNode();\n\n    //build calendar interface:\n    const headernode = <div class={this.options.baseclass + \"__header\"}>\n      <div class={this.options.baseclass + \"__previous\"} onClick={evt => this.changeMonth(evt, -1)} />\n      {this.monthselectnode}\n      {this.yearspinner}\n      <div class={this.options.baseclass + \"__next\"} onClick={evt => this.changeMonth(evt, +1)} />\n    </div>;\n\n    //month pulldown\n    const selectedmonth = this._currentdate.month;\n    for (let m = 0; m < 12; ++m)\n      this.monthselectnode.appendChild(<option value={m + 1} selected={m === selectedmonth - 1}>{this._languagetexts[m + 2]}</option>);\n\n    this.node.append(headernode, this.tablenode);//, btnbarnode);\n\n    //looks like we're visible ! install a capturing\n    new KeyboardHandler(this.node, {\n      \"Enter\": ev => this.onKeyEnter(ev)\n    }\n      , { captureunsafekeys: true }\n    );\n\n    // Locale.addEvent(\"change\", this.onLanguageChange.bind(this));\n    this._startOverlayDismissCapture();\n    this._onYearMonthChange();\n  }\n\n  setMonthTable(showdate) {\n    this.yearspinner.value = showdate.year;\n    this.monthselectnode.value = showdate.month;\n\n    const newtable = this.getTable(showdate);\n\n    if (this.tablenode)\n      this.tablenode.replaceWith(newtable);\n    this.tablenode = newtable;\n\n    this.setFocus();\n  }\n\n  setFocus() {\n    if (!this.tablenode.clientWidth)\n      return;//Not (yet) visible\n\n    //Set focus on showdate or else first selectable date\n    let fnode;\n    if (this.date)\n      fnode = this.tablenode.querySelector(\"td[data-wh-datepicker-date='\" + datehelpers.formatISODate(this.date.year, this.date.month, this.date.day) + \"']\");\n    if (!fnode) //else pick first selectable day\n      fnode = this.tablenode.querySelector(\".\" + this.options.baseclass + '__day--selectable');\n    if (fnode)\n      fnode.focus();\n  }\n\n  onKeyEnter(ev) {\n    const daynode = ev.target.closest(\".\" + this.options.baseclass + '__day--selectable');\n    if (!daynode)\n      return;\n\n    this._onDayClick(ev);\n  }\n\n  _dismissOverlay() {\n    this.node.remove();\n    this._endOverlayDismissCapture();\n    this._owner.__closedDatepicker();\n  }\n\n  changeMonth(evt, direction) {\n    dompack.stop(evt);\n\n    let newyear = parseInt(this.yearspinner.value);\n    let newmonth = parseInt(this.monthselectnode.value) + direction;\n\n    if (newmonth > 12 || newmonth < 1) //wrap it\n    {\n      newyear += direction;\n      newmonth = direction > 0 ? 1 : 12;\n    }\n    this.setMonthTable({ year: newyear, month: newmonth });\n  }\n}\n\nclass DatePicker extends Calendar2 {\n  /** options.baseclass Base class to use for the elements in the date picker. Defaults to 'datepicker' */\n  constructor(owner) {\n    super({ ...owner.options, baseclass: owner._baseclass + '__picker' });\n    this._owner = owner;\n    this._datenode = owner._replacednode;\n    this.options = {\n      ...this.options,\n      language: null\n    };\n    //TODO limit by supportedlanguages and use gettid(\"~locale.datetimestrings\")\n    if (!this.options.language)\n      this.options.language = getLang().language;\n\n    this._languagetexts = (langcodes[this.options.language] || langcodes.en).split(';');\n\n    //we use the node to store our result, so verify it\n    //FIXME maybe this should be optional and you be allowed to create a datepicker without a corresponding node if you just manage getvalue/setvalue yourself, or maybe this glue code belongs outside us\n    //     if(node.nodeName !== 'INPUT' || node.getAttribute('type') !== 'date')\n    //       throw new Error(\"The DatePicker expects to be associated with a input[type=date]\");\n\n    //     this._node = node;\n    //     this._class = (options ? options.baseclass : '') || 'datepicker';\n    //     this._node.classList.add(this._class + \"--attached\");\n    // //\n    // this._node.addEventListener(\"wh:datepicker-request\");\n\n    this._anchornode = this._datenode.nextSibling;\n\n    this._calendarnode = dompack.create('div', { className: this.options.baseclass }); //tabindex:0 ?\n    this._addMeToNode(this._calendarnode);\n\n    this._items = this._calendarnode; //TODO bit ugly but keeps us compatible with selectlist.es\n\n    this._calendarnode.addEventListener(\"change\", ev => {\n      console.log(ev);\n    });\n\n    //Allow users to hook into the datepicker\n    dompack.dispatchCustomEvent(this._datenode, \"wh:datepicker-built\", { bubbles: true, cancelable: false, detail: { input: this._datenode, datepicker: this._calendarnode } });\n\n    //ADDME can we borrow positioning code from the dompack pulldown?\n    //for now, attach to bottom\n    document.body.appendChild(this._calendarnode);\n    const calendarnodesize = this._calendarnode.getBoundingClientRect();\n    const anchornode = this._anchornode.getBoundingClientRect();\n\n    //fits left aligned?\n    if (anchornode.left + calendarnodesize.width > window.innerWidth) { //doesn't fit left aligned, we must right align\n      this._calendarnode.style.right = '0px';\n    } else //left align\n    {\n      this._calendarnode.style.left = Math.ceil(anchornode.left) + 'px';\n    }\n\n    //fits top aligned?\n    if (anchornode.top + calendarnodesize.height > window.innerHeight) { //doesn't fit below, send above\n      let y = (window.innerHeight - anchornode.top);\n      if ((window.innerHeight - y) - calendarnodesize.height < 0) //Prevent calendar hiding behind top of window\n        y = window.innerHeight - calendarnodesize.height;\n      this._calendarnode.style.bottom = y + 'px';\n    } else //left align\n    {\n      this._calendarnode.style.top = Math.ceil(anchornode.bottom) + 'px';\n    }\n\n    this.setFocus();\n  }\n}\n\nexport default DatePicker;\n","/* eslint-disable */\n/// @ts-nocheck -- These property hacks aren't simple to convert TS (and we may need an even more modern approach) so split them off for now\n\n///////////////////////////////////////\n//\n// new 'value' property\n//\nfunction mySelectGetValue() {\n  const origgetter = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this), 'value')!.get;\n  //console.error(\"mySelectGetValue\", origgetter, origgetter.apply(this));\n  return origgetter.apply(this);\n}\nexport function __setUnderlyingValue(comp, newvalue) {\n  const origsetter = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(comp), 'value')!.set;\n  if (origsetter) //this works on chrome, firefox and IE\n  {\n    origsetter.apply(comp, [newvalue]);\n  } else {\n    //safari doesn't let us call the original setter. but we _can_ remove the value property and it will be restored\n    delete comp.value;\n    comp.value = newvalue;\n    setupMyValueProperty(comp); //reset our custom property\n  }\n}\nfunction mySelectSetValue(newvalue) //this is invoked on external sets, and updates the replaced fields\n{\n  __setUnderlyingValue(this, newvalue);\n  this._split_doupdate();\n}\n\nexport function setupMyValueProperty(select) {\n  Object.defineProperty(select, 'value', { configurable: true, get: mySelectGetValue, set: mySelectSetValue }); //FIXME why intercept get?\n}\n\n","/// @ts-nocheck -- Bulk rename to enable TypeScript validation\n\nimport * as dompack from \"dompack\";\nimport * as datehelpers from \"../internal/datehelpers\";\nimport Keyboard from 'dompack/extra/keyboard';\nimport DatePicker from '@mod-publisher/js/forms/internal/datepicker';\n\nimport { __setUnderlyingValue, setupMyValueProperty } from \"../internal/datetime-valueprops\";\nimport { getTid } from \"@webhare/gettid\";\nimport { getLang } from \"@webhare/dompack\";\nexport { __setUnderlyingValue } from \"../internal/datetime-valueprops\";\n\n/*\nReplaces date/time inputs into separate number type inputs\nField ordering can be set by data attribute data-dateformat\n\nnice to have:\n - placeholder translations\n - Field ordering by localization\n*/\n\ninterface MultiInputSubstitionOptions {\n  baseclass: string;\n}\n\nabstract class MultiInputSubstition {\n  protected _replacednode: HTMLInputElement;\n  protected placeholders: Record<string, string> = {};\n  options: MultiInputSubstitionOptions;\n\n  constructor(inpnode: HTMLInputElement, options: Partial<MultiInputSubstitionOptions>) {\n    this.options = {\n      baseclass: 'datetime',\n      ...options\n    };\n\n    this._baseclass = this.options.baseclass;\n    this._replacednode = inpnode;\n    this._replacednode._split_doupdate = () => this._split_doupdate();\n    this._replacednode.classList.add(this._baseclass + '--replaced');\n    this._replacednode.setAttribute(\"tabindex\", \"-1\"); //disable focus by tabbing replaced field\n    this._replacednode.addEventListener('change', () => this._onOriginalChange());\n\n    if (window.MutationObserver) {\n      const _observer = new MutationObserver(() => this._onObserve());\n      _observer.observe(this._replacednode, { attributes: true, attributeFilter: ['disabled', 'required', 'class'], subtree: false, childList: false });\n    }\n\n    this._nodes = {};\n    setupMyValueProperty(this._replacednode);\n  }\n  _onOriginalChange() { //capture browser initiated changes (they don't go through our value property)\n    if (this._replacednode.value === this._lastsetvalue)\n      return;\n\n    this._lastsetvalue = this._replacednode.value;\n    this._refreshReplacingFields();\n  }\n  _onBlur(field) {\n    if (!isNaN(parseInt(field.value)))\n      field.value = ('000' + parseInt(field.value)).slice(-this._getFieldTextLength(field));\n  }\n  _onReset(evt) {\n    dompack.stop(evt);\n    if (this._replacednode.disabled)\n      return;\n\n    this._replacednode.value = '';\n    dompack.dispatchDomEvent(this._replacednode, 'input');\n    dompack.dispatchDomEvent(this._replacednode, 'change');\n  }\n  _handlePastedValue(inval) {\n    return false;\n  }\n  protected _onInput(field: HTMLInputElement | null) {\n    //now with EARLY focus\n    //FIXME cleanup field first?\n    //FIXME determine whether to use NUMBER of TEL.\n    // if(field && field.input.length === )\n    if (!field)\n      return false;\n\n    if (this._handlePastedValue(field.value)) {\n      this._refreshReplacingFields();\n      return true;\n    }\n\n    const maxlength = this._getFieldTextLength(field);\n    if (field.value.length >= maxlength) {\n      const nextfield = this._getNextField(field);\n      if (nextfield) {\n        dompack.focus(nextfield);\n\n        if (field.value.length > maxlength) { //copy over remaining contents\n          nextfield.value = field.value.substr(maxlength);\n          field.value = field.value.substr(0, maxlength);\n          dompack.dispatchDomEvent(nextfield, 'input');\n          return true; //the next field's _onInput will deal with all the normal validations\n        }\n      }\n    }\n    return false;\n  }\n  protected getLanguageCode() {\n    return getLang(this._replacednode).language;\n  }\n\n  _finalize() {\n    this._refreshAttributes();\n    this._refreshReplacingFields();\n\n    this._controlsnode = <span class={`${this._baseclass}__controls`}></span>;\n    this._inputgroup.appendChild(this._controlsnode);\n    dompack.after(this._replacednode, this._inputgroup);\n\n    this._inputgroup.addEventListener(\"input\", ev => this._onInput(ev.target), true);\n    this._inputgroup.addEventListener(\"focus\", ev => this._onFocus(ev.target), true);\n    this._inputgroup.addEventListener('blur', evt => this._onBlur(evt.target), true);\n\n    new Keyboard(this._inputgroup, {\n      \"ArrowDown\": (evt) => this._trySpin(evt, -1),\n      \"ArrowUp\": (evt) => this._trySpin(evt, +1),\n      \"ArrowLeft\": (evt) => this._arrowHorizontal(evt, -1),\n      \"ArrowRight\": (evt) => this._arrowHorizontal(evt, +1),\n      \"Backspace\": (evt) => this._handleBackspace(evt)\n    }, {\n      captureunsafekeys: true,\n      onkeypress: (evt, key) => this._onKeyPress(evt, key)\n    });\n\n  }\n  _constructPart(partname, options) {\n    return dompack.create(\"input\", {\n      className: `${this._baseclass}__part ${this._baseclass}__${partname}`,\n      pattern: \"[0-9]*\",\n      inputmode: \"numeric\",\n      autocomplete: \"off\",\n      placeholder: this.placeholders[partname],\n      type: \"tel\", //we need 'tel' for fine selection control, we can't control selectionStart/End of a type=number\n      ...options\n    });\n  }\n  _onObserve() {\n    this._refreshAttributes();\n  }\n\n  _split_doupdate() {\n    this._refreshReplacingFields();\n    if (this._currentdatepicker)\n      this._currentdatepicker.readDateNode();\n  }\n\n  _refreshAttributes() {\n    const isdisabled = this._replacednode.disabled;\n    const isrequired = this._replacednode.required;\n\n    dompack.toggleClass(this._inputgroup, this._baseclass + '--disabled', isdisabled);\n    dompack.toggleClass(this._inputgroup, this._baseclass + '--required', isrequired);\n    this._getSubInputs().forEach(node => { node.disabled = isdisabled; node.required = isrequired; });\n  }\n\n  _getSubInputs() {\n    throw new Error(\"Override!\");\n  }\n\n  _setReplacedValue(setvalue) {\n    if (setvalue !== this._lastsetvalue) {\n      __setUnderlyingValue(this._replacednode, setvalue); //direct update to prevent it from rewriting our fields\n      this._lastsetvalue = setvalue;\n\n      //TODO would be more correct to fire 'input' on any value change, but 'change' only on calendar pick OR blur\n      dompack.dispatchDomEvent(this._replacednode, 'input');\n      dompack.dispatchDomEvent(this._replacednode, 'change');\n    }\n  }\n\n  _onFocus(field) {\n    if (this._getSubInputs().indexOf(field) >= 0) //one of our handled fields\n      field.select(); //select contents fully on focus, makes it easier to start typing new values\n  }\n\n  _trySpin(evt, change) {\n    const field = evt.target;\n    const nodeidx = this._getSubInputs().indexOf(field);\n    if (nodeidx < 0) //not one of our inputs\n      return; //not handling!\n\n    dompack.stop(evt);\n    if (this._spinNode(field, nodeidx, change))\n      this._onInput(null);\n    return true;\n  }\n\n  _arrowHorizontal(evt, dir) {\n    const field = evt.target;\n\n    if ((field.selectionStart !== field.selectionEnd) //theres a selection, let the browser deal with that\n      || (dir < 0 && field.selectionStart > 0) //not at the left edge\n      || (dir > 0 && field.selectionEnd < field.value.length)) // not at the right edge\n      return;\n\n    dompack.stop(evt);\n\n    const subinputs = this._getSubInputs();\n    const gotofield = subinputs[subinputs.indexOf(field) + dir];\n    if (gotofield) {\n      dompack.focus(gotofield);\n      gotofield.selectionEnd = gotofield.selectionStart = dir > 0 ? 0 : gotofield.value.length;\n    }\n  }\n\n  _onKeyPress(evt, key) {\n    if ((key >= '0' && key <= '9') || key.length > 1) //digit or special key\n      return true;\n    dompack.stop(evt);\n  }\n\n  _handleBackspace(evt) {\n    const field = evt.target;\n    const nodeidx = this._getSubInputs().indexOf(field);\n    if (nodeidx <= 0) //not one of our fields, or the first (where we can't go back anywhere)\n      return false; //not handling\n\n    if (field.selectionEnd > 0) //selection does not include the left side of the field\n      return false;\n\n    //remove selection, if any (we're a \"backspace\" after all)\n    dompack.stop(evt);\n    field.value = field.value.substr(0, field.selectionStart) + field.value.substr(field.selectionEnd);\n\n    const prevfield = this._getSubInputs()[nodeidx - 1];\n    dompack.focus(prevfield);\n    if (prevfield.value.length > 0) //do a backspace in the previous field as if we were one\n      prevfield.value = prevfield.value.substr(0, prevfield.value.length - 1);\n\n    prevfield.selectionEnd = prevfield.selectionStart = prevfield.value.length;\n    return true;\n  }\n}\n\nexport interface DateFieldOptions extends MultiInputSubstitionOptions {\n  placeholders: {\n    year: string;\n    month: string;\n    day: string;\n  };\n  datepicker: boolean;\n  resetcontrol: boolean;\n  weeknumbers: boolean;\n}\n\nexport class DateField extends MultiInputSubstition {\n  declare options: DateFieldOptions;\n\n  constructor(inpnode: HTMLInputElement, options?: Partial<DateFieldOptions>);\n  /** @deprecated You should ensure the inputnode is a HTMLInputElement */\n  constructor(inpnode: HTMLElement, options?: Partial<DateFieldOptions>);\n\n  constructor(inpnode: HTMLInputElement, options?: Partial<DateFieldOptions>) {\n    options = {\n      datepicker: true,\n      resetcontrol: true,\n      weeknumbers: false,\n      ...options\n    };\n\n    super(inpnode, options);\n    if (!this._replacednode)\n      return;\n\n    this.placeholders = this.options.placeholders ?? (this.getLanguageCode()?.startsWith('nl') ? { year: \"jjjj\", month: \"mm\", day: \"dd\" } : { year: \"yyyy\", month: \"mm\", day: \"dd\" });\n    this.previous = { value: '' };\n\n    const dateformat = inpnode.dataset.format || \"d-m-y\";\n    const parseddate = dateformat.match(/^([dmy])([^dmy]*)([dmy])([^dmy]*)([dmy])$/);\n    if (!parseddate)\n      throw new Error(`Unrecognized date format '${dateformat}'`);\n\n    this._inputgroup = <span class={`${this._baseclass} ${this._baseclass}__date`}>\n      {this._constructDatePart(parseddate[1])}\n      <span class={`${this._baseclass}__sep`}>{parseddate[2]}</span>\n      {this._constructDatePart(parseddate[3])}\n      <span class={`${this._baseclass}__sep`}>{parseddate[4]}</span>\n      {this._constructDatePart(parseddate[5])}\n    </span>;\n\n    this._nodes.day.min = 1;\n    this._nodes.day.max = 31;\n    this._nodes.month.min = 1;\n    this._nodes.month.max = 12;\n\n    if (this._replacednode.min !== \"\") { //Should be iso date\n      const minyear = this._replacednode.min.split(/[^0-9]+/)[0];\n      if (minyear !== \"\")\n        this._nodes.year.min = minyear;\n    }\n\n    if (this._replacednode.max !== \"\") { //Should be iso date\n      const maxyear = this._replacednode.max.split(/[^0-9]+/)[0];\n      if (maxyear !== \"\")\n        this._nodes.year.max = maxyear;\n    }\n\n    this._finalize();\n\n    if (this.options.datepicker) {\n      this._datepickercontrol = <span class={`${this._baseclass}__togglepicker`}></span>;\n      this._datepickercontrol.addEventListener(\"click\", evt => this._onDatePickerClick(evt));\n      this._controlsnode.appendChild(this._datepickercontrol);\n    }\n    if (this.options.resetcontrol) {\n      this._resetcontrol = <span class={`${this._baseclass}__reset`}></span>;\n      this._resetcontrol.addEventListener(\"click\", evt => this._onReset(evt));\n      this._controlsnode.appendChild(this._resetcontrol);\n    }\n  }\n\n  _onDatePickerClick(evt) {\n    dompack.stop(evt);\n\n    if (this._currentdatepicker || this._replacednode.disabled)\n      return;\n    this._currentdatepicker = new DatePicker(this);\n  }\n  __closedDatepicker() {\n    this._currentdatepicker = null;\n\n    //return focus to last replacement input (so if using tab you go to next field)\n    const inplst = this._inputgroup.querySelectorAll(\"input\");\n    if (inplst.length)\n      inplst[inplst.length - 1].focus();\n  }\n\n  _constructDatePart(which) {\n    const partname = { d: \"day\", m: \"month\", y: \"year\" }[which];\n    if (this._nodes[partname])\n      throw new Error(`Duplicate '${partname}' node`);\n\n    this._nodes[partname] = this._constructPart(partname, { maxlength: partname === \"year\" ? 4 : 2 });\n    return this._nodes[partname];\n  }\n\n  _getSubInputs() {\n    return [this._nodes.day, this._nodes.month, this._nodes.year];\n  }\n\n  _setDateByParts(parts) {\n    this._nodes.day.value = ('0' + parts.day).substr(-2);\n    this._nodes.month.value = ('0' + parts.month).substr(-2);\n    this._nodes.year.value = ('000' + parts.year).substr(-4);\n  }\n\n  _refreshReplacingFields() {\n    this._lastsetvalue = this._replacednode.value;\n\n    if (this._replacednode.value) { //Should be iso date\n      this._currentdate = datehelpers.parseISODate(this._replacednode.value, { nofail: true });\n      if (this._currentdate) {\n        this._setDateByParts(this._currentdate);\n        return;\n      }\n    }\n    this._nodes.day.value = \"\";\n    this._nodes.month.value = \"\";\n    this._nodes.year.value = \"\";\n  }\n\n  _getFieldTextLength(field) {\n    return field === this._nodes.year ? 4 : 2;\n  }\n  _getNextField(field) {\n    return field === this._nodes.day ? this._nodes.month\n      : field === this._nodes.month ? this._nodes.year\n        : null;\n\n  }\n\n  _getCurrentAsISODate() {\n    let year = parseInt(this._nodes.year.value, 0);\n    const month = parseInt(this._nodes.month.value, 0);\n    const day = parseInt(this._nodes.day.value, 0);\n\n    if (year >= 0 && year <= 99 && this._replacednode.dataset.shortyearcutoff !== \"\") {\n      const cutoff = parseInt(this._replacednode.dataset.shortyearcutoff);\n      if (year < cutoff) //to do someday.. current century might not be 2000 anymore\n        year += 2000;\n      else\n        year += 1900;\n    }\n\n    return datehelpers.formatISODate(year, month, day);\n  }\n\n  _spinNode(node, nodeidx, change) {\n    const isodate = this._getCurrentAsISODate();\n    if (!isodate)\n      return; //not sure what to do with a corrupt\n\n    let newdate = new Date(isodate);\n    if (node === this._nodes.day) {\n      newdate = new Date(Number(newdate) + (change * 86400000));\n    } else if (node === this._nodes.month) {\n      newdate.setUTCMonth(newdate.getUTCMonth() + change);\n    } else if (node === this._nodes.year) {\n      newdate.setUTCFullYear(newdate.getUTCFullYear() + change);\n    } else {\n      return;\n    }\n\n    this._setReplacedValue(datehelpers.formatJSUTCISODate(newdate));\n    this._split_doupdate();\n    return true;\n  }\n\n  _handlePastedValue(inval) {\n    //if we're spotting a xx-xx-xx or xx/xx/xx pattern, assume a paste\n    const is_dashed = inval.match(/.+-.+-.+/);\n    const is_slashed = inval.match(/.+\\/.+\\/.+/);\n    if (is_dashed || is_slashed) {\n      const parseddate = datehelpers.parseDate('d-m-y', inval, { nofail: true });\n      if (parseddate) {\n        this._setReplacedValue(datehelpers.formatISODate(parseddate.year, parseddate.month, parseddate.day));\n        this._refreshReplacingFields();\n        return true;\n      }\n    }\n    return false;\n  }\n\n  private getInputValues() {\n    return {\n      year: this._nodes.year.value,\n      month: this._nodes.month.value,\n      day: this._nodes.day.value\n    };\n  }\n\n  _onInput(field: HTMLInputElement | null) {\n    if (super._onInput(field))\n      return true;\n\n    const fields = this.getInputValues();\n    if (!fields.year && !fields.month && !fields.day) { //full field clear\n      this._replacednode.setCustomValidity('');\n      this._setReplacedValue(\"\");\n      return;\n    }\n\n    let year = parseInt(fields.year, 0);\n    const month = parseInt(fields.month, 0);\n    const day = parseInt(fields.day, 0);\n\n    if (year >= 0 && year <= 99 && this._replacednode.dataset.shortyearcutoff !== \"\") {\n      const cutoff = parseInt(this._replacednode.dataset.shortyearcutoff);\n      if (year < cutoff) //TODO current century might not be 2000 anymore\n        year += 2000;\n      else\n        year += 1900;\n    }\n\n    const finaldate = datehelpers.formatISODate(year, month, day);\n    this._replacednode.setCustomValidity(finaldate ? \"\" : getTid(\"publisher:site.forms.commonerrors.date\"));\n    this._setReplacedValue(finaldate);\n    return true;\n  }\n\n  _onKeyPress(evt, key) {\n    if (key === '-' || key === '/') {\n      const nextfield = this._getNextField(evt.target);\n      if (nextfield)\n        dompack.focus(nextfield);\n      return false;\n    }\n    return super._onKeyPress(evt, key);\n  }\n\n  /*\n    onKeyUp( ev, node )\n    {\n      ev.preventDefault();\n      ev.stopPropagation();\n\n      let prevval = this.previous.value;\n      this.previous.value = node.value;\n\n      if( ev.keyCode === 8 && node.value === \"\" && prevval === \"\" )//backspace\n      {\n        //Try to set focus on previous input\n        let prevnode = node.parentNode.previousSibling;\n        if( prevnode )\n        {\n          let previnp = prevnode.querySelector(\"input\");\n          if( previnp )\n            previnp.focus();\n        }\n\n        return;\n      }\n\n      //First some basic validation\n      let value = node.value.replace(/[^0-9]+/g,'');\n\n      if( value === \"\" || value !== node.value || 1*value < 1*node.min || 1*value > 1*node.max )\n        return;\n\n      //Is field value minimal length\n      if( (node === this.yearnode && value.length < 4) || (node !== this.yearnode && value.length < 2) )\n        return;\n\n      if( prevval === node.value )\n          return;//Only go to next input if value changed\n\n      //Try to set focus on next input\n      let nextnode = node.parentNode.nextSibling;\n      if( !nextnode )\n        return;\n\n      let nextinp = nextnode.querySelector(\"input\");\n      if( nextinp )\n        nextinp.focus();\n    }\n  */\n\n  _onReset(evt) {\n    this.closePicker();\n    super._onReset(evt);\n  }\n\n  //-------- PUBLIC API ---------------\n  closePicker() { //close any open date picker\n    if (this._currentdatepicker)\n      this._currentdatepicker._dismissOverlay();\n  }\n}\n\nexport interface TimeFieldOptions extends MultiInputSubstitionOptions {\n  placeholders: {\n    hour: string;\n    minute: string;\n    second: string;\n    msec: string;\n  };\n  resetcontrol: boolean;\n}\n\nexport class TimeField extends MultiInputSubstition {\n\n  constructor(inpnode: HTMLInputElement, options?: Partial<TimeFieldOptions>);\n  /** @deprecated You should ensure the inputnode is a HTMLInputElement */\n  constructor(inpnode: HTMLElement, options?: Partial<TimeFieldOptions>);\n\n  constructor(inpnode: HTMLInputElement, options?: Partial<TimeFieldOptions>) {\n    options = {\n      resetcontrol: true,\n      ...options\n    };\n\n    super(inpnode, options);\n    if (!this._replacednode)\n      return;\n\n    this.placeholders = this.options.placeholders ?? (this.getLanguageCode() === 'nl' ? { hour: \"uu\", minute: \"mm\", second: \"ss\", msec: \"mmm\" } : { hour: \"hh\", minute: \"mm\", second: \"ss\", msec: \"mmm\" });\n    const step = parseFloat(this._replacednode.getAttribute(\"step\") || '0');\n    this.previous = { value: '' };\n    this._showmsec = step !== Math.floor(step); //fraction\n    this._showsecond = this._showmsec || (step % 60 !== 0); //unable to round to minute... so seconds\n\n    this._inputgroup = <span class={`${this._baseclass} ${this._baseclass}__time`}>\n      {this._constructTimePart(\"hour\")}\n      <span class={`${this._baseclass}__sep`}>:</span>\n      {this._constructTimePart(\"minute\")}\n    </span>;\n\n    this._nodes.hour.max = 23;\n    this._nodes.minute.max = 59;\n\n    if (this._showsecond) {\n      this._inputgroup.appendChild(<span class={`${this._baseclass}__sep`}>:</span>);\n      this._inputgroup.appendChild(this._constructTimePart(\"second\"));\n      this._nodes.second.max = 59;\n    }\n    if (this._showmsec) {\n      this._inputgroup.appendChild(<span class={`${this._baseclass}__sep`}>.</span>);\n      this._inputgroup.appendChild(this._constructTimePart(\"msec\"));\n      this._nodes.msec.max = 999;\n    }\n\n    this._finalize();\n\n    if (this.options.resetcontrol) {\n      this._resetcontrol = <span class={`${this._baseclass}__reset`}></span>;\n      this._resetcontrol.addEventListener(\"click\", evt => this._onReset(evt));\n      this._controlsnode.appendChild(this._resetcontrol);\n    }\n  }\n\n  _spinNode(node, nodeidx, change) {\n    let newval = (parseInt(node.value) || 0) + change;\n    const max = parseInt(node.getAttribute(\"max\"));\n\n    if (newval < 0 || newval > max) {\n      if (nodeidx === 0) //already at top level, no wrapping..\n        return false;\n\n      newval = change < 0 ? max : 0; //wrap it!\n      if (nodeidx > 0) //spin higher node too\n        if (!this._spinNode(this._getSubInputs()[nodeidx - 1], nodeidx - 1, change))\n          return false;\n    }\n\n    //Cannot use dompack.changeValue here as we need to explicitly tell onInput not to move the next field\n    node.value = ('000' + newval).slice(nodeidx === 3 ? -3 : -2);\n    return true;\n  }\n\n  _constructTimePart(partname) {\n    if (this._nodes[partname])\n      throw new Error(`Duplicate '${partname}' node`);\n\n    this._nodes[partname] = this._constructPart(partname, {\n      maxlength: partname === 'msec' ? 3 : 2,\n      min: \"0\"\n    });\n\n    return this._nodes[partname];\n  }\n\n  _refreshReplacingFields() {\n    this._lastsetvalue = this._replacednode.value;\n\n    const time = datehelpers.parseISOTime(this._replacednode.value, { nofail: true });\n    if (time) {\n      this._currenttime = time;\n      this._nodes.hour.value = (\"0\" + this._currenttime.hour).slice(-2);\n      this._nodes.minute.value = (\"0\" + this._currenttime.minute).slice(-2);\n      if (this._nodes.second)\n        this._nodes.second.value = (\"0\" + this._currenttime.second).slice(-2);\n      if (this._nodes.msec)\n        this._nodes.msec.value = (\"00\" + this._currenttime.msec).slice(-3);\n      return;\n    }\n\n    this._nodes.hour.value = \"\";\n    this._nodes.minute.value = \"\";\n    if (this._nodes.second)\n      this._nodes.second.value = \"\";\n    if (this._nodes.msec)\n      this._nodes.msec.value = \"\";\n  }\n\n  _getFieldTextLength(field) {\n    return field === this._nodes.msec ? 3 : 2;\n  }\n  _getSubInputs() {\n    return [\n      this._nodes.hour,\n      this._nodes.minute,\n      ...(this._nodes.second ? [this._nodes.second] : []),\n      ...(this._nodes.msec ? [this._nodes.msec] : [])\n    ];\n  }\n\n  private getInputValues() {\n    return {\n      hour: this._nodes.hour.value,\n      minute: this._nodes.minute.value,\n      second: this._nodes.second?.value ?? \"\",\n      msec: this._nodes.msec?.value ?? \"\"\n    };\n  }\n\n  _onInput(field: HTMLInputElement | null) {\n    if (super._onInput(field))\n      return true;\n\n    const fields = this.getInputValues();\n    if (!fields.hour && !fields.minute && !fields.second && !fields.msec) { //full field clear\n      this._replacednode.setCustomValidity('');\n      this._setReplacedValue(\"\");\n      return;\n    }\n\n    const hour = parseInt(fields.hour, 0);\n    const minute = parseInt(fields.minute, 0);\n    const second = parseInt(fields.second, 0);\n    const msec = parseInt(fields.msec, 0);\n\n    const finaltime = datehelpers.formatISOTime(hour, minute, this._showsecond ? second : null, this._showmsec ? msec : null);\n    this._replacednode.setCustomValidity(finaltime ? \"\" : getTid(\"publisher:site.forms.commonerrors.time\"));\n    this._setReplacedValue(finaltime);\n    return true;\n  }\n\n  _onKeyPress(evt, key) {\n    if (key === ':' || key === '.') {\n      const nextfield = this._getNextField(evt.target);\n      if (nextfield)\n        dompack.focus(nextfield);\n      return false;\n    }\n    return super._onKeyPress(evt, key);\n  }\n\n  _getNextField(field) {\n    return field === this._nodes.hour ? this._nodes.minute\n      : field === this._nodes.minute ? this._nodes.second\n        : null;\n\n  }\n\n\n  /*\n    onKeyUp( ev, node )\n    {\n      ev.preventDefault();\n      ev.stopPropagation();\n\n      let prevval = this.previous.value;\n      this.previous.value = node.value;\n\n      if( ev.keyCode === 8 && node.value === \"\" && prevval === \"\" )//backspace\n      {\n        //Try to set focus on previous input\n        let prevnode = node.parentNode.previousSibling;\n        if( prevnode )\n        {\n          let previnp = prevnode.querySelector(\"input\");\n          if( previnp )\n            previnp.focus();\n        }\n\n        return;\n      }\n\n      //First some basic validation\n      let value = node.value.replace(/[^0-9]+/g,'');\n      if( value === \"\" || value !== node.value || 1*value < 1*node.min || 1*value > 1*node.max )\n        return;\n\n      //Is field value minimal length\n      if( value.length < 2 )\n        return;\n\n      if( prevval === node.value )\n          return;//Only go to next input if value changed\n\n      //Try to set focus on next input\n      let nextnode = node.parentNode.nextSibling;\n      if( !nextnode )\n        return;\n\n      let nextinp = nextnode.querySelector(\"input\");\n      if( nextinp )\n        nextinp.focus();\n    }\n  */\n}\n","import * as dompack from '@webhare/dompack';\nimport { type CaptchaProvider, type CaptchaSettings, captcharegistry } from \"@mod-publisher/js/captcha/api\";\n\n//recaptcha API: https://developers.google.com/recaptcha/docs/display\nlet recaptchaload: PromiseWithResolvers<void> | undefined;\n\ntype RecaptchaOptions = { language?: string };\nlet recaptchaOptions: RecaptchaOptions | undefined;\n\ndeclare global {\n  interface Window {\n    $wh__ongooglerecaptchaloaded: () => void;\n    grecaptcha: {\n      render: (node: HTMLElement, options: { sitekey: string; callback: () => void }) => string;\n      getResponse: (id: string) => string;\n    };\n  }\n}\n\nwindow.$wh__ongooglerecaptchaloaded = function () {\n  recaptchaload!.resolve();\n};\n\nfunction makeRecaptchaLoadPromise() {\n  recaptchaload = Promise.withResolvers<void>();\n  document.querySelector<HTMLElement>(\"head,body\")!.append(<script src=\"https://www.google.com/recaptcha/api.js?onload=$wh__ongooglerecaptchaloaded&amp;render=explicit\" />);\n  return recaptchaload.promise;\n}\n\nexport async function runRecaptcha(provider: CaptchaProvider, injectInto: HTMLElement, settings: CaptchaSettings) {\n  const lock = dompack.flagUIBusy({ modal: true });\n  try {\n    await (recaptchaload ? recaptchaload.promise : makeRecaptchaLoadPromise());\n\n    const captchanode = <div class=\"wh-captcha__googlerecaptchaholder\"></div>;\n    injectInto.append(captchanode);\n\n    if (provider.apikey === 'mock') {\n      captchanode.appendChild(<label class=\"wh-captcha__mock\"><input type=\"checkbox\" on={{ click: () => settings.onResponse('mock') }} />I am a human, beep-bop</label>);\n    } else {\n      const recaptchaid = window.grecaptcha.render(captchanode, {\n        sitekey: provider.apikey,\n        ...recaptchaOptions?.language ? { hl: recaptchaOptions.language } : {},\n        callback: () => {\n          const response = window.grecaptcha ? window.grecaptcha.getResponse(recaptchaid) : '';\n          settings.onResponse(response);\n        }\n      });\n    }\n  } finally {\n    lock.release();\n  }\n}\n\n\n/** Setup Google reCAPTCHA rendering\n * @param options Optional settings, currently supports:\n *  - language: The language code to use for the reCAPTCHA widget. See https://developers.google.com/recaptcha/docs/language for supported language codes\n */\nexport function setupGoogleRecaptcha(options?: RecaptchaOptions) {\n  if (captcharegistry[\"google-recaptcha\"])\n    throw new Error(\"Duplicate google recaptcha initialization\");\n\n  recaptchaOptions = { ...recaptchaOptions, ...options };\n  captcharegistry[\"google-recaptcha\"] = { initialize: runRecaptcha };\n}\n","import * as dompack from '@webhare/dompack';\nimport { type CaptchaProvider, type CaptchaSettings, captcharegistry } from \"@mod-publisher/js/captcha/api\";\n\n//friendly captcha API: https://developer.friendlycaptcha.com/docs/v2/sdk/configuration\nlet script = \"https://cdn.jsdelivr.net/npm/@friendlycaptcha/sdk@0.1.31/site.min.js\";\nlet endpoint: string | undefined;\nlet isLoaded = false;\n\nexport async function runFriendlyCaptcha(provider: CaptchaProvider, injectInto: HTMLElement, settings: CaptchaSettings): Promise<void> {\n  const captcha = document.createElement('div');\n  captcha.className = \"frc-captcha\";\n  captcha.dataset.sitekey = provider.apikey;\n  if (endpoint === \"eu\")\n    captcha.dataset.apiEndpoint = \"eu\"; //https://developer.friendlycaptcha.com/docs/v2/sdk/configuration#data-api-endpoint\n  captcha.addEventListener(\"frc:widget.complete\", ((evt: CustomEvent<{ response: string }>) => settings.onResponse(evt.detail.response)) as EventListener);\n\n  injectInto.append(captcha);\n\n  if (isLoaded) {\n    //@ts-expect-error -- undocumented but this seems to properly refresh the unit\n    window.frcaptcha.attach();\n  } else { //Now initialize it\n    using lock = dompack.flagUIBusy();\n    void (lock);\n    //TODO listen for widget.statechange - https://developer.friendlycaptcha.com/docs/v2/sdk/events#frcwidgetstatechange before releasing the lock\n    await dompack.loadScript(script, { module: true });\n    isLoaded = true;\n  }\n}\n\n/** Setup friendlycaptcha integration */\nexport function setupFriendlyCaptcha(options?: { script?: string; endpoint?: \"eu\" }) {\n  if (captcharegistry[\"friendly-captcha\"])\n    throw new Error(\"Duplicate friendly captcha initialization\");\n\n  if (options?.script)\n    script = options.script;\n  if (options?.endpoint)\n    endpoint = options.endpoint;\n\n  captcharegistry[\"friendly-captcha\"] = { initialize: runFriendlyCaptcha };\n}\n","/* To verify tree shaking viability, try:\n   whcd\n   cd whtree\n   echo 'import \"@webhare/forms\"' | node_modules/.bin/esbuild --loader:.css=empty --tsconfig=tsconfig.json --bundle --minify\n*/\n\n// This gets TypeScript to refer to us by our @webhare/... name in auto imports:\ndeclare module \"@webhare/forms\" {\n}\n\nimport FormBase from '@mod-publisher/js/forms/rpc';\nimport { default as LocalFormBase } from \"@mod-publisher/js/forms/formbase\"; //'FormBase', the RPC-ing one, is the one you want 99% of the time. LocalFormBase is for pure local handling (eg a PWA Config screen)\nimport { verifyAddress, type AddressValidationResult, type AddressChecks } from './address';\nimport { FileUploadFormElement as FileEditElement } from \"@mod-publisher/js/forms/fields/upload\";\nimport { ImgEditElement } from \"@mod-publisher/js/forms/fields/imgedit\";\nimport { JSFormElement } from './jsformelement';\nimport type { FormFileValue, FormAnalyticsEvent } from './types';\nimport { getFormHandler, getFormData } from './domsupport';\nimport { configureForms, registerHandlers } from './registration';\n\n/* TODO / NOTES\n  - we cannot move this file into jssdk namespace, the lang.json compiler doesn't accept paths that cannot be translated to a WH resource\n  - lang.json isn't really TS compatible, a nicer followup TS interface would allow something like\n    import myModuleTexts from \"wh:tid/mymodle\";\n    and offer intellisense (after solving the problems like \"what if a module wants to export multiple sets, how to implement HTMLTid and variables, etc\")\n  - so for now we'll hardcode importing form.lang.json so external users don't have to do this, take the treeshaking hit, and plan to move builtin texts\n    to some sort of /.wh/generated/builtin-language-texts system where we load the common builtin texts per language on demand\n*/\nimport \"@mod-publisher/js/forms/internal/form.lang.json\";\nimport { omit } from '@webhare/std';\n\nexport { FormBase, verifyAddress, ImgEditElement, FileEditElement, JSFormElement, getFormHandler, getFormData };\nexport type { FormSubmitResult } from \"@mod-publisher/js/forms/formbase\";\nexport { buildRPCFormSubmission as buildFormSubmission, submitRPCForm as submitForm } from \"@mod-publisher/js/forms/rpc\";\nexport type { RPCFormSubmission as FormSubmission } from \"./types\";\nexport type { AddressValidationResult, AddressChecks, FormFileValue, FormAnalyticsEvent };\nexport { DateField, TimeField } from \"@mod-publisher/js/forms/fields/datetime\";\nexport { registerHandler } from \"./registration\";\nexport { setupGoogleRecaptcha } from \"@mod-publisher/js/captcha/google-recaptcha\";\nexport { setupFriendlyCaptcha } from \"./friendly-captcha\";\nexport { setupValidator } from \"@mod-publisher/js/forms/internal/customvalidation\";\nexport { LocalFormBase };\n\nexport type FormHandlerFactory = (form: HTMLFormElement) => LocalFormBase;\n\nexport type FormConfiguration = {\n  captcha?: \"onLoad\" | \"onActivate\";\n};\n\nexport type FormSetupOptions = FormConfiguration & {\n  handlers: Record<string, FormHandlerFactory>;\n};\n\n/// Initialize all forms we already have the handler for\nexport function setupForms(options?: Partial<FormSetupOptions>) {\n  registerHandlers(options?.handlers ?? {});\n  if (options)\n    configureForms(omit(options, [\"handlers\"]));\n}\n","type Cleanup = () => void;\ntype Init = (root: HTMLElement) => void | Cleanup;\nconst registry: Array<{ selector: string; init: Init }> = [];\n// Per element its cleanups and where it stood when it was mounted: an element may move itself out of its scope in\n// init (the application popup goes to <body>), and must still be stopped along with the scope it came from\nconst live = new Map<HTMLElement, { cleanups: Cleanup[]; origin: Node }>();\n\n/** Registers behavior for every element matching `selector`. `init` may return a cleanup. */\nexport function component(selector: string, init: Init): void {\n  registry.push({ selector, init });\n}\n\n/** Starts all registered behavior inside `scope` (the document on first load, the swapped containers after a swup visit). */\nexport function mount(scope: ParentNode = document): void {\n  for (const { selector, init } of registry)\n    for (const el of scope.querySelectorAll<HTMLElement>(selector)) {\n      const origin = el.parentNode ?? el;\n      const cleanup = init(el);\n      if (!cleanup) continue;\n      const entry = live.get(el) ?? { cleanups: [], origin };\n      entry.cleanups.push(cleanup);\n      live.set(el, entry);\n    }\n}\n\n/** Stops behavior of every element mounted inside `scope`; used before swup replaces it. */\nexport function unmount(scope: Element): void {\n  for (const [el, { cleanups, origin }] of live)\n    if (scope.contains(el) || scope.contains(origin)) {\n      cleanups.forEach((fn) => fn());\n      live.delete(el);\n    }\n}\n","function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\n/*!\n * GSAP 3.13.0\n * https://gsap.com\n *\n * @license Copyright 2008-2025, GreenSock. All rights reserved.\n * Subject to the terms at https://gsap.com/standard-license\n * @author: Jack Doyle, jack@greensock.com\n*/\n\n/* eslint-disable */\nvar _config = {\n  autoSleep: 120,\n  force3D: \"auto\",\n  nullTargetWarn: 1,\n  units: {\n    lineHeight: \"\"\n  }\n},\n    _defaults = {\n  duration: .5,\n  overwrite: false,\n  delay: 0\n},\n    _suppressOverwrites,\n    _reverting,\n    _context,\n    _bigNum = 1e8,\n    _tinyNum = 1 / _bigNum,\n    _2PI = Math.PI * 2,\n    _HALF_PI = _2PI / 4,\n    _gsID = 0,\n    _sqrt = Math.sqrt,\n    _cos = Math.cos,\n    _sin = Math.sin,\n    _isString = function _isString(value) {\n  return typeof value === \"string\";\n},\n    _isFunction = function _isFunction(value) {\n  return typeof value === \"function\";\n},\n    _isNumber = function _isNumber(value) {\n  return typeof value === \"number\";\n},\n    _isUndefined = function _isUndefined(value) {\n  return typeof value === \"undefined\";\n},\n    _isObject = function _isObject(value) {\n  return typeof value === \"object\";\n},\n    _isNotFalse = function _isNotFalse(value) {\n  return value !== false;\n},\n    _windowExists = function _windowExists() {\n  return typeof window !== \"undefined\";\n},\n    _isFuncOrString = function _isFuncOrString(value) {\n  return _isFunction(value) || _isString(value);\n},\n    _isTypedArray = typeof ArrayBuffer === \"function\" && ArrayBuffer.isView || function () {},\n    // note: IE10 has ArrayBuffer, but NOT ArrayBuffer.isView().\n_isArray = Array.isArray,\n    _strictNumExp = /(?:-?\\.?\\d|\\.)+/gi,\n    //only numbers (including negatives and decimals) but NOT relative values.\n_numExp = /[-+=.]*\\d+[.e\\-+]*\\d*[e\\-+]*\\d*/g,\n    //finds any numbers, including ones that start with += or -=, negative numbers, and ones in scientific notation like 1e-8.\n_numWithUnitExp = /[-+=.]*\\d+[.e-]*\\d*[a-z%]*/g,\n    _complexStringNumExp = /[-+=.]*\\d+\\.?\\d*(?:e-|e\\+)?\\d*/gi,\n    //duplicate so that while we're looping through matches from exec(), it doesn't contaminate the lastIndex of _numExp which we use to search for colors too.\n_relExp = /[+-]=-?[.\\d]+/,\n    _delimitedValueExp = /[^,'\"\\[\\]\\s]+/gi,\n    // previously /[#\\-+.]*\\b[a-z\\d\\-=+%.]+/gi but didn't catch special characters.\n_unitExp = /^[+\\-=e\\s\\d]*\\d+[.\\d]*([a-z]*|%)\\s*$/i,\n    _globalTimeline,\n    _win,\n    _coreInitted,\n    _doc,\n    _globals = {},\n    _installScope = {},\n    _coreReady,\n    _install = function _install(scope) {\n  return (_installScope = _merge(scope, _globals)) && gsap;\n},\n    _missingPlugin = function _missingPlugin(property, value) {\n  return console.warn(\"Invalid property\", property, \"set to\", value, \"Missing plugin? gsap.registerPlugin()\");\n},\n    _warn = function _warn(message, suppress) {\n  return !suppress && console.warn(message);\n},\n    _addGlobal = function _addGlobal(name, obj) {\n  return name && (_globals[name] = obj) && _installScope && (_installScope[name] = obj) || _globals;\n},\n    _emptyFunc = function _emptyFunc() {\n  return 0;\n},\n    _startAtRevertConfig = {\n  suppressEvents: true,\n  isStart: true,\n  kill: false\n},\n    _revertConfigNoKill = {\n  suppressEvents: true,\n  kill: false\n},\n    _revertConfig = {\n  suppressEvents: true\n},\n    _reservedProps = {},\n    _lazyTweens = [],\n    _lazyLookup = {},\n    _lastRenderedFrame,\n    _plugins = {},\n    _effects = {},\n    _nextGCFrame = 30,\n    _harnessPlugins = [],\n    _callbackNames = \"\",\n    _harness = function _harness(targets) {\n  var target = targets[0],\n      harnessPlugin,\n      i;\n  _isObject(target) || _isFunction(target) || (targets = [targets]);\n\n  if (!(harnessPlugin = (target._gsap || {}).harness)) {\n    // find the first target with a harness. We assume targets passed into an animation will be of similar type, meaning the same kind of harness can be used for them all (performance optimization)\n    i = _harnessPlugins.length;\n\n    while (i-- && !_harnessPlugins[i].targetTest(target)) {}\n\n    harnessPlugin = _harnessPlugins[i];\n  }\n\n  i = targets.length;\n\n  while (i--) {\n    targets[i] && (targets[i]._gsap || (targets[i]._gsap = new GSCache(targets[i], harnessPlugin))) || targets.splice(i, 1);\n  }\n\n  return targets;\n},\n    _getCache = function _getCache(target) {\n  return target._gsap || _harness(toArray(target))[0]._gsap;\n},\n    _getProperty = function _getProperty(target, property, v) {\n  return (v = target[property]) && _isFunction(v) ? target[property]() : _isUndefined(v) && target.getAttribute && target.getAttribute(property) || v;\n},\n    _forEachName = function _forEachName(names, func) {\n  return (names = names.split(\",\")).forEach(func) || names;\n},\n    //split a comma-delimited list of names into an array, then run a forEach() function and return the split array (this is just a way to consolidate/shorten some code).\n_round = function _round(value) {\n  return Math.round(value * 100000) / 100000 || 0;\n},\n    _roundPrecise = function _roundPrecise(value) {\n  return Math.round(value * 10000000) / 10000000 || 0;\n},\n    // increased precision mostly for timing values.\n_parseRelative = function _parseRelative(start, value) {\n  var operator = value.charAt(0),\n      end = parseFloat(value.substr(2));\n  start = parseFloat(start);\n  return operator === \"+\" ? start + end : operator === \"-\" ? start - end : operator === \"*\" ? start * end : start / end;\n},\n    _arrayContainsAny = function _arrayContainsAny(toSearch, toFind) {\n  //searches one array to find matches for any of the items in the toFind array. As soon as one is found, it returns true. It does NOT return all the matches; it's simply a boolean search.\n  var l = toFind.length,\n      i = 0;\n\n  for (; toSearch.indexOf(toFind[i]) < 0 && ++i < l;) {}\n\n  return i < l;\n},\n    _lazyRender = function _lazyRender() {\n  var l = _lazyTweens.length,\n      a = _lazyTweens.slice(0),\n      i,\n      tween;\n\n  _lazyLookup = {};\n  _lazyTweens.length = 0;\n\n  for (i = 0; i < l; i++) {\n    tween = a[i];\n    tween && tween._lazy && (tween.render(tween._lazy[0], tween._lazy[1], true)._lazy = 0);\n  }\n},\n    _isRevertWorthy = function _isRevertWorthy(animation) {\n  return !!(animation._initted || animation._startAt || animation.add);\n},\n    _lazySafeRender = function _lazySafeRender(animation, time, suppressEvents, force) {\n  _lazyTweens.length && !_reverting && _lazyRender();\n  animation.render(time, suppressEvents, force || !!(_reverting && time < 0 && _isRevertWorthy(animation)));\n  _lazyTweens.length && !_reverting && _lazyRender(); //in case rendering caused any tweens to lazy-init, we should render them because typically when someone calls seek() or time() or progress(), they expect an immediate render.\n},\n    _numericIfPossible = function _numericIfPossible(value) {\n  var n = parseFloat(value);\n  return (n || n === 0) && (value + \"\").match(_delimitedValueExp).length < 2 ? n : _isString(value) ? value.trim() : value;\n},\n    _passThrough = function _passThrough(p) {\n  return p;\n},\n    _setDefaults = function _setDefaults(obj, defaults) {\n  for (var p in defaults) {\n    p in obj || (obj[p] = defaults[p]);\n  }\n\n  return obj;\n},\n    _setKeyframeDefaults = function _setKeyframeDefaults(excludeDuration) {\n  return function (obj, defaults) {\n    for (var p in defaults) {\n      p in obj || p === \"duration\" && excludeDuration || p === \"ease\" || (obj[p] = defaults[p]);\n    }\n  };\n},\n    _merge = function _merge(base, toMerge) {\n  for (var p in toMerge) {\n    base[p] = toMerge[p];\n  }\n\n  return base;\n},\n    _mergeDeep = function _mergeDeep(base, toMerge) {\n  for (var p in toMerge) {\n    p !== \"__proto__\" && p !== \"constructor\" && p !== \"prototype\" && (base[p] = _isObject(toMerge[p]) ? _mergeDeep(base[p] || (base[p] = {}), toMerge[p]) : toMerge[p]);\n  }\n\n  return base;\n},\n    _copyExcluding = function _copyExcluding(obj, excluding) {\n  var copy = {},\n      p;\n\n  for (p in obj) {\n    p in excluding || (copy[p] = obj[p]);\n  }\n\n  return copy;\n},\n    _inheritDefaults = function _inheritDefaults(vars) {\n  var parent = vars.parent || _globalTimeline,\n      func = vars.keyframes ? _setKeyframeDefaults(_isArray(vars.keyframes)) : _setDefaults;\n\n  if (_isNotFalse(vars.inherit)) {\n    while (parent) {\n      func(vars, parent.vars.defaults);\n      parent = parent.parent || parent._dp;\n    }\n  }\n\n  return vars;\n},\n    _arraysMatch = function _arraysMatch(a1, a2) {\n  var i = a1.length,\n      match = i === a2.length;\n\n  while (match && i-- && a1[i] === a2[i]) {}\n\n  return i < 0;\n},\n    _addLinkedListItem = function _addLinkedListItem(parent, child, firstProp, lastProp, sortBy) {\n  if (firstProp === void 0) {\n    firstProp = \"_first\";\n  }\n\n  if (lastProp === void 0) {\n    lastProp = \"_last\";\n  }\n\n  var prev = parent[lastProp],\n      t;\n\n  if (sortBy) {\n    t = child[sortBy];\n\n    while (prev && prev[sortBy] > t) {\n      prev = prev._prev;\n    }\n  }\n\n  if (prev) {\n    child._next = prev._next;\n    prev._next = child;\n  } else {\n    child._next = parent[firstProp];\n    parent[firstProp] = child;\n  }\n\n  if (child._next) {\n    child._next._prev = child;\n  } else {\n    parent[lastProp] = child;\n  }\n\n  child._prev = prev;\n  child.parent = child._dp = parent;\n  return child;\n},\n    _removeLinkedListItem = function _removeLinkedListItem(parent, child, firstProp, lastProp) {\n  if (firstProp === void 0) {\n    firstProp = \"_first\";\n  }\n\n  if (lastProp === void 0) {\n    lastProp = \"_last\";\n  }\n\n  var prev = child._prev,\n      next = child._next;\n\n  if (prev) {\n    prev._next = next;\n  } else if (parent[firstProp] === child) {\n    parent[firstProp] = next;\n  }\n\n  if (next) {\n    next._prev = prev;\n  } else if (parent[lastProp] === child) {\n    parent[lastProp] = prev;\n  }\n\n  child._next = child._prev = child.parent = null; // don't delete the _dp just so we can revert if necessary. But parent should be null to indicate the item isn't in a linked list.\n},\n    _removeFromParent = function _removeFromParent(child, onlyIfParentHasAutoRemove) {\n  child.parent && (!onlyIfParentHasAutoRemove || child.parent.autoRemoveChildren) && child.parent.remove && child.parent.remove(child);\n  child._act = 0;\n},\n    _uncache = function _uncache(animation, child) {\n  if (animation && (!child || child._end > animation._dur || child._start < 0)) {\n    // performance optimization: if a child animation is passed in we should only uncache if that child EXTENDS the animation (its end time is beyond the end)\n    var a = animation;\n\n    while (a) {\n      a._dirty = 1;\n      a = a.parent;\n    }\n  }\n\n  return animation;\n},\n    _recacheAncestors = function _recacheAncestors(animation) {\n  var parent = animation.parent;\n\n  while (parent && parent.parent) {\n    //sometimes we must force a re-sort of all children and update the duration/totalDuration of all ancestor timelines immediately in case, for example, in the middle of a render loop, one tween alters another tween's timeScale which shoves its startTime before 0, forcing the parent timeline to shift around and shiftChildren() which could affect that next tween's render (startTime). Doesn't matter for the root timeline though.\n    parent._dirty = 1;\n    parent.totalDuration();\n    parent = parent.parent;\n  }\n\n  return animation;\n},\n    _rewindStartAt = function _rewindStartAt(tween, totalTime, suppressEvents, force) {\n  return tween._startAt && (_reverting ? tween._startAt.revert(_revertConfigNoKill) : tween.vars.immediateRender && !tween.vars.autoRevert || tween._startAt.render(totalTime, true, force));\n},\n    _hasNoPausedAncestors = function _hasNoPausedAncestors(animation) {\n  return !animation || animation._ts && _hasNoPausedAncestors(animation.parent);\n},\n    _elapsedCycleDuration = function _elapsedCycleDuration(animation) {\n  return animation._repeat ? _animationCycle(animation._tTime, animation = animation.duration() + animation._rDelay) * animation : 0;\n},\n    // feed in the totalTime and cycleDuration and it'll return the cycle (iteration minus 1) and if the playhead is exactly at the very END, it will NOT bump up to the next cycle.\n_animationCycle = function _animationCycle(tTime, cycleDuration) {\n  var whole = Math.floor(tTime = _roundPrecise(tTime / cycleDuration));\n  return tTime && whole === tTime ? whole - 1 : whole;\n},\n    _parentToChildTotalTime = function _parentToChildTotalTime(parentTime, child) {\n  return (parentTime - child._start) * child._ts + (child._ts >= 0 ? 0 : child._dirty ? child.totalDuration() : child._tDur);\n},\n    _setEnd = function _setEnd(animation) {\n  return animation._end = _roundPrecise(animation._start + (animation._tDur / Math.abs(animation._ts || animation._rts || _tinyNum) || 0));\n},\n    _alignPlayhead = function _alignPlayhead(animation, totalTime) {\n  // adjusts the animation's _start and _end according to the provided totalTime (only if the parent's smoothChildTiming is true and the animation isn't paused). It doesn't do any rendering or forcing things back into parent timelines, etc. - that's what totalTime() is for.\n  var parent = animation._dp;\n\n  if (parent && parent.smoothChildTiming && animation._ts) {\n    animation._start = _roundPrecise(parent._time - (animation._ts > 0 ? totalTime / animation._ts : ((animation._dirty ? animation.totalDuration() : animation._tDur) - totalTime) / -animation._ts));\n\n    _setEnd(animation);\n\n    parent._dirty || _uncache(parent, animation); //for performance improvement. If the parent's cache is already dirty, it already took care of marking the ancestors as dirty too, so skip the function call here.\n  }\n\n  return animation;\n},\n\n/*\n_totalTimeToTime = (clampedTotalTime, duration, repeat, repeatDelay, yoyo) => {\n\tlet cycleDuration = duration + repeatDelay,\n\t\ttime = _round(clampedTotalTime % cycleDuration);\n\tif (time > duration) {\n\t\ttime = duration;\n\t}\n\treturn (yoyo && (~~(clampedTotalTime / cycleDuration) & 1)) ? duration - time : time;\n},\n*/\n_postAddChecks = function _postAddChecks(timeline, child) {\n  var t;\n\n  if (child._time || !child._dur && child._initted || child._start < timeline._time && (child._dur || !child.add)) {\n    // in case, for example, the _start is moved on a tween that has already rendered, or if it's being inserted into a timeline BEFORE where the playhead is currently. Imagine it's at its end state, then the startTime is moved WAY later (after the end of this timeline), it should render at its beginning. Special case: if it's a timeline (has .add() method) and no duration, we can skip rendering because the user may be populating it AFTER adding it to a parent timeline (unconventional, but possible, and we wouldn't want it to get removed if the parent's autoRemoveChildren is true).\n    t = _parentToChildTotalTime(timeline.rawTime(), child);\n\n    if (!child._dur || _clamp(0, child.totalDuration(), t) - child._tTime > _tinyNum) {\n      child.render(t, true);\n    }\n  } //if the timeline has already ended but the inserted tween/timeline extends the duration, we should enable this timeline again so that it renders properly. We should also align the playhead with the parent timeline's when appropriate.\n\n\n  if (_uncache(timeline, child)._dp && timeline._initted && timeline._time >= timeline._dur && timeline._ts) {\n    //in case any of the ancestors had completed but should now be enabled...\n    if (timeline._dur < timeline.duration()) {\n      t = timeline;\n\n      while (t._dp) {\n        t.rawTime() >= 0 && t.totalTime(t._tTime); //moves the timeline (shifts its startTime) if necessary, and also enables it. If it's currently zero, though, it may not be scheduled to render until later so there's no need to force it to align with the current playhead position. Only move to catch up with the playhead.\n\n        t = t._dp;\n      }\n    }\n\n    timeline._zTime = -_tinyNum; // helps ensure that the next render() will be forced (crossingStart = true in render()), even if the duration hasn't changed (we're adding a child which would need to get rendered). Definitely an edge case. Note: we MUST do this AFTER the loop above where the totalTime() might trigger a render() because this _addToTimeline() method gets called from the Animation constructor, BEFORE tweens even record their targets, etc. so we wouldn't want things to get triggered in the wrong order.\n  }\n},\n    _addToTimeline = function _addToTimeline(timeline, child, position, skipChecks) {\n  child.parent && _removeFromParent(child);\n  child._start = _roundPrecise((_isNumber(position) ? position : position || timeline !== _globalTimeline ? _parsePosition(timeline, position, child) : timeline._time) + child._delay);\n  child._end = _roundPrecise(child._start + (child.totalDuration() / Math.abs(child.timeScale()) || 0));\n\n  _addLinkedListItem(timeline, child, \"_first\", \"_last\", timeline._sort ? \"_start\" : 0);\n\n  _isFromOrFromStart(child) || (timeline._recent = child);\n  skipChecks || _postAddChecks(timeline, child);\n  timeline._ts < 0 && _alignPlayhead(timeline, timeline._tTime); // if the timeline is reversed and the new child makes it longer, we may need to adjust the parent's _start (push it back)\n\n  return timeline;\n},\n    _scrollTrigger = function _scrollTrigger(animation, trigger) {\n  return (_globals.ScrollTrigger || _missingPlugin(\"scrollTrigger\", trigger)) && _globals.ScrollTrigger.create(trigger, animation);\n},\n    _attemptInitTween = function _attemptInitTween(tween, time, force, suppressEvents, tTime) {\n  _initTween(tween, time, tTime);\n\n  if (!tween._initted) {\n    return 1;\n  }\n\n  if (!force && tween._pt && !_reverting && (tween._dur && tween.vars.lazy !== false || !tween._dur && tween.vars.lazy) && _lastRenderedFrame !== _ticker.frame) {\n    _lazyTweens.push(tween);\n\n    tween._lazy = [tTime, suppressEvents];\n    return 1;\n  }\n},\n    _parentPlayheadIsBeforeStart = function _parentPlayheadIsBeforeStart(_ref) {\n  var parent = _ref.parent;\n  return parent && parent._ts && parent._initted && !parent._lock && (parent.rawTime() < 0 || _parentPlayheadIsBeforeStart(parent));\n},\n    // check parent's _lock because when a timeline repeats/yoyos and does its artificial wrapping, we shouldn't force the ratio back to 0\n_isFromOrFromStart = function _isFromOrFromStart(_ref2) {\n  var data = _ref2.data;\n  return data === \"isFromStart\" || data === \"isStart\";\n},\n    _renderZeroDurationTween = function _renderZeroDurationTween(tween, totalTime, suppressEvents, force) {\n  var prevRatio = tween.ratio,\n      ratio = totalTime < 0 || !totalTime && (!tween._start && _parentPlayheadIsBeforeStart(tween) && !(!tween._initted && _isFromOrFromStart(tween)) || (tween._ts < 0 || tween._dp._ts < 0) && !_isFromOrFromStart(tween)) ? 0 : 1,\n      // if the tween or its parent is reversed and the totalTime is 0, we should go to a ratio of 0. Edge case: if a from() or fromTo() stagger tween is placed later in a timeline, the \"startAt\" zero-duration tween could initially render at a time when the parent timeline's playhead is technically BEFORE where this tween is, so make sure that any \"from\" and \"fromTo\" startAt tweens are rendered the first time at a ratio of 1.\n  repeatDelay = tween._rDelay,\n      tTime = 0,\n      pt,\n      iteration,\n      prevIteration;\n\n  if (repeatDelay && tween._repeat) {\n    // in case there's a zero-duration tween that has a repeat with a repeatDelay\n    tTime = _clamp(0, tween._tDur, totalTime);\n    iteration = _animationCycle(tTime, repeatDelay);\n    tween._yoyo && iteration & 1 && (ratio = 1 - ratio);\n\n    if (iteration !== _animationCycle(tween._tTime, repeatDelay)) {\n      // if iteration changed\n      prevRatio = 1 - ratio;\n      tween.vars.repeatRefresh && tween._initted && tween.invalidate();\n    }\n  }\n\n  if (ratio !== prevRatio || _reverting || force || tween._zTime === _tinyNum || !totalTime && tween._zTime) {\n    if (!tween._initted && _attemptInitTween(tween, totalTime, force, suppressEvents, tTime)) {\n      // if we render the very beginning (time == 0) of a fromTo(), we must force the render (normal tweens wouldn't need to render at a time of 0 when the prevTime was also 0). This is also mandatory to make sure overwriting kicks in immediately.\n      return;\n    }\n\n    prevIteration = tween._zTime;\n    tween._zTime = totalTime || (suppressEvents ? _tinyNum : 0); // when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect.\n\n    suppressEvents || (suppressEvents = totalTime && !prevIteration); // if it was rendered previously at exactly 0 (_zTime) and now the playhead is moving away, DON'T fire callbacks otherwise they'll seem like duplicates.\n\n    tween.ratio = ratio;\n    tween._from && (ratio = 1 - ratio);\n    tween._time = 0;\n    tween._tTime = tTime;\n    pt = tween._pt;\n\n    while (pt) {\n      pt.r(ratio, pt.d);\n      pt = pt._next;\n    }\n\n    totalTime < 0 && _rewindStartAt(tween, totalTime, suppressEvents, true);\n    tween._onUpdate && !suppressEvents && _callback(tween, \"onUpdate\");\n    tTime && tween._repeat && !suppressEvents && tween.parent && _callback(tween, \"onRepeat\");\n\n    if ((totalTime >= tween._tDur || totalTime < 0) && tween.ratio === ratio) {\n      ratio && _removeFromParent(tween, 1);\n\n      if (!suppressEvents && !_reverting) {\n        _callback(tween, ratio ? \"onComplete\" : \"onReverseComplete\", true);\n\n        tween._prom && tween._prom();\n      }\n    }\n  } else if (!tween._zTime) {\n    tween._zTime = totalTime;\n  }\n},\n    _findNextPauseTween = function _findNextPauseTween(animation, prevTime, time) {\n  var child;\n\n  if (time > prevTime) {\n    child = animation._first;\n\n    while (child && child._start <= time) {\n      if (child.data === \"isPause\" && child._start > prevTime) {\n        return child;\n      }\n\n      child = child._next;\n    }\n  } else {\n    child = animation._last;\n\n    while (child && child._start >= time) {\n      if (child.data === \"isPause\" && child._start < prevTime) {\n        return child;\n      }\n\n      child = child._prev;\n    }\n  }\n},\n    _setDuration = function _setDuration(animation, duration, skipUncache, leavePlayhead) {\n  var repeat = animation._repeat,\n      dur = _roundPrecise(duration) || 0,\n      totalProgress = animation._tTime / animation._tDur;\n  totalProgress && !leavePlayhead && (animation._time *= dur / animation._dur);\n  animation._dur = dur;\n  animation._tDur = !repeat ? dur : repeat < 0 ? 1e10 : _roundPrecise(dur * (repeat + 1) + animation._rDelay * repeat);\n  totalProgress > 0 && !leavePlayhead && _alignPlayhead(animation, animation._tTime = animation._tDur * totalProgress);\n  animation.parent && _setEnd(animation);\n  skipUncache || _uncache(animation.parent, animation);\n  return animation;\n},\n    _onUpdateTotalDuration = function _onUpdateTotalDuration(animation) {\n  return animation instanceof Timeline ? _uncache(animation) : _setDuration(animation, animation._dur);\n},\n    _zeroPosition = {\n  _start: 0,\n  endTime: _emptyFunc,\n  totalDuration: _emptyFunc\n},\n    _parsePosition = function _parsePosition(animation, position, percentAnimation) {\n  var labels = animation.labels,\n      recent = animation._recent || _zeroPosition,\n      clippedDuration = animation.duration() >= _bigNum ? recent.endTime(false) : animation._dur,\n      //in case there's a child that infinitely repeats, users almost never intend for the insertion point of a new child to be based on a SUPER long value like that so we clip it and assume the most recently-added child's endTime should be used instead.\n  i,\n      offset,\n      isPercent;\n\n  if (_isString(position) && (isNaN(position) || position in labels)) {\n    //if the string is a number like \"1\", check to see if there's a label with that name, otherwise interpret it as a number (absolute value).\n    offset = position.charAt(0);\n    isPercent = position.substr(-1) === \"%\";\n    i = position.indexOf(\"=\");\n\n    if (offset === \"<\" || offset === \">\") {\n      i >= 0 && (position = position.replace(/=/, \"\"));\n      return (offset === \"<\" ? recent._start : recent.endTime(recent._repeat >= 0)) + (parseFloat(position.substr(1)) || 0) * (isPercent ? (i < 0 ? recent : percentAnimation).totalDuration() / 100 : 1);\n    }\n\n    if (i < 0) {\n      position in labels || (labels[position] = clippedDuration);\n      return labels[position];\n    }\n\n    offset = parseFloat(position.charAt(i - 1) + position.substr(i + 1));\n\n    if (isPercent && percentAnimation) {\n      offset = offset / 100 * (_isArray(percentAnimation) ? percentAnimation[0] : percentAnimation).totalDuration();\n    }\n\n    return i > 1 ? _parsePosition(animation, position.substr(0, i - 1), percentAnimation) + offset : clippedDuration + offset;\n  }\n\n  return position == null ? clippedDuration : +position;\n},\n    _createTweenType = function _createTweenType(type, params, timeline) {\n  var isLegacy = _isNumber(params[1]),\n      varsIndex = (isLegacy ? 2 : 1) + (type < 2 ? 0 : 1),\n      vars = params[varsIndex],\n      irVars,\n      parent;\n\n  isLegacy && (vars.duration = params[1]);\n  vars.parent = timeline;\n\n  if (type) {\n    irVars = vars;\n    parent = timeline;\n\n    while (parent && !(\"immediateRender\" in irVars)) {\n      // inheritance hasn't happened yet, but someone may have set a default in an ancestor timeline. We could do vars.immediateRender = _isNotFalse(_inheritDefaults(vars).immediateRender) but that'd exact a slight performance penalty because _inheritDefaults() also runs in the Tween constructor. We're paying a small kb price here to gain speed.\n      irVars = parent.vars.defaults || {};\n      parent = _isNotFalse(parent.vars.inherit) && parent.parent;\n    }\n\n    vars.immediateRender = _isNotFalse(irVars.immediateRender);\n    type < 2 ? vars.runBackwards = 1 : vars.startAt = params[varsIndex - 1]; // \"from\" vars\n  }\n\n  return new Tween(params[0], vars, params[varsIndex + 1]);\n},\n    _conditionalReturn = function _conditionalReturn(value, func) {\n  return value || value === 0 ? func(value) : func;\n},\n    _clamp = function _clamp(min, max, value) {\n  return value < min ? min : value > max ? max : value;\n},\n    getUnit = function getUnit(value, v) {\n  return !_isString(value) || !(v = _unitExp.exec(value)) ? \"\" : v[1];\n},\n    // note: protect against padded numbers as strings, like \"100.100\". That shouldn't return \"00\" as the unit. If it's numeric, return no unit.\nclamp = function clamp(min, max, value) {\n  return _conditionalReturn(value, function (v) {\n    return _clamp(min, max, v);\n  });\n},\n    _slice = [].slice,\n    _isArrayLike = function _isArrayLike(value, nonEmpty) {\n  return value && _isObject(value) && \"length\" in value && (!nonEmpty && !value.length || value.length - 1 in value && _isObject(value[0])) && !value.nodeType && value !== _win;\n},\n    _flatten = function _flatten(ar, leaveStrings, accumulator) {\n  if (accumulator === void 0) {\n    accumulator = [];\n  }\n\n  return ar.forEach(function (value) {\n    var _accumulator;\n\n    return _isString(value) && !leaveStrings || _isArrayLike(value, 1) ? (_accumulator = accumulator).push.apply(_accumulator, toArray(value)) : accumulator.push(value);\n  }) || accumulator;\n},\n    //takes any value and returns an array. If it's a string (and leaveStrings isn't true), it'll use document.querySelectorAll() and convert that to an array. It'll also accept iterables like jQuery objects.\ntoArray = function toArray(value, scope, leaveStrings) {\n  return _context && !scope && _context.selector ? _context.selector(value) : _isString(value) && !leaveStrings && (_coreInitted || !_wake()) ? _slice.call((scope || _doc).querySelectorAll(value), 0) : _isArray(value) ? _flatten(value, leaveStrings) : _isArrayLike(value) ? _slice.call(value, 0) : value ? [value] : [];\n},\n    selector = function selector(value) {\n  value = toArray(value)[0] || _warn(\"Invalid scope\") || {};\n  return function (v) {\n    var el = value.current || value.nativeElement || value;\n    return toArray(v, el.querySelectorAll ? el : el === value ? _warn(\"Invalid scope\") || _doc.createElement(\"div\") : value);\n  };\n},\n    shuffle = function shuffle(a) {\n  return a.sort(function () {\n    return .5 - Math.random();\n  });\n},\n    // alternative that's a bit faster and more reliably diverse but bigger:   for (let j, v, i = a.length; i; j = (Math.random() * i) | 0, v = a[--i], a[i] = a[j], a[j] = v); return a;\n//for distributing values across an array. Can accept a number, a function or (most commonly) a function which can contain the following properties: {base, amount, from, ease, grid, axis, length, each}. Returns a function that expects the following parameters: index, target, array. Recognizes the following\ndistribute = function distribute(v) {\n  if (_isFunction(v)) {\n    return v;\n  }\n\n  var vars = _isObject(v) ? v : {\n    each: v\n  },\n      //n:1 is just to indicate v was a number; we leverage that later to set v according to the length we get. If a number is passed in, we treat it like the old stagger value where 0.1, for example, would mean that things would be distributed with 0.1 between each element in the array rather than a total \"amount\" that's chunked out among them all.\n  ease = _parseEase(vars.ease),\n      from = vars.from || 0,\n      base = parseFloat(vars.base) || 0,\n      cache = {},\n      isDecimal = from > 0 && from < 1,\n      ratios = isNaN(from) || isDecimal,\n      axis = vars.axis,\n      ratioX = from,\n      ratioY = from;\n\n  if (_isString(from)) {\n    ratioX = ratioY = {\n      center: .5,\n      edges: .5,\n      end: 1\n    }[from] || 0;\n  } else if (!isDecimal && ratios) {\n    ratioX = from[0];\n    ratioY = from[1];\n  }\n\n  return function (i, target, a) {\n    var l = (a || vars).length,\n        distances = cache[l],\n        originX,\n        originY,\n        x,\n        y,\n        d,\n        j,\n        max,\n        min,\n        wrapAt;\n\n    if (!distances) {\n      wrapAt = vars.grid === \"auto\" ? 0 : (vars.grid || [1, _bigNum])[1];\n\n      if (!wrapAt) {\n        max = -_bigNum;\n\n        while (max < (max = a[wrapAt++].getBoundingClientRect().left) && wrapAt < l) {}\n\n        wrapAt < l && wrapAt--;\n      }\n\n      distances = cache[l] = [];\n      originX = ratios ? Math.min(wrapAt, l) * ratioX - .5 : from % wrapAt;\n      originY = wrapAt === _bigNum ? 0 : ratios ? l * ratioY / wrapAt - .5 : from / wrapAt | 0;\n      max = 0;\n      min = _bigNum;\n\n      for (j = 0; j < l; j++) {\n        x = j % wrapAt - originX;\n        y = originY - (j / wrapAt | 0);\n        distances[j] = d = !axis ? _sqrt(x * x + y * y) : Math.abs(axis === \"y\" ? y : x);\n        d > max && (max = d);\n        d < min && (min = d);\n      }\n\n      from === \"random\" && shuffle(distances);\n      distances.max = max - min;\n      distances.min = min;\n      distances.v = l = (parseFloat(vars.amount) || parseFloat(vars.each) * (wrapAt > l ? l - 1 : !axis ? Math.max(wrapAt, l / wrapAt) : axis === \"y\" ? l / wrapAt : wrapAt) || 0) * (from === \"edges\" ? -1 : 1);\n      distances.b = l < 0 ? base - l : base;\n      distances.u = getUnit(vars.amount || vars.each) || 0; //unit\n\n      ease = ease && l < 0 ? _invertEase(ease) : ease;\n    }\n\n    l = (distances[i] - distances.min) / distances.max || 0;\n    return _roundPrecise(distances.b + (ease ? ease(l) : l) * distances.v) + distances.u; //round in order to work around floating point errors\n  };\n},\n    _roundModifier = function _roundModifier(v) {\n  //pass in 0.1 get a function that'll round to the nearest tenth, or 5 to round to the closest 5, or 0.001 to the closest 1000th, etc.\n  var p = Math.pow(10, ((v + \"\").split(\".\")[1] || \"\").length); //to avoid floating point math errors (like 24 * 0.1 == 2.4000000000000004), we chop off at a specific number of decimal places (much faster than toFixed())\n\n  return function (raw) {\n    var n = _roundPrecise(Math.round(parseFloat(raw) / v) * v * p);\n\n    return (n - n % 1) / p + (_isNumber(raw) ? 0 : getUnit(raw)); // n - n % 1 replaces Math.floor() in order to handle negative values properly. For example, Math.floor(-150.00000000000003) is 151!\n  };\n},\n    snap = function snap(snapTo, value) {\n  var isArray = _isArray(snapTo),\n      radius,\n      is2D;\n\n  if (!isArray && _isObject(snapTo)) {\n    radius = isArray = snapTo.radius || _bigNum;\n\n    if (snapTo.values) {\n      snapTo = toArray(snapTo.values);\n\n      if (is2D = !_isNumber(snapTo[0])) {\n        radius *= radius; //performance optimization so we don't have to Math.sqrt() in the loop.\n      }\n    } else {\n      snapTo = _roundModifier(snapTo.increment);\n    }\n  }\n\n  return _conditionalReturn(value, !isArray ? _roundModifier(snapTo) : _isFunction(snapTo) ? function (raw) {\n    is2D = snapTo(raw);\n    return Math.abs(is2D - raw) <= radius ? is2D : raw;\n  } : function (raw) {\n    var x = parseFloat(is2D ? raw.x : raw),\n        y = parseFloat(is2D ? raw.y : 0),\n        min = _bigNum,\n        closest = 0,\n        i = snapTo.length,\n        dx,\n        dy;\n\n    while (i--) {\n      if (is2D) {\n        dx = snapTo[i].x - x;\n        dy = snapTo[i].y - y;\n        dx = dx * dx + dy * dy;\n      } else {\n        dx = Math.abs(snapTo[i] - x);\n      }\n\n      if (dx < min) {\n        min = dx;\n        closest = i;\n      }\n    }\n\n    closest = !radius || min <= radius ? snapTo[closest] : raw;\n    return is2D || closest === raw || _isNumber(raw) ? closest : closest + getUnit(raw);\n  });\n},\n    random = function random(min, max, roundingIncrement, returnFunction) {\n  return _conditionalReturn(_isArray(min) ? !max : roundingIncrement === true ? !!(roundingIncrement = 0) : !returnFunction, function () {\n    return _isArray(min) ? min[~~(Math.random() * min.length)] : (roundingIncrement = roundingIncrement || 1e-5) && (returnFunction = roundingIncrement < 1 ? Math.pow(10, (roundingIncrement + \"\").length - 2) : 1) && Math.floor(Math.round((min - roundingIncrement / 2 + Math.random() * (max - min + roundingIncrement * .99)) / roundingIncrement) * roundingIncrement * returnFunction) / returnFunction;\n  });\n},\n    pipe = function pipe() {\n  for (var _len = arguments.length, functions = new Array(_len), _key = 0; _key < _len; _key++) {\n    functions[_key] = arguments[_key];\n  }\n\n  return function (value) {\n    return functions.reduce(function (v, f) {\n      return f(v);\n    }, value);\n  };\n},\n    unitize = function unitize(func, unit) {\n  return function (value) {\n    return func(parseFloat(value)) + (unit || getUnit(value));\n  };\n},\n    normalize = function normalize(min, max, value) {\n  return mapRange(min, max, 0, 1, value);\n},\n    _wrapArray = function _wrapArray(a, wrapper, value) {\n  return _conditionalReturn(value, function (index) {\n    return a[~~wrapper(index)];\n  });\n},\n    wrap = function wrap(min, max, value) {\n  // NOTE: wrap() CANNOT be an arrow function! A very odd compiling bug causes problems (unrelated to GSAP).\n  var range = max - min;\n  return _isArray(min) ? _wrapArray(min, wrap(0, min.length), max) : _conditionalReturn(value, function (value) {\n    return (range + (value - min) % range) % range + min;\n  });\n},\n    wrapYoyo = function wrapYoyo(min, max, value) {\n  var range = max - min,\n      total = range * 2;\n  return _isArray(min) ? _wrapArray(min, wrapYoyo(0, min.length - 1), max) : _conditionalReturn(value, function (value) {\n    value = (total + (value - min) % total) % total || 0;\n    return min + (value > range ? total - value : value);\n  });\n},\n    _replaceRandom = function _replaceRandom(value) {\n  //replaces all occurrences of random(...) in a string with the calculated random value. can be a range like random(-100, 100, 5) or an array like random([0, 100, 500])\n  var prev = 0,\n      s = \"\",\n      i,\n      nums,\n      end,\n      isArray;\n\n  while (~(i = value.indexOf(\"random(\", prev))) {\n    end = value.indexOf(\")\", i);\n    isArray = value.charAt(i + 7) === \"[\";\n    nums = value.substr(i + 7, end - i - 7).match(isArray ? _delimitedValueExp : _strictNumExp);\n    s += value.substr(prev, i - prev) + random(isArray ? nums : +nums[0], isArray ? 0 : +nums[1], +nums[2] || 1e-5);\n    prev = end + 1;\n  }\n\n  return s + value.substr(prev, value.length - prev);\n},\n    mapRange = function mapRange(inMin, inMax, outMin, outMax, value) {\n  var inRange = inMax - inMin,\n      outRange = outMax - outMin;\n  return _conditionalReturn(value, function (value) {\n    return outMin + ((value - inMin) / inRange * outRange || 0);\n  });\n},\n    interpolate = function interpolate(start, end, progress, mutate) {\n  var func = isNaN(start + end) ? 0 : function (p) {\n    return (1 - p) * start + p * end;\n  };\n\n  if (!func) {\n    var isString = _isString(start),\n        master = {},\n        p,\n        i,\n        interpolators,\n        l,\n        il;\n\n    progress === true && (mutate = 1) && (progress = null);\n\n    if (isString) {\n      start = {\n        p: start\n      };\n      end = {\n        p: end\n      };\n    } else if (_isArray(start) && !_isArray(end)) {\n      interpolators = [];\n      l = start.length;\n      il = l - 2;\n\n      for (i = 1; i < l; i++) {\n        interpolators.push(interpolate(start[i - 1], start[i])); //build the interpolators up front as a performance optimization so that when the function is called many times, it can just reuse them.\n      }\n\n      l--;\n\n      func = function func(p) {\n        p *= l;\n        var i = Math.min(il, ~~p);\n        return interpolators[i](p - i);\n      };\n\n      progress = end;\n    } else if (!mutate) {\n      start = _merge(_isArray(start) ? [] : {}, start);\n    }\n\n    if (!interpolators) {\n      for (p in end) {\n        _addPropTween.call(master, start, p, \"get\", end[p]);\n      }\n\n      func = function func(p) {\n        return _renderPropTweens(p, master) || (isString ? start.p : start);\n      };\n    }\n  }\n\n  return _conditionalReturn(progress, func);\n},\n    _getLabelInDirection = function _getLabelInDirection(timeline, fromTime, backward) {\n  //used for nextLabel() and previousLabel()\n  var labels = timeline.labels,\n      min = _bigNum,\n      p,\n      distance,\n      label;\n\n  for (p in labels) {\n    distance = labels[p] - fromTime;\n\n    if (distance < 0 === !!backward && distance && min > (distance = Math.abs(distance))) {\n      label = p;\n      min = distance;\n    }\n  }\n\n  return label;\n},\n    _callback = function _callback(animation, type, executeLazyFirst) {\n  var v = animation.vars,\n      callback = v[type],\n      prevContext = _context,\n      context = animation._ctx,\n      params,\n      scope,\n      result;\n\n  if (!callback) {\n    return;\n  }\n\n  params = v[type + \"Params\"];\n  scope = v.callbackScope || animation;\n  executeLazyFirst && _lazyTweens.length && _lazyRender(); //in case rendering caused any tweens to lazy-init, we should render them because typically when a timeline finishes, users expect things to have rendered fully. Imagine an onUpdate on a timeline that reports/checks tweened values.\n\n  context && (_context = context);\n  result = params ? callback.apply(scope, params) : callback.call(scope);\n  _context = prevContext;\n  return result;\n},\n    _interrupt = function _interrupt(animation) {\n  _removeFromParent(animation);\n\n  animation.scrollTrigger && animation.scrollTrigger.kill(!!_reverting);\n  animation.progress() < 1 && _callback(animation, \"onInterrupt\");\n  return animation;\n},\n    _quickTween,\n    _registerPluginQueue = [],\n    _createPlugin = function _createPlugin(config) {\n  if (!config) return;\n  config = !config.name && config[\"default\"] || config; // UMD packaging wraps things oddly, so for example MotionPathHelper becomes {MotionPathHelper:MotionPathHelper, default:MotionPathHelper}.\n\n  if (_windowExists() || config.headless) {\n    // edge case: some build tools may pass in a null/undefined value\n    var name = config.name,\n        isFunc = _isFunction(config),\n        Plugin = name && !isFunc && config.init ? function () {\n      this._props = [];\n    } : config,\n        //in case someone passes in an object that's not a plugin, like CustomEase\n    instanceDefaults = {\n      init: _emptyFunc,\n      render: _renderPropTweens,\n      add: _addPropTween,\n      kill: _killPropTweensOf,\n      modifier: _addPluginModifier,\n      rawVars: 0\n    },\n        statics = {\n      targetTest: 0,\n      get: 0,\n      getSetter: _getSetter,\n      aliases: {},\n      register: 0\n    };\n\n    _wake();\n\n    if (config !== Plugin) {\n      if (_plugins[name]) {\n        return;\n      }\n\n      _setDefaults(Plugin, _setDefaults(_copyExcluding(config, instanceDefaults), statics)); //static methods\n\n\n      _merge(Plugin.prototype, _merge(instanceDefaults, _copyExcluding(config, statics))); //instance methods\n\n\n      _plugins[Plugin.prop = name] = Plugin;\n\n      if (config.targetTest) {\n        _harnessPlugins.push(Plugin);\n\n        _reservedProps[name] = 1;\n      }\n\n      name = (name === \"css\" ? \"CSS\" : name.charAt(0).toUpperCase() + name.substr(1)) + \"Plugin\"; //for the global name. \"motionPath\" should become MotionPathPlugin\n    }\n\n    _addGlobal(name, Plugin);\n\n    config.register && config.register(gsap, Plugin, PropTween);\n  } else {\n    _registerPluginQueue.push(config);\n  }\n},\n\n/*\n * --------------------------------------------------------------------------------------\n * COLORS\n * --------------------------------------------------------------------------------------\n */\n_255 = 255,\n    _colorLookup = {\n  aqua: [0, _255, _255],\n  lime: [0, _255, 0],\n  silver: [192, 192, 192],\n  black: [0, 0, 0],\n  maroon: [128, 0, 0],\n  teal: [0, 128, 128],\n  blue: [0, 0, _255],\n  navy: [0, 0, 128],\n  white: [_255, _255, _255],\n  olive: [128, 128, 0],\n  yellow: [_255, _255, 0],\n  orange: [_255, 165, 0],\n  gray: [128, 128, 128],\n  purple: [128, 0, 128],\n  green: [0, 128, 0],\n  red: [_255, 0, 0],\n  pink: [_255, 192, 203],\n  cyan: [0, _255, _255],\n  transparent: [_255, _255, _255, 0]\n},\n    // possible future idea to replace the hard-coded color name values - put this in the ticker.wake() where we set the _doc:\n// let ctx = _doc.createElement(\"canvas\").getContext(\"2d\");\n// _forEachName(\"aqua,lime,silver,black,maroon,teal,blue,navy,white,olive,yellow,orange,gray,purple,green,red,pink,cyan\", color => {ctx.fillStyle = color; _colorLookup[color] = splitColor(ctx.fillStyle)});\n_hue = function _hue(h, m1, m2) {\n  h += h < 0 ? 1 : h > 1 ? -1 : 0;\n  return (h * 6 < 1 ? m1 + (m2 - m1) * h * 6 : h < .5 ? m2 : h * 3 < 2 ? m1 + (m2 - m1) * (2 / 3 - h) * 6 : m1) * _255 + .5 | 0;\n},\n    splitColor = function splitColor(v, toHSL, forceAlpha) {\n  var a = !v ? _colorLookup.black : _isNumber(v) ? [v >> 16, v >> 8 & _255, v & _255] : 0,\n      r,\n      g,\n      b,\n      h,\n      s,\n      l,\n      max,\n      min,\n      d,\n      wasHSL;\n\n  if (!a) {\n    if (v.substr(-1) === \",\") {\n      //sometimes a trailing comma is included and we should chop it off (typically from a comma-delimited list of values like a textShadow:\"2px 2px 2px blue, 5px 5px 5px rgb(255,0,0)\" - in this example \"blue,\" has a trailing comma. We could strip it out inside parseComplex() but we'd need to do it to the beginning and ending values plus it wouldn't provide protection from other potential scenarios like if the user passes in a similar value.\n      v = v.substr(0, v.length - 1);\n    }\n\n    if (_colorLookup[v]) {\n      a = _colorLookup[v];\n    } else if (v.charAt(0) === \"#\") {\n      if (v.length < 6) {\n        //for shorthand like #9F0 or #9F0F (could have alpha)\n        r = v.charAt(1);\n        g = v.charAt(2);\n        b = v.charAt(3);\n        v = \"#\" + r + r + g + g + b + b + (v.length === 5 ? v.charAt(4) + v.charAt(4) : \"\");\n      }\n\n      if (v.length === 9) {\n        // hex with alpha, like #fd5e53ff\n        a = parseInt(v.substr(1, 6), 16);\n        return [a >> 16, a >> 8 & _255, a & _255, parseInt(v.substr(7), 16) / 255];\n      }\n\n      v = parseInt(v.substr(1), 16);\n      a = [v >> 16, v >> 8 & _255, v & _255];\n    } else if (v.substr(0, 3) === \"hsl\") {\n      a = wasHSL = v.match(_strictNumExp);\n\n      if (!toHSL) {\n        h = +a[0] % 360 / 360;\n        s = +a[1] / 100;\n        l = +a[2] / 100;\n        g = l <= .5 ? l * (s + 1) : l + s - l * s;\n        r = l * 2 - g;\n        a.length > 3 && (a[3] *= 1); //cast as number\n\n        a[0] = _hue(h + 1 / 3, r, g);\n        a[1] = _hue(h, r, g);\n        a[2] = _hue(h - 1 / 3, r, g);\n      } else if (~v.indexOf(\"=\")) {\n        //if relative values are found, just return the raw strings with the relative prefixes in place.\n        a = v.match(_numExp);\n        forceAlpha && a.length < 4 && (a[3] = 1);\n        return a;\n      }\n    } else {\n      a = v.match(_strictNumExp) || _colorLookup.transparent;\n    }\n\n    a = a.map(Number);\n  }\n\n  if (toHSL && !wasHSL) {\n    r = a[0] / _255;\n    g = a[1] / _255;\n    b = a[2] / _255;\n    max = Math.max(r, g, b);\n    min = Math.min(r, g, b);\n    l = (max + min) / 2;\n\n    if (max === min) {\n      h = s = 0;\n    } else {\n      d = max - min;\n      s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n      h = max === r ? (g - b) / d + (g < b ? 6 : 0) : max === g ? (b - r) / d + 2 : (r - g) / d + 4;\n      h *= 60;\n    }\n\n    a[0] = ~~(h + .5);\n    a[1] = ~~(s * 100 + .5);\n    a[2] = ~~(l * 100 + .5);\n  }\n\n  forceAlpha && a.length < 4 && (a[3] = 1);\n  return a;\n},\n    _colorOrderData = function _colorOrderData(v) {\n  // strips out the colors from the string, finds all the numeric slots (with units) and returns an array of those. The Array also has a \"c\" property which is an Array of the index values where the colors belong. This is to help work around issues where there's a mis-matched order of color/numeric data like drop-shadow(#f00 0px 1px 2px) and drop-shadow(0x 1px 2px #f00). This is basically a helper function used in _formatColors()\n  var values = [],\n      c = [],\n      i = -1;\n  v.split(_colorExp).forEach(function (v) {\n    var a = v.match(_numWithUnitExp) || [];\n    values.push.apply(values, a);\n    c.push(i += a.length + 1);\n  });\n  values.c = c;\n  return values;\n},\n    _formatColors = function _formatColors(s, toHSL, orderMatchData) {\n  var result = \"\",\n      colors = (s + result).match(_colorExp),\n      type = toHSL ? \"hsla(\" : \"rgba(\",\n      i = 0,\n      c,\n      shell,\n      d,\n      l;\n\n  if (!colors) {\n    return s;\n  }\n\n  colors = colors.map(function (color) {\n    return (color = splitColor(color, toHSL, 1)) && type + (toHSL ? color[0] + \",\" + color[1] + \"%,\" + color[2] + \"%,\" + color[3] : color.join(\",\")) + \")\";\n  });\n\n  if (orderMatchData) {\n    d = _colorOrderData(s);\n    c = orderMatchData.c;\n\n    if (c.join(result) !== d.c.join(result)) {\n      shell = s.replace(_colorExp, \"1\").split(_numWithUnitExp);\n      l = shell.length - 1;\n\n      for (; i < l; i++) {\n        result += shell[i] + (~c.indexOf(i) ? colors.shift() || type + \"0,0,0,0)\" : (d.length ? d : colors.length ? colors : orderMatchData).shift());\n      }\n    }\n  }\n\n  if (!shell) {\n    shell = s.split(_colorExp);\n    l = shell.length - 1;\n\n    for (; i < l; i++) {\n      result += shell[i] + colors[i];\n    }\n  }\n\n  return result + shell[l];\n},\n    _colorExp = function () {\n  var s = \"(?:\\\\b(?:(?:rgb|rgba|hsl|hsla)\\\\(.+?\\\\))|\\\\B#(?:[0-9a-f]{3,4}){1,2}\\\\b\",\n      //we'll dynamically build this Regular Expression to conserve file size. After building it, it will be able to find rgb(), rgba(), # (hexadecimal), and named color values like red, blue, purple, etc.,\n  p;\n\n  for (p in _colorLookup) {\n    s += \"|\" + p + \"\\\\b\";\n  }\n\n  return new RegExp(s + \")\", \"gi\");\n}(),\n    _hslExp = /hsl[a]?\\(/,\n    _colorStringFilter = function _colorStringFilter(a) {\n  var combined = a.join(\" \"),\n      toHSL;\n  _colorExp.lastIndex = 0;\n\n  if (_colorExp.test(combined)) {\n    toHSL = _hslExp.test(combined);\n    a[1] = _formatColors(a[1], toHSL);\n    a[0] = _formatColors(a[0], toHSL, _colorOrderData(a[1])); // make sure the order of numbers/colors match with the END value.\n\n    return true;\n  }\n},\n\n/*\n * --------------------------------------------------------------------------------------\n * TICKER\n * --------------------------------------------------------------------------------------\n */\n_tickerActive,\n    _ticker = function () {\n  var _getTime = Date.now,\n      _lagThreshold = 500,\n      _adjustedLag = 33,\n      _startTime = _getTime(),\n      _lastUpdate = _startTime,\n      _gap = 1000 / 240,\n      _nextTime = _gap,\n      _listeners = [],\n      _id,\n      _req,\n      _raf,\n      _self,\n      _delta,\n      _i,\n      _tick = function _tick(v) {\n    var elapsed = _getTime() - _lastUpdate,\n        manual = v === true,\n        overlap,\n        dispatch,\n        time,\n        frame;\n\n    (elapsed > _lagThreshold || elapsed < 0) && (_startTime += elapsed - _adjustedLag);\n    _lastUpdate += elapsed;\n    time = _lastUpdate - _startTime;\n    overlap = time - _nextTime;\n\n    if (overlap > 0 || manual) {\n      frame = ++_self.frame;\n      _delta = time - _self.time * 1000;\n      _self.time = time = time / 1000;\n      _nextTime += overlap + (overlap >= _gap ? 4 : _gap - overlap);\n      dispatch = 1;\n    }\n\n    manual || (_id = _req(_tick)); //make sure the request is made before we dispatch the \"tick\" event so that timing is maintained. Otherwise, if processing the \"tick\" requires a bunch of time (like 15ms) and we're using a setTimeout() that's based on 16.7ms, it'd technically take 31.7ms between frames otherwise.\n\n    if (dispatch) {\n      for (_i = 0; _i < _listeners.length; _i++) {\n        // use _i and check _listeners.length instead of a variable because a listener could get removed during the loop, and if that happens to an element less than the current index, it'd throw things off in the loop.\n        _listeners[_i](time, _delta, frame, v);\n      }\n    }\n  };\n\n  _self = {\n    time: 0,\n    frame: 0,\n    tick: function tick() {\n      _tick(true);\n    },\n    deltaRatio: function deltaRatio(fps) {\n      return _delta / (1000 / (fps || 60));\n    },\n    wake: function wake() {\n      if (_coreReady) {\n        if (!_coreInitted && _windowExists()) {\n          _win = _coreInitted = window;\n          _doc = _win.document || {};\n          _globals.gsap = gsap;\n          (_win.gsapVersions || (_win.gsapVersions = [])).push(gsap.version);\n\n          _install(_installScope || _win.GreenSockGlobals || !_win.gsap && _win || {});\n\n          _registerPluginQueue.forEach(_createPlugin);\n        }\n\n        _raf = typeof requestAnimationFrame !== \"undefined\" && requestAnimationFrame;\n        _id && _self.sleep();\n\n        _req = _raf || function (f) {\n          return setTimeout(f, _nextTime - _self.time * 1000 + 1 | 0);\n        };\n\n        _tickerActive = 1;\n\n        _tick(2);\n      }\n    },\n    sleep: function sleep() {\n      (_raf ? cancelAnimationFrame : clearTimeout)(_id);\n      _tickerActive = 0;\n      _req = _emptyFunc;\n    },\n    lagSmoothing: function lagSmoothing(threshold, adjustedLag) {\n      _lagThreshold = threshold || Infinity; // zero should be interpreted as basically unlimited\n\n      _adjustedLag = Math.min(adjustedLag || 33, _lagThreshold);\n    },\n    fps: function fps(_fps) {\n      _gap = 1000 / (_fps || 240);\n      _nextTime = _self.time * 1000 + _gap;\n    },\n    add: function add(callback, once, prioritize) {\n      var func = once ? function (t, d, f, v) {\n        callback(t, d, f, v);\n\n        _self.remove(func);\n      } : callback;\n\n      _self.remove(callback);\n\n      _listeners[prioritize ? \"unshift\" : \"push\"](func);\n\n      _wake();\n\n      return func;\n    },\n    remove: function remove(callback, i) {\n      ~(i = _listeners.indexOf(callback)) && _listeners.splice(i, 1) && _i >= i && _i--;\n    },\n    _listeners: _listeners\n  };\n  return _self;\n}(),\n    _wake = function _wake() {\n  return !_tickerActive && _ticker.wake();\n},\n    //also ensures the core classes are initialized.\n\n/*\n* -------------------------------------------------\n* EASING\n* -------------------------------------------------\n*/\n_easeMap = {},\n    _customEaseExp = /^[\\d.\\-M][\\d.\\-,\\s]/,\n    _quotesExp = /[\"']/g,\n    _parseObjectInString = function _parseObjectInString(value) {\n  //takes a string like \"{wiggles:10, type:anticipate})\" and turns it into a real object. Notice it ends in \")\" and includes the {} wrappers. This is because we only use this function for parsing ease configs and prioritized optimization rather than reusability.\n  var obj = {},\n      split = value.substr(1, value.length - 3).split(\":\"),\n      key = split[0],\n      i = 1,\n      l = split.length,\n      index,\n      val,\n      parsedVal;\n\n  for (; i < l; i++) {\n    val = split[i];\n    index = i !== l - 1 ? val.lastIndexOf(\",\") : val.length;\n    parsedVal = val.substr(0, index);\n    obj[key] = isNaN(parsedVal) ? parsedVal.replace(_quotesExp, \"\").trim() : +parsedVal;\n    key = val.substr(index + 1).trim();\n  }\n\n  return obj;\n},\n    _valueInParentheses = function _valueInParentheses(value) {\n  var open = value.indexOf(\"(\") + 1,\n      close = value.indexOf(\")\"),\n      nested = value.indexOf(\"(\", open);\n  return value.substring(open, ~nested && nested < close ? value.indexOf(\")\", close + 1) : close);\n},\n    _configEaseFromString = function _configEaseFromString(name) {\n  //name can be a string like \"elastic.out(1,0.5)\", and pass in _easeMap as obj and it'll parse it out and call the actual function like _easeMap.Elastic.easeOut.config(1,0.5). It will also parse custom ease strings as long as CustomEase is loaded and registered (internally as _easeMap._CE).\n  var split = (name + \"\").split(\"(\"),\n      ease = _easeMap[split[0]];\n  return ease && split.length > 1 && ease.config ? ease.config.apply(null, ~name.indexOf(\"{\") ? [_parseObjectInString(split[1])] : _valueInParentheses(name).split(\",\").map(_numericIfPossible)) : _easeMap._CE && _customEaseExp.test(name) ? _easeMap._CE(\"\", name) : ease;\n},\n    _invertEase = function _invertEase(ease) {\n  return function (p) {\n    return 1 - ease(1 - p);\n  };\n},\n    // allow yoyoEase to be set in children and have those affected when the parent/ancestor timeline yoyos.\n_propagateYoyoEase = function _propagateYoyoEase(timeline, isYoyo) {\n  var child = timeline._first,\n      ease;\n\n  while (child) {\n    if (child instanceof Timeline) {\n      _propagateYoyoEase(child, isYoyo);\n    } else if (child.vars.yoyoEase && (!child._yoyo || !child._repeat) && child._yoyo !== isYoyo) {\n      if (child.timeline) {\n        _propagateYoyoEase(child.timeline, isYoyo);\n      } else {\n        ease = child._ease;\n        child._ease = child._yEase;\n        child._yEase = ease;\n        child._yoyo = isYoyo;\n      }\n    }\n\n    child = child._next;\n  }\n},\n    _parseEase = function _parseEase(ease, defaultEase) {\n  return !ease ? defaultEase : (_isFunction(ease) ? ease : _easeMap[ease] || _configEaseFromString(ease)) || defaultEase;\n},\n    _insertEase = function _insertEase(names, easeIn, easeOut, easeInOut) {\n  if (easeOut === void 0) {\n    easeOut = function easeOut(p) {\n      return 1 - easeIn(1 - p);\n    };\n  }\n\n  if (easeInOut === void 0) {\n    easeInOut = function easeInOut(p) {\n      return p < .5 ? easeIn(p * 2) / 2 : 1 - easeIn((1 - p) * 2) / 2;\n    };\n  }\n\n  var ease = {\n    easeIn: easeIn,\n    easeOut: easeOut,\n    easeInOut: easeInOut\n  },\n      lowercaseName;\n\n  _forEachName(names, function (name) {\n    _easeMap[name] = _globals[name] = ease;\n    _easeMap[lowercaseName = name.toLowerCase()] = easeOut;\n\n    for (var p in ease) {\n      _easeMap[lowercaseName + (p === \"easeIn\" ? \".in\" : p === \"easeOut\" ? \".out\" : \".inOut\")] = _easeMap[name + \".\" + p] = ease[p];\n    }\n  });\n\n  return ease;\n},\n    _easeInOutFromOut = function _easeInOutFromOut(easeOut) {\n  return function (p) {\n    return p < .5 ? (1 - easeOut(1 - p * 2)) / 2 : .5 + easeOut((p - .5) * 2) / 2;\n  };\n},\n    _configElastic = function _configElastic(type, amplitude, period) {\n  var p1 = amplitude >= 1 ? amplitude : 1,\n      //note: if amplitude is < 1, we simply adjust the period for a more natural feel. Otherwise the math doesn't work right and the curve starts at 1.\n  p2 = (period || (type ? .3 : .45)) / (amplitude < 1 ? amplitude : 1),\n      p3 = p2 / _2PI * (Math.asin(1 / p1) || 0),\n      easeOut = function easeOut(p) {\n    return p === 1 ? 1 : p1 * Math.pow(2, -10 * p) * _sin((p - p3) * p2) + 1;\n  },\n      ease = type === \"out\" ? easeOut : type === \"in\" ? function (p) {\n    return 1 - easeOut(1 - p);\n  } : _easeInOutFromOut(easeOut);\n\n  p2 = _2PI / p2; //precalculate to optimize\n\n  ease.config = function (amplitude, period) {\n    return _configElastic(type, amplitude, period);\n  };\n\n  return ease;\n},\n    _configBack = function _configBack(type, overshoot) {\n  if (overshoot === void 0) {\n    overshoot = 1.70158;\n  }\n\n  var easeOut = function easeOut(p) {\n    return p ? --p * p * ((overshoot + 1) * p + overshoot) + 1 : 0;\n  },\n      ease = type === \"out\" ? easeOut : type === \"in\" ? function (p) {\n    return 1 - easeOut(1 - p);\n  } : _easeInOutFromOut(easeOut);\n\n  ease.config = function (overshoot) {\n    return _configBack(type, overshoot);\n  };\n\n  return ease;\n}; // a cheaper (kb and cpu) but more mild way to get a parameterized weighted ease by feeding in a value between -1 (easeIn) and 1 (easeOut) where 0 is linear.\n// _weightedEase = ratio => {\n// \tlet y = 0.5 + ratio / 2;\n// \treturn p => (2 * (1 - p) * p * y + p * p);\n// },\n// a stronger (but more expensive kb/cpu) parameterized weighted ease that lets you feed in a value between -1 (easeIn) and 1 (easeOut) where 0 is linear.\n// _weightedEaseStrong = ratio => {\n// \tratio = .5 + ratio / 2;\n// \tlet o = 1 / 3 * (ratio < .5 ? ratio : 1 - ratio),\n// \t\tb = ratio - o,\n// \t\tc = ratio + o;\n// \treturn p => p === 1 ? p : 3 * b * (1 - p) * (1 - p) * p + 3 * c * (1 - p) * p * p + p * p * p;\n// };\n\n\n_forEachName(\"Linear,Quad,Cubic,Quart,Quint,Strong\", function (name, i) {\n  var power = i < 5 ? i + 1 : i;\n\n  _insertEase(name + \",Power\" + (power - 1), i ? function (p) {\n    return Math.pow(p, power);\n  } : function (p) {\n    return p;\n  }, function (p) {\n    return 1 - Math.pow(1 - p, power);\n  }, function (p) {\n    return p < .5 ? Math.pow(p * 2, power) / 2 : 1 - Math.pow((1 - p) * 2, power) / 2;\n  });\n});\n\n_easeMap.Linear.easeNone = _easeMap.none = _easeMap.Linear.easeIn;\n\n_insertEase(\"Elastic\", _configElastic(\"in\"), _configElastic(\"out\"), _configElastic());\n\n(function (n, c) {\n  var n1 = 1 / c,\n      n2 = 2 * n1,\n      n3 = 2.5 * n1,\n      easeOut = function easeOut(p) {\n    return p < n1 ? n * p * p : p < n2 ? n * Math.pow(p - 1.5 / c, 2) + .75 : p < n3 ? n * (p -= 2.25 / c) * p + .9375 : n * Math.pow(p - 2.625 / c, 2) + .984375;\n  };\n\n  _insertEase(\"Bounce\", function (p) {\n    return 1 - easeOut(1 - p);\n  }, easeOut);\n})(7.5625, 2.75);\n\n_insertEase(\"Expo\", function (p) {\n  return Math.pow(2, 10 * (p - 1)) * p + p * p * p * p * p * p * (1 - p);\n}); // previously 2 ** (10 * (p - 1)) but that doesn't end up with the value quite at the right spot so we do a blended ease to ensure it lands where it should perfectly.\n\n\n_insertEase(\"Circ\", function (p) {\n  return -(_sqrt(1 - p * p) - 1);\n});\n\n_insertEase(\"Sine\", function (p) {\n  return p === 1 ? 1 : -_cos(p * _HALF_PI) + 1;\n});\n\n_insertEase(\"Back\", _configBack(\"in\"), _configBack(\"out\"), _configBack());\n\n_easeMap.SteppedEase = _easeMap.steps = _globals.SteppedEase = {\n  config: function config(steps, immediateStart) {\n    if (steps === void 0) {\n      steps = 1;\n    }\n\n    var p1 = 1 / steps,\n        p2 = steps + (immediateStart ? 0 : 1),\n        p3 = immediateStart ? 1 : 0,\n        max = 1 - _tinyNum;\n    return function (p) {\n      return ((p2 * _clamp(0, max, p) | 0) + p3) * p1;\n    };\n  }\n};\n_defaults.ease = _easeMap[\"quad.out\"];\n\n_forEachName(\"onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt\", function (name) {\n  return _callbackNames += name + \",\" + name + \"Params,\";\n});\n/*\n * --------------------------------------------------------------------------------------\n * CACHE\n * --------------------------------------------------------------------------------------\n */\n\n\nexport var GSCache = function GSCache(target, harness) {\n  this.id = _gsID++;\n  target._gsap = this;\n  this.target = target;\n  this.harness = harness;\n  this.get = harness ? harness.get : _getProperty;\n  this.set = harness ? harness.getSetter : _getSetter;\n};\n/*\n * --------------------------------------------------------------------------------------\n * ANIMATION\n * --------------------------------------------------------------------------------------\n */\n\nexport var Animation = /*#__PURE__*/function () {\n  function Animation(vars) {\n    this.vars = vars;\n    this._delay = +vars.delay || 0;\n\n    if (this._repeat = vars.repeat === Infinity ? -2 : vars.repeat || 0) {\n      // TODO: repeat: Infinity on a timeline's children must flag that timeline internally and affect its totalDuration, otherwise it'll stop in the negative direction when reaching the start.\n      this._rDelay = vars.repeatDelay || 0;\n      this._yoyo = !!vars.yoyo || !!vars.yoyoEase;\n    }\n\n    this._ts = 1;\n\n    _setDuration(this, +vars.duration, 1, 1);\n\n    this.data = vars.data;\n\n    if (_context) {\n      this._ctx = _context;\n\n      _context.data.push(this);\n    }\n\n    _tickerActive || _ticker.wake();\n  }\n\n  var _proto = Animation.prototype;\n\n  _proto.delay = function delay(value) {\n    if (value || value === 0) {\n      this.parent && this.parent.smoothChildTiming && this.startTime(this._start + value - this._delay);\n      this._delay = value;\n      return this;\n    }\n\n    return this._delay;\n  };\n\n  _proto.duration = function duration(value) {\n    return arguments.length ? this.totalDuration(this._repeat > 0 ? value + (value + this._rDelay) * this._repeat : value) : this.totalDuration() && this._dur;\n  };\n\n  _proto.totalDuration = function totalDuration(value) {\n    if (!arguments.length) {\n      return this._tDur;\n    }\n\n    this._dirty = 0;\n    return _setDuration(this, this._repeat < 0 ? value : (value - this._repeat * this._rDelay) / (this._repeat + 1));\n  };\n\n  _proto.totalTime = function totalTime(_totalTime, suppressEvents) {\n    _wake();\n\n    if (!arguments.length) {\n      return this._tTime;\n    }\n\n    var parent = this._dp;\n\n    if (parent && parent.smoothChildTiming && this._ts) {\n      _alignPlayhead(this, _totalTime);\n\n      !parent._dp || parent.parent || _postAddChecks(parent, this); // edge case: if this is a child of a timeline that already completed, for example, we must re-activate the parent.\n      //in case any of the ancestor timelines had completed but should now be enabled, we should reset their totalTime() which will also ensure that they're lined up properly and enabled. Skip for animations that are on the root (wasteful). Example: a TimelineLite.exportRoot() is performed when there's a paused tween on the root, the export will not complete until that tween is unpaused, but imagine a child gets restarted later, after all [unpaused] tweens have completed. The start of that child would get pushed out, but one of the ancestors may have completed.\n\n      while (parent && parent.parent) {\n        if (parent.parent._time !== parent._start + (parent._ts >= 0 ? parent._tTime / parent._ts : (parent.totalDuration() - parent._tTime) / -parent._ts)) {\n          parent.totalTime(parent._tTime, true);\n        }\n\n        parent = parent.parent;\n      }\n\n      if (!this.parent && this._dp.autoRemoveChildren && (this._ts > 0 && _totalTime < this._tDur || this._ts < 0 && _totalTime > 0 || !this._tDur && !_totalTime)) {\n        //if the animation doesn't have a parent, put it back into its last parent (recorded as _dp for exactly cases like this). Limit to parents with autoRemoveChildren (like globalTimeline) so that if the user manually removes an animation from a timeline and then alters its playhead, it doesn't get added back in.\n        _addToTimeline(this._dp, this, this._start - this._delay);\n      }\n    }\n\n    if (this._tTime !== _totalTime || !this._dur && !suppressEvents || this._initted && Math.abs(this._zTime) === _tinyNum || !_totalTime && !this._initted && (this.add || this._ptLookup)) {\n      // check for _ptLookup on a Tween instance to ensure it has actually finished being instantiated, otherwise if this.reverse() gets called in the Animation constructor, it could trigger a render() here even though the _targets weren't populated, thus when _init() is called there won't be any PropTweens (it'll act like the tween is non-functional)\n      this._ts || (this._pTime = _totalTime); // otherwise, if an animation is paused, then the playhead is moved back to zero, then resumed, it'd revert back to the original time at the pause\n      //if (!this._lock) { // avoid endless recursion (not sure we need this yet or if it's worth the performance hit)\n      //   this._lock = 1;\n\n      _lazySafeRender(this, _totalTime, suppressEvents); //   this._lock = 0;\n      //}\n\n    }\n\n    return this;\n  };\n\n  _proto.time = function time(value, suppressEvents) {\n    return arguments.length ? this.totalTime(Math.min(this.totalDuration(), value + _elapsedCycleDuration(this)) % (this._dur + this._rDelay) || (value ? this._dur : 0), suppressEvents) : this._time; // note: if the modulus results in 0, the playhead could be exactly at the end or the beginning, and we always defer to the END with a non-zero value, otherwise if you set the time() to the very end (duration()), it would render at the START!\n  };\n\n  _proto.totalProgress = function totalProgress(value, suppressEvents) {\n    return arguments.length ? this.totalTime(this.totalDuration() * value, suppressEvents) : this.totalDuration() ? Math.min(1, this._tTime / this._tDur) : this.rawTime() >= 0 && this._initted ? 1 : 0;\n  };\n\n  _proto.progress = function progress(value, suppressEvents) {\n    return arguments.length ? this.totalTime(this.duration() * (this._yoyo && !(this.iteration() & 1) ? 1 - value : value) + _elapsedCycleDuration(this), suppressEvents) : this.duration() ? Math.min(1, this._time / this._dur) : this.rawTime() > 0 ? 1 : 0;\n  };\n\n  _proto.iteration = function iteration(value, suppressEvents) {\n    var cycleDuration = this.duration() + this._rDelay;\n\n    return arguments.length ? this.totalTime(this._time + (value - 1) * cycleDuration, suppressEvents) : this._repeat ? _animationCycle(this._tTime, cycleDuration) + 1 : 1;\n  } // potential future addition:\n  // isPlayingBackwards() {\n  // \tlet animation = this,\n  // \t\torientation = 1; // 1 = forward, -1 = backward\n  // \twhile (animation) {\n  // \t\torientation *= animation.reversed() || (animation.repeat() && !(animation.iteration() & 1)) ? -1 : 1;\n  // \t\tanimation = animation.parent;\n  // \t}\n  // \treturn orientation < 0;\n  // }\n  ;\n\n  _proto.timeScale = function timeScale(value, suppressEvents) {\n    if (!arguments.length) {\n      return this._rts === -_tinyNum ? 0 : this._rts; // recorded timeScale. Special case: if someone calls reverse() on an animation with timeScale of 0, we assign it -_tinyNum to remember it's reversed.\n    }\n\n    if (this._rts === value) {\n      return this;\n    }\n\n    var tTime = this.parent && this._ts ? _parentToChildTotalTime(this.parent._time, this) : this._tTime; // make sure to do the parentToChildTotalTime() BEFORE setting the new _ts because the old one must be used in that calculation.\n    // future addition? Up side: fast and minimal file size. Down side: only works on this animation; if a timeline is reversed, for example, its childrens' onReverse wouldn't get called.\n    //(+value < 0 && this._rts >= 0) && _callback(this, \"onReverse\", true);\n    // prioritize rendering where the parent's playhead lines up instead of this._tTime because there could be a tween that's animating another tween's timeScale in the same rendering loop (same parent), thus if the timeScale tween renders first, it would alter _start BEFORE _tTime was set on that tick (in the rendering loop), effectively freezing it until the timeScale tween finishes.\n\n    this._rts = +value || 0;\n    this._ts = this._ps || value === -_tinyNum ? 0 : this._rts; // _ts is the functional timeScale which would be 0 if the animation is paused.\n\n    this.totalTime(_clamp(-Math.abs(this._delay), this.totalDuration(), tTime), suppressEvents !== false);\n\n    _setEnd(this); // if parent.smoothChildTiming was false, the end time didn't get updated in the _alignPlayhead() method, so do it here.\n\n\n    return _recacheAncestors(this);\n  };\n\n  _proto.paused = function paused(value) {\n    if (!arguments.length) {\n      return this._ps;\n    } // possible future addition - if an animation is removed from its parent and then .restart() or .play() or .resume() is called, perhaps we should force it back into the globalTimeline but be careful because what if it's already at its end? We don't want it to just persist forever and not get released for GC.\n    // !this.parent && !value && this._tTime < this._tDur && this !== _globalTimeline && _globalTimeline.add(this);\n\n\n    if (this._ps !== value) {\n      this._ps = value;\n\n      if (value) {\n        this._pTime = this._tTime || Math.max(-this._delay, this.rawTime()); // if the pause occurs during the delay phase, make sure that's factored in when resuming.\n\n        this._ts = this._act = 0; // _ts is the functional timeScale, so a paused tween would effectively have a timeScale of 0. We record the \"real\" timeScale as _rts (recorded time scale)\n      } else {\n        _wake();\n\n        this._ts = this._rts; //only defer to _pTime (pauseTime) if tTime is zero. Remember, someone could pause() an animation, then scrub the playhead and resume(). If the parent doesn't have smoothChildTiming, we render at the rawTime() because the startTime won't get updated.\n\n        this.totalTime(this.parent && !this.parent.smoothChildTiming ? this.rawTime() : this._tTime || this._pTime, this.progress() === 1 && Math.abs(this._zTime) !== _tinyNum && (this._tTime -= _tinyNum)); // edge case: animation.progress(1).pause().play() wouldn't render again because the playhead is already at the end, but the call to totalTime() below will add it back to its parent...and not remove it again (since removing only happens upon rendering at a new time). Offsetting the _tTime slightly is done simply to cause the final render in totalTime() that'll pop it off its timeline (if autoRemoveChildren is true, of course). Check to make sure _zTime isn't -_tinyNum to avoid an edge case where the playhead is pushed to the end but INSIDE a tween/callback, the timeline itself is paused thus halting rendering and leaving a few unrendered. When resuming, it wouldn't render those otherwise.\n      }\n    }\n\n    return this;\n  };\n\n  _proto.startTime = function startTime(value) {\n    if (arguments.length) {\n      this._start = value;\n      var parent = this.parent || this._dp;\n      parent && (parent._sort || !this.parent) && _addToTimeline(parent, this, value - this._delay);\n      return this;\n    }\n\n    return this._start;\n  };\n\n  _proto.endTime = function endTime(includeRepeats) {\n    return this._start + (_isNotFalse(includeRepeats) ? this.totalDuration() : this.duration()) / Math.abs(this._ts || 1);\n  };\n\n  _proto.rawTime = function rawTime(wrapRepeats) {\n    var parent = this.parent || this._dp; // _dp = detached parent\n\n    return !parent ? this._tTime : wrapRepeats && (!this._ts || this._repeat && this._time && this.totalProgress() < 1) ? this._tTime % (this._dur + this._rDelay) : !this._ts ? this._tTime : _parentToChildTotalTime(parent.rawTime(wrapRepeats), this);\n  };\n\n  _proto.revert = function revert(config) {\n    if (config === void 0) {\n      config = _revertConfig;\n    }\n\n    var prevIsReverting = _reverting;\n    _reverting = config;\n\n    if (_isRevertWorthy(this)) {\n      this.timeline && this.timeline.revert(config);\n      this.totalTime(-0.01, config.suppressEvents);\n    }\n\n    this.data !== \"nested\" && config.kill !== false && this.kill();\n    _reverting = prevIsReverting;\n    return this;\n  };\n\n  _proto.globalTime = function globalTime(rawTime) {\n    var animation = this,\n        time = arguments.length ? rawTime : animation.rawTime();\n\n    while (animation) {\n      time = animation._start + time / (Math.abs(animation._ts) || 1);\n      animation = animation._dp;\n    }\n\n    return !this.parent && this._sat ? this._sat.globalTime(rawTime) : time; // the _startAt tweens for .fromTo() and .from() that have immediateRender should always be FIRST in the timeline (important for context.revert()). \"_sat\" stands for _startAtTween, referring to the parent tween that created the _startAt. We must discern if that tween had immediateRender so that we can know whether or not to prioritize it in revert().\n  };\n\n  _proto.repeat = function repeat(value) {\n    if (arguments.length) {\n      this._repeat = value === Infinity ? -2 : value;\n      return _onUpdateTotalDuration(this);\n    }\n\n    return this._repeat === -2 ? Infinity : this._repeat;\n  };\n\n  _proto.repeatDelay = function repeatDelay(value) {\n    if (arguments.length) {\n      var time = this._time;\n      this._rDelay = value;\n\n      _onUpdateTotalDuration(this);\n\n      return time ? this.time(time) : this;\n    }\n\n    return this._rDelay;\n  };\n\n  _proto.yoyo = function yoyo(value) {\n    if (arguments.length) {\n      this._yoyo = value;\n      return this;\n    }\n\n    return this._yoyo;\n  };\n\n  _proto.seek = function seek(position, suppressEvents) {\n    return this.totalTime(_parsePosition(this, position), _isNotFalse(suppressEvents));\n  };\n\n  _proto.restart = function restart(includeDelay, suppressEvents) {\n    this.play().totalTime(includeDelay ? -this._delay : 0, _isNotFalse(suppressEvents));\n    this._dur || (this._zTime = -_tinyNum); // ensures onComplete fires on a zero-duration animation that gets restarted.\n\n    return this;\n  };\n\n  _proto.play = function play(from, suppressEvents) {\n    from != null && this.seek(from, suppressEvents);\n    return this.reversed(false).paused(false);\n  };\n\n  _proto.reverse = function reverse(from, suppressEvents) {\n    from != null && this.seek(from || this.totalDuration(), suppressEvents);\n    return this.reversed(true).paused(false);\n  };\n\n  _proto.pause = function pause(atTime, suppressEvents) {\n    atTime != null && this.seek(atTime, suppressEvents);\n    return this.paused(true);\n  };\n\n  _proto.resume = function resume() {\n    return this.paused(false);\n  };\n\n  _proto.reversed = function reversed(value) {\n    if (arguments.length) {\n      !!value !== this.reversed() && this.timeScale(-this._rts || (value ? -_tinyNum : 0)); // in case timeScale is zero, reversing would have no effect so we use _tinyNum.\n\n      return this;\n    }\n\n    return this._rts < 0;\n  };\n\n  _proto.invalidate = function invalidate() {\n    this._initted = this._act = 0;\n    this._zTime = -_tinyNum;\n    return this;\n  };\n\n  _proto.isActive = function isActive() {\n    var parent = this.parent || this._dp,\n        start = this._start,\n        rawTime;\n    return !!(!parent || this._ts && this._initted && parent.isActive() && (rawTime = parent.rawTime(true)) >= start && rawTime < this.endTime(true) - _tinyNum);\n  };\n\n  _proto.eventCallback = function eventCallback(type, callback, params) {\n    var vars = this.vars;\n\n    if (arguments.length > 1) {\n      if (!callback) {\n        delete vars[type];\n      } else {\n        vars[type] = callback;\n        params && (vars[type + \"Params\"] = params);\n        type === \"onUpdate\" && (this._onUpdate = callback);\n      }\n\n      return this;\n    }\n\n    return vars[type];\n  };\n\n  _proto.then = function then(onFulfilled) {\n    var self = this;\n    return new Promise(function (resolve) {\n      var f = _isFunction(onFulfilled) ? onFulfilled : _passThrough,\n          _resolve = function _resolve() {\n        var _then = self.then;\n        self.then = null; // temporarily null the then() method to avoid an infinite loop (see https://github.com/greensock/GSAP/issues/322)\n\n        _isFunction(f) && (f = f(self)) && (f.then || f === self) && (self.then = _then);\n        resolve(f);\n        self.then = _then;\n      };\n\n      if (self._initted && self.totalProgress() === 1 && self._ts >= 0 || !self._tTime && self._ts < 0) {\n        _resolve();\n      } else {\n        self._prom = _resolve;\n      }\n    });\n  };\n\n  _proto.kill = function kill() {\n    _interrupt(this);\n  };\n\n  return Animation;\n}();\n\n_setDefaults(Animation.prototype, {\n  _time: 0,\n  _start: 0,\n  _end: 0,\n  _tTime: 0,\n  _tDur: 0,\n  _dirty: 0,\n  _repeat: 0,\n  _yoyo: false,\n  parent: null,\n  _initted: false,\n  _rDelay: 0,\n  _ts: 1,\n  _dp: 0,\n  ratio: 0,\n  _zTime: -_tinyNum,\n  _prom: 0,\n  _ps: false,\n  _rts: 1\n});\n/*\n * -------------------------------------------------\n * TIMELINE\n * -------------------------------------------------\n */\n\n\nexport var Timeline = /*#__PURE__*/function (_Animation) {\n  _inheritsLoose(Timeline, _Animation);\n\n  function Timeline(vars, position) {\n    var _this;\n\n    if (vars === void 0) {\n      vars = {};\n    }\n\n    _this = _Animation.call(this, vars) || this;\n    _this.labels = {};\n    _this.smoothChildTiming = !!vars.smoothChildTiming;\n    _this.autoRemoveChildren = !!vars.autoRemoveChildren;\n    _this._sort = _isNotFalse(vars.sortChildren);\n    _globalTimeline && _addToTimeline(vars.parent || _globalTimeline, _assertThisInitialized(_this), position);\n    vars.reversed && _this.reverse();\n    vars.paused && _this.paused(true);\n    vars.scrollTrigger && _scrollTrigger(_assertThisInitialized(_this), vars.scrollTrigger);\n    return _this;\n  }\n\n  var _proto2 = Timeline.prototype;\n\n  _proto2.to = function to(targets, vars, position) {\n    _createTweenType(0, arguments, this);\n\n    return this;\n  };\n\n  _proto2.from = function from(targets, vars, position) {\n    _createTweenType(1, arguments, this);\n\n    return this;\n  };\n\n  _proto2.fromTo = function fromTo(targets, fromVars, toVars, position) {\n    _createTweenType(2, arguments, this);\n\n    return this;\n  };\n\n  _proto2.set = function set(targets, vars, position) {\n    vars.duration = 0;\n    vars.parent = this;\n    _inheritDefaults(vars).repeatDelay || (vars.repeat = 0);\n    vars.immediateRender = !!vars.immediateRender;\n    new Tween(targets, vars, _parsePosition(this, position), 1);\n    return this;\n  };\n\n  _proto2.call = function call(callback, params, position) {\n    return _addToTimeline(this, Tween.delayedCall(0, callback, params), position);\n  } //ONLY for backward compatibility! Maybe delete?\n  ;\n\n  _proto2.staggerTo = function staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams) {\n    vars.duration = duration;\n    vars.stagger = vars.stagger || stagger;\n    vars.onComplete = onCompleteAll;\n    vars.onCompleteParams = onCompleteAllParams;\n    vars.parent = this;\n    new Tween(targets, vars, _parsePosition(this, position));\n    return this;\n  };\n\n  _proto2.staggerFrom = function staggerFrom(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams) {\n    vars.runBackwards = 1;\n    _inheritDefaults(vars).immediateRender = _isNotFalse(vars.immediateRender);\n    return this.staggerTo(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams);\n  };\n\n  _proto2.staggerFromTo = function staggerFromTo(targets, duration, fromVars, toVars, stagger, position, onCompleteAll, onCompleteAllParams) {\n    toVars.startAt = fromVars;\n    _inheritDefaults(toVars).immediateRender = _isNotFalse(toVars.immediateRender);\n    return this.staggerTo(targets, duration, toVars, stagger, position, onCompleteAll, onCompleteAllParams);\n  };\n\n  _proto2.render = function render(totalTime, suppressEvents, force) {\n    var prevTime = this._time,\n        tDur = this._dirty ? this.totalDuration() : this._tDur,\n        dur = this._dur,\n        tTime = totalTime <= 0 ? 0 : _roundPrecise(totalTime),\n        // if a paused timeline is resumed (or its _start is updated for another reason...which rounds it), that could result in the playhead shifting a **tiny** amount and a zero-duration child at that spot may get rendered at a different ratio, like its totalTime in render() may be 1e-17 instead of 0, for example.\n    crossingStart = this._zTime < 0 !== totalTime < 0 && (this._initted || !dur),\n        time,\n        child,\n        next,\n        iteration,\n        cycleDuration,\n        prevPaused,\n        pauseTween,\n        timeScale,\n        prevStart,\n        prevIteration,\n        yoyo,\n        isYoyo;\n    this !== _globalTimeline && tTime > tDur && totalTime >= 0 && (tTime = tDur);\n\n    if (tTime !== this._tTime || force || crossingStart) {\n      if (prevTime !== this._time && dur) {\n        //if totalDuration() finds a child with a negative startTime and smoothChildTiming is true, things get shifted around internally so we need to adjust the time accordingly. For example, if a tween starts at -30 we must shift EVERYTHING forward 30 seconds and move this timeline's startTime backward by 30 seconds so that things align with the playhead (no jump).\n        tTime += this._time - prevTime;\n        totalTime += this._time - prevTime;\n      }\n\n      time = tTime;\n      prevStart = this._start;\n      timeScale = this._ts;\n      prevPaused = !timeScale;\n\n      if (crossingStart) {\n        dur || (prevTime = this._zTime); //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect.\n\n        (totalTime || !suppressEvents) && (this._zTime = totalTime);\n      }\n\n      if (this._repeat) {\n        //adjust the time for repeats and yoyos\n        yoyo = this._yoyo;\n        cycleDuration = dur + this._rDelay;\n\n        if (this._repeat < -1 && totalTime < 0) {\n          return this.totalTime(cycleDuration * 100 + totalTime, suppressEvents, force);\n        }\n\n        time = _roundPrecise(tTime % cycleDuration); //round to avoid floating point errors. (4 % 0.8 should be 0 but some browsers report it as 0.79999999!)\n\n        if (tTime === tDur) {\n          // the tDur === tTime is for edge cases where there's a lengthy decimal on the duration and it may reach the very end but the time is rendered as not-quite-there (remember, tDur is rounded to 4 decimals whereas dur isn't)\n          iteration = this._repeat;\n          time = dur;\n        } else {\n          prevIteration = _roundPrecise(tTime / cycleDuration); // full decimal version of iterations, not the previous iteration (we're reusing prevIteration variable for efficiency)\n\n          iteration = ~~prevIteration;\n\n          if (iteration && iteration === prevIteration) {\n            time = dur;\n            iteration--;\n          }\n\n          time > dur && (time = dur);\n        }\n\n        prevIteration = _animationCycle(this._tTime, cycleDuration);\n        !prevTime && this._tTime && prevIteration !== iteration && this._tTime - prevIteration * cycleDuration - this._dur <= 0 && (prevIteration = iteration); // edge case - if someone does addPause() at the very beginning of a repeating timeline, that pause is technically at the same spot as the end which causes this._time to get set to 0 when the totalTime would normally place the playhead at the end. See https://gsap.com/forums/topic/23823-closing-nav-animation-not-working-on-ie-and-iphone-6-maybe-other-older-browser/?tab=comments#comment-113005 also, this._tTime - prevIteration * cycleDuration - this._dur <= 0 just checks to make sure it wasn't previously in the \"repeatDelay\" portion\n\n        if (yoyo && iteration & 1) {\n          time = dur - time;\n          isYoyo = 1;\n        }\n        /*\n        make sure children at the end/beginning of the timeline are rendered properly. If, for example,\n        a 3-second long timeline rendered at 2.9 seconds previously, and now renders at 3.2 seconds (which\n        would get translated to 2.8 seconds if the timeline yoyos or 0.2 seconds if it just repeats), there\n        could be a callback or a short tween that's at 2.95 or 3 seconds in which wouldn't render. So\n        we need to push the timeline to the end (and/or beginning depending on its yoyo value). Also we must\n        ensure that zero-duration tweens at the very beginning or end of the Timeline work.\n        */\n\n\n        if (iteration !== prevIteration && !this._lock) {\n          var rewinding = yoyo && prevIteration & 1,\n              doesWrap = rewinding === (yoyo && iteration & 1);\n          iteration < prevIteration && (rewinding = !rewinding);\n          prevTime = rewinding ? 0 : tTime % dur ? dur : tTime; // if the playhead is landing exactly at the end of an iteration, use that totalTime rather than only the duration, otherwise it'll skip the 2nd render since it's effectively at the same time.\n\n          this._lock = 1;\n          this.render(prevTime || (isYoyo ? 0 : _roundPrecise(iteration * cycleDuration)), suppressEvents, !dur)._lock = 0;\n          this._tTime = tTime; // if a user gets the iteration() inside the onRepeat, for example, it should be accurate.\n\n          !suppressEvents && this.parent && _callback(this, \"onRepeat\");\n          this.vars.repeatRefresh && !isYoyo && (this.invalidate()._lock = 1);\n\n          if (prevTime && prevTime !== this._time || prevPaused !== !this._ts || this.vars.onRepeat && !this.parent && !this._act) {\n            // if prevTime is 0 and we render at the very end, _time will be the end, thus won't match. So in this edge case, prevTime won't match _time but that's okay. If it gets killed in the onRepeat, eject as well.\n            return this;\n          }\n\n          dur = this._dur; // in case the duration changed in the onRepeat\n\n          tDur = this._tDur;\n\n          if (doesWrap) {\n            this._lock = 2;\n            prevTime = rewinding ? dur : -0.0001;\n            this.render(prevTime, true);\n            this.vars.repeatRefresh && !isYoyo && this.invalidate();\n          }\n\n          this._lock = 0;\n\n          if (!this._ts && !prevPaused) {\n            return this;\n          } //in order for yoyoEase to work properly when there's a stagger, we must swap out the ease in each sub-tween.\n\n\n          _propagateYoyoEase(this, isYoyo);\n        }\n      }\n\n      if (this._hasPause && !this._forcing && this._lock < 2) {\n        pauseTween = _findNextPauseTween(this, _roundPrecise(prevTime), _roundPrecise(time));\n\n        if (pauseTween) {\n          tTime -= time - (time = pauseTween._start);\n        }\n      }\n\n      this._tTime = tTime;\n      this._time = time;\n      this._act = !timeScale; //as long as it's not paused, force it to be active so that if the user renders independent of the parent timeline, it'll be forced to re-render on the next tick.\n\n      if (!this._initted) {\n        this._onUpdate = this.vars.onUpdate;\n        this._initted = 1;\n        this._zTime = totalTime;\n        prevTime = 0; // upon init, the playhead should always go forward; someone could invalidate() a completed timeline and then if they restart(), that would make child tweens render in reverse order which could lock in the wrong starting values if they build on each other, like tl.to(obj, {x: 100}).to(obj, {x: 0}).\n      }\n\n      if (!prevTime && tTime && !suppressEvents && !prevIteration) {\n        _callback(this, \"onStart\");\n\n        if (this._tTime !== tTime) {\n          // in case the onStart triggered a render at a different spot, eject. Like if someone did animation.pause(0.5) or something inside the onStart.\n          return this;\n        }\n      }\n\n      if (time >= prevTime && totalTime >= 0) {\n        child = this._first;\n\n        while (child) {\n          next = child._next;\n\n          if ((child._act || time >= child._start) && child._ts && pauseTween !== child) {\n            if (child.parent !== this) {\n              // an extreme edge case - the child's render could do something like kill() the \"next\" one in the linked list, or reparent it. In that case we must re-initiate the whole render to be safe.\n              return this.render(totalTime, suppressEvents, force);\n            }\n\n            child.render(child._ts > 0 ? (time - child._start) * child._ts : (child._dirty ? child.totalDuration() : child._tDur) + (time - child._start) * child._ts, suppressEvents, force);\n\n            if (time !== this._time || !this._ts && !prevPaused) {\n              //in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete\n              pauseTween = 0;\n              next && (tTime += this._zTime = -_tinyNum); // it didn't finish rendering, so flag zTime as negative so that the next time render() is called it'll be forced (to render any remaining children)\n\n              break;\n            }\n          }\n\n          child = next;\n        }\n      } else {\n        child = this._last;\n        var adjustedTime = totalTime < 0 ? totalTime : time; //when the playhead goes backward beyond the start of this timeline, we must pass that information down to the child animations so that zero-duration tweens know whether to render their starting or ending values.\n\n        while (child) {\n          next = child._prev;\n\n          if ((child._act || adjustedTime <= child._end) && child._ts && pauseTween !== child) {\n            if (child.parent !== this) {\n              // an extreme edge case - the child's render could do something like kill() the \"next\" one in the linked list, or reparent it. In that case we must re-initiate the whole render to be safe.\n              return this.render(totalTime, suppressEvents, force);\n            }\n\n            child.render(child._ts > 0 ? (adjustedTime - child._start) * child._ts : (child._dirty ? child.totalDuration() : child._tDur) + (adjustedTime - child._start) * child._ts, suppressEvents, force || _reverting && _isRevertWorthy(child)); // if reverting, we should always force renders of initted tweens (but remember that .fromTo() or .from() may have a _startAt but not _initted yet). If, for example, a .fromTo() tween with a stagger (which creates an internal timeline) gets reverted BEFORE some of its child tweens render for the first time, it may not properly trigger them to revert.\n\n            if (time !== this._time || !this._ts && !prevPaused) {\n              //in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete\n              pauseTween = 0;\n              next && (tTime += this._zTime = adjustedTime ? -_tinyNum : _tinyNum); // it didn't finish rendering, so adjust zTime so that so that the next time render() is called it'll be forced (to render any remaining children)\n\n              break;\n            }\n          }\n\n          child = next;\n        }\n      }\n\n      if (pauseTween && !suppressEvents) {\n        this.pause();\n        pauseTween.render(time >= prevTime ? 0 : -_tinyNum)._zTime = time >= prevTime ? 1 : -1;\n\n        if (this._ts) {\n          //the callback resumed playback! So since we may have held back the playhead due to where the pause is positioned, go ahead and jump to where it's SUPPOSED to be (if no pause happened).\n          this._start = prevStart; //if the pause was at an earlier time and the user resumed in the callback, it could reposition the timeline (changing its startTime), throwing things off slightly, so we make sure the _start doesn't shift.\n\n          _setEnd(this);\n\n          return this.render(totalTime, suppressEvents, force);\n        }\n      }\n\n      this._onUpdate && !suppressEvents && _callback(this, \"onUpdate\", true);\n      if (tTime === tDur && this._tTime >= this.totalDuration() || !tTime && prevTime) if (prevStart === this._start || Math.abs(timeScale) !== Math.abs(this._ts)) if (!this._lock) {\n        // remember, a child's callback may alter this timeline's playhead or timeScale which is why we need to add some of these checks.\n        (totalTime || !dur) && (tTime === tDur && this._ts > 0 || !tTime && this._ts < 0) && _removeFromParent(this, 1); // don't remove if the timeline is reversed and the playhead isn't at 0, otherwise tl.progress(1).reverse() won't work. Only remove if the playhead is at the end and timeScale is positive, or if the playhead is at 0 and the timeScale is negative.\n\n        if (!suppressEvents && !(totalTime < 0 && !prevTime) && (tTime || prevTime || !tDur)) {\n          _callback(this, tTime === tDur && totalTime >= 0 ? \"onComplete\" : \"onReverseComplete\", true);\n\n          this._prom && !(tTime < tDur && this.timeScale() > 0) && this._prom();\n        }\n      }\n    }\n\n    return this;\n  };\n\n  _proto2.add = function add(child, position) {\n    var _this2 = this;\n\n    _isNumber(position) || (position = _parsePosition(this, position, child));\n\n    if (!(child instanceof Animation)) {\n      if (_isArray(child)) {\n        child.forEach(function (obj) {\n          return _this2.add(obj, position);\n        });\n        return this;\n      }\n\n      if (_isString(child)) {\n        return this.addLabel(child, position);\n      }\n\n      if (_isFunction(child)) {\n        child = Tween.delayedCall(0, child);\n      } else {\n        return this;\n      }\n    }\n\n    return this !== child ? _addToTimeline(this, child, position) : this; //don't allow a timeline to be added to itself as a child!\n  };\n\n  _proto2.getChildren = function getChildren(nested, tweens, timelines, ignoreBeforeTime) {\n    if (nested === void 0) {\n      nested = true;\n    }\n\n    if (tweens === void 0) {\n      tweens = true;\n    }\n\n    if (timelines === void 0) {\n      timelines = true;\n    }\n\n    if (ignoreBeforeTime === void 0) {\n      ignoreBeforeTime = -_bigNum;\n    }\n\n    var a = [],\n        child = this._first;\n\n    while (child) {\n      if (child._start >= ignoreBeforeTime) {\n        if (child instanceof Tween) {\n          tweens && a.push(child);\n        } else {\n          timelines && a.push(child);\n          nested && a.push.apply(a, child.getChildren(true, tweens, timelines));\n        }\n      }\n\n      child = child._next;\n    }\n\n    return a;\n  };\n\n  _proto2.getById = function getById(id) {\n    var animations = this.getChildren(1, 1, 1),\n        i = animations.length;\n\n    while (i--) {\n      if (animations[i].vars.id === id) {\n        return animations[i];\n      }\n    }\n  };\n\n  _proto2.remove = function remove(child) {\n    if (_isString(child)) {\n      return this.removeLabel(child);\n    }\n\n    if (_isFunction(child)) {\n      return this.killTweensOf(child);\n    }\n\n    child.parent === this && _removeLinkedListItem(this, child);\n\n    if (child === this._recent) {\n      this._recent = this._last;\n    }\n\n    return _uncache(this);\n  };\n\n  _proto2.totalTime = function totalTime(_totalTime2, suppressEvents) {\n    if (!arguments.length) {\n      return this._tTime;\n    }\n\n    this._forcing = 1;\n\n    if (!this._dp && this._ts) {\n      //special case for the global timeline (or any other that has no parent or detached parent).\n      this._start = _roundPrecise(_ticker.time - (this._ts > 0 ? _totalTime2 / this._ts : (this.totalDuration() - _totalTime2) / -this._ts));\n    }\n\n    _Animation.prototype.totalTime.call(this, _totalTime2, suppressEvents);\n\n    this._forcing = 0;\n    return this;\n  };\n\n  _proto2.addLabel = function addLabel(label, position) {\n    this.labels[label] = _parsePosition(this, position);\n    return this;\n  };\n\n  _proto2.removeLabel = function removeLabel(label) {\n    delete this.labels[label];\n    return this;\n  };\n\n  _proto2.addPause = function addPause(position, callback, params) {\n    var t = Tween.delayedCall(0, callback || _emptyFunc, params);\n    t.data = \"isPause\";\n    this._hasPause = 1;\n    return _addToTimeline(this, t, _parsePosition(this, position));\n  };\n\n  _proto2.removePause = function removePause(position) {\n    var child = this._first;\n    position = _parsePosition(this, position);\n\n    while (child) {\n      if (child._start === position && child.data === \"isPause\") {\n        _removeFromParent(child);\n      }\n\n      child = child._next;\n    }\n  };\n\n  _proto2.killTweensOf = function killTweensOf(targets, props, onlyActive) {\n    var tweens = this.getTweensOf(targets, onlyActive),\n        i = tweens.length;\n\n    while (i--) {\n      _overwritingTween !== tweens[i] && tweens[i].kill(targets, props);\n    }\n\n    return this;\n  };\n\n  _proto2.getTweensOf = function getTweensOf(targets, onlyActive) {\n    var a = [],\n        parsedTargets = toArray(targets),\n        child = this._first,\n        isGlobalTime = _isNumber(onlyActive),\n        // a number is interpreted as a global time. If the animation spans\n    children;\n\n    while (child) {\n      if (child instanceof Tween) {\n        if (_arrayContainsAny(child._targets, parsedTargets) && (isGlobalTime ? (!_overwritingTween || child._initted && child._ts) && child.globalTime(0) <= onlyActive && child.globalTime(child.totalDuration()) > onlyActive : !onlyActive || child.isActive())) {\n          // note: if this is for overwriting, it should only be for tweens that aren't paused and are initted.\n          a.push(child);\n        }\n      } else if ((children = child.getTweensOf(parsedTargets, onlyActive)).length) {\n        a.push.apply(a, children);\n      }\n\n      child = child._next;\n    }\n\n    return a;\n  } // potential future feature - targets() on timelines\n  // targets() {\n  // \tlet result = [];\n  // \tthis.getChildren(true, true, false).forEach(t => result.push(...t.targets()));\n  // \treturn result.filter((v, i) => result.indexOf(v) === i);\n  // }\n  ;\n\n  _proto2.tweenTo = function tweenTo(position, vars) {\n    vars = vars || {};\n\n    var tl = this,\n        endTime = _parsePosition(tl, position),\n        _vars = vars,\n        startAt = _vars.startAt,\n        _onStart = _vars.onStart,\n        onStartParams = _vars.onStartParams,\n        immediateRender = _vars.immediateRender,\n        initted,\n        tween = Tween.to(tl, _setDefaults({\n      ease: vars.ease || \"none\",\n      lazy: false,\n      immediateRender: false,\n      time: endTime,\n      overwrite: \"auto\",\n      duration: vars.duration || Math.abs((endTime - (startAt && \"time\" in startAt ? startAt.time : tl._time)) / tl.timeScale()) || _tinyNum,\n      onStart: function onStart() {\n        tl.pause();\n\n        if (!initted) {\n          var duration = vars.duration || Math.abs((endTime - (startAt && \"time\" in startAt ? startAt.time : tl._time)) / tl.timeScale());\n          tween._dur !== duration && _setDuration(tween, duration, 0, 1).render(tween._time, true, true);\n          initted = 1;\n        }\n\n        _onStart && _onStart.apply(tween, onStartParams || []); //in case the user had an onStart in the vars - we don't want to overwrite it.\n      }\n    }, vars));\n\n    return immediateRender ? tween.render(0) : tween;\n  };\n\n  _proto2.tweenFromTo = function tweenFromTo(fromPosition, toPosition, vars) {\n    return this.tweenTo(toPosition, _setDefaults({\n      startAt: {\n        time: _parsePosition(this, fromPosition)\n      }\n    }, vars));\n  };\n\n  _proto2.recent = function recent() {\n    return this._recent;\n  };\n\n  _proto2.nextLabel = function nextLabel(afterTime) {\n    if (afterTime === void 0) {\n      afterTime = this._time;\n    }\n\n    return _getLabelInDirection(this, _parsePosition(this, afterTime));\n  };\n\n  _proto2.previousLabel = function previousLabel(beforeTime) {\n    if (beforeTime === void 0) {\n      beforeTime = this._time;\n    }\n\n    return _getLabelInDirection(this, _parsePosition(this, beforeTime), 1);\n  };\n\n  _proto2.currentLabel = function currentLabel(value) {\n    return arguments.length ? this.seek(value, true) : this.previousLabel(this._time + _tinyNum);\n  };\n\n  _proto2.shiftChildren = function shiftChildren(amount, adjustLabels, ignoreBeforeTime) {\n    if (ignoreBeforeTime === void 0) {\n      ignoreBeforeTime = 0;\n    }\n\n    var child = this._first,\n        labels = this.labels,\n        p;\n\n    while (child) {\n      if (child._start >= ignoreBeforeTime) {\n        child._start += amount;\n        child._end += amount;\n      }\n\n      child = child._next;\n    }\n\n    if (adjustLabels) {\n      for (p in labels) {\n        if (labels[p] >= ignoreBeforeTime) {\n          labels[p] += amount;\n        }\n      }\n    }\n\n    return _uncache(this);\n  };\n\n  _proto2.invalidate = function invalidate(soft) {\n    var child = this._first;\n    this._lock = 0;\n\n    while (child) {\n      child.invalidate(soft);\n      child = child._next;\n    }\n\n    return _Animation.prototype.invalidate.call(this, soft);\n  };\n\n  _proto2.clear = function clear(includeLabels) {\n    if (includeLabels === void 0) {\n      includeLabels = true;\n    }\n\n    var child = this._first,\n        next;\n\n    while (child) {\n      next = child._next;\n      this.remove(child);\n      child = next;\n    }\n\n    this._dp && (this._time = this._tTime = this._pTime = 0);\n    includeLabels && (this.labels = {});\n    return _uncache(this);\n  };\n\n  _proto2.totalDuration = function totalDuration(value) {\n    var max = 0,\n        self = this,\n        child = self._last,\n        prevStart = _bigNum,\n        prev,\n        start,\n        parent;\n\n    if (arguments.length) {\n      return self.timeScale((self._repeat < 0 ? self.duration() : self.totalDuration()) / (self.reversed() ? -value : value));\n    }\n\n    if (self._dirty) {\n      parent = self.parent;\n\n      while (child) {\n        prev = child._prev; //record it here in case the tween changes position in the sequence...\n\n        child._dirty && child.totalDuration(); //could change the tween._startTime, so make sure the animation's cache is clean before analyzing it.\n\n        start = child._start;\n\n        if (start > prevStart && self._sort && child._ts && !self._lock) {\n          //in case one of the tweens shifted out of order, it needs to be re-inserted into the correct position in the sequence\n          self._lock = 1; //prevent endless recursive calls - there are methods that get triggered that check duration/totalDuration when we add().\n\n          _addToTimeline(self, child, start - child._delay, 1)._lock = 0;\n        } else {\n          prevStart = start;\n        }\n\n        if (start < 0 && child._ts) {\n          //children aren't allowed to have negative startTimes unless smoothChildTiming is true, so adjust here if one is found.\n          max -= start;\n\n          if (!parent && !self._dp || parent && parent.smoothChildTiming) {\n            self._start += start / self._ts;\n            self._time -= start;\n            self._tTime -= start;\n          }\n\n          self.shiftChildren(-start, false, -1e999);\n          prevStart = 0;\n        }\n\n        child._end > max && child._ts && (max = child._end);\n        child = prev;\n      }\n\n      _setDuration(self, self === _globalTimeline && self._time > max ? self._time : max, 1, 1);\n\n      self._dirty = 0;\n    }\n\n    return self._tDur;\n  };\n\n  Timeline.updateRoot = function updateRoot(time) {\n    if (_globalTimeline._ts) {\n      _lazySafeRender(_globalTimeline, _parentToChildTotalTime(time, _globalTimeline));\n\n      _lastRenderedFrame = _ticker.frame;\n    }\n\n    if (_ticker.frame >= _nextGCFrame) {\n      _nextGCFrame += _config.autoSleep || 120;\n      var child = _globalTimeline._first;\n      if (!child || !child._ts) if (_config.autoSleep && _ticker._listeners.length < 2) {\n        while (child && !child._ts) {\n          child = child._next;\n        }\n\n        child || _ticker.sleep();\n      }\n    }\n  };\n\n  return Timeline;\n}(Animation);\n\n_setDefaults(Timeline.prototype, {\n  _lock: 0,\n  _hasPause: 0,\n  _forcing: 0\n});\n\nvar _addComplexStringPropTween = function _addComplexStringPropTween(target, prop, start, end, setter, stringFilter, funcParam) {\n  //note: we call _addComplexStringPropTween.call(tweenInstance...) to ensure that it's scoped properly. We may call it from within a plugin too, thus \"this\" would refer to the plugin.\n  var pt = new PropTween(this._pt, target, prop, 0, 1, _renderComplexString, null, setter),\n      index = 0,\n      matchIndex = 0,\n      result,\n      startNums,\n      color,\n      endNum,\n      chunk,\n      startNum,\n      hasRandom,\n      a;\n  pt.b = start;\n  pt.e = end;\n  start += \"\"; //ensure values are strings\n\n  end += \"\";\n\n  if (hasRandom = ~end.indexOf(\"random(\")) {\n    end = _replaceRandom(end);\n  }\n\n  if (stringFilter) {\n    a = [start, end];\n    stringFilter(a, target, prop); //pass an array with the starting and ending values and let the filter do whatever it needs to the values.\n\n    start = a[0];\n    end = a[1];\n  }\n\n  startNums = start.match(_complexStringNumExp) || [];\n\n  while (result = _complexStringNumExp.exec(end)) {\n    endNum = result[0];\n    chunk = end.substring(index, result.index);\n\n    if (color) {\n      color = (color + 1) % 5;\n    } else if (chunk.substr(-5) === \"rgba(\") {\n      color = 1;\n    }\n\n    if (endNum !== startNums[matchIndex++]) {\n      startNum = parseFloat(startNums[matchIndex - 1]) || 0; //these nested PropTweens are handled in a special way - we'll never actually call a render or setter method on them. We'll just loop through them in the parent complex string PropTween's render method.\n\n      pt._pt = {\n        _next: pt._pt,\n        p: chunk || matchIndex === 1 ? chunk : \",\",\n        //note: SVG spec allows omission of comma/space when a negative sign is wedged between two numbers, like 2.5-5.3 instead of 2.5,-5.3 but when tweening, the negative value may switch to positive, so we insert the comma just in case.\n        s: startNum,\n        c: endNum.charAt(1) === \"=\" ? _parseRelative(startNum, endNum) - startNum : parseFloat(endNum) - startNum,\n        m: color && color < 4 ? Math.round : 0\n      };\n      index = _complexStringNumExp.lastIndex;\n    }\n  }\n\n  pt.c = index < end.length ? end.substring(index, end.length) : \"\"; //we use the \"c\" of the PropTween to store the final part of the string (after the last number)\n\n  pt.fp = funcParam;\n\n  if (_relExp.test(end) || hasRandom) {\n    pt.e = 0; //if the end string contains relative values or dynamic random(...) values, delete the end it so that on the final render we don't actually set it to the string with += or -= characters (forces it to use the calculated value).\n  }\n\n  this._pt = pt; //start the linked list with this new PropTween. Remember, we call _addComplexStringPropTween.call(tweenInstance...) to ensure that it's scoped properly. We may call it from within a plugin too, thus \"this\" would refer to the plugin.\n\n  return pt;\n},\n    _addPropTween = function _addPropTween(target, prop, start, end, index, targets, modifier, stringFilter, funcParam, optional) {\n  _isFunction(end) && (end = end(index || 0, target, targets));\n  var currentValue = target[prop],\n      parsedStart = start !== \"get\" ? start : !_isFunction(currentValue) ? currentValue : funcParam ? target[prop.indexOf(\"set\") || !_isFunction(target[\"get\" + prop.substr(3)]) ? prop : \"get\" + prop.substr(3)](funcParam) : target[prop](),\n      setter = !_isFunction(currentValue) ? _setterPlain : funcParam ? _setterFuncWithParam : _setterFunc,\n      pt;\n\n  if (_isString(end)) {\n    if (~end.indexOf(\"random(\")) {\n      end = _replaceRandom(end);\n    }\n\n    if (end.charAt(1) === \"=\") {\n      pt = _parseRelative(parsedStart, end) + (getUnit(parsedStart) || 0);\n\n      if (pt || pt === 0) {\n        // to avoid isNaN, like if someone passes in a value like \"!= whatever\"\n        end = pt;\n      }\n    }\n  }\n\n  if (!optional || parsedStart !== end || _forceAllPropTweens) {\n    if (!isNaN(parsedStart * end) && end !== \"\") {\n      // fun fact: any number multiplied by \"\" is evaluated as the number 0!\n      pt = new PropTween(this._pt, target, prop, +parsedStart || 0, end - (parsedStart || 0), typeof currentValue === \"boolean\" ? _renderBoolean : _renderPlain, 0, setter);\n      funcParam && (pt.fp = funcParam);\n      modifier && pt.modifier(modifier, this, target);\n      return this._pt = pt;\n    }\n\n    !currentValue && !(prop in target) && _missingPlugin(prop, end);\n    return _addComplexStringPropTween.call(this, target, prop, parsedStart, end, setter, stringFilter || _config.stringFilter, funcParam);\n  }\n},\n    //creates a copy of the vars object and processes any function-based values (putting the resulting values directly into the copy) as well as strings with \"random()\" in them. It does NOT process relative values.\n_processVars = function _processVars(vars, index, target, targets, tween) {\n  _isFunction(vars) && (vars = _parseFuncOrString(vars, tween, index, target, targets));\n\n  if (!_isObject(vars) || vars.style && vars.nodeType || _isArray(vars) || _isTypedArray(vars)) {\n    return _isString(vars) ? _parseFuncOrString(vars, tween, index, target, targets) : vars;\n  }\n\n  var copy = {},\n      p;\n\n  for (p in vars) {\n    copy[p] = _parseFuncOrString(vars[p], tween, index, target, targets);\n  }\n\n  return copy;\n},\n    _checkPlugin = function _checkPlugin(property, vars, tween, index, target, targets) {\n  var plugin, pt, ptLookup, i;\n\n  if (_plugins[property] && (plugin = new _plugins[property]()).init(target, plugin.rawVars ? vars[property] : _processVars(vars[property], index, target, targets, tween), tween, index, targets) !== false) {\n    tween._pt = pt = new PropTween(tween._pt, target, property, 0, 1, plugin.render, plugin, 0, plugin.priority);\n\n    if (tween !== _quickTween) {\n      ptLookup = tween._ptLookup[tween._targets.indexOf(target)]; //note: we can't use tween._ptLookup[index] because for staggered tweens, the index from the fullTargets array won't match what it is in each individual tween that spawns from the stagger.\n\n      i = plugin._props.length;\n\n      while (i--) {\n        ptLookup[plugin._props[i]] = pt;\n      }\n    }\n  }\n\n  return plugin;\n},\n    _overwritingTween,\n    //store a reference temporarily so we can avoid overwriting itself.\n_forceAllPropTweens,\n    _initTween = function _initTween(tween, time, tTime) {\n  var vars = tween.vars,\n      ease = vars.ease,\n      startAt = vars.startAt,\n      immediateRender = vars.immediateRender,\n      lazy = vars.lazy,\n      onUpdate = vars.onUpdate,\n      runBackwards = vars.runBackwards,\n      yoyoEase = vars.yoyoEase,\n      keyframes = vars.keyframes,\n      autoRevert = vars.autoRevert,\n      dur = tween._dur,\n      prevStartAt = tween._startAt,\n      targets = tween._targets,\n      parent = tween.parent,\n      fullTargets = parent && parent.data === \"nested\" ? parent.vars.targets : targets,\n      autoOverwrite = tween._overwrite === \"auto\" && !_suppressOverwrites,\n      tl = tween.timeline,\n      cleanVars,\n      i,\n      p,\n      pt,\n      target,\n      hasPriority,\n      gsData,\n      harness,\n      plugin,\n      ptLookup,\n      index,\n      harnessVars,\n      overwritten;\n  tl && (!keyframes || !ease) && (ease = \"none\");\n  tween._ease = _parseEase(ease, _defaults.ease);\n  tween._yEase = yoyoEase ? _invertEase(_parseEase(yoyoEase === true ? ease : yoyoEase, _defaults.ease)) : 0;\n\n  if (yoyoEase && tween._yoyo && !tween._repeat) {\n    //there must have been a parent timeline with yoyo:true that is currently in its yoyo phase, so flip the eases.\n    yoyoEase = tween._yEase;\n    tween._yEase = tween._ease;\n    tween._ease = yoyoEase;\n  }\n\n  tween._from = !tl && !!vars.runBackwards; //nested timelines should never run backwards - the backwards-ness is in the child tweens.\n\n  if (!tl || keyframes && !vars.stagger) {\n    //if there's an internal timeline, skip all the parsing because we passed that task down the chain.\n    harness = targets[0] ? _getCache(targets[0]).harness : 0;\n    harnessVars = harness && vars[harness.prop]; //someone may need to specify CSS-specific values AND non-CSS values, like if the element has an \"x\" property plus it's a standard DOM element. We allow people to distinguish by wrapping plugin-specific stuff in a css:{} object for example.\n\n    cleanVars = _copyExcluding(vars, _reservedProps);\n\n    if (prevStartAt) {\n      prevStartAt._zTime < 0 && prevStartAt.progress(1); // in case it's a lazy startAt that hasn't rendered yet.\n\n      time < 0 && runBackwards && immediateRender && !autoRevert ? prevStartAt.render(-1, true) : prevStartAt.revert(runBackwards && dur ? _revertConfigNoKill : _startAtRevertConfig); // if it's a \"startAt\" (not \"from()\" or runBackwards: true), we only need to do a shallow revert (keep transforms cached in CSSPlugin)\n      // don't just _removeFromParent(prevStartAt.render(-1, true)) because that'll leave inline styles. We're creating a new _startAt for \"startAt\" tweens that re-capture things to ensure that if the pre-tween values changed since the tween was created, they're recorded.\n\n      prevStartAt._lazy = 0;\n    }\n\n    if (startAt) {\n      _removeFromParent(tween._startAt = Tween.set(targets, _setDefaults({\n        data: \"isStart\",\n        overwrite: false,\n        parent: parent,\n        immediateRender: true,\n        lazy: !prevStartAt && _isNotFalse(lazy),\n        startAt: null,\n        delay: 0,\n        onUpdate: onUpdate && function () {\n          return _callback(tween, \"onUpdate\");\n        },\n        stagger: 0\n      }, startAt))); //copy the properties/values into a new object to avoid collisions, like var to = {x:0}, from = {x:500}; timeline.fromTo(e, from, to).fromTo(e, to, from);\n\n\n      tween._startAt._dp = 0; // don't allow it to get put back into root timeline! Like when revert() is called and totalTime() gets set.\n\n      tween._startAt._sat = tween; // used in globalTime(). _sat stands for _startAtTween\n\n      time < 0 && (_reverting || !immediateRender && !autoRevert) && tween._startAt.revert(_revertConfigNoKill); // rare edge case, like if a render is forced in the negative direction of a non-initted tween.\n\n      if (immediateRender) {\n        if (dur && time <= 0 && tTime <= 0) {\n          // check tTime here because in the case of a yoyo tween whose playhead gets pushed to the end like tween.progress(1), we should allow it through so that the onComplete gets fired properly.\n          time && (tween._zTime = time);\n          return; //we skip initialization here so that overwriting doesn't occur until the tween actually begins. Otherwise, if you create several immediateRender:true tweens of the same target/properties to drop into a Timeline, the last one created would overwrite the first ones because they didn't get placed into the timeline yet before the first render occurs and kicks in overwriting.\n        }\n      }\n    } else if (runBackwards && dur) {\n      //from() tweens must be handled uniquely: their beginning values must be rendered but we don't want overwriting to occur yet (when time is still 0). Wait until the tween actually begins before doing all the routines like overwriting. At that time, we should render at the END of the tween to ensure that things initialize correctly (remember, from() tweens go backwards)\n      if (!prevStartAt) {\n        time && (immediateRender = false); //in rare cases (like if a from() tween runs and then is invalidate()-ed), immediateRender could be true but the initial forced-render gets skipped, so there's no need to force the render in this context when the _time is greater than 0\n\n        p = _setDefaults({\n          overwrite: false,\n          data: \"isFromStart\",\n          //we tag the tween with as \"isFromStart\" so that if [inside a plugin] we need to only do something at the very END of a tween, we have a way of identifying this tween as merely the one that's setting the beginning values for a \"from()\" tween. For example, clearProps in CSSPlugin should only get applied at the very END of a tween and without this tag, from(...{height:100, clearProps:\"height\", delay:1}) would wipe the height at the beginning of the tween and after 1 second, it'd kick back in.\n          lazy: immediateRender && !prevStartAt && _isNotFalse(lazy),\n          immediateRender: immediateRender,\n          //zero-duration tweens render immediately by default, but if we're not specifically instructed to render this tween immediately, we should skip this and merely _init() to record the starting values (rendering them immediately would push them to completion which is wasteful in that case - we'd have to render(-1) immediately after)\n          stagger: 0,\n          parent: parent //ensures that nested tweens that had a stagger are handled properly, like gsap.from(\".class\", {y: gsap.utils.wrap([-100,100]), stagger: 0.5})\n\n        }, cleanVars);\n        harnessVars && (p[harness.prop] = harnessVars); // in case someone does something like .from(..., {css:{}})\n\n        _removeFromParent(tween._startAt = Tween.set(targets, p));\n\n        tween._startAt._dp = 0; // don't allow it to get put back into root timeline!\n\n        tween._startAt._sat = tween; // used in globalTime()\n\n        time < 0 && (_reverting ? tween._startAt.revert(_revertConfigNoKill) : tween._startAt.render(-1, true));\n        tween._zTime = time;\n\n        if (!immediateRender) {\n          _initTween(tween._startAt, _tinyNum, _tinyNum); //ensures that the initial values are recorded\n\n        } else if (!time) {\n          return;\n        }\n      }\n    }\n\n    tween._pt = tween._ptCache = 0;\n    lazy = dur && _isNotFalse(lazy) || lazy && !dur;\n\n    for (i = 0; i < targets.length; i++) {\n      target = targets[i];\n      gsData = target._gsap || _harness(targets)[i]._gsap;\n      tween._ptLookup[i] = ptLookup = {};\n      _lazyLookup[gsData.id] && _lazyTweens.length && _lazyRender(); //if other tweens of the same target have recently initted but haven't rendered yet, we've got to force the render so that the starting values are correct (imagine populating a timeline with a bunch of sequential tweens and then jumping to the end)\n\n      index = fullTargets === targets ? i : fullTargets.indexOf(target);\n\n      if (harness && (plugin = new harness()).init(target, harnessVars || cleanVars, tween, index, fullTargets) !== false) {\n        tween._pt = pt = new PropTween(tween._pt, target, plugin.name, 0, 1, plugin.render, plugin, 0, plugin.priority);\n\n        plugin._props.forEach(function (name) {\n          ptLookup[name] = pt;\n        });\n\n        plugin.priority && (hasPriority = 1);\n      }\n\n      if (!harness || harnessVars) {\n        for (p in cleanVars) {\n          if (_plugins[p] && (plugin = _checkPlugin(p, cleanVars, tween, index, target, fullTargets))) {\n            plugin.priority && (hasPriority = 1);\n          } else {\n            ptLookup[p] = pt = _addPropTween.call(tween, target, p, \"get\", cleanVars[p], index, fullTargets, 0, vars.stringFilter);\n          }\n        }\n      }\n\n      tween._op && tween._op[i] && tween.kill(target, tween._op[i]);\n\n      if (autoOverwrite && tween._pt) {\n        _overwritingTween = tween;\n\n        _globalTimeline.killTweensOf(target, ptLookup, tween.globalTime(time)); // make sure the overwriting doesn't overwrite THIS tween!!!\n\n\n        overwritten = !tween.parent;\n        _overwritingTween = 0;\n      }\n\n      tween._pt && lazy && (_lazyLookup[gsData.id] = 1);\n    }\n\n    hasPriority && _sortPropTweensByPriority(tween);\n    tween._onInit && tween._onInit(tween); //plugins like RoundProps must wait until ALL of the PropTweens are instantiated. In the plugin's init() function, it sets the _onInit on the tween instance. May not be pretty/intuitive, but it's fast and keeps file size down.\n  }\n\n  tween._onUpdate = onUpdate;\n  tween._initted = (!tween._op || tween._pt) && !overwritten; // if overwrittenProps resulted in the entire tween being killed, do NOT flag it as initted or else it may render for one tick.\n\n  keyframes && time <= 0 && tl.render(_bigNum, true, true); // if there's a 0% keyframe, it'll render in the \"before\" state for any staggered/delayed animations thus when the following tween initializes, it'll use the \"before\" state instead of the \"after\" state as the initial values.\n},\n    _updatePropTweens = function _updatePropTweens(tween, property, value, start, startIsRelative, ratio, time, skipRecursion) {\n  var ptCache = (tween._pt && tween._ptCache || (tween._ptCache = {}))[property],\n      pt,\n      rootPT,\n      lookup,\n      i;\n\n  if (!ptCache) {\n    ptCache = tween._ptCache[property] = [];\n    lookup = tween._ptLookup;\n    i = tween._targets.length;\n\n    while (i--) {\n      pt = lookup[i][property];\n\n      if (pt && pt.d && pt.d._pt) {\n        // it's a plugin, so find the nested PropTween\n        pt = pt.d._pt;\n\n        while (pt && pt.p !== property && pt.fp !== property) {\n          // \"fp\" is functionParam for things like setting CSS variables which require .setProperty(\"--var-name\", value)\n          pt = pt._next;\n        }\n      }\n\n      if (!pt) {\n        // there is no PropTween associated with that property, so we must FORCE one to be created and ditch out of this\n        // if the tween has other properties that already rendered at new positions, we'd normally have to rewind to put them back like tween.render(0, true) before forcing an _initTween(), but that can create another edge case like tweening a timeline's progress would trigger onUpdates to fire which could move other things around. It's better to just inform users that .resetTo() should ONLY be used for tweens that already have that property. For example, you can't gsap.to(...{ y: 0 }) and then tween.restTo(\"x\", 200) for example.\n        _forceAllPropTweens = 1; // otherwise, when we _addPropTween() and it finds no change between the start and end values, it skips creating a PropTween (for efficiency...why tween when there's no difference?) but in this case we NEED that PropTween created so we can edit it.\n\n        tween.vars[property] = \"+=0\";\n\n        _initTween(tween, time);\n\n        _forceAllPropTweens = 0;\n        return skipRecursion ? _warn(property + \" not eligible for reset\") : 1; // if someone tries to do a quickTo() on a special property like borderRadius which must get split into 4 different properties, that's not eligible for .resetTo().\n      }\n\n      ptCache.push(pt);\n    }\n  }\n\n  i = ptCache.length;\n\n  while (i--) {\n    rootPT = ptCache[i];\n    pt = rootPT._pt || rootPT; // complex values may have nested PropTweens. We only accommodate the FIRST value.\n\n    pt.s = (start || start === 0) && !startIsRelative ? start : pt.s + (start || 0) + ratio * pt.c;\n    pt.c = value - pt.s;\n    rootPT.e && (rootPT.e = _round(value) + getUnit(rootPT.e)); // mainly for CSSPlugin (end value)\n\n    rootPT.b && (rootPT.b = pt.s + getUnit(rootPT.b)); // (beginning value)\n  }\n},\n    _addAliasesToVars = function _addAliasesToVars(targets, vars) {\n  var harness = targets[0] ? _getCache(targets[0]).harness : 0,\n      propertyAliases = harness && harness.aliases,\n      copy,\n      p,\n      i,\n      aliases;\n\n  if (!propertyAliases) {\n    return vars;\n  }\n\n  copy = _merge({}, vars);\n\n  for (p in propertyAliases) {\n    if (p in copy) {\n      aliases = propertyAliases[p].split(\",\");\n      i = aliases.length;\n\n      while (i--) {\n        copy[aliases[i]] = copy[p];\n      }\n    }\n  }\n\n  return copy;\n},\n    // parses multiple formats, like {\"0%\": {x: 100}, {\"50%\": {x: -20}} and { x: {\"0%\": 100, \"50%\": -20} }, and an \"ease\" can be set on any object. We populate an \"allProps\" object with an Array for each property, like {x: [{}, {}], y:[{}, {}]} with data for each property tween. The objects have a \"t\" (time), \"v\", (value), and \"e\" (ease) property. This allows us to piece together a timeline later.\n_parseKeyframe = function _parseKeyframe(prop, obj, allProps, easeEach) {\n  var ease = obj.ease || easeEach || \"power1.inOut\",\n      p,\n      a;\n\n  if (_isArray(obj)) {\n    a = allProps[prop] || (allProps[prop] = []); // t = time (out of 100), v = value, e = ease\n\n    obj.forEach(function (value, i) {\n      return a.push({\n        t: i / (obj.length - 1) * 100,\n        v: value,\n        e: ease\n      });\n    });\n  } else {\n    for (p in obj) {\n      a = allProps[p] || (allProps[p] = []);\n      p === \"ease\" || a.push({\n        t: parseFloat(prop),\n        v: obj[p],\n        e: ease\n      });\n    }\n  }\n},\n    _parseFuncOrString = function _parseFuncOrString(value, tween, i, target, targets) {\n  return _isFunction(value) ? value.call(tween, i, target, targets) : _isString(value) && ~value.indexOf(\"random(\") ? _replaceRandom(value) : value;\n},\n    _staggerTweenProps = _callbackNames + \"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert\",\n    _staggerPropsToSkip = {};\n\n_forEachName(_staggerTweenProps + \",id,stagger,delay,duration,paused,scrollTrigger\", function (name) {\n  return _staggerPropsToSkip[name] = 1;\n});\n/*\n * --------------------------------------------------------------------------------------\n * TWEEN\n * --------------------------------------------------------------------------------------\n */\n\n\nexport var Tween = /*#__PURE__*/function (_Animation2) {\n  _inheritsLoose(Tween, _Animation2);\n\n  function Tween(targets, vars, position, skipInherit) {\n    var _this3;\n\n    if (typeof vars === \"number\") {\n      position.duration = vars;\n      vars = position;\n      position = null;\n    }\n\n    _this3 = _Animation2.call(this, skipInherit ? vars : _inheritDefaults(vars)) || this;\n    var _this3$vars = _this3.vars,\n        duration = _this3$vars.duration,\n        delay = _this3$vars.delay,\n        immediateRender = _this3$vars.immediateRender,\n        stagger = _this3$vars.stagger,\n        overwrite = _this3$vars.overwrite,\n        keyframes = _this3$vars.keyframes,\n        defaults = _this3$vars.defaults,\n        scrollTrigger = _this3$vars.scrollTrigger,\n        yoyoEase = _this3$vars.yoyoEase,\n        parent = vars.parent || _globalTimeline,\n        parsedTargets = (_isArray(targets) || _isTypedArray(targets) ? _isNumber(targets[0]) : \"length\" in vars) ? [targets] : toArray(targets),\n        tl,\n        i,\n        copy,\n        l,\n        p,\n        curTarget,\n        staggerFunc,\n        staggerVarsToMerge;\n    _this3._targets = parsedTargets.length ? _harness(parsedTargets) : _warn(\"GSAP target \" + targets + \" not found. https://gsap.com\", !_config.nullTargetWarn) || [];\n    _this3._ptLookup = []; //PropTween lookup. An array containing an object for each target, having keys for each tweening property\n\n    _this3._overwrite = overwrite;\n\n    if (keyframes || stagger || _isFuncOrString(duration) || _isFuncOrString(delay)) {\n      vars = _this3.vars;\n      tl = _this3.timeline = new Timeline({\n        data: \"nested\",\n        defaults: defaults || {},\n        targets: parent && parent.data === \"nested\" ? parent.vars.targets : parsedTargets\n      }); // we need to store the targets because for staggers and keyframes, we end up creating an individual tween for each but function-based values need to know the index and the whole Array of targets.\n\n      tl.kill();\n      tl.parent = tl._dp = _assertThisInitialized(_this3);\n      tl._start = 0;\n\n      if (stagger || _isFuncOrString(duration) || _isFuncOrString(delay)) {\n        l = parsedTargets.length;\n        staggerFunc = stagger && distribute(stagger);\n\n        if (_isObject(stagger)) {\n          //users can pass in callbacks like onStart/onComplete in the stagger object. These should fire with each individual tween.\n          for (p in stagger) {\n            if (~_staggerTweenProps.indexOf(p)) {\n              staggerVarsToMerge || (staggerVarsToMerge = {});\n              staggerVarsToMerge[p] = stagger[p];\n            }\n          }\n        }\n\n        for (i = 0; i < l; i++) {\n          copy = _copyExcluding(vars, _staggerPropsToSkip);\n          copy.stagger = 0;\n          yoyoEase && (copy.yoyoEase = yoyoEase);\n          staggerVarsToMerge && _merge(copy, staggerVarsToMerge);\n          curTarget = parsedTargets[i]; //don't just copy duration or delay because if they're a string or function, we'd end up in an infinite loop because _isFuncOrString() would evaluate as true in the child tweens, entering this loop, etc. So we parse the value straight from vars and default to 0.\n\n          copy.duration = +_parseFuncOrString(duration, _assertThisInitialized(_this3), i, curTarget, parsedTargets);\n          copy.delay = (+_parseFuncOrString(delay, _assertThisInitialized(_this3), i, curTarget, parsedTargets) || 0) - _this3._delay;\n\n          if (!stagger && l === 1 && copy.delay) {\n            // if someone does delay:\"random(1, 5)\", repeat:-1, for example, the delay shouldn't be inside the repeat.\n            _this3._delay = delay = copy.delay;\n            _this3._start += delay;\n            copy.delay = 0;\n          }\n\n          tl.to(curTarget, copy, staggerFunc ? staggerFunc(i, curTarget, parsedTargets) : 0);\n          tl._ease = _easeMap.none;\n        }\n\n        tl.duration() ? duration = delay = 0 : _this3.timeline = 0; // if the timeline's duration is 0, we don't need a timeline internally!\n      } else if (keyframes) {\n        _inheritDefaults(_setDefaults(tl.vars.defaults, {\n          ease: \"none\"\n        }));\n\n        tl._ease = _parseEase(keyframes.ease || vars.ease || \"none\");\n        var time = 0,\n            a,\n            kf,\n            v;\n\n        if (_isArray(keyframes)) {\n          keyframes.forEach(function (frame) {\n            return tl.to(parsedTargets, frame, \">\");\n          });\n          tl.duration(); // to ensure tl._dur is cached because we tap into it for performance purposes in the render() method.\n        } else {\n          copy = {};\n\n          for (p in keyframes) {\n            p === \"ease\" || p === \"easeEach\" || _parseKeyframe(p, keyframes[p], copy, keyframes.easeEach);\n          }\n\n          for (p in copy) {\n            a = copy[p].sort(function (a, b) {\n              return a.t - b.t;\n            });\n            time = 0;\n\n            for (i = 0; i < a.length; i++) {\n              kf = a[i];\n              v = {\n                ease: kf.e,\n                duration: (kf.t - (i ? a[i - 1].t : 0)) / 100 * duration\n              };\n              v[p] = kf.v;\n              tl.to(parsedTargets, v, time);\n              time += v.duration;\n            }\n          }\n\n          tl.duration() < duration && tl.to({}, {\n            duration: duration - tl.duration()\n          }); // in case keyframes didn't go to 100%\n        }\n      }\n\n      duration || _this3.duration(duration = tl.duration());\n    } else {\n      _this3.timeline = 0; //speed optimization, faster lookups (no going up the prototype chain)\n    }\n\n    if (overwrite === true && !_suppressOverwrites) {\n      _overwritingTween = _assertThisInitialized(_this3);\n\n      _globalTimeline.killTweensOf(parsedTargets);\n\n      _overwritingTween = 0;\n    }\n\n    _addToTimeline(parent, _assertThisInitialized(_this3), position);\n\n    vars.reversed && _this3.reverse();\n    vars.paused && _this3.paused(true);\n\n    if (immediateRender || !duration && !keyframes && _this3._start === _roundPrecise(parent._time) && _isNotFalse(immediateRender) && _hasNoPausedAncestors(_assertThisInitialized(_this3)) && parent.data !== \"nested\") {\n      _this3._tTime = -_tinyNum; //forces a render without having to set the render() \"force\" parameter to true because we want to allow lazying by default (using the \"force\" parameter always forces an immediate full render)\n\n      _this3.render(Math.max(0, -delay) || 0); //in case delay is negative\n\n    }\n\n    scrollTrigger && _scrollTrigger(_assertThisInitialized(_this3), scrollTrigger);\n    return _this3;\n  }\n\n  var _proto3 = Tween.prototype;\n\n  _proto3.render = function render(totalTime, suppressEvents, force) {\n    var prevTime = this._time,\n        tDur = this._tDur,\n        dur = this._dur,\n        isNegative = totalTime < 0,\n        tTime = totalTime > tDur - _tinyNum && !isNegative ? tDur : totalTime < _tinyNum ? 0 : totalTime,\n        time,\n        pt,\n        iteration,\n        cycleDuration,\n        prevIteration,\n        isYoyo,\n        ratio,\n        timeline,\n        yoyoEase;\n\n    if (!dur) {\n      _renderZeroDurationTween(this, totalTime, suppressEvents, force);\n    } else if (tTime !== this._tTime || !totalTime || force || !this._initted && this._tTime || this._startAt && this._zTime < 0 !== isNegative || this._lazy) {\n      // this senses if we're crossing over the start time, in which case we must record _zTime and force the render, but we do it in this lengthy conditional way for performance reasons (usually we can skip the calculations): this._initted && (this._zTime < 0) !== (totalTime < 0)\n      time = tTime;\n      timeline = this.timeline;\n\n      if (this._repeat) {\n        //adjust the time for repeats and yoyos\n        cycleDuration = dur + this._rDelay;\n\n        if (this._repeat < -1 && isNegative) {\n          return this.totalTime(cycleDuration * 100 + totalTime, suppressEvents, force);\n        }\n\n        time = _roundPrecise(tTime % cycleDuration); //round to avoid floating point errors. (4 % 0.8 should be 0 but some browsers report it as 0.79999999!)\n\n        if (tTime === tDur) {\n          // the tDur === tTime is for edge cases where there's a lengthy decimal on the duration and it may reach the very end but the time is rendered as not-quite-there (remember, tDur is rounded to 4 decimals whereas dur isn't)\n          iteration = this._repeat;\n          time = dur;\n        } else {\n          prevIteration = _roundPrecise(tTime / cycleDuration); // full decimal version of iterations, not the previous iteration (we're reusing prevIteration variable for efficiency)\n\n          iteration = ~~prevIteration;\n\n          if (iteration && iteration === prevIteration) {\n            time = dur;\n            iteration--;\n          } else if (time > dur) {\n            time = dur;\n          }\n        }\n\n        isYoyo = this._yoyo && iteration & 1;\n\n        if (isYoyo) {\n          yoyoEase = this._yEase;\n          time = dur - time;\n        }\n\n        prevIteration = _animationCycle(this._tTime, cycleDuration);\n\n        if (time === prevTime && !force && this._initted && iteration === prevIteration) {\n          //could be during the repeatDelay part. No need to render and fire callbacks.\n          this._tTime = tTime;\n          return this;\n        }\n\n        if (iteration !== prevIteration) {\n          timeline && this._yEase && _propagateYoyoEase(timeline, isYoyo); //repeatRefresh functionality\n\n          if (this.vars.repeatRefresh && !isYoyo && !this._lock && time !== cycleDuration && this._initted) {\n            // this._time will === cycleDuration when we render at EXACTLY the end of an iteration. Without this condition, it'd often do the repeatRefresh render TWICE (again on the very next tick).\n            this._lock = force = 1; //force, otherwise if lazy is true, the _attemptInitTween() will return and we'll jump out and get caught bouncing on each tick.\n\n            this.render(_roundPrecise(cycleDuration * iteration), true).invalidate()._lock = 0;\n          }\n        }\n      }\n\n      if (!this._initted) {\n        if (_attemptInitTween(this, isNegative ? totalTime : time, force, suppressEvents, tTime)) {\n          this._tTime = 0; // in constructor if immediateRender is true, we set _tTime to -_tinyNum to have the playhead cross the starting point but we can't leave _tTime as a negative number.\n\n          return this;\n        }\n\n        if (prevTime !== this._time && !(force && this.vars.repeatRefresh && iteration !== prevIteration)) {\n          // rare edge case - during initialization, an onUpdate in the _startAt (.fromTo()) might force this tween to render at a different spot in which case we should ditch this render() call so that it doesn't revert the values. But we also don't want to dump if we're doing a repeatRefresh render!\n          return this;\n        }\n\n        if (dur !== this._dur) {\n          // while initting, a plugin like InertiaPlugin might alter the duration, so rerun from the start to ensure everything renders as it should.\n          return this.render(totalTime, suppressEvents, force);\n        }\n      }\n\n      this._tTime = tTime;\n      this._time = time;\n\n      if (!this._act && this._ts) {\n        this._act = 1; //as long as it's not paused, force it to be active so that if the user renders independent of the parent timeline, it'll be forced to re-render on the next tick.\n\n        this._lazy = 0;\n      }\n\n      this.ratio = ratio = (yoyoEase || this._ease)(time / dur);\n\n      if (this._from) {\n        this.ratio = ratio = 1 - ratio;\n      }\n\n      if (!prevTime && tTime && !suppressEvents && !prevIteration) {\n        _callback(this, \"onStart\");\n\n        if (this._tTime !== tTime) {\n          // in case the onStart triggered a render at a different spot, eject. Like if someone did animation.pause(0.5) or something inside the onStart.\n          return this;\n        }\n      }\n\n      pt = this._pt;\n\n      while (pt) {\n        pt.r(ratio, pt.d);\n        pt = pt._next;\n      }\n\n      timeline && timeline.render(totalTime < 0 ? totalTime : timeline._dur * timeline._ease(time / this._dur), suppressEvents, force) || this._startAt && (this._zTime = totalTime);\n\n      if (this._onUpdate && !suppressEvents) {\n        isNegative && _rewindStartAt(this, totalTime, suppressEvents, force); //note: for performance reasons, we tuck this conditional logic inside less traveled areas (most tweens don't have an onUpdate). We'd just have it at the end before the onComplete, but the values should be updated before any onUpdate is called, so we ALSO put it here and then if it's not called, we do so later near the onComplete.\n\n        _callback(this, \"onUpdate\");\n      }\n\n      this._repeat && iteration !== prevIteration && this.vars.onRepeat && !suppressEvents && this.parent && _callback(this, \"onRepeat\");\n\n      if ((tTime === this._tDur || !tTime) && this._tTime === tTime) {\n        isNegative && !this._onUpdate && _rewindStartAt(this, totalTime, true, true);\n        (totalTime || !dur) && (tTime === this._tDur && this._ts > 0 || !tTime && this._ts < 0) && _removeFromParent(this, 1); // don't remove if we're rendering at exactly a time of 0, as there could be autoRevert values that should get set on the next tick (if the playhead goes backward beyond the startTime, negative totalTime). Don't remove if the timeline is reversed and the playhead isn't at 0, otherwise tl.progress(1).reverse() won't work. Only remove if the playhead is at the end and timeScale is positive, or if the playhead is at 0 and the timeScale is negative.\n\n        if (!suppressEvents && !(isNegative && !prevTime) && (tTime || prevTime || isYoyo)) {\n          // if prevTime and tTime are zero, we shouldn't fire the onReverseComplete. This could happen if you gsap.to(... {paused:true}).play();\n          _callback(this, tTime === tDur ? \"onComplete\" : \"onReverseComplete\", true);\n\n          this._prom && !(tTime < tDur && this.timeScale() > 0) && this._prom();\n        }\n      }\n    }\n\n    return this;\n  };\n\n  _proto3.targets = function targets() {\n    return this._targets;\n  };\n\n  _proto3.invalidate = function invalidate(soft) {\n    // \"soft\" gives us a way to clear out everything EXCEPT the recorded pre-\"from\" portion of from() tweens. Otherwise, for example, if you tween.progress(1).render(0, true true).invalidate(), the \"from\" values would persist and then on the next render, the from() tweens would initialize and the current value would match the \"from\" values, thus animate from the same value to the same value (no animation). We tap into this in ScrollTrigger's refresh() where we must push a tween to completion and then back again but honor its init state in case the tween is dependent on another tween further up on the page.\n    (!soft || !this.vars.runBackwards) && (this._startAt = 0);\n    this._pt = this._op = this._onUpdate = this._lazy = this.ratio = 0;\n    this._ptLookup = [];\n    this.timeline && this.timeline.invalidate(soft);\n    return _Animation2.prototype.invalidate.call(this, soft);\n  };\n\n  _proto3.resetTo = function resetTo(property, value, start, startIsRelative, skipRecursion) {\n    _tickerActive || _ticker.wake();\n    this._ts || this.play();\n    var time = Math.min(this._dur, (this._dp._time - this._start) * this._ts),\n        ratio;\n    this._initted || _initTween(this, time);\n    ratio = this._ease(time / this._dur); // don't just get tween.ratio because it may not have rendered yet.\n    // possible future addition to allow an object with multiple values to update, like tween.resetTo({x: 100, y: 200}); At this point, it doesn't seem worth the added kb given the fact that most users will likely opt for the convenient gsap.quickTo() way of interacting with this method.\n    // if (_isObject(property)) { // performance optimization\n    // \tfor (p in property) {\n    // \t\tif (_updatePropTweens(this, p, property[p], value ? value[p] : null, start, ratio, time)) {\n    // \t\t\treturn this.resetTo(property, value, start, startIsRelative); // if a PropTween wasn't found for the property, it'll get forced with a re-initialization so we need to jump out and start over again.\n    // \t\t}\n    // \t}\n    // } else {\n\n    if (_updatePropTweens(this, property, value, start, startIsRelative, ratio, time, skipRecursion)) {\n      return this.resetTo(property, value, start, startIsRelative, 1); // if a PropTween wasn't found for the property, it'll get forced with a re-initialization so we need to jump out and start over again.\n    } //}\n\n\n    _alignPlayhead(this, 0);\n\n    this.parent || _addLinkedListItem(this._dp, this, \"_first\", \"_last\", this._dp._sort ? \"_start\" : 0);\n    return this.render(0);\n  };\n\n  _proto3.kill = function kill(targets, vars) {\n    if (vars === void 0) {\n      vars = \"all\";\n    }\n\n    if (!targets && (!vars || vars === \"all\")) {\n      this._lazy = this._pt = 0;\n      this.parent ? _interrupt(this) : this.scrollTrigger && this.scrollTrigger.kill(!!_reverting);\n      return this;\n    }\n\n    if (this.timeline) {\n      var tDur = this.timeline.totalDuration();\n      this.timeline.killTweensOf(targets, vars, _overwritingTween && _overwritingTween.vars.overwrite !== true)._first || _interrupt(this); // if nothing is left tweening, interrupt.\n\n      this.parent && tDur !== this.timeline.totalDuration() && _setDuration(this, this._dur * this.timeline._tDur / tDur, 0, 1); // if a nested tween is killed that changes the duration, it should affect this tween's duration. We must use the ratio, though, because sometimes the internal timeline is stretched like for keyframes where they don't all add up to whatever the parent tween's duration was set to.\n\n      return this;\n    }\n\n    var parsedTargets = this._targets,\n        killingTargets = targets ? toArray(targets) : parsedTargets,\n        propTweenLookup = this._ptLookup,\n        firstPT = this._pt,\n        overwrittenProps,\n        curLookup,\n        curOverwriteProps,\n        props,\n        p,\n        pt,\n        i;\n\n    if ((!vars || vars === \"all\") && _arraysMatch(parsedTargets, killingTargets)) {\n      vars === \"all\" && (this._pt = 0);\n      return _interrupt(this);\n    }\n\n    overwrittenProps = this._op = this._op || [];\n\n    if (vars !== \"all\") {\n      //so people can pass in a comma-delimited list of property names\n      if (_isString(vars)) {\n        p = {};\n\n        _forEachName(vars, function (name) {\n          return p[name] = 1;\n        });\n\n        vars = p;\n      }\n\n      vars = _addAliasesToVars(parsedTargets, vars);\n    }\n\n    i = parsedTargets.length;\n\n    while (i--) {\n      if (~killingTargets.indexOf(parsedTargets[i])) {\n        curLookup = propTweenLookup[i];\n\n        if (vars === \"all\") {\n          overwrittenProps[i] = vars;\n          props = curLookup;\n          curOverwriteProps = {};\n        } else {\n          curOverwriteProps = overwrittenProps[i] = overwrittenProps[i] || {};\n          props = vars;\n        }\n\n        for (p in props) {\n          pt = curLookup && curLookup[p];\n\n          if (pt) {\n            if (!(\"kill\" in pt.d) || pt.d.kill(p) === true) {\n              _removeLinkedListItem(this, pt, \"_pt\");\n            }\n\n            delete curLookup[p];\n          }\n\n          if (curOverwriteProps !== \"all\") {\n            curOverwriteProps[p] = 1;\n          }\n        }\n      }\n    }\n\n    this._initted && !this._pt && firstPT && _interrupt(this); //if all tweening properties are killed, kill the tween. Without this line, if there's a tween with multiple targets and then you killTweensOf() each target individually, the tween would technically still remain active and fire its onComplete even though there aren't any more properties tweening.\n\n    return this;\n  };\n\n  Tween.to = function to(targets, vars) {\n    return new Tween(targets, vars, arguments[2]);\n  };\n\n  Tween.from = function from(targets, vars) {\n    return _createTweenType(1, arguments);\n  };\n\n  Tween.delayedCall = function delayedCall(delay, callback, params, scope) {\n    return new Tween(callback, 0, {\n      immediateRender: false,\n      lazy: false,\n      overwrite: false,\n      delay: delay,\n      onComplete: callback,\n      onReverseComplete: callback,\n      onCompleteParams: params,\n      onReverseCompleteParams: params,\n      callbackScope: scope\n    }); // we must use onReverseComplete too for things like timeline.add(() => {...}) which should be triggered in BOTH directions (forward and reverse)\n  };\n\n  Tween.fromTo = function fromTo(targets, fromVars, toVars) {\n    return _createTweenType(2, arguments);\n  };\n\n  Tween.set = function set(targets, vars) {\n    vars.duration = 0;\n    vars.repeatDelay || (vars.repeat = 0);\n    return new Tween(targets, vars);\n  };\n\n  Tween.killTweensOf = function killTweensOf(targets, props, onlyActive) {\n    return _globalTimeline.killTweensOf(targets, props, onlyActive);\n  };\n\n  return Tween;\n}(Animation);\n\n_setDefaults(Tween.prototype, {\n  _targets: [],\n  _lazy: 0,\n  _startAt: 0,\n  _op: 0,\n  _onInit: 0\n}); //add the pertinent timeline methods to Tween instances so that users can chain conveniently and create a timeline automatically. (removed due to concerns that it'd ultimately add to more confusion especially for beginners)\n// _forEachName(\"to,from,fromTo,set,call,add,addLabel,addPause\", name => {\n// \tTween.prototype[name] = function() {\n// \t\tlet tl = new Timeline();\n// \t\treturn _addToTimeline(tl, this)[name].apply(tl, toArray(arguments));\n// \t}\n// });\n//for backward compatibility. Leverage the timeline calls.\n\n\n_forEachName(\"staggerTo,staggerFrom,staggerFromTo\", function (name) {\n  Tween[name] = function () {\n    var tl = new Timeline(),\n        params = _slice.call(arguments, 0);\n\n    params.splice(name === \"staggerFromTo\" ? 5 : 4, 0, 0);\n    return tl[name].apply(tl, params);\n  };\n});\n/*\n * --------------------------------------------------------------------------------------\n * PROPTWEEN\n * --------------------------------------------------------------------------------------\n */\n\n\nvar _setterPlain = function _setterPlain(target, property, value) {\n  return target[property] = value;\n},\n    _setterFunc = function _setterFunc(target, property, value) {\n  return target[property](value);\n},\n    _setterFuncWithParam = function _setterFuncWithParam(target, property, value, data) {\n  return target[property](data.fp, value);\n},\n    _setterAttribute = function _setterAttribute(target, property, value) {\n  return target.setAttribute(property, value);\n},\n    _getSetter = function _getSetter(target, property) {\n  return _isFunction(target[property]) ? _setterFunc : _isUndefined(target[property]) && target.setAttribute ? _setterAttribute : _setterPlain;\n},\n    _renderPlain = function _renderPlain(ratio, data) {\n  return data.set(data.t, data.p, Math.round((data.s + data.c * ratio) * 1000000) / 1000000, data);\n},\n    _renderBoolean = function _renderBoolean(ratio, data) {\n  return data.set(data.t, data.p, !!(data.s + data.c * ratio), data);\n},\n    _renderComplexString = function _renderComplexString(ratio, data) {\n  var pt = data._pt,\n      s = \"\";\n\n  if (!ratio && data.b) {\n    //b = beginning string\n    s = data.b;\n  } else if (ratio === 1 && data.e) {\n    //e = ending string\n    s = data.e;\n  } else {\n    while (pt) {\n      s = pt.p + (pt.m ? pt.m(pt.s + pt.c * ratio) : Math.round((pt.s + pt.c * ratio) * 10000) / 10000) + s; //we use the \"p\" property for the text inbetween (like a suffix). And in the context of a complex string, the modifier (m) is typically just Math.round(), like for RGB colors.\n\n      pt = pt._next;\n    }\n\n    s += data.c; //we use the \"c\" of the PropTween to store the final chunk of non-numeric text.\n  }\n\n  data.set(data.t, data.p, s, data);\n},\n    _renderPropTweens = function _renderPropTweens(ratio, data) {\n  var pt = data._pt;\n\n  while (pt) {\n    pt.r(ratio, pt.d);\n    pt = pt._next;\n  }\n},\n    _addPluginModifier = function _addPluginModifier(modifier, tween, target, property) {\n  var pt = this._pt,\n      next;\n\n  while (pt) {\n    next = pt._next;\n    pt.p === property && pt.modifier(modifier, tween, target);\n    pt = next;\n  }\n},\n    _killPropTweensOf = function _killPropTweensOf(property) {\n  var pt = this._pt,\n      hasNonDependentRemaining,\n      next;\n\n  while (pt) {\n    next = pt._next;\n\n    if (pt.p === property && !pt.op || pt.op === property) {\n      _removeLinkedListItem(this, pt, \"_pt\");\n    } else if (!pt.dep) {\n      hasNonDependentRemaining = 1;\n    }\n\n    pt = next;\n  }\n\n  return !hasNonDependentRemaining;\n},\n    _setterWithModifier = function _setterWithModifier(target, property, value, data) {\n  data.mSet(target, property, data.m.call(data.tween, value, data.mt), data);\n},\n    _sortPropTweensByPriority = function _sortPropTweensByPriority(parent) {\n  var pt = parent._pt,\n      next,\n      pt2,\n      first,\n      last; //sorts the PropTween linked list in order of priority because some plugins need to do their work after ALL of the PropTweens were created (like RoundPropsPlugin and ModifiersPlugin)\n\n  while (pt) {\n    next = pt._next;\n    pt2 = first;\n\n    while (pt2 && pt2.pr > pt.pr) {\n      pt2 = pt2._next;\n    }\n\n    if (pt._prev = pt2 ? pt2._prev : last) {\n      pt._prev._next = pt;\n    } else {\n      first = pt;\n    }\n\n    if (pt._next = pt2) {\n      pt2._prev = pt;\n    } else {\n      last = pt;\n    }\n\n    pt = next;\n  }\n\n  parent._pt = first;\n}; //PropTween key: t = target, p = prop, r = renderer, d = data, s = start, c = change, op = overwriteProperty (ONLY populated when it's different than p), pr = priority, _next/_prev for the linked list siblings, set = setter, m = modifier, mSet = modifierSetter (the original setter, before a modifier was added)\n\n\nexport var PropTween = /*#__PURE__*/function () {\n  function PropTween(next, target, prop, start, change, renderer, data, setter, priority) {\n    this.t = target;\n    this.s = start;\n    this.c = change;\n    this.p = prop;\n    this.r = renderer || _renderPlain;\n    this.d = data || this;\n    this.set = setter || _setterPlain;\n    this.pr = priority || 0;\n    this._next = next;\n\n    if (next) {\n      next._prev = this;\n    }\n  }\n\n  var _proto4 = PropTween.prototype;\n\n  _proto4.modifier = function modifier(func, tween, target) {\n    this.mSet = this.mSet || this.set; //in case it was already set (a PropTween can only have one modifier)\n\n    this.set = _setterWithModifier;\n    this.m = func;\n    this.mt = target; //modifier target\n\n    this.tween = tween;\n  };\n\n  return PropTween;\n}(); //Initialization tasks\n\n_forEachName(_callbackNames + \"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger\", function (name) {\n  return _reservedProps[name] = 1;\n});\n\n_globals.TweenMax = _globals.TweenLite = Tween;\n_globals.TimelineLite = _globals.TimelineMax = Timeline;\n_globalTimeline = new Timeline({\n  sortChildren: false,\n  defaults: _defaults,\n  autoRemoveChildren: true,\n  id: \"root\",\n  smoothChildTiming: true\n});\n_config.stringFilter = _colorStringFilter;\n\nvar _media = [],\n    _listeners = {},\n    _emptyArray = [],\n    _lastMediaTime = 0,\n    _contextID = 0,\n    _dispatch = function _dispatch(type) {\n  return (_listeners[type] || _emptyArray).map(function (f) {\n    return f();\n  });\n},\n    _onMediaChange = function _onMediaChange() {\n  var time = Date.now(),\n      matches = [];\n\n  if (time - _lastMediaTime > 2) {\n    _dispatch(\"matchMediaInit\");\n\n    _media.forEach(function (c) {\n      var queries = c.queries,\n          conditions = c.conditions,\n          match,\n          p,\n          anyMatch,\n          toggled;\n\n      for (p in queries) {\n        match = _win.matchMedia(queries[p]).matches; // Firefox doesn't update the \"matches\" property of the MediaQueryList object correctly - it only does so as it calls its change handler - so we must re-create a media query here to ensure it's accurate.\n\n        match && (anyMatch = 1);\n\n        if (match !== conditions[p]) {\n          conditions[p] = match;\n          toggled = 1;\n        }\n      }\n\n      if (toggled) {\n        c.revert();\n        anyMatch && matches.push(c);\n      }\n    });\n\n    _dispatch(\"matchMediaRevert\");\n\n    matches.forEach(function (c) {\n      return c.onMatch(c, function (func) {\n        return c.add(null, func);\n      });\n    });\n    _lastMediaTime = time;\n\n    _dispatch(\"matchMedia\");\n  }\n};\n\nvar Context = /*#__PURE__*/function () {\n  function Context(func, scope) {\n    this.selector = scope && selector(scope);\n    this.data = [];\n    this._r = []; // returned/cleanup functions\n\n    this.isReverted = false;\n    this.id = _contextID++; // to work around issues that frameworks like Vue cause by making things into Proxies which make it impossible to do something like _media.indexOf(this) because \"this\" would no longer refer to the Context instance itself - it'd refer to a Proxy! We needed a way to identify the context uniquely\n\n    func && this.add(func);\n  }\n\n  var _proto5 = Context.prototype;\n\n  _proto5.add = function add(name, func, scope) {\n    // possible future addition if we need the ability to add() an animation to a context and for whatever reason cannot create that animation inside of a context.add(() => {...}) function.\n    // if (name && _isFunction(name.revert)) {\n    // \tthis.data.push(name);\n    // \treturn (name._ctx = this);\n    // }\n    if (_isFunction(name)) {\n      scope = func;\n      func = name;\n      name = _isFunction;\n    }\n\n    var self = this,\n        f = function f() {\n      var prev = _context,\n          prevSelector = self.selector,\n          result;\n      prev && prev !== self && prev.data.push(self);\n      scope && (self.selector = selector(scope));\n      _context = self;\n      result = func.apply(self, arguments);\n      _isFunction(result) && self._r.push(result);\n      _context = prev;\n      self.selector = prevSelector;\n      self.isReverted = false;\n      return result;\n    };\n\n    self.last = f;\n    return name === _isFunction ? f(self, function (func) {\n      return self.add(null, func);\n    }) : name ? self[name] = f : f;\n  };\n\n  _proto5.ignore = function ignore(func) {\n    var prev = _context;\n    _context = null;\n    func(this);\n    _context = prev;\n  };\n\n  _proto5.getTweens = function getTweens() {\n    var a = [];\n    this.data.forEach(function (e) {\n      return e instanceof Context ? a.push.apply(a, e.getTweens()) : e instanceof Tween && !(e.parent && e.parent.data === \"nested\") && a.push(e);\n    });\n    return a;\n  };\n\n  _proto5.clear = function clear() {\n    this._r.length = this.data.length = 0;\n  };\n\n  _proto5.kill = function kill(revert, matchMedia) {\n    var _this4 = this;\n\n    if (revert) {\n      (function () {\n        var tweens = _this4.getTweens(),\n            i = _this4.data.length,\n            t;\n\n        while (i--) {\n          // Flip plugin tweens are very different in that they should actually be pushed to their end. The plugin replaces the timeline's .revert() method to do exactly that. But we also need to remove any of those nested tweens inside the flip timeline so that they don't get individually reverted.\n          t = _this4.data[i];\n\n          if (t.data === \"isFlip\") {\n            t.revert();\n            t.getChildren(true, true, false).forEach(function (tween) {\n              return tweens.splice(tweens.indexOf(tween), 1);\n            });\n          }\n        } // save as an object so that we can cache the globalTime for each tween to optimize performance during the sort\n\n\n        tweens.map(function (t) {\n          return {\n            g: t._dur || t._delay || t._sat && !t._sat.vars.immediateRender ? t.globalTime(0) : -Infinity,\n            t: t\n          };\n        }).sort(function (a, b) {\n          return b.g - a.g || -Infinity;\n        }).forEach(function (o) {\n          return o.t.revert(revert);\n        }); // note: all of the _startAt tweens should be reverted in reverse order that they were created, and they'll all have the same globalTime (-1) so the \" || -1\" in the sort keeps the order properly.\n\n        i = _this4.data.length;\n\n        while (i--) {\n          // make sure we loop backwards so that, for example, SplitTexts that were created later on the same element get reverted first\n          t = _this4.data[i];\n\n          if (t instanceof Timeline) {\n            if (t.data !== \"nested\") {\n              t.scrollTrigger && t.scrollTrigger.revert();\n              t.kill(); // don't revert() the timeline because that's duplicating efforts since we already reverted all the tweens\n            }\n          } else {\n            !(t instanceof Tween) && t.revert && t.revert(revert);\n          }\n        }\n\n        _this4._r.forEach(function (f) {\n          return f(revert, _this4);\n        });\n\n        _this4.isReverted = true;\n      })();\n    } else {\n      this.data.forEach(function (e) {\n        return e.kill && e.kill();\n      });\n    }\n\n    this.clear();\n\n    if (matchMedia) {\n      var i = _media.length;\n\n      while (i--) {\n        // previously, we checked _media.indexOf(this), but some frameworks like Vue enforce Proxy objects that make it impossible to get the proper result that way, so we must use a unique ID number instead.\n        _media[i].id === this.id && _media.splice(i, 1);\n      }\n    }\n  } // killWithCleanup() {\n  // \tthis.kill();\n  // \tthis._r.forEach(f => f(false, this));\n  // }\n  ;\n\n  _proto5.revert = function revert(config) {\n    this.kill(config || {});\n  };\n\n  return Context;\n}();\n\nvar MatchMedia = /*#__PURE__*/function () {\n  function MatchMedia(scope) {\n    this.contexts = [];\n    this.scope = scope;\n    _context && _context.data.push(this);\n  }\n\n  var _proto6 = MatchMedia.prototype;\n\n  _proto6.add = function add(conditions, func, scope) {\n    _isObject(conditions) || (conditions = {\n      matches: conditions\n    });\n    var context = new Context(0, scope || this.scope),\n        cond = context.conditions = {},\n        mq,\n        p,\n        active;\n    _context && !context.selector && (context.selector = _context.selector); // in case a context is created inside a context. Like a gsap.matchMedia() that's inside a scoped gsap.context()\n\n    this.contexts.push(context);\n    func = context.add(\"onMatch\", func);\n    context.queries = conditions;\n\n    for (p in conditions) {\n      if (p === \"all\") {\n        active = 1;\n      } else {\n        mq = _win.matchMedia(conditions[p]);\n\n        if (mq) {\n          _media.indexOf(context) < 0 && _media.push(context);\n          (cond[p] = mq.matches) && (active = 1);\n          mq.addListener ? mq.addListener(_onMediaChange) : mq.addEventListener(\"change\", _onMediaChange);\n        }\n      }\n    }\n\n    active && func(context, function (f) {\n      return context.add(null, f);\n    });\n    return this;\n  } // refresh() {\n  // \tlet time = _lastMediaTime,\n  // \t\tmedia = _media;\n  // \t_lastMediaTime = -1;\n  // \t_media = this.contexts;\n  // \t_onMediaChange();\n  // \t_lastMediaTime = time;\n  // \t_media = media;\n  // }\n  ;\n\n  _proto6.revert = function revert(config) {\n    this.kill(config || {});\n  };\n\n  _proto6.kill = function kill(revert) {\n    this.contexts.forEach(function (c) {\n      return c.kill(revert, true);\n    });\n  };\n\n  return MatchMedia;\n}();\n/*\n * --------------------------------------------------------------------------------------\n * GSAP\n * --------------------------------------------------------------------------------------\n */\n\n\nvar _gsap = {\n  registerPlugin: function registerPlugin() {\n    for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n      args[_key2] = arguments[_key2];\n    }\n\n    args.forEach(function (config) {\n      return _createPlugin(config);\n    });\n  },\n  timeline: function timeline(vars) {\n    return new Timeline(vars);\n  },\n  getTweensOf: function getTweensOf(targets, onlyActive) {\n    return _globalTimeline.getTweensOf(targets, onlyActive);\n  },\n  getProperty: function getProperty(target, property, unit, uncache) {\n    _isString(target) && (target = toArray(target)[0]); //in case selector text or an array is passed in\n\n    var getter = _getCache(target || {}).get,\n        format = unit ? _passThrough : _numericIfPossible;\n\n    unit === \"native\" && (unit = \"\");\n    return !target ? target : !property ? function (property, unit, uncache) {\n      return format((_plugins[property] && _plugins[property].get || getter)(target, property, unit, uncache));\n    } : format((_plugins[property] && _plugins[property].get || getter)(target, property, unit, uncache));\n  },\n  quickSetter: function quickSetter(target, property, unit) {\n    target = toArray(target);\n\n    if (target.length > 1) {\n      var setters = target.map(function (t) {\n        return gsap.quickSetter(t, property, unit);\n      }),\n          l = setters.length;\n      return function (value) {\n        var i = l;\n\n        while (i--) {\n          setters[i](value);\n        }\n      };\n    }\n\n    target = target[0] || {};\n\n    var Plugin = _plugins[property],\n        cache = _getCache(target),\n        p = cache.harness && (cache.harness.aliases || {})[property] || property,\n        // in case it's an alias, like \"rotate\" for \"rotation\".\n    setter = Plugin ? function (value) {\n      var p = new Plugin();\n      _quickTween._pt = 0;\n      p.init(target, unit ? value + unit : value, _quickTween, 0, [target]);\n      p.render(1, p);\n      _quickTween._pt && _renderPropTweens(1, _quickTween);\n    } : cache.set(target, p);\n\n    return Plugin ? setter : function (value) {\n      return setter(target, p, unit ? value + unit : value, cache, 1);\n    };\n  },\n  quickTo: function quickTo(target, property, vars) {\n    var _setDefaults2;\n\n    var tween = gsap.to(target, _setDefaults((_setDefaults2 = {}, _setDefaults2[property] = \"+=0.1\", _setDefaults2.paused = true, _setDefaults2.stagger = 0, _setDefaults2), vars || {})),\n        func = function func(value, start, startIsRelative) {\n      return tween.resetTo(property, value, start, startIsRelative);\n    };\n\n    func.tween = tween;\n    return func;\n  },\n  isTweening: function isTweening(targets) {\n    return _globalTimeline.getTweensOf(targets, true).length > 0;\n  },\n  defaults: function defaults(value) {\n    value && value.ease && (value.ease = _parseEase(value.ease, _defaults.ease));\n    return _mergeDeep(_defaults, value || {});\n  },\n  config: function config(value) {\n    return _mergeDeep(_config, value || {});\n  },\n  registerEffect: function registerEffect(_ref3) {\n    var name = _ref3.name,\n        effect = _ref3.effect,\n        plugins = _ref3.plugins,\n        defaults = _ref3.defaults,\n        extendTimeline = _ref3.extendTimeline;\n    (plugins || \"\").split(\",\").forEach(function (pluginName) {\n      return pluginName && !_plugins[pluginName] && !_globals[pluginName] && _warn(name + \" effect requires \" + pluginName + \" plugin.\");\n    });\n\n    _effects[name] = function (targets, vars, tl) {\n      return effect(toArray(targets), _setDefaults(vars || {}, defaults), tl);\n    };\n\n    if (extendTimeline) {\n      Timeline.prototype[name] = function (targets, vars, position) {\n        return this.add(_effects[name](targets, _isObject(vars) ? vars : (position = vars) && {}, this), position);\n      };\n    }\n  },\n  registerEase: function registerEase(name, ease) {\n    _easeMap[name] = _parseEase(ease);\n  },\n  parseEase: function parseEase(ease, defaultEase) {\n    return arguments.length ? _parseEase(ease, defaultEase) : _easeMap;\n  },\n  getById: function getById(id) {\n    return _globalTimeline.getById(id);\n  },\n  exportRoot: function exportRoot(vars, includeDelayedCalls) {\n    if (vars === void 0) {\n      vars = {};\n    }\n\n    var tl = new Timeline(vars),\n        child,\n        next;\n    tl.smoothChildTiming = _isNotFalse(vars.smoothChildTiming);\n\n    _globalTimeline.remove(tl);\n\n    tl._dp = 0; //otherwise it'll get re-activated when adding children and be re-introduced into _globalTimeline's linked list (then added to itself).\n\n    tl._time = tl._tTime = _globalTimeline._time;\n    child = _globalTimeline._first;\n\n    while (child) {\n      next = child._next;\n\n      if (includeDelayedCalls || !(!child._dur && child instanceof Tween && child.vars.onComplete === child._targets[0])) {\n        _addToTimeline(tl, child, child._start - child._delay);\n      }\n\n      child = next;\n    }\n\n    _addToTimeline(_globalTimeline, tl, 0);\n\n    return tl;\n  },\n  context: function context(func, scope) {\n    return func ? new Context(func, scope) : _context;\n  },\n  matchMedia: function matchMedia(scope) {\n    return new MatchMedia(scope);\n  },\n  matchMediaRefresh: function matchMediaRefresh() {\n    return _media.forEach(function (c) {\n      var cond = c.conditions,\n          found,\n          p;\n\n      for (p in cond) {\n        if (cond[p]) {\n          cond[p] = false;\n          found = 1;\n        }\n      }\n\n      found && c.revert();\n    }) || _onMediaChange();\n  },\n  addEventListener: function addEventListener(type, callback) {\n    var a = _listeners[type] || (_listeners[type] = []);\n    ~a.indexOf(callback) || a.push(callback);\n  },\n  removeEventListener: function removeEventListener(type, callback) {\n    var a = _listeners[type],\n        i = a && a.indexOf(callback);\n    i >= 0 && a.splice(i, 1);\n  },\n  utils: {\n    wrap: wrap,\n    wrapYoyo: wrapYoyo,\n    distribute: distribute,\n    random: random,\n    snap: snap,\n    normalize: normalize,\n    getUnit: getUnit,\n    clamp: clamp,\n    splitColor: splitColor,\n    toArray: toArray,\n    selector: selector,\n    mapRange: mapRange,\n    pipe: pipe,\n    unitize: unitize,\n    interpolate: interpolate,\n    shuffle: shuffle\n  },\n  install: _install,\n  effects: _effects,\n  ticker: _ticker,\n  updateRoot: Timeline.updateRoot,\n  plugins: _plugins,\n  globalTimeline: _globalTimeline,\n  core: {\n    PropTween: PropTween,\n    globals: _addGlobal,\n    Tween: Tween,\n    Timeline: Timeline,\n    Animation: Animation,\n    getCache: _getCache,\n    _removeLinkedListItem: _removeLinkedListItem,\n    reverting: function reverting() {\n      return _reverting;\n    },\n    context: function context(toAdd) {\n      if (toAdd && _context) {\n        _context.data.push(toAdd);\n\n        toAdd._ctx = _context;\n      }\n\n      return _context;\n    },\n    suppressOverwrites: function suppressOverwrites(value) {\n      return _suppressOverwrites = value;\n    }\n  }\n};\n\n_forEachName(\"to,from,fromTo,delayedCall,set,killTweensOf\", function (name) {\n  return _gsap[name] = Tween[name];\n});\n\n_ticker.add(Timeline.updateRoot);\n\n_quickTween = _gsap.to({}, {\n  duration: 0\n}); // ---- EXTRA PLUGINS --------------------------------------------------------\n\nvar _getPluginPropTween = function _getPluginPropTween(plugin, prop) {\n  var pt = plugin._pt;\n\n  while (pt && pt.p !== prop && pt.op !== prop && pt.fp !== prop) {\n    pt = pt._next;\n  }\n\n  return pt;\n},\n    _addModifiers = function _addModifiers(tween, modifiers) {\n  var targets = tween._targets,\n      p,\n      i,\n      pt;\n\n  for (p in modifiers) {\n    i = targets.length;\n\n    while (i--) {\n      pt = tween._ptLookup[i][p];\n\n      if (pt && (pt = pt.d)) {\n        if (pt._pt) {\n          // is a plugin\n          pt = _getPluginPropTween(pt, p);\n        }\n\n        pt && pt.modifier && pt.modifier(modifiers[p], tween, targets[i], p);\n      }\n    }\n  }\n},\n    _buildModifierPlugin = function _buildModifierPlugin(name, modifier) {\n  return {\n    name: name,\n    headless: 1,\n    rawVars: 1,\n    //don't pre-process function-based values or \"random()\" strings.\n    init: function init(target, vars, tween) {\n      tween._onInit = function (tween) {\n        var temp, p;\n\n        if (_isString(vars)) {\n          temp = {};\n\n          _forEachName(vars, function (name) {\n            return temp[name] = 1;\n          }); //if the user passes in a comma-delimited list of property names to roundProps, like \"x,y\", we round to whole numbers.\n\n\n          vars = temp;\n        }\n\n        if (modifier) {\n          temp = {};\n\n          for (p in vars) {\n            temp[p] = modifier(vars[p]);\n          }\n\n          vars = temp;\n        }\n\n        _addModifiers(tween, vars);\n      };\n    }\n  };\n}; //register core plugins\n\n\nexport var gsap = _gsap.registerPlugin({\n  name: \"attr\",\n  init: function init(target, vars, tween, index, targets) {\n    var p, pt, v;\n    this.tween = tween;\n\n    for (p in vars) {\n      v = target.getAttribute(p) || \"\";\n      pt = this.add(target, \"setAttribute\", (v || 0) + \"\", vars[p], index, targets, 0, 0, p);\n      pt.op = p;\n      pt.b = v; // record the beginning value so we can revert()\n\n      this._props.push(p);\n    }\n  },\n  render: function render(ratio, data) {\n    var pt = data._pt;\n\n    while (pt) {\n      _reverting ? pt.set(pt.t, pt.p, pt.b, pt) : pt.r(ratio, pt.d); // if reverting, go back to the original (pt.b)\n\n      pt = pt._next;\n    }\n  }\n}, {\n  name: \"endArray\",\n  headless: 1,\n  init: function init(target, value) {\n    var i = value.length;\n\n    while (i--) {\n      this.add(target, i, target[i] || 0, value[i], 0, 0, 0, 0, 0, 1);\n    }\n  }\n}, _buildModifierPlugin(\"roundProps\", _roundModifier), _buildModifierPlugin(\"modifiers\"), _buildModifierPlugin(\"snap\", snap)) || _gsap; //to prevent the core plugins from being dropped via aggressive tree shaking, we must include them in the variable declaration in this way.\n\nTween.version = Timeline.version = gsap.version = \"3.13.0\";\n_coreReady = 1;\n_windowExists() && _wake();\nvar Power0 = _easeMap.Power0,\n    Power1 = _easeMap.Power1,\n    Power2 = _easeMap.Power2,\n    Power3 = _easeMap.Power3,\n    Power4 = _easeMap.Power4,\n    Linear = _easeMap.Linear,\n    Quad = _easeMap.Quad,\n    Cubic = _easeMap.Cubic,\n    Quart = _easeMap.Quart,\n    Quint = _easeMap.Quint,\n    Strong = _easeMap.Strong,\n    Elastic = _easeMap.Elastic,\n    Back = _easeMap.Back,\n    SteppedEase = _easeMap.SteppedEase,\n    Bounce = _easeMap.Bounce,\n    Sine = _easeMap.Sine,\n    Expo = _easeMap.Expo,\n    Circ = _easeMap.Circ;\nexport { Power0, Power1, Power2, Power3, Power4, Linear, Quad, Cubic, Quart, Quint, Strong, Elastic, Back, SteppedEase, Bounce, Sine, Expo, Circ };\nexport { Tween as TweenMax, Tween as TweenLite, Timeline as TimelineMax, Timeline as TimelineLite, gsap as default, wrap, wrapYoyo, distribute, random, snap, normalize, getUnit, clamp, splitColor, toArray, selector, mapRange, pipe, unitize, interpolate, shuffle }; //export some internal methods/orojects for use in CSSPlugin so that we can externalize that file and allow custom builds that exclude it.\n\nexport { _getProperty, _numExp, _numWithUnitExp, _isString, _isUndefined, _renderComplexString, _relExp, _setDefaults, _removeLinkedListItem, _forEachName, _sortPropTweensByPriority, _colorStringFilter, _replaceRandom, _checkPlugin, _plugins, _ticker, _config, _roundModifier, _round, _missingPlugin, _getSetter, _getCache, _colorExp, _parseRelative };","/*!\n * CSSPlugin 3.13.0\n * https://gsap.com\n *\n * Copyright 2008-2025, GreenSock. All rights reserved.\n * Subject to the terms at https://gsap.com/standard-license\n * @author: Jack Doyle, jack@greensock.com\n*/\n\n/* eslint-disable */\nimport { gsap, _getProperty, _numExp, _numWithUnitExp, getUnit, _isString, _isUndefined, _renderComplexString, _relExp, _forEachName, _sortPropTweensByPriority, _colorStringFilter, _checkPlugin, _replaceRandom, _plugins, GSCache, PropTween, _config, _ticker, _round, _missingPlugin, _getSetter, _getCache, _colorExp, _parseRelative, _setDefaults, _removeLinkedListItem //for the commented-out className feature.\n} from \"./gsap-core.js\";\n\nvar _win,\n    _doc,\n    _docElement,\n    _pluginInitted,\n    _tempDiv,\n    _tempDivStyler,\n    _recentSetterPlugin,\n    _reverting,\n    _windowExists = function _windowExists() {\n  return typeof window !== \"undefined\";\n},\n    _transformProps = {},\n    _RAD2DEG = 180 / Math.PI,\n    _DEG2RAD = Math.PI / 180,\n    _atan2 = Math.atan2,\n    _bigNum = 1e8,\n    _capsExp = /([A-Z])/g,\n    _horizontalExp = /(left|right|width|margin|padding|x)/i,\n    _complexExp = /[\\s,\\(]\\S/,\n    _propertyAliases = {\n  autoAlpha: \"opacity,visibility\",\n  scale: \"scaleX,scaleY\",\n  alpha: \"opacity\"\n},\n    _renderCSSProp = function _renderCSSProp(ratio, data) {\n  return data.set(data.t, data.p, Math.round((data.s + data.c * ratio) * 10000) / 10000 + data.u, data);\n},\n    _renderPropWithEnd = function _renderPropWithEnd(ratio, data) {\n  return data.set(data.t, data.p, ratio === 1 ? data.e : Math.round((data.s + data.c * ratio) * 10000) / 10000 + data.u, data);\n},\n    _renderCSSPropWithBeginning = function _renderCSSPropWithBeginning(ratio, data) {\n  return data.set(data.t, data.p, ratio ? Math.round((data.s + data.c * ratio) * 10000) / 10000 + data.u : data.b, data);\n},\n    //if units change, we need a way to render the original unit/value when the tween goes all the way back to the beginning (ratio:0)\n_renderRoundedCSSProp = function _renderRoundedCSSProp(ratio, data) {\n  var value = data.s + data.c * ratio;\n  data.set(data.t, data.p, ~~(value + (value < 0 ? -.5 : .5)) + data.u, data);\n},\n    _renderNonTweeningValue = function _renderNonTweeningValue(ratio, data) {\n  return data.set(data.t, data.p, ratio ? data.e : data.b, data);\n},\n    _renderNonTweeningValueOnlyAtEnd = function _renderNonTweeningValueOnlyAtEnd(ratio, data) {\n  return data.set(data.t, data.p, ratio !== 1 ? data.b : data.e, data);\n},\n    _setterCSSStyle = function _setterCSSStyle(target, property, value) {\n  return target.style[property] = value;\n},\n    _setterCSSProp = function _setterCSSProp(target, property, value) {\n  return target.style.setProperty(property, value);\n},\n    _setterTransform = function _setterTransform(target, property, value) {\n  return target._gsap[property] = value;\n},\n    _setterScale = function _setterScale(target, property, value) {\n  return target._gsap.scaleX = target._gsap.scaleY = value;\n},\n    _setterScaleWithRender = function _setterScaleWithRender(target, property, value, data, ratio) {\n  var cache = target._gsap;\n  cache.scaleX = cache.scaleY = value;\n  cache.renderTransform(ratio, cache);\n},\n    _setterTransformWithRender = function _setterTransformWithRender(target, property, value, data, ratio) {\n  var cache = target._gsap;\n  cache[property] = value;\n  cache.renderTransform(ratio, cache);\n},\n    _transformProp = \"transform\",\n    _transformOriginProp = _transformProp + \"Origin\",\n    _saveStyle = function _saveStyle(property, isNotCSS) {\n  var _this = this;\n\n  var target = this.target,\n      style = target.style,\n      cache = target._gsap;\n\n  if (property in _transformProps && style) {\n    this.tfm = this.tfm || {};\n\n    if (property !== \"transform\") {\n      property = _propertyAliases[property] || property;\n      ~property.indexOf(\",\") ? property.split(\",\").forEach(function (a) {\n        return _this.tfm[a] = _get(target, a);\n      }) : this.tfm[property] = cache.x ? cache[property] : _get(target, property); // note: scale would map to \"scaleX,scaleY\", thus we loop and apply them both.\n\n      property === _transformOriginProp && (this.tfm.zOrigin = cache.zOrigin);\n    } else {\n      return _propertyAliases.transform.split(\",\").forEach(function (p) {\n        return _saveStyle.call(_this, p, isNotCSS);\n      });\n    }\n\n    if (this.props.indexOf(_transformProp) >= 0) {\n      return;\n    }\n\n    if (cache.svg) {\n      this.svgo = target.getAttribute(\"data-svg-origin\");\n      this.props.push(_transformOriginProp, isNotCSS, \"\");\n    }\n\n    property = _transformProp;\n  }\n\n  (style || isNotCSS) && this.props.push(property, isNotCSS, style[property]);\n},\n    _removeIndependentTransforms = function _removeIndependentTransforms(style) {\n  if (style.translate) {\n    style.removeProperty(\"translate\");\n    style.removeProperty(\"scale\");\n    style.removeProperty(\"rotate\");\n  }\n},\n    _revertStyle = function _revertStyle() {\n  var props = this.props,\n      target = this.target,\n      style = target.style,\n      cache = target._gsap,\n      i,\n      p;\n\n  for (i = 0; i < props.length; i += 3) {\n    // stored like this: property, isNotCSS, value\n    if (!props[i + 1]) {\n      props[i + 2] ? style[props[i]] = props[i + 2] : style.removeProperty(props[i].substr(0, 2) === \"--\" ? props[i] : props[i].replace(_capsExp, \"-$1\").toLowerCase());\n    } else if (props[i + 1] === 2) {\n      // non-CSS value (function-based)\n      target[props[i]](props[i + 2]);\n    } else {\n      // non-CSS value (not function-based)\n      target[props[i]] = props[i + 2];\n    }\n  }\n\n  if (this.tfm) {\n    for (p in this.tfm) {\n      cache[p] = this.tfm[p];\n    }\n\n    if (cache.svg) {\n      cache.renderTransform();\n      target.setAttribute(\"data-svg-origin\", this.svgo || \"\");\n    }\n\n    i = _reverting();\n\n    if ((!i || !i.isStart) && !style[_transformProp]) {\n      _removeIndependentTransforms(style);\n\n      if (cache.zOrigin && style[_transformOriginProp]) {\n        style[_transformOriginProp] += \" \" + cache.zOrigin + \"px\"; // since we're uncaching, we must put the zOrigin back into the transformOrigin so that we can pull it out accurately when we parse again. Otherwise, we'd lose the z portion of the origin since we extract it to protect from Safari bugs.\n\n        cache.zOrigin = 0;\n        cache.renderTransform();\n      }\n\n      cache.uncache = 1; // if it's a startAt that's being reverted in the _initTween() of the core, we don't need to uncache transforms. This is purely a performance optimization.\n    }\n  }\n},\n    _getStyleSaver = function _getStyleSaver(target, properties) {\n  var saver = {\n    target: target,\n    props: [],\n    revert: _revertStyle,\n    save: _saveStyle\n  };\n  target._gsap || gsap.core.getCache(target); // just make sure there's a _gsap cache defined because we read from it in _saveStyle() and it's more efficient to just check it here once.\n\n  properties && target.style && target.nodeType && properties.split(\",\").forEach(function (p) {\n    return saver.save(p);\n  }); // make sure it's a DOM node too.\n\n  return saver;\n},\n    _supports3D,\n    _createElement = function _createElement(type, ns) {\n  var e = _doc.createElementNS ? _doc.createElementNS((ns || \"http://www.w3.org/1999/xhtml\").replace(/^https/, \"http\"), type) : _doc.createElement(type); //some servers swap in https for http in the namespace which can break things, making \"style\" inaccessible.\n\n  return e && e.style ? e : _doc.createElement(type); //some environments won't allow access to the element's style when created with a namespace in which case we default to the standard createElement() to work around the issue. Also note that when GSAP is embedded directly inside an SVG file, createElement() won't allow access to the style object in Firefox (see https://gsap.com/forums/topic/20215-problem-using-tweenmax-in-standalone-self-containing-svg-file-err-cannot-set-property-csstext-of-undefined/).\n},\n    _getComputedProperty = function _getComputedProperty(target, property, skipPrefixFallback) {\n  var cs = getComputedStyle(target);\n  return cs[property] || cs.getPropertyValue(property.replace(_capsExp, \"-$1\").toLowerCase()) || cs.getPropertyValue(property) || !skipPrefixFallback && _getComputedProperty(target, _checkPropPrefix(property) || property, 1) || \"\"; //css variables may not need caps swapped out for dashes and lowercase.\n},\n    _prefixes = \"O,Moz,ms,Ms,Webkit\".split(\",\"),\n    _checkPropPrefix = function _checkPropPrefix(property, element, preferPrefix) {\n  var e = element || _tempDiv,\n      s = e.style,\n      i = 5;\n\n  if (property in s && !preferPrefix) {\n    return property;\n  }\n\n  property = property.charAt(0).toUpperCase() + property.substr(1);\n\n  while (i-- && !(_prefixes[i] + property in s)) {}\n\n  return i < 0 ? null : (i === 3 ? \"ms\" : i >= 0 ? _prefixes[i] : \"\") + property;\n},\n    _initCore = function _initCore() {\n  if (_windowExists() && window.document) {\n    _win = window;\n    _doc = _win.document;\n    _docElement = _doc.documentElement;\n    _tempDiv = _createElement(\"div\") || {\n      style: {}\n    };\n    _tempDivStyler = _createElement(\"div\");\n    _transformProp = _checkPropPrefix(_transformProp);\n    _transformOriginProp = _transformProp + \"Origin\";\n    _tempDiv.style.cssText = \"border-width:0;line-height:0;position:absolute;padding:0\"; //make sure to override certain properties that may contaminate measurements, in case the user has overreaching style sheets.\n\n    _supports3D = !!_checkPropPrefix(\"perspective\");\n    _reverting = gsap.core.reverting;\n    _pluginInitted = 1;\n  }\n},\n    _getReparentedCloneBBox = function _getReparentedCloneBBox(target) {\n  //works around issues in some browsers (like Firefox) that don't correctly report getBBox() on SVG elements inside a <defs> element and/or <mask>. We try creating an SVG, adding it to the documentElement and toss the element in there so that it's definitely part of the rendering tree, then grab the bbox and if it works, we actually swap out the original getBBox() method for our own that does these extra steps whenever getBBox is needed. This helps ensure that performance is optimal (only do all these extra steps when absolutely necessary...most elements don't need it).\n  var owner = target.ownerSVGElement,\n      svg = _createElement(\"svg\", owner && owner.getAttribute(\"xmlns\") || \"http://www.w3.org/2000/svg\"),\n      clone = target.cloneNode(true),\n      bbox;\n\n  clone.style.display = \"block\";\n  svg.appendChild(clone);\n\n  _docElement.appendChild(svg);\n\n  try {\n    bbox = clone.getBBox();\n  } catch (e) {}\n\n  svg.removeChild(clone);\n\n  _docElement.removeChild(svg);\n\n  return bbox;\n},\n    _getAttributeFallbacks = function _getAttributeFallbacks(target, attributesArray) {\n  var i = attributesArray.length;\n\n  while (i--) {\n    if (target.hasAttribute(attributesArray[i])) {\n      return target.getAttribute(attributesArray[i]);\n    }\n  }\n},\n    _getBBox = function _getBBox(target) {\n  var bounds, cloned;\n\n  try {\n    bounds = target.getBBox(); //Firefox throws errors if you try calling getBBox() on an SVG element that's not rendered (like in a <symbol> or <defs>). https://bugzilla.mozilla.org/show_bug.cgi?id=612118\n  } catch (error) {\n    bounds = _getReparentedCloneBBox(target);\n    cloned = 1;\n  }\n\n  bounds && (bounds.width || bounds.height) || cloned || (bounds = _getReparentedCloneBBox(target)); //some browsers (like Firefox) misreport the bounds if the element has zero width and height (it just assumes it's at x:0, y:0), thus we need to manually grab the position in that case.\n\n  return bounds && !bounds.width && !bounds.x && !bounds.y ? {\n    x: +_getAttributeFallbacks(target, [\"x\", \"cx\", \"x1\"]) || 0,\n    y: +_getAttributeFallbacks(target, [\"y\", \"cy\", \"y1\"]) || 0,\n    width: 0,\n    height: 0\n  } : bounds;\n},\n    _isSVG = function _isSVG(e) {\n  return !!(e.getCTM && (!e.parentNode || e.ownerSVGElement) && _getBBox(e));\n},\n    //reports if the element is an SVG on which getBBox() actually works\n_removeProperty = function _removeProperty(target, property) {\n  if (property) {\n    var style = target.style,\n        first2Chars;\n\n    if (property in _transformProps && property !== _transformOriginProp) {\n      property = _transformProp;\n    }\n\n    if (style.removeProperty) {\n      first2Chars = property.substr(0, 2);\n\n      if (first2Chars === \"ms\" || property.substr(0, 6) === \"webkit\") {\n        //Microsoft and some Webkit browsers don't conform to the standard of capitalizing the first prefix character, so we adjust so that when we prefix the caps with a dash, it's correct (otherwise it'd be \"ms-transform\" instead of \"-ms-transform\" for IE9, for example)\n        property = \"-\" + property;\n      }\n\n      style.removeProperty(first2Chars === \"--\" ? property : property.replace(_capsExp, \"-$1\").toLowerCase());\n    } else {\n      //note: old versions of IE use \"removeAttribute()\" instead of \"removeProperty()\"\n      style.removeAttribute(property);\n    }\n  }\n},\n    _addNonTweeningPT = function _addNonTweeningPT(plugin, target, property, beginning, end, onlySetAtEnd) {\n  var pt = new PropTween(plugin._pt, target, property, 0, 1, onlySetAtEnd ? _renderNonTweeningValueOnlyAtEnd : _renderNonTweeningValue);\n  plugin._pt = pt;\n  pt.b = beginning;\n  pt.e = end;\n\n  plugin._props.push(property);\n\n  return pt;\n},\n    _nonConvertibleUnits = {\n  deg: 1,\n  rad: 1,\n  turn: 1\n},\n    _nonStandardLayouts = {\n  grid: 1,\n  flex: 1\n},\n    //takes a single value like 20px and converts it to the unit specified, like \"%\", returning only the numeric amount.\n_convertToUnit = function _convertToUnit(target, property, value, unit) {\n  var curValue = parseFloat(value) || 0,\n      curUnit = (value + \"\").trim().substr((curValue + \"\").length) || \"px\",\n      // some browsers leave extra whitespace at the beginning of CSS variables, hence the need to trim()\n  style = _tempDiv.style,\n      horizontal = _horizontalExp.test(property),\n      isRootSVG = target.tagName.toLowerCase() === \"svg\",\n      measureProperty = (isRootSVG ? \"client\" : \"offset\") + (horizontal ? \"Width\" : \"Height\"),\n      amount = 100,\n      toPixels = unit === \"px\",\n      toPercent = unit === \"%\",\n      px,\n      parent,\n      cache,\n      isSVG;\n\n  if (unit === curUnit || !curValue || _nonConvertibleUnits[unit] || _nonConvertibleUnits[curUnit]) {\n    return curValue;\n  }\n\n  curUnit !== \"px\" && !toPixels && (curValue = _convertToUnit(target, property, value, \"px\"));\n  isSVG = target.getCTM && _isSVG(target);\n\n  if ((toPercent || curUnit === \"%\") && (_transformProps[property] || ~property.indexOf(\"adius\"))) {\n    px = isSVG ? target.getBBox()[horizontal ? \"width\" : \"height\"] : target[measureProperty];\n    return _round(toPercent ? curValue / px * amount : curValue / 100 * px);\n  }\n\n  style[horizontal ? \"width\" : \"height\"] = amount + (toPixels ? curUnit : unit);\n  parent = unit !== \"rem\" && ~property.indexOf(\"adius\") || unit === \"em\" && target.appendChild && !isRootSVG ? target : target.parentNode;\n\n  if (isSVG) {\n    parent = (target.ownerSVGElement || {}).parentNode;\n  }\n\n  if (!parent || parent === _doc || !parent.appendChild) {\n    parent = _doc.body;\n  }\n\n  cache = parent._gsap;\n\n  if (cache && toPercent && cache.width && horizontal && cache.time === _ticker.time && !cache.uncache) {\n    return _round(curValue / cache.width * amount);\n  } else {\n    if (toPercent && (property === \"height\" || property === \"width\")) {\n      // if we're dealing with width/height that's inside a container with padding and/or it's a flexbox/grid container, we must apply it to the target itself rather than the _tempDiv in order to ensure complete accuracy, factoring in the parent's padding.\n      var v = target.style[property];\n      target.style[property] = amount + unit;\n      px = target[measureProperty];\n      v ? target.style[property] = v : _removeProperty(target, property);\n    } else {\n      (toPercent || curUnit === \"%\") && !_nonStandardLayouts[_getComputedProperty(parent, \"display\")] && (style.position = _getComputedProperty(target, \"position\"));\n      parent === target && (style.position = \"static\"); // like for borderRadius, if it's a % we must have it relative to the target itself but that may not have position: relative or position: absolute in which case it'd go up the chain until it finds its offsetParent (bad). position: static protects against that.\n\n      parent.appendChild(_tempDiv);\n      px = _tempDiv[measureProperty];\n      parent.removeChild(_tempDiv);\n      style.position = \"absolute\";\n    }\n\n    if (horizontal && toPercent) {\n      cache = _getCache(parent);\n      cache.time = _ticker.time;\n      cache.width = parent[measureProperty];\n    }\n  }\n\n  return _round(toPixels ? px * curValue / amount : px && curValue ? amount / px * curValue : 0);\n},\n    _get = function _get(target, property, unit, uncache) {\n  var value;\n  _pluginInitted || _initCore();\n\n  if (property in _propertyAliases && property !== \"transform\") {\n    property = _propertyAliases[property];\n\n    if (~property.indexOf(\",\")) {\n      property = property.split(\",\")[0];\n    }\n  }\n\n  if (_transformProps[property] && property !== \"transform\") {\n    value = _parseTransform(target, uncache);\n    value = property !== \"transformOrigin\" ? value[property] : value.svg ? value.origin : _firstTwoOnly(_getComputedProperty(target, _transformOriginProp)) + \" \" + value.zOrigin + \"px\";\n  } else {\n    value = target.style[property];\n\n    if (!value || value === \"auto\" || uncache || ~(value + \"\").indexOf(\"calc(\")) {\n      value = _specialProps[property] && _specialProps[property](target, property, unit) || _getComputedProperty(target, property) || _getProperty(target, property) || (property === \"opacity\" ? 1 : 0); // note: some browsers, like Firefox, don't report borderRadius correctly! Instead, it only reports every corner like  borderTopLeftRadius\n    }\n  }\n\n  return unit && !~(value + \"\").trim().indexOf(\" \") ? _convertToUnit(target, property, value, unit) + unit : value;\n},\n    _tweenComplexCSSString = function _tweenComplexCSSString(target, prop, start, end) {\n  // note: we call _tweenComplexCSSString.call(pluginInstance...) to ensure that it's scoped properly. We may call it from within a plugin too, thus \"this\" would refer to the plugin.\n  if (!start || start === \"none\") {\n    // some browsers like Safari actually PREFER the prefixed property and mis-report the unprefixed value like clipPath (BUG). In other words, even though clipPath exists in the style (\"clipPath\" in target.style) and it's set in the CSS properly (along with -webkit-clip-path), Safari reports clipPath as \"none\" whereas WebkitClipPath reports accurately like \"ellipse(100% 0% at 50% 0%)\", so in this case we must SWITCH to using the prefixed property instead. See https://gsap.com/forums/topic/18310-clippath-doesnt-work-on-ios/\n    var p = _checkPropPrefix(prop, target, 1),\n        s = p && _getComputedProperty(target, p, 1);\n\n    if (s && s !== start) {\n      prop = p;\n      start = s;\n    } else if (prop === \"borderColor\") {\n      start = _getComputedProperty(target, \"borderTopColor\"); // Firefox bug: always reports \"borderColor\" as \"\", so we must fall back to borderTopColor. See https://gsap.com/forums/topic/24583-how-to-return-colors-that-i-had-after-reverse/\n    }\n  }\n\n  var pt = new PropTween(this._pt, target.style, prop, 0, 1, _renderComplexString),\n      index = 0,\n      matchIndex = 0,\n      a,\n      result,\n      startValues,\n      startNum,\n      color,\n      startValue,\n      endValue,\n      endNum,\n      chunk,\n      endUnit,\n      startUnit,\n      endValues;\n  pt.b = start;\n  pt.e = end;\n  start += \"\"; // ensure values are strings\n\n  end += \"\";\n\n  if (end.substring(0, 6) === \"var(--\") {\n    end = _getComputedProperty(target, end.substring(4, end.indexOf(\")\")));\n  }\n\n  if (end === \"auto\") {\n    startValue = target.style[prop];\n    target.style[prop] = end;\n    end = _getComputedProperty(target, prop) || end;\n    startValue ? target.style[prop] = startValue : _removeProperty(target, prop);\n  }\n\n  a = [start, end];\n\n  _colorStringFilter(a); // pass an array with the starting and ending values and let the filter do whatever it needs to the values. If colors are found, it returns true and then we must match where the color shows up order-wise because for things like boxShadow, sometimes the browser provides the computed values with the color FIRST, but the user provides it with the color LAST, so flip them if necessary. Same for drop-shadow().\n\n\n  start = a[0];\n  end = a[1];\n  startValues = start.match(_numWithUnitExp) || [];\n  endValues = end.match(_numWithUnitExp) || [];\n\n  if (endValues.length) {\n    while (result = _numWithUnitExp.exec(end)) {\n      endValue = result[0];\n      chunk = end.substring(index, result.index);\n\n      if (color) {\n        color = (color + 1) % 5;\n      } else if (chunk.substr(-5) === \"rgba(\" || chunk.substr(-5) === \"hsla(\") {\n        color = 1;\n      }\n\n      if (endValue !== (startValue = startValues[matchIndex++] || \"\")) {\n        startNum = parseFloat(startValue) || 0;\n        startUnit = startValue.substr((startNum + \"\").length);\n        endValue.charAt(1) === \"=\" && (endValue = _parseRelative(startNum, endValue) + startUnit);\n        endNum = parseFloat(endValue);\n        endUnit = endValue.substr((endNum + \"\").length);\n        index = _numWithUnitExp.lastIndex - endUnit.length;\n\n        if (!endUnit) {\n          //if something like \"perspective:300\" is passed in and we must add a unit to the end\n          endUnit = endUnit || _config.units[prop] || startUnit;\n\n          if (index === end.length) {\n            end += endUnit;\n            pt.e += endUnit;\n          }\n        }\n\n        if (startUnit !== endUnit) {\n          startNum = _convertToUnit(target, prop, startValue, endUnit) || 0;\n        } // these nested PropTweens are handled in a special way - we'll never actually call a render or setter method on them. We'll just loop through them in the parent complex string PropTween's render method.\n\n\n        pt._pt = {\n          _next: pt._pt,\n          p: chunk || matchIndex === 1 ? chunk : \",\",\n          //note: SVG spec allows omission of comma/space when a negative sign is wedged between two numbers, like 2.5-5.3 instead of 2.5,-5.3 but when tweening, the negative value may switch to positive, so we insert the comma just in case.\n          s: startNum,\n          c: endNum - startNum,\n          m: color && color < 4 || prop === \"zIndex\" ? Math.round : 0\n        };\n      }\n    }\n\n    pt.c = index < end.length ? end.substring(index, end.length) : \"\"; //we use the \"c\" of the PropTween to store the final part of the string (after the last number)\n  } else {\n    pt.r = prop === \"display\" && end === \"none\" ? _renderNonTweeningValueOnlyAtEnd : _renderNonTweeningValue;\n  }\n\n  _relExp.test(end) && (pt.e = 0); //if the end string contains relative values or dynamic random(...) values, delete the end it so that on the final render we don't actually set it to the string with += or -= characters (forces it to use the calculated value).\n\n  this._pt = pt; //start the linked list with this new PropTween. Remember, we call _tweenComplexCSSString.call(pluginInstance...) to ensure that it's scoped properly. We may call it from within another plugin too, thus \"this\" would refer to the plugin.\n\n  return pt;\n},\n    _keywordToPercent = {\n  top: \"0%\",\n  bottom: \"100%\",\n  left: \"0%\",\n  right: \"100%\",\n  center: \"50%\"\n},\n    _convertKeywordsToPercentages = function _convertKeywordsToPercentages(value) {\n  var split = value.split(\" \"),\n      x = split[0],\n      y = split[1] || \"50%\";\n\n  if (x === \"top\" || x === \"bottom\" || y === \"left\" || y === \"right\") {\n    //the user provided them in the wrong order, so flip them\n    value = x;\n    x = y;\n    y = value;\n  }\n\n  split[0] = _keywordToPercent[x] || x;\n  split[1] = _keywordToPercent[y] || y;\n  return split.join(\" \");\n},\n    _renderClearProps = function _renderClearProps(ratio, data) {\n  if (data.tween && data.tween._time === data.tween._dur) {\n    var target = data.t,\n        style = target.style,\n        props = data.u,\n        cache = target._gsap,\n        prop,\n        clearTransforms,\n        i;\n\n    if (props === \"all\" || props === true) {\n      style.cssText = \"\";\n      clearTransforms = 1;\n    } else {\n      props = props.split(\",\");\n      i = props.length;\n\n      while (--i > -1) {\n        prop = props[i];\n\n        if (_transformProps[prop]) {\n          clearTransforms = 1;\n          prop = prop === \"transformOrigin\" ? _transformOriginProp : _transformProp;\n        }\n\n        _removeProperty(target, prop);\n      }\n    }\n\n    if (clearTransforms) {\n      _removeProperty(target, _transformProp);\n\n      if (cache) {\n        cache.svg && target.removeAttribute(\"transform\");\n        style.scale = style.rotate = style.translate = \"none\";\n\n        _parseTransform(target, 1); // force all the cached values back to \"normal\"/identity, otherwise if there's another tween that's already set to render transforms on this element, it could display the wrong values.\n\n\n        cache.uncache = 1;\n\n        _removeIndependentTransforms(style);\n      }\n    }\n  }\n},\n    // note: specialProps should return 1 if (and only if) they have a non-zero priority. It indicates we need to sort the linked list.\n_specialProps = {\n  clearProps: function clearProps(plugin, target, property, endValue, tween) {\n    if (tween.data !== \"isFromStart\") {\n      var pt = plugin._pt = new PropTween(plugin._pt, target, property, 0, 0, _renderClearProps);\n      pt.u = endValue;\n      pt.pr = -10;\n      pt.tween = tween;\n\n      plugin._props.push(property);\n\n      return 1;\n    }\n  }\n  /* className feature (about 0.4kb gzipped).\n  , className(plugin, target, property, endValue, tween) {\n  \tlet _renderClassName = (ratio, data) => {\n  \t\t\tdata.css.render(ratio, data.css);\n  \t\t\tif (!ratio || ratio === 1) {\n  \t\t\t\tlet inline = data.rmv,\n  \t\t\t\t\ttarget = data.t,\n  \t\t\t\t\tp;\n  \t\t\t\ttarget.setAttribute(\"class\", ratio ? data.e : data.b);\n  \t\t\t\tfor (p in inline) {\n  \t\t\t\t\t_removeProperty(target, p);\n  \t\t\t\t}\n  \t\t\t}\n  \t\t},\n  \t\t_getAllStyles = (target) => {\n  \t\t\tlet styles = {},\n  \t\t\t\tcomputed = getComputedStyle(target),\n  \t\t\t\tp;\n  \t\t\tfor (p in computed) {\n  \t\t\t\tif (isNaN(p) && p !== \"cssText\" && p !== \"length\") {\n  \t\t\t\t\tstyles[p] = computed[p];\n  \t\t\t\t}\n  \t\t\t}\n  \t\t\t_setDefaults(styles, _parseTransform(target, 1));\n  \t\t\treturn styles;\n  \t\t},\n  \t\tstartClassList = target.getAttribute(\"class\"),\n  \t\tstyle = target.style,\n  \t\tcssText = style.cssText,\n  \t\tcache = target._gsap,\n  \t\tclassPT = cache.classPT,\n  \t\tinlineToRemoveAtEnd = {},\n  \t\tdata = {t:target, plugin:plugin, rmv:inlineToRemoveAtEnd, b:startClassList, e:(endValue.charAt(1) !== \"=\") ? endValue : startClassList.replace(new RegExp(\"(?:\\\\s|^)\" + endValue.substr(2) + \"(?![\\\\w-])\"), \"\") + ((endValue.charAt(0) === \"+\") ? \" \" + endValue.substr(2) : \"\")},\n  \t\tchangingVars = {},\n  \t\tstartVars = _getAllStyles(target),\n  \t\ttransformRelated = /(transform|perspective)/i,\n  \t\tendVars, p;\n  \tif (classPT) {\n  \t\tclassPT.r(1, classPT.d);\n  \t\t_removeLinkedListItem(classPT.d.plugin, classPT, \"_pt\");\n  \t}\n  \ttarget.setAttribute(\"class\", data.e);\n  \tendVars = _getAllStyles(target, true);\n  \ttarget.setAttribute(\"class\", startClassList);\n  \tfor (p in endVars) {\n  \t\tif (endVars[p] !== startVars[p] && !transformRelated.test(p)) {\n  \t\t\tchangingVars[p] = endVars[p];\n  \t\t\tif (!style[p] && style[p] !== \"0\") {\n  \t\t\t\tinlineToRemoveAtEnd[p] = 1;\n  \t\t\t}\n  \t\t}\n  \t}\n  \tcache.classPT = plugin._pt = new PropTween(plugin._pt, target, \"className\", 0, 0, _renderClassName, data, 0, -11);\n  \tif (style.cssText !== cssText) { //only apply if things change. Otherwise, in cases like a background-image that's pulled dynamically, it could cause a refresh. See https://gsap.com/forums/topic/20368-possible-gsap-bug-switching-classnames-in-chrome/.\n  \t\tstyle.cssText = cssText; //we recorded cssText before we swapped classes and ran _getAllStyles() because in cases when a className tween is overwritten, we remove all the related tweening properties from that class change (otherwise class-specific stuff can't override properties we've directly set on the target's style object due to specificity).\n  \t}\n  \t_parseTransform(target, true); //to clear the caching of transforms\n  \tdata.css = new gsap.plugins.css();\n  \tdata.css.init(target, changingVars, tween);\n  \tplugin._props.push(...data.css._props);\n  \treturn 1;\n  }\n  */\n\n},\n\n/*\n * --------------------------------------------------------------------------------------\n * TRANSFORMS\n * --------------------------------------------------------------------------------------\n */\n_identity2DMatrix = [1, 0, 0, 1, 0, 0],\n    _rotationalProperties = {},\n    _isNullTransform = function _isNullTransform(value) {\n  return value === \"matrix(1, 0, 0, 1, 0, 0)\" || value === \"none\" || !value;\n},\n    _getComputedTransformMatrixAsArray = function _getComputedTransformMatrixAsArray(target) {\n  var matrixString = _getComputedProperty(target, _transformProp);\n\n  return _isNullTransform(matrixString) ? _identity2DMatrix : matrixString.substr(7).match(_numExp).map(_round);\n},\n    _getMatrix = function _getMatrix(target, force2D) {\n  var cache = target._gsap || _getCache(target),\n      style = target.style,\n      matrix = _getComputedTransformMatrixAsArray(target),\n      parent,\n      nextSibling,\n      temp,\n      addedToDOM;\n\n  if (cache.svg && target.getAttribute(\"transform\")) {\n    temp = target.transform.baseVal.consolidate().matrix; //ensures that even complex values like \"translate(50,60) rotate(135,0,0)\" are parsed because it mashes it into a matrix.\n\n    matrix = [temp.a, temp.b, temp.c, temp.d, temp.e, temp.f];\n    return matrix.join(\",\") === \"1,0,0,1,0,0\" ? _identity2DMatrix : matrix;\n  } else if (matrix === _identity2DMatrix && !target.offsetParent && target !== _docElement && !cache.svg) {\n    //note: if offsetParent is null, that means the element isn't in the normal document flow, like if it has display:none or one of its ancestors has display:none). Firefox returns null for getComputedStyle() if the element is in an iframe that has display:none. https://bugzilla.mozilla.org/show_bug.cgi?id=548397\n    //browsers don't report transforms accurately unless the element is in the DOM and has a display value that's not \"none\". Firefox and Microsoft browsers have a partial bug where they'll report transforms even if display:none BUT not any percentage-based values like translate(-50%, 8px) will be reported as if it's translate(0, 8px).\n    temp = style.display;\n    style.display = \"block\";\n    parent = target.parentNode;\n\n    if (!parent || !target.offsetParent && !target.getBoundingClientRect().width) {\n      // note: in 3.3.0 we switched target.offsetParent to _doc.body.contains(target) to avoid [sometimes unnecessary] MutationObserver calls but that wasn't adequate because there are edge cases where nested position: fixed elements need to get reparented to accurately sense transforms. See https://github.com/greensock/GSAP/issues/388 and https://github.com/greensock/GSAP/issues/375. Note: position: fixed elements report a null offsetParent but they could also be invisible because they're in an ancestor with display: none, so we check getBoundingClientRect(). We only want to alter the DOM if we absolutely have to because it can cause iframe content to reload, like a Vimeo video.\n      addedToDOM = 1; //flag\n\n      nextSibling = target.nextElementSibling;\n\n      _docElement.appendChild(target); //we must add it to the DOM in order to get values properly\n\n    }\n\n    matrix = _getComputedTransformMatrixAsArray(target);\n    temp ? style.display = temp : _removeProperty(target, \"display\");\n\n    if (addedToDOM) {\n      nextSibling ? parent.insertBefore(target, nextSibling) : parent ? parent.appendChild(target) : _docElement.removeChild(target);\n    }\n  }\n\n  return force2D && matrix.length > 6 ? [matrix[0], matrix[1], matrix[4], matrix[5], matrix[12], matrix[13]] : matrix;\n},\n    _applySVGOrigin = function _applySVGOrigin(target, origin, originIsAbsolute, smooth, matrixArray, pluginToAddPropTweensTo) {\n  var cache = target._gsap,\n      matrix = matrixArray || _getMatrix(target, true),\n      xOriginOld = cache.xOrigin || 0,\n      yOriginOld = cache.yOrigin || 0,\n      xOffsetOld = cache.xOffset || 0,\n      yOffsetOld = cache.yOffset || 0,\n      a = matrix[0],\n      b = matrix[1],\n      c = matrix[2],\n      d = matrix[3],\n      tx = matrix[4],\n      ty = matrix[5],\n      originSplit = origin.split(\" \"),\n      xOrigin = parseFloat(originSplit[0]) || 0,\n      yOrigin = parseFloat(originSplit[1]) || 0,\n      bounds,\n      determinant,\n      x,\n      y;\n\n  if (!originIsAbsolute) {\n    bounds = _getBBox(target);\n    xOrigin = bounds.x + (~originSplit[0].indexOf(\"%\") ? xOrigin / 100 * bounds.width : xOrigin);\n    yOrigin = bounds.y + (~(originSplit[1] || originSplit[0]).indexOf(\"%\") ? yOrigin / 100 * bounds.height : yOrigin); // if (!(\"xOrigin\" in cache) && (xOrigin || yOrigin)) { // added in 3.12.3, reverted in 3.12.4; requires more exploration\n    // \txOrigin -= bounds.x;\n    // \tyOrigin -= bounds.y;\n    // }\n  } else if (matrix !== _identity2DMatrix && (determinant = a * d - b * c)) {\n    //if it's zero (like if scaleX and scaleY are zero), skip it to avoid errors with dividing by zero.\n    x = xOrigin * (d / determinant) + yOrigin * (-c / determinant) + (c * ty - d * tx) / determinant;\n    y = xOrigin * (-b / determinant) + yOrigin * (a / determinant) - (a * ty - b * tx) / determinant;\n    xOrigin = x;\n    yOrigin = y; // theory: we only had to do this for smoothing and it assumes that the previous one was not originIsAbsolute.\n  }\n\n  if (smooth || smooth !== false && cache.smooth) {\n    tx = xOrigin - xOriginOld;\n    ty = yOrigin - yOriginOld;\n    cache.xOffset = xOffsetOld + (tx * a + ty * c) - tx;\n    cache.yOffset = yOffsetOld + (tx * b + ty * d) - ty;\n  } else {\n    cache.xOffset = cache.yOffset = 0;\n  }\n\n  cache.xOrigin = xOrigin;\n  cache.yOrigin = yOrigin;\n  cache.smooth = !!smooth;\n  cache.origin = origin;\n  cache.originIsAbsolute = !!originIsAbsolute;\n  target.style[_transformOriginProp] = \"0px 0px\"; //otherwise, if someone sets  an origin via CSS, it will likely interfere with the SVG transform attribute ones (because remember, we're baking the origin into the matrix() value).\n\n  if (pluginToAddPropTweensTo) {\n    _addNonTweeningPT(pluginToAddPropTweensTo, cache, \"xOrigin\", xOriginOld, xOrigin);\n\n    _addNonTweeningPT(pluginToAddPropTweensTo, cache, \"yOrigin\", yOriginOld, yOrigin);\n\n    _addNonTweeningPT(pluginToAddPropTweensTo, cache, \"xOffset\", xOffsetOld, cache.xOffset);\n\n    _addNonTweeningPT(pluginToAddPropTweensTo, cache, \"yOffset\", yOffsetOld, cache.yOffset);\n  }\n\n  target.setAttribute(\"data-svg-origin\", xOrigin + \" \" + yOrigin);\n},\n    _parseTransform = function _parseTransform(target, uncache) {\n  var cache = target._gsap || new GSCache(target);\n\n  if (\"x\" in cache && !uncache && !cache.uncache) {\n    return cache;\n  }\n\n  var style = target.style,\n      invertedScaleX = cache.scaleX < 0,\n      px = \"px\",\n      deg = \"deg\",\n      cs = getComputedStyle(target),\n      origin = _getComputedProperty(target, _transformOriginProp) || \"0\",\n      x,\n      y,\n      z,\n      scaleX,\n      scaleY,\n      rotation,\n      rotationX,\n      rotationY,\n      skewX,\n      skewY,\n      perspective,\n      xOrigin,\n      yOrigin,\n      matrix,\n      angle,\n      cos,\n      sin,\n      a,\n      b,\n      c,\n      d,\n      a12,\n      a22,\n      t1,\n      t2,\n      t3,\n      a13,\n      a23,\n      a33,\n      a42,\n      a43,\n      a32;\n  x = y = z = rotation = rotationX = rotationY = skewX = skewY = perspective = 0;\n  scaleX = scaleY = 1;\n  cache.svg = !!(target.getCTM && _isSVG(target));\n\n  if (cs.translate) {\n    // accommodate independent transforms by combining them into normal ones.\n    if (cs.translate !== \"none\" || cs.scale !== \"none\" || cs.rotate !== \"none\") {\n      style[_transformProp] = (cs.translate !== \"none\" ? \"translate3d(\" + (cs.translate + \" 0 0\").split(\" \").slice(0, 3).join(\", \") + \") \" : \"\") + (cs.rotate !== \"none\" ? \"rotate(\" + cs.rotate + \") \" : \"\") + (cs.scale !== \"none\" ? \"scale(\" + cs.scale.split(\" \").join(\",\") + \") \" : \"\") + (cs[_transformProp] !== \"none\" ? cs[_transformProp] : \"\");\n    }\n\n    style.scale = style.rotate = style.translate = \"none\";\n  }\n\n  matrix = _getMatrix(target, cache.svg);\n\n  if (cache.svg) {\n    if (cache.uncache) {\n      // if cache.uncache is true (and maybe if origin is 0,0), we need to set element.style.transformOrigin = (cache.xOrigin - bbox.x) + \"px \" + (cache.yOrigin - bbox.y) + \"px\". Previously we let the data-svg-origin stay instead, but when introducing revert(), it complicated things.\n      t2 = target.getBBox();\n      origin = cache.xOrigin - t2.x + \"px \" + (cache.yOrigin - t2.y) + \"px\";\n      t1 = \"\";\n    } else {\n      t1 = !uncache && target.getAttribute(\"data-svg-origin\"); //  Remember, to work around browser inconsistencies we always force SVG elements' transformOrigin to 0,0 and offset the translation accordingly.\n    }\n\n    _applySVGOrigin(target, t1 || origin, !!t1 || cache.originIsAbsolute, cache.smooth !== false, matrix);\n  }\n\n  xOrigin = cache.xOrigin || 0;\n  yOrigin = cache.yOrigin || 0;\n\n  if (matrix !== _identity2DMatrix) {\n    a = matrix[0]; //a11\n\n    b = matrix[1]; //a21\n\n    c = matrix[2]; //a31\n\n    d = matrix[3]; //a41\n\n    x = a12 = matrix[4];\n    y = a22 = matrix[5]; //2D matrix\n\n    if (matrix.length === 6) {\n      scaleX = Math.sqrt(a * a + b * b);\n      scaleY = Math.sqrt(d * d + c * c);\n      rotation = a || b ? _atan2(b, a) * _RAD2DEG : 0; //note: if scaleX is 0, we cannot accurately measure rotation. Same for skewX with a scaleY of 0. Therefore, we default to the previously recorded value (or zero if that doesn't exist).\n\n      skewX = c || d ? _atan2(c, d) * _RAD2DEG + rotation : 0;\n      skewX && (scaleY *= Math.abs(Math.cos(skewX * _DEG2RAD)));\n\n      if (cache.svg) {\n        x -= xOrigin - (xOrigin * a + yOrigin * c);\n        y -= yOrigin - (xOrigin * b + yOrigin * d);\n      } //3D matrix\n\n    } else {\n      a32 = matrix[6];\n      a42 = matrix[7];\n      a13 = matrix[8];\n      a23 = matrix[9];\n      a33 = matrix[10];\n      a43 = matrix[11];\n      x = matrix[12];\n      y = matrix[13];\n      z = matrix[14];\n      angle = _atan2(a32, a33);\n      rotationX = angle * _RAD2DEG; //rotationX\n\n      if (angle) {\n        cos = Math.cos(-angle);\n        sin = Math.sin(-angle);\n        t1 = a12 * cos + a13 * sin;\n        t2 = a22 * cos + a23 * sin;\n        t3 = a32 * cos + a33 * sin;\n        a13 = a12 * -sin + a13 * cos;\n        a23 = a22 * -sin + a23 * cos;\n        a33 = a32 * -sin + a33 * cos;\n        a43 = a42 * -sin + a43 * cos;\n        a12 = t1;\n        a22 = t2;\n        a32 = t3;\n      } //rotationY\n\n\n      angle = _atan2(-c, a33);\n      rotationY = angle * _RAD2DEG;\n\n      if (angle) {\n        cos = Math.cos(-angle);\n        sin = Math.sin(-angle);\n        t1 = a * cos - a13 * sin;\n        t2 = b * cos - a23 * sin;\n        t3 = c * cos - a33 * sin;\n        a43 = d * sin + a43 * cos;\n        a = t1;\n        b = t2;\n        c = t3;\n      } //rotationZ\n\n\n      angle = _atan2(b, a);\n      rotation = angle * _RAD2DEG;\n\n      if (angle) {\n        cos = Math.cos(angle);\n        sin = Math.sin(angle);\n        t1 = a * cos + b * sin;\n        t2 = a12 * cos + a22 * sin;\n        b = b * cos - a * sin;\n        a22 = a22 * cos - a12 * sin;\n        a = t1;\n        a12 = t2;\n      }\n\n      if (rotationX && Math.abs(rotationX) + Math.abs(rotation) > 359.9) {\n        //when rotationY is set, it will often be parsed as 180 degrees different than it should be, and rotationX and rotation both being 180 (it looks the same), so we adjust for that here.\n        rotationX = rotation = 0;\n        rotationY = 180 - rotationY;\n      }\n\n      scaleX = _round(Math.sqrt(a * a + b * b + c * c));\n      scaleY = _round(Math.sqrt(a22 * a22 + a32 * a32));\n      angle = _atan2(a12, a22);\n      skewX = Math.abs(angle) > 0.0002 ? angle * _RAD2DEG : 0;\n      perspective = a43 ? 1 / (a43 < 0 ? -a43 : a43) : 0;\n    }\n\n    if (cache.svg) {\n      //sense if there are CSS transforms applied on an SVG element in which case we must overwrite them when rendering. The transform attribute is more reliable cross-browser, but we can't just remove the CSS ones because they may be applied in a CSS rule somewhere (not just inline).\n      t1 = target.getAttribute(\"transform\");\n      cache.forceCSS = target.setAttribute(\"transform\", \"\") || !_isNullTransform(_getComputedProperty(target, _transformProp));\n      t1 && target.setAttribute(\"transform\", t1);\n    }\n  }\n\n  if (Math.abs(skewX) > 90 && Math.abs(skewX) < 270) {\n    if (invertedScaleX) {\n      scaleX *= -1;\n      skewX += rotation <= 0 ? 180 : -180;\n      rotation += rotation <= 0 ? 180 : -180;\n    } else {\n      scaleY *= -1;\n      skewX += skewX <= 0 ? 180 : -180;\n    }\n  }\n\n  uncache = uncache || cache.uncache;\n  cache.x = x - ((cache.xPercent = x && (!uncache && cache.xPercent || (Math.round(target.offsetWidth / 2) === Math.round(-x) ? -50 : 0))) ? target.offsetWidth * cache.xPercent / 100 : 0) + px;\n  cache.y = y - ((cache.yPercent = y && (!uncache && cache.yPercent || (Math.round(target.offsetHeight / 2) === Math.round(-y) ? -50 : 0))) ? target.offsetHeight * cache.yPercent / 100 : 0) + px;\n  cache.z = z + px;\n  cache.scaleX = _round(scaleX);\n  cache.scaleY = _round(scaleY);\n  cache.rotation = _round(rotation) + deg;\n  cache.rotationX = _round(rotationX) + deg;\n  cache.rotationY = _round(rotationY) + deg;\n  cache.skewX = skewX + deg;\n  cache.skewY = skewY + deg;\n  cache.transformPerspective = perspective + px;\n\n  if (cache.zOrigin = parseFloat(origin.split(\" \")[2]) || !uncache && cache.zOrigin || 0) {\n    style[_transformOriginProp] = _firstTwoOnly(origin);\n  }\n\n  cache.xOffset = cache.yOffset = 0;\n  cache.force3D = _config.force3D;\n  cache.renderTransform = cache.svg ? _renderSVGTransforms : _supports3D ? _renderCSSTransforms : _renderNon3DTransforms;\n  cache.uncache = 0;\n  return cache;\n},\n    _firstTwoOnly = function _firstTwoOnly(value) {\n  return (value = value.split(\" \"))[0] + \" \" + value[1];\n},\n    //for handling transformOrigin values, stripping out the 3rd dimension\n_addPxTranslate = function _addPxTranslate(target, start, value) {\n  var unit = getUnit(start);\n  return _round(parseFloat(start) + parseFloat(_convertToUnit(target, \"x\", value + \"px\", unit))) + unit;\n},\n    _renderNon3DTransforms = function _renderNon3DTransforms(ratio, cache) {\n  cache.z = \"0px\";\n  cache.rotationY = cache.rotationX = \"0deg\";\n  cache.force3D = 0;\n\n  _renderCSSTransforms(ratio, cache);\n},\n    _zeroDeg = \"0deg\",\n    _zeroPx = \"0px\",\n    _endParenthesis = \") \",\n    _renderCSSTransforms = function _renderCSSTransforms(ratio, cache) {\n  var _ref = cache || this,\n      xPercent = _ref.xPercent,\n      yPercent = _ref.yPercent,\n      x = _ref.x,\n      y = _ref.y,\n      z = _ref.z,\n      rotation = _ref.rotation,\n      rotationY = _ref.rotationY,\n      rotationX = _ref.rotationX,\n      skewX = _ref.skewX,\n      skewY = _ref.skewY,\n      scaleX = _ref.scaleX,\n      scaleY = _ref.scaleY,\n      transformPerspective = _ref.transformPerspective,\n      force3D = _ref.force3D,\n      target = _ref.target,\n      zOrigin = _ref.zOrigin,\n      transforms = \"\",\n      use3D = force3D === \"auto\" && ratio && ratio !== 1 || force3D === true; // Safari has a bug that causes it not to render 3D transform-origin values properly, so we force the z origin to 0, record it in the cache, and then do the math here to offset the translate values accordingly (basically do the 3D transform-origin part manually)\n\n\n  if (zOrigin && (rotationX !== _zeroDeg || rotationY !== _zeroDeg)) {\n    var angle = parseFloat(rotationY) * _DEG2RAD,\n        a13 = Math.sin(angle),\n        a33 = Math.cos(angle),\n        cos;\n\n    angle = parseFloat(rotationX) * _DEG2RAD;\n    cos = Math.cos(angle);\n    x = _addPxTranslate(target, x, a13 * cos * -zOrigin);\n    y = _addPxTranslate(target, y, -Math.sin(angle) * -zOrigin);\n    z = _addPxTranslate(target, z, a33 * cos * -zOrigin + zOrigin);\n  }\n\n  if (transformPerspective !== _zeroPx) {\n    transforms += \"perspective(\" + transformPerspective + _endParenthesis;\n  }\n\n  if (xPercent || yPercent) {\n    transforms += \"translate(\" + xPercent + \"%, \" + yPercent + \"%) \";\n  }\n\n  if (use3D || x !== _zeroPx || y !== _zeroPx || z !== _zeroPx) {\n    transforms += z !== _zeroPx || use3D ? \"translate3d(\" + x + \", \" + y + \", \" + z + \") \" : \"translate(\" + x + \", \" + y + _endParenthesis;\n  }\n\n  if (rotation !== _zeroDeg) {\n    transforms += \"rotate(\" + rotation + _endParenthesis;\n  }\n\n  if (rotationY !== _zeroDeg) {\n    transforms += \"rotateY(\" + rotationY + _endParenthesis;\n  }\n\n  if (rotationX !== _zeroDeg) {\n    transforms += \"rotateX(\" + rotationX + _endParenthesis;\n  }\n\n  if (skewX !== _zeroDeg || skewY !== _zeroDeg) {\n    transforms += \"skew(\" + skewX + \", \" + skewY + _endParenthesis;\n  }\n\n  if (scaleX !== 1 || scaleY !== 1) {\n    transforms += \"scale(\" + scaleX + \", \" + scaleY + _endParenthesis;\n  }\n\n  target.style[_transformProp] = transforms || \"translate(0, 0)\";\n},\n    _renderSVGTransforms = function _renderSVGTransforms(ratio, cache) {\n  var _ref2 = cache || this,\n      xPercent = _ref2.xPercent,\n      yPercent = _ref2.yPercent,\n      x = _ref2.x,\n      y = _ref2.y,\n      rotation = _ref2.rotation,\n      skewX = _ref2.skewX,\n      skewY = _ref2.skewY,\n      scaleX = _ref2.scaleX,\n      scaleY = _ref2.scaleY,\n      target = _ref2.target,\n      xOrigin = _ref2.xOrigin,\n      yOrigin = _ref2.yOrigin,\n      xOffset = _ref2.xOffset,\n      yOffset = _ref2.yOffset,\n      forceCSS = _ref2.forceCSS,\n      tx = parseFloat(x),\n      ty = parseFloat(y),\n      a11,\n      a21,\n      a12,\n      a22,\n      temp;\n\n  rotation = parseFloat(rotation);\n  skewX = parseFloat(skewX);\n  skewY = parseFloat(skewY);\n\n  if (skewY) {\n    //for performance reasons, we combine all skewing into the skewX and rotation values. Remember, a skewY of 10 degrees looks the same as a rotation of 10 degrees plus a skewX of 10 degrees.\n    skewY = parseFloat(skewY);\n    skewX += skewY;\n    rotation += skewY;\n  }\n\n  if (rotation || skewX) {\n    rotation *= _DEG2RAD;\n    skewX *= _DEG2RAD;\n    a11 = Math.cos(rotation) * scaleX;\n    a21 = Math.sin(rotation) * scaleX;\n    a12 = Math.sin(rotation - skewX) * -scaleY;\n    a22 = Math.cos(rotation - skewX) * scaleY;\n\n    if (skewX) {\n      skewY *= _DEG2RAD;\n      temp = Math.tan(skewX - skewY);\n      temp = Math.sqrt(1 + temp * temp);\n      a12 *= temp;\n      a22 *= temp;\n\n      if (skewY) {\n        temp = Math.tan(skewY);\n        temp = Math.sqrt(1 + temp * temp);\n        a11 *= temp;\n        a21 *= temp;\n      }\n    }\n\n    a11 = _round(a11);\n    a21 = _round(a21);\n    a12 = _round(a12);\n    a22 = _round(a22);\n  } else {\n    a11 = scaleX;\n    a22 = scaleY;\n    a21 = a12 = 0;\n  }\n\n  if (tx && !~(x + \"\").indexOf(\"px\") || ty && !~(y + \"\").indexOf(\"px\")) {\n    tx = _convertToUnit(target, \"x\", x, \"px\");\n    ty = _convertToUnit(target, \"y\", y, \"px\");\n  }\n\n  if (xOrigin || yOrigin || xOffset || yOffset) {\n    tx = _round(tx + xOrigin - (xOrigin * a11 + yOrigin * a12) + xOffset);\n    ty = _round(ty + yOrigin - (xOrigin * a21 + yOrigin * a22) + yOffset);\n  }\n\n  if (xPercent || yPercent) {\n    //The SVG spec doesn't support percentage-based translation in the \"transform\" attribute, so we merge it into the translation to simulate it.\n    temp = target.getBBox();\n    tx = _round(tx + xPercent / 100 * temp.width);\n    ty = _round(ty + yPercent / 100 * temp.height);\n  }\n\n  temp = \"matrix(\" + a11 + \",\" + a21 + \",\" + a12 + \",\" + a22 + \",\" + tx + \",\" + ty + \")\";\n  target.setAttribute(\"transform\", temp);\n  forceCSS && (target.style[_transformProp] = temp); //some browsers prioritize CSS transforms over the transform attribute. When we sense that the user has CSS transforms applied, we must overwrite them this way (otherwise some browser simply won't render the transform attribute changes!)\n},\n    _addRotationalPropTween = function _addRotationalPropTween(plugin, target, property, startNum, endValue) {\n  var cap = 360,\n      isString = _isString(endValue),\n      endNum = parseFloat(endValue) * (isString && ~endValue.indexOf(\"rad\") ? _RAD2DEG : 1),\n      change = endNum - startNum,\n      finalValue = startNum + change + \"deg\",\n      direction,\n      pt;\n\n  if (isString) {\n    direction = endValue.split(\"_\")[1];\n\n    if (direction === \"short\") {\n      change %= cap;\n\n      if (change !== change % (cap / 2)) {\n        change += change < 0 ? cap : -cap;\n      }\n    }\n\n    if (direction === \"cw\" && change < 0) {\n      change = (change + cap * _bigNum) % cap - ~~(change / cap) * cap;\n    } else if (direction === \"ccw\" && change > 0) {\n      change = (change - cap * _bigNum) % cap - ~~(change / cap) * cap;\n    }\n  }\n\n  plugin._pt = pt = new PropTween(plugin._pt, target, property, startNum, change, _renderPropWithEnd);\n  pt.e = finalValue;\n  pt.u = \"deg\";\n\n  plugin._props.push(property);\n\n  return pt;\n},\n    _assign = function _assign(target, source) {\n  // Internet Explorer doesn't have Object.assign(), so we recreate it here.\n  for (var p in source) {\n    target[p] = source[p];\n  }\n\n  return target;\n},\n    _addRawTransformPTs = function _addRawTransformPTs(plugin, transforms, target) {\n  //for handling cases where someone passes in a whole transform string, like transform: \"scale(2, 3) rotate(20deg) translateY(30em)\"\n  var startCache = _assign({}, target._gsap),\n      exclude = \"perspective,force3D,transformOrigin,svgOrigin\",\n      style = target.style,\n      endCache,\n      p,\n      startValue,\n      endValue,\n      startNum,\n      endNum,\n      startUnit,\n      endUnit;\n\n  if (startCache.svg) {\n    startValue = target.getAttribute(\"transform\");\n    target.setAttribute(\"transform\", \"\");\n    style[_transformProp] = transforms;\n    endCache = _parseTransform(target, 1);\n\n    _removeProperty(target, _transformProp);\n\n    target.setAttribute(\"transform\", startValue);\n  } else {\n    startValue = getComputedStyle(target)[_transformProp];\n    style[_transformProp] = transforms;\n    endCache = _parseTransform(target, 1);\n    style[_transformProp] = startValue;\n  }\n\n  for (p in _transformProps) {\n    startValue = startCache[p];\n    endValue = endCache[p];\n\n    if (startValue !== endValue && exclude.indexOf(p) < 0) {\n      //tweening to no perspective gives very unintuitive results - just keep the same perspective in that case.\n      startUnit = getUnit(startValue);\n      endUnit = getUnit(endValue);\n      startNum = startUnit !== endUnit ? _convertToUnit(target, p, startValue, endUnit) : parseFloat(startValue);\n      endNum = parseFloat(endValue);\n      plugin._pt = new PropTween(plugin._pt, endCache, p, startNum, endNum - startNum, _renderCSSProp);\n      plugin._pt.u = endUnit || 0;\n\n      plugin._props.push(p);\n    }\n  }\n\n  _assign(endCache, startCache);\n}; // handle splitting apart padding, margin, borderWidth, and borderRadius into their 4 components. Firefox, for example, won't report borderRadius correctly - it will only do borderTopLeftRadius and the other corners. We also want to handle paddingTop, marginLeft, borderRightWidth, etc.\n\n\n_forEachName(\"padding,margin,Width,Radius\", function (name, index) {\n  var t = \"Top\",\n      r = \"Right\",\n      b = \"Bottom\",\n      l = \"Left\",\n      props = (index < 3 ? [t, r, b, l] : [t + l, t + r, b + r, b + l]).map(function (side) {\n    return index < 2 ? name + side : \"border\" + side + name;\n  });\n\n  _specialProps[index > 1 ? \"border\" + name : name] = function (plugin, target, property, endValue, tween) {\n    var a, vars;\n\n    if (arguments.length < 4) {\n      // getter, passed target, property, and unit (from _get())\n      a = props.map(function (prop) {\n        return _get(plugin, prop, property);\n      });\n      vars = a.join(\" \");\n      return vars.split(a[0]).length === 5 ? a[0] : vars;\n    }\n\n    a = (endValue + \"\").split(\" \");\n    vars = {};\n    props.forEach(function (prop, i) {\n      return vars[prop] = a[i] = a[i] || a[(i - 1) / 2 | 0];\n    });\n    plugin.init(target, vars, tween);\n  };\n});\n\nexport var CSSPlugin = {\n  name: \"css\",\n  register: _initCore,\n  targetTest: function targetTest(target) {\n    return target.style && target.nodeType;\n  },\n  init: function init(target, vars, tween, index, targets) {\n    var props = this._props,\n        style = target.style,\n        startAt = tween.vars.startAt,\n        startValue,\n        endValue,\n        endNum,\n        startNum,\n        type,\n        specialProp,\n        p,\n        startUnit,\n        endUnit,\n        relative,\n        isTransformRelated,\n        transformPropTween,\n        cache,\n        smooth,\n        hasPriority,\n        inlineProps;\n    _pluginInitted || _initCore(); // we may call init() multiple times on the same plugin instance, like when adding special properties, so make sure we don't overwrite the revert data or inlineProps\n\n    this.styles = this.styles || _getStyleSaver(target);\n    inlineProps = this.styles.props;\n    this.tween = tween;\n\n    for (p in vars) {\n      if (p === \"autoRound\") {\n        continue;\n      }\n\n      endValue = vars[p];\n\n      if (_plugins[p] && _checkPlugin(p, vars, tween, index, target, targets)) {\n        // plugins\n        continue;\n      }\n\n      type = typeof endValue;\n      specialProp = _specialProps[p];\n\n      if (type === \"function\") {\n        endValue = endValue.call(tween, index, target, targets);\n        type = typeof endValue;\n      }\n\n      if (type === \"string\" && ~endValue.indexOf(\"random(\")) {\n        endValue = _replaceRandom(endValue);\n      }\n\n      if (specialProp) {\n        specialProp(this, target, p, endValue, tween) && (hasPriority = 1);\n      } else if (p.substr(0, 2) === \"--\") {\n        //CSS variable\n        startValue = (getComputedStyle(target).getPropertyValue(p) + \"\").trim();\n        endValue += \"\";\n        _colorExp.lastIndex = 0;\n\n        if (!_colorExp.test(startValue)) {\n          // colors don't have units\n          startUnit = getUnit(startValue);\n          endUnit = getUnit(endValue);\n        }\n\n        endUnit ? startUnit !== endUnit && (startValue = _convertToUnit(target, p, startValue, endUnit) + endUnit) : startUnit && (endValue += startUnit);\n        this.add(style, \"setProperty\", startValue, endValue, index, targets, 0, 0, p);\n        props.push(p);\n        inlineProps.push(p, 0, style[p]);\n      } else if (type !== \"undefined\") {\n        if (startAt && p in startAt) {\n          // in case someone hard-codes a complex value as the start, like top: \"calc(2vh / 2)\". Without this, it'd use the computed value (always in px)\n          startValue = typeof startAt[p] === \"function\" ? startAt[p].call(tween, index, target, targets) : startAt[p];\n          _isString(startValue) && ~startValue.indexOf(\"random(\") && (startValue = _replaceRandom(startValue));\n          getUnit(startValue + \"\") || startValue === \"auto\" || (startValue += _config.units[p] || getUnit(_get(target, p)) || \"\"); // for cases when someone passes in a unitless value like {x: 100}; if we try setting translate(100, 0px) it won't work.\n\n          (startValue + \"\").charAt(1) === \"=\" && (startValue = _get(target, p)); // can't work with relative values\n        } else {\n          startValue = _get(target, p);\n        }\n\n        startNum = parseFloat(startValue);\n        relative = type === \"string\" && endValue.charAt(1) === \"=\" && endValue.substr(0, 2);\n        relative && (endValue = endValue.substr(2));\n        endNum = parseFloat(endValue);\n\n        if (p in _propertyAliases) {\n          if (p === \"autoAlpha\") {\n            //special case where we control the visibility along with opacity. We still allow the opacity value to pass through and get tweened.\n            if (startNum === 1 && _get(target, \"visibility\") === \"hidden\" && endNum) {\n              //if visibility is initially set to \"hidden\", we should interpret that as intent to make opacity 0 (a convenience)\n              startNum = 0;\n            }\n\n            inlineProps.push(\"visibility\", 0, style.visibility);\n\n            _addNonTweeningPT(this, style, \"visibility\", startNum ? \"inherit\" : \"hidden\", endNum ? \"inherit\" : \"hidden\", !endNum);\n          }\n\n          if (p !== \"scale\" && p !== \"transform\") {\n            p = _propertyAliases[p];\n            ~p.indexOf(\",\") && (p = p.split(\",\")[0]);\n          }\n        }\n\n        isTransformRelated = p in _transformProps; //--- TRANSFORM-RELATED ---\n\n        if (isTransformRelated) {\n          this.styles.save(p);\n\n          if (type === \"string\" && endValue.substring(0, 6) === \"var(--\") {\n            endValue = _getComputedProperty(target, endValue.substring(4, endValue.indexOf(\")\")));\n            endNum = parseFloat(endValue);\n          }\n\n          if (!transformPropTween) {\n            cache = target._gsap;\n            cache.renderTransform && !vars.parseTransform || _parseTransform(target, vars.parseTransform); // if, for example, gsap.set(... {transform:\"translateX(50vw)\"}), the _get() call doesn't parse the transform, thus cache.renderTransform won't be set yet so force the parsing of the transform here.\n\n            smooth = vars.smoothOrigin !== false && cache.smooth;\n            transformPropTween = this._pt = new PropTween(this._pt, style, _transformProp, 0, 1, cache.renderTransform, cache, 0, -1); //the first time through, create the rendering PropTween so that it runs LAST (in the linked list, we keep adding to the beginning)\n\n            transformPropTween.dep = 1; //flag it as dependent so that if things get killed/overwritten and this is the only PropTween left, we can safely kill the whole tween.\n          }\n\n          if (p === \"scale\") {\n            this._pt = new PropTween(this._pt, cache, \"scaleY\", cache.scaleY, (relative ? _parseRelative(cache.scaleY, relative + endNum) : endNum) - cache.scaleY || 0, _renderCSSProp);\n            this._pt.u = 0;\n            props.push(\"scaleY\", p);\n            p += \"X\";\n          } else if (p === \"transformOrigin\") {\n            inlineProps.push(_transformOriginProp, 0, style[_transformOriginProp]);\n            endValue = _convertKeywordsToPercentages(endValue); //in case something like \"left top\" or \"bottom right\" is passed in. Convert to percentages.\n\n            if (cache.svg) {\n              _applySVGOrigin(target, endValue, 0, smooth, 0, this);\n            } else {\n              endUnit = parseFloat(endValue.split(\" \")[2]) || 0; //handle the zOrigin separately!\n\n              endUnit !== cache.zOrigin && _addNonTweeningPT(this, cache, \"zOrigin\", cache.zOrigin, endUnit);\n\n              _addNonTweeningPT(this, style, p, _firstTwoOnly(startValue), _firstTwoOnly(endValue));\n            }\n\n            continue;\n          } else if (p === \"svgOrigin\") {\n            _applySVGOrigin(target, endValue, 1, smooth, 0, this);\n\n            continue;\n          } else if (p in _rotationalProperties) {\n            _addRotationalPropTween(this, cache, p, startNum, relative ? _parseRelative(startNum, relative + endValue) : endValue);\n\n            continue;\n          } else if (p === \"smoothOrigin\") {\n            _addNonTweeningPT(this, cache, \"smooth\", cache.smooth, endValue);\n\n            continue;\n          } else if (p === \"force3D\") {\n            cache[p] = endValue;\n            continue;\n          } else if (p === \"transform\") {\n            _addRawTransformPTs(this, endValue, target);\n\n            continue;\n          }\n        } else if (!(p in style)) {\n          p = _checkPropPrefix(p) || p;\n        }\n\n        if (isTransformRelated || (endNum || endNum === 0) && (startNum || startNum === 0) && !_complexExp.test(endValue) && p in style) {\n          startUnit = (startValue + \"\").substr((startNum + \"\").length);\n          endNum || (endNum = 0); // protect against NaN\n\n          endUnit = getUnit(endValue) || (p in _config.units ? _config.units[p] : startUnit);\n          startUnit !== endUnit && (startNum = _convertToUnit(target, p, startValue, endUnit));\n          this._pt = new PropTween(this._pt, isTransformRelated ? cache : style, p, startNum, (relative ? _parseRelative(startNum, relative + endNum) : endNum) - startNum, !isTransformRelated && (endUnit === \"px\" || p === \"zIndex\") && vars.autoRound !== false ? _renderRoundedCSSProp : _renderCSSProp);\n          this._pt.u = endUnit || 0;\n\n          if (startUnit !== endUnit && endUnit !== \"%\") {\n            //when the tween goes all the way back to the beginning, we need to revert it to the OLD/ORIGINAL value (with those units). We record that as a \"b\" (beginning) property and point to a render method that handles that. (performance optimization)\n            this._pt.b = startValue;\n            this._pt.r = _renderCSSPropWithBeginning;\n          }\n        } else if (!(p in style)) {\n          if (p in target) {\n            //maybe it's not a style - it could be a property added directly to an element in which case we'll try to animate that.\n            this.add(target, p, startValue || target[p], relative ? relative + endValue : endValue, index, targets);\n          } else if (p !== \"parseTransform\") {\n            _missingPlugin(p, endValue);\n\n            continue;\n          }\n        } else {\n          _tweenComplexCSSString.call(this, target, p, startValue, relative ? relative + endValue : endValue);\n        }\n\n        isTransformRelated || (p in style ? inlineProps.push(p, 0, style[p]) : typeof target[p] === \"function\" ? inlineProps.push(p, 2, target[p]()) : inlineProps.push(p, 1, startValue || target[p]));\n        props.push(p);\n      }\n    }\n\n    hasPriority && _sortPropTweensByPriority(this);\n  },\n  render: function render(ratio, data) {\n    if (data.tween._time || !_reverting()) {\n      var pt = data._pt;\n\n      while (pt) {\n        pt.r(ratio, pt.d);\n        pt = pt._next;\n      }\n    } else {\n      data.styles.revert();\n    }\n  },\n  get: _get,\n  aliases: _propertyAliases,\n  getSetter: function getSetter(target, property, plugin) {\n    //returns a setter function that accepts target, property, value and applies it accordingly. Remember, properties like \"x\" aren't as simple as target.style.property = value because they've got to be applied to a proxy object and then merged into a transform string in a renderer.\n    var p = _propertyAliases[property];\n    p && p.indexOf(\",\") < 0 && (property = p);\n    return property in _transformProps && property !== _transformOriginProp && (target._gsap.x || _get(target, \"x\")) ? plugin && _recentSetterPlugin === plugin ? property === \"scale\" ? _setterScale : _setterTransform : (_recentSetterPlugin = plugin || {}) && (property === \"scale\" ? _setterScaleWithRender : _setterTransformWithRender) : target.style && !_isUndefined(target.style[property]) ? _setterCSSStyle : ~property.indexOf(\"-\") ? _setterCSSProp : _getSetter(target, property);\n  },\n  core: {\n    _removeProperty: _removeProperty,\n    _getMatrix: _getMatrix\n  }\n};\ngsap.utils.checkPrefix = _checkPropPrefix;\ngsap.core.getStyleSaver = _getStyleSaver;\n\n(function (positionAndScale, rotation, others, aliases) {\n  var all = _forEachName(positionAndScale + \",\" + rotation + \",\" + others, function (name) {\n    _transformProps[name] = 1;\n  });\n\n  _forEachName(rotation, function (name) {\n    _config.units[name] = \"deg\";\n    _rotationalProperties[name] = 1;\n  });\n\n  _propertyAliases[all[13]] = positionAndScale + \",\" + rotation;\n\n  _forEachName(aliases, function (name) {\n    var split = name.split(\":\");\n    _propertyAliases[split[1]] = all[split[0]];\n  });\n})(\"x,y,z,scale,scaleX,scaleY,xPercent,yPercent\", \"rotation,rotationX,rotationY,skewX,skewY\", \"transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective\", \"0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY\");\n\n_forEachName(\"x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective\", function (name) {\n  _config.units[name] = \"px\";\n});\n\ngsap.registerPlugin(CSSPlugin);\nexport { CSSPlugin as default, _getBBox, _createElement, _checkPropPrefix as checkPrefix };","import { gsap, Power0, Power1, Power2, Power3, Power4, Linear, Quad, Cubic, Quart, Quint, Strong, Elastic, Back, SteppedEase, Bounce, Sine, Expo, Circ, TweenLite, TimelineLite, TimelineMax } from \"./gsap-core.js\";\nimport { CSSPlugin } from \"./CSSPlugin.js\";\nvar gsapWithCSS = gsap.registerPlugin(CSSPlugin) || gsap,\n    // to protect from tree shaking\nTweenMaxWithCSS = gsapWithCSS.core.Tween;\nexport { gsapWithCSS as gsap, gsapWithCSS as default, CSSPlugin, TweenMaxWithCSS as TweenMax, TweenLite, TimelineMax, TimelineLite, Power0, Power1, Power2, Power3, Power4, Linear, Quad, Cubic, Quart, Quint, Strong, Elastic, Back, SteppedEase, Bounce, Sine, Expo, Circ };","function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/*!\n * Observer 3.13.0\n * https://gsap.com\n *\n * @license Copyright 2008-2025, GreenSock. All rights reserved.\n * Subject to the terms at https://gsap.com/standard-license\n * @author: Jack Doyle, jack@greensock.com\n*/\n\n/* eslint-disable */\nvar gsap,\n    _coreInitted,\n    _clamp,\n    _win,\n    _doc,\n    _docEl,\n    _body,\n    _isTouch,\n    _pointerType,\n    ScrollTrigger,\n    _root,\n    _normalizer,\n    _eventTypes,\n    _context,\n    _getGSAP = function _getGSAP() {\n  return gsap || typeof window !== \"undefined\" && (gsap = window.gsap) && gsap.registerPlugin && gsap;\n},\n    _startup = 1,\n    _observers = [],\n    _scrollers = [],\n    _proxies = [],\n    _getTime = Date.now,\n    _bridge = function _bridge(name, value) {\n  return value;\n},\n    _integrate = function _integrate() {\n  var core = ScrollTrigger.core,\n      data = core.bridge || {},\n      scrollers = core._scrollers,\n      proxies = core._proxies;\n  scrollers.push.apply(scrollers, _scrollers);\n  proxies.push.apply(proxies, _proxies);\n  _scrollers = scrollers;\n  _proxies = proxies;\n\n  _bridge = function _bridge(name, value) {\n    return data[name](value);\n  };\n},\n    _getProxyProp = function _getProxyProp(element, property) {\n  return ~_proxies.indexOf(element) && _proxies[_proxies.indexOf(element) + 1][property];\n},\n    _isViewport = function _isViewport(el) {\n  return !!~_root.indexOf(el);\n},\n    _addListener = function _addListener(element, type, func, passive, capture) {\n  return element.addEventListener(type, func, {\n    passive: passive !== false,\n    capture: !!capture\n  });\n},\n    _removeListener = function _removeListener(element, type, func, capture) {\n  return element.removeEventListener(type, func, !!capture);\n},\n    _scrollLeft = \"scrollLeft\",\n    _scrollTop = \"scrollTop\",\n    _onScroll = function _onScroll() {\n  return _normalizer && _normalizer.isPressed || _scrollers.cache++;\n},\n    _scrollCacheFunc = function _scrollCacheFunc(f, doNotCache) {\n  var cachingFunc = function cachingFunc(value) {\n    // since reading the scrollTop/scrollLeft/pageOffsetY/pageOffsetX can trigger a layout, this function allows us to cache the value so it only gets read fresh after a \"scroll\" event fires (or while we're refreshing because that can lengthen the page and alter the scroll position). when \"soft\" is true, that means don't actually set the scroll, but cache the new value instead (useful in ScrollSmoother)\n    if (value || value === 0) {\n      _startup && (_win.history.scrollRestoration = \"manual\"); // otherwise the new position will get overwritten by the browser onload.\n\n      var isNormalizing = _normalizer && _normalizer.isPressed;\n      value = cachingFunc.v = Math.round(value) || (_normalizer && _normalizer.iOS ? 1 : 0); //TODO: iOS Bug: if you allow it to go to 0, Safari can start to report super strange (wildly inaccurate) touch positions!\n\n      f(value);\n      cachingFunc.cacheID = _scrollers.cache;\n      isNormalizing && _bridge(\"ss\", value); // set scroll (notify ScrollTrigger so it can dispatch a \"scrollStart\" event if necessary\n    } else if (doNotCache || _scrollers.cache !== cachingFunc.cacheID || _bridge(\"ref\")) {\n      cachingFunc.cacheID = _scrollers.cache;\n      cachingFunc.v = f();\n    }\n\n    return cachingFunc.v + cachingFunc.offset;\n  };\n\n  cachingFunc.offset = 0;\n  return f && cachingFunc;\n},\n    _horizontal = {\n  s: _scrollLeft,\n  p: \"left\",\n  p2: \"Left\",\n  os: \"right\",\n  os2: \"Right\",\n  d: \"width\",\n  d2: \"Width\",\n  a: \"x\",\n  sc: _scrollCacheFunc(function (value) {\n    return arguments.length ? _win.scrollTo(value, _vertical.sc()) : _win.pageXOffset || _doc[_scrollLeft] || _docEl[_scrollLeft] || _body[_scrollLeft] || 0;\n  })\n},\n    _vertical = {\n  s: _scrollTop,\n  p: \"top\",\n  p2: \"Top\",\n  os: \"bottom\",\n  os2: \"Bottom\",\n  d: \"height\",\n  d2: \"Height\",\n  a: \"y\",\n  op: _horizontal,\n  sc: _scrollCacheFunc(function (value) {\n    return arguments.length ? _win.scrollTo(_horizontal.sc(), value) : _win.pageYOffset || _doc[_scrollTop] || _docEl[_scrollTop] || _body[_scrollTop] || 0;\n  })\n},\n    _getTarget = function _getTarget(t, self) {\n  return (self && self._ctx && self._ctx.selector || gsap.utils.toArray)(t)[0] || (typeof t === \"string\" && gsap.config().nullTargetWarn !== false ? console.warn(\"Element not found:\", t) : null);\n},\n    _isWithin = function _isWithin(element, list) {\n  // check if the element is in the list or is a descendant of an element in the list.\n  var i = list.length;\n\n  while (i--) {\n    if (list[i] === element || list[i].contains(element)) {\n      return true;\n    }\n  }\n\n  return false;\n},\n    _getScrollFunc = function _getScrollFunc(element, _ref) {\n  var s = _ref.s,\n      sc = _ref.sc;\n  // we store the scroller functions in an alternating sequenced Array like [element, verticalScrollFunc, horizontalScrollFunc, ...] so that we can minimize memory, maximize performance, and we also record the last position as a \".rec\" property in order to revert to that after refreshing to ensure things don't shift around.\n  _isViewport(element) && (element = _doc.scrollingElement || _docEl);\n\n  var i = _scrollers.indexOf(element),\n      offset = sc === _vertical.sc ? 1 : 2;\n\n  !~i && (i = _scrollers.push(element) - 1);\n  _scrollers[i + offset] || _addListener(element, \"scroll\", _onScroll); // clear the cache when a scroll occurs\n\n  var prev = _scrollers[i + offset],\n      func = prev || (_scrollers[i + offset] = _scrollCacheFunc(_getProxyProp(element, s), true) || (_isViewport(element) ? sc : _scrollCacheFunc(function (value) {\n    return arguments.length ? element[s] = value : element[s];\n  })));\n  func.target = element;\n  prev || (func.smooth = gsap.getProperty(element, \"scrollBehavior\") === \"smooth\"); // only set it the first time (don't reset every time a scrollFunc is requested because perhaps it happens during a refresh() when it's disabled in ScrollTrigger.\n\n  return func;\n},\n    _getVelocityProp = function _getVelocityProp(value, minTimeRefresh, useDelta) {\n  var v1 = value,\n      v2 = value,\n      t1 = _getTime(),\n      t2 = t1,\n      min = minTimeRefresh || 50,\n      dropToZeroTime = Math.max(500, min * 3),\n      update = function update(value, force) {\n    var t = _getTime();\n\n    if (force || t - t1 > min) {\n      v2 = v1;\n      v1 = value;\n      t2 = t1;\n      t1 = t;\n    } else if (useDelta) {\n      v1 += value;\n    } else {\n      // not totally necessary, but makes it a bit more accurate by adjusting the v1 value according to the new slope. This way we're not just ignoring the incoming data. Removing for now because it doesn't seem to make much practical difference and it's probably not worth the kb.\n      v1 = v2 + (value - v2) / (t - t2) * (t1 - t2);\n    }\n  },\n      reset = function reset() {\n    v2 = v1 = useDelta ? 0 : v1;\n    t2 = t1 = 0;\n  },\n      getVelocity = function getVelocity(latestValue) {\n    var tOld = t2,\n        vOld = v2,\n        t = _getTime();\n\n    (latestValue || latestValue === 0) && latestValue !== v1 && update(latestValue);\n    return t1 === t2 || t - t2 > dropToZeroTime ? 0 : (v1 + (useDelta ? vOld : -vOld)) / ((useDelta ? t : t1) - tOld) * 1000;\n  };\n\n  return {\n    update: update,\n    reset: reset,\n    getVelocity: getVelocity\n  };\n},\n    _getEvent = function _getEvent(e, preventDefault) {\n  preventDefault && !e._gsapAllow && e.preventDefault();\n  return e.changedTouches ? e.changedTouches[0] : e;\n},\n    _getAbsoluteMax = function _getAbsoluteMax(a) {\n  var max = Math.max.apply(Math, a),\n      min = Math.min.apply(Math, a);\n  return Math.abs(max) >= Math.abs(min) ? max : min;\n},\n    _setScrollTrigger = function _setScrollTrigger() {\n  ScrollTrigger = gsap.core.globals().ScrollTrigger;\n  ScrollTrigger && ScrollTrigger.core && _integrate();\n},\n    _initCore = function _initCore(core) {\n  gsap = core || _getGSAP();\n\n  if (!_coreInitted && gsap && typeof document !== \"undefined\" && document.body) {\n    _win = window;\n    _doc = document;\n    _docEl = _doc.documentElement;\n    _body = _doc.body;\n    _root = [_win, _doc, _docEl, _body];\n    _clamp = gsap.utils.clamp;\n\n    _context = gsap.core.context || function () {};\n\n    _pointerType = \"onpointerenter\" in _body ? \"pointer\" : \"mouse\"; // isTouch is 0 if no touch, 1 if ONLY touch, and 2 if it can accommodate touch but also other types like mouse/pointer.\n\n    _isTouch = Observer.isTouch = _win.matchMedia && _win.matchMedia(\"(hover: none), (pointer: coarse)\").matches ? 1 : \"ontouchstart\" in _win || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0 ? 2 : 0;\n    _eventTypes = Observer.eventTypes = (\"ontouchstart\" in _docEl ? \"touchstart,touchmove,touchcancel,touchend\" : !(\"onpointerdown\" in _docEl) ? \"mousedown,mousemove,mouseup,mouseup\" : \"pointerdown,pointermove,pointercancel,pointerup\").split(\",\");\n    setTimeout(function () {\n      return _startup = 0;\n    }, 500);\n\n    _setScrollTrigger();\n\n    _coreInitted = 1;\n  }\n\n  return _coreInitted;\n};\n\n_horizontal.op = _vertical;\n_scrollers.cache = 0;\nexport var Observer = /*#__PURE__*/function () {\n  function Observer(vars) {\n    this.init(vars);\n  }\n\n  var _proto = Observer.prototype;\n\n  _proto.init = function init(vars) {\n    _coreInitted || _initCore(gsap) || console.warn(\"Please gsap.registerPlugin(Observer)\");\n    ScrollTrigger || _setScrollTrigger();\n    var tolerance = vars.tolerance,\n        dragMinimum = vars.dragMinimum,\n        type = vars.type,\n        target = vars.target,\n        lineHeight = vars.lineHeight,\n        debounce = vars.debounce,\n        preventDefault = vars.preventDefault,\n        onStop = vars.onStop,\n        onStopDelay = vars.onStopDelay,\n        ignore = vars.ignore,\n        wheelSpeed = vars.wheelSpeed,\n        event = vars.event,\n        onDragStart = vars.onDragStart,\n        onDragEnd = vars.onDragEnd,\n        onDrag = vars.onDrag,\n        onPress = vars.onPress,\n        onRelease = vars.onRelease,\n        onRight = vars.onRight,\n        onLeft = vars.onLeft,\n        onUp = vars.onUp,\n        onDown = vars.onDown,\n        onChangeX = vars.onChangeX,\n        onChangeY = vars.onChangeY,\n        onChange = vars.onChange,\n        onToggleX = vars.onToggleX,\n        onToggleY = vars.onToggleY,\n        onHover = vars.onHover,\n        onHoverEnd = vars.onHoverEnd,\n        onMove = vars.onMove,\n        ignoreCheck = vars.ignoreCheck,\n        isNormalizer = vars.isNormalizer,\n        onGestureStart = vars.onGestureStart,\n        onGestureEnd = vars.onGestureEnd,\n        onWheel = vars.onWheel,\n        onEnable = vars.onEnable,\n        onDisable = vars.onDisable,\n        onClick = vars.onClick,\n        scrollSpeed = vars.scrollSpeed,\n        capture = vars.capture,\n        allowClicks = vars.allowClicks,\n        lockAxis = vars.lockAxis,\n        onLockAxis = vars.onLockAxis;\n    this.target = target = _getTarget(target) || _docEl;\n    this.vars = vars;\n    ignore && (ignore = gsap.utils.toArray(ignore));\n    tolerance = tolerance || 1e-9;\n    dragMinimum = dragMinimum || 0;\n    wheelSpeed = wheelSpeed || 1;\n    scrollSpeed = scrollSpeed || 1;\n    type = type || \"wheel,touch,pointer\";\n    debounce = debounce !== false;\n    lineHeight || (lineHeight = parseFloat(_win.getComputedStyle(_body).lineHeight) || 22); // note: browser may report \"normal\", so default to 22.\n\n    var id,\n        onStopDelayedCall,\n        dragged,\n        moved,\n        wheeled,\n        locked,\n        axis,\n        self = this,\n        prevDeltaX = 0,\n        prevDeltaY = 0,\n        passive = vars.passive || !preventDefault && vars.passive !== false,\n        scrollFuncX = _getScrollFunc(target, _horizontal),\n        scrollFuncY = _getScrollFunc(target, _vertical),\n        scrollX = scrollFuncX(),\n        scrollY = scrollFuncY(),\n        limitToTouch = ~type.indexOf(\"touch\") && !~type.indexOf(\"pointer\") && _eventTypes[0] === \"pointerdown\",\n        // for devices that accommodate mouse events and touch events, we need to distinguish.\n    isViewport = _isViewport(target),\n        ownerDoc = target.ownerDocument || _doc,\n        deltaX = [0, 0, 0],\n        // wheel, scroll, pointer/touch\n    deltaY = [0, 0, 0],\n        onClickTime = 0,\n        clickCapture = function clickCapture() {\n      return onClickTime = _getTime();\n    },\n        _ignoreCheck = function _ignoreCheck(e, isPointerOrTouch) {\n      return (self.event = e) && ignore && _isWithin(e.target, ignore) || isPointerOrTouch && limitToTouch && e.pointerType !== \"touch\" || ignoreCheck && ignoreCheck(e, isPointerOrTouch);\n    },\n        onStopFunc = function onStopFunc() {\n      self._vx.reset();\n\n      self._vy.reset();\n\n      onStopDelayedCall.pause();\n      onStop && onStop(self);\n    },\n        update = function update() {\n      var dx = self.deltaX = _getAbsoluteMax(deltaX),\n          dy = self.deltaY = _getAbsoluteMax(deltaY),\n          changedX = Math.abs(dx) >= tolerance,\n          changedY = Math.abs(dy) >= tolerance;\n\n      onChange && (changedX || changedY) && onChange(self, dx, dy, deltaX, deltaY); // in ScrollTrigger.normalizeScroll(), we need to know if it was touch/pointer so we need access to the deltaX/deltaY Arrays before we clear them out.\n\n      if (changedX) {\n        onRight && self.deltaX > 0 && onRight(self);\n        onLeft && self.deltaX < 0 && onLeft(self);\n        onChangeX && onChangeX(self);\n        onToggleX && self.deltaX < 0 !== prevDeltaX < 0 && onToggleX(self);\n        prevDeltaX = self.deltaX;\n        deltaX[0] = deltaX[1] = deltaX[2] = 0;\n      }\n\n      if (changedY) {\n        onDown && self.deltaY > 0 && onDown(self);\n        onUp && self.deltaY < 0 && onUp(self);\n        onChangeY && onChangeY(self);\n        onToggleY && self.deltaY < 0 !== prevDeltaY < 0 && onToggleY(self);\n        prevDeltaY = self.deltaY;\n        deltaY[0] = deltaY[1] = deltaY[2] = 0;\n      }\n\n      if (moved || dragged) {\n        onMove && onMove(self);\n\n        if (dragged) {\n          onDragStart && dragged === 1 && onDragStart(self);\n          onDrag && onDrag(self);\n          dragged = 0;\n        }\n\n        moved = false;\n      }\n\n      locked && !(locked = false) && onLockAxis && onLockAxis(self);\n\n      if (wheeled) {\n        onWheel(self);\n        wheeled = false;\n      }\n\n      id = 0;\n    },\n        onDelta = function onDelta(x, y, index) {\n      deltaX[index] += x;\n      deltaY[index] += y;\n\n      self._vx.update(x);\n\n      self._vy.update(y);\n\n      debounce ? id || (id = requestAnimationFrame(update)) : update();\n    },\n        onTouchOrPointerDelta = function onTouchOrPointerDelta(x, y) {\n      if (lockAxis && !axis) {\n        self.axis = axis = Math.abs(x) > Math.abs(y) ? \"x\" : \"y\";\n        locked = true;\n      }\n\n      if (axis !== \"y\") {\n        deltaX[2] += x;\n\n        self._vx.update(x, true); // update the velocity as frequently as possible instead of in the debounced function so that very quick touch-scrolls (flicks) feel natural. If it's the mouse/touch/pointer, force it so that we get snappy/accurate momentum scroll.\n\n      }\n\n      if (axis !== \"x\") {\n        deltaY[2] += y;\n\n        self._vy.update(y, true);\n      }\n\n      debounce ? id || (id = requestAnimationFrame(update)) : update();\n    },\n        _onDrag = function _onDrag(e) {\n      if (_ignoreCheck(e, 1)) {\n        return;\n      }\n\n      e = _getEvent(e, preventDefault);\n      var x = e.clientX,\n          y = e.clientY,\n          dx = x - self.x,\n          dy = y - self.y,\n          isDragging = self.isDragging;\n      self.x = x;\n      self.y = y;\n\n      if (isDragging || (dx || dy) && (Math.abs(self.startX - x) >= dragMinimum || Math.abs(self.startY - y) >= dragMinimum)) {\n        dragged = isDragging ? 2 : 1; // dragged: 0 = not dragging, 1 = first drag, 2 = normal drag\n\n        isDragging || (self.isDragging = true);\n        onTouchOrPointerDelta(dx, dy);\n      }\n    },\n        _onPress = self.onPress = function (e) {\n      if (_ignoreCheck(e, 1) || e && e.button) {\n        return;\n      }\n\n      self.axis = axis = null;\n      onStopDelayedCall.pause();\n      self.isPressed = true;\n      e = _getEvent(e); // note: may need to preventDefault(?) Won't side-scroll on iOS Safari if we do, though.\n\n      prevDeltaX = prevDeltaY = 0;\n      self.startX = self.x = e.clientX;\n      self.startY = self.y = e.clientY;\n\n      self._vx.reset(); // otherwise the t2 may be stale if the user touches and flicks super fast and releases in less than 2 requestAnimationFrame ticks, causing velocity to be 0.\n\n\n      self._vy.reset();\n\n      _addListener(isNormalizer ? target : ownerDoc, _eventTypes[1], _onDrag, passive, true);\n\n      self.deltaX = self.deltaY = 0;\n      onPress && onPress(self);\n    },\n        _onRelease = self.onRelease = function (e) {\n      if (_ignoreCheck(e, 1)) {\n        return;\n      }\n\n      _removeListener(isNormalizer ? target : ownerDoc, _eventTypes[1], _onDrag, true);\n\n      var isTrackingDrag = !isNaN(self.y - self.startY),\n          wasDragging = self.isDragging,\n          isDragNotClick = wasDragging && (Math.abs(self.x - self.startX) > 3 || Math.abs(self.y - self.startY) > 3),\n          // some touch devices need some wiggle room in terms of sensing clicks - the finger may move a few pixels.\n      eventData = _getEvent(e);\n\n      if (!isDragNotClick && isTrackingDrag) {\n        self._vx.reset();\n\n        self._vy.reset(); //if (preventDefault && allowClicks && self.isPressed) { // check isPressed because in a rare edge case, the inputObserver in ScrollTrigger may stopPropagation() on the press/drag, so the onRelease may get fired without the onPress/onDrag ever getting called, thus it could trigger a click to occur on a link after scroll-dragging it.\n\n\n        if (preventDefault && allowClicks) {\n          gsap.delayedCall(0.08, function () {\n            // some browsers (like Firefox) won't trust script-generated clicks, so if the user tries to click on a video to play it, for example, it simply won't work. Since a regular \"click\" event will most likely be generated anyway (one that has its isTrusted flag set to true), we must slightly delay our script-generated click so that the \"real\"/trusted one is prioritized. Remember, when there are duplicate events in quick succession, we suppress all but the first one. Some browsers don't even trigger the \"real\" one at all, so our synthetic one is a safety valve that ensures that no matter what, a click event does get dispatched.\n            if (_getTime() - onClickTime > 300 && !e.defaultPrevented) {\n              if (e.target.click) {\n                //some browsers (like mobile Safari) don't properly trigger the click event\n                e.target.click();\n              } else if (ownerDoc.createEvent) {\n                var syntheticEvent = ownerDoc.createEvent(\"MouseEvents\");\n                syntheticEvent.initMouseEvent(\"click\", true, true, _win, 1, eventData.screenX, eventData.screenY, eventData.clientX, eventData.clientY, false, false, false, false, 0, null);\n                e.target.dispatchEvent(syntheticEvent);\n              }\n            }\n          });\n        }\n      }\n\n      self.isDragging = self.isGesturing = self.isPressed = false;\n      onStop && wasDragging && !isNormalizer && onStopDelayedCall.restart(true);\n      dragged && update(); // in case debouncing, we don't want onDrag to fire AFTER onDragEnd().\n\n      onDragEnd && wasDragging && onDragEnd(self);\n      onRelease && onRelease(self, isDragNotClick);\n    },\n        _onGestureStart = function _onGestureStart(e) {\n      return e.touches && e.touches.length > 1 && (self.isGesturing = true) && onGestureStart(e, self.isDragging);\n    },\n        _onGestureEnd = function _onGestureEnd() {\n      return (self.isGesturing = false) || onGestureEnd(self);\n    },\n        onScroll = function onScroll(e) {\n      if (_ignoreCheck(e)) {\n        return;\n      }\n\n      var x = scrollFuncX(),\n          y = scrollFuncY();\n      onDelta((x - scrollX) * scrollSpeed, (y - scrollY) * scrollSpeed, 1);\n      scrollX = x;\n      scrollY = y;\n      onStop && onStopDelayedCall.restart(true);\n    },\n        _onWheel = function _onWheel(e) {\n      if (_ignoreCheck(e)) {\n        return;\n      }\n\n      e = _getEvent(e, preventDefault);\n      onWheel && (wheeled = true);\n      var multiplier = (e.deltaMode === 1 ? lineHeight : e.deltaMode === 2 ? _win.innerHeight : 1) * wheelSpeed;\n      onDelta(e.deltaX * multiplier, e.deltaY * multiplier, 0);\n      onStop && !isNormalizer && onStopDelayedCall.restart(true);\n    },\n        _onMove = function _onMove(e) {\n      if (_ignoreCheck(e)) {\n        return;\n      }\n\n      var x = e.clientX,\n          y = e.clientY,\n          dx = x - self.x,\n          dy = y - self.y;\n      self.x = x;\n      self.y = y;\n      moved = true;\n      onStop && onStopDelayedCall.restart(true);\n      (dx || dy) && onTouchOrPointerDelta(dx, dy);\n    },\n        _onHover = function _onHover(e) {\n      self.event = e;\n      onHover(self);\n    },\n        _onHoverEnd = function _onHoverEnd(e) {\n      self.event = e;\n      onHoverEnd(self);\n    },\n        _onClick = function _onClick(e) {\n      return _ignoreCheck(e) || _getEvent(e, preventDefault) && onClick(self);\n    };\n\n    onStopDelayedCall = self._dc = gsap.delayedCall(onStopDelay || 0.25, onStopFunc).pause();\n    self.deltaX = self.deltaY = 0;\n    self._vx = _getVelocityProp(0, 50, true);\n    self._vy = _getVelocityProp(0, 50, true);\n    self.scrollX = scrollFuncX;\n    self.scrollY = scrollFuncY;\n    self.isDragging = self.isGesturing = self.isPressed = false;\n\n    _context(this);\n\n    self.enable = function (e) {\n      if (!self.isEnabled) {\n        _addListener(isViewport ? ownerDoc : target, \"scroll\", _onScroll);\n\n        type.indexOf(\"scroll\") >= 0 && _addListener(isViewport ? ownerDoc : target, \"scroll\", onScroll, passive, capture);\n        type.indexOf(\"wheel\") >= 0 && _addListener(target, \"wheel\", _onWheel, passive, capture);\n\n        if (type.indexOf(\"touch\") >= 0 && _isTouch || type.indexOf(\"pointer\") >= 0) {\n          _addListener(target, _eventTypes[0], _onPress, passive, capture);\n\n          _addListener(ownerDoc, _eventTypes[2], _onRelease);\n\n          _addListener(ownerDoc, _eventTypes[3], _onRelease);\n\n          allowClicks && _addListener(target, \"click\", clickCapture, true, true);\n          onClick && _addListener(target, \"click\", _onClick);\n          onGestureStart && _addListener(ownerDoc, \"gesturestart\", _onGestureStart);\n          onGestureEnd && _addListener(ownerDoc, \"gestureend\", _onGestureEnd);\n          onHover && _addListener(target, _pointerType + \"enter\", _onHover);\n          onHoverEnd && _addListener(target, _pointerType + \"leave\", _onHoverEnd);\n          onMove && _addListener(target, _pointerType + \"move\", _onMove);\n        }\n\n        self.isEnabled = true;\n        self.isDragging = self.isGesturing = self.isPressed = moved = dragged = false;\n\n        self._vx.reset();\n\n        self._vy.reset();\n\n        scrollX = scrollFuncX();\n        scrollY = scrollFuncY();\n        e && e.type && _onPress(e);\n        onEnable && onEnable(self);\n      }\n\n      return self;\n    };\n\n    self.disable = function () {\n      if (self.isEnabled) {\n        // only remove the _onScroll listener if there aren't any others that rely on the functionality.\n        _observers.filter(function (o) {\n          return o !== self && _isViewport(o.target);\n        }).length || _removeListener(isViewport ? ownerDoc : target, \"scroll\", _onScroll);\n\n        if (self.isPressed) {\n          self._vx.reset();\n\n          self._vy.reset();\n\n          _removeListener(isNormalizer ? target : ownerDoc, _eventTypes[1], _onDrag, true);\n        }\n\n        _removeListener(isViewport ? ownerDoc : target, \"scroll\", onScroll, capture);\n\n        _removeListener(target, \"wheel\", _onWheel, capture);\n\n        _removeListener(target, _eventTypes[0], _onPress, capture);\n\n        _removeListener(ownerDoc, _eventTypes[2], _onRelease);\n\n        _removeListener(ownerDoc, _eventTypes[3], _onRelease);\n\n        _removeListener(target, \"click\", clickCapture, true);\n\n        _removeListener(target, \"click\", _onClick);\n\n        _removeListener(ownerDoc, \"gesturestart\", _onGestureStart);\n\n        _removeListener(ownerDoc, \"gestureend\", _onGestureEnd);\n\n        _removeListener(target, _pointerType + \"enter\", _onHover);\n\n        _removeListener(target, _pointerType + \"leave\", _onHoverEnd);\n\n        _removeListener(target, _pointerType + \"move\", _onMove);\n\n        self.isEnabled = self.isPressed = self.isDragging = false;\n        onDisable && onDisable(self);\n      }\n    };\n\n    self.kill = self.revert = function () {\n      self.disable();\n\n      var i = _observers.indexOf(self);\n\n      i >= 0 && _observers.splice(i, 1);\n      _normalizer === self && (_normalizer = 0);\n    };\n\n    _observers.push(self);\n\n    isNormalizer && _isViewport(target) && (_normalizer = self);\n    self.enable(event);\n  };\n\n  _createClass(Observer, [{\n    key: \"velocityX\",\n    get: function get() {\n      return this._vx.getVelocity();\n    }\n  }, {\n    key: \"velocityY\",\n    get: function get() {\n      return this._vy.getVelocity();\n    }\n  }]);\n\n  return Observer;\n}();\nObserver.version = \"3.13.0\";\n\nObserver.create = function (vars) {\n  return new Observer(vars);\n};\n\nObserver.register = _initCore;\n\nObserver.getAll = function () {\n  return _observers.slice();\n};\n\nObserver.getById = function (id) {\n  return _observers.filter(function (o) {\n    return o.vars.id === id;\n  })[0];\n};\n\n_getGSAP() && gsap.registerPlugin(Observer);\nexport { Observer as default, _isViewport, _scrollers, _getScrollFunc, _getProxyProp, _proxies, _getVelocityProp, _vertical, _horizontal, _getTarget };","/*!\n * ScrollTrigger 3.13.0\n * https://gsap.com\n *\n * @license Copyright 2008-2025, GreenSock. All rights reserved.\n * Subject to the terms at https://gsap.com/standard-license\n * @author: Jack Doyle, jack@greensock.com\n*/\n\n/* eslint-disable */\nimport { Observer, _getTarget, _vertical, _horizontal, _scrollers, _proxies, _getScrollFunc, _getProxyProp, _getVelocityProp } from \"./Observer.js\";\n\nvar gsap,\n    _coreInitted,\n    _win,\n    _doc,\n    _docEl,\n    _body,\n    _root,\n    _resizeDelay,\n    _toArray,\n    _clamp,\n    _time2,\n    _syncInterval,\n    _refreshing,\n    _pointerIsDown,\n    _transformProp,\n    _i,\n    _prevWidth,\n    _prevHeight,\n    _autoRefresh,\n    _sort,\n    _suppressOverwrites,\n    _ignoreResize,\n    _normalizer,\n    _ignoreMobileResize,\n    _baseScreenHeight,\n    _baseScreenWidth,\n    _fixIOSBug,\n    _context,\n    _scrollRestoration,\n    _div100vh,\n    _100vh,\n    _isReverted,\n    _clampingMax,\n    _limitCallbacks,\n    // if true, we'll only trigger callbacks if the active state toggles, so if you scroll immediately past both the start and end positions of a ScrollTrigger (thus inactive to inactive), neither its onEnter nor onLeave will be called. This is useful during startup.\n_startup = 1,\n    _getTime = Date.now,\n    _time1 = _getTime(),\n    _lastScrollTime = 0,\n    _enabled = 0,\n    _parseClamp = function _parseClamp(value, type, self) {\n  var clamp = _isString(value) && (value.substr(0, 6) === \"clamp(\" || value.indexOf(\"max\") > -1);\n  self[\"_\" + type + \"Clamp\"] = clamp;\n  return clamp ? value.substr(6, value.length - 7) : value;\n},\n    _keepClamp = function _keepClamp(value, clamp) {\n  return clamp && (!_isString(value) || value.substr(0, 6) !== \"clamp(\") ? \"clamp(\" + value + \")\" : value;\n},\n    _rafBugFix = function _rafBugFix() {\n  return _enabled && requestAnimationFrame(_rafBugFix);\n},\n    // in some browsers (like Firefox), screen repaints weren't consistent unless we had SOMETHING queued up in requestAnimationFrame()! So this just creates a super simple loop to keep it alive and smooth out repaints.\n_pointerDownHandler = function _pointerDownHandler() {\n  return _pointerIsDown = 1;\n},\n    _pointerUpHandler = function _pointerUpHandler() {\n  return _pointerIsDown = 0;\n},\n    _passThrough = function _passThrough(v) {\n  return v;\n},\n    _round = function _round(value) {\n  return Math.round(value * 100000) / 100000 || 0;\n},\n    _windowExists = function _windowExists() {\n  return typeof window !== \"undefined\";\n},\n    _getGSAP = function _getGSAP() {\n  return gsap || _windowExists() && (gsap = window.gsap) && gsap.registerPlugin && gsap;\n},\n    _isViewport = function _isViewport(e) {\n  return !!~_root.indexOf(e);\n},\n    _getViewportDimension = function _getViewportDimension(dimensionProperty) {\n  return (dimensionProperty === \"Height\" ? _100vh : _win[\"inner\" + dimensionProperty]) || _docEl[\"client\" + dimensionProperty] || _body[\"client\" + dimensionProperty];\n},\n    _getBoundsFunc = function _getBoundsFunc(element) {\n  return _getProxyProp(element, \"getBoundingClientRect\") || (_isViewport(element) ? function () {\n    _winOffsets.width = _win.innerWidth;\n    _winOffsets.height = _100vh;\n    return _winOffsets;\n  } : function () {\n    return _getBounds(element);\n  });\n},\n    _getSizeFunc = function _getSizeFunc(scroller, isViewport, _ref) {\n  var d = _ref.d,\n      d2 = _ref.d2,\n      a = _ref.a;\n  return (a = _getProxyProp(scroller, \"getBoundingClientRect\")) ? function () {\n    return a()[d];\n  } : function () {\n    return (isViewport ? _getViewportDimension(d2) : scroller[\"client\" + d2]) || 0;\n  };\n},\n    _getOffsetsFunc = function _getOffsetsFunc(element, isViewport) {\n  return !isViewport || ~_proxies.indexOf(element) ? _getBoundsFunc(element) : function () {\n    return _winOffsets;\n  };\n},\n    _maxScroll = function _maxScroll(element, _ref2) {\n  var s = _ref2.s,\n      d2 = _ref2.d2,\n      d = _ref2.d,\n      a = _ref2.a;\n  return Math.max(0, (s = \"scroll\" + d2) && (a = _getProxyProp(element, s)) ? a() - _getBoundsFunc(element)()[d] : _isViewport(element) ? (_docEl[s] || _body[s]) - _getViewportDimension(d2) : element[s] - element[\"offset\" + d2]);\n},\n    _iterateAutoRefresh = function _iterateAutoRefresh(func, events) {\n  for (var i = 0; i < _autoRefresh.length; i += 3) {\n    (!events || ~events.indexOf(_autoRefresh[i + 1])) && func(_autoRefresh[i], _autoRefresh[i + 1], _autoRefresh[i + 2]);\n  }\n},\n    _isString = function _isString(value) {\n  return typeof value === \"string\";\n},\n    _isFunction = function _isFunction(value) {\n  return typeof value === \"function\";\n},\n    _isNumber = function _isNumber(value) {\n  return typeof value === \"number\";\n},\n    _isObject = function _isObject(value) {\n  return typeof value === \"object\";\n},\n    _endAnimation = function _endAnimation(animation, reversed, pause) {\n  return animation && animation.progress(reversed ? 0 : 1) && pause && animation.pause();\n},\n    _callback = function _callback(self, func) {\n  if (self.enabled) {\n    var result = self._ctx ? self._ctx.add(function () {\n      return func(self);\n    }) : func(self);\n    result && result.totalTime && (self.callbackAnimation = result);\n  }\n},\n    _abs = Math.abs,\n    _left = \"left\",\n    _top = \"top\",\n    _right = \"right\",\n    _bottom = \"bottom\",\n    _width = \"width\",\n    _height = \"height\",\n    _Right = \"Right\",\n    _Left = \"Left\",\n    _Top = \"Top\",\n    _Bottom = \"Bottom\",\n    _padding = \"padding\",\n    _margin = \"margin\",\n    _Width = \"Width\",\n    _Height = \"Height\",\n    _px = \"px\",\n    _getComputedStyle = function _getComputedStyle(element) {\n  return _win.getComputedStyle(element);\n},\n    _makePositionable = function _makePositionable(element) {\n  // if the element already has position: absolute or fixed, leave that, otherwise make it position: relative\n  var position = _getComputedStyle(element).position;\n\n  element.style.position = position === \"absolute\" || position === \"fixed\" ? position : \"relative\";\n},\n    _setDefaults = function _setDefaults(obj, defaults) {\n  for (var p in defaults) {\n    p in obj || (obj[p] = defaults[p]);\n  }\n\n  return obj;\n},\n    _getBounds = function _getBounds(element, withoutTransforms) {\n  var tween = withoutTransforms && _getComputedStyle(element)[_transformProp] !== \"matrix(1, 0, 0, 1, 0, 0)\" && gsap.to(element, {\n    x: 0,\n    y: 0,\n    xPercent: 0,\n    yPercent: 0,\n    rotation: 0,\n    rotationX: 0,\n    rotationY: 0,\n    scale: 1,\n    skewX: 0,\n    skewY: 0\n  }).progress(1),\n      bounds = element.getBoundingClientRect();\n  tween && tween.progress(0).kill();\n  return bounds;\n},\n    _getSize = function _getSize(element, _ref3) {\n  var d2 = _ref3.d2;\n  return element[\"offset\" + d2] || element[\"client\" + d2] || 0;\n},\n    _getLabelRatioArray = function _getLabelRatioArray(timeline) {\n  var a = [],\n      labels = timeline.labels,\n      duration = timeline.duration(),\n      p;\n\n  for (p in labels) {\n    a.push(labels[p] / duration);\n  }\n\n  return a;\n},\n    _getClosestLabel = function _getClosestLabel(animation) {\n  return function (value) {\n    return gsap.utils.snap(_getLabelRatioArray(animation), value);\n  };\n},\n    _snapDirectional = function _snapDirectional(snapIncrementOrArray) {\n  var snap = gsap.utils.snap(snapIncrementOrArray),\n      a = Array.isArray(snapIncrementOrArray) && snapIncrementOrArray.slice(0).sort(function (a, b) {\n    return a - b;\n  });\n  return a ? function (value, direction, threshold) {\n    if (threshold === void 0) {\n      threshold = 1e-3;\n    }\n\n    var i;\n\n    if (!direction) {\n      return snap(value);\n    }\n\n    if (direction > 0) {\n      value -= threshold; // to avoid rounding errors. If we're too strict, it might snap forward, then immediately again, and again.\n\n      for (i = 0; i < a.length; i++) {\n        if (a[i] >= value) {\n          return a[i];\n        }\n      }\n\n      return a[i - 1];\n    } else {\n      i = a.length;\n      value += threshold;\n\n      while (i--) {\n        if (a[i] <= value) {\n          return a[i];\n        }\n      }\n    }\n\n    return a[0];\n  } : function (value, direction, threshold) {\n    if (threshold === void 0) {\n      threshold = 1e-3;\n    }\n\n    var snapped = snap(value);\n    return !direction || Math.abs(snapped - value) < threshold || snapped - value < 0 === direction < 0 ? snapped : snap(direction < 0 ? value - snapIncrementOrArray : value + snapIncrementOrArray);\n  };\n},\n    _getLabelAtDirection = function _getLabelAtDirection(timeline) {\n  return function (value, st) {\n    return _snapDirectional(_getLabelRatioArray(timeline))(value, st.direction);\n  };\n},\n    _multiListener = function _multiListener(func, element, types, callback) {\n  return types.split(\",\").forEach(function (type) {\n    return func(element, type, callback);\n  });\n},\n    _addListener = function _addListener(element, type, func, nonPassive, capture) {\n  return element.addEventListener(type, func, {\n    passive: !nonPassive,\n    capture: !!capture\n  });\n},\n    _removeListener = function _removeListener(element, type, func, capture) {\n  return element.removeEventListener(type, func, !!capture);\n},\n    _wheelListener = function _wheelListener(func, el, scrollFunc) {\n  scrollFunc = scrollFunc && scrollFunc.wheelHandler;\n\n  if (scrollFunc) {\n    func(el, \"wheel\", scrollFunc);\n    func(el, \"touchmove\", scrollFunc);\n  }\n},\n    _markerDefaults = {\n  startColor: \"green\",\n  endColor: \"red\",\n  indent: 0,\n  fontSize: \"16px\",\n  fontWeight: \"normal\"\n},\n    _defaults = {\n  toggleActions: \"play\",\n  anticipatePin: 0\n},\n    _keywords = {\n  top: 0,\n  left: 0,\n  center: 0.5,\n  bottom: 1,\n  right: 1\n},\n    _offsetToPx = function _offsetToPx(value, size) {\n  if (_isString(value)) {\n    var eqIndex = value.indexOf(\"=\"),\n        relative = ~eqIndex ? +(value.charAt(eqIndex - 1) + 1) * parseFloat(value.substr(eqIndex + 1)) : 0;\n\n    if (~eqIndex) {\n      value.indexOf(\"%\") > eqIndex && (relative *= size / 100);\n      value = value.substr(0, eqIndex - 1);\n    }\n\n    value = relative + (value in _keywords ? _keywords[value] * size : ~value.indexOf(\"%\") ? parseFloat(value) * size / 100 : parseFloat(value) || 0);\n  }\n\n  return value;\n},\n    _createMarker = function _createMarker(type, name, container, direction, _ref4, offset, matchWidthEl, containerAnimation) {\n  var startColor = _ref4.startColor,\n      endColor = _ref4.endColor,\n      fontSize = _ref4.fontSize,\n      indent = _ref4.indent,\n      fontWeight = _ref4.fontWeight;\n\n  var e = _doc.createElement(\"div\"),\n      useFixedPosition = _isViewport(container) || _getProxyProp(container, \"pinType\") === \"fixed\",\n      isScroller = type.indexOf(\"scroller\") !== -1,\n      parent = useFixedPosition ? _body : container,\n      isStart = type.indexOf(\"start\") !== -1,\n      color = isStart ? startColor : endColor,\n      css = \"border-color:\" + color + \";font-size:\" + fontSize + \";color:\" + color + \";font-weight:\" + fontWeight + \";pointer-events:none;white-space:nowrap;font-family:sans-serif,Arial;z-index:1000;padding:4px 8px;border-width:0;border-style:solid;\";\n\n  css += \"position:\" + ((isScroller || containerAnimation) && useFixedPosition ? \"fixed;\" : \"absolute;\");\n  (isScroller || containerAnimation || !useFixedPosition) && (css += (direction === _vertical ? _right : _bottom) + \":\" + (offset + parseFloat(indent)) + \"px;\");\n  matchWidthEl && (css += \"box-sizing:border-box;text-align:left;width:\" + matchWidthEl.offsetWidth + \"px;\");\n  e._isStart = isStart;\n  e.setAttribute(\"class\", \"gsap-marker-\" + type + (name ? \" marker-\" + name : \"\"));\n  e.style.cssText = css;\n  e.innerText = name || name === 0 ? type + \"-\" + name : type;\n  parent.children[0] ? parent.insertBefore(e, parent.children[0]) : parent.appendChild(e);\n  e._offset = e[\"offset\" + direction.op.d2];\n\n  _positionMarker(e, 0, direction, isStart);\n\n  return e;\n},\n    _positionMarker = function _positionMarker(marker, start, direction, flipped) {\n  var vars = {\n    display: \"block\"\n  },\n      side = direction[flipped ? \"os2\" : \"p2\"],\n      oppositeSide = direction[flipped ? \"p2\" : \"os2\"];\n  marker._isFlipped = flipped;\n  vars[direction.a + \"Percent\"] = flipped ? -100 : 0;\n  vars[direction.a] = flipped ? \"1px\" : 0;\n  vars[\"border\" + side + _Width] = 1;\n  vars[\"border\" + oppositeSide + _Width] = 0;\n  vars[direction.p] = start + \"px\";\n  gsap.set(marker, vars);\n},\n    _triggers = [],\n    _ids = {},\n    _rafID,\n    _sync = function _sync() {\n  return _getTime() - _lastScrollTime > 34 && (_rafID || (_rafID = requestAnimationFrame(_updateAll)));\n},\n    _onScroll = function _onScroll() {\n  // previously, we tried to optimize performance by batching/deferring to the next requestAnimationFrame(), but discovered that Safari has a few bugs that make this unworkable (especially on iOS). See https://codepen.io/GreenSock/pen/16c435b12ef09c38125204818e7b45fc?editors=0010 and https://codepen.io/GreenSock/pen/JjOxYpQ/3dd65ccec5a60f1d862c355d84d14562?editors=0010 and https://codepen.io/GreenSock/pen/ExbrPNa/087cef197dc35445a0951e8935c41503?editors=0010\n  if (!_normalizer || !_normalizer.isPressed || _normalizer.startX > _body.clientWidth) {\n    // if the user is dragging the scrollbar, allow it.\n    _scrollers.cache++;\n\n    if (_normalizer) {\n      _rafID || (_rafID = requestAnimationFrame(_updateAll));\n    } else {\n      _updateAll(); // Safari in particular (on desktop) NEEDS the immediate update rather than waiting for a requestAnimationFrame() whereas iOS seems to benefit from waiting for the requestAnimationFrame() tick, at least when normalizing. See https://codepen.io/GreenSock/pen/qBYozqO?editors=0110\n\n    }\n\n    _lastScrollTime || _dispatch(\"scrollStart\");\n    _lastScrollTime = _getTime();\n  }\n},\n    _setBaseDimensions = function _setBaseDimensions() {\n  _baseScreenWidth = _win.innerWidth;\n  _baseScreenHeight = _win.innerHeight;\n},\n    _onResize = function _onResize(force) {\n  _scrollers.cache++;\n  (force === true || !_refreshing && !_ignoreResize && !_doc.fullscreenElement && !_doc.webkitFullscreenElement && (!_ignoreMobileResize || _baseScreenWidth !== _win.innerWidth || Math.abs(_win.innerHeight - _baseScreenHeight) > _win.innerHeight * 0.25)) && _resizeDelay.restart(true);\n},\n    // ignore resizes triggered by refresh()\n_listeners = {},\n    _emptyArray = [],\n    _softRefresh = function _softRefresh() {\n  return _removeListener(ScrollTrigger, \"scrollEnd\", _softRefresh) || _refreshAll(true);\n},\n    _dispatch = function _dispatch(type) {\n  return _listeners[type] && _listeners[type].map(function (f) {\n    return f();\n  }) || _emptyArray;\n},\n    _savedStyles = [],\n    // when ScrollTrigger.saveStyles() is called, the inline styles are recorded in this Array in a sequential format like [element, cssText, gsCache, media]. This keeps it very memory-efficient and fast to iterate through.\n_revertRecorded = function _revertRecorded(media) {\n  for (var i = 0; i < _savedStyles.length; i += 5) {\n    if (!media || _savedStyles[i + 4] && _savedStyles[i + 4].query === media) {\n      _savedStyles[i].style.cssText = _savedStyles[i + 1];\n      _savedStyles[i].getBBox && _savedStyles[i].setAttribute(\"transform\", _savedStyles[i + 2] || \"\");\n      _savedStyles[i + 3].uncache = 1;\n    }\n  }\n},\n    _revertAll = function _revertAll(kill, media) {\n  var trigger;\n\n  for (_i = 0; _i < _triggers.length; _i++) {\n    trigger = _triggers[_i];\n\n    if (trigger && (!media || trigger._ctx === media)) {\n      if (kill) {\n        trigger.kill(1);\n      } else {\n        trigger.revert(true, true);\n      }\n    }\n  }\n\n  _isReverted = true;\n  media && _revertRecorded(media);\n  media || _dispatch(\"revert\");\n},\n    _clearScrollMemory = function _clearScrollMemory(scrollRestoration, force) {\n  // zero-out all the recorded scroll positions. Don't use _triggers because if, for example, .matchMedia() is used to create some ScrollTriggers and then the user resizes and it removes ALL ScrollTriggers, and then go back to a size where there are ScrollTriggers, it would have kept the position(s) saved from the initial state.\n  _scrollers.cache++;\n  (force || !_refreshingAll) && _scrollers.forEach(function (obj) {\n    return _isFunction(obj) && obj.cacheID++ && (obj.rec = 0);\n  });\n  _isString(scrollRestoration) && (_win.history.scrollRestoration = _scrollRestoration = scrollRestoration);\n},\n    _refreshingAll,\n    _refreshID = 0,\n    _queueRefreshID,\n    _queueRefreshAll = function _queueRefreshAll() {\n  // we don't want to call _refreshAll() every time we create a new ScrollTrigger (for performance reasons) - it's better to batch them. Some frameworks dynamically load content and we can't rely on the window's \"load\" or \"DOMContentLoaded\" events to trigger it.\n  if (_queueRefreshID !== _refreshID) {\n    var id = _queueRefreshID = _refreshID;\n    requestAnimationFrame(function () {\n      return id === _refreshID && _refreshAll(true);\n    });\n  }\n},\n    _refresh100vh = function _refresh100vh() {\n  _body.appendChild(_div100vh);\n\n  _100vh = !_normalizer && _div100vh.offsetHeight || _win.innerHeight;\n\n  _body.removeChild(_div100vh);\n},\n    _hideAllMarkers = function _hideAllMarkers(hide) {\n  return _toArray(\".gsap-marker-start, .gsap-marker-end, .gsap-marker-scroller-start, .gsap-marker-scroller-end\").forEach(function (el) {\n    return el.style.display = hide ? \"none\" : \"block\";\n  });\n},\n    _refreshAll = function _refreshAll(force, skipRevert) {\n  _docEl = _doc.documentElement; // some frameworks like Astro may cache the <body> and replace it during routing, so we'll just re-record the _docEl and _body for safety (otherwise, the markers may not get added properly).\n\n  _body = _doc.body;\n  _root = [_win, _doc, _docEl, _body];\n\n  if (_lastScrollTime && !force && !_isReverted) {\n    _addListener(ScrollTrigger, \"scrollEnd\", _softRefresh);\n\n    return;\n  }\n\n  _refresh100vh();\n\n  _refreshingAll = ScrollTrigger.isRefreshing = true;\n\n  _scrollers.forEach(function (obj) {\n    return _isFunction(obj) && ++obj.cacheID && (obj.rec = obj());\n  }); // force the clearing of the cache because some browsers take a little while to dispatch the \"scroll\" event and the user may have changed the scroll position and then called ScrollTrigger.refresh() right away\n\n\n  var refreshInits = _dispatch(\"refreshInit\");\n\n  _sort && ScrollTrigger.sort();\n  skipRevert || _revertAll();\n\n  _scrollers.forEach(function (obj) {\n    if (_isFunction(obj)) {\n      obj.smooth && (obj.target.style.scrollBehavior = \"auto\"); // smooth scrolling interferes\n\n      obj(0);\n    }\n  });\n\n  _triggers.slice(0).forEach(function (t) {\n    return t.refresh();\n  }); // don't loop with _i because during a refresh() someone could call ScrollTrigger.update() which would iterate through _i resulting in a skip.\n\n\n  _isReverted = false;\n\n  _triggers.forEach(function (t) {\n    // nested pins (pinnedContainer) with pinSpacing may expand the container, so we must accommodate that here.\n    if (t._subPinOffset && t.pin) {\n      var prop = t.vars.horizontal ? \"offsetWidth\" : \"offsetHeight\",\n          original = t.pin[prop];\n      t.revert(true, 1);\n      t.adjustPinSpacing(t.pin[prop] - original);\n      t.refresh();\n    }\n  });\n\n  _clampingMax = 1; // pinSpacing might be propping a page open, thus when we .setPositions() to clamp a ScrollTrigger's end we should leave the pinSpacing alone. That's what this flag is for.\n\n  _hideAllMarkers(true);\n\n  _triggers.forEach(function (t) {\n    // the scroller's max scroll position may change after all the ScrollTriggers refreshed (like pinning could push it down), so we need to loop back and correct any with end: \"max\". Same for anything with a clamped end\n    var max = _maxScroll(t.scroller, t._dir),\n        endClamp = t.vars.end === \"max\" || t._endClamp && t.end > max,\n        startClamp = t._startClamp && t.start >= max;\n\n    (endClamp || startClamp) && t.setPositions(startClamp ? max - 1 : t.start, endClamp ? Math.max(startClamp ? max : t.start + 1, max) : t.end, true);\n  });\n\n  _hideAllMarkers(false);\n\n  _clampingMax = 0;\n  refreshInits.forEach(function (result) {\n    return result && result.render && result.render(-1);\n  }); // if the onRefreshInit() returns an animation (typically a gsap.set()), revert it. This makes it easy to put things in a certain spot before refreshing for measurement purposes, and then put things back.\n\n  _scrollers.forEach(function (obj) {\n    if (_isFunction(obj)) {\n      obj.smooth && requestAnimationFrame(function () {\n        return obj.target.style.scrollBehavior = \"smooth\";\n      });\n      obj.rec && obj(obj.rec);\n    }\n  });\n\n  _clearScrollMemory(_scrollRestoration, 1);\n\n  _resizeDelay.pause();\n\n  _refreshID++;\n  _refreshingAll = 2;\n\n  _updateAll(2);\n\n  _triggers.forEach(function (t) {\n    return _isFunction(t.vars.onRefresh) && t.vars.onRefresh(t);\n  });\n\n  _refreshingAll = ScrollTrigger.isRefreshing = false;\n\n  _dispatch(\"refresh\");\n},\n    _lastScroll = 0,\n    _direction = 1,\n    _primary,\n    _updateAll = function _updateAll(force) {\n  if (force === 2 || !_refreshingAll && !_isReverted) {\n    // _isReverted could be true if, for example, a matchMedia() is in the process of executing. We don't want to update during the time everything is reverted.\n    ScrollTrigger.isUpdating = true;\n    _primary && _primary.update(0); // ScrollSmoother uses refreshPriority -9999 to become the primary that gets updated before all others because it affects the scroll position.\n\n    var l = _triggers.length,\n        time = _getTime(),\n        recordVelocity = time - _time1 >= 50,\n        scroll = l && _triggers[0].scroll();\n\n    _direction = _lastScroll > scroll ? -1 : 1;\n    _refreshingAll || (_lastScroll = scroll);\n\n    if (recordVelocity) {\n      if (_lastScrollTime && !_pointerIsDown && time - _lastScrollTime > 200) {\n        _lastScrollTime = 0;\n\n        _dispatch(\"scrollEnd\");\n      }\n\n      _time2 = _time1;\n      _time1 = time;\n    }\n\n    if (_direction < 0) {\n      _i = l;\n\n      while (_i-- > 0) {\n        _triggers[_i] && _triggers[_i].update(0, recordVelocity);\n      }\n\n      _direction = 1;\n    } else {\n      for (_i = 0; _i < l; _i++) {\n        _triggers[_i] && _triggers[_i].update(0, recordVelocity);\n      }\n    }\n\n    ScrollTrigger.isUpdating = false;\n  }\n\n  _rafID = 0;\n},\n    _propNamesToCopy = [_left, _top, _bottom, _right, _margin + _Bottom, _margin + _Right, _margin + _Top, _margin + _Left, \"display\", \"flexShrink\", \"float\", \"zIndex\", \"gridColumnStart\", \"gridColumnEnd\", \"gridRowStart\", \"gridRowEnd\", \"gridArea\", \"justifySelf\", \"alignSelf\", \"placeSelf\", \"order\"],\n    _stateProps = _propNamesToCopy.concat([_width, _height, \"boxSizing\", \"max\" + _Width, \"max\" + _Height, \"position\", _margin, _padding, _padding + _Top, _padding + _Right, _padding + _Bottom, _padding + _Left]),\n    _swapPinOut = function _swapPinOut(pin, spacer, state) {\n  _setState(state);\n\n  var cache = pin._gsap;\n\n  if (cache.spacerIsNative) {\n    _setState(cache.spacerState);\n  } else if (pin._gsap.swappedIn) {\n    var parent = spacer.parentNode;\n\n    if (parent) {\n      parent.insertBefore(pin, spacer);\n      parent.removeChild(spacer);\n    }\n  }\n\n  pin._gsap.swappedIn = false;\n},\n    _swapPinIn = function _swapPinIn(pin, spacer, cs, spacerState) {\n  if (!pin._gsap.swappedIn) {\n    var i = _propNamesToCopy.length,\n        spacerStyle = spacer.style,\n        pinStyle = pin.style,\n        p;\n\n    while (i--) {\n      p = _propNamesToCopy[i];\n      spacerStyle[p] = cs[p];\n    }\n\n    spacerStyle.position = cs.position === \"absolute\" ? \"absolute\" : \"relative\";\n    cs.display === \"inline\" && (spacerStyle.display = \"inline-block\");\n    pinStyle[_bottom] = pinStyle[_right] = \"auto\";\n    spacerStyle.flexBasis = cs.flexBasis || \"auto\";\n    spacerStyle.overflow = \"visible\";\n    spacerStyle.boxSizing = \"border-box\";\n    spacerStyle[_width] = _getSize(pin, _horizontal) + _px;\n    spacerStyle[_height] = _getSize(pin, _vertical) + _px;\n    spacerStyle[_padding] = pinStyle[_margin] = pinStyle[_top] = pinStyle[_left] = \"0\";\n\n    _setState(spacerState);\n\n    pinStyle[_width] = pinStyle[\"max\" + _Width] = cs[_width];\n    pinStyle[_height] = pinStyle[\"max\" + _Height] = cs[_height];\n    pinStyle[_padding] = cs[_padding];\n\n    if (pin.parentNode !== spacer) {\n      pin.parentNode.insertBefore(spacer, pin);\n      spacer.appendChild(pin);\n    }\n\n    pin._gsap.swappedIn = true;\n  }\n},\n    _capsExp = /([A-Z])/g,\n    _setState = function _setState(state) {\n  if (state) {\n    var style = state.t.style,\n        l = state.length,\n        i = 0,\n        p,\n        value;\n    (state.t._gsap || gsap.core.getCache(state.t)).uncache = 1; // otherwise transforms may be off\n\n    for (; i < l; i += 2) {\n      value = state[i + 1];\n      p = state[i];\n\n      if (value) {\n        style[p] = value;\n      } else if (style[p]) {\n        style.removeProperty(p.replace(_capsExp, \"-$1\").toLowerCase());\n      }\n    }\n  }\n},\n    _getState = function _getState(element) {\n  // returns an Array with alternating values like [property, value, property, value] and a \"t\" property pointing to the target (element). Makes it fast and cheap.\n  var l = _stateProps.length,\n      style = element.style,\n      state = [],\n      i = 0;\n\n  for (; i < l; i++) {\n    state.push(_stateProps[i], style[_stateProps[i]]);\n  }\n\n  state.t = element;\n  return state;\n},\n    _copyState = function _copyState(state, override, omitOffsets) {\n  var result = [],\n      l = state.length,\n      i = omitOffsets ? 8 : 0,\n      // skip top, left, right, bottom if omitOffsets is true\n  p;\n\n  for (; i < l; i += 2) {\n    p = state[i];\n    result.push(p, p in override ? override[p] : state[i + 1]);\n  }\n\n  result.t = state.t;\n  return result;\n},\n    _winOffsets = {\n  left: 0,\n  top: 0\n},\n    // // potential future feature (?) Allow users to calculate where a trigger hits (scroll position) like getScrollPosition(\"#id\", \"top bottom\")\n// _getScrollPosition = (trigger, position, {scroller, containerAnimation, horizontal}) => {\n// \tscroller = _getTarget(scroller || _win);\n// \tlet direction = horizontal ? _horizontal : _vertical,\n// \t\tisViewport = _isViewport(scroller);\n// \t_getSizeFunc(scroller, isViewport, direction);\n// \treturn _parsePosition(position, _getTarget(trigger), _getSizeFunc(scroller, isViewport, direction)(), direction, _getScrollFunc(scroller, direction)(), 0, 0, 0, _getOffsetsFunc(scroller, isViewport)(), isViewport ? 0 : parseFloat(_getComputedStyle(scroller)[\"border\" + direction.p2 + _Width]) || 0, 0, containerAnimation ? containerAnimation.duration() : _maxScroll(scroller), containerAnimation);\n// },\n_parsePosition = function _parsePosition(value, trigger, scrollerSize, direction, scroll, marker, markerScroller, self, scrollerBounds, borderWidth, useFixedPosition, scrollerMax, containerAnimation, clampZeroProp) {\n  _isFunction(value) && (value = value(self));\n\n  if (_isString(value) && value.substr(0, 3) === \"max\") {\n    value = scrollerMax + (value.charAt(4) === \"=\" ? _offsetToPx(\"0\" + value.substr(3), scrollerSize) : 0);\n  }\n\n  var time = containerAnimation ? containerAnimation.time() : 0,\n      p1,\n      p2,\n      element;\n  containerAnimation && containerAnimation.seek(0);\n  isNaN(value) || (value = +value); // convert a string number like \"45\" to an actual number\n\n  if (!_isNumber(value)) {\n    _isFunction(trigger) && (trigger = trigger(self));\n    var offsets = (value || \"0\").split(\" \"),\n        bounds,\n        localOffset,\n        globalOffset,\n        display;\n    element = _getTarget(trigger, self) || _body;\n    bounds = _getBounds(element) || {};\n\n    if ((!bounds || !bounds.left && !bounds.top) && _getComputedStyle(element).display === \"none\") {\n      // if display is \"none\", it won't report getBoundingClientRect() properly\n      display = element.style.display;\n      element.style.display = \"block\";\n      bounds = _getBounds(element);\n      display ? element.style.display = display : element.style.removeProperty(\"display\");\n    }\n\n    localOffset = _offsetToPx(offsets[0], bounds[direction.d]);\n    globalOffset = _offsetToPx(offsets[1] || \"0\", scrollerSize);\n    value = bounds[direction.p] - scrollerBounds[direction.p] - borderWidth + localOffset + scroll - globalOffset;\n    markerScroller && _positionMarker(markerScroller, globalOffset, direction, scrollerSize - globalOffset < 20 || markerScroller._isStart && globalOffset > 20);\n    scrollerSize -= scrollerSize - globalOffset; // adjust for the marker\n  } else {\n    containerAnimation && (value = gsap.utils.mapRange(containerAnimation.scrollTrigger.start, containerAnimation.scrollTrigger.end, 0, scrollerMax, value));\n    markerScroller && _positionMarker(markerScroller, scrollerSize, direction, true);\n  }\n\n  if (clampZeroProp) {\n    self[clampZeroProp] = value || -0.001;\n    value < 0 && (value = 0);\n  }\n\n  if (marker) {\n    var position = value + scrollerSize,\n        isStart = marker._isStart;\n    p1 = \"scroll\" + direction.d2;\n\n    _positionMarker(marker, position, direction, isStart && position > 20 || !isStart && (useFixedPosition ? Math.max(_body[p1], _docEl[p1]) : marker.parentNode[p1]) <= position + 1);\n\n    if (useFixedPosition) {\n      scrollerBounds = _getBounds(markerScroller);\n      useFixedPosition && (marker.style[direction.op.p] = scrollerBounds[direction.op.p] - direction.op.m - marker._offset + _px);\n    }\n  }\n\n  if (containerAnimation && element) {\n    p1 = _getBounds(element);\n    containerAnimation.seek(scrollerMax);\n    p2 = _getBounds(element);\n    containerAnimation._caScrollDist = p1[direction.p] - p2[direction.p];\n    value = value / containerAnimation._caScrollDist * scrollerMax;\n  }\n\n  containerAnimation && containerAnimation.seek(time);\n  return containerAnimation ? value : Math.round(value);\n},\n    _prefixExp = /(webkit|moz|length|cssText|inset)/i,\n    _reparent = function _reparent(element, parent, top, left) {\n  if (element.parentNode !== parent) {\n    var style = element.style,\n        p,\n        cs;\n\n    if (parent === _body) {\n      element._stOrig = style.cssText; // record original inline styles so we can revert them later\n\n      cs = _getComputedStyle(element);\n\n      for (p in cs) {\n        // must copy all relevant styles to ensure that nothing changes visually when we reparent to the <body>. Skip the vendor prefixed ones.\n        if (!+p && !_prefixExp.test(p) && cs[p] && typeof style[p] === \"string\" && p !== \"0\") {\n          style[p] = cs[p];\n        }\n      }\n\n      style.top = top;\n      style.left = left;\n    } else {\n      style.cssText = element._stOrig;\n    }\n\n    gsap.core.getCache(element).uncache = 1;\n    parent.appendChild(element);\n  }\n},\n    _interruptionTracker = function _interruptionTracker(getValueFunc, initialValue, onInterrupt) {\n  var last1 = initialValue,\n      last2 = last1;\n  return function (value) {\n    var current = Math.round(getValueFunc()); // round because in some [very uncommon] Windows environments, scroll can get reported with decimals even though it was set without.\n\n    if (current !== last1 && current !== last2 && Math.abs(current - last1) > 3 && Math.abs(current - last2) > 3) {\n      // if the user scrolls, kill the tween. iOS Safari intermittently misreports the scroll position, it may be the most recently-set one or the one before that! When Safari is zoomed (CMD-+), it often misreports as 1 pixel off too! So if we set the scroll position to 125, for example, it'll actually report it as 124.\n      value = current;\n      onInterrupt && onInterrupt();\n    }\n\n    last2 = last1;\n    last1 = Math.round(value);\n    return last1;\n  };\n},\n    _shiftMarker = function _shiftMarker(marker, direction, value) {\n  var vars = {};\n  vars[direction.p] = \"+=\" + value;\n  gsap.set(marker, vars);\n},\n    // _mergeAnimations = animations => {\n// \tlet tl = gsap.timeline({smoothChildTiming: true}).startTime(Math.min(...animations.map(a => a.globalTime(0))));\n// \tanimations.forEach(a => {let time = a.totalTime(); tl.add(a); a.totalTime(time); });\n// \ttl.smoothChildTiming = false;\n// \treturn tl;\n// },\n// returns a function that can be used to tween the scroll position in the direction provided, and when doing so it'll add a .tween property to the FUNCTION itself, and remove it when the tween completes or gets killed. This gives us a way to have multiple ScrollTriggers use a central function for any given scroller and see if there's a scroll tween running (which would affect if/how things get updated)\n_getTweenCreator = function _getTweenCreator(scroller, direction) {\n  var getScroll = _getScrollFunc(scroller, direction),\n      prop = \"_scroll\" + direction.p2,\n      // add a tweenable property to the scroller that's a getter/setter function, like _scrollTop or _scrollLeft. This way, if someone does gsap.killTweensOf(scroller) it'll kill the scroll tween.\n  getTween = function getTween(scrollTo, vars, initialValue, change1, change2) {\n    var tween = getTween.tween,\n        onComplete = vars.onComplete,\n        modifiers = {};\n    initialValue = initialValue || getScroll();\n\n    var checkForInterruption = _interruptionTracker(getScroll, initialValue, function () {\n      tween.kill();\n      getTween.tween = 0;\n    });\n\n    change2 = change1 && change2 || 0; // if change1 is 0, we set that to the difference and ignore change2. Otherwise, there would be a compound effect.\n\n    change1 = change1 || scrollTo - initialValue;\n    tween && tween.kill();\n    vars[prop] = scrollTo;\n    vars.inherit = false;\n    vars.modifiers = modifiers;\n\n    modifiers[prop] = function () {\n      return checkForInterruption(initialValue + change1 * tween.ratio + change2 * tween.ratio * tween.ratio);\n    };\n\n    vars.onUpdate = function () {\n      _scrollers.cache++;\n      getTween.tween && _updateAll(); // if it was interrupted/killed, like in a context.revert(), don't force an updateAll()\n    };\n\n    vars.onComplete = function () {\n      getTween.tween = 0;\n      onComplete && onComplete.call(tween);\n    };\n\n    tween = getTween.tween = gsap.to(scroller, vars);\n    return tween;\n  };\n\n  scroller[prop] = getScroll;\n\n  getScroll.wheelHandler = function () {\n    return getTween.tween && getTween.tween.kill() && (getTween.tween = 0);\n  };\n\n  _addListener(scroller, \"wheel\", getScroll.wheelHandler); // Windows machines handle mousewheel scrolling in chunks (like \"3 lines per scroll\") meaning the typical strategy for cancelling the scroll isn't as sensitive. It's much more likely to match one of the previous 2 scroll event positions. So we kill any snapping as soon as there's a wheel event.\n\n\n  ScrollTrigger.isTouch && _addListener(scroller, \"touchmove\", getScroll.wheelHandler);\n  return getTween;\n};\n\nexport var ScrollTrigger = /*#__PURE__*/function () {\n  function ScrollTrigger(vars, animation) {\n    _coreInitted || ScrollTrigger.register(gsap) || console.warn(\"Please gsap.registerPlugin(ScrollTrigger)\");\n\n    _context(this);\n\n    this.init(vars, animation);\n  }\n\n  var _proto = ScrollTrigger.prototype;\n\n  _proto.init = function init(vars, animation) {\n    this.progress = this.start = 0;\n    this.vars && this.kill(true, true); // in case it's being initted again\n\n    if (!_enabled) {\n      this.update = this.refresh = this.kill = _passThrough;\n      return;\n    }\n\n    vars = _setDefaults(_isString(vars) || _isNumber(vars) || vars.nodeType ? {\n      trigger: vars\n    } : vars, _defaults);\n\n    var _vars = vars,\n        onUpdate = _vars.onUpdate,\n        toggleClass = _vars.toggleClass,\n        id = _vars.id,\n        onToggle = _vars.onToggle,\n        onRefresh = _vars.onRefresh,\n        scrub = _vars.scrub,\n        trigger = _vars.trigger,\n        pin = _vars.pin,\n        pinSpacing = _vars.pinSpacing,\n        invalidateOnRefresh = _vars.invalidateOnRefresh,\n        anticipatePin = _vars.anticipatePin,\n        onScrubComplete = _vars.onScrubComplete,\n        onSnapComplete = _vars.onSnapComplete,\n        once = _vars.once,\n        snap = _vars.snap,\n        pinReparent = _vars.pinReparent,\n        pinSpacer = _vars.pinSpacer,\n        containerAnimation = _vars.containerAnimation,\n        fastScrollEnd = _vars.fastScrollEnd,\n        preventOverlaps = _vars.preventOverlaps,\n        direction = vars.horizontal || vars.containerAnimation && vars.horizontal !== false ? _horizontal : _vertical,\n        isToggle = !scrub && scrub !== 0,\n        scroller = _getTarget(vars.scroller || _win),\n        scrollerCache = gsap.core.getCache(scroller),\n        isViewport = _isViewport(scroller),\n        useFixedPosition = (\"pinType\" in vars ? vars.pinType : _getProxyProp(scroller, \"pinType\") || isViewport && \"fixed\") === \"fixed\",\n        callbacks = [vars.onEnter, vars.onLeave, vars.onEnterBack, vars.onLeaveBack],\n        toggleActions = isToggle && vars.toggleActions.split(\" \"),\n        markers = \"markers\" in vars ? vars.markers : _defaults.markers,\n        borderWidth = isViewport ? 0 : parseFloat(_getComputedStyle(scroller)[\"border\" + direction.p2 + _Width]) || 0,\n        self = this,\n        onRefreshInit = vars.onRefreshInit && function () {\n      return vars.onRefreshInit(self);\n    },\n        getScrollerSize = _getSizeFunc(scroller, isViewport, direction),\n        getScrollerOffsets = _getOffsetsFunc(scroller, isViewport),\n        lastSnap = 0,\n        lastRefresh = 0,\n        prevProgress = 0,\n        scrollFunc = _getScrollFunc(scroller, direction),\n        tweenTo,\n        pinCache,\n        snapFunc,\n        scroll1,\n        scroll2,\n        start,\n        end,\n        markerStart,\n        markerEnd,\n        markerStartTrigger,\n        markerEndTrigger,\n        markerVars,\n        executingOnRefresh,\n        change,\n        pinOriginalState,\n        pinActiveState,\n        pinState,\n        spacer,\n        offset,\n        pinGetter,\n        pinSetter,\n        pinStart,\n        pinChange,\n        spacingStart,\n        spacerState,\n        markerStartSetter,\n        pinMoves,\n        markerEndSetter,\n        cs,\n        snap1,\n        snap2,\n        scrubTween,\n        scrubSmooth,\n        snapDurClamp,\n        snapDelayedCall,\n        prevScroll,\n        prevAnimProgress,\n        caMarkerSetter,\n        customRevertReturn; // for the sake of efficiency, _startClamp/_endClamp serve like a truthy value indicating that clamping was enabled on the start/end, and ALSO store the actual pre-clamped numeric value. We tap into that in ScrollSmoother for speed effects. So for example, if start=\"clamp(top bottom)\" results in a start of -100 naturally, it would get clamped to 0 but -100 would be stored in _startClamp.\n\n\n    self._startClamp = self._endClamp = false;\n    self._dir = direction;\n    anticipatePin *= 45;\n    self.scroller = scroller;\n    self.scroll = containerAnimation ? containerAnimation.time.bind(containerAnimation) : scrollFunc;\n    scroll1 = scrollFunc();\n    self.vars = vars;\n    animation = animation || vars.animation;\n\n    if (\"refreshPriority\" in vars) {\n      _sort = 1;\n      vars.refreshPriority === -9999 && (_primary = self); // used by ScrollSmoother\n    }\n\n    scrollerCache.tweenScroll = scrollerCache.tweenScroll || {\n      top: _getTweenCreator(scroller, _vertical),\n      left: _getTweenCreator(scroller, _horizontal)\n    };\n    self.tweenTo = tweenTo = scrollerCache.tweenScroll[direction.p];\n\n    self.scrubDuration = function (value) {\n      scrubSmooth = _isNumber(value) && value;\n\n      if (!scrubSmooth) {\n        scrubTween && scrubTween.progress(1).kill();\n        scrubTween = 0;\n      } else {\n        scrubTween ? scrubTween.duration(value) : scrubTween = gsap.to(animation, {\n          ease: \"expo\",\n          totalProgress: \"+=0\",\n          inherit: false,\n          duration: scrubSmooth,\n          paused: true,\n          onComplete: function onComplete() {\n            return onScrubComplete && onScrubComplete(self);\n          }\n        });\n      }\n    };\n\n    if (animation) {\n      animation.vars.lazy = false;\n      animation._initted && !self.isReverted || animation.vars.immediateRender !== false && vars.immediateRender !== false && animation.duration() && animation.render(0, true, true); // special case: if this ScrollTrigger gets re-initted, a from() tween with a stagger could get initted initially and then reverted on the re-init which means it'll need to get rendered again here to properly display things. Otherwise, See https://gsap.com/forums/topic/36777-scrollsmoother-splittext-nextjs/ and https://codepen.io/GreenSock/pen/eYPyPpd?editors=0010\n\n      self.animation = animation.pause();\n      animation.scrollTrigger = self;\n      self.scrubDuration(scrub);\n      snap1 = 0;\n      id || (id = animation.vars.id);\n    }\n\n    if (snap) {\n      // TODO: potential idea: use legitimate CSS scroll snapping by pushing invisible elements into the DOM that serve as snap positions, and toggle the document.scrollingElement.style.scrollSnapType onToggle. See https://codepen.io/GreenSock/pen/JjLrgWM for a quick proof of concept.\n      if (!_isObject(snap) || snap.push) {\n        snap = {\n          snapTo: snap\n        };\n      }\n\n      \"scrollBehavior\" in _body.style && gsap.set(isViewport ? [_body, _docEl] : scroller, {\n        scrollBehavior: \"auto\"\n      }); // smooth scrolling doesn't work with snap.\n\n      _scrollers.forEach(function (o) {\n        return _isFunction(o) && o.target === (isViewport ? _doc.scrollingElement || _docEl : scroller) && (o.smooth = false);\n      }); // note: set smooth to false on both the vertical and horizontal scroll getters/setters\n\n\n      snapFunc = _isFunction(snap.snapTo) ? snap.snapTo : snap.snapTo === \"labels\" ? _getClosestLabel(animation) : snap.snapTo === \"labelsDirectional\" ? _getLabelAtDirection(animation) : snap.directional !== false ? function (value, st) {\n        return _snapDirectional(snap.snapTo)(value, _getTime() - lastRefresh < 500 ? 0 : st.direction);\n      } : gsap.utils.snap(snap.snapTo);\n      snapDurClamp = snap.duration || {\n        min: 0.1,\n        max: 2\n      };\n      snapDurClamp = _isObject(snapDurClamp) ? _clamp(snapDurClamp.min, snapDurClamp.max) : _clamp(snapDurClamp, snapDurClamp);\n      snapDelayedCall = gsap.delayedCall(snap.delay || scrubSmooth / 2 || 0.1, function () {\n        var scroll = scrollFunc(),\n            refreshedRecently = _getTime() - lastRefresh < 500,\n            tween = tweenTo.tween;\n\n        if ((refreshedRecently || Math.abs(self.getVelocity()) < 10) && !tween && !_pointerIsDown && lastSnap !== scroll) {\n          var progress = (scroll - start) / change,\n              totalProgress = animation && !isToggle ? animation.totalProgress() : progress,\n              velocity = refreshedRecently ? 0 : (totalProgress - snap2) / (_getTime() - _time2) * 1000 || 0,\n              change1 = gsap.utils.clamp(-progress, 1 - progress, _abs(velocity / 2) * velocity / 0.185),\n              naturalEnd = progress + (snap.inertia === false ? 0 : change1),\n              endValue,\n              endScroll,\n              _snap = snap,\n              onStart = _snap.onStart,\n              _onInterrupt = _snap.onInterrupt,\n              _onComplete = _snap.onComplete;\n          endValue = snapFunc(naturalEnd, self);\n          _isNumber(endValue) || (endValue = naturalEnd); // in case the function didn't return a number, fall back to using the naturalEnd\n\n          endScroll = Math.max(0, Math.round(start + endValue * change));\n\n          if (scroll <= end && scroll >= start && endScroll !== scroll) {\n            if (tween && !tween._initted && tween.data <= _abs(endScroll - scroll)) {\n              // there's an overlapping snap! So we must figure out which one is closer and let that tween live.\n              return;\n            }\n\n            if (snap.inertia === false) {\n              change1 = endValue - progress;\n            }\n\n            tweenTo(endScroll, {\n              duration: snapDurClamp(_abs(Math.max(_abs(naturalEnd - totalProgress), _abs(endValue - totalProgress)) * 0.185 / velocity / 0.05 || 0)),\n              ease: snap.ease || \"power3\",\n              data: _abs(endScroll - scroll),\n              // record the distance so that if another snap tween occurs (conflict) we can prioritize the closest snap.\n              onInterrupt: function onInterrupt() {\n                return snapDelayedCall.restart(true) && _onInterrupt && _onInterrupt(self);\n              },\n              onComplete: function onComplete() {\n                self.update();\n                lastSnap = scrollFunc();\n\n                if (animation && !isToggle) {\n                  // the resolution of the scrollbar is limited, so we should correct the scrubbed animation's playhead at the end to match EXACTLY where it was supposed to snap\n                  scrubTween ? scrubTween.resetTo(\"totalProgress\", endValue, animation._tTime / animation._tDur) : animation.progress(endValue);\n                }\n\n                snap1 = snap2 = animation && !isToggle ? animation.totalProgress() : self.progress;\n                onSnapComplete && onSnapComplete(self);\n                _onComplete && _onComplete(self);\n              }\n            }, scroll, change1 * change, endScroll - scroll - change1 * change);\n            onStart && onStart(self, tweenTo.tween);\n          }\n        } else if (self.isActive && lastSnap !== scroll) {\n          snapDelayedCall.restart(true);\n        }\n      }).pause();\n    }\n\n    id && (_ids[id] = self);\n    trigger = self.trigger = _getTarget(trigger || pin !== true && pin); // if a trigger has some kind of scroll-related effect applied that could contaminate the \"y\" or \"x\" position (like a ScrollSmoother effect), we needed a way to temporarily revert it, so we use the stRevert property of the gsCache. It can return another function that we'll call at the end so it can return to its normal state.\n\n    customRevertReturn = trigger && trigger._gsap && trigger._gsap.stRevert;\n    customRevertReturn && (customRevertReturn = customRevertReturn(self));\n    pin = pin === true ? trigger : _getTarget(pin);\n    _isString(toggleClass) && (toggleClass = {\n      targets: trigger,\n      className: toggleClass\n    });\n\n    if (pin) {\n      pinSpacing === false || pinSpacing === _margin || (pinSpacing = !pinSpacing && pin.parentNode && pin.parentNode.style && _getComputedStyle(pin.parentNode).display === \"flex\" ? false : _padding); // if the parent is display: flex, don't apply pinSpacing by default. We should check that pin.parentNode is an element (not shadow dom window)\n\n      self.pin = pin;\n      pinCache = gsap.core.getCache(pin);\n\n      if (!pinCache.spacer) {\n        // record the spacer and pinOriginalState on the cache in case someone tries pinning the same element with MULTIPLE ScrollTriggers - we don't want to have multiple spacers or record the \"original\" pin state after it has already been affected by another ScrollTrigger.\n        if (pinSpacer) {\n          pinSpacer = _getTarget(pinSpacer);\n          pinSpacer && !pinSpacer.nodeType && (pinSpacer = pinSpacer.current || pinSpacer.nativeElement); // for React & Angular\n\n          pinCache.spacerIsNative = !!pinSpacer;\n          pinSpacer && (pinCache.spacerState = _getState(pinSpacer));\n        }\n\n        pinCache.spacer = spacer = pinSpacer || _doc.createElement(\"div\");\n        spacer.classList.add(\"pin-spacer\");\n        id && spacer.classList.add(\"pin-spacer-\" + id);\n        pinCache.pinState = pinOriginalState = _getState(pin);\n      } else {\n        pinOriginalState = pinCache.pinState;\n      }\n\n      vars.force3D !== false && gsap.set(pin, {\n        force3D: true\n      });\n      self.spacer = spacer = pinCache.spacer;\n      cs = _getComputedStyle(pin);\n      spacingStart = cs[pinSpacing + direction.os2];\n      pinGetter = gsap.getProperty(pin);\n      pinSetter = gsap.quickSetter(pin, direction.a, _px); // pin.firstChild && !_maxScroll(pin, direction) && (pin.style.overflow = \"hidden\"); // protects from collapsing margins, but can have unintended consequences as demonstrated here: https://codepen.io/GreenSock/pen/1e42c7a73bfa409d2cf1e184e7a4248d so it was removed in favor of just telling people to set up their CSS to avoid the collapsing margins (overflow: hidden | auto is just one option. Another is border-top: 1px solid transparent).\n\n      _swapPinIn(pin, spacer, cs);\n\n      pinState = _getState(pin);\n    }\n\n    if (markers) {\n      markerVars = _isObject(markers) ? _setDefaults(markers, _markerDefaults) : _markerDefaults;\n      markerStartTrigger = _createMarker(\"scroller-start\", id, scroller, direction, markerVars, 0);\n      markerEndTrigger = _createMarker(\"scroller-end\", id, scroller, direction, markerVars, 0, markerStartTrigger);\n      offset = markerStartTrigger[\"offset\" + direction.op.d2];\n\n      var content = _getTarget(_getProxyProp(scroller, \"content\") || scroller);\n\n      markerStart = this.markerStart = _createMarker(\"start\", id, content, direction, markerVars, offset, 0, containerAnimation);\n      markerEnd = this.markerEnd = _createMarker(\"end\", id, content, direction, markerVars, offset, 0, containerAnimation);\n      containerAnimation && (caMarkerSetter = gsap.quickSetter([markerStart, markerEnd], direction.a, _px));\n\n      if (!useFixedPosition && !(_proxies.length && _getProxyProp(scroller, \"fixedMarkers\") === true)) {\n        _makePositionable(isViewport ? _body : scroller);\n\n        gsap.set([markerStartTrigger, markerEndTrigger], {\n          force3D: true\n        });\n        markerStartSetter = gsap.quickSetter(markerStartTrigger, direction.a, _px);\n        markerEndSetter = gsap.quickSetter(markerEndTrigger, direction.a, _px);\n      }\n    }\n\n    if (containerAnimation) {\n      var oldOnUpdate = containerAnimation.vars.onUpdate,\n          oldParams = containerAnimation.vars.onUpdateParams;\n      containerAnimation.eventCallback(\"onUpdate\", function () {\n        self.update(0, 0, 1);\n        oldOnUpdate && oldOnUpdate.apply(containerAnimation, oldParams || []);\n      });\n    }\n\n    self.previous = function () {\n      return _triggers[_triggers.indexOf(self) - 1];\n    };\n\n    self.next = function () {\n      return _triggers[_triggers.indexOf(self) + 1];\n    };\n\n    self.revert = function (revert, temp) {\n      if (!temp) {\n        return self.kill(true);\n      } // for compatibility with gsap.context() and gsap.matchMedia() which call revert()\n\n\n      var r = revert !== false || !self.enabled,\n          prevRefreshing = _refreshing;\n\n      if (r !== self.isReverted) {\n        if (r) {\n          prevScroll = Math.max(scrollFunc(), self.scroll.rec || 0); // record the scroll so we can revert later (repositioning/pinning things can affect scroll position). In the static refresh() method, we first record all the scroll positions as a reference.\n\n          prevProgress = self.progress;\n          prevAnimProgress = animation && animation.progress();\n        }\n\n        markerStart && [markerStart, markerEnd, markerStartTrigger, markerEndTrigger].forEach(function (m) {\n          return m.style.display = r ? \"none\" : \"block\";\n        });\n\n        if (r) {\n          _refreshing = self;\n          self.update(r); // make sure the pin is back in its original position so that all the measurements are correct. do this BEFORE swapping the pin out\n        }\n\n        if (pin && (!pinReparent || !self.isActive)) {\n          if (r) {\n            _swapPinOut(pin, spacer, pinOriginalState);\n          } else {\n            _swapPinIn(pin, spacer, _getComputedStyle(pin), spacerState);\n          }\n        }\n\n        r || self.update(r); // when we're restoring, the update should run AFTER swapping the pin into its pin-spacer.\n\n        _refreshing = prevRefreshing; // restore. We set it to true during the update() so that things fire properly in there.\n\n        self.isReverted = r;\n      }\n    };\n\n    self.refresh = function (soft, force, position, pinOffset) {\n      // position is typically only defined if it's coming from setPositions() - it's a way to skip the normal parsing. pinOffset is also only from setPositions() and is mostly related to fancy stuff we need to do in ScrollSmoother with effects\n      if ((_refreshing || !self.enabled) && !force) {\n        return;\n      }\n\n      if (pin && soft && _lastScrollTime) {\n        _addListener(ScrollTrigger, \"scrollEnd\", _softRefresh);\n\n        return;\n      }\n\n      !_refreshingAll && onRefreshInit && onRefreshInit(self);\n      _refreshing = self;\n\n      if (tweenTo.tween && !position) {\n        // we skip this if a position is passed in because typically that's from .setPositions() and it's best to allow in-progress snapping to continue.\n        tweenTo.tween.kill();\n        tweenTo.tween = 0;\n      }\n\n      scrubTween && scrubTween.pause();\n\n      if (invalidateOnRefresh && animation) {\n        animation.revert({\n          kill: false\n        }).invalidate();\n        animation.getChildren && animation.getChildren(true, true, false).forEach(function (t) {\n          return t.vars.immediateRender && t.render(0, true, true);\n        }); // any from() or fromTo() tweens inside a timeline should render immediately (well, unless they have immediateRender: false)\n      }\n\n      self.isReverted || self.revert(true, true);\n      self._subPinOffset = false; // we'll set this to true in the sub-pins if we find any\n\n      var size = getScrollerSize(),\n          scrollerBounds = getScrollerOffsets(),\n          max = containerAnimation ? containerAnimation.duration() : _maxScroll(scroller, direction),\n          isFirstRefresh = change <= 0.01 || !change,\n          offset = 0,\n          otherPinOffset = pinOffset || 0,\n          parsedEnd = _isObject(position) ? position.end : vars.end,\n          parsedEndTrigger = vars.endTrigger || trigger,\n          parsedStart = _isObject(position) ? position.start : vars.start || (vars.start === 0 || !trigger ? 0 : pin ? \"0 0\" : \"0 100%\"),\n          pinnedContainer = self.pinnedContainer = vars.pinnedContainer && _getTarget(vars.pinnedContainer, self),\n          triggerIndex = trigger && Math.max(0, _triggers.indexOf(self)) || 0,\n          i = triggerIndex,\n          cs,\n          bounds,\n          scroll,\n          isVertical,\n          override,\n          curTrigger,\n          curPin,\n          oppositeScroll,\n          initted,\n          revertedPins,\n          forcedOverflow,\n          markerStartOffset,\n          markerEndOffset;\n\n      if (markers && _isObject(position)) {\n        // if we alter the start/end positions with .setPositions(), it generally feeds in absolute NUMBERS which don't convey information about where to line up the markers, so to keep it intuitive, we record how far the trigger positions shift after applying the new numbers and then offset by that much in the opposite direction. We do the same to the associated trigger markers too of course.\n        markerStartOffset = gsap.getProperty(markerStartTrigger, direction.p);\n        markerEndOffset = gsap.getProperty(markerEndTrigger, direction.p);\n      }\n\n      while (i-- > 0) {\n        // user might try to pin the same element more than once, so we must find any prior triggers with the same pin, revert them, and determine how long they're pinning so that we can offset things appropriately. Make sure we revert from last to first so that things \"rewind\" properly.\n        curTrigger = _triggers[i];\n        curTrigger.end || curTrigger.refresh(0, 1) || (_refreshing = self); // if it's a timeline-based trigger that hasn't been fully initialized yet because it's waiting for 1 tick, just force the refresh() here, otherwise if it contains a pin that's supposed to affect other ScrollTriggers further down the page, they won't be adjusted properly.\n\n        curPin = curTrigger.pin;\n\n        if (curPin && (curPin === trigger || curPin === pin || curPin === pinnedContainer) && !curTrigger.isReverted) {\n          revertedPins || (revertedPins = []);\n          revertedPins.unshift(curTrigger); // we'll revert from first to last to make sure things reach their end state properly\n\n          curTrigger.revert(true, true);\n        }\n\n        if (curTrigger !== _triggers[i]) {\n          // in case it got removed.\n          triggerIndex--;\n          i--;\n        }\n      }\n\n      _isFunction(parsedStart) && (parsedStart = parsedStart(self));\n      parsedStart = _parseClamp(parsedStart, \"start\", self);\n      start = _parsePosition(parsedStart, trigger, size, direction, scrollFunc(), markerStart, markerStartTrigger, self, scrollerBounds, borderWidth, useFixedPosition, max, containerAnimation, self._startClamp && \"_startClamp\") || (pin ? -0.001 : 0);\n      _isFunction(parsedEnd) && (parsedEnd = parsedEnd(self));\n\n      if (_isString(parsedEnd) && !parsedEnd.indexOf(\"+=\")) {\n        if (~parsedEnd.indexOf(\" \")) {\n          parsedEnd = (_isString(parsedStart) ? parsedStart.split(\" \")[0] : \"\") + parsedEnd;\n        } else {\n          offset = _offsetToPx(parsedEnd.substr(2), size);\n          parsedEnd = _isString(parsedStart) ? parsedStart : (containerAnimation ? gsap.utils.mapRange(0, containerAnimation.duration(), containerAnimation.scrollTrigger.start, containerAnimation.scrollTrigger.end, start) : start) + offset; // _parsePosition won't factor in the offset if the start is a number, so do it here.\n\n          parsedEndTrigger = trigger;\n        }\n      }\n\n      parsedEnd = _parseClamp(parsedEnd, \"end\", self);\n      end = Math.max(start, _parsePosition(parsedEnd || (parsedEndTrigger ? \"100% 0\" : max), parsedEndTrigger, size, direction, scrollFunc() + offset, markerEnd, markerEndTrigger, self, scrollerBounds, borderWidth, useFixedPosition, max, containerAnimation, self._endClamp && \"_endClamp\")) || -0.001;\n      offset = 0;\n      i = triggerIndex;\n\n      while (i--) {\n        curTrigger = _triggers[i];\n        curPin = curTrigger.pin;\n\n        if (curPin && curTrigger.start - curTrigger._pinPush <= start && !containerAnimation && curTrigger.end > 0) {\n          cs = curTrigger.end - (self._startClamp ? Math.max(0, curTrigger.start) : curTrigger.start);\n\n          if ((curPin === trigger && curTrigger.start - curTrigger._pinPush < start || curPin === pinnedContainer) && isNaN(parsedStart)) {\n            // numeric start values shouldn't be offset at all - treat them as absolute\n            offset += cs * (1 - curTrigger.progress);\n          }\n\n          curPin === pin && (otherPinOffset += cs);\n        }\n      }\n\n      start += offset;\n      end += offset;\n      self._startClamp && (self._startClamp += offset);\n\n      if (self._endClamp && !_refreshingAll) {\n        self._endClamp = end || -0.001;\n        end = Math.min(end, _maxScroll(scroller, direction));\n      }\n\n      change = end - start || (start -= 0.01) && 0.001;\n\n      if (isFirstRefresh) {\n        // on the very first refresh(), the prevProgress couldn't have been accurate yet because the start/end were never calculated, so we set it here. Before 3.11.5, it could lead to an inaccurate scroll position restoration with snapping.\n        prevProgress = gsap.utils.clamp(0, 1, gsap.utils.normalize(start, end, prevScroll));\n      }\n\n      self._pinPush = otherPinOffset;\n\n      if (markerStart && offset) {\n        // offset the markers if necessary\n        cs = {};\n        cs[direction.a] = \"+=\" + offset;\n        pinnedContainer && (cs[direction.p] = \"-=\" + scrollFunc());\n        gsap.set([markerStart, markerEnd], cs);\n      }\n\n      if (pin && !(_clampingMax && self.end >= _maxScroll(scroller, direction))) {\n        cs = _getComputedStyle(pin);\n        isVertical = direction === _vertical;\n        scroll = scrollFunc(); // recalculate because the triggers can affect the scroll\n\n        pinStart = parseFloat(pinGetter(direction.a)) + otherPinOffset;\n\n        if (!max && end > 1) {\n          // makes sure the scroller has a scrollbar, otherwise if something has width: 100%, for example, it would be too big (exclude the scrollbar). See https://gsap.com/forums/topic/25182-scrolltrigger-width-of-page-increase-where-markers-are-set-to-false/\n          forcedOverflow = (isViewport ? _doc.scrollingElement || _docEl : scroller).style;\n          forcedOverflow = {\n            style: forcedOverflow,\n            value: forcedOverflow[\"overflow\" + direction.a.toUpperCase()]\n          };\n\n          if (isViewport && _getComputedStyle(_body)[\"overflow\" + direction.a.toUpperCase()] !== \"scroll\") {\n            // avoid an extra scrollbar if BOTH <html> and <body> have overflow set to \"scroll\"\n            forcedOverflow.style[\"overflow\" + direction.a.toUpperCase()] = \"scroll\";\n          }\n        }\n\n        _swapPinIn(pin, spacer, cs);\n\n        pinState = _getState(pin); // transforms will interfere with the top/left/right/bottom placement, so remove them temporarily. getBoundingClientRect() factors in transforms.\n\n        bounds = _getBounds(pin, true);\n        oppositeScroll = useFixedPosition && _getScrollFunc(scroller, isVertical ? _horizontal : _vertical)();\n\n        if (pinSpacing) {\n          spacerState = [pinSpacing + direction.os2, change + otherPinOffset + _px];\n          spacerState.t = spacer;\n          i = pinSpacing === _padding ? _getSize(pin, direction) + change + otherPinOffset : 0;\n\n          if (i) {\n            spacerState.push(direction.d, i + _px); // for box-sizing: border-box (must include padding).\n\n            spacer.style.flexBasis !== \"auto\" && (spacer.style.flexBasis = i + _px);\n          }\n\n          _setState(spacerState);\n\n          if (pinnedContainer) {\n            // in ScrollTrigger.refresh(), we need to re-evaluate the pinContainer's size because this pinSpacing may stretch it out, but we can't just add the exact distance because depending on layout, it may not push things down or it may only do so partially.\n            _triggers.forEach(function (t) {\n              if (t.pin === pinnedContainer && t.vars.pinSpacing !== false) {\n                t._subPinOffset = true;\n              }\n            });\n          }\n\n          useFixedPosition && scrollFunc(prevScroll);\n        } else {\n          i = _getSize(pin, direction);\n          i && spacer.style.flexBasis !== \"auto\" && (spacer.style.flexBasis = i + _px);\n        }\n\n        if (useFixedPosition) {\n          override = {\n            top: bounds.top + (isVertical ? scroll - start : oppositeScroll) + _px,\n            left: bounds.left + (isVertical ? oppositeScroll : scroll - start) + _px,\n            boxSizing: \"border-box\",\n            position: \"fixed\"\n          };\n          override[_width] = override[\"max\" + _Width] = Math.ceil(bounds.width) + _px;\n          override[_height] = override[\"max\" + _Height] = Math.ceil(bounds.height) + _px;\n          override[_margin] = override[_margin + _Top] = override[_margin + _Right] = override[_margin + _Bottom] = override[_margin + _Left] = \"0\";\n          override[_padding] = cs[_padding];\n          override[_padding + _Top] = cs[_padding + _Top];\n          override[_padding + _Right] = cs[_padding + _Right];\n          override[_padding + _Bottom] = cs[_padding + _Bottom];\n          override[_padding + _Left] = cs[_padding + _Left];\n          pinActiveState = _copyState(pinOriginalState, override, pinReparent);\n          _refreshingAll && scrollFunc(0);\n        }\n\n        if (animation) {\n          // the animation might be affecting the transform, so we must jump to the end, check the value, and compensate accordingly. Otherwise, when it becomes unpinned, the pinSetter() will get set to a value that doesn't include whatever the animation did.\n          initted = animation._initted; // if not, we must invalidate() after this step, otherwise it could lock in starting values prematurely.\n\n          _suppressOverwrites(1);\n\n          animation.render(animation.duration(), true, true);\n          pinChange = pinGetter(direction.a) - pinStart + change + otherPinOffset;\n          pinMoves = Math.abs(change - pinChange) > 1;\n          useFixedPosition && pinMoves && pinActiveState.splice(pinActiveState.length - 2, 2); // transform is the last property/value set in the state Array. Since the animation is controlling that, we should omit it.\n\n          animation.render(0, true, true);\n          initted || animation.invalidate(true);\n          animation.parent || animation.totalTime(animation.totalTime()); // if, for example, a toggleAction called play() and then refresh() happens and when we render(1) above, it would cause the animation to complete and get removed from its parent, so this makes sure it gets put back in.\n\n          _suppressOverwrites(0);\n        } else {\n          pinChange = change;\n        }\n\n        forcedOverflow && (forcedOverflow.value ? forcedOverflow.style[\"overflow\" + direction.a.toUpperCase()] = forcedOverflow.value : forcedOverflow.style.removeProperty(\"overflow-\" + direction.a));\n      } else if (trigger && scrollFunc() && !containerAnimation) {\n        // it may be INSIDE a pinned element, so walk up the tree and look for any elements with _pinOffset to compensate because anything with pinSpacing that's already scrolled would throw off the measurements in getBoundingClientRect()\n        bounds = trigger.parentNode;\n\n        while (bounds && bounds !== _body) {\n          if (bounds._pinOffset) {\n            start -= bounds._pinOffset;\n            end -= bounds._pinOffset;\n          }\n\n          bounds = bounds.parentNode;\n        }\n      }\n\n      revertedPins && revertedPins.forEach(function (t) {\n        return t.revert(false, true);\n      });\n      self.start = start;\n      self.end = end;\n      scroll1 = scroll2 = _refreshingAll ? prevScroll : scrollFunc(); // reset velocity\n\n      if (!containerAnimation && !_refreshingAll) {\n        scroll1 < prevScroll && scrollFunc(prevScroll);\n        self.scroll.rec = 0;\n      }\n\n      self.revert(false, true);\n      lastRefresh = _getTime();\n\n      if (snapDelayedCall) {\n        lastSnap = -1; // just so snapping gets re-enabled, clear out any recorded last value\n        // self.isActive && scrollFunc(start + change * prevProgress); // previously this line was here to ensure that when snapping kicks in, it's from the previous progress but in some cases that's not desirable, like an all-page ScrollTrigger when new content gets added to the page, that'd totally change the progress.\n\n        snapDelayedCall.restart(true);\n      }\n\n      _refreshing = 0;\n      animation && isToggle && (animation._initted || prevAnimProgress) && animation.progress() !== prevAnimProgress && animation.progress(prevAnimProgress || 0, true).render(animation.time(), true, true); // must force a re-render because if saveStyles() was used on the target(s), the styles could have been wiped out during the refresh().\n\n      if (isFirstRefresh || prevProgress !== self.progress || containerAnimation || invalidateOnRefresh || animation && !animation._initted) {\n        // ensures that the direction is set properly (when refreshing, progress is set back to 0 initially, then back again to wherever it needs to be) and that callbacks are triggered.\n        animation && !isToggle && (animation._initted || prevProgress || animation.vars.immediateRender !== false) && animation.totalProgress(containerAnimation && start < -0.001 && !prevProgress ? gsap.utils.normalize(start, end, 0) : prevProgress, true); // to avoid issues where animation callbacks like onStart aren't triggered.\n\n        self.progress = isFirstRefresh || (scroll1 - start) / change === prevProgress ? 0 : prevProgress;\n      }\n\n      pin && pinSpacing && (spacer._pinOffset = Math.round(self.progress * pinChange));\n      scrubTween && scrubTween.invalidate();\n\n      if (!isNaN(markerStartOffset)) {\n        // numbers were passed in for the position which are absolute, so instead of just putting the markers at the very bottom of the viewport, we figure out how far they shifted down (it's safe to assume they were originally positioned in closer relation to the trigger element with values like \"top\", \"center\", a percentage or whatever, so we offset that much in the opposite direction to basically revert them to the relative position thy were at previously.\n        markerStartOffset -= gsap.getProperty(markerStartTrigger, direction.p);\n        markerEndOffset -= gsap.getProperty(markerEndTrigger, direction.p);\n\n        _shiftMarker(markerStartTrigger, direction, markerStartOffset);\n\n        _shiftMarker(markerStart, direction, markerStartOffset - (pinOffset || 0));\n\n        _shiftMarker(markerEndTrigger, direction, markerEndOffset);\n\n        _shiftMarker(markerEnd, direction, markerEndOffset - (pinOffset || 0));\n      }\n\n      isFirstRefresh && !_refreshingAll && self.update(); // edge case - when you reload a page when it's already scrolled down, some browsers fire a \"scroll\" event before DOMContentLoaded, triggering an updateAll(). If we don't update the self.progress as part of refresh(), then when it happens next, it may record prevProgress as 0 when it really shouldn't, potentially causing a callback in an animation to fire again.\n\n      if (onRefresh && !_refreshingAll && !executingOnRefresh) {\n        // when refreshing all, we do extra work to correct pinnedContainer sizes and ensure things don't exceed the maxScroll, so we should do all the refreshes at the end after all that work so that the start/end values are corrected.\n        executingOnRefresh = true;\n        onRefresh(self);\n        executingOnRefresh = false;\n      }\n    };\n\n    self.getVelocity = function () {\n      return (scrollFunc() - scroll2) / (_getTime() - _time2) * 1000 || 0;\n    };\n\n    self.endAnimation = function () {\n      _endAnimation(self.callbackAnimation);\n\n      if (animation) {\n        scrubTween ? scrubTween.progress(1) : !animation.paused() ? _endAnimation(animation, animation.reversed()) : isToggle || _endAnimation(animation, self.direction < 0, 1);\n      }\n    };\n\n    self.labelToScroll = function (label) {\n      return animation && animation.labels && (start || self.refresh() || start) + animation.labels[label] / animation.duration() * change || 0;\n    };\n\n    self.getTrailing = function (name) {\n      var i = _triggers.indexOf(self),\n          a = self.direction > 0 ? _triggers.slice(0, i).reverse() : _triggers.slice(i + 1);\n\n      return (_isString(name) ? a.filter(function (t) {\n        return t.vars.preventOverlaps === name;\n      }) : a).filter(function (t) {\n        return self.direction > 0 ? t.end <= start : t.start >= end;\n      });\n    };\n\n    self.update = function (reset, recordVelocity, forceFake) {\n      if (containerAnimation && !forceFake && !reset) {\n        return;\n      }\n\n      var scroll = _refreshingAll === true ? prevScroll : self.scroll(),\n          p = reset ? 0 : (scroll - start) / change,\n          clipped = p < 0 ? 0 : p > 1 ? 1 : p || 0,\n          prevProgress = self.progress,\n          isActive,\n          wasActive,\n          toggleState,\n          action,\n          stateChanged,\n          toggled,\n          isAtMax,\n          isTakingAction;\n\n      if (recordVelocity) {\n        scroll2 = scroll1;\n        scroll1 = containerAnimation ? scrollFunc() : scroll;\n\n        if (snap) {\n          snap2 = snap1;\n          snap1 = animation && !isToggle ? animation.totalProgress() : clipped;\n        }\n      } // anticipate the pinning a few ticks ahead of time based on velocity to avoid a visual glitch due to the fact that most browsers do scrolling on a separate thread (not synced with requestAnimationFrame).\n\n\n      if (anticipatePin && pin && !_refreshing && !_startup && _lastScrollTime) {\n        if (!clipped && start < scroll + (scroll - scroll2) / (_getTime() - _time2) * anticipatePin) {\n          clipped = 0.0001;\n        } else if (clipped === 1 && end > scroll + (scroll - scroll2) / (_getTime() - _time2) * anticipatePin) {\n          clipped = 0.9999;\n        }\n      }\n\n      if (clipped !== prevProgress && self.enabled) {\n        isActive = self.isActive = !!clipped && clipped < 1;\n        wasActive = !!prevProgress && prevProgress < 1;\n        toggled = isActive !== wasActive;\n        stateChanged = toggled || !!clipped !== !!prevProgress; // could go from start all the way to end, thus it didn't toggle but it did change state in a sense (may need to fire a callback)\n\n        self.direction = clipped > prevProgress ? 1 : -1;\n        self.progress = clipped;\n\n        if (stateChanged && !_refreshing) {\n          toggleState = clipped && !prevProgress ? 0 : clipped === 1 ? 1 : prevProgress === 1 ? 2 : 3; // 0 = enter, 1 = leave, 2 = enterBack, 3 = leaveBack (we prioritize the FIRST encounter, thus if you scroll really fast past the onEnter and onLeave in one tick, it'd prioritize onEnter.\n\n          if (isToggle) {\n            action = !toggled && toggleActions[toggleState + 1] !== \"none\" && toggleActions[toggleState + 1] || toggleActions[toggleState]; // if it didn't toggle, that means it shot right past and since we prioritize the \"enter\" action, we should switch to the \"leave\" in this case (but only if one is defined)\n\n            isTakingAction = animation && (action === \"complete\" || action === \"reset\" || action in animation);\n          }\n        }\n\n        preventOverlaps && (toggled || isTakingAction) && (isTakingAction || scrub || !animation) && (_isFunction(preventOverlaps) ? preventOverlaps(self) : self.getTrailing(preventOverlaps).forEach(function (t) {\n          return t.endAnimation();\n        }));\n\n        if (!isToggle) {\n          if (scrubTween && !_refreshing && !_startup) {\n            scrubTween._dp._time - scrubTween._start !== scrubTween._time && scrubTween.render(scrubTween._dp._time - scrubTween._start); // if there's a scrub on both the container animation and this one (or a ScrollSmoother), the update order would cause this one not to have rendered yet, so it wouldn't make any progress before we .restart() it heading toward the new progress so it'd appear stuck thus we force a render here.\n\n            if (scrubTween.resetTo) {\n              scrubTween.resetTo(\"totalProgress\", clipped, animation._tTime / animation._tDur);\n            } else {\n              // legacy support (courtesy), before 3.10.0\n              scrubTween.vars.totalProgress = clipped;\n              scrubTween.invalidate().restart();\n            }\n          } else if (animation) {\n            animation.totalProgress(clipped, !!(_refreshing && (lastRefresh || reset)));\n          }\n        }\n\n        if (pin) {\n          reset && pinSpacing && (spacer.style[pinSpacing + direction.os2] = spacingStart);\n\n          if (!useFixedPosition) {\n            pinSetter(_round(pinStart + pinChange * clipped));\n          } else if (stateChanged) {\n            isAtMax = !reset && clipped > prevProgress && end + 1 > scroll && scroll + 1 >= _maxScroll(scroller, direction); // if it's at the VERY end of the page, don't switch away from position: fixed because it's pointless and it could cause a brief flash when the user scrolls back up (when it gets pinned again)\n\n            if (pinReparent) {\n              if (!reset && (isActive || isAtMax)) {\n                var bounds = _getBounds(pin, true),\n                    _offset = scroll - start;\n\n                _reparent(pin, _body, bounds.top + (direction === _vertical ? _offset : 0) + _px, bounds.left + (direction === _vertical ? 0 : _offset) + _px);\n              } else {\n                _reparent(pin, spacer);\n              }\n            }\n\n            _setState(isActive || isAtMax ? pinActiveState : pinState);\n\n            pinMoves && clipped < 1 && isActive || pinSetter(pinStart + (clipped === 1 && !isAtMax ? pinChange : 0));\n          }\n        }\n\n        snap && !tweenTo.tween && !_refreshing && !_startup && snapDelayedCall.restart(true);\n        toggleClass && (toggled || once && clipped && (clipped < 1 || !_limitCallbacks)) && _toArray(toggleClass.targets).forEach(function (el) {\n          return el.classList[isActive || once ? \"add\" : \"remove\"](toggleClass.className);\n        }); // classes could affect positioning, so do it even if reset or refreshing is true.\n\n        onUpdate && !isToggle && !reset && onUpdate(self);\n\n        if (stateChanged && !_refreshing) {\n          if (isToggle) {\n            if (isTakingAction) {\n              if (action === \"complete\") {\n                animation.pause().totalProgress(1);\n              } else if (action === \"reset\") {\n                animation.restart(true).pause();\n              } else if (action === \"restart\") {\n                animation.restart(true);\n              } else {\n                animation[action]();\n              }\n            }\n\n            onUpdate && onUpdate(self);\n          }\n\n          if (toggled || !_limitCallbacks) {\n            // on startup, the page could be scrolled and we don't want to fire callbacks that didn't toggle. For example onEnter shouldn't fire if the ScrollTrigger isn't actually entered.\n            onToggle && toggled && _callback(self, onToggle);\n            callbacks[toggleState] && _callback(self, callbacks[toggleState]);\n            once && (clipped === 1 ? self.kill(false, 1) : callbacks[toggleState] = 0); // a callback shouldn't be called again if once is true.\n\n            if (!toggled) {\n              // it's possible to go completely past, like from before the start to after the end (or vice-versa) in which case BOTH callbacks should be fired in that order\n              toggleState = clipped === 1 ? 1 : 3;\n              callbacks[toggleState] && _callback(self, callbacks[toggleState]);\n            }\n          }\n\n          if (fastScrollEnd && !isActive && Math.abs(self.getVelocity()) > (_isNumber(fastScrollEnd) ? fastScrollEnd : 2500)) {\n            _endAnimation(self.callbackAnimation);\n\n            scrubTween ? scrubTween.progress(1) : _endAnimation(animation, action === \"reverse\" ? 1 : !clipped, 1);\n          }\n        } else if (isToggle && onUpdate && !_refreshing) {\n          onUpdate(self);\n        }\n      } // update absolutely-positioned markers (only if the scroller isn't the viewport)\n\n\n      if (markerEndSetter) {\n        var n = containerAnimation ? scroll / containerAnimation.duration() * (containerAnimation._caScrollDist || 0) : scroll;\n        markerStartSetter(n + (markerStartTrigger._isFlipped ? 1 : 0));\n        markerEndSetter(n);\n      }\n\n      caMarkerSetter && caMarkerSetter(-scroll / containerAnimation.duration() * (containerAnimation._caScrollDist || 0));\n    };\n\n    self.enable = function (reset, refresh) {\n      if (!self.enabled) {\n        self.enabled = true;\n\n        _addListener(scroller, \"resize\", _onResize);\n\n        isViewport || _addListener(scroller, \"scroll\", _onScroll);\n        onRefreshInit && _addListener(ScrollTrigger, \"refreshInit\", onRefreshInit);\n\n        if (reset !== false) {\n          self.progress = prevProgress = 0;\n          scroll1 = scroll2 = lastSnap = scrollFunc();\n        }\n\n        refresh !== false && self.refresh();\n      }\n    };\n\n    self.getTween = function (snap) {\n      return snap && tweenTo ? tweenTo.tween : scrubTween;\n    };\n\n    self.setPositions = function (newStart, newEnd, keepClamp, pinOffset) {\n      // doesn't persist after refresh()! Intended to be a way to override values that were set during refresh(), like you could set it in onRefresh()\n      if (containerAnimation) {\n        // convert ratios into scroll positions. Remember, start/end values on ScrollTriggers that have a containerAnimation refer to the time (in seconds), NOT scroll positions.\n        var st = containerAnimation.scrollTrigger,\n            duration = containerAnimation.duration(),\n            _change = st.end - st.start;\n\n        newStart = st.start + _change * newStart / duration;\n        newEnd = st.start + _change * newEnd / duration;\n      }\n\n      self.refresh(false, false, {\n        start: _keepClamp(newStart, keepClamp && !!self._startClamp),\n        end: _keepClamp(newEnd, keepClamp && !!self._endClamp)\n      }, pinOffset);\n      self.update();\n    };\n\n    self.adjustPinSpacing = function (amount) {\n      if (spacerState && amount) {\n        var i = spacerState.indexOf(direction.d) + 1;\n        spacerState[i] = parseFloat(spacerState[i]) + amount + _px;\n        spacerState[1] = parseFloat(spacerState[1]) + amount + _px;\n\n        _setState(spacerState);\n      }\n    };\n\n    self.disable = function (reset, allowAnimation) {\n      if (self.enabled) {\n        reset !== false && self.revert(true, true);\n        self.enabled = self.isActive = false;\n        allowAnimation || scrubTween && scrubTween.pause();\n        prevScroll = 0;\n        pinCache && (pinCache.uncache = 1);\n        onRefreshInit && _removeListener(ScrollTrigger, \"refreshInit\", onRefreshInit);\n\n        if (snapDelayedCall) {\n          snapDelayedCall.pause();\n          tweenTo.tween && tweenTo.tween.kill() && (tweenTo.tween = 0);\n        }\n\n        if (!isViewport) {\n          var i = _triggers.length;\n\n          while (i--) {\n            if (_triggers[i].scroller === scroller && _triggers[i] !== self) {\n              return; //don't remove the listeners if there are still other triggers referencing it.\n            }\n          }\n\n          _removeListener(scroller, \"resize\", _onResize);\n\n          isViewport || _removeListener(scroller, \"scroll\", _onScroll);\n        }\n      }\n    };\n\n    self.kill = function (revert, allowAnimation) {\n      self.disable(revert, allowAnimation);\n      scrubTween && !allowAnimation && scrubTween.kill();\n      id && delete _ids[id];\n\n      var i = _triggers.indexOf(self);\n\n      i >= 0 && _triggers.splice(i, 1);\n      i === _i && _direction > 0 && _i--; // if we're in the middle of a refresh() or update(), splicing would cause skips in the index, so adjust...\n      // if no other ScrollTrigger instances of the same scroller are found, wipe out any recorded scroll position. Otherwise, in a single page application, for example, it could maintain scroll position when it really shouldn't.\n\n      i = 0;\n\n      _triggers.forEach(function (t) {\n        return t.scroller === self.scroller && (i = 1);\n      });\n\n      i || _refreshingAll || (self.scroll.rec = 0);\n\n      if (animation) {\n        animation.scrollTrigger = null;\n        revert && animation.revert({\n          kill: false\n        });\n        allowAnimation || animation.kill();\n      }\n\n      markerStart && [markerStart, markerEnd, markerStartTrigger, markerEndTrigger].forEach(function (m) {\n        return m.parentNode && m.parentNode.removeChild(m);\n      });\n      _primary === self && (_primary = 0);\n\n      if (pin) {\n        pinCache && (pinCache.uncache = 1);\n        i = 0;\n\n        _triggers.forEach(function (t) {\n          return t.pin === pin && i++;\n        });\n\n        i || (pinCache.spacer = 0); // if there aren't any more ScrollTriggers with the same pin, remove the spacer, otherwise it could be contaminated with old/stale values if the user re-creates a ScrollTrigger for the same element.\n      }\n\n      vars.onKill && vars.onKill(self);\n    };\n\n    _triggers.push(self);\n\n    self.enable(false, false);\n    customRevertReturn && customRevertReturn(self);\n\n    if (animation && animation.add && !change) {\n      // if the animation is a timeline, it may not have been populated yet, so it wouldn't render at the proper place on the first refresh(), thus we should schedule one for the next tick. If \"change\" is defined, we know it must be re-enabling, thus we can refresh() right away.\n      var updateFunc = self.update; // some browsers may fire a scroll event BEFORE a tick elapses and/or the DOMContentLoaded fires. So there's a chance update() will be called BEFORE a refresh() has happened on a Timeline-attached ScrollTrigger which means the start/end won't be calculated yet. We don't want to add conditional logic inside the update() method (like check to see if end is defined and if not, force a refresh()) because that's a function that gets hit a LOT (performance). So we swap out the real update() method for this one that'll re-attach it the first time it gets called and of course forces a refresh().\n\n      self.update = function () {\n        self.update = updateFunc;\n        _scrollers.cache++; // otherwise a cached scroll position may get used in the refresh() in a very rare scenario, like if ScrollTriggers are created inside a DOMContentLoaded event and the queued requestAnimationFrame() fires beforehand. See https://gsap.com/community/forums/topic/41267-scrolltrigger-breaks-on-refresh-when-using-domcontentloaded/\n\n        start || end || self.refresh();\n      };\n\n      gsap.delayedCall(0.01, self.update);\n      change = 0.01;\n      start = end = 0;\n    } else {\n      self.refresh();\n    }\n\n    pin && _queueRefreshAll(); // pinning could affect the positions of other things, so make sure we queue a full refresh()\n  };\n\n  ScrollTrigger.register = function register(core) {\n    if (!_coreInitted) {\n      gsap = core || _getGSAP();\n      _windowExists() && window.document && ScrollTrigger.enable();\n      _coreInitted = _enabled;\n    }\n\n    return _coreInitted;\n  };\n\n  ScrollTrigger.defaults = function defaults(config) {\n    if (config) {\n      for (var p in config) {\n        _defaults[p] = config[p];\n      }\n    }\n\n    return _defaults;\n  };\n\n  ScrollTrigger.disable = function disable(reset, kill) {\n    _enabled = 0;\n\n    _triggers.forEach(function (trigger) {\n      return trigger[kill ? \"kill\" : \"disable\"](reset);\n    });\n\n    _removeListener(_win, \"wheel\", _onScroll);\n\n    _removeListener(_doc, \"scroll\", _onScroll);\n\n    clearInterval(_syncInterval);\n\n    _removeListener(_doc, \"touchcancel\", _passThrough);\n\n    _removeListener(_body, \"touchstart\", _passThrough);\n\n    _multiListener(_removeListener, _doc, \"pointerdown,touchstart,mousedown\", _pointerDownHandler);\n\n    _multiListener(_removeListener, _doc, \"pointerup,touchend,mouseup\", _pointerUpHandler);\n\n    _resizeDelay.kill();\n\n    _iterateAutoRefresh(_removeListener);\n\n    for (var i = 0; i < _scrollers.length; i += 3) {\n      _wheelListener(_removeListener, _scrollers[i], _scrollers[i + 1]);\n\n      _wheelListener(_removeListener, _scrollers[i], _scrollers[i + 2]);\n    }\n  };\n\n  ScrollTrigger.enable = function enable() {\n    _win = window;\n    _doc = document;\n    _docEl = _doc.documentElement;\n    _body = _doc.body;\n\n    if (gsap) {\n      _toArray = gsap.utils.toArray;\n      _clamp = gsap.utils.clamp;\n      _context = gsap.core.context || _passThrough;\n      _suppressOverwrites = gsap.core.suppressOverwrites || _passThrough;\n      _scrollRestoration = _win.history.scrollRestoration || \"auto\";\n      _lastScroll = _win.pageYOffset || 0;\n      gsap.core.globals(\"ScrollTrigger\", ScrollTrigger); // must register the global manually because in Internet Explorer, functions (classes) don't have a \"name\" property.\n\n      if (_body) {\n        _enabled = 1;\n        _div100vh = document.createElement(\"div\"); // to solve mobile browser address bar show/hide resizing, we shouldn't rely on window.innerHeight. Instead, use a <div> with its height set to 100vh and measure that since that's what the scrolling is based on anyway and it's not affected by address bar showing/hiding.\n\n        _div100vh.style.height = \"100vh\";\n        _div100vh.style.position = \"absolute\";\n\n        _refresh100vh();\n\n        _rafBugFix();\n\n        Observer.register(gsap); // isTouch is 0 if no touch, 1 if ONLY touch, and 2 if it can accommodate touch but also other types like mouse/pointer.\n\n        ScrollTrigger.isTouch = Observer.isTouch;\n        _fixIOSBug = Observer.isTouch && /(iPad|iPhone|iPod|Mac)/g.test(navigator.userAgent); // since 2017, iOS has had a bug that causes event.clientX/Y to be inaccurate when a scroll occurs, thus we must alternate ignoring every other touchmove event to work around it. See https://bugs.webkit.org/show_bug.cgi?id=181954 and https://codepen.io/GreenSock/pen/ExbrPNa/087cef197dc35445a0951e8935c41503\n\n        _ignoreMobileResize = Observer.isTouch === 1;\n\n        _addListener(_win, \"wheel\", _onScroll); // mostly for 3rd party smooth scrolling libraries.\n\n\n        _root = [_win, _doc, _docEl, _body];\n\n        if (gsap.matchMedia) {\n          ScrollTrigger.matchMedia = function (vars) {\n            var mm = gsap.matchMedia(),\n                p;\n\n            for (p in vars) {\n              mm.add(p, vars[p]);\n            }\n\n            return mm;\n          };\n\n          gsap.addEventListener(\"matchMediaInit\", function () {\n            return _revertAll();\n          });\n          gsap.addEventListener(\"matchMediaRevert\", function () {\n            return _revertRecorded();\n          });\n          gsap.addEventListener(\"matchMedia\", function () {\n            _refreshAll(0, 1);\n\n            _dispatch(\"matchMedia\");\n          });\n          gsap.matchMedia().add(\"(orientation: portrait)\", function () {\n            // when orientation changes, we should take new base measurements for the ignoreMobileResize feature.\n            _setBaseDimensions();\n\n            return _setBaseDimensions;\n          });\n        } else {\n          console.warn(\"Requires GSAP 3.11.0 or later\");\n        }\n\n        _setBaseDimensions();\n\n        _addListener(_doc, \"scroll\", _onScroll); // some browsers (like Chrome), the window stops dispatching scroll events on the window if you scroll really fast, but it's consistent on the document!\n\n\n        var bodyHasStyle = _body.hasAttribute(\"style\"),\n            bodyStyle = _body.style,\n            border = bodyStyle.borderTopStyle,\n            AnimationProto = gsap.core.Animation.prototype,\n            bounds,\n            i;\n\n        AnimationProto.revert || Object.defineProperty(AnimationProto, \"revert\", {\n          value: function value() {\n            return this.time(-0.01, true);\n          }\n        }); // only for backwards compatibility (Animation.revert() was added after 3.10.4)\n\n        bodyStyle.borderTopStyle = \"solid\"; // works around an issue where a margin of a child element could throw off the bounds of the _body, making it seem like there's a margin when there actually isn't. The border ensures that the bounds are accurate.\n\n        bounds = _getBounds(_body);\n        _vertical.m = Math.round(bounds.top + _vertical.sc()) || 0; // accommodate the offset of the <body> caused by margins and/or padding\n\n        _horizontal.m = Math.round(bounds.left + _horizontal.sc()) || 0;\n        border ? bodyStyle.borderTopStyle = border : bodyStyle.removeProperty(\"border-top-style\");\n\n        if (!bodyHasStyle) {\n          // SSR frameworks like Next.js complain if this attribute gets added.\n          _body.setAttribute(\"style\", \"\"); // it's not enough to just removeAttribute() - we must first set it to empty, otherwise Next.js complains.\n\n\n          _body.removeAttribute(\"style\");\n        } // TODO: (?) maybe move to leveraging the velocity mechanism in Observer and skip intervals.\n\n\n        _syncInterval = setInterval(_sync, 250);\n        gsap.delayedCall(0.5, function () {\n          return _startup = 0;\n        });\n\n        _addListener(_doc, \"touchcancel\", _passThrough); // some older Android devices intermittently stop dispatching \"touchmove\" events if we don't listen for \"touchcancel\" on the document.\n\n\n        _addListener(_body, \"touchstart\", _passThrough); //works around Safari bug: https://gsap.com/forums/topic/21450-draggable-in-iframe-on-mobile-is-buggy/\n\n\n        _multiListener(_addListener, _doc, \"pointerdown,touchstart,mousedown\", _pointerDownHandler);\n\n        _multiListener(_addListener, _doc, \"pointerup,touchend,mouseup\", _pointerUpHandler);\n\n        _transformProp = gsap.utils.checkPrefix(\"transform\");\n\n        _stateProps.push(_transformProp);\n\n        _coreInitted = _getTime();\n        _resizeDelay = gsap.delayedCall(0.2, _refreshAll).pause();\n        _autoRefresh = [_doc, \"visibilitychange\", function () {\n          var w = _win.innerWidth,\n              h = _win.innerHeight;\n\n          if (_doc.hidden) {\n            _prevWidth = w;\n            _prevHeight = h;\n          } else if (_prevWidth !== w || _prevHeight !== h) {\n            _onResize();\n          }\n        }, _doc, \"DOMContentLoaded\", _refreshAll, _win, \"load\", _refreshAll, _win, \"resize\", _onResize];\n\n        _iterateAutoRefresh(_addListener);\n\n        _triggers.forEach(function (trigger) {\n          return trigger.enable(0, 1);\n        });\n\n        for (i = 0; i < _scrollers.length; i += 3) {\n          _wheelListener(_removeListener, _scrollers[i], _scrollers[i + 1]);\n\n          _wheelListener(_removeListener, _scrollers[i], _scrollers[i + 2]);\n        }\n      }\n    }\n  };\n\n  ScrollTrigger.config = function config(vars) {\n    \"limitCallbacks\" in vars && (_limitCallbacks = !!vars.limitCallbacks);\n    var ms = vars.syncInterval;\n    ms && clearInterval(_syncInterval) || (_syncInterval = ms) && setInterval(_sync, ms);\n    \"ignoreMobileResize\" in vars && (_ignoreMobileResize = ScrollTrigger.isTouch === 1 && vars.ignoreMobileResize);\n\n    if (\"autoRefreshEvents\" in vars) {\n      _iterateAutoRefresh(_removeListener) || _iterateAutoRefresh(_addListener, vars.autoRefreshEvents || \"none\");\n      _ignoreResize = (vars.autoRefreshEvents + \"\").indexOf(\"resize\") === -1;\n    }\n  };\n\n  ScrollTrigger.scrollerProxy = function scrollerProxy(target, vars) {\n    var t = _getTarget(target),\n        i = _scrollers.indexOf(t),\n        isViewport = _isViewport(t);\n\n    if (~i) {\n      _scrollers.splice(i, isViewport ? 6 : 2);\n    }\n\n    if (vars) {\n      isViewport ? _proxies.unshift(_win, vars, _body, vars, _docEl, vars) : _proxies.unshift(t, vars);\n    }\n  };\n\n  ScrollTrigger.clearMatchMedia = function clearMatchMedia(query) {\n    _triggers.forEach(function (t) {\n      return t._ctx && t._ctx.query === query && t._ctx.kill(true, true);\n    });\n  };\n\n  ScrollTrigger.isInViewport = function isInViewport(element, ratio, horizontal) {\n    var bounds = (_isString(element) ? _getTarget(element) : element).getBoundingClientRect(),\n        offset = bounds[horizontal ? _width : _height] * ratio || 0;\n    return horizontal ? bounds.right - offset > 0 && bounds.left + offset < _win.innerWidth : bounds.bottom - offset > 0 && bounds.top + offset < _win.innerHeight;\n  };\n\n  ScrollTrigger.positionInViewport = function positionInViewport(element, referencePoint, horizontal) {\n    _isString(element) && (element = _getTarget(element));\n    var bounds = element.getBoundingClientRect(),\n        size = bounds[horizontal ? _width : _height],\n        offset = referencePoint == null ? size / 2 : referencePoint in _keywords ? _keywords[referencePoint] * size : ~referencePoint.indexOf(\"%\") ? parseFloat(referencePoint) * size / 100 : parseFloat(referencePoint) || 0;\n    return horizontal ? (bounds.left + offset) / _win.innerWidth : (bounds.top + offset) / _win.innerHeight;\n  };\n\n  ScrollTrigger.killAll = function killAll(allowListeners) {\n    _triggers.slice(0).forEach(function (t) {\n      return t.vars.id !== \"ScrollSmoother\" && t.kill();\n    });\n\n    if (allowListeners !== true) {\n      var listeners = _listeners.killAll || [];\n      _listeners = {};\n      listeners.forEach(function (f) {\n        return f();\n      });\n    }\n  };\n\n  return ScrollTrigger;\n}();\nScrollTrigger.version = \"3.13.0\";\n\nScrollTrigger.saveStyles = function (targets) {\n  return targets ? _toArray(targets).forEach(function (target) {\n    // saved styles are recorded in a consecutive alternating Array, like [element, cssText, transform attribute, cache, matchMedia, ...]\n    if (target && target.style) {\n      var i = _savedStyles.indexOf(target);\n\n      i >= 0 && _savedStyles.splice(i, 5);\n\n      _savedStyles.push(target, target.style.cssText, target.getBBox && target.getAttribute(\"transform\"), gsap.core.getCache(target), _context());\n    }\n  }) : _savedStyles;\n};\n\nScrollTrigger.revert = function (soft, media) {\n  return _revertAll(!soft, media);\n};\n\nScrollTrigger.create = function (vars, animation) {\n  return new ScrollTrigger(vars, animation);\n};\n\nScrollTrigger.refresh = function (safe) {\n  return safe ? _onResize(true) : (_coreInitted || ScrollTrigger.register()) && _refreshAll(true);\n};\n\nScrollTrigger.update = function (force) {\n  return ++_scrollers.cache && _updateAll(force === true ? 2 : 0);\n};\n\nScrollTrigger.clearScrollMemory = _clearScrollMemory;\n\nScrollTrigger.maxScroll = function (element, horizontal) {\n  return _maxScroll(element, horizontal ? _horizontal : _vertical);\n};\n\nScrollTrigger.getScrollFunc = function (element, horizontal) {\n  return _getScrollFunc(_getTarget(element), horizontal ? _horizontal : _vertical);\n};\n\nScrollTrigger.getById = function (id) {\n  return _ids[id];\n};\n\nScrollTrigger.getAll = function () {\n  return _triggers.filter(function (t) {\n    return t.vars.id !== \"ScrollSmoother\";\n  });\n}; // it's common for people to ScrollTrigger.getAll(t => t.kill()) on page routes, for example, and we don't want it to ruin smooth scrolling by killing the main ScrollSmoother one.\n\n\nScrollTrigger.isScrolling = function () {\n  return !!_lastScrollTime;\n};\n\nScrollTrigger.snapDirectional = _snapDirectional;\n\nScrollTrigger.addEventListener = function (type, callback) {\n  var a = _listeners[type] || (_listeners[type] = []);\n  ~a.indexOf(callback) || a.push(callback);\n};\n\nScrollTrigger.removeEventListener = function (type, callback) {\n  var a = _listeners[type],\n      i = a && a.indexOf(callback);\n  i >= 0 && a.splice(i, 1);\n};\n\nScrollTrigger.batch = function (targets, vars) {\n  var result = [],\n      varsCopy = {},\n      interval = vars.interval || 0.016,\n      batchMax = vars.batchMax || 1e9,\n      proxyCallback = function proxyCallback(type, callback) {\n    var elements = [],\n        triggers = [],\n        delay = gsap.delayedCall(interval, function () {\n      callback(elements, triggers);\n      elements = [];\n      triggers = [];\n    }).pause();\n    return function (self) {\n      elements.length || delay.restart(true);\n      elements.push(self.trigger);\n      triggers.push(self);\n      batchMax <= elements.length && delay.progress(1);\n    };\n  },\n      p;\n\n  for (p in vars) {\n    varsCopy[p] = p.substr(0, 2) === \"on\" && _isFunction(vars[p]) && p !== \"onRefreshInit\" ? proxyCallback(p, vars[p]) : vars[p];\n  }\n\n  if (_isFunction(batchMax)) {\n    batchMax = batchMax();\n\n    _addListener(ScrollTrigger, \"refresh\", function () {\n      return batchMax = vars.batchMax();\n    });\n  }\n\n  _toArray(targets).forEach(function (target) {\n    var config = {};\n\n    for (p in varsCopy) {\n      config[p] = varsCopy[p];\n    }\n\n    config.trigger = target;\n    result.push(ScrollTrigger.create(config));\n  });\n\n  return result;\n}; // to reduce file size. clamps the scroll and also returns a duration multiplier so that if the scroll gets chopped shorter, the duration gets curtailed as well (otherwise if you're very close to the top of the page, for example, and swipe up really fast, it'll suddenly slow down and take a long time to reach the top).\n\n\nvar _clampScrollAndGetDurationMultiplier = function _clampScrollAndGetDurationMultiplier(scrollFunc, current, end, max) {\n  current > max ? scrollFunc(max) : current < 0 && scrollFunc(0);\n  return end > max ? (max - current) / (end - current) : end < 0 ? current / (current - end) : 1;\n},\n    _allowNativePanning = function _allowNativePanning(target, direction) {\n  if (direction === true) {\n    target.style.removeProperty(\"touch-action\");\n  } else {\n    target.style.touchAction = direction === true ? \"auto\" : direction ? \"pan-\" + direction + (Observer.isTouch ? \" pinch-zoom\" : \"\") : \"none\"; // note: Firefox doesn't support it pinch-zoom properly, at least in addition to a pan-x or pan-y.\n  }\n\n  target === _docEl && _allowNativePanning(_body, direction);\n},\n    _overflow = {\n  auto: 1,\n  scroll: 1\n},\n    _nestedScroll = function _nestedScroll(_ref5) {\n  var event = _ref5.event,\n      target = _ref5.target,\n      axis = _ref5.axis;\n\n  var node = (event.changedTouches ? event.changedTouches[0] : event).target,\n      cache = node._gsap || gsap.core.getCache(node),\n      time = _getTime(),\n      cs;\n\n  if (!cache._isScrollT || time - cache._isScrollT > 2000) {\n    // cache for 2 seconds to improve performance.\n    while (node && node !== _body && (node.scrollHeight <= node.clientHeight && node.scrollWidth <= node.clientWidth || !(_overflow[(cs = _getComputedStyle(node)).overflowY] || _overflow[cs.overflowX]))) {\n      node = node.parentNode;\n    }\n\n    cache._isScroll = node && node !== target && !_isViewport(node) && (_overflow[(cs = _getComputedStyle(node)).overflowY] || _overflow[cs.overflowX]);\n    cache._isScrollT = time;\n  }\n\n  if (cache._isScroll || axis === \"x\") {\n    event.stopPropagation();\n    event._gsapAllow = true;\n  }\n},\n    // capture events on scrollable elements INSIDE the <body> and allow those by calling stopPropagation() when we find a scrollable ancestor\n_inputObserver = function _inputObserver(target, type, inputs, nested) {\n  return Observer.create({\n    target: target,\n    capture: true,\n    debounce: false,\n    lockAxis: true,\n    type: type,\n    onWheel: nested = nested && _nestedScroll,\n    onPress: nested,\n    onDrag: nested,\n    onScroll: nested,\n    onEnable: function onEnable() {\n      return inputs && _addListener(_doc, Observer.eventTypes[0], _captureInputs, false, true);\n    },\n    onDisable: function onDisable() {\n      return _removeListener(_doc, Observer.eventTypes[0], _captureInputs, true);\n    }\n  });\n},\n    _inputExp = /(input|label|select|textarea)/i,\n    _inputIsFocused,\n    _captureInputs = function _captureInputs(e) {\n  var isInput = _inputExp.test(e.target.tagName);\n\n  if (isInput || _inputIsFocused) {\n    e._gsapAllow = true;\n    _inputIsFocused = isInput;\n  }\n},\n    _getScrollNormalizer = function _getScrollNormalizer(vars) {\n  _isObject(vars) || (vars = {});\n  vars.preventDefault = vars.isNormalizer = vars.allowClicks = true;\n  vars.type || (vars.type = \"wheel,touch\");\n  vars.debounce = !!vars.debounce;\n  vars.id = vars.id || \"normalizer\";\n\n  var _vars2 = vars,\n      normalizeScrollX = _vars2.normalizeScrollX,\n      momentum = _vars2.momentum,\n      allowNestedScroll = _vars2.allowNestedScroll,\n      onRelease = _vars2.onRelease,\n      self,\n      maxY,\n      target = _getTarget(vars.target) || _docEl,\n      smoother = gsap.core.globals().ScrollSmoother,\n      smootherInstance = smoother && smoother.get(),\n      content = _fixIOSBug && (vars.content && _getTarget(vars.content) || smootherInstance && vars.content !== false && !smootherInstance.smooth() && smootherInstance.content()),\n      scrollFuncY = _getScrollFunc(target, _vertical),\n      scrollFuncX = _getScrollFunc(target, _horizontal),\n      scale = 1,\n      initialScale = (Observer.isTouch && _win.visualViewport ? _win.visualViewport.scale * _win.visualViewport.width : _win.outerWidth) / _win.innerWidth,\n      wheelRefresh = 0,\n      resolveMomentumDuration = _isFunction(momentum) ? function () {\n    return momentum(self);\n  } : function () {\n    return momentum || 2.8;\n  },\n      lastRefreshID,\n      skipTouchMove,\n      inputObserver = _inputObserver(target, vars.type, true, allowNestedScroll),\n      resumeTouchMove = function resumeTouchMove() {\n    return skipTouchMove = false;\n  },\n      scrollClampX = _passThrough,\n      scrollClampY = _passThrough,\n      updateClamps = function updateClamps() {\n    maxY = _maxScroll(target, _vertical);\n    scrollClampY = _clamp(_fixIOSBug ? 1 : 0, maxY);\n    normalizeScrollX && (scrollClampX = _clamp(0, _maxScroll(target, _horizontal)));\n    lastRefreshID = _refreshID;\n  },\n      removeContentOffset = function removeContentOffset() {\n    content._gsap.y = _round(parseFloat(content._gsap.y) + scrollFuncY.offset) + \"px\";\n    content.style.transform = \"matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, \" + parseFloat(content._gsap.y) + \", 0, 1)\";\n    scrollFuncY.offset = scrollFuncY.cacheID = 0;\n  },\n      ignoreDrag = function ignoreDrag() {\n    if (skipTouchMove) {\n      requestAnimationFrame(resumeTouchMove);\n\n      var offset = _round(self.deltaY / 2),\n          scroll = scrollClampY(scrollFuncY.v - offset);\n\n      if (content && scroll !== scrollFuncY.v + scrollFuncY.offset) {\n        scrollFuncY.offset = scroll - scrollFuncY.v;\n\n        var y = _round((parseFloat(content && content._gsap.y) || 0) - scrollFuncY.offset);\n\n        content.style.transform = \"matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, \" + y + \", 0, 1)\";\n        content._gsap.y = y + \"px\";\n        scrollFuncY.cacheID = _scrollers.cache;\n\n        _updateAll();\n      }\n\n      return true;\n    }\n\n    scrollFuncY.offset && removeContentOffset();\n    skipTouchMove = true;\n  },\n      tween,\n      startScrollX,\n      startScrollY,\n      onStopDelayedCall,\n      onResize = function onResize() {\n    // if the window resizes, like on an iPhone which Apple FORCES the address bar to show/hide even if we event.preventDefault(), it may be scrolling too far now that the address bar is showing, so we must dynamically adjust the momentum tween.\n    updateClamps();\n\n    if (tween.isActive() && tween.vars.scrollY > maxY) {\n      scrollFuncY() > maxY ? tween.progress(1) && scrollFuncY(maxY) : tween.resetTo(\"scrollY\", maxY);\n    }\n  };\n\n  content && gsap.set(content, {\n    y: \"+=0\"\n  }); // to ensure there's a cache (element._gsap)\n\n  vars.ignoreCheck = function (e) {\n    return _fixIOSBug && e.type === \"touchmove\" && ignoreDrag(e) || scale > 1.05 && e.type !== \"touchstart\" || self.isGesturing || e.touches && e.touches.length > 1;\n  };\n\n  vars.onPress = function () {\n    skipTouchMove = false;\n    var prevScale = scale;\n    scale = _round((_win.visualViewport && _win.visualViewport.scale || 1) / initialScale);\n    tween.pause();\n    prevScale !== scale && _allowNativePanning(target, scale > 1.01 ? true : normalizeScrollX ? false : \"x\");\n    startScrollX = scrollFuncX();\n    startScrollY = scrollFuncY();\n    updateClamps();\n    lastRefreshID = _refreshID;\n  };\n\n  vars.onRelease = vars.onGestureStart = function (self, wasDragging) {\n    scrollFuncY.offset && removeContentOffset();\n\n    if (!wasDragging) {\n      onStopDelayedCall.restart(true);\n    } else {\n      _scrollers.cache++; // make sure we're pulling the non-cached value\n      // alternate algorithm: durX = Math.min(6, Math.abs(self.velocityX / 800)),\tdur = Math.max(durX, Math.min(6, Math.abs(self.velocityY / 800))); dur = dur * (0.4 + (1 - _power4In(dur / 6)) * 0.6)) * (momentumSpeed || 1)\n\n      var dur = resolveMomentumDuration(),\n          currentScroll,\n          endScroll;\n\n      if (normalizeScrollX) {\n        currentScroll = scrollFuncX();\n        endScroll = currentScroll + dur * 0.05 * -self.velocityX / 0.227; // the constant .227 is from power4(0.05). velocity is inverted because scrolling goes in the opposite direction.\n\n        dur *= _clampScrollAndGetDurationMultiplier(scrollFuncX, currentScroll, endScroll, _maxScroll(target, _horizontal));\n        tween.vars.scrollX = scrollClampX(endScroll);\n      }\n\n      currentScroll = scrollFuncY();\n      endScroll = currentScroll + dur * 0.05 * -self.velocityY / 0.227; // the constant .227 is from power4(0.05)\n\n      dur *= _clampScrollAndGetDurationMultiplier(scrollFuncY, currentScroll, endScroll, _maxScroll(target, _vertical));\n      tween.vars.scrollY = scrollClampY(endScroll);\n      tween.invalidate().duration(dur).play(0.01);\n\n      if (_fixIOSBug && tween.vars.scrollY >= maxY || currentScroll >= maxY - 1) {\n        // iOS bug: it'll show the address bar but NOT fire the window \"resize\" event until the animation is done but we must protect against overshoot so we leverage an onUpdate to do so.\n        gsap.to({}, {\n          onUpdate: onResize,\n          duration: dur\n        });\n      }\n    }\n\n    onRelease && onRelease(self);\n  };\n\n  vars.onWheel = function () {\n    tween._ts && tween.pause();\n\n    if (_getTime() - wheelRefresh > 1000) {\n      // after 1 second, refresh the clamps otherwise that'll only happen when ScrollTrigger.refresh() is called or for touch-scrolling.\n      lastRefreshID = 0;\n      wheelRefresh = _getTime();\n    }\n  };\n\n  vars.onChange = function (self, dx, dy, xArray, yArray) {\n    _refreshID !== lastRefreshID && updateClamps();\n    dx && normalizeScrollX && scrollFuncX(scrollClampX(xArray[2] === dx ? startScrollX + (self.startX - self.x) : scrollFuncX() + dx - xArray[1])); // for more precision, we track pointer/touch movement from the start, otherwise it'll drift.\n\n    if (dy) {\n      scrollFuncY.offset && removeContentOffset();\n      var isTouch = yArray[2] === dy,\n          y = isTouch ? startScrollY + self.startY - self.y : scrollFuncY() + dy - yArray[1],\n          yClamped = scrollClampY(y);\n      isTouch && y !== yClamped && (startScrollY += yClamped - y);\n      scrollFuncY(yClamped);\n    }\n\n    (dy || dx) && _updateAll();\n  };\n\n  vars.onEnable = function () {\n    _allowNativePanning(target, normalizeScrollX ? false : \"x\");\n\n    ScrollTrigger.addEventListener(\"refresh\", onResize);\n\n    _addListener(_win, \"resize\", onResize);\n\n    if (scrollFuncY.smooth) {\n      scrollFuncY.target.style.scrollBehavior = \"auto\";\n      scrollFuncY.smooth = scrollFuncX.smooth = false;\n    }\n\n    inputObserver.enable();\n  };\n\n  vars.onDisable = function () {\n    _allowNativePanning(target, true);\n\n    _removeListener(_win, \"resize\", onResize);\n\n    ScrollTrigger.removeEventListener(\"refresh\", onResize);\n    inputObserver.kill();\n  };\n\n  vars.lockAxis = vars.lockAxis !== false;\n  self = new Observer(vars);\n  self.iOS = _fixIOSBug; // used in the Observer getCachedScroll() function to work around an iOS bug that wreaks havoc with TouchEvent.clientY if we allow scroll to go all the way back to 0.\n\n  _fixIOSBug && !scrollFuncY() && scrollFuncY(1); // iOS bug causes event.clientY values to freak out (wildly inaccurate) if the scroll position is exactly 0.\n\n  _fixIOSBug && gsap.ticker.add(_passThrough); // prevent the ticker from sleeping\n\n  onStopDelayedCall = self._dc;\n  tween = gsap.to(self, {\n    ease: \"power4\",\n    paused: true,\n    inherit: false,\n    scrollX: normalizeScrollX ? \"+=0.1\" : \"+=0\",\n    scrollY: \"+=0.1\",\n    modifiers: {\n      scrollY: _interruptionTracker(scrollFuncY, scrollFuncY(), function () {\n        return tween.pause();\n      })\n    },\n    onUpdate: _updateAll,\n    onComplete: onStopDelayedCall.vars.onComplete\n  }); // we need the modifier to sense if the scroll position is altered outside of the momentum tween (like with a scrollTo tween) so we can pause() it to prevent conflicts.\n\n  return self;\n};\n\nScrollTrigger.sort = function (func) {\n  if (_isFunction(func)) {\n    return _triggers.sort(func);\n  }\n\n  var scroll = _win.pageYOffset || 0;\n  ScrollTrigger.getAll().forEach(function (t) {\n    return t._sortY = t.trigger ? scroll + t.trigger.getBoundingClientRect().top : t.start + _win.innerHeight;\n  });\n  return _triggers.sort(func || function (a, b) {\n    return (a.vars.refreshPriority || 0) * -1e6 + (a.vars.containerAnimation ? 1e6 : a._sortY) - ((b.vars.containerAnimation ? 1e6 : b._sortY) + (b.vars.refreshPriority || 0) * -1e6);\n  }); // anything with a containerAnimation should refresh last.\n};\n\nScrollTrigger.observe = function (vars) {\n  return new Observer(vars);\n};\n\nScrollTrigger.normalizeScroll = function (vars) {\n  if (typeof vars === \"undefined\") {\n    return _normalizer;\n  }\n\n  if (vars === true && _normalizer) {\n    return _normalizer.enable();\n  }\n\n  if (vars === false) {\n    _normalizer && _normalizer.kill();\n    _normalizer = vars;\n    return;\n  }\n\n  var normalizer = vars instanceof Observer ? vars : _getScrollNormalizer(vars);\n  _normalizer && _normalizer.target === normalizer.target && _normalizer.kill();\n  _isViewport(normalizer.target) && (_normalizer = normalizer);\n  return normalizer;\n};\n\nScrollTrigger.core = {\n  // smaller file size way to leverage in ScrollSmoother and Observer\n  _getVelocityProp: _getVelocityProp,\n  _inputObserver: _inputObserver,\n  _scrollers: _scrollers,\n  _proxies: _proxies,\n  bridge: {\n    // when normalizeScroll sets the scroll position (ss = setScroll)\n    ss: function ss() {\n      _lastScrollTime || _dispatch(\"scrollStart\");\n      _lastScrollTime = _getTime();\n    },\n    // a way to get the _refreshing value in Observer\n    ref: function ref() {\n      return _refreshing;\n    }\n  }\n};\n_getGSAP() && gsap.registerPlugin(ScrollTrigger);\nexport { ScrollTrigger as default };","/*!\n * SplitText 3.13.0\n * https://gsap.com\n *\n * @license Copyright 2025, GreenSock. All rights reserved. Subject to the terms at https://gsap.com/standard-license.\n * @author: Jack Doyle\n */\n\nlet gsap, _fonts, _coreInitted, _initIfNecessary = () => _coreInitted || SplitText.register(window.gsap), _charSegmenter = typeof Intl !== \"undefined\" ? new Intl.Segmenter() : 0, _toArray = (r) => typeof r === \"string\" ? _toArray(document.querySelectorAll(r)) : \"length\" in r ? Array.from(r) : [r], _elements = (targets) => _toArray(targets).filter((e) => e instanceof HTMLElement), _emptyArray = [], _context = function() {\n}, _spacesRegEx = /\\s+/g, _emojiSafeRegEx = new RegExp(\"\\\\p{RI}\\\\p{RI}|\\\\p{Emoji}(\\\\p{EMod}|\\\\u{FE0F}\\\\u{20E3}?|[\\\\u{E0020}-\\\\u{E007E}]+\\\\u{E007F})?(\\\\u{200D}\\\\p{Emoji}(\\\\p{EMod}|\\\\u{FE0F}\\\\u{20E3}?|[\\\\u{E0020}-\\\\u{E007E}]+\\\\u{E007F})?)*|.\", \"gu\"), _emptyBounds = { left: 0, top: 0, width: 0, height: 0 }, _stretchToFitSpecialChars = (collection, specialCharsRegEx) => {\n  if (specialCharsRegEx) {\n    let charsFound = new Set(collection.join(\"\").match(specialCharsRegEx) || _emptyArray), i = collection.length, slots, word, char, combined;\n    if (charsFound.size) {\n      while (--i > -1) {\n        word = collection[i];\n        for (char of charsFound) {\n          if (char.startsWith(word) && char.length > word.length) {\n            slots = 0;\n            combined = word;\n            while (char.startsWith(combined += collection[i + ++slots]) && combined.length < char.length) {\n            }\n            if (slots && combined.length === char.length) {\n              collection[i] = char;\n              collection.splice(i + 1, slots);\n              break;\n            }\n          }\n        }\n      }\n    }\n  }\n  return collection;\n}, _disallowInline = (element) => window.getComputedStyle(element).display === \"inline\" && (element.style.display = \"inline-block\"), _insertNodeBefore = (newChild, parent, existingChild) => parent.insertBefore(typeof newChild === \"string\" ? document.createTextNode(newChild) : newChild, existingChild), _getWrapper = (type, config, collection) => {\n  let className = config[type + \"sClass\"] || \"\", { tag = \"div\", aria = \"auto\", propIndex = false } = config, display = type === \"line\" ? \"block\" : \"inline-block\", incrementClass = className.indexOf(\"++\") > -1, wrapper = (text) => {\n    let el = document.createElement(tag), i = collection.length + 1;\n    className && (el.className = className + (incrementClass ? \" \" + className + i : \"\"));\n    propIndex && el.style.setProperty(\"--\" + type, i + \"\");\n    aria !== \"none\" && el.setAttribute(\"aria-hidden\", \"true\");\n    if (tag !== \"span\") {\n      el.style.position = \"relative\";\n      el.style.display = display;\n    }\n    el.textContent = text;\n    collection.push(el);\n    return el;\n  };\n  incrementClass && (className = className.replace(\"++\", \"\"));\n  wrapper.collection = collection;\n  return wrapper;\n}, _getLineWrapper = (element, nodes, config, collection) => {\n  let lineWrapper = _getWrapper(\"line\", config, collection), textAlign = window.getComputedStyle(element).textAlign || \"left\";\n  return (startIndex, endIndex) => {\n    let newLine = lineWrapper(\"\");\n    newLine.style.textAlign = textAlign;\n    element.insertBefore(newLine, nodes[startIndex]);\n    for (; startIndex < endIndex; startIndex++) {\n      newLine.appendChild(nodes[startIndex]);\n    }\n    newLine.normalize();\n  };\n}, _splitWordsAndCharsRecursively = (element, config, wordWrapper, charWrapper, prepForCharsOnly, deepSlice, ignore, charSplitRegEx, specialCharsRegEx, isNested) => {\n  var _a;\n  let nodes = Array.from(element.childNodes), i = 0, { wordDelimiter, reduceWhiteSpace = true, prepareText } = config, elementBounds = element.getBoundingClientRect(), lastBounds = elementBounds, isPreformatted = !reduceWhiteSpace && window.getComputedStyle(element).whiteSpace.substring(0, 3) === \"pre\", ignoredPreviousSibling = 0, wordsCollection = wordWrapper.collection, wordDelimIsNotSpace, wordDelimString, wordDelimSplitter, curNode, words, curWordEl, startsWithSpace, endsWithSpace, j, bounds, curWordChars, clonedNode, curSubNode, tempSubNode, curTextContent, wordText, lastWordText, k;\n  if (typeof wordDelimiter === \"object\") {\n    wordDelimSplitter = wordDelimiter.delimiter || wordDelimiter;\n    wordDelimString = wordDelimiter.replaceWith || \"\";\n  } else {\n    wordDelimString = wordDelimiter === \"\" ? \"\" : wordDelimiter || \" \";\n  }\n  wordDelimIsNotSpace = wordDelimString !== \" \";\n  for (; i < nodes.length; i++) {\n    curNode = nodes[i];\n    if (curNode.nodeType === 3) {\n      curTextContent = curNode.textContent || \"\";\n      if (reduceWhiteSpace) {\n        curTextContent = curTextContent.replace(_spacesRegEx, \" \");\n      } else if (isPreformatted) {\n        curTextContent = curTextContent.replace(/\\n/g, wordDelimString + \"\\n\");\n      }\n      prepareText && (curTextContent = prepareText(curTextContent, element));\n      curNode.textContent = curTextContent;\n      words = wordDelimString || wordDelimSplitter ? curTextContent.split(wordDelimSplitter || wordDelimString) : curTextContent.match(charSplitRegEx) || _emptyArray;\n      lastWordText = words[words.length - 1];\n      endsWithSpace = wordDelimIsNotSpace ? lastWordText.slice(-1) === \" \" : !lastWordText;\n      lastWordText || words.pop();\n      lastBounds = elementBounds;\n      startsWithSpace = wordDelimIsNotSpace ? words[0].charAt(0) === \" \" : !words[0];\n      startsWithSpace && _insertNodeBefore(\" \", element, curNode);\n      words[0] || words.shift();\n      _stretchToFitSpecialChars(words, specialCharsRegEx);\n      deepSlice && isNested || (curNode.textContent = \"\");\n      for (j = 1; j <= words.length; j++) {\n        wordText = words[j - 1];\n        if (!reduceWhiteSpace && isPreformatted && wordText.charAt(0) === \"\\n\") {\n          (_a = curNode.previousSibling) == null ? void 0 : _a.remove();\n          _insertNodeBefore(document.createElement(\"br\"), element, curNode);\n          wordText = wordText.slice(1);\n        }\n        if (!reduceWhiteSpace && wordText === \"\") {\n          _insertNodeBefore(wordDelimString, element, curNode);\n        } else if (wordText === \" \") {\n          element.insertBefore(document.createTextNode(\" \"), curNode);\n        } else {\n          wordDelimIsNotSpace && wordText.charAt(0) === \" \" && _insertNodeBefore(\" \", element, curNode);\n          if (ignoredPreviousSibling && j === 1 && !startsWithSpace && wordsCollection.indexOf(ignoredPreviousSibling.parentNode) > -1) {\n            curWordEl = wordsCollection[wordsCollection.length - 1];\n            curWordEl.appendChild(document.createTextNode(charWrapper ? \"\" : wordText));\n          } else {\n            curWordEl = wordWrapper(charWrapper ? \"\" : wordText);\n            _insertNodeBefore(curWordEl, element, curNode);\n            ignoredPreviousSibling && j === 1 && !startsWithSpace && curWordEl.insertBefore(ignoredPreviousSibling, curWordEl.firstChild);\n          }\n          if (charWrapper) {\n            curWordChars = _charSegmenter ? _stretchToFitSpecialChars([..._charSegmenter.segment(wordText)].map((s) => s.segment), specialCharsRegEx) : wordText.match(charSplitRegEx) || _emptyArray;\n            for (k = 0; k < curWordChars.length; k++) {\n              curWordEl.appendChild(curWordChars[k] === \" \" ? document.createTextNode(\" \") : charWrapper(curWordChars[k]));\n            }\n          }\n          if (deepSlice && isNested) {\n            curTextContent = curNode.textContent = curTextContent.substring(wordText.length + 1, curTextContent.length);\n            bounds = curWordEl.getBoundingClientRect();\n            if (bounds.top > lastBounds.top && bounds.left <= lastBounds.left) {\n              clonedNode = element.cloneNode();\n              curSubNode = element.childNodes[0];\n              while (curSubNode && curSubNode !== curWordEl) {\n                tempSubNode = curSubNode;\n                curSubNode = curSubNode.nextSibling;\n                clonedNode.appendChild(tempSubNode);\n              }\n              element.parentNode.insertBefore(clonedNode, element);\n              prepForCharsOnly && _disallowInline(clonedNode);\n            }\n            lastBounds = bounds;\n          }\n          if (j < words.length || endsWithSpace) {\n            _insertNodeBefore(j >= words.length ? \" \" : wordDelimIsNotSpace && wordText.slice(-1) === \" \" ? \" \" + wordDelimString : wordDelimString, element, curNode);\n          }\n        }\n      }\n      element.removeChild(curNode);\n      ignoredPreviousSibling = 0;\n    } else if (curNode.nodeType === 1) {\n      if (ignore && ignore.indexOf(curNode) > -1) {\n        wordsCollection.indexOf(curNode.previousSibling) > -1 && wordsCollection[wordsCollection.length - 1].appendChild(curNode);\n        ignoredPreviousSibling = curNode;\n      } else {\n        _splitWordsAndCharsRecursively(curNode, config, wordWrapper, charWrapper, prepForCharsOnly, deepSlice, ignore, charSplitRegEx, specialCharsRegEx, true);\n        ignoredPreviousSibling = 0;\n      }\n      prepForCharsOnly && _disallowInline(curNode);\n    }\n  }\n};\nconst _SplitText = class _SplitText {\n  constructor(elements, config) {\n    this.isSplit = false;\n    _initIfNecessary();\n    this.elements = _elements(elements);\n    this.chars = [];\n    this.words = [];\n    this.lines = [];\n    this.masks = [];\n    this.vars = config;\n    this._split = () => this.isSplit && this.split(this.vars);\n    let orig = [], timerId, checkWidths = () => {\n      let i = orig.length, o;\n      while (i--) {\n        o = orig[i];\n        let w = o.element.offsetWidth;\n        if (w !== o.width) {\n          o.width = w;\n          this._split();\n          return;\n        }\n      }\n    };\n    this._data = { orig, obs: typeof ResizeObserver !== \"undefined\" && new ResizeObserver(() => {\n      clearTimeout(timerId);\n      timerId = setTimeout(checkWidths, 200);\n    }) };\n    _context(this);\n    this.split(config);\n  }\n  split(config) {\n    this.isSplit && this.revert();\n    this.vars = config = config || this.vars || {};\n    let { type = \"chars,words,lines\", aria = \"auto\", deepSlice = true, smartWrap, onSplit, autoSplit = false, specialChars, mask } = this.vars, splitLines = type.indexOf(\"lines\") > -1, splitCharacters = type.indexOf(\"chars\") > -1, splitWords = type.indexOf(\"words\") > -1, onlySplitCharacters = splitCharacters && !splitWords && !splitLines, specialCharsRegEx = specialChars && (\"push\" in specialChars ? new RegExp(\"(?:\" + specialChars.join(\"|\") + \")\", \"gu\") : specialChars), finalCharSplitRegEx = specialCharsRegEx ? new RegExp(specialCharsRegEx.source + \"|\" + _emojiSafeRegEx.source, \"gu\") : _emojiSafeRegEx, ignore = !!config.ignore && _elements(config.ignore), { orig, animTime, obs } = this._data, onSplitResult;\n    if (splitCharacters || splitWords || splitLines) {\n      this.elements.forEach((element, index) => {\n        orig[index] = {\n          element,\n          html: element.innerHTML,\n          ariaL: element.getAttribute(\"aria-label\"),\n          ariaH: element.getAttribute(\"aria-hidden\")\n        };\n        aria === \"auto\" ? element.setAttribute(\"aria-label\", (element.textContent || \"\").trim()) : aria === \"hidden\" && element.setAttribute(\"aria-hidden\", \"true\");\n        let chars = [], words = [], lines = [], charWrapper = splitCharacters ? _getWrapper(\"char\", config, chars) : null, wordWrapper = _getWrapper(\"word\", config, words), i, curWord, smartWrapSpan, nextSibling;\n        _splitWordsAndCharsRecursively(element, config, wordWrapper, charWrapper, onlySplitCharacters, deepSlice && (splitLines || onlySplitCharacters), ignore, finalCharSplitRegEx, specialCharsRegEx, false);\n        if (splitLines) {\n          let nodes = _toArray(element.childNodes), wrapLine = _getLineWrapper(element, nodes, config, lines), curNode, toRemove = [], lineStartIndex = 0, allBounds = nodes.map((n) => n.nodeType === 1 ? n.getBoundingClientRect() : _emptyBounds), lastBounds = _emptyBounds;\n          for (i = 0; i < nodes.length; i++) {\n            curNode = nodes[i];\n            if (curNode.nodeType === 1) {\n              if (curNode.nodeName === \"BR\") {\n                toRemove.push(curNode);\n                wrapLine(lineStartIndex, i + 1);\n                lineStartIndex = i + 1;\n                lastBounds = allBounds[lineStartIndex];\n              } else {\n                if (i && allBounds[i].top > lastBounds.top && allBounds[i].left <= lastBounds.left) {\n                  wrapLine(lineStartIndex, i);\n                  lineStartIndex = i;\n                }\n                lastBounds = allBounds[i];\n              }\n            }\n          }\n          lineStartIndex < i && wrapLine(lineStartIndex, i);\n          toRemove.forEach((el) => {\n            var _a;\n            return (_a = el.parentNode) == null ? void 0 : _a.removeChild(el);\n          });\n        }\n        if (!splitWords) {\n          for (i = 0; i < words.length; i++) {\n            curWord = words[i];\n            if (splitCharacters || !curWord.nextSibling || curWord.nextSibling.nodeType !== 3) {\n              if (smartWrap && !splitLines) {\n                smartWrapSpan = document.createElement(\"span\");\n                smartWrapSpan.style.whiteSpace = \"nowrap\";\n                while (curWord.firstChild) {\n                  smartWrapSpan.appendChild(curWord.firstChild);\n                }\n                curWord.replaceWith(smartWrapSpan);\n              } else {\n                curWord.replaceWith(...curWord.childNodes);\n              }\n            } else {\n              nextSibling = curWord.nextSibling;\n              if (nextSibling && nextSibling.nodeType === 3) {\n                nextSibling.textContent = (curWord.textContent || \"\") + (nextSibling.textContent || \"\");\n                curWord.remove();\n              }\n            }\n          }\n          words.length = 0;\n          element.normalize();\n        }\n        this.lines.push(...lines);\n        this.words.push(...words);\n        this.chars.push(...chars);\n      });\n      mask && this[mask] && this.masks.push(...this[mask].map((el) => {\n        let maskEl = el.cloneNode();\n        el.replaceWith(maskEl);\n        maskEl.appendChild(el);\n        el.className && (maskEl.className = el.className.replace(/(\\b\\w+\\b)/g, \"$1-mask\"));\n        maskEl.style.overflow = \"clip\";\n        return maskEl;\n      }));\n    }\n    this.isSplit = true;\n    _fonts && (autoSplit ? _fonts.addEventListener(\"loadingdone\", this._split) : _fonts.status === \"loading\" && console.warn(\"SplitText called before fonts loaded\"));\n    if ((onSplitResult = onSplit && onSplit(this)) && onSplitResult.totalTime) {\n      this._data.anim = animTime ? onSplitResult.totalTime(animTime) : onSplitResult;\n    }\n    splitLines && autoSplit && this.elements.forEach((element, index) => {\n      orig[index].width = element.offsetWidth;\n      obs && obs.observe(element);\n    });\n    return this;\n  }\n  revert() {\n    var _a, _b;\n    let { orig, anim, obs } = this._data;\n    obs && obs.disconnect();\n    orig.forEach(({ element, html, ariaL, ariaH }) => {\n      element.innerHTML = html;\n      ariaL ? element.setAttribute(\"aria-label\", ariaL) : element.removeAttribute(\"aria-label\");\n      ariaH ? element.setAttribute(\"aria-hidden\", ariaH) : element.removeAttribute(\"aria-hidden\");\n    });\n    this.chars.length = this.words.length = this.lines.length = orig.length = this.masks.length = 0;\n    this.isSplit = false;\n    _fonts == null ? void 0 : _fonts.removeEventListener(\"loadingdone\", this._split);\n    if (anim) {\n      this._data.animTime = anim.totalTime();\n      anim.revert();\n    }\n    (_b = (_a = this.vars).onRevert) == null ? void 0 : _b.call(_a, this);\n    return this;\n  }\n  static create(elements, config) {\n    return new _SplitText(elements, config);\n  }\n  static register(core) {\n    gsap = gsap || core || window.gsap;\n    if (gsap) {\n      _toArray = gsap.utils.toArray;\n      _context = gsap.core.context || _context;\n    }\n    if (!_coreInitted && window.innerWidth > 0) {\n      _fonts = document.fonts;\n      _coreInitted = true;\n    }\n  }\n};\n_SplitText.version = \"3.13.0\";\nlet SplitText = _SplitText;\n\nexport { SplitText, SplitText as default };\n","import { gsap } from \"gsap\";\nimport { ScrollTrigger } from \"gsap/ScrollTrigger\";\nimport { SplitText } from \"gsap/SplitText\";\nimport { onDomReady } from \"@webhare/dompack\";\n\n// WebHare loads the assetpack async from <head>, so this can run before <body> exists. ScrollTrigger only finishes\n// its setup when it finds a body at registration, so wait for\n// the DOM. This still runs before mount(): frontend.ts registers its own onDomReady after importing this.\nonDomReady(() => gsap.registerPlugin(ScrollTrigger, SplitText));\ngsap.defaults({ ease: \"expo.out\", duration: 1.2 });\n// Keep real time: an intro started in a background tab is finished when the visitor returns, instead of crawling on\ngsap.ticker.lagSmoothing(0);\n\nexport { gsap, ScrollTrigger, SplitText };\n\nexport function prefersReducedMotion(): boolean {\n  return window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n}\n\nexport function isTouch(): boolean {\n  return window.matchMedia(\"(hover: none)\").matches;\n}\n\n/** The blur for text split into words, or none on a touch screen: Safari on iOS drew magenta streaks through words\n    that each carry a blur filter, and dozens of filtered words cost phones frames. There they only fade. */\nexport function wordBlur(px: number): { filter?: string } {\n  return isTouch() ? {} : { filter: `blur(${px}px)` };\n}\n\n// The intro curtain resolves this when the hero may start animating\nlet releaseIntro: () => void = () => {};\nexport const introDone = new Promise<void>((resolve) => { releaseIntro = resolve; });\nexport function finishIntro(): void {\n  releaseIntro();\n}\n\n// On page load every section's setup ran in one task of half a second on a phone (Total Blocking Time); now each gets\n// a task of its own, in the same order. Null once motionSettled() has seen the queue empty: a swup visit runs its\n// setups at once again, because its curtain opens right after the swap\nlet queue: Promise<void> | null = document.fonts.ready.then(() => {});\nconst nextTask = () => new Promise<void>((resolve) => setTimeout(resolve));\n\n/** Runs a GSAP setup scoped to `root` once fonts are ready; the returned cleanup reverts everything, including a\n    cleanup that `setup` returns. Does nothing with reduced motion. */\nexport function motion(root: HTMLElement, setup: (self: HTMLElement) => void | (() => void)): () => void {\n  let ctx: gsap.Context | undefined;\n  let alive = true;\n  const run = () => {\n    if (alive) ctx = gsap.context(() => setup(root), root);\n  };\n  if (!prefersReducedMotion()) {\n    // A failing setup must not stop the ones queued after it\n    if (queue) queue = queue.then(nextTask).then(run).catch((error: unknown) => console.error(error));\n    else void document.fonts.ready.then(run);\n  }\n  return () => {\n    alive = false;\n    ctx?.revert();\n  };\n}\n\n/** Resolves once every setup queued during page load has run, so each entrance animation has set its starting point. */\nexport async function motionSettled(): Promise<void> {\n  while (queue) {\n    const tail = queue;\n    await tail;\n    if (queue === tail) queue = null;\n  }\n}\n\n/** Splits a heading into masked lines that slide up when the heading scrolls into view. */\nexport function revealLines(target: Element | null, options: { delay?: number; start?: string; trigger?: Element } = {}): void {\n  if (!target) return;\n  const split = SplitText.create(target, { type: \"lines\", mask: \"lines\", linesClass: \"split-line\", aria: \"none\" });\n  gsap.from(split.lines, {\n    // Starts well below the line: the mask has extra room for descenders, so 110% would peek out\n    yPercent: 140,\n    duration: 1.3,\n    stagger: 0.09,\n    delay: options.delay ?? 0,\n    scrollTrigger: { trigger: options.trigger ?? target, start: options.start ?? \"top 85%\", once: true },\n  });\n}\n\n/** Fades and lifts a set of elements into view, staggered. */\nexport function revealUp(targets: gsap.TweenTarget, trigger: Element | null, options: { y?: number; stagger?: number; start?: string } = {}): void {\n  gsap.from(targets, {\n    y: options.y ?? 48,\n    autoAlpha: 0,\n    duration: 1.1,\n    stagger: options.stagger ?? 0.08,\n    clearProps: \"transform,opacity,visibility\",\n    scrollTrigger: { trigger: trigger ?? undefined, start: options.start ?? \"top 82%\", once: true },\n  });\n}\n\n","/* Debug overlay with frame statistics, to find out why the site stutters on a phone.\n   Switch on in the WebHare debug settings (\"Show performance statistics\"), or locally with ?wh-debug=tech42perfstats. */\n\nimport { debugFlags } from \"@webhare/env\";\nimport { ScrollTrigger } from \"./motion\";\n\n/** Shown in the overlay to tell which build a phone is running. Kept by hand: raise it with every change you\n    want to recognize on a device. */\nconst buildVersion = 15;\n\n/** A frame that takes this long is one a visitor sees as a hitch (three missed frames at 60 Hz). */\nconst longFrameMs = 50;\n\nexport interface FrameSummary {\n  fps: number;\n  avgMs: number;\n  worstMs: number;\n  longFrames: number;\n}\n\nfunction round1(value: number): number {\n  return Math.round(value * 10) / 10;\n}\n\n/** Summarizes the time between consecutive frames (in ms) over a measuring window. */\nexport function summarizeFrames(deltas: number[]): FrameSummary {\n  if (!deltas.length) return { fps: 0, avgMs: 0, worstMs: 0, longFrames: 0 };\n  const total = deltas.reduce((sum, delta) => sum + delta, 0);\n  return {\n    fps: Math.round((1000 * deltas.length) / total),\n    avgMs: round1(total / deltas.length),\n    worstMs: round1(Math.max(...deltas)),\n    longFrames: deltas.filter((delta) => delta >= longFrameMs).length,\n  };\n}\n\n/** Starts the overlay if the debug flag is on. Plain DOM on purpose: a Vue component would change the tree it measures. */\nexport function startPerfStats(): void {\n  if (!debugFlags.tech42perfstats) return;\n\n  const panel = document.createElement(\"div\");\n  panel.style.cssText =\n    \"position:fixed;left:8px;top:8px;z-index:2147483647;padding:6px 8px;border-radius:6px;\" +\n    \"background:rgba(0,0,0,.8);color:#7CFC8A;font:11px/1.35 ui-monospace,Menlo,monospace;\" +\n    \"white-space:pre;pointer-events:none\";\n  document.body.append(panel);\n\n  let longTasks = 0;\n  let longTaskMs = 0;\n  let longTasksSupported = false;\n  try {\n    // Chromium only; Safari on iOS has no longtask entries\n    new PerformanceObserver((list) => {\n      for (const entry of list.getEntries()) {\n        longTasks++;\n        longTaskMs += entry.duration;\n      }\n    }).observe({ type: \"longtask\", buffered: true });\n    longTasksSupported = true;\n  } catch {\n    // Not supported\n  }\n\n  let deltas: number[] = [];\n  let last = performance.now();\n  let lastPaint = last;\n  let sessionLongFrames = 0;\n  let sessionWorstMs = 0;\n\n  // A hidden tab pauses rAF. The first frame after it returns arrives when the tab is visible again, so\n  // document.hidden cannot tell: skip the frame that follows any visibility change instead\n  let skipFrame = false;\n  document.addEventListener(\"visibilitychange\", () => { skipFrame = true; });\n\n  function frame(now: number): void {\n    if (!skipFrame) deltas.push(now - last);\n    skipFrame = false;\n    last = now;\n\n    if (now - lastPaint >= 500) {\n      const stats = summarizeFrames(deltas);\n      sessionLongFrames += stats.longFrames;\n      sessionWorstMs = Math.max(sessionWorstMs, stats.worstMs);\n      const heap = (performance as { memory?: { usedJSHeapSize: number } }).memory?.usedJSHeapSize;\n      panel.textContent = [\n        `tech42v3 build ${buildVersion}`,\n        `FPS ${stats.fps}  avg ${stats.avgMs}ms  worst ${stats.worstMs}ms`,\n        `frames >${longFrameMs}ms: ${sessionLongFrames}  worst ever ${sessionWorstMs}ms`,\n        longTasksSupported ? `long tasks ${longTasks}  ${Math.round(longTaskMs)}ms` : \"long tasks n/a\",\n        `DOM ${document.getElementsByTagName(\"*\").length}  canvas ${document.getElementsByTagName(\"canvas\").length}  triggers ${ScrollTrigger.getAll().length}`,\n        `${innerWidth}x${innerHeight} @${devicePixelRatio}x` + (heap ? `  heap ${Math.round(heap / 1048576)}MB` : \"\"),\n      ].join(\"\\n\");\n      panel.style.color = stats.fps >= 50 ? \"#7CFC8A\" : stats.fps >= 30 ? \"#FFD166\" : \"#FF6B6B\";\n      deltas = [];\n      lastPaint = now;\n    }\n    requestAnimationFrame(frame);\n  }\n  requestAnimationFrame(frame);\n}\n","/* Arriving from another page on a link like \"/#services\". The browser would jump to that section while the page still\n   has its prerendered layout, which is thousands of pixels off from the mounted app, so the visitor saw an unrelated\n   spot of the page before a second jump. The page head therefore takes the hash out of the URL before the browser\n   can act on it and parks it on <html data-arrival>; the app scrolls there itself once the layout is final, still\n   under the curtain, and puts the hash back.\n   Read it only from mount on: the assetpack loads async in <head> and may run before that head script has. */\nfunction arrivalHash(): string {\n  return document.documentElement.dataset.arrival ?? \"\";\n}\n\nlet releaseArrival: () => void = () => {};\nconst settled = new Promise<void>((resolve) => { releaseArrival = resolve; });\n\n/** Resolves once the page stands at the section it was opened on (at once when there is none). */\nexport function arrived(): Promise<void> {\n  return arrivalHash() ? settled : Promise.resolve();\n}\n\nexport function arrivalTarget(): Element | null {\n  const hash = arrivalHash();\n  if (!hash) return null;\n  try {\n    return document.querySelector(hash);\n  } catch {\n    // Not a valid selector (a hash with odd characters): stay at the top\n    return null;\n  }\n}\n\nexport function finishArrival(): void {\n  const hash = arrivalHash();\n  if (hash) {\n    history.replaceState(history.state, \"\", location.pathname + location.search + hash);\n    delete document.documentElement.dataset.arrival;\n  }\n  releaseArrival();\n}\n","// Leads and their source. Where a visitor came from is remembered (which site or AI assistant, which campaign,\n// which page they landed on), so a lead from the contact form arrives in Tech_42 OS with its source.\n// Analytics is not loaded yet: track() only collects the conversion events, ready for when it is.\n// The contact form sends a lead with this source (components/contact-modal.ts, the hidden source_* fields).\nimport { basePath, lang } from \"./site\";\n\nexport interface LeadSource {\n  channel: \"ai-assistant\" | \"search\" | \"social\" | \"email\" | \"paid\" | \"referral\" | \"direct\";\n  referrer: string;\n  landingPage: string;\n  utm: Record<string, string>;\n  firstSeen: string;\n}\n\nconst storageKey = \"t42-source\";\nconst utmKeys = [\"utm_source\", \"utm_medium\", \"utm_campaign\", \"utm_term\", \"utm_content\", \"gclid\"];\n\n// Referrers that say where someone came from; AI assistants first, so they can be measured as their own channel\nconst channels: Array<[LeadSource[\"channel\"], RegExp]> = [\n  [\"ai-assistant\", /(^|\\.)(chatgpt\\.com|chat\\.openai\\.com|perplexity\\.ai|copilot\\.microsoft\\.com|claude\\.ai|gemini\\.google\\.com)$/],\n  [\"search\", /(^|\\.)(google\\.[a-z.]+|bing\\.com|duckduckgo\\.com|ecosia\\.org|yahoo\\.com)$/],\n  [\"social\", /(^|\\.)(linkedin\\.com|lnkd\\.in|facebook\\.com|instagram\\.com|x\\.com|t\\.co|youtube\\.com)$/],\n];\n\nfunction classify(referrerHost: string, utm: Record<string, string>): LeadSource[\"channel\"] {\n  const medium = (utm.utm_medium ?? \"\").toLowerCase();\n  // A campaign source counts like a referrer: ChatGPT adds utm_source=chatgpt.com to its links, for instance\n  const source = (utm.utm_source ?? \"\").toLowerCase().replace(/^www\\./, \"\");\n  if (utm.gclid || /cpc|ppc|paid/.test(medium)) return \"paid\";\n  if (medium === \"email\" || medium === \"newsletter\") return \"email\";\n  for (const [channel, pattern] of channels) if (pattern.test(referrerHost) || pattern.test(source)) return channel;\n  if (/^(chatgpt|openai|perplexity|copilot|claude|gemini)$/.test(source)) return \"ai-assistant\";\n  if (/^(linkedin|facebook|instagram|youtube|twitter|x)$/.test(source) || medium === \"social\") return \"social\";\n  if (referrerHost) return \"referral\";\n  return \"direct\";\n}\n\nfunction read(): LeadSource | null {\n  try {\n    const raw = localStorage.getItem(storageKey);\n    return raw ? (JSON.parse(raw) as LeadSource) : null;\n  } catch {\n    return null;\n  }\n}\n\n/** Remembers where this visitor came from; call once when the site loads */\nexport function captureSource() {\n  const params = new URLSearchParams(window.location.search);\n  const utm = Object.fromEntries(utmKeys.filter((key) => params.has(key)).map((key) => [key, params.get(key)!]));\n  let referrerHost = \"\";\n  try {\n    referrerHost = document.referrer ? new URL(document.referrer).hostname : \"\";\n  } catch {\n    // An unreadable referrer counts as none\n  }\n  if (referrerHost === window.location.hostname) referrerHost = \"\";\n\n  // The most recent visit that came from somewhere (a campaign tag or another site) counts; a direct visit\n  // keeps the source that is already known, for up to 90 days\n  const existing = read();\n  const expired = existing && Date.now() - Date.parse(existing.firstSeen) > 90 * 24 * 3600 * 1000;\n  const cameFromSomewhere = Object.keys(utm).length > 0 || referrerHost !== \"\";\n  if (existing && !expired && !cameFromSomewhere) return;\n  const source: LeadSource = {\n    channel: classify(referrerHost, utm),\n    referrer: referrerHost,\n    landingPage: basePath(),\n    utm,\n    firstSeen: new Date().toISOString(),\n  };\n  try {\n    localStorage.setItem(storageKey, JSON.stringify(source));\n  } catch {\n    // Not remembered; the lead then goes without its source\n  }\n}\n\nexport function leadSource(): LeadSource | null {\n  return read();\n}\n\n/** A conversion moment (form sent, phone or email clicked, appointment link opened) for analytics, once it is added */\nexport function track(event: string, params: Record<string, string> = {}) {\n  const payload = { event, lang, page: basePath(), ...params };\n  (window as unknown as { dataLayer?: unknown[] }).dataLayer?.push(payload);\n  window.dispatchEvent(new CustomEvent(\"t42:track\", { detail: payload }));\n}\n","","/**\n * Clamp a value between a minimum and maximum value\n *\n * @param min Minimum value\n * @param input Value to clamp\n * @param max Maximum value\n * @returns Clamped value\n */\nexport function clamp(min: number, input: number, max: number) {\n  return Math.max(min, Math.min(input, max))\n}\n\n/**\n * Truncate a floating-point number to a specified number of decimal places\n *\n * @param value Value to truncate\n * @param decimals Number of decimal places to truncate to\n * @returns Truncated value\n */\nexport function truncate(value: number, decimals = 0) {\n  return Number.parseFloat(value.toFixed(decimals))\n}\n\n/**\n *  Linearly interpolate between two values using an amount (0 <= t <= 1)\n *\n * @param x First value\n * @param y Second value\n * @param t Amount to interpolate (0 <= t <= 1)\n * @returns Interpolated value\n */\nexport function lerp(x: number, y: number, t: number) {\n  return (1 - t) * x + t * y\n}\n\n/**\n * Damp a value over time using a damping factor\n * {@link http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/}\n *\n * @param x Initial value\n * @param y Target value\n * @param lambda Damping factor\n * @param dt Time elapsed since the last update\n * @returns Damped value\n */\nexport function damp(x: number, y: number, lambda: number, deltaTime: number) {\n  return lerp(x, y, 1 - Math.exp(-lambda * deltaTime))\n}\n\n/**\n * Calculate the modulo of the dividend and divisor while keeping the result within the same sign as the divisor\n * {@link https://anguscroll.com/just/just-modulo}\n *\n * @param n Dividend\n * @param d Divisor\n * @returns Modulo\n */\nexport function modulo(n: number, d: number) {\n  return ((n % d) + d) % d\n}\n","import { clamp, damp } from './maths'\nimport type { EasingFunction, FromToOptions, OnUpdateCallback } from './types'\n\n/**\n * Animate class to handle value animations with lerping or easing\n *\n * @example\n * const animate = new Animate()\n * animate.fromTo(0, 100, { duration: 1, easing: (t) => t })\n * animate.advance(0.5) // 50\n */\nexport class Animate {\n  isRunning = false\n  value = 0\n  from = 0\n  to = 0\n  currentTime = 0\n\n  // These are instanciated in the fromTo method\n  lerp?: number\n  duration?: number\n  easing?: EasingFunction\n  onUpdate?: OnUpdateCallback\n\n  /**\n   * Advance the animation by the given delta time\n   *\n   * @param deltaTime - The time in seconds to advance the animation\n   */\n  advance(deltaTime: number) {\n    if (!this.isRunning) return\n\n    let completed = false\n\n    if (this.duration && this.easing) {\n      this.currentTime += deltaTime\n      const linearProgress = clamp(0, this.currentTime / this.duration, 1)\n\n      completed = linearProgress >= 1\n      const easedProgress = completed ? 1 : this.easing(linearProgress)\n      this.value = this.from + (this.to - this.from) * easedProgress\n    } else if (this.lerp) {\n      this.value = damp(this.value, this.to, this.lerp * 60, deltaTime)\n      if (Math.round(this.value) === Math.round(this.to)) {\n        this.value = this.to\n        completed = true\n      }\n    } else {\n      // If no easing or lerp, just jump to the end value\n      this.value = this.to\n      completed = true\n    }\n\n    if (completed) {\n      this.stop()\n    }\n\n    // Call the onUpdate callback with the current value and completed status\n    this.onUpdate?.(this.value, completed)\n  }\n\n  /** Stop the animation */\n  stop() {\n    this.isRunning = false\n  }\n\n  /**\n   * Set up the animation from a starting value to an ending value\n   * with optional parameters for lerping, duration, easing, and onUpdate callback\n   *\n   * @param from - The starting value\n   * @param to - The ending value\n   * @param options - Options for the animation\n   */\n  fromTo(\n    from: number,\n    to: number,\n    { lerp, duration, easing, onStart, onUpdate }: FromToOptions\n  ) {\n    this.from = this.value = from\n    this.to = to\n    this.lerp = lerp\n    this.duration = duration\n    this.easing = easing\n    this.currentTime = 0\n    this.isRunning = true\n\n    onStart?.()\n    this.onUpdate = onUpdate\n  }\n}\n","export function debounce<CB extends (...args: unknown[]) => void>(\n  callback: CB,\n  delay: number\n) {\n  let timer: number | undefined\n  return function <T>(this: T, ...args: Parameters<typeof callback>) {\n    clearTimeout(timer)\n    timer = setTimeout(() => {\n      timer = undefined\n      callback.apply(this, args)\n    }, delay)\n  }\n}\n","import { debounce } from './debounce'\n\n/**\n * Dimensions class to handle the size of the content and wrapper\n *\n * @example\n * const dimensions = new Dimensions(wrapper, content)\n * dimensions.on('resize', (e) => {\n *   console.log(e.width, e.height)\n * })\n */\nexport class Dimensions {\n  width = 0\n  height = 0\n  scrollHeight = 0\n  scrollWidth = 0\n\n  // These are instanciated in the constructor as they need information from the options\n  private debouncedResize?: (...args: unknown[]) => void\n  private wrapperResizeObserver?: ResizeObserver\n  private contentResizeObserver?: ResizeObserver\n\n  constructor(\n    private wrapper: HTMLElement | Window | Element,\n    private content: HTMLElement | Element,\n    { autoResize = true, debounce: debounceValue = 250 } = {}\n  ) {\n    if (autoResize) {\n      this.debouncedResize = debounce(this.resize, debounceValue)\n\n      if (this.wrapper instanceof Window) {\n        window.addEventListener('resize', this.debouncedResize)\n      } else {\n        this.wrapperResizeObserver = new ResizeObserver(this.debouncedResize)\n        this.wrapperResizeObserver.observe(this.wrapper)\n      }\n\n      this.contentResizeObserver = new ResizeObserver(this.debouncedResize)\n      this.contentResizeObserver.observe(this.content)\n    }\n\n    this.resize()\n  }\n\n  destroy() {\n    this.wrapperResizeObserver?.disconnect()\n    this.contentResizeObserver?.disconnect()\n\n    if (this.wrapper === window && this.debouncedResize) {\n      window.removeEventListener('resize', this.debouncedResize)\n    }\n  }\n\n  resize = () => {\n    this.onWrapperResize()\n    this.onContentResize()\n  }\n\n  onWrapperResize = () => {\n    if (this.wrapper instanceof Window) {\n      this.width = window.innerWidth\n      this.height = window.innerHeight\n    } else {\n      this.width = this.wrapper.clientWidth\n      this.height = this.wrapper.clientHeight\n    }\n  }\n\n  onContentResize = () => {\n    if (this.wrapper instanceof Window) {\n      this.scrollHeight = this.content.scrollHeight\n      this.scrollWidth = this.content.scrollWidth\n    } else {\n      this.scrollHeight = this.wrapper.scrollHeight\n      this.scrollWidth = this.wrapper.scrollWidth\n    }\n  }\n\n  get limit() {\n    return {\n      x: this.scrollWidth - this.width,\n      y: this.scrollHeight - this.height,\n    }\n  }\n}\n","/**\n * Emitter class to handle events\n * @example\n * const emitter = new Emitter()\n * emitter.on('event', (data) => {\n *   console.log(data)\n * })\n * emitter.emit('event', 'data')\n */\nexport class Emitter {\n  private events: Record<\n    string,\n    Array<(...args: unknown[]) => void> | undefined\n  > = {}\n\n  /**\n   * Emit an event with the given data\n   * @param event Event name\n   * @param args Data to pass to the event handlers\n   */\n  emit(event: string, ...args: unknown[]) {\n    const callbacks = this.events[event] || []\n    for (let i = 0, length = callbacks.length; i < length; i++) {\n      callbacks[i]?.(...args)\n    }\n  }\n\n  /**\n   * Add a callback to the event\n   * @param event Event name\n   * @param cb Callback function\n   * @returns Unsubscribe function\n   */\n  on<CB extends (...args: unknown[]) => void>(event: string, cb: CB) {\n    // Add the callback to the event's callback list, or create a new list with the callback\n    if (this.events[event]) {\n      this.events[event].push(cb)\n    } else {\n      this.events[event] = [cb]\n    }\n\n    // Return an unsubscribe function\n    return () => {\n      this.events[event] = this.events[event]?.filter((i) => cb !== i)\n    }\n  }\n\n  /**\n   * Remove a callback from the event\n   * @param event Event name\n   * @param callback Callback function\n   */\n  off<CB extends (...args: unknown[]) => void>(event: string, callback: CB) {\n    this.events[event] = this.events[event]?.filter((i) => callback !== i)\n  }\n\n  /**\n   * Remove all event listeners and clean up\n   */\n  destroy() {\n    this.events = {}\n  }\n}\n","import { Emitter } from './emitter'\nimport type { VirtualScrollCallback } from './types'\n\nconst LINE_HEIGHT = 100 / 6\nconst listenerOptions: AddEventListenerOptions = { passive: false }\n\nfunction getDeltaMultiplier(deltaMode: number, size: number): number {\n  if (deltaMode === 1) return LINE_HEIGHT\n  if (deltaMode === 2) return size\n  return 1\n}\n\nexport class VirtualScroll {\n  touchStart = {\n    x: 0,\n    y: 0,\n  }\n  lastDelta = {\n    x: 0,\n    y: 0,\n  }\n  window = {\n    width: 0,\n    height: 0,\n  }\n  private emitter = new Emitter()\n\n  constructor(\n    private element: HTMLElement,\n    private options = { wheelMultiplier: 1, touchMultiplier: 1 }\n  ) {\n    window.addEventListener('resize', this.onWindowResize)\n    this.onWindowResize()\n\n    this.element.addEventListener('wheel', this.onWheel, listenerOptions)\n    this.element.addEventListener(\n      'touchstart',\n      this.onTouchStart,\n      listenerOptions\n    )\n    this.element.addEventListener(\n      'touchmove',\n      this.onTouchMove,\n      listenerOptions\n    )\n    this.element.addEventListener('touchend', this.onTouchEnd, listenerOptions)\n  }\n\n  /**\n   * Add an event listener for the given event and callback\n   *\n   * @param event Event name\n   * @param callback Callback function\n   */\n  on(event: string, callback: VirtualScrollCallback) {\n    return this.emitter.on(event, callback as (...args: unknown[]) => void)\n  }\n\n  /** Remove all event listeners and clean up */\n  destroy() {\n    this.emitter.destroy()\n\n    window.removeEventListener('resize', this.onWindowResize)\n\n    this.element.removeEventListener('wheel', this.onWheel, listenerOptions)\n    this.element.removeEventListener(\n      'touchstart',\n      this.onTouchStart,\n      listenerOptions\n    )\n    this.element.removeEventListener(\n      'touchmove',\n      this.onTouchMove,\n      listenerOptions\n    )\n    this.element.removeEventListener(\n      'touchend',\n      this.onTouchEnd,\n      listenerOptions\n    )\n  }\n\n  /**\n   * Event handler for 'touchstart' event\n   *\n   * @param event Touch event\n   */\n  onTouchStart = (event: TouchEvent) => {\n    // @ts-expect-error - event.targetTouches is not defined\n    const { clientX, clientY } = event.targetTouches\n      ? event.targetTouches[0]\n      : event\n\n    this.touchStart.x = clientX\n    this.touchStart.y = clientY\n\n    this.lastDelta = {\n      x: 0,\n      y: 0,\n    }\n\n    this.emitter.emit('scroll', {\n      deltaX: 0,\n      deltaY: 0,\n      event,\n    })\n  }\n\n  /** Event handler for 'touchmove' event */\n  onTouchMove = (event: TouchEvent) => {\n    // @ts-expect-error - event.targetTouches is not defined\n    const { clientX, clientY } = event.targetTouches\n      ? event.targetTouches[0]\n      : event\n\n    const deltaX = -(clientX - this.touchStart.x) * this.options.touchMultiplier\n    const deltaY = -(clientY - this.touchStart.y) * this.options.touchMultiplier\n\n    this.touchStart.x = clientX\n    this.touchStart.y = clientY\n\n    this.lastDelta = {\n      x: deltaX,\n      y: deltaY,\n    }\n\n    this.emitter.emit('scroll', {\n      deltaX,\n      deltaY,\n      event,\n    })\n  }\n\n  onTouchEnd = (event: TouchEvent) => {\n    this.emitter.emit('scroll', {\n      deltaX: this.lastDelta.x,\n      deltaY: this.lastDelta.y,\n      event,\n    })\n  }\n\n  /** Event handler for 'wheel' event */\n  onWheel = (event: WheelEvent) => {\n    let { deltaX, deltaY, deltaMode } = event\n\n    const multiplierX = getDeltaMultiplier(deltaMode, this.window.width)\n    const multiplierY = getDeltaMultiplier(deltaMode, this.window.height)\n\n    deltaX *= multiplierX\n    deltaY *= multiplierY\n\n    deltaX *= this.options.wheelMultiplier\n    deltaY *= this.options.wheelMultiplier\n\n    this.emitter.emit('scroll', { deltaX, deltaY, event })\n  }\n\n  onWindowResize = () => {\n    this.window = {\n      width: window.innerWidth,\n      height: window.innerHeight,\n    }\n  }\n}\n","import { version } from '../../../package.json'\nimport { Animate } from './animate'\nimport { Dimensions } from './dimensions'\nimport { Emitter } from './emitter'\nimport { clamp, modulo } from './maths'\nimport type {\n  LenisEvent,\n  LenisOptions,\n  ScrollCallback,\n  Scrolling,\n  ScrollToOptions,\n  UserData,\n  VirtualScrollCallback,\n  VirtualScrollData,\n} from './types'\nimport { VirtualScroll } from './virtual-scroll'\n\n// Technical explanation\n// - listen to 'wheel' events\n// - prevent 'wheel' event to prevent scroll\n// - normalize wheel delta\n// - add delta to targetScroll\n// - animate scroll to targetScroll (smooth context)\n// - if animation is not running, listen to 'scroll' events (native context)\n\ntype OptionalPick<T, F extends keyof T> = Omit<T, F> & Partial<Pick<T, F>>\n\nconst defaultEasing = (t: number) => Math.min(1, 1.001 - 2 ** (-10 * t))\n\nexport class Lenis {\n  private _isScrolling: Scrolling = false // true when scroll is animating\n  private _isStopped = false // true if user should not be able to scroll - enable/disable programmatically\n  private _isLocked = false // same as isStopped but enabled/disabled when scroll reaches target\n  private _preventNextNativeScrollEvent = false\n  private _resetVelocityTimeout: ReturnType<typeof setTimeout> | null = null\n  private _rafId: number | null = null\n  private _isDraggingSelection = false // true while a touch is dragging an iOS selection handle\n  // `.matches` is read at scroll time so preference changes apply live, no listener needed\n  private readonly reducedMotionMediaQuery = window.matchMedia(\n    '(prefers-reduced-motion: reduce)'\n  )\n\n  /**\n   * Whether or not the user is touching the screen\n   */\n  isTouching?: boolean\n  /**\n   * Whether or not the device is running iOS\n   */\n  isIos: boolean\n  /**\n   * The time in ms since the lenis instance was created\n   */\n  time = 0\n  /**\n   * User data that will be forwarded through the scroll event\n   *\n   * @example\n   * lenis.scrollTo(100, {\n   *   userData: {\n   *     foo: 'bar'\n   *   }\n   * })\n   */\n  userData: UserData = {}\n  /**\n   * The last velocity of the scroll\n   */\n  lastVelocity = 0\n  /**\n   * The current velocity of the scroll\n   */\n  velocity = 0\n  /**\n   * The direction of the scroll\n   */\n  direction: 1 | -1 | 0 = 0\n  /**\n   * The options passed to the lenis instance\n   */\n  options: OptionalPick<\n    Required<LenisOptions>,\n    | 'duration'\n    | 'easing'\n    | 'prevent'\n    | 'virtualScroll'\n    | '__experimental__naiveDimensions'\n  >\n  /**\n   * The target scroll value\n   */\n  targetScroll: number\n  /**\n   * The animated scroll value\n   */\n  animatedScroll: number\n\n  // These are instanciated here as they don't need information from the options\n  private readonly animate = new Animate()\n  private readonly emitter = new Emitter()\n  // These are instanciated in the constructor as they need information from the options\n  readonly dimensions: Dimensions // This is not private because it's used in the Snap class\n  private readonly virtualScroll: VirtualScroll\n\n  constructor({\n    wrapper = window,\n    content = document.documentElement,\n    eventsTarget = wrapper,\n    smoothWheel = true,\n    syncTouch = false,\n    syncTouchLerp = 0.075,\n    touchInertiaExponent = 1.7,\n    duration, // in seconds\n    easing,\n    lerp = 0.1,\n    infinite = false,\n    orientation = 'vertical', // vertical, horizontal\n    gestureOrientation = orientation === 'horizontal' ? 'both' : 'vertical', // vertical, horizontal, both\n    touchMultiplier = 1,\n    wheelMultiplier = 1,\n    autoResize = true,\n    prevent,\n    virtualScroll,\n    overscroll = true,\n    autoRaf = false,\n    anchors = false,\n    autoToggle = false, // https://caniuse.com/?search=transition-behavior\n    allowNestedScroll = false,\n    __experimental__naiveDimensions = false,\n    naiveDimensions = __experimental__naiveDimensions,\n    stopInertiaOnNavigate = false,\n    respectReducedMotion = true,\n  }: LenisOptions = {}) {\n    // Set version (deprecated)\n    window.lenisVersion = version\n\n    if (!window.lenis) {\n      window.lenis = {}\n    }\n\n    window.lenis.version = version\n\n    if (orientation === 'horizontal') {\n      window.lenis.horizontal = true\n    }\n\n    if (syncTouch === true) {\n      window.lenis.touch = true\n    }\n\n    this.isIos = /(iPad|iPhone|iPod)/g.test(navigator.userAgent)\n\n    // Check if wrapper is <html>, fallback to window\n    if (!wrapper || wrapper === document.documentElement) {\n      wrapper = window\n    }\n\n    // flip to easing/time based animation if at least one of them is provided\n    if (typeof duration === 'number' && typeof easing !== 'function') {\n      easing = defaultEasing\n    } else if (typeof easing === 'function' && typeof duration !== 'number') {\n      duration = 1\n    }\n\n    // Setup options\n    this.options = {\n      wrapper,\n      content,\n      eventsTarget,\n      smoothWheel,\n      syncTouch,\n      syncTouchLerp,\n      touchInertiaExponent,\n      duration,\n      easing,\n      lerp,\n      infinite,\n      gestureOrientation,\n      orientation,\n      touchMultiplier,\n      wheelMultiplier,\n      autoResize,\n      prevent,\n      virtualScroll,\n      overscroll,\n      autoRaf,\n      anchors,\n      autoToggle,\n      allowNestedScroll,\n      naiveDimensions,\n      stopInertiaOnNavigate,\n      respectReducedMotion,\n    }\n\n    // Setup dimensions instance\n    this.dimensions = new Dimensions(wrapper, content, { autoResize })\n\n    // Setup class name\n    this.updateClassName()\n\n    // Set the initial scroll value for all scroll information\n    this.targetScroll = this.animatedScroll = this.actualScroll\n\n    // Add event listeners\n    this.options.wrapper.addEventListener('scroll', this.onNativeScroll)\n\n    this.options.wrapper.addEventListener('scrollend', this.onScrollEnd, {\n      capture: true,\n    })\n\n    if (this.options.anchors || this.options.stopInertiaOnNavigate) {\n      this.options.wrapper.addEventListener(\n        'click',\n        this.onClick as EventListener\n      )\n    }\n\n    this.options.wrapper.addEventListener(\n      'pointerdown',\n      this.onPointerDown as EventListener\n    )\n\n    // Setup virtual scroll instance\n    this.virtualScroll = new VirtualScroll(eventsTarget as HTMLElement, {\n      touchMultiplier,\n      wheelMultiplier,\n    })\n    this.virtualScroll.on('scroll', this.onVirtualScroll)\n\n    if (this.options.autoToggle) {\n      this.checkOverflow()\n      this.rootElement.addEventListener('transitionend', this.onTransitionEnd)\n    }\n\n    if (this.options.autoRaf) {\n      this._rafId = requestAnimationFrame(this.raf)\n    }\n  }\n\n  /**\n   * Destroy the lenis instance, remove all event listeners and clean up the class name\n   */\n  destroy() {\n    this.emitter.destroy()\n\n    if (this._resetVelocityTimeout !== null) {\n      clearTimeout(this._resetVelocityTimeout)\n      this._resetVelocityTimeout = null\n    }\n\n    this.options.wrapper.removeEventListener('scroll', this.onNativeScroll)\n\n    this.options.wrapper.removeEventListener('scrollend', this.onScrollEnd, {\n      capture: true,\n    })\n\n    this.options.wrapper.removeEventListener(\n      'pointerdown',\n      this.onPointerDown as EventListener\n    )\n\n    if (this.options.anchors || this.options.stopInertiaOnNavigate) {\n      this.options.wrapper.removeEventListener(\n        'click',\n        this.onClick as EventListener\n      )\n    }\n\n    this.virtualScroll.destroy()\n    this.dimensions.destroy()\n\n    this.cleanUpClassName()\n\n    if (this._rafId) {\n      cancelAnimationFrame(this._rafId)\n    }\n  }\n\n  /**\n   * Add an event listener for the given event and callback\n   *\n   * @param event Event name\n   * @param callback Callback function\n   * @returns Unsubscribe function\n   */\n  on(event: 'scroll', callback: ScrollCallback): () => void\n  on(event: 'virtual-scroll', callback: VirtualScrollCallback): () => void\n  on(event: LenisEvent, callback: ScrollCallback | VirtualScrollCallback) {\n    return this.emitter.on(event, callback as (...args: unknown[]) => void)\n  }\n\n  /**\n   * Remove an event listener for the given event and callback\n   *\n   * @param event Event name\n   * @param callback Callback function\n   */\n  off(event: 'scroll', callback: ScrollCallback): void\n  off(event: 'virtual-scroll', callback: VirtualScrollCallback): void\n  off(event: LenisEvent, callback: ScrollCallback | VirtualScrollCallback) {\n    return this.emitter.off(event, callback as (...args: unknown[]) => void)\n  }\n\n  private onScrollEnd = (e: Event | CustomEvent) => {\n    if (!(e instanceof CustomEvent)) {\n      if (this.isScrolling === 'smooth' || this.isScrolling === false) {\n        e.stopPropagation()\n      }\n    }\n  }\n\n  private dispatchScrollendEvent = () => {\n    this.options.wrapper.dispatchEvent(\n      new CustomEvent('scrollend', {\n        bubbles: this.options.wrapper === window,\n        // cancelable: false,\n        detail: {\n          lenisScrollEnd: true,\n        },\n      })\n    )\n  }\n\n  get overflow() {\n    const property = this.isHorizontal ? 'overflow-x' : 'overflow-y'\n    return getComputedStyle(this.rootElement)[\n      property as keyof CSSStyleDeclaration\n    ] as string\n  }\n\n  private checkOverflow() {\n    if (['hidden', 'clip'].includes(this.overflow)) {\n      this.internalStop()\n    } else {\n      this.internalStart()\n    }\n  }\n\n  private onTransitionEnd = (event: TransitionEvent) => {\n    if (\n      event.propertyName?.includes('overflow') &&\n      event.target === this.rootElement\n    ) {\n      this.checkOverflow()\n    }\n  }\n\n  private setScroll(scroll: number) {\n    // behavior: 'instant' bypasses the scroll-behavior CSS property\n\n    if (this.isHorizontal) {\n      this.options.wrapper.scrollTo({ left: scroll, behavior: 'instant' })\n    } else {\n      this.options.wrapper.scrollTo({ top: scroll, behavior: 'instant' })\n    }\n  }\n\n  private onClick = (event: PointerEvent | MouseEvent) => {\n    const path = event.composedPath()\n\n    // filter anchor elements (elements with a valid href attribute)\n    const linkElements = path.filter(\n      (node) => node instanceof HTMLAnchorElement && node.href\n    ) as HTMLAnchorElement[]\n    const linkElementsUrls = linkElements.map(\n      (element) => new URL(element.href)\n    )\n\n    const currentUrl = new URL(window.location.href)\n\n    if (this.options.anchors) {\n      const anchorElementUrl = linkElementsUrls.find(\n        (targetUrl) =>\n          currentUrl.host === targetUrl.host &&\n          currentUrl.pathname === targetUrl.pathname &&\n          targetUrl.hash\n      )\n\n      if (anchorElementUrl) {\n        const options =\n          typeof this.options.anchors === 'object' && this.options.anchors\n            ? this.options.anchors\n            : undefined\n\n        // hash is URL-encoded (e.g. `#footnote-%E2%80%A0`); decode so it\n        // matches the raw HTML id in scrollTo's getElementById\n        const target = decodeURIComponent(anchorElementUrl.hash)\n\n        this.scrollTo(target, options)\n        return\n      }\n    }\n\n    if (this.options.stopInertiaOnNavigate) {\n      const hasPageLinkElementUrl = linkElementsUrls.some(\n        (targetUrl) =>\n          currentUrl.host === targetUrl.host &&\n          currentUrl.pathname !== targetUrl.pathname\n      )\n\n      if (hasPageLinkElementUrl) {\n        this.reset()\n        return\n      }\n    }\n  }\n\n  private onPointerDown = (event: PointerEvent | MouseEvent) => {\n    if (event.button === 1) {\n      this.reset()\n    }\n  }\n\n  // iOS renders text-selection handles at the start and end points of the\n  // selection. A touch starting within a handle-sized radius of either point is\n  // the user grabbing a handle, not scrolling.\n  private isTouchOnSelectionHandle(event: TouchEvent) {\n    const selection = window.getSelection()\n    if (!selection || selection.isCollapsed || selection.rangeCount === 0)\n      return false\n\n    const touch = event.targetTouches[0] ?? event.changedTouches[0]\n    if (!touch) return false\n\n    const rects = selection.getRangeAt(0).getClientRects()\n    if (rects.length === 0) return false\n\n    const first = rects[0]!\n    const last = rects[rects.length - 1]!\n    const HANDLE_RADIUS = 40 // px — handles are large, finger-sized touch targets\n\n    const nearStart =\n      Math.hypot(touch.clientX - first.left, touch.clientY - first.top) <=\n      HANDLE_RADIUS\n    const nearEnd =\n      Math.hypot(touch.clientX - last.right, touch.clientY - last.bottom) <=\n      HANDLE_RADIUS\n\n    return nearStart || nearEnd\n  }\n\n  private onVirtualScroll = (data: VirtualScrollData) => {\n    if (\n      typeof this.options.virtualScroll === 'function' &&\n      this.options.virtualScroll(data) === false\n    )\n      return\n\n    const { deltaX, deltaY, event } = data\n\n    this.emitter.emit('virtual-scroll', { deltaX, deltaY, event })\n\n    // keep zoom feature\n    if (event.ctrlKey) return\n    // @ts-expect-error\n    if (event.lenisStopPropagation) return\n\n    const isTouch = event.type.includes('touch')\n    const isWheel = event.type.includes('wheel')\n\n    // If the touch grabbed an iOS text-selection handle, let the OS adjust the\n    // selection instead of scrolling. Latched on touchstart, held until touchend.\n    if (isTouch && this.isIos) {\n      if (event.type === 'touchstart') {\n        this._isDraggingSelection = this.isTouchOnSelectionHandle(\n          event as TouchEvent\n        )\n      }\n      if (this._isDraggingSelection) {\n        if (event.type === 'touchend') this._isDraggingSelection = false\n        return\n      }\n    }\n\n    this.isTouching = event.type === 'touchstart' || event.type === 'touchmove'\n\n    const isClickOrTap = deltaX === 0 && deltaY === 0\n\n    const isTapToStop =\n      this.options.syncTouch &&\n      isTouch &&\n      event.type === 'touchstart' &&\n      isClickOrTap &&\n      !this.isStopped &&\n      !this.isLocked\n\n    if (isTapToStop) {\n      this.reset()\n      return\n    }\n\n    // const isPullToRefresh =\n    //   this.options.gestureOrientation === 'vertical' &&\n    //   this.scroll === 0 &&\n    //   !this.options.infinite &&\n    //   deltaY <= 5 // touch pull to refresh, not reliable yet\n\n    // most likely a touchpad gesture, this keep prev/next page navigation working\n    const isUnknownGesture =\n      (this.options.gestureOrientation === 'vertical' && deltaY === 0) ||\n      (this.options.gestureOrientation === 'horizontal' && deltaX === 0)\n\n    if (isClickOrTap || isUnknownGesture) {\n      return\n    }\n\n    // catch if scrolling on nested scroll elements\n    let composedPath = event.composedPath()\n    composedPath = composedPath.slice(0, composedPath.indexOf(this.rootElement)) // remove parents elements\n\n    const prevent = this.options.prevent\n\n    const gestureOrientation =\n      Math.abs(deltaX) >= Math.abs(deltaY) ? 'horizontal' : 'vertical'\n\n    if (\n      composedPath.find(\n        (node) =>\n          node instanceof HTMLElement &&\n          ((typeof prevent === 'function' && prevent?.(node)) ||\n            node.hasAttribute?.('data-lenis-prevent') ||\n            (gestureOrientation === 'vertical' &&\n              node.hasAttribute?.('data-lenis-prevent-vertical')) ||\n            (gestureOrientation === 'horizontal' &&\n              node.hasAttribute?.('data-lenis-prevent-horizontal')) ||\n            (isTouch && node.hasAttribute?.('data-lenis-prevent-touch')) ||\n            (isWheel && node.hasAttribute?.('data-lenis-prevent-wheel')) ||\n            (this.options.allowNestedScroll &&\n              this.hasNestedScroll(node, {\n                deltaX,\n                deltaY,\n              })))\n      )\n    )\n      return\n\n    if (this.isStopped || this.isLocked) {\n      if (event.cancelable) {\n        event.preventDefault() // this will stop forwarding the event to the parent, this is problematic\n      }\n      return\n    }\n\n    const isSmooth =\n      (this.options.syncTouch && isTouch) ||\n      (this.options.smoothWheel && isWheel)\n\n    if (!isSmooth) {\n      this.isScrolling = 'native'\n      this.animate.stop()\n      // @ts-expect-error\n      event.lenisStopPropagation = true\n      return\n    }\n\n    let delta = deltaY\n    if (this.options.gestureOrientation === 'both') {\n      delta = Math.abs(deltaY) > Math.abs(deltaX) ? deltaY : deltaX\n    } else if (this.options.gestureOrientation === 'horizontal') {\n      delta = deltaX\n    }\n\n    if (\n      !this.options.overscroll ||\n      this.options.infinite ||\n      (this.options.wrapper !== window &&\n        this.limit > 0 &&\n        ((this.animatedScroll > 0 && this.animatedScroll < this.limit) ||\n          (this.animatedScroll === 0 && deltaY > 0) ||\n          (this.animatedScroll === this.limit && deltaY < 0)))\n    ) {\n      // @ts-expect-error\n      event.lenisStopPropagation = true\n      // event.stopPropagation()\n    }\n\n    if (event.cancelable) {\n      event.preventDefault()\n    }\n\n    const isSyncTouch = isTouch && this.options.syncTouch\n    const isTouchEnd = isTouch && event.type === 'touchend'\n\n    const hasTouchInertia = isTouchEnd\n\n    if (hasTouchInertia) {\n      delta =\n        Math.sign(delta) *\n        Math.abs(this.velocity) ** this.options.touchInertiaExponent\n    }\n\n    this.scrollTo(this.targetScroll + delta, {\n      programmatic: false,\n      ...(isSyncTouch\n        ? {\n            lerp: hasTouchInertia ? this.options.syncTouchLerp : 1,\n          }\n        : {\n            lerp: this.options.lerp,\n            duration: this.options.duration,\n            easing: this.options.easing,\n          }),\n    })\n  }\n\n  /**\n   * Force lenis to recalculate the dimensions\n   */\n  resize() {\n    this.dimensions.resize()\n    this.animatedScroll = this.targetScroll = this.actualScroll\n    this.emit()\n  }\n\n  private emit() {\n    this.emitter.emit('scroll', this)\n  }\n\n  private onNativeScroll = () => {\n    if (this._resetVelocityTimeout !== null) {\n      clearTimeout(this._resetVelocityTimeout)\n      this._resetVelocityTimeout = null\n    }\n\n    if (this._preventNextNativeScrollEvent) {\n      this._preventNextNativeScrollEvent = false\n      return\n    }\n\n    if (this.isScrolling === false || this.isScrolling === 'native') {\n      const lastScroll = this.animatedScroll\n      this.animatedScroll = this.targetScroll = this.actualScroll\n      this.lastVelocity = this.velocity\n      this.velocity = this.animatedScroll - lastScroll\n      this.direction = Math.sign(\n        this.animatedScroll - lastScroll\n      ) as Lenis['direction']\n\n      if (!this.isStopped) {\n        this.isScrolling = 'native'\n      }\n\n      this.emit()\n\n      if (this.velocity !== 0) {\n        this._resetVelocityTimeout = setTimeout(() => {\n          this.lastVelocity = this.velocity\n          this.velocity = 0\n          this.isScrolling = false\n          this.emit()\n        }, 400)\n      }\n    }\n  }\n\n  private reset() {\n    this.isLocked = false\n    this.isScrolling = false\n    this.animatedScroll = this.targetScroll = this.actualScroll\n    this.lastVelocity = this.velocity = 0\n    this.animate.stop()\n  }\n\n  /**\n   * Start lenis scroll after it has been stopped\n   */\n  start() {\n    if (!this.isStopped) return\n\n    if (this.options.autoToggle) {\n      this.rootElement.style.removeProperty('overflow')\n      return\n    }\n\n    this.internalStart()\n  }\n\n  private internalStart() {\n    if (!this.isStopped) return\n\n    this.reset()\n    this.isStopped = false\n    this.emit()\n  }\n\n  /**\n   * Stop lenis scroll\n   */\n  stop() {\n    if (this.isStopped) return\n\n    if (this.options.autoToggle) {\n      this.rootElement.style.setProperty('overflow', 'clip')\n      return\n    }\n\n    this.internalStop()\n  }\n\n  private internalStop() {\n    if (this.isStopped) return\n\n    this.reset()\n    this.isStopped = true\n    this.emit()\n  }\n\n  /**\n   * RequestAnimationFrame for lenis\n   *\n   * @param time The time in ms from an external clock like `requestAnimationFrame` or Tempus\n   */\n  raf = (time: number) => {\n    const deltaTime = time - (this.time || time)\n    this.time = time\n\n    this.animate.advance(deltaTime * 0.001)\n\n    if (this.options.autoRaf) {\n      this._rafId = requestAnimationFrame(this.raf)\n    }\n  }\n\n  /**\n   * Scroll to a target value\n   *\n   * @param target The target value to scroll to\n   * @param options The options for the scroll\n   *\n   * @example\n   * lenis.scrollTo(100, {\n   *   offset: 100,\n   *   duration: 1,\n   *   easing: (t) => 1 - Math.cos((t * Math.PI) / 2),\n   *   lerp: 0.1,\n   *   onStart: () => {\n   *     console.log('onStart')\n   *   },\n   *   onComplete: () => {\n   *     console.log('onComplete')\n   *   },\n   * })\n   */\n  scrollTo(\n    _target: number | string | Element,\n    {\n      offset = 0,\n      immediate = false,\n      lock = false,\n      programmatic = true, // called from outside of the class\n      lerp = programmatic ? this.options.lerp : undefined,\n      duration = programmatic ? this.options.duration : undefined,\n      easing = programmatic ? this.options.easing : undefined,\n      onStart,\n      onComplete,\n      force = false, // scroll even if stopped\n      userData,\n    }: ScrollToOptions = {}\n  ) {\n    if (this.prefersReducedMotion) {\n      if (programmatic) {\n        // jump cut instead of animation\n        immediate = true\n      } else {\n        // 1:1 input tracking, same mechanism as syncTouch finger tracking\n        lerp = 1\n        duration = undefined\n        easing = undefined\n      }\n    }\n\n    if ((this.isStopped || this.isLocked) && !force) return\n\n    let target: number | string | Element = _target\n    let adjustedOffset = offset\n\n    // keywords\n    if (\n      typeof target === 'string' &&\n      ['top', 'left', 'start', '#'].includes(target)\n    ) {\n      target = 0\n    } else if (\n      typeof target === 'string' &&\n      ['bottom', 'right', 'end'].includes(target)\n    ) {\n      target = this.limit\n    } else {\n      let node: Element | null = null\n\n      if (typeof target === 'string') {\n        // getElementById accepts any valid HTML id (e.g. `#footnote-†`),\n        // querySelector would reject it as an invalid CSS selector\n        node = target.startsWith('#')\n          ? document.getElementById(target.slice(1))\n          : document.querySelector(target)\n\n        if (!node) {\n          if (target === '#top') {\n            target = 0\n          } else {\n            console.warn('Lenis: Target not found', target)\n          }\n        }\n      } else if (target instanceof Element) {\n        // Node element\n        node = target\n      }\n\n      if (node) {\n        if (this.options.wrapper !== window) {\n          // nested scroll offset correction\n          const wrapperRect = this.rootElement.getBoundingClientRect()\n          adjustedOffset -= this.isHorizontal\n            ? wrapperRect.left\n            : wrapperRect.top\n        }\n\n        const rect = node.getBoundingClientRect()\n\n        // Account for scroll-margin CSS property on the target element\n        const targetStyle = getComputedStyle(node)\n        const scrollMargin = this.isHorizontal\n          ? Number.parseFloat(targetStyle.scrollMarginLeft)\n          : Number.parseFloat(targetStyle.scrollMarginTop)\n\n        // Account for scroll-padding CSS property on the scroll container\n        const containerStyle = getComputedStyle(this.rootElement)\n        const scrollPadding = this.isHorizontal\n          ? Number.parseFloat(containerStyle.scrollPaddingLeft)\n          : Number.parseFloat(containerStyle.scrollPaddingTop)\n\n        target =\n          (this.isHorizontal ? rect.left : rect.top) +\n          this.animatedScroll -\n          (Number.isNaN(scrollMargin) ? 0 : scrollMargin) -\n          (Number.isNaN(scrollPadding) ? 0 : scrollPadding)\n      }\n    }\n\n    if (typeof target !== 'number') return\n\n    target += adjustedOffset\n    // target = Math.round(target)\n\n    if (this.options.infinite) {\n      if (programmatic) {\n        this.targetScroll = this.animatedScroll = this.scroll\n\n        const distance = target - this.animatedScroll\n\n        if (distance > this.limit / 2) {\n          target -= this.limit\n        } else if (distance < -this.limit / 2) {\n          target += this.limit\n        }\n      }\n    } else {\n      target = clamp(0, target, this.limit)\n    }\n\n    if (target === this.targetScroll) {\n      onStart?.(this)\n      onComplete?.(this)\n      return\n    }\n\n    this.userData = userData ?? {}\n\n    if (immediate) {\n      this.animatedScroll = this.targetScroll = target\n      this.setScroll(this.scroll)\n      this.reset()\n      this.preventNextNativeScrollEvent()\n      this.emit()\n      onComplete?.(this)\n      this.userData = {}\n\n      requestAnimationFrame(() => {\n        this.dispatchScrollendEvent()\n      })\n      return\n    }\n\n    if (!programmatic) {\n      this.targetScroll = target\n    }\n\n    // flip to easing/time based animation if at least one of them is provided\n    if (typeof duration === 'number' && typeof easing !== 'function') {\n      easing = defaultEasing\n    } else if (typeof easing === 'function' && typeof duration !== 'number') {\n      duration = 1\n    }\n\n    this.animate.fromTo(this.animatedScroll, target, {\n      duration,\n      easing,\n      lerp,\n      onStart: () => {\n        // started\n        if (lock) this.isLocked = true\n        this.isScrolling = 'smooth'\n        onStart?.(this)\n      },\n      onUpdate: (value: number, completed: boolean) => {\n        this.isScrolling = 'smooth'\n\n        // updated\n        this.lastVelocity = this.velocity\n        this.velocity = value - this.animatedScroll\n        this.direction = Math.sign(this.velocity) as Lenis['direction']\n\n        this.animatedScroll = value\n        this.setScroll(this.scroll)\n\n        if (programmatic) {\n          // wheel during programmatic should stop it\n          this.targetScroll = value\n        }\n\n        if (!completed) this.emit()\n\n        if (completed) {\n          this.reset()\n          this.emit()\n          onComplete?.(this)\n          this.userData = {}\n\n          requestAnimationFrame(() => {\n            this.dispatchScrollendEvent()\n          })\n\n          // avoid emitting event twice\n          this.preventNextNativeScrollEvent()\n        }\n      },\n    })\n  }\n\n  private preventNextNativeScrollEvent() {\n    this._preventNextNativeScrollEvent = true\n\n    requestAnimationFrame(() => {\n      this._preventNextNativeScrollEvent = false\n    })\n  }\n\n  private hasNestedScroll(\n    node: HTMLElement,\n    { deltaX, deltaY }: { deltaX: number; deltaY: number }\n  ) {\n    const time = Date.now()\n\n    // @ts-expect-error - _lenis is a custom cache property\n    if (!node._lenis) node._lenis = {}\n    // @ts-expect-error\n    const cache = node._lenis\n\n    let hasOverflowX: boolean | undefined\n    let hasOverflowY: boolean | undefined\n    let isScrollableX: boolean | undefined\n    let isScrollableY: boolean | undefined\n    let hasOverscrollBehaviorX: boolean | undefined\n    let hasOverscrollBehaviorY: boolean | undefined\n    let scrollWidth: number\n    let scrollHeight: number\n    let clientWidth: number\n    let clientHeight: number\n\n    if (time - (cache.time ?? 0) > 2000) {\n      cache.time = Date.now()\n\n      const computedStyle = window.getComputedStyle(node)\n      cache.computedStyle = computedStyle\n\n      hasOverflowX = ['auto', 'overlay', 'scroll'].includes(\n        computedStyle.overflowX\n      )\n      hasOverflowY = ['auto', 'overlay', 'scroll'].includes(\n        computedStyle.overflowY\n      )\n\n      hasOverscrollBehaviorX = ['auto'].includes(\n        computedStyle.overscrollBehaviorX\n      )\n      hasOverscrollBehaviorY = ['auto'].includes(\n        computedStyle.overscrollBehaviorY\n      )\n\n      cache.hasOverflowX = hasOverflowX\n      cache.hasOverflowY = hasOverflowY\n\n      if (!(hasOverflowX || hasOverflowY)) return false // if no overflow, it's not scrollable no matter what, early return saves some computations\n\n      scrollWidth = node.scrollWidth\n      scrollHeight = node.scrollHeight\n\n      clientWidth = node.clientWidth\n      clientHeight = node.clientHeight\n\n      isScrollableX = scrollWidth > clientWidth\n      isScrollableY = scrollHeight > clientHeight\n\n      cache.isScrollableX = isScrollableX\n      cache.isScrollableY = isScrollableY\n      cache.scrollWidth = scrollWidth\n      cache.scrollHeight = scrollHeight\n      cache.clientWidth = clientWidth\n      cache.clientHeight = clientHeight\n      cache.hasOverscrollBehaviorX = hasOverscrollBehaviorX\n      cache.hasOverscrollBehaviorY = hasOverscrollBehaviorY\n    } else {\n      isScrollableX = cache.isScrollableX\n      isScrollableY = cache.isScrollableY\n      hasOverflowX = cache.hasOverflowX\n      hasOverflowY = cache.hasOverflowY\n      scrollWidth = cache.scrollWidth\n      scrollHeight = cache.scrollHeight\n      clientWidth = cache.clientWidth\n      clientHeight = cache.clientHeight\n      hasOverscrollBehaviorX = cache.hasOverscrollBehaviorX\n      hasOverscrollBehaviorY = cache.hasOverscrollBehaviorY\n    }\n\n    if (!((hasOverflowX && isScrollableX) || (hasOverflowY && isScrollableY))) {\n      return false\n    }\n\n    const orientation =\n      Math.abs(deltaX) >= Math.abs(deltaY) ? 'horizontal' : 'vertical'\n\n    let scroll: number | undefined\n    let maxScroll: number | undefined\n    let delta: number | undefined\n    let hasOverflow: boolean | undefined\n    let isScrollable: boolean | undefined\n    let hasOverscrollBehavior: boolean | undefined\n\n    if (orientation === 'horizontal') {\n      scroll = Math.round(node.scrollLeft)\n      maxScroll = scrollWidth - clientWidth\n      delta = deltaX\n\n      hasOverflow = hasOverflowX\n      isScrollable = isScrollableX\n      hasOverscrollBehavior = hasOverscrollBehaviorX\n    } else if (orientation === 'vertical') {\n      scroll = Math.round(node.scrollTop)\n      maxScroll = scrollHeight - clientHeight\n      delta = deltaY\n\n      hasOverflow = hasOverflowY\n      isScrollable = isScrollableY\n      hasOverscrollBehavior = hasOverscrollBehaviorY\n    } else {\n      return false\n    }\n\n    if (!hasOverscrollBehavior && (scroll >= maxScroll || scroll <= 0)) {\n      return true\n    }\n\n    const willScroll = delta > 0 ? scroll < maxScroll : scroll > 0\n\n    return willScroll && hasOverflow && isScrollable\n  }\n\n  /**\n   * The root element on which lenis is instanced\n   */\n  get rootElement() {\n    return (\n      this.options.wrapper === window\n        ? document.documentElement\n        : this.options.wrapper\n    ) as HTMLElement\n  }\n\n  /**\n   * The limit which is the maximum scroll value\n   */\n  get limit() {\n    if (this.options.naiveDimensions) {\n      if (this.isHorizontal) {\n        return this.rootElement.scrollWidth - this.rootElement.clientWidth\n      }\n      return this.rootElement.scrollHeight - this.rootElement.clientHeight\n    }\n    return this.dimensions.limit[this.isHorizontal ? 'x' : 'y']\n  }\n\n  /**\n   * Whether or not the scroll is horizontal\n   */\n  get isHorizontal() {\n    return this.options.orientation === 'horizontal'\n  }\n\n  /**\n   * The actual scroll value\n   */\n  get actualScroll() {\n    // value browser takes into account\n    // it has to be this way because of DOCTYPE declaration\n    const wrapper = this.options.wrapper as Window | HTMLElement\n\n    return this.isHorizontal\n      ? ((wrapper as Window).scrollX ?? (wrapper as HTMLElement).scrollLeft)\n      : ((wrapper as Window).scrollY ?? (wrapper as HTMLElement).scrollTop)\n  }\n\n  /**\n   * The current scroll value\n   */\n  get scroll() {\n    return this.options.infinite\n      ? modulo(this.animatedScroll, this.limit)\n      : this.animatedScroll\n  }\n\n  /**\n   * The progress of the scroll relative to the limit\n   */\n  get progress() {\n    // avoid progress to be NaN\n    return this.limit === 0 ? 1 : this.scroll / this.limit\n  }\n\n  /**\n   * Current scroll state\n   */\n  get isScrolling() {\n    return this._isScrolling\n  }\n\n  private set isScrolling(value: Scrolling) {\n    if (this._isScrolling !== value) {\n      this._isScrolling = value\n      this.updateClassName()\n    }\n  }\n\n  /**\n   * Check if lenis is stopped\n   */\n  get isStopped() {\n    return this._isStopped\n  }\n\n  private set isStopped(value: boolean) {\n    if (this._isStopped !== value) {\n      this._isStopped = value\n      this.updateClassName()\n    }\n  }\n\n  /**\n   * Check if lenis is locked\n   */\n  get isLocked() {\n    return this._isLocked\n  }\n\n  private set isLocked(value: boolean) {\n    if (this._isLocked !== value) {\n      this._isLocked = value\n      this.updateClassName()\n    }\n  }\n\n  /**\n   * Check if lenis is smooth scrolling\n   */\n  get isSmooth() {\n    return this.isScrolling === 'smooth'\n  }\n\n  /**\n   * Whether the user prefers reduced motion and lenis is honoring it (see `respectReducedMotion` option)\n   */\n  get prefersReducedMotion() {\n    return (\n      this.options.respectReducedMotion && this.reducedMotionMediaQuery.matches\n    )\n  }\n\n  /**\n   * The class name applied to the wrapper element\n   */\n  get className() {\n    let className = 'lenis'\n    if (this.options.autoToggle) className += ' lenis-autoToggle'\n    if (this.isStopped) className += ' lenis-stopped'\n    if (this.isLocked) className += ' lenis-locked'\n    if (this.isScrolling) className += ' lenis-scrolling'\n    if (this.isScrolling === 'smooth') className += ' lenis-smooth'\n    return className\n  }\n\n  private updateClassName() {\n    this.cleanUpClassName()\n\n    this.className.split(' ').forEach((className) => {\n      this.rootElement.classList.add(className)\n    })\n  }\n\n  private cleanUpClassName() {\n    for (const className of Array.from(this.rootElement.classList)) {\n      if (className === 'lenis' || className.startsWith('lenis-')) {\n        this.rootElement.classList.remove(className)\n      }\n    }\n  }\n}\n","html.lenis,\nhtml.lenis body {\n  height: auto;\n}\n\n.lenis:not(.lenis-autoToggle).lenis-stopped {\n  overflow: clip;\n}\n\n.lenis [data-lenis-prevent],\n.lenis [data-lenis-prevent-wheel],\n.lenis [data-lenis-prevent-touch],\n.lenis [data-lenis-prevent-vertical],\n.lenis [data-lenis-prevent-horizontal] {\n  overscroll-behavior: contain;\n}\n\n.lenis.lenis-smooth iframe {\n  pointer-events: none;\n}\n\n.lenis.lenis-autoToggle {\n  transition-property: overflow;\n  transition-duration: 1ms;\n  transition-behavior: allow-discrete;\n}\n","// Smooth scrolling with Lenis: it moves the real page scroll, so fixed elements, pins and ScrollTrigger keep working\n// as they do natively. It drives touch scrolling too (syncTouch): natively, iOS tells the page of the scroll position\n// only a few times a second during a swipe, and the hero's \"Let's talk\" flight, moved by script, then fell behind the\n// page. The price is iOS's own momentum and rubber band, which Lenis replaces with its own (chosen 2026-11-15, after\n// comparing native scroll, a scroll timeline and position: sticky on a phone). GSAP's ScrollSmoother juddered on\n// iOS: it moved the page with a transform instead of the scroll position.\nimport Lenis from \"lenis\";\nimport \"lenis/dist/lenis.css\";\nimport { gsap, ScrollTrigger } from \"./motion\";\n\nlet lenis: Lenis | null = null;\n\nexport function startSmoothScroll(): void {\n  // autoToggle: stops while <html> has overflow: hidden, which the contact and application popups set\n  lenis = new Lenis({ autoToggle: true, syncTouch: true });\n  lenis.on(\"scroll\", ScrollTrigger.update);\n  gsap.ticker.add((time) => lenis?.raf(time * 1000));\n}\n\n/** Jumps (or with `smooth`, glides) to `target`: a y position or an element, whose top lands at the top of the screen */\nexport function scrollToTarget(target: number | HTMLElement, { smooth = false } = {}): void {\n  if (lenis)\n    lenis.scrollTo(target, { immediate: !smooth, force: true });\n  else if (typeof target === \"number\")\n    window.scrollTo(0, target);\n  else\n    target.scrollIntoView({ behavior: smooth ? \"smooth\" : \"auto\" });\n}\n","// The page-wide behavior that tech42v2 had in App.vue: smooth scrolling, links within the page, the header's colour\n// over light sections, arriving on a section from another page, and conversion tracking. Runs once, after mount().\nimport { arrivalTarget, finishArrival } from \"../lib/arrival\";\nimport { captureSource, track } from \"../lib/leads\";\nimport { ScrollTrigger, motionSettled, prefersReducedMotion } from \"../lib/motion\";\nimport { scrollToTarget, startSmoothScroll } from \"../lib/scroll\";\n\nlet headerTriggers: ScrollTrigger[] = [];\n\n/** The fixed header turns dark over light sections (marked with data-header=\"light\"). Called again after a swup\n    visit, for the sections of the new page. */\nexport function watchHeaderBackground(): void {\n  const header = document.querySelector(\".header\");\n  headerTriggers.forEach((st) => st.kill());\n  header?.classList.remove(\"header--on-light\");\n  let active = 0;\n  // Counted rather than toggled, so two light sections in a row never leave the logo light in between\n  headerTriggers = [...document.querySelectorAll('[data-header=\"light\"]')].map((section) =>\n    ScrollTrigger.create({\n      trigger: section,\n      start: \"top 48px\",\n      end: \"bottom 48px\",\n      onToggle: (st) => {\n        active += st.isActive ? 1 : -1;\n        header?.classList.toggle(\"header--on-light\", active > 0);\n      },\n    }));\n}\n\n/** Brings `target` to the top of the screen once the layout stops moving, and keeps it there through late refreshes\n    (images, fonts) until the visitor scrolls themself. */\nexport function settleOn(target: Element): void {\n  let offset = Number.NaN;\n  for (let pass = 0; pass < 4; pass++) {\n    ScrollTrigger.refresh();\n    const next = Math.round(window.scrollY + target.getBoundingClientRect().top);\n    if (next === offset) break;\n    offset = next;\n  }\n  scrollToTarget(offset);\n  const align = () => scrollToTarget(window.scrollY + target.getBoundingClientRect().top);\n  ScrollTrigger.addEventListener(\"refresh\", align);\n  const release = () => {\n    ScrollTrigger.removeEventListener(\"refresh\", align);\n    for (const type of [\"wheel\", \"touchstart\", \"keydown\"]) window.removeEventListener(type, release);\n  };\n  for (const type of [\"wheel\", \"touchstart\", \"keydown\"]) window.addEventListener(type, release, { passive: true });\n}\n\nexport async function startApp(): Promise<void> {\n  // Where this visitor came from, and clicks on phone numbers and email addresses as conversion moments\n  captureSource();\n  document.addEventListener(\"click\", (e) => {\n    const link = (e.target as HTMLElement).closest<HTMLAnchorElement>('a[href^=\"tel:\"], a[href^=\"mailto:\"]');\n    if (link) track(\"contact_click\", { method: link.protocol === \"tel:\" ? \"phone\" : \"email\" });\n  });\n  if (prefersReducedMotion()) {\n    await document.fonts.ready;\n    watchHeaderBackground();\n    arrivalTarget()?.scrollIntoView();\n    finishArrival();\n    return;\n  }\n\n  startSmoothScroll();\n\n  // Links to a spot on this same page (\"#contact\", or \"/#services\" while on the homepage) scroll smoothly\n  document.addEventListener(\"click\", (e) => {\n    if (e.defaultPrevented) return;\n    const link = (e.target as HTMLElement).closest<HTMLAnchorElement>(\"a[href*='#']\");\n    if (!link) return;\n    const samePage = link.pathname.replace(/\\/+$/, \"\") === window.location.pathname.replace(/\\/+$/, \"\");\n    if (!samePage || link.hash.length < 2) return;\n    const target = document.querySelector(link.hash);\n    if (!target) return;\n    e.preventDefault();\n    scrollToTarget(target as HTMLElement, { smooth: true });\n  });\n\n  await motionSettled();\n  watchHeaderBackground();\n  ScrollTrigger.refresh();\n  // Every entrance animation has set its starting point by now, so the header and hero may show (see the page head)\n  document.documentElement.classList.remove(\"motion-pending\");\n\n  // Arriving from another page on a link like \"/#services\": go to that section while the curtain still covers the page\n  const arrival = arrivalTarget();\n  if (arrival) {\n    // The curtain holds until finishArrival, so let the page settle first and jump only once. Until some 600ms after\n    // loading (when the intro curtain measures again) the pinned \"why\" section above measures 329px taller, which\n    // left the section past its heading; wait that out, then refresh until the section's offset stops changing\n    if (document.readyState !== \"complete\") await new Promise((resolve) => window.addEventListener(\"load\", resolve, { once: true }));\n    await new Promise((resolve) => setTimeout(resolve, 650));\n    settleOn(arrival);\n  }\n  finishArrival();\n}\n","/** Keeps track of raw listeners added to the base elements to avoid duplication */\nconst ledger = new WeakMap();\nfunction editLedger(wanted, baseElement, callback, setup) {\n    if (!wanted && !ledger.has(baseElement)) {\n        return false;\n    }\n    const elementMap = ledger.get(baseElement)\n        ?? new WeakMap();\n    ledger.set(baseElement, elementMap);\n    const setups = elementMap.get(callback) ?? new Set();\n    elementMap.set(callback, setups);\n    const existed = setups.has(setup);\n    if (wanted) {\n        setups.add(setup);\n    }\n    else {\n        setups.delete(setup);\n    }\n    return existed && wanted;\n}\nfunction safeClosest(event, selector) {\n    let target = event.target;\n    if (target instanceof Text) {\n        target = target.parentElement;\n    }\n    // The currentTarget could be an Element or e.g. a ShadowRoot\n    if (target instanceof Element && event.currentTarget instanceof Node) {\n        // `.closest()` may match ancestors of `currentTarget` but we only need its children\n        const closest = target.closest(selector);\n        if (closest && event.currentTarget.contains(closest)) {\n            return closest;\n        }\n    }\n}\n// This type isn't exported as a declaration, so it needs to be duplicated above\nfunction delegate(selector, type, callback, options = {}) {\n    if (Array.isArray(type)) {\n        for (const t of type) {\n            delegate(selector, t, callback, options);\n        }\n        return;\n    }\n    // After the Array.isArray early-return above, `type` is a single event type string.\n    // TypeScript doesn't narrow generic union types through Array.isArray, so we cast here.\n    const singleType = type;\n    const { signal, base = document } = options;\n    if (signal?.aborted) {\n        return;\n    }\n    // Don't pass `once` to `addEventListener` because it needs to be handled in `delegate-it`\n    const { once, ...nativeListenerOptions } = options;\n    // `document` should never be the base, it's just an easy way to define \"global event listeners\"\n    const baseElement = base instanceof Document ? base.documentElement : base;\n    // Handle the regular Element usage\n    const capture = Boolean(typeof options === 'object' ? options.capture : options);\n    const listenerFunction = (event) => {\n        const delegateTarget = safeClosest(event, String(selector));\n        if (delegateTarget) {\n            const delegateEvent = Object.assign(event, { delegateTarget });\n            callback.call(baseElement, delegateEvent);\n            if (once) {\n                baseElement.removeEventListener(singleType, listenerFunction, nativeListenerOptions);\n                editLedger(false, baseElement, callback, setup);\n            }\n        }\n    };\n    const setup = JSON.stringify({ selector, type: singleType, capture });\n    const isAlreadyListening = editLedger(true, baseElement, callback, setup);\n    if (!isAlreadyListening) {\n        baseElement.addEventListener(singleType, listenerFunction, nativeListenerOptions);\n    }\n    signal?.addEventListener('abort', () => {\n        editLedger(false, baseElement, callback, setup);\n    });\n}\nexport default delegate;\n","import delegate from './delegate.js';\n// This type isn't exported as a declaration, so it needs to be duplicated above\nasync function oneEvent(selector, type, options = {}) {\n    return new Promise(resolve => {\n        const { filter, ...delegateOptions } = options;\n        if (delegateOptions.signal?.aborted) {\n            resolve(undefined);\n            return;\n        }\n        if (filter) {\n            const controller = new AbortController();\n            delegateOptions.signal?.addEventListener('abort', () => {\n                controller.abort();\n                resolve(undefined);\n            });\n            delegate(selector, type, event => {\n                if (filter(event)) {\n                    controller.abort();\n                    resolve(event);\n                }\n            }, { ...delegateOptions, signal: controller.signal });\n        }\n        else {\n            delegateOptions.signal?.addEventListener('abort', () => {\n                resolve(undefined);\n            });\n            delegate(selector, type, resolve, { ...delegateOptions, once: true });\n        }\n    });\n}\nexport default oneEvent;\n","export * from './delegate.js';\nexport * from './one-event.js';\nexport { default } from './delegate.js';\nexport { default as oneEvent } from './one-event.js';\n","/** Turn a string into a slug by lowercasing and replacing whitespace. */\nexport const classify = (text: string, fallback?: string): string => {\n\tconst output = String(text)\n\t\t.toLowerCase()\n\t\t// .normalize('NFD') // split an accented letter in the base letter and the accent\n\t\t// .replace(/[\\u0300-\\u036f]/g, '') // remove all previously split accents\n\t\t.replace(/[\\s/_.]+/g, '-') // replace spaces and _./ with '-'\n\t\t.replace(/[^\\w-]+/g, '') // remove all non-word chars\n\t\t.replace(/--+/g, '-') // replace repeating '-' with single '-'\n\t\t.replace(/^-+|-+$/g, ''); // trim '-' from edges\n\treturn output || fallback || '';\n};\n","/** Get the current page URL: path name + query params. Optionally including hash. */\nexport const getCurrentUrl = ({ hash }: { hash?: boolean } = {}): string => {\n\treturn window.location.pathname + window.location.search + (hash ? window.location.hash : '');\n};\n","import { getCurrentUrl } from './getCurrentUrl.js';\n\nexport interface HistoryState {\n\turl: string;\n\tsource: 'swup';\n\trandom: number;\n\tindex?: number;\n\t[key: string]: unknown;\n}\n\ntype HistoryData = Record<string, unknown>;\n\n/** Create a new history record with a custom swup identifier. */\nexport const createHistoryRecord = (url: string, data: HistoryData = {}): void => {\n\turl = url || getCurrentUrl({ hash: true });\n\tconst state: HistoryState = {\n\t\turl,\n\t\trandom: Math.random(),\n\t\tsource: 'swup',\n\t\t...data\n\t};\n\twindow.history.pushState(state, '', url);\n};\n\n/** Update the current history record with a custom swup identifier. */\nexport const updateHistoryRecord = (url: string | null = null, data: HistoryData = {}): void => {\n\turl = url || getCurrentUrl({ hash: true });\n\tconst currentState = (window.history.state as HistoryState) || {};\n\tconst state: HistoryState = {\n\t\t...currentState,\n\t\turl,\n\t\trandom: Math.random(),\n\t\tsource: 'swup',\n\t\t...data\n\t};\n\twindow.history.replaceState(state, '', url);\n};\n","import delegate, {\n\ttype DelegateEventHandler,\n\ttype DelegateOptions,\n\ttype EventType\n} from 'delegate-it';\nimport type { ParseSelector } from 'typed-query-selector/parser.js';\n\nexport type DelegateEventUnsubscribe = {\n\tdestroy: () => void;\n};\n\n/** Register a delegated event listener. */\nexport const delegateEvent = <\n\tSelector extends string,\n\tTElement extends Element = ParseSelector<Selector, HTMLElement>,\n\tTEvent extends EventType = EventType\n>(\n\tselector: Selector,\n\ttype: TEvent,\n\tcallback: DelegateEventHandler<GlobalEventHandlersEventMap[TEvent], TElement>,\n\toptions?: DelegateOptions\n): DelegateEventUnsubscribe => {\n\tconst controller = new AbortController();\n\toptions = { ...options, signal: controller.signal };\n\tdelegate<Selector, TElement, TEvent>(selector, type, callback, options);\n\treturn { destroy: () => controller.abort() };\n};\n","/**\n * A helper for creating a Location from either an element\n * or a URL object/string\n *\n */\nexport class Location extends URL {\n\tconstructor(url: URL | string, base: string = document.baseURI) {\n\t\tsuper(url.toString(), base);\n\t\t// Fix Safari bug with extending native classes\n\t\tObject.setPrototypeOf(this, Location.prototype);\n\t}\n\n\t/**\n\t * The full local path including query params.\n\t */\n\tget url(): string {\n\t\treturn this.pathname + this.search;\n\t}\n\n\t/**\n\t * Instantiate a Location from an element's href attribute\n\t * @param el\n\t * @returns new Location instance\n\t */\n\tstatic fromElement(el: Element): Location {\n\t\tconst href = el.getAttribute('href') || el.getAttribute('xlink:href') || '';\n\t\treturn new Location(href);\n\t}\n\n\t/**\n\t * Instantiate a Location from a URL object or string\n\t * @param url\n\t * @returns new Location instance\n\t */\n\tstatic fromUrl(url: URL | string): Location {\n\t\treturn new Location(url);\n\t}\n}\n","import { match } from 'path-to-regexp';\n\nimport type { Path, MatchFunction } from 'path-to-regexp';\n\nexport { type Path };\n\ntype Params = Parameters<typeof match>;\n\n/** Create a match function from a path pattern that checks if a URLs matches it. */\nexport const matchPath = <P extends object = object>(\n\tpath: Params[0],\n\toptions?: Params[1]\n): MatchFunction<P> => {\n\tif (Array.isArray(path) && !path.length) {\n\t\tpath = '';\n\t}\n\n\ttry {\n\t\treturn match<P>(path, options);\n\t} catch (error) {\n\t\tthrow new Error(`[swup] Error parsing path \"${String(path)}\":\\n${String(error)}`, {\n\t\t\tcause: error\n\t\t});\n\t}\n};\n","import type Swup from '../Swup.js';\nimport { Location } from '../helpers.js';\nimport type { Visit } from './Visit.js';\n\n/** A page object as used by swup and its cache. */\nexport interface PageData {\n\t/** The URL of the page */\n\turl: string;\n\t/** The complete HTML response received from the server */\n\thtml: string;\n}\n\n/** Define how a page is fetched. */\nexport interface FetchOptions extends Omit<RequestInit, 'cache'> {\n\t/** The request method. */\n\tmethod?: 'GET' | 'POST';\n\t/** The body of the request: raw string, form data object or URL params. */\n\tbody?: string | FormData | URLSearchParams;\n\t/** The request timeout in milliseconds. */\n\ttimeout?: number;\n\t/** Optional visit object with additional context. @internal */\n\tvisit?: Visit;\n}\n\nexport class FetchError extends Error {\n\turl: string;\n\tstatus?: number;\n\taborted: boolean;\n\ttimedOut: boolean;\n\tconstructor(\n\t\tmessage: string,\n\t\tdetails: { url: string; status?: number; aborted?: boolean; timedOut?: boolean }\n\t) {\n\t\tsuper(message);\n\t\tthis.name = 'FetchError';\n\t\tthis.url = details.url;\n\t\tthis.status = details.status;\n\t\tthis.aborted = details.aborted || false;\n\t\tthis.timedOut = details.timedOut || false;\n\t}\n}\n\n/**\n * Fetch a page from the server, return it and cache it.\n */\nexport async function fetchPage(\n\tthis: Swup,\n\turl: URL | string,\n\toptions: FetchOptions = {}\n): Promise<PageData> {\n\turl = Location.fromUrl(url).url;\n\n\tconst { visit = this.visit } = options;\n\tconst headers = { ...this.options.requestHeaders, ...options.headers };\n\tconst timeout = options.timeout ?? this.options.timeout;\n\tconst controller = new AbortController();\n\tconst { signal } = controller;\n\toptions = { ...options, headers, signal };\n\n\tlet timedOut = false;\n\tlet timeoutId: ReturnType<typeof setTimeout> | null = null;\n\tif (timeout && timeout > 0) {\n\t\ttimeoutId = setTimeout(() => {\n\t\t\ttimedOut = true;\n\t\t\tcontroller.abort('timeout');\n\t\t}, timeout);\n\t}\n\n\t// Allow hooking before this and returning a custom response-like object (e.g. custom fetch implementation)\n\tlet response: Response;\n\ttry {\n\t\tresponse = await this.hooks.call(\n\t\t\t'fetch:request',\n\t\t\tvisit,\n\t\t\t{ url, options },\n\t\t\t(visit, { url, options }) => fetch(url, options)\n\t\t);\n\t\tif (timeoutId) {\n\t\t\tclearTimeout(timeoutId);\n\t\t}\n\t} catch (error) {\n\t\tif (timedOut) {\n\t\t\tthis.hooks.call('fetch:timeout', visit, { url });\n\t\t\tthrow new FetchError(`Request timed out: ${url}`, { url, timedOut });\n\t\t}\n\t\tif ((error as Error)?.name === 'AbortError' || signal.aborted) {\n\t\t\tthrow new FetchError(`Request aborted: ${url}`, { url, aborted: true });\n\t\t}\n\t\tthrow error;\n\t}\n\n\tconst { status, url: responseUrl } = response;\n\tconst html = await response.text();\n\n\tif (status === 500) {\n\t\tthis.hooks.call('fetch:error', visit, { status, response, url: responseUrl });\n\t\tthrow new FetchError(`Server error: ${responseUrl}`, { status, url: responseUrl });\n\t}\n\n\tif (!html) {\n\t\tthrow new FetchError(`Empty response: ${responseUrl}`, { status, url: responseUrl });\n\t}\n\n\t// Resolve real url after potential redirect\n\tconst { url: finalUrl } = Location.fromUrl(responseUrl);\n\tconst page = { url: finalUrl, html };\n\n\t// Write to cache for safe methods and non-redirects\n\tif (visit.cache.write && (!options.method || options.method === 'GET') && url === finalUrl) {\n\t\tthis.cache.set(page.url, page);\n\t}\n\n\treturn page;\n}\n","import type Swup from '../Swup.js';\nimport { Location } from '../helpers.js';\nimport { type PageData } from './fetchPage.js';\n\n// CacheData is intended for augmentation in user land\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface CacheData extends PageData {}\n\n/**\n * In-memory page cache.\n */\nexport class Cache {\n\t/** Swup instance this cache belongs to */\n\tprotected swup: Swup;\n\n\t/** Cached pages, indexed by URL */\n\tprotected pages: Map<string, CacheData> = new Map();\n\n\tconstructor(swup: Swup) {\n\t\tthis.swup = swup;\n\t}\n\n\t/** Number of cached pages in memory. */\n\tget size(): number {\n\t\treturn this.pages.size;\n\t}\n\n\t/** All cached pages. */\n\tget all() {\n\t\tconst copy = new Map();\n\t\tthis.pages.forEach((page, key) => {\n\t\t\tcopy.set(key, { ...page });\n\t\t});\n\t\treturn copy;\n\t}\n\n\t/** Check if the given URL has been cached. */\n\thas(url: string): boolean {\n\t\treturn this.pages.has(this.resolve(url));\n\t}\n\n\t/** Return a shallow copy of the cached page object if available. */\n\tget(url: string): CacheData | undefined {\n\t\tconst result = this.pages.get(this.resolve(url));\n\t\tif (!result) return result;\n\t\treturn { ...result };\n\t}\n\n\t/** Create a cache record for the specified URL. */\n\tset(url: string, page: CacheData) {\n\t\turl = this.resolve(url);\n\t\tpage = { ...page, url };\n\t\tthis.pages.set(url, page);\n\t\tthis.swup.hooks.callSync('cache:set', undefined, { page });\n\t}\n\n\t/** Update a cache record, overwriting or adding custom data. */\n\tupdate(url: string, payload: object) {\n\t\turl = this.resolve(url);\n\t\tconst page = { ...this.get(url), ...payload, url } as CacheData;\n\t\tthis.pages.set(url, page);\n\t}\n\n\t/** Delete a cache record. */\n\tdelete(url: string): void {\n\t\tthis.pages.delete(this.resolve(url));\n\t}\n\n\t/** Empty the cache. */\n\tclear(): void {\n\t\tthis.pages.clear();\n\t\tthis.swup.hooks.callSync('cache:clear', undefined, undefined);\n\t}\n\n\t/** Remove all cache entries that return true for a given predicate function.  */\n\tprune(predicate: (url: string, page: CacheData) => boolean): void {\n\t\tthis.pages.forEach((page, url) => {\n\t\t\tif (predicate(url, page)) {\n\t\t\t\tthis.delete(url);\n\t\t\t}\n\t\t});\n\t}\n\n\t/** Resolve URLs by making them local and letting swup resolve them. */\n\tprotected resolve(urlToResolve: string): string {\n\t\tconst { url } = Location.fromUrl(urlToResolve);\n\t\treturn this.swup.resolveUrl(url);\n\t}\n}\n","/** Find an element by selector. */\nexport const query = (selector: string, context: Document | Element = document) => {\n\treturn context.querySelector<HTMLElement>(selector);\n};\n\n/** Find a set of elements by selector. */\nexport const queryAll = (\n\tselector: string,\n\tcontext: Document | Element = document\n): HTMLElement[] => {\n\treturn Array.from(context.querySelectorAll(selector));\n};\n\n/** Return a Promise that resolves after the next event loop. */\nexport const nextTick = (): Promise<void> => {\n\treturn new Promise((resolve) => {\n\t\trequestAnimationFrame(() => {\n\t\t\trequestAnimationFrame(() => {\n\t\t\t\tresolve();\n\t\t\t});\n\t\t});\n\t});\n};\n\n/** Check if an object is a Promise or a Thenable */\nexport function isPromise<T>(obj: unknown): obj is PromiseLike<T> {\n\treturn (\n\t\t!!obj &&\n\t\t(typeof obj === 'object' || typeof obj === 'function') &&\n\t\ttypeof (obj as Record<string, unknown>).then === 'function'\n\t);\n}\n\n/** Call a function as a Promise. Resolves with the returned Promsise or immediately. */\n// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\nexport function runAsPromise(func: Function, args: unknown[] = []): Promise<unknown> {\n\treturn new Promise((resolve, reject) => {\n\t\tconst result: unknown = (func as (...args: unknown[]) => unknown)(...args);\n\t\tif (isPromise(result)) {\n\t\t\tresult.then(resolve, reject);\n\t\t} else {\n\t\t\tresolve(result);\n\t\t}\n\t});\n}\n\n/**\n * Force a layout reflow, e.g. after adding classnames\n * @see https://stackoverflow.com/a/21665117/3759615\n */\nexport function forceReflow(element?: HTMLElement): void {\n\telement = element || document.body;\n\telement?.getBoundingClientRect();\n}\n\n/**\n * Read data attribute from closest element with that attribute.\n *\n * Returns `undefined` if no element is found or attribute is missing.\n * Returns `true` if attribute is present without a value.\n */\nexport function getContextualAttr(\n\tel: Element | undefined,\n\tattr: string\n): string | boolean | undefined {\n\tconst target = el?.closest(`[${attr}]`);\n\treturn target?.hasAttribute(attr) ? target?.getAttribute(attr) || true : undefined;\n}\n","import type Swup from '../Swup.js';\nimport { queryAll } from '../utils.js';\n\nexport class Classes {\n\tprotected swup: Swup;\n\tprotected swupClasses = [\n\t\t'to-',\n\t\t'is-changing',\n\t\t'is-rendering',\n\t\t'is-popstate',\n\t\t'is-animating',\n\t\t'is-leaving'\n\t];\n\n\tconstructor(swup: Swup) {\n\t\tthis.swup = swup;\n\t}\n\n\tprotected get selectors(): string[] {\n\t\tconst { scope } = this.swup.visit.animation;\n\t\tif (scope === 'containers') return this.swup.visit.containers;\n\t\tif (scope === 'html') return ['html'];\n\t\tif (Array.isArray(scope)) return scope;\n\t\treturn [];\n\t}\n\n\tprotected get selector(): string {\n\t\treturn this.selectors.join(',');\n\t}\n\n\tprotected get targets(): HTMLElement[] {\n\t\tif (!this.selector.trim()) return [];\n\t\treturn queryAll(this.selector);\n\t}\n\n\tadd(...classes: string[]): void {\n\t\tthis.targets.forEach((target) => target.classList.add(...classes));\n\t}\n\n\tremove(...classes: string[]): void {\n\t\tthis.targets.forEach((target) => target.classList.remove(...classes));\n\t}\n\n\tclear(): void {\n\t\tthis.targets.forEach((target) => {\n\t\t\tconst remove = target.className.split(' ').filter((c) => this.isSwupClass(c));\n\t\t\ttarget.classList.remove(...remove);\n\t\t});\n\t}\n\n\tprotected isSwupClass(className: string): boolean {\n\t\treturn this.swupClasses.some((c) => className.startsWith(c));\n\t}\n}\n","import type Swup from '../Swup.js';\nimport type { Options } from '../Swup.js';\nimport type { HistoryAction, HistoryDirection } from './navigate.js';\n\n/** See below for the class Visit {} definition */\n// export interface Visit {}\n\nexport interface VisitFrom {\n\t/** The URL of the previous page */\n\turl: string;\n\t/** The hash of the previous page */\n\thash?: string;\n}\n\nexport interface VisitTo {\n\t/** The URL of the next page */\n\turl: string;\n\t/** The hash of the next page */\n\thash?: string;\n\t/** The HTML content of the next page */\n\thtml?: string;\n\t/** The parsed document of the next page, available during visit */\n\tdocument?: Document;\n}\n\nexport interface VisitAnimation {\n\t/** Whether this visit is animated. Default: `true` */\n\tanimate: boolean;\n\t/** Whether to wait for the next page to load before starting the animation. Default: `false` */\n\twait: boolean;\n\t/** Name of a custom animation to run. */\n\tname?: string;\n\t/** Whether this animation uses the native browser ViewTransition API. Default: `false` */\n\tnative: boolean;\n\t/** Elements on which to add animation classes. Default: `html` element */\n\tscope: 'html' | 'containers' | string[];\n\t/** Selector for detecting animation timing. Default: `[class*=\"transition-\"]` */\n\tselector: Options['animationSelector'];\n}\n\nexport interface VisitScroll {\n\t/** Whether to reset the scroll position after the visit. Default: `true` */\n\treset: boolean;\n\t/** Anchor element to scroll to on the next page. */\n\ttarget?: string | false;\n}\n\nexport interface VisitTrigger {\n\t/** DOM element that triggered this visit. */\n\tel?: Element;\n\t/** DOM event that triggered this visit. */\n\tevent?: Event;\n}\n\nexport interface VisitCache {\n\t/** Whether this visit will try to load the requested page from cache. */\n\tread: boolean;\n\t/** Whether this visit will save the loaded page in cache. */\n\twrite: boolean;\n}\n\nexport interface VisitHistory {\n\t/** History action to perform: `push` for creating a new history entry, `replace` for replacing the current entry. Default: `push` */\n\taction: HistoryAction;\n\t/** Whether this visit was triggered by a browser history navigation. */\n\tpopstate: boolean;\n\t/** The direction of travel in case of a browser history navigation: backward or forward. */\n\tdirection: HistoryDirection | undefined;\n}\n\nexport interface VisitInitOptions {\n\tto: string;\n\tfrom?: string;\n\thash?: string;\n\tel?: Element;\n\tevent?: Event;\n}\n\n/** @internal */\nexport const VisitState = {\n\tCREATED: 1,\n\tQUEUED: 2,\n\tSTARTED: 3,\n\tLEAVING: 4,\n\tLOADED: 5,\n\tENTERING: 6,\n\tCOMPLETED: 7,\n\tABORTED: 8,\n\tFAILED: 9,\n\tIGNORED: 10\n} as const;\n\n/** @internal */\nexport type VisitState = (typeof VisitState)[keyof typeof VisitState];\n\n/** An object holding details about the current visit. */\nexport class Visit {\n\t/** A unique ID to identify this visit */\n\tid: number;\n\t/** The current state of this visit @internal */\n\tstate: VisitState;\n\t/** The previous page, about to leave */\n\tfrom: VisitFrom;\n\t/** The next page, about to enter */\n\tto: VisitTo;\n\t/** The content containers, about to be replaced */\n\tcontainers: Options['containers'];\n\t/** Information about animated page transitions */\n\tanimation: VisitAnimation;\n\t/** What triggered this visit */\n\ttrigger: VisitTrigger;\n\t/** Cache behavior for this visit */\n\tcache: VisitCache;\n\t/** Browser history behavior on this visit */\n\thistory: VisitHistory;\n\t/** Scroll behavior on this visit */\n\tscroll: VisitScroll;\n\t/** User-defined metadata */\n\tmeta: Record<string, unknown>;\n\n\tconstructor(swup: Swup, options: VisitInitOptions) {\n\t\tconst { to, from, hash, el, event } = options;\n\n\t\tthis.id = Math.random();\n\t\tthis.state = VisitState.CREATED;\n\t\tthis.from = { url: from ?? swup.location.url, hash: swup.location.hash };\n\t\tthis.to = { url: to, hash };\n\t\tthis.containers = swup.options.containers;\n\t\tthis.animation = {\n\t\t\tanimate: true,\n\t\t\twait: false,\n\t\t\tname: undefined,\n\t\t\tnative: swup.options.native,\n\t\t\tscope: swup.options.animationScope,\n\t\t\tselector: swup.options.animationSelector\n\t\t};\n\t\tthis.trigger = { el, event };\n\t\tthis.cache = {\n\t\t\tread: swup.options.cache,\n\t\t\twrite: swup.options.cache\n\t\t};\n\t\tthis.history = {\n\t\t\taction: 'push',\n\t\t\tpopstate: false,\n\t\t\tdirection: undefined\n\t\t};\n\t\tthis.scroll = {\n\t\t\treset: true,\n\t\t\ttarget: undefined\n\t\t};\n\t\tthis.meta = {};\n\t}\n\n\t/** @internal */\n\tadvance(state: VisitState) {\n\t\tif (this.state < state) {\n\t\t\tthis.state = state;\n\t\t}\n\t}\n\n\t/** @internal */\n\tabort() {\n\t\tthis.state = VisitState.ABORTED;\n\t}\n\n\tignore() {\n\t\tthis.state = VisitState.IGNORED;\n\t}\n\n\t/** Is this visit done, i.e. completed, aborted, failed, or ignored? */\n\tget done(): boolean {\n\t\treturn this.state >= VisitState.COMPLETED;\n\t}\n\n\t/** Was this visit ignored by swup, i.e. left to the browser? */\n\tget ignored(): boolean {\n\t\treturn this.state === VisitState.IGNORED;\n\t}\n}\n\n/** Create a new visit object. */\nexport function createVisit(this: Swup, options: VisitInitOptions): Visit {\n\treturn new Visit(this, options);\n}\n","import type { DelegateEvent } from 'delegate-it';\n\nimport type Swup from '../Swup.js';\nimport { isPromise, runAsPromise } from '../utils.js';\nimport { Visit } from './Visit.js';\nimport type { FetchOptions, PageData } from './fetchPage.js';\n\nexport interface HookDefinitions {\n\t'animation:out:start': undefined;\n\t'animation:out:await': { skip: boolean };\n\t'animation:out:end': undefined;\n\t'animation:in:start': undefined;\n\t'animation:in:await': { skip: boolean };\n\t'animation:in:end': undefined;\n\t'animation:skip': undefined;\n\t'cache:clear': undefined;\n\t'cache:set': { page: PageData };\n\t'content:replace': { page: PageData };\n\t'content:scroll': undefined;\n\t'enable': undefined;\n\t'disable': undefined;\n\t'fetch:request': { url: string; options: FetchOptions };\n\t'fetch:error': { url: string; status: number; response: Response };\n\t'fetch:timeout': { url: string };\n\t'history:popstate': { event: PopStateEvent };\n\t'link:click': { el: HTMLAnchorElement; event: DelegateEvent<MouseEvent> };\n\t'link:self': undefined;\n\t'link:anchor': { hash: string };\n\t'link:newtab': { href: string };\n\t'page:load': { page?: PageData; cache?: boolean; options: FetchOptions };\n\t'page:view': { url: string; title: string };\n\t'scroll:top': { options: ScrollIntoViewOptions };\n\t'scroll:anchor': { hash: string; options: ScrollIntoViewOptions };\n\t'visit:start': undefined;\n\t'visit:transition': undefined;\n\t'visit:abort': undefined;\n\t'visit:end': undefined;\n\t'visit:fail': { error: unknown };\n}\n\nexport interface HookReturnValues {\n\t'content:scroll': Promise<boolean> | boolean;\n\t'fetch:request': Promise<Response>;\n\t'page:load': Promise<PageData>;\n\t'scroll:top': boolean;\n\t'scroll:anchor': boolean;\n}\n\nexport type HookArguments<T extends HookName> = HookDefinitions[T];\n\nexport type HookName = keyof HookDefinitions;\n\nexport type HookNameWithModifier = `${HookName}.${HookModifier}`;\n\ntype HookModifier = 'once' | 'before' | 'replace';\n\n/** A generic hook handler. */\nexport type HookHandler<T extends HookName> = (\n\t/** Context about the current visit. */\n\tvisit: Visit,\n\t/** Local arguments passed into the handler. */\n\targs: HookArguments<T>\n) => Promise<unknown> | unknown;\n\n/** A default hook handler with an expected return type. */\nexport type HookDefaultHandler<T extends HookName> = (\n\t/** Context about the current visit. */\n\tvisit: Visit,\n\t/** Local arguments passed into the handler. */\n\targs: HookArguments<T>,\n\t/** Default handler to be executed. Available if replacing an internal hook handler. */\n\tdefaultHandler?: HookDefaultHandler<T>\n) => T extends keyof HookReturnValues ? HookReturnValues[T] : Promise<unknown> | unknown;\n\nexport type Handlers = {\n\t[K in HookName]: HookHandler<K>[];\n};\n\nexport type HookInitOptions = {\n\t[K in HookName as K | `${K}.${HookModifier}`]: HookHandler<K>;\n} & {\n\t[K in HookName as K | `${K}.${HookModifier}.${HookModifier}`]: HookHandler<K>;\n};\n\n/** Unregister a previously registered hook handler. */\nexport type HookUnregister = () => void;\n\n/** Define when and how a hook handler is executed. */\nexport type HookOptions = {\n\t/** Execute the hook once, then remove the handler */\n\tonce?: boolean;\n\t/** Execute the hook before the internal default handler */\n\tbefore?: boolean;\n\t/** Set a priority for when to execute this hook. Lower numbers execute first. Default: `0` */\n\tpriority?: number;\n\t/** Replace the internal default handler with this hook handler */\n\treplace?: boolean;\n};\n\nexport type HookRegistration<\n\tT extends HookName,\n\tH extends HookHandler<T> | HookDefaultHandler<T> = HookHandler<T>\n> = {\n\tid: number;\n\thook: T;\n\thandler: H;\n\tdefaultHandler?: HookDefaultHandler<T>;\n} & HookOptions;\n\ntype HookEventDetail = {\n\thook: HookName;\n\targs: unknown;\n\tvisit: Visit;\n};\n\nexport type HookEvent = CustomEvent<HookEventDetail>;\n\ntype HookLedger<T extends HookName> = Map<HookHandler<T>, HookRegistration<T>>;\n\ninterface HookRegistry extends Map<HookName, HookLedger<HookName>> {\n\tget<K extends HookName>(key: K): HookLedger<K> | undefined;\n\tset<K extends HookName>(key: K, value: HookLedger<K>): this;\n}\n\n/**\n * Hook registry.\n *\n * Create, trigger and handle hooks.\n *\n */\nexport class Hooks {\n\t/** Swup instance this registry belongs to */\n\tprotected swup: Swup;\n\n\t/** Map of all registered hook handlers. */\n\tprotected registry: HookRegistry = new Map();\n\n\t// Can we deduplicate this somehow? Or make it error when not in sync with HookDefinitions?\n\t// https://stackoverflow.com/questions/53387838/how-to-ensure-an-arrays-values-the-keys-of-a-typescript-interface/53395649\n\tprotected readonly hooks: HookName[] = [\n\t\t'animation:out:start',\n\t\t'animation:out:await',\n\t\t'animation:out:end',\n\t\t'animation:in:start',\n\t\t'animation:in:await',\n\t\t'animation:in:end',\n\t\t'animation:skip',\n\t\t'cache:clear',\n\t\t'cache:set',\n\t\t'content:replace',\n\t\t'content:scroll',\n\t\t'enable',\n\t\t'disable',\n\t\t'fetch:request',\n\t\t'fetch:error',\n\t\t'fetch:timeout',\n\t\t'history:popstate',\n\t\t'link:click',\n\t\t'link:self',\n\t\t'link:anchor',\n\t\t'link:newtab',\n\t\t'page:load',\n\t\t'page:view',\n\t\t'scroll:top',\n\t\t'scroll:anchor',\n\t\t'visit:start',\n\t\t'visit:transition',\n\t\t'visit:abort',\n\t\t'visit:end',\n\t\t'visit:fail'\n\t];\n\n\tprotected nextHookId = 0;\n\n\tconstructor(swup: Swup) {\n\t\tthis.swup = swup;\n\t\tthis.init();\n\t}\n\n\t/**\n\t * Create ledgers for all core hooks.\n\t */\n\tprotected init() {\n\t\tthis.hooks.forEach((hook) => this.create(hook));\n\t}\n\n\t/**\n\t * Create a new hook type.\n\t */\n\tcreate(hook: string) {\n\t\tif (!this.registry.has(hook as HookName)) {\n\t\t\tthis.registry.set(hook as HookName, new Map());\n\t\t}\n\t}\n\n\t/**\n\t * Check if a hook type exists.\n\t */\n\texists(hook: HookName): boolean {\n\t\treturn this.registry.has(hook);\n\t}\n\n\t/**\n\t * Get the ledger with all registrations for a hook.\n\t */\n\tprotected get<T extends HookName>(hook: T): HookLedger<T> | undefined {\n\t\tconst ledger = this.registry.get(hook);\n\t\tif (ledger) {\n\t\t\treturn ledger;\n\t\t}\n\t\tconsole.error(`Unknown hook '${hook}'`);\n\t}\n\n\t/**\n\t * Remove all handlers of all hooks.\n\t */\n\tclear() {\n\t\tthis.registry.forEach((ledger) => ledger.clear());\n\t}\n\n\t/**\n\t * Register a new hook handler.\n\t * @param hook Name of the hook to listen for\n\t * @param handler The handler function to execute\n\t * @param options Object to specify how and when the handler is executed\n\t *                Available options:\n\t *                - `once`: Only execute the handler once\n\t *                - `before`: Execute the handler before the default handler\n\t *                - `priority`: Specify the order in which the handlers are executed\n\t *                - `replace`: Replace the default handler with this handler\n\t * @returns A function to unregister the handler\n\t */\n\n\t// Overload: replacing default handler\n\ton<T extends HookName, O extends HookOptions>(hook: T, handler: HookDefaultHandler<T>, options: O & { replace: true }): HookUnregister; // prettier-ignore\n\t// Overload: passed in handler options\n\ton<T extends HookName, O extends HookOptions>(hook: T, handler: HookHandler<T>, options: O): HookUnregister; // prettier-ignore\n\t// Overload: no handler options\n\ton<T extends HookName>(hook: T, handler: HookHandler<T>): HookUnregister; // prettier-ignore\n\t// Implementation\n\ton<T extends HookName, O extends HookOptions>(\n\t\thook: T,\n\t\thandler: O['replace'] extends true ? HookDefaultHandler<T> : HookHandler<T>,\n\t\toptions: Partial<O> = {}\n\t): HookUnregister {\n\t\tconst ledger = this.get(hook);\n\t\tif (!ledger) {\n\t\t\tconsole.warn(`Hook '${hook}' not found.`);\n\t\t\treturn () => {};\n\t\t}\n\n\t\tconst id = ++this.nextHookId;\n\t\tconst registration: HookRegistration<T> = { ...options, id, hook, handler };\n\t\tledger.set(handler, registration);\n\n\t\treturn () => this.off(hook, handler);\n\t}\n\n\t/**\n\t * Register a new hook handler to run before the default handler.\n\t * Shortcut for `hooks.on(hook, handler, { before: true })`.\n\t * @param hook Name of the hook to listen for\n\t * @param handler The handler function to execute\n\t * @param options Any other event options (see `hooks.on()` for details)\n\t * @returns A function to unregister the handler\n\t * @see on\n\t */\n\t// Overload: passed in handler options\n\tbefore<T extends HookName>(hook: T, handler: HookHandler<T>, options: HookOptions): HookUnregister; // prettier-ignore\n\t// Overload: no handler options\n\tbefore<T extends HookName>(hook: T, handler: HookHandler<T>): HookUnregister;\n\t// Implementation\n\tbefore<T extends HookName>(\n\t\thook: T,\n\t\thandler: HookHandler<T>,\n\t\toptions: HookOptions = {}\n\t): HookUnregister {\n\t\treturn this.on(hook, handler, { ...options, before: true });\n\t}\n\n\t/**\n\t * Register a new hook handler to replace the default handler.\n\t * Shortcut for `hooks.on(hook, handler, { replace: true })`.\n\t * @param hook Name of the hook to listen for\n\t * @param handler The handler function to execute instead of the default handler\n\t * @param options Any other event options (see `hooks.on()` for details)\n\t * @returns A function to unregister the handler\n\t * @see on\n\t */\n\t// Overload: passed in handler options\n\treplace<T extends HookName>(hook: T, handler: HookDefaultHandler<T>, options: HookOptions): HookUnregister; // prettier-ignore\n\t// Overload: no handler options\n\treplace<T extends HookName>(hook: T, handler: HookDefaultHandler<T>): HookUnregister; // prettier-ignore\n\t// Implementation\n\treplace<T extends HookName>(\n\t\thook: T,\n\t\thandler: HookDefaultHandler<T>,\n\t\toptions: HookOptions = {}\n\t): HookUnregister {\n\t\treturn this.on(hook, handler, { ...options, replace: true });\n\t}\n\n\t/**\n\t * Register a new hook handler to run once.\n\t * Shortcut for `hooks.on(hook, handler, { once: true })`.\n\t * @param hook Name of the hook to listen for\n\t * @param handler The handler function to execute\n\t * @param options Any other event options (see `hooks.on()` for details)\n\t * @see on\n\t */\n\t// Overload: passed in handler options\n\tonce<T extends HookName>(hook: T, handler: HookHandler<T>, options: HookOptions): HookUnregister; // prettier-ignore\n\t// Overload: no handler options\n\tonce<T extends HookName>(hook: T, handler: HookHandler<T>): HookUnregister;\n\t// Implementation\n\tonce<T extends HookName>(\n\t\thook: T,\n\t\thandler: HookHandler<T>,\n\t\toptions: HookOptions = {}\n\t): HookUnregister {\n\t\treturn this.on(hook, handler, { ...options, once: true });\n\t}\n\n\t/**\n\t * Unregister a hook handler.\n\t * @param hook Name of the hook the handler is registered for\n\t * @param handler The handler function that was registered.\n\t *                If omitted, all handlers for the hook will be removed.\n\t */\n\t// Overload: unregister a specific handler\n\toff<T extends HookName>(hook: T, handler: HookHandler<T> | HookDefaultHandler<T>): void;\n\t// Overload: unregister all handlers\n\toff<T extends HookName>(hook: T): void;\n\t// Implementation\n\toff<T extends HookName>(hook: T, handler?: HookHandler<T> | HookDefaultHandler<T>): void {\n\t\tconst ledger = this.get(hook);\n\t\tif (ledger && handler) {\n\t\t\tconst deleted = ledger.delete(handler);\n\t\t\tif (!deleted) {\n\t\t\t\tconsole.warn(`Handler for hook '${hook}' not found.`);\n\t\t\t}\n\t\t} else if (ledger) {\n\t\t\tledger.clear();\n\t\t}\n\t}\n\n\t/**\n\t * Trigger a hook asynchronously, executing its default handler and all registered handlers.\n\t * Will execute all handlers in order and `await` any `Promise`s they return.\n\t * @param hook Name of the hook to trigger\n\t * @param visit The visit object this hook belongs to\n\t * @param args Arguments to pass to the handler\n\t * @param defaultHandler A default implementation of this hook to execute\n\t * @returns The resolved return value of the executed default handler\n\t */\n\t// Overload: default order of arguments\n\tasync call<T extends HookName>(hook: T, visit: Visit | undefined, args: HookArguments<T>, defaultHandler?: HookDefaultHandler<T>): Promise<Awaited<ReturnType<HookDefaultHandler<T>>>>; // prettier-ignore\n\t// Overload: legacy order of arguments, with visit missing\n\tasync call<T extends HookName>(hook: T, args: HookArguments<T>, defaultHandler?: HookDefaultHandler<T>): Promise<Awaited<ReturnType<HookDefaultHandler<T>>>>; // prettier-ignore\n\t// Implementation\n\tasync call<T extends HookName>(\n\t\thook: T,\n\t\targ1: Visit | HookArguments<T>,\n\t\targ2: HookArguments<T> | HookDefaultHandler<T>,\n\t\targ3?: HookDefaultHandler<T>\n\t): Promise<Awaited<ReturnType<HookDefaultHandler<T>>>> {\n\t\tconst [visit, args, defaultHandler] = this.parseCallArgs(hook, arg1, arg2, arg3);\n\n\t\tconst { before, handler, after } = this.getHandlers(hook, defaultHandler);\n\t\tawait this.run(before, visit, args);\n\t\tconst [result] = await this.run(handler, visit, args, true);\n\t\tawait this.run(after, visit, args);\n\t\tthis.dispatchDomEvent(hook, visit, args);\n\t\treturn result;\n\t}\n\n\t/**\n\t * Trigger a hook synchronously, executing its default handler and all registered handlers.\n\t * Will execute all handlers in order, but will **not** `await` any `Promise`s they return.\n\t * @param hook Name of the hook to trigger\n\t * @param visit The visit object this hook belongs to\n\t * @param args Arguments to pass to the handler\n\t * @param defaultHandler A default implementation of this hook to execute\n\t * @returns The (possibly unresolved) return value of the executed default handler\n\t */\n\t// Overload: default order of arguments\n\tcallSync<T extends HookName>(hook: T, visit: Visit | undefined, args: HookArguments<T>, defaultHandler?: HookDefaultHandler<T>): ReturnType<HookDefaultHandler<T>>; // prettier-ignore\n\t// Overload: legacy order of arguments, with visit missing\n\tcallSync<T extends HookName>(hook: T, args: HookArguments<T>, defaultHandler?: HookDefaultHandler<T>): ReturnType<HookDefaultHandler<T>>; // prettier-ignore\n\t// Implementation\n\tcallSync<T extends HookName>(\n\t\thook: T,\n\t\targ1: Visit | HookArguments<T>,\n\t\targ2: HookArguments<T> | HookDefaultHandler<T>,\n\t\targ3?: HookDefaultHandler<T>\n\t): ReturnType<HookDefaultHandler<T>> {\n\t\tconst [visit, args, defaultHandler] = this.parseCallArgs(hook, arg1, arg2, arg3);\n\t\tconst { before, handler, after } = this.getHandlers(hook, defaultHandler);\n\t\tthis.runSync(before, visit, args);\n\t\tconst [result] = this.runSync(handler, visit, args, true);\n\t\tthis.runSync(after, visit, args);\n\t\tthis.dispatchDomEvent(hook, visit, args);\n\t\treturn result;\n\t}\n\n\t/**\n\t * Parse the call arguments for call() and callSync() to allow legacy argument order.\n\t */\n\tprotected parseCallArgs<T extends HookName>(\n\t\thook: T,\n\t\targ1: Visit | HookArguments<T> | undefined,\n\t\targ2: HookArguments<T> | HookDefaultHandler<T>,\n\t\targ3?: HookDefaultHandler<T>\n\t): [Visit | undefined, HookArguments<T>, HookDefaultHandler<T> | undefined] {\n\t\tconst isLegacyOrder =\n\t\t\t!(arg1 instanceof Visit) && (typeof arg1 === 'object' || typeof arg2 === 'function');\n\t\tif (isLegacyOrder) {\n\t\t\t// Legacy positioning: arguments in second or handler passed in third place\n\t\t\treturn [undefined, arg1 as HookArguments<T>, arg2 as HookDefaultHandler<T>];\n\t\t} else {\n\t\t\t// Default positioning: visit passed in as first argument\n\t\t\treturn [arg1, arg2 as HookArguments<T>, arg3];\n\t\t}\n\t}\n\n\t/**\n\t * Execute the handlers for a hook, in order, as `Promise`s that will be `await`ed.\n\t * @param registrations The registrations (handler + options) to execute\n\t * @param args Arguments to pass to the handler\n\t */\n\n\t// Overload: running HookDefaultHandler: expect HookDefaultHandler return type\n\tprotected async run<T extends HookName>(registrations: HookRegistration<T, HookDefaultHandler<T>>[], visit: Visit | undefined, args: HookArguments<T>, rethrow: true): Promise<Awaited<ReturnType<HookDefaultHandler<T>>>[]>; // prettier-ignore\n\t// Overload:  running user handler: expect no specific type\n\tprotected async run<T extends HookName>(registrations: HookRegistration<T>[], visit: Visit | undefined, args: HookArguments<T>): Promise<unknown[]>; // prettier-ignore\n\t// Implementation\n\tprotected async run<T extends HookName, R extends HookRegistration<T>[]>(\n\t\tregistrations: R,\n\t\tvisit: Visit | undefined = this.swup.visit,\n\t\targs: HookArguments<T>,\n\t\trethrow: boolean = false\n\t): Promise<Awaited<ReturnType<HookDefaultHandler<T>>> | unknown[]> {\n\t\tconst results = [];\n\t\tfor (const { hook, handler, defaultHandler, once } of registrations) {\n\t\t\tif (visit?.done) continue;\n\t\t\tif (once) this.off(hook, handler);\n\t\t\ttry {\n\t\t\t\tconst result = await runAsPromise(handler, [visit, args, defaultHandler]);\n\t\t\t\tresults.push(result);\n\t\t\t} catch (error) {\n\t\t\t\tif (rethrow) {\n\t\t\t\t\tthrow error;\n\t\t\t\t} else {\n\t\t\t\t\tconsole.error(`Error in hook '${hook}':`, error);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn results;\n\t}\n\n\t/**\n\t * Execute the handlers for a hook, in order, without `await`ing any returned `Promise`s.\n\t * @param registrations The registrations (handler + options) to execute\n\t * @param args Arguments to pass to the handler\n\t */\n\n\t// Overload: running HookDefaultHandler: expect HookDefaultHandler return type\n\tprotected runSync<T extends HookName>(registrations: HookRegistration<T, HookDefaultHandler<T>>[], visit: Visit | undefined, args: HookArguments<T>, rethrow: true): ReturnType<HookDefaultHandler<T>>[]; // prettier-ignore\n\t// Overload: running user handler: expect no specific type\n\tprotected runSync<T extends HookName>(registrations: HookRegistration<T>[], visit: Visit | undefined, args: HookArguments<T>): unknown[]; // prettier-ignore\n\t// Implementation\n\tprotected runSync<T extends HookName, R extends HookRegistration<T>[]>(\n\t\tregistrations: R,\n\t\tvisit: Visit | undefined = this.swup.visit,\n\t\targs: HookArguments<T>,\n\t\trethrow: boolean = false\n\t): (ReturnType<HookDefaultHandler<T>> | unknown)[] {\n\t\tconst results = [];\n\t\tfor (const { hook, handler, defaultHandler, once } of registrations) {\n\t\t\tif (visit?.done) continue;\n\t\t\tif (once) this.off(hook, handler);\n\t\t\ttry {\n\t\t\t\tconst result = (handler as HookDefaultHandler<T>)(visit, args, defaultHandler);\n\t\t\t\tresults.push(result);\n\t\t\t\tif (isPromise(result)) {\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`Swup will not await Promises in handler for synchronous hook '${hook}'.`\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tif (rethrow) {\n\t\t\t\t\tthrow error;\n\t\t\t\t} else {\n\t\t\t\t\tconsole.error(`Error in hook '${hook}':`, error);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn results;\n\t}\n\n\t/**\n\t * Get all registered handlers for a hook, sorted by priority and registration order.\n\t * @param hook Name of the hook\n\t * @param defaultHandler The optional default handler of this hook\n\t * @returns An object with the handlers sorted into `before` and `after` arrays,\n\t *          as well as a flag indicating if the original handler was replaced\n\t */\n\tprotected getHandlers<T extends HookName>(hook: T, defaultHandler?: HookDefaultHandler<T>) {\n\t\tconst ledger = this.get(hook);\n\t\tif (!ledger) {\n\t\t\treturn { found: false, before: [], handler: [], after: [], replaced: false };\n\t\t}\n\n\t\tconst registrations = Array.from(ledger.values());\n\n\t\t// Let TypeScript know that replaced handlers are default handlers by filtering to true\n\t\tconst def = (T: HookRegistration<T>): T is HookRegistration<T, HookDefaultHandler<T>> => true; // prettier-ignore\n\t\tconst sort = this.sortRegistrations;\n\n\t\t// Filter into before, after, and replace handlers\n\t\tconst before = registrations.filter(({ before, replace }) => before && !replace).sort(sort);\n\t\tconst replace = registrations.filter(({ replace }) => replace).filter(def).sort(sort); // prettier-ignore\n\t\tconst after = registrations.filter(({ before, replace }) => !before && !replace).sort(sort);\n\t\tconst replaced = replace.length > 0;\n\n\t\t// Define main handler registration\n\t\t// Created as HookRegistration[] array to allow passing it into hooks.run() directly\n\t\tlet handler: HookRegistration<T, HookDefaultHandler<T>>[] = [];\n\t\tif (defaultHandler) {\n\t\t\thandler = [{ id: 0, hook, handler: defaultHandler }];\n\t\t\tif (replaced) {\n\t\t\t\tconst index = replace.length - 1;\n\t\t\t\tconst { handler: replacingHandler, once } = replace[index];\n\t\t\t\tconst createDefaultHandler = (index: number): HookDefaultHandler<T> | undefined => {\n\t\t\t\t\tconst next = replace[index - 1];\n\t\t\t\t\tif (next) {\n\t\t\t\t\t\treturn (visit, args) =>\n\t\t\t\t\t\t\tnext.handler(visit, args, createDefaultHandler(index - 1));\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn defaultHandler;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tconst nestedDefaultHandler = createDefaultHandler(index);\n\t\t\t\thandler = [{ id: 0, hook, once, handler: replacingHandler, defaultHandler: nestedDefaultHandler }]; // prettier-ignore\n\t\t\t}\n\t\t}\n\n\t\treturn { found: true, before, handler, after, replaced };\n\t}\n\n\t/**\n\t * Sort two hook registrations by priority and registration order.\n\t * @param a The registration object to compare\n\t * @param b The other registration object to compare with\n\t * @returns The sort direction\n\t */\n\tprotected sortRegistrations<T extends HookName>(\n\t\ta: HookRegistration<T>,\n\t\tb: HookRegistration<T>\n\t): number {\n\t\tconst priority = (a.priority ?? 0) - (b.priority ?? 0);\n\t\tconst id = a.id - b.id;\n\t\treturn priority || id || 0;\n\t}\n\n\t/**\n\t * Dispatch a custom event on the `document` for a hook. Prefixed with `swup:`\n\t * @param hook Name of the hook.\n\t */\n\tprotected dispatchDomEvent<T extends HookName>(\n\t\thook: T,\n\t\tvisit: Visit | undefined,\n\t\targs?: HookArguments<T>\n\t): void {\n\t\tif (visit?.done) return;\n\n\t\tconst detail: HookEventDetail = { hook, args, visit: visit || this.swup.visit };\n\t\tdocument.dispatchEvent(\n\t\t\tnew CustomEvent<HookEventDetail>(`swup:any`, { detail, bubbles: true })\n\t\t);\n\t\tdocument.dispatchEvent(\n\t\t\tnew CustomEvent<HookEventDetail>(`swup:${hook}`, { detail, bubbles: true })\n\t\t);\n\t}\n\n\t/**\n\t * Parse a hook name into the name and any modifiers.\n\t * @param hook Name of the hook.\n\t */\n\tparseName(hook: HookName | HookNameWithModifier): [HookName, Partial<HookOptions>] {\n\t\tconst [name, ...modifiers] = hook.split('.');\n\t\tconst options = modifiers.reduce((acc, mod) => ({ ...acc, [mod]: true }), {});\n\t\treturn [name as HookName, options];\n\t}\n}\n","import { query } from '../utils.js';\n\n/**\n * Find the anchor element for a given hash.\n *\n * @param hash Hash with or without leading '#'\n * @returns The element, if found, or null.\n *\n * @see https://html.spec.whatwg.org/#find-a-potential-indicated-element\n */\nexport const getAnchorElement = (hash?: string): Element | null => {\n\tif (hash && hash.charAt(0) === '#') {\n\t\thash = hash.substring(1);\n\t}\n\n\tif (!hash) {\n\t\treturn null;\n\t}\n\n\tconst decoded = decodeURIComponent(hash);\n\tlet element =\n\t\tdocument.getElementById(hash) ||\n\t\tdocument.getElementById(decoded) ||\n\t\tquery(`a[name='${CSS.escape(hash)}']`) ||\n\t\tquery(`a[name='${CSS.escape(decoded)}']`);\n\n\tif (!element && hash === 'top') {\n\t\telement = document.body;\n\t}\n\n\treturn element;\n};\n","import { queryAll } from '../utils.js';\nimport type Swup from '../Swup.js';\nimport type { Options } from '../Swup.js';\n\nconst TRANSITION = 'transition';\nconst ANIMATION = 'animation';\n\ntype AnimationType = typeof TRANSITION | typeof ANIMATION;\ntype AnimationEndEvent = `${AnimationType}end`;\ntype AnimationProperty = 'Delay' | 'Duration';\ntype AnimationStyleKey = `${AnimationType}${AnimationProperty}` | 'transitionProperty';\n\nexport type AnimationDirection = 'in' | 'out';\n\n/**\n * Return a Promise that resolves when all CSS animations and transitions\n * are done on the page. Filters by selector or takes elements directly.\n */\nexport async function awaitAnimations(\n\tthis: Swup,\n\t{\n\t\tselector,\n\t\telements\n\t}: {\n\t\tselector: Options['animationSelector'];\n\t\telements?: NodeListOf<HTMLElement> | HTMLElement[];\n\t}\n): Promise<void> {\n\t// Allow usage of swup without animations: { animationSelector: false }\n\tif (selector === false && !elements) {\n\t\treturn;\n\t}\n\n\t// Allow passing in elements\n\tlet animatedElements: HTMLElement[] = [];\n\tif (elements) {\n\t\tanimatedElements = Array.from(elements);\n\t} else if (selector) {\n\t\tanimatedElements = queryAll(selector, document.body);\n\t\t// Warn if no elements match the selector, but keep things going\n\t\tif (!animatedElements.length) {\n\t\t\tconsole.warn(`[swup] No elements found matching animationSelector \\`${selector}\\``);\n\t\t\treturn;\n\t\t}\n\t}\n\n\tconst awaitedAnimations = animatedElements\n\t\t.map((el) => awaitAnimationsOnElement(el))\n\t\t.filter((p): p is Promise<void> => p !== false);\n\n\tif (!awaitedAnimations.length) {\n\t\tif (selector) {\n\t\t\tconsole.warn(\n\t\t\t\t`[swup] No CSS animation duration defined on elements matching \\`${selector}\\``\n\t\t\t);\n\t\t}\n\t\treturn;\n\t}\n\n\tawait Promise.all(awaitedAnimations);\n}\n\nfunction awaitAnimationsOnElement(element: HTMLElement): Promise<void> | false {\n\tconst { type, timeout, propCount } = getTransitionInfo(element);\n\n\t// Resolve immediately if no transition defined\n\tif (!type || !timeout) {\n\t\treturn false;\n\t}\n\n\treturn new Promise((resolve) => {\n\t\tconst endEvent: AnimationEndEvent = `${type}end`;\n\t\tconst startTime = performance.now();\n\t\tlet propsTransitioned = 0;\n\n\t\tconst end = () => {\n\t\t\telement.removeEventListener(endEvent, onEnd);\n\t\t\tresolve();\n\t\t};\n\n\t\tconst onEnd = (event: TransitionEvent | AnimationEvent) => {\n\t\t\t// Skip transitions on child elements\n\t\t\tif (event.target !== element) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Skip transitions that happened before we started listening\n\t\t\tconst elapsedTime = (performance.now() - startTime) / 1000;\n\t\t\tif (elapsedTime < event.elapsedTime) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// End if all properties have transitioned\n\t\t\tif (++propsTransitioned >= propCount) {\n\t\t\t\tend();\n\t\t\t}\n\t\t};\n\n\t\tsetTimeout(() => {\n\t\t\tif (propsTransitioned < propCount) {\n\t\t\t\tend();\n\t\t\t}\n\t\t}, timeout + 1);\n\n\t\telement.addEventListener(endEvent, onEnd);\n\t});\n}\n\nfunction getTransitionInfo(element: Element) {\n\tconst styles = window.getComputedStyle(element);\n\n\tconst transitionDelays = getStyleProperties(styles, `${TRANSITION}Delay`);\n\tconst transitionDurations = getStyleProperties(styles, `${TRANSITION}Duration`);\n\tconst transitionTimeout = calculateTimeout(transitionDelays, transitionDurations);\n\n\tconst animationDelays = getStyleProperties(styles, `${ANIMATION}Delay`);\n\tconst animationDurations = getStyleProperties(styles, `${ANIMATION}Duration`);\n\tconst animationTimeout = calculateTimeout(animationDelays, animationDurations);\n\n\tconst timeout = Math.max(transitionTimeout, animationTimeout);\n\tconst type: AnimationType | null =\n\t\ttimeout > 0 ? (transitionTimeout > animationTimeout ? TRANSITION : ANIMATION) : null;\n\tconst propCount = type\n\t\t? type === TRANSITION\n\t\t\t? transitionDurations.length\n\t\t\t: animationDurations.length\n\t\t: 0;\n\n\treturn {\n\t\ttype,\n\t\ttimeout,\n\t\tpropCount\n\t};\n}\n\nexport function getStyleProperties(styles: CSSStyleDeclaration, key: AnimationStyleKey): string[] {\n\treturn (styles[key] || '').split(', ');\n}\n\nexport function calculateTimeout(delays: string[], durations: string[]): number {\n\twhile (delays.length < durations.length) {\n\t\tdelays = delays.concat(delays);\n\t}\n\n\treturn Math.max(...durations.map((duration, i) => toMs(duration) + toMs(delays[i])));\n}\n\nexport function toMs(time: string): number {\n\treturn parseFloat(time) * 1000;\n}\n","import type Swup from '../Swup.js';\nimport { FetchError, type FetchOptions, type PageData } from './fetchPage.js';\nimport { type VisitInitOptions, type Visit, VisitState } from './Visit.js';\nimport {\n\tcreateHistoryRecord,\n\tupdateHistoryRecord,\n\tgetCurrentUrl,\n\tLocation,\n\tclassify\n} from '../helpers.js';\nimport { getContextualAttr } from '../utils.js';\n\nexport type HistoryAction = 'push' | 'replace';\nexport type HistoryDirection = 'forwards' | 'backwards';\nexport type NavigationToSelfAction = 'scroll' | 'navigate';\nexport type CacheControl = Partial<{ read: boolean; write: boolean }>;\n\n/** Define how to navigate to a page. */\ntype NavigationOptions = {\n\t/** Whether this visit is animated. Default: `true` */\n\tanimate?: boolean;\n\t/** Name of a custom animation to run. */\n\tanimation?: string;\n\t/** History action to perform: `push` for creating a new history entry, `replace` for replacing the current entry. Default: `push` */\n\thistory?: HistoryAction;\n\t/** Whether this visit should read from or write to the cache. */\n\tcache?: CacheControl;\n\t/** Custom metadata associated with this visit. */\n\tmeta?: Record<string, unknown>;\n};\n\n/**\n * Navigate to a new URL.\n * @param url The URL to navigate to.\n * @param options Options for how to perform this visit.\n * @returns Promise<void>\n */\nexport function navigate(\n\tthis: Swup,\n\turl: string,\n\toptions: NavigationOptions & FetchOptions = {},\n\tinit: Omit<VisitInitOptions, 'to'> = {}\n) {\n\tif (typeof url !== 'string') {\n\t\tthrow new Error(`swup.navigate() requires a URL parameter`);\n\t}\n\n\t// Check if the visit should be ignored\n\tif (this.shouldIgnoreVisit(url, { el: init.el, event: init.event })) {\n\t\twindow.location.assign(url);\n\t\treturn;\n\t}\n\n\tconst { url: to, hash } = Location.fromUrl(url);\n\n\tconst visit = this.createVisit({ ...init, to, hash });\n\tthis.performNavigation(visit, options);\n}\n\n/**\n * Start a visit to a new URL.\n *\n * Internal method that assumes the visit context has already been created.\n *\n * As a user, you should call `swup.navigate(url)` instead.\n *\n * @param url The URL to navigate to.\n * @param options Options for how to perform this visit.\n * @returns Promise<void>\n */\nexport async function performNavigation(\n\tthis: Swup,\n\tvisit: Visit,\n\toptions: NavigationOptions & FetchOptions = {}\n): Promise<void> {\n\tif (this.navigating) {\n\t\tif (this.visit.state >= VisitState.ENTERING) {\n\t\t\t// Currently navigating and content already loaded? Finish and queue\n\t\t\tvisit.state = VisitState.QUEUED;\n\t\t\tthis.onVisitEnd = () => this.performNavigation(visit, options);\n\t\t\treturn;\n\t\t} else {\n\t\t\t// Currently navigating and content not loaded? Abort running visit\n\t\t\tawait this.hooks.call('visit:abort', this.visit, undefined);\n\t\t\tdelete this.visit.to.document;\n\t\t\tthis.visit.state = VisitState.ABORTED;\n\t\t}\n\t}\n\n\tthis.navigating = true;\n\tthis.visit = visit;\n\n\tconst { el } = visit.trigger;\n\toptions.referrer = options.referrer || this.location.url;\n\n\tif (options.animate === false) {\n\t\tvisit.animation.animate = false;\n\t}\n\n\t// Clean up old animation classes\n\tif (!visit.animation.animate) {\n\t\tthis.classes.clear();\n\t}\n\n\t// Get history action from option or attribute on trigger element\n\tconst history = options.history || getContextualAttr(el, 'data-swup-history');\n\tif (typeof history === 'string' && ['push', 'replace'].includes(history)) {\n\t\tvisit.history.action = history as HistoryAction;\n\t}\n\n\t// Get custom animation name from option or attribute on trigger element\n\tconst animation = options.animation || getContextualAttr(el, 'data-swup-animation');\n\tif (typeof animation === 'string') {\n\t\tvisit.animation.name = animation;\n\t}\n\n\t// Get custom metadata from option\n\tvisit.meta = options.meta || {};\n\n\t// Sanitize cache option\n\tif (typeof options.cache === 'object') {\n\t\tvisit.cache.read = options.cache.read ?? visit.cache.read;\n\t\tvisit.cache.write = options.cache.write ?? visit.cache.write;\n\t} else if (options.cache !== undefined) {\n\t\tvisit.cache = { read: !!options.cache, write: !!options.cache };\n\t}\n\t// Delete this so that window.fetch doesn't misinterpret it\n\tdelete options.cache;\n\n\ttry {\n\t\tawait this.hooks.call('visit:start', visit, undefined);\n\n\t\tvisit.state = VisitState.STARTED;\n\n\t\t// Begin loading page\n\t\tconst page = this.hooks.call('page:load', visit, { options }, async (visit, args) => {\n\t\t\t// Read from cache\n\t\t\tlet cachedPage: PageData | undefined;\n\t\t\tif (visit.cache.read) {\n\t\t\t\tcachedPage = this.cache.get(visit.to.url);\n\t\t\t}\n\n\t\t\targs.page = cachedPage || (await this.fetchPage(visit.to.url, args.options));\n\t\t\targs.cache = !!cachedPage;\n\n\t\t\treturn args.page;\n\t\t});\n\n\t\t/**\n\t\t * When the page is loaded: mark the visit as loaded and save\n\t\t * the raw html and a parsed document of the received page in the visit object\n\t\t */\n\t\tpage.then(({ html }) => {\n\t\t\tvisit.advance(VisitState.LOADED);\n\t\t\tvisit.to.html = html;\n\t\t\tvisit.to.document = new DOMParser().parseFromString(html, 'text/html');\n\t\t});\n\n\t\t// Create/update history record if this is not a popstate call or leads to the same URL\n\t\tconst newUrl = visit.to.url + visit.to.hash;\n\t\tif (!visit.history.popstate) {\n\t\t\tif (visit.history.action === 'replace' || visit.to.url === this.location.url) {\n\t\t\t\tupdateHistoryRecord(newUrl);\n\t\t\t} else {\n\t\t\t\tthis.currentHistoryIndex++;\n\t\t\t\tcreateHistoryRecord(newUrl, { index: this.currentHistoryIndex });\n\t\t\t}\n\t\t}\n\t\tthis.location = Location.fromUrl(newUrl);\n\n\t\t// Mark visit type with classes\n\t\tif (visit.history.popstate) {\n\t\t\tthis.classes.add('is-popstate');\n\t\t}\n\t\tif (visit.animation.name) {\n\t\t\tthis.classes.add(`to-${classify(visit.animation.name)}`);\n\t\t}\n\n\t\t// Wait for page before starting to animate out?\n\t\tif (visit.animation.wait) {\n\t\t\tawait page;\n\t\t}\n\n\t\t// Ignored in the meantime? Throw to trigger catch block and exit visit\n\t\tif (visit.ignored) {\n\t\t\tthrow new Error(`Visit to ${visit.to.url} manually ignored`);\n\t\t}\n\n\t\t// Check if failed/aborted in the meantime\n\t\tif (visit.done) return;\n\n\t\t// Perform the actual transition: animate and replace content\n\t\tawait this.hooks.call('visit:transition', visit, undefined, async () => {\n\t\t\t// No animation? Just await page and render\n\t\t\tif (!visit.animation.animate) {\n\t\t\t\tawait this.hooks.call('animation:skip', undefined);\n\t\t\t\tawait this.renderPage(visit, await page);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Animate page out, render page, animate page in\n\t\t\tvisit.advance(VisitState.LEAVING);\n\t\t\tawait this.animatePageOut(visit);\n\t\t\tif (visit.animation.native && document.startViewTransition) {\n\t\t\t\tawait document.startViewTransition(\n\t\t\t\t\tasync () => await this.renderPage(visit, await page)\n\t\t\t\t).finished;\n\t\t\t} else {\n\t\t\t\tawait this.renderPage(visit, await page);\n\t\t\t}\n\t\t\tawait this.animatePageIn(visit);\n\t\t});\n\n\t\t// Check if failed/aborted in the meantime\n\t\tif (visit.done) return;\n\n\t\t// Finalize visit\n\t\tawait this.hooks.call('visit:end', visit, undefined, () => this.classes.clear());\n\t\tvisit.state = VisitState.COMPLETED;\n\n\t\t// Needs to happen here and in finally {} to fix race condition with superseded visits\n\t\tthis.navigating = false;\n\n\t\t/** Run eventually queued function */\n\t\tif (this.onVisitEnd) {\n\t\t\tthis.onVisitEnd();\n\t\t\tthis.onVisitEnd = undefined;\n\t\t}\n\t} catch (error) {\n\t\t// Return early if error is undefined or signals an aborted request\n\t\tif (!error || (error as FetchError)?.aborted) {\n\t\t\tvisit.advance(VisitState.ABORTED);\n\t\t\treturn;\n\t\t}\n\n\t\t// Ignored visits are handed to the browser to navigate\n\t\tif (visit.ignored) {\n\t\t\tperformNativeNavigation.call(this, visit);\n\t\t\treturn;\n\t\t}\n\n\t\t// Failed visits are logged & handed to the browser, but we allow customizing the behavior\n\t\tawait this.hooks.call('visit:fail', visit, { error }, (visit, { error }) => {\n\t\t\tconsole.error(error);\n\t\t\tperformNativeNavigation.call(this, visit);\n\t\t});\n\n\t\t// Marking as failed is the last step to allow all hooks to execute\n\t\tvisit.advance(VisitState.FAILED);\n\t} finally {\n\t\tdelete visit.to.document;\n\t\t// Release pipeline unless a new visit has claimed it\n\t\tif (this.visit === visit) {\n\t\t\tthis.navigating = false;\n\t\t}\n\t}\n}\n\n/**\n * Navigate to a visit's url natively in the browser, without leaving incomplete history entries behind.\n */\nfunction performNativeNavigation(this: Swup, visit: Visit): void {\n\tconst url = visit.to.url + visit.to.hash;\n\tif (getCurrentUrl() === visit.to.url) {\n\t\t// History state was already moved forward to reflect this visit's target url\n\t\t// Bind a custom popstate handler and go back to unwind the current history entry\n\t\twindow.removeEventListener('popstate', this.handlePopState);\n\t\twindow.addEventListener('popstate', () => window.location.assign(url), { once: true });\n\t\twindow.history.back();\n\t} else {\n\t\t// History was never touched: the current entry is intact and we can just leave\n\t\twindow.location.assign(url);\n\t}\n}\n","import type Swup from '../Swup.js';\nimport type { Visit } from './Visit.js';\n\n/**\n * Perform the out/leave animation of the current page.\n * @returns Promise<void>\n */\nexport const animatePageOut = async function (this: Swup, visit: Visit) {\n\tawait this.hooks.call('animation:out:start', visit, undefined, () => {\n\t\tthis.classes.add('is-changing', 'is-animating', 'is-leaving');\n\t});\n\n\tawait this.hooks.call('animation:out:await', visit, { skip: false }, (visit, { skip }) => {\n\t\tif (skip) return;\n\t\treturn this.awaitAnimations({ selector: visit.animation.selector });\n\t});\n\n\tawait this.hooks.call('animation:out:end', visit, undefined);\n};\n","import type Swup from '../Swup.js';\nimport { query, queryAll } from '../utils.js';\nimport type { Visit } from './Visit.js';\n\n/**\n * Perform the replacement of content after loading a page.\n *\n * @returns Whether all containers were replaced.\n */\nexport const replaceContent = function (this: Swup, visit: Visit): boolean {\n\tconst incomingDocument = visit.to.document;\n\tif (!incomingDocument) return false;\n\n\t// Update browser title\n\tconst title = incomingDocument.querySelector('title')?.innerText || '';\n\tdocument.title = title;\n\n\t// Save persisted elements\n\tconst persistedElements = queryAll('[data-swup-persist]:not([data-swup-persist=\"\"])');\n\n\t// Update content containers\n\tconst replaced = visit.containers\n\t\t.map((selector) => {\n\t\t\tconst currentEl = document.querySelector(selector);\n\t\t\tconst incomingEl = incomingDocument.querySelector(selector);\n\t\t\tif (currentEl && incomingEl) {\n\t\t\t\tcurrentEl.replaceWith(incomingEl.cloneNode(true));\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (!currentEl) {\n\t\t\t\tconsole.warn(`[swup] Container missing in current document: ${selector}`);\n\t\t\t}\n\t\t\tif (!incomingEl) {\n\t\t\t\tconsole.warn(`[swup] Container missing in incoming document: ${selector}`);\n\t\t\t}\n\t\t\treturn false;\n\t\t})\n\t\t.filter(Boolean);\n\n\t// Restore persisted elements\n\tpersistedElements.forEach((existing) => {\n\t\tconst key = existing.getAttribute('data-swup-persist');\n\t\tconst replacement = query(`[data-swup-persist=\"${key}\"]`);\n\t\tif (replacement && replacement !== existing) {\n\t\t\treplacement.replaceWith(existing);\n\t\t}\n\t});\n\n\t// Return true if all containers were replaced\n\treturn replaced.length === visit.containers.length;\n};\n","import type Swup from '../Swup.js';\nimport type { Visit } from './Visit.js';\n\n/**\n * Update the scroll position after page render.\n * @returns Promise<boolean>\n */\nexport const scrollToContent = function (this: Swup, visit: Visit): boolean {\n\tconst options: ScrollIntoViewOptions = { behavior: 'auto' };\n\tconst { target, reset } = visit.scroll;\n\tconst scrollTarget = target ?? visit.to.hash;\n\n\tlet scrolled = false;\n\n\tif (scrollTarget) {\n\t\tscrolled = this.hooks.callSync(\n\t\t\t'scroll:anchor',\n\t\t\tvisit,\n\t\t\t{ hash: scrollTarget, options },\n\t\t\t(visit, { hash, options }) => {\n\t\t\t\tconst anchor = this.getAnchorElement(hash);\n\t\t\t\tif (anchor) {\n\t\t\t\t\tanchor.scrollIntoView(options);\n\t\t\t\t}\n\t\t\t\treturn !!anchor;\n\t\t\t}\n\t\t);\n\t}\n\n\tif (reset && !scrolled) {\n\t\tscrolled = this.hooks.callSync('scroll:top', visit, { options }, (visit, { options }) => {\n\t\t\twindow.scrollTo({ top: 0, left: 0, ...options });\n\t\t\treturn true;\n\t\t});\n\t}\n\n\treturn scrolled;\n};\n","import type Swup from '../Swup.js';\nimport { nextTick } from '../utils.js';\nimport type { Visit } from './Visit.js';\n\n/**\n * Perform the in/enter animation of the next page.\n * @returns Promise<void>\n */\nexport const animatePageIn = async function (this: Swup, visit: Visit) {\n\t// Check if failed/aborted in the meantime\n\tif (visit.done) return;\n\n\tconst animation = this.hooks.call(\n\t\t'animation:in:await',\n\t\tvisit,\n\t\t{ skip: false },\n\t\t(visit, { skip }) => {\n\t\t\tif (skip) return;\n\t\t\treturn this.awaitAnimations({ selector: visit.animation.selector });\n\t\t}\n\t);\n\n\tawait nextTick();\n\n\tawait this.hooks.call('animation:in:start', visit, undefined, () => {\n\t\tthis.classes.remove('is-animating');\n\t});\n\n\tawait animation;\n\n\tawait this.hooks.call('animation:in:end', visit, undefined);\n};\n","import { updateHistoryRecord, getCurrentUrl, classify, Location } from '../helpers.js';\nimport type Swup from '../Swup.js';\nimport type { PageData } from './fetchPage.js';\nimport { VisitState, type Visit } from './Visit.js';\n\n/**\n * Render the next page: replace the content and update scroll position.\n */\nexport const renderPage = async function (this: Swup, visit: Visit, page: PageData): Promise<void> {\n\t// Check if failed/aborted in the meantime\n\tif (visit.done) return;\n\n\tvisit.advance(VisitState.ENTERING);\n\n\tconst { url } = page;\n\n\t// update state if the url was redirected\n\tif (!this.isSameResolvedUrl(getCurrentUrl(), url)) {\n\t\tupdateHistoryRecord(url);\n\t\tthis.location = Location.fromUrl(url);\n\t\tvisit.to.url = this.location.url;\n\t\tvisit.to.hash = this.location.hash;\n\t}\n\n\t// replace content: allow handlers and plugins to overwrite paga data and containers\n\tawait this.hooks.call('content:replace', visit, { page }, (visit, { page }) => {\n\t\tthis.classes.remove('is-leaving');\n\t\t// only add for animated page loads\n\t\tif (visit.animation.animate) {\n\t\t\tthis.classes.add('is-rendering');\n\t\t}\n\t\tconst success = this.replaceContent(visit);\n\t\tif (!success) {\n\t\t\tthrow new Error('[swup] Container mismatch, aborting');\n\t\t}\n\t\tif (visit.animation.animate) {\n\t\t\t// Make sure to add these classes to new containers as well\n\t\t\tthis.classes.add('is-changing', 'is-animating', 'is-rendering');\n\t\t\tif (visit.animation.name) {\n\t\t\t\tthis.classes.add(`to-${classify(visit.animation.name)}`);\n\t\t\t}\n\t\t}\n\t});\n\n\t// scroll into view: either anchor or top of page\n\tawait this.hooks.call('content:scroll', visit, undefined, () => {\n\t\treturn this.scrollToContent(visit);\n\t});\n\n\tawait this.hooks.call('page:view', visit, { url: this.location.url, title: document.title });\n};\n","import type Swup from '../Swup.js';\n\nexport type Plugin = {\n\t/** Identify as a swup plugin */\n\tisSwupPlugin: true;\n\t/** Name of this plugin */\n\tname: string;\n\t/** Version of this plugin. Currently not in use, defined here for backward compatibility. */\n\tversion?: string;\n\t/** The swup instance that mounted this plugin */\n\tswup?: Swup;\n\t/** Version requirements of this plugin. Example: `{ swup: '>=4' }` */\n\trequires?: Record<string, string | string[]>;\n\t/** Run on mount */\n\tmount: () => void;\n\t/** Run on unmount */\n\tunmount: () => void;\n\t_beforeMount?: () => void;\n\t_afterUnmount?: () => void;\n\t_checkRequirements?: () => boolean;\n};\n\nconst isSwupPlugin = (maybeInvalidPlugin: unknown): maybeInvalidPlugin is Plugin => {\n\t// @ts-ignore: this might be anything, object or no\n\treturn Boolean(maybeInvalidPlugin?.isSwupPlugin);\n};\n\n/** Install a plugin. */\nexport const use = function (this: Swup, plugin: unknown) {\n\tif (!isSwupPlugin(plugin)) {\n\t\tconsole.error('Not a swup plugin instance', plugin);\n\t\treturn;\n\t}\n\n\tplugin.swup = this;\n\tif (plugin._checkRequirements) {\n\t\tif (!plugin._checkRequirements()) {\n\t\t\treturn;\n\t\t}\n\t}\n\tif (plugin._beforeMount) {\n\t\tplugin._beforeMount();\n\t}\n\tplugin.mount();\n\n\tthis.plugins.push(plugin);\n\n\treturn this.plugins;\n};\n\n/** Uninstall a plugin. */\nexport function unuse(this: Swup, pluginOrName: Plugin | string) {\n\tconst plugin = this.findPlugin(pluginOrName);\n\tif (!plugin) {\n\t\tconsole.error('No such plugin', plugin);\n\t\treturn;\n\t}\n\n\tplugin.unmount();\n\tif (plugin._afterUnmount) {\n\t\tplugin._afterUnmount();\n\t}\n\n\tthis.plugins = this.plugins.filter((p) => p !== plugin);\n\n\treturn this.plugins;\n}\n\n/** Find a plugin by name or reference. */\nexport function findPlugin(this: Swup, pluginOrName: Plugin | string) {\n\treturn this.plugins.find((plugin) => {\n\t\treturn typeof pluginOrName === 'string'\n\t\t\t? [`Swup${pluginOrName}`, pluginOrName].includes(plugin.name)\n\t\t\t: plugin === pluginOrName;\n\t});\n}\n","import type Swup from '../Swup.js';\n\n/**\n * Utility function to validate and run the global option 'resolveUrl'\n * @param {string} url\n * @returns {string} the resolved url\n */\nexport function resolveUrl(this: Swup, url: string): string {\n\tif (typeof this.options.resolveUrl !== 'function') {\n\t\tconsole.warn(`[swup] options.resolveUrl expects a callback function.`);\n\t\treturn url;\n\t}\n\tconst result = this.options.resolveUrl(url);\n\tif (!result || typeof result !== 'string') {\n\t\tconsole.warn(`[swup] options.resolveUrl needs to return a url`);\n\t\treturn url;\n\t}\n\tif (result.startsWith('//') || result.startsWith('http')) {\n\t\tconsole.warn(`[swup] options.resolveUrl needs to return a relative url`);\n\t\treturn url;\n\t}\n\treturn result;\n}\n\n/**\n * Compares the resolved version of two paths and returns true if they are the same\n * @param {string} url1\n * @param {string} url2\n * @returns {boolean}\n */\nexport function isSameResolvedUrl(this: Swup, url1: string, url2: string): boolean {\n\treturn this.resolveUrl(url1) === this.resolveUrl(url2);\n}\n","import { type DelegateEvent } from 'delegate-it';\n\nimport version from './config/version.js';\n\nimport { delegateEvent, getCurrentUrl, Location, updateHistoryRecord } from './helpers.js';\nimport { type DelegateEventUnsubscribe } from './helpers/delegateEvent.js';\n\nimport { Cache } from './modules/Cache.js';\nimport { Classes } from './modules/Classes.js';\nimport { type Visit, createVisit } from './modules/Visit.js';\nimport { Hooks, type HookName, type HookInitOptions } from './modules/Hooks.js';\nimport { getAnchorElement } from './modules/getAnchorElement.js';\nimport { awaitAnimations } from './modules/awaitAnimations.js';\nimport { navigate, performNavigation, type NavigationToSelfAction } from './modules/navigate.js';\nimport { fetchPage } from './modules/fetchPage.js';\nimport { animatePageOut } from './modules/animatePageOut.js';\nimport { replaceContent } from './modules/replaceContent.js';\nimport { scrollToContent } from './modules/scrollToContent.js';\nimport { animatePageIn } from './modules/animatePageIn.js';\nimport { renderPage } from './modules/renderPage.js';\nimport { use, unuse, findPlugin, type Plugin } from './modules/plugins.js';\nimport { isSameResolvedUrl, resolveUrl } from './modules/resolveUrl.js';\nimport { nextTick } from './utils.js';\nimport { type HistoryState } from './helpers/history.js';\n\n/** Options for customizing swup's behavior. */\nexport type Options = {\n\t/** Whether history visits are animated. Default: `false` */\n\tanimateHistoryBrowsing: boolean;\n\t/** Selector for detecting animation timing. Default: `[class*=\"transition-\"]` */\n\tanimationSelector: string | false;\n\t/** Elements on which to add animation classes. Default: `html` element */\n\tanimationScope: 'html' | 'containers';\n\t/** Enable in-memory page cache. Default: `true` */\n\tcache: boolean;\n\t/** Content containers to be replaced on page visits. Default: `['#swup']` */\n\tcontainers: string[];\n\t/** Callback for ignoring visits. Receives the element and event that triggered the visit. */\n\tignoreVisit: (url: string, { el, event }: { el?: Element; event?: Event }) => boolean;\n\t/** Selector for links that trigger visits. Default: `'a[href]'` */\n\tlinkSelector: string;\n\t/** How swup handles links to the same page. Default: `scroll` */\n\tlinkToSelf: NavigationToSelfAction;\n\t/** Enable native animations using the View Transitions API. */\n\tnative: boolean;\n\t/** Hook handlers to register. */\n\thooks: Partial<HookInitOptions>;\n\t/** Plugins to register on startup. */\n\tplugins: Plugin[];\n\t/** Custom headers sent along with fetch requests. */\n\trequestHeaders: Record<string, string>;\n\t/** Rewrite URLs before loading them. */\n\tresolveUrl: (url: string) => string;\n\t/** Callback for telling swup to ignore certain popstate events.  */\n\tskipPopStateHandling: (event: PopStateEvent) => boolean;\n\t/** Request timeout in milliseconds. */\n\ttimeout: number;\n};\n\nconst defaults: Options = {\n\tanimateHistoryBrowsing: false,\n\tanimationSelector: '[class*=\"transition-\"]',\n\tanimationScope: 'html',\n\tcache: true,\n\tcontainers: ['#swup'],\n\thooks: {},\n\tignoreVisit: (url, { el } = {}) => !!el?.closest('[data-no-swup]'),\n\tlinkSelector: 'a[href]',\n\tlinkToSelf: 'scroll',\n\tnative: false,\n\tplugins: [],\n\tresolveUrl: (url) => url,\n\trequestHeaders: {\n\t\t'X-Requested-With': 'swup',\n\t\t'Accept': 'text/html, application/xhtml+xml'\n\t},\n\tskipPopStateHandling: (event) => (event.state as HistoryState)?.source !== 'swup',\n\ttimeout: 0\n};\n\n/** Swup page transition library. */\nexport default class Swup {\n\t/** Library version */\n\treadonly version: string = version;\n\t/** Options passed into the instance */\n\toptions: Options;\n\t/** Default options before merging user options */\n\treadonly defaults: Options = defaults;\n\t/** Registered plugin instances */\n\tplugins: Plugin[] = [];\n\t/** Data about the current visit */\n\tvisit: Visit;\n\t/** Cache instance */\n\treadonly cache: Cache;\n\t/** Hook registry */\n\treadonly hooks: Hooks;\n\t/** Animation class manager */\n\treadonly classes: Classes;\n\t/** Location of the currently visible page */\n\tlocation: Location = Location.fromUrl(window.location.href);\n\t/** URL of the currently visible page @deprecated Use swup.location.url instead */\n\tget currentPageUrl(): string {\n\t\treturn this.location.url;\n\t}\n\t/** Index of the current history entry */\n\tprotected currentHistoryIndex: number;\n\t/** Delegated event subscription handle */\n\tprotected clickDelegate?: DelegateEventUnsubscribe;\n\t/** Navigation status */\n\tprotected navigating: boolean = false;\n\t/** Run anytime a visit ends */\n\tprotected onVisitEnd?: () => Promise<unknown>;\n\n\t/** Install a plugin */\n\tuse = use;\n\t/** Uninstall a plugin */\n\tunuse = unuse;\n\t/** Find a plugin by name or instance */\n\tfindPlugin = findPlugin;\n\n\t/** Log a message. Has no effect unless debug plugin is installed */\n\tlog: (message: string, context?: unknown) => void = () => {};\n\n\t/** Navigate to a new URL */\n\tnavigate = navigate;\n\t/** Actually perform a navigation */\n\tprotected performNavigation = performNavigation;\n\t/** Create a new context for this visit */\n\tprotected createVisit = createVisit;\n\t/** Register a delegated event listener */\n\tdelegateEvent = delegateEvent;\n\t/** Fetch a page from the server */\n\tfetchPage = fetchPage;\n\t/** Resolve when animations on the page finish */\n\tawaitAnimations = awaitAnimations;\n\tprotected renderPage = renderPage;\n\t/** Replace the content after page load */\n\treplaceContent = replaceContent;\n\tprotected animatePageIn = animatePageIn;\n\tprotected animatePageOut = animatePageOut;\n\tprotected scrollToContent = scrollToContent;\n\t/** Find the anchor element for a given hash */\n\tgetAnchorElement = getAnchorElement;\n\n\t/** Get the current page URL */\n\tgetCurrentUrl = getCurrentUrl;\n\t/** Resolve a URL to its final location */\n\tresolveUrl = resolveUrl;\n\t/** Check if two URLs resolve to the same location */\n\tprotected isSameResolvedUrl = isSameResolvedUrl;\n\n\tconstructor(options: Partial<Options> = {}) {\n\t\t// Merge defaults and options\n\t\tthis.options = { ...this.defaults, ...options };\n\n\t\tthis.handleLinkClick = this.handleLinkClick.bind(this);\n\t\tthis.handlePopState = this.handlePopState.bind(this);\n\n\t\tthis.cache = new Cache(this);\n\t\tthis.classes = new Classes(this);\n\t\tthis.hooks = new Hooks(this);\n\t\tthis.visit = this.createVisit({ to: '' });\n\n\t\tthis.currentHistoryIndex = (window.history.state as HistoryState)?.index ?? 1;\n\n\t\tthis.enable();\n\t}\n\n\t/** Enable this instance, adding listeners and classnames. */\n\tasync enable() {\n\t\t// Add event listener\n\t\tconst { linkSelector } = this.options;\n\t\tthis.clickDelegate = this.delegateEvent(linkSelector, 'click', this.handleLinkClick);\n\n\t\twindow.addEventListener('popstate', this.handlePopState);\n\n\t\t// Set scroll restoration to manual if animating history visits\n\t\tif (this.options.animateHistoryBrowsing) {\n\t\t\twindow.history.scrollRestoration = 'manual';\n\t\t}\n\n\t\t// Initial save to cache\n\t\tif (this.options.cache) {\n\t\t\t// Disabled to avoid caching modified dom state: logic moved to preload plugin\n\t\t\t// https://github.com/swup/swup/issues/475\n\t\t}\n\n\t\t// Sanitize/check native option\n\t\tthis.options.native = this.options.native && !!document.startViewTransition;\n\n\t\t// Mount plugins\n\t\tthis.options.plugins.forEach((plugin) => this.use(plugin));\n\n\t\t// Install user hooks\n\t\tfor (const [key, handler] of Object.entries(this.options.hooks)) {\n\t\t\t// Build hook options from modifier suffix: 'content:replace.before' => { before: true }\n\t\t\tconst [hook, modifiers] = this.hooks.parseName(key as HookName);\n\t\t\t// @ts-expect-error: object.entries() does not preserve key/value types\n\t\t\tthis.hooks.on(hook, handler, modifiers);\n\t\t}\n\n\t\t// Create initial history record\n\t\tif ((window.history.state as HistoryState)?.source !== 'swup') {\n\t\t\tupdateHistoryRecord(null, { index: this.currentHistoryIndex });\n\t\t}\n\n\t\t// Give consumers a chance to hook into enable\n\t\tawait nextTick();\n\n\t\t// Trigger enable hook\n\t\tawait this.hooks.call('enable', undefined, undefined, () => {\n\t\t\tconst html = document.documentElement;\n\t\t\thtml.classList.add('swup-enabled');\n\t\t\thtml.classList.toggle('swup-native', this.options.native);\n\t\t});\n\t}\n\n\t/** Disable this instance, removing listeners and classnames. */\n\tasync destroy() {\n\t\t// remove delegated listener\n\t\tthis.clickDelegate!.destroy();\n\n\t\t// remove popstate listener\n\t\twindow.removeEventListener('popstate', this.handlePopState);\n\n\t\t// empty cache\n\t\tthis.cache.clear();\n\n\t\t// unmount plugins\n\t\tthis.plugins.forEach((plugin) => this.unuse(plugin));\n\n\t\t// trigger disable hook\n\t\tawait this.hooks.call('disable', undefined, undefined, () => {\n\t\t\tconst html = document.documentElement;\n\t\t\thtml.classList.remove('swup-enabled');\n\t\t\thtml.classList.remove('swup-native');\n\t\t});\n\n\t\t// remove handlers\n\t\tthis.hooks.clear();\n\t}\n\n\t/** Determine if a visit should be ignored by swup, based on URL or trigger element. */\n\tshouldIgnoreVisit(href: string, { el, event }: { el?: Element; event?: Event } = {}) {\n\t\tconst { origin, url, hash } = Location.fromUrl(href);\n\n\t\t// Ignore if the new origin doesn't match the current one\n\t\tif (origin !== window.location.origin) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Ignore if the link/form would open a new window (or none at all)\n\t\tif (el && this.triggerWillOpenNewWindow(el)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Ignore if the visit should be ignored as per user options\n\t\tif (this.options.ignoreVisit(url + hash, { el, event })) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Finally, allow the visit\n\t\treturn false;\n\t}\n\n\tprotected handleLinkClick(event: DelegateEvent<MouseEvent>) {\n\t\tconst el = event.delegateTarget as HTMLAnchorElement;\n\t\tconst { href, url, hash } = Location.fromElement(el);\n\n\t\t// Exit early if the link should be ignored\n\t\tif (this.shouldIgnoreVisit(href, { el, event })) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Ignore if swup is currently navigating towards the link's URL\n\t\tif (this.navigating && url === this.visit.to.url) {\n\t\t\tevent.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tconst visit = this.createVisit({ to: url, hash, el, event });\n\n\t\t// Exit early if control key pressed\n\t\tif (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) {\n\t\t\tthis.hooks.callSync('link:newtab', visit, { href });\n\t\t\treturn;\n\t\t}\n\n\t\t// Exit early if other than left mouse button\n\t\tif (event.button !== 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.hooks.callSync('link:click', visit, { el, event }, () => {\n\t\t\tconst from = visit.from.url ?? '';\n\n\t\t\tevent.preventDefault();\n\n\t\t\t// Handle links to the same page\n\t\t\tif (!url || url === from) {\n\t\t\t\tif (hash) {\n\t\t\t\t\t// With hash: scroll to anchor\n\t\t\t\t\tthis.hooks.callSync('link:anchor', visit, { hash }, () => {\n\t\t\t\t\t\tupdateHistoryRecord(url + hash);\n\t\t\t\t\t\tthis.scrollToContent(visit);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\t// Without hash: scroll to top or load/reload page\n\t\t\t\t\tthis.hooks.callSync('link:self', visit, undefined, () => {\n\t\t\t\t\t\tif (this.options.linkToSelf === 'navigate') {\n\t\t\t\t\t\t\tthis.performNavigation(visit);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tupdateHistoryRecord(url);\n\t\t\t\t\t\t\tthis.scrollToContent(visit);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Exit early if the resolved path hasn't changed\n\t\t\tif (this.isSameResolvedUrl(url, from)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Finally, proceed with loading the page\n\t\t\tthis.performNavigation(visit);\n\t\t});\n\t}\n\n\tprotected handlePopState(event: PopStateEvent) {\n\t\tconst href: string = (event.state as HistoryState)?.url ?? window.location.href;\n\n\t\t// Exit early if this event should be ignored\n\t\tif (this.options.skipPopStateHandling(event)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Exit early if the resolved path hasn't changed\n\t\tif (this.isSameResolvedUrl(getCurrentUrl(), this.location.url)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { url, hash } = Location.fromUrl(href);\n\n\t\tconst visit = this.createVisit({ to: url, hash, event });\n\n\t\t// Mark as history visit\n\t\tvisit.history.popstate = true;\n\n\t\t// Determine direction of history visit\n\t\tconst index = (event.state as HistoryState)?.index ?? 0;\n\t\tif (index && index !== this.currentHistoryIndex) {\n\t\t\tconst direction = index - this.currentHistoryIndex > 0 ? 'forwards' : 'backwards';\n\t\t\tvisit.history.direction = direction;\n\t\t\tthis.currentHistoryIndex = index;\n\t\t}\n\n\t\t// Disable animation & scrolling for history visits\n\t\tvisit.animation.animate = false;\n\t\tvisit.scroll.reset = false;\n\t\tvisit.scroll.target = false;\n\n\t\t// Animated history visit: re-enable animation & scroll reset (unless browser already animated)\n\t\tif (this.options.animateHistoryBrowsing && !event.hasUAVisualTransition) {\n\t\t\tvisit.animation.animate = true;\n\t\t\tvisit.scroll.reset = true;\n\t\t}\n\n\t\tthis.hooks.callSync('history:popstate', visit, { event }, () => {\n\t\t\tthis.performNavigation(visit);\n\t\t});\n\t}\n\n\t/** Determine whether an element will open a new tab when clicking/activating. */\n\tprotected triggerWillOpenNewWindow(triggerEl: Element) {\n\t\tif (triggerEl.matches('[download], [target=\"_blank\"]')) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n}\n","type Comparator = '>' | '>=' | '<' | '<=';\n\n// Fill versions to exactly 3 decimals\nexport const normalizeVersion = (version: string): string => {\n\treturn String(version)\n\t\t.split('.')\n\t\t.map(segment => String(parseInt(segment || '0', 10)))\n\t\t.concat(['0', '0'])\n\t\t.slice(0, 3)\n\t\t.join('.');\n};\n\n// Numerically compare version strings after normalizing them\nexport const compareVersion = (a: string, b: string): number => {\n\ta = normalizeVersion(a);\n\tb = normalizeVersion(b);\n\treturn a.localeCompare(b, undefined, { numeric: true });\n};\n\n// Apply a comparator (equals, greater-than, etc) by its symbol to a sort comparison\nconst applyComparator = (comparisonResult: number, comparator: Comparator) => {\n\tconst comparators = {\n\t\t'': (r: number) => r === 0,\n\t\t'>': (r: number) => r > 0,\n\t\t'>=': (r: number) => r >= 0,\n\t\t'<': (r: number) => r < 0,\n\t\t'<=': (r: number) => r <= 0\n\t};\n\tconst comparatorFn = comparators[comparator] || comparators[''];\n\treturn comparatorFn(comparisonResult);\n};\n\n/**\n * Check if a version satisfies all given version requirements\n *\n * versionSatisfies('2.1.0', ['>=2', '<4']) // true\n * versionSatisfies('2.1.0', ['5']) // false\n *\n * @param {string} installed Installed version\n * @param {Array.<string>} requirements Array of requirements that must be satisfied\n * @returns boolean\n */\nexport const versionSatisfies = (installed: string, requirements: string[]) => {\n\treturn requirements.every((required) => {\n\t\tconst [, comparator, version] = required.match(/^([\\D]+)?(.*)$/) || [];\n\t\tconst comparisonResult = compareVersion(installed, version);\n\t\treturn applyComparator(comparisonResult, (comparator as Comparator) || '>=');\n\t});\n};\n","import type Swup from 'swup';\nimport type { Plugin, HookName, HookOptions, HookUnregister, Handler } from 'swup';\nimport { checkDependencyVersion } from './pluginRequirements.js';\n\nfunction isBound(func: Function) {\n\treturn func.name.startsWith('bound ') && !func.hasOwnProperty('prototype');\n}\n\nexport default abstract class SwupPlugin implements Plugin {\n\t/** Name of the plugin */\n\tabstract name: string;\n\n\t/** Identify as a swup plugin */\n\tisSwupPlugin: true = true;\n\n\t// Swup instance, assigned by swup itself\n\tswup!: Swup;\n\n\t/** Version of this plugin. Currently not in use, defined here for backward compatiblity. */\n\tversion?: string;\n\n\t/** Version requirements of this plugin. Example: `{ swup: '>=4' }` */\n\trequires?: Record<string, string | string[]> = {};\n\n\t// List of hook handlers to unregister on unmount\n\tprivate handlersToUnregister: HookUnregister[] = [];\n\n\t/** Run on mount */\n\tmount() {\n\t\t// this is mount method rewritten by class extending\n\t\t// and is executed when swup is enabled with plugin\n\t}\n\n\t/** Run on unmount */\n\tunmount() {\n\t\t// this is unmount method rewritten by class extending\n\t\t// and is executed when swup with plugin is disabled\n\n\t\t// Unsubscribe all registered hook handlers\n\t\tthis.handlersToUnregister.forEach((unregister) => unregister());\n\t\tthis.handlersToUnregister = [];\n\t}\n\n\t_beforeMount(): void {\n\t\tif (!this.name) {\n\t\t\tthrow new Error('You must define a name of plugin when creating a class.');\n\t\t}\n\t}\n\n\t_afterUnmount(): void {\n\t\t// here for any future hidden auto-cleanup\n\t}\n\n\t_checkRequirements(): boolean {\n\t\tif (typeof this.requires !== 'object') {\n\t\t\treturn true;\n\t\t}\n\n\t\tObject.entries(this.requires).forEach(([dependency, versions]) => {\n\t\t\tversions = Array.isArray(versions) ? versions : [versions];\n\t\t\tif (!checkDependencyVersion(dependency, versions, this.swup)) {\n\t\t\t\tconst requirement = `${dependency} ${versions.join(', ')}`;\n\t\t\t\tthrow new Error(`Plugin version mismatch: ${this.name} requires ${requirement}`);\n\t\t\t}\n\t\t});\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Register a new hook handler.\n\t *\n\t * On plugin unmount, the handler will automatically be unregistered.\n\t * The handler function is lexically bound to the plugin instance for convenience.\n\t * @see swup.hooks.on\n\t */\n\tprotected on<T extends HookName>(hook: T, handler: Handler<T>, options: HookOptions = {}): HookUnregister {\n\t\thandler = !isBound(handler) ? handler.bind(this) : handler;\n\t\tconst unregister = this.swup.hooks.on(hook, handler, options);\n\t\tthis.handlersToUnregister.push(unregister);\n\t\treturn unregister;\n\t}\n\n\tprotected once<T extends HookName>(hook: T, handler: Handler<T>, options: HookOptions = {}): HookUnregister {\n\t\treturn this.on(hook, handler, { ...options, once: true });\n\t}\n\n\tprotected before<T extends HookName>(hook: T, handler: Handler<T>, options: HookOptions = {}): HookUnregister {\n\t\treturn this.on(hook, handler, { ...options, before: true });\n\t}\n\n\tprotected replace<T extends HookName>(hook: T, handler: Handler<T>, options: HookOptions = {}): HookUnregister {\n\t\treturn this.on(hook, handler, { ...options, replace: true });\n\t}\n\n\tprotected off<T extends HookName>(hook: T, handler?: Handler<T>): void {\n\t\treturn this.swup.hooks.off(hook, handler!);\n\t}\n}\n","import type Swup from 'swup';\n\nimport { versionSatisfies } from './versionSatisfies.js';\n\nfunction getInstalledDependencyVersion(dependency: string, swup: Swup): string {\n\tif (dependency === 'swup') {\n\t\treturn swup.version ?? '';\n\t} else {\n\t\t// Circular type dependency?\n\t\t// findPlugin returns swup's Plugin type which is not up-to-date\n\t\t// with the actual Plugin type from index.ts\n\t\tconst plugin = swup.findPlugin(dependency);\n\t\treturn plugin?.version ?? '';\n\t}\n}\n\nexport function checkDependencyVersion(\n\tdependency: string,\n\trequirements: string[],\n\tswup: Swup\n): boolean {\n\tconst version = getInstalledDependencyVersion(dependency, swup);\n\tif (version) {\n\t\treturn versionSatisfies(version, requirements);\n\t} else {\n\t\treturn false;\n\t}\n}\n","type ElementCollection = { el: Element; index?: number }[];\n\nexport default function mergeHeadContents(\n\tcurrentHead: HTMLHeadElement,\n\tnewHead: HTMLHeadElement,\n\t{ shouldPersist = () => false }: { shouldPersist?: (el: Element) => boolean } = {}\n) {\n\tconst currentTags = Array.from(currentHead.children);\n\tconst newChildren = Array.from(newHead.children);\n\n\tconst addTags = getTagsToAdd(currentTags, newChildren);\n\tconst removeTags = getTagsToRemove(currentTags, newChildren);\n\n\t// Remove tags in reverse to keep indexes, keep persistant elements\n\tremoveTags\n\t\t.reverse()\n\t\t.filter(({ el }) => shouldManageTag(el))\n\t\t.filter(({ el }) => !shouldPersist(el))\n\t\t.forEach(({ el }) => currentHead.removeChild(el));\n\n\t// Insert tag *after* previous version of itself to preserve JS variable scope and CSS cascade\n\tconst newAddTags = addTags\n\t\t.filter(({ el }) => shouldManageTag(el))\n\t\t.map((tag) => {\n\t\t\tlet newEl = tag.el.cloneNode(true) as Element;\n\t\t\tcurrentHead.insertBefore(newEl, currentHead.children[(tag.index || 0) + 1] || null);\n\n\t\t\treturn { ...tag, el: newEl };\n\t\t});\n\n\treturn {\n\t\tremoved: removeTags.map(({ el }) => el),\n\t\tadded: newAddTags.map(({ el }) => el)\n\t};\n}\n\nfunction getTagsToRemove(currentEls: Element[], newEls: Element[]): ElementCollection {\n\treturn currentEls.reduce((tags, el) => {\n\t\tconst isAmongNew = newEls.some((newEl) => compareTags(el, newEl));\n\t\tif (!isAmongNew) {\n\t\t\ttags.push({ el });\n\t\t}\n\t\treturn tags;\n\t}, [] as ElementCollection);\n}\n\nfunction getTagsToAdd(currentEls: Element[], newEls: Element[]): ElementCollection {\n\treturn newEls.reduce((tags, el, index) => {\n\t\tconst isAmongCurrent = currentEls.some((currentEl) => compareTags(el, currentEl));\n\t\tif (!isAmongCurrent) {\n\t\t\ttags.push({ el, index });\n\t\t}\n\t\treturn tags;\n\t}, [] as ElementCollection);\n}\n\nfunction shouldManageTag(el: Element) {\n\t// Let swup manage the title tag\n\tif (el.localName === 'title') {\n\t\treturn false;\n\t}\n\t// Leave swup theme styles untouched\n\tif (el.matches('[data-swup-theme]')) {\n\t\treturn false;\n\t}\n\treturn true;\n}\n\nfunction compareTags(oldTag: Element, newTag: Element) {\n\treturn oldTag.outerHTML === newTag.outerHTML;\n}\n","export default function updateAttributes(\n\ttarget: Element,\n\tsource: Element,\n\tfilters: (string | RegExp)[] = []\n): void {\n\tconst keep = new Set<string>();\n\n\tfor (const { name, value } of getAttributes(source, filters)) {\n\t\ttarget.setAttribute(name, value);\n\t\tkeep.add(name);\n\t}\n\n\tfor (const { name } of getAttributes(target, filters)) {\n\t\tif (!keep.has(name)) {\n\t\t\ttarget.removeAttribute(name);\n\t\t}\n\t}\n}\n\nfunction getAttributes(el: Element, filters: (string | RegExp)[] = []): Attr[] {\n\tconst all = Array.from(el.attributes);\n\tif (!filters.length) return all;\n\n\treturn all.filter(({ name }) =>\n\t\tfilters.some((pattern) =>\n\t\t\tpattern instanceof RegExp ? pattern.test(name) : name === pattern\n\t\t)\n\t);\n}\n","export default function waitForAssets(\n\telements: Element[],\n\ttimeoutMs: number = 0\n): Promise<HTMLLinkElement>[] {\n\treturn elements.filter(isStylesheet).map((el) => waitForStylesheet(el, timeoutMs));\n}\n\nfunction isStylesheet(el: Element): el is HTMLLinkElement {\n\treturn el.matches('link[rel=stylesheet][href]');\n}\n\nexport function waitForStylesheet(\n\telement: HTMLLinkElement,\n\ttimeoutMs: number = 0\n): Promise<HTMLLinkElement> {\n\tlet timeoutId: ReturnType<typeof setTimeout>;\n\n\tconst whenLoaded = (cb: () => void) => {\n\t\tif (element.sheet) {\n\t\t\tcb();\n\t\t} else {\n\t\t\ttimeoutId = setTimeout(() => whenLoaded(cb), 10);\n\t\t}\n\t};\n\n\treturn new Promise((resolve) => {\n\t\twhenLoaded(() => resolve(element));\n\t\tif (timeoutMs > 0) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tif (timeoutId) clearTimeout(timeoutId);\n\t\t\t\tresolve(element);\n\t\t\t}, timeoutMs);\n\t\t}\n\t});\n}\n","import { Handler } from 'swup';\nimport Plugin from '@swup/plugin';\n\nimport mergeHeadContents from './mergeHeadContents.js';\nimport updateAttributes from './updateAttributes.js';\nimport waitForAssets from './waitForAssets.js';\n\ntype Options = {\n\t/** Whether to keep orphaned `link`, `style` and `script` tags from the old page. Default: `false` */\n\tpersistAssets: boolean;\n\t/** Tags that will be persisted when a new page is loaded. Boolean, selector or predicate function. Default: `false` */\n\tpersistTags: boolean | string | ((el: Element) => boolean);\n\t/** Delay the transition to the new page until all newly added assets have finished loading. Default: `false` */\n\tawaitAssets: boolean;\n\t/** Additional attributes of the head element to update. Default: ['lang', 'dir']. */\n\tattributes: (string | RegExp)[];\n\t/** How long to wait for assets before continuing anyway. Only applies if `awaitAssets` is enabled. Default: `3000` */\n\ttimeout: number;\n};\n\nexport default class SwupHeadPlugin extends Plugin {\n\tname = 'SwupHeadPlugin';\n\n\trequires = { swup: '>=4.6' };\n\n\tdefaults: Options = {\n\t\tpersistTags: false,\n\t\tpersistAssets: false,\n\t\tawaitAssets: false,\n\t\tattributes: ['lang', 'dir'],\n\t\ttimeout: 3000\n\t};\n\toptions: Options;\n\n\tconstructor(options: Partial<Options> = {}) {\n\t\tsuper();\n\n\t\tthis.options = { ...this.defaults, ...options };\n\n\t\t// persistAssets is a shortcut for: persistTags with a default asset selector for scripts & styles\n\t\tif (this.options.persistAssets && !this.options.persistTags) {\n\t\t\tthis.options.persistTags = 'link[rel=stylesheet], script[src], style';\n\t\t}\n\t}\n\n\tmount() {\n\t\tthis.before('content:replace', this.updateHead);\n\t}\n\n\tupdateHead: Handler<'content:replace'> = async (visit, { page: { html } }) => {\n\t\tconst { awaitAssets, attributes, timeout } = this.options;\n\n\t\tconst newDocument = visit.to.document!;\n\n\t\tconst { removed, added } = mergeHeadContents(document.head, newDocument.head, {\n\t\t\tshouldPersist: (el) => this.isPersistentTag(el)\n\t\t});\n\n\t\tthis.swup.log(`Removed ${removed.length} / added ${added.length} tags in head`);\n\n\t\tif (attributes?.length) {\n\t\t\tupdateAttributes(document.documentElement, newDocument.documentElement, attributes);\n\t\t}\n\n\t\tif (awaitAssets) {\n\t\t\tconst assetLoadPromises = waitForAssets(added, timeout);\n\t\t\tif (assetLoadPromises.length) {\n\t\t\t\tthis.swup.log(`Waiting for ${assetLoadPromises.length} assets to load`);\n\t\t\t\tawait Promise.all(assetLoadPromises);\n\t\t\t}\n\t\t}\n\t};\n\n\tisPersistentTag(el: Element) {\n\t\tconst { persistTags } = this.options;\n\t\tif (typeof persistTags === 'function') {\n\t\t\treturn persistTags(el);\n\t\t}\n\t\tif (typeof persistTags === 'string' && persistTags.length > 0) {\n\t\t\treturn el.matches(persistTags);\n\t\t}\n\t\treturn Boolean(persistTags);\n\t}\n}\n","// Page transitions: swup swaps <main> (and the page's own parts outside it, the #swup-float and #swup-overlays slots\n// in shell.witty) while the header, footer and menu stay. The frosted-glass layer of the intro curtain covers the swap:\n// it closes in 0.3 s, the content changes underneath, and it clears as the reveal does on a first visit.\nimport Swup from \"swup\";\nimport SwupHeadPlugin from \"@swup/head-plugin\";\nimport { registerMissed } from \"@webhare/dompack\";\nimport { mount, unmount } from \"../lib/components\";\nimport { finishIntro, gsap, prefersReducedMotion, ScrollTrigger } from \"../lib/motion\";\nimport { scrollToTarget } from \"../lib/scroll\";\nimport { settleOn, watchHeaderBackground } from \"./app\";\n\nconst containers = [\"#swup\", \"#swup-float\", \"#swup-overlays\"];\n\nfunction curtain(): HTMLElement | null {\n  return document.querySelector<HTMLElement>(\".intro\");\n}\n\n/** Closes the frosted-glass layer over the page */\nasync function cover(): Promise<void> {\n  const layer = curtain();\n  if (!layer || prefersReducedMotion()) return;\n  // A click during the first reveal: that reveal stops here, but the page must still count its intro as done\n  gsap.killTweensOf(layer);\n  finishIntro();\n  layer.querySelector(\".intro__logo\")?.remove();\n  layer.classList.add(\"intro--reveal\");\n  layer.hidden = false;\n  await gsap.fromTo(layer, { \"--intro-alpha\": 0, \"--intro-blur\": \"0px\" }, { \"--intro-alpha\": 0.85, \"--intro-blur\": \"32px\", duration: 0.3, ease: \"power2.in\" });\n}\n\n/** Clears the layer again over the new page: the reveal, never the logo */\nasync function uncover(): Promise<void> {\n  const layer = curtain();\n  if (!layer || prefersReducedMotion()) return;\n  await gsap.to(layer, { \"--intro-alpha\": 0, \"--intro-blur\": \"0px\", duration: 1, ease: \"power2.inOut\" });\n  layer.hidden = true;\n}\n\n/** The header stays, but its language links point to this page on the other site */\nfunction syncHeader(incoming: Document): void {\n  const next = incoming.querySelectorAll<HTMLAnchorElement>(\"a.lang__option\");\n  document.querySelectorAll<HTMLAnchorElement>(\"a.lang__option\").forEach((link, i) => {\n    const source = next[i];\n    if (!source) return;\n    link.href = source.getAttribute(\"href\")!;\n    link.className = source.className;\n    if (source.hasAttribute(\"aria-current\")) link.setAttribute(\"aria-current\", source.getAttribute(\"aria-current\")!);\n    else link.removeAttribute(\"aria-current\");\n  });\n}\n\nexport function startTransitions(): void {\n  const swup = new Swup({\n    containers,\n    animationSelector: false,\n    ignoreVisit: (url, { el, event } = {}) =>\n      // Already handled: a link within the page (app.ts) or one that opens the contact or application popup\n      Boolean(event?.defaultPrevented)\n      // The other language is another site: a full page load\n      || Boolean(el?.matches(\".lang__option, [hreflang]\"))\n      || url.includes(\"/.wh/\")\n      || /\\.(jpe?g|png|gif|webp|pdf)$/i.test(url),\n    // lang, dir and the page's WebHare object id follow the new page; data-siteroot is the same within a site\n    plugins: [new SwupHeadPlugin({ persistAssets: true, attributes: [\"lang\", \"dir\", \"data-wh-ob\"] })],\n  });\n\n  swup.hooks.replace(\"animation:out:await\", () => cover());\n  swup.hooks.replace(\"animation:in:await\", () => uncover());\n\n  // Close the menu when leaving through the browser's back or forward button; a menu link already closes it itself,\n  // and the menu covers every other link\n  swup.hooks.on(\"visit:start\", (visit) => {\n    const menu = document.querySelector<HTMLElement>(\"#site-menu\");\n    if (visit.history.popstate && menu && !menu.hidden) document.querySelector<HTMLButtonElement>(\".menu__close\")?.click();\n  });\n\n  // Stop the old page's behavior while its elements are still in place; its ScrollTriggers revert with it\n  swup.hooks.before(\"content:replace\", () => {\n    for (const selector of containers) {\n      const el = document.querySelector(selector);\n      if (el) unmount(el);\n    }\n  });\n\n  swup.hooks.on(\"content:replace\", (visit) => {\n    // A form page hands out a fresh form per request; never serve it again from swup's cache\n    if (visit.to.document?.querySelector(\"form.wh-form\")) swup.cache.delete(visit.to.url);\n    if (visit.to.document) syncHeader(visit.to.document);\n    scrollToTarget(0);\n    for (const selector of containers) {\n      const el = document.querySelector<HTMLElement>(selector);\n      if (!el) continue;\n      registerMissed(el); // the WebHare form on the contact and application pages\n      mount(el);\n    }\n    watchHeaderBackground();\n    ScrollTrigger.refresh();\n  });\n\n  // The page may still grow (images, fonts, pins), so swup's own scrolling to a \"/#services\" target could land in the wrong spot\n  swup.hooks.replace(\"content:scroll\", (visit) => {\n    const hash = visit.scroll.target ?? visit.to.hash;\n    let target: Element | null = null;\n    try {\n      target = hash ? document.querySelector(hash) : null;\n    } catch {\n      // Not a valid selector: stay at the top\n    }\n    if (!target) return false;\n    settleOn(target);\n    return true;\n  });\n}\n","/** How a page comes in: the full logo intro, only the frosted-glass reveal, or nothing at all. */\nexport type IntroMode = \"logo\" | \"reveal\" | \"none\";\n\n/** Whether a user agent is Lighthouse (PageSpeed Insights). Older versions said \"Chrome-Lighthouse\"; the current\n    mobile run poses as a moto g power (2022), and since the user-agent reduction a real Chrome on Android sends no\n    device name. Its desktop run looks like any Chrome on a Mac; isLighthouseDesktopWindow catches that one. The head\n    script of shell.witty does the same tests. */\nexport const isLighthouseAgent = (userAgent: string): boolean => /Chrome-Lighthouse|moto g power \\(2022\\)/.test(userAgent);\n\n/** Whether a window has the exact size Lighthouse's desktop run emulates: 1350x940 at pixel ratio 1. A real visitor\n    with that window (no Retina, to the pixel) gets what Lighthouse gets: no intro, no entrances of header and hero,\n    and the still gradient instead of the flowing one. */\nexport const isLighthouseDesktopWindow = (win: { width: number; height: number; pixelRatio: number }): boolean =>\n  win.width === 1350 && win.height === 940 && win.pixelRatio === 1;\n\nexport const isLighthouse = (): boolean => isLighthouseAgent(navigator.userAgent)\n  || isLighthouseDesktopWindow({ width: innerWidth, height: innerHeight, pixelRatio: devicePixelRatio });\n\n/* The logo intro plays once a day; a returning visitor still gets the frosted-glass reveal, just without the logo,\n   so the page never appears sharp at once. Reduced motion skips both, and so does Lighthouse (PageSpeed Insights):\n   it measures a first visit, so it would always wait for the logo and score its animation frames. */\nexport function chooseIntro(options: { lighthouse: boolean; reducedMotion: boolean; playedToday: boolean; isHome: boolean }): IntroMode {\n  if (options.reducedMotion || options.lighthouse) return \"none\";\n  // The logo belongs to the homepage; every other page always comes in through the reveal\n  if (!options.isHome) return \"reveal\";\n  return options.playedToday ? \"reveal\" : \"logo\";\n}\n","// How a page comes in: the logo once a day on the homepage, otherwise the frosted-glass reveal, with reduced motion\n// nothing. The curtain starts hidden in the shell; until this runs, the page head's stand-in covers the page.\n// From tech42v2 IntroCurtain.vue.\nimport { component } from \"../lib/components\";\nimport { arrived } from \"../lib/arrival\";\nimport { chooseIntro, isLighthouse } from \"../lib/intro\";\nimport { finishIntro, gsap, prefersReducedMotion, ScrollTrigger } from \"../lib/motion\";\n\n// The logo intro plays once a day per visitor: the day it last played is remembered in this browser. Later visits\n// that day only get the frosted-glass reveal. Without storage (private window, blocked site data) the logo plays every time\nconst introKey = \"tech42-intro-day\";\nconst today = new Date().toLocaleDateString(\"sv\"); // local date as YYYY-MM-DD\nfunction playedToday(): boolean {\n  try {\n    return localStorage.getItem(introKey) === today;\n  } catch {\n    return false;\n  }\n}\n\nfunction remeasureAfterLoad() {\n  const later = () => setTimeout(() => ScrollTrigger.refresh(), 600);\n  if (document.readyState === \"complete\") later();\n  else window.addEventListener(\"load\", later, { once: true });\n}\n\ncomponent(\".intro\", (root) => {\n  const logo = root.querySelector<HTMLElement>(\".intro__logo\");\n  // The shell only renders the logo on the homepage\n  const mode = chooseIntro({ lighthouse: isLighthouse(), reducedMotion: prefersReducedMotion(), playedToday: playedToday(), isHome: Boolean(logo) });\n\n  function end() {\n    document.documentElement.style.overflow = \"\";\n    root.hidden = true;\n    // Measure the scroll animations again before the visitor can scroll: in the seconds after loading the page can change\n    // without a resize event (the scrollbar returns, browser bars settle), which left pinned sections starting too low\n    ScrollTrigger.refresh();\n  }\n\n  // From here this layer takes over from the stand-in the page head puts up before the script has loaded\n  document.documentElement.classList.remove(\"intro-pending\");\n  if (mode === \"none\") {\n    finishIntro();\n    // Without the intro there is no moment to measure again before scrolling starts, so do it once the page has\n    // settled after loading\n    if (!prefersReducedMotion()) remeasureAfterLoad();\n    return;\n  }\n\n  root.hidden = false;\n  if (mode === \"reveal\") {\n    logo?.remove();\n    root.classList.add(\"intro--reveal\");\n    // Hold the layer as dense as the stand-in until the page stands at the section it was opened on, so the jump\n    // there happens out of sight. Never longer than 3 seconds, so a failing script cannot keep the page blurred.\n    // A returning visitor: no logo, the layer starts lighter and clears quicker, and the hero comes in while it\n    // clears. It never blocks the page (pointer-events: none), so there is no need to stop scrolling\n    gsap.set(root, { \"--intro-alpha\": 0.85, \"--intro-blur\": \"32px\" });\n    void Promise.race([arrived(), new Promise((resolve) => setTimeout(resolve, 3000))]).then(() => {\n      gsap.timeline({ onComplete: end })\n        .fromTo(root, { \"--intro-alpha\": 0.85, \"--intro-blur\": \"32px\" },\n          { \"--intro-alpha\": 0, \"--intro-blur\": \"0px\", duration: 1.6, ease: \"power2.inOut\" })\n        .add(() => finishIntro(), 0.3);\n    });\n    // The reveal can finish before the page has loaded, so its refresh in end() may come too early\n    remeasureAfterLoad();\n    return;\n  }\n\n  document.documentElement.style.overflow = \"hidden\";\n  try {\n    localStorage.setItem(introKey, today);\n  } catch {\n    // Not remembered, so it plays again next time\n  }\n  void playLogo(root, logo!, end);\n});\n\nasync function playLogo(root: HTMLElement, logo: HTMLElement, end: () => void) {\n  // The player and the animation are fetched here, not with the page: only a first visit of the day to the homepage\n  // plays the logo, and every other page load would carry their weight for nothing\n  const [{ default: lottie }, { default: logoAnimation }] = await Promise.all([import(\"lottie-web/build/player/lottie_light\"), import(\"../lib/logo-loader.json\")]);\n\n  // The logo builds itself exactly as on the current tech42.nl (2.8 seconds)...\n  const animation = lottie.loadAnimation({\n    container: logo,\n    renderer: \"svg\",\n    loop: false,\n    autoplay: true,\n    animationData: logoAnimation,\n  });\n\n  // ...then it dissolves, and the dark layer clears like frosted glass: it turns see-through while its blur\n  // lets go, so the site and the gradient come into focus underneath\n  animation.addEventListener(\"complete\", () => {\n    gsap.timeline({ onComplete: () => { animation.destroy(); end(); } })\n      .to(logo, { autoAlpha: 0, filter: \"blur(14px)\", duration: 1.1, ease: \"power2.in\" }, \"+=0.5\")\n      .to(root, { \"--intro-alpha\": 0, \"--intro-blur\": \"0px\", duration: 2.8, ease: \"power2.inOut\" }, \"-=0.4\")\n      .add(() => finishIntro(), \"-=2.2\");\n  });\n}\n","// Whether the \"Let's talk\" button sits docked in the header as the phone icon. On the homepage the hero button\n// flies up into the header while you scroll (hero-contact.ts); a service page has a floating button instead; other\n// pages have no button of their own, so there it is always docked.\ntype Listener = (docked: boolean) => void;\n\n// The server renders the starting state as header--call; read lazily, the assetpack may run before <body> exists\nlet docked: boolean | undefined;\nconst listeners = new Set<Listener>();\n\nexport function getCallDocked(): boolean {\n  return docked ??= Boolean(document.querySelector(\".header--call\"));\n}\n\nexport function setCallDocked(value: boolean): void {\n  if (value === getCallDocked()) return;\n  docked = value;\n  listeners.forEach((listener) => listener(value));\n}\n\n/** Calls `listener` on every change; returns the unsubscribe */\nexport function onCallDocked(listener: Listener): () => void {\n  listeners.add(listener);\n  return () => listeners.delete(listener);\n}\n","// The fixed header: blur once scrolled, the docked phone, the full-screen menu, the easter egg on the logo and the\n// header's own entrance. From tech42v2 SiteHeader.vue.\nimport { component } from \"../lib/components\";\nimport { getCallDocked, onCallDocked } from \"../lib/dock\";\nimport { isLighthouse } from \"../lib/intro\";\nimport { gsap, introDone, motion, prefersReducedMotion } from \"../lib/motion\";\n\ncomponent(\".header\", (root) => {\n  const logoLink = root.querySelector<HTMLElement>(\".header__logo\")!;\n  const trigger = root.querySelector<HTMLButtonElement>(\".header__menu\")!;\n  const call = root.querySelector<HTMLElement>(\".header__call\");\n  const menu = document.querySelector<HTMLElement>(\"#site-menu\")!;\n\n  // Once the page has scrolled, a soft blur sits behind the header\n  const onScroll = () => root.classList.toggle(\"header--scrolled\", window.scrollY > 24);\n  onScroll();\n  window.addEventListener(\"scroll\", onScroll, { passive: true });\n\n  // The hero's \"Let's talk\" docks here as just the phone once it has flown up (hero-contact.ts)\n  const showDocked = (docked: boolean) => {\n    root.classList.toggle(\"header--call\", docked);\n    call?.classList.toggle(\"header__call--shown\", docked);\n    call?.toggleAttribute(\"inert\", !docked);\n  };\n  showDocked(getCallDocked());\n  const stopDock = onCallDocked(showDocked);\n\n  // Easter egg: hold still on the logo (mouse) or keep pressing it (touch) for 4 seconds\n  let eggTween: ReturnType<typeof gsap.to> | null = null;\n  let eggDone = false;\n  let eggBusy = false;\n  function startEgg(e?: PointerEvent) {\n    if (eggBusy || prefersReducedMotion()) return;\n    if (e?.type === \"pointerenter\" && e.pointerType !== \"mouse\") return;\n    eggDone = false;\n    eggTween?.kill();\n    eggTween = gsap.to(logoLink, { \"--egg\": 1, duration: 4, ease: \"none\", onComplete: () => void playEgg() });\n  }\n  function stopEgg() {\n    if (eggBusy) return;\n    eggTween?.kill();\n    eggTween = gsap.to(logoLink, { \"--egg\": 0, duration: 0.4, ease: \"power2.out\" });\n  }\n  async function playEgg() {\n    eggDone = true;\n    eggBusy = true;\n    try {\n      const { walkRobot } = await import(\"../lib/robot\");\n      const walk = walkRobot(logoLink.dataset.robot!);\n      // The orange drains away while he walks\n      gsap.to(logoLink, { \"--egg\": 0, duration: 1.2, delay: 0.6, ease: \"power2.inOut\" });\n      await walk;\n    } finally {\n      eggBusy = false;\n    }\n  }\n  logoLink.addEventListener(\"pointerenter\", startEgg);\n  logoLink.addEventListener(\"pointerleave\", stopEgg);\n  logoLink.addEventListener(\"pointercancel\", stopEgg);\n  logoLink.addEventListener(\"pointerdown\", (e) => { if (e.pointerType !== \"mouse\") startEgg(); });\n  logoLink.addEventListener(\"pointerup\", (e) => { if (e.pointerType !== \"mouse\") stopEgg(); });\n  // A finished long press is not a tap: don't follow the link or open the context menu\n  logoLink.addEventListener(\"click\", (e) => {\n    if (eggDone || eggBusy) e.preventDefault();\n    eggDone = false;\n  });\n  logoLink.addEventListener(\"contextmenu\", (e) => {\n    if (eggTween?.isActive() || eggBusy) e.preventDefault();\n  });\n\n  // While the menu is open the page behind it is inert: not focusable, not read out\n  const setPageInert = (inert: boolean) => document.querySelector(\"#smooth-wrapper\")?.toggleAttribute(\"inert\", inert);\n  let menuOpen = false;\n  const setMenuOpen = (open: boolean) => {\n    menuOpen = open;\n    menu.hidden = !open;\n    trigger.setAttribute(\"aria-expanded\", String(open));\n  };\n\n  const onKeydown = (e: KeyboardEvent) => {\n    if (e.key === \"Escape\" && menuOpen) closeMenu();\n  };\n  const focusables = () => [...menu.querySelectorAll<HTMLElement>(\"a[href], button\")];\n  const trapTab = (e: KeyboardEvent) => {\n    if (e.key !== \"Tab\") return;\n    const items = focusables();\n    if (!items.length) return;\n    const first = items[0], last = items[items.length - 1];\n    const wrapTo = e.shiftKey ? (document.activeElement === first ? last : null) : (document.activeElement === last ? first : null);\n    if (wrapTo) {\n      e.preventDefault();\n      wrapTo.focus();\n    }\n  };\n\n  // The menu opens and closes as a circle centred on the Menu button, with a radius that exactly reaches the\n  // farthest corner of the screen, so the circle is fully open at its largest and never cuts a corner off\n  function circle(open: boolean) {\n    const b = trigger.getBoundingClientRect();\n    const x = b.left + b.width / 2;\n    const y = b.top + b.height / 2;\n    const radius = Math.hypot(Math.max(x, window.innerWidth - x), Math.max(y, window.innerHeight - y));\n    return `circle(${open ? radius : 0}px at ${x}px ${y}px)`;\n  }\n\n  function openMenu() {\n    // The menu's logo sits exactly on top of the header's, so the logo seems to stay put\n    const logo = logoLink.getBoundingClientRect();\n    menu.style.setProperty(\"--logo-top\", `${logo.top}px`);\n    menu.style.setProperty(\"--logo-left\", `${logo.left}px`);\n    // The article card is hidden on phones and tablets (see the 860px rule), so its photo is only fetched on a wide screen\n    const image = menu.querySelector<HTMLImageElement>(\".menu__blog-image[data-src]\");\n    if (image && window.matchMedia(\"(min-width: 861px)\").matches) {\n      if (image.dataset.srcset) image.srcset = image.dataset.srcset;\n      if (image.dataset.sizes) image.sizes = image.dataset.sizes;\n      image.src = image.dataset.src!;\n      delete image.dataset.src;\n    }\n    setMenuOpen(true);\n    setPageInert(true);\n    document.addEventListener(\"keydown\", onKeydown);\n    focusables().find((el) => el.classList.contains(\"menu__link\"))?.focus({ preventScroll: true });\n    if (prefersReducedMotion()) return;\n    const links = menu.querySelectorAll(\".menu__link\");\n    gsap.timeline()\n      .fromTo(menu, { clipPath: circle(false) }, { clipPath: circle(true), duration: 1.6, ease: \"expo.inOut\" })\n      .from(links, { yPercent: 110, duration: 1.4, stagger: 0.1 }, \"-=0.7\")\n      .from(menu.querySelectorAll(\".menu__close, .menu__aside\"), { autoAlpha: 0, duration: 0.9 }, \"-=0.9\");\n  }\n\n  /** `returnFocus` is false when a menu link was chosen: focus then follows the link instead of the trigger. */\n  function closeMenu(returnFocus = true) {\n    document.removeEventListener(\"keydown\", onKeydown);\n    setPageInert(false);\n    if (returnFocus) trigger.focus({ preventScroll: true });\n    if (prefersReducedMotion()) {\n      setMenuOpen(false);\n      return;\n    }\n    // The links slide away first, then the circle closes in slowly towards the Menu button.\n    // It starts from exactly the screen-covering radius, so the shrink is visible from the first frame.\n    const links = menu.querySelectorAll(\".menu__link\");\n    const fades = menu.querySelectorAll(\".menu__close, .menu__aside\");\n    gsap.timeline({\n      onComplete: () => {\n        setMenuOpen(false);\n        // The next open animates the links in from their resting place\n        gsap.set([...links, ...fades], { clearProps: \"transform,opacity,visibility\" });\n      },\n    })\n      .to(links, { yPercent: -110, duration: 0.8, stagger: 0.06, ease: \"power3.in\" })\n      .to(fades, { autoAlpha: 0, duration: 0.5 }, 0)\n      .fromTo(menu, { clipPath: circle(true) }, { clipPath: circle(false), duration: 1.6, ease: \"power3.inOut\" }, \"-=0.4\");\n  }\n\n  const onMenuClick = (e: MouseEvent) => {\n    const target = e.target as HTMLElement;\n    if (target.closest(\".menu__close\")) closeMenu();\n    else if (target.closest(\".menu__logo, .menu__link\")) closeMenu(false);\n  };\n  trigger.addEventListener(\"click\", openMenu);\n  menu.addEventListener(\"click\", onMenuClick);\n  menu.addEventListener(\"keydown\", trapTab);\n\n  // Lighthouse gets the header without its entrance (see the head script of shell.witty)\n  const stopMotion = isLighthouse() ? () => {} : motion(root, (self) => {\n    gsap.set(self.children, { autoAlpha: 0, y: -20 });\n    void introDone.then(() => gsap.to(self.children, { autoAlpha: 1, y: 0, duration: 1, stagger: 0.1, delay: 0.6 }));\n  });\n\n  return () => {\n    stopMotion();\n    stopDock();\n    window.removeEventListener(\"scroll\", onScroll);\n    document.removeEventListener(\"keydown\", onKeydown);\n    menu.removeEventListener(\"click\", onMenuClick);\n    menu.removeEventListener(\"keydown\", trapTab);\n    trigger.removeEventListener(\"click\", openMenu);\n    setPageInert(false);\n  };\n});\n","// The language menu opens on hover or click; its options are plain links to the same page on the other site.\n// From tech42v2 LanguageSelector.vue.\nimport { component } from \"../lib/components\";\n\ncomponent(\".lang\", (root) => {\n  const trigger = root.querySelector<HTMLButtonElement>(\".lang__trigger\")!;\n  const menu = root.querySelector<HTMLElement>(\".lang__menu\")!;\n  const setOpen = (open: boolean) => {\n    root.classList.toggle(\"lang--open\", open);\n    menu.hidden = !open;\n    trigger.setAttribute(\"aria-expanded\", String(open));\n  };\n  const onEnter = () => setOpen(true);\n  const onLeave = () => setOpen(false);\n  const onClick = () => setOpen(!root.classList.contains(\"lang--open\"));\n  const onKeydown = (e: KeyboardEvent) => {\n    if (e.key === \"Escape\") setOpen(false);\n  };\n  root.addEventListener(\"mouseenter\", onEnter);\n  root.addEventListener(\"mouseleave\", onLeave);\n  root.addEventListener(\"keydown\", onKeydown);\n  trigger.addEventListener(\"click\", onClick);\n  return () => {\n    root.removeEventListener(\"mouseenter\", onEnter);\n    root.removeEventListener(\"mouseleave\", onLeave);\n    root.removeEventListener(\"keydown\", onKeydown);\n    trigger.removeEventListener(\"click\", onClick);\n  };\n});\n","// A canvas texture, where the browser cannot choose: the smallest version that still covers the screen at its pixel\n// density. A background fills the screen in both directions, so on a tall phone it is the height that decides how\n// wide the (landscape) image has to be. `srcset` is the server's list of \"url width\" (lib/assets.ts#texture)\nexport function backdrop(srcset: string): string {\n  const list = srcset.split(\", \").map((entry) => {\n    const [url, width] = entry.split(\" \");\n    return { url, width: parseInt(width) };\n  });\n  const needed = Math.max(window.innerWidth, window.innerHeight * 16 / 9) * Math.min(window.devicePixelRatio || 1, 2);\n  return (list.find((candidate) => candidate.width >= needed) ?? list[list.length - 1]).url;\n}\n","// Liquid gradient: renders an image through a slowly flowing domain-warp, in plain WebGL.\n// The gradient is soft, so it renders at reduced resolution and the canvas is stretched by CSS.\n\nconst vertexSource = `\nattribute vec2 position;\nvarying vec2 vUv;\nvoid main() {\n  vUv = position * 0.5 + 0.5;\n  gl_Position = vec4(position, 0.0, 1.0);\n}`;\n\nconst fragmentSource = `\nprecision highp float;\nuniform sampler2D uImage;\nuniform vec2 uResolution;\nuniform vec2 uImageSize;\nuniform vec2 uPointer;\nuniform float uPointerStrength;\nuniform float uTime;\nvarying vec2 vUv;\n\nfloat hash(vec2 p) {\n  return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);\n}\n\n// Layered sine flow: few, large and smooth folds read as viscous liquid\n// (value noise with many octaves read as smoke)\nvec2 flow(vec2 p, float t) {\n  for (int i = 1; i < 6; i++) {\n    float fi = float(i);\n    p.x += 0.5 / fi * sin(fi * 0.9 * p.y + t * 0.12 + 0.7 * fi);\n    p.y += 0.4 / fi * cos(fi * 1.1 * p.x + t * 0.1 + 1.3 * fi);\n  }\n  return p;\n}\n\nvoid main() {\n  vec2 uv = vUv;\n  float aspect = uResolution.x / uResolution.y;\n  vec2 base = vec2(uv.x * aspect, uv.y) * 1.8;\n  float t = uTime;\n\n  vec2 warped = flow(base, t);\n  vec2 offset = (warped - base) * vec2(0.075, 0.09);\n\n  // Pointer pushes the liquid outward a little\n  vec2 toPointer = uv - uPointer;\n  toPointer.x *= aspect;\n  float falloff = exp(-dot(toPointer, toPointer) * 9.0);\n  offset += normalize(toPointer + 0.0001) * falloff * 0.06 * uPointerStrength;\n\n  // Cover-fit the image to the canvas\n  vec2 ratio = uResolution / uImageSize;\n  float scale = max(ratio.x, ratio.y);\n  vec2 imageUv = (uv - 0.5) * uResolution / (uImageSize * scale) + 0.5;\n\n  vec3 color = texture2D(uImage, clamp(imageUv + offset, 0.001, 0.999)).rgb;\n\n  // Soft sheen along the folds makes the surface read as glossy liquid\n  float fold = sin((warped.x + warped.y) * 1.2 - t * 0.06);\n  float sheen = smoothstep(0.55, 1.0, fold) * 0.045;\n  color += sheen * (0.4 + color);\n\n  // Dither against banding in the dark areas\n  color += (hash(uv * uResolution + t) - 0.5) / 255.0;\n  gl_FragColor = vec4(color, 1.0);\n}`;\n\nfunction compile(gl: WebGLRenderingContext, type: number, source: string): WebGLShader | null {\n  const shader = gl.createShader(type);\n  if (!shader) return null;\n  gl.shaderSource(shader, source);\n  gl.compileShader(shader);\n  if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n    console.warn(\"Liquid gradient shader:\", gl.getShaderInfoLog(shader));\n    return null;\n  }\n  return shader;\n}\n\n/** A touch screen as the main pointer: a phone or tablet, with a much weaker graphics chip than a laptop. */\nfunction isCoarsePointer(): boolean {\n  return window.matchMedia(\"(pointer: coarse)\").matches;\n}\n\n// How many canvas pixels per CSS pixel. Three quarters of the screen's own pixels looks sharp; the cap keeps the\n// work for the graphics chip about the same on every screen (a laptop at 1440 × 900 draws some 730,000 pixels).\n// A phone has few CSS pixels but dense ones: at the old fixed 0.75 it drew a third of its pixels and looked coarse.\n// It gets a smaller budget than a laptop all the same, because the same pixel count on a phone chip made the page stutter\nexport function liquidResolution(screen = { width: window.innerWidth, height: window.innerHeight, dpr: window.devicePixelRatio || 1, coarse: isCoarsePointer() }): number {\n  const area = Math.max(1, screen.width * screen.height);\n  const budget = screen.coarse ? 450_000 : 800_000;\n  return Math.min(screen.dpr * 0.75, Math.max(0.75, Math.sqrt(budget / area)));\n}\n\n/** Starts the effect on `canvas`; resolves to a stop function, or null when WebGL is unavailable. */\n// `flow.value` scales how fast the gradient moves (1 = its calm pace); change it at any time, e.g. a burst on load\nexport async function startLiquid(canvas: HTMLCanvasElement, imageUrl: string, flow = { value: 1 }, resolution = liquidResolution()): Promise<(() => void) | null> {\n  const gl = canvas.getContext(\"webgl\", { antialias: false, premultipliedAlpha: false, powerPreference: \"low-power\" });\n  if (!gl) return null;\n\n  const vs = compile(gl, gl.VERTEX_SHADER, vertexSource);\n  const fs = compile(gl, gl.FRAGMENT_SHADER, fragmentSource);\n  if (!vs || !fs) return null;\n  const program = gl.createProgram()!;\n  gl.attachShader(program, vs);\n  gl.attachShader(program, fs);\n  gl.linkProgram(program);\n  if (!gl.getProgramParameter(program, gl.LINK_STATUS)) return null;\n  gl.useProgram(program);\n\n  const buffer = gl.createBuffer();\n  gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n  gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]), gl.STATIC_DRAW);\n  const position = gl.getAttribLocation(program, \"position\");\n  gl.enableVertexAttribArray(position);\n  gl.vertexAttribPointer(position, 2, gl.FLOAT, false, 0, 0);\n\n  const image = new Image();\n  image.decoding = \"async\";\n  image.src = imageUrl;\n  try {\n    await image.decode();\n  } catch {\n    return null;\n  }\n\n  const texture = gl.createTexture();\n  gl.bindTexture(gl.TEXTURE_2D, texture);\n  gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n  gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE, image);\n  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\n  const u = (name: string) => gl.getUniformLocation(program, name);\n  const uResolution = u(\"uResolution\"), uImageSize = u(\"uImageSize\"), uTime = u(\"uTime\");\n  const uPointer = u(\"uPointer\"), uPointerStrength = u(\"uPointerStrength\");\n  gl.uniform2f(uImageSize, image.naturalWidth, image.naturalHeight);\n\n  const resize = () => {\n    const w = Math.max(1, Math.round(canvas.clientWidth * resolution));\n    const h = Math.max(1, Math.round(canvas.clientHeight * resolution));\n    if (canvas.width === w && canvas.height === h) return;\n    canvas.width = w;\n    canvas.height = h;\n    gl.viewport(0, 0, w, h);\n    gl.uniform2f(uResolution, w, h);\n  };\n\n  // Pointer position eases toward the cursor so the push feels viscous\n  const target = { x: 0.5, y: 0.5, strength: 0 };\n  const pointer = { x: 0.5, y: 0.5, strength: 0 };\n  const onMove = (e: PointerEvent) => {\n    const rect = canvas.getBoundingClientRect();\n    target.x = (e.clientX - rect.left) / rect.width;\n    target.y = 1 - (e.clientY - rect.top) / rect.height;\n    target.strength = e.clientY < rect.bottom ? 1 : 0;\n  };\n  window.addEventListener(\"pointermove\", onMove, { passive: true });\n\n  let visible = true;\n  const observer = new IntersectionObserver(([entry]) => { visible = entry.isIntersecting; });\n  observer.observe(canvas);\n\n  // The liquid moves slowly, so a phone draws it at 30 frames a second; the 4 ms slack keeps a 60 Hz screen\n  // from skipping two frames when one arrives a hair early\n  const minFrameMs = isCoarsePointer() ? 1000 / 30 - 4 : 0;\n  let lastDraw = 0;\n\n  let frame = 0;\n  let time = 0;\n  let last = performance.now();\n  const render = () => {\n    frame = requestAnimationFrame(render);\n    const now = performance.now();\n    // Time advances at the current flow speed (capped per frame, so a stalled tab doesn't jump ahead)\n    time += Math.min(now - last, 100) / 1000 * flow.value;\n    last = now;\n    if (!visible || now - lastDraw < minFrameMs) return;\n    lastDraw = now;\n    resize();\n    pointer.x += (target.x - pointer.x) * 0.03;\n    pointer.y += (target.y - pointer.y) * 0.03;\n    pointer.strength += (target.strength - pointer.strength) * 0.04;\n    gl.uniform2f(uPointer, pointer.x, pointer.y);\n    gl.uniform1f(uPointerStrength, pointer.strength);\n    gl.uniform1f(uTime, time);\n    gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n  };\n  render();\n\n  return () => {\n    cancelAnimationFrame(frame);\n    observer.disconnect();\n    window.removeEventListener(\"pointermove\", onMove);\n    gl.getExtension(\"WEBGL_lose_context\")?.loseContext();\n  };\n}\n","// The homepage hero: the flowing gradient (WebGL) over the still one, and the entrance after the intro curtain.\n// From tech42v2 HeroSection.vue.\nimport { component } from \"../lib/components\";\nimport { backdrop } from \"../lib/assets\";\nimport { isLighthouse } from \"../lib/intro\";\nimport { startLiquid } from \"../lib/liquid\";\nimport { gsap, introDone, motion, prefersReducedMotion } from \"../lib/motion\";\n\ncomponent(\".hero\", (root) => {\n  const canvas = root.querySelector<HTMLCanvasElement>(\".hero__liquid\");\n  let alive = true;\n  let stopLiquid: (() => void) | null = null;\n  // The gradient rushes while the site loads, then settles into its calm flow as the hero appears\n  const flow = { value: 16 };\n\n  // The still gradient stays underneath; the flowing version fades in on top once WebGL is running. Not for\n  // Lighthouse: without a GPU it compiles the shaders in software, and some runs then showed a blank screen for seconds\n  if (!prefersReducedMotion() && !isLighthouse() && canvas?.dataset.texture)\n    void startLiquid(canvas, backdrop(canvas.dataset.texture), flow).then((stop) => {\n      if (!alive) return stop?.();\n      stopLiquid = stop;\n      canvas.classList.toggle(\"hero__liquid--on\", Boolean(stop));\n    });\n\n  const stopMotion = motion(root, (self) => {\n    const words = self.querySelectorAll(\".hero__word\");\n    const underline = self.querySelector(\".hero__underline\");\n    const bg = self.querySelector(\".hero__bg\");\n    const fade = self.querySelectorAll(\".hero__lead, .hero__cta\");\n\n    // Lighthouse gets the hero without its entrance, text in place at first paint (see the head script of shell.witty)\n    if (isLighthouse()) flow.value = 1;\n    else {\n      gsap.set(words, { yPercent: 115 });\n      gsap.set(underline, { scaleX: 0 });\n      gsap.set(fade, { autoAlpha: 0, y: 30 });\n      gsap.set(bg, { scale: 1.25 });\n      void introDone.then(() => {\n        gsap.to(flow, { value: 1, duration: 5, ease: \"power2.out\" });\n        gsap.timeline()\n          .to(bg, { scale: 1.05, duration: 2.4, ease: \"expo.out\" })\n          // \"Brilliant idea,\" comes in first on its own, the rest follows\n          .to(words[0], { yPercent: 0, duration: 0.9, ease: \"expo.out\" }, 0)\n          .to([...words].slice(1), { yPercent: 0, duration: 1.4, stagger: 0.12 }, 0.6)\n          // A straight line draws itself under \"digital muscle\", left to right\n          .to(underline, { scaleX: 1, duration: 1.2, ease: \"expo.inOut\" }, 1.5)\n          .to(fade, { autoAlpha: 1, y: 0, duration: 1.1, stagger: 0.1 }, 0.8);\n      });\n    }\n\n    // While scrolling away: background drifts, title lifts and fades\n    gsap.timeline({ scrollTrigger: { trigger: self, start: \"top top\", end: \"bottom top\", scrub: true } })\n      .to(bg, { yPercent: 8, rotate: 1.5, ease: \"none\" }, 0)\n      .to(self.querySelector(\".hero__inner\"), { yPercent: -8, autoAlpha: 0.4, ease: \"none\" }, 0);\n  });\n\n  return () => {\n    alive = false;\n    stopLiquid?.();\n    stopMotion();\n  };\n});\n","// \"Let's talk\": the contact button that unfolds on hover (or keyboard focus, or a tap) into the quickest ways to reach\n// us. In the hero it is the large button that flies up into the header while you scroll; compact, in the header, it\n// is only the phone icon; floating, on a service page, it stays at the bottom right. From tech42v2 HeroContact.vue.\nimport { component } from \"../lib/components\";\nimport { setCallDocked } from \"../lib/dock\";\nimport { gsap, introDone, isTouch, motion, prefersReducedMotion, ScrollTrigger } from \"../lib/motion\";\n\n// Set on the header, its only reader: a custom property on <html> restyles the whole page on every scroll frame\nconst dockHost = () => document.querySelector<HTMLElement>(\".header\")?.style;\n\nfunction setDock(t: number) {\n  dockHost()?.setProperty(\"--call-dock\", String(t));\n}\n\ncomponent(\".hc\", (root) => {\n  const panel = root.querySelector<HTMLElement>(\".hc__panel\")!;\n  const button = root.querySelector<HTMLElement>(\".hc__button\")!;\n  const options = [...panel.querySelectorAll<HTMLAnchorElement>(\".hc__option\")];\n  const compact = root.classList.contains(\"hc--compact\");\n  const floating = root.classList.contains(\"hc--floating\");\n  const cleanups: Array<() => void> = [];\n\n  let opened = false;\n  let tl: gsap.core.Timeline | null = null;\n  function setOpened(value: boolean) {\n    opened = value;\n    panel.setAttribute(\"aria-hidden\", String(!value));\n    button.setAttribute(\"aria-expanded\", String(value));\n    for (const option of options) option.tabIndex = value ? 0 : -1;\n  }\n  // The look of \"open\" (button blended into the panel) lasts until the panel has fully folded back\n  const setExpanded = (value: boolean) => root.classList.toggle(\"hc--open\", value);\n\n  // The panel grows out of the button: its clip starts as exactly the button's pill (bottom right on desktop,\n  // bottom left on small screens, where the panel opens to the right)\n  function buttonClip(fullWidth = false) {\n    const p = panel.getBoundingClientRect(), b = button.getBoundingClientRect();\n    const right = fullWidth ? 0 : p.right - b.right;\n    const left = fullWidth ? 0 : b.left - p.left;\n    return `inset(${b.top - p.top}px ${right}px ${p.bottom - b.bottom}px ${left}px round ${b.height / 2}px)`;\n  }\n\n  function build() {\n    tl?.kill();\n    const items = panel.querySelectorAll(\".hc__title, .hc__item\");\n    // Once folded back into the button, the panel hides completely (no border or shadow left behind it)\n    tl = gsap.timeline({\n      paused: true,\n      onReverseComplete: () => {\n        gsap.set(panel, { autoAlpha: 0 });\n        setExpanded(false);\n      },\n    })\n      // First the button itself stretches out to the full width, then it unfolds upwards into the panel\n      .fromTo(panel, { clipPath: buttonClip(), autoAlpha: 1 }, { clipPath: buttonClip(true), duration: 0.35, ease: \"power3.inOut\" })\n      .to(panel, { clipPath: `inset(0px 0px 0px 0px round ${compact ? 26 : 28}px)`, duration: 0.6, ease: \"expo.out\" })\n      .fromTo(button, { scale: 1 }, { scale: 1.04, duration: 0.2, yoyo: true, repeat: 1, ease: \"power2.out\" }, 0)\n      .fromTo(items, { y: 18, autoAlpha: 0, filter: \"blur(6px)\" }, { y: 0, autoAlpha: 1, filter: \"blur(0px)\", duration: 0.5, stagger: 0.06, ease: \"power3.out\" }, 0.45)\n      // The phone gives a little ring as the options open\n      .fromTo(button.querySelector(\".hc__phone\"), { rotate: 0 }, { keyframes: { rotate: [0, -16, 14, -10, 6, 0] }, duration: 0.6, ease: \"none\" }, 0);\n  }\n\n  function open() {\n    if (opened) return;\n    setOpened(true);\n    setExpanded(true);\n    if (prefersReducedMotion()) return;\n    build();\n    tl!.timeScale(1).play();\n  }\n\n  function close() {\n    if (!opened) return;\n    setOpened(false);\n    if (prefersReducedMotion() || !tl) {\n      setExpanded(false);\n      return;\n    }\n    // Folding back: a little quicker than opening, along the same path (up, then narrow, into the button)\n    tl.timeScale(1.4).reverse();\n  }\n\n  // Hover and focus open it on desktop. On touch screens a tap also fires these (just before the click),\n  // which would open and then instantly close it again, so there only the tap itself toggles it.\n  const onHoverIn = () => { if (!isTouch()) open(); };\n  const onHoverOut = () => { if (!isTouch()) close(); };\n  const onFocusOut = (e: FocusEvent) => {\n    if (!isTouch() && !root.contains(e.relatedTarget as Node)) close();\n  };\n  // On touch screens a tap anywhere outside closes it\n  const onOutsideTap = (e: PointerEvent) => {\n    if (opened && !root.contains(e.target as Node)) close();\n  };\n  // The button itself never jumps away: a click (or tap, where there is no hover) opens or closes the options\n  const onButtonClick = (e: MouseEvent) => {\n    e.preventDefault();\n    if (!isTouch()) open();\n    else if (opened) close();\n    else open();\n  };\n  const onOptionClick = (e: MouseEvent) => {\n    if ((e.currentTarget as HTMLAnchorElement).getAttribute(\"href\")?.includes(\"#\")) close();\n  };\n  root.addEventListener(\"mouseenter\", onHoverIn);\n  root.addEventListener(\"mouseleave\", onHoverOut);\n  root.addEventListener(\"focusin\", onHoverIn);\n  root.addEventListener(\"focusout\", onFocusOut);\n  button.addEventListener(\"click\", onButtonClick);\n  for (const option of options) option.addEventListener(\"click\", onOptionClick);\n  document.addEventListener(\"pointerdown\", onOutsideTap);\n  cleanups.push(() => {\n    root.removeEventListener(\"mouseenter\", onHoverIn);\n    root.removeEventListener(\"mouseleave\", onHoverOut);\n    root.removeEventListener(\"focusin\", onHoverIn);\n    root.removeEventListener(\"focusout\", onFocusOut);\n    button.removeEventListener(\"click\", onButtonClick);\n    for (const option of options) option.removeEventListener(\"click\", onOptionClick);\n    document.removeEventListener(\"pointerdown\", onOutsideTap);\n    tl?.kill();\n  });\n\n  // Floating: the button is on screen the whole time, so the phone in the header stays away. It comes in once the\n  // page's intro has cleared\n  if (floating) {\n    setCallDocked(false);\n    setDock(0);\n    void introDone.then(() => root.classList.add(\"hc--shown\"));\n    cleanups.push(() => {\n      setCallDocked(true);\n      dockHost()?.removeProperty(\"--call-dock\");\n    });\n  }\n\n  // The hero button and the header phone are one button: scrolling the hero away morphs it into the header.\n  // Progress 0 = in the hero, 1 = docked. In between, a fixed stand-in travels from the hero spot to the\n  // header spot while the pill shrinks into a circle and the label fades.\n  // A page published before the stand-in got its inner pill has no .hc-fly__pill: then the button simply stays put.\n  // Checked by hand rather than with :has(), which throws in older browsers and would stop every component after this.\n  const flyer = document.querySelector<HTMLElement>(\".hc-fly\");\n  if (!compact && !floating && flyer?.querySelector(\".hc-fly__pill\")) {\n    flyer.hidden = false;\n    setCallDocked(false);\n    setDock(0);\n    if (prefersReducedMotion()) {\n      // Without motion: no flight, the phone simply appears in the header once the hero is gone\n      const onReducedScroll = () => {\n        const docked = window.scrollY > window.innerHeight * 0.6;\n        setCallDocked(docked);\n        setDock(docked ? 1 : 0);\n        root.style.visibility = docked ? \"hidden\" : \"\";\n      };\n      window.addEventListener(\"scroll\", onReducedScroll, { passive: true });\n      cleanups.push(() => window.removeEventListener(\"scroll\", onReducedScroll));\n    }\n\n    cleanups.push(motion(root, (self) => {\n      const pill = flyer.querySelector<HTMLElement>(\".hc-fly__pill\")!;\n      const label = flyer.querySelector<HTMLElement>(\".hc-fly__label\")!;\n      const icon = flyer.querySelector<HTMLElement>(\".hc-fly__icon\")!;\n      const ease = gsap.parseEase(\"power2.inOut\");\n      const lerp = (a: number, b: number, t: number) => a + (b - a) * t;\n      const flightLength = () => window.innerHeight * 0.6;\n      let hiddenByDock = false;\n      // Style morph: from the orange glass button to the dark glass of the header's menu button\n      const background = gsap.utils.interpolate(\"rgba(255, 119, 0, 0.72)\", \"rgba(23, 31, 28, 0.35)\");\n      const border = gsap.utils.interpolate(\"rgba(255, 255, 255, 0.2)\", \"rgba(255, 255, 255, 0.22)\");\n      const iconBackground = gsap.utils.interpolate(\"rgba(255, 255, 255, 1)\", \"rgba(255, 255, 255, 0)\");\n      const iconColor = gsap.utils.interpolate(\"rgb(23, 31, 28)\", \"rgb(255, 119, 0)\");\n\n      // The phone's own spot in the header (it opens up while the button flies in). The stand-in is positioned by\n      // the right end and the vertical middle of its pill, where the phone icon sits.\n      const headerSlot = () => {\n        const slot = document.querySelector(\".header__call .hc__button\")!.getBoundingClientRect();\n        return { right: slot.right, middle: slot.top + slot.height / 2 };\n      };\n\n      // Where an absolute stand-in's left/top 0 sits on screen: its positioned ancestor, or else the document origin\n      const containerOrigin = () => {\n        const parent = flyer.offsetParent;\n        if (parent && getComputedStyle(parent).position !== \"static\") return parent.getBoundingClientRect();\n        return { left: -window.scrollX, top: -window.scrollY };\n      };\n\n      const update = (progress: number) => {\n        const t = ease(progress);\n        const atStart = progress <= 0.001;\n        const docked = progress >= 0.999;\n        setCallDocked(docked);\n        setDock(t);\n        // Only touch the button's visibility once it has left, so the hero's own intro fade stays in charge\n        if (!atStart || hiddenByDock) {\n          hiddenByDock = !atStart;\n          self.style.visibility = hiddenByDock ? \"hidden\" : \"\";\n        }\n        if (atStart || docked) {\n          flyer.style.visibility = \"hidden\";\n          return;\n        }\n        const from = button.getBoundingClientRect();\n        const to = headerSlot();\n        // Lenis moves the page and calls this in the same frame (lib/scroll.ts), but should an update come in late,\n        // fixed leaves the stand-in behind by (1 - t) of the missed scroll and scrolling along with the page\n        // (absolute) by t of it. So it scrolls along in the first half and is fixed in the second.\n        const scrollsAlong = t < 0.5;\n        flyer.style.position = scrollsAlong ? \"absolute\" : \"\";\n        const origin = scrollsAlong ? containerOrigin() : { left: 0, top: 0 };\n        gsap.set(flyer, {\n          visibility: \"visible\",\n          x: lerp(from.right, to.right, t) - origin.left,\n          y: lerp(from.top + from.height / 2, to.middle, t) - origin.top,\n        });\n        if (opened) close();\n        morph(t);\n      };\n\n      // Style morph of the pill, from the hero button (t = 0) to the phone in the header (t = 1)\n      const morph = (t: number) => {\n        const from = button.getBoundingClientRect();\n        gsap.set(pill, {\n          width: lerp(from.width, 40, t),\n          height: lerp(from.height, 40, t),\n          paddingLeft: lerp(24, 6, t),\n          gap: lerp(18, 0, t),\n          backgroundColor: background(t),\n          borderColor: border(t),\n        });\n        gsap.set(label, { opacity: Math.max(0, 1 - t * 2.5) });\n        gsap.set(icon, { width: lerp(40, 30, t), height: lerp(40, 30, t), backgroundColor: iconBackground(t), color: iconColor(t) });\n      };\n\n      // Runs from the top of the page until the hero is mostly gone\n      ScrollTrigger.create({\n        start: 0,\n        end: flightLength,\n        onUpdate: (st) => update(st.progress),\n        onRefresh: (st) => update(st.progress),\n      });\n      return () => {\n        setCallDocked(true);\n        dockHost()?.removeProperty(\"--call-dock\");\n      };\n    }));\n  }\n\n  return () => cleanups.forEach((fn) => fn());\n});\n","// The strip of client logos: the intro and the track rise into view. From tech42v2 ClientStrip.vue.\nimport { component } from \"../lib/components\";\nimport { motion, revealUp } from \"../lib/motion\";\n\ncomponent(\".clients\", (root) =>\n  motion(root, (self) => {\n    revealUp(self.querySelectorAll(\".clients__intro > *, .clients__track\"), self, { y: 24, stagger: 0.07, start: \"top 92%\" });\n  }),\n);\n","// The pinned \"who we are\" section: words light up while you scroll, then the tagline rises in, and the outline 42\n// draws itself underneath. From tech42v2 WhySection.vue.\nimport { component } from \"../lib/components\";\nimport { gsap, motion, SplitText, wordBlur } from \"../lib/motion\";\n\ncomponent(\".why\", (root) =>\n  motion(root, (self) => {\n    // The server HTML shows the texts one below the other; this switches to the pinned stage layout\n    self.classList.add(\"why--animated\");\n    const one = self.querySelector(\".why__text--one\")!;\n    const step = self.querySelector(\".why__step\")!;\n    const two = self.querySelector(\".why__text--two\")!;\n    const tag = self.querySelector<HTMLElement>(\".why__tag\")!;\n    const label = self.querySelector(\".why__tag-label\")!;\n    const tagline = self.querySelector(\".why__tagline\")!;\n    const wordsOne = SplitText.create(one, { type: \"words\", aria: \"none\" }).words;\n    const wordsTwo = SplitText.create(two, { type: \"words\", aria: \"none\" }).words;\n    // Same line class as revealLines, whose mask padding keeps descenders (the g) from being cut off\n    const taglineLines = SplitText.create(tagline, { type: \"lines\", mask: \"lines\", linesClass: \"split-line\", aria: \"none\" }).lines;\n\n    gsap.set(step, { autoAlpha: 0, y: 40 });\n    const tl = gsap.timeline({\n      scrollTrigger: {\n        trigger: self.querySelector(\".why__stage\"),\n        start: \"top top\",\n        end: () => `+=${Math.round(window.innerHeight * 1.6)}`,\n        pin: true,\n        // A shorter pin with a softer scrub: less scrolling, and the animation glides to where you stop\n        scrub: 1.2,\n        invalidateOnRefresh: true,\n      },\n    })\n      // Words come into focus as they light up: a subtle blur that clears\n      .fromTo(wordsOne, { opacity: 0.12, ...wordBlur(4) }, { opacity: 1, ...wordBlur(0), stagger: 0.1, ease: \"none\", duration: 0.3 })\n      .to(one, { autoAlpha: 0, y: -40, filter: \"blur(8px)\", duration: 0.6, ease: \"power1.in\" }, \"+=0.4\")\n      .fromTo(step, { filter: \"blur(8px)\" }, { autoAlpha: 1, y: 0, filter: \"blur(0px)\", duration: 0.6, ease: \"power1.out\" }, \"<0.2\")\n      .fromTo(wordsTwo, { opacity: 0.12, ...wordBlur(4) }, { opacity: 1, ...wordBlur(0), stagger: 0.1, ease: \"none\", duration: 0.3 }, \"<\")\n      // Text two stays; the tagline rises in underneath it, sharpening as it comes up\n      // \"We call it\" comes first, quietly\n      .from(label, { autoAlpha: 0, y: 12, filter: \"blur(6px)\", duration: 0.6, ease: \"power3.out\" }, \"+=0.3\")\n      .from(taglineLines, { yPercent: 140, filter: \"blur(10px)\", duration: 1, stagger: 0.15, ease: \"power3.out\" }, \"<0.2\")\n      // The text moves up to make room, so text and tagline end up centred together\n      .to(step, { y: () => -(tag.offsetHeight + parseFloat(getComputedStyle(tag).marginTop)) / 2, duration: 1, ease: \"power3.out\" }, \"<\")\n      .to({}, { duration: 1 });\n\n    // Underneath it all, the outline 42 slowly draws itself over the whole pinned scroll,\n    // so it is only complete as the tagline lands\n    const lines = self.querySelectorAll<SVGPathElement>(\".why__42-line\");\n    lines.forEach((line) => {\n      const length = line.getTotalLength();\n      gsap.set(line, { strokeDasharray: length });\n      tl.fromTo(line, { strokeDashoffset: length }, { strokeDashoffset: 0, duration: tl.duration(), ease: \"power1.inOut\" }, 0);\n    });\n    // It also gains strength as it draws: faint while the first words are still dim, clearly there by the tagline\n    tl.fromTo(self.querySelector(\".why__42\"), { opacity: 0.2 }, { opacity: 1, duration: tl.duration(), ease: \"power1.in\" }, 0);\n\n    // Runs when the motion context is reverted\n    return () => self.classList.remove(\"why--animated\");\n  }),\n);\n","// The \"Tech_42 cycle\": rings that ripple out and turn, faster while you scroll. From tech42v2 CycleSection.vue.\nimport { component } from \"../lib/components\";\nimport { gsap, motion, ScrollTrigger, SplitText, wordBlur } from \"../lib/motion\";\n\ncomponent(\".cycle\", (root) =>\n  motion(root, (self) => {\n    const title = self.querySelector<HTMLElement>(\".cycle__title\")!;\n\n    // Oversized heading slides across while the section passes\n    gsap.fromTo(title, { x: () => window.innerWidth * 0.15 }, {\n      x: () => -(title.scrollWidth - window.innerWidth + 80),\n      ease: \"none\",\n      scrollTrigger: { trigger: self, start: \"top bottom\", end: \"center center\", scrub: 0.6, invalidateOnRefresh: true },\n    });\n\n    // Rings ripple outwards. The radius itself grows, so the browser redraws thin lines\n    // instead of scaling large GPU layers (which flashed as a cross on load)\n    const ripple = gsap.timeline({ scrollTrigger: { trigger: self.querySelector(\".cycle__diagram\"), start: \"top 75%\", once: true } });\n    self.querySelectorAll<SVGCircleElement>(\".cycle__ring\").forEach((circle, i) => {\n      ripple.from(circle, { attr: { r: Number(circle.getAttribute(\"r\")) * 0.4 }, opacity: 0, duration: 1.8 }, i * 0.14);\n    });\n\n    // The ring turns on its own; scrolling through the section takes it over:\n    // scrolling down spins it faster, scrolling up turns it back, and it eases back to its own pace.\n    // The labels are fixed to the ring and turn along.\n    // Only the four labels move: rotating the whole (mostly empty) ring layer made the GPU tile seams\n    // flash as a cross through the centre. Each label gets its transform directly: a CSS variable on the diagram\n    // restyled and repainted the whole diagram every frame, which made phones stutter.\n    const labels = [...self.querySelectorAll<HTMLElement>(\".cycle__label\")].map((el) => ({ el, base: parseFloat(el.style.getPropertyValue(\"--a\")) }));\n    const angle = { value: 0 };\n    const spin = gsap.to(angle, {\n      value: 360,\n      duration: 48,\n      ease: \"none\",\n      repeat: -1,\n      onUpdate: () => labels.forEach(({ el, base }) => (el.style.transform = `rotate(${base + angle.value}deg) translateY(-19.9cqw)`)),\n    });\n    // Start far into the repeats so scrolling up can turn it backwards without hitting the tween's start\n    spin.totalTime(48 * 1000);\n    // Every frame, the distance the (smoothed) page moved drives the spin speed:\n    // scrolling down spins it up to ~16x faster, scrolling up turns it backwards,\n    // and when you stop it glides back to its own pace.\n    const scrollPos = () => window.scrollY;\n    let last = scrollPos();\n    let speed = 1;\n    const follow = () => {\n      const y = scrollPos();\n      const delta = y - last;\n      last = y;\n      const target = gsap.utils.clamp(-16, 16, 1 + delta * 0.8);\n      // Pick up quickly, settle slowly\n      speed += (target - speed) * (Math.abs(target - 1) > Math.abs(speed - 1) ? 0.3 : 0.035);\n      spin.timeScale(speed);\n    };\n    ScrollTrigger.create({\n      trigger: self,\n      start: \"top bottom\",\n      end: \"bottom top\",\n      onToggle: (st) => {\n        if (st.isActive) {\n          last = scrollPos();\n          spin.resume();\n          gsap.ticker.add(follow);\n        } else {\n          gsap.ticker.remove(follow);\n          spin.pause();\n        }\n      },\n    });\n    gsap.from(self.querySelectorAll(\".cycle__label\"), {\n      autoAlpha: 0,\n      filter: \"blur(8px)\",\n      clearProps: \"filter\",\n      duration: 1,\n      stagger: 0.12,\n      delay: 0.6,\n      scrollTrigger: { trigger: self.querySelector(\".cycle__diagram\"), start: \"top 75%\", once: true },\n    });\n\n    // Centre copy comes into focus: the heading first, then the text word by word\n    const centreWords = SplitText.create(self.querySelector(\".cycle__text\")!, { type: \"words\", aria: \"none\" }).words;\n    gsap.timeline({ scrollTrigger: { trigger: self.querySelector(\".cycle__centre\"), start: \"top 80%\", once: true } })\n      .from(self.querySelector(\".cycle__mvp\"), { y: 16, autoAlpha: 0, filter: \"blur(10px)\", duration: 1.1, clearProps: \"filter\" })\n      .from(centreWords, { autoAlpha: 0, ...wordBlur(8), duration: 0.9, stagger: 0.035, clearProps: \"filter\" }, \"-=0.6\");\n\n    // Runs when the motion context is reverted\n    return () => gsap.ticker.remove(follow);\n  }),\n);\n","// The services accordion (one row open at a time) and the entrance of the section. From tech42v2 ServicesSection.vue.\nimport { component } from \"../lib/components\";\nimport { gsap, motion, revealLines, revealUp, ScrollTrigger } from \"../lib/motion\";\n\n// The body has bottom padding, so height alone would stop at the padding and jump the rows below when it hides\nconst bodyStyles = \"height,paddingBottom,opacity,visibility\";\n\nfunction expand(el: HTMLElement) {\n  gsap.killTweensOf(el);\n  gsap.set(el, { clearProps: bodyStyles });\n  el.hidden = false;\n  gsap.from(el, { height: 0, paddingBottom: 0, autoAlpha: 0, duration: 0.7, ease: \"expo.out\", clearProps: \"height,paddingBottom\", onComplete: () => ScrollTrigger.refresh() });\n  gsap.from(el.querySelectorAll(\".service__text, .service__tags li, .service__cta\"), { y: 16, autoAlpha: 0, duration: 0.6, stagger: 0.05, delay: 0.1 });\n}\n\nfunction collapse(el: HTMLElement) {\n  gsap.killTweensOf(el);\n  gsap.to(el, {\n    height: 0,\n    paddingBottom: 0,\n    autoAlpha: 0,\n    duration: 0.45,\n    ease: \"power3.inOut\",\n    // The server renders a closed body as hidden, and so does this\n    onComplete: () => {\n      el.hidden = true;\n      gsap.set(el, { clearProps: bodyStyles });\n      ScrollTrigger.refresh();\n    },\n  });\n}\n\ncomponent(\".services\", (root) => {\n  const rows = [...root.querySelectorAll<HTMLElement>(\".service\")];\n  const bodyOf = (row: HTMLElement) => row.querySelector<HTMLElement>(\".service__body\");\n  let open = rows.findIndex((row) => row.classList.contains(\"service--open\"));\n\n  function toggle(index: number) {\n    const previous = open;\n    open = open === index ? -1 : index;\n    rows.forEach((row, i) => {\n      const isOpen = i === open;\n      row.classList.toggle(\"service--open\", isOpen);\n      row.querySelector(\".service__toggle\")?.setAttribute(\"aria-expanded\", String(isOpen));\n    });\n    // Rows without text have no body, so there is nothing to animate for them\n    const closing = previous >= 0 ? bodyOf(rows[previous]) : null;\n    const opening = open >= 0 ? bodyOf(rows[open]) : null;\n    if (closing) collapse(closing);\n    if (opening) expand(opening);\n  }\n\n  const listeners = rows.map((row, i) => {\n    const button = row.querySelector<HTMLElement>(\".service__toggle\")!;\n    const onClick = () => toggle(i);\n    button.addEventListener(\"click\", onClick);\n    return () => button.removeEventListener(\"click\", onClick);\n  });\n\n  const stopMotion = motion(root, (self) => {\n    revealLines(self.querySelector(\".services__title\"));\n    revealUp(self.querySelectorAll(\".services__body\"), self, { y: 24 });\n    revealUp(self.querySelectorAll(\".service\"), self.querySelector(\".services__list\"), { y: 80, stagger: 0.1 });\n\n    // Soft parallax on the light gradient\n    gsap.fromTo(self, { backgroundPosition: \"center 0%, center 30%\" }, {\n      backgroundPosition: \"center 0%, center 70%\",\n      ease: \"none\",\n      scrollTrigger: { trigger: self, start: \"top bottom\", end: \"bottom top\", scrub: true },\n    });\n  });\n\n  return () => {\n    listeners.forEach((fn) => fn());\n    stopMotion();\n    for (const row of rows) {\n      const body = bodyOf(row);\n      if (body) gsap.killTweensOf([body, ...body.querySelectorAll(\"*\")]);\n    }\n  };\n});\n","// The products: each card wipes open and its image drifts inside the frame. From tech42v2 ProductsSection.vue.\nimport { component } from \"../lib/components\";\nimport { gsap, motion, revealLines, revealUp } from \"../lib/motion\";\n\ncomponent(\".products\", (root) =>\n  motion(root, (self) => {\n    revealLines(self.querySelector(\".products__title\"));\n    revealUp(self.querySelectorAll(\".products__body\"), self, { y: 24 });\n\n    self.querySelectorAll<HTMLElement>(\".product\").forEach((card, i) => {\n      // Card wipes open from the top down, panel copy follows\n      gsap.timeline({ scrollTrigger: { trigger: card, start: \"top 85%\", once: true }, delay: i * 0.12 })\n        .from(card, { clipPath: \"inset(0% 0% 100% 0% round 16px)\", duration: 1.4, ease: \"expo.inOut\" })\n        .from(card.querySelectorAll(\".product__meta, .product__text, .product__foot\"), { y: 30, autoAlpha: 0, stagger: 0.08, duration: 1 }, \"-=0.6\");\n\n      // Image drifts inside its frame\n      gsap.fromTo(card.querySelector(\".product__image\"), { yPercent: -5, scale: 1.08 }, {\n        yPercent: 5,\n        scale: 1.08,\n        ease: \"none\",\n        scrollTrigger: { trigger: card, start: \"top bottom\", end: \"bottom top\", scrub: true },\n      });\n    });\n  }),\n);\n","// \"Move faster\": the steps build up like a staircase while the orange section warms up. From tech42v2 HowSection.vue.\nimport { component } from \"../lib/components\";\nimport { gsap, motion, revealLines, revealUp } from \"../lib/motion\";\n\ncomponent(\".how\", (root) =>\n  motion(root, (self) => {\n    revealLines(self.querySelector(\".how__title\"));\n    revealUp(self.querySelectorAll(\".how__body\"), self, { y: 24 });\n\n    // Blocks build up like a staircase, their borders draw in\n    const blocks = self.querySelectorAll(\".step\");\n    gsap.from(blocks, {\n      yPercent: 30,\n      autoAlpha: 0,\n      duration: 1.3,\n      stagger: 0.15,\n      clearProps: \"transform,opacity,visibility\",\n      scrollTrigger: { trigger: self.querySelector(\".how__steps\"), start: \"top 85%\", once: true },\n    });\n    gsap.from(self.querySelectorAll(\".step__title\"), {\n      yPercent: 100,\n      autoAlpha: 0,\n      duration: 1.2,\n      stagger: 0.15,\n      delay: 0.35,\n      scrollTrigger: { trigger: self.querySelector(\".how__steps\"), start: \"top 85%\", once: true },\n    });\n\n    // The orange section warms up while it scrolls by\n    gsap.fromTo(self, { backgroundColor: \"#ff7700\" }, {\n      backgroundColor: \"#ff6400\",\n      ease: \"none\",\n      scrollTrigger: { trigger: self, start: \"top bottom\", end: \"bottom top\", scrub: true },\n    });\n  }),\n);\n","import { gsap } from \"./motion\";\nimport { pick } from \"./site\";\n\n// A small \"Explore\" label that joins the cursor once it comes near one of the round buttons in a section.\n// The label is added to the section (which needs position: relative); returns a cleanup for the motion context.\nexport function cursorHint(section: HTMLElement, buttons: string, text = pick(\"Explore\", \"Ontdek\")): () => void {\n  const label = Object.assign(document.createElement(\"span\"), { className: \"cursor-hint\", textContent: text });\n  label.setAttribute(\"aria-hidden\", \"true\");\n  section.append(label);\n  gsap.set(label, { scale: 0, autoAlpha: 0 });\n\n  const moveX = gsap.quickTo(label, \"x\", { duration: 0.35, ease: \"power3.out\" });\n  const moveY = gsap.quickTo(label, \"y\", { duration: 0.35, ease: \"power3.out\" });\n  let shown = false;\n  const show = (visible: boolean) => {\n    if (visible === shown) return;\n    shown = visible;\n    gsap.to(label, { scale: visible ? 1 : 0, autoAlpha: visible ? 1 : 0, duration: visible ? 0.4 : 0.25, ease: visible ? \"back.out(2)\" : \"power2.in\", overwrite: \"auto\" });\n  };\n\n  const onMove = (event: MouseEvent) => {\n    const box = section.getBoundingClientRect();\n    // Kept inside the section, so it never widens the page near the right edge\n    const x = Math.min(event.clientX - box.left, box.width - label.offsetWidth - 32);\n    const y = event.clientY - box.top;\n    // Snap into place on first appearance instead of flying in from the corner\n    if (!shown) gsap.set(label, { x, y });\n    moveX(x);\n    moveY(y);\n    const near = [...section.querySelectorAll<HTMLElement>(buttons)].some((button) => {\n      const r = button.getBoundingClientRect();\n      return Math.hypot(event.clientX - (r.left + r.width / 2), event.clientY - (r.top + r.height / 2)) < 120;\n    });\n    show(near);\n  };\n  const onLeave = () => show(false);\n\n  section.addEventListener(\"mousemove\", onMove);\n  section.addEventListener(\"mouseleave\", onLeave);\n  return () => {\n    section.removeEventListener(\"mousemove\", onMove);\n    section.removeEventListener(\"mouseleave\", onLeave);\n    label.remove();\n  };\n}\n","// The team: cards are dealt onto the table, and \"Explore\" follows the cursor near the open roles.\n// From tech42v2 TeamSection.vue.\nimport { component } from \"../lib/components\";\nimport { cursorHint } from \"../lib/cursorHint\";\nimport { gsap, isTouch, motion, revealLines, revealUp } from \"../lib/motion\";\n\ncomponent(\".team\", (root) =>\n  motion(root, (self) => {\n    revealLines(self.querySelector(\".team__title\"));\n    revealUp(self.querySelectorAll(\".team__body, .jobs__title, .jobs__list li\"), self.querySelector(\".team__text\"), { y: 24 });\n\n    const members = self.querySelectorAll<HTMLElement>(\".member\");\n    // Cards are dealt onto the table, then straighten out\n    gsap.from(members, {\n      y: 140,\n      rotate: (i: number) => (i % 2 ? 6 : -6),\n      autoAlpha: 0,\n      duration: 1.5,\n      stagger: 0.12,\n      scrollTrigger: { trigger: self.querySelector(\".team__grid\"), start: \"top 80%\", once: true },\n    });\n\n    // Columns move at slightly different speeds for depth\n    members.forEach((member, i) => {\n      gsap.to(member, {\n        yPercent: i % 2 ? -3 : 1.5,\n        ease: \"none\",\n        scrollTrigger: { trigger: self, start: \"top bottom\", end: \"bottom top\", scrub: true },\n      });\n    });\n\n    // \"Explore\" joins the cursor near the round buttons of the open roles\n    return isTouch() ? undefined : cursorHint(self, \".job__icon\");\n  }),\n);\n","// The closing contact section: the card slides out from behind the team section, the gradient keeps turning and the\n// heading arrives character by character. From tech42v2 ContactSection.vue (the popup is a separate component).\nimport { component } from \"../lib/components\";\nimport { gsap, motion, SplitText } from \"../lib/motion\";\n\ncomponent(\".contact\", (root) =>\n  motion(root, (self) => {\n    const card = self.querySelector(\".contact__card\");\n    const bg = self.querySelector(\".contact__bg\");\n\n    // Parallax reveal: the card starts tucked up behind the team section and travels slower than the page,\n    // so the section above seems to slide off it\n    gsap.fromTo(card, { yPercent: -25, scale: 0.97 }, {\n      yPercent: 0,\n      scale: 1,\n      ease: \"none\",\n      scrollTrigger: { trigger: self, start: \"top bottom\", end: \"top top\", scrub: true },\n    });\n\n    // Gradient keeps slowly turning\n    gsap.to(bg, { rotate: \"+=360\", duration: 60, ease: \"none\", repeat: -1 });\n\n    // Mask each word so the heading can reflow on resize while its letters animate.\n    const split = SplitText.create(self.querySelector(\".contact__title\")!, { type: \"words,chars\", mask: \"words\", wordsClass: \"contact__word\" });\n    const tl = gsap.timeline({ scrollTrigger: { trigger: self.querySelector(\".contact__content\"), start: \"top 80%\", once: true } })\n      .from(split.chars, { yPercent: 140, duration: 1, stagger: 0.018 }, 0.1)\n      .from(self.querySelectorAll(\".contact__body, .contact__cta\"), { autoAlpha: 0, y: 24, stagger: 0.1, duration: 1 }, 0.6);\n    // The portrait only exists on service pages; it wipes open from the bottom, like the photos elsewhere on the site\n    const person = self.querySelectorAll(\".contact__person\");\n    if (person.length) tl.from(person, { clipPath: \"inset(100% 0% 0% 0% round 20px)\", duration: 1.4, ease: \"expo.inOut\" }, 0.2);\n  }),\n);\n","// A service page: hero, photo, steps and text parts animate in, and the illustrations load when they scroll into\n// view. From tech42v2 ServicePage.vue.\nimport { component } from \"../lib/components\";\nimport { isLighthouse } from \"../lib/intro\";\nimport { gsap, introDone, motion, revealLines, revealUp, SplitText, wordBlur } from \"../lib/motion\";\n\n// The dark drawings only show on hover, so a touch screen does not load them\nconst canHover = window.matchMedia(\"(hover: hover)\").matches;\n\n// Fetches the drawings right away and shows them once most of the frame is on screen, so the drawing builds up in\n// view rather than at the screen's edge, without waiting for the network then. Each image gets a blob URL of its\n// own: that is a fresh SVG document, so its animation starts when it is shown, not when it was fetched.\nfunction loadWhenInView(frame: Element, observers: IntersectionObserver[], urls: Array<Promise<string>>) {\n  const images = [...frame.querySelectorAll<HTMLImageElement>(\"img[data-src]\")]\n    .filter((img) => canHover || !img.classList.contains(\"sp-highlight__img--dark\"))\n    .map((img) => {\n      const url = fetch(img.dataset.src!).then((response) => response.ok ? response.blob() : Promise.reject(new Error(response.statusText)))\n        .then((blob) => URL.createObjectURL(blob), () => img.dataset.src!);\n      urls.push(url);\n      return { img, url };\n    });\n  const observer = new IntersectionObserver(\n    (entries) => {\n      if (!entries.some((entry) => entry.isIntersecting)) return;\n      for (const { img, url } of images) void url.then((src) => (img.src = src));\n      observer.disconnect();\n    },\n    { threshold: 0.6 },\n  );\n  observer.observe(frame);\n  observers.push(observer);\n}\n\ncomponent(\".sp\", (root) => {\n  const observers: IntersectionObserver[] = [];\n  const urls: Array<Promise<string>> = [];\n  for (const frame of root.querySelectorAll(\".sp-lead__art, .sp-highlight__art\")) loadWhenInView(frame, observers, urls);\n\n  const stopMotion = motion(root, (self) => {\n    // Hero: the title rises line by line once the page has loaded, the rest comes into focus\n    const titleLines = SplitText.create(self.querySelector(\".sp-hero__title\"), { type: \"lines\", mask: \"lines\", linesClass: \"split-line\", aria: \"none\" }).lines;\n    const hero = gsap.timeline({ paused: true })\n      .from(titleLines, { yPercent: 140, duration: 1.3, stagger: 0.09 })\n      .from(self.querySelectorAll(\".sp-back, .sp-hero__num, .sp-hero__headline, .sp-hero__intro\"), { autoAlpha: 0, y: 20, filter: \"blur(8px)\", duration: 1, stagger: 0.08, clearProps: \"filter\" }, \"-=0.9\");\n    // Lighthouse gets the hero without its entrance (see the head script of shell.witty)\n    if (isLighthouse()) hero.progress(1);\n    else void introDone.then(() => hero.play());\n\n    // Photo wipes open from the top, then drifts with the scroll\n    const photo = self.querySelector(\".sp-photo__frame\");\n    if (photo) {\n      gsap.from(photo, { clipPath: \"inset(0% 0% 100% 0% round 20px)\", duration: 1.4, ease: \"expo.inOut\", scrollTrigger: { trigger: photo, start: \"top 85%\", once: true } });\n      gsap.fromTo(self.querySelector(\".sp-photo__img\"), { yPercent: -6, scale: 1.12 }, {\n        yPercent: 6,\n        scale: 1.12,\n        ease: \"none\",\n        scrollTrigger: { trigger: photo, start: \"top bottom\", end: \"bottom top\", scrub: true },\n      });\n    }\n\n    // Steps build up side by side\n    const steps = self.querySelectorAll(\".sp-step\");\n    if (steps.length) {\n      gsap.from(steps, {\n        yPercent: 30,\n        autoAlpha: 0,\n        duration: 1.3,\n        stagger: 0.15,\n        clearProps: \"transform,opacity,visibility\",\n        scrollTrigger: { trigger: self.querySelector(\".sp-steps__list\"), start: \"top 85%\", once: true },\n      });\n    }\n\n    // The opening and each part: the title rises, the text comes into focus\n    self.querySelectorAll<HTMLElement>(\".sp-lead__copy, .sp-part\").forEach((part) => {\n      revealLines(part.querySelector(\".sp-lead__title, .sp-part__title\"), { trigger: part });\n      gsap.from(part.querySelectorAll(\".sp-lead__text, .sp-part__num, .sp-part__text\"), {\n        autoAlpha: 0,\n        y: 20,\n        filter: \"blur(8px)\",\n        duration: 1,\n        clearProps: \"filter\",\n        scrollTrigger: { trigger: part, start: \"top 85%\", once: true },\n      });\n    });\n\n    // Closing statement: words sharpen and light up as it scrolls through\n    const words = SplitText.create(self.querySelector(\".sp-closing__text\"), { type: \"words\", aria: \"none\" }).words;\n    gsap.fromTo(words, { opacity: 0.15, ...wordBlur(6) }, {\n      opacity: 1,\n      ...wordBlur(0),\n      stagger: 0.1,\n      ease: \"none\",\n      scrollTrigger: { trigger: self.querySelector(\".sp-closing\"), start: \"top 75%\", end: \"center center\", scrub: 0.8 },\n    });\n\n    revealLines(self.querySelector(\".sp-others__title\"));\n    revealUp(self.querySelectorAll(\".sp-others__list li\"), self.querySelector(\".sp-others__list\"), { y: 40, stagger: 0.1 });\n  });\n\n  return () => {\n    for (const observer of observers) observer.disconnect();\n    for (const url of urls) void url.then((src) => src.startsWith(\"blob:\") && URL.revokeObjectURL(src));\n    stopMotion();\n  };\n});\n","// \"Where your budget goes\" on a service page: the title rises, each comparison row draws its rule and slides in.\n// From tech42v2 BudgetSection.vue.\nimport { component } from \"../lib/components\";\nimport { gsap, motion, revealLines, revealUp } from \"../lib/motion\";\n\ncomponent(\".budget\", (root) =>\n  motion(root, (self) => {\n    revealLines(self.querySelector(\".budget__title\"));\n    revealUp(self.querySelectorAll(\".budget__body\"), self, { y: 24 });\n\n    // Each row slides in, its rule drawing across first\n    const list = self.querySelector(\".budget__compare\");\n    gsap.timeline({ scrollTrigger: { trigger: list, start: \"top 80%\", once: true } })\n      .from(self.querySelectorAll(\".budget__row\"), { \"--rule\": 0, duration: 1, stagger: 0.12, ease: \"expo.out\" })\n      .from(self.querySelectorAll(\".budget__from, .budget__to\"), { y: 20, autoAlpha: 0, duration: 0.9, stagger: 0.06 }, \"<0.15\")\n      .from(self.querySelectorAll(\".budget__head, .budget__note\"), { autoAlpha: 0, duration: 0.8 }, \"<0.3\");\n  }));\n","// A vacancy page: hero, photo and text parts animate in, and the floating apply button (outside <main>, in the\n// shell) shows between the hero and the closing card. From tech42v2 JobPage.vue.\nimport { component } from \"../lib/components\";\nimport { gsap, introDone, motion, revealLines, ScrollTrigger, SplitText, wordBlur } from \"../lib/motion\";\n\ncomponent(\".jp\", (root) => {\n  const float = document.querySelector<HTMLAnchorElement>(\"a.jp-float\");\n  let pastHero = false;\n  let atCta = false;\n  function updateFloat() {\n    if (!float) return;\n    const shown = pastHero && !atCta;\n    float.classList.toggle(\"jp-float--shown\", shown);\n    float.tabIndex = shown ? 0 : -1;\n    float.setAttribute(\"aria-hidden\", String(!shown));\n  }\n\n  const stopMotion = motion(root, (self) => {\n    // Hero: the title rises line by line, the rest comes into focus\n    const titleLines = SplitText.create(self.querySelector(\".jp-hero__title\"), { type: \"lines\", mask: \"lines\", linesClass: \"split-line\", aria: \"none\" }).lines;\n    const hero = gsap.timeline({ paused: true })\n      .from(titleLines, { yPercent: 140, duration: 1.3, stagger: 0.09 })\n      .from(self.querySelectorAll(\".jp-back, .jp-facts li, .jp-hero__tagline\"), { autoAlpha: 0, y: 20, filter: \"blur(8px)\", duration: 1, stagger: 0.08, clearProps: \"filter\" }, \"-=0.9\");\n    void introDone.then(() => hero.play());\n\n    // Photo wipes open from the top, then drifts with the scroll\n    const photo = self.querySelector(\".jp-photo__frame\");\n    gsap.from(photo, { clipPath: \"inset(0% 0% 100% 0% round 20px)\", duration: 1.4, ease: \"expo.inOut\", scrollTrigger: { trigger: photo, start: \"top 85%\", once: true } });\n    gsap.fromTo(self.querySelector(\".jp-photo__img\"), { yPercent: -6, scale: 1.12 }, {\n      yPercent: 6,\n      scale: 1.12,\n      ease: \"none\",\n      scrollTrigger: { trigger: photo, start: \"top bottom\", end: \"bottom top\", scrub: true },\n    });\n\n    // Intro lines sharpen word by word as they scroll through\n    const words = SplitText.create(self.querySelectorAll(\".jp-intro__line\"), { type: \"words\", aria: \"none\" }).words;\n    gsap.fromTo(words, { opacity: 0.15, ...wordBlur(6) }, {\n      opacity: 1,\n      ...wordBlur(0),\n      stagger: 0.1,\n      ease: \"none\",\n      scrollTrigger: { trigger: self.querySelector(\".jp-intro\"), start: \"top 75%\", end: \"bottom 60%\", scrub: 0.8 },\n    });\n\n    self.querySelectorAll<HTMLElement>(\".jp-part\").forEach((part) => {\n      revealLines(part.querySelector(\".jp-part__title\"), { trigger: part });\n      gsap.from(part.querySelectorAll(\".jp-part__text, .jp-list li\"), {\n        autoAlpha: 0,\n        y: 16,\n        filter: \"blur(6px)\",\n        duration: 0.9,\n        stagger: 0.05,\n        clearProps: \"filter\",\n        scrollTrigger: { trigger: part, start: \"top 85%\", once: true },\n      });\n    });\n\n    // The button starts display: none; with script it is laid out (still invisible) so it can slide in\n    if (float) float.hidden = false;\n    ScrollTrigger.create({ trigger: self.querySelector(\".jp-hero\"), start: \"bottom 70%\", end: \"max\", onToggle: (st) => { pastHero = st.isActive; updateFloat(); } });\n    ScrollTrigger.create({ trigger: self.querySelector(\".jp-apply\"), start: \"top 80%\", end: \"max\", onToggle: (st) => { atCta = st.isActive; updateFloat(); } });\n    return () => {\n      pastHero = atCta = false;\n      updateFloat();\n      if (float) float.hidden = true;\n    };\n  });\n\n  return stopMotion;\n});\n","// The closing \"Let's grab a coffee\" card on a vacancy or info page. Animation only; its button opens the video\n// application popup (apply-modal.ts). From tech42v2 ApplyCta.vue.\nimport { component } from \"../lib/components\";\nimport { gsap, motion, SplitText } from \"../lib/motion\";\n\ncomponent(\".jp-apply\", (root) =>\n  motion(root, (self) => {\n    // Card grows into place, the gradient keeps turning, the title arrives letter by letter\n    const card = self.querySelector(\".jp-apply__card\");\n    gsap.fromTo(card, { scale: 0.94, borderRadius: 48 }, {\n      scale: 1,\n      borderRadius: 28,\n      ease: \"none\",\n      scrollTrigger: { trigger: card, start: \"top bottom\", end: \"top 30%\", scrub: true },\n    });\n    gsap.to(self.querySelector(\".jp-apply__bg\"), { rotate: \"+=360\", duration: 60, ease: \"none\", repeat: -1 });\n    const chars = SplitText.create(self.querySelector(\".jp-apply__title\"), { type: \"lines,chars\", mask: \"lines\", linesClass: \"split-line\" }).chars;\n    gsap.timeline({ scrollTrigger: { trigger: card, start: \"top 70%\", once: true } })\n      .from(chars, { yPercent: 140, duration: 1, stagger: 0.03 })\n      .from(self.querySelectorAll(\".jp-apply__copy, .jp-apply__actions\"), { autoAlpha: 0, y: 24, filter: \"blur(8px)\", stagger: 0.1, duration: 1, clearProps: \"filter\" }, 0.4);\n  }));\n","// The blog overview: title and intro come in after the intro curtain, the cards come into focus as they scroll in.\n// From tech42v2 BlogPage.vue.\nimport { component } from \"../lib/components\";\nimport { gsap, introDone, motion, SplitText } from \"../lib/motion\";\n\ncomponent(\".blog\", (root) => {\n  return motion(root, (self) => {\n    const lines = SplitText.create(self.querySelector(\".blog-hero__title\")!, { type: \"lines\", mask: \"lines\", linesClass: \"split-line\", aria: \"none\" }).lines;\n    const hero = gsap.timeline({ paused: true })\n      .from(lines, { yPercent: 140, duration: 1.3 })\n      .from(self.querySelector(\".blog-hero__intro\"), { autoAlpha: 0, y: 20, filter: \"blur(8px)\", duration: 1, clearProps: \"filter\" }, \"-=0.8\");\n    void introDone.then(() => hero.play());\n\n    // Cards come into focus one after another\n    gsap.from(self.querySelectorAll(\".post\"), {\n      y: 60,\n      autoAlpha: 0,\n      filter: \"blur(8px)\",\n      duration: 1.1,\n      stagger: 0.12,\n      clearProps: \"filter\",\n      scrollTrigger: { trigger: self.querySelector(\".blog-list__grid\"), start: \"top 85%\", once: true },\n    });\n  });\n});\n","// An article: reading progress, hero entrance, cover wipe and parallax, and the copy-link button.\n// From tech42v2 ArticlePage.vue.\nimport { component } from \"../lib/components\";\nimport { gsap, introDone, motion, SplitText } from \"../lib/motion\";\nimport { pick } from \"../lib/site\";\n\nconst t = pick(\n  { copied: \"Link copied\", copy: \"Copy link\", copyPrompt: \"Copy this link:\" },\n  { copied: \"Link gekopieerd\", copy: \"Kopieer link\", copyPrompt: \"Kopieer deze link:\" },\n);\nconst copyIcon = \"M10 14a4.5 4.5 0 0 0 6.36 0l3-3a4.5 4.5 0 0 0-6.36-6.36l-1 1M14 10a4.5 4.5 0 0 0-6.36 0l-3 3a4.5 4.5 0 0 0 6.36 6.36l1-1\";\nconst checkIcon = \"M5 12.5l4.5 4.5L19 7.5\";\n\ncomponent(\".article\", (root) => {\n  const button = root.querySelector<HTMLButtonElement>(\"button.art-share__button\")!;\n  const status = root.querySelector<HTMLElement>(\".art-share__status\")!;\n  const icon = button.querySelector(\"path\")!;\n  let timer: number | undefined;\n\n  function setCopied(value: boolean) {\n    button.setAttribute(\"aria-label\", value ? t.copied : t.copy);\n    status.textContent = value ? t.copied : \"\";\n    icon.setAttribute(\"d\", value ? checkIcon : copyIcon);\n  }\n\n  // Sharing uses the page's own address, so it works the same on the preview and on the real site\n  const pageUrl = () => window.location.href.split(\"#\")[0];\n  async function copyLink() {\n    try {\n      await navigator.clipboard.writeText(pageUrl());\n      setCopied(true);\n      window.clearTimeout(timer);\n      timer = window.setTimeout(() => setCopied(false), 2000);\n    } catch {\n      // eslint-disable-next-line no-alert -- same fallback as tech42v2 when the clipboard is blocked\n      window.prompt(t.copyPrompt, pageUrl());\n    }\n  }\n  const onClick = () => void copyLink();\n  button.addEventListener(\"click\", onClick);\n\n  const stopMotion = motion(root, (self) => {\n    // Reading progress follows the article text, from its first line to its last. The bar sits outside <main>.\n    gsap.fromTo(document.querySelector(\".art-progress__bar\"), { scaleX: 0 }, {\n      scaleX: 1,\n      ease: \"none\",\n      scrollTrigger: { trigger: self.querySelector(\".art-prose\"), start: \"top 80%\", end: \"bottom 60%\", scrub: true },\n    });\n\n    const lines = SplitText.create(self.querySelector(\".art-hero__title\")!, { type: \"lines\", mask: \"lines\", linesClass: \"split-line\", aria: \"none\" }).lines;\n    const hero = gsap.timeline({ paused: true })\n      .from(lines, { yPercent: 140, duration: 1.3, stagger: 0.08 })\n      .from(self.querySelectorAll(\".art-back, .art-meta\"), { autoAlpha: 0, y: 16, filter: \"blur(8px)\", duration: 1, stagger: 0.08, clearProps: \"filter\" }, \"-=0.9\");\n    void introDone.then(() => hero.play());\n\n    // Cover wipes open from the top, then drifts with the scroll\n    const frame = self.querySelector(\".art-cover__frame\");\n    gsap.from(frame, { clipPath: \"inset(0% 0% 100% 0% round 20px)\", duration: 1.4, ease: \"expo.inOut\", scrollTrigger: { trigger: frame, start: \"top 90%\", once: true } });\n    gsap.fromTo(self.querySelector(\".art-cover__img\"), { yPercent: -5, scale: 1.1 }, {\n      yPercent: 5,\n      scale: 1.1,\n      ease: \"none\",\n      scrollTrigger: { trigger: frame, start: \"top bottom\", end: \"bottom top\", scrub: true },\n    });\n  });\n\n  return () => {\n    stopMotion();\n    button.removeEventListener(\"click\", onClick);\n    window.clearTimeout(timer);\n    setCopied(false);\n  };\n});\n","// An info page (about, vacancies overview, ...): hero entrance, photo wipe, and parts and cards rising into view.\n// From tech42v2 InfoPage.vue.\nimport { component } from \"../lib/components\";\nimport { gsap, introDone, motion, SplitText } from \"../lib/motion\";\n\ncomponent(\".info\", (root) => {\n  return motion(root, (self) => {\n    const lines = SplitText.create(self.querySelector(\".info-hero__title\")!, { type: \"lines\", mask: \"lines\", linesClass: \"split-line\", aria: \"none\" }).lines;\n    const hero = gsap.timeline({ paused: true })\n      .from(lines, { yPercent: 140, duration: 1.3 })\n      .from(self.querySelectorAll(\".info-hero__intro, .info-hero__facts\"), { autoAlpha: 0, y: 20, filter: \"blur(8px)\", duration: 1, stagger: 0.1, clearProps: \"filter\" }, \"-=0.8\");\n    void introDone.then(() => hero.play());\n\n    // Photo wipes open from the top, then drifts with the scroll, like on the service pages\n    const photo = self.querySelector(\".info-photo__frame\");\n    if (photo) {\n      gsap.from(photo, { clipPath: \"inset(0% 0% 100% 0% round 20px)\", duration: 1.4, ease: \"expo.inOut\", scrollTrigger: { trigger: photo, start: \"top 85%\", once: true } });\n      gsap.fromTo(self.querySelector(\".info-photo__img\"), { yPercent: -6, scale: 1.12 }, {\n        yPercent: 6,\n        scale: 1.12,\n        ease: \"none\",\n        scrollTrigger: { trigger: photo, start: \"top bottom\", end: \"bottom top\", scrub: true },\n      });\n    }\n\n    // Cards build up side by side\n    const cards = self.querySelectorAll(\".info-card\");\n    if (cards.length)\n      gsap.from(cards, { autoAlpha: 0, y: 40, duration: 1, stagger: 0.1, ease: \"power3.out\", scrollTrigger: { trigger: cards[0], start: \"top 85%\", once: true } });\n\n    // Parts and link cards rise in as they come into view\n    self.querySelectorAll(\".info-part, .info-gallery, .info-team, .info-links\").forEach((el) => {\n      gsap.from(el, { autoAlpha: 0, y: 40, duration: 1, ease: \"power3.out\", scrollTrigger: { trigger: el, start: \"top 85%\", once: true } });\n    });\n  });\n});\n","// A policy page (terms, privacy, ...): the hero entrance after the intro curtain. From tech42v2 PolicyPage.vue.\nimport { component } from \"../lib/components\";\nimport { gsap, introDone, motion, SplitText } from \"../lib/motion\";\n\ncomponent(\".policy\", (root) => {\n  return motion(root, (self) => {\n    const lines = SplitText.create(self.querySelector(\".policy-hero__title\")!, { type: \"lines\", mask: \"lines\", linesClass: \"split-line\", aria: \"none\" }).lines;\n    const hero = gsap.timeline({ paused: true })\n      .from(lines, { yPercent: 140, duration: 1.3 })\n      .from(self.querySelector(\".policy-hero__intro\"), { autoAlpha: 0, y: 20, filter: \"blur(8px)\", duration: 1, clearProps: \"filter\" }, \"-=0.8\");\n    void introDone.then(() => hero.play());\n  });\n});\n","// The footer: its columns come into view, and the giant logo glyphs rise out of the bottom edge. From tech42v2\n// SiteFooter.vue.\nimport { component } from \"../lib/components\";\nimport { gsap, motion, revealUp } from \"../lib/motion\";\n\ncomponent(\".footer\", (root) =>\n  motion(root, (self) => {\n    revealUp(self.querySelectorAll(\".footer__top > *, .footer__bar > *\"), self, { y: 30, stagger: 0.08, start: \"top 85%\" });\n\n    // Giant logo glyphs rise out of the bottom edge while you reach the end of the page\n    const glyphs = self.querySelectorAll(\".footer__wordmark-logo path\");\n    gsap.fromTo(glyphs, { y: 32 }, {\n      y: 0,\n      stagger: 0.06,\n      ease: \"none\",\n      scrollTrigger: { trigger: self.querySelector(\".footer__wordmark\"), start: \"top bottom\", end: \"bottom bottom\", scrub: 0.8 },\n    });\n  }));\n","// The contact form as a popup (tech42v2 ContactModal.vue). A link to the contact page opens it instead of navigating:\n// the popup fetches that page and moves its WebHare form into the panel, so the form is stored and handled exactly as\n// on the page itself. Without JavaScript, or when fetching fails, the link simply goes to the contact page.\n// The contact page also gets the form's finishing touches (button, source fields), without the popup.\nimport { registerMissed } from \"@webhare/dompack\";\nimport { component } from \"../lib/components\";\nimport { leadSource, track } from \"../lib/leads\";\nimport { gsap, prefersReducedMotion } from \"../lib/motion\";\nimport { basePath } from \"../lib/site\";\n\nconst arrow = `<svg class=\"arrow\" width=\"18\" height=\"18\" viewBox=\"0 0 25 25\" fill=\"none\" aria-hidden=\"true\"><path d=\"M6.58 12.44H17.57M13.17 16.84L17.57 12.44L13.17 8.04\" /></svg>`;\n\n/** Gives a contact form the site's button and the visitor's source, and reports a sent form */\nfunction prepareForm(form: HTMLFormElement, panel: HTMLElement): void {\n  const submit = form.querySelector(\".wh-form__button--submit\");\n  if (submit && !submit.classList.contains(\"btn\")) {\n    submit.classList.add(\"btn\");\n    submit.querySelector(\".wh-form__buttonlabel\")?.classList.add(\"btn__label\");\n    submit.insertAdjacentHTML(\"beforeend\", `<span class=\"btn__icon\">${arrow}</span>`);\n  }\n  // tech42v2 put the privacy note beside the send button, which sits in the platform's button group\n  const note = panel.querySelector(\".cm__note\");\n  if (note) form.querySelector(\".wh-form__buttongroup\")?.append(note);\n\n  // Where the visitor came from (frontend/lib/leads.ts) goes along with the lead to Tech_42 OS\n  const source = leadSource();\n  const values: Record<string, string> = {\n    source_channel: source?.channel ?? \"\",\n    source_referrer: source?.referrer ?? \"\",\n    source_landingpage: source?.landingPage ?? \"\",\n    source_utm: source ? JSON.stringify(source.utm) : \"\",\n    source_firstseen: source?.firstSeen ?? \"\",\n    page: basePath(),\n  };\n  for (const [name, value] of Object.entries(values)) {\n    const input = form.querySelector<HTMLInputElement>(`input[type=\"hidden\"][name=\"${name}\"]`);\n    if (input) input.value = value;\n  }\n\n  form.addEventListener(\"wh:form-submitted\", () => {\n    panel.classList.add(\"cm--sent\");\n    const foundVia = form.querySelector<HTMLSelectElement>('select[name=\"found_via\"]');\n    track(\"lead_form\", { method: \"form\", found_via: foundVia?.value ? foundVia.selectedOptions[0].text : \"\" });\n  });\n}\n\n// The contact page: the form is already there\ncomponent(\".cm--page\", (root) => {\n  const form = root.querySelector<HTMLFormElement>(\"form.wh-form\");\n  if (form) prepareForm(form, root);\n});\n\ncomponent(\".cm[role=dialog]\", (root) => {\n  const slot = root.querySelector<HTMLElement>(\".cm__form\")!;\n  const closeButton = root.querySelector<HTMLButtonElement>(\".cm__close\")!;\n  let returnFocus: HTMLElement | null = null;\n  let form: HTMLFormElement | null = null;\n  let opening = false;\n\n  const setPageInert = (inert: boolean) => {\n    for (const el of document.querySelectorAll(\"#smooth-wrapper, .header\")) el.toggleAttribute(\"inert\", inert);\n    document.documentElement.style.overflow = inert ? \"hidden\" : \"\";\n  };\n\n  const onKeydown = (e: KeyboardEvent) => {\n    if (e.key === \"Escape\") close();\n    if (e.key !== \"Tab\") return;\n    const items = [...root.querySelectorAll<HTMLElement>(\"a[href], button, input:not([type=hidden]):not([tabindex='-1']), select, textarea\")].filter((el) => el.offsetParent !== null);\n    if (!items.length) return;\n    const first = items[0], last = items[items.length - 1];\n    if (e.shiftKey && document.activeElement === first) {\n      e.preventDefault();\n      last.focus();\n    } else if (!e.shiftKey && document.activeElement === last) {\n      e.preventDefault();\n      first.focus();\n    }\n  };\n\n  /** The form of the contact page; a fresh one after a sent form, as tech42v2 started over on every open */\n  async function loadForm(href: string): Promise<HTMLFormElement> {\n    const response = await fetch(href, { credentials: \"same-origin\" });\n    if (!response.ok) throw new Error(`Could not load the contact form from \"${href}\" (${response.status})`);\n    const page = new DOMParser().parseFromString(await response.text(), \"text/html\");\n    const fetched = page.querySelector<HTMLFormElement>(\"form.wh-form\") ?? (() => { throw new Error(`No form on \"${href}\"`); })();\n    const node = document.importNode(fetched, true);\n    // The note sits in the old form's button group: keep it before that form goes\n    slot.after(root.querySelector(\".cm__note\")!);\n    slot.replaceChildren(node);\n    root.classList.remove(\"cm--sent\");\n    prepareForm(node, root);\n    registerMissed(node);\n    return node;\n  }\n\n  async function open(link: HTMLAnchorElement): Promise<void> {\n    if (opening) return;\n    opening = true;\n    try {\n      if (!form || root.classList.contains(\"cm--sent\")) form = await loadForm(link.href);\n    } catch (error) {\n      console.error(error);\n      window.location.href = link.href;\n      return;\n    } finally {\n      opening = false;\n    }\n\n    returnFocus = link;\n    root.hidden = false;\n    setPageInert(true);\n    document.addEventListener(\"keydown\", onKeydown);\n    // The animation starts its fields hidden, which would take the focus away again: focus once they are visible\n    const focusFirst = () => root.querySelector<HTMLElement>(\".wh-form__textinput\")?.focus({ preventScroll: true });\n    if (prefersReducedMotion()) return void focusFirst();\n    // Backdrop fades in, the panel rises out of a blur, then its content lines up\n    gsap.timeline({ onComplete: focusFirst })\n      .from(root.querySelector(\".cm__backdrop\"), { autoAlpha: 0, duration: 0.5, ease: \"power2.out\" })\n      .from(root.querySelector(\".cm__panel\"), { y: 80, scale: 0.96, autoAlpha: 0, filter: \"blur(12px)\", duration: 0.9, ease: \"expo.out\", clearProps: \"filter\" }, \"-=0.3\")\n      .from(root.querySelectorAll(\".cm__side-content > *, .cm__options li, .cm__title, .wh-form__fieldgroup, .wh-form__buttongroup\"), { y: 24, autoAlpha: 0, duration: 0.7, stagger: 0.04 }, \"-=0.55\");\n  }\n\n  function close(): void {\n    if (root.hidden) return;\n    document.removeEventListener(\"keydown\", onKeydown);\n    const finish = () => {\n      root.hidden = true;\n      gsap.set(root.querySelectorAll(\".cm__backdrop, .cm__panel\"), { clearProps: \"all\" });\n      setPageInert(false);\n      returnFocus?.focus({ preventScroll: true });\n    };\n    if (prefersReducedMotion()) return finish();\n    gsap.timeline({ onComplete: finish })\n      .to(root.querySelector(\".cm__panel\"), { y: 40, autoAlpha: 0, filter: \"blur(8px)\", duration: 0.45, ease: \"power2.in\" })\n      .to(root.querySelector(\".cm__backdrop\"), { autoAlpha: 0, duration: 0.35 }, \"-=0.2\");\n  }\n\n  // Every link to the contact page, also in content that swup puts in later\n  const onClick = (e: MouseEvent) => {\n    const link = (e.target as Element | null)?.closest<HTMLAnchorElement>(\"a[href]\");\n    if (!link || e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;\n    if (link.target === \"_blank\" || !new URL(link.href).pathname.endsWith(\"/contact/\") || new URL(link.href).origin !== window.location.origin) return;\n    e.preventDefault();\n    void open(link);\n  };\n\n  const onBackdrop = () => close();\n  // Capturing, so this runs before swup takes the link as a page visit (transitions.ts), also after a swap remounts it\n  document.addEventListener(\"click\", onClick, { capture: true });\n  closeButton.addEventListener(\"click\", onBackdrop);\n  root.querySelector(\".cm__backdrop\")?.addEventListener(\"click\", onBackdrop);\n  return () => {\n    document.removeEventListener(\"click\", onClick, { capture: true });\n    document.removeEventListener(\"keydown\", onKeydown);\n    if (!root.hidden) setPageInert(false);\n  };\n});\n","// The video application (tech42v2 ApplyModal.vue). The recorder is the one of tech42v2; what it records goes into the\n// video field of the WebHare application form, so the application is stored and mailed like any form result. A link to\n// the application page opens the popup instead of navigating: the popup fetches that page and moves its form into the\n// panel. Without JavaScript, or when fetching fails, the link simply goes to the application page, which has the same\n// panel and recorder. A browser that can't record gets the form's own upload field.\nimport { registerMissed } from \"@webhare/dompack\";\nimport type { FormFileValue } from \"@webhare/forms\";\nimport { component } from \"../lib/components\";\nimport { gsap, prefersReducedMotion } from \"../lib/motion\";\n\nconst maxSeconds = 60;\n// The platform uploads in chunks and sets no limit of its own. A minute at 1280 wide records at roughly 10 to 30 MB,\n// so this only stops an upload that is clearly not a one-minute video\nconst maxBytes = 60 * 1024 * 1024;\n\ntype Stage = \"idle\" | \"unavailable\" | \"live\" | \"recording\" | \"recorded\";\ntype FileField = HTMLElement & { value: Array<Partial<FormFileValue>> };\n\n// The first recording format this browser supports (Chrome and Firefox record WebM, Safari MP4)\nfunction recordingType(): string {\n  const types = [\"video/webm;codecs=vp9,opus\", \"video/webm;codecs=vp8,opus\", \"video/webm\", \"video/mp4\"];\n  return types.find((type) => window.MediaRecorder?.isTypeSupported(type)) ?? \"\";\n}\n\nfunction canRecord(): boolean {\n  return typeof navigator.mediaDevices?.getUserMedia === \"function\" && typeof window.MediaRecorder === \"function\";\n}\n\nconst tooBig = () => (document.documentElement.lang === \"nl\" ? \"Je video is groter dan 60 MB.\" : \"Your video is larger than 60 MB.\");\n\n/** The recorder of one panel. `field` is the form's video field once the form is there. Returns `reset`, which starts\n    over from a switched-off camera, and `stop`, which switches the camera off. */\nfunction recorder(panel: HTMLElement, field: () => FileField | null) {\n  const rec = panel.querySelector<HTMLElement>(\".rec\")!;\n  const liveVideo = rec.querySelector<HTMLVideoElement>(\".rec__video--live\")!;\n  const playback = rec.querySelector<HTMLVideoElement>(\".rec__video--playback\")!;\n  const error = panel.querySelector<HTMLElement>(\".apply__error\")!;\n  const ring = rec.querySelector<SVGCircleElement>(\".rec__ring-progress\")!;\n  const left = rec.querySelector<HTMLElement>(\".rec__left\")!;\n  let stream: MediaStream | null = null;\n  let mediaRecorder: MediaRecorder | null = null;\n  let timer = 0;\n  let videoUrl = \"\";\n\n  const setStage = (stage: Stage) => {\n    rec.className = `rec rec--${stage}`;\n    for (const el of rec.querySelectorAll<HTMLElement>(\"[data-stage]\")) el.hidden = !el.dataset.stage!.split(\" \").includes(stage);\n    // Can't record: the form's own upload field takes the recorder's place\n    panel.classList.toggle(\"apply--upload\", stage === \"unavailable\");\n  };\n\n  const showError = (text: string) => {\n    error.textContent = text;\n    error.hidden = !text;\n  };\n\n  const showElapsed = (elapsed: number) => {\n    ring.style.strokeDashoffset = String(113.1 * (1 - elapsed / maxSeconds));\n    left.textContent = String(maxSeconds - elapsed);\n  };\n\n  const stopCamera = () => {\n    stream?.getTracks().forEach((track) => track.stop());\n    stream = null;\n    liveVideo.srcObject = null;\n  };\n\n  const stopRecording = () => {\n    window.clearInterval(timer);\n    if (mediaRecorder?.state === \"recording\") mediaRecorder.stop();\n  };\n\n  const setVideo = (file: File | null) => {\n    const target = field();\n    if (!target) return;\n    target.value = file ? [{ file, fileName: file.name }] : [];\n    // The field's own change event, so the form validates it again and clears a \"required\" error. Not when emptying:\n    // that would report the error before the visitor even tried to send\n    if (file) target.dispatchEvent(new Event(\"change\", { bubbles: true }));\n  };\n\n  const clearVideo = () => {\n    if (videoUrl) URL.revokeObjectURL(videoUrl);\n    videoUrl = \"\";\n    playback.removeAttribute(\"src\");\n  };\n\n  async function startCamera() {\n    showError(\"\");\n    if (!canRecord()) return setStage(\"unavailable\");\n    try {\n      stream = await navigator.mediaDevices.getUserMedia({ video: { facingMode: \"user\", width: { ideal: 1280 } }, audio: true });\n      liveVideo.srcObject = stream;\n      setStage(\"live\");\n    } catch {\n      setStage(\"unavailable\");\n    }\n  }\n\n  function startRecording() {\n    if (!stream) return;\n    const chunks: Blob[] = [];\n    const type = recordingType();\n    const current = mediaRecorder = new MediaRecorder(stream, type ? { mimeType: type } : undefined);\n    current.ondataavailable = (e) => { if (e.data.size) chunks.push(e.data); };\n    current.onstop = () => {\n      // The form wants the bare type; the recorder's own includes the codecs\n      const mimeType = (current.mimeType || type || \"video/webm\").split(\";\")[0];\n      const file = new File(chunks, `video.${mimeType.includes(\"mp4\") ? \"mp4\" : \"webm\"}`, { type: mimeType });\n      clearVideo();\n      videoUrl = URL.createObjectURL(file);\n      playback.src = videoUrl;\n      setStage(\"recorded\");\n      stopCamera();\n      if (file.size > maxBytes) return showError(tooBig());\n      setVideo(file);\n    };\n    current.start();\n    let elapsed = 0;\n    showElapsed(elapsed);\n    setStage(\"recording\");\n    // One minute at most: the recording stops by itself\n    timer = window.setInterval(() => {\n      showElapsed(++elapsed);\n      if (elapsed >= maxSeconds) stopRecording();\n    }, 1000);\n  }\n\n  rec.querySelector(\".rec__start\")!.addEventListener(\"click\", () => void startCamera());\n  rec.querySelector(\".rec__retry\")!.addEventListener(\"click\", () => void startCamera());\n  rec.querySelector(\".rec__record:not(.rec__record--stop)\")!.addEventListener(\"click\", startRecording);\n  rec.querySelector(\".rec__record--stop\")!.addEventListener(\"click\", stopRecording);\n  rec.querySelector(\".rec__again\")!.addEventListener(\"click\", () => {\n    clearVideo();\n    setVideo(null);\n    void startCamera();\n  });\n\n  return {\n    reset() {\n      stopRecording();\n      stopCamera();\n      clearVideo();\n      setVideo(null);\n      showError(\"\");\n      // The browser can't record at all: show the upload field straight away\n      setStage(canRecord() ? \"idle\" : \"unavailable\");\n    },\n    stop() {\n      stopRecording();\n      stopCamera();\n    },\n  };\n}\n\n/** Gives an application form the site's button, the vacancy it is for and the size check on an uploaded video */\nfunction prepareForm(form: HTMLFormElement, panel: HTMLElement, vacancy: string, onSent: () => void): void {\n  const submit = form.querySelector(\".wh-form__button--submit\");\n  if (submit && !submit.classList.contains(\"btn\")) {\n    submit.classList.add(\"btn\", \"apply__submit\");\n    submit.querySelector(\".wh-form__buttonlabel\")?.classList.add(\"btn__label\");\n    submit.insertAdjacentHTML(\"beforeend\", `<span class=\"btn__icon\"><svg class=\"arrow\" width=\"18\" height=\"18\" viewBox=\"0 0 25 25\" fill=\"none\" aria-hidden=\"true\"><path d=\"M6.58 12.44H17.57M13.17 16.84L17.57 12.44L13.17 8.04\" /></svg></span>`);\n  }\n  // tech42v2 put the note beside the send button, which sits in the platform's button group\n  const note = panel.querySelector(\".apply__note\");\n  if (note) form.querySelector(\".wh-form__buttongroup\")?.append(note);\n  const input = form.querySelector<HTMLInputElement>('input[type=\"hidden\"][name=\"vacancy\"]');\n  if (input) input.value = vacancy;\n\n  // An uploaded file (no camera) gets the same size check as a recording\n  const error = panel.querySelector<HTMLElement>(\".apply__error\")!;\n  form.addEventListener(\"change\", (e) => {\n    const field = e.target as FileField;\n    if (!field.matches?.(\"[name=video]\")) return;\n    const file = field.value[0]?.file;\n    const big = Boolean(file && file.size > maxBytes);\n    error.textContent = big ? tooBig() : \"\";\n    error.hidden = !big;\n    if (big) field.value = [];\n  });\n\n  form.addEventListener(\"wh:form-submitted\", () => {\n    panel.classList.add(\"apply--sent\");\n    onSent();\n  });\n}\n\nconst vacancyOf = (url: string) => new URL(url, window.location.href).searchParams.get(\"vacature\") || \"open\";\nconst videoField = (panel: HTMLElement) => () => panel.querySelector<FileField>(\"form.wh-form [name=video]\");\n\n// The application page: the form is already there\ncomponent(\".apply--page\", (root) => {\n  const rec = recorder(root, videoField(root));\n  rec.reset();\n  const form = root.querySelector<HTMLFormElement>(\"form.wh-form\");\n  if (form) prepareForm(form, root, vacancyOf(window.location.href), rec.stop);\n  return rec.stop;\n});\n\ncomponent(\".apply[role=dialog]\", (root) => {\n  // Out of the smoothed content: that is moved with a transform (a fixed popup would move along) and made inert\n  // while the popup is open\n  document.body.append(root);\n  const slot = root.querySelector<HTMLElement>(\".apply__form\")!;\n  const side = root.querySelector<HTMLElement>(\".apply__side\")!;\n  const closeButton = root.querySelector<HTMLButtonElement>(\".apply__close\")!;\n  const rec = recorder(root, videoField(root));\n  let returnFocus: HTMLElement | null = null;\n  let form: HTMLFormElement | null = null;\n  let opening = false;\n\n  // The turning square must cover the side panel's diagonal, or its corners show as black\n  const sideObserver = new ResizeObserver(() => side.style.setProperty(\"--apply-diagonal\", `${Math.ceil(Math.hypot(side.offsetWidth, side.offsetHeight)) + 4}px`));\n\n  const setPageInert = (inert: boolean) => {\n    for (const el of document.querySelectorAll(\"#smooth-wrapper, .header\")) el.toggleAttribute(\"inert\", inert);\n    document.documentElement.style.overflow = inert ? \"hidden\" : \"\";\n  };\n\n  const onKeydown = (e: KeyboardEvent) => {\n    if (e.key === \"Escape\") close();\n    if (e.key !== \"Tab\") return;\n    const items = [...root.querySelectorAll<HTMLElement>(\"a[href], button, input:not([type=hidden]), video[controls], wh-fileedit\")].filter((el) => el.offsetParent !== null);\n    if (!items.length) return;\n    const first = items[0], last = items[items.length - 1];\n    if (e.shiftKey && document.activeElement === first) {\n      e.preventDefault();\n      last.focus();\n    } else if (!e.shiftKey && document.activeElement === last) {\n      e.preventDefault();\n      first.focus();\n    }\n  };\n\n  /** The form of the application page; a fresh one after a sent form */\n  async function loadForm(href: string): Promise<HTMLFormElement> {\n    const response = await fetch(href, { credentials: \"same-origin\" });\n    if (!response.ok) throw new Error(`Could not load the application form from \"${href}\" (${response.status})`);\n    const page = new DOMParser().parseFromString(await response.text(), \"text/html\");\n    const fetched = page.querySelector<HTMLFormElement>(\"form.wh-form\") ?? (() => { throw new Error(`No form on \"${href}\"`); })();\n    const node = document.importNode(fetched, true);\n    // The note sits in the old form's button group: keep it before that form goes\n    slot.after(root.querySelector(\".apply__note\")!);\n    slot.replaceChildren(node);\n    root.classList.remove(\"apply--sent\");\n    prepareForm(node, root, vacancyOf(href), () => {\n      rec.stop();\n      closeButton.focus({ preventScroll: true });\n    });\n    registerMissed(node);\n    return node;\n  }\n\n  async function open(link: HTMLAnchorElement): Promise<void> {\n    if (opening) return;\n    opening = true;\n    try {\n      if (!form || root.classList.contains(\"apply--sent\")) form = await loadForm(link.href);\n    } catch (error) {\n      console.error(error);\n      window.location.href = link.href;\n      return;\n    } finally {\n      opening = false;\n    }\n    const vacancy = form.querySelector<HTMLInputElement>('input[type=\"hidden\"][name=\"vacancy\"]');\n    if (vacancy) vacancy.value = vacancyOf(link.href);\n\n    // Every open starts over with the camera off, as in tech42v2\n    rec.reset();\n\n    returnFocus = link;\n    root.hidden = false;\n    sideObserver.observe(side);\n    setPageInert(true);\n    document.addEventListener(\"keydown\", onKeydown);\n    // The animation starts its parts hidden, which would take the focus away again: focus once they are visible\n    const focusFirst = () => [...root.querySelectorAll<HTMLElement>(\".rec__start, .wh-form__textinput\")].find((el) => el.offsetParent !== null)?.focus({ preventScroll: true });\n    if (prefersReducedMotion()) return void focusFirst();\n    // Backdrop fades in, the panel rises out of a blur, then its content lines up\n    gsap.timeline({ onComplete: focusFirst })\n      .from(root.querySelector(\".apply__backdrop\"), { autoAlpha: 0, duration: 0.5, ease: \"power2.out\" })\n      .from(root.querySelector(\".apply__panel\"), { y: 80, scale: 0.96, autoAlpha: 0, filter: \"blur(12px)\", duration: 0.9, ease: \"expo.out\", clearProps: \"filter\" }, \"-=0.3\")\n      .from(root.querySelectorAll(\".apply__side-content > *, .apply__title, .apply__questions, .rec, .wh-form__fieldgroup:not(.wh-form__fieldgroup--upload), .wh-form__buttongroup\"), { y: 24, autoAlpha: 0, duration: 0.7, stagger: 0.05 }, \"-=0.55\");\n  }\n\n  function close(): void {\n    if (root.hidden) return;\n    document.removeEventListener(\"keydown\", onKeydown);\n    sideObserver.disconnect();\n    rec.stop();\n    const finish = () => {\n      root.hidden = true;\n      gsap.set(root.querySelectorAll(\".apply__backdrop, .apply__panel\"), { clearProps: \"all\" });\n      setPageInert(false);\n      returnFocus?.focus({ preventScroll: true });\n    };\n    if (prefersReducedMotion()) return finish();\n    gsap.timeline({ onComplete: finish })\n      .to(root.querySelector(\".apply__panel\"), { y: 40, autoAlpha: 0, filter: \"blur(8px)\", duration: 0.45, ease: \"power2.in\" })\n      .to(root.querySelector(\".apply__backdrop\"), { autoAlpha: 0, duration: 0.35 }, \"-=0.2\");\n  }\n\n  // Every link to the application page (the apply card, the floating button on a vacancy)\n  const onClick = (e: MouseEvent) => {\n    const link = (e.target as Element | null)?.closest<HTMLAnchorElement>(\"a[href]\");\n    if (!link || e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || link.target === \"_blank\") return;\n    const url = new URL(link.href);\n    if (url.origin !== window.location.origin || !/\\/(solliciteren|apply)\\/$/.test(url.pathname)) return;\n    e.preventDefault();\n    void open(link);\n  };\n\n  // Capturing, so this runs before swup takes the link as a page visit (transitions.ts), also after a swap remounts it\n\n  document.addEventListener(\"click\", onClick, { capture: true });\n  closeButton.addEventListener(\"click\", close);\n  root.querySelector(\".apply__backdrop\")?.addEventListener(\"click\", close);\n  return () => {\n    document.removeEventListener(\"click\", onClick, { capture: true });\n    document.removeEventListener(\"keydown\", onKeydown);\n    sideObserver.disconnect();\n    rec.stop();\n    if (!root.hidden) setPageInert(false);\n    root.remove();\n  };\n});\n","import \"@webhare/dompack/reset.css\";\nimport \"@webhare/forms/styling/functional.css\";\nimport \"./frontend.scss\";\n\nimport { onDomReady } from \"@webhare/dompack\";\nimport { FileEditElement, setupForms } from \"@webhare/forms\";\nimport { mount } from \"./lib/components\";\nimport { startPerfStats } from \"./lib/perfstats\";\nimport { startApp } from \"./components/app\";\nimport { startTransitions } from \"./components/transitions\";\n// Each of these registers its behavior with component(); mount() starts them on the elements of this page\nimport \"./components/intro-curtain\";\nimport \"./components/site-header\";\nimport \"./components/language-selector\";\nimport \"./components/hero-section\";\nimport \"./components/hero-contact\";\nimport \"./components/client-strip\";\nimport \"./components/why-section\";\nimport \"./components/cycle-section\";\nimport \"./components/services-section\";\nimport \"./components/products-section\";\nimport \"./components/how-section\";\nimport \"./components/team-section\";\nimport \"./components/contact-section\";\nimport \"./components/service-page\";\nimport \"./components/budget-section\";\nimport \"./components/job-page\";\nimport \"./components/apply-cta\";\nimport \"./components/blog-page\";\nimport \"./components/article-page\";\nimport \"./components/info-page\";\nimport \"./components/policy-page\";\nimport \"./components/site-footer\";\nimport \"./components/contact-modal\";\nimport \"./components/apply-modal\";\n\n// The video field of the application form; without it the form falls back to a bare file input after a delay\ncustomElements.define(\"wh-fileedit\", FileEditElement);\n// Also picks up forms that the contact modal adds later with registerMissed.\nsetupForms();\n\nonDomReady(() => {\n  // Before mount(), so the intro and the first render are measured too\n  startPerfStats();\n  mount();\n  void startApp();\n  // After the popups and app.ts have set their click listeners: swup skips a click they already handled\n  startTransitions();\n});\n","/* frontend-config parses the wh-config object in the browser and mocks any missing data. @webhare/env does not actually expose this config, @webhare/frontend does\n   The frontend configuration is built in PageBuildRequest's 'frontendConfig' member */\n\nimport type { DTAPStage } from \"@webhare/env/src/concepts\";\nimport { debugFlags, initEnv } from \"@webhare/env/src/envbackend\";\nimport { getBrowserDebugFlags } from \"@webhare/env/src/init-browser\";\nimport { getLang } from \"@webhare/dompack/src/tree\";\nimport type { FrontendDataTypes } from \"@webhare/frontend\";\nimport { omit, throwError } from \"@webhare/std\";\n\n\n/** The format of the <script id=\"wh-config\"> object  */\nexport type WHConfigScriptData = {\n  //NOTE: existing frontend code doesn't expect site/obj to ever be null. not sure if 'object' provides the best interface or whether we need some sort of 'unknown but an existing object'\n  /** Page (targetobject) specific settings\n   *  @deprecated Use setFrontendData for type-safe settings\n  */\n  obj: { [key: string]: unknown };\n  /** Site specific settings\n   *  @deprecated Use setFrontendData for type-safe settings\n   */\n  site: { [key: string]: unknown };\n\n  /** Root URL of this site */\n  siteRoot: string;\n};\n\nexport type WHConfigScriptData_FromServer = WHConfigScriptData & { dtapStage: DTAPStage };\n\n//names fields can still have when not yet republished\ninterface WHConfigScriptData_OldPublishFields {\n  islive: boolean;\n  dtapstage: DTAPStage;\n  siteroot: string;\n}\n\n//fallback names with deprecation warnings\ninterface WHConfigScriptData_LegacyFields {\n  /** @deprecated Use dtapStage in WH5.4+ */\n  islive: boolean;\n  /** @deprecated Use `dtapStage` from \"\\@webhare/env\"; in WH5.4+ */\n  dtapstage: DTAPStage;\n  /** @deprecated Use `getSiteRoot` from \"\\@webhare/frontend\"; in WH5.7+ */\n  siteroot: string;\n}\n\nlet config: WHConfigScriptData_FromServer | undefined;\nlet siteroot: string | undefined;\nlet dtapStage: DTAPStage = \"production\";\n\n//if document is undefined, we're serverside or in a worker\nconst whconfigel = typeof document !== \"undefined\" ? document.querySelector('script#wh-config') : null;\nif (whconfigel?.textContent) {\n  const parsedConfig: WHConfigScriptData_FromServer & WHConfigScriptData_OldPublishFields = JSON.parse(whconfigel.textContent);\n  config = omit(parsedConfig, [\"siteroot\", \"dtapstage\", \"islive\"]);\n\n  //Fallbacks for pages last published with WH5.3 *and* pages published from HareScript which still emit lowercase props\n  siteroot = parsedConfig.siteRoot ?? parsedConfig.siteroot!;\n  dtapStage = parsedConfig.dtapStage ?? parsedConfig.dtapstage;\n}\n\ninitEnv(dtapStage, '/');\n\nif (typeof location !== \"undefined\")\n  for (const flag of getBrowserDebugFlags('wh-debug'))\n    debugFlags[flag] = true;\n\n\n/** @deprecated frontendConfig has been deprecated. Switch to the getFrontendData system */\n// Make sure we have obj/site as some sort of object, to prevent crashes on naive 'if ($wh.config.obj.x)' tests'\nexport const frontendConfig: WHConfigScriptData & {\n  /** @deprecated Use `getLang().tag` in WH6.0+ & WH5.9.7 */\n  locale?: string;\n} = {\n  ...config,\n  obj: config?.obj || {},\n  site: config?.site || {},\n  siteRoot: siteroot || \"\",\n  dtapstage: dtapStage,\n  islive: dtapStage === \"production\" || dtapStage === \"acceptance\",\n  siteroot: siteroot || \"\",\n  ...typeof document !== \"undefined\" ? { locale: getLang().tag } : {},\n} as WHConfigScriptData & WHConfigScriptData_LegacyFields;\n\n// this is what we actually store in the config object but is type-unsafe to access. Plugins still store data in the config object\nexport type WHConfigSerializedData = WHConfigScriptData & WHConfigScriptData_LegacyFields & { [key in keyof FrontendDataTypes]?: FrontendDataTypes[key] };\n\nif (dtapStage === \"development\") { //WH6.0: it's time to hard phase-out the old fields\n  Object.defineProperties(frontendConfig, {\n    islive: { get() { throw new Error(\"frontendConfig.islive will be removed - replace with testing 'dtapStage' for production | acceptance (WH5.4+)\"); } },\n    dtapstage: { get() { throw new Error(\"frontendConfig.dtapstage will be removed - replace with 'dtapStage' (WH5.4+)\"); } },\n    siteroot: { get() { throw new Error(\"frontendConfig.siteroot will be removed - replace with 'getSiteRoot()' (WH5.7+)\"); } },\n    //TODO but only WH6 addded this property AND getLang so there's no phasing out yet.\n    //locale: { get() { throw new Error(\"frontendConfig.locale will be removed - replace with getLang().tag in WH6.0+ & WH5.9.7\"); } },\n  });\n}\n\n//NOTE: These APIs need to live in init.ts so eg gtm.ts can access us without triggering a CSS reset through frontend.ts. When frontend.ts stops auto-resetting we might move it back\n\nexport function getFrontendData<Type extends keyof FrontendDataTypes>(type: Type, options: { allowMissing: true }): FrontendDataTypes[Type] | null;\nexport function getFrontendData<Type extends keyof FrontendDataTypes>(type: Type, options?: { allowMissing: boolean }): FrontendDataTypes[Type];\n\n/** Get data exported by the response\n * @typeParam Type - The type of data to get\n * @param dataObject - The data object of data to get\n * @param allowMissing - If true, return null if the data object is missing. Otherwise throw an error\n * @example\n```\n  declare module \"@webhare/frontend\" {\n    interface FrontendDataTypes {\n      \"mymodule:type\": {\n        test: number;\n      };\n    }\n  }\n\n  const data = getFrontendData(\"mymodule:type\");\n```\n*/\nexport function getFrontendData<Type extends keyof FrontendDataTypes>(dataObject: Type, { allowMissing = false } = {}): FrontendDataTypes[Type] | null {\n  const retval = (config as undefined | WHConfigSerializedData)?.[dataObject] as FrontendDataTypes[Type];\n  if (!retval)\n    if (allowMissing)\n      return null;\n    else\n      throw new Error(`Missing frontend data object: ${dataObject}`);\n\n  return retval;\n}\n\n/** Get the current site root\n *\n * @returns The site root URL (ending with a slash)\n*/\nexport function getSiteRoot(): string { //now an API to improve treeshaking\n  return siteroot ?? throwError(\"Site root is undefined. HTML code may be broken\");\n}\n","\n//Note that @webhare/env does not invoke this API itself. In WebHare @webhare/frontend/src/init uses this to initialize\nexport function getBrowserDebugFlags(varname: string): string[] {\n  const flags = [];\n  const urldebugvar = new URL(location.href).searchParams.get(varname);\n  if (urldebugvar)\n    flags.push(...urldebugvar.split(','));\n\n  //not importing getCookie to solve some import ordering issues\n  if (typeof document !== \"undefined\") { //'document' is undefined in a worker but assetpacks compiled for a ServiceWorker will also load us\n    const debugcookie = document.cookie.match(`(?:^|;)\\\\s*${varname}=([^;]*)`); //TODO escape varname\n    if (debugcookie) {\n      const debugcookievalue = decodeURIComponent(debugcookie[1]);\n      if (debugcookievalue)\n        flags.push(... (debugcookievalue.split('.').filter(flag => !flag.startsWith('sig='))));\n    }\n  }\n\n  if (typeof sessionStorage !== \"undefined\") {\n    const sessionDebug = sessionStorage.getItem(varname);\n    if (sessionDebug)\n      flags.push(...sessionDebug.split(','));\n  }\n\n  return flags;\n}\n","import \"@webhare/tsrun/src/polyfills\";\nimport \"./iterator-helpers\";\nimport \"./publisher-integration\";\n","/* eslint-disable @typescript-eslint/no-loop-func */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-this-alias */\n\n/* Iterator polyfills (https://caniuse.com/?search=iterator) - stage 4 ES but not in all browsers yet\n   Based on https://github.com/alkihis/iterator-polyfill/tree/master but we removed all the AsyncIterator\n   stuff as that's still stage 2 AND not implemented in TypeScript (as of 5.6)\n\n   We're ignoring a few linting/any issues as we really don't care to maintain this much\n   Fixed an issue with .some - reported as https://github.com/alkihis/iterator-polyfill/issues/6\n*/\n\n(function () {\n  // polyfill already applied / proposal implemented\n  if ('Iterator' in globalThis) {\n    return;\n  }\n\n  // Polyfill for Iterator\n  const IteratorPrototype = {};\n\n  const ArrayIteratorPrototype = Object.getPrototypeOf([][Symbol.iterator]());\n  const OriginalIteratorPrototype = Object.getPrototypeOf(ArrayIteratorPrototype);\n\n  Object.setPrototypeOf(OriginalIteratorPrototype, IteratorPrototype);\n\n  Object.defineProperties(IteratorPrototype, {\n    [Symbol.iterator]: {\n      value() {\n        return this;\n      }\n    },\n    map: {\n      *value<T, R>(callback: (value: T) => R): Generator<any, any, any> {\n        const it = this;\n        let value = it.next();\n\n        while (!value.done) {\n          const real_value = callback(value.value);\n          const next_value = yield real_value;\n          value = it.next(next_value);\n        }\n\n        return value.value;\n      },\n    },\n    filter: {\n      *value<T>(callback: (value: T) => boolean): Generator<any, any, any> {\n        const it = this;\n        let value = it.next();\n        let next_value;\n\n        while (!value.done) {\n          const real_value = value.value;\n          if (callback(real_value)) {\n            next_value = yield real_value;\n            value = it.next(next_value);\n          } else {\n            value = it.next(next_value);\n          }\n        }\n\n        return value.value;\n      },\n    },\n    find: {\n      value<T>(callback: (value: boolean) => T) {\n        const it = this;\n        let value = it.next();\n\n        while (!value.done) {\n          const real_value = value.value;\n\n          if (callback(real_value))\n            return real_value;\n\n          value = it.next();\n        }\n      }\n    },\n    every: {\n      value<T>(callback: (value: T) => boolean) {\n        const it = this;\n        let value = it.next();\n\n        while (!value.done) {\n          const real_value = value.value;\n\n          if (!callback(real_value))\n            return false;\n\n          value = it.next();\n        }\n\n        return true;\n      }\n    },\n    some: {\n      value<T>(callback: (value: T) => boolean) {\n        const it = this;\n        let value = it.next();\n\n        while (!value.done) {\n          const real_value = value.value;\n\n          if (callback(real_value)) {\n            it.return();\n            return true;\n          }\n\n          value = it.next();\n        }\n\n        return false;\n      }\n    },\n    toArray: {\n      value(max_count = Infinity) {\n        const values = [];\n\n        const it = this;\n        let value = it.next();\n\n        while (!value.done) {\n          const real_value = value.value;\n\n          if (max_count <= 0)\n            return values;\n\n          values.push(real_value);\n\n          if (max_count !== Infinity)\n            max_count--;\n\n          value = it.next();\n        }\n\n        return values;\n      }\n    },\n    take: {\n      *value(limit: number): Generator<any, any, any> {\n        limit = Number(limit);\n        if (limit < 0)\n          throw new RangeError('Invalid limit.');\n\n        const it = this;\n        let value = it.next();\n        let remaining = limit;\n        let next_value;\n\n        while (!value.done) {\n          const real_value = value.value;\n\n          if (remaining <= 0)\n            return;\n\n          next_value = yield real_value;\n          value = it.next(next_value);\n          remaining--;\n        }\n\n        return value.value;\n      },\n    },\n    drop: {\n      *value(limit: number): Generator<any, any, any> {\n        limit = Number(limit);\n        if (limit < 0)\n          throw new RangeError('Invalid limit.');\n\n        const it = this;\n        let value = it.next();\n        let remaining = limit;\n        let next_value;\n\n        while (!value.done) {\n          const real_value = value.value;\n\n          if (remaining > 0) {\n            value = it.next(next_value);\n            remaining--;\n            continue;\n          }\n\n          next_value = yield real_value;\n          value = it.next(next_value);\n        }\n\n        return value.value;\n      },\n    },\n    asIndexedPairs: {\n      *value(): Generator<any, any, any> {\n        const it = this;\n        let value = it.next();\n        let index = 0;\n\n        while (!value.done) {\n          const real_value = value.value;\n          const next_value = yield [index, real_value];\n          value = it.next(next_value);\n          index++;\n        }\n\n        return value.value;\n      }\n    },\n    flatMap: {\n      *value<T, R extends object>(mapper: (value: T) => IterableIterator<R> | R): Generator<any, any, any> {\n        if (typeof mapper !== 'function') {\n          throw new TypeError('Mapper must be a function.');\n        }\n\n        const it = this;\n        let value = it.next();\n        let next_value;\n\n        while (!value.done) {\n          const real_value = value.value;\n          const mapped = mapper(real_value);\n\n          if (Symbol.iterator in mapped) {\n            next_value = yield* mapped[Symbol.iterator]();\n          } else {\n            next_value = yield mapped;\n          }\n\n          value = it.next(next_value);\n        }\n\n        return value.value;\n      },\n    },\n    reduce: {\n      value<T, V>(reducer: (acc: V, value: T) => V, initial_value?: V) {\n        let acc = initial_value;\n\n        const it = this;\n        if (acc === undefined) {\n          acc = it.next().value;\n        }\n\n        let value = it.next();\n        while (!value.done) {\n          const real_value = value.value;\n\n          acc = reducer(acc!, real_value);\n\n          value = it.next();\n        }\n\n        return acc;\n      }\n    },\n    forEach: {\n      value<T>(callback: (value: T) => any) {\n        const it = this;\n        let value = it.next();\n\n        while (!value.done) {\n          const real_value = value.value;\n\n          callback(real_value);\n\n          value = it.next();\n        }\n      }\n    },\n    [Symbol.toStringTag]: {\n      value: 'IteratorPrototype'\n    },\n\n    /* OUTSIDE PROPOSAL */\n    count: {\n      value() {\n        let count = 0;\n\n        const it = this;\n        let value = it.next();\n\n        while (!value.done) {\n          count++;\n          value = it.next();\n        }\n\n        return count;\n      },\n    },\n    join: {\n      value(string: string) {\n        let final = '';\n        let first = true;\n\n        const it = this;\n        let value = it.next();\n\n        while (!value.done) {\n          const real_value = value.value;\n\n          if (first) {\n            first = false;\n            final += real_value;\n          } else {\n            final += string + real_value;\n          }\n\n          value = it.next();\n        }\n\n        return final;\n      }\n    },\n    chain: {\n      *value<I>(...iterables: IterableIterator<I>[]) {\n        yield* this;\n\n        for (const it of iterables) {\n          yield* it;\n        }\n      }\n    },\n    zip: {\n      *value<T, O>(...others: IterableIterator<O>[]): Iterator<(T | O)[]> {\n        const it_array = [this, ...others].map((e: any) => Symbol.iterator in e ? e[Symbol.iterator]() : e as Iterator<T | O>);\n        let values = it_array.map(e => e.next());\n        let next_value: any;\n\n        while (values.every(e => !e.done)) {\n          next_value = yield values.map(e => e.value);\n          values = it_array.map(e => e.next(next_value));\n        }\n      },\n    },\n    takeWhile: {\n      *value<T>(callback: (value: T) => boolean): Generator<any, any, any> {\n        const it = this;\n        let value = it.next();\n        let next_value;\n\n        while (!value.done) {\n          const real_value = value.value;\n\n          if (callback(real_value))\n            next_value = yield real_value;\n          else\n            return;\n\n          value = it.next(next_value);\n        }\n\n        return value.value;\n      }\n    },\n    dropWhile: {\n      *value<T>(callback: (value: T) => boolean): Generator<any, any, any> {\n        const it = this;\n        let value = it.next();\n        let next_value;\n        let finished = false;\n\n        while (!value.done) {\n          const real_value = value.value;\n\n          if (!finished && callback(real_value)) {\n            value = it.next(next_value);\n            continue;\n          }\n\n          finished = true;\n          next_value = yield real_value;\n\n          value = it.next(next_value);\n        }\n\n        return value.value;\n      }\n    },\n    fuse: {\n      *value(): Generator<any, any, any> {\n        const it = this;\n        let value = it.next();\n        let next_value;\n\n        while (!value.done) {\n          const real_value = value.value;\n\n          if (real_value !== undefined && real_value !== null)\n            next_value = yield real_value;\n          else\n            return;\n\n          value = it.next(next_value);\n        }\n\n        return value.value;\n      }\n    },\n    partition: {\n      value<T>(callback: (value: T) => boolean) {\n        const partition1 = [], partition2 = [];\n\n        const it = this;\n        let value = it.next();\n\n        while (!value.done) {\n          const real_value = value.value;\n\n          if (callback(real_value))\n            partition1.push(real_value);\n          else\n            partition2.push(real_value);\n\n          value = it.next();\n        }\n\n        return [partition1, partition2];\n      },\n    },\n    findIndex: {\n      value<T>(callback: (value: T) => boolean) {\n        const it = this;\n        let i = 0;\n        let value = it.next();\n\n        while (!value.done) {\n          const real_value = value.value;\n\n          if (callback(real_value))\n            return i;\n\n          value = it.next();\n          i++;\n        }\n\n        return -1;\n      }\n    },\n    max: {\n      value() {\n        let max = -Infinity;\n\n        const it = this;\n        let value = it.next();\n\n        while (!value.done) {\n          const real_value = value.value;\n\n          if (max < real_value)\n            max = real_value;\n\n          value = it.next();\n        }\n\n        return max;\n      },\n    },\n    min: {\n      value() {\n        let min = Infinity;\n\n        const it = this;\n        let value = it.next();\n\n        while (!value.done) {\n          const real_value = value.value;\n\n          if (min > real_value)\n            min = real_value;\n\n          value = it.next();\n        }\n\n        return min;\n      },\n    },\n    cycle: {\n      *value(): Generator<any, any, any> {\n        const values = [];\n\n        const it = this;\n        let value = it.next();\n\n        while (!value.done) {\n          const real_value = value.value;\n          values.push(real_value);\n\n          const next_value = yield real_value;\n          value = it.next(next_value);\n        }\n\n        while (true) {\n          yield* values;\n        }\n      },\n    },\n  });\n\n  //iterator.from from https://github.com/rauschma/iterator-helpers-polyfill/\n\n  function isObject(value: unknown) {\n    if (value === null) return false;\n    const t = typeof value;\n    return t === 'object' || t === 'function';\n  }\n\n  function GetIteratorFlattenable<T>(obj: Record<symbol, any>): T {\n    if (!isObject(obj)) {\n      throw new TypeError();\n    }\n    const method = obj[Symbol.iterator];\n    let iterator = undefined;\n    if (typeof method !== 'function') {\n      iterator = obj;\n    } else {\n      iterator = method.call(obj);\n    }\n    if (!isObject(iterator)) {\n      throw new TypeError();\n    }\n    return iterator;\n  }\n\n  if (!('Iterator' in globalThis)) {\n    const Iterator = function Iterator() { };\n\n    Iterator.prototype = IteratorPrototype;\n\n    // @ts-expect-error We're still missing From in this poyfill\n    (globalThis).Iterator = Iterator;\n  }\n\n\n  //----- Static method -----\n  // Must be done after Iterator.prototype was set up,\n  // so that `extends Iterator` works below\n\n  class WrappedIterator<T, TReturn = any, TNext = undefined> extends Iterator<T, TReturn, TNext> {\n    #iterator;\n    constructor(iterator: Iterator<T, TReturn, TNext>) {\n      super();\n      this.#iterator = iterator;\n    }\n    override next(...args: [] | [TNext]): any {\n      return this.#iterator.next(...args);\n    }\n    // `async` helps with line (*)\n    override return(value?: TReturn | PromiseLike<TReturn>): any {\n      const returnMethod = this.#iterator.return;\n      if (returnMethod === undefined) {\n        return { done: true, value: value as any }; // (*)\n      }\n      return returnMethod.call(this.#iterator);\n    }\n  }\n\n  function Iterator_from<T>(value: any) {\n    const iterator = GetIteratorFlattenable<Iterator<T>>(value);\n    if (iterator instanceof Iterator) {\n      return iterator;\n    }\n    // `iterator´ does not support the new API – wrap it so that it does\n    return new WrappedIterator(iterator);\n  }\n\n  Object.defineProperty(\n    Iterator, 'from',\n    {\n      writable: true,\n      enumerable: false,\n      configurable: true,\n      value: Iterator_from,\n    }\n  );\n})();\n","import { isHTMLElement } from \"@webhare/dompack\";\nimport type { CMSConfig } from \"@mod-system/js/internal/generation/gen_misc_ts\";\n\nlet config: CMSConfig | undefined;\n\nfunction forwardPublisherNavigation(event: Event) {\n  /* we watch for clicks.. as we only want to update the Publisher's selection for user triggered actions (otherwise we'd\n     start navigation in response to JS or internal link autoredirects) */\n  if (!isHTMLElement(event.target) || !config?.interfaceServers)\n    return;\n\n  const navaction = event.target.closest<HTMLAnchorElement>('a[href]');\n  if (!navaction)\n    return;\n\n  const desturl = navaction.href;\n  if (desturl.split('#')[0] !== location.href.split('#')[0]) { //it's actual navigation...\n    for (const origin of config.interfaceServers)\n      if (origin.startsWith(document.referrer || ''))\n        try {\n          window.top?.postMessage({ type: \"webhare-navigation\", location: desturl }, origin);\n        } catch (ignore) {\n          //ignore crossdomain errors\n        }\n  }\n}\n\nasync function configureForCMS() {\n  try {\n    const res = await fetch(\"/.wh/ea/config/cms.json\");\n    config = await res.json();\n  } catch (e) {\n    console.log(\"Failed to get CMS configuration\", e);\n    return;\n  }\n  window.addEventListener(\"click\", forwardPublisherNavigation);\n}\n\nif (typeof window !== \"undefined\" && window !== window.top) { //if we're in an iframe, we may be running in WebHare and need to forward navigation events\n  //we have no way to detect whether we're in a WebHare iframe or a 3rd party iframe. assume it's webhare and grab the interface servers\n  void configureForCMS();\n}\n","import \"@webhare/frontend/src/init\";import \"/opt/wh/whtree/modules/publisher/js/internal/polyfills/all\";\nimport \"/opt/whdata/installedmodules/tech42_website.20261118T195627.406Z/webdesigns/tech42v3/frontend/frontend\";const aps = globalThis.whAssetPacks ||= {}; aps[\"tech42_website:tech42v3\"]=\"2026-11-18T19:56:32.686Z\";"],"mappings":"6NA0GA,SAASA,IAAuB,CAC9B,MAAO,eAAe,CAAC,GAAG,OAAO,KAAKC,CAAU,CAAC,EAAE,OAAOC,GAAOD,EAAWC,CAAG,CAAC,EAAE,KAAK,IAAI,CAAC,GAC9F,CAEA,SAASC,IAAuB,CAC9B,QAA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C3C,GAAI,CACF,OAAO,KAAK,YAAY,CAAE,KAAM,qBAAsB,SAAUD,CAAQ,EAAGC,CAAM,CACnF,MAAiB,CAEjB,EAER,CAEA,eAAeC,IAAkB,CAC/B,GAAI,CAEFP,GAAS,MADG,MAAM,MAAM,yBAAyB,GAC9B,KAAK,CAC1B,OAASQ,EAAG,CACV,QAAQ,IAAI,kCAAmCA,CAAC,EAChD,MACF,CACA,OAAO,iBAAiB,QAASP,EAA0B,CAC7D,CAEI,OAAO,OAAW,KAAe,SAAW,OAAO,KAEhDM,GAAgB,ECvCvB,IAAAE,GAAO,SAA+GC,GAAM,WAAW,eAAiB,CAAC,EAAGA,GAAI,yBAAyB,EAAE","names":["formatForConsoleLogs","debugFlags","key","runSettingsCallbacks","cb","settingschangedcallbacks","initEnv","setDtapStage","setBackendBase","dtapStage","isLive","backendBase","dtapstage","islive","globalDebugFlags","localDebugFlags","debugFlagsOverridesCB","DebugFlagsProxyHandler","init_envbackend","__esmMin","target","p","record","keys","newValue","toModify","value","qS","node_or_selector","selector","qR","matches","qSA","isFormControl","field","isHTMLElement","isElement","node","parseLanguageTag","languageTag","match","getLang","tag","init_tree","__esmMin","getWHType","obj","isCrossRealm","value","isMoney","isTemporalInstant","isTemporalPlainDateTime","isTemporalPlainDate","isTemporalPlainTime","isTemporalZonedDateTime","isDate","isBlob","isFile","isPromise","e","stdTypeOf","t","init_quacks","__esmMin","parseMS","ms","parseDuration","duration","matches","addDuration","startingdate","isTemporalInstant","direction","date","modifydays","timeoffset","convertFlexibleInstantToDate","input","convertWaitPeriodToDate","wait","options","isDate","isValidDate","year","month","day","minYear","isleapyear","init_datetime","__esmMin","init_quacks","sleep","duration","options","until","convertWaitPeriodToDate","resolve","timeoutid","wrapInTimeout","promise","timeout","rejectWith","timeoutpromise","reject","timer","error","wrapSerialized","fn","Coalescer","queue","args","res","init_promises","__esmMin","init_datetime","init_quacks","startpos","currentpos","result","e","init_finmath","__esmMin","init_money","__esmMin","init_finmath","init_quacks","nameToCamelCase","name","c","nameToSnakeCase","init_types","__esmMin","init_money","init_quacks","isHTMLUnrepresentableChar","curch","encodeEntities","str","html","s","char","decodeEntities","_","dec","encodeString","encoding","decodeString","stringify","arg","options","usereplacer","key","value","origvalue","type","stdTypeOf","lhs","rhs","result","isValidEmail","email","init_strings","__esmMin","init_quacks","init_money","generateRandomId","encoding","bytes","u8array","x","init_platformbased","__esmMin","emplace","map","key","handler","current","setvalue","pick","value","keys","elt","ret","omit","val","init_collections","__esmMin","init_utils","__esmMin","init_quacks","unlock","LocalMutex","LocalLock","init_localmutex","__esmMin","defer","mutex","throwError","err","init_std","__esmMin","init_promises","init_types","init_strings","init_platformbased","init_collections","init_money","init_datetime","init_quacks","init_utils","init_localmutex","init_polyfills","__esmMin","resolve","reject","_resolve","_reject","items","callbackfn","retval","idx","item","key","list","submitForm","action","values","method","form","item","input","navigateTo","navigation","init_navigation","__esmMin","init_fetchdebug","__esmMin","init_envbackend","init_std","init_whglobal","__esmMin","init_envbackend","debugFlags","init_env","__esmMin","init_envbackend","init_navigation","init_fetchdebug","init_whglobal","dispatchDomEvent","element","eventtype","options","createtype","evt","dispatchCustomEvent","node","event","params","prop","CustomEvent","defaultaction","changeValue","newvalue","asString","stop","addDocEventListener","type","listener","init_events","__esmMin","getLockmgr","mylockmgr","getParentLockManager","LockManager","anyModalLocks","locallocks","l","scheduleCheckUIFree","uiwatcher","checkUIFree","modallocked","toggleBusyModal","lockmgr","isDialogElement","el","checkCancelEvent","evt","show","dispatchCustomEvent","installedanticancelhandler","busymodalcontent","currentbusymodaluserdialog","dialog","toembed","currentbusymodaldialog","flagUIBusy","options","BusyLock","debugFlags","locallockmgr","lock","init_busy","__esmMin","init_env","init_events","init_polyfills","pos","lockpos","generateInsertList","nodes","frag","node","append","isDomReady","onDomReady","callback","setStyles","value","key","propvalue","IS_NON_DIMENSIONAL","init_tree","__esmMin","flattenArray","list","acc","elt","setClassName","node","value","str","key","idx","toDashed","MATCH_UPCASE","attrHasBooleanValue","propname","createElement","elementname","attributes","toattrs","attrname","eventname","setStyles","append","child","create","children","el","jsxcreate","element","childNodes","parts","init_create","__esmMin","init_tree","isNodeCompletelyInDom","node","processRegistration","item","reg","domready","map","list","applyRegistration","startnode","isDomReady","items","e","focus","options","dispatchCustomEvent","register","selector","handler","newreg","components","onDomReady","registerMissed","init_components","__esmMin","init_tree","init_events","init_cookiebuilder","__esmMin","init_storage","__esmMin","init_cookiebuilder","init_std","init_preload","__esmMin","submitselector","init_browser","__esmMin","init_dompack","__esmMin","init_busy","init_events","init_tree","init_create","init_components","init_storage","init_preload","init_browser","init_reset","__esmMin","init_functional","__esmMin","init_frontend","__esmMin","getActiveElement","doc","getToplevelWindow","toplevelwindow","asIframe","node","getCurrentlyFocusedElement","limitdoc","focused","frame","canFocusTo","ignoreInertAttribute","getFocusableComponents","startnode","options","focusable","currentnode","currentstyle","iframe","subnodes","init_focus","__esmMin","mergeNode","node","set","data","parts","isNodeFunc","func","exprpath","callparts","funcrest","value","exprpathparts","i","updaters","prop","formatters","run","mergenode","filter","nodes","sets","init_merge","__esmMin","init_merge","__esmMin","init_dompack","__esmMin","init_std","init_events","init_tree","init_create","init_components","init_env","getISOLocalDate","date","init_datetime","__esmMin","parse","stackString","lines","stack","line","parseResult","parseChrome","parseWinjs","parseGecko","parseNode","parseJSC","parts","chromeRe","isNative","isEval","submatch","chromeEvalRe","UNKNOWN_FUNCTION","winjsRe","geckoRe","geckoEvalRe","javaScriptCoreRe","nodeRe","init_stack_trace_parser_esm","__esmMin","parseTrace","e","parse","i","formatTrace","trace","prependStackTrace","error","stacklines","tracelines","init_stacktracing","__esmMin","init_stack_trace_parser_esm","init_levenshtein","__esmMin","init_std","init_js_api_tools","__esmMin","init_stacktracing","init_levenshtein","getDebugAppend","urldebugvar","createClient","servicename","options","rpcclient","RPCClient","ServiceProxy","globalseqnr","ControlledCall","init_jsonrpc_client","__esmMin","init_env","init_js_api_tools","client","method","stack","id","callurl","fetchoptions","fetchpromise","requestStack","response","retryafter","resolve","exception","jsonresponse","logitem","err","prependStackTrace","url","debugFlags","error","backendBase","params","parseTrace","target","prop","receiver","newoptions","args","getFormService","hsformservice","createClient","getTSFormService","tsformservice","init_formservice","__esmMin","init_jsonrpc_client","verifyHareScriptAddress","address","options","lookupcache","lookupkey","stringify","emplace","getFormService","init_address","__esmMin","init_std","init_formservice","getGetTidHooks","gotHooks","hookFactory","init_hooks","__esmMin","internal_exports","__export","getHTMLTid","getHTMLTidForLanguage","getTIDListForLanguage","getTid","getTidForLanguage","getTidLanguage","registerTexts","setTidLanguage","ensureHooks","hooks","getGetTidHooks","lang","browserSetLanguage","defaultLanguage","newLanguage","getLanguageFile","moduleName","langCode","langkey","compiled","langFileCache","loader","addResourceChangeListener","loaded","e","dtapStage","debugFlags","texts","toHTMLNode","tag","props","node","wrapInFragment","children","fragment","getTidInternal","tid","params","options","decodeString","nodes","calcTIDForLanguage","p","p1","p2","p3","p4","encodeString","langcode","gid","getCanonicalTid","modsep","module","lookup","result","key","fallback","cannotFind","rawParams","rich","render","getLanguageDatetimeStrings","debugtid","match","fallbackMatch","executeCompiledTidText","renderString","tok","part","_","text","parts","get_param","sub","link","flattenRecursiveLanguageTexts","pathsofar","name","value","tids","compiledFile","init_internal","__esmMin","init_std","init_hooks","init_env","init_tree","getLang","init_gettid","__esmMin","init_internal","JSFormElement","init_jsformelement","__esmMin","newname","required","disable","name","oldValue","newValue","isInputElement","field","isHTMLElement","isFormFieldLike","control","isFormControl","JSFormElement","isRadioOrCheckbox","isRadioNodeList","el","getFieldName","setFieldName","newname","getFieldDisplayName","downgradeUploadFields","form","uploadfield","qSA","input","attr","getErrorForValidity","validity","getTid","max","reformatDate","min","key","isFieldNativeErrored","getFieldNativeError","parseCondition","conditiontext","getFormElementCandidates","basenode","namePrefix","parentForm","candidates","queryFormFieldLike","getFormHandler","node","allowMissing","throwError","init_domsupport","__esmMin","init_webharefields","init_gettid","init_dompack","init_jsformelement","init_std","setupServerErrorClear","field","group","setFieldError","getValidationState","state","validations","newstate","ComponentValidationState","error","options","isHTMLElement","debugFlags","getFieldDisplayName","updateFieldError","dispatchCustomEvent","getFieldNativeError","setupValidator","node","checker","init_customvalidation","__esmMin","init_dompack","init_env","init_domsupport","el","err","SubField","AddressField","init_addressfield","__esmMin","init_dompack","init_formbase","init_env","init_address","init_customvalidation","init_std","node","pos","throwError","qR","prefixLength","fieldpos","field","qSA","event","fieldname","data","firstfield","key","country","ordering","e","prevgroup","idx","item","fieldgroup","setFieldError","value","visiblefields","anyset","allrequiredset","form","FormBase","curstate","result","lock","flagUIBusy","el","verifyHareScriptAddress","debugFlags","err","anychanges","newvalue","changeValue","formatDate","dateformat","year","month","day","isValidDate","output","c","parseDate","format","newdate","options","parts","dayoffset","monthoffset","yearoffset","daypos","monthpos","yearpos","parseISODate","init_datehelpers","__esmMin","init_std","validateCheckboxGroup","groupnode","nodes","qSA","min","max","anyenabled","node","numChecked","getTid","validateRadioGroup","reformatDate","datestr","parsed","parseISODate","formatDate","validateDate","date","dateparts","year","month","day","isValidDate","normalizeddate","validateTime","time","timeparts","hours","minutes","seconds","setup","form","datecontrol","field","datematch","propname","thedate","getISOLocalDate","setupValidator","timecontrol","propvalue","checkboxgroup","radiogroup","addresscontrol","AddressField","init_webharefields","__esmMin","init_dompack","init_datetime","init_addressfield","init_customvalidation","init_gettid","init_datehelpers","init_std","init_requiredstyles","__esmMin","rfSymbol","init_registeredfield","__esmMin","init_arrayfield","__esmMin","fixupConditionRecursive","node","condition","mapping","anychanges","subcondition","newName","ArrayField","init_arrayfield","__esmMin","init_gettid","init_std","init_dompack","init_domsupport","init_fieldmap","init_webharefields","handler","items","name","throwError","qS","event","addDocEventListener","rownode","qSA","form","getFormHandler","newrow","addedrow","registerMissed","setup","stop","delNode","row","rowBaseName","rowFields","getFormElementCandidates","_","RecordFieldHandler","rows","n","rowval","valuePromises","rowPromises","field","values","rowValue","value","idx","rowField","firstnode","valueRows","newvalue","fieldnode","rowid","nodeArray","fieldname","getFieldName","cellname","subname","setFieldName","labelnodes","labelnode","type","conditionnode","parseCondition","minRows","maxRows","numRows","getTid","unmapFieldName","camelCaseName","nameToSnakeCase","mapFieldName","htmlName","nameToCamelCase","mapValue","type","invalue","unmapValue","fieldDescr","isDate","HTMLFormFieldHandler","RadioFormFieldHandler","CheckboxGroupHandler","RegisteredFieldHandler","ArrayFieldHandler","FormFieldMap","RecordFieldHandler","AddressFieldHandler","FieldMapDataProxy","init_fieldmap","__esmMin","init_domsupport","init_registeredfield","init_arrayfield","init_std","form","field","selectedrow","newvalue","setvalue","name","rnodes","group","node","_","myname","cboxes","throwError","toset","missing","cbox","items","rfSymbol","ArrayField","getFieldName","fieldName","nodes","subpos","groups","fullName","arraygroup","options","mapName","match","data","ignoreUnknownFields","key","value","baseName","retval","val","prettyName","omit","target","p","prop","lineFeedsToBreaks","text","frag","part","getPageIdx","state","page","idx","getErrorFields","validationresult","field","getFieldName","value","index","self","hasEverFailed","doValidation","iffailedbefore","validationpendingfor","releasePendingValidations","delayvalidation","debugFlags","form","doDelayValidation","tovalidate","handleFocusOutEvent","event","lastfocusout","handleFocusInEvent","handleValidateAfterEvent","didGlobalHandlers","FormBase","init_formbase","__esmMin","init_dompack","init_focus","init_webharefields","init_merge","init_requiredstyles","init_customvalidation","init_std","init_env","init_domsupport","init_registeredfield","init_fieldmap","init_browser","FormFieldMap","generateRandomId","#lastFocused","FieldMapDataProxy","node","getFormElementCandidates","setup","addDocEventListener","evt","#recordLastFocus","pagestate","name","#onUnload","now","eventdata","dispatchCustomEvent","control","qSA","element","target","ourcondition","parseCondition","searchparams","allvalues","shouldbechecked","tocheck","_","type","getError","fieldgroup","field_with_message","error","potentialgroupnode","contextnode","messageid","messagenode","suggestionholder","create","describedby","describedby_fields","failedfield","getValidationState","stop","extradata","submitter","submitselector","tempbutton","beforeResult","isPromise","el","queryFormFieldLike","startingpoint","lock","flagUIBusy","result","containingpage","pagenum","actionnode","pages","curpage","pagelist","currentpage","scrollto","origscrollto","__isSubmit","pageidx","goingforward","run","direction","pagenode","action","navigateTo","validationstatus","isinit","hiddenPages","mergeNodes","anychanges","formpage","visible","hiddengroups","enabledgroups","requiredgroups","formgroup","groupPage","enabled","required","formline","inputtargets","node_enabled","isFormFieldLike","node_required","isFormControl","option","option_enabled","option_hidden","selectnode","wrapSerialized","nodes","formvalue","mergeNode","conditiontext","fieldname","options","matchfield","isRadioNodeList","currentvalue","conditionfield","fields","attrname","selectedvalue","val","selected","qS","extrafields","condition","subcondition","birthdate","age","matchcase","compareagainst","currentValArray","nextpage","morepages","curpagerole","nextpagerole","rawNavigateTo","exitButton","parsedNavTo","redirectdelay","submitButton","submitButtonLabel","richvalues","registerMissed","dtapStage","getFieldDisplayName","rfSymbol","deferred","file","fieldnode","saveInteractive","changeValue","foundfields","skiparraymembers","addto","isRadioOrCheckbox","outdata","fieldpromises","receivedvalue","resolve","reject","e","opts","vals","checker","setupValidator","setFieldError","isFieldNativeErrored","updateFieldError","validator","limitset","defer","item","original","group","subnode","tovalidatelist","validationresults","fld","failed","tofocus","canFocusTo","getFocusableComponents","focus","mayValidateField","field","acceptEmailSuggestion","evt","form","suggestion","stop","validateField","setFieldError","checkvalue","isValidEmail","getTid","key","cache","rpcCall","getFormService","getTidLanguage","wrapInTimeout","result","e","debugFlags","jsxcreate","init_emailvalidation","__esmMin","init_dompack","init_gettid","init_formservice","init_std","init_customvalidation","init_env","init_debug","__esmMin","init_env","debugFlags","flagname","parseUserAgent","ua","UA","platform","getPlatform","browser","init_browser","__esmMin","IS_MAC_PLATFORM","init_keyboard","__esmMin","init_events","init_debug","init_browser","getPlatform","createDialog","options","dialogconstructor","dialog","runMessageBox","question","choices","choicebuttons","choice","create","dialogoptions","init_dialog","__esmMin","init_dompack","init_focus","init_keyboard","isRealBlob","data","convertToRealBlob","getFilelistFromUser","multiple","accept","defer","dispatchCustomEvent","input","list","requestFile","options","files","MultiFileUploader","SingleFileUploader","init_upload","__esmMin","init_dompack","#files","signal","item","file","instructions","outfiles","uploadedBytes","uploadedFiles","totalBytes","acc","totalFiles","start","fireProgressEvent","partialbytes","curUploaded","timeElapsed","idx","offset","uploadurl","xmlhttp","ev","doAbort","registerTexts","init_captcha_lang","__esmMin","initializeCaptcha","provider","injectInto","settings","captcharegistry","finalsettings","getTid","init_api","__esmMin","init_gettid","init_captcha_lang","setupCaptchaFieldGroup","form","provider","captchaControl","create","virtualCaptchaPage","getTid","buttonarea","qS","CaptchaField","init_captchafield","__esmMin","init_dompack","init_api","init_customvalidation","init_captcha_lang","init_forms","init_gettid","JSFormElement","evt","setFieldError","initializeCaptcha","result","stop","scheduleFormSetup","form","factory","_stack","lock","__using","flagUIBusy","customEls","qSA","_","initPromise","nextWarning","firstWarningMs","timeoutPromise","sleep","missing","tag","downgradeUploadFields","warningIntervalMs","_error","_hasError","__callDispose","configureForms","setup","formConfiguration","dispatchCustomEvent","registerHandlers","addHandlers","handlers","defaultHandler","RPCFormBase","handlername","handler","emplace","current","configuredRegistrations","register","getFormConfiguration","init_registration","__esmMin","init_rpc","init_dompack","init_std","init_domsupport","unpackObject","formvalue","_","buildTarget","target","buildRPCFormSubmission","formValue","options","vals","FormSubmitter","eventdetail","submitRPCForm","submission","createClient","RPCFormBase","init_rpc","__esmMin","init_dompack","init_focus","init_merge","init_formbase","init_formservice","init_emailvalidation","init_dialog","init_env","init_std","init_customvalidation","init_upload","init_jsonrpc_client","init_captchafield","init_registration","cache","offline","file","completed","uploader","SingleFileUploader","uploadinstructions","getTSFormService","uploadedfile","isBlob","result","key","value","FormBase","#hadFocus","#completedUploads","#settingUpCaptcha","formnode","#onFirstFocus","isLive","#getSubmitVals","background","methodname","args","waiter","lock","flagUIBusy","rpc","getFormService","field","prop","keyValue","matchpage","dataval","fieldnode","registerMissed","promise","messages","msg","extradata","extraSubmitAwaitable","extraSubmit","dispatchCustomEvent","config","getFormConfiguration","captchaConfig","setupCaptchaFieldGroup","parameters","insubmitrpc","submitparameters","debugFlags","didfirstfocus","globalerrors","error","failednode","serverMetadata","focus","setFieldError","run","failedfields","pick","e","errors","create","runMessageBox","navigateTo","getCurrentlyFocusedElement","validation","validateField","registerTexts","init_form_lang","__esmMin","isAcceptableType","fileType","masks","basetype","FileEditElement","init_fileeditbase","__esmMin","init_dompack","init_upload","init_gettid","init_customvalidation","init_domsupport","init_jsformelement","init_form_lang","JSFormElement","csslink","#setValue","evt","error","setFieldError","getTid","value","toset","row","getFieldDisplayName","mimetype","accept","mask","files","_stack","lock","__using","flagUIBusy","file","requestFile","_","_error","_hasError","__callDispose","msg","dispatchCustomEvent","idx","stop","button","init_upload","__esmMin","FileUploadFormElement","init_upload","__esmMin","init_dompack","init_gettid","init_fileeditbase","init_std","FileEditElement","#constructFileHolder","fileholder","nodes","idx","file","filename","isFile","filenamefield","jsxcreate","deletebutton","getTid","uploadbutton","init_imgedit","__esmMin","init_dompack","init_fileeditbase","init_std","init_gettid","init_upload","init_customvalidation","init_datepicker","__esmMin","init_dompack","init_keyboard","init_datehelpers","init_tree","init_datetime_valueprops","__esmMin","init_datetime","__esmMin","init_dompack","init_datehelpers","init_keyboard","init_datepicker","init_datetime_valueprops","init_gettid","recaptchaload","init_google_recaptcha","__esmMin","init_dompack","init_api","init_friendly_captcha","__esmMin","init_dompack","init_api","setupForms","options","registerHandlers","configureForms","omit","init_forms","__esmMin","init_rpc","init_formbase","init_address","init_upload","init_imgedit","init_jsformelement","init_domsupport","init_registration","init_form_lang","init_std","init_datetime","init_google_recaptcha","init_friendly_captcha","init_customvalidation","component","selector","init","registry","mount","scope","el","origin","cleanup","entry","live","unmount","cleanups","fn","init_components","__esmMin","_assertThisInitialized","self","_inheritsLoose","subClass","superClass","_config","_defaults","_suppressOverwrites","_reverting","_context","_bigNum","_tinyNum","_2PI","_HALF_PI","_gsID","_sqrt","_cos","_sin","_isString","_isFunction","_isNumber","_isUndefined","_isObject","_isNotFalse","_windowExists","_isFuncOrString","_isTypedArray","_isArray","_strictNumExp","_numExp","_numWithUnitExp","_complexStringNumExp","_relExp","_delimitedValueExp","_unitExp","_globalTimeline","_win","_coreInitted","_doc","_globals","_installScope","_coreReady","_install","_missingPlugin","_warn","_addGlobal","_emptyFunc","_startAtRevertConfig","_revertConfigNoKill","_revertConfig","_reservedProps","_lazyTweens","_lazyLookup","_lastRenderedFrame","_plugins","_effects","_nextGCFrame","_harnessPlugins","_callbackNames","_harness","_getCache","_getProperty","_forEachName","_round","_roundPrecise","_parseRelative","_arrayContainsAny","_lazyRender","_isRevertWorthy","_lazySafeRender","_numericIfPossible","_passThrough","_setDefaults","_setKeyframeDefaults","_merge","_mergeDeep","_copyExcluding","_inheritDefaults","_arraysMatch","_addLinkedListItem","_removeLinkedListItem","_removeFromParent","_uncache","_recacheAncestors","_rewindStartAt","_hasNoPausedAncestors","_elapsedCycleDuration","_animationCycle","_parentToChildTotalTime","_setEnd","_alignPlayhead","_postAddChecks","_addToTimeline","_scrollTrigger","_attemptInitTween","_parentPlayheadIsBeforeStart","_isFromOrFromStart","_renderZeroDurationTween","_findNextPauseTween","_setDuration","_onUpdateTotalDuration","_zeroPosition","_parsePosition","_createTweenType","_conditionalReturn","_clamp","getUnit","clamp","_slice","_isArrayLike","_flatten","toArray","selector","shuffle","distribute","_roundModifier","snap","random","pipe","unitize","normalize","_wrapArray","wrap","wrapYoyo","_replaceRandom","mapRange","interpolate","_getLabelInDirection","_callback","_interrupt","_quickTween","_registerPluginQueue","_createPlugin","_255","_colorLookup","_hue","splitColor","_colorOrderData","_formatColors","_colorExp","_hslExp","_colorStringFilter","_tickerActive","_ticker","_wake","_easeMap","_customEaseExp","_quotesExp","_parseObjectInString","_valueInParentheses","_configEaseFromString","_invertEase","_propagateYoyoEase","_parseEase","_insertEase","_easeInOutFromOut","_configElastic","_configBack","GSCache","Animation","Timeline","_addComplexStringPropTween","_addPropTween","_processVars","_checkPlugin","_overwritingTween","_forceAllPropTweens","_initTween","_updatePropTweens","_addAliasesToVars","_parseKeyframe","_parseFuncOrString","_staggerTweenProps","_staggerPropsToSkip","Tween","_setterPlain","_setterFunc","_setterFuncWithParam","_setterAttribute","_getSetter","_renderPlain","_renderBoolean","_renderComplexString","_renderPropTweens","_addPluginModifier","_killPropTweensOf","_setterWithModifier","_sortPropTweensByPriority","PropTween","_media","_listeners","_emptyArray","_lastMediaTime","_contextID","_dispatch","_onMediaChange","Context","MatchMedia","_gsap","_getPluginPropTween","_addModifiers","_buildModifierPlugin","gsap","Power0","Power1","Power2","Power3","Power4","Linear","Quad","Cubic","Quart","Quint","Strong","Elastic","Back","SteppedEase","Bounce","Sine","Expo","Circ","init_gsap_core","__esmMin","value","scope","property","message","suppress","name","obj","targets","target","harnessPlugin","v","names","func","start","operator","end","toSearch","toFind","l","a","i","tween","animation","time","suppressEvents","force","n","p","defaults","excludeDuration","base","toMerge","excluding","copy","vars","parent","a1","a2","match","child","firstProp","lastProp","sortBy","prev","t","next","onlyIfParentHasAutoRemove","totalTime","tTime","cycleDuration","whole","parentTime","timeline","position","skipChecks","trigger","_ref","_ref2","data","prevRatio","ratio","repeatDelay","pt","iteration","prevIteration","prevTime","duration","skipUncache","leavePlayhead","repeat","dur","totalProgress","percentAnimation","labels","recent","clippedDuration","offset","isPercent","type","params","isLegacy","varsIndex","irVars","min","max","nonEmpty","ar","leaveStrings","accumulator","_accumulator","el","ease","from","cache","isDecimal","ratios","axis","ratioX","ratioY","distances","originX","originY","x","y","d","j","wrapAt","raw","snapTo","isArray","radius","is2D","closest","dx","dy","roundingIncrement","returnFunction","_len","functions","_key","f","unit","wrapper","index","range","total","s","nums","inMin","inMax","outMin","outMax","inRange","outRange","progress","mutate","isString","master","interpolators","il","fromTime","backward","distance","label","executeLazyFirst","callback","prevContext","context","result","config","isFunc","Plugin","instanceDefaults","statics","h","m1","m2","toHSL","forceAlpha","r","g","b","wasHSL","values","c","orderMatchData","colors","shell","color","combined","_getTime","_lagThreshold","_adjustedLag","_startTime","_lastUpdate","_gap","_nextTime","_id","_req","_raf","_self","_delta","_i","_tick","elapsed","manual","overlap","dispatch","frame","fps","threshold","adjustedLag","_fps","once","prioritize","split","key","val","parsedVal","open","close","nested","isYoyo","defaultEase","easeIn","easeOut","easeInOut","lowercaseName","amplitude","period","p1","p2","p3","overshoot","power","n1","n2","n3","steps","immediateStart","harness","_proto","_totalTime","includeRepeats","wrapRepeats","prevIsReverting","rawTime","includeDelay","atTime","onFulfilled","resolve","_resolve","_then","_Animation","_this","_proto2","fromVars","toVars","stagger","onCompleteAll","onCompleteAllParams","tDur","crossingStart","prevPaused","pauseTween","timeScale","prevStart","yoyo","rewinding","doesWrap","adjustedTime","_this2","tweens","timelines","ignoreBeforeTime","id","animations","_totalTime2","props","onlyActive","parsedTargets","isGlobalTime","children","tl","endTime","_vars","startAt","_onStart","onStartParams","immediateRender","initted","fromPosition","toPosition","afterTime","beforeTime","amount","adjustLabels","soft","includeLabels","prop","setter","stringFilter","funcParam","matchIndex","startNums","endNum","chunk","startNum","hasRandom","modifier","optional","currentValue","parsedStart","plugin","ptLookup","lazy","onUpdate","runBackwards","yoyoEase","keyframes","autoRevert","prevStartAt","fullTargets","autoOverwrite","cleanVars","hasPriority","gsData","harnessVars","overwritten","startIsRelative","skipRecursion","ptCache","rootPT","lookup","propertyAliases","aliases","allProps","easeEach","_Animation2","skipInherit","_this3","_this3$vars","delay","overwrite","scrollTrigger","curTarget","staggerFunc","staggerVarsToMerge","kf","_proto3","isNegative","killingTargets","propTweenLookup","firstPT","overwrittenProps","curLookup","curOverwriteProps","hasNonDependentRemaining","pt2","first","last","change","renderer","priority","_proto4","matches","queries","conditions","anyMatch","toggled","_proto5","prevSelector","e","revert","matchMedia","_this4","o","_proto6","cond","mq","active","_len2","args","_key2","uncache","getter","format","setters","_setDefaults2","_ref3","effect","plugins","extendTimeline","pluginName","includeDelayedCalls","found","toAdd","modifiers","temp","_win","_doc","_docElement","_pluginInitted","_tempDiv","_tempDivStyler","_recentSetterPlugin","_reverting","_windowExists","_transformProps","_RAD2DEG","_DEG2RAD","_atan2","_bigNum","_capsExp","_horizontalExp","_complexExp","_propertyAliases","_renderCSSProp","_renderPropWithEnd","_renderCSSPropWithBeginning","_renderRoundedCSSProp","_renderNonTweeningValue","_renderNonTweeningValueOnlyAtEnd","_setterCSSStyle","_setterCSSProp","_setterTransform","_setterScale","_setterScaleWithRender","_setterTransformWithRender","_transformProp","_transformOriginProp","_saveStyle","_removeIndependentTransforms","_revertStyle","_getStyleSaver","_supports3D","_createElement","_getComputedProperty","_prefixes","_checkPropPrefix","_initCore","_getReparentedCloneBBox","_getAttributeFallbacks","_getBBox","_isSVG","_removeProperty","_addNonTweeningPT","_nonConvertibleUnits","_nonStandardLayouts","_convertToUnit","_get","_tweenComplexCSSString","_keywordToPercent","_convertKeywordsToPercentages","_renderClearProps","_specialProps","_identity2DMatrix","_rotationalProperties","_isNullTransform","_getComputedTransformMatrixAsArray","_getMatrix","_applySVGOrigin","_parseTransform","_firstTwoOnly","_addPxTranslate","_renderNon3DTransforms","_zeroDeg","_zeroPx","_endParenthesis","_renderCSSTransforms","_renderSVGTransforms","_addRotationalPropTween","_assign","_addRawTransformPTs","CSSPlugin","init_CSSPlugin","__esmMin","init_gsap_core","ratio","data","value","target","property","cache","isNotCSS","_this","style","p","props","i","properties","saver","gsap","type","ns","e","skipPrefixFallback","cs","element","preferPrefix","s","owner","svg","clone","bbox","attributesArray","bounds","cloned","first2Chars","plugin","beginning","end","onlySetAtEnd","pt","PropTween","unit","curValue","curUnit","horizontal","isRootSVG","measureProperty","amount","toPixels","toPercent","px","parent","isSVG","_round","_ticker","v","_getCache","uncache","_getProperty","prop","start","_renderComplexString","index","matchIndex","a","result","startValues","startNum","color","startValue","endValue","endNum","chunk","endUnit","startUnit","endValues","_colorStringFilter","_numWithUnitExp","_parseRelative","_config","_relExp","split","x","y","clearTransforms","tween","matrixString","_numExp","force2D","matrix","nextSibling","temp","addedToDOM","origin","originIsAbsolute","smooth","matrixArray","pluginToAddPropTweensTo","xOriginOld","yOriginOld","xOffsetOld","yOffsetOld","b","c","d","tx","ty","originSplit","xOrigin","yOrigin","determinant","GSCache","invertedScaleX","deg","z","scaleX","scaleY","rotation","rotationX","rotationY","skewX","skewY","perspective","angle","cos","sin","a12","a22","t1","t2","t3","a13","a23","a33","a42","a43","a32","getUnit","_ref","xPercent","yPercent","transformPerspective","force3D","zOrigin","transforms","use3D","_ref2","xOffset","yOffset","forceCSS","a11","a21","cap","isString","_isString","change","finalValue","direction","source","startCache","exclude","endCache","_forEachName","name","l","side","vars","targets","startAt","specialProp","relative","isTransformRelated","transformPropTween","hasPriority","inlineProps","_plugins","_checkPlugin","_replaceRandom","_colorExp","_missingPlugin","_sortPropTweensByPriority","_isUndefined","_getSetter","positionAndScale","others","aliases","all","gsapWithCSS","TweenMaxWithCSS","init_gsap","__esmMin","init_gsap_core","init_CSSPlugin","gsap","CSSPlugin","_defineProperties","target","props","i","descriptor","_createClass","Constructor","protoProps","staticProps","gsap","_coreInitted","_clamp","_win","_doc","_docEl","_body","_isTouch","_pointerType","ScrollTrigger","_root","_normalizer","_eventTypes","_context","_getGSAP","_startup","_observers","_scrollers","_proxies","_getTime","_bridge","_integrate","_getProxyProp","_isViewport","_addListener","_removeListener","_scrollLeft","_scrollTop","_onScroll","_scrollCacheFunc","_horizontal","_vertical","_getTarget","_isWithin","_getScrollFunc","_getVelocityProp","_getEvent","_getAbsoluteMax","_setScrollTrigger","_initCore","Observer","init_Observer","__esmMin","name","value","core","data","scrollers","proxies","element","property","el","type","func","passive","capture","f","doNotCache","cachingFunc","isNormalizing","t","self","list","_ref","s","sc","offset","prev","minTimeRefresh","useDelta","v1","v2","t1","t2","min","dropToZeroTime","update","force","reset","getVelocity","latestValue","tOld","vOld","preventDefault","a","max","vars","_proto","tolerance","dragMinimum","lineHeight","debounce","onStop","onStopDelay","ignore","wheelSpeed","event","onDragStart","onDragEnd","onDrag","onPress","onRelease","onRight","onLeft","onUp","onDown","onChangeX","onChangeY","onChange","onToggleX","onToggleY","onHover","onHoverEnd","onMove","ignoreCheck","isNormalizer","onGestureStart","onGestureEnd","onWheel","onEnable","onDisable","onClick","scrollSpeed","allowClicks","lockAxis","onLockAxis","id","onStopDelayedCall","dragged","moved","wheeled","locked","axis","prevDeltaX","prevDeltaY","scrollFuncX","scrollFuncY","scrollX","scrollY","limitToTouch","isViewport","ownerDoc","deltaX","deltaY","onClickTime","clickCapture","_ignoreCheck","e","isPointerOrTouch","onStopFunc","dx","dy","changedX","changedY","onDelta","x","y","index","onTouchOrPointerDelta","_onDrag","isDragging","_onPress","_onRelease","isTrackingDrag","wasDragging","isDragNotClick","eventData","syntheticEvent","_onGestureStart","_onGestureEnd","onScroll","_onWheel","multiplier","_onMove","_onHover","_onHoverEnd","_onClick","o","gsap","_coreInitted","_win","_doc","_docEl","_body","_root","_resizeDelay","_toArray","_clamp","_time2","_syncInterval","_refreshing","_pointerIsDown","_transformProp","_i","_prevWidth","_prevHeight","_autoRefresh","_sort","_suppressOverwrites","_ignoreResize","_normalizer","_ignoreMobileResize","_baseScreenHeight","_baseScreenWidth","_fixIOSBug","_context","_scrollRestoration","_div100vh","_100vh","_isReverted","_clampingMax","_limitCallbacks","_startup","_getTime","_time1","_lastScrollTime","_enabled","_parseClamp","_keepClamp","_rafBugFix","_pointerDownHandler","_pointerUpHandler","_passThrough","_round","_windowExists","_getGSAP","_isViewport","_getViewportDimension","_getBoundsFunc","_getSizeFunc","_getOffsetsFunc","_maxScroll","_iterateAutoRefresh","_isString","_isFunction","_isNumber","_isObject","_endAnimation","_callback","_abs","_left","_top","_right","_bottom","_width","_height","_Right","_Left","_Top","_Bottom","_padding","_margin","_Width","_Height","_px","_getComputedStyle","_makePositionable","_setDefaults","_getBounds","_getSize","_getLabelRatioArray","_getClosestLabel","_snapDirectional","_getLabelAtDirection","_multiListener","_addListener","_removeListener","_wheelListener","_markerDefaults","_defaults","_keywords","_offsetToPx","_createMarker","_positionMarker","_triggers","_ids","_rafID","_sync","_onScroll","_setBaseDimensions","_onResize","_listeners","_emptyArray","_softRefresh","_dispatch","_savedStyles","_revertRecorded","_revertAll","_clearScrollMemory","_refreshingAll","_refreshID","_queueRefreshID","_queueRefreshAll","_refresh100vh","_hideAllMarkers","_refreshAll","_lastScroll","_direction","_primary","_updateAll","_propNamesToCopy","_stateProps","_swapPinOut","_swapPinIn","_capsExp","_setState","_getState","_copyState","_winOffsets","_parsePosition","_prefixExp","_reparent","_interruptionTracker","_shiftMarker","_getTweenCreator","ScrollTrigger","_clampScrollAndGetDurationMultiplier","_allowNativePanning","_overflow","_nestedScroll","_inputObserver","_inputExp","_inputIsFocused","_captureInputs","_getScrollNormalizer","init_ScrollTrigger","__esmMin","init_Observer","value","type","self","clamp","v","dimensionProperty","element","_getProxyProp","scroller","isViewport","_ref","d","d2","a","_proxies","_ref2","s","func","events","i","animation","reversed","pause","result","position","obj","defaults","p","withoutTransforms","tween","bounds","_ref3","timeline","labels","duration","snapIncrementOrArray","snap","b","direction","threshold","snapped","st","types","callback","nonPassive","capture","el","scrollFunc","size","eqIndex","relative","name","container","_ref4","offset","matchWidthEl","containerAnimation","startColor","endColor","fontSize","indent","fontWeight","e","useFixedPosition","isScroller","parent","isStart","color","css","_vertical","marker","start","flipped","vars","side","oppositeSide","_scrollers","force","f","media","kill","trigger","scrollRestoration","id","hide","skipRevert","refreshInits","t","prop","original","max","endClamp","startClamp","l","time","recordVelocity","scroll","pin","spacer","state","cache","cs","spacerState","spacerStyle","pinStyle","_horizontal","style","override","omitOffsets","scrollerSize","markerScroller","scrollerBounds","borderWidth","scrollerMax","clampZeroProp","p1","p2","offsets","localOffset","globalOffset","display","_getTarget","top","left","getValueFunc","initialValue","onInterrupt","last1","last2","current","getScroll","_getScrollFunc","getTween","scrollTo","change1","change2","onComplete","modifiers","checkForInterruption","_proto","_vars","onUpdate","toggleClass","onToggle","onRefresh","scrub","pinSpacing","invalidateOnRefresh","anticipatePin","onScrubComplete","onSnapComplete","once","pinReparent","pinSpacer","fastScrollEnd","preventOverlaps","isToggle","scrollerCache","callbacks","toggleActions","markers","onRefreshInit","getScrollerSize","getScrollerOffsets","lastSnap","lastRefresh","prevProgress","tweenTo","pinCache","snapFunc","scroll1","scroll2","end","markerStart","markerEnd","markerStartTrigger","markerEndTrigger","markerVars","executingOnRefresh","change","pinOriginalState","pinActiveState","pinState","pinGetter","pinSetter","pinStart","pinChange","spacingStart","markerStartSetter","pinMoves","markerEndSetter","snap1","snap2","scrubTween","scrubSmooth","snapDurClamp","snapDelayedCall","prevScroll","prevAnimProgress","caMarkerSetter","customRevertReturn","o","refreshedRecently","progress","totalProgress","velocity","naturalEnd","endValue","endScroll","_snap","onStart","_onInterrupt","_onComplete","content","oldOnUpdate","oldParams","revert","temp","r","prevRefreshing","m","soft","pinOffset","isFirstRefresh","otherPinOffset","parsedEnd","parsedEndTrigger","parsedStart","pinnedContainer","triggerIndex","isVertical","curTrigger","curPin","oppositeScroll","initted","revertedPins","forcedOverflow","markerStartOffset","markerEndOffset","label","reset","forceFake","clipped","isActive","wasActive","toggleState","action","stateChanged","toggled","isAtMax","isTakingAction","_offset","n","refresh","newStart","newEnd","keepClamp","_change","amount","allowAnimation","updateFunc","core","config","Observer","mm","bodyHasStyle","bodyStyle","border","AnimationProto","w","h","ms","target","query","ratio","horizontal","referencePoint","allowListeners","listeners","targets","safe","varsCopy","interval","batchMax","proxyCallback","elements","triggers","delay","_ref5","event","axis","node","inputs","nested","isInput","_vars2","normalizeScrollX","momentum","allowNestedScroll","onRelease","maxY","smoother","smootherInstance","scrollFuncY","scrollFuncX","scale","initialScale","wheelRefresh","resolveMomentumDuration","lastRefreshID","skipTouchMove","inputObserver","resumeTouchMove","scrollClampX","scrollClampY","updateClamps","removeContentOffset","ignoreDrag","y","startScrollX","startScrollY","onStopDelayedCall","onResize","prevScale","wasDragging","dur","currentScroll","dx","dy","xArray","yArray","isTouch","yClamped","normalizer","_getVelocityProp","gsap","_fonts","_coreInitted","_initIfNecessary","_charSegmenter","_toArray","_elements","_emptyArray","_context","_spacesRegEx","_emojiSafeRegEx","_emptyBounds","_stretchToFitSpecialChars","_disallowInline","_insertNodeBefore","_getWrapper","_getLineWrapper","_splitWordsAndCharsRecursively","_SplitText","SplitText","init_SplitText","__esmMin","r","targets","collection","specialCharsRegEx","charsFound","i","slots","word","char","combined","element","newChild","parent","existingChild","type","config","className","tag","aria","propIndex","display","incrementClass","wrapper","text","el","nodes","lineWrapper","textAlign","startIndex","endIndex","newLine","wordWrapper","charWrapper","prepForCharsOnly","deepSlice","ignore","charSplitRegEx","isNested","_a","wordDelimiter","reduceWhiteSpace","prepareText","elementBounds","lastBounds","isPreformatted","ignoredPreviousSibling","wordsCollection","wordDelimIsNotSpace","wordDelimString","wordDelimSplitter","curNode","words","curWordEl","startsWithSpace","endsWithSpace","j","bounds","curWordChars","clonedNode","curSubNode","tempSubNode","curTextContent","wordText","lastWordText","k","s","elements","orig","timerId","checkWidths","o","w","smartWrap","onSplit","autoSplit","specialChars","mask","splitLines","splitCharacters","splitWords","onlySplitCharacters","finalCharSplitRegEx","animTime","obs","onSplitResult","index","chars","lines","curWord","smartWrapSpan","nextSibling","wrapLine","toRemove","lineStartIndex","allBounds","n","maskEl","_b","anim","html","ariaL","ariaH","core","prefersReducedMotion","isTouch","wordBlur","px","finishIntro","releaseIntro","motion","root","setup","ctx","alive","run","gsapWithCSS","queue","nextTask","error","motionSettled","tail","revealLines","target","options","split","SplitText","revealUp","targets","trigger","introDone","init_motion","__esmMin","init_gsap","init_ScrollTrigger","init_SplitText","init_dompack","onDomReady","ScrollTrigger","resolve","round1","value","summarizeFrames","deltas","total","sum","delta","longFrameMs","startPerfStats","debugFlags","panel","longTasks","longTaskMs","longTasksSupported","list","entry","last","lastPaint","sessionLongFrames","sessionWorstMs","skipFrame","frame","now","stats","heap","buildVersion","ScrollTrigger","init_perfstats","__esmMin","init_env","init_motion","arrivalHash","arrived","settled","arrivalTarget","hash","finishArrival","releaseArrival","init_arrival","__esmMin","resolve","classify","referrerHost","utm","medium","source","channel","pattern","channels","read","raw","storageKey","captureSource","params","utmKeys","key","existing","expired","cameFromSomewhere","basePath","leadSource","track","event","payload","lang","init_leads","__esmMin","init_site","clamp","min","input","max","lerp","x","y","damp","lambda","deltaTime","modulo","d","debounce","callback","delay","timer","args","getDeltaMultiplier","deltaMode","size","LINE_HEIGHT","Animate","Dimensions","Emitter","listenerOptions","VirtualScroll","defaultEasing","Lenis","completed","linearProgress","easedProgress","from","to","duration","easing","onStart","onUpdate","wrapper","content","autoResize","debounceValue","event","callbacks","i","length","cb","element","options","clientX","clientY","deltaX","deltaY","multiplierX","multiplierY","t","eventsTarget","smoothWheel","syncTouch","syncTouchLerp","touchInertiaExponent","infinite","orientation","gestureOrientation","touchMultiplier","wheelMultiplier","prevent","virtualScroll","overscroll","autoRaf","anchors","autoToggle","allowNestedScroll","__experimental__naiveDimensions","naiveDimensions","stopInertiaOnNavigate","respectReducedMotion","version","e","property","scroll","linkElementsUrls","node","currentUrl","anchorElementUrl","targetUrl","target","selection","touch","rects","first","last","HANDLE_RADIUS","nearStart","nearEnd","data","isTouch","isWheel","isClickOrTap","isUnknownGesture","composedPath","delta","isSyncTouch","hasTouchInertia","lastScroll","time","_target","offset","immediate","lock","programmatic","onComplete","force","userData","adjustedOffset","wrapperRect","rect","targetStyle","scrollMargin","containerStyle","scrollPadding","distance","value","cache","hasOverflowX","hasOverflowY","isScrollableX","isScrollableY","hasOverscrollBehaviorX","hasOverscrollBehaviorY","scrollWidth","scrollHeight","clientWidth","clientHeight","computedStyle","maxScroll","hasOverflow","isScrollable","hasOverscrollBehavior","className","init_lenis","__esmMin","startSmoothScroll","lenis","Lenis","ScrollTrigger","gsapWithCSS","time","scrollToTarget","target","smooth","init_scroll","__esmMin","init_lenis","init_motion","watchHeaderBackground","header","headerTriggers","st","active","section","ScrollTrigger","settleOn","target","offset","pass","next","scrollToTarget","align","release","type","startApp","captureSource","link","track","prefersReducedMotion","arrivalTarget","finishArrival","startSmoothScroll","motionSettled","arrival","resolve","init_app","__esmMin","init_arrival","init_leads","init_motion","init_scroll","editLedger","wanted","baseElement","callback","setup","ledger","elementMap","setups","existed","safeClosest","event","selector","target","closest","delegate","type","options","t","singleType","signal","base","once","nativeListenerOptions","capture","listenerFunction","delegateTarget","delegateEvent","delegate_default","init_delegate","__esmMin","init_one_event","__esmMin","init_delegate","init_delegate_it","__esmMin","init_delegate","init_one_event","async","fetchPage","url","options","_options$timeout","Location","fromUrl","visit","this","headers","_extends","requestHeaders","timeout","controller","AbortController","signal","response","timedOut","timeoutId","setTimeout","abort","hooks","call","fetch","clearTimeout","error","FetchError","name","aborted","status","responseUrl","html","text","finalUrl","page","cache","write","method","set","isPromise","obj","then","runAsPromise","func","args","Promise","resolve","reject","result","getContextualAttr","el","attr","target","closest","hasAttribute","getAttribute","createVisit","Visit","awaitAnimations","selector","elements","animatedElements","Array","from","queryAll","document","body","length","console","warn","awaitedAnimations","map","element","type","propCount","styles","window","getComputedStyle","transitionDelays","getStyleProperties","TRANSITION","transitionDurations","transitionTimeout","calculateTimeout","animationDelays","ANIMATION","animationDurations","animationTimeout","Math","max","endEvent","startTime","performance","now","propsTransitioned","end","removeEventListener","onEnd","event","elapsedTime","addEventListener","filter","p","all","key","split","delays","durations","concat","duration","i","toMs","time","parseFloat","navigate","init","Error","shouldIgnoreVisit","location","assign","to","hash","performNavigation","navigating","state","onVisitEnd","undefined","trigger","referrer","animate","animation","classes","clear","history","includes","action","_options$cache$read","_options$cache$write","meta","read","cachedPage","get","advance","DOMParser","parseFromString","newUrl","popstate","updateHistoryRecord","currentHistoryIndex","createHistoryRecord","index","add","classify","wait","ignored","done","renderPage","animatePageOut","native","startViewTransition","finished","animatePageIn","performNativeNavigation","getCurrentUrl","handlePopState","once","back","unuse","pluginOrName","plugin","findPlugin","unmount","_afterUnmount","plugins","find","resolveUrl","startsWith","isSameResolvedUrl","url1","url2","delegateEvent","Cache","query","nextTick","Classes","Hooks","getAnchorElement","replaceContent","scrollToContent","use","defaults","Swup","fallback","String","toLowerCase","replace","pathname","search","data","random","source","pushState","currentState","replaceState","callback","delegate","destroy","URL","constructor","base","baseURI","super","toString","Object","setPrototypeOf","prototype","href","message","details","swup","pages","Map","size","copy","forEach","has","callSync","update","payload","delete","prune","predicate","urlToResolve","context","querySelector","querySelectorAll","requestAnimationFrame","swupClasses","selectors","scope","containers","isArray","join","targets","trim","classList","remove","className","c","isSwupClass","some","id","scroll","animationScope","animationSelector","direction","reset","ignore","registry","nextHookId","hook","create","exists","ledger","on","handler","registration","off","before","arg1","arg2","arg3","defaultHandler","parseCallArgs","after","getHandlers","run","dispatchDomEvent","runSync","registrations","rethrow","results","push","found","replaced","values","sort","sortRegistrations","T","replacingHandler","createDefaultHandler","next","a","b","_a$priority","_b$priority","priority","detail","dispatchEvent","CustomEvent","bubbles","parseName","modifiers","reduce","acc","mod","charAt","substring","decoded","decodeURIComponent","getElementById","CSS","escape","skip","_incomingDocument$que","incomingDocument","title","innerText","persistedElements","currentEl","incomingEl","replaceWith","cloneNode","Boolean","existing","replacement","behavior","scrollTarget","scrolled","anchor","scrollIntoView","scrollTo","top","left","maybeInvalidPlugin","isSwupPlugin","_checkRequirements","_beforeMount","mount","animateHistoryBrowsing","ignoreVisit","linkSelector","linkToSelf","Accept","skipPopStateHandling","_event$state","currentPageUrl","_window$history$state","_window$history$state2","version","clickDelegate","log","handleLinkClick","bind","enable","_window$history$state3","scrollRestoration","entries","documentElement","toggle","origin","triggerWillOpenNewWindow","delegateTarget","fromElement","preventDefault","metaKey","ctrlKey","shiftKey","altKey","button","_visit$from$url","_event$state$url","_event$state2","_event$state$index","_event$state3","hasUAVisualTransition","triggerEl","matches","normalizeVersion","SwupPlugin","version","String","split","map","segment","parseInt","concat","slice","join","constructor","this","isSwupPlugin","swup","requires","handlersToUnregister","mount","unmount","forEach","unregister","_beforeMount","name","Error","_afterUnmount","_checkRequirements","Object","entries","dependency","versions","requirements","_swup$version","_plugin$version","plugin","findPlugin","versionSatisfies","installed","every","required","comparator","match","compareVersion","a","b","applyComparator","comparisonResult","comparators","r","localeCompare","numeric","Array","isArray","requirement","on","hook","handler","options","func","startsWith","hasOwnProperty","bind","hooks","push","once","_extends","before","replace","off","shouldManageTag","el","localName","matches","compareTags","oldTag","newTag","outerHTML","getAttributes","filters","all","Array","from","attributes","length","filter","name","some","pattern","RegExp","test","isStylesheet","SwupHeadPlugin","Plugin","constructor","options","_this","super","this","requires","swup","defaults","persistTags","persistAssets","awaitAssets","timeout","updateHead","async","visit","page","newDocument","to","document","removed","added","currentHead","newHead","shouldPersist","currentTags","children","newChildren","addTags","currentEls","reduce","tags","index","currentEl","push","removeTags","newEls","newEl","reverse","forEach","removeChild","newAddTags","map","tag","cloneNode","insertBefore","_extends","head","isPersistentTag","log","target","source","keep","Set","value","setAttribute","add","has","removeAttribute","documentElement","assetLoadPromises","elements","timeoutMs","element","timeoutId","whenLoaded","cb","sheet","setTimeout","Promise","resolve","clearTimeout","mount","before","Boolean","curtain","cover","layer","prefersReducedMotion","gsapWithCSS","finishIntro","uncover","syncHeader","incoming","next","link","i","source","startTransitions","swup","F","containers","url","el","event","visit","menu","selector","unmount","scrollToTarget","registerMissed","mount","watchHeaderBackground","ScrollTrigger","hash","target","settleOn","init_transitions","__esmMin","init_Swup_modern","init_index_modern","init_dompack","init_components","init_motion","init_scroll","init_app","chooseIntro","options","isLighthouseAgent","isLighthouseDesktopWindow","isLighthouse","init_intro","__esmMin","userAgent","win","require_intro_curtain","__commonJSMin","init_components","init_arrival","init_intro","init_motion","introKey","today","playedToday","remeasureAfterLoad","later","ScrollTrigger","component","root","logo","mode","chooseIntro","isLighthouse","prefersReducedMotion","end","finishIntro","gsapWithCSS","arrived","resolve","playLogo","lottie","logoAnimation","animation","getCallDocked","docked","setCallDocked","value","listeners","listener","onCallDocked","init_dock","__esmMin","require_site_header","__commonJSMin","init_components","init_dock","init_intro","init_motion","component","root","logoLink","trigger","call","menu","onScroll","showDocked","docked","getCallDocked","stopDock","onCallDocked","eggTween","eggDone","eggBusy","startEgg","e","prefersReducedMotion","gsapWithCSS","playEgg","stopEgg","walkRobot","walk","setPageInert","inert","menuOpen","setMenuOpen","open","onKeydown","closeMenu","focusables","trapTab","items","first","last","wrapTo","circle","b","x","y","radius","openMenu","logo","image","el","links","returnFocus","fades","onMenuClick","target","stopMotion","isLighthouse","motion","self","introDone","require_language_selector","__commonJSMin","init_components","component","root","trigger","menu","setOpen","open","onEnter","onLeave","onClick","onKeydown","e","backdrop","srcset","list","entry","url","width","needed","candidate","init_assets","__esmMin","compile","gl","type","source","shader","isCoarsePointer","liquidResolution","screen","area","budget","startLiquid","canvas","imageUrl","flow","resolution","vs","vertexSource","fs","fragmentSource","program","buffer","position","image","texture","u","name","uResolution","uImageSize","uTime","uPointer","uPointerStrength","resize","w","h","target","pointer","onMove","e","rect","visible","observer","entry","minFrameMs","lastDraw","frame","time","last","render","now","init_liquid","__esmMin","require_hero_section","__commonJSMin","init_components","init_assets","init_intro","init_liquid","init_motion","component","root","canvas","alive","stopLiquid","flow","prefersReducedMotion","isLighthouse","startLiquid","backdrop","stop","stopMotion","motion","self","words","underline","bg","fade","gsapWithCSS","introDone","require_hero_contact","__commonJSMin","init_components","init_dock","init_motion","dockHost","setDock","t","component","root","panel","button","options","compact","floating","cleanups","opened","tl","setOpened","value","option","setExpanded","buttonClip","fullWidth","p","b","right","left","build","items","gsapWithCSS","open","prefersReducedMotion","close","onHoverIn","isTouch","onHoverOut","onFocusOut","e","onOutsideTap","onButtonClick","onOptionClick","setCallDocked","introDone","flyer","onReducedScroll","docked","motion","self","pill","label","icon","ease","lerp","a","flightLength","hiddenByDock","background","border","iconBackground","iconColor","headerSlot","slot","containerOrigin","parent","update","progress","atStart","from","to","scrollsAlong","origin","morph","ScrollTrigger","st","fn","require_client_strip","__commonJSMin","init_components","init_motion","component","root","motion","self","revealUp","require_why_section","__commonJSMin","init_components","init_motion","component","root","motion","self","one","step","two","tag","label","tagline","wordsOne","SplitText","wordsTwo","taglineLines","gsapWithCSS","tl","wordBlur","line","length","require_cycle_section","__commonJSMin","init_components","init_motion","component","root","motion","self","title","gsapWithCSS","ripple","circle","i","labels","el","angle","spin","base","scrollPos","last","speed","follow","y","delta","target","ScrollTrigger","st","centreWords","SplitText","wordBlur","require_services_section","__commonJSMin","init_components","init_motion","bodyStyles","expand","el","gsapWithCSS","ScrollTrigger","collapse","component","root","rows","bodyOf","row","open","toggle","index","previous","i","isOpen","closing","opening","listeners","button","onClick","stopMotion","motion","self","revealLines","revealUp","fn","body","require_products_section","__commonJSMin","init_components","init_motion","component","root","motion","self","revealLines","revealUp","card","i","gsapWithCSS","require_how_section","__commonJSMin","init_components","init_motion","component","root","motion","self","revealLines","revealUp","blocks","gsapWithCSS","cursorHint","section","buttons","text","pick","label","gsapWithCSS","moveX","moveY","shown","show","visible","onMove","event","box","x","y","near","button","r","onLeave","init_cursorHint","__esmMin","init_motion","init_site","require_team_section","__commonJSMin","init_components","init_cursorHint","init_motion","component","root","motion","self","revealLines","revealUp","members","gsapWithCSS","i","member","isTouch","cursorHint","require_contact_section","__commonJSMin","init_components","init_motion","component","root","motion","self","card","bg","gsapWithCSS","split","SplitText","tl","person","require_service_page","__commonJSMin","init_components","init_intro","init_motion","canHover","loadWhenInView","frame","observers","urls","images","img","url","response","blob","observer","entries","entry","src","component","root","stopMotion","motion","self","titleLines","SplitText","hero","gsapWithCSS","isLighthouse","introDone","photo","steps","part","revealLines","words","wordBlur","revealUp","require_budget_section","__commonJSMin","init_components","init_motion","component","root","motion","self","revealLines","revealUp","list","gsapWithCSS","require_job_page","__commonJSMin","init_components","init_motion","component","root","float","pastHero","atCta","updateFloat","shown","motion","self","titleLines","SplitText","hero","gsapWithCSS","introDone","photo","words","wordBlur","part","revealLines","ScrollTrigger","st","require_apply_cta","__commonJSMin","init_components","init_motion","component","root","motion","self","card","gsapWithCSS","chars","SplitText","require_blog_page","__commonJSMin","init_components","init_motion","component","root","motion","self","lines","SplitText","hero","gsapWithCSS","introDone","require_article_page","__commonJSMin","init_components","init_motion","init_site","t","pick","copyIcon","checkIcon","component","root","button","status","icon","timer","setCopied","value","pageUrl","copyLink","onClick","stopMotion","motion","self","gsapWithCSS","lines","SplitText","hero","introDone","frame","require_info_page","__commonJSMin","init_components","init_motion","component","root","motion","self","lines","SplitText","hero","gsapWithCSS","introDone","photo","cards","el","require_policy_page","__commonJSMin","init_components","init_motion","component","root","motion","self","lines","SplitText","hero","gsapWithCSS","introDone","require_site_footer","__commonJSMin","init_components","init_motion","component","root","motion","self","revealUp","glyphs","gsapWithCSS","require_contact_modal","__commonJSMin","init_dompack","init_components","init_leads","init_motion","init_site","arrow","prepareForm","form","panel","submit","note","source","leadSource","values","basePath","name","value","input","foundVia","track","component","root","slot","closeButton","returnFocus","opening","setPageInert","inert","el","onKeydown","e","close","items","first","last","loadForm","href","response","fetched","node","registerMissed","open","link","error","focusFirst","prefersReducedMotion","gsapWithCSS","finish","onClick","onBackdrop","require_apply_modal","__commonJSMin","init_dompack","init_components","init_motion","maxSeconds","maxBytes","recordingType","type","canRecord","tooBig","recorder","panel","field","rec","liveVideo","playback","error","ring","left","stream","mediaRecorder","timer","videoUrl","setStage","stage","el","showError","text","showElapsed","elapsed","stopCamera","track","stopRecording","setVideo","file","target","clearVideo","startCamera","startRecording","chunks","current","e","mimeType","prepareForm","form","vacancy","onSent","submit","note","input","big","vacancyOf","url","videoField","component","root","slot","side","closeButton","returnFocus","opening","sideObserver","setPageInert","inert","onKeydown","close","items","first","last","loadForm","href","response","fetched","node","registerMissed","open","link","focusFirst","prefersReducedMotion","gsapWithCSS","finish","onClick","require_frontend","__commonJSMin","init_reset","init_functional","init_frontend","init_dompack","init_forms","init_components","init_perfstats","init_app","init_transitions","import_intro_curtain","import_site_header","import_language_selector","import_hero_section","import_hero_contact","import_client_strip","import_why_section","import_cycle_section","import_services_section","import_products_section","import_how_section","import_team_section","import_contact_section","import_service_page","import_budget_section","import_job_page","import_apply_cta","import_blog_page","import_article_page","import_info_page","import_policy_page","import_site_footer","import_contact_modal","import_apply_modal","FileUploadFormElement","setupForms","onDomReady","startPerfStats","mount","startApp","startTransitions","init_envbackend","getBrowserDebugFlags","varname","flags","urldebugvar","debugcookie","debugcookievalue","flag","sessionDebug","init_tree","init_std","config","siteroot","dtapStage","whconfigel","parsedConfig","omit","initEnv","flag","getBrowserDebugFlags","debugFlags","frontendConfig","getLang","init_polyfills","IteratorPrototype","ArrayIteratorPrototype","OriginalIteratorPrototype","callback","it","value","next_value","real_value","max_count","values","limit","remaining","index","mapper","mapped","reducer","initial_value","acc","count","string","final","first","iterables","others","it_array","e","finished","partition1","partition2","i","max","min","isObject","t","GetIteratorFlattenable","obj","method","iterator","Iterator","WrappedIterator","#iterator","args","returnMethod","Iterator_from","init_dompack","config","forwardPublisherNavigation","event","isHTMLElement","navaction","desturl","origin","configureForCMS","e","import_frontend","aps"]}