{
  "version": 3,
  "sources": ["../../record/dist/record.js", "../../types/dist/types.js", "../../utils/dist/utils.js", "../../../node_modules/websocket-ts/dist/esm/src/backoff/exponentialbackoff.js", "../../../node_modules/websocket-ts/dist/esm/src/queue/array_queue.js", "../../../node_modules/websocket-ts/dist/esm/src/websocket_event.js", "../../../node_modules/websocket-ts/dist/esm/src/websocket.js", "../../../node_modules/websocket-ts/dist/esm/src/websocket_builder.js", "../src/index.ts"],
  "sourcesContent": ["var __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\nvar _a;\nvar EventType = /* @__PURE__ */ ((EventType2) => {\n  EventType2[EventType2[\"DomContentLoaded\"] = 0] = \"DomContentLoaded\";\n  EventType2[EventType2[\"Load\"] = 1] = \"Load\";\n  EventType2[EventType2[\"FullSnapshot\"] = 2] = \"FullSnapshot\";\n  EventType2[EventType2[\"IncrementalSnapshot\"] = 3] = \"IncrementalSnapshot\";\n  EventType2[EventType2[\"Meta\"] = 4] = \"Meta\";\n  EventType2[EventType2[\"Custom\"] = 5] = \"Custom\";\n  EventType2[EventType2[\"Plugin\"] = 6] = \"Plugin\";\n  EventType2[EventType2[\"Asset\"] = 7] = \"Asset\";\n  return EventType2;\n})(EventType || {});\nvar IncrementalSource = /* @__PURE__ */ ((IncrementalSource2) => {\n  IncrementalSource2[IncrementalSource2[\"Mutation\"] = 0] = \"Mutation\";\n  IncrementalSource2[IncrementalSource2[\"MouseMove\"] = 1] = \"MouseMove\";\n  IncrementalSource2[IncrementalSource2[\"MouseInteraction\"] = 2] = \"MouseInteraction\";\n  IncrementalSource2[IncrementalSource2[\"Scroll\"] = 3] = \"Scroll\";\n  IncrementalSource2[IncrementalSource2[\"ViewportResize\"] = 4] = \"ViewportResize\";\n  IncrementalSource2[IncrementalSource2[\"Input\"] = 5] = \"Input\";\n  IncrementalSource2[IncrementalSource2[\"TouchMove\"] = 6] = \"TouchMove\";\n  IncrementalSource2[IncrementalSource2[\"MediaInteraction\"] = 7] = \"MediaInteraction\";\n  IncrementalSource2[IncrementalSource2[\"StyleSheetRule\"] = 8] = \"StyleSheetRule\";\n  IncrementalSource2[IncrementalSource2[\"CanvasMutation\"] = 9] = \"CanvasMutation\";\n  IncrementalSource2[IncrementalSource2[\"Font\"] = 10] = \"Font\";\n  IncrementalSource2[IncrementalSource2[\"Log\"] = 11] = \"Log\";\n  IncrementalSource2[IncrementalSource2[\"Drag\"] = 12] = \"Drag\";\n  IncrementalSource2[IncrementalSource2[\"StyleDeclaration\"] = 13] = \"StyleDeclaration\";\n  IncrementalSource2[IncrementalSource2[\"Selection\"] = 14] = \"Selection\";\n  IncrementalSource2[IncrementalSource2[\"AdoptedStyleSheet\"] = 15] = \"AdoptedStyleSheet\";\n  IncrementalSource2[IncrementalSource2[\"CustomElement\"] = 16] = \"CustomElement\";\n  return IncrementalSource2;\n})(IncrementalSource || {});\nvar MouseInteractions = /* @__PURE__ */ ((MouseInteractions2) => {\n  MouseInteractions2[MouseInteractions2[\"MouseUp\"] = 0] = \"MouseUp\";\n  MouseInteractions2[MouseInteractions2[\"MouseDown\"] = 1] = \"MouseDown\";\n  MouseInteractions2[MouseInteractions2[\"Click\"] = 2] = \"Click\";\n  MouseInteractions2[MouseInteractions2[\"ContextMenu\"] = 3] = \"ContextMenu\";\n  MouseInteractions2[MouseInteractions2[\"DblClick\"] = 4] = \"DblClick\";\n  MouseInteractions2[MouseInteractions2[\"Focus\"] = 5] = \"Focus\";\n  MouseInteractions2[MouseInteractions2[\"Blur\"] = 6] = \"Blur\";\n  MouseInteractions2[MouseInteractions2[\"TouchStart\"] = 7] = \"TouchStart\";\n  MouseInteractions2[MouseInteractions2[\"TouchMove_Departed\"] = 8] = \"TouchMove_Departed\";\n  MouseInteractions2[MouseInteractions2[\"TouchEnd\"] = 9] = \"TouchEnd\";\n  MouseInteractions2[MouseInteractions2[\"TouchCancel\"] = 10] = \"TouchCancel\";\n  return MouseInteractions2;\n})(MouseInteractions || {});\nvar PointerTypes = /* @__PURE__ */ ((PointerTypes2) => {\n  PointerTypes2[PointerTypes2[\"Mouse\"] = 0] = \"Mouse\";\n  PointerTypes2[PointerTypes2[\"Pen\"] = 1] = \"Pen\";\n  PointerTypes2[PointerTypes2[\"Touch\"] = 2] = \"Touch\";\n  return PointerTypes2;\n})(PointerTypes || {});\nvar CanvasContext = /* @__PURE__ */ ((CanvasContext2) => {\n  CanvasContext2[CanvasContext2[\"2D\"] = 0] = \"2D\";\n  CanvasContext2[CanvasContext2[\"WebGL\"] = 1] = \"WebGL\";\n  CanvasContext2[CanvasContext2[\"WebGL2\"] = 2] = \"WebGL2\";\n  return CanvasContext2;\n})(CanvasContext || {});\nvar MediaInteractions = /* @__PURE__ */ ((MediaInteractions2) => {\n  MediaInteractions2[MediaInteractions2[\"Play\"] = 0] = \"Play\";\n  MediaInteractions2[MediaInteractions2[\"Pause\"] = 1] = \"Pause\";\n  MediaInteractions2[MediaInteractions2[\"Seeked\"] = 2] = \"Seeked\";\n  MediaInteractions2[MediaInteractions2[\"VolumeChange\"] = 3] = \"VolumeChange\";\n  MediaInteractions2[MediaInteractions2[\"RateChange\"] = 4] = \"RateChange\";\n  return MediaInteractions2;\n})(MediaInteractions || {});\nvar NodeType = /* @__PURE__ */ ((NodeType2) => {\n  NodeType2[NodeType2[\"Document\"] = 0] = \"Document\";\n  NodeType2[NodeType2[\"DocumentType\"] = 1] = \"DocumentType\";\n  NodeType2[NodeType2[\"Element\"] = 2] = \"Element\";\n  NodeType2[NodeType2[\"Text\"] = 3] = \"Text\";\n  NodeType2[NodeType2[\"CDATA\"] = 4] = \"CDATA\";\n  NodeType2[NodeType2[\"Comment\"] = 5] = \"Comment\";\n  return NodeType2;\n})(NodeType || {});\nconst testableAccessors = {\n  Node: [\n    \"childNodes\",\n    \"parentNode\",\n    \"parentElement\",\n    \"textContent\",\n    \"ownerDocument\"\n  ],\n  ShadowRoot: [\"host\", \"styleSheets\"],\n  Element: [\"shadowRoot\", \"querySelector\", \"querySelectorAll\"],\n  MutationObserver: []\n};\nconst testableMethods = {\n  Node: [\"contains\", \"getRootNode\"],\n  ShadowRoot: [\"getSelection\"],\n  Element: [],\n  MutationObserver: [\"constructor\"]\n};\nconst untaintedBasePrototype = {};\nconst isAngularZonePresent = () => {\n  return !!globalThis.Zone;\n};\nfunction getUntaintedPrototype(key) {\n  if (untaintedBasePrototype[key])\n    return untaintedBasePrototype[key];\n  const defaultObj = globalThis[key];\n  const defaultPrototype = defaultObj.prototype;\n  const accessorNames = key in testableAccessors ? testableAccessors[key] : void 0;\n  const isUntaintedAccessors = Boolean(\n    accessorNames && // @ts-expect-error 2345\n    accessorNames.every(\n      (accessor) => {\n        var _a2, _b;\n        return Boolean(\n          (_b = (_a2 = Object.getOwnPropertyDescriptor(defaultPrototype, accessor)) == null ? void 0 : _a2.get) == null ? void 0 : _b.toString().includes(\"[native code]\")\n        );\n      }\n    )\n  );\n  const methodNames = key in testableMethods ? testableMethods[key] : void 0;\n  const isUntaintedMethods = Boolean(\n    methodNames && methodNames.every(\n      // @ts-expect-error 2345\n      (method) => {\n        var _a2;\n        return typeof defaultPrototype[method] === \"function\" && ((_a2 = defaultPrototype[method]) == null ? void 0 : _a2.toString().includes(\"[native code]\"));\n      }\n    )\n  );\n  if (isUntaintedAccessors && isUntaintedMethods && !isAngularZonePresent()) {\n    untaintedBasePrototype[key] = defaultObj.prototype;\n    return defaultObj.prototype;\n  }\n  try {\n    const iframeEl = document.createElement(\"iframe\");\n    document.body.appendChild(iframeEl);\n    const win = iframeEl.contentWindow;\n    if (!win) return defaultObj.prototype;\n    const untaintedObject = win[key].prototype;\n    document.body.removeChild(iframeEl);\n    if (!untaintedObject) return defaultPrototype;\n    return untaintedBasePrototype[key] = untaintedObject;\n  } catch {\n    return defaultPrototype;\n  }\n}\nconst untaintedAccessorCache = {};\nfunction getUntaintedAccessor(key, instance, accessor) {\n  var _a2;\n  const cacheKey = `${key}.${String(accessor)}`;\n  if (untaintedAccessorCache[cacheKey])\n    return untaintedAccessorCache[cacheKey].call(\n      instance\n    );\n  const untaintedPrototype = getUntaintedPrototype(key);\n  const untaintedAccessor = (_a2 = Object.getOwnPropertyDescriptor(\n    untaintedPrototype,\n    accessor\n  )) == null ? void 0 : _a2.get;\n  if (!untaintedAccessor) return instance[accessor];\n  untaintedAccessorCache[cacheKey] = untaintedAccessor;\n  return untaintedAccessor.call(instance);\n}\nconst untaintedMethodCache = {};\nfunction getUntaintedMethod(key, instance, method) {\n  const cacheKey = `${key}.${String(method)}`;\n  if (untaintedMethodCache[cacheKey])\n    return untaintedMethodCache[cacheKey].bind(\n      instance\n    );\n  const untaintedPrototype = getUntaintedPrototype(key);\n  const untaintedMethod = untaintedPrototype[method];\n  if (typeof untaintedMethod !== \"function\") return instance[method];\n  untaintedMethodCache[cacheKey] = untaintedMethod;\n  return untaintedMethod.bind(instance);\n}\nfunction ownerDocument(n) {\n  return getUntaintedAccessor(\"Node\", n, \"ownerDocument\");\n}\nfunction childNodes(n) {\n  return getUntaintedAccessor(\"Node\", n, \"childNodes\");\n}\nfunction parentNode(n) {\n  return getUntaintedAccessor(\"Node\", n, \"parentNode\");\n}\nfunction parentElement(n) {\n  return getUntaintedAccessor(\"Node\", n, \"parentElement\");\n}\nfunction textContent(n) {\n  return getUntaintedAccessor(\"Node\", n, \"textContent\");\n}\nfunction contains(n, other) {\n  return getUntaintedMethod(\"Node\", n, \"contains\")(other);\n}\nfunction getRootNode(n) {\n  return getUntaintedMethod(\"Node\", n, \"getRootNode\")();\n}\nfunction host(n) {\n  if (!n || !(\"host\" in n)) return null;\n  return getUntaintedAccessor(\"ShadowRoot\", n, \"host\");\n}\nfunction styleSheets(n) {\n  return n.styleSheets;\n}\nfunction shadowRoot(n) {\n  if (!n || !(\"shadowRoot\" in n)) return null;\n  return getUntaintedAccessor(\"Element\", n, \"shadowRoot\");\n}\nfunction querySelector(n, selectors) {\n  return getUntaintedAccessor(\"Element\", n, \"querySelector\")(selectors);\n}\nfunction querySelectorAll(n, selectors) {\n  return getUntaintedAccessor(\"Element\", n, \"querySelectorAll\")(selectors);\n}\nfunction mutationObserverCtor() {\n  return getUntaintedPrototype(\"MutationObserver\").constructor;\n}\nlet nowTimestamp = Date.now;\nif (!/* @__PURE__ */ /[1-9][0-9]{12}/.test(Date.now().toString())) {\n  nowTimestamp = () => (/* @__PURE__ */ new Date()).getTime();\n}\nfunction patch(source, name, replacement) {\n  try {\n    if (!(name in source)) {\n      return () => {\n      };\n    }\n    const original = source[name];\n    const wrapped = replacement(original);\n    if (typeof wrapped === \"function\") {\n      wrapped.prototype = wrapped.prototype || {};\n      Object.defineProperties(wrapped, {\n        __rrweb_original__: {\n          enumerable: false,\n          value: original\n        }\n      });\n    }\n    source[name] = wrapped;\n    return () => {\n      source[name] = original;\n    };\n  } catch {\n    return () => {\n    };\n  }\n}\nconst index = {\n  ownerDocument,\n  childNodes,\n  parentNode,\n  parentElement,\n  textContent,\n  contains,\n  getRootNode,\n  host,\n  styleSheets,\n  shadowRoot,\n  querySelector,\n  querySelectorAll,\n  mutationObserver: mutationObserverCtor,\n  nowTimestamp,\n  patch\n};\nfunction isElement(n) {\n  return n.nodeType === n.ELEMENT_NODE;\n}\nfunction isShadowRoot(n) {\n  const hostEl = (\n    // anchor and textarea elements also have a `host` property\n    // but only shadow roots have a `mode` property\n    n && \"host\" in n && \"mode\" in n && index.host(n) || null\n  );\n  return Boolean(\n    hostEl && \"shadowRoot\" in hostEl && index.shadowRoot(hostEl) === n\n  );\n}\nfunction isNativeShadowDom(shadowRoot2) {\n  return Object.prototype.toString.call(shadowRoot2) === \"[object ShadowRoot]\";\n}\nfunction fixBrowserCompatibilityIssuesInCSS(cssText) {\n  if (cssText.includes(\" background-clip: text;\") && !cssText.includes(\" -webkit-background-clip: text;\")) {\n    cssText = cssText.replace(\n      /\\sbackground-clip:\\s*text;/g,\n      \" -webkit-background-clip: text; background-clip: text;\"\n    );\n  }\n  return cssText;\n}\nfunction escapeImportStatement(rule) {\n  const { cssText } = rule;\n  if (cssText.split('\"').length < 3) return cssText;\n  const statement = [\"@import\", `url(${JSON.stringify(rule.href)})`];\n  if (rule.layerName === \"\") {\n    statement.push(`layer`);\n  } else if (rule.layerName) {\n    statement.push(`layer(${rule.layerName})`);\n  }\n  if (rule.supportsText) {\n    statement.push(`supports(${rule.supportsText})`);\n  }\n  if (rule.media.length) {\n    statement.push(rule.media.mediaText);\n  }\n  return statement.join(\" \") + \";\";\n}\nfunction stringifyStylesheet(s) {\n  try {\n    const rules = s.rules || s.cssRules;\n    if (!rules) {\n      return null;\n    }\n    let sheetHref = s.href;\n    if (!sheetHref && s.ownerNode) {\n      sheetHref = s.ownerNode.baseURI;\n    }\n    const stringifiedRules = Array.from(\n      rules,\n      (rule) => stringifyRule(rule, sheetHref)\n    ).join(\"\");\n    return fixBrowserCompatibilityIssuesInCSS(stringifiedRules);\n  } catch (error) {\n    return null;\n  }\n}\nfunction stringifyRule(rule, sheetHref) {\n  if (isCSSImportRule(rule)) {\n    let importStringified;\n    try {\n      importStringified = // for same-origin stylesheets,\n      // we can access the imported stylesheet rules directly\n      stringifyStylesheet(rule.styleSheet) || // work around browser issues with the raw string `@import url(...)` statement\n      escapeImportStatement(rule);\n    } catch (error) {\n      importStringified = rule.cssText;\n    }\n    if (rule.styleSheet.href) {\n      return absolutifyURLs(importStringified, rule.styleSheet.href);\n    }\n    return importStringified;\n  } else {\n    let ruleStringified = rule.cssText;\n    if (isCSSStyleRule(rule) && rule.selectorText.includes(\":\")) {\n      ruleStringified = fixSafariColons(ruleStringified);\n    }\n    if (sheetHref) {\n      return absolutifyURLs(ruleStringified, sheetHref);\n    }\n    return ruleStringified;\n  }\n}\nfunction fixSafariColons(cssStringified) {\n  const regex = /(\\[(?:[\\w-]+)[^\\\\])(:(?:[\\w-]+)\\])/gm;\n  return cssStringified.replace(regex, \"$1\\\\$2\");\n}\nfunction isCSSImportRule(rule) {\n  return \"styleSheet\" in rule;\n}\nfunction isCSSStyleRule(rule) {\n  return \"selectorText\" in rule;\n}\nclass Mirror {\n  constructor() {\n    __publicField(this, \"idNodeMap\", /* @__PURE__ */ new Map());\n    __publicField(this, \"nodeMetaMap\", /* @__PURE__ */ new WeakMap());\n  }\n  getId(n) {\n    var _a2;\n    if (!n) return -1;\n    const id = (_a2 = this.getMeta(n)) == null ? void 0 : _a2.id;\n    return id ?? -1;\n  }\n  getNode(id) {\n    return this.idNodeMap.get(id) || null;\n  }\n  getIds() {\n    return Array.from(this.idNodeMap.keys());\n  }\n  getMeta(n) {\n    return this.nodeMetaMap.get(n) || null;\n  }\n  // removes the node from idNodeMap\n  // doesn't remove the node from nodeMetaMap\n  removeNodeFromMap(n) {\n    const id = this.getId(n);\n    this.idNodeMap.delete(id);\n    if (n.childNodes) {\n      n.childNodes.forEach(\n        (childNode) => this.removeNodeFromMap(childNode)\n      );\n    }\n  }\n  has(id) {\n    return this.idNodeMap.has(id);\n  }\n  hasNode(node) {\n    return this.nodeMetaMap.has(node);\n  }\n  add(n, meta) {\n    const id = meta.id;\n    this.idNodeMap.set(id, n);\n    this.nodeMetaMap.set(n, meta);\n  }\n  replace(id, n) {\n    const oldNode = this.getNode(id);\n    if (oldNode) {\n      const meta = this.nodeMetaMap.get(oldNode);\n      if (meta) this.nodeMetaMap.set(n, meta);\n    }\n    this.idNodeMap.set(id, n);\n  }\n  reset() {\n    this.idNodeMap = /* @__PURE__ */ new Map();\n    this.nodeMetaMap = /* @__PURE__ */ new WeakMap();\n  }\n}\nfunction createMirror() {\n  return new Mirror();\n}\nfunction maskInputValue({\n  element,\n  maskInputOptions,\n  tagName,\n  type,\n  value,\n  maskInputFn\n}) {\n  let text = value || \"\";\n  const actualType = type && toLowerCase(type);\n  if (maskInputOptions[tagName.toLowerCase()] || actualType && maskInputOptions[actualType]) {\n    if (maskInputFn) {\n      text = maskInputFn(text, element);\n    } else {\n      text = \"*\".repeat(text.length);\n    }\n  }\n  return text;\n}\nfunction toLowerCase(str) {\n  return str.toLowerCase();\n}\nconst ORIGINAL_ATTRIBUTE_NAME = \"__rrweb_original__\";\nfunction is2DCanvasBlank(canvas) {\n  const ctx = canvas.getContext(\"2d\");\n  if (!ctx) return true;\n  const chunkSize = 50;\n  for (let x = 0; x < canvas.width; x += chunkSize) {\n    for (let y = 0; y < canvas.height; y += chunkSize) {\n      const getImageData = ctx.getImageData;\n      const originalGetImageData = ORIGINAL_ATTRIBUTE_NAME in getImageData ? getImageData[ORIGINAL_ATTRIBUTE_NAME] : getImageData;\n      const pixelBuffer = new Uint32Array(\n        // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access\n        originalGetImageData.call(\n          ctx,\n          x,\n          y,\n          Math.min(chunkSize, canvas.width - x),\n          Math.min(chunkSize, canvas.height - y)\n        ).data.buffer\n      );\n      if (pixelBuffer.some((pixel) => pixel !== 0)) return false;\n    }\n  }\n  return true;\n}\nfunction getInputType(element) {\n  const type = element.type;\n  return element.hasAttribute(\"data-rr-is-password\") ? \"password\" : type ? (\n    // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n    toLowerCase(type)\n  ) : null;\n}\nfunction extractFileExtension(path, baseURL) {\n  let url;\n  try {\n    url = new URL(path, baseURL ?? window.location.href);\n  } catch (err) {\n    return null;\n  }\n  const regex = /\\.([0-9a-z]+)(?:$)/i;\n  const match = url.pathname.match(regex);\n  return (match == null ? void 0 : match[1]) ?? null;\n}\nfunction extractOrigin(url) {\n  let origin = \"\";\n  if (url.indexOf(\"//\") > -1) {\n    origin = url.split(\"/\").slice(0, 3).join(\"/\");\n  } else {\n    origin = url.split(\"/\")[0];\n  }\n  origin = origin.split(\"?\")[0];\n  return origin;\n}\nconst URL_IN_CSS_REF = /url\\((?:(')([^']*)'|(\")(.*?)\"|([^)]*))\\)/gm;\nconst URL_PROTOCOL_MATCH = /^(?:[a-z+]+:)?\\/\\//i;\nconst URL_WWW_MATCH = /^www\\..*/i;\nconst DATA_URI = /^(data:)([^,]*),(.*)/i;\nfunction absolutifyURLs(cssText, href) {\n  return (cssText || \"\").replace(\n    URL_IN_CSS_REF,\n    (origin, quote1, path1, quote2, path2, path3) => {\n      const filePath = path1 || path2 || path3;\n      const maybeQuote = quote1 || quote2 || \"\";\n      if (!filePath) {\n        return origin;\n      }\n      if (URL_PROTOCOL_MATCH.test(filePath) || URL_WWW_MATCH.test(filePath)) {\n        return `url(${maybeQuote}${filePath}${maybeQuote})`;\n      }\n      if (DATA_URI.test(filePath)) {\n        return `url(${maybeQuote}${filePath}${maybeQuote})`;\n      }\n      if (filePath[0] === \"/\") {\n        return `url(${maybeQuote}${extractOrigin(href) + filePath}${maybeQuote})`;\n      }\n      const stack = href.split(\"/\");\n      const parts = filePath.split(\"/\");\n      stack.pop();\n      for (const part of parts) {\n        if (part === \".\") {\n          continue;\n        } else if (part === \"..\") {\n          stack.pop();\n        } else {\n          stack.push(part);\n        }\n      }\n      return `url(${maybeQuote}${stack.join(\"/\")}${maybeQuote})`;\n    }\n  );\n}\nfunction normalizeCssString(cssText, _testNoPxNorm = false) {\n  if (_testNoPxNorm) {\n    return cssText.replace(/(\\/\\*[^*]*\\*\\/)|[\\s;]/g, \"\");\n  } else {\n    return cssText.replace(/(\\/\\*[^*]*\\*\\/)|[\\s;]/g, \"\").replace(/0px/g, \"0\");\n  }\n}\nfunction splitCssText(cssText, style, _testNoPxNorm = false) {\n  const childNodes2 = Array.from(style.childNodes);\n  const splits = [];\n  let iterCount = 0;\n  if (childNodes2.length > 1 && cssText && typeof cssText === \"string\") {\n    let cssTextNorm = normalizeCssString(cssText, _testNoPxNorm);\n    const normFactor = cssTextNorm.length / cssText.length;\n    for (let i = 1; i < childNodes2.length; i++) {\n      if (childNodes2[i].textContent && typeof childNodes2[i].textContent === \"string\") {\n        const textContentNorm = normalizeCssString(\n          childNodes2[i].textContent,\n          _testNoPxNorm\n        );\n        const jLimit = 100;\n        let j = 3;\n        for (; j < textContentNorm.length; j++) {\n          if (\n            // keep consuming css identifiers (to get a decent chunk more quickly)\n            textContentNorm[j].match(/[a-zA-Z0-9]/) || // substring needs to be unique to this section\n            textContentNorm.indexOf(textContentNorm.substring(0, j), 1) !== -1\n          ) {\n            continue;\n          }\n          break;\n        }\n        for (; j < textContentNorm.length; j++) {\n          let startSubstring = textContentNorm.substring(0, j);\n          let cssNormSplits = cssTextNorm.split(startSubstring);\n          let splitNorm = -1;\n          if (cssNormSplits.length === 2) {\n            splitNorm = cssNormSplits[0].length;\n          } else if (cssNormSplits.length > 2 && cssNormSplits[0] === \"\" && childNodes2[i - 1].textContent !== \"\") {\n            splitNorm = cssTextNorm.indexOf(startSubstring, 1);\n          } else if (cssNormSplits.length === 1) {\n            startSubstring = startSubstring.substring(\n              0,\n              startSubstring.length - 1\n            );\n            cssNormSplits = cssTextNorm.split(startSubstring);\n            if (cssNormSplits.length <= 1) {\n              splits.push(cssText);\n              return splits;\n            }\n            j = jLimit + 1;\n          } else if (j === textContentNorm.length - 1) {\n            splitNorm = cssTextNorm.indexOf(startSubstring);\n          }\n          if (cssNormSplits.length >= 2 && j > jLimit) {\n            const prevTextContent = childNodes2[i - 1].textContent;\n            if (prevTextContent && typeof prevTextContent === \"string\") {\n              const prevMinLength = normalizeCssString(prevTextContent).length;\n              splitNorm = cssTextNorm.indexOf(startSubstring, prevMinLength);\n            }\n            if (splitNorm === -1) {\n              splitNorm = cssNormSplits[0].length;\n            }\n          }\n          if (splitNorm !== -1) {\n            let k = Math.floor(splitNorm / normFactor);\n            for (; k > 0 && k < cssText.length; ) {\n              iterCount += 1;\n              if (iterCount > 50 * childNodes2.length) {\n                splits.push(cssText);\n                return splits;\n              }\n              const normPart = normalizeCssString(\n                cssText.substring(0, k),\n                _testNoPxNorm\n              );\n              if (normPart.length === splitNorm) {\n                splits.push(cssText.substring(0, k));\n                cssText = cssText.substring(k);\n                cssTextNorm = cssTextNorm.substring(splitNorm);\n                break;\n              } else if (normPart.length < splitNorm) {\n                k += Math.max(\n                  1,\n                  Math.floor((splitNorm - normPart.length) / normFactor)\n                );\n              } else {\n                k -= Math.max(\n                  1,\n                  Math.floor((normPart.length - splitNorm) * normFactor)\n                );\n              }\n            }\n            break;\n          }\n        }\n      }\n    }\n  }\n  splits.push(cssText);\n  return splits;\n}\nfunction markCssSplits(cssText, style) {\n  return splitCssText(cssText, style).join(\"/* rr_split */\");\n}\nlet _id = 1;\nconst tagNameRegex = new RegExp(\"[^a-z0-9-_:]\");\nconst IGNORED_NODE = -2;\nfunction genId() {\n  return _id++;\n}\nfunction getValidTagName(element) {\n  if (element instanceof HTMLFormElement) {\n    return \"form\";\n  }\n  const processedTagName = toLowerCase(element.tagName);\n  if (tagNameRegex.test(processedTagName)) {\n    return \"div\";\n  }\n  return processedTagName;\n}\nlet canvasService;\nlet canvasCtx;\nconst SRCSET_NOT_SPACES = /^[^ \\t\\n\\r\\u000c]+/;\nconst SRCSET_COMMAS_OR_SPACES = /^[, \\t\\n\\r\\u000c]+/;\nfunction getAbsoluteSrcsetString(doc, attributeValue) {\n  if (attributeValue.trim() === \"\") {\n    return attributeValue;\n  }\n  let pos = 0;\n  function collectCharacters(regEx) {\n    let chars2;\n    const match = regEx.exec(attributeValue.substring(pos));\n    if (match) {\n      chars2 = match[0];\n      pos += chars2.length;\n      return chars2;\n    }\n    return \"\";\n  }\n  const output = [];\n  while (true) {\n    collectCharacters(SRCSET_COMMAS_OR_SPACES);\n    if (pos >= attributeValue.length) {\n      break;\n    }\n    let url = collectCharacters(SRCSET_NOT_SPACES);\n    if (url.slice(-1) === \",\") {\n      url = absoluteToDoc(doc, url.substring(0, url.length - 1));\n      output.push(url);\n    } else {\n      let descriptorsStr = \"\";\n      url = absoluteToDoc(doc, url);\n      let inParens = false;\n      while (true) {\n        const c = attributeValue.charAt(pos);\n        if (c === \"\") {\n          output.push((url + descriptorsStr).trim());\n          break;\n        } else if (!inParens) {\n          if (c === \",\") {\n            pos += 1;\n            output.push((url + descriptorsStr).trim());\n            break;\n          } else if (c === \"(\") {\n            inParens = true;\n          }\n        } else {\n          if (c === \")\") {\n            inParens = false;\n          }\n        }\n        descriptorsStr += c;\n        pos += 1;\n      }\n    }\n  }\n  return output.join(\", \");\n}\nconst cachedDocument = /* @__PURE__ */ new WeakMap();\nfunction absoluteToDoc(doc, attributeValue) {\n  if (!attributeValue || attributeValue.trim() === \"\") {\n    return attributeValue;\n  }\n  return getHref(doc, attributeValue);\n}\nfunction isSVGElement(el) {\n  return Boolean(el.tagName === \"svg\" || el.ownerSVGElement);\n}\nfunction getHref(doc, customHref) {\n  let a = cachedDocument.get(doc);\n  if (!a) {\n    a = doc.createElement(\"a\");\n    cachedDocument.set(doc, a);\n  }\n  if (!customHref) {\n    customHref = \"\";\n  } else if (customHref.startsWith(\"blob:\") || customHref.startsWith(\"data:\")) {\n    return customHref;\n  }\n  a.setAttribute(\"href\", customHref);\n  return a.href;\n}\nfunction transformAttribute(doc, tagName, name, value) {\n  if (!value) {\n    return value;\n  }\n  if (name === \"src\" || name === \"href\" && !(tagName === \"use\" && value[0] === \"#\")) {\n    return absoluteToDoc(doc, value);\n  } else if (name === \"xlink:href\" && value[0] !== \"#\") {\n    return absoluteToDoc(doc, value);\n  } else if (name === \"background\" && [\"table\", \"td\", \"th\"].includes(tagName)) {\n    return absoluteToDoc(doc, value);\n  } else if (name === \"srcset\") {\n    return getAbsoluteSrcsetString(doc, value);\n  } else if (name === \"style\") {\n    return absolutifyURLs(value, getHref(doc));\n  } else if (tagName === \"object\" && name === \"data\") {\n    return absoluteToDoc(doc, value);\n  }\n  return value;\n}\nfunction ignoreAttribute(tagName, name, _value) {\n  return [\"video\", \"audio\"].includes(tagName) && name === \"autoplay\";\n}\nfunction _isBlockedElement(element, blockClass, blockSelector) {\n  try {\n    if (typeof blockClass === \"string\") {\n      if (element.classList.contains(blockClass)) {\n        return true;\n      }\n    } else {\n      for (let eIndex = element.classList.length; eIndex--; ) {\n        const className = element.classList[eIndex];\n        if (blockClass.test(className)) {\n          return true;\n        }\n      }\n    }\n    if (blockSelector) {\n      return element.matches(blockSelector);\n    }\n  } catch (e) {\n  }\n  return false;\n}\nfunction classMatchesRegex(node, regex, checkAncestors) {\n  if (!node) return false;\n  if (node.nodeType !== node.ELEMENT_NODE) {\n    if (!checkAncestors) return false;\n    return classMatchesRegex(index.parentNode(node), regex, checkAncestors);\n  }\n  for (let eIndex = node.classList.length; eIndex--; ) {\n    const className = node.classList[eIndex];\n    if (regex.test(className)) {\n      return true;\n    }\n  }\n  if (!checkAncestors) return false;\n  return classMatchesRegex(index.parentNode(node), regex, checkAncestors);\n}\nfunction needMaskingText(node, maskTextClass, maskTextSelector, checkAncestors) {\n  let el;\n  if (isElement(node)) {\n    el = node;\n    if (!index.childNodes(el).length) {\n      return false;\n    }\n  } else if (index.parentElement(node) === null) {\n    return false;\n  } else {\n    el = index.parentElement(node);\n  }\n  try {\n    if (typeof maskTextClass === \"string\") {\n      if (checkAncestors) {\n        if (el.closest(`.${maskTextClass}`)) return true;\n      } else {\n        if (el.classList.contains(maskTextClass)) return true;\n      }\n    } else {\n      if (classMatchesRegex(el, maskTextClass, checkAncestors)) return true;\n    }\n    if (maskTextSelector) {\n      if (checkAncestors) {\n        if (el.closest(maskTextSelector)) return true;\n      } else {\n        if (el.matches(maskTextSelector)) return true;\n      }\n    }\n  } catch (e) {\n  }\n  return false;\n}\nfunction onceIframeLoaded(iframeEl, listener, iframeLoadTimeout) {\n  const win = iframeEl.contentWindow;\n  if (!win) {\n    return;\n  }\n  let fired = false;\n  let readyState;\n  try {\n    readyState = win.document.readyState;\n  } catch (error) {\n    return;\n  }\n  if (readyState !== \"complete\") {\n    const timer = setTimeout(() => {\n      if (!fired) {\n        listener();\n        fired = true;\n      }\n    }, iframeLoadTimeout);\n    iframeEl.addEventListener(\"load\", () => {\n      clearTimeout(timer);\n      fired = true;\n      listener();\n    });\n    return;\n  }\n  const blankUrl = \"about:blank\";\n  if (win.location.href !== blankUrl || iframeEl.src === blankUrl || iframeEl.src === \"\") {\n    setTimeout(listener, 0);\n    return iframeEl.addEventListener(\"load\", listener);\n  }\n  iframeEl.addEventListener(\"load\", listener);\n}\nfunction onceStylesheetLoaded(link, listener, styleSheetLoadTimeout) {\n  let fired = false;\n  let styleSheetLoaded;\n  try {\n    styleSheetLoaded = link.sheet;\n  } catch (error) {\n    return;\n  }\n  if (styleSheetLoaded) return;\n  const timer = setTimeout(() => {\n    if (!fired) {\n      listener();\n      fired = true;\n    }\n  }, styleSheetLoadTimeout);\n  link.addEventListener(\"load\", () => {\n    clearTimeout(timer);\n    fired = true;\n    listener();\n  });\n}\nfunction serializeNode(n, options) {\n  const {\n    doc,\n    mirror: mirror2,\n    blockClass,\n    blockSelector,\n    needsMask,\n    inlineStylesheet,\n    maskInputOptions = {},\n    maskTextFn,\n    maskInputFn,\n    dataURLOptions = {},\n    inlineImages,\n    recordCanvas,\n    keepIframeSrcFn,\n    newlyAddedElement = false,\n    cssCaptured = false\n  } = options;\n  const rootId = getRootId(doc, mirror2);\n  switch (n.nodeType) {\n    case n.DOCUMENT_NODE:\n      if (n.compatMode !== \"CSS1Compat\") {\n        return {\n          type: NodeType.Document,\n          childNodes: [],\n          compatMode: n.compatMode\n          // probably \"BackCompat\"\n        };\n      } else {\n        return {\n          type: NodeType.Document,\n          childNodes: []\n        };\n      }\n    case n.DOCUMENT_TYPE_NODE:\n      return {\n        type: NodeType.DocumentType,\n        name: n.name,\n        publicId: n.publicId,\n        systemId: n.systemId,\n        rootId\n      };\n    case n.ELEMENT_NODE:\n      return serializeElementNode(n, {\n        doc,\n        blockClass,\n        blockSelector,\n        inlineStylesheet,\n        maskInputOptions,\n        maskInputFn,\n        dataURLOptions,\n        inlineImages,\n        recordCanvas,\n        keepIframeSrcFn,\n        newlyAddedElement,\n        rootId\n      });\n    case n.TEXT_NODE:\n      return serializeTextNode(n, {\n        doc,\n        needsMask,\n        maskTextFn,\n        rootId,\n        cssCaptured\n      });\n    case n.CDATA_SECTION_NODE:\n      return {\n        type: NodeType.CDATA,\n        textContent: \"\",\n        rootId\n      };\n    case n.COMMENT_NODE:\n      return {\n        type: NodeType.Comment,\n        textContent: index.textContent(n) || \"\",\n        rootId\n      };\n    default:\n      return false;\n  }\n}\nfunction getRootId(doc, mirror2) {\n  if (!mirror2.hasNode(doc)) return void 0;\n  const docId = mirror2.getId(doc);\n  return docId === 1 ? void 0 : docId;\n}\nfunction serializeTextNode(n, options) {\n  const { needsMask, maskTextFn, rootId, cssCaptured } = options;\n  const parent = index.parentNode(n);\n  const parentTagName = parent && parent.tagName;\n  let textContent2 = \"\";\n  const isStyle = parentTagName === \"STYLE\" ? true : void 0;\n  const isScript = parentTagName === \"SCRIPT\" ? true : void 0;\n  if (isScript) {\n    textContent2 = \"SCRIPT_PLACEHOLDER\";\n  } else if (!cssCaptured) {\n    textContent2 = index.textContent(n);\n    if (isStyle && textContent2) {\n      textContent2 = absolutifyURLs(textContent2, getHref(options.doc));\n    }\n  }\n  if (!isStyle && !isScript && textContent2 && needsMask) {\n    textContent2 = maskTextFn ? maskTextFn(textContent2, index.parentElement(n)) : textContent2.replace(/[\\S]/g, \"*\");\n  }\n  return {\n    type: NodeType.Text,\n    textContent: textContent2 || \"\",\n    rootId\n  };\n}\nfunction serializeElementNode(n, options) {\n  const {\n    doc,\n    blockClass,\n    blockSelector,\n    inlineStylesheet,\n    maskInputOptions = {},\n    maskInputFn,\n    dataURLOptions = {},\n    inlineImages,\n    recordCanvas,\n    keepIframeSrcFn,\n    newlyAddedElement = false,\n    rootId\n  } = options;\n  const needBlock = _isBlockedElement(n, blockClass, blockSelector);\n  const tagName = getValidTagName(n);\n  let attributes = {};\n  const len = n.attributes.length;\n  for (let i = 0; i < len; i++) {\n    const attr = n.attributes[i];\n    if (!ignoreAttribute(tagName, attr.name, attr.value)) {\n      attributes[attr.name] = transformAttribute(\n        doc,\n        tagName,\n        toLowerCase(attr.name),\n        attr.value\n      );\n    }\n  }\n  if (tagName === \"link\" && inlineStylesheet) {\n    const stylesheet = Array.from(doc.styleSheets).find((s) => {\n      return s.href === n.href;\n    });\n    let cssText = null;\n    if (stylesheet) {\n      cssText = stringifyStylesheet(stylesheet);\n    }\n    if (cssText) {\n      delete attributes.rel;\n      delete attributes.href;\n      attributes._cssText = cssText;\n    }\n  }\n  if (tagName === \"style\" && n.sheet) {\n    let cssText = stringifyStylesheet(\n      n.sheet\n    );\n    if (cssText) {\n      if (n.childNodes.length > 1) {\n        cssText = markCssSplits(cssText, n);\n      }\n      attributes._cssText = cssText;\n    }\n  }\n  if ([\"input\", \"textarea\", \"select\"].includes(tagName)) {\n    const value = n.value;\n    const checked = n.checked;\n    if (attributes.type !== \"radio\" && attributes.type !== \"checkbox\" && attributes.type !== \"submit\" && attributes.type !== \"button\" && value) {\n      attributes.value = maskInputValue({\n        element: n,\n        type: getInputType(n),\n        tagName,\n        value,\n        maskInputOptions,\n        maskInputFn\n      });\n    } else if (checked) {\n      attributes.checked = checked;\n    }\n  }\n  if (tagName === \"option\") {\n    if (n.selected && !maskInputOptions[\"select\"]) {\n      attributes.selected = true;\n    } else {\n      delete attributes.selected;\n    }\n  }\n  if (tagName === \"dialog\" && n.open) {\n    attributes.rr_open_mode = n.matches(\"dialog:modal\") ? \"modal\" : \"non-modal\";\n  }\n  if (tagName === \"canvas\" && recordCanvas) {\n    if (n.__context === \"2d\") {\n      if (!is2DCanvasBlank(n)) {\n        attributes.rr_dataURL = n.toDataURL(\n          dataURLOptions.type,\n          dataURLOptions.quality\n        );\n      }\n    } else if (!(\"__context\" in n)) {\n      const canvasDataURL = n.toDataURL(\n        dataURLOptions.type,\n        dataURLOptions.quality\n      );\n      const blankCanvas = doc.createElement(\"canvas\");\n      blankCanvas.width = n.width;\n      blankCanvas.height = n.height;\n      const blankCanvasDataURL = blankCanvas.toDataURL(\n        dataURLOptions.type,\n        dataURLOptions.quality\n      );\n      if (canvasDataURL !== blankCanvasDataURL) {\n        attributes.rr_dataURL = canvasDataURL;\n      }\n    }\n  }\n  if (tagName === \"img\" && inlineImages) {\n    if (!canvasService) {\n      canvasService = doc.createElement(\"canvas\");\n      canvasCtx = canvasService.getContext(\"2d\");\n    }\n    const image = n;\n    const imageSrc = image.currentSrc || image.getAttribute(\"src\") || \"<unknown-src>\";\n    const priorCrossOrigin = image.crossOrigin;\n    const recordInlineImage = () => {\n      image.removeEventListener(\"load\", recordInlineImage);\n      try {\n        canvasService.width = image.naturalWidth;\n        canvasService.height = image.naturalHeight;\n        canvasCtx.drawImage(image, 0, 0);\n        attributes.rr_dataURL = canvasService.toDataURL(\n          dataURLOptions.type,\n          dataURLOptions.quality\n        );\n      } catch (err) {\n        if (image.crossOrigin !== \"anonymous\") {\n          image.crossOrigin = \"anonymous\";\n          if (image.complete && image.naturalWidth !== 0)\n            recordInlineImage();\n          else image.addEventListener(\"load\", recordInlineImage);\n          return;\n        } else {\n          console.warn(\n            `Cannot inline img src=${imageSrc}! Error: ${err}`\n          );\n        }\n      }\n      if (image.crossOrigin === \"anonymous\") {\n        priorCrossOrigin ? attributes.crossOrigin = priorCrossOrigin : image.removeAttribute(\"crossorigin\");\n      }\n    };\n    if (image.complete && image.naturalWidth !== 0) recordInlineImage();\n    else image.addEventListener(\"load\", recordInlineImage);\n  }\n  if ([\"audio\", \"video\"].includes(tagName)) {\n    const mediaAttributes = attributes;\n    mediaAttributes.rr_mediaState = n.paused ? \"paused\" : \"played\";\n    mediaAttributes.rr_mediaCurrentTime = n.currentTime;\n    mediaAttributes.rr_mediaPlaybackRate = n.playbackRate;\n    mediaAttributes.rr_mediaMuted = n.muted;\n    mediaAttributes.rr_mediaLoop = n.loop;\n    mediaAttributes.rr_mediaVolume = n.volume;\n  }\n  if (!newlyAddedElement) {\n    if (n.scrollLeft) {\n      attributes.rr_scrollLeft = n.scrollLeft;\n    }\n    if (n.scrollTop) {\n      attributes.rr_scrollTop = n.scrollTop;\n    }\n  }\n  if (needBlock) {\n    const { width, height } = n.getBoundingClientRect();\n    attributes = {\n      class: attributes.class,\n      rr_width: `${width}px`,\n      rr_height: `${height}px`\n    };\n  }\n  if (tagName === \"iframe\" && !keepIframeSrcFn(attributes.src)) {\n    if (!n.contentDocument) {\n      attributes.rr_src = attributes.src;\n    }\n    delete attributes.src;\n  }\n  let isCustomElement;\n  try {\n    if (customElements.get(tagName)) isCustomElement = true;\n  } catch (e) {\n  }\n  return {\n    type: NodeType.Element,\n    tagName,\n    attributes,\n    childNodes: [],\n    isSVG: isSVGElement(n) || void 0,\n    needBlock,\n    rootId,\n    isCustom: isCustomElement\n  };\n}\nfunction lowerIfExists(maybeAttr) {\n  if (maybeAttr === void 0 || maybeAttr === null) {\n    return \"\";\n  } else {\n    return maybeAttr.toLowerCase();\n  }\n}\nfunction slimDOMDefaults(_slimDOMOptions) {\n  if (_slimDOMOptions === true || _slimDOMOptions === \"all\") {\n    return {\n      script: true,\n      comment: true,\n      headFavicon: true,\n      headWhitespace: true,\n      headMetaSocial: true,\n      headMetaRobots: true,\n      headMetaHttpEquiv: true,\n      headMetaVerification: true,\n      // the following are off for slimDOMOptions === true,\n      // as they destroy some (hidden) info:\n      headMetaAuthorship: _slimDOMOptions === \"all\",\n      headMetaDescKeywords: _slimDOMOptions === \"all\",\n      headTitleMutations: _slimDOMOptions === \"all\"\n    };\n  } else if (_slimDOMOptions) {\n    return _slimDOMOptions;\n  }\n  return {};\n}\nfunction slimDOMExcluded(sn, slimDOMOptions) {\n  if (slimDOMOptions.comment && sn.type === NodeType.Comment) {\n    return true;\n  } else if (sn.type === NodeType.Element) {\n    if (slimDOMOptions.script && // script tag\n    (sn.tagName === \"script\" || // (module)preload link\n    sn.tagName === \"link\" && (sn.attributes.rel === \"preload\" && sn.attributes.as === \"script\" || sn.attributes.rel === \"modulepreload\") || // prefetch link\n    sn.tagName === \"link\" && sn.attributes.rel === \"prefetch\" && typeof sn.attributes.href === \"string\" && extractFileExtension(sn.attributes.href) === \"js\")) {\n      return true;\n    } else if (slimDOMOptions.headFavicon && (sn.tagName === \"link\" && sn.attributes.rel === \"shortcut icon\" || sn.tagName === \"meta\" && (lowerIfExists(sn.attributes.name).match(\n      /^msapplication-tile(image|color)$/\n    ) || lowerIfExists(sn.attributes.name) === \"application-name\" || lowerIfExists(sn.attributes.rel) === \"icon\" || lowerIfExists(sn.attributes.rel) === \"apple-touch-icon\" || lowerIfExists(sn.attributes.rel) === \"shortcut icon\"))) {\n      return true;\n    } else if (sn.tagName === \"meta\") {\n      if (slimDOMOptions.headMetaDescKeywords && lowerIfExists(sn.attributes.name).match(/^description|keywords$/)) {\n        return true;\n      } else if (slimDOMOptions.headMetaSocial && (lowerIfExists(sn.attributes.property).match(/^(og|twitter|fb):/) || // og = opengraph (facebook)\n      lowerIfExists(sn.attributes.name).match(/^(og|twitter):/) || lowerIfExists(sn.attributes.name) === \"pinterest\")) {\n        return true;\n      } else if (slimDOMOptions.headMetaRobots && (lowerIfExists(sn.attributes.name) === \"robots\" || lowerIfExists(sn.attributes.name) === \"googlebot\" || lowerIfExists(sn.attributes.name) === \"bingbot\")) {\n        return true;\n      } else if (slimDOMOptions.headMetaHttpEquiv && sn.attributes[\"http-equiv\"] !== void 0) {\n        return true;\n      } else if (slimDOMOptions.headMetaAuthorship && (lowerIfExists(sn.attributes.name) === \"author\" || lowerIfExists(sn.attributes.name) === \"generator\" || lowerIfExists(sn.attributes.name) === \"framework\" || lowerIfExists(sn.attributes.name) === \"publisher\" || lowerIfExists(sn.attributes.name) === \"progid\" || lowerIfExists(sn.attributes.property).match(/^article:/) || lowerIfExists(sn.attributes.property).match(/^product:/))) {\n        return true;\n      } else if (slimDOMOptions.headMetaVerification && (lowerIfExists(sn.attributes.name) === \"google-site-verification\" || lowerIfExists(sn.attributes.name) === \"yandex-verification\" || lowerIfExists(sn.attributes.name) === \"csrf-token\" || lowerIfExists(sn.attributes.name) === \"p:domain_verify\" || lowerIfExists(sn.attributes.name) === \"verify-v1\" || lowerIfExists(sn.attributes.name) === \"verification\" || lowerIfExists(sn.attributes.name) === \"shopify-checkout-api-token\")) {\n        return true;\n      }\n    }\n  }\n  return false;\n}\nfunction serializeNodeWithId(n, options) {\n  const {\n    doc,\n    mirror: mirror2,\n    blockClass,\n    blockSelector,\n    maskTextClass,\n    maskTextSelector,\n    skipChild = false,\n    inlineStylesheet = true,\n    maskInputOptions = {},\n    maskTextFn,\n    maskInputFn,\n    slimDOMOptions,\n    dataURLOptions = {},\n    inlineImages = false,\n    recordCanvas = false,\n    onSerialize,\n    onIframeLoad,\n    iframeLoadTimeout = 5e3,\n    onStylesheetLoad,\n    stylesheetLoadTimeout = 5e3,\n    keepIframeSrcFn = () => false,\n    newlyAddedElement = false,\n    cssCaptured = false\n  } = options;\n  let { needsMask } = options;\n  let { preserveWhiteSpace = true } = options;\n  if (!needsMask) {\n    const checkAncestors = needsMask === void 0;\n    needsMask = needMaskingText(\n      n,\n      maskTextClass,\n      maskTextSelector,\n      checkAncestors\n    );\n  }\n  const _serializedNode = serializeNode(n, {\n    doc,\n    mirror: mirror2,\n    blockClass,\n    blockSelector,\n    needsMask,\n    inlineStylesheet,\n    maskInputOptions,\n    maskTextFn,\n    maskInputFn,\n    dataURLOptions,\n    inlineImages,\n    recordCanvas,\n    keepIframeSrcFn,\n    newlyAddedElement,\n    cssCaptured\n  });\n  if (!_serializedNode) {\n    console.warn(n, \"not serialized\");\n    return null;\n  }\n  let id;\n  if (mirror2.hasNode(n)) {\n    id = mirror2.getId(n);\n  } else if (slimDOMExcluded(_serializedNode, slimDOMOptions) || !preserveWhiteSpace && _serializedNode.type === NodeType.Text && !_serializedNode.textContent.replace(/^\\s+|\\s+$/gm, \"\").length) {\n    id = IGNORED_NODE;\n  } else {\n    id = genId();\n  }\n  const serializedNode = Object.assign(_serializedNode, { id });\n  mirror2.add(n, serializedNode);\n  if (id === IGNORED_NODE) {\n    return null;\n  }\n  if (onSerialize) {\n    onSerialize(n);\n  }\n  let recordChild = !skipChild;\n  if (serializedNode.type === NodeType.Element) {\n    recordChild = recordChild && !serializedNode.needBlock;\n    delete serializedNode.needBlock;\n    const shadowRootEl = index.shadowRoot(n);\n    if (shadowRootEl && isNativeShadowDom(shadowRootEl))\n      serializedNode.isShadowHost = true;\n  }\n  if ((serializedNode.type === NodeType.Document || serializedNode.type === NodeType.Element) && recordChild) {\n    if (slimDOMOptions.headWhitespace && serializedNode.type === NodeType.Element && serializedNode.tagName === \"head\") {\n      preserveWhiteSpace = false;\n    }\n    const bypassOptions = {\n      doc,\n      mirror: mirror2,\n      blockClass,\n      blockSelector,\n      needsMask,\n      maskTextClass,\n      maskTextSelector,\n      skipChild,\n      inlineStylesheet,\n      maskInputOptions,\n      maskTextFn,\n      maskInputFn,\n      slimDOMOptions,\n      dataURLOptions,\n      inlineImages,\n      recordCanvas,\n      preserveWhiteSpace,\n      onSerialize,\n      onIframeLoad,\n      iframeLoadTimeout,\n      onStylesheetLoad,\n      stylesheetLoadTimeout,\n      keepIframeSrcFn,\n      cssCaptured: false\n    };\n    if (serializedNode.type === NodeType.Element && serializedNode.tagName === \"textarea\" && serializedNode.attributes.value !== void 0) ;\n    else {\n      if (serializedNode.type === NodeType.Element && serializedNode.attributes._cssText !== void 0 && typeof serializedNode.attributes._cssText === \"string\") {\n        bypassOptions.cssCaptured = true;\n      }\n      for (const childN of Array.from(index.childNodes(n))) {\n        const serializedChildNode = serializeNodeWithId(childN, bypassOptions);\n        if (serializedChildNode) {\n          serializedNode.childNodes.push(serializedChildNode);\n        }\n      }\n    }\n    let shadowRootEl = null;\n    if (isElement(n) && (shadowRootEl = index.shadowRoot(n))) {\n      for (const childN of Array.from(index.childNodes(shadowRootEl))) {\n        const serializedChildNode = serializeNodeWithId(childN, bypassOptions);\n        if (serializedChildNode) {\n          isNativeShadowDom(shadowRootEl) && (serializedChildNode.isShadow = true);\n          serializedNode.childNodes.push(serializedChildNode);\n        }\n      }\n    }\n  }\n  const parent = index.parentNode(n);\n  if (parent && isShadowRoot(parent) && isNativeShadowDom(parent)) {\n    serializedNode.isShadow = true;\n  }\n  if (serializedNode.type === NodeType.Element && serializedNode.tagName === \"iframe\") {\n    onceIframeLoaded(\n      n,\n      () => {\n        const iframeDoc = n.contentDocument;\n        if (iframeDoc && onIframeLoad) {\n          const serializedIframeNode = serializeNodeWithId(iframeDoc, {\n            doc: iframeDoc,\n            mirror: mirror2,\n            blockClass,\n            blockSelector,\n            needsMask,\n            maskTextClass,\n            maskTextSelector,\n            skipChild: false,\n            inlineStylesheet,\n            maskInputOptions,\n            maskTextFn,\n            maskInputFn,\n            slimDOMOptions,\n            dataURLOptions,\n            inlineImages,\n            recordCanvas,\n            preserveWhiteSpace,\n            onSerialize,\n            onIframeLoad,\n            iframeLoadTimeout,\n            onStylesheetLoad,\n            stylesheetLoadTimeout,\n            keepIframeSrcFn\n          });\n          if (serializedIframeNode) {\n            onIframeLoad(\n              n,\n              serializedIframeNode\n            );\n          }\n        }\n      },\n      iframeLoadTimeout\n    );\n  }\n  if (serializedNode.type === NodeType.Element && serializedNode.tagName === \"link\" && typeof serializedNode.attributes.rel === \"string\" && (serializedNode.attributes.rel === \"stylesheet\" || serializedNode.attributes.rel === \"preload\" && typeof serializedNode.attributes.href === \"string\" && extractFileExtension(serializedNode.attributes.href) === \"css\")) {\n    onceStylesheetLoaded(\n      n,\n      () => {\n        if (onStylesheetLoad) {\n          const serializedLinkNode = serializeNodeWithId(n, {\n            doc,\n            mirror: mirror2,\n            blockClass,\n            blockSelector,\n            needsMask,\n            maskTextClass,\n            maskTextSelector,\n            skipChild: false,\n            inlineStylesheet,\n            maskInputOptions,\n            maskTextFn,\n            maskInputFn,\n            slimDOMOptions,\n            dataURLOptions,\n            inlineImages,\n            recordCanvas,\n            preserveWhiteSpace,\n            onSerialize,\n            onIframeLoad,\n            iframeLoadTimeout,\n            onStylesheetLoad,\n            stylesheetLoadTimeout,\n            keepIframeSrcFn\n          });\n          if (serializedLinkNode) {\n            onStylesheetLoad(\n              n,\n              serializedLinkNode\n            );\n          }\n        }\n      },\n      stylesheetLoadTimeout\n    );\n  }\n  return serializedNode;\n}\nfunction snapshot(n, options) {\n  const {\n    mirror: mirror2 = new Mirror(),\n    blockClass = \"rr-block\",\n    blockSelector = null,\n    maskTextClass = \"rr-mask\",\n    maskTextSelector = null,\n    inlineStylesheet = true,\n    inlineImages = false,\n    recordCanvas = false,\n    maskAllInputs = false,\n    maskTextFn,\n    maskInputFn,\n    slimDOM = false,\n    dataURLOptions,\n    preserveWhiteSpace,\n    onSerialize,\n    onIframeLoad,\n    iframeLoadTimeout,\n    onStylesheetLoad,\n    stylesheetLoadTimeout,\n    keepIframeSrcFn = () => false\n  } = options;\n  const maskInputOptions = maskAllInputs === true ? {\n    color: true,\n    date: true,\n    \"datetime-local\": true,\n    email: true,\n    month: true,\n    number: true,\n    range: true,\n    search: true,\n    tel: true,\n    text: true,\n    time: true,\n    url: true,\n    week: true,\n    textarea: true,\n    select: true,\n    password: true\n  } : maskAllInputs === false ? {\n    password: true\n  } : maskAllInputs;\n  const slimDOMOptions = slimDOMDefaults(slimDOM);\n  return serializeNodeWithId(n, {\n    doc: n,\n    mirror: mirror2,\n    blockClass,\n    blockSelector,\n    maskTextClass,\n    maskTextSelector,\n    skipChild: false,\n    inlineStylesheet,\n    maskInputOptions,\n    maskTextFn,\n    maskInputFn,\n    slimDOMOptions,\n    dataURLOptions,\n    inlineImages,\n    recordCanvas,\n    preserveWhiteSpace,\n    onSerialize,\n    onIframeLoad,\n    iframeLoadTimeout,\n    onStylesheetLoad,\n    stylesheetLoadTimeout,\n    keepIframeSrcFn,\n    newlyAddedElement: false\n  });\n}\nclass BaseRRNode {\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any\n  constructor(..._args) {\n    __publicField(this, \"parentElement\", null);\n    __publicField(this, \"parentNode\", null);\n    __publicField(this, \"ownerDocument\");\n    __publicField(this, \"firstChild\", null);\n    __publicField(this, \"lastChild\", null);\n    __publicField(this, \"previousSibling\", null);\n    __publicField(this, \"nextSibling\", null);\n    __publicField(this, \"ELEMENT_NODE\", 1);\n    __publicField(this, \"TEXT_NODE\", 3);\n    // corresponding nodeType value of standard HTML Node\n    __publicField(this, \"nodeType\");\n    __publicField(this, \"nodeName\");\n    __publicField(this, \"RRNodeType\");\n  }\n  get childNodes() {\n    const childNodes2 = [];\n    let childIterator = this.firstChild;\n    while (childIterator) {\n      childNodes2.push(childIterator);\n      childIterator = childIterator.nextSibling;\n    }\n    return childNodes2;\n  }\n  contains(node) {\n    if (!(node instanceof BaseRRNode)) return false;\n    else if (node.ownerDocument !== this.ownerDocument) return false;\n    else if (node === this) return true;\n    while (node.parentNode) {\n      if (node.parentNode === this) return true;\n      node = node.parentNode;\n    }\n    return false;\n  }\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  appendChild(_newChild) {\n    throw new Error(\n      `RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.`\n    );\n  }\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  insertBefore(_newChild, _refChild) {\n    throw new Error(\n      `RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.`\n    );\n  }\n  // eslint-disable-next-line @typescript-eslint/no-unused-vars\n  removeChild(_node) {\n    throw new Error(\n      `RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.`\n    );\n  }\n  toString() {\n    return \"RRNode\";\n  }\n}\nfunction on(type, fn, target = document) {\n  const options = { capture: true, passive: true };\n  target.addEventListener(type, fn, options);\n  return () => target.removeEventListener(type, fn, options);\n}\nconst DEPARTED_MIRROR_ACCESS_WARNING = \"Please stop import mirror directly. Instead of that,\\r\\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\\r\\nor you can use record.mirror to access the mirror instance during recording.\";\nlet _mirror = {\n  map: {},\n  getId() {\n    console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n    return -1;\n  },\n  getNode() {\n    console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n    return null;\n  },\n  removeNodeFromMap() {\n    console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n  },\n  has() {\n    console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n    return false;\n  },\n  reset() {\n    console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n  }\n};\nif (typeof window !== \"undefined\" && window.Proxy && window.Reflect) {\n  _mirror = new Proxy(_mirror, {\n    get(target, prop, receiver) {\n      if (prop === \"map\") {\n        console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n      }\n      return Reflect.get(target, prop, receiver);\n    }\n  });\n}\nfunction throttle(func, wait, options = {}) {\n  let timeout = null;\n  let previous = 0;\n  return function(...args) {\n    const now = Date.now();\n    if (!previous && options.leading === false) {\n      previous = now;\n    }\n    const remaining = wait - (now - previous);\n    const context = this;\n    if (remaining <= 0 || remaining > wait) {\n      if (timeout) {\n        clearTimeout(timeout);\n        timeout = null;\n      }\n      previous = now;\n      func.apply(context, args);\n    } else if (!timeout && options.trailing !== false) {\n      timeout = setTimeout(() => {\n        previous = options.leading === false ? 0 : Date.now();\n        timeout = null;\n        func.apply(context, args);\n      }, remaining);\n    }\n  };\n}\nfunction hookSetter(target, key, d, isRevoked, win = window) {\n  const original = win.Object.getOwnPropertyDescriptor(target, key);\n  win.Object.defineProperty(\n    target,\n    key,\n    isRevoked ? d : {\n      set(value) {\n        setTimeout(() => {\n          d.set.call(this, value);\n        }, 0);\n        if (original && original.set) {\n          original.set.call(this, value);\n        }\n      }\n    }\n  );\n  return () => hookSetter(target, key, original || {}, true);\n}\nfunction getWindowScroll(win) {\n  var _a2, _b, _c, _d;\n  const doc = win.document;\n  return {\n    left: doc.scrollingElement ? doc.scrollingElement.scrollLeft : win.pageXOffset !== void 0 ? win.pageXOffset : doc.documentElement.scrollLeft || (doc == null ? void 0 : doc.body) && ((_a2 = index.parentElement(doc.body)) == null ? void 0 : _a2.scrollLeft) || ((_b = doc == null ? void 0 : doc.body) == null ? void 0 : _b.scrollLeft) || 0,\n    top: doc.scrollingElement ? doc.scrollingElement.scrollTop : win.pageYOffset !== void 0 ? win.pageYOffset : (doc == null ? void 0 : doc.documentElement.scrollTop) || (doc == null ? void 0 : doc.body) && ((_c = index.parentElement(doc.body)) == null ? void 0 : _c.scrollTop) || ((_d = doc == null ? void 0 : doc.body) == null ? void 0 : _d.scrollTop) || 0\n  };\n}\nfunction getWindowHeight() {\n  return window.innerHeight || document.documentElement && document.documentElement.clientHeight || document.body && document.body.clientHeight;\n}\nfunction getWindowWidth() {\n  return window.innerWidth || document.documentElement && document.documentElement.clientWidth || document.body && document.body.clientWidth;\n}\nfunction closestElementOfNode(node) {\n  if (!node) {\n    return null;\n  }\n  const el = node.nodeType === node.ELEMENT_NODE ? node : index.parentElement(node);\n  return el;\n}\nfunction isBlocked(node, blockClass, blockSelector, checkAncestors) {\n  if (!node) {\n    return false;\n  }\n  const el = closestElementOfNode(node);\n  if (!el) {\n    return false;\n  }\n  try {\n    if (typeof blockClass === \"string\") {\n      if (el.classList.contains(blockClass)) return true;\n      if (checkAncestors && el.closest(\".\" + blockClass) !== null) return true;\n    } else {\n      if (classMatchesRegex(el, blockClass, checkAncestors)) return true;\n    }\n  } catch (e) {\n  }\n  if (blockSelector) {\n    if (el.matches(blockSelector)) return true;\n    if (checkAncestors && el.closest(blockSelector) !== null) return true;\n  }\n  return false;\n}\nfunction isSerialized(n, mirror2) {\n  return mirror2.getId(n) !== -1;\n}\nfunction isIgnored(n, mirror2, slimDOMOptions) {\n  if (n.tagName === \"TITLE\" && slimDOMOptions.headTitleMutations) {\n    return true;\n  }\n  return mirror2.getId(n) === IGNORED_NODE;\n}\nfunction isAncestorRemoved(target, mirror2) {\n  if (isShadowRoot(target)) {\n    return false;\n  }\n  const id = mirror2.getId(target);\n  if (!mirror2.has(id)) {\n    return true;\n  }\n  const parent = index.parentNode(target);\n  if (parent && parent.nodeType === target.DOCUMENT_NODE) {\n    return false;\n  }\n  if (!parent) {\n    return true;\n  }\n  return isAncestorRemoved(parent, mirror2);\n}\nfunction legacy_isTouchEvent(event) {\n  return Boolean(event.changedTouches);\n}\nfunction polyfill(win = window) {\n  if (\"NodeList\" in win && !win.NodeList.prototype.forEach) {\n    win.NodeList.prototype.forEach = Array.prototype.forEach;\n  }\n  if (\"DOMTokenList\" in win && !win.DOMTokenList.prototype.forEach) {\n    win.DOMTokenList.prototype.forEach = Array.prototype.forEach;\n  }\n}\nfunction isSerializedIframe(n, mirror2) {\n  return Boolean(n.nodeName === \"IFRAME\" && mirror2.getMeta(n));\n}\nfunction isSerializedStylesheet(n, mirror2) {\n  return Boolean(\n    n.nodeName === \"LINK\" && n.nodeType === n.ELEMENT_NODE && n.getAttribute && n.getAttribute(\"rel\") === \"stylesheet\" && mirror2.getMeta(n)\n  );\n}\nfunction hasShadowRoot(n) {\n  if (!n) return false;\n  if (n instanceof BaseRRNode && \"shadowRoot\" in n) {\n    return Boolean(n.shadowRoot);\n  }\n  return Boolean(index.shadowRoot(n));\n}\nclass StyleSheetMirror {\n  constructor() {\n    __publicField(this, \"id\", 1);\n    __publicField(this, \"styleIDMap\", /* @__PURE__ */ new WeakMap());\n    __publicField(this, \"idStyleMap\", /* @__PURE__ */ new Map());\n  }\n  getId(stylesheet) {\n    return this.styleIDMap.get(stylesheet) ?? -1;\n  }\n  has(stylesheet) {\n    return this.styleIDMap.has(stylesheet);\n  }\n  /**\n   * @returns If the stylesheet is in the mirror, returns the id of the stylesheet. If not, return the new assigned id.\n   */\n  add(stylesheet, id) {\n    if (this.has(stylesheet)) return this.getId(stylesheet);\n    let newId;\n    if (id === void 0) {\n      newId = this.id++;\n    } else newId = id;\n    this.styleIDMap.set(stylesheet, newId);\n    this.idStyleMap.set(newId, stylesheet);\n    return newId;\n  }\n  getStyle(id) {\n    return this.idStyleMap.get(id) || null;\n  }\n  reset() {\n    this.styleIDMap = /* @__PURE__ */ new WeakMap();\n    this.idStyleMap = /* @__PURE__ */ new Map();\n    this.id = 1;\n  }\n  generateId() {\n    return this.id++;\n  }\n}\nfunction getShadowHost(n) {\n  var _a2;\n  let shadowHost = null;\n  if (\"getRootNode\" in n && ((_a2 = index.getRootNode(n)) == null ? void 0 : _a2.nodeType) === Node.DOCUMENT_FRAGMENT_NODE && index.host(index.getRootNode(n)))\n    shadowHost = index.host(index.getRootNode(n));\n  return shadowHost;\n}\nfunction getRootShadowHost(n) {\n  let rootShadowHost = n;\n  let shadowHost;\n  while (shadowHost = getShadowHost(rootShadowHost))\n    rootShadowHost = shadowHost;\n  return rootShadowHost;\n}\nfunction shadowHostInDom(n) {\n  const doc = index.ownerDocument(n);\n  if (!doc) return false;\n  const shadowHost = getRootShadowHost(n);\n  return index.contains(doc, shadowHost);\n}\nfunction inDom(n) {\n  const doc = index.ownerDocument(n);\n  if (!doc) return false;\n  return index.contains(doc, n) || shadowHostInDom(n);\n}\nfunction isNodeInLinkedList(n) {\n  return \"__ln\" in n;\n}\nclass DoubleLinkedList {\n  constructor() {\n    __publicField(this, \"length\", 0);\n    __publicField(this, \"head\", null);\n    __publicField(this, \"tail\", null);\n  }\n  get(position) {\n    if (position >= this.length) {\n      throw new Error(\"Position outside of list range\");\n    }\n    let current = this.head;\n    for (let index2 = 0; index2 < position; index2++) {\n      current = (current == null ? void 0 : current.next) || null;\n    }\n    return current;\n  }\n  addNode(n) {\n    const node = {\n      value: n,\n      previous: null,\n      next: null\n    };\n    n.__ln = node;\n    if (n.previousSibling && isNodeInLinkedList(n.previousSibling)) {\n      const current = n.previousSibling.__ln.next;\n      node.next = current;\n      node.previous = n.previousSibling.__ln;\n      n.previousSibling.__ln.next = node;\n      if (current) {\n        current.previous = node;\n      }\n    } else if (n.nextSibling && isNodeInLinkedList(n.nextSibling) && n.nextSibling.__ln.previous) {\n      const current = n.nextSibling.__ln.previous;\n      node.previous = current;\n      node.next = n.nextSibling.__ln;\n      n.nextSibling.__ln.previous = node;\n      if (current) {\n        current.next = node;\n      }\n    } else {\n      if (this.head) {\n        this.head.previous = node;\n      }\n      node.next = this.head;\n      this.head = node;\n    }\n    if (node.next === null) {\n      this.tail = node;\n    }\n    this.length++;\n  }\n  removeNode(n) {\n    const current = n.__ln;\n    if (!this.head) {\n      return;\n    }\n    if (!current.previous) {\n      this.head = current.next;\n      if (this.head) {\n        this.head.previous = null;\n      } else {\n        this.tail = null;\n      }\n    } else {\n      current.previous.next = current.next;\n      if (current.next) {\n        current.next.previous = current.previous;\n      } else {\n        this.tail = current.previous;\n      }\n    }\n    if (n.__ln) {\n      delete n.__ln;\n    }\n    this.length--;\n  }\n}\nconst moveKey = (id, parentId) => `${id}@${parentId}`;\nclass MutationBuffer {\n  constructor() {\n    __publicField(this, \"frozen\", false);\n    __publicField(this, \"locked\", false);\n    __publicField(this, \"texts\", []);\n    __publicField(this, \"attributes\", []);\n    __publicField(this, \"attributeMap\", /* @__PURE__ */ new WeakMap());\n    __publicField(this, \"removes\", []);\n    __publicField(this, \"mapRemoves\", []);\n    __publicField(this, \"movedMap\", {});\n    /**\n     * the browser MutationObserver emits multiple mutations after\n     * a delay for performance reasons, making tracing added nodes hard\n     * in our `processMutations` callback function.\n     * For example, if we append an element el_1 into body, and then append\n     * another element el_2 into el_1, these two mutations may be passed to the\n     * callback function together when the two operations were done.\n     * Generally we need to trace child nodes of newly added nodes, but in this\n     * case if we count el_2 as el_1's child node in the first mutation record,\n     * then we will count el_2 again in the second mutation record which was\n     * duplicated.\n     * To avoid of duplicate counting added nodes, we use a Set to store\n     * added nodes and its child nodes during iterate mutation records. Then\n     * collect added nodes from the Set which have no duplicate copy. But\n     * this also causes newly added nodes will not be serialized with id ASAP,\n     * which means all the id related calculation should be lazy too.\n     */\n    __publicField(this, \"addedSet\", /* @__PURE__ */ new Set());\n    __publicField(this, \"movedSet\", /* @__PURE__ */ new Set());\n    __publicField(this, \"droppedSet\", /* @__PURE__ */ new Set());\n    __publicField(this, \"removesSubTreeCache\", /* @__PURE__ */ new Set());\n    __publicField(this, \"mutationCb\");\n    __publicField(this, \"blockClass\");\n    __publicField(this, \"blockSelector\");\n    __publicField(this, \"maskTextClass\");\n    __publicField(this, \"maskTextSelector\");\n    __publicField(this, \"inlineStylesheet\");\n    __publicField(this, \"maskInputOptions\");\n    __publicField(this, \"maskTextFn\");\n    __publicField(this, \"maskInputFn\");\n    __publicField(this, \"keepIframeSrcFn\");\n    __publicField(this, \"recordCanvas\");\n    __publicField(this, \"inlineImages\");\n    __publicField(this, \"slimDOMOptions\");\n    __publicField(this, \"dataURLOptions\");\n    __publicField(this, \"doc\");\n    __publicField(this, \"mirror\");\n    __publicField(this, \"iframeManager\");\n    __publicField(this, \"stylesheetManager\");\n    __publicField(this, \"shadowDomManager\");\n    __publicField(this, \"canvasManager\");\n    __publicField(this, \"processedNodeManager\");\n    __publicField(this, \"unattachedDoc\");\n    __publicField(this, \"processMutations\", (mutations) => {\n      mutations.forEach(this.processMutation);\n      this.emit();\n    });\n    __publicField(this, \"emit\", () => {\n      if (this.frozen || this.locked) {\n        return;\n      }\n      const adds = [];\n      const addedIds = /* @__PURE__ */ new Set();\n      const addList = new DoubleLinkedList();\n      const getNextId = (n) => {\n        let ns = n;\n        let nextId = IGNORED_NODE;\n        while (nextId === IGNORED_NODE) {\n          ns = ns && ns.nextSibling;\n          nextId = ns && this.mirror.getId(ns);\n        }\n        return nextId;\n      };\n      const pushAdd = (n) => {\n        const parent = index.parentNode(n);\n        if (!parent || !inDom(n)) {\n          return;\n        }\n        let cssCaptured = false;\n        if (n.nodeType === Node.TEXT_NODE) {\n          const parentTag = parent.tagName;\n          if (parentTag === \"TEXTAREA\") {\n            return;\n          } else if (parentTag === \"STYLE\" && this.addedSet.has(parent)) {\n            cssCaptured = true;\n          }\n        }\n        const parentId = isShadowRoot(parent) ? this.mirror.getId(getShadowHost(n)) : this.mirror.getId(parent);\n        const nextId = getNextId(n);\n        if (parentId === -1 || nextId === -1) {\n          return addList.addNode(n);\n        }\n        const sn = serializeNodeWithId(n, {\n          doc: this.doc,\n          mirror: this.mirror,\n          blockClass: this.blockClass,\n          blockSelector: this.blockSelector,\n          maskTextClass: this.maskTextClass,\n          maskTextSelector: this.maskTextSelector,\n          skipChild: true,\n          newlyAddedElement: true,\n          inlineStylesheet: this.inlineStylesheet,\n          maskInputOptions: this.maskInputOptions,\n          maskTextFn: this.maskTextFn,\n          maskInputFn: this.maskInputFn,\n          slimDOMOptions: this.slimDOMOptions,\n          dataURLOptions: this.dataURLOptions,\n          recordCanvas: this.recordCanvas,\n          inlineImages: this.inlineImages,\n          onSerialize: (currentN) => {\n            if (isSerializedIframe(currentN, this.mirror)) {\n              this.iframeManager.addIframe(currentN);\n            }\n            if (isSerializedStylesheet(currentN, this.mirror)) {\n              this.stylesheetManager.trackLinkElement(\n                currentN\n              );\n            }\n            if (hasShadowRoot(n)) {\n              this.shadowDomManager.addShadowRoot(index.shadowRoot(n), this.doc);\n            }\n          },\n          onIframeLoad: (iframe, childSn) => {\n            this.iframeManager.attachIframe(iframe, childSn);\n            this.shadowDomManager.observeAttachShadow(iframe);\n          },\n          onStylesheetLoad: (link, childSn) => {\n            this.stylesheetManager.attachLinkElement(link, childSn);\n          },\n          cssCaptured\n        });\n        if (sn) {\n          adds.push({\n            parentId,\n            nextId,\n            node: sn\n          });\n          addedIds.add(sn.id);\n        }\n      };\n      while (this.mapRemoves.length) {\n        this.mirror.removeNodeFromMap(this.mapRemoves.shift());\n      }\n      for (const n of this.movedSet) {\n        if (isParentRemoved(this.removesSubTreeCache, n, this.mirror) && !this.movedSet.has(index.parentNode(n))) {\n          continue;\n        }\n        pushAdd(n);\n      }\n      for (const n of this.addedSet) {\n        if (!isAncestorInSet(this.droppedSet, n) && !isParentRemoved(this.removesSubTreeCache, n, this.mirror)) {\n          pushAdd(n);\n        } else if (isAncestorInSet(this.movedSet, n)) {\n          pushAdd(n);\n        } else {\n          this.droppedSet.add(n);\n        }\n      }\n      let candidate = null;\n      while (addList.length) {\n        let node = null;\n        if (candidate) {\n          const parentId = this.mirror.getId(index.parentNode(candidate.value));\n          const nextId = getNextId(candidate.value);\n          if (parentId !== -1 && nextId !== -1) {\n            node = candidate;\n          }\n        }\n        if (!node) {\n          let tailNode = addList.tail;\n          while (tailNode) {\n            const _node = tailNode;\n            tailNode = tailNode.previous;\n            if (_node) {\n              const parentId = this.mirror.getId(index.parentNode(_node.value));\n              const nextId = getNextId(_node.value);\n              if (nextId === -1) continue;\n              else if (parentId !== -1) {\n                node = _node;\n                break;\n              } else {\n                const unhandledNode = _node.value;\n                const parent = index.parentNode(unhandledNode);\n                if (parent && parent.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n                  const shadowHost = index.host(parent);\n                  const parentId2 = this.mirror.getId(shadowHost);\n                  if (parentId2 !== -1) {\n                    node = _node;\n                    break;\n                  }\n                }\n              }\n            }\n          }\n        }\n        if (!node) {\n          while (addList.head) {\n            addList.removeNode(addList.head.value);\n          }\n          break;\n        }\n        candidate = node.previous;\n        addList.removeNode(node.value);\n        pushAdd(node.value);\n      }\n      const payload = {\n        texts: this.texts.map((text) => {\n          const n = text.node;\n          const parent = index.parentNode(n);\n          if (parent && parent.tagName === \"TEXTAREA\") {\n            this.genTextAreaValueMutation(parent);\n          }\n          return {\n            id: this.mirror.getId(n),\n            value: text.value\n          };\n        }).filter((text) => !addedIds.has(text.id)).filter((text) => this.mirror.has(text.id)),\n        attributes: this.attributes.map((attribute) => {\n          const { attributes } = attribute;\n          if (typeof attributes.style === \"string\") {\n            const diffAsStr = JSON.stringify(attribute.styleDiff);\n            const unchangedAsStr = JSON.stringify(attribute._unchangedStyles);\n            if (diffAsStr.length < attributes.style.length) {\n              if ((diffAsStr + unchangedAsStr).split(\"var(\").length === attributes.style.split(\"var(\").length) {\n                attributes.style = attribute.styleDiff;\n              }\n            }\n          }\n          return {\n            id: this.mirror.getId(attribute.node),\n            attributes\n          };\n        }).filter((attribute) => !addedIds.has(attribute.id)).filter((attribute) => this.mirror.has(attribute.id)),\n        removes: this.removes,\n        adds\n      };\n      if (!payload.texts.length && !payload.attributes.length && !payload.removes.length && !payload.adds.length) {\n        return;\n      }\n      this.texts = [];\n      this.attributes = [];\n      this.attributeMap = /* @__PURE__ */ new WeakMap();\n      this.removes = [];\n      this.addedSet = /* @__PURE__ */ new Set();\n      this.movedSet = /* @__PURE__ */ new Set();\n      this.droppedSet = /* @__PURE__ */ new Set();\n      this.removesSubTreeCache = /* @__PURE__ */ new Set();\n      this.movedMap = {};\n      this.mutationCb(payload);\n    });\n    __publicField(this, \"genTextAreaValueMutation\", (textarea) => {\n      let item = this.attributeMap.get(textarea);\n      if (!item) {\n        item = {\n          node: textarea,\n          attributes: {},\n          styleDiff: {},\n          _unchangedStyles: {}\n        };\n        this.attributes.push(item);\n        this.attributeMap.set(textarea, item);\n      }\n      const value = Array.from(\n        index.childNodes(textarea),\n        (cn) => index.textContent(cn) || \"\"\n      ).join(\"\");\n      item.attributes.value = maskInputValue({\n        element: textarea,\n        maskInputOptions: this.maskInputOptions,\n        tagName: textarea.tagName,\n        type: getInputType(textarea),\n        value,\n        maskInputFn: this.maskInputFn\n      });\n    });\n    __publicField(this, \"processMutation\", (m) => {\n      if (isIgnored(m.target, this.mirror, this.slimDOMOptions)) {\n        return;\n      }\n      switch (m.type) {\n        case \"characterData\": {\n          const value = index.textContent(m.target);\n          if (!isBlocked(m.target, this.blockClass, this.blockSelector, false) && value !== m.oldValue) {\n            this.texts.push({\n              value: needMaskingText(\n                m.target,\n                this.maskTextClass,\n                this.maskTextSelector,\n                true\n                // checkAncestors\n              ) && value ? this.maskTextFn ? this.maskTextFn(value, closestElementOfNode(m.target)) : value.replace(/[\\S]/g, \"*\") : value,\n              node: m.target\n            });\n          }\n          break;\n        }\n        case \"attributes\": {\n          const target = m.target;\n          let attributeName = m.attributeName;\n          let value = m.target.getAttribute(attributeName);\n          if (attributeName === \"value\") {\n            const type = getInputType(target);\n            value = maskInputValue({\n              element: target,\n              maskInputOptions: this.maskInputOptions,\n              tagName: target.tagName,\n              type,\n              value,\n              maskInputFn: this.maskInputFn\n            });\n          }\n          if (isBlocked(m.target, this.blockClass, this.blockSelector, false) || value === m.oldValue) {\n            return;\n          }\n          let item = this.attributeMap.get(m.target);\n          if (target.tagName === \"IFRAME\" && attributeName === \"src\" && !this.keepIframeSrcFn(value)) {\n            if (!target.contentDocument) {\n              attributeName = \"rr_src\";\n            } else {\n              return;\n            }\n          }\n          if (!item) {\n            item = {\n              node: m.target,\n              attributes: {},\n              styleDiff: {},\n              _unchangedStyles: {}\n            };\n            this.attributes.push(item);\n            this.attributeMap.set(m.target, item);\n          }\n          if (attributeName === \"type\" && target.tagName === \"INPUT\" && (m.oldValue || \"\").toLowerCase() === \"password\") {\n            target.setAttribute(\"data-rr-is-password\", \"true\");\n          }\n          if (!ignoreAttribute(target.tagName, attributeName)) {\n            item.attributes[attributeName] = transformAttribute(\n              this.doc,\n              toLowerCase(target.tagName),\n              toLowerCase(attributeName),\n              value\n            );\n            if (attributeName === \"style\") {\n              if (!this.unattachedDoc) {\n                try {\n                  this.unattachedDoc = document.implementation.createHTMLDocument();\n                } catch (e) {\n                  this.unattachedDoc = this.doc;\n                }\n              }\n              const old = this.unattachedDoc.createElement(\"span\");\n              if (m.oldValue) {\n                old.setAttribute(\"style\", m.oldValue);\n              }\n              for (const pname of Array.from(target.style)) {\n                const newValue = target.style.getPropertyValue(pname);\n                const newPriority = target.style.getPropertyPriority(pname);\n                if (newValue !== old.style.getPropertyValue(pname) || newPriority !== old.style.getPropertyPriority(pname)) {\n                  if (newPriority === \"\") {\n                    item.styleDiff[pname] = newValue;\n                  } else {\n                    item.styleDiff[pname] = [newValue, newPriority];\n                  }\n                } else {\n                  item._unchangedStyles[pname] = [newValue, newPriority];\n                }\n              }\n              for (const pname of Array.from(old.style)) {\n                if (target.style.getPropertyValue(pname) === \"\") {\n                  item.styleDiff[pname] = false;\n                }\n              }\n            } else if (attributeName === \"open\" && target.tagName === \"DIALOG\") {\n              if (target.matches(\"dialog:modal\")) {\n                item.attributes[\"rr_open_mode\"] = \"modal\";\n              } else {\n                item.attributes[\"rr_open_mode\"] = \"non-modal\";\n              }\n            }\n          }\n          break;\n        }\n        case \"childList\": {\n          if (isBlocked(m.target, this.blockClass, this.blockSelector, true))\n            return;\n          if (m.target.tagName === \"TEXTAREA\") {\n            this.genTextAreaValueMutation(m.target);\n            return;\n          }\n          m.addedNodes.forEach((n) => this.genAdds(n, m.target));\n          m.removedNodes.forEach((n) => {\n            const nodeId = this.mirror.getId(n);\n            const parentId = isShadowRoot(m.target) ? this.mirror.getId(index.host(m.target)) : this.mirror.getId(m.target);\n            if (isBlocked(m.target, this.blockClass, this.blockSelector, false) || isIgnored(n, this.mirror, this.slimDOMOptions) || !isSerialized(n, this.mirror)) {\n              return;\n            }\n            if (this.addedSet.has(n)) {\n              deepDelete(this.addedSet, n);\n              this.droppedSet.add(n);\n            } else if (this.addedSet.has(m.target) && nodeId === -1) ;\n            else if (isAncestorRemoved(m.target, this.mirror)) ;\n            else if (this.movedSet.has(n) && this.movedMap[moveKey(nodeId, parentId)]) {\n              deepDelete(this.movedSet, n);\n            } else {\n              this.removes.push({\n                parentId,\n                id: nodeId,\n                isShadow: isShadowRoot(m.target) && isNativeShadowDom(m.target) ? true : void 0\n              });\n              processRemoves(n, this.removesSubTreeCache);\n            }\n            this.mapRemoves.push(n);\n          });\n          break;\n        }\n      }\n    });\n    /**\n     * Make sure you check if `n`'s parent is blocked before calling this function\n     * */\n    __publicField(this, \"genAdds\", (n, target) => {\n      if (this.processedNodeManager.inOtherBuffer(n, this)) return;\n      if (this.addedSet.has(n) || this.movedSet.has(n)) return;\n      if (this.mirror.hasNode(n)) {\n        if (isIgnored(n, this.mirror, this.slimDOMOptions)) {\n          return;\n        }\n        this.movedSet.add(n);\n        let targetId = null;\n        if (target && this.mirror.hasNode(target)) {\n          targetId = this.mirror.getId(target);\n        }\n        if (targetId && targetId !== -1) {\n          this.movedMap[moveKey(this.mirror.getId(n), targetId)] = true;\n        }\n      } else {\n        this.addedSet.add(n);\n        this.droppedSet.delete(n);\n      }\n      if (!isBlocked(n, this.blockClass, this.blockSelector, false)) {\n        index.childNodes(n).forEach((childN) => this.genAdds(childN));\n        if (hasShadowRoot(n)) {\n          index.childNodes(index.shadowRoot(n)).forEach((childN) => {\n            this.processedNodeManager.add(childN, this);\n            this.genAdds(childN, n);\n          });\n        }\n      }\n    });\n  }\n  init(options) {\n    [\n      \"mutationCb\",\n      \"blockClass\",\n      \"blockSelector\",\n      \"maskTextClass\",\n      \"maskTextSelector\",\n      \"inlineStylesheet\",\n      \"maskInputOptions\",\n      \"maskTextFn\",\n      \"maskInputFn\",\n      \"keepIframeSrcFn\",\n      \"recordCanvas\",\n      \"inlineImages\",\n      \"slimDOMOptions\",\n      \"dataURLOptions\",\n      \"doc\",\n      \"mirror\",\n      \"iframeManager\",\n      \"stylesheetManager\",\n      \"shadowDomManager\",\n      \"canvasManager\",\n      \"processedNodeManager\"\n    ].forEach((key) => {\n      this[key] = options[key];\n    });\n  }\n  freeze() {\n    this.frozen = true;\n    this.canvasManager.freeze();\n  }\n  unfreeze() {\n    this.frozen = false;\n    this.canvasManager.unfreeze();\n    this.emit();\n  }\n  isFrozen() {\n    return this.frozen;\n  }\n  lock() {\n    this.locked = true;\n    this.canvasManager.lock();\n  }\n  unlock() {\n    this.locked = false;\n    this.canvasManager.unlock();\n    this.emit();\n  }\n  reset() {\n    this.shadowDomManager.reset();\n    this.canvasManager.reset();\n  }\n}\nfunction deepDelete(addsSet, n) {\n  addsSet.delete(n);\n  index.childNodes(n).forEach((childN) => deepDelete(addsSet, childN));\n}\nfunction processRemoves(n, cache) {\n  const queue = [n];\n  while (queue.length) {\n    const next = queue.pop();\n    if (cache.has(next)) continue;\n    cache.add(next);\n    index.childNodes(next).forEach((n2) => queue.push(n2));\n  }\n  return;\n}\nfunction isParentRemoved(removes, n, mirror2) {\n  if (removes.size === 0) return false;\n  return _isParentRemoved(removes, n);\n}\nfunction _isParentRemoved(removes, n, _mirror2) {\n  const node = index.parentNode(n);\n  if (!node) return false;\n  return removes.has(node);\n}\nfunction isAncestorInSet(set, n) {\n  if (set.size === 0) return false;\n  return _isAncestorInSet(set, n);\n}\nfunction _isAncestorInSet(set, n) {\n  const parent = index.parentNode(n);\n  if (!parent) {\n    return false;\n  }\n  if (set.has(parent)) {\n    return true;\n  }\n  return _isAncestorInSet(set, parent);\n}\nlet errorHandler;\nfunction registerErrorHandler(handler) {\n  errorHandler = handler;\n}\nfunction unregisterErrorHandler() {\n  errorHandler = void 0;\n}\nconst callbackWrapper = (cb) => {\n  if (!errorHandler) {\n    return cb;\n  }\n  const rrwebWrapped = (...rest) => {\n    try {\n      return cb(...rest);\n    } catch (error) {\n      if (errorHandler && errorHandler(error) === true) {\n        return;\n      }\n      throw error;\n    }\n  };\n  return rrwebWrapped;\n};\nconst mutationBuffers = [];\nfunction getEventTarget(event) {\n  try {\n    if (\"composedPath\" in event) {\n      const path = event.composedPath();\n      if (path.length) {\n        return path[0];\n      }\n    } else if (\"path\" in event && event.path.length) {\n      return event.path[0];\n    }\n  } catch {\n  }\n  return event && event.target;\n}\nfunction initMutationObserver(options, rootEl) {\n  const mutationBuffer = new MutationBuffer();\n  mutationBuffers.push(mutationBuffer);\n  mutationBuffer.init(options);\n  const observer = new (mutationObserverCtor())(\n    callbackWrapper(mutationBuffer.processMutations.bind(mutationBuffer))\n  );\n  observer.observe(rootEl, {\n    attributes: true,\n    attributeOldValue: true,\n    characterData: true,\n    characterDataOldValue: true,\n    childList: true,\n    subtree: true\n  });\n  return observer;\n}\nfunction initMoveObserver({\n  mousemoveCb,\n  sampling,\n  doc,\n  mirror: mirror2\n}) {\n  if (sampling.mousemove === false) {\n    return () => {\n    };\n  }\n  const threshold = typeof sampling.mousemove === \"number\" ? sampling.mousemove : 50;\n  const callbackThreshold = typeof sampling.mousemoveCallback === \"number\" ? sampling.mousemoveCallback : 500;\n  let positions = [];\n  let timeBaseline;\n  const wrappedCb = throttle(\n    callbackWrapper(\n      (source) => {\n        const totalOffset = Date.now() - timeBaseline;\n        mousemoveCb(\n          positions.map((p) => {\n            p.timeOffset -= totalOffset;\n            return p;\n          }),\n          source\n        );\n        positions = [];\n        timeBaseline = null;\n      }\n    ),\n    callbackThreshold\n  );\n  const updatePosition = callbackWrapper(\n    throttle(\n      callbackWrapper((evt) => {\n        const target = getEventTarget(evt);\n        const { clientX, clientY } = legacy_isTouchEvent(evt) ? evt.changedTouches[0] : evt;\n        if (!timeBaseline) {\n          timeBaseline = nowTimestamp();\n        }\n        positions.push({\n          x: clientX,\n          y: clientY,\n          id: mirror2.getId(target),\n          timeOffset: nowTimestamp() - timeBaseline\n        });\n        wrappedCb(\n          typeof DragEvent !== \"undefined\" && evt instanceof DragEvent ? IncrementalSource.Drag : evt instanceof MouseEvent ? IncrementalSource.MouseMove : IncrementalSource.TouchMove\n        );\n      }),\n      threshold,\n      {\n        trailing: false\n      }\n    )\n  );\n  const handlers = [\n    on(\"mousemove\", updatePosition, doc),\n    on(\"touchmove\", updatePosition, doc),\n    on(\"drag\", updatePosition, doc)\n  ];\n  return callbackWrapper(() => {\n    handlers.forEach((h) => h());\n  });\n}\nfunction initMouseInteractionObserver({\n  mouseInteractionCb,\n  doc,\n  mirror: mirror2,\n  blockClass,\n  blockSelector,\n  sampling\n}) {\n  if (sampling.mouseInteraction === false) {\n    return () => {\n    };\n  }\n  const disableMap = sampling.mouseInteraction === true || sampling.mouseInteraction === void 0 ? {} : sampling.mouseInteraction;\n  const handlers = [];\n  let currentPointerType = null;\n  const getHandler = (eventKey) => {\n    return (event) => {\n      const target = getEventTarget(event);\n      if (isBlocked(target, blockClass, blockSelector, true)) {\n        return;\n      }\n      let pointerType = null;\n      let thisEventKey = eventKey;\n      if (\"pointerType\" in event) {\n        switch (event.pointerType) {\n          case \"mouse\":\n            pointerType = PointerTypes.Mouse;\n            break;\n          case \"touch\":\n            pointerType = PointerTypes.Touch;\n            break;\n          case \"pen\":\n            pointerType = PointerTypes.Pen;\n            break;\n        }\n        if (pointerType === PointerTypes.Touch) {\n          if (MouseInteractions[eventKey] === MouseInteractions.MouseDown) {\n            thisEventKey = \"TouchStart\";\n          } else if (MouseInteractions[eventKey] === MouseInteractions.MouseUp) {\n            thisEventKey = \"TouchEnd\";\n          }\n        } else if (pointerType === PointerTypes.Pen) ;\n      } else if (legacy_isTouchEvent(event)) {\n        pointerType = PointerTypes.Touch;\n      }\n      if (pointerType !== null) {\n        currentPointerType = pointerType;\n        if (thisEventKey.startsWith(\"Touch\") && pointerType === PointerTypes.Touch || thisEventKey.startsWith(\"Mouse\") && pointerType === PointerTypes.Mouse) {\n          pointerType = null;\n        }\n      } else if (MouseInteractions[eventKey] === MouseInteractions.Click) {\n        pointerType = currentPointerType;\n        currentPointerType = null;\n      }\n      const e = legacy_isTouchEvent(event) ? event.changedTouches[0] : event;\n      if (!e) {\n        return;\n      }\n      const id = mirror2.getId(target);\n      const { clientX, clientY } = e;\n      callbackWrapper(mouseInteractionCb)({\n        type: MouseInteractions[thisEventKey],\n        id,\n        x: clientX,\n        y: clientY,\n        ...pointerType !== null && { pointerType }\n      });\n    };\n  };\n  Object.keys(MouseInteractions).filter(\n    (key) => Number.isNaN(Number(key)) && !key.endsWith(\"_Departed\") && disableMap[key] !== false\n  ).forEach((eventKey) => {\n    let eventName = toLowerCase(eventKey);\n    const handler = getHandler(eventKey);\n    if (window.PointerEvent) {\n      switch (MouseInteractions[eventKey]) {\n        case MouseInteractions.MouseDown:\n        case MouseInteractions.MouseUp:\n          eventName = eventName.replace(\n            \"mouse\",\n            \"pointer\"\n          );\n          break;\n        case MouseInteractions.TouchStart:\n        case MouseInteractions.TouchEnd:\n          return;\n      }\n    }\n    handlers.push(on(eventName, handler, doc));\n  });\n  return callbackWrapper(() => {\n    handlers.forEach((h) => h());\n  });\n}\nfunction initScrollObserver({\n  scrollCb,\n  doc,\n  mirror: mirror2,\n  blockClass,\n  blockSelector,\n  sampling\n}) {\n  const updatePosition = callbackWrapper(\n    throttle(\n      callbackWrapper((evt) => {\n        const target = getEventTarget(evt);\n        if (!target || isBlocked(target, blockClass, blockSelector, true)) {\n          return;\n        }\n        const id = mirror2.getId(target);\n        if (target === doc && doc.defaultView) {\n          const scrollLeftTop = getWindowScroll(doc.defaultView);\n          scrollCb({\n            id,\n            x: scrollLeftTop.left,\n            y: scrollLeftTop.top\n          });\n        } else {\n          scrollCb({\n            id,\n            x: target.scrollLeft,\n            y: target.scrollTop\n          });\n        }\n      }),\n      sampling.scroll || 100\n    )\n  );\n  return on(\"scroll\", updatePosition, doc);\n}\nfunction initViewportResizeObserver({ viewportResizeCb }, { win }) {\n  let lastH = -1;\n  let lastW = -1;\n  const updateDimension = callbackWrapper(\n    throttle(\n      callbackWrapper(() => {\n        const height = getWindowHeight();\n        const width = getWindowWidth();\n        if (lastH !== height || lastW !== width) {\n          viewportResizeCb({\n            width: Number(width),\n            height: Number(height)\n          });\n          lastH = height;\n          lastW = width;\n        }\n      }),\n      200\n    )\n  );\n  return on(\"resize\", updateDimension, win);\n}\nconst INPUT_TAGS = [\"INPUT\", \"TEXTAREA\", \"SELECT\"];\nconst lastInputValueMap = /* @__PURE__ */ new WeakMap();\nfunction initInputObserver({\n  inputCb,\n  doc,\n  mirror: mirror2,\n  blockClass,\n  blockSelector,\n  ignoreClass,\n  ignoreSelector,\n  maskInputOptions,\n  maskInputFn,\n  sampling,\n  userTriggeredOnInput\n}) {\n  function eventHandler(event) {\n    let target = getEventTarget(event);\n    const userTriggered = event.isTrusted;\n    const tagName = target && target.tagName;\n    if (target && tagName === \"OPTION\") {\n      target = index.parentElement(target);\n    }\n    if (!target || !tagName || INPUT_TAGS.indexOf(tagName) < 0 || isBlocked(target, blockClass, blockSelector, true)) {\n      return;\n    }\n    if (target.classList.contains(ignoreClass) || ignoreSelector && target.matches(ignoreSelector)) {\n      return;\n    }\n    let text = target.value;\n    let isChecked = false;\n    const type = getInputType(target) || \"\";\n    if (type === \"radio\" || type === \"checkbox\") {\n      isChecked = target.checked;\n    } else if (maskInputOptions[tagName.toLowerCase()] || maskInputOptions[type]) {\n      text = maskInputValue({\n        element: target,\n        maskInputOptions,\n        tagName,\n        type,\n        value: text,\n        maskInputFn\n      });\n    }\n    cbWithDedup(\n      target,\n      userTriggeredOnInput ? { text, isChecked, userTriggered } : { text, isChecked }\n    );\n    const name = target.name;\n    if (type === \"radio\" && name && isChecked) {\n      doc.querySelectorAll(`input[type=\"radio\"][name=\"${name}\"]`).forEach((el) => {\n        if (el !== target) {\n          const text2 = el.value;\n          cbWithDedup(\n            el,\n            userTriggeredOnInput ? { text: text2, isChecked: !isChecked, userTriggered: false } : { text: text2, isChecked: !isChecked }\n          );\n        }\n      });\n    }\n  }\n  function cbWithDedup(target, v) {\n    const lastInputValue = lastInputValueMap.get(target);\n    if (!lastInputValue || lastInputValue.text !== v.text || lastInputValue.isChecked !== v.isChecked) {\n      lastInputValueMap.set(target, v);\n      const id = mirror2.getId(target);\n      callbackWrapper(inputCb)({\n        ...v,\n        id\n      });\n    }\n  }\n  const events = sampling.input === \"last\" ? [\"change\"] : [\"input\", \"change\"];\n  const handlers = events.map(\n    (eventName) => on(eventName, callbackWrapper(eventHandler), doc)\n  );\n  const currentWindow = doc.defaultView;\n  if (!currentWindow) {\n    return () => {\n      handlers.forEach((h) => h());\n    };\n  }\n  const propertyDescriptor = currentWindow.Object.getOwnPropertyDescriptor(\n    currentWindow.HTMLInputElement.prototype,\n    \"value\"\n  );\n  const hookProperties = [\n    [currentWindow.HTMLInputElement.prototype, \"value\"],\n    [currentWindow.HTMLInputElement.prototype, \"checked\"],\n    [currentWindow.HTMLSelectElement.prototype, \"value\"],\n    [currentWindow.HTMLTextAreaElement.prototype, \"value\"],\n    // Some UI library use selectedIndex to set select value\n    [currentWindow.HTMLSelectElement.prototype, \"selectedIndex\"],\n    [currentWindow.HTMLOptionElement.prototype, \"selected\"]\n  ];\n  if (propertyDescriptor && propertyDescriptor.set) {\n    handlers.push(\n      ...hookProperties.map(\n        (p) => hookSetter(\n          p[0],\n          p[1],\n          {\n            set() {\n              callbackWrapper(eventHandler)({\n                target: this,\n                isTrusted: false\n                // userTriggered to false as this could well be programmatic\n              });\n            }\n          },\n          false,\n          currentWindow\n        )\n      )\n    );\n  }\n  return callbackWrapper(() => {\n    handlers.forEach((h) => h());\n  });\n}\nfunction getNestedCSSRulePositions(rule) {\n  const positions = [];\n  function recurse(childRule, pos) {\n    if (hasNestedCSSRule(\"CSSGroupingRule\") && childRule.parentRule instanceof CSSGroupingRule || hasNestedCSSRule(\"CSSMediaRule\") && childRule.parentRule instanceof CSSMediaRule || hasNestedCSSRule(\"CSSSupportsRule\") && childRule.parentRule instanceof CSSSupportsRule || hasNestedCSSRule(\"CSSConditionRule\") && childRule.parentRule instanceof CSSConditionRule) {\n      const rules = Array.from(\n        childRule.parentRule.cssRules\n      );\n      const index2 = rules.indexOf(childRule);\n      pos.unshift(index2);\n      return recurse(childRule.parentRule, pos);\n    } else if (childRule.parentStyleSheet) {\n      const rules = Array.from(childRule.parentStyleSheet.cssRules);\n      const index2 = rules.indexOf(childRule);\n      pos.unshift(index2);\n    }\n    return pos;\n  }\n  return recurse(rule, positions);\n}\nfunction getIdAndStyleId(sheet, mirror2, styleMirror) {\n  let id, styleId;\n  if (!sheet) return {};\n  if (sheet.ownerNode) id = mirror2.getId(sheet.ownerNode);\n  else styleId = styleMirror.getId(sheet);\n  return {\n    styleId,\n    id\n  };\n}\nfunction initStyleSheetObserver({ styleSheetRuleCb, mirror: mirror2, stylesheetManager }, { win }) {\n  if (!win.CSSStyleSheet || !win.CSSStyleSheet.prototype) {\n    return () => {\n    };\n  }\n  const insertRule = win.CSSStyleSheet.prototype.insertRule;\n  win.CSSStyleSheet.prototype.insertRule = new Proxy(insertRule, {\n    apply: callbackWrapper(\n      (target, thisArg, argumentsList) => {\n        const [rule, index2] = argumentsList;\n        const { id, styleId } = getIdAndStyleId(\n          thisArg,\n          mirror2,\n          stylesheetManager.styleMirror\n        );\n        if (id && id !== -1 || styleId && styleId !== -1) {\n          styleSheetRuleCb({\n            id,\n            styleId,\n            adds: [{ rule, index: index2 }]\n          });\n        }\n        return target.apply(thisArg, argumentsList);\n      }\n    )\n  });\n  win.CSSStyleSheet.prototype.addRule = function(selector, styleBlock, index2 = this.cssRules.length) {\n    const rule = `${selector} { ${styleBlock} }`;\n    return win.CSSStyleSheet.prototype.insertRule.apply(this, [rule, index2]);\n  };\n  const deleteRule = win.CSSStyleSheet.prototype.deleteRule;\n  win.CSSStyleSheet.prototype.deleteRule = new Proxy(deleteRule, {\n    apply: callbackWrapper(\n      (target, thisArg, argumentsList) => {\n        const [index2] = argumentsList;\n        const { id, styleId } = getIdAndStyleId(\n          thisArg,\n          mirror2,\n          stylesheetManager.styleMirror\n        );\n        if (id && id !== -1 || styleId && styleId !== -1) {\n          styleSheetRuleCb({\n            id,\n            styleId,\n            removes: [{ index: index2 }]\n          });\n        }\n        return target.apply(thisArg, argumentsList);\n      }\n    )\n  });\n  win.CSSStyleSheet.prototype.removeRule = function(index2) {\n    return win.CSSStyleSheet.prototype.deleteRule.apply(this, [index2]);\n  };\n  let replace;\n  if (win.CSSStyleSheet.prototype.replace) {\n    replace = win.CSSStyleSheet.prototype.replace;\n    win.CSSStyleSheet.prototype.replace = new Proxy(replace, {\n      apply: callbackWrapper(\n        (target, thisArg, argumentsList) => {\n          const [text] = argumentsList;\n          const { id, styleId } = getIdAndStyleId(\n            thisArg,\n            mirror2,\n            stylesheetManager.styleMirror\n          );\n          if (id && id !== -1 || styleId && styleId !== -1) {\n            styleSheetRuleCb({\n              id,\n              styleId,\n              replace: text\n            });\n          }\n          return target.apply(thisArg, argumentsList);\n        }\n      )\n    });\n  }\n  let replaceSync;\n  if (win.CSSStyleSheet.prototype.replaceSync) {\n    replaceSync = win.CSSStyleSheet.prototype.replaceSync;\n    win.CSSStyleSheet.prototype.replaceSync = new Proxy(replaceSync, {\n      apply: callbackWrapper(\n        (target, thisArg, argumentsList) => {\n          const [text] = argumentsList;\n          const { id, styleId } = getIdAndStyleId(\n            thisArg,\n            mirror2,\n            stylesheetManager.styleMirror\n          );\n          if (id && id !== -1 || styleId && styleId !== -1) {\n            styleSheetRuleCb({\n              id,\n              styleId,\n              replaceSync: text\n            });\n          }\n          return target.apply(thisArg, argumentsList);\n        }\n      )\n    });\n  }\n  const supportedNestedCSSRuleTypes = {};\n  if (canMonkeyPatchNestedCSSRule(\"CSSGroupingRule\")) {\n    supportedNestedCSSRuleTypes.CSSGroupingRule = win.CSSGroupingRule;\n  } else {\n    if (canMonkeyPatchNestedCSSRule(\"CSSMediaRule\")) {\n      supportedNestedCSSRuleTypes.CSSMediaRule = win.CSSMediaRule;\n    }\n    if (canMonkeyPatchNestedCSSRule(\"CSSConditionRule\")) {\n      supportedNestedCSSRuleTypes.CSSConditionRule = win.CSSConditionRule;\n    }\n    if (canMonkeyPatchNestedCSSRule(\"CSSSupportsRule\")) {\n      supportedNestedCSSRuleTypes.CSSSupportsRule = win.CSSSupportsRule;\n    }\n  }\n  const unmodifiedFunctions = {};\n  Object.entries(supportedNestedCSSRuleTypes).forEach(([typeKey, type]) => {\n    unmodifiedFunctions[typeKey] = {\n      // eslint-disable-next-line @typescript-eslint/unbound-method\n      insertRule: type.prototype.insertRule,\n      // eslint-disable-next-line @typescript-eslint/unbound-method\n      deleteRule: type.prototype.deleteRule\n    };\n    type.prototype.insertRule = new Proxy(\n      unmodifiedFunctions[typeKey].insertRule,\n      {\n        apply: callbackWrapper(\n          (target, thisArg, argumentsList) => {\n            const [rule, index2] = argumentsList;\n            const { id, styleId } = getIdAndStyleId(\n              thisArg.parentStyleSheet,\n              mirror2,\n              stylesheetManager.styleMirror\n            );\n            if (id && id !== -1 || styleId && styleId !== -1) {\n              styleSheetRuleCb({\n                id,\n                styleId,\n                adds: [\n                  {\n                    rule,\n                    index: [\n                      ...getNestedCSSRulePositions(thisArg),\n                      index2 || 0\n                      // defaults to 0\n                    ]\n                  }\n                ]\n              });\n            }\n            return target.apply(thisArg, argumentsList);\n          }\n        )\n      }\n    );\n    type.prototype.deleteRule = new Proxy(\n      unmodifiedFunctions[typeKey].deleteRule,\n      {\n        apply: callbackWrapper(\n          (target, thisArg, argumentsList) => {\n            const [index2] = argumentsList;\n            const { id, styleId } = getIdAndStyleId(\n              thisArg.parentStyleSheet,\n              mirror2,\n              stylesheetManager.styleMirror\n            );\n            if (id && id !== -1 || styleId && styleId !== -1) {\n              styleSheetRuleCb({\n                id,\n                styleId,\n                removes: [\n                  { index: [...getNestedCSSRulePositions(thisArg), index2] }\n                ]\n              });\n            }\n            return target.apply(thisArg, argumentsList);\n          }\n        )\n      }\n    );\n  });\n  return callbackWrapper(() => {\n    win.CSSStyleSheet.prototype.insertRule = insertRule;\n    win.CSSStyleSheet.prototype.deleteRule = deleteRule;\n    replace && (win.CSSStyleSheet.prototype.replace = replace);\n    replaceSync && (win.CSSStyleSheet.prototype.replaceSync = replaceSync);\n    Object.entries(supportedNestedCSSRuleTypes).forEach(([typeKey, type]) => {\n      type.prototype.insertRule = unmodifiedFunctions[typeKey].insertRule;\n      type.prototype.deleteRule = unmodifiedFunctions[typeKey].deleteRule;\n    });\n  });\n}\nfunction initAdoptedStyleSheetObserver({\n  mirror: mirror2,\n  stylesheetManager\n}, host2) {\n  var _a2, _b, _c;\n  let hostId = null;\n  if (host2.nodeName === \"#document\") hostId = mirror2.getId(host2);\n  else hostId = mirror2.getId(index.host(host2));\n  const patchTarget = host2.nodeName === \"#document\" ? (_a2 = host2.defaultView) == null ? void 0 : _a2.Document : (_c = (_b = host2.ownerDocument) == null ? void 0 : _b.defaultView) == null ? void 0 : _c.ShadowRoot;\n  const originalPropertyDescriptor = (patchTarget == null ? void 0 : patchTarget.prototype) ? Object.getOwnPropertyDescriptor(\n    patchTarget == null ? void 0 : patchTarget.prototype,\n    \"adoptedStyleSheets\"\n  ) : void 0;\n  if (hostId === null || hostId === -1 || !patchTarget || !originalPropertyDescriptor)\n    return () => {\n    };\n  Object.defineProperty(host2, \"adoptedStyleSheets\", {\n    configurable: originalPropertyDescriptor.configurable,\n    enumerable: originalPropertyDescriptor.enumerable,\n    get() {\n      var _a3;\n      return (_a3 = originalPropertyDescriptor.get) == null ? void 0 : _a3.call(this);\n    },\n    set(sheets) {\n      var _a3;\n      const result = (_a3 = originalPropertyDescriptor.set) == null ? void 0 : _a3.call(this, sheets);\n      if (hostId !== null && hostId !== -1) {\n        try {\n          stylesheetManager.adoptStyleSheets(sheets, hostId);\n        } catch (e) {\n        }\n      }\n      return result;\n    }\n  });\n  return callbackWrapper(() => {\n    Object.defineProperty(host2, \"adoptedStyleSheets\", {\n      configurable: originalPropertyDescriptor.configurable,\n      enumerable: originalPropertyDescriptor.enumerable,\n      // eslint-disable-next-line @typescript-eslint/unbound-method\n      get: originalPropertyDescriptor.get,\n      // eslint-disable-next-line @typescript-eslint/unbound-method\n      set: originalPropertyDescriptor.set\n    });\n  });\n}\nfunction initStyleDeclarationObserver({\n  styleDeclarationCb,\n  mirror: mirror2,\n  ignoreCSSAttributes,\n  stylesheetManager\n}, { win }) {\n  const setProperty = win.CSSStyleDeclaration.prototype.setProperty;\n  win.CSSStyleDeclaration.prototype.setProperty = new Proxy(setProperty, {\n    apply: callbackWrapper(\n      (target, thisArg, argumentsList) => {\n        var _a2;\n        const [property, value, priority] = argumentsList;\n        if (ignoreCSSAttributes.has(property)) {\n          return setProperty.apply(thisArg, [property, value, priority]);\n        }\n        const { id, styleId } = getIdAndStyleId(\n          (_a2 = thisArg.parentRule) == null ? void 0 : _a2.parentStyleSheet,\n          mirror2,\n          stylesheetManager.styleMirror\n        );\n        if (id && id !== -1 || styleId && styleId !== -1) {\n          styleDeclarationCb({\n            id,\n            styleId,\n            set: {\n              property,\n              value,\n              priority\n            },\n            // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n            index: getNestedCSSRulePositions(thisArg.parentRule)\n          });\n        }\n        return target.apply(thisArg, argumentsList);\n      }\n    )\n  });\n  const removeProperty = win.CSSStyleDeclaration.prototype.removeProperty;\n  win.CSSStyleDeclaration.prototype.removeProperty = new Proxy(removeProperty, {\n    apply: callbackWrapper(\n      (target, thisArg, argumentsList) => {\n        var _a2;\n        const [property] = argumentsList;\n        if (ignoreCSSAttributes.has(property)) {\n          return removeProperty.apply(thisArg, [property]);\n        }\n        const { id, styleId } = getIdAndStyleId(\n          (_a2 = thisArg.parentRule) == null ? void 0 : _a2.parentStyleSheet,\n          mirror2,\n          stylesheetManager.styleMirror\n        );\n        if (id && id !== -1 || styleId && styleId !== -1) {\n          styleDeclarationCb({\n            id,\n            styleId,\n            remove: {\n              property\n            },\n            // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n            index: getNestedCSSRulePositions(thisArg.parentRule)\n          });\n        }\n        return target.apply(thisArg, argumentsList);\n      }\n    )\n  });\n  return callbackWrapper(() => {\n    win.CSSStyleDeclaration.prototype.setProperty = setProperty;\n    win.CSSStyleDeclaration.prototype.removeProperty = removeProperty;\n  });\n}\nfunction initMediaInteractionObserver({\n  mediaInteractionCb,\n  blockClass,\n  blockSelector,\n  mirror: mirror2,\n  sampling,\n  doc\n}) {\n  const handler = callbackWrapper(\n    (type) => throttle(\n      callbackWrapper((event) => {\n        const target = getEventTarget(event);\n        if (!target || isBlocked(target, blockClass, blockSelector, true)) {\n          return;\n        }\n        const { currentTime, volume, muted, playbackRate, loop } = target;\n        mediaInteractionCb({\n          type,\n          id: mirror2.getId(target),\n          currentTime,\n          volume,\n          muted,\n          playbackRate,\n          loop\n        });\n      }),\n      sampling.media || 500\n    )\n  );\n  const handlers = [\n    on(\"play\", handler(MediaInteractions.Play), doc),\n    on(\"pause\", handler(MediaInteractions.Pause), doc),\n    on(\"seeked\", handler(MediaInteractions.Seeked), doc),\n    on(\"volumechange\", handler(MediaInteractions.VolumeChange), doc),\n    on(\"ratechange\", handler(MediaInteractions.RateChange), doc)\n  ];\n  return callbackWrapper(() => {\n    handlers.forEach((h) => h());\n  });\n}\nfunction initFontObserver({ fontCb, doc }) {\n  const win = doc.defaultView;\n  if (!win) {\n    return () => {\n    };\n  }\n  const handlers = [];\n  const fontMap = /* @__PURE__ */ new WeakMap();\n  const originalFontFace = win.FontFace;\n  win.FontFace = function FontFace(family, source, descriptors) {\n    const fontFace = new originalFontFace(family, source, descriptors);\n    fontMap.set(fontFace, {\n      family,\n      buffer: typeof source !== \"string\",\n      descriptors,\n      fontSource: typeof source === \"string\" ? source : JSON.stringify(Array.from(new Uint8Array(source)))\n    });\n    return fontFace;\n  };\n  const restoreHandler = patch(\n    doc.fonts,\n    \"add\",\n    function(original) {\n      return function(fontFace) {\n        setTimeout(\n          callbackWrapper(() => {\n            const p = fontMap.get(fontFace);\n            if (p) {\n              fontCb(p);\n              fontMap.delete(fontFace);\n            }\n          }),\n          0\n        );\n        return original.apply(this, [fontFace]);\n      };\n    }\n  );\n  handlers.push(() => {\n    win.FontFace = originalFontFace;\n  });\n  handlers.push(restoreHandler);\n  return callbackWrapper(() => {\n    handlers.forEach((h) => h());\n  });\n}\nfunction initSelectionObserver(param) {\n  const { doc, mirror: mirror2, blockClass, blockSelector, selectionCb } = param;\n  let collapsed = true;\n  const updateSelection = callbackWrapper(() => {\n    const selection = doc.getSelection();\n    if (!selection || collapsed && (selection == null ? void 0 : selection.isCollapsed)) return;\n    collapsed = selection.isCollapsed || false;\n    const ranges = [];\n    const count = selection.rangeCount || 0;\n    for (let i = 0; i < count; i++) {\n      const range = selection.getRangeAt(i);\n      const { startContainer, startOffset, endContainer, endOffset } = range;\n      const blocked = isBlocked(startContainer, blockClass, blockSelector, true) || isBlocked(endContainer, blockClass, blockSelector, true);\n      if (blocked) continue;\n      ranges.push({\n        start: mirror2.getId(startContainer),\n        startOffset,\n        end: mirror2.getId(endContainer),\n        endOffset\n      });\n    }\n    selectionCb({ ranges });\n  });\n  updateSelection();\n  return on(\"selectionchange\", updateSelection);\n}\nfunction initCustomElementObserver({\n  doc,\n  customElementCb\n}) {\n  const win = doc.defaultView;\n  if (!win || !win.customElements) return () => {\n  };\n  const restoreHandler = patch(\n    win.customElements,\n    \"define\",\n    function(original) {\n      return function(name, constructor, options) {\n        try {\n          customElementCb({\n            define: {\n              name\n            }\n          });\n        } catch (e) {\n          console.warn(`Custom element callback failed for ${name}`);\n        }\n        return original.apply(this, [name, constructor, options]);\n      };\n    }\n  );\n  return restoreHandler;\n}\nfunction mergeHooks(o, hooks) {\n  const {\n    mutationCb,\n    mousemoveCb,\n    mouseInteractionCb,\n    scrollCb,\n    viewportResizeCb,\n    inputCb,\n    mediaInteractionCb,\n    styleSheetRuleCb,\n    styleDeclarationCb,\n    canvasMutationCb,\n    fontCb,\n    selectionCb,\n    customElementCb\n  } = o;\n  o.mutationCb = (...p) => {\n    if (hooks.mutation) {\n      hooks.mutation(...p);\n    }\n    mutationCb(...p);\n  };\n  o.mousemoveCb = (...p) => {\n    if (hooks.mousemove) {\n      hooks.mousemove(...p);\n    }\n    mousemoveCb(...p);\n  };\n  o.mouseInteractionCb = (...p) => {\n    if (hooks.mouseInteraction) {\n      hooks.mouseInteraction(...p);\n    }\n    mouseInteractionCb(...p);\n  };\n  o.scrollCb = (...p) => {\n    if (hooks.scroll) {\n      hooks.scroll(...p);\n    }\n    scrollCb(...p);\n  };\n  o.viewportResizeCb = (...p) => {\n    if (hooks.viewportResize) {\n      hooks.viewportResize(...p);\n    }\n    viewportResizeCb(...p);\n  };\n  o.inputCb = (...p) => {\n    if (hooks.input) {\n      hooks.input(...p);\n    }\n    inputCb(...p);\n  };\n  o.mediaInteractionCb = (...p) => {\n    if (hooks.mediaInteaction) {\n      hooks.mediaInteaction(...p);\n    }\n    mediaInteractionCb(...p);\n  };\n  o.styleSheetRuleCb = (...p) => {\n    if (hooks.styleSheetRule) {\n      hooks.styleSheetRule(...p);\n    }\n    styleSheetRuleCb(...p);\n  };\n  o.styleDeclarationCb = (...p) => {\n    if (hooks.styleDeclaration) {\n      hooks.styleDeclaration(...p);\n    }\n    styleDeclarationCb(...p);\n  };\n  o.canvasMutationCb = (...p) => {\n    if (hooks.canvasMutation) {\n      hooks.canvasMutation(...p);\n    }\n    canvasMutationCb(...p);\n  };\n  o.fontCb = (...p) => {\n    if (hooks.font) {\n      hooks.font(...p);\n    }\n    fontCb(...p);\n  };\n  o.selectionCb = (...p) => {\n    if (hooks.selection) {\n      hooks.selection(...p);\n    }\n    selectionCb(...p);\n  };\n  o.customElementCb = (...c) => {\n    if (hooks.customElement) {\n      hooks.customElement(...c);\n    }\n    customElementCb(...c);\n  };\n}\nfunction initObservers(o, hooks = {}) {\n  const currentWindow = o.doc.defaultView;\n  if (!currentWindow) {\n    return () => {\n    };\n  }\n  mergeHooks(o, hooks);\n  let mutationObserver;\n  if (o.recordDOM) {\n    mutationObserver = initMutationObserver(o, o.doc);\n  }\n  const mousemoveHandler = initMoveObserver(o);\n  const mouseInteractionHandler = initMouseInteractionObserver(o);\n  const scrollHandler = initScrollObserver(o);\n  const viewportResizeHandler = initViewportResizeObserver(o, {\n    win: currentWindow\n  });\n  const inputHandler = initInputObserver(o);\n  const mediaInteractionHandler = initMediaInteractionObserver(o);\n  let styleSheetObserver = () => {\n  };\n  let adoptedStyleSheetObserver = () => {\n  };\n  let styleDeclarationObserver = () => {\n  };\n  let fontObserver = () => {\n  };\n  if (o.recordDOM) {\n    styleSheetObserver = initStyleSheetObserver(o, { win: currentWindow });\n    adoptedStyleSheetObserver = initAdoptedStyleSheetObserver(o, o.doc);\n    styleDeclarationObserver = initStyleDeclarationObserver(o, {\n      win: currentWindow\n    });\n    if (o.collectFonts) {\n      fontObserver = initFontObserver(o);\n    }\n  }\n  const selectionObserver = initSelectionObserver(o);\n  const customElementObserver = initCustomElementObserver(o);\n  const pluginHandlers = [];\n  for (const plugin of o.plugins) {\n    pluginHandlers.push(\n      plugin.observer(plugin.callback, currentWindow, plugin.options)\n    );\n  }\n  return callbackWrapper(() => {\n    mutationBuffers.forEach((b) => b.reset());\n    mutationObserver == null ? void 0 : mutationObserver.disconnect();\n    mousemoveHandler();\n    mouseInteractionHandler();\n    scrollHandler();\n    viewportResizeHandler();\n    inputHandler();\n    mediaInteractionHandler();\n    styleSheetObserver();\n    adoptedStyleSheetObserver();\n    styleDeclarationObserver();\n    fontObserver();\n    selectionObserver();\n    customElementObserver();\n    pluginHandlers.forEach((h) => h());\n  });\n}\nfunction hasNestedCSSRule(prop) {\n  return typeof window[prop] !== \"undefined\";\n}\nfunction canMonkeyPatchNestedCSSRule(prop) {\n  return Boolean(\n    typeof window[prop] !== \"undefined\" && // Note: Generally, this check _shouldn't_ be necessary\n    // However, in some scenarios (e.g. jsdom) this can sometimes fail, so we check for it here\n    window[prop].prototype && \"insertRule\" in window[prop].prototype && \"deleteRule\" in window[prop].prototype\n  );\n}\nclass CrossOriginIframeMirror {\n  constructor(generateIdFn) {\n    __publicField(this, \"iframeIdToRemoteIdMap\", /* @__PURE__ */ new WeakMap());\n    __publicField(this, \"iframeRemoteIdToIdMap\", /* @__PURE__ */ new WeakMap());\n    this.generateIdFn = generateIdFn;\n  }\n  getId(iframe, remoteId, idToRemoteMap, remoteToIdMap) {\n    const idToRemoteIdMap = idToRemoteMap || this.getIdToRemoteIdMap(iframe);\n    const remoteIdToIdMap = remoteToIdMap || this.getRemoteIdToIdMap(iframe);\n    let id = idToRemoteIdMap.get(remoteId);\n    if (!id) {\n      id = this.generateIdFn();\n      idToRemoteIdMap.set(remoteId, id);\n      remoteIdToIdMap.set(id, remoteId);\n    }\n    return id;\n  }\n  getIds(iframe, remoteId) {\n    const idToRemoteIdMap = this.getIdToRemoteIdMap(iframe);\n    const remoteIdToIdMap = this.getRemoteIdToIdMap(iframe);\n    return remoteId.map(\n      (id) => this.getId(iframe, id, idToRemoteIdMap, remoteIdToIdMap)\n    );\n  }\n  getRemoteId(iframe, id, map) {\n    const remoteIdToIdMap = map || this.getRemoteIdToIdMap(iframe);\n    if (typeof id !== \"number\") return id;\n    const remoteId = remoteIdToIdMap.get(id);\n    if (!remoteId) return -1;\n    return remoteId;\n  }\n  getRemoteIds(iframe, ids) {\n    const remoteIdToIdMap = this.getRemoteIdToIdMap(iframe);\n    return ids.map((id) => this.getRemoteId(iframe, id, remoteIdToIdMap));\n  }\n  reset(iframe) {\n    if (!iframe) {\n      this.iframeIdToRemoteIdMap = /* @__PURE__ */ new WeakMap();\n      this.iframeRemoteIdToIdMap = /* @__PURE__ */ new WeakMap();\n      return;\n    }\n    this.iframeIdToRemoteIdMap.delete(iframe);\n    this.iframeRemoteIdToIdMap.delete(iframe);\n  }\n  getIdToRemoteIdMap(iframe) {\n    let idToRemoteIdMap = this.iframeIdToRemoteIdMap.get(iframe);\n    if (!idToRemoteIdMap) {\n      idToRemoteIdMap = /* @__PURE__ */ new Map();\n      this.iframeIdToRemoteIdMap.set(iframe, idToRemoteIdMap);\n    }\n    return idToRemoteIdMap;\n  }\n  getRemoteIdToIdMap(iframe) {\n    let remoteIdToIdMap = this.iframeRemoteIdToIdMap.get(iframe);\n    if (!remoteIdToIdMap) {\n      remoteIdToIdMap = /* @__PURE__ */ new Map();\n      this.iframeRemoteIdToIdMap.set(iframe, remoteIdToIdMap);\n    }\n    return remoteIdToIdMap;\n  }\n}\nclass IframeManager {\n  constructor(options) {\n    __publicField(this, \"iframes\", /* @__PURE__ */ new WeakMap());\n    __publicField(this, \"crossOriginIframeMap\", /* @__PURE__ */ new WeakMap());\n    __publicField(this, \"crossOriginIframeMirror\", new CrossOriginIframeMirror(genId));\n    __publicField(this, \"crossOriginIframeStyleMirror\");\n    __publicField(this, \"crossOriginIframeRootIdMap\", /* @__PURE__ */ new WeakMap());\n    __publicField(this, \"mirror\");\n    __publicField(this, \"mutationCb\");\n    __publicField(this, \"wrappedEmit\");\n    __publicField(this, \"loadListener\");\n    __publicField(this, \"stylesheetManager\");\n    __publicField(this, \"recordCrossOriginIframes\");\n    this.mutationCb = options.mutationCb;\n    this.wrappedEmit = options.wrappedEmit;\n    this.stylesheetManager = options.stylesheetManager;\n    this.recordCrossOriginIframes = options.recordCrossOriginIframes;\n    this.crossOriginIframeStyleMirror = new CrossOriginIframeMirror(\n      this.stylesheetManager.styleMirror.generateId.bind(\n        this.stylesheetManager.styleMirror\n      )\n    );\n    this.mirror = options.mirror;\n    if (this.recordCrossOriginIframes) {\n      window.addEventListener(\"message\", this.handleMessage.bind(this));\n    }\n  }\n  addIframe(iframeEl) {\n    this.iframes.set(iframeEl, true);\n    if (iframeEl.contentWindow)\n      this.crossOriginIframeMap.set(iframeEl.contentWindow, iframeEl);\n  }\n  addLoadListener(cb) {\n    this.loadListener = cb;\n  }\n  attachIframe(iframeEl, childSn) {\n    var _a2, _b;\n    this.mutationCb({\n      adds: [\n        {\n          parentId: this.mirror.getId(iframeEl),\n          nextId: null,\n          node: childSn\n        }\n      ],\n      removes: [],\n      texts: [],\n      attributes: [],\n      isAttachIframe: true\n    });\n    if (this.recordCrossOriginIframes)\n      (_a2 = iframeEl.contentWindow) == null ? void 0 : _a2.addEventListener(\n        \"message\",\n        this.handleMessage.bind(this)\n      );\n    (_b = this.loadListener) == null ? void 0 : _b.call(this, iframeEl);\n    if (iframeEl.contentDocument && iframeEl.contentDocument.adoptedStyleSheets && iframeEl.contentDocument.adoptedStyleSheets.length > 0)\n      this.stylesheetManager.adoptStyleSheets(\n        iframeEl.contentDocument.adoptedStyleSheets,\n        this.mirror.getId(iframeEl.contentDocument)\n      );\n  }\n  handleMessage(message) {\n    const crossOriginMessageEvent = message;\n    if (crossOriginMessageEvent.data.type !== \"rrweb\" || // To filter out the rrweb messages which are forwarded by some sites.\n    crossOriginMessageEvent.origin !== crossOriginMessageEvent.data.origin)\n      return;\n    const iframeSourceWindow = message.source;\n    if (!iframeSourceWindow) return;\n    const iframeEl = this.crossOriginIframeMap.get(message.source);\n    if (!iframeEl) return;\n    const transformedEvent = this.transformCrossOriginEvent(\n      iframeEl,\n      crossOriginMessageEvent.data.event\n    );\n    if (transformedEvent)\n      this.wrappedEmit(\n        transformedEvent,\n        crossOriginMessageEvent.data.isCheckout\n      );\n  }\n  transformCrossOriginEvent(iframeEl, e) {\n    var _a2;\n    switch (e.type) {\n      case EventType.FullSnapshot: {\n        this.crossOriginIframeMirror.reset(iframeEl);\n        this.crossOriginIframeStyleMirror.reset(iframeEl);\n        this.replaceIdOnNode(e.data.node, iframeEl);\n        const rootId = e.data.node.id;\n        this.crossOriginIframeRootIdMap.set(iframeEl, rootId);\n        this.patchRootIdOnNode(e.data.node, rootId);\n        return {\n          timestamp: e.timestamp,\n          type: EventType.IncrementalSnapshot,\n          data: {\n            source: IncrementalSource.Mutation,\n            adds: [\n              {\n                parentId: this.mirror.getId(iframeEl),\n                nextId: null,\n                node: e.data.node\n              }\n            ],\n            removes: [],\n            texts: [],\n            attributes: [],\n            isAttachIframe: true\n          }\n        };\n      }\n      case EventType.Meta:\n      case EventType.Load:\n      case EventType.DomContentLoaded: {\n        return false;\n      }\n      case EventType.Plugin: {\n        return e;\n      }\n      case EventType.Custom: {\n        this.replaceIds(\n          e.data.payload,\n          iframeEl,\n          [\"id\", \"parentId\", \"previousId\", \"nextId\"]\n        );\n        return e;\n      }\n      case EventType.IncrementalSnapshot: {\n        switch (e.data.source) {\n          case IncrementalSource.Mutation: {\n            e.data.adds.forEach((n) => {\n              this.replaceIds(n, iframeEl, [\n                \"parentId\",\n                \"nextId\",\n                \"previousId\"\n              ]);\n              this.replaceIdOnNode(n.node, iframeEl);\n              const rootId = this.crossOriginIframeRootIdMap.get(iframeEl);\n              rootId && this.patchRootIdOnNode(n.node, rootId);\n            });\n            e.data.removes.forEach((n) => {\n              this.replaceIds(n, iframeEl, [\"parentId\", \"id\"]);\n            });\n            e.data.attributes.forEach((n) => {\n              this.replaceIds(n, iframeEl, [\"id\"]);\n            });\n            e.data.texts.forEach((n) => {\n              this.replaceIds(n, iframeEl, [\"id\"]);\n            });\n            return e;\n          }\n          case IncrementalSource.Drag:\n          case IncrementalSource.TouchMove:\n          case IncrementalSource.MouseMove: {\n            e.data.positions.forEach((p) => {\n              this.replaceIds(p, iframeEl, [\"id\"]);\n            });\n            return e;\n          }\n          case IncrementalSource.ViewportResize: {\n            return false;\n          }\n          case IncrementalSource.MediaInteraction:\n          case IncrementalSource.MouseInteraction:\n          case IncrementalSource.Scroll:\n          case IncrementalSource.CanvasMutation:\n          case IncrementalSource.Input: {\n            this.replaceIds(e.data, iframeEl, [\"id\"]);\n            return e;\n          }\n          case IncrementalSource.StyleSheetRule:\n          case IncrementalSource.StyleDeclaration: {\n            this.replaceIds(e.data, iframeEl, [\"id\"]);\n            this.replaceStyleIds(e.data, iframeEl, [\"styleId\"]);\n            return e;\n          }\n          case IncrementalSource.Font: {\n            return e;\n          }\n          case IncrementalSource.Selection: {\n            e.data.ranges.forEach((range) => {\n              this.replaceIds(range, iframeEl, [\"start\", \"end\"]);\n            });\n            return e;\n          }\n          case IncrementalSource.AdoptedStyleSheet: {\n            this.replaceIds(e.data, iframeEl, [\"id\"]);\n            this.replaceStyleIds(e.data, iframeEl, [\"styleIds\"]);\n            (_a2 = e.data.styles) == null ? void 0 : _a2.forEach((style) => {\n              this.replaceStyleIds(style, iframeEl, [\"styleId\"]);\n            });\n            return e;\n          }\n        }\n      }\n    }\n    return false;\n  }\n  replace(iframeMirror, obj, iframeEl, keys) {\n    for (const key of keys) {\n      if (!Array.isArray(obj[key]) && typeof obj[key] !== \"number\") continue;\n      if (Array.isArray(obj[key])) {\n        obj[key] = iframeMirror.getIds(\n          iframeEl,\n          obj[key]\n        );\n      } else {\n        obj[key] = iframeMirror.getId(iframeEl, obj[key]);\n      }\n    }\n    return obj;\n  }\n  replaceIds(obj, iframeEl, keys) {\n    return this.replace(this.crossOriginIframeMirror, obj, iframeEl, keys);\n  }\n  replaceStyleIds(obj, iframeEl, keys) {\n    return this.replace(this.crossOriginIframeStyleMirror, obj, iframeEl, keys);\n  }\n  replaceIdOnNode(node, iframeEl) {\n    this.replaceIds(node, iframeEl, [\"id\", \"rootId\"]);\n    if (\"childNodes\" in node) {\n      node.childNodes.forEach((child) => {\n        this.replaceIdOnNode(child, iframeEl);\n      });\n    }\n  }\n  patchRootIdOnNode(node, rootId) {\n    if (node.type !== NodeType.Document && !node.rootId) node.rootId = rootId;\n    if (\"childNodes\" in node) {\n      node.childNodes.forEach((child) => {\n        this.patchRootIdOnNode(child, rootId);\n      });\n    }\n  }\n}\nclass ShadowDomManager {\n  constructor(options) {\n    __publicField(this, \"shadowDoms\", /* @__PURE__ */ new WeakSet());\n    __publicField(this, \"mutationCb\");\n    __publicField(this, \"scrollCb\");\n    __publicField(this, \"bypassOptions\");\n    __publicField(this, \"mirror\");\n    __publicField(this, \"restoreHandlers\", []);\n    this.mutationCb = options.mutationCb;\n    this.scrollCb = options.scrollCb;\n    this.bypassOptions = options.bypassOptions;\n    this.mirror = options.mirror;\n    this.init();\n  }\n  init() {\n    this.reset();\n    this.patchAttachShadow(Element, document);\n  }\n  addShadowRoot(shadowRoot2, doc) {\n    if (!isNativeShadowDom(shadowRoot2)) return;\n    if (this.shadowDoms.has(shadowRoot2)) return;\n    this.shadowDoms.add(shadowRoot2);\n    const observer = initMutationObserver(\n      {\n        ...this.bypassOptions,\n        doc,\n        mutationCb: this.mutationCb,\n        mirror: this.mirror,\n        shadowDomManager: this\n      },\n      shadowRoot2\n    );\n    this.restoreHandlers.push(() => observer.disconnect());\n    this.restoreHandlers.push(\n      initScrollObserver({\n        ...this.bypassOptions,\n        scrollCb: this.scrollCb,\n        // https://gist.github.com/praveenpuglia/0832da687ed5a5d7a0907046c9ef1813\n        // scroll is not allowed to pass the boundary, so we need to listen the shadow document\n        doc: shadowRoot2,\n        mirror: this.mirror\n      })\n    );\n    setTimeout(() => {\n      if (shadowRoot2.adoptedStyleSheets && shadowRoot2.adoptedStyleSheets.length > 0)\n        this.bypassOptions.stylesheetManager.adoptStyleSheets(\n          shadowRoot2.adoptedStyleSheets,\n          this.mirror.getId(index.host(shadowRoot2))\n        );\n      this.restoreHandlers.push(\n        initAdoptedStyleSheetObserver(\n          {\n            mirror: this.mirror,\n            stylesheetManager: this.bypassOptions.stylesheetManager\n          },\n          shadowRoot2\n        )\n      );\n    }, 0);\n  }\n  /**\n   * Monkey patch 'attachShadow' of an IFrameElement to observe newly added shadow doms.\n   */\n  observeAttachShadow(iframeElement) {\n    if (!iframeElement.contentWindow || !iframeElement.contentDocument) return;\n    this.patchAttachShadow(\n      iframeElement.contentWindow.Element,\n      iframeElement.contentDocument\n    );\n  }\n  /**\n   * Patch 'attachShadow' to observe newly added shadow doms.\n   */\n  patchAttachShadow(element, doc) {\n    const manager = this;\n    this.restoreHandlers.push(\n      patch(\n        element.prototype,\n        \"attachShadow\",\n        function(original) {\n          return function(option) {\n            const sRoot = original.call(this, option);\n            const shadowRootEl = index.shadowRoot(this);\n            if (shadowRootEl && inDom(this))\n              manager.addShadowRoot(shadowRootEl, doc);\n            return sRoot;\n          };\n        }\n      )\n    );\n  }\n  reset() {\n    this.restoreHandlers.forEach((handler) => {\n      try {\n        handler();\n      } catch (e) {\n      }\n    });\n    this.restoreHandlers = [];\n    this.shadowDoms = /* @__PURE__ */ new WeakSet();\n  }\n}\nvar chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\nvar lookup = typeof Uint8Array === \"undefined\" ? [] : new Uint8Array(256);\nfor (var i = 0; i < chars.length; i++) {\n  lookup[chars.charCodeAt(i)] = i;\n}\nvar encode = function(arraybuffer) {\n  var bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = \"\";\n  for (i = 0; i < len; i += 3) {\n    base64 += chars[bytes[i] >> 2];\n    base64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n    base64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n    base64 += chars[bytes[i + 2] & 63];\n  }\n  if (len % 3 === 2) {\n    base64 = base64.substring(0, base64.length - 1) + \"=\";\n  } else if (len % 3 === 1) {\n    base64 = base64.substring(0, base64.length - 2) + \"==\";\n  }\n  return base64;\n};\nconst canvasVarMap = /* @__PURE__ */ new Map();\nfunction variableListFor(ctx, ctor) {\n  let contextMap = canvasVarMap.get(ctx);\n  if (!contextMap) {\n    contextMap = /* @__PURE__ */ new Map();\n    canvasVarMap.set(ctx, contextMap);\n  }\n  if (!contextMap.has(ctor)) {\n    contextMap.set(ctor, []);\n  }\n  return contextMap.get(ctor);\n}\nconst saveWebGLVar = (value, win, ctx) => {\n  if (!value || !(isInstanceOfWebGLObject(value, win) || typeof value === \"object\"))\n    return;\n  const name = value.constructor.name;\n  const list = variableListFor(ctx, name);\n  let index2 = list.indexOf(value);\n  if (index2 === -1) {\n    index2 = list.length;\n    list.push(value);\n  }\n  return index2;\n};\nfunction serializeArg(value, win, ctx) {\n  if (value instanceof Array) {\n    return value.map((arg) => serializeArg(arg, win, ctx));\n  } else if (value === null) {\n    return value;\n  } else if (value instanceof Float32Array || value instanceof Float64Array || value instanceof Int32Array || value instanceof Uint32Array || value instanceof Uint8Array || value instanceof Uint16Array || value instanceof Int16Array || value instanceof Int8Array || value instanceof Uint8ClampedArray) {\n    const name = value.constructor.name;\n    return {\n      rr_type: name,\n      args: [Object.values(value)]\n    };\n  } else if (\n    // SharedArrayBuffer disabled on most browsers due to spectre.\n    // More info: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer/SharedArrayBuffer\n    // value instanceof SharedArrayBuffer ||\n    value instanceof ArrayBuffer\n  ) {\n    const name = value.constructor.name;\n    const base64 = encode(value);\n    return {\n      rr_type: name,\n      base64\n    };\n  } else if (value instanceof DataView) {\n    const name = value.constructor.name;\n    return {\n      rr_type: name,\n      args: [\n        serializeArg(value.buffer, win, ctx),\n        value.byteOffset,\n        value.byteLength\n      ]\n    };\n  } else if (value instanceof HTMLImageElement) {\n    const name = value.constructor.name;\n    const { src } = value;\n    return {\n      rr_type: name,\n      src\n    };\n  } else if (value instanceof HTMLCanvasElement) {\n    const name = \"HTMLImageElement\";\n    const src = value.toDataURL();\n    return {\n      rr_type: name,\n      src\n    };\n  } else if (value instanceof ImageData) {\n    const name = value.constructor.name;\n    return {\n      rr_type: name,\n      args: [serializeArg(value.data, win, ctx), value.width, value.height]\n    };\n  } else if (isInstanceOfWebGLObject(value, win) || typeof value === \"object\") {\n    const name = value.constructor.name;\n    const index2 = saveWebGLVar(value, win, ctx);\n    return {\n      rr_type: name,\n      index: index2\n    };\n  }\n  return value;\n}\nconst serializeArgs = (args, win, ctx) => {\n  return args.map((arg) => serializeArg(arg, win, ctx));\n};\nconst isInstanceOfWebGLObject = (value, win) => {\n  const webGLConstructorNames = [\n    \"WebGLActiveInfo\",\n    \"WebGLBuffer\",\n    \"WebGLFramebuffer\",\n    \"WebGLProgram\",\n    \"WebGLRenderbuffer\",\n    \"WebGLShader\",\n    \"WebGLShaderPrecisionFormat\",\n    \"WebGLTexture\",\n    \"WebGLUniformLocation\",\n    \"WebGLVertexArrayObject\",\n    // In old Chrome versions, value won't be an instanceof WebGLVertexArrayObject.\n    \"WebGLVertexArrayObjectOES\"\n  ];\n  const supportedWebGLConstructorNames = webGLConstructorNames.filter(\n    (name) => typeof win[name] === \"function\"\n  );\n  return Boolean(\n    supportedWebGLConstructorNames.find(\n      (name) => value instanceof win[name]\n    )\n  );\n};\nfunction initCanvas2DMutationObserver(cb, win, blockClass, blockSelector) {\n  const handlers = [];\n  const props2D = Object.getOwnPropertyNames(\n    win.CanvasRenderingContext2D.prototype\n  );\n  for (const prop of props2D) {\n    try {\n      if (typeof win.CanvasRenderingContext2D.prototype[prop] !== \"function\") {\n        continue;\n      }\n      const restoreHandler = patch(\n        win.CanvasRenderingContext2D.prototype,\n        prop,\n        function(original) {\n          return function(...args) {\n            if (!isBlocked(this.canvas, blockClass, blockSelector, true)) {\n              setTimeout(() => {\n                const recordArgs = serializeArgs(args, win, this);\n                cb(this.canvas, {\n                  type: CanvasContext[\"2D\"],\n                  property: prop,\n                  args: recordArgs\n                });\n              }, 0);\n            }\n            return original.apply(this, args);\n          };\n        }\n      );\n      handlers.push(restoreHandler);\n    } catch {\n      const hookHandler = hookSetter(\n        win.CanvasRenderingContext2D.prototype,\n        prop,\n        {\n          set(v) {\n            cb(this.canvas, {\n              type: CanvasContext[\"2D\"],\n              property: prop,\n              args: [v],\n              setter: true\n            });\n          }\n        }\n      );\n      handlers.push(hookHandler);\n    }\n  }\n  return () => {\n    handlers.forEach((h) => h());\n  };\n}\nfunction getNormalizedContextName(contextType) {\n  return contextType === \"experimental-webgl\" ? \"webgl\" : contextType;\n}\nfunction initCanvasContextObserver(win, blockClass, blockSelector, setPreserveDrawingBufferToTrue) {\n  const handlers = [];\n  try {\n    const restoreHandler = patch(\n      win.HTMLCanvasElement.prototype,\n      \"getContext\",\n      function(original) {\n        return function(contextType, ...args) {\n          if (!isBlocked(this, blockClass, blockSelector, true)) {\n            const ctxName = getNormalizedContextName(contextType);\n            if (!(\"__context\" in this)) this.__context = ctxName;\n            if (setPreserveDrawingBufferToTrue && [\"webgl\", \"webgl2\"].includes(ctxName)) {\n              if (args[0] && typeof args[0] === \"object\") {\n                const contextAttributes = args[0];\n                if (!contextAttributes.preserveDrawingBuffer) {\n                  contextAttributes.preserveDrawingBuffer = true;\n                }\n              } else {\n                args.splice(0, 1, {\n                  preserveDrawingBuffer: true\n                });\n              }\n            }\n          }\n          return original.apply(this, [contextType, ...args]);\n        };\n      }\n    );\n    handlers.push(restoreHandler);\n  } catch {\n    console.error(\"failed to patch HTMLCanvasElement.prototype.getContext\");\n  }\n  return () => {\n    handlers.forEach((h) => h());\n  };\n}\nfunction patchGLPrototype(prototype, type, cb, blockClass, blockSelector, win) {\n  const handlers = [];\n  const props = Object.getOwnPropertyNames(prototype);\n  for (const prop of props) {\n    if (\n      //prop.startsWith('get') ||  // e.g. getProgramParameter, but too risky\n      [\n        \"isContextLost\",\n        \"canvas\",\n        \"drawingBufferWidth\",\n        \"drawingBufferHeight\"\n      ].includes(prop)\n    ) {\n      continue;\n    }\n    try {\n      if (typeof prototype[prop] !== \"function\") {\n        continue;\n      }\n      const restoreHandler = patch(\n        prototype,\n        prop,\n        function(original) {\n          return function(...args) {\n            const result = original.apply(this, args);\n            saveWebGLVar(result, win, this);\n            if (\"tagName\" in this.canvas && !isBlocked(this.canvas, blockClass, blockSelector, true)) {\n              const recordArgs = serializeArgs(args, win, this);\n              const mutation = {\n                type,\n                property: prop,\n                args: recordArgs\n              };\n              cb(this.canvas, mutation);\n            }\n            return result;\n          };\n        }\n      );\n      handlers.push(restoreHandler);\n    } catch {\n      const hookHandler = hookSetter(prototype, prop, {\n        set(v) {\n          cb(this.canvas, {\n            type,\n            property: prop,\n            args: [v],\n            setter: true\n          });\n        }\n      });\n      handlers.push(hookHandler);\n    }\n  }\n  return handlers;\n}\nfunction initCanvasWebGLMutationObserver(cb, win, blockClass, blockSelector) {\n  const handlers = [];\n  if (typeof win.WebGLRenderingContext !== \"undefined\") {\n    handlers.push(\n      ...patchGLPrototype(\n        win.WebGLRenderingContext.prototype,\n        CanvasContext.WebGL,\n        cb,\n        blockClass,\n        blockSelector,\n        win\n      )\n    );\n  }\n  if (typeof win.WebGL2RenderingContext !== \"undefined\") {\n    handlers.push(\n      ...patchGLPrototype(\n        win.WebGL2RenderingContext.prototype,\n        CanvasContext.WebGL2,\n        cb,\n        blockClass,\n        blockSelector,\n        win\n      )\n    );\n  }\n  return () => {\n    handlers.forEach((h) => h());\n  };\n}\nconst jsContent = '(function() {\\n  \"use strict\";\\n  var chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\\n  var lookup = typeof Uint8Array === \"undefined\" ? [] : new Uint8Array(256);\\n  for (var i = 0; i < chars.length; i++) {\\n    lookup[chars.charCodeAt(i)] = i;\\n  }\\n  var encode = function(arraybuffer) {\\n    var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = \"\";\\n    for (i2 = 0; i2 < len; i2 += 3) {\\n      base64 += chars[bytes[i2] >> 2];\\n      base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\\n      base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\\n      base64 += chars[bytes[i2 + 2] & 63];\\n    }\\n    if (len % 3 === 2) {\\n      base64 = base64.substring(0, base64.length - 1) + \"=\";\\n    } else if (len % 3 === 1) {\\n      base64 = base64.substring(0, base64.length - 2) + \"==\";\\n    }\\n    return base64;\\n  };\\n  const lastBlobMap = /* @__PURE__ */ new Map();\\n  const transparentBlobMap = /* @__PURE__ */ new Map();\\n  async function getTransparentBlobFor(width, height, dataURLOptions) {\\n    const id = `${width}-${height}`;\\n    if (\"OffscreenCanvas\" in globalThis) {\\n      if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\\n      const offscreen = new OffscreenCanvas(width, height);\\n      offscreen.getContext(\"2d\");\\n      const blob = await offscreen.convertToBlob(dataURLOptions);\\n      const arrayBuffer = await blob.arrayBuffer();\\n      const base64 = encode(arrayBuffer);\\n      transparentBlobMap.set(id, base64);\\n      return base64;\\n    } else {\\n      return \"\";\\n    }\\n  }\\n  const worker = self;\\n  worker.onmessage = async function(e) {\\n    if (\"OffscreenCanvas\" in globalThis) {\\n      const { id, bitmap, width, height, dataURLOptions } = e.data;\\n      const transparentBase64 = getTransparentBlobFor(\\n        width,\\n        height,\\n        dataURLOptions\\n      );\\n      const offscreen = new OffscreenCanvas(width, height);\\n      const ctx = offscreen.getContext(\"2d\");\\n      ctx.drawImage(bitmap, 0, 0);\\n      bitmap.close();\\n      const blob = await offscreen.convertToBlob(dataURLOptions);\\n      const type = blob.type;\\n      const arrayBuffer = await blob.arrayBuffer();\\n      const base64 = encode(arrayBuffer);\\n      if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\\n        lastBlobMap.set(id, base64);\\n        return worker.postMessage({ id });\\n      }\\n      if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\\n      worker.postMessage({\\n        id,\\n        type,\\n        base64,\\n        width,\\n        height\\n      });\\n      lastBlobMap.set(id, base64);\\n    } else {\\n      return worker.postMessage({ id: e.data.id });\\n    }\\n  };\\n})();\\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\\n';\nconst blob = typeof self !== \"undefined\" && self.Blob && new Blob([jsContent], { type: \"text/javascript;charset=utf-8\" });\nfunction WorkerWrapper(options) {\n  let objURL;\n  try {\n    objURL = blob && (self.URL || self.webkitURL).createObjectURL(blob);\n    if (!objURL) throw \"\";\n    const worker = new Worker(objURL, {\n      name: options == null ? void 0 : options.name\n    });\n    worker.addEventListener(\"error\", () => {\n      (self.URL || self.webkitURL).revokeObjectURL(objURL);\n    });\n    return worker;\n  } catch (e) {\n    return new Worker(\n      \"data:text/javascript;charset=utf-8,\" + encodeURIComponent(jsContent),\n      {\n        name: options == null ? void 0 : options.name\n      }\n    );\n  } finally {\n    objURL && (self.URL || self.webkitURL).revokeObjectURL(objURL);\n  }\n}\nclass CanvasManager {\n  constructor(options) {\n    __publicField(this, \"pendingCanvasMutations\", /* @__PURE__ */ new Map());\n    __publicField(this, \"rafStamps\", { latestId: 0, invokeId: null });\n    __publicField(this, \"mirror\");\n    __publicField(this, \"mutationCb\");\n    __publicField(this, \"resetObservers\");\n    __publicField(this, \"frozen\", false);\n    __publicField(this, \"locked\", false);\n    __publicField(this, \"processMutation\", (target, mutation) => {\n      const newFrame = this.rafStamps.invokeId && this.rafStamps.latestId !== this.rafStamps.invokeId;\n      if (newFrame || !this.rafStamps.invokeId)\n        this.rafStamps.invokeId = this.rafStamps.latestId;\n      if (!this.pendingCanvasMutations.has(target)) {\n        this.pendingCanvasMutations.set(target, []);\n      }\n      this.pendingCanvasMutations.get(target).push(mutation);\n    });\n    const {\n      sampling = \"all\",\n      win,\n      blockClass,\n      blockSelector,\n      recordCanvas,\n      dataURLOptions\n    } = options;\n    this.mutationCb = options.mutationCb;\n    this.mirror = options.mirror;\n    if (recordCanvas && sampling === \"all\")\n      this.initCanvasMutationObserver(win, blockClass, blockSelector);\n    if (recordCanvas && typeof sampling === \"number\")\n      this.initCanvasFPSObserver(sampling, win, blockClass, blockSelector, {\n        dataURLOptions\n      });\n  }\n  reset() {\n    this.pendingCanvasMutations.clear();\n    this.resetObservers && this.resetObservers();\n  }\n  freeze() {\n    this.frozen = true;\n  }\n  unfreeze() {\n    this.frozen = false;\n  }\n  lock() {\n    this.locked = true;\n  }\n  unlock() {\n    this.locked = false;\n  }\n  initCanvasFPSObserver(fps, win, blockClass, blockSelector, options) {\n    const canvasContextReset = initCanvasContextObserver(\n      win,\n      blockClass,\n      blockSelector,\n      true\n    );\n    const snapshotInProgressMap = /* @__PURE__ */ new Map();\n    const worker = new WorkerWrapper();\n    worker.onmessage = (e) => {\n      const { id } = e.data;\n      snapshotInProgressMap.set(id, false);\n      if (!(\"base64\" in e.data)) return;\n      const { base64, type, width, height } = e.data;\n      this.mutationCb({\n        id,\n        type: CanvasContext[\"2D\"],\n        commands: [\n          {\n            property: \"clearRect\",\n            // wipe canvas\n            args: [0, 0, width, height]\n          },\n          {\n            property: \"drawImage\",\n            // draws (semi-transparent) image\n            args: [\n              {\n                rr_type: \"ImageBitmap\",\n                args: [\n                  {\n                    rr_type: \"Blob\",\n                    data: [{ rr_type: \"ArrayBuffer\", base64 }],\n                    type\n                  }\n                ]\n              },\n              0,\n              0\n            ]\n          }\n        ]\n      });\n    };\n    const timeBetweenSnapshots = 1e3 / fps;\n    let lastSnapshotTime = 0;\n    let rafId;\n    const getCanvas = () => {\n      const matchedCanvas = [];\n      win.document.querySelectorAll(\"canvas\").forEach((canvas) => {\n        if (!isBlocked(canvas, blockClass, blockSelector, true)) {\n          matchedCanvas.push(canvas);\n        }\n      });\n      return matchedCanvas;\n    };\n    const takeCanvasSnapshots = (timestamp) => {\n      if (lastSnapshotTime && timestamp - lastSnapshotTime < timeBetweenSnapshots) {\n        rafId = requestAnimationFrame(takeCanvasSnapshots);\n        return;\n      }\n      lastSnapshotTime = timestamp;\n      getCanvas().forEach(async (canvas) => {\n        var _a2;\n        const id = this.mirror.getId(canvas);\n        if (snapshotInProgressMap.get(id)) return;\n        if (canvas.width === 0 || canvas.height === 0) return;\n        snapshotInProgressMap.set(id, true);\n        if ([\"webgl\", \"webgl2\"].includes(canvas.__context)) {\n          const context = canvas.getContext(canvas.__context);\n          if (((_a2 = context == null ? void 0 : context.getContextAttributes()) == null ? void 0 : _a2.preserveDrawingBuffer) === false) {\n            context.clear(context.COLOR_BUFFER_BIT);\n          }\n        }\n        const bitmap = await createImageBitmap(canvas);\n        worker.postMessage(\n          {\n            id,\n            bitmap,\n            width: canvas.width,\n            height: canvas.height,\n            dataURLOptions: options.dataURLOptions\n          },\n          [bitmap]\n        );\n      });\n      rafId = requestAnimationFrame(takeCanvasSnapshots);\n    };\n    rafId = requestAnimationFrame(takeCanvasSnapshots);\n    this.resetObservers = () => {\n      canvasContextReset();\n      cancelAnimationFrame(rafId);\n    };\n  }\n  initCanvasMutationObserver(win, blockClass, blockSelector) {\n    this.startRAFTimestamping();\n    this.startPendingCanvasMutationFlusher();\n    const canvasContextReset = initCanvasContextObserver(\n      win,\n      blockClass,\n      blockSelector,\n      false\n    );\n    const canvas2DReset = initCanvas2DMutationObserver(\n      this.processMutation.bind(this),\n      win,\n      blockClass,\n      blockSelector\n    );\n    const canvasWebGL1and2Reset = initCanvasWebGLMutationObserver(\n      this.processMutation.bind(this),\n      win,\n      blockClass,\n      blockSelector\n    );\n    this.resetObservers = () => {\n      canvasContextReset();\n      canvas2DReset();\n      canvasWebGL1and2Reset();\n    };\n  }\n  startPendingCanvasMutationFlusher() {\n    requestAnimationFrame(() => this.flushPendingCanvasMutations());\n  }\n  startRAFTimestamping() {\n    const setLatestRAFTimestamp = (timestamp) => {\n      this.rafStamps.latestId = timestamp;\n      requestAnimationFrame(setLatestRAFTimestamp);\n    };\n    requestAnimationFrame(setLatestRAFTimestamp);\n  }\n  flushPendingCanvasMutations() {\n    this.pendingCanvasMutations.forEach(\n      (_values, canvas) => {\n        const id = this.mirror.getId(canvas);\n        this.flushPendingCanvasMutationFor(canvas, id);\n      }\n    );\n    requestAnimationFrame(() => this.flushPendingCanvasMutations());\n  }\n  flushPendingCanvasMutationFor(canvas, id) {\n    if (this.frozen || this.locked) {\n      return;\n    }\n    const valuesWithType = this.pendingCanvasMutations.get(canvas);\n    if (!valuesWithType || id === -1) return;\n    const values = valuesWithType.map((value) => {\n      const { type: type2, ...rest } = value;\n      return rest;\n    });\n    const { type } = valuesWithType[0];\n    this.mutationCb({ id, type, commands: values });\n    this.pendingCanvasMutations.delete(canvas);\n  }\n}\nclass StylesheetManager {\n  constructor(options) {\n    __publicField(this, \"trackedLinkElements\", /* @__PURE__ */ new WeakSet());\n    __publicField(this, \"mutationCb\");\n    __publicField(this, \"adoptedStyleSheetCb\");\n    __publicField(this, \"styleMirror\", new StyleSheetMirror());\n    this.mutationCb = options.mutationCb;\n    this.adoptedStyleSheetCb = options.adoptedStyleSheetCb;\n  }\n  attachLinkElement(linkEl, childSn) {\n    if (\"_cssText\" in childSn.attributes)\n      this.mutationCb({\n        adds: [],\n        removes: [],\n        texts: [],\n        attributes: [\n          {\n            id: childSn.id,\n            attributes: childSn.attributes\n          }\n        ]\n      });\n    this.trackLinkElement(linkEl);\n  }\n  trackLinkElement(linkEl) {\n    if (this.trackedLinkElements.has(linkEl)) return;\n    this.trackedLinkElements.add(linkEl);\n    this.trackStylesheetInLinkElement(linkEl);\n  }\n  adoptStyleSheets(sheets, hostId) {\n    if (sheets.length === 0) return;\n    const adoptedStyleSheetData = {\n      id: hostId,\n      styleIds: []\n    };\n    const styles = [];\n    for (const sheet of sheets) {\n      let styleId;\n      if (!this.styleMirror.has(sheet)) {\n        styleId = this.styleMirror.add(sheet);\n        styles.push({\n          styleId,\n          rules: Array.from(sheet.rules || CSSRule, (r, index2) => ({\n            rule: stringifyRule(r, sheet.href),\n            index: index2\n          }))\n        });\n      } else styleId = this.styleMirror.getId(sheet);\n      adoptedStyleSheetData.styleIds.push(styleId);\n    }\n    if (styles.length > 0) adoptedStyleSheetData.styles = styles;\n    this.adoptedStyleSheetCb(adoptedStyleSheetData);\n  }\n  reset() {\n    this.styleMirror.reset();\n    this.trackedLinkElements = /* @__PURE__ */ new WeakSet();\n  }\n  // TODO: take snapshot on stylesheet reload by applying event listener\n  trackStylesheetInLinkElement(_linkEl) {\n  }\n}\nclass ProcessedNodeManager {\n  constructor() {\n    __publicField(this, \"nodeMap\", /* @__PURE__ */ new WeakMap());\n    __publicField(this, \"active\", false);\n  }\n  inOtherBuffer(node, thisBuffer) {\n    const buffers = this.nodeMap.get(node);\n    return buffers && Array.from(buffers).some((buffer) => buffer !== thisBuffer);\n  }\n  add(node, buffer) {\n    if (!this.active) {\n      this.active = true;\n      requestAnimationFrame(() => {\n        this.nodeMap = /* @__PURE__ */ new WeakMap();\n        this.active = false;\n      });\n    }\n    this.nodeMap.set(node, (this.nodeMap.get(node) || /* @__PURE__ */ new Set()).add(buffer));\n  }\n  destroy() {\n  }\n}\nlet wrappedEmit;\nlet takeFullSnapshot;\nlet canvasManager;\nlet recording = false;\ntry {\n  if (Array.from([1], (x) => x * 2)[0] !== 2) {\n    const cleanFrame = document.createElement(\"iframe\");\n    document.body.appendChild(cleanFrame);\n    Array.from = ((_a = cleanFrame.contentWindow) == null ? void 0 : _a.Array.from) || Array.from;\n    document.body.removeChild(cleanFrame);\n  }\n} catch (err) {\n  console.debug(\"Unable to override Array.from\", err);\n}\nconst mirror = createMirror();\nfunction record(options = {}) {\n  const {\n    emit,\n    checkoutEveryNms,\n    checkoutEveryNth,\n    blockClass = \"rr-block\",\n    blockSelector = null,\n    ignoreClass = \"rr-ignore\",\n    ignoreSelector = null,\n    maskTextClass = \"rr-mask\",\n    maskTextSelector = null,\n    inlineStylesheet = true,\n    maskAllInputs,\n    maskInputOptions: _maskInputOptions,\n    slimDOMOptions: _slimDOMOptions,\n    maskInputFn,\n    maskTextFn,\n    hooks,\n    packFn,\n    sampling = {},\n    dataURLOptions = {},\n    mousemoveWait,\n    recordDOM = true,\n    recordCanvas = false,\n    recordCrossOriginIframes = false,\n    recordAfter = options.recordAfter === \"DOMContentLoaded\" ? options.recordAfter : \"load\",\n    userTriggeredOnInput = false,\n    collectFonts = false,\n    inlineImages = false,\n    plugins,\n    keepIframeSrcFn = () => false,\n    ignoreCSSAttributes = /* @__PURE__ */ new Set([]),\n    errorHandler: errorHandler2\n  } = options;\n  registerErrorHandler(errorHandler2);\n  const inEmittingFrame = recordCrossOriginIframes ? window.parent === window : true;\n  let passEmitsToParent = false;\n  if (!inEmittingFrame) {\n    try {\n      if (window.parent.document) {\n        passEmitsToParent = false;\n      }\n    } catch (e) {\n      passEmitsToParent = true;\n    }\n  }\n  if (inEmittingFrame && !emit) {\n    throw new Error(\"emit function is required\");\n  }\n  if (!inEmittingFrame && !passEmitsToParent) {\n    return () => {\n    };\n  }\n  if (mousemoveWait !== void 0 && sampling.mousemove === void 0) {\n    sampling.mousemove = mousemoveWait;\n  }\n  mirror.reset();\n  const maskInputOptions = maskAllInputs === true ? {\n    color: true,\n    date: true,\n    \"datetime-local\": true,\n    email: true,\n    month: true,\n    number: true,\n    range: true,\n    search: true,\n    tel: true,\n    text: true,\n    time: true,\n    url: true,\n    week: true,\n    textarea: true,\n    select: true,\n    password: true\n  } : _maskInputOptions !== void 0 ? _maskInputOptions : { password: true };\n  const slimDOMOptions = slimDOMDefaults(_slimDOMOptions);\n  polyfill();\n  let lastFullSnapshotEvent;\n  let incrementalSnapshotCount = 0;\n  const eventProcessor = (e) => {\n    for (const plugin of plugins || []) {\n      if (plugin.eventProcessor) {\n        e = plugin.eventProcessor(e);\n      }\n    }\n    if (packFn && // Disable packing events which will be emitted to parent frames.\n    !passEmitsToParent) {\n      e = packFn(e);\n    }\n    return e;\n  };\n  wrappedEmit = (r, isCheckout) => {\n    var _a2;\n    const e = r;\n    e.timestamp = nowTimestamp();\n    if (((_a2 = mutationBuffers[0]) == null ? void 0 : _a2.isFrozen()) && e.type !== EventType.FullSnapshot && !(e.type === EventType.IncrementalSnapshot && e.data.source === IncrementalSource.Mutation)) {\n      mutationBuffers.forEach((buf) => buf.unfreeze());\n    }\n    if (inEmittingFrame) {\n      emit == null ? void 0 : emit(eventProcessor(e), isCheckout);\n    } else if (passEmitsToParent) {\n      const message = {\n        type: \"rrweb\",\n        event: eventProcessor(e),\n        origin: window.location.origin,\n        isCheckout\n      };\n      window.parent.postMessage(message, \"*\");\n    }\n    if (e.type === EventType.FullSnapshot) {\n      lastFullSnapshotEvent = e;\n      incrementalSnapshotCount = 0;\n    } else if (e.type === EventType.IncrementalSnapshot) {\n      if (e.data.source === IncrementalSource.Mutation && e.data.isAttachIframe) {\n        return;\n      }\n      incrementalSnapshotCount++;\n      const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;\n      const exceedTime = checkoutEveryNms && e.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;\n      if (exceedCount || exceedTime) {\n        takeFullSnapshot(true);\n      }\n    }\n  };\n  const wrappedMutationEmit = (m) => {\n    wrappedEmit({\n      type: EventType.IncrementalSnapshot,\n      data: {\n        source: IncrementalSource.Mutation,\n        ...m\n      }\n    });\n  };\n  const wrappedScrollEmit = (p) => wrappedEmit({\n    type: EventType.IncrementalSnapshot,\n    data: {\n      source: IncrementalSource.Scroll,\n      ...p\n    }\n  });\n  const wrappedCanvasMutationEmit = (p) => wrappedEmit({\n    type: EventType.IncrementalSnapshot,\n    data: {\n      source: IncrementalSource.CanvasMutation,\n      ...p\n    }\n  });\n  const wrappedAdoptedStyleSheetEmit = (a) => wrappedEmit({\n    type: EventType.IncrementalSnapshot,\n    data: {\n      source: IncrementalSource.AdoptedStyleSheet,\n      ...a\n    }\n  });\n  const stylesheetManager = new StylesheetManager({\n    mutationCb: wrappedMutationEmit,\n    adoptedStyleSheetCb: wrappedAdoptedStyleSheetEmit\n  });\n  const iframeManager = new IframeManager({\n    mirror,\n    mutationCb: wrappedMutationEmit,\n    stylesheetManager,\n    recordCrossOriginIframes,\n    wrappedEmit\n  });\n  for (const plugin of plugins || []) {\n    if (plugin.getMirror)\n      plugin.getMirror({\n        nodeMirror: mirror,\n        crossOriginIframeMirror: iframeManager.crossOriginIframeMirror,\n        crossOriginIframeStyleMirror: iframeManager.crossOriginIframeStyleMirror\n      });\n  }\n  const processedNodeManager = new ProcessedNodeManager();\n  canvasManager = new CanvasManager({\n    recordCanvas,\n    mutationCb: wrappedCanvasMutationEmit,\n    win: window,\n    blockClass,\n    blockSelector,\n    mirror,\n    sampling: sampling.canvas,\n    dataURLOptions\n  });\n  const shadowDomManager = new ShadowDomManager({\n    mutationCb: wrappedMutationEmit,\n    scrollCb: wrappedScrollEmit,\n    bypassOptions: {\n      blockClass,\n      blockSelector,\n      maskTextClass,\n      maskTextSelector,\n      inlineStylesheet,\n      maskInputOptions,\n      dataURLOptions,\n      maskTextFn,\n      maskInputFn,\n      recordCanvas,\n      inlineImages,\n      sampling,\n      slimDOMOptions,\n      iframeManager,\n      stylesheetManager,\n      canvasManager,\n      keepIframeSrcFn,\n      processedNodeManager\n    },\n    mirror\n  });\n  takeFullSnapshot = (isCheckout = false) => {\n    if (!recordDOM) {\n      return;\n    }\n    wrappedEmit(\n      {\n        type: EventType.Meta,\n        data: {\n          href: window.location.href,\n          width: getWindowWidth(),\n          height: getWindowHeight()\n        }\n      },\n      isCheckout\n    );\n    stylesheetManager.reset();\n    shadowDomManager.init();\n    mutationBuffers.forEach((buf) => buf.lock());\n    const node = snapshot(document, {\n      mirror,\n      blockClass,\n      blockSelector,\n      maskTextClass,\n      maskTextSelector,\n      inlineStylesheet,\n      maskAllInputs: maskInputOptions,\n      maskTextFn,\n      maskInputFn,\n      slimDOM: slimDOMOptions,\n      dataURLOptions,\n      recordCanvas,\n      inlineImages,\n      onSerialize: (n) => {\n        if (isSerializedIframe(n, mirror)) {\n          iframeManager.addIframe(n);\n        }\n        if (isSerializedStylesheet(n, mirror)) {\n          stylesheetManager.trackLinkElement(n);\n        }\n        if (hasShadowRoot(n)) {\n          shadowDomManager.addShadowRoot(index.shadowRoot(n), document);\n        }\n      },\n      onIframeLoad: (iframe, childSn) => {\n        iframeManager.attachIframe(iframe, childSn);\n        shadowDomManager.observeAttachShadow(iframe);\n      },\n      onStylesheetLoad: (linkEl, childSn) => {\n        stylesheetManager.attachLinkElement(linkEl, childSn);\n      },\n      keepIframeSrcFn\n    });\n    if (!node) {\n      return console.warn(\"Failed to snapshot the document\");\n    }\n    wrappedEmit(\n      {\n        type: EventType.FullSnapshot,\n        data: {\n          node,\n          initialOffset: getWindowScroll(window)\n        }\n      },\n      isCheckout\n    );\n    mutationBuffers.forEach((buf) => buf.unlock());\n    if (document.adoptedStyleSheets && document.adoptedStyleSheets.length > 0)\n      stylesheetManager.adoptStyleSheets(\n        document.adoptedStyleSheets,\n        mirror.getId(document)\n      );\n  };\n  try {\n    const handlers = [];\n    const observe = (doc) => {\n      var _a2;\n      return callbackWrapper(initObservers)(\n        {\n          mutationCb: wrappedMutationEmit,\n          mousemoveCb: (positions, source) => wrappedEmit({\n            type: EventType.IncrementalSnapshot,\n            data: {\n              source,\n              positions\n            }\n          }),\n          mouseInteractionCb: (d) => wrappedEmit({\n            type: EventType.IncrementalSnapshot,\n            data: {\n              source: IncrementalSource.MouseInteraction,\n              ...d\n            }\n          }),\n          scrollCb: wrappedScrollEmit,\n          viewportResizeCb: (d) => wrappedEmit({\n            type: EventType.IncrementalSnapshot,\n            data: {\n              source: IncrementalSource.ViewportResize,\n              ...d\n            }\n          }),\n          inputCb: (v) => wrappedEmit({\n            type: EventType.IncrementalSnapshot,\n            data: {\n              source: IncrementalSource.Input,\n              ...v\n            }\n          }),\n          mediaInteractionCb: (p) => wrappedEmit({\n            type: EventType.IncrementalSnapshot,\n            data: {\n              source: IncrementalSource.MediaInteraction,\n              ...p\n            }\n          }),\n          styleSheetRuleCb: (r) => wrappedEmit({\n            type: EventType.IncrementalSnapshot,\n            data: {\n              source: IncrementalSource.StyleSheetRule,\n              ...r\n            }\n          }),\n          styleDeclarationCb: (r) => wrappedEmit({\n            type: EventType.IncrementalSnapshot,\n            data: {\n              source: IncrementalSource.StyleDeclaration,\n              ...r\n            }\n          }),\n          canvasMutationCb: wrappedCanvasMutationEmit,\n          fontCb: (p) => wrappedEmit({\n            type: EventType.IncrementalSnapshot,\n            data: {\n              source: IncrementalSource.Font,\n              ...p\n            }\n          }),\n          selectionCb: (p) => {\n            wrappedEmit({\n              type: EventType.IncrementalSnapshot,\n              data: {\n                source: IncrementalSource.Selection,\n                ...p\n              }\n            });\n          },\n          customElementCb: (c) => {\n            wrappedEmit({\n              type: EventType.IncrementalSnapshot,\n              data: {\n                source: IncrementalSource.CustomElement,\n                ...c\n              }\n            });\n          },\n          blockClass,\n          ignoreClass,\n          ignoreSelector,\n          maskTextClass,\n          maskTextSelector,\n          maskInputOptions,\n          inlineStylesheet,\n          sampling,\n          recordDOM,\n          recordCanvas,\n          inlineImages,\n          userTriggeredOnInput,\n          collectFonts,\n          doc,\n          maskInputFn,\n          maskTextFn,\n          keepIframeSrcFn,\n          blockSelector,\n          slimDOMOptions,\n          dataURLOptions,\n          mirror,\n          iframeManager,\n          stylesheetManager,\n          shadowDomManager,\n          processedNodeManager,\n          canvasManager,\n          ignoreCSSAttributes,\n          plugins: ((_a2 = plugins == null ? void 0 : plugins.filter((p) => p.observer)) == null ? void 0 : _a2.map((p) => ({\n            observer: p.observer,\n            options: p.options,\n            callback: (payload) => wrappedEmit({\n              type: EventType.Plugin,\n              data: {\n                plugin: p.name,\n                payload\n              }\n            })\n          }))) || []\n        },\n        hooks\n      );\n    };\n    iframeManager.addLoadListener((iframeEl) => {\n      try {\n        handlers.push(observe(iframeEl.contentDocument));\n      } catch (error) {\n        console.warn(error);\n      }\n    });\n    const init = () => {\n      takeFullSnapshot();\n      handlers.push(observe(document));\n      recording = true;\n    };\n    if ([\"interactive\", \"complete\"].includes(document.readyState)) {\n      init();\n    } else {\n      handlers.push(\n        on(\"DOMContentLoaded\", () => {\n          wrappedEmit({\n            type: EventType.DomContentLoaded,\n            data: {}\n          });\n          if (recordAfter === \"DOMContentLoaded\") init();\n        })\n      );\n      handlers.push(\n        on(\n          \"load\",\n          () => {\n            wrappedEmit({\n              type: EventType.Load,\n              data: {}\n            });\n            if (recordAfter === \"load\") init();\n          },\n          window\n        )\n      );\n    }\n    return () => {\n      handlers.forEach((handler) => {\n        try {\n          handler();\n        } catch (error) {\n          const msg = String(error).toLowerCase();\n          if (!msg.includes(\"cross-origin\")) {\n            console.warn(error);\n          }\n        }\n      });\n      processedNodeManager.destroy();\n      recording = false;\n      unregisterErrorHandler();\n    };\n  } catch (error) {\n    console.warn(error);\n  }\n}\nrecord.addCustomEvent = (tag, payload) => {\n  if (!recording) {\n    throw new Error(\"please add custom event after start recording\");\n  }\n  wrappedEmit({\n    type: EventType.Custom,\n    data: {\n      tag,\n      payload\n    }\n  });\n};\nrecord.freezePage = () => {\n  mutationBuffers.forEach((buf) => buf.freeze());\n};\nrecord.takeFullSnapshot = (isCheckout) => {\n  if (!recording) {\n    throw new Error(\"please take full snapshot after start recording\");\n  }\n  takeFullSnapshot(isCheckout);\n};\nrecord.mirror = mirror;\nexport {\n  record\n};\n//# sourceMappingURL=record.js.map\n", "var EventType = /* @__PURE__ */ ((EventType2) => {\n  EventType2[EventType2[\"DomContentLoaded\"] = 0] = \"DomContentLoaded\";\n  EventType2[EventType2[\"Load\"] = 1] = \"Load\";\n  EventType2[EventType2[\"FullSnapshot\"] = 2] = \"FullSnapshot\";\n  EventType2[EventType2[\"IncrementalSnapshot\"] = 3] = \"IncrementalSnapshot\";\n  EventType2[EventType2[\"Meta\"] = 4] = \"Meta\";\n  EventType2[EventType2[\"Custom\"] = 5] = \"Custom\";\n  EventType2[EventType2[\"Plugin\"] = 6] = \"Plugin\";\n  EventType2[EventType2[\"Asset\"] = 7] = \"Asset\";\n  return EventType2;\n})(EventType || {});\nvar IncrementalSource = /* @__PURE__ */ ((IncrementalSource2) => {\n  IncrementalSource2[IncrementalSource2[\"Mutation\"] = 0] = \"Mutation\";\n  IncrementalSource2[IncrementalSource2[\"MouseMove\"] = 1] = \"MouseMove\";\n  IncrementalSource2[IncrementalSource2[\"MouseInteraction\"] = 2] = \"MouseInteraction\";\n  IncrementalSource2[IncrementalSource2[\"Scroll\"] = 3] = \"Scroll\";\n  IncrementalSource2[IncrementalSource2[\"ViewportResize\"] = 4] = \"ViewportResize\";\n  IncrementalSource2[IncrementalSource2[\"Input\"] = 5] = \"Input\";\n  IncrementalSource2[IncrementalSource2[\"TouchMove\"] = 6] = \"TouchMove\";\n  IncrementalSource2[IncrementalSource2[\"MediaInteraction\"] = 7] = \"MediaInteraction\";\n  IncrementalSource2[IncrementalSource2[\"StyleSheetRule\"] = 8] = \"StyleSheetRule\";\n  IncrementalSource2[IncrementalSource2[\"CanvasMutation\"] = 9] = \"CanvasMutation\";\n  IncrementalSource2[IncrementalSource2[\"Font\"] = 10] = \"Font\";\n  IncrementalSource2[IncrementalSource2[\"Log\"] = 11] = \"Log\";\n  IncrementalSource2[IncrementalSource2[\"Drag\"] = 12] = \"Drag\";\n  IncrementalSource2[IncrementalSource2[\"StyleDeclaration\"] = 13] = \"StyleDeclaration\";\n  IncrementalSource2[IncrementalSource2[\"Selection\"] = 14] = \"Selection\";\n  IncrementalSource2[IncrementalSource2[\"AdoptedStyleSheet\"] = 15] = \"AdoptedStyleSheet\";\n  IncrementalSource2[IncrementalSource2[\"CustomElement\"] = 16] = \"CustomElement\";\n  return IncrementalSource2;\n})(IncrementalSource || {});\nvar MouseInteractions = /* @__PURE__ */ ((MouseInteractions2) => {\n  MouseInteractions2[MouseInteractions2[\"MouseUp\"] = 0] = \"MouseUp\";\n  MouseInteractions2[MouseInteractions2[\"MouseDown\"] = 1] = \"MouseDown\";\n  MouseInteractions2[MouseInteractions2[\"Click\"] = 2] = \"Click\";\n  MouseInteractions2[MouseInteractions2[\"ContextMenu\"] = 3] = \"ContextMenu\";\n  MouseInteractions2[MouseInteractions2[\"DblClick\"] = 4] = \"DblClick\";\n  MouseInteractions2[MouseInteractions2[\"Focus\"] = 5] = \"Focus\";\n  MouseInteractions2[MouseInteractions2[\"Blur\"] = 6] = \"Blur\";\n  MouseInteractions2[MouseInteractions2[\"TouchStart\"] = 7] = \"TouchStart\";\n  MouseInteractions2[MouseInteractions2[\"TouchMove_Departed\"] = 8] = \"TouchMove_Departed\";\n  MouseInteractions2[MouseInteractions2[\"TouchEnd\"] = 9] = \"TouchEnd\";\n  MouseInteractions2[MouseInteractions2[\"TouchCancel\"] = 10] = \"TouchCancel\";\n  return MouseInteractions2;\n})(MouseInteractions || {});\nvar PointerTypes = /* @__PURE__ */ ((PointerTypes2) => {\n  PointerTypes2[PointerTypes2[\"Mouse\"] = 0] = \"Mouse\";\n  PointerTypes2[PointerTypes2[\"Pen\"] = 1] = \"Pen\";\n  PointerTypes2[PointerTypes2[\"Touch\"] = 2] = \"Touch\";\n  return PointerTypes2;\n})(PointerTypes || {});\nvar CanvasContext = /* @__PURE__ */ ((CanvasContext2) => {\n  CanvasContext2[CanvasContext2[\"2D\"] = 0] = \"2D\";\n  CanvasContext2[CanvasContext2[\"WebGL\"] = 1] = \"WebGL\";\n  CanvasContext2[CanvasContext2[\"WebGL2\"] = 2] = \"WebGL2\";\n  return CanvasContext2;\n})(CanvasContext || {});\nvar MediaInteractions = /* @__PURE__ */ ((MediaInteractions2) => {\n  MediaInteractions2[MediaInteractions2[\"Play\"] = 0] = \"Play\";\n  MediaInteractions2[MediaInteractions2[\"Pause\"] = 1] = \"Pause\";\n  MediaInteractions2[MediaInteractions2[\"Seeked\"] = 2] = \"Seeked\";\n  MediaInteractions2[MediaInteractions2[\"VolumeChange\"] = 3] = \"VolumeChange\";\n  MediaInteractions2[MediaInteractions2[\"RateChange\"] = 4] = \"RateChange\";\n  return MediaInteractions2;\n})(MediaInteractions || {});\nvar ReplayerEvents = /* @__PURE__ */ ((ReplayerEvents2) => {\n  ReplayerEvents2[\"Start\"] = \"start\";\n  ReplayerEvents2[\"Pause\"] = \"pause\";\n  ReplayerEvents2[\"Resume\"] = \"resume\";\n  ReplayerEvents2[\"Resize\"] = \"resize\";\n  ReplayerEvents2[\"Finish\"] = \"finish\";\n  ReplayerEvents2[\"FullsnapshotRebuilded\"] = \"fullsnapshot-rebuilded\";\n  ReplayerEvents2[\"LoadStylesheetStart\"] = \"load-stylesheet-start\";\n  ReplayerEvents2[\"LoadStylesheetEnd\"] = \"load-stylesheet-end\";\n  ReplayerEvents2[\"SkipStart\"] = \"skip-start\";\n  ReplayerEvents2[\"SkipEnd\"] = \"skip-end\";\n  ReplayerEvents2[\"MouseInteraction\"] = \"mouse-interaction\";\n  ReplayerEvents2[\"EventCast\"] = \"event-cast\";\n  ReplayerEvents2[\"CustomEvent\"] = \"custom-event\";\n  ReplayerEvents2[\"Flush\"] = \"flush\";\n  ReplayerEvents2[\"StateChange\"] = \"state-change\";\n  ReplayerEvents2[\"PlayBack\"] = \"play-back\";\n  ReplayerEvents2[\"Destroy\"] = \"destroy\";\n  return ReplayerEvents2;\n})(ReplayerEvents || {});\nvar NodeType = /* @__PURE__ */ ((NodeType2) => {\n  NodeType2[NodeType2[\"Document\"] = 0] = \"Document\";\n  NodeType2[NodeType2[\"DocumentType\"] = 1] = \"DocumentType\";\n  NodeType2[NodeType2[\"Element\"] = 2] = \"Element\";\n  NodeType2[NodeType2[\"Text\"] = 3] = \"Text\";\n  NodeType2[NodeType2[\"CDATA\"] = 4] = \"CDATA\";\n  NodeType2[NodeType2[\"Comment\"] = 5] = \"Comment\";\n  return NodeType2;\n})(NodeType || {});\nexport {\n  CanvasContext,\n  EventType,\n  IncrementalSource,\n  MediaInteractions,\n  MouseInteractions,\n  NodeType,\n  PointerTypes,\n  ReplayerEvents\n};\n//# sourceMappingURL=types.js.map\n", "const testableAccessors = {\n  Node: [\n    \"childNodes\",\n    \"parentNode\",\n    \"parentElement\",\n    \"textContent\",\n    \"ownerDocument\"\n  ],\n  ShadowRoot: [\"host\", \"styleSheets\"],\n  Element: [\"shadowRoot\", \"querySelector\", \"querySelectorAll\"],\n  MutationObserver: []\n};\nconst testableMethods = {\n  Node: [\"contains\", \"getRootNode\"],\n  ShadowRoot: [\"getSelection\"],\n  Element: [],\n  MutationObserver: [\"constructor\"]\n};\nconst untaintedBasePrototype = {};\nconst isAngularZonePresent = () => {\n  return !!globalThis.Zone;\n};\nfunction getUntaintedPrototype(key) {\n  if (untaintedBasePrototype[key])\n    return untaintedBasePrototype[key];\n  const defaultObj = globalThis[key];\n  const defaultPrototype = defaultObj.prototype;\n  const accessorNames = key in testableAccessors ? testableAccessors[key] : void 0;\n  const isUntaintedAccessors = Boolean(\n    accessorNames && // @ts-expect-error 2345\n    accessorNames.every(\n      (accessor) => {\n        var _a, _b;\n        return Boolean(\n          (_b = (_a = Object.getOwnPropertyDescriptor(defaultPrototype, accessor)) == null ? void 0 : _a.get) == null ? void 0 : _b.toString().includes(\"[native code]\")\n        );\n      }\n    )\n  );\n  const methodNames = key in testableMethods ? testableMethods[key] : void 0;\n  const isUntaintedMethods = Boolean(\n    methodNames && methodNames.every(\n      // @ts-expect-error 2345\n      (method) => {\n        var _a;\n        return typeof defaultPrototype[method] === \"function\" && ((_a = defaultPrototype[method]) == null ? void 0 : _a.toString().includes(\"[native code]\"));\n      }\n    )\n  );\n  if (isUntaintedAccessors && isUntaintedMethods && !isAngularZonePresent()) {\n    untaintedBasePrototype[key] = defaultObj.prototype;\n    return defaultObj.prototype;\n  }\n  try {\n    const iframeEl = document.createElement(\"iframe\");\n    document.body.appendChild(iframeEl);\n    const win = iframeEl.contentWindow;\n    if (!win) return defaultObj.prototype;\n    const untaintedObject = win[key].prototype;\n    document.body.removeChild(iframeEl);\n    if (!untaintedObject) return defaultPrototype;\n    return untaintedBasePrototype[key] = untaintedObject;\n  } catch {\n    return defaultPrototype;\n  }\n}\nconst untaintedAccessorCache = {};\nfunction getUntaintedAccessor(key, instance, accessor) {\n  var _a;\n  const cacheKey = `${key}.${String(accessor)}`;\n  if (untaintedAccessorCache[cacheKey])\n    return untaintedAccessorCache[cacheKey].call(\n      instance\n    );\n  const untaintedPrototype = getUntaintedPrototype(key);\n  const untaintedAccessor = (_a = Object.getOwnPropertyDescriptor(\n    untaintedPrototype,\n    accessor\n  )) == null ? void 0 : _a.get;\n  if (!untaintedAccessor) return instance[accessor];\n  untaintedAccessorCache[cacheKey] = untaintedAccessor;\n  return untaintedAccessor.call(instance);\n}\nconst untaintedMethodCache = {};\nfunction getUntaintedMethod(key, instance, method) {\n  const cacheKey = `${key}.${String(method)}`;\n  if (untaintedMethodCache[cacheKey])\n    return untaintedMethodCache[cacheKey].bind(\n      instance\n    );\n  const untaintedPrototype = getUntaintedPrototype(key);\n  const untaintedMethod = untaintedPrototype[method];\n  if (typeof untaintedMethod !== \"function\") return instance[method];\n  untaintedMethodCache[cacheKey] = untaintedMethod;\n  return untaintedMethod.bind(instance);\n}\nfunction ownerDocument(n) {\n  return getUntaintedAccessor(\"Node\", n, \"ownerDocument\");\n}\nfunction childNodes(n) {\n  return getUntaintedAccessor(\"Node\", n, \"childNodes\");\n}\nfunction parentNode(n) {\n  return getUntaintedAccessor(\"Node\", n, \"parentNode\");\n}\nfunction parentElement(n) {\n  return getUntaintedAccessor(\"Node\", n, \"parentElement\");\n}\nfunction textContent(n) {\n  return getUntaintedAccessor(\"Node\", n, \"textContent\");\n}\nfunction contains(n, other) {\n  return getUntaintedMethod(\"Node\", n, \"contains\")(other);\n}\nfunction getRootNode(n) {\n  return getUntaintedMethod(\"Node\", n, \"getRootNode\")();\n}\nfunction host(n) {\n  if (!n || !(\"host\" in n)) return null;\n  return getUntaintedAccessor(\"ShadowRoot\", n, \"host\");\n}\nfunction styleSheets(n) {\n  return n.styleSheets;\n}\nfunction shadowRoot(n) {\n  if (!n || !(\"shadowRoot\" in n)) return null;\n  return getUntaintedAccessor(\"Element\", n, \"shadowRoot\");\n}\nfunction querySelector(n, selectors) {\n  return getUntaintedAccessor(\"Element\", n, \"querySelector\")(selectors);\n}\nfunction querySelectorAll(n, selectors) {\n  return getUntaintedAccessor(\"Element\", n, \"querySelectorAll\")(selectors);\n}\nfunction mutationObserverCtor() {\n  return getUntaintedPrototype(\"MutationObserver\").constructor;\n}\nlet nowTimestamp = Date.now;\nif (!/* @__PURE__ */ /[1-9][0-9]{12}/.test(Date.now().toString())) {\n  nowTimestamp = () => (/* @__PURE__ */ new Date()).getTime();\n}\nfunction patch(source, name, replacement) {\n  try {\n    if (!(name in source)) {\n      return () => {\n      };\n    }\n    const original = source[name];\n    const wrapped = replacement(original);\n    if (typeof wrapped === \"function\") {\n      wrapped.prototype = wrapped.prototype || {};\n      Object.defineProperties(wrapped, {\n        __rrweb_original__: {\n          enumerable: false,\n          value: original\n        }\n      });\n    }\n    source[name] = wrapped;\n    return () => {\n      source[name] = original;\n    };\n  } catch {\n    return () => {\n    };\n  }\n}\nconst index = {\n  ownerDocument,\n  childNodes,\n  parentNode,\n  parentElement,\n  textContent,\n  contains,\n  getRootNode,\n  host,\n  styleSheets,\n  shadowRoot,\n  querySelector,\n  querySelectorAll,\n  mutationObserver: mutationObserverCtor,\n  nowTimestamp,\n  patch\n};\nexport {\n  childNodes,\n  contains,\n  index as default,\n  getRootNode,\n  getUntaintedAccessor,\n  getUntaintedMethod,\n  getUntaintedPrototype,\n  host,\n  isAngularZonePresent,\n  mutationObserverCtor,\n  nowTimestamp,\n  ownerDocument,\n  parentElement,\n  parentNode,\n  patch,\n  querySelector,\n  querySelectorAll,\n  shadowRoot,\n  styleSheets,\n  textContent\n};\n//# sourceMappingURL=utils.js.map\n", "/**\n * ExponentialBackoff increases the backoff-time exponentially.\n * An optional maximum can be provided as an upper bound to the\n * exponent and thus to the returned backoff.\n *\n * The series can be described as ('i' is the current step/retry):\n *    backoff = base * 2^i                | without bound\n *    backoff = base * 2^min(i, expMax)   | with bound\n *\n * Example:\n *\n * 1) Without bound:\n *   base = 1000, expMax = undefined\n *   backoff = 1000 * 2^0 = 1000 // first retry\n *   backoff = 1000 * 2^1 = 2000 // second retry\n *   backoff = 1000 * 2^2 = 4000 // ...doubles with every retry\n *   backoff = 1000 * 2^3 = 8000\n *   backoff = 1000 * 2^4 = 16000\n *   ... // and so on\n *\n * 2) With bound:\n *  base = 1000, expMax = 3\n *  backoff = 1000 * 2^0 = 1000 // first retry\n *  backoff = 1000 * 2^1 = 2000 // second retry\n *  backoff = 1000 * 2^2 = 4000 // third retry\n *  backoff = 1000 * 2^3 = 8000 // maximum reached, don't increase further\n *  backoff = 1000 * 2^3 = 8000\n *  backoff = 1000 * 2^3 = 8000\n *  ... // and so on\n */\nexport class ExponentialBackoff {\n    /**\n     * Creates a new ExponentialBackoff.\n     * @param base the base of the exponentiation\n     * @param expMax the maximum exponent, no bound if undefined\n     */\n    constructor(base, expMax) {\n        this._retries = 0;\n        if (!Number.isInteger(base) || base < 0) {\n            throw new Error(\"Base must be a positive integer or zero\");\n        }\n        if (expMax !== undefined && (!Number.isInteger(expMax) || expMax < 0)) {\n            throw new Error(\"ExpMax must be undefined, a positive integer, or zero\");\n        }\n        this.base = base;\n        this.expMax = expMax;\n        this.i = 0;\n    }\n    get retries() {\n        return this._retries;\n    }\n    get current() {\n        return this.base * Math.pow(2, this.i);\n    }\n    next() {\n        this._retries++;\n        this.i =\n            this.expMax === undefined\n                ? this.i + 1\n                : Math.min(this.i + 1, this.expMax);\n        return this.current;\n    }\n    reset() {\n        this._retries = 0;\n        this.i = 0;\n    }\n}\n//# sourceMappingURL=exponentialbackoff.js.map", "/**\n * An array queue is a queue that has an unbounded capacity. Reading from an array queue\n * will return the oldest element and effectively remove it from the queue.\n */\nexport class ArrayQueue {\n    constructor() {\n        this.elements = [];\n    }\n    add(element) {\n        this.elements.push(element);\n    }\n    clear() {\n        this.elements.length = 0;\n    }\n    forEach(fn) {\n        this.elements.forEach(fn);\n    }\n    length() {\n        return this.elements.length;\n    }\n    isEmpty() {\n        return this.elements.length === 0;\n    }\n    peek() {\n        return this.elements[0];\n    }\n    read() {\n        return this.elements.shift();\n    }\n}\n//# sourceMappingURL=array_queue.js.map", "/**\n * Events that can be fired by the websocket.\n */\nexport const WebsocketEvent = {\n    /** Fired when the connection is opened. */\n    open: \"open\",\n    /** Fired when the connection is closed. */\n    close: \"close\",\n    /** Fired when the connection has been closed because of an error, such as when some data couldn't be sent. */\n    error: \"error\",\n    /** Fired when a message is received. */\n    message: \"message\",\n    /** Fired when the websocket tries to reconnect after a connection loss. */\n    retry: \"retry\",\n    /** Fired when the websocket successfully reconnects after a connection loss. */\n    reconnect: \"reconnect\",\n};\n//# sourceMappingURL=websocket_event.js.map", "import { WebsocketEvent, } from \"./websocket_event\";\n/**\n * A websocket wrapper that can be configured to reconnect automatically and buffer messages when the websocket is not connected.\n */\nexport class Websocket {\n    /**\n     * Creates a new websocket.\n     *\n     * @param url to connect to, or a function that returns a URL.\n     * @param protocols optional protocols to use.\n     * @param options optional options to use.\n     */\n    constructor(url, protocols, options) {\n        var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;\n        this._closedByUser = false; // whether the websocket was closed by the user\n        /**\n         * Handles the 'open' event of the browser-native websocket.\n         * @param event to handle.\n         */\n        this.handleOpenEvent = (event) => this.handleEvent(WebsocketEvent.open, event);\n        /**\n         * Handles the 'error' event of the browser-native websocket.\n         * @param event to handle.\n         */\n        this.handleErrorEvent = (event) => this.handleEvent(WebsocketEvent.error, event);\n        /**\n         * Handles the 'close' event of the browser-native websocket.\n         * @param event to handle.\n         */\n        this.handleCloseEvent = (event) => this.handleEvent(WebsocketEvent.close, event);\n        /**\n         * Handles the 'message' event of the browser-native websocket.\n         * @param event to handle.\n         */\n        this.handleMessageEvent = (event) => this.handleEvent(WebsocketEvent.message, event);\n        this._urlProvider = url;\n        this._protocols = protocols;\n        // make a copy of the options to prevent the user from changing them\n        this._options = {\n            buffer: options === null || options === void 0 ? void 0 : options.buffer,\n            retry: {\n                maxRetries: (_a = options === null || options === void 0 ? void 0 : options.retry) === null || _a === void 0 ? void 0 : _a.maxRetries,\n                instantReconnect: (_b = options === null || options === void 0 ? void 0 : options.retry) === null || _b === void 0 ? void 0 : _b.instantReconnect,\n                backoff: (_c = options === null || options === void 0 ? void 0 : options.retry) === null || _c === void 0 ? void 0 : _c.backoff,\n            },\n            listeners: {\n                open: [...((_e = (_d = options === null || options === void 0 ? void 0 : options.listeners) === null || _d === void 0 ? void 0 : _d.open) !== null && _e !== void 0 ? _e : [])],\n                close: [...((_g = (_f = options === null || options === void 0 ? void 0 : options.listeners) === null || _f === void 0 ? void 0 : _f.close) !== null && _g !== void 0 ? _g : [])],\n                error: [...((_j = (_h = options === null || options === void 0 ? void 0 : options.listeners) === null || _h === void 0 ? void 0 : _h.error) !== null && _j !== void 0 ? _j : [])],\n                message: [...((_l = (_k = options === null || options === void 0 ? void 0 : options.listeners) === null || _k === void 0 ? void 0 : _k.message) !== null && _l !== void 0 ? _l : [])],\n                retry: [...((_o = (_m = options === null || options === void 0 ? void 0 : options.listeners) === null || _m === void 0 ? void 0 : _m.retry) !== null && _o !== void 0 ? _o : [])],\n                reconnect: [...((_q = (_p = options === null || options === void 0 ? void 0 : options.listeners) === null || _p === void 0 ? void 0 : _p.reconnect) !== null && _q !== void 0 ? _q : [])],\n            },\n        };\n        this._underlyingWebsocket = this.tryConnect();\n    }\n    /**\n     * Getter for the url.\n     *\n     * @return the url.\n     */\n    get url() {\n        return this._url;\n    }\n    /**\n     * Getter for the protocols.\n     *\n     * @return the protocols, or undefined if none were provided.\n     */\n    get protocols() {\n        return this._protocols;\n    }\n    /**\n     * Getter for the buffer.\n     *\n     * @return the buffer, or undefined if none was provided.\n     */\n    get buffer() {\n        return this._options.buffer;\n    }\n    /**\n     * Getter for the maxRetries.\n     *\n     * @return the maxRetries, or undefined if none was provided (no limit).\n     */\n    get maxRetries() {\n        return this._options.retry.maxRetries;\n    }\n    /**\n     * Getter for the instantReconnect.\n     *\n     * @return the instantReconnect, or undefined if none was provided.\n     */\n    get instantReconnect() {\n        return this._options.retry.instantReconnect;\n    }\n    /**\n     * Getter for the backoff.\n     *\n     * @return the backoff, or undefined if none was provided.\n     */\n    get backoff() {\n        return this._options.retry.backoff;\n    }\n    /**\n     * Whether the websocket was closed by the user. A websocket is closed by the user by calling close().\n     *\n     * @return true if the websocket was closed by the user, false otherwise.\n     */\n    get closedByUser() {\n        return this._closedByUser;\n    }\n    /**\n     * Getter for the last 'open' event, e.g. the last time the websocket was connected.\n     *\n     * @return the last 'open' event, or undefined if the websocket was never connected.\n     */\n    get lastConnection() {\n        return this._lastConnection;\n    }\n    /**\n     * Getter for the underlying websocket. This can be used to access the browser's native websocket directly.\n     *\n     * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket\n     * @return the underlying websocket.\n     */\n    get underlyingWebsocket() {\n        return this._underlyingWebsocket;\n    }\n    /**\n     * Getter for the readyState of the underlying websocket.\n     *\n     * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/readyState\n     * @return the readyState of the underlying websocket.\n     */\n    get readyState() {\n        return this._underlyingWebsocket.readyState;\n    }\n    /**\n     * Getter for the bufferedAmount of the underlying websocket.\n     *\n     * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/bufferedAmount\n     * @return the bufferedAmount of the underlying websocket.\n     */\n    get bufferedAmount() {\n        return this._underlyingWebsocket.bufferedAmount;\n    }\n    /**\n     * Getter for the extensions of the underlying websocket.\n     *\n     * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/extensions\n     * @return the extensions of the underlying websocket.\n     */\n    get extensions() {\n        return this._underlyingWebsocket.extensions;\n    }\n    /**\n     * Getter for the binaryType of the underlying websocket.\n     *\n     * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/binaryType\n     * @return the binaryType of the underlying websocket.\n     */\n    get binaryType() {\n        return this._underlyingWebsocket.binaryType;\n    }\n    /**\n     * Setter for the binaryType of the underlying websocket.\n     *\n     * @param value to set, 'blob' or 'arraybuffer'.\n     */\n    set binaryType(value) {\n        this._underlyingWebsocket.binaryType = value;\n    }\n    /**\n     * Sends data over the websocket.\n     *\n     * If the websocket is not connected and a buffer was provided on creation, the data will be added to the buffer.\n     * If no buffer was provided or the websocket was closed by the user, the data will be dropped.\n     *\n     * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/send\n     * @param data to send.\n     */\n    send(data) {\n        if (this.closedByUser)\n            return; // no-op if closed by user\n        if (this._underlyingWebsocket.readyState === this._underlyingWebsocket.OPEN) {\n            this._underlyingWebsocket.send(data); // websocket is connected, send data\n        }\n        else if (this.buffer !== undefined) {\n            this.buffer.add(data); // websocket is not connected, add data to buffer\n        }\n    }\n    /**\n     * Close the websocket. No connection-retry will be attempted after this.\n     *\n     * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close\n     * @param code optional close code.\n     * @param reason optional close reason.\n     */\n    close(code, reason) {\n        this.cancelScheduledConnectionRetry(); // cancel any scheduled retries\n        this._closedByUser = true; // mark websocket as closed by user\n        this._underlyingWebsocket.close(code, reason); // close underlying websocket with provided code and reason\n    }\n    /**\n     * Adds an event listener for the given event-type.\n     *\n     * @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener\n     * @param type of the event to add the listener for.\n     * @param listener to add.\n     * @param options to use when adding the listener.\n     */\n    addEventListener(type, listener, options) {\n        this._options.listeners[type].push({ listener, options }); // add listener to list of listeners\n    }\n    /**\n     * Removes one or more event listener for the given event-type that match the given listener and options.\n     *\n     * @param type of the event to remove the listener for.\n     * @param listener to remove.\n     * @param options that were used when the listener was added.\n     */\n    removeEventListener(type, listener, options) {\n        const isListenerNotToBeRemoved = (l) => l.listener !== listener || l.options !== options;\n        this._options.listeners[type] =\n            this._options.listeners[type].filter(isListenerNotToBeRemoved); // only keep listeners that are not to be removed\n    }\n    /**\n     * Creates a new browser-native websocket and connects it to the given URL with the given protocols\n     * and adds all event listeners to the browser-native websocket.\n     *\n     * @return the created browser-native websocket which is also stored in the '_underlyingWebsocket' property.\n     */\n    tryConnect() {\n        this._url =\n            typeof this._urlProvider === \"function\"\n                ? this._urlProvider()\n                : this._urlProvider;\n        this._underlyingWebsocket = new WebSocket(this._url, this.protocols); // create new browser-native websocket and add all event listeners\n        this._underlyingWebsocket.addEventListener(WebsocketEvent.open, this.handleOpenEvent);\n        this._underlyingWebsocket.addEventListener(WebsocketEvent.close, this.handleCloseEvent);\n        this._underlyingWebsocket.addEventListener(WebsocketEvent.error, this.handleErrorEvent);\n        this._underlyingWebsocket.addEventListener(WebsocketEvent.message, this.handleMessageEvent);\n        return this._underlyingWebsocket;\n    }\n    /**\n     * Removes all event listeners from the browser-native websocket and closes it.\n     */\n    clearWebsocket() {\n        this._underlyingWebsocket.removeEventListener(WebsocketEvent.open, this.handleOpenEvent);\n        this._underlyingWebsocket.removeEventListener(WebsocketEvent.close, this.handleCloseEvent);\n        this._underlyingWebsocket.removeEventListener(WebsocketEvent.error, this.handleErrorEvent);\n        this._underlyingWebsocket.removeEventListener(WebsocketEvent.message, this.handleMessageEvent);\n        this._underlyingWebsocket.close();\n    }\n    /**\n     * Dispatch an event to all listeners of the given event-type.\n     *\n     * @param type of the event to dispatch.\n     * @param event to dispatch.\n     */\n    dispatchEvent(type, event) {\n        const eventListeners = this._options.listeners[type];\n        const newEventListeners = [];\n        eventListeners.forEach(({ listener, options }) => {\n            listener(this, event); // invoke listener with event\n            if (options === undefined ||\n                options.once === undefined ||\n                !options.once) {\n                newEventListeners.push({ listener, options }); // only keep listener if it isn't a once-listener\n            }\n        });\n        this._options.listeners[type] = newEventListeners; // replace old listeners with new listeners that don't include once-listeners\n    }\n    /**\n     * Handles the given event by dispatching it to all listeners of the given event-type.\n     *\n     * @param type of the event to handle.\n     * @param event to handle.\n     */\n    handleEvent(type, event) {\n        switch (type) {\n            case WebsocketEvent.close:\n                this.dispatchEvent(type, event);\n                this.scheduleConnectionRetryIfNeeded(); // schedule a new connection retry if the websocket was closed by the server\n                break;\n            case WebsocketEvent.open:\n                if (this.backoff !== undefined && this._lastConnection !== undefined) {\n                    // websocket was reconnected, dispatch reconnect event and reset backoff\n                    const detail = {\n                        retries: this.backoff.retries,\n                        lastConnection: new Date(this._lastConnection),\n                    };\n                    const event = new CustomEvent(WebsocketEvent.reconnect, {\n                        detail,\n                    });\n                    this.dispatchEvent(WebsocketEvent.reconnect, event);\n                    this.backoff.reset();\n                }\n                this._lastConnection = new Date();\n                this.dispatchEvent(type, event); // dispatch open event and send buffered data\n                this.sendBufferedData();\n                break;\n            case WebsocketEvent.retry:\n                this.dispatchEvent(type, event); // dispatch retry event and try to connect\n                this.clearWebsocket(); // clear the old websocket\n                this.tryConnect();\n                break;\n            default:\n                this.dispatchEvent(type, event); // dispatch event to all listeners of the given event-type\n                break;\n        }\n    }\n    /**\n     * Sends buffered data if there is a buffer defined.\n     */\n    sendBufferedData() {\n        if (this.buffer === undefined) {\n            return; // no buffer defined, nothing to send\n        }\n        for (let ele = this.buffer.read(); ele !== undefined; ele = this.buffer.read()) {\n            this.send(ele); // send buffered data\n        }\n    }\n    /**\n     * Schedules a connection-retry if there is a backoff defined and the websocket was not closed by the user.\n     */\n    scheduleConnectionRetryIfNeeded() {\n        if (this.closedByUser) {\n            return; // user closed the websocket, no retry\n        }\n        if (this.backoff === undefined) {\n            return; // no backoff defined, no retry\n        }\n        // handler dispatches the retry event to all listeners of the retry event-type\n        const handleRetryEvent = (detail) => {\n            const event = new CustomEvent(WebsocketEvent.retry, { detail });\n            this.handleEvent(WebsocketEvent.retry, event);\n        };\n        // create retry event detail, depending on the 'instantReconnect' option\n        const retryEventDetail = {\n            backoff: this._options.retry.instantReconnect === true ? 0 : this.backoff.next(),\n            retries: this._options.retry.instantReconnect === true\n                ? 0\n                : this.backoff.retries,\n            lastConnection: this._lastConnection,\n        };\n        // schedule a new connection-retry if the maximum number of retries is not reached yet\n        if (this._options.retry.maxRetries === undefined ||\n            retryEventDetail.retries <= this._options.retry.maxRetries) {\n            this.retryTimeout = globalThis.setTimeout(() => handleRetryEvent(retryEventDetail), retryEventDetail.backoff);\n        }\n    }\n    /**\n     * Cancels the scheduled connection-retry, if there is one.\n     */\n    cancelScheduledConnectionRetry() {\n        globalThis.clearTimeout(this.retryTimeout);\n    }\n}\n//# sourceMappingURL=websocket.js.map", "import { WebsocketEvent, } from \"./websocket_event\";\nimport { Websocket } from \"./websocket\";\n/**\n * Builder for websockets.\n */\nexport class WebsocketBuilder {\n    /**\n     * Creates a new WebsocketBuilder.\n     *\n     * @param url the url to connect to, or a function that returns a URL\n     */\n    constructor(url) {\n        this._url = url;\n    }\n    /**\n     * Getter for the url.\n     *\n     * @returns the url or url provider\n     */\n    get url() {\n        return this._url;\n    }\n    /**\n     * Adds protocols to the websocket. Subsequent calls to this method will override the previously set protocols.\n     *\n     * @param protocols the protocols to add\n     */\n    withProtocols(protocols) {\n        this._protocols = protocols;\n        return this;\n    }\n    /**\n     * Getter for the protocols.\n     *\n     * @returns the protocols, undefined if no protocols have been set\n     */\n    get protocols() {\n        return this._protocols;\n    }\n    /**\n     * Sets the maximum number of retries before giving up. No limit if undefined.\n     *\n     * @param maxRetries the maximum number of retries before giving up\n     */\n    withMaxRetries(maxRetries) {\n        var _a;\n        this._options = Object.assign(Object.assign({}, this._options), { retry: Object.assign(Object.assign({}, (_a = this._options) === null || _a === void 0 ? void 0 : _a.retry), { maxRetries }) });\n        return this;\n    }\n    /**\n     * Getter for the maximum number of retries before giving up.\n     *\n     * @returns the maximum number of retries before giving up, undefined if no maximum has been set\n     */\n    get maxRetries() {\n        var _a, _b;\n        return (_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.retry) === null || _b === void 0 ? void 0 : _b.maxRetries;\n    }\n    /**\n     * Sets whether to reconnect immediately after a connection has been lost, ignoring the backoff strategy for the first retry.\n     *\n     * @param instantReconnect whether to reconnect immediately after a connection has been lost\n     */\n    withInstantReconnect(instantReconnect) {\n        var _a;\n        this._options = Object.assign(Object.assign({}, this._options), { retry: Object.assign(Object.assign({}, (_a = this._options) === null || _a === void 0 ? void 0 : _a.retry), { instantReconnect }) });\n        return this;\n    }\n    /**\n     * Getter for whether to reconnect immediately after a connection has been lost, ignoring the backoff strategy for the first retry.\n     *\n     * @returns whether to reconnect immediately after a connection has been lost, undefined if no value has been set\n     */\n    get instantReconnect() {\n        var _a, _b;\n        return (_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.retry) === null || _b === void 0 ? void 0 : _b.instantReconnect;\n    }\n    /**\n     * Adds a backoff to the websocket. Subsequent calls to this method will override the previously set backoff.\n     *\n     * @param backoff the backoff to add\n     */\n    withBackoff(backoff) {\n        var _a;\n        this._options = Object.assign(Object.assign({}, this._options), { retry: Object.assign(Object.assign({}, (_a = this._options) === null || _a === void 0 ? void 0 : _a.retry), { backoff }) });\n        return this;\n    }\n    /**\n     * Getter for the backoff.\n     *\n     * @returns the backoff, undefined if no backoff has been set\n     */\n    get backoff() {\n        var _a, _b;\n        return (_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.retry) === null || _b === void 0 ? void 0 : _b.backoff;\n    }\n    /**\n     * Adds a buffer to the websocket. Subsequent calls to this method will override the previously set buffer.\n     *\n     * @param buffer the buffer to add\n     */\n    withBuffer(buffer) {\n        this._options = Object.assign(Object.assign({}, this._options), { buffer });\n        return this;\n    }\n    /**\n     * Getter for the buffer.\n     *\n     * @returns the buffer, undefined if no buffer has been set\n     */\n    get buffer() {\n        var _a;\n        return (_a = this._options) === null || _a === void 0 ? void 0 : _a.buffer;\n    }\n    /**\n     * Adds an 'open' event listener to the websocket. Subsequent calls to this method will add additional listeners that will be\n     * called in the order they were added.\n     *\n     * @param listener the listener to add\n     * @param options the listener options\n     */\n    onOpen(listener, options) {\n        this.addListener(WebsocketEvent.open, listener, options);\n        return this;\n    }\n    /**\n     * Adds an 'close' event listener to the websocket. Subsequent calls to this method will add additional listeners that will be\n     * called in the order they were added.\n     *\n     * @param listener the listener to add\n     * @param options the listener options\n     */\n    onClose(listener, options) {\n        this.addListener(WebsocketEvent.close, listener, options);\n        return this;\n    }\n    /**\n     * Adds an 'error' event listener to the websocket. Subsequent calls to this method will add additional listeners that will be\n     * called in the order they were added.\n     *\n     * @param listener the listener to add\n     * @param options the listener options\n     */\n    onError(listener, options) {\n        this.addListener(WebsocketEvent.error, listener, options);\n        return this;\n    }\n    /**\n     * Adds an 'message' event listener to the websocket. Subsequent calls to this method will add additional listeners that will be\n     * called in the order they were added.\n     *\n     * @param listener the listener to add\n     * @param options the listener options\n     */\n    onMessage(listener, options) {\n        this.addListener(WebsocketEvent.message, listener, options);\n        return this;\n    }\n    /**\n     * Adds an 'retry' event listener to the websocket. Subsequent calls to this method will add additional listeners that will be\n     * called in the order they were added.\n     *\n     * @param listener the listener to add\n     * @param options the listener options\n     */\n    onRetry(listener, options) {\n        this.addListener(WebsocketEvent.retry, listener, options);\n        return this;\n    }\n    /**\n     * Adds an 'reconnect' event listener to the websocket. Subsequent calls to this method will add additional listeners that will be\n     * called in the order they were added.\n     *\n     * @param listener the listener to add\n     * @param options the listener options\n     */\n    onReconnect(listener, options) {\n        this.addListener(WebsocketEvent.reconnect, listener, options);\n        return this;\n    }\n    /**\n     * Builds the websocket.\n     *\n     * @return a new websocket, with the set options\n     */\n    build() {\n        return new Websocket(this._url, this._protocols, this._options); // instantiate the websocket with the set options\n    }\n    /**\n     * Adds an event listener to the options.\n     *\n     * @param event the event to add the listener to\n     * @param listener the listener to add\n     * @param options the listener options\n     */\n    addListener(event, listener, options) {\n        var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;\n        this._options = Object.assign(Object.assign({}, this._options), { listeners: {\n                open: (_c = (_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.listeners) === null || _b === void 0 ? void 0 : _b.open) !== null && _c !== void 0 ? _c : [],\n                close: (_f = (_e = (_d = this._options) === null || _d === void 0 ? void 0 : _d.listeners) === null || _e === void 0 ? void 0 : _e.close) !== null && _f !== void 0 ? _f : [],\n                error: (_j = (_h = (_g = this._options) === null || _g === void 0 ? void 0 : _g.listeners) === null || _h === void 0 ? void 0 : _h.error) !== null && _j !== void 0 ? _j : [],\n                message: (_m = (_l = (_k = this._options) === null || _k === void 0 ? void 0 : _k.listeners) === null || _l === void 0 ? void 0 : _l.message) !== null && _m !== void 0 ? _m : [],\n                retry: (_q = (_p = (_o = this._options) === null || _o === void 0 ? void 0 : _o.listeners) === null || _p === void 0 ? void 0 : _p.retry) !== null && _q !== void 0 ? _q : [],\n                reconnect: (_t = (_s = (_r = this._options) === null || _r === void 0 ? void 0 : _r.listeners) === null || _s === void 0 ? void 0 : _s.reconnect) !== null && _t !== void 0 ? _t : [],\n                [event]: [\n                    ...((_w = (_v = (_u = this._options) === null || _u === void 0 ? void 0 : _u.listeners) === null || _v === void 0 ? void 0 : _v[event]) !== null && _w !== void 0 ? _w : []),\n                    { listener, options },\n                ],\n            } });\n        return this;\n    }\n}\n//# sourceMappingURL=websocket_builder.js.map", "import { record } from '@rrweb/record';\n\nimport { EventType } from '@rrweb/types';\nimport type { customEvent, eventWithTime, listenerHandler } from '@rrweb/types';\nimport { nowTimestamp } from '@rrweb/utils';\nimport type { recordOptions } from 'rrweb';\n\nimport {\n  ArrayQueue,\n  ExponentialBackoff,\n  Websocket,\n  WebsocketBuilder,\n  WebsocketEvent,\n} from 'websocket-ts';\n\ndeclare const __RRWEB_BROWSER_CLIENT_VERSION__: string;\ndeclare const __RRWEB_BROWSER_CLIENT_COMMIT_HASH__: string;\n\nexport type clientConfig = {\n  serverUrl?: string;\n  publicApiKey: string;\n  autostart: boolean;\n  includePii: boolean;\n  jsSource?: string;\n  jsEntrypoint?: string;\n  meta?: nameValues;\n};\n\nexport type nameValues = Record<string, string | boolean | number>;\n\nexport type browserClientRecordOptions = Omit<\n  recordOptions<eventWithTime>,\n  'emit'\n> &\n  clientConfig & {\n    emit?: recordOptions<eventWithTime>['emit'] | string;\n  };\n\ntype websocketListenerHandler = (i: Websocket, ev: MessageEvent) => void;\ntype ServerMessage =\n  | { type: 'error' }\n  | { type: 'upstream-result'; ok?: boolean }\n  | { type?: unknown; ok?: unknown };\n\nexport type customEventWithTime = customEvent & {\n  timestamp: number;\n};\n\nconst defaultServerUrl =\n  'https://api.rrweb.com/recordings/{recordingId}/events/ws';\nlet defaultClientConfig: clientConfig = {\n  serverUrl: defaultServerUrl,\n  publicApiKey: '',\n  autostart: false,\n  includePii: false,\n};\nconst sessionStorageName = 'rrweb-browser-client-recording-id';\nconst wsLimit = 10e5; // this is approximate and depends on the browser, also on how unicode is encoded (we are comparing against the length of a javascript string)\n\nlet ws: Websocket | undefined;\nlet wsConnectionPaused = false;\n\nconst buffer: ArrayQueue<string> = new ArrayQueue();\nlet rrwebStopFn: listenerHandler | undefined;\n\nfunction isServerMessage(value: unknown): value is ServerMessage {\n  return typeof value === 'object' && value !== null;\n}\n\nfunction sanitizeScriptSource(value: string | undefined): string | undefined {\n  if (!value) return undefined;\n  try {\n    const url = new URL(value);\n    url.search = '';\n    url.hash = '';\n    return url.href;\n  } catch {\n    return value;\n  }\n}\n\nfunction scriptSourceFromElement(\n  script: HTMLScriptElement,\n): string | undefined {\n  return sanitizeScriptSource(script.src);\n}\n\nexport function stop(resetRecordingId: boolean) {\n  // reset all state so that start() can start afresh\n  if (rrwebStopFn !== undefined) {\n    rrwebStopFn();\n    rrwebStopFn = undefined;\n  }\n  if (ws) {\n    const closeEvent: customEventWithTime = {\n      timestamp: nowTimestamp(),\n      type: EventType.Custom,\n      data: {\n        tag: 'close-' + (resetRecordingId ? 'permanent' : 'temporary'),\n        payload: {},\n      },\n    };\n    // Clear old events before send, so websocket-ts can buffer the close event\n    // for the HTTP fallback when the socket is not currently open.\n    buffer.clear();\n    ws.send(JSON.stringify(closeEvent));\n    ws.close();\n    wsConnectionPaused = false;\n    ws = undefined; // so `emit` can restart it again if page is unfrozen\n  } else {\n    buffer.clear();\n  }\n  if (resetRecordingId) {\n    removeRecordingId();\n  }\n}\n\nfunction removeRecordingId(): void {\n  sessionStorage.removeItem(sessionStorageName);\n}\n\nfunction getSetVisitorId() {\n  const nameEQ = 'rrweb-browser-client-visitor-id=';\n  let value: string | null = null;\n  if (document.cookie) {\n    document.cookie.split(';').forEach((cp) => {\n      if (cp.trim().startsWith(nameEQ)) {\n        value = cp.trim();\n        // we could `break` (if not in a forEach) as we're not setting multiple cookies against different subdomains/paths\n      }\n    });\n  }\n  if (!value) {\n    // eslint-disable-next-line compat/compat -- @rrweb/browser-client targets modern browsers with crypto UUID support for recording/session identity.\n    value = self.crypto.randomUUID();\n    const date = new Date();\n    date.setTime(date.getTime() + 366 * 86400000); // 1 year\n    const expires = 'expires=' + date.toUTCString();\n\n    // SameSite=Lax to cross subdomains\n    const secure = window.location.protocol === 'https:' ? ';Secure' : '';\n    const domain = `;domain=${document.location.host.replace(/^www\\./, '')}`;\n    document.cookie = `${nameEQ}${value};${expires}${domain};path=/;SameSite=Lax${secure}`;\n  }\n  return value;\n}\n\nfunction getSetRecordingId(): string | null {\n  let value: string | null = null;\n  try {\n    value = sessionStorage.getItem(sessionStorageName);\n    if (!value) {\n      // eslint-disable-next-line compat/compat -- @rrweb/browser-client targets modern browsers with crypto UUID support for recording/session identity.\n      value = self.crypto.randomUUID();\n      try {\n        sessionStorage.setItem(sessionStorageName, value);\n      } catch (e) {\n        value = null;\n      }\n    }\n  } catch (e) {\n    value = null;\n  }\n  return value;\n}\n\n// if API client requests the recording ID prior to start,\n// set it immediately so that it will be the eventual id used\nexport const getRecordingId = getSetRecordingId;\n\nfunction connect(\n  serverUrl: string,\n  postUrl: string,\n  publicApiKey: string,\n  messageHandler: websocketListenerHandler,\n): Websocket {\n  const wsUrl = new URL(serverUrl);\n  if (publicApiKey) {\n    wsUrl.searchParams.set('token', publicApiKey);\n  }\n  wsUrl.protocol = wsUrl.protocol.replace('http', 'ws'); // testing/puppeteer: SyntaxError: Failed to construct 'WebSocket': The URL's scheme must be either 'ws' or 'wss'. 'https' is not allowed.\n\n  const ws = new WebsocketBuilder(wsUrl.href)\n    .withBuffer(buffer) // when disconnected\n    .withBackoff(\n      new ExponentialBackoff(500 + Math.round(1000 * Math.random()), 6),\n    ) // retry around every 1s, 2s, 4s, 8s, maxing out with a retry every ~1minute\n    .build();\n\n  const fallbackPosting = setInterval(() => {\n    if (buffer.length()) {\n      void postData(postUrl, publicApiKey, buffer).catch((error) => {\n        clearInterval(fallbackPosting);\n        console.error('Error periodically POSTing events:', error);\n      });\n    }\n  }, 5 * 1000);\n\n  // Add event listeners\n  ws.addEventListener(WebsocketEvent.open, () => {\n    clearInterval(fallbackPosting);\n  });\n  ws.addEventListener(WebsocketEvent.message, messageHandler);\n  return ws;\n}\n\nasync function postData(\n  postUrl: string,\n  publicApiKey: string,\n  buffer: ArrayQueue<string> | string,\n) {\n  const keepaliveLimit = 65000;\n  let done = false;\n  const responses: Response[] = [];\n  const toSend: string[] = [];\n  do {\n    let body;\n    if (buffer instanceof ArrayQueue) {\n      // this clears the buffer so no need to call buffer.clear()\n      let sendSize = 0;\n      done = true;\n      for (\n        let eventStr = buffer.read();\n        eventStr !== undefined;\n        eventStr = buffer.read()\n      ) {\n        toSend.push(eventStr);\n        sendSize += eventStr.length;\n        if (sendSize > keepaliveLimit) {\n          done = false;\n          break;\n        }\n      }\n      body = toSend.join('\\n');\n    } else {\n      body = buffer;\n      done = true;\n    }\n    // eslint-disable-next-line compat/compat -- fetch is the runtime transport for POST fallback in supported browsers.\n    const response = await fetch(postUrl, {\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/x-ndjson',\n        Authorization: `Bearer ${publicApiKey}`,\n      },\n      body,\n      keepalive: body.length < keepaliveLimit, // don't abort POST after end of session (must be under the limit)\n    });\n    responses.push(response);\n    if (!response.ok) {\n      if (buffer instanceof ArrayQueue) {\n        // re-queue events in case we can reconnect next time or with ws\n        toSend.forEach((eventStr) => buffer.add(eventStr));\n      }\n      break;\n    } else if (done) {\n      break;\n    }\n  } while (!done);\n  const badResponse = responses.find((r) => r.status >= 300);\n  if (badResponse) {\n    let badResponseInfo = `${badResponse.status} ${badResponse.statusText}`;\n    if (!badResponse.bodyUsed) {\n      badResponseInfo +=\n        '\\nresponse body:' + JSON.stringify(await badResponse.json());\n    }\n    throw new Error(`Bad response from POST: ${badResponseInfo}`);\n  }\n  return responses;\n}\n\nexport function start(\n  options: browserClientRecordOptions = defaultClientConfig,\n) {\n  const {\n    includePii,\n    publicApiKey,\n    jsSource: rawJsSource,\n    jsEntrypoint,\n    ...recordOptions\n  } = options;\n  let { serverUrl = defaultServerUrl } = options;\n\n  if (recordOptions.slimDOMOptions === undefined) {\n    recordOptions.slimDOMOptions = 'all';\n  }\n  if (recordOptions.maskAllInputs === undefined) {\n    recordOptions.maskAllInputs = true; // default to more privacy\n  }\n  // TODO: switch this back to captureAssets.stylesheets once rrweb pulls in\n  // the captureAssets recording API from the assets branch.\n  if (recordOptions.inlineStylesheet === undefined) {\n    recordOptions.inlineStylesheet = true;\n  }\n\n  const configEmit = recordOptions.emit;\n\n  const handleMessage = (_: Websocket, ev: MessageEvent) => {\n    const parsedEvent: unknown = JSON.parse(String(ev.data));\n    if (\n      isServerMessage(parsedEvent) &&\n      (parsedEvent.type === 'error' ||\n        (parsedEvent.type === 'upstream-result' && !parsedEvent.ok))\n    ) {\n      console.warn('received error, pausing websockets:', parsedEvent);\n      wsConnectionPaused = true;\n    } else {\n      console.log(`received message: ${String(ev.data)}`);\n    }\n  };\n\n  const recordingId = getSetRecordingId();\n  if (!recordingId) {\n    // TODO: we could allow client to supply their own recordingId\n    // however that would have implications on how we can handle\n    // recordings server side (that a recording could mix events from\n    // multiple browsing contexts)\n    console.error(\n      '@rrweb/browser-client: Unable to start(); sessionStorage unavailable',\n    );\n    return;\n  }\n\n  const initialPayload: nameValues = {\n    domain: document.location.hostname || document.location.href.split('?')[0], // latter is for debugging (e.g. a file:// url)\n    includePii: Boolean(includePii), // tell server not to store IP addresses or user agents\n  };\n\n  // the expected replacement of recording id\n  serverUrl = serverUrl.replace('{recordingId}', recordingId);\n  serverUrl = serverUrl.replace('%7BrecordingId%7D', recordingId); // as mangled by `new URL`\n\n  const sURL = new URL(serverUrl);\n  if (!serverUrl.includes(recordingId)) {\n    // '{recordingId}' wasn't in the url;\n    // pass as a query string param instead\n    sURL.searchParams.set('recordingId', recordingId);\n    serverUrl = sURL.href;\n    // also include in initialPayload in case query string gets lost during upgrade or proxying\n    initialPayload.recordingId = recordingId;\n  }\n  if (sURL.pathname.endsWith('/ws')) {\n    sURL.pathname = sURL.pathname.slice(0, -3);\n  }\n  const postUrl = sURL.href;\n\n  if (includePii) {\n    initialPayload.visitor = getSetVisitorId();\n    try {\n      initialPayload.timezone =\n        Intl.DateTimeFormat().resolvedOptions().timeZone;\n    } catch (e) {\n      initialPayload.timezone = 'unknown';\n    }\n    try {\n      if (navigator.languages !== undefined) {\n        initialPayload.language = navigator.languages[0];\n      } else {\n        initialPayload.language = navigator.language;\n      }\n    } catch (e) {\n      initialPayload.language = 'unknown';\n    }\n    // initialPayload.userAgent = navigator.userAgent;  // we should be able to get this server side\n    // the following is different to EventType.Meta width/height\n    // which is used in replay; it's more about what size screen\n    // the visitor has for analytics\n    initialPayload.screenWidth = screen.width;\n    initialPayload.screenHeight = screen.height;\n    initialPayload.devicePixelRatio = window.devicePixelRatio;\n  }\n  if (options.meta) {\n    Object.assign(initialPayload, options.meta);\n  }\n  initialPayload.recordVersion = __RRWEB_BROWSER_CLIENT_VERSION__;\n  initialPayload.recordCommitHash = __RRWEB_BROWSER_CLIENT_COMMIT_HASH__;\n  initialPayload.jsEntrypoint = jsEntrypoint ?? 'programmatic';\n\n  const jsSource = sanitizeScriptSource(rawJsSource);\n  if (jsSource) {\n    initialPayload.jsSource = jsSource;\n  }\n\n  const metaEvent: customEventWithTime = {\n    timestamp: nowTimestamp(),\n    type: EventType.Custom,\n    data: {\n      tag: 'recording-meta',\n      payload: initialPayload,\n    },\n  };\n  // metadata event should be the first seen server side\n  buffer.add(JSON.stringify(metaEvent));\n\n  recordOptions.emit = (event: eventWithTime) => {\n    if (!ws) {\n      // don't make a connection until rrweb starts (looks at document.readyState and waits for DOMContentLoaded or load)\n      ws = connect(serverUrl, postUrl, publicApiKey, handleMessage);\n\n      ws.addEventListener(WebsocketEvent.close, () => {\n        // fallback to postData while backoff algorithm is in effect\n        wsConnectionPaused = true;\n      });\n    }\n    if (configEmit !== undefined) {\n      if (typeof configEmit === 'function') {\n        configEmit(event);\n      } else if (\n        typeof (window as unknown as Record<string, unknown>)[configEmit] ===\n        'function'\n      ) {\n        const emit = (window as unknown as Record<string, unknown>)[\n          configEmit\n        ] as (event: eventWithTime) => void;\n        emit(event);\n      } else {\n        console.error('Could not understand emit config option:', configEmit);\n      }\n    }\n    if (event.type === EventType.Meta && includePii) {\n      const metaData = event.data as typeof event.data & {\n        title?: string;\n        referrer?: string;\n      };\n      metaData.title = document.title.substring(0, 500); // already recorded in rrweb as part of the <title> element\n      metaData.referrer = document.referrer; // could potentially contain PII\n    }\n\n    const eventStr = JSON.stringify(event);\n    // TODO: add browser native compression\n    if (eventStr.length > wsLimit) {\n      // Assuming wsLimit is a defined constant, and eventStr.length is intended.\n      void postData(postUrl, publicApiKey, eventStr);\n    } else if (ws && !wsConnectionPaused) {\n      ws.send(eventStr);\n    } else {\n      buffer.add(eventStr);\n    }\n  };\n\n  let startWhenVisible = false;\n  if (!document.hidden) {\n    rrwebStopFn = record(recordOptions as recordOptions<eventWithTime>);\n  } else {\n    startWhenVisible = true;\n  }\n  if (typeof document.hidden !== 'undefined') {\n    document.addEventListener(\n      'visibilitychange',\n      () => {\n        if (!document.hidden && startWhenVisible) {\n          rrwebStopFn = record(recordOptions as recordOptions<eventWithTime>);\n          startWhenVisible = false;\n          return;\n        }\n        try {\n          // either of 'page-hidden' or 'page-visible'\n          record.addCustomEvent('page-' + document.visibilityState, {});\n          if (document.hidden) {\n            /*\n            - a user navigates to a new page\n            - switches tabs\n            - closes the tab\n            - minimizes or closes the browser\n            - switches from the browser to a different app\n          */\n            // don't record background animations etc. while page isn't visible\n            record.freezePage();\n\n            // document.hidden is better than beforeunload, see:\n            // https://developer.chrome.com/docs/web-platform/page-lifecycle-api\n            if ((!ws || wsConnectionPaused) && buffer.length()) {\n              void postData(postUrl, publicApiKey, buffer);\n            }\n          }\n        } catch (e) {\n          // ignore, recording may not be active yet\n        }\n      },\n      false,\n    );\n  }\n  document.addEventListener('freeze', () => {\n    // https://developer.chrome.com/docs/web-platform/page-lifecycle-api\n    // \"In particular, it's important that you ... close any open Web Socket connections\n    if (ws) {\n      ws.close();\n      wsConnectionPaused = false;\n      ws = undefined; // so `emit` can restart it again if page is unfrozen\n    }\n    if (rrwebStopFn !== undefined) {\n      rrwebStopFn();\n      startWhenVisible = true;\n    }\n  });\n}\n\nexport const addCustomEvent = <T>(tag: string, payload: T) => {\n  if (rrwebStopFn !== undefined) {\n    record.addCustomEvent(tag, payload);\n  } else {\n    const customEvent: customEventWithTime = {\n      timestamp: nowTimestamp(),\n      type: EventType.Custom,\n      data: {\n        tag,\n        payload,\n      },\n    };\n    // let websocket buffer handle it\n    buffer.add(JSON.stringify(customEvent));\n  }\n};\n\nexport function addMeta(payload: nameValues) {\n  addCustomEvent('recording-meta', payload);\n}\n\nexport function addPageviewMeta(payload: nameValues) {\n  // could alter timestamp to match Meta/FullSnapshot event\n  addCustomEvent('pageview-meta', payload);\n}\n\nif (document && document.currentScript) {\n  let config = defaultClientConfig;\n  const truthyAttr: readonly (string | null)[] = ['', 'yes', 'on', 'true', '1']; // empty string allows setting plain html5 attributes without values\n  const self = document.currentScript as HTMLScriptElement;\n  if (self.innerText && self.innerText.trim()) {\n    try {\n      // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- script tag config is an external payload.\n      config = JSON.parse(\n        self.innerText\n          .replace(/^\\s*\\/\\/.*/gm, '') // remove comment lines\n          .replace(/,(\\s*[\\]}])/g, '$1'), // allow trailing commas\n      );\n    } catch (error) {\n      console.error(\n        '@rrweb/browser-client: Could not parse script tag config as JSON',\n        error,\n      );\n    }\n  }\n  config.jsSource ??= scriptSourceFromElement(self);\n  config.jsEntrypoint ??= self.dataset.rrwebEntrypoint || 'script-tag';\n  if (truthyAttr.includes(self.getAttribute('includepii'))) {\n    config.includePii = true;\n  }\n  if (self.src) {\n    try {\n      if (config.serverUrl) {\n        // transform provided relative URLs into absolute based on where we are served from\n        config.serverUrl = new URL(config.serverUrl, self.src).href;\n      } else {\n        // generate a default server url\n        const srcUrl = new URL(self.src);\n        if (srcUrl.hostname) {\n          let apiHost = srcUrl.hostname;\n          if (\n            apiHost === 'rrweb.com' ||\n            apiHost === 'www.rrweb.com' ||\n            apiHost === 'cdn.rrweb.com' ||\n            apiHost === 'rrweb.io' ||\n            apiHost.endsWith('.rrweb.io')\n          ) {\n            apiHost = 'api.rrweb.com';\n          }\n          config.serverUrl = `https://${apiHost}/recordings/{recordingId}/events/ws`;\n        }\n      }\n    } catch {\n      // maybe we are in a weird environment, we're likely gonna fail when we next call new URL on serverurl\n    }\n  }\n  // if start later (no autostart), or manually stop and (re)start() later\n  defaultClientConfig = config;\n  if (config.autostart || truthyAttr.includes(self.getAttribute('autostart'))) {\n    start(config);\n  }\n}\n\nexport default {\n  start,\n  stop,\n  addMeta,\n  addPageviewMeta,\n  addCustomEvent,\n  getRecordingId,\n};\n"],
  "mappings": ";;;;;;;;;;;;;itBAAA,IAAIA,GAAY,OAAO,eACnBC,GAAkB,CAACC,EAAKC,EAAKC,IAAUD,KAAOD,EAAMF,GAAUE,EAAKC,EAAK,CAAE,WAAY,GAAM,aAAc,GAAM,SAAU,GAAM,MAAAC,CAAK,CAAE,EAAIF,EAAIC,CAAG,EAAIC,EACtJC,EAAgB,CAACH,EAAKC,EAAKC,IAAUH,GAAgBC,EAAK,OAAOC,GAAQ,SAAWA,EAAM,GAAKA,EAAKC,CAAK,EACzGE,GACAC,GAA8BC,IAChCA,EAAWA,EAAW,iBAAsB,CAAC,EAAI,mBACjDA,EAAWA,EAAW,KAAU,CAAC,EAAI,OACrCA,EAAWA,EAAW,aAAkB,CAAC,EAAI,eAC7CA,EAAWA,EAAW,oBAAyB,CAAC,EAAI,sBACpDA,EAAWA,EAAW,KAAU,CAAC,EAAI,OACrCA,EAAWA,EAAW,OAAY,CAAC,EAAI,SACvCA,EAAWA,EAAW,OAAY,CAAC,EAAI,SACvCA,EAAWA,EAAW,MAAW,CAAC,EAAI,QAC/BA,IACND,GAAa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ACF",
  "names": ["__defProp", "__defNormalProp", "obj", "key", "value", "__publicField", "_a", "EventType", "EventType2", "IncrementalSource", "IncrementalSource2", "MouseInteractions", "MouseInteractions2", "PointerTypes", "PointerTypes2", "CanvasContext", "CanvasContext2", "MediaInteractions", "MediaInteractions2", "NodeType", "NodeType2", "testableAccessors", "testableMethods", "untaintedBasePrototype", "isAngularZonePresent", "getUntaintedPrototype", "defaultObj", "defaultPrototype", "accessorNames", "isUntaintedAccessors", "accessor", "_a2", "_b", "methodNames", "isUntaintedMethods", "method", "iframeEl", "win", "untaintedObject", "e", "untaintedAccessorCache", "getUntaintedAccessor", "instance", "cacheKey", "untaintedPrototype", "untaintedAccessor", "untaintedMethodCache", "getUntaintedMethod", "untaintedMethod", "ownerDocument", "n", "childNodes", "parentNode", "parentElement", "textContent", "contains", "other", "getRootNode", "host", "styleSheets", "shadowRoot", "querySelector", "selectors", "querySelectorAll", "mutationObserverCtor", "nowTimestamp", "patch", "source", "name", "replacement", "original", "wrapped", "index", "isElement", "isShadowRoot", "hostEl", "isNativeShadowDom", "shadowRoot2", "fixBrowserCompatibilityIssuesInCSS", "cssText", "escapeImportStatement", "rule", "statement", "stringifyStylesheet", "s", "rules", "sheetHref", "stringifiedRules", "stringifyRule", "error", "isCSSImportRule", "importStringified", "absolutifyURLs", "ruleStringified", "isCSSStyleRule", "fixSafariColons", "cssStringified", "regex", "Mirror", "id", "childNode", "node", "meta", "oldNode", "createMirror", "maskInputValue", "element", "maskInputOptions", "tagName", "type", "maskInputFn", "text", "actualType", "toLowerCase", "str", "ORIGINAL_ATTRIBUTE_NAME", "is2DCanvasBlank", "canvas", "ctx", "chunkSize", "x", "y", "getImageData", "originalGetImageData", "pixel", "getInputType", "extractFileExtension", "path", "baseURL", "url", "err", "match", "extractOrigin", "origin", "URL_IN_CSS_REF", "URL_PROTOCOL_MATCH", "URL_WWW_MATCH", "DATA_URI", "href", "quote1", "path1", "quote2", "path2", "path3", "filePath", "maybeQuote", "stack", "parts", "part", "normalizeCssString", "_testNoPxNorm", "splitCssText", "style", "childNodes2", "splits", "iterCount", "cssTextNorm", "normFactor", "textContentNorm", "jLimit", "j", "startSubstring", "cssNormSplits", "splitNorm", "prevTextContent", "prevMinLength", "k", "normPart", "markCssSplits", "_id", "tagNameRegex", "IGNORED_NODE", "genId", "getValidTagName", "processedTagName", "canvasService", "canvasCtx", "SRCSET_NOT_SPACES", "SRCSET_COMMAS_OR_SPACES", "getAbsoluteSrcsetString", "doc", "attributeValue", "pos", "collectCharacters", "regEx", "chars2", "output", "absoluteToDoc", "descriptorsStr", "inParens", "c", "cachedDocument", "getHref", "isSVGElement", "el", "customHref", "a", "transformAttribute", "ignoreAttribute", "_value", "_isBlockedElement", "blockClass", "blockSelector", "eIndex", "className", "classMatchesRegex", "checkAncestors", "needMaskingText", "maskTextClass", "maskTextSelector", "onceIframeLoaded", "listener", "iframeLoadTimeout", "fired", "readyState", "timer", "blankUrl", "onceStylesheetLoaded", "link", "styleSheetLoadTimeout", "styleSheetLoaded", "serializeNode", "options", "mirror2", "needsMask", "inlineStylesheet", "maskTextFn", "dataURLOptions", "inlineImages", "recordCanvas", "keepIframeSrcFn", "newlyAddedElement", "cssCaptured", "rootId", "getRootId", "serializeElementNode", "serializeTextNode", "docId", "parent", "parentTagName", "textContent2", "isStyle", "isScript", "needBlock", "attributes", "len", "i", "attr", "stylesheet", "checked", "canvasDataURL", "blankCanvas", "blankCanvasDataURL", "image", "imageSrc", "priorCrossOrigin", "recordInlineImage", "mediaAttributes", "width", "height", "isCustomElement", "lowerIfExists", "maybeAttr", "slimDOMDefaults", "_slimDOMOptions", "slimDOMExcluded", "sn", "slimDOMOptions", "serializeNodeWithId", "skipChild", "onSerialize", "onIframeLoad", "onStylesheetLoad", "stylesheetLoadTimeout", "preserveWhiteSpace", "_serializedNode", "serializedNode", "recordChild", "shadowRootEl", "bypassOptions", "childN", "serializedChildNode", "iframeDoc", "serializedIframeNode", "serializedLinkNode", "snapshot", "maskAllInputs", "slimDOM", "BaseRRNode", "_args", "childIterator", "_newChild", "_refChild", "_node", "on", "fn", "target", "DEPARTED_MIRROR_ACCESS_WARNING", "_mirror", "prop", "receiver", "throttle", "func", "wait", "timeout", "previous", "args", "now", "remaining", "context", "hookSetter", "d", "isRevoked", "getWindowScroll", "_c", "_d", "getWindowHeight", "getWindowWidth", "closestElementOfNode", "isBlocked", "isSerialized", "isIgnored", "isAncestorRemoved", "legacy_isTouchEvent", "event", "polyfill", "isSerializedIframe", "isSerializedStylesheet", "hasShadowRoot", "StyleSheetMirror", "newId", "getShadowHost", "shadowHost", "getRootShadowHost", "rootShadowHost", "shadowHostInDom", "inDom", "isNodeInLinkedList", "DoubleLinkedList", "position", "current", "index2", "moveKey", "parentId", "MutationBuffer", "mutations", "adds", "addedIds", "addList", "getNextId", "ns", "nextId", "pushAdd", "parentTag", "currentN", "iframe", "childSn", "isParentRemoved", "isAncestorInSet", "candidate", "tailNode", "unhandledNode", "payload", "attribute", "diffAsStr", "unchangedAsStr", "textarea", "item", "cn", "m", "attributeName", "old", "pname", "newValue", "newPriority", "nodeId", "deepDelete", "processRemoves", "targetId", "addsSet", "cache", "queue", "next", "n2", "removes", "_isParentRemoved", "_mirror2", "set", "_isAncestorInSet", "errorHandler", "registerErrorHandler", "handler", "unregisterErrorHandler", "callbackWrapper", "cb", "rest", "mutationBuffers", "getEventTarget", "initMutationObserver", "rootEl", "mutationBuffer", "observer", "initMoveObserver", "mousemoveCb", "sampling", "threshold", "callbackThreshold", "positions", "timeBaseline", "wrappedCb", "totalOffset", "p", "updatePosition", "evt", "clientX", "clientY", "handlers", "initMouseInteractionObserver", "mouseInteractionCb", "disableMap", "currentPointerType", "getHandler", "eventKey", "pointerType", "thisEventKey", "__spreadValues", "eventName", "h", "initScrollObserver", "scrollCb", "scrollLeftTop", "initViewportResizeObserver", "viewportResizeCb", "lastH", "lastW", "updateDimension", "INPUT_TAGS", "lastInputValueMap", "initInputObserver", "inputCb", "ignoreClass", "ignoreSelector", "userTriggeredOnInput", "eventHandler", "userTriggered", "isChecked", "cbWithDedup", "text2", "v", "lastInputValue", "__spreadProps", "currentWindow", "propertyDescriptor", "hookProperties", "getNestedCSSRulePositions", "recurse", "childRule", "hasNestedCSSRule", "getIdAndStyleId", "sheet", "styleMirror", "styleId", "initStyleSheetObserver", "styleSheetRuleCb", "stylesheetManager", "insertRule", "thisArg", "argumentsList", "selector", "styleBlock", "deleteRule", "replace", "replaceSync", "supportedNestedCSSRuleTypes", "canMonkeyPatchNestedCSSRule", "unmodifiedFunctions", "typeKey", "initAdoptedStyleSheetObserver", "host2", "hostId", "patchTarget", "originalPropertyDescriptor", "_a3", "sheets", "result", "initStyleDeclarationObserver", "styleDeclarationCb", "ignoreCSSAttributes", "setProperty", "property", "priority", "removeProperty", "initMediaInteractionObserver", "mediaInteractionCb", "currentTime", "volume", "muted", "playbackRate", "loop", "initFontObserver", "fontCb", "fontMap", "originalFontFace", "family", "descriptors", "fontFace", "restoreHandler", "initSelectionObserver", "param", "selectionCb", "collapsed", "updateSelection", "selection", "ranges", "count", "range", "startContainer", "startOffset", "endContainer", "endOffset", "initCustomElementObserver", "customElementCb", "constructor", "mergeHooks", "o", "hooks", "mutationCb", "canvasMutationCb", "initObservers", "mutationObserver", "mousemoveHandler", "mouseInteractionHandler", "scrollHandler", "viewportResizeHandler", "inputHandler", "mediaInteractionHandler", "styleSheetObserver", "adoptedStyleSheetObserver", "styleDeclarationObserver", "fontObserver", "selectionObserver", "customElementObserver", "pluginHandlers", "plugin", "b", "CrossOriginIframeMirror", "generateIdFn", "remoteId", "idToRemoteMap", "remoteToIdMap", "idToRemoteIdMap", "remoteIdToIdMap", "map", "ids", "IframeManager", "message", "crossOriginMessageEvent", "transformedEvent", "iframeMirror", "keys", "child", "ShadowDomManager", "iframeElement", "manager", "option", "sRoot", "chars", "lookup", "encode", "arraybuffer", "bytes", "base64", "canvasVarMap", "variableListFor", "ctor", "contextMap", "saveWebGLVar", "isInstanceOfWebGLObject", "list", "serializeArg", "arg", "src", "serializeArgs", "initCanvas2DMutationObserver", "props2D", "recordArgs", "hookHandler", "getNormalizedContextName", "contextType", "initCanvasContextObserver", "setPreserveDrawingBufferToTrue", "ctxName", "contextAttributes", "patchGLPrototype", "prototype", "props", "mutation", "initCanvasWebGLMutationObserver", "jsContent", "blob", "WorkerWrapper", "objURL", "worker", "CanvasManager", "fps", "canvasContextReset", "snapshotInProgressMap", "timeBetweenSnapshots", "lastSnapshotTime", "rafId", "getCanvas", "matchedCanvas", "takeCanvasSnapshots", "timestamp", "bitmap", "canvas2DReset", "canvasWebGL1and2Reset", "setLatestRAFTimestamp", "_values", "valuesWithType", "values", "type2", "__objRest", "StylesheetManager", "linkEl", "adoptedStyleSheetData", "styles", "r", "_linkEl", "ProcessedNodeManager", "thisBuffer", "buffers", "buffer", "wrappedEmit", "takeFullSnapshot", "canvasManager", "recording", "cleanFrame", "mirror", "record", "emit", "checkoutEveryNms", "checkoutEveryNth", "_maskInputOptions", "packFn", "mousemoveWait", "recordDOM", "recordCrossOriginIframes", "recordAfter", "collectFonts", "plugins", "errorHandler2", "inEmittingFrame", "passEmitsToParent", "lastFullSnapshotEvent", "incrementalSnapshotCount", "eventProcessor", "isCheckout", "buf", "exceedCount", "exceedTime", "wrappedMutationEmit", "wrappedScrollEmit", "wrappedCanvasMutationEmit", "wrappedAdoptedStyleSheetEmit", "iframeManager", "processedNodeManager", "shadowDomManager", "observe", "init", "tag", "ExponentialBackoff", "base", "expMax", "ArrayQueue", "WebsocketEvent", "Websocket", "protocols", "_e", "_f", "_g", "_h", "_j", "_k", "_l", "_m", "_o", "_p", "_q", "data", "code", "reason", "isListenerNotToBeRemoved", "l", "eventListeners", "newEventListeners", "detail", "ele", "handleRetryEvent", "retryEventDetail", "WebsocketBuilder", "maxRetries", "instantReconnect", "backoff", "_r", "_s", "_t", "_u", "_v", "_w", "defaultServerUrl", "defaultClientConfig", "sessionStorageName", "wsLimit", "ws", "wsConnectionPaused", "rrwebStopFn", "isServerMessage", "sanitizeScriptSource", "scriptSourceFromElement", "script", "stop", "resetRecordingId", "closeEvent", "removeRecordingId", "getSetVisitorId", "nameEQ", "cp", "date", "expires", "secure", "domain", "getSetRecordingId", "getRecordingId", "connect", "serverUrl", "postUrl", "publicApiKey", "messageHandler", "wsUrl", "fallbackPosting", "postData", "ws2", "done", "responses", "toSend", "body", "sendSize", "eventStr", "response", "badResponse", "badResponseInfo", "start", "includePii", "rawJsSource", "jsEntrypoint", "recordOptions", "configEmit", "handleMessage", "_", "ev", "parsedEvent", "recordingId", "initialPayload", "sURL", "jsSource", "metaEvent", "metaData", "startWhenVisible", "addCustomEvent", "customEvent", "addMeta", "addPageviewMeta", "config", "truthyAttr", "self", "srcUrl", "apiHost"]
}
