@powerit/cms-tracker 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../../../node_modules/rrweb/dist/rrweb.js","../src/session.js","../src/privacy.js","../src/compression.js","../src/recorder.js","../src/index.js"],"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 __defProp$1 = Object.defineProperty;\nvar __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\nvar NodeType$3 = /* @__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$3 || {});\nconst testableAccessors$1 = {\n Node: [\"childNodes\", \"parentNode\", \"parentElement\", \"textContent\"],\n ShadowRoot: [\"host\", \"styleSheets\"],\n Element: [\"shadowRoot\", \"querySelector\", \"querySelectorAll\"],\n MutationObserver: []\n};\nconst testableMethods$1 = {\n Node: [\"contains\", \"getRootNode\"],\n ShadowRoot: [\"getSelection\"],\n Element: [],\n MutationObserver: [\"constructor\"]\n};\nconst untaintedBasePrototype$1 = {};\nconst isAngularZonePresent$1 = () => {\n return !!globalThis.Zone;\n};\nfunction getUntaintedPrototype$1(key) {\n if (untaintedBasePrototype$1[key])\n return untaintedBasePrototype$1[key];\n const defaultObj = globalThis[key];\n const defaultPrototype = defaultObj.prototype;\n const accessorNames = key in testableAccessors$1 ? testableAccessors$1[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$1 ? testableMethods$1[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$1()) {\n untaintedBasePrototype$1[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$1[key] = untaintedObject;\n } catch {\n return defaultPrototype;\n }\n}\nconst untaintedAccessorCache$1 = {};\nfunction getUntaintedAccessor$1(key, instance, accessor) {\n var _a2;\n const cacheKey = `${key}.${String(accessor)}`;\n if (untaintedAccessorCache$1[cacheKey])\n return untaintedAccessorCache$1[cacheKey].call(\n instance\n );\n const untaintedPrototype = getUntaintedPrototype$1(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$1[cacheKey] = untaintedAccessor;\n return untaintedAccessor.call(instance);\n}\nconst untaintedMethodCache$1 = {};\nfunction getUntaintedMethod$1(key, instance, method) {\n const cacheKey = `${key}.${String(method)}`;\n if (untaintedMethodCache$1[cacheKey])\n return untaintedMethodCache$1[cacheKey].bind(\n instance\n );\n const untaintedPrototype = getUntaintedPrototype$1(key);\n const untaintedMethod = untaintedPrototype[method];\n if (typeof untaintedMethod !== \"function\") return instance[method];\n untaintedMethodCache$1[cacheKey] = untaintedMethod;\n return untaintedMethod.bind(instance);\n}\nfunction childNodes$1(n2) {\n return getUntaintedAccessor$1(\"Node\", n2, \"childNodes\");\n}\nfunction parentNode$1(n2) {\n return getUntaintedAccessor$1(\"Node\", n2, \"parentNode\");\n}\nfunction parentElement$1(n2) {\n return getUntaintedAccessor$1(\"Node\", n2, \"parentElement\");\n}\nfunction textContent$1(n2) {\n return getUntaintedAccessor$1(\"Node\", n2, \"textContent\");\n}\nfunction contains$1(n2, other) {\n return getUntaintedMethod$1(\"Node\", n2, \"contains\")(other);\n}\nfunction getRootNode$1(n2) {\n return getUntaintedMethod$1(\"Node\", n2, \"getRootNode\")();\n}\nfunction host$1(n2) {\n if (!n2 || !(\"host\" in n2)) return null;\n return getUntaintedAccessor$1(\"ShadowRoot\", n2, \"host\");\n}\nfunction styleSheets$1(n2) {\n return n2.styleSheets;\n}\nfunction shadowRoot$1(n2) {\n if (!n2 || !(\"shadowRoot\" in n2)) return null;\n return getUntaintedAccessor$1(\"Element\", n2, \"shadowRoot\");\n}\nfunction querySelector$1(n2, selectors) {\n return getUntaintedAccessor$1(\"Element\", n2, \"querySelector\")(selectors);\n}\nfunction querySelectorAll$1(n2, selectors) {\n return getUntaintedAccessor$1(\"Element\", n2, \"querySelectorAll\")(selectors);\n}\nfunction mutationObserverCtor$1() {\n return getUntaintedPrototype$1(\"MutationObserver\").constructor;\n}\nconst index$1 = {\n childNodes: childNodes$1,\n parentNode: parentNode$1,\n parentElement: parentElement$1,\n textContent: textContent$1,\n contains: contains$1,\n getRootNode: getRootNode$1,\n host: host$1,\n styleSheets: styleSheets$1,\n shadowRoot: shadowRoot$1,\n querySelector: querySelector$1,\n querySelectorAll: querySelectorAll$1,\n mutationObserver: mutationObserverCtor$1\n};\nfunction isElement(n2) {\n return n2.nodeType === n2.ELEMENT_NODE;\n}\nfunction isShadowRoot(n2) {\n const hostEl = (\n // anchor and textarea elements also have a `host` property\n // but only shadow roots have a `mode` property\n n2 && \"host\" in n2 && \"mode\" in n2 && index$1.host(n2) || null\n );\n return Boolean(\n hostEl && \"shadowRoot\" in hostEl && index$1.shadowRoot(hostEl) === n2\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(rule2) {\n const { cssText } = rule2;\n if (cssText.split('\"').length < 3) return cssText;\n const statement = [\"@import\", `url(${JSON.stringify(rule2.href)})`];\n if (rule2.layerName === \"\") {\n statement.push(`layer`);\n } else if (rule2.layerName) {\n statement.push(`layer(${rule2.layerName})`);\n }\n if (rule2.supportsText) {\n statement.push(`supports(${rule2.supportsText})`);\n }\n if (rule2.media.length) {\n statement.push(rule2.media.mediaText);\n }\n return statement.join(\" \") + \";\";\n}\nfunction stringifyStylesheet(s2) {\n try {\n const rules2 = s2.rules || s2.cssRules;\n if (!rules2) {\n return null;\n }\n let sheetHref = s2.href;\n if (!sheetHref && s2.ownerNode && s2.ownerNode.ownerDocument) {\n sheetHref = s2.ownerNode.ownerDocument.location.href;\n }\n const stringifiedRules = Array.from(\n rules2,\n (rule2) => stringifyRule(rule2, sheetHref)\n ).join(\"\");\n return fixBrowserCompatibilityIssuesInCSS(stringifiedRules);\n } catch (error) {\n return null;\n }\n}\nfunction stringifyRule(rule2, sheetHref) {\n if (isCSSImportRule(rule2)) {\n let importStringified;\n try {\n importStringified = // for same-origin stylesheets,\n // we can access the imported stylesheet rules directly\n stringifyStylesheet(rule2.styleSheet) || // work around browser issues with the raw string `@import url(...)` statement\n escapeImportStatement(rule2);\n } catch (error) {\n importStringified = rule2.cssText;\n }\n if (rule2.styleSheet.href) {\n return absolutifyURLs(importStringified, rule2.styleSheet.href);\n }\n return importStringified;\n } else {\n let ruleStringified = rule2.cssText;\n if (isCSSStyleRule(rule2) && rule2.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(rule2) {\n return \"styleSheet\" in rule2;\n}\nfunction isCSSStyleRule(rule2) {\n return \"selectorText\" in rule2;\n}\nclass Mirror {\n constructor() {\n __publicField$1(this, \"idNodeMap\", /* @__PURE__ */ new Map());\n __publicField$1(this, \"nodeMetaMap\", /* @__PURE__ */ new WeakMap());\n }\n getId(n2) {\n var _a2;\n if (!n2) return -1;\n const id = (_a2 = this.getMeta(n2)) == 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(n2) {\n return this.nodeMetaMap.get(n2) || null;\n }\n // removes the node from idNodeMap\n // doesn't remove the node from nodeMetaMap\n removeNodeFromMap(n2) {\n const id = this.getId(n2);\n this.idNodeMap.delete(id);\n if (n2.childNodes) {\n n2.childNodes.forEach(\n (childNode) => this.removeNodeFromMap(childNode)\n );\n }\n }\n has(id) {\n return this.idNodeMap.has(id);\n }\n hasNode(node2) {\n return this.nodeMetaMap.has(node2);\n }\n add(n2, meta) {\n const id = meta.id;\n this.idNodeMap.set(id, n2);\n this.nodeMetaMap.set(n2, meta);\n }\n replace(id, n2) {\n const oldNode = this.getNode(id);\n if (oldNode) {\n const meta = this.nodeMetaMap.get(oldNode);\n if (meta) this.nodeMetaMap.set(n2, meta);\n }\n this.idNodeMap.set(id, n2);\n }\n reset() {\n this.idNodeMap = /* @__PURE__ */ new Map();\n this.nodeMetaMap = /* @__PURE__ */ new WeakMap();\n }\n}\nfunction createMirror$2() {\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 x2 = 0; x2 < canvas.width; x2 += 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 x2,\n y,\n Math.min(chunkSize, canvas.width - x2),\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 isNodeMetaEqual(a2, b) {\n if (!a2 || !b || a2.type !== b.type) return false;\n if (a2.type === NodeType$3.Document)\n return a2.compatMode === b.compatMode;\n else if (a2.type === NodeType$3.DocumentType)\n return a2.name === b.name && a2.publicId === b.publicId && a2.systemId === b.systemId;\n else if (a2.type === NodeType$3.Comment || a2.type === NodeType$3.Text || a2.type === NodeType$3.CDATA)\n return a2.textContent === b.textContent;\n else if (a2.type === NodeType$3.Element)\n return a2.tagName === b.tagName && JSON.stringify(a2.attributes) === JSON.stringify(b.attributes) && a2.isSVG === b.isSVG && a2.needBlock === b.needBlock;\n return false;\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) {\n return cssText.replace(/(\\/\\*[^*]*\\*\\/)|[\\s;]/g, \"\");\n}\nfunction splitCssText(cssText, style) {\n const childNodes2 = Array.from(style.childNodes);\n const splits = [];\n if (childNodes2.length > 1 && cssText && typeof cssText === \"string\") {\n const cssTextNorm = normalizeCssString(cssText);\n for (let i2 = 1; i2 < childNodes2.length; i2++) {\n if (childNodes2[i2].textContent && typeof childNodes2[i2].textContent === \"string\") {\n const textContentNorm = normalizeCssString(childNodes2[i2].textContent);\n for (let j = 3; j < textContentNorm.length; j++) {\n const bit = textContentNorm.substring(0, j);\n if (cssTextNorm.split(bit).length === 2) {\n const splitNorm = cssTextNorm.indexOf(bit);\n for (let k = splitNorm; k < cssText.length; k++) {\n if (normalizeCssString(cssText.substring(0, k)).length === splitNorm) {\n splits.push(cssText.substring(0, k));\n cssText = cssText.substring(k);\n break;\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$1(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 c2 = attributeValue.charAt(pos);\n if (c2 === \"\") {\n output.push((url + descriptorsStr).trim());\n break;\n } else if (!inParens) {\n if (c2 === \",\") {\n pos += 1;\n output.push((url + descriptorsStr).trim());\n break;\n } else if (c2 === \"(\") {\n inParens = true;\n }\n } else {\n if (c2 === \")\") {\n inParens = false;\n }\n }\n descriptorsStr += c2;\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 a2 = cachedDocument.get(doc);\n if (!a2) {\n a2 = doc.createElement(\"a\");\n cachedDocument.set(doc, a2);\n }\n if (!customHref) {\n customHref = \"\";\n } else if (customHref.startsWith(\"blob:\") || customHref.startsWith(\"data:\")) {\n return customHref;\n }\n a2.setAttribute(\"href\", customHref);\n return a2.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\" && (tagName === \"table\" || tagName === \"td\" || tagName === \"th\")) {\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 (tagName === \"video\" || tagName === \"audio\") && 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 (e2) {\n }\n return false;\n}\nfunction classMatchesRegex(node2, regex, checkAncestors) {\n if (!node2) return false;\n if (node2.nodeType !== node2.ELEMENT_NODE) {\n if (!checkAncestors) return false;\n return classMatchesRegex(index$1.parentNode(node2), regex, checkAncestors);\n }\n for (let eIndex = node2.classList.length; eIndex--; ) {\n const className = node2.classList[eIndex];\n if (regex.test(className)) {\n return true;\n }\n }\n if (!checkAncestors) return false;\n return classMatchesRegex(index$1.parentNode(node2), regex, checkAncestors);\n}\nfunction needMaskingText(node2, maskTextClass, maskTextSelector, checkAncestors) {\n let el;\n if (isElement(node2)) {\n el = node2;\n if (!index$1.childNodes(el).length) {\n return false;\n }\n } else if (index$1.parentElement(node2) === null) {\n return false;\n } else {\n el = index$1.parentElement(node2);\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 (e2) {\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(n2, 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 (n2.nodeType) {\n case n2.DOCUMENT_NODE:\n if (n2.compatMode !== \"CSS1Compat\") {\n return {\n type: NodeType$3.Document,\n childNodes: [],\n compatMode: n2.compatMode\n // probably \"BackCompat\"\n };\n } else {\n return {\n type: NodeType$3.Document,\n childNodes: []\n };\n }\n case n2.DOCUMENT_TYPE_NODE:\n return {\n type: NodeType$3.DocumentType,\n name: n2.name,\n publicId: n2.publicId,\n systemId: n2.systemId,\n rootId\n };\n case n2.ELEMENT_NODE:\n return serializeElementNode(n2, {\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 n2.TEXT_NODE:\n return serializeTextNode(n2, {\n doc,\n needsMask,\n maskTextFn,\n rootId,\n cssCaptured\n });\n case n2.CDATA_SECTION_NODE:\n return {\n type: NodeType$3.CDATA,\n textContent: \"\",\n rootId\n };\n case n2.COMMENT_NODE:\n return {\n type: NodeType$3.Comment,\n textContent: index$1.textContent(n2) || \"\",\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(n2, options) {\n const { needsMask, maskTextFn, rootId, cssCaptured } = options;\n const parent = index$1.parentNode(n2);\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$1.textContent(n2);\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$1.parentElement(n2)) : textContent2.replace(/[\\S]/g, \"*\");\n }\n return {\n type: NodeType$3.Text,\n textContent: textContent2 || \"\",\n rootId\n };\n}\nfunction serializeElementNode(n2, 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(n2, blockClass, blockSelector);\n const tagName = getValidTagName$1(n2);\n let attributes = {};\n const len = n2.attributes.length;\n for (let i2 = 0; i2 < len; i2++) {\n const attr = n2.attributes[i2];\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((s2) => {\n return s2.href === n2.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\" && n2.sheet) {\n let cssText = stringifyStylesheet(\n n2.sheet\n );\n if (cssText) {\n if (n2.childNodes.length > 1) {\n cssText = markCssSplits(cssText, n2);\n }\n attributes._cssText = cssText;\n }\n }\n if (tagName === \"input\" || tagName === \"textarea\" || tagName === \"select\") {\n const value = n2.value;\n const checked = n2.checked;\n if (attributes.type !== \"radio\" && attributes.type !== \"checkbox\" && attributes.type !== \"submit\" && attributes.type !== \"button\" && value) {\n attributes.value = maskInputValue({\n element: n2,\n type: getInputType(n2),\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 (n2.selected && !maskInputOptions[\"select\"]) {\n attributes.selected = true;\n } else {\n delete attributes.selected;\n }\n }\n if (tagName === \"dialog\" && n2.open) {\n attributes.rr_open_mode = n2.matches(\"dialog:modal\") ? \"modal\" : \"non-modal\";\n }\n if (tagName === \"canvas\" && recordCanvas) {\n if (n2.__context === \"2d\") {\n if (!is2DCanvasBlank(n2)) {\n attributes.rr_dataURL = n2.toDataURL(\n dataURLOptions.type,\n dataURLOptions.quality\n );\n }\n } else if (!(\"__context\" in n2)) {\n const canvasDataURL = n2.toDataURL(\n dataURLOptions.type,\n dataURLOptions.quality\n );\n const blankCanvas = doc.createElement(\"canvas\");\n blankCanvas.width = n2.width;\n blankCanvas.height = n2.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 = n2;\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 (tagName === \"audio\" || tagName === \"video\") {\n const mediaAttributes = attributes;\n mediaAttributes.rr_mediaState = n2.paused ? \"paused\" : \"played\";\n mediaAttributes.rr_mediaCurrentTime = n2.currentTime;\n mediaAttributes.rr_mediaPlaybackRate = n2.playbackRate;\n mediaAttributes.rr_mediaMuted = n2.muted;\n mediaAttributes.rr_mediaLoop = n2.loop;\n mediaAttributes.rr_mediaVolume = n2.volume;\n }\n if (!newlyAddedElement) {\n if (n2.scrollLeft) {\n attributes.rr_scrollLeft = n2.scrollLeft;\n }\n if (n2.scrollTop) {\n attributes.rr_scrollTop = n2.scrollTop;\n }\n }\n if (needBlock) {\n const { width, height } = n2.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 (!n2.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 (e2) {\n }\n return {\n type: NodeType$3.Element,\n tagName,\n attributes,\n childNodes: [],\n isSVG: isSVGElement(n2) || 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 slimDOMExcluded(sn, slimDOMOptions) {\n if (slimDOMOptions.comment && sn.type === NodeType$3.Comment) {\n return true;\n } else if (sn.type === NodeType$3.Element) {\n if (slimDOMOptions.script && // script tag\n (sn.tagName === \"script\" || // (module)preload link\n sn.tagName === \"link\" && (sn.attributes.rel === \"preload\" || sn.attributes.rel === \"modulepreload\") && sn.attributes.as === \"script\" || // 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(n2, 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 n2,\n maskTextClass,\n maskTextSelector,\n checkAncestors\n );\n }\n const _serializedNode = serializeNode(n2, {\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(n2, \"not serialized\");\n return null;\n }\n let id;\n if (mirror2.hasNode(n2)) {\n id = mirror2.getId(n2);\n } else if (slimDOMExcluded(_serializedNode, slimDOMOptions) || !preserveWhiteSpace && _serializedNode.type === NodeType$3.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(n2, serializedNode);\n if (id === IGNORED_NODE) {\n return null;\n }\n if (onSerialize) {\n onSerialize(n2);\n }\n let recordChild = !skipChild;\n if (serializedNode.type === NodeType$3.Element) {\n recordChild = recordChild && !serializedNode.needBlock;\n delete serializedNode.needBlock;\n const shadowRootEl = index$1.shadowRoot(n2);\n if (shadowRootEl && isNativeShadowDom(shadowRootEl))\n serializedNode.isShadowHost = true;\n }\n if ((serializedNode.type === NodeType$3.Document || serializedNode.type === NodeType$3.Element) && recordChild) {\n if (slimDOMOptions.headWhitespace && serializedNode.type === NodeType$3.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$3.Element && serializedNode.tagName === \"textarea\" && serializedNode.attributes.value !== void 0) ;\n else {\n if (serializedNode.type === NodeType$3.Element && serializedNode.attributes._cssText !== void 0 && typeof serializedNode.attributes._cssText === \"string\") {\n bypassOptions.cssCaptured = true;\n }\n for (const childN of Array.from(index$1.childNodes(n2))) {\n const serializedChildNode = serializeNodeWithId(childN, bypassOptions);\n if (serializedChildNode) {\n serializedNode.childNodes.push(serializedChildNode);\n }\n }\n }\n let shadowRootEl = null;\n if (isElement(n2) && (shadowRootEl = index$1.shadowRoot(n2))) {\n for (const childN of Array.from(index$1.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$1.parentNode(n2);\n if (parent && isShadowRoot(parent) && isNativeShadowDom(parent)) {\n serializedNode.isShadow = true;\n }\n if (serializedNode.type === NodeType$3.Element && serializedNode.tagName === \"iframe\") {\n onceIframeLoaded(\n n2,\n () => {\n const iframeDoc = n2.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 n2,\n serializedIframeNode\n );\n }\n }\n },\n iframeLoadTimeout\n );\n }\n if (serializedNode.type === NodeType$3.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 n2,\n () => {\n if (onStylesheetLoad) {\n const serializedLinkNode = serializeNodeWithId(n2, {\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 n2,\n serializedLinkNode\n );\n }\n }\n },\n stylesheetLoadTimeout\n );\n }\n return serializedNode;\n}\nfunction snapshot(n2, 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 = slimDOM === true || slimDOM === \"all\" ? (\n // if true: set of sensible options that should not throw away any information\n {\n script: true,\n comment: true,\n headFavicon: true,\n headWhitespace: true,\n headMetaDescKeywords: slimDOM === \"all\",\n // destructive\n headMetaSocial: true,\n headMetaRobots: true,\n headMetaHttpEquiv: true,\n headMetaAuthorship: true,\n headMetaVerification: true\n }\n ) : slimDOM === false ? {} : slimDOM;\n return serializeNodeWithId(n2, {\n doc: n2,\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}\nconst MEDIA_SELECTOR = /(max|min)-device-(width|height)/;\nconst MEDIA_SELECTOR_GLOBAL = new RegExp(MEDIA_SELECTOR.source, \"g\");\nconst mediaSelectorPlugin = {\n postcssPlugin: \"postcss-custom-selectors\",\n prepare() {\n return {\n postcssPlugin: \"postcss-custom-selectors\",\n AtRule: function(atrule) {\n if (atrule.params.match(MEDIA_SELECTOR_GLOBAL)) {\n atrule.params = atrule.params.replace(MEDIA_SELECTOR_GLOBAL, \"$1-$2\");\n }\n }\n };\n }\n};\nconst pseudoClassPlugin = {\n postcssPlugin: \"postcss-hover-classes\",\n prepare: function() {\n const fixed = [];\n return {\n Rule: function(rule2) {\n if (fixed.indexOf(rule2) !== -1) {\n return;\n }\n fixed.push(rule2);\n rule2.selectors.forEach(function(selector) {\n if (selector.includes(\":hover\")) {\n rule2.selector += \",\\n\" + selector.replace(/:hover/g, \".\\\\:hover\");\n }\n });\n }\n };\n }\n};\nfunction getDefaultExportFromCjs$1(x2) {\n return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, \"default\") ? x2[\"default\"] : x2;\n}\nfunction getAugmentedNamespace$1(n2) {\n if (n2.__esModule) return n2;\n var f2 = n2.default;\n if (typeof f2 == \"function\") {\n var a2 = function a22() {\n if (this instanceof a22) {\n return Reflect.construct(f2, arguments, this.constructor);\n }\n return f2.apply(this, arguments);\n };\n a2.prototype = f2.prototype;\n } else a2 = {};\n Object.defineProperty(a2, \"__esModule\", { value: true });\n Object.keys(n2).forEach(function(k) {\n var d = Object.getOwnPropertyDescriptor(n2, k);\n Object.defineProperty(a2, k, d.get ? d : {\n enumerable: true,\n get: function() {\n return n2[k];\n }\n });\n });\n return a2;\n}\nvar picocolors_browser$1 = { exports: {} };\nvar x$1 = String;\nvar create$1 = function() {\n return { isColorSupported: false, reset: x$1, bold: x$1, dim: x$1, italic: x$1, underline: x$1, inverse: x$1, hidden: x$1, strikethrough: x$1, black: x$1, red: x$1, green: x$1, yellow: x$1, blue: x$1, magenta: x$1, cyan: x$1, white: x$1, gray: x$1, bgBlack: x$1, bgRed: x$1, bgGreen: x$1, bgYellow: x$1, bgBlue: x$1, bgMagenta: x$1, bgCyan: x$1, bgWhite: x$1 };\n};\npicocolors_browser$1.exports = create$1();\npicocolors_browser$1.exports.createColors = create$1;\nvar picocolors_browserExports$1 = picocolors_browser$1.exports;\nconst __viteBrowserExternal$2 = {};\nconst __viteBrowserExternal$1$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n default: __viteBrowserExternal$2\n}, Symbol.toStringTag, { value: \"Module\" }));\nconst require$$2$1 = /* @__PURE__ */ getAugmentedNamespace$1(__viteBrowserExternal$1$1);\nlet pico$1 = picocolors_browserExports$1;\nlet terminalHighlight$1$1 = require$$2$1;\nlet CssSyntaxError$3$1 = class CssSyntaxError extends Error {\n constructor(message, line, column, source, file, plugin22) {\n super(message);\n this.name = \"CssSyntaxError\";\n this.reason = message;\n if (file) {\n this.file = file;\n }\n if (source) {\n this.source = source;\n }\n if (plugin22) {\n this.plugin = plugin22;\n }\n if (typeof line !== \"undefined\" && typeof column !== \"undefined\") {\n if (typeof line === \"number\") {\n this.line = line;\n this.column = column;\n } else {\n this.line = line.line;\n this.column = line.column;\n this.endLine = column.line;\n this.endColumn = column.column;\n }\n }\n this.setMessage();\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, CssSyntaxError);\n }\n }\n setMessage() {\n this.message = this.plugin ? this.plugin + \": \" : \"\";\n this.message += this.file ? this.file : \"<css input>\";\n if (typeof this.line !== \"undefined\") {\n this.message += \":\" + this.line + \":\" + this.column;\n }\n this.message += \": \" + this.reason;\n }\n showSourceCode(color) {\n if (!this.source) return \"\";\n let css = this.source;\n if (color == null) color = pico$1.isColorSupported;\n if (terminalHighlight$1$1) {\n if (color) css = terminalHighlight$1$1(css);\n }\n let lines = css.split(/\\r?\\n/);\n let start = Math.max(this.line - 3, 0);\n let end = Math.min(this.line + 2, lines.length);\n let maxWidth = String(end).length;\n let mark, aside;\n if (color) {\n let { bold, gray, red } = pico$1.createColors(true);\n mark = (text) => bold(red(text));\n aside = (text) => gray(text);\n } else {\n mark = aside = (str) => str;\n }\n return lines.slice(start, end).map((line, index2) => {\n let number = start + 1 + index2;\n let gutter = \" \" + (\" \" + number).slice(-maxWidth) + \" | \";\n if (number === this.line) {\n let spacing = aside(gutter.replace(/\\d/g, \" \")) + line.slice(0, this.column - 1).replace(/[^\\t]/g, \" \");\n return mark(\">\") + aside(gutter) + line + \"\\n \" + spacing + mark(\"^\");\n }\n return \" \" + aside(gutter) + line;\n }).join(\"\\n\");\n }\n toString() {\n let code = this.showSourceCode();\n if (code) {\n code = \"\\n\\n\" + code + \"\\n\";\n }\n return this.name + \": \" + this.message + code;\n }\n};\nvar cssSyntaxError$1 = CssSyntaxError$3$1;\nCssSyntaxError$3$1.default = CssSyntaxError$3$1;\nvar symbols$1 = {};\nsymbols$1.isClean = Symbol(\"isClean\");\nsymbols$1.my = Symbol(\"my\");\nconst DEFAULT_RAW$1 = {\n after: \"\\n\",\n beforeClose: \"\\n\",\n beforeComment: \"\\n\",\n beforeDecl: \"\\n\",\n beforeOpen: \" \",\n beforeRule: \"\\n\",\n colon: \": \",\n commentLeft: \" \",\n commentRight: \" \",\n emptyBody: \"\",\n indent: \" \",\n semicolon: false\n};\nfunction capitalize$1(str) {\n return str[0].toUpperCase() + str.slice(1);\n}\nlet Stringifier$2$1 = class Stringifier {\n constructor(builder) {\n this.builder = builder;\n }\n atrule(node2, semicolon) {\n let name = \"@\" + node2.name;\n let params = node2.params ? this.rawValue(node2, \"params\") : \"\";\n if (typeof node2.raws.afterName !== \"undefined\") {\n name += node2.raws.afterName;\n } else if (params) {\n name += \" \";\n }\n if (node2.nodes) {\n this.block(node2, name + params);\n } else {\n let end = (node2.raws.between || \"\") + (semicolon ? \";\" : \"\");\n this.builder(name + params + end, node2);\n }\n }\n beforeAfter(node2, detect) {\n let value;\n if (node2.type === \"decl\") {\n value = this.raw(node2, null, \"beforeDecl\");\n } else if (node2.type === \"comment\") {\n value = this.raw(node2, null, \"beforeComment\");\n } else if (detect === \"before\") {\n value = this.raw(node2, null, \"beforeRule\");\n } else {\n value = this.raw(node2, null, \"beforeClose\");\n }\n let buf = node2.parent;\n let depth = 0;\n while (buf && buf.type !== \"root\") {\n depth += 1;\n buf = buf.parent;\n }\n if (value.includes(\"\\n\")) {\n let indent = this.raw(node2, null, \"indent\");\n if (indent.length) {\n for (let step = 0; step < depth; step++) value += indent;\n }\n }\n return value;\n }\n block(node2, start) {\n let between = this.raw(node2, \"between\", \"beforeOpen\");\n this.builder(start + between + \"{\", node2, \"start\");\n let after;\n if (node2.nodes && node2.nodes.length) {\n this.body(node2);\n after = this.raw(node2, \"after\");\n } else {\n after = this.raw(node2, \"after\", \"emptyBody\");\n }\n if (after) this.builder(after);\n this.builder(\"}\", node2, \"end\");\n }\n body(node2) {\n let last = node2.nodes.length - 1;\n while (last > 0) {\n if (node2.nodes[last].type !== \"comment\") break;\n last -= 1;\n }\n let semicolon = this.raw(node2, \"semicolon\");\n for (let i2 = 0; i2 < node2.nodes.length; i2++) {\n let child = node2.nodes[i2];\n let before = this.raw(child, \"before\");\n if (before) this.builder(before);\n this.stringify(child, last !== i2 || semicolon);\n }\n }\n comment(node2) {\n let left = this.raw(node2, \"left\", \"commentLeft\");\n let right = this.raw(node2, \"right\", \"commentRight\");\n this.builder(\"/*\" + left + node2.text + right + \"*/\", node2);\n }\n decl(node2, semicolon) {\n let between = this.raw(node2, \"between\", \"colon\");\n let string = node2.prop + between + this.rawValue(node2, \"value\");\n if (node2.important) {\n string += node2.raws.important || \" !important\";\n }\n if (semicolon) string += \";\";\n this.builder(string, node2);\n }\n document(node2) {\n this.body(node2);\n }\n raw(node2, own, detect) {\n let value;\n if (!detect) detect = own;\n if (own) {\n value = node2.raws[own];\n if (typeof value !== \"undefined\") return value;\n }\n let parent = node2.parent;\n if (detect === \"before\") {\n if (!parent || parent.type === \"root\" && parent.first === node2) {\n return \"\";\n }\n if (parent && parent.type === \"document\") {\n return \"\";\n }\n }\n if (!parent) return DEFAULT_RAW$1[detect];\n let root2 = node2.root();\n if (!root2.rawCache) root2.rawCache = {};\n if (typeof root2.rawCache[detect] !== \"undefined\") {\n return root2.rawCache[detect];\n }\n if (detect === \"before\" || detect === \"after\") {\n return this.beforeAfter(node2, detect);\n } else {\n let method = \"raw\" + capitalize$1(detect);\n if (this[method]) {\n value = this[method](root2, node2);\n } else {\n root2.walk((i2) => {\n value = i2.raws[own];\n if (typeof value !== \"undefined\") return false;\n });\n }\n }\n if (typeof value === \"undefined\") value = DEFAULT_RAW$1[detect];\n root2.rawCache[detect] = value;\n return value;\n }\n rawBeforeClose(root2) {\n let value;\n root2.walk((i2) => {\n if (i2.nodes && i2.nodes.length > 0) {\n if (typeof i2.raws.after !== \"undefined\") {\n value = i2.raws.after;\n if (value.includes(\"\\n\")) {\n value = value.replace(/[^\\n]+$/, \"\");\n }\n return false;\n }\n }\n });\n if (value) value = value.replace(/\\S/g, \"\");\n return value;\n }\n rawBeforeComment(root2, node2) {\n let value;\n root2.walkComments((i2) => {\n if (typeof i2.raws.before !== \"undefined\") {\n value = i2.raws.before;\n if (value.includes(\"\\n\")) {\n value = value.replace(/[^\\n]+$/, \"\");\n }\n return false;\n }\n });\n if (typeof value === \"undefined\") {\n value = this.raw(node2, null, \"beforeDecl\");\n } else if (value) {\n value = value.replace(/\\S/g, \"\");\n }\n return value;\n }\n rawBeforeDecl(root2, node2) {\n let value;\n root2.walkDecls((i2) => {\n if (typeof i2.raws.before !== \"undefined\") {\n value = i2.raws.before;\n if (value.includes(\"\\n\")) {\n value = value.replace(/[^\\n]+$/, \"\");\n }\n return false;\n }\n });\n if (typeof value === \"undefined\") {\n value = this.raw(node2, null, \"beforeRule\");\n } else if (value) {\n value = value.replace(/\\S/g, \"\");\n }\n return value;\n }\n rawBeforeOpen(root2) {\n let value;\n root2.walk((i2) => {\n if (i2.type !== \"decl\") {\n value = i2.raws.between;\n if (typeof value !== \"undefined\") return false;\n }\n });\n return value;\n }\n rawBeforeRule(root2) {\n let value;\n root2.walk((i2) => {\n if (i2.nodes && (i2.parent !== root2 || root2.first !== i2)) {\n if (typeof i2.raws.before !== \"undefined\") {\n value = i2.raws.before;\n if (value.includes(\"\\n\")) {\n value = value.replace(/[^\\n]+$/, \"\");\n }\n return false;\n }\n }\n });\n if (value) value = value.replace(/\\S/g, \"\");\n return value;\n }\n rawColon(root2) {\n let value;\n root2.walkDecls((i2) => {\n if (typeof i2.raws.between !== \"undefined\") {\n value = i2.raws.between.replace(/[^\\s:]/g, \"\");\n return false;\n }\n });\n return value;\n }\n rawEmptyBody(root2) {\n let value;\n root2.walk((i2) => {\n if (i2.nodes && i2.nodes.length === 0) {\n value = i2.raws.after;\n if (typeof value !== \"undefined\") return false;\n }\n });\n return value;\n }\n rawIndent(root2) {\n if (root2.raws.indent) return root2.raws.indent;\n let value;\n root2.walk((i2) => {\n let p = i2.parent;\n if (p && p !== root2 && p.parent && p.parent === root2) {\n if (typeof i2.raws.before !== \"undefined\") {\n let parts = i2.raws.before.split(\"\\n\");\n value = parts[parts.length - 1];\n value = value.replace(/\\S/g, \"\");\n return false;\n }\n }\n });\n return value;\n }\n rawSemicolon(root2) {\n let value;\n root2.walk((i2) => {\n if (i2.nodes && i2.nodes.length && i2.last.type === \"decl\") {\n value = i2.raws.semicolon;\n if (typeof value !== \"undefined\") return false;\n }\n });\n return value;\n }\n rawValue(node2, prop) {\n let value = node2[prop];\n let raw = node2.raws[prop];\n if (raw && raw.value === value) {\n return raw.raw;\n }\n return value;\n }\n root(node2) {\n this.body(node2);\n if (node2.raws.after) this.builder(node2.raws.after);\n }\n rule(node2) {\n this.block(node2, this.rawValue(node2, \"selector\"));\n if (node2.raws.ownSemicolon) {\n this.builder(node2.raws.ownSemicolon, node2, \"end\");\n }\n }\n stringify(node2, semicolon) {\n if (!this[node2.type]) {\n throw new Error(\n \"Unknown AST node type \" + node2.type + \". Maybe you need to change PostCSS stringifier.\"\n );\n }\n this[node2.type](node2, semicolon);\n }\n};\nvar stringifier$1 = Stringifier$2$1;\nStringifier$2$1.default = Stringifier$2$1;\nlet Stringifier$1$1 = stringifier$1;\nfunction stringify$4$1(node2, builder) {\n let str = new Stringifier$1$1(builder);\n str.stringify(node2);\n}\nvar stringify_1$1 = stringify$4$1;\nstringify$4$1.default = stringify$4$1;\nlet { isClean: isClean$2$1, my: my$2$1 } = symbols$1;\nlet CssSyntaxError$2$1 = cssSyntaxError$1;\nlet Stringifier2$1 = stringifier$1;\nlet stringify$3$1 = stringify_1$1;\nfunction cloneNode$1(obj, parent) {\n let cloned = new obj.constructor();\n for (let i2 in obj) {\n if (!Object.prototype.hasOwnProperty.call(obj, i2)) {\n continue;\n }\n if (i2 === \"proxyCache\") continue;\n let value = obj[i2];\n let type = typeof value;\n if (i2 === \"parent\" && type === \"object\") {\n if (parent) cloned[i2] = parent;\n } else if (i2 === \"source\") {\n cloned[i2] = value;\n } else if (Array.isArray(value)) {\n cloned[i2] = value.map((j) => cloneNode$1(j, cloned));\n } else {\n if (type === \"object\" && value !== null) value = cloneNode$1(value);\n cloned[i2] = value;\n }\n }\n return cloned;\n}\nlet Node$4$1 = class Node2 {\n constructor(defaults = {}) {\n this.raws = {};\n this[isClean$2$1] = false;\n this[my$2$1] = true;\n for (let name in defaults) {\n if (name === \"nodes\") {\n this.nodes = [];\n for (let node2 of defaults[name]) {\n if (typeof node2.clone === \"function\") {\n this.append(node2.clone());\n } else {\n this.append(node2);\n }\n }\n } else {\n this[name] = defaults[name];\n }\n }\n }\n addToError(error) {\n error.postcssNode = this;\n if (error.stack && this.source && /\\n\\s{4}at /.test(error.stack)) {\n let s2 = this.source;\n error.stack = error.stack.replace(\n /\\n\\s{4}at /,\n `$&${s2.input.from}:${s2.start.line}:${s2.start.column}$&`\n );\n }\n return error;\n }\n after(add) {\n this.parent.insertAfter(this, add);\n return this;\n }\n assign(overrides = {}) {\n for (let name in overrides) {\n this[name] = overrides[name];\n }\n return this;\n }\n before(add) {\n this.parent.insertBefore(this, add);\n return this;\n }\n cleanRaws(keepBetween) {\n delete this.raws.before;\n delete this.raws.after;\n if (!keepBetween) delete this.raws.between;\n }\n clone(overrides = {}) {\n let cloned = cloneNode$1(this);\n for (let name in overrides) {\n cloned[name] = overrides[name];\n }\n return cloned;\n }\n cloneAfter(overrides = {}) {\n let cloned = this.clone(overrides);\n this.parent.insertAfter(this, cloned);\n return cloned;\n }\n cloneBefore(overrides = {}) {\n let cloned = this.clone(overrides);\n this.parent.insertBefore(this, cloned);\n return cloned;\n }\n error(message, opts = {}) {\n if (this.source) {\n let { end, start } = this.rangeBy(opts);\n return this.source.input.error(\n message,\n { column: start.column, line: start.line },\n { column: end.column, line: end.line },\n opts\n );\n }\n return new CssSyntaxError$2$1(message);\n }\n getProxyProcessor() {\n return {\n get(node2, prop) {\n if (prop === \"proxyOf\") {\n return node2;\n } else if (prop === \"root\") {\n return () => node2.root().toProxy();\n } else {\n return node2[prop];\n }\n },\n set(node2, prop, value) {\n if (node2[prop] === value) return true;\n node2[prop] = value;\n if (prop === \"prop\" || prop === \"value\" || prop === \"name\" || prop === \"params\" || prop === \"important\" || /* c8 ignore next */\n prop === \"text\") {\n node2.markDirty();\n }\n return true;\n }\n };\n }\n markDirty() {\n if (this[isClean$2$1]) {\n this[isClean$2$1] = false;\n let next = this;\n while (next = next.parent) {\n next[isClean$2$1] = false;\n }\n }\n }\n next() {\n if (!this.parent) return void 0;\n let index2 = this.parent.index(this);\n return this.parent.nodes[index2 + 1];\n }\n positionBy(opts, stringRepresentation) {\n let pos = this.source.start;\n if (opts.index) {\n pos = this.positionInside(opts.index, stringRepresentation);\n } else if (opts.word) {\n stringRepresentation = this.toString();\n let index2 = stringRepresentation.indexOf(opts.word);\n if (index2 !== -1) pos = this.positionInside(index2, stringRepresentation);\n }\n return pos;\n }\n positionInside(index2, stringRepresentation) {\n let string = stringRepresentation || this.toString();\n let column = this.source.start.column;\n let line = this.source.start.line;\n for (let i2 = 0; i2 < index2; i2++) {\n if (string[i2] === \"\\n\") {\n column = 1;\n line += 1;\n } else {\n column += 1;\n }\n }\n return { column, line };\n }\n prev() {\n if (!this.parent) return void 0;\n let index2 = this.parent.index(this);\n return this.parent.nodes[index2 - 1];\n }\n rangeBy(opts) {\n let start = {\n column: this.source.start.column,\n line: this.source.start.line\n };\n let end = this.source.end ? {\n column: this.source.end.column + 1,\n line: this.source.end.line\n } : {\n column: start.column + 1,\n line: start.line\n };\n if (opts.word) {\n let stringRepresentation = this.toString();\n let index2 = stringRepresentation.indexOf(opts.word);\n if (index2 !== -1) {\n start = this.positionInside(index2, stringRepresentation);\n end = this.positionInside(index2 + opts.word.length, stringRepresentation);\n }\n } else {\n if (opts.start) {\n start = {\n column: opts.start.column,\n line: opts.start.line\n };\n } else if (opts.index) {\n start = this.positionInside(opts.index);\n }\n if (opts.end) {\n end = {\n column: opts.end.column,\n line: opts.end.line\n };\n } else if (typeof opts.endIndex === \"number\") {\n end = this.positionInside(opts.endIndex);\n } else if (opts.index) {\n end = this.positionInside(opts.index + 1);\n }\n }\n if (end.line < start.line || end.line === start.line && end.column <= start.column) {\n end = { column: start.column + 1, line: start.line };\n }\n return { end, start };\n }\n raw(prop, defaultType) {\n let str = new Stringifier2$1();\n return str.raw(this, prop, defaultType);\n }\n remove() {\n if (this.parent) {\n this.parent.removeChild(this);\n }\n this.parent = void 0;\n return this;\n }\n replaceWith(...nodes) {\n if (this.parent) {\n let bookmark = this;\n let foundSelf = false;\n for (let node2 of nodes) {\n if (node2 === this) {\n foundSelf = true;\n } else if (foundSelf) {\n this.parent.insertAfter(bookmark, node2);\n bookmark = node2;\n } else {\n this.parent.insertBefore(bookmark, node2);\n }\n }\n if (!foundSelf) {\n this.remove();\n }\n }\n return this;\n }\n root() {\n let result2 = this;\n while (result2.parent && result2.parent.type !== \"document\") {\n result2 = result2.parent;\n }\n return result2;\n }\n toJSON(_, inputs) {\n let fixed = {};\n let emitInputs = inputs == null;\n inputs = inputs || /* @__PURE__ */ new Map();\n let inputsNextIndex = 0;\n for (let name in this) {\n if (!Object.prototype.hasOwnProperty.call(this, name)) {\n continue;\n }\n if (name === \"parent\" || name === \"proxyCache\") continue;\n let value = this[name];\n if (Array.isArray(value)) {\n fixed[name] = value.map((i2) => {\n if (typeof i2 === \"object\" && i2.toJSON) {\n return i2.toJSON(null, inputs);\n } else {\n return i2;\n }\n });\n } else if (typeof value === \"object\" && value.toJSON) {\n fixed[name] = value.toJSON(null, inputs);\n } else if (name === \"source\") {\n let inputId = inputs.get(value.input);\n if (inputId == null) {\n inputId = inputsNextIndex;\n inputs.set(value.input, inputsNextIndex);\n inputsNextIndex++;\n }\n fixed[name] = {\n end: value.end,\n inputId,\n start: value.start\n };\n } else {\n fixed[name] = value;\n }\n }\n if (emitInputs) {\n fixed.inputs = [...inputs.keys()].map((input2) => input2.toJSON());\n }\n return fixed;\n }\n toProxy() {\n if (!this.proxyCache) {\n this.proxyCache = new Proxy(this, this.getProxyProcessor());\n }\n return this.proxyCache;\n }\n toString(stringifier2 = stringify$3$1) {\n if (stringifier2.stringify) stringifier2 = stringifier2.stringify;\n let result2 = \"\";\n stringifier2(this, (i2) => {\n result2 += i2;\n });\n return result2;\n }\n warn(result2, text, opts) {\n let data = { node: this };\n for (let i2 in opts) data[i2] = opts[i2];\n return result2.warn(text, data);\n }\n get proxyOf() {\n return this;\n }\n};\nvar node$1 = Node$4$1;\nNode$4$1.default = Node$4$1;\nlet Node$3$1 = node$1;\nlet Declaration$4$1 = class Declaration extends Node$3$1 {\n constructor(defaults) {\n if (defaults && typeof defaults.value !== \"undefined\" && typeof defaults.value !== \"string\") {\n defaults = { ...defaults, value: String(defaults.value) };\n }\n super(defaults);\n this.type = \"decl\";\n }\n get variable() {\n return this.prop.startsWith(\"--\") || this.prop[0] === \"$\";\n }\n};\nvar declaration$1 = Declaration$4$1;\nDeclaration$4$1.default = Declaration$4$1;\nlet urlAlphabet$1 = \"useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict\";\nlet customAlphabet$1 = (alphabet, defaultSize = 21) => {\n return (size = defaultSize) => {\n let id = \"\";\n let i2 = size;\n while (i2--) {\n id += alphabet[Math.random() * alphabet.length | 0];\n }\n return id;\n };\n};\nlet nanoid$1$1 = (size = 21) => {\n let id = \"\";\n let i2 = size;\n while (i2--) {\n id += urlAlphabet$1[Math.random() * 64 | 0];\n }\n return id;\n};\nvar nonSecure$1 = { nanoid: nanoid$1$1, customAlphabet: customAlphabet$1 };\nlet { SourceMapConsumer: SourceMapConsumer$2$1, SourceMapGenerator: SourceMapGenerator$2$1 } = require$$2$1;\nlet { existsSync: existsSync$1, readFileSync: readFileSync$1 } = require$$2$1;\nlet { dirname: dirname$1$1, join: join$1 } = require$$2$1;\nfunction fromBase64$1(str) {\n if (Buffer) {\n return Buffer.from(str, \"base64\").toString();\n } else {\n return window.atob(str);\n }\n}\nlet PreviousMap$2$1 = class PreviousMap {\n constructor(css, opts) {\n if (opts.map === false) return;\n this.loadAnnotation(css);\n this.inline = this.startWith(this.annotation, \"data:\");\n let prev = opts.map ? opts.map.prev : void 0;\n let text = this.loadMap(opts.from, prev);\n if (!this.mapFile && opts.from) {\n this.mapFile = opts.from;\n }\n if (this.mapFile) this.root = dirname$1$1(this.mapFile);\n if (text) this.text = text;\n }\n consumer() {\n if (!this.consumerCache) {\n this.consumerCache = new SourceMapConsumer$2$1(this.text);\n }\n return this.consumerCache;\n }\n decodeInline(text) {\n let baseCharsetUri = /^data:application\\/json;charset=utf-?8;base64,/;\n let baseUri = /^data:application\\/json;base64,/;\n let charsetUri = /^data:application\\/json;charset=utf-?8,/;\n let uri = /^data:application\\/json,/;\n if (charsetUri.test(text) || uri.test(text)) {\n return decodeURIComponent(text.substr(RegExp.lastMatch.length));\n }\n if (baseCharsetUri.test(text) || baseUri.test(text)) {\n return fromBase64$1(text.substr(RegExp.lastMatch.length));\n }\n let encoding = text.match(/data:application\\/json;([^,]+),/)[1];\n throw new Error(\"Unsupported source map encoding \" + encoding);\n }\n getAnnotationURL(sourceMapString) {\n return sourceMapString.replace(/^\\/\\*\\s*# sourceMappingURL=/, \"\").trim();\n }\n isMap(map) {\n if (typeof map !== \"object\") return false;\n return typeof map.mappings === \"string\" || typeof map._mappings === \"string\" || Array.isArray(map.sections);\n }\n loadAnnotation(css) {\n let comments = css.match(/\\/\\*\\s*# sourceMappingURL=/gm);\n if (!comments) return;\n let start = css.lastIndexOf(comments.pop());\n let end = css.indexOf(\"*/\", start);\n if (start > -1 && end > -1) {\n this.annotation = this.getAnnotationURL(css.substring(start, end));\n }\n }\n loadFile(path) {\n this.root = dirname$1$1(path);\n if (existsSync$1(path)) {\n this.mapFile = path;\n return readFileSync$1(path, \"utf-8\").toString().trim();\n }\n }\n loadMap(file, prev) {\n if (prev === false) return false;\n if (prev) {\n if (typeof prev === \"string\") {\n return prev;\n } else if (typeof prev === \"function\") {\n let prevPath = prev(file);\n if (prevPath) {\n let map = this.loadFile(prevPath);\n if (!map) {\n throw new Error(\n \"Unable to load previous source map: \" + prevPath.toString()\n );\n }\n return map;\n }\n } else if (prev instanceof SourceMapConsumer$2$1) {\n return SourceMapGenerator$2$1.fromSourceMap(prev).toString();\n } else if (prev instanceof SourceMapGenerator$2$1) {\n return prev.toString();\n } else if (this.isMap(prev)) {\n return JSON.stringify(prev);\n } else {\n throw new Error(\n \"Unsupported previous source map format: \" + prev.toString()\n );\n }\n } else if (this.inline) {\n return this.decodeInline(this.annotation);\n } else if (this.annotation) {\n let map = this.annotation;\n if (file) map = join$1(dirname$1$1(file), map);\n return this.loadFile(map);\n }\n }\n startWith(string, start) {\n if (!string) return false;\n return string.substr(0, start.length) === start;\n }\n withContent() {\n return !!(this.consumer().sourcesContent && this.consumer().sourcesContent.length > 0);\n }\n};\nvar previousMap$1 = PreviousMap$2$1;\nPreviousMap$2$1.default = PreviousMap$2$1;\nlet { SourceMapConsumer: SourceMapConsumer$1$1, SourceMapGenerator: SourceMapGenerator$1$1 } = require$$2$1;\nlet { fileURLToPath: fileURLToPath$1, pathToFileURL: pathToFileURL$1$1 } = require$$2$1;\nlet { isAbsolute: isAbsolute$1, resolve: resolve$1$1 } = require$$2$1;\nlet { nanoid: nanoid$2 } = nonSecure$1;\nlet terminalHighlight$2 = require$$2$1;\nlet CssSyntaxError$1$1 = cssSyntaxError$1;\nlet PreviousMap$1$1 = previousMap$1;\nlet fromOffsetCache$1 = Symbol(\"fromOffsetCache\");\nlet sourceMapAvailable$1$1 = Boolean(SourceMapConsumer$1$1 && SourceMapGenerator$1$1);\nlet pathAvailable$1$1 = Boolean(resolve$1$1 && isAbsolute$1);\nlet Input$4$1 = class Input {\n constructor(css, opts = {}) {\n if (css === null || typeof css === \"undefined\" || typeof css === \"object\" && !css.toString) {\n throw new Error(`PostCSS received ${css} instead of CSS string`);\n }\n this.css = css.toString();\n if (this.css[0] === \"\\uFEFF\" || this.css[0] === \"￾\") {\n this.hasBOM = true;\n this.css = this.css.slice(1);\n } else {\n this.hasBOM = false;\n }\n if (opts.from) {\n if (!pathAvailable$1$1 || /^\\w+:\\/\\//.test(opts.from) || isAbsolute$1(opts.from)) {\n this.file = opts.from;\n } else {\n this.file = resolve$1$1(opts.from);\n }\n }\n if (pathAvailable$1$1 && sourceMapAvailable$1$1) {\n let map = new PreviousMap$1$1(this.css, opts);\n if (map.text) {\n this.map = map;\n let file = map.consumer().file;\n if (!this.file && file) this.file = this.mapResolve(file);\n }\n }\n if (!this.file) {\n this.id = \"<input css \" + nanoid$2(6) + \">\";\n }\n if (this.map) this.map.file = this.from;\n }\n error(message, line, column, opts = {}) {\n let result2, endLine, endColumn;\n if (line && typeof line === \"object\") {\n let start = line;\n let end = column;\n if (typeof start.offset === \"number\") {\n let pos = this.fromOffset(start.offset);\n line = pos.line;\n column = pos.col;\n } else {\n line = start.line;\n column = start.column;\n }\n if (typeof end.offset === \"number\") {\n let pos = this.fromOffset(end.offset);\n endLine = pos.line;\n endColumn = pos.col;\n } else {\n endLine = end.line;\n endColumn = end.column;\n }\n } else if (!column) {\n let pos = this.fromOffset(line);\n line = pos.line;\n column = pos.col;\n }\n let origin = this.origin(line, column, endLine, endColumn);\n if (origin) {\n result2 = new CssSyntaxError$1$1(\n message,\n origin.endLine === void 0 ? origin.line : { column: origin.column, line: origin.line },\n origin.endLine === void 0 ? origin.column : { column: origin.endColumn, line: origin.endLine },\n origin.source,\n origin.file,\n opts.plugin\n );\n } else {\n result2 = new CssSyntaxError$1$1(\n message,\n endLine === void 0 ? line : { column, line },\n endLine === void 0 ? column : { column: endColumn, line: endLine },\n this.css,\n this.file,\n opts.plugin\n );\n }\n result2.input = { column, endColumn, endLine, line, source: this.css };\n if (this.file) {\n if (pathToFileURL$1$1) {\n result2.input.url = pathToFileURL$1$1(this.file).toString();\n }\n result2.input.file = this.file;\n }\n return result2;\n }\n fromOffset(offset) {\n let lastLine, lineToIndex;\n if (!this[fromOffsetCache$1]) {\n let lines = this.css.split(\"\\n\");\n lineToIndex = new Array(lines.length);\n let prevIndex = 0;\n for (let i2 = 0, l2 = lines.length; i2 < l2; i2++) {\n lineToIndex[i2] = prevIndex;\n prevIndex += lines[i2].length + 1;\n }\n this[fromOffsetCache$1] = lineToIndex;\n } else {\n lineToIndex = this[fromOffsetCache$1];\n }\n lastLine = lineToIndex[lineToIndex.length - 1];\n let min = 0;\n if (offset >= lastLine) {\n min = lineToIndex.length - 1;\n } else {\n let max = lineToIndex.length - 2;\n let mid;\n while (min < max) {\n mid = min + (max - min >> 1);\n if (offset < lineToIndex[mid]) {\n max = mid - 1;\n } else if (offset >= lineToIndex[mid + 1]) {\n min = mid + 1;\n } else {\n min = mid;\n break;\n }\n }\n }\n return {\n col: offset - lineToIndex[min] + 1,\n line: min + 1\n };\n }\n mapResolve(file) {\n if (/^\\w+:\\/\\//.test(file)) {\n return file;\n }\n return resolve$1$1(this.map.consumer().sourceRoot || this.map.root || \".\", file);\n }\n origin(line, column, endLine, endColumn) {\n if (!this.map) return false;\n let consumer = this.map.consumer();\n let from = consumer.originalPositionFor({ column, line });\n if (!from.source) return false;\n let to;\n if (typeof endLine === \"number\") {\n to = consumer.originalPositionFor({ column: endColumn, line: endLine });\n }\n let fromUrl;\n if (isAbsolute$1(from.source)) {\n fromUrl = pathToFileURL$1$1(from.source);\n } else {\n fromUrl = new URL(\n from.source,\n this.map.consumer().sourceRoot || pathToFileURL$1$1(this.map.mapFile)\n );\n }\n let result2 = {\n column: from.column,\n endColumn: to && to.column,\n endLine: to && to.line,\n line: from.line,\n url: fromUrl.toString()\n };\n if (fromUrl.protocol === \"file:\") {\n if (fileURLToPath$1) {\n result2.file = fileURLToPath$1(fromUrl);\n } else {\n throw new Error(`file: protocol is not available in this PostCSS build`);\n }\n }\n let source = consumer.sourceContentFor(from.source);\n if (source) result2.source = source;\n return result2;\n }\n toJSON() {\n let json = {};\n for (let name of [\"hasBOM\", \"css\", \"file\", \"id\"]) {\n if (this[name] != null) {\n json[name] = this[name];\n }\n }\n if (this.map) {\n json.map = { ...this.map };\n if (json.map.consumerCache) {\n json.map.consumerCache = void 0;\n }\n }\n return json;\n }\n get from() {\n return this.file || this.id;\n }\n};\nvar input$1 = Input$4$1;\nInput$4$1.default = Input$4$1;\nif (terminalHighlight$2 && terminalHighlight$2.registerInput) {\n terminalHighlight$2.registerInput(Input$4$1);\n}\nlet { SourceMapConsumer: SourceMapConsumer$3, SourceMapGenerator: SourceMapGenerator$3 } = require$$2$1;\nlet { dirname: dirname$2, relative: relative$1, resolve: resolve$2, sep: sep$1 } = require$$2$1;\nlet { pathToFileURL: pathToFileURL$2 } = require$$2$1;\nlet Input$3$1 = input$1;\nlet sourceMapAvailable$2 = Boolean(SourceMapConsumer$3 && SourceMapGenerator$3);\nlet pathAvailable$2 = Boolean(dirname$2 && resolve$2 && relative$1 && sep$1);\nlet MapGenerator$2$1 = class MapGenerator {\n constructor(stringify2, root2, opts, cssString) {\n this.stringify = stringify2;\n this.mapOpts = opts.map || {};\n this.root = root2;\n this.opts = opts;\n this.css = cssString;\n this.originalCSS = cssString;\n this.usesFileUrls = !this.mapOpts.from && this.mapOpts.absolute;\n this.memoizedFileURLs = /* @__PURE__ */ new Map();\n this.memoizedPaths = /* @__PURE__ */ new Map();\n this.memoizedURLs = /* @__PURE__ */ new Map();\n }\n addAnnotation() {\n let content;\n if (this.isInline()) {\n content = \"data:application/json;base64,\" + this.toBase64(this.map.toString());\n } else if (typeof this.mapOpts.annotation === \"string\") {\n content = this.mapOpts.annotation;\n } else if (typeof this.mapOpts.annotation === \"function\") {\n content = this.mapOpts.annotation(this.opts.to, this.root);\n } else {\n content = this.outputFile() + \".map\";\n }\n let eol = \"\\n\";\n if (this.css.includes(\"\\r\\n\")) eol = \"\\r\\n\";\n this.css += eol + \"/*# sourceMappingURL=\" + content + \" */\";\n }\n applyPrevMaps() {\n for (let prev of this.previous()) {\n let from = this.toUrl(this.path(prev.file));\n let root2 = prev.root || dirname$2(prev.file);\n let map;\n if (this.mapOpts.sourcesContent === false) {\n map = new SourceMapConsumer$3(prev.text);\n if (map.sourcesContent) {\n map.sourcesContent = null;\n }\n } else {\n map = prev.consumer();\n }\n this.map.applySourceMap(map, from, this.toUrl(this.path(root2)));\n }\n }\n clearAnnotation() {\n if (this.mapOpts.annotation === false) return;\n if (this.root) {\n let node2;\n for (let i2 = this.root.nodes.length - 1; i2 >= 0; i2--) {\n node2 = this.root.nodes[i2];\n if (node2.type !== \"comment\") continue;\n if (node2.text.indexOf(\"# sourceMappingURL=\") === 0) {\n this.root.removeChild(i2);\n }\n }\n } else if (this.css) {\n this.css = this.css.replace(/\\n*?\\/\\*#[\\S\\s]*?\\*\\/$/gm, \"\");\n }\n }\n generate() {\n this.clearAnnotation();\n if (pathAvailable$2 && sourceMapAvailable$2 && this.isMap()) {\n return this.generateMap();\n } else {\n let result2 = \"\";\n this.stringify(this.root, (i2) => {\n result2 += i2;\n });\n return [result2];\n }\n }\n generateMap() {\n if (this.root) {\n this.generateString();\n } else if (this.previous().length === 1) {\n let prev = this.previous()[0].consumer();\n prev.file = this.outputFile();\n this.map = SourceMapGenerator$3.fromSourceMap(prev, {\n ignoreInvalidMapping: true\n });\n } else {\n this.map = new SourceMapGenerator$3({\n file: this.outputFile(),\n ignoreInvalidMapping: true\n });\n this.map.addMapping({\n generated: { column: 0, line: 1 },\n original: { column: 0, line: 1 },\n source: this.opts.from ? this.toUrl(this.path(this.opts.from)) : \"<no source>\"\n });\n }\n if (this.isSourcesContent()) this.setSourcesContent();\n if (this.root && this.previous().length > 0) this.applyPrevMaps();\n if (this.isAnnotation()) this.addAnnotation();\n if (this.isInline()) {\n return [this.css];\n } else {\n return [this.css, this.map];\n }\n }\n generateString() {\n this.css = \"\";\n this.map = new SourceMapGenerator$3({\n file: this.outputFile(),\n ignoreInvalidMapping: true\n });\n let line = 1;\n let column = 1;\n let noSource = \"<no source>\";\n let mapping = {\n generated: { column: 0, line: 0 },\n original: { column: 0, line: 0 },\n source: \"\"\n };\n let lines, last;\n this.stringify(this.root, (str, node2, type) => {\n this.css += str;\n if (node2 && type !== \"end\") {\n mapping.generated.line = line;\n mapping.generated.column = column - 1;\n if (node2.source && node2.source.start) {\n mapping.source = this.sourcePath(node2);\n mapping.original.line = node2.source.start.line;\n mapping.original.column = node2.source.start.column - 1;\n this.map.addMapping(mapping);\n } else {\n mapping.source = noSource;\n mapping.original.line = 1;\n mapping.original.column = 0;\n this.map.addMapping(mapping);\n }\n }\n lines = str.match(/\\n/g);\n if (lines) {\n line += lines.length;\n last = str.lastIndexOf(\"\\n\");\n column = str.length - last;\n } else {\n column += str.length;\n }\n if (node2 && type !== \"start\") {\n let p = node2.parent || { raws: {} };\n let childless = node2.type === \"decl\" || node2.type === \"atrule\" && !node2.nodes;\n if (!childless || node2 !== p.last || p.raws.semicolon) {\n if (node2.source && node2.source.end) {\n mapping.source = this.sourcePath(node2);\n mapping.original.line = node2.source.end.line;\n mapping.original.column = node2.source.end.column - 1;\n mapping.generated.line = line;\n mapping.generated.column = column - 2;\n this.map.addMapping(mapping);\n } else {\n mapping.source = noSource;\n mapping.original.line = 1;\n mapping.original.column = 0;\n mapping.generated.line = line;\n mapping.generated.column = column - 1;\n this.map.addMapping(mapping);\n }\n }\n }\n });\n }\n isAnnotation() {\n if (this.isInline()) {\n return true;\n }\n if (typeof this.mapOpts.annotation !== \"undefined\") {\n return this.mapOpts.annotation;\n }\n if (this.previous().length) {\n return this.previous().some((i2) => i2.annotation);\n }\n return true;\n }\n isInline() {\n if (typeof this.mapOpts.inline !== \"undefined\") {\n return this.mapOpts.inline;\n }\n let annotation = this.mapOpts.annotation;\n if (typeof annotation !== \"undefined\" && annotation !== true) {\n return false;\n }\n if (this.previous().length) {\n return this.previous().some((i2) => i2.inline);\n }\n return true;\n }\n isMap() {\n if (typeof this.opts.map !== \"undefined\") {\n return !!this.opts.map;\n }\n return this.previous().length > 0;\n }\n isSourcesContent() {\n if (typeof this.mapOpts.sourcesContent !== \"undefined\") {\n return this.mapOpts.sourcesContent;\n }\n if (this.previous().length) {\n return this.previous().some((i2) => i2.withContent());\n }\n return true;\n }\n outputFile() {\n if (this.opts.to) {\n return this.path(this.opts.to);\n } else if (this.opts.from) {\n return this.path(this.opts.from);\n } else {\n return \"to.css\";\n }\n }\n path(file) {\n if (this.mapOpts.absolute) return file;\n if (file.charCodeAt(0) === 60) return file;\n if (/^\\w+:\\/\\//.test(file)) return file;\n let cached = this.memoizedPaths.get(file);\n if (cached) return cached;\n let from = this.opts.to ? dirname$2(this.opts.to) : \".\";\n if (typeof this.mapOpts.annotation === \"string\") {\n from = dirname$2(resolve$2(from, this.mapOpts.annotation));\n }\n let path = relative$1(from, file);\n this.memoizedPaths.set(file, path);\n return path;\n }\n previous() {\n if (!this.previousMaps) {\n this.previousMaps = [];\n if (this.root) {\n this.root.walk((node2) => {\n if (node2.source && node2.source.input.map) {\n let map = node2.source.input.map;\n if (!this.previousMaps.includes(map)) {\n this.previousMaps.push(map);\n }\n }\n });\n } else {\n let input2 = new Input$3$1(this.originalCSS, this.opts);\n if (input2.map) this.previousMaps.push(input2.map);\n }\n }\n return this.previousMaps;\n }\n setSourcesContent() {\n let already = {};\n if (this.root) {\n this.root.walk((node2) => {\n if (node2.source) {\n let from = node2.source.input.from;\n if (from && !already[from]) {\n already[from] = true;\n let fromUrl = this.usesFileUrls ? this.toFileUrl(from) : this.toUrl(this.path(from));\n this.map.setSourceContent(fromUrl, node2.source.input.css);\n }\n }\n });\n } else if (this.css) {\n let from = this.opts.from ? this.toUrl(this.path(this.opts.from)) : \"<no source>\";\n this.map.setSourceContent(from, this.css);\n }\n }\n sourcePath(node2) {\n if (this.mapOpts.from) {\n return this.toUrl(this.mapOpts.from);\n } else if (this.usesFileUrls) {\n return this.toFileUrl(node2.source.input.from);\n } else {\n return this.toUrl(this.path(node2.source.input.from));\n }\n }\n toBase64(str) {\n if (Buffer) {\n return Buffer.from(str).toString(\"base64\");\n } else {\n return window.btoa(unescape(encodeURIComponent(str)));\n }\n }\n toFileUrl(path) {\n let cached = this.memoizedFileURLs.get(path);\n if (cached) return cached;\n if (pathToFileURL$2) {\n let fileURL = pathToFileURL$2(path).toString();\n this.memoizedFileURLs.set(path, fileURL);\n return fileURL;\n } else {\n throw new Error(\n \"`map.absolute` option is not available in this PostCSS build\"\n );\n }\n }\n toUrl(path) {\n let cached = this.memoizedURLs.get(path);\n if (cached) return cached;\n if (sep$1 === \"\\\\\") {\n path = path.replace(/\\\\/g, \"/\");\n }\n let url = encodeURI(path).replace(/[#?]/g, encodeURIComponent);\n this.memoizedURLs.set(path, url);\n return url;\n }\n};\nvar mapGenerator$1 = MapGenerator$2$1;\nlet Node$2$1 = node$1;\nlet Comment$4$1 = class Comment extends Node$2$1 {\n constructor(defaults) {\n super(defaults);\n this.type = \"comment\";\n }\n};\nvar comment$1 = Comment$4$1;\nComment$4$1.default = Comment$4$1;\nlet { isClean: isClean$1$1, my: my$1$1 } = symbols$1;\nlet Declaration$3$1 = declaration$1;\nlet Comment$3$1 = comment$1;\nlet Node$1$1 = node$1;\nlet parse$4$1, Rule$4$1, AtRule$4$1, Root$6$1;\nfunction cleanSource$1(nodes) {\n return nodes.map((i2) => {\n if (i2.nodes) i2.nodes = cleanSource$1(i2.nodes);\n delete i2.source;\n return i2;\n });\n}\nfunction markDirtyUp$1(node2) {\n node2[isClean$1$1] = false;\n if (node2.proxyOf.nodes) {\n for (let i2 of node2.proxyOf.nodes) {\n markDirtyUp$1(i2);\n }\n }\n}\nlet Container$7$1 = class Container extends Node$1$1 {\n append(...children) {\n for (let child of children) {\n let nodes = this.normalize(child, this.last);\n for (let node2 of nodes) this.proxyOf.nodes.push(node2);\n }\n this.markDirty();\n return this;\n }\n cleanRaws(keepBetween) {\n super.cleanRaws(keepBetween);\n if (this.nodes) {\n for (let node2 of this.nodes) node2.cleanRaws(keepBetween);\n }\n }\n each(callback) {\n if (!this.proxyOf.nodes) return void 0;\n let iterator = this.getIterator();\n let index2, result2;\n while (this.indexes[iterator] < this.proxyOf.nodes.length) {\n index2 = this.indexes[iterator];\n result2 = callback(this.proxyOf.nodes[index2], index2);\n if (result2 === false) break;\n this.indexes[iterator] += 1;\n }\n delete this.indexes[iterator];\n return result2;\n }\n every(condition) {\n return this.nodes.every(condition);\n }\n getIterator() {\n if (!this.lastEach) this.lastEach = 0;\n if (!this.indexes) this.indexes = {};\n this.lastEach += 1;\n let iterator = this.lastEach;\n this.indexes[iterator] = 0;\n return iterator;\n }\n getProxyProcessor() {\n return {\n get(node2, prop) {\n if (prop === \"proxyOf\") {\n return node2;\n } else if (!node2[prop]) {\n return node2[prop];\n } else if (prop === \"each\" || typeof prop === \"string\" && prop.startsWith(\"walk\")) {\n return (...args) => {\n return node2[prop](\n ...args.map((i2) => {\n if (typeof i2 === \"function\") {\n return (child, index2) => i2(child.toProxy(), index2);\n } else {\n return i2;\n }\n })\n );\n };\n } else if (prop === \"every\" || prop === \"some\") {\n return (cb) => {\n return node2[prop](\n (child, ...other) => cb(child.toProxy(), ...other)\n );\n };\n } else if (prop === \"root\") {\n return () => node2.root().toProxy();\n } else if (prop === \"nodes\") {\n return node2.nodes.map((i2) => i2.toProxy());\n } else if (prop === \"first\" || prop === \"last\") {\n return node2[prop].toProxy();\n } else {\n return node2[prop];\n }\n },\n set(node2, prop, value) {\n if (node2[prop] === value) return true;\n node2[prop] = value;\n if (prop === \"name\" || prop === \"params\" || prop === \"selector\") {\n node2.markDirty();\n }\n return true;\n }\n };\n }\n index(child) {\n if (typeof child === \"number\") return child;\n if (child.proxyOf) child = child.proxyOf;\n return this.proxyOf.nodes.indexOf(child);\n }\n insertAfter(exist, add) {\n let existIndex = this.index(exist);\n let nodes = this.normalize(add, this.proxyOf.nodes[existIndex]).reverse();\n existIndex = this.index(exist);\n for (let node2 of nodes) this.proxyOf.nodes.splice(existIndex + 1, 0, node2);\n let index2;\n for (let id in this.indexes) {\n index2 = this.indexes[id];\n if (existIndex < index2) {\n this.indexes[id] = index2 + nodes.length;\n }\n }\n this.markDirty();\n return this;\n }\n insertBefore(exist, add) {\n let existIndex = this.index(exist);\n let type = existIndex === 0 ? \"prepend\" : false;\n let nodes = this.normalize(add, this.proxyOf.nodes[existIndex], type).reverse();\n existIndex = this.index(exist);\n for (let node2 of nodes) this.proxyOf.nodes.splice(existIndex, 0, node2);\n let index2;\n for (let id in this.indexes) {\n index2 = this.indexes[id];\n if (existIndex <= index2) {\n this.indexes[id] = index2 + nodes.length;\n }\n }\n this.markDirty();\n return this;\n }\n normalize(nodes, sample) {\n if (typeof nodes === \"string\") {\n nodes = cleanSource$1(parse$4$1(nodes).nodes);\n } else if (typeof nodes === \"undefined\") {\n nodes = [];\n } else if (Array.isArray(nodes)) {\n nodes = nodes.slice(0);\n for (let i2 of nodes) {\n if (i2.parent) i2.parent.removeChild(i2, \"ignore\");\n }\n } else if (nodes.type === \"root\" && this.type !== \"document\") {\n nodes = nodes.nodes.slice(0);\n for (let i2 of nodes) {\n if (i2.parent) i2.parent.removeChild(i2, \"ignore\");\n }\n } else if (nodes.type) {\n nodes = [nodes];\n } else if (nodes.prop) {\n if (typeof nodes.value === \"undefined\") {\n throw new Error(\"Value field is missed in node creation\");\n } else if (typeof nodes.value !== \"string\") {\n nodes.value = String(nodes.value);\n }\n nodes = [new Declaration$3$1(nodes)];\n } else if (nodes.selector) {\n nodes = [new Rule$4$1(nodes)];\n } else if (nodes.name) {\n nodes = [new AtRule$4$1(nodes)];\n } else if (nodes.text) {\n nodes = [new Comment$3$1(nodes)];\n } else {\n throw new Error(\"Unknown node type in node creation\");\n }\n let processed = nodes.map((i2) => {\n if (!i2[my$1$1]) Container.rebuild(i2);\n i2 = i2.proxyOf;\n if (i2.parent) i2.parent.removeChild(i2);\n if (i2[isClean$1$1]) markDirtyUp$1(i2);\n if (typeof i2.raws.before === \"undefined\") {\n if (sample && typeof sample.raws.before !== \"undefined\") {\n i2.raws.before = sample.raws.before.replace(/\\S/g, \"\");\n }\n }\n i2.parent = this.proxyOf;\n return i2;\n });\n return processed;\n }\n prepend(...children) {\n children = children.reverse();\n for (let child of children) {\n let nodes = this.normalize(child, this.first, \"prepend\").reverse();\n for (let node2 of nodes) this.proxyOf.nodes.unshift(node2);\n for (let id in this.indexes) {\n this.indexes[id] = this.indexes[id] + nodes.length;\n }\n }\n this.markDirty();\n return this;\n }\n push(child) {\n child.parent = this;\n this.proxyOf.nodes.push(child);\n return this;\n }\n removeAll() {\n for (let node2 of this.proxyOf.nodes) node2.parent = void 0;\n this.proxyOf.nodes = [];\n this.markDirty();\n return this;\n }\n removeChild(child) {\n child = this.index(child);\n this.proxyOf.nodes[child].parent = void 0;\n this.proxyOf.nodes.splice(child, 1);\n let index2;\n for (let id in this.indexes) {\n index2 = this.indexes[id];\n if (index2 >= child) {\n this.indexes[id] = index2 - 1;\n }\n }\n this.markDirty();\n return this;\n }\n replaceValues(pattern, opts, callback) {\n if (!callback) {\n callback = opts;\n opts = {};\n }\n this.walkDecls((decl) => {\n if (opts.props && !opts.props.includes(decl.prop)) return;\n if (opts.fast && !decl.value.includes(opts.fast)) return;\n decl.value = decl.value.replace(pattern, callback);\n });\n this.markDirty();\n return this;\n }\n some(condition) {\n return this.nodes.some(condition);\n }\n walk(callback) {\n return this.each((child, i2) => {\n let result2;\n try {\n result2 = callback(child, i2);\n } catch (e2) {\n throw child.addToError(e2);\n }\n if (result2 !== false && child.walk) {\n result2 = child.walk(callback);\n }\n return result2;\n });\n }\n walkAtRules(name, callback) {\n if (!callback) {\n callback = name;\n return this.walk((child, i2) => {\n if (child.type === \"atrule\") {\n return callback(child, i2);\n }\n });\n }\n if (name instanceof RegExp) {\n return this.walk((child, i2) => {\n if (child.type === \"atrule\" && name.test(child.name)) {\n return callback(child, i2);\n }\n });\n }\n return this.walk((child, i2) => {\n if (child.type === \"atrule\" && child.name === name) {\n return callback(child, i2);\n }\n });\n }\n walkComments(callback) {\n return this.walk((child, i2) => {\n if (child.type === \"comment\") {\n return callback(child, i2);\n }\n });\n }\n walkDecls(prop, callback) {\n if (!callback) {\n callback = prop;\n return this.walk((child, i2) => {\n if (child.type === \"decl\") {\n return callback(child, i2);\n }\n });\n }\n if (prop instanceof RegExp) {\n return this.walk((child, i2) => {\n if (child.type === \"decl\" && prop.test(child.prop)) {\n return callback(child, i2);\n }\n });\n }\n return this.walk((child, i2) => {\n if (child.type === \"decl\" && child.prop === prop) {\n return callback(child, i2);\n }\n });\n }\n walkRules(selector, callback) {\n if (!callback) {\n callback = selector;\n return this.walk((child, i2) => {\n if (child.type === \"rule\") {\n return callback(child, i2);\n }\n });\n }\n if (selector instanceof RegExp) {\n return this.walk((child, i2) => {\n if (child.type === \"rule\" && selector.test(child.selector)) {\n return callback(child, i2);\n }\n });\n }\n return this.walk((child, i2) => {\n if (child.type === \"rule\" && child.selector === selector) {\n return callback(child, i2);\n }\n });\n }\n get first() {\n if (!this.proxyOf.nodes) return void 0;\n return this.proxyOf.nodes[0];\n }\n get last() {\n if (!this.proxyOf.nodes) return void 0;\n return this.proxyOf.nodes[this.proxyOf.nodes.length - 1];\n }\n};\nContainer$7$1.registerParse = (dependant) => {\n parse$4$1 = dependant;\n};\nContainer$7$1.registerRule = (dependant) => {\n Rule$4$1 = dependant;\n};\nContainer$7$1.registerAtRule = (dependant) => {\n AtRule$4$1 = dependant;\n};\nContainer$7$1.registerRoot = (dependant) => {\n Root$6$1 = dependant;\n};\nvar container$1 = Container$7$1;\nContainer$7$1.default = Container$7$1;\nContainer$7$1.rebuild = (node2) => {\n if (node2.type === \"atrule\") {\n Object.setPrototypeOf(node2, AtRule$4$1.prototype);\n } else if (node2.type === \"rule\") {\n Object.setPrototypeOf(node2, Rule$4$1.prototype);\n } else if (node2.type === \"decl\") {\n Object.setPrototypeOf(node2, Declaration$3$1.prototype);\n } else if (node2.type === \"comment\") {\n Object.setPrototypeOf(node2, Comment$3$1.prototype);\n } else if (node2.type === \"root\") {\n Object.setPrototypeOf(node2, Root$6$1.prototype);\n }\n node2[my$1$1] = true;\n if (node2.nodes) {\n node2.nodes.forEach((child) => {\n Container$7$1.rebuild(child);\n });\n }\n};\nlet Container$6$1 = container$1;\nlet LazyResult$4$1, Processor$3$1;\nlet Document$3$1 = class Document2 extends Container$6$1 {\n constructor(defaults) {\n super({ type: \"document\", ...defaults });\n if (!this.nodes) {\n this.nodes = [];\n }\n }\n toResult(opts = {}) {\n let lazy = new LazyResult$4$1(new Processor$3$1(), this, opts);\n return lazy.stringify();\n }\n};\nDocument$3$1.registerLazyResult = (dependant) => {\n LazyResult$4$1 = dependant;\n};\nDocument$3$1.registerProcessor = (dependant) => {\n Processor$3$1 = dependant;\n};\nvar document$1$1 = Document$3$1;\nDocument$3$1.default = Document$3$1;\nlet printed$1 = {};\nvar warnOnce$2$1 = function warnOnce(message) {\n if (printed$1[message]) return;\n printed$1[message] = true;\n if (typeof console !== \"undefined\" && console.warn) {\n console.warn(message);\n }\n};\nlet Warning$2$1 = class Warning {\n constructor(text, opts = {}) {\n this.type = \"warning\";\n this.text = text;\n if (opts.node && opts.node.source) {\n let range = opts.node.rangeBy(opts);\n this.line = range.start.line;\n this.column = range.start.column;\n this.endLine = range.end.line;\n this.endColumn = range.end.column;\n }\n for (let opt in opts) this[opt] = opts[opt];\n }\n toString() {\n if (this.node) {\n return this.node.error(this.text, {\n index: this.index,\n plugin: this.plugin,\n word: this.word\n }).message;\n }\n if (this.plugin) {\n return this.plugin + \": \" + this.text;\n }\n return this.text;\n }\n};\nvar warning$1 = Warning$2$1;\nWarning$2$1.default = Warning$2$1;\nlet Warning$1$1 = warning$1;\nlet Result$3$1 = class Result {\n constructor(processor2, root2, opts) {\n this.processor = processor2;\n this.messages = [];\n this.root = root2;\n this.opts = opts;\n this.css = void 0;\n this.map = void 0;\n }\n toString() {\n return this.css;\n }\n warn(text, opts = {}) {\n if (!opts.plugin) {\n if (this.lastPlugin && this.lastPlugin.postcssPlugin) {\n opts.plugin = this.lastPlugin.postcssPlugin;\n }\n }\n let warning2 = new Warning$1$1(text, opts);\n this.messages.push(warning2);\n return warning2;\n }\n warnings() {\n return this.messages.filter((i2) => i2.type === \"warning\");\n }\n get content() {\n return this.css;\n }\n};\nvar result$1 = Result$3$1;\nResult$3$1.default = Result$3$1;\nconst SINGLE_QUOTE$1 = \"'\".charCodeAt(0);\nconst DOUBLE_QUOTE$1 = '\"'.charCodeAt(0);\nconst BACKSLASH$1 = \"\\\\\".charCodeAt(0);\nconst SLASH$1 = \"/\".charCodeAt(0);\nconst NEWLINE$1 = \"\\n\".charCodeAt(0);\nconst SPACE$1 = \" \".charCodeAt(0);\nconst FEED$1 = \"\\f\".charCodeAt(0);\nconst TAB$1 = \"\t\".charCodeAt(0);\nconst CR$1 = \"\\r\".charCodeAt(0);\nconst OPEN_SQUARE$1 = \"[\".charCodeAt(0);\nconst CLOSE_SQUARE$1 = \"]\".charCodeAt(0);\nconst OPEN_PARENTHESES$1 = \"(\".charCodeAt(0);\nconst CLOSE_PARENTHESES$1 = \")\".charCodeAt(0);\nconst OPEN_CURLY$1 = \"{\".charCodeAt(0);\nconst CLOSE_CURLY$1 = \"}\".charCodeAt(0);\nconst SEMICOLON$1 = \";\".charCodeAt(0);\nconst ASTERISK$1 = \"*\".charCodeAt(0);\nconst COLON$1 = \":\".charCodeAt(0);\nconst AT$1 = \"@\".charCodeAt(0);\nconst RE_AT_END$1 = /[\\t\\n\\f\\r \"#'()/;[\\\\\\]{}]/g;\nconst RE_WORD_END$1 = /[\\t\\n\\f\\r !\"#'():;@[\\\\\\]{}]|\\/(?=\\*)/g;\nconst RE_BAD_BRACKET$1 = /.[\\r\\n\"'(/\\\\]/;\nconst RE_HEX_ESCAPE$1 = /[\\da-f]/i;\nvar tokenize$1 = function tokenizer(input2, options = {}) {\n let css = input2.css.valueOf();\n let ignore = options.ignoreErrors;\n let code, next, quote, content, escape;\n let escaped, escapePos, prev, n2, currentToken;\n let length = css.length;\n let pos = 0;\n let buffer = [];\n let returned = [];\n function position() {\n return pos;\n }\n function unclosed(what) {\n throw input2.error(\"Unclosed \" + what, pos);\n }\n function endOfFile() {\n return returned.length === 0 && pos >= length;\n }\n function nextToken(opts) {\n if (returned.length) return returned.pop();\n if (pos >= length) return;\n let ignoreUnclosed = opts ? opts.ignoreUnclosed : false;\n code = css.charCodeAt(pos);\n switch (code) {\n case NEWLINE$1:\n case SPACE$1:\n case TAB$1:\n case CR$1:\n case FEED$1: {\n next = pos;\n do {\n next += 1;\n code = css.charCodeAt(next);\n } while (code === SPACE$1 || code === NEWLINE$1 || code === TAB$1 || code === CR$1 || code === FEED$1);\n currentToken = [\"space\", css.slice(pos, next)];\n pos = next - 1;\n break;\n }\n case OPEN_SQUARE$1:\n case CLOSE_SQUARE$1:\n case OPEN_CURLY$1:\n case CLOSE_CURLY$1:\n case COLON$1:\n case SEMICOLON$1:\n case CLOSE_PARENTHESES$1: {\n let controlChar = String.fromCharCode(code);\n currentToken = [controlChar, controlChar, pos];\n break;\n }\n case OPEN_PARENTHESES$1: {\n prev = buffer.length ? buffer.pop()[1] : \"\";\n n2 = css.charCodeAt(pos + 1);\n if (prev === \"url\" && n2 !== SINGLE_QUOTE$1 && n2 !== DOUBLE_QUOTE$1 && n2 !== SPACE$1 && n2 !== NEWLINE$1 && n2 !== TAB$1 && n2 !== FEED$1 && n2 !== CR$1) {\n next = pos;\n do {\n escaped = false;\n next = css.indexOf(\")\", next + 1);\n if (next === -1) {\n if (ignore || ignoreUnclosed) {\n next = pos;\n break;\n } else {\n unclosed(\"bracket\");\n }\n }\n escapePos = next;\n while (css.charCodeAt(escapePos - 1) === BACKSLASH$1) {\n escapePos -= 1;\n escaped = !escaped;\n }\n } while (escaped);\n currentToken = [\"brackets\", css.slice(pos, next + 1), pos, next];\n pos = next;\n } else {\n next = css.indexOf(\")\", pos + 1);\n content = css.slice(pos, next + 1);\n if (next === -1 || RE_BAD_BRACKET$1.test(content)) {\n currentToken = [\"(\", \"(\", pos];\n } else {\n currentToken = [\"brackets\", content, pos, next];\n pos = next;\n }\n }\n break;\n }\n case SINGLE_QUOTE$1:\n case DOUBLE_QUOTE$1: {\n quote = code === SINGLE_QUOTE$1 ? \"'\" : '\"';\n next = pos;\n do {\n escaped = false;\n next = css.indexOf(quote, next + 1);\n if (next === -1) {\n if (ignore || ignoreUnclosed) {\n next = pos + 1;\n break;\n } else {\n unclosed(\"string\");\n }\n }\n escapePos = next;\n while (css.charCodeAt(escapePos - 1) === BACKSLASH$1) {\n escapePos -= 1;\n escaped = !escaped;\n }\n } while (escaped);\n currentToken = [\"string\", css.slice(pos, next + 1), pos, next];\n pos = next;\n break;\n }\n case AT$1: {\n RE_AT_END$1.lastIndex = pos + 1;\n RE_AT_END$1.test(css);\n if (RE_AT_END$1.lastIndex === 0) {\n next = css.length - 1;\n } else {\n next = RE_AT_END$1.lastIndex - 2;\n }\n currentToken = [\"at-word\", css.slice(pos, next + 1), pos, next];\n pos = next;\n break;\n }\n case BACKSLASH$1: {\n next = pos;\n escape = true;\n while (css.charCodeAt(next + 1) === BACKSLASH$1) {\n next += 1;\n escape = !escape;\n }\n code = css.charCodeAt(next + 1);\n if (escape && code !== SLASH$1 && code !== SPACE$1 && code !== NEWLINE$1 && code !== TAB$1 && code !== CR$1 && code !== FEED$1) {\n next += 1;\n if (RE_HEX_ESCAPE$1.test(css.charAt(next))) {\n while (RE_HEX_ESCAPE$1.test(css.charAt(next + 1))) {\n next += 1;\n }\n if (css.charCodeAt(next + 1) === SPACE$1) {\n next += 1;\n }\n }\n }\n currentToken = [\"word\", css.slice(pos, next + 1), pos, next];\n pos = next;\n break;\n }\n default: {\n if (code === SLASH$1 && css.charCodeAt(pos + 1) === ASTERISK$1) {\n next = css.indexOf(\"*/\", pos + 2) + 1;\n if (next === 0) {\n if (ignore || ignoreUnclosed) {\n next = css.length;\n } else {\n unclosed(\"comment\");\n }\n }\n currentToken = [\"comment\", css.slice(pos, next + 1), pos, next];\n pos = next;\n } else {\n RE_WORD_END$1.lastIndex = pos + 1;\n RE_WORD_END$1.test(css);\n if (RE_WORD_END$1.lastIndex === 0) {\n next = css.length - 1;\n } else {\n next = RE_WORD_END$1.lastIndex - 2;\n }\n currentToken = [\"word\", css.slice(pos, next + 1), pos, next];\n buffer.push(currentToken);\n pos = next;\n }\n break;\n }\n }\n pos++;\n return currentToken;\n }\n function back(token) {\n returned.push(token);\n }\n return {\n back,\n endOfFile,\n nextToken,\n position\n };\n};\nlet Container$5$1 = container$1;\nlet AtRule$3$1 = class AtRule extends Container$5$1 {\n constructor(defaults) {\n super(defaults);\n this.type = \"atrule\";\n }\n append(...children) {\n if (!this.proxyOf.nodes) this.nodes = [];\n return super.append(...children);\n }\n prepend(...children) {\n if (!this.proxyOf.nodes) this.nodes = [];\n return super.prepend(...children);\n }\n};\nvar atRule$1 = AtRule$3$1;\nAtRule$3$1.default = AtRule$3$1;\nContainer$5$1.registerAtRule(AtRule$3$1);\nlet Container$4$1 = container$1;\nlet LazyResult$3$1, Processor$2$1;\nlet Root$5$1 = class Root extends Container$4$1 {\n constructor(defaults) {\n super(defaults);\n this.type = \"root\";\n if (!this.nodes) this.nodes = [];\n }\n normalize(child, sample, type) {\n let nodes = super.normalize(child);\n if (sample) {\n if (type === \"prepend\") {\n if (this.nodes.length > 1) {\n sample.raws.before = this.nodes[1].raws.before;\n } else {\n delete sample.raws.before;\n }\n } else if (this.first !== sample) {\n for (let node2 of nodes) {\n node2.raws.before = sample.raws.before;\n }\n }\n }\n return nodes;\n }\n removeChild(child, ignore) {\n let index2 = this.index(child);\n if (!ignore && index2 === 0 && this.nodes.length > 1) {\n this.nodes[1].raws.before = this.nodes[index2].raws.before;\n }\n return super.removeChild(child);\n }\n toResult(opts = {}) {\n let lazy = new LazyResult$3$1(new Processor$2$1(), this, opts);\n return lazy.stringify();\n }\n};\nRoot$5$1.registerLazyResult = (dependant) => {\n LazyResult$3$1 = dependant;\n};\nRoot$5$1.registerProcessor = (dependant) => {\n Processor$2$1 = dependant;\n};\nvar root$1 = Root$5$1;\nRoot$5$1.default = Root$5$1;\nContainer$4$1.registerRoot(Root$5$1);\nlet list$2$1 = {\n comma(string) {\n return list$2$1.split(string, [\",\"], true);\n },\n space(string) {\n let spaces = [\" \", \"\\n\", \"\t\"];\n return list$2$1.split(string, spaces);\n },\n split(string, separators, last) {\n let array = [];\n let current = \"\";\n let split = false;\n let func = 0;\n let inQuote = false;\n let prevQuote = \"\";\n let escape = false;\n for (let letter of string) {\n if (escape) {\n escape = false;\n } else if (letter === \"\\\\\") {\n escape = true;\n } else if (inQuote) {\n if (letter === prevQuote) {\n inQuote = false;\n }\n } else if (letter === '\"' || letter === \"'\") {\n inQuote = true;\n prevQuote = letter;\n } else if (letter === \"(\") {\n func += 1;\n } else if (letter === \")\") {\n if (func > 0) func -= 1;\n } else if (func === 0) {\n if (separators.includes(letter)) split = true;\n }\n if (split) {\n if (current !== \"\") array.push(current.trim());\n current = \"\";\n split = false;\n } else {\n current += letter;\n }\n }\n if (last || current !== \"\") array.push(current.trim());\n return array;\n }\n};\nvar list_1$1 = list$2$1;\nlist$2$1.default = list$2$1;\nlet Container$3$1 = container$1;\nlet list$1$1 = list_1$1;\nlet Rule$3$1 = class Rule extends Container$3$1 {\n constructor(defaults) {\n super(defaults);\n this.type = \"rule\";\n if (!this.nodes) this.nodes = [];\n }\n get selectors() {\n return list$1$1.comma(this.selector);\n }\n set selectors(values) {\n let match = this.selector ? this.selector.match(/,\\s*/) : null;\n let sep2 = match ? match[0] : \",\" + this.raw(\"between\", \"beforeOpen\");\n this.selector = values.join(sep2);\n }\n};\nvar rule$1 = Rule$3$1;\nRule$3$1.default = Rule$3$1;\nContainer$3$1.registerRule(Rule$3$1);\nlet Declaration$2$1 = declaration$1;\nlet tokenizer2$1 = tokenize$1;\nlet Comment$2$1 = comment$1;\nlet AtRule$2$1 = atRule$1;\nlet Root$4$1 = root$1;\nlet Rule$2$1 = rule$1;\nconst SAFE_COMMENT_NEIGHBOR$1 = {\n empty: true,\n space: true\n};\nfunction findLastWithPosition$1(tokens) {\n for (let i2 = tokens.length - 1; i2 >= 0; i2--) {\n let token = tokens[i2];\n let pos = token[3] || token[2];\n if (pos) return pos;\n }\n}\nlet Parser$1$1 = class Parser {\n constructor(input2) {\n this.input = input2;\n this.root = new Root$4$1();\n this.current = this.root;\n this.spaces = \"\";\n this.semicolon = false;\n this.createTokenizer();\n this.root.source = { input: input2, start: { column: 1, line: 1, offset: 0 } };\n }\n atrule(token) {\n let node2 = new AtRule$2$1();\n node2.name = token[1].slice(1);\n if (node2.name === \"\") {\n this.unnamedAtrule(node2, token);\n }\n this.init(node2, token[2]);\n let type;\n let prev;\n let shift;\n let last = false;\n let open = false;\n let params = [];\n let brackets = [];\n while (!this.tokenizer.endOfFile()) {\n token = this.tokenizer.nextToken();\n type = token[0];\n if (type === \"(\" || type === \"[\") {\n brackets.push(type === \"(\" ? \")\" : \"]\");\n } else if (type === \"{\" && brackets.length > 0) {\n brackets.push(\"}\");\n } else if (type === brackets[brackets.length - 1]) {\n brackets.pop();\n }\n if (brackets.length === 0) {\n if (type === \";\") {\n node2.source.end = this.getPosition(token[2]);\n node2.source.end.offset++;\n this.semicolon = true;\n break;\n } else if (type === \"{\") {\n open = true;\n break;\n } else if (type === \"}\") {\n if (params.length > 0) {\n shift = params.length - 1;\n prev = params[shift];\n while (prev && prev[0] === \"space\") {\n prev = params[--shift];\n }\n if (prev) {\n node2.source.end = this.getPosition(prev[3] || prev[2]);\n node2.source.end.offset++;\n }\n }\n this.end(token);\n break;\n } else {\n params.push(token);\n }\n } else {\n params.push(token);\n }\n if (this.tokenizer.endOfFile()) {\n last = true;\n break;\n }\n }\n node2.raws.between = this.spacesAndCommentsFromEnd(params);\n if (params.length) {\n node2.raws.afterName = this.spacesAndCommentsFromStart(params);\n this.raw(node2, \"params\", params);\n if (last) {\n token = params[params.length - 1];\n node2.source.end = this.getPosition(token[3] || token[2]);\n node2.source.end.offset++;\n this.spaces = node2.raws.between;\n node2.raws.between = \"\";\n }\n } else {\n node2.raws.afterName = \"\";\n node2.params = \"\";\n }\n if (open) {\n node2.nodes = [];\n this.current = node2;\n }\n }\n checkMissedSemicolon(tokens) {\n let colon = this.colon(tokens);\n if (colon === false) return;\n let founded = 0;\n let token;\n for (let j = colon - 1; j >= 0; j--) {\n token = tokens[j];\n if (token[0] !== \"space\") {\n founded += 1;\n if (founded === 2) break;\n }\n }\n throw this.input.error(\n \"Missed semicolon\",\n token[0] === \"word\" ? token[3] + 1 : token[2]\n );\n }\n colon(tokens) {\n let brackets = 0;\n let token, type, prev;\n for (let [i2, element] of tokens.entries()) {\n token = element;\n type = token[0];\n if (type === \"(\") {\n brackets += 1;\n }\n if (type === \")\") {\n brackets -= 1;\n }\n if (brackets === 0 && type === \":\") {\n if (!prev) {\n this.doubleColon(token);\n } else if (prev[0] === \"word\" && prev[1] === \"progid\") {\n continue;\n } else {\n return i2;\n }\n }\n prev = token;\n }\n return false;\n }\n comment(token) {\n let node2 = new Comment$2$1();\n this.init(node2, token[2]);\n node2.source.end = this.getPosition(token[3] || token[2]);\n node2.source.end.offset++;\n let text = token[1].slice(2, -2);\n if (/^\\s*$/.test(text)) {\n node2.text = \"\";\n node2.raws.left = text;\n node2.raws.right = \"\";\n } else {\n let match = text.match(/^(\\s*)([^]*\\S)(\\s*)$/);\n node2.text = match[2];\n node2.raws.left = match[1];\n node2.raws.right = match[3];\n }\n }\n createTokenizer() {\n this.tokenizer = tokenizer2$1(this.input);\n }\n decl(tokens, customProperty) {\n let node2 = new Declaration$2$1();\n this.init(node2, tokens[0][2]);\n let last = tokens[tokens.length - 1];\n if (last[0] === \";\") {\n this.semicolon = true;\n tokens.pop();\n }\n node2.source.end = this.getPosition(\n last[3] || last[2] || findLastWithPosition$1(tokens)\n );\n node2.source.end.offset++;\n while (tokens[0][0] !== \"word\") {\n if (tokens.length === 1) this.unknownWord(tokens);\n node2.raws.before += tokens.shift()[1];\n }\n node2.source.start = this.getPosition(tokens[0][2]);\n node2.prop = \"\";\n while (tokens.length) {\n let type = tokens[0][0];\n if (type === \":\" || type === \"space\" || type === \"comment\") {\n break;\n }\n node2.prop += tokens.shift()[1];\n }\n node2.raws.between = \"\";\n let token;\n while (tokens.length) {\n token = tokens.shift();\n if (token[0] === \":\") {\n node2.raws.between += token[1];\n break;\n } else {\n if (token[0] === \"word\" && /\\w/.test(token[1])) {\n this.unknownWord([token]);\n }\n node2.raws.between += token[1];\n }\n }\n if (node2.prop[0] === \"_\" || node2.prop[0] === \"*\") {\n node2.raws.before += node2.prop[0];\n node2.prop = node2.prop.slice(1);\n }\n let firstSpaces = [];\n let next;\n while (tokens.length) {\n next = tokens[0][0];\n if (next !== \"space\" && next !== \"comment\") break;\n firstSpaces.push(tokens.shift());\n }\n this.precheckMissedSemicolon(tokens);\n for (let i2 = tokens.length - 1; i2 >= 0; i2--) {\n token = tokens[i2];\n if (token[1].toLowerCase() === \"!important\") {\n node2.important = true;\n let string = this.stringFrom(tokens, i2);\n string = this.spacesFromEnd(tokens) + string;\n if (string !== \" !important\") node2.raws.important = string;\n break;\n } else if (token[1].toLowerCase() === \"important\") {\n let cache = tokens.slice(0);\n let str = \"\";\n for (let j = i2; j > 0; j--) {\n let type = cache[j][0];\n if (str.trim().indexOf(\"!\") === 0 && type !== \"space\") {\n break;\n }\n str = cache.pop()[1] + str;\n }\n if (str.trim().indexOf(\"!\") === 0) {\n node2.important = true;\n node2.raws.important = str;\n tokens = cache;\n }\n }\n if (token[0] !== \"space\" && token[0] !== \"comment\") {\n break;\n }\n }\n let hasWord = tokens.some((i2) => i2[0] !== \"space\" && i2[0] !== \"comment\");\n if (hasWord) {\n node2.raws.between += firstSpaces.map((i2) => i2[1]).join(\"\");\n firstSpaces = [];\n }\n this.raw(node2, \"value\", firstSpaces.concat(tokens), customProperty);\n if (node2.value.includes(\":\") && !customProperty) {\n this.checkMissedSemicolon(tokens);\n }\n }\n doubleColon(token) {\n throw this.input.error(\n \"Double colon\",\n { offset: token[2] },\n { offset: token[2] + token[1].length }\n );\n }\n emptyRule(token) {\n let node2 = new Rule$2$1();\n this.init(node2, token[2]);\n node2.selector = \"\";\n node2.raws.between = \"\";\n this.current = node2;\n }\n end(token) {\n if (this.current.nodes && this.current.nodes.length) {\n this.current.raws.semicolon = this.semicolon;\n }\n this.semicolon = false;\n this.current.raws.after = (this.current.raws.after || \"\") + this.spaces;\n this.spaces = \"\";\n if (this.current.parent) {\n this.current.source.end = this.getPosition(token[2]);\n this.current.source.end.offset++;\n this.current = this.current.parent;\n } else {\n this.unexpectedClose(token);\n }\n }\n endFile() {\n if (this.current.parent) this.unclosedBlock();\n if (this.current.nodes && this.current.nodes.length) {\n this.current.raws.semicolon = this.semicolon;\n }\n this.current.raws.after = (this.current.raws.after || \"\") + this.spaces;\n this.root.source.end = this.getPosition(this.tokenizer.position());\n }\n freeSemicolon(token) {\n this.spaces += token[1];\n if (this.current.nodes) {\n let prev = this.current.nodes[this.current.nodes.length - 1];\n if (prev && prev.type === \"rule\" && !prev.raws.ownSemicolon) {\n prev.raws.ownSemicolon = this.spaces;\n this.spaces = \"\";\n }\n }\n }\n // Helpers\n getPosition(offset) {\n let pos = this.input.fromOffset(offset);\n return {\n column: pos.col,\n line: pos.line,\n offset\n };\n }\n init(node2, offset) {\n this.current.push(node2);\n node2.source = {\n input: this.input,\n start: this.getPosition(offset)\n };\n node2.raws.before = this.spaces;\n this.spaces = \"\";\n if (node2.type !== \"comment\") this.semicolon = false;\n }\n other(start) {\n let end = false;\n let type = null;\n let colon = false;\n let bracket = null;\n let brackets = [];\n let customProperty = start[1].startsWith(\"--\");\n let tokens = [];\n let token = start;\n while (token) {\n type = token[0];\n tokens.push(token);\n if (type === \"(\" || type === \"[\") {\n if (!bracket) bracket = token;\n brackets.push(type === \"(\" ? \")\" : \"]\");\n } else if (customProperty && colon && type === \"{\") {\n if (!bracket) bracket = token;\n brackets.push(\"}\");\n } else if (brackets.length === 0) {\n if (type === \";\") {\n if (colon) {\n this.decl(tokens, customProperty);\n return;\n } else {\n break;\n }\n } else if (type === \"{\") {\n this.rule(tokens);\n return;\n } else if (type === \"}\") {\n this.tokenizer.back(tokens.pop());\n end = true;\n break;\n } else if (type === \":\") {\n colon = true;\n }\n } else if (type === brackets[brackets.length - 1]) {\n brackets.pop();\n if (brackets.length === 0) bracket = null;\n }\n token = this.tokenizer.nextToken();\n }\n if (this.tokenizer.endOfFile()) end = true;\n if (brackets.length > 0) this.unclosedBracket(bracket);\n if (end && colon) {\n if (!customProperty) {\n while (tokens.length) {\n token = tokens[tokens.length - 1][0];\n if (token !== \"space\" && token !== \"comment\") break;\n this.tokenizer.back(tokens.pop());\n }\n }\n this.decl(tokens, customProperty);\n } else {\n this.unknownWord(tokens);\n }\n }\n parse() {\n let token;\n while (!this.tokenizer.endOfFile()) {\n token = this.tokenizer.nextToken();\n switch (token[0]) {\n case \"space\":\n this.spaces += token[1];\n break;\n case \";\":\n this.freeSemicolon(token);\n break;\n case \"}\":\n this.end(token);\n break;\n case \"comment\":\n this.comment(token);\n break;\n case \"at-word\":\n this.atrule(token);\n break;\n case \"{\":\n this.emptyRule(token);\n break;\n default:\n this.other(token);\n break;\n }\n }\n this.endFile();\n }\n precheckMissedSemicolon() {\n }\n raw(node2, prop, tokens, customProperty) {\n let token, type;\n let length = tokens.length;\n let value = \"\";\n let clean = true;\n let next, prev;\n for (let i2 = 0; i2 < length; i2 += 1) {\n token = tokens[i2];\n type = token[0];\n if (type === \"space\" && i2 === length - 1 && !customProperty) {\n clean = false;\n } else if (type === \"comment\") {\n prev = tokens[i2 - 1] ? tokens[i2 - 1][0] : \"empty\";\n next = tokens[i2 + 1] ? tokens[i2 + 1][0] : \"empty\";\n if (!SAFE_COMMENT_NEIGHBOR$1[prev] && !SAFE_COMMENT_NEIGHBOR$1[next]) {\n if (value.slice(-1) === \",\") {\n clean = false;\n } else {\n value += token[1];\n }\n } else {\n clean = false;\n }\n } else {\n value += token[1];\n }\n }\n if (!clean) {\n let raw = tokens.reduce((all, i2) => all + i2[1], \"\");\n node2.raws[prop] = { raw, value };\n }\n node2[prop] = value;\n }\n rule(tokens) {\n tokens.pop();\n let node2 = new Rule$2$1();\n this.init(node2, tokens[0][2]);\n node2.raws.between = this.spacesAndCommentsFromEnd(tokens);\n this.raw(node2, \"selector\", tokens);\n this.current = node2;\n }\n spacesAndCommentsFromEnd(tokens) {\n let lastTokenType;\n let spaces = \"\";\n while (tokens.length) {\n lastTokenType = tokens[tokens.length - 1][0];\n if (lastTokenType !== \"space\" && lastTokenType !== \"comment\") break;\n spaces = tokens.pop()[1] + spaces;\n }\n return spaces;\n }\n // Errors\n spacesAndCommentsFromStart(tokens) {\n let next;\n let spaces = \"\";\n while (tokens.length) {\n next = tokens[0][0];\n if (next !== \"space\" && next !== \"comment\") break;\n spaces += tokens.shift()[1];\n }\n return spaces;\n }\n spacesFromEnd(tokens) {\n let lastTokenType;\n let spaces = \"\";\n while (tokens.length) {\n lastTokenType = tokens[tokens.length - 1][0];\n if (lastTokenType !== \"space\") break;\n spaces = tokens.pop()[1] + spaces;\n }\n return spaces;\n }\n stringFrom(tokens, from) {\n let result2 = \"\";\n for (let i2 = from; i2 < tokens.length; i2++) {\n result2 += tokens[i2][1];\n }\n tokens.splice(from, tokens.length - from);\n return result2;\n }\n unclosedBlock() {\n let pos = this.current.source.start;\n throw this.input.error(\"Unclosed block\", pos.line, pos.column);\n }\n unclosedBracket(bracket) {\n throw this.input.error(\n \"Unclosed bracket\",\n { offset: bracket[2] },\n { offset: bracket[2] + 1 }\n );\n }\n unexpectedClose(token) {\n throw this.input.error(\n \"Unexpected }\",\n { offset: token[2] },\n { offset: token[2] + 1 }\n );\n }\n unknownWord(tokens) {\n throw this.input.error(\n \"Unknown word\",\n { offset: tokens[0][2] },\n { offset: tokens[0][2] + tokens[0][1].length }\n );\n }\n unnamedAtrule(node2, token) {\n throw this.input.error(\n \"At-rule without name\",\n { offset: token[2] },\n { offset: token[2] + token[1].length }\n );\n }\n};\nvar parser$1 = Parser$1$1;\nlet Container$2$1 = container$1;\nlet Parser2$1 = parser$1;\nlet Input$2$1 = input$1;\nfunction parse$3$1(css, opts) {\n let input2 = new Input$2$1(css, opts);\n let parser2 = new Parser2$1(input2);\n try {\n parser2.parse();\n } catch (e2) {\n if (process.env.NODE_ENV !== \"production\") {\n if (e2.name === \"CssSyntaxError\" && opts && opts.from) {\n if (/\\.scss$/i.test(opts.from)) {\n e2.message += \"\\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser\";\n } else if (/\\.sass/i.test(opts.from)) {\n e2.message += \"\\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser\";\n } else if (/\\.less$/i.test(opts.from)) {\n e2.message += \"\\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser\";\n }\n }\n }\n throw e2;\n }\n return parser2.root;\n}\nvar parse_1$1 = parse$3$1;\nparse$3$1.default = parse$3$1;\nContainer$2$1.registerParse(parse$3$1);\nlet { isClean: isClean$3, my: my$3 } = symbols$1;\nlet MapGenerator$1$1 = mapGenerator$1;\nlet stringify$2$1 = stringify_1$1;\nlet Container$1$1 = container$1;\nlet Document$2$1 = document$1$1;\nlet warnOnce$1$1 = warnOnce$2$1;\nlet Result$2$1 = result$1;\nlet parse$2$1 = parse_1$1;\nlet Root$3$1 = root$1;\nconst TYPE_TO_CLASS_NAME$1 = {\n atrule: \"AtRule\",\n comment: \"Comment\",\n decl: \"Declaration\",\n document: \"Document\",\n root: \"Root\",\n rule: \"Rule\"\n};\nconst PLUGIN_PROPS$1 = {\n AtRule: true,\n AtRuleExit: true,\n Comment: true,\n CommentExit: true,\n Declaration: true,\n DeclarationExit: true,\n Document: true,\n DocumentExit: true,\n Once: true,\n OnceExit: true,\n postcssPlugin: true,\n prepare: true,\n Root: true,\n RootExit: true,\n Rule: true,\n RuleExit: true\n};\nconst NOT_VISITORS$1 = {\n Once: true,\n postcssPlugin: true,\n prepare: true\n};\nconst CHILDREN$1 = 0;\nfunction isPromise$1(obj) {\n return typeof obj === \"object\" && typeof obj.then === \"function\";\n}\nfunction getEvents$1(node2) {\n let key = false;\n let type = TYPE_TO_CLASS_NAME$1[node2.type];\n if (node2.type === \"decl\") {\n key = node2.prop.toLowerCase();\n } else if (node2.type === \"atrule\") {\n key = node2.name.toLowerCase();\n }\n if (key && node2.append) {\n return [\n type,\n type + \"-\" + key,\n CHILDREN$1,\n type + \"Exit\",\n type + \"Exit-\" + key\n ];\n } else if (key) {\n return [type, type + \"-\" + key, type + \"Exit\", type + \"Exit-\" + key];\n } else if (node2.append) {\n return [type, CHILDREN$1, type + \"Exit\"];\n } else {\n return [type, type + \"Exit\"];\n }\n}\nfunction toStack$1(node2) {\n let events;\n if (node2.type === \"document\") {\n events = [\"Document\", CHILDREN$1, \"DocumentExit\"];\n } else if (node2.type === \"root\") {\n events = [\"Root\", CHILDREN$1, \"RootExit\"];\n } else {\n events = getEvents$1(node2);\n }\n return {\n eventIndex: 0,\n events,\n iterator: 0,\n node: node2,\n visitorIndex: 0,\n visitors: []\n };\n}\nfunction cleanMarks$1(node2) {\n node2[isClean$3] = false;\n if (node2.nodes) node2.nodes.forEach((i2) => cleanMarks$1(i2));\n return node2;\n}\nlet postcss$2$1 = {};\nlet LazyResult$2$1 = class LazyResult {\n constructor(processor2, css, opts) {\n this.stringified = false;\n this.processed = false;\n let root2;\n if (typeof css === \"object\" && css !== null && (css.type === \"root\" || css.type === \"document\")) {\n root2 = cleanMarks$1(css);\n } else if (css instanceof LazyResult || css instanceof Result$2$1) {\n root2 = cleanMarks$1(css.root);\n if (css.map) {\n if (typeof opts.map === \"undefined\") opts.map = {};\n if (!opts.map.inline) opts.map.inline = false;\n opts.map.prev = css.map;\n }\n } else {\n let parser2 = parse$2$1;\n if (opts.syntax) parser2 = opts.syntax.parse;\n if (opts.parser) parser2 = opts.parser;\n if (parser2.parse) parser2 = parser2.parse;\n try {\n root2 = parser2(css, opts);\n } catch (error) {\n this.processed = true;\n this.error = error;\n }\n if (root2 && !root2[my$3]) {\n Container$1$1.rebuild(root2);\n }\n }\n this.result = new Result$2$1(processor2, root2, opts);\n this.helpers = { ...postcss$2$1, postcss: postcss$2$1, result: this.result };\n this.plugins = this.processor.plugins.map((plugin22) => {\n if (typeof plugin22 === \"object\" && plugin22.prepare) {\n return { ...plugin22, ...plugin22.prepare(this.result) };\n } else {\n return plugin22;\n }\n });\n }\n async() {\n if (this.error) return Promise.reject(this.error);\n if (this.processed) return Promise.resolve(this.result);\n if (!this.processing) {\n this.processing = this.runAsync();\n }\n return this.processing;\n }\n catch(onRejected) {\n return this.async().catch(onRejected);\n }\n finally(onFinally) {\n return this.async().then(onFinally, onFinally);\n }\n getAsyncError() {\n throw new Error(\"Use process(css).then(cb) to work with async plugins\");\n }\n handleError(error, node2) {\n let plugin22 = this.result.lastPlugin;\n try {\n if (node2) node2.addToError(error);\n this.error = error;\n if (error.name === \"CssSyntaxError\" && !error.plugin) {\n error.plugin = plugin22.postcssPlugin;\n error.setMessage();\n } else if (plugin22.postcssVersion) {\n if (process.env.NODE_ENV !== \"production\") {\n let pluginName = plugin22.postcssPlugin;\n let pluginVer = plugin22.postcssVersion;\n let runtimeVer = this.result.processor.version;\n let a2 = pluginVer.split(\".\");\n let b = runtimeVer.split(\".\");\n if (a2[0] !== b[0] || parseInt(a2[1]) > parseInt(b[1])) {\n console.error(\n \"Unknown error from PostCSS plugin. Your current PostCSS version is \" + runtimeVer + \", but \" + pluginName + \" uses \" + pluginVer + \". Perhaps this is the source of the error below.\"\n );\n }\n }\n }\n } catch (err) {\n if (console && console.error) console.error(err);\n }\n return error;\n }\n prepareVisitors() {\n this.listeners = {};\n let add = (plugin22, type, cb) => {\n if (!this.listeners[type]) this.listeners[type] = [];\n this.listeners[type].push([plugin22, cb]);\n };\n for (let plugin22 of this.plugins) {\n if (typeof plugin22 === \"object\") {\n for (let event in plugin22) {\n if (!PLUGIN_PROPS$1[event] && /^[A-Z]/.test(event)) {\n throw new Error(\n `Unknown event ${event} in ${plugin22.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`\n );\n }\n if (!NOT_VISITORS$1[event]) {\n if (typeof plugin22[event] === \"object\") {\n for (let filter in plugin22[event]) {\n if (filter === \"*\") {\n add(plugin22, event, plugin22[event][filter]);\n } else {\n add(\n plugin22,\n event + \"-\" + filter.toLowerCase(),\n plugin22[event][filter]\n );\n }\n }\n } else if (typeof plugin22[event] === \"function\") {\n add(plugin22, event, plugin22[event]);\n }\n }\n }\n }\n }\n this.hasListener = Object.keys(this.listeners).length > 0;\n }\n async runAsync() {\n this.plugin = 0;\n for (let i2 = 0; i2 < this.plugins.length; i2++) {\n let plugin22 = this.plugins[i2];\n let promise = this.runOnRoot(plugin22);\n if (isPromise$1(promise)) {\n try {\n await promise;\n } catch (error) {\n throw this.handleError(error);\n }\n }\n }\n this.prepareVisitors();\n if (this.hasListener) {\n let root2 = this.result.root;\n while (!root2[isClean$3]) {\n root2[isClean$3] = true;\n let stack = [toStack$1(root2)];\n while (stack.length > 0) {\n let promise = this.visitTick(stack);\n if (isPromise$1(promise)) {\n try {\n await promise;\n } catch (e2) {\n let node2 = stack[stack.length - 1].node;\n throw this.handleError(e2, node2);\n }\n }\n }\n }\n if (this.listeners.OnceExit) {\n for (let [plugin22, visitor] of this.listeners.OnceExit) {\n this.result.lastPlugin = plugin22;\n try {\n if (root2.type === \"document\") {\n let roots = root2.nodes.map(\n (subRoot) => visitor(subRoot, this.helpers)\n );\n await Promise.all(roots);\n } else {\n await visitor(root2, this.helpers);\n }\n } catch (e2) {\n throw this.handleError(e2);\n }\n }\n }\n }\n this.processed = true;\n return this.stringify();\n }\n runOnRoot(plugin22) {\n this.result.lastPlugin = plugin22;\n try {\n if (typeof plugin22 === \"object\" && plugin22.Once) {\n if (this.result.root.type === \"document\") {\n let roots = this.result.root.nodes.map(\n (root2) => plugin22.Once(root2, this.helpers)\n );\n if (isPromise$1(roots[0])) {\n return Promise.all(roots);\n }\n return roots;\n }\n return plugin22.Once(this.result.root, this.helpers);\n } else if (typeof plugin22 === \"function\") {\n return plugin22(this.result.root, this.result);\n }\n } catch (error) {\n throw this.handleError(error);\n }\n }\n stringify() {\n if (this.error) throw this.error;\n if (this.stringified) return this.result;\n this.stringified = true;\n this.sync();\n let opts = this.result.opts;\n let str = stringify$2$1;\n if (opts.syntax) str = opts.syntax.stringify;\n if (opts.stringifier) str = opts.stringifier;\n if (str.stringify) str = str.stringify;\n let map = new MapGenerator$1$1(str, this.result.root, this.result.opts);\n let data = map.generate();\n this.result.css = data[0];\n this.result.map = data[1];\n return this.result;\n }\n sync() {\n if (this.error) throw this.error;\n if (this.processed) return this.result;\n this.processed = true;\n if (this.processing) {\n throw this.getAsyncError();\n }\n for (let plugin22 of this.plugins) {\n let promise = this.runOnRoot(plugin22);\n if (isPromise$1(promise)) {\n throw this.getAsyncError();\n }\n }\n this.prepareVisitors();\n if (this.hasListener) {\n let root2 = this.result.root;\n while (!root2[isClean$3]) {\n root2[isClean$3] = true;\n this.walkSync(root2);\n }\n if (this.listeners.OnceExit) {\n if (root2.type === \"document\") {\n for (let subRoot of root2.nodes) {\n this.visitSync(this.listeners.OnceExit, subRoot);\n }\n } else {\n this.visitSync(this.listeners.OnceExit, root2);\n }\n }\n }\n return this.result;\n }\n then(onFulfilled, onRejected) {\n if (process.env.NODE_ENV !== \"production\") {\n if (!(\"from\" in this.opts)) {\n warnOnce$1$1(\n \"Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.\"\n );\n }\n }\n return this.async().then(onFulfilled, onRejected);\n }\n toString() {\n return this.css;\n }\n visitSync(visitors, node2) {\n for (let [plugin22, visitor] of visitors) {\n this.result.lastPlugin = plugin22;\n let promise;\n try {\n promise = visitor(node2, this.helpers);\n } catch (e2) {\n throw this.handleError(e2, node2.proxyOf);\n }\n if (node2.type !== \"root\" && node2.type !== \"document\" && !node2.parent) {\n return true;\n }\n if (isPromise$1(promise)) {\n throw this.getAsyncError();\n }\n }\n }\n visitTick(stack) {\n let visit2 = stack[stack.length - 1];\n let { node: node2, visitors } = visit2;\n if (node2.type !== \"root\" && node2.type !== \"document\" && !node2.parent) {\n stack.pop();\n return;\n }\n if (visitors.length > 0 && visit2.visitorIndex < visitors.length) {\n let [plugin22, visitor] = visitors[visit2.visitorIndex];\n visit2.visitorIndex += 1;\n if (visit2.visitorIndex === visitors.length) {\n visit2.visitors = [];\n visit2.visitorIndex = 0;\n }\n this.result.lastPlugin = plugin22;\n try {\n return visitor(node2.toProxy(), this.helpers);\n } catch (e2) {\n throw this.handleError(e2, node2);\n }\n }\n if (visit2.iterator !== 0) {\n let iterator = visit2.iterator;\n let child;\n while (child = node2.nodes[node2.indexes[iterator]]) {\n node2.indexes[iterator] += 1;\n if (!child[isClean$3]) {\n child[isClean$3] = true;\n stack.push(toStack$1(child));\n return;\n }\n }\n visit2.iterator = 0;\n delete node2.indexes[iterator];\n }\n let events = visit2.events;\n while (visit2.eventIndex < events.length) {\n let event = events[visit2.eventIndex];\n visit2.eventIndex += 1;\n if (event === CHILDREN$1) {\n if (node2.nodes && node2.nodes.length) {\n node2[isClean$3] = true;\n visit2.iterator = node2.getIterator();\n }\n return;\n } else if (this.listeners[event]) {\n visit2.visitors = this.listeners[event];\n return;\n }\n }\n stack.pop();\n }\n walkSync(node2) {\n node2[isClean$3] = true;\n let events = getEvents$1(node2);\n for (let event of events) {\n if (event === CHILDREN$1) {\n if (node2.nodes) {\n node2.each((child) => {\n if (!child[isClean$3]) this.walkSync(child);\n });\n }\n } else {\n let visitors = this.listeners[event];\n if (visitors) {\n if (this.visitSync(visitors, node2.toProxy())) return;\n }\n }\n }\n }\n warnings() {\n return this.sync().warnings();\n }\n get content() {\n return this.stringify().content;\n }\n get css() {\n return this.stringify().css;\n }\n get map() {\n return this.stringify().map;\n }\n get messages() {\n return this.sync().messages;\n }\n get opts() {\n return this.result.opts;\n }\n get processor() {\n return this.result.processor;\n }\n get root() {\n return this.sync().root;\n }\n get [Symbol.toStringTag]() {\n return \"LazyResult\";\n }\n};\nLazyResult$2$1.registerPostcss = (dependant) => {\n postcss$2$1 = dependant;\n};\nvar lazyResult$1 = LazyResult$2$1;\nLazyResult$2$1.default = LazyResult$2$1;\nRoot$3$1.registerLazyResult(LazyResult$2$1);\nDocument$2$1.registerLazyResult(LazyResult$2$1);\nlet MapGenerator2$1 = mapGenerator$1;\nlet stringify$1$1 = stringify_1$1;\nlet warnOnce2$1 = warnOnce$2$1;\nlet parse$1$1 = parse_1$1;\nconst Result$1$1 = result$1;\nlet NoWorkResult$1$1 = class NoWorkResult {\n constructor(processor2, css, opts) {\n css = css.toString();\n this.stringified = false;\n this._processor = processor2;\n this._css = css;\n this._opts = opts;\n this._map = void 0;\n let root2;\n let str = stringify$1$1;\n this.result = new Result$1$1(this._processor, root2, this._opts);\n this.result.css = css;\n let self = this;\n Object.defineProperty(this.result, \"root\", {\n get() {\n return self.root;\n }\n });\n let map = new MapGenerator2$1(str, root2, this._opts, css);\n if (map.isMap()) {\n let [generatedCSS, generatedMap] = map.generate();\n if (generatedCSS) {\n this.result.css = generatedCSS;\n }\n if (generatedMap) {\n this.result.map = generatedMap;\n }\n } else {\n map.clearAnnotation();\n this.result.css = map.css;\n }\n }\n async() {\n if (this.error) return Promise.reject(this.error);\n return Promise.resolve(this.result);\n }\n catch(onRejected) {\n return this.async().catch(onRejected);\n }\n finally(onFinally) {\n return this.async().then(onFinally, onFinally);\n }\n sync() {\n if (this.error) throw this.error;\n return this.result;\n }\n then(onFulfilled, onRejected) {\n if (process.env.NODE_ENV !== \"production\") {\n if (!(\"from\" in this._opts)) {\n warnOnce2$1(\n \"Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.\"\n );\n }\n }\n return this.async().then(onFulfilled, onRejected);\n }\n toString() {\n return this._css;\n }\n warnings() {\n return [];\n }\n get content() {\n return this.result.css;\n }\n get css() {\n return this.result.css;\n }\n get map() {\n return this.result.map;\n }\n get messages() {\n return [];\n }\n get opts() {\n return this.result.opts;\n }\n get processor() {\n return this.result.processor;\n }\n get root() {\n if (this._root) {\n return this._root;\n }\n let root2;\n let parser2 = parse$1$1;\n try {\n root2 = parser2(this._css, this._opts);\n } catch (error) {\n this.error = error;\n }\n if (this.error) {\n throw this.error;\n } else {\n this._root = root2;\n return root2;\n }\n }\n get [Symbol.toStringTag]() {\n return \"NoWorkResult\";\n }\n};\nvar noWorkResult$1 = NoWorkResult$1$1;\nNoWorkResult$1$1.default = NoWorkResult$1$1;\nlet NoWorkResult2$1 = noWorkResult$1;\nlet LazyResult$1$1 = lazyResult$1;\nlet Document$1$1 = document$1$1;\nlet Root$2$1 = root$1;\nlet Processor$1$1 = class Processor {\n constructor(plugins = []) {\n this.version = \"8.4.38\";\n this.plugins = this.normalize(plugins);\n }\n normalize(plugins) {\n let normalized = [];\n for (let i2 of plugins) {\n if (i2.postcss === true) {\n i2 = i2();\n } else if (i2.postcss) {\n i2 = i2.postcss;\n }\n if (typeof i2 === \"object\" && Array.isArray(i2.plugins)) {\n normalized = normalized.concat(i2.plugins);\n } else if (typeof i2 === \"object\" && i2.postcssPlugin) {\n normalized.push(i2);\n } else if (typeof i2 === \"function\") {\n normalized.push(i2);\n } else if (typeof i2 === \"object\" && (i2.parse || i2.stringify)) {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(\n \"PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.\"\n );\n }\n } else {\n throw new Error(i2 + \" is not a PostCSS plugin\");\n }\n }\n return normalized;\n }\n process(css, opts = {}) {\n if (!this.plugins.length && !opts.parser && !opts.stringifier && !opts.syntax) {\n return new NoWorkResult2$1(this, css, opts);\n } else {\n return new LazyResult$1$1(this, css, opts);\n }\n }\n use(plugin22) {\n this.plugins = this.plugins.concat(this.normalize([plugin22]));\n return this;\n }\n};\nvar processor$1 = Processor$1$1;\nProcessor$1$1.default = Processor$1$1;\nRoot$2$1.registerProcessor(Processor$1$1);\nDocument$1$1.registerProcessor(Processor$1$1);\nlet Declaration$1$1 = declaration$1;\nlet PreviousMap2$1 = previousMap$1;\nlet Comment$1$1 = comment$1;\nlet AtRule$1$1 = atRule$1;\nlet Input$1$1 = input$1;\nlet Root$1$1 = root$1;\nlet Rule$1$1 = rule$1;\nfunction fromJSON$1$1(json, inputs) {\n if (Array.isArray(json)) return json.map((n2) => fromJSON$1$1(n2));\n let { inputs: ownInputs, ...defaults } = json;\n if (ownInputs) {\n inputs = [];\n for (let input2 of ownInputs) {\n let inputHydrated = { ...input2, __proto__: Input$1$1.prototype };\n if (inputHydrated.map) {\n inputHydrated.map = {\n ...inputHydrated.map,\n __proto__: PreviousMap2$1.prototype\n };\n }\n inputs.push(inputHydrated);\n }\n }\n if (defaults.nodes) {\n defaults.nodes = json.nodes.map((n2) => fromJSON$1$1(n2, inputs));\n }\n if (defaults.source) {\n let { inputId, ...source } = defaults.source;\n defaults.source = source;\n if (inputId != null) {\n defaults.source.input = inputs[inputId];\n }\n }\n if (defaults.type === \"root\") {\n return new Root$1$1(defaults);\n } else if (defaults.type === \"decl\") {\n return new Declaration$1$1(defaults);\n } else if (defaults.type === \"rule\") {\n return new Rule$1$1(defaults);\n } else if (defaults.type === \"comment\") {\n return new Comment$1$1(defaults);\n } else if (defaults.type === \"atrule\") {\n return new AtRule$1$1(defaults);\n } else {\n throw new Error(\"Unknown node type: \" + json.type);\n }\n}\nvar fromJSON_1$1 = fromJSON$1$1;\nfromJSON$1$1.default = fromJSON$1$1;\nlet CssSyntaxError2$1 = cssSyntaxError$1;\nlet Declaration2$1 = declaration$1;\nlet LazyResult2$1 = lazyResult$1;\nlet Container2$1 = container$1;\nlet Processor2$1 = processor$1;\nlet stringify$5 = stringify_1$1;\nlet fromJSON$2 = fromJSON_1$1;\nlet Document22 = document$1$1;\nlet Warning2$1 = warning$1;\nlet Comment2$1 = comment$1;\nlet AtRule2$1 = atRule$1;\nlet Result2$1 = result$1;\nlet Input2$1 = input$1;\nlet parse$5 = parse_1$1;\nlet list$3 = list_1$1;\nlet Rule2$1 = rule$1;\nlet Root2$1 = root$1;\nlet Node2$1 = node$1;\nfunction postcss$3(...plugins) {\n if (plugins.length === 1 && Array.isArray(plugins[0])) {\n plugins = plugins[0];\n }\n return new Processor2$1(plugins);\n}\npostcss$3.plugin = function plugin(name, initializer) {\n let warningPrinted = false;\n function creator(...args) {\n if (console && console.warn && !warningPrinted) {\n warningPrinted = true;\n console.warn(\n name + \": postcss.plugin was deprecated. Migration guide:\\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration\"\n );\n if (process.env.LANG && process.env.LANG.startsWith(\"cn\")) {\n console.warn(\n name + \": 里面 postcss.plugin 被弃用. 迁移指南:\\nhttps://www.w3ctech.com/topic/2226\"\n );\n }\n }\n let transformer = initializer(...args);\n transformer.postcssPlugin = name;\n transformer.postcssVersion = new Processor2$1().version;\n return transformer;\n }\n let cache;\n Object.defineProperty(creator, \"postcss\", {\n get() {\n if (!cache) cache = creator();\n return cache;\n }\n });\n creator.process = function(css, processOpts, pluginOpts) {\n return postcss$3([creator(pluginOpts)]).process(css, processOpts);\n };\n return creator;\n};\npostcss$3.stringify = stringify$5;\npostcss$3.parse = parse$5;\npostcss$3.fromJSON = fromJSON$2;\npostcss$3.list = list$3;\npostcss$3.comment = (defaults) => new Comment2$1(defaults);\npostcss$3.atRule = (defaults) => new AtRule2$1(defaults);\npostcss$3.decl = (defaults) => new Declaration2$1(defaults);\npostcss$3.rule = (defaults) => new Rule2$1(defaults);\npostcss$3.root = (defaults) => new Root2$1(defaults);\npostcss$3.document = (defaults) => new Document22(defaults);\npostcss$3.CssSyntaxError = CssSyntaxError2$1;\npostcss$3.Declaration = Declaration2$1;\npostcss$3.Container = Container2$1;\npostcss$3.Processor = Processor2$1;\npostcss$3.Document = Document22;\npostcss$3.Comment = Comment2$1;\npostcss$3.Warning = Warning2$1;\npostcss$3.AtRule = AtRule2$1;\npostcss$3.Result = Result2$1;\npostcss$3.Input = Input2$1;\npostcss$3.Rule = Rule2$1;\npostcss$3.Root = Root2$1;\npostcss$3.Node = Node2$1;\nLazyResult2$1.registerPostcss(postcss$3);\nvar postcss_1$1 = postcss$3;\npostcss$3.default = postcss$3;\nconst postcss$1$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(postcss_1$1);\npostcss$1$1.stringify;\npostcss$1$1.fromJSON;\npostcss$1$1.plugin;\npostcss$1$1.parse;\npostcss$1$1.list;\npostcss$1$1.document;\npostcss$1$1.comment;\npostcss$1$1.atRule;\npostcss$1$1.rule;\npostcss$1$1.decl;\npostcss$1$1.root;\npostcss$1$1.CssSyntaxError;\npostcss$1$1.Declaration;\npostcss$1$1.Container;\npostcss$1$1.Processor;\npostcss$1$1.Document;\npostcss$1$1.Comment;\npostcss$1$1.Warning;\npostcss$1$1.AtRule;\npostcss$1$1.Result;\npostcss$1$1.Input;\npostcss$1$1.Rule;\npostcss$1$1.Root;\npostcss$1$1.Node;\nconst tagMap = {\n script: \"noscript\",\n // camel case svg element tag names\n altglyph: \"altGlyph\",\n altglyphdef: \"altGlyphDef\",\n altglyphitem: \"altGlyphItem\",\n animatecolor: \"animateColor\",\n animatemotion: \"animateMotion\",\n animatetransform: \"animateTransform\",\n clippath: \"clipPath\",\n feblend: \"feBlend\",\n fecolormatrix: \"feColorMatrix\",\n fecomponenttransfer: \"feComponentTransfer\",\n fecomposite: \"feComposite\",\n feconvolvematrix: \"feConvolveMatrix\",\n fediffuselighting: \"feDiffuseLighting\",\n fedisplacementmap: \"feDisplacementMap\",\n fedistantlight: \"feDistantLight\",\n fedropshadow: \"feDropShadow\",\n feflood: \"feFlood\",\n fefunca: \"feFuncA\",\n fefuncb: \"feFuncB\",\n fefuncg: \"feFuncG\",\n fefuncr: \"feFuncR\",\n fegaussianblur: \"feGaussianBlur\",\n feimage: \"feImage\",\n femerge: \"feMerge\",\n femergenode: \"feMergeNode\",\n femorphology: \"feMorphology\",\n feoffset: \"feOffset\",\n fepointlight: \"fePointLight\",\n fespecularlighting: \"feSpecularLighting\",\n fespotlight: \"feSpotLight\",\n fetile: \"feTile\",\n feturbulence: \"feTurbulence\",\n foreignobject: \"foreignObject\",\n glyphref: \"glyphRef\",\n lineargradient: \"linearGradient\",\n radialgradient: \"radialGradient\"\n};\nfunction getTagName(n2) {\n let tagName = tagMap[n2.tagName] ? tagMap[n2.tagName] : n2.tagName;\n if (tagName === \"link\" && n2.attributes._cssText) {\n tagName = \"style\";\n }\n return tagName;\n}\nfunction adaptCssForReplay(cssText, cache) {\n const cachedStyle = cache == null ? void 0 : cache.stylesWithHoverClass.get(cssText);\n if (cachedStyle) return cachedStyle;\n const ast = postcss$1$1([\n mediaSelectorPlugin,\n pseudoClassPlugin\n ]).process(cssText);\n const result2 = ast.css;\n cache == null ? void 0 : cache.stylesWithHoverClass.set(cssText, result2);\n return result2;\n}\nfunction createCache() {\n const stylesWithHoverClass = /* @__PURE__ */ new Map();\n return {\n stylesWithHoverClass\n };\n}\nfunction applyCssSplits(n2, cssText, hackCss, cache) {\n const childTextNodes = [];\n for (const scn of n2.childNodes) {\n if (scn.type === NodeType$3.Text) {\n childTextNodes.push(scn);\n }\n }\n const cssTextSplits = cssText.split(\"/* rr_split */\");\n while (cssTextSplits.length > 1 && cssTextSplits.length > childTextNodes.length) {\n cssTextSplits.splice(-2, 2, cssTextSplits.slice(-2).join(\"\"));\n }\n for (let i2 = 0; i2 < childTextNodes.length; i2++) {\n const childTextNode = childTextNodes[i2];\n const cssTextSection = cssTextSplits[i2];\n if (childTextNode && cssTextSection) {\n childTextNode.textContent = hackCss ? adaptCssForReplay(cssTextSection, cache) : cssTextSection;\n }\n }\n}\nfunction buildStyleNode(n2, styleEl, cssText, options) {\n const { doc, hackCss, cache } = options;\n if (n2.childNodes.length) {\n applyCssSplits(n2, cssText, hackCss, cache);\n } else {\n if (hackCss) {\n cssText = adaptCssForReplay(cssText, cache);\n }\n styleEl.appendChild(doc.createTextNode(cssText));\n }\n}\nfunction buildNode(n2, options) {\n var _a2;\n const { doc, hackCss, cache } = options;\n switch (n2.type) {\n case NodeType$3.Document:\n return doc.implementation.createDocument(null, \"\", null);\n case NodeType$3.DocumentType:\n return doc.implementation.createDocumentType(\n n2.name || \"html\",\n n2.publicId,\n n2.systemId\n );\n case NodeType$3.Element: {\n const tagName = getTagName(n2);\n let node2;\n if (n2.isSVG) {\n node2 = doc.createElementNS(\"http://www.w3.org/2000/svg\", tagName);\n } else {\n if (\n // If the tag name is a custom element name\n n2.isCustom && // If the browser supports custom elements\n ((_a2 = doc.defaultView) == null ? void 0 : _a2.customElements) && // If the custom element hasn't been defined yet\n !doc.defaultView.customElements.get(n2.tagName)\n )\n doc.defaultView.customElements.define(\n n2.tagName,\n class extends doc.defaultView.HTMLElement {\n }\n );\n node2 = doc.createElement(tagName);\n }\n const specialAttributes = {};\n for (const name in n2.attributes) {\n if (!Object.prototype.hasOwnProperty.call(n2.attributes, name)) {\n continue;\n }\n let value = n2.attributes[name];\n if (tagName === \"option\" && name === \"selected\" && value === false) {\n continue;\n }\n if (value === null) {\n continue;\n }\n if (value === true) value = \"\";\n if (name.startsWith(\"rr_\")) {\n specialAttributes[name] = value;\n continue;\n }\n if (typeof value !== \"string\") ;\n else if (tagName === \"style\" && name === \"_cssText\") {\n buildStyleNode(n2, node2, value, options);\n continue;\n } else if (tagName === \"textarea\" && name === \"value\") {\n node2.appendChild(doc.createTextNode(value));\n n2.childNodes = [];\n continue;\n }\n try {\n if (n2.isSVG && name === \"xlink:href\") {\n node2.setAttributeNS(\n \"http://www.w3.org/1999/xlink\",\n name,\n value.toString()\n );\n } else if (name === \"onload\" || name === \"onclick\" || name.substring(0, 7) === \"onmouse\") {\n node2.setAttribute(\"_\" + name, value.toString());\n } else if (tagName === \"meta\" && n2.attributes[\"http-equiv\"] === \"Content-Security-Policy\" && name === \"content\") {\n node2.setAttribute(\"csp-content\", value.toString());\n continue;\n } else if (tagName === \"link\" && (n2.attributes.rel === \"preload\" || n2.attributes.rel === \"modulepreload\") && n2.attributes.as === \"script\") {\n } else if (tagName === \"link\" && n2.attributes.rel === \"prefetch\" && typeof n2.attributes.href === \"string\" && n2.attributes.href.endsWith(\".js\")) {\n } else if (tagName === \"img\" && n2.attributes.srcset && n2.attributes.rr_dataURL) {\n node2.setAttribute(\n \"rrweb-original-srcset\",\n n2.attributes.srcset\n );\n } else {\n node2.setAttribute(name, value.toString());\n }\n } catch (error) {\n }\n }\n for (const name in specialAttributes) {\n const value = specialAttributes[name];\n if (tagName === \"canvas\" && name === \"rr_dataURL\") {\n const image = doc.createElement(\"img\");\n image.onload = () => {\n const ctx = node2.getContext(\"2d\");\n if (ctx) {\n ctx.drawImage(image, 0, 0, image.width, image.height);\n }\n };\n image.src = value.toString();\n if (node2.RRNodeType)\n node2.rr_dataURL = value.toString();\n } else if (tagName === \"img\" && name === \"rr_dataURL\") {\n const image = node2;\n if (!image.currentSrc.startsWith(\"data:\")) {\n image.setAttribute(\n \"rrweb-original-src\",\n n2.attributes.src\n );\n image.src = value.toString();\n }\n }\n if (name === \"rr_width\") {\n node2.style.setProperty(\"width\", value.toString());\n } else if (name === \"rr_height\") {\n node2.style.setProperty(\"height\", value.toString());\n } else if (name === \"rr_mediaCurrentTime\" && typeof value === \"number\") {\n node2.currentTime = value;\n } else if (name === \"rr_mediaState\") {\n switch (value) {\n case \"played\":\n node2.play().catch((e2) => console.warn(\"media playback error\", e2));\n break;\n case \"paused\":\n node2.pause();\n break;\n }\n } else if (name === \"rr_mediaPlaybackRate\" && typeof value === \"number\") {\n node2.playbackRate = value;\n } else if (name === \"rr_mediaMuted\" && typeof value === \"boolean\") {\n node2.muted = value;\n } else if (name === \"rr_mediaLoop\" && typeof value === \"boolean\") {\n node2.loop = value;\n } else if (name === \"rr_mediaVolume\" && typeof value === \"number\") {\n node2.volume = value;\n } else if (name === \"rr_open_mode\") {\n node2.setAttribute(\n \"rr_open_mode\",\n value\n );\n }\n }\n if (n2.isShadowHost) {\n if (!node2.shadowRoot) {\n node2.attachShadow({ mode: \"open\" });\n } else {\n while (node2.shadowRoot.firstChild) {\n node2.shadowRoot.removeChild(node2.shadowRoot.firstChild);\n }\n }\n }\n return node2;\n }\n case NodeType$3.Text:\n if (n2.isStyle && hackCss) {\n return doc.createTextNode(adaptCssForReplay(n2.textContent, cache));\n }\n return doc.createTextNode(n2.textContent);\n case NodeType$3.CDATA:\n return doc.createCDATASection(n2.textContent);\n case NodeType$3.Comment:\n return doc.createComment(n2.textContent);\n default:\n return null;\n }\n}\nfunction buildNodeWithSN(n2, options) {\n const {\n doc,\n mirror: mirror2,\n skipChild = false,\n hackCss = true,\n afterAppend,\n cache\n } = options;\n if (mirror2.has(n2.id)) {\n const nodeInMirror = mirror2.getNode(n2.id);\n const meta = mirror2.getMeta(nodeInMirror);\n if (isNodeMetaEqual(meta, n2)) return mirror2.getNode(n2.id);\n }\n let node2 = buildNode(n2, { doc, hackCss, cache });\n if (!node2) {\n return null;\n }\n if (n2.rootId && mirror2.getNode(n2.rootId) !== doc) {\n mirror2.replace(n2.rootId, doc);\n }\n if (n2.type === NodeType$3.Document) {\n doc.close();\n doc.open();\n if (n2.compatMode === \"BackCompat\" && n2.childNodes && n2.childNodes[0].type !== NodeType$3.DocumentType) {\n if (n2.childNodes[0].type === NodeType$3.Element && \"xmlns\" in n2.childNodes[0].attributes && n2.childNodes[0].attributes.xmlns === \"http://www.w3.org/1999/xhtml\") {\n doc.write(\n '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"\">'\n );\n } else {\n doc.write(\n '<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"\">'\n );\n }\n }\n node2 = doc;\n }\n mirror2.add(node2, n2);\n if ((n2.type === NodeType$3.Document || n2.type === NodeType$3.Element) && !skipChild) {\n for (const childN of n2.childNodes) {\n const childNode = buildNodeWithSN(childN, {\n doc,\n mirror: mirror2,\n skipChild: false,\n hackCss,\n afterAppend,\n cache\n });\n if (!childNode) {\n console.warn(\"Failed to rebuild\", childN);\n continue;\n }\n if (childN.isShadow && isElement(node2) && node2.shadowRoot) {\n node2.shadowRoot.appendChild(childNode);\n } else if (n2.type === NodeType$3.Document && childN.type == NodeType$3.Element) {\n const htmlElement = childNode;\n let body = null;\n htmlElement.childNodes.forEach((child) => {\n if (child.nodeName === \"BODY\") body = child;\n });\n if (body) {\n htmlElement.removeChild(body);\n node2.appendChild(childNode);\n htmlElement.appendChild(body);\n } else {\n node2.appendChild(childNode);\n }\n } else {\n node2.appendChild(childNode);\n }\n if (afterAppend) {\n afterAppend(childNode, childN.id);\n }\n }\n }\n return node2;\n}\nfunction visit(mirror2, onVisit) {\n function walk(node2) {\n onVisit(node2);\n }\n for (const id of mirror2.getIds()) {\n if (mirror2.has(id)) {\n walk(mirror2.getNode(id));\n }\n }\n}\nfunction handleScroll(node2, mirror2) {\n const n2 = mirror2.getMeta(node2);\n if ((n2 == null ? void 0 : n2.type) !== NodeType$3.Element) {\n return;\n }\n const el = node2;\n for (const name in n2.attributes) {\n if (!(Object.prototype.hasOwnProperty.call(n2.attributes, name) && name.startsWith(\"rr_\"))) {\n continue;\n }\n const value = n2.attributes[name];\n if (name === \"rr_scrollLeft\") {\n el.scrollLeft = value;\n }\n if (name === \"rr_scrollTop\") {\n el.scrollTop = value;\n }\n }\n}\nfunction rebuild(n2, options) {\n const {\n doc,\n onVisit,\n hackCss = true,\n afterAppend,\n cache,\n mirror: mirror2 = new Mirror()\n } = options;\n const node2 = buildNodeWithSN(n2, {\n doc,\n mirror: mirror2,\n skipChild: false,\n hackCss,\n afterAppend,\n cache\n });\n visit(mirror2, (visitedNode) => {\n if (onVisit) {\n onVisit(visitedNode);\n }\n handleScroll(visitedNode, mirror2);\n });\n return node2;\n}\nvar __defProp2 = Object.defineProperty;\nvar __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField2 = (obj, key, value) => __defNormalProp2(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\nvar __defProp22 = Object.defineProperty;\nvar __defNormalProp22 = (obj, key, value) => key in obj ? __defProp22(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField22 = (obj, key, value) => __defNormalProp22(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\nlet Mirror$1 = class Mirror2 {\n constructor() {\n __publicField22(this, \"idNodeMap\", /* @__PURE__ */ new Map());\n __publicField22(this, \"nodeMetaMap\", /* @__PURE__ */ new WeakMap());\n }\n getId(n2) {\n var _a2;\n if (!n2) return -1;\n const id = (_a2 = this.getMeta(n2)) == 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(n2) {\n return this.nodeMetaMap.get(n2) || null;\n }\n // removes the node from idNodeMap\n // doesn't remove the node from nodeMetaMap\n removeNodeFromMap(n2) {\n const id = this.getId(n2);\n this.idNodeMap.delete(id);\n if (n2.childNodes) {\n n2.childNodes.forEach(\n (childNode) => this.removeNodeFromMap(childNode)\n );\n }\n }\n has(id) {\n return this.idNodeMap.has(id);\n }\n hasNode(node2) {\n return this.nodeMetaMap.has(node2);\n }\n add(n2, meta) {\n const id = meta.id;\n this.idNodeMap.set(id, n2);\n this.nodeMetaMap.set(n2, meta);\n }\n replace(id, n2) {\n const oldNode = this.getNode(id);\n if (oldNode) {\n const meta = this.nodeMetaMap.get(oldNode);\n if (meta) this.nodeMetaMap.set(n2, meta);\n }\n this.idNodeMap.set(id, n2);\n }\n reset() {\n this.idNodeMap = /* @__PURE__ */ new Map();\n this.nodeMetaMap = /* @__PURE__ */ new WeakMap();\n }\n};\nfunction createMirror$1() {\n return new Mirror$1();\n}\nfunction getDefaultExportFromCjs(x2) {\n return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, \"default\") ? x2[\"default\"] : x2;\n}\nfunction getAugmentedNamespace(n2) {\n if (n2.__esModule) return n2;\n var f2 = n2.default;\n if (typeof f2 == \"function\") {\n var a2 = function a22() {\n if (this instanceof a22) {\n return Reflect.construct(f2, arguments, this.constructor);\n }\n return f2.apply(this, arguments);\n };\n a2.prototype = f2.prototype;\n } else a2 = {};\n Object.defineProperty(a2, \"__esModule\", { value: true });\n Object.keys(n2).forEach(function(k) {\n var d = Object.getOwnPropertyDescriptor(n2, k);\n Object.defineProperty(a2, k, d.get ? d : {\n enumerable: true,\n get: function() {\n return n2[k];\n }\n });\n });\n return a2;\n}\nvar picocolors_browser = { exports: {} };\nvar x = String;\nvar create = function() {\n return { isColorSupported: false, reset: x, bold: x, dim: x, italic: x, underline: x, inverse: x, hidden: x, strikethrough: x, black: x, red: x, green: x, yellow: x, blue: x, magenta: x, cyan: x, white: x, gray: x, bgBlack: x, bgRed: x, bgGreen: x, bgYellow: x, bgBlue: x, bgMagenta: x, bgCyan: x, bgWhite: x };\n};\npicocolors_browser.exports = create();\npicocolors_browser.exports.createColors = create;\nvar picocolors_browserExports = picocolors_browser.exports;\nconst __viteBrowserExternal = {};\nconst __viteBrowserExternal$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n default: __viteBrowserExternal\n}, Symbol.toStringTag, { value: \"Module\" }));\nconst require$$2 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1);\nlet pico = picocolors_browserExports;\nlet terminalHighlight$1 = require$$2;\nlet CssSyntaxError$3 = class CssSyntaxError2 extends Error {\n constructor(message, line, column, source, file, plugin22) {\n super(message);\n this.name = \"CssSyntaxError\";\n this.reason = message;\n if (file) {\n this.file = file;\n }\n if (source) {\n this.source = source;\n }\n if (plugin22) {\n this.plugin = plugin22;\n }\n if (typeof line !== \"undefined\" && typeof column !== \"undefined\") {\n if (typeof line === \"number\") {\n this.line = line;\n this.column = column;\n } else {\n this.line = line.line;\n this.column = line.column;\n this.endLine = column.line;\n this.endColumn = column.column;\n }\n }\n this.setMessage();\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, CssSyntaxError2);\n }\n }\n setMessage() {\n this.message = this.plugin ? this.plugin + \": \" : \"\";\n this.message += this.file ? this.file : \"<css input>\";\n if (typeof this.line !== \"undefined\") {\n this.message += \":\" + this.line + \":\" + this.column;\n }\n this.message += \": \" + this.reason;\n }\n showSourceCode(color) {\n if (!this.source) return \"\";\n let css = this.source;\n if (color == null) color = pico.isColorSupported;\n if (terminalHighlight$1) {\n if (color) css = terminalHighlight$1(css);\n }\n let lines = css.split(/\\r?\\n/);\n let start = Math.max(this.line - 3, 0);\n let end = Math.min(this.line + 2, lines.length);\n let maxWidth = String(end).length;\n let mark, aside;\n if (color) {\n let { bold, gray, red } = pico.createColors(true);\n mark = (text) => bold(red(text));\n aside = (text) => gray(text);\n } else {\n mark = aside = (str) => str;\n }\n return lines.slice(start, end).map((line, index2) => {\n let number = start + 1 + index2;\n let gutter = \" \" + (\" \" + number).slice(-maxWidth) + \" | \";\n if (number === this.line) {\n let spacing = aside(gutter.replace(/\\d/g, \" \")) + line.slice(0, this.column - 1).replace(/[^\\t]/g, \" \");\n return mark(\">\") + aside(gutter) + line + \"\\n \" + spacing + mark(\"^\");\n }\n return \" \" + aside(gutter) + line;\n }).join(\"\\n\");\n }\n toString() {\n let code = this.showSourceCode();\n if (code) {\n code = \"\\n\\n\" + code + \"\\n\";\n }\n return this.name + \": \" + this.message + code;\n }\n};\nvar cssSyntaxError = CssSyntaxError$3;\nCssSyntaxError$3.default = CssSyntaxError$3;\nvar symbols = {};\nsymbols.isClean = Symbol(\"isClean\");\nsymbols.my = Symbol(\"my\");\nconst DEFAULT_RAW = {\n after: \"\\n\",\n beforeClose: \"\\n\",\n beforeComment: \"\\n\",\n beforeDecl: \"\\n\",\n beforeOpen: \" \",\n beforeRule: \"\\n\",\n colon: \": \",\n commentLeft: \" \",\n commentRight: \" \",\n emptyBody: \"\",\n indent: \" \",\n semicolon: false\n};\nfunction capitalize(str) {\n return str[0].toUpperCase() + str.slice(1);\n}\nlet Stringifier$2 = class Stringifier2 {\n constructor(builder) {\n this.builder = builder;\n }\n atrule(node2, semicolon) {\n let name = \"@\" + node2.name;\n let params = node2.params ? this.rawValue(node2, \"params\") : \"\";\n if (typeof node2.raws.afterName !== \"undefined\") {\n name += node2.raws.afterName;\n } else if (params) {\n name += \" \";\n }\n if (node2.nodes) {\n this.block(node2, name + params);\n } else {\n let end = (node2.raws.between || \"\") + (semicolon ? \";\" : \"\");\n this.builder(name + params + end, node2);\n }\n }\n beforeAfter(node2, detect) {\n let value;\n if (node2.type === \"decl\") {\n value = this.raw(node2, null, \"beforeDecl\");\n } else if (node2.type === \"comment\") {\n value = this.raw(node2, null, \"beforeComment\");\n } else if (detect === \"before\") {\n value = this.raw(node2, null, \"beforeRule\");\n } else {\n value = this.raw(node2, null, \"beforeClose\");\n }\n let buf = node2.parent;\n let depth = 0;\n while (buf && buf.type !== \"root\") {\n depth += 1;\n buf = buf.parent;\n }\n if (value.includes(\"\\n\")) {\n let indent = this.raw(node2, null, \"indent\");\n if (indent.length) {\n for (let step = 0; step < depth; step++) value += indent;\n }\n }\n return value;\n }\n block(node2, start) {\n let between = this.raw(node2, \"between\", \"beforeOpen\");\n this.builder(start + between + \"{\", node2, \"start\");\n let after;\n if (node2.nodes && node2.nodes.length) {\n this.body(node2);\n after = this.raw(node2, \"after\");\n } else {\n after = this.raw(node2, \"after\", \"emptyBody\");\n }\n if (after) this.builder(after);\n this.builder(\"}\", node2, \"end\");\n }\n body(node2) {\n let last = node2.nodes.length - 1;\n while (last > 0) {\n if (node2.nodes[last].type !== \"comment\") break;\n last -= 1;\n }\n let semicolon = this.raw(node2, \"semicolon\");\n for (let i2 = 0; i2 < node2.nodes.length; i2++) {\n let child = node2.nodes[i2];\n let before = this.raw(child, \"before\");\n if (before) this.builder(before);\n this.stringify(child, last !== i2 || semicolon);\n }\n }\n comment(node2) {\n let left = this.raw(node2, \"left\", \"commentLeft\");\n let right = this.raw(node2, \"right\", \"commentRight\");\n this.builder(\"/*\" + left + node2.text + right + \"*/\", node2);\n }\n decl(node2, semicolon) {\n let between = this.raw(node2, \"between\", \"colon\");\n let string = node2.prop + between + this.rawValue(node2, \"value\");\n if (node2.important) {\n string += node2.raws.important || \" !important\";\n }\n if (semicolon) string += \";\";\n this.builder(string, node2);\n }\n document(node2) {\n this.body(node2);\n }\n raw(node2, own, detect) {\n let value;\n if (!detect) detect = own;\n if (own) {\n value = node2.raws[own];\n if (typeof value !== \"undefined\") return value;\n }\n let parent = node2.parent;\n if (detect === \"before\") {\n if (!parent || parent.type === \"root\" && parent.first === node2) {\n return \"\";\n }\n if (parent && parent.type === \"document\") {\n return \"\";\n }\n }\n if (!parent) return DEFAULT_RAW[detect];\n let root2 = node2.root();\n if (!root2.rawCache) root2.rawCache = {};\n if (typeof root2.rawCache[detect] !== \"undefined\") {\n return root2.rawCache[detect];\n }\n if (detect === \"before\" || detect === \"after\") {\n return this.beforeAfter(node2, detect);\n } else {\n let method = \"raw\" + capitalize(detect);\n if (this[method]) {\n value = this[method](root2, node2);\n } else {\n root2.walk((i2) => {\n value = i2.raws[own];\n if (typeof value !== \"undefined\") return false;\n });\n }\n }\n if (typeof value === \"undefined\") value = DEFAULT_RAW[detect];\n root2.rawCache[detect] = value;\n return value;\n }\n rawBeforeClose(root2) {\n let value;\n root2.walk((i2) => {\n if (i2.nodes && i2.nodes.length > 0) {\n if (typeof i2.raws.after !== \"undefined\") {\n value = i2.raws.after;\n if (value.includes(\"\\n\")) {\n value = value.replace(/[^\\n]+$/, \"\");\n }\n return false;\n }\n }\n });\n if (value) value = value.replace(/\\S/g, \"\");\n return value;\n }\n rawBeforeComment(root2, node2) {\n let value;\n root2.walkComments((i2) => {\n if (typeof i2.raws.before !== \"undefined\") {\n value = i2.raws.before;\n if (value.includes(\"\\n\")) {\n value = value.replace(/[^\\n]+$/, \"\");\n }\n return false;\n }\n });\n if (typeof value === \"undefined\") {\n value = this.raw(node2, null, \"beforeDecl\");\n } else if (value) {\n value = value.replace(/\\S/g, \"\");\n }\n return value;\n }\n rawBeforeDecl(root2, node2) {\n let value;\n root2.walkDecls((i2) => {\n if (typeof i2.raws.before !== \"undefined\") {\n value = i2.raws.before;\n if (value.includes(\"\\n\")) {\n value = value.replace(/[^\\n]+$/, \"\");\n }\n return false;\n }\n });\n if (typeof value === \"undefined\") {\n value = this.raw(node2, null, \"beforeRule\");\n } else if (value) {\n value = value.replace(/\\S/g, \"\");\n }\n return value;\n }\n rawBeforeOpen(root2) {\n let value;\n root2.walk((i2) => {\n if (i2.type !== \"decl\") {\n value = i2.raws.between;\n if (typeof value !== \"undefined\") return false;\n }\n });\n return value;\n }\n rawBeforeRule(root2) {\n let value;\n root2.walk((i2) => {\n if (i2.nodes && (i2.parent !== root2 || root2.first !== i2)) {\n if (typeof i2.raws.before !== \"undefined\") {\n value = i2.raws.before;\n if (value.includes(\"\\n\")) {\n value = value.replace(/[^\\n]+$/, \"\");\n }\n return false;\n }\n }\n });\n if (value) value = value.replace(/\\S/g, \"\");\n return value;\n }\n rawColon(root2) {\n let value;\n root2.walkDecls((i2) => {\n if (typeof i2.raws.between !== \"undefined\") {\n value = i2.raws.between.replace(/[^\\s:]/g, \"\");\n return false;\n }\n });\n return value;\n }\n rawEmptyBody(root2) {\n let value;\n root2.walk((i2) => {\n if (i2.nodes && i2.nodes.length === 0) {\n value = i2.raws.after;\n if (typeof value !== \"undefined\") return false;\n }\n });\n return value;\n }\n rawIndent(root2) {\n if (root2.raws.indent) return root2.raws.indent;\n let value;\n root2.walk((i2) => {\n let p = i2.parent;\n if (p && p !== root2 && p.parent && p.parent === root2) {\n if (typeof i2.raws.before !== \"undefined\") {\n let parts = i2.raws.before.split(\"\\n\");\n value = parts[parts.length - 1];\n value = value.replace(/\\S/g, \"\");\n return false;\n }\n }\n });\n return value;\n }\n rawSemicolon(root2) {\n let value;\n root2.walk((i2) => {\n if (i2.nodes && i2.nodes.length && i2.last.type === \"decl\") {\n value = i2.raws.semicolon;\n if (typeof value !== \"undefined\") return false;\n }\n });\n return value;\n }\n rawValue(node2, prop) {\n let value = node2[prop];\n let raw = node2.raws[prop];\n if (raw && raw.value === value) {\n return raw.raw;\n }\n return value;\n }\n root(node2) {\n this.body(node2);\n if (node2.raws.after) this.builder(node2.raws.after);\n }\n rule(node2) {\n this.block(node2, this.rawValue(node2, \"selector\"));\n if (node2.raws.ownSemicolon) {\n this.builder(node2.raws.ownSemicolon, node2, \"end\");\n }\n }\n stringify(node2, semicolon) {\n if (!this[node2.type]) {\n throw new Error(\n \"Unknown AST node type \" + node2.type + \". Maybe you need to change PostCSS stringifier.\"\n );\n }\n this[node2.type](node2, semicolon);\n }\n};\nvar stringifier = Stringifier$2;\nStringifier$2.default = Stringifier$2;\nlet Stringifier$1 = stringifier;\nfunction stringify$4(node2, builder) {\n let str = new Stringifier$1(builder);\n str.stringify(node2);\n}\nvar stringify_1 = stringify$4;\nstringify$4.default = stringify$4;\nlet { isClean: isClean$2, my: my$2 } = symbols;\nlet CssSyntaxError$2 = cssSyntaxError;\nlet Stringifier22 = stringifier;\nlet stringify$3 = stringify_1;\nfunction cloneNode(obj, parent) {\n let cloned = new obj.constructor();\n for (let i2 in obj) {\n if (!Object.prototype.hasOwnProperty.call(obj, i2)) {\n continue;\n }\n if (i2 === \"proxyCache\") continue;\n let value = obj[i2];\n let type = typeof value;\n if (i2 === \"parent\" && type === \"object\") {\n if (parent) cloned[i2] = parent;\n } else if (i2 === \"source\") {\n cloned[i2] = value;\n } else if (Array.isArray(value)) {\n cloned[i2] = value.map((j) => cloneNode(j, cloned));\n } else {\n if (type === \"object\" && value !== null) value = cloneNode(value);\n cloned[i2] = value;\n }\n }\n return cloned;\n}\nlet Node$4 = class Node3 {\n constructor(defaults = {}) {\n this.raws = {};\n this[isClean$2] = false;\n this[my$2] = true;\n for (let name in defaults) {\n if (name === \"nodes\") {\n this.nodes = [];\n for (let node2 of defaults[name]) {\n if (typeof node2.clone === \"function\") {\n this.append(node2.clone());\n } else {\n this.append(node2);\n }\n }\n } else {\n this[name] = defaults[name];\n }\n }\n }\n addToError(error) {\n error.postcssNode = this;\n if (error.stack && this.source && /\\n\\s{4}at /.test(error.stack)) {\n let s2 = this.source;\n error.stack = error.stack.replace(\n /\\n\\s{4}at /,\n `$&${s2.input.from}:${s2.start.line}:${s2.start.column}$&`\n );\n }\n return error;\n }\n after(add) {\n this.parent.insertAfter(this, add);\n return this;\n }\n assign(overrides = {}) {\n for (let name in overrides) {\n this[name] = overrides[name];\n }\n return this;\n }\n before(add) {\n this.parent.insertBefore(this, add);\n return this;\n }\n cleanRaws(keepBetween) {\n delete this.raws.before;\n delete this.raws.after;\n if (!keepBetween) delete this.raws.between;\n }\n clone(overrides = {}) {\n let cloned = cloneNode(this);\n for (let name in overrides) {\n cloned[name] = overrides[name];\n }\n return cloned;\n }\n cloneAfter(overrides = {}) {\n let cloned = this.clone(overrides);\n this.parent.insertAfter(this, cloned);\n return cloned;\n }\n cloneBefore(overrides = {}) {\n let cloned = this.clone(overrides);\n this.parent.insertBefore(this, cloned);\n return cloned;\n }\n error(message, opts = {}) {\n if (this.source) {\n let { end, start } = this.rangeBy(opts);\n return this.source.input.error(\n message,\n { column: start.column, line: start.line },\n { column: end.column, line: end.line },\n opts\n );\n }\n return new CssSyntaxError$2(message);\n }\n getProxyProcessor() {\n return {\n get(node2, prop) {\n if (prop === \"proxyOf\") {\n return node2;\n } else if (prop === \"root\") {\n return () => node2.root().toProxy();\n } else {\n return node2[prop];\n }\n },\n set(node2, prop, value) {\n if (node2[prop] === value) return true;\n node2[prop] = value;\n if (prop === \"prop\" || prop === \"value\" || prop === \"name\" || prop === \"params\" || prop === \"important\" || /* c8 ignore next */\n prop === \"text\") {\n node2.markDirty();\n }\n return true;\n }\n };\n }\n markDirty() {\n if (this[isClean$2]) {\n this[isClean$2] = false;\n let next = this;\n while (next = next.parent) {\n next[isClean$2] = false;\n }\n }\n }\n next() {\n if (!this.parent) return void 0;\n let index2 = this.parent.index(this);\n return this.parent.nodes[index2 + 1];\n }\n positionBy(opts, stringRepresentation) {\n let pos = this.source.start;\n if (opts.index) {\n pos = this.positionInside(opts.index, stringRepresentation);\n } else if (opts.word) {\n stringRepresentation = this.toString();\n let index2 = stringRepresentation.indexOf(opts.word);\n if (index2 !== -1) pos = this.positionInside(index2, stringRepresentation);\n }\n return pos;\n }\n positionInside(index2, stringRepresentation) {\n let string = stringRepresentation || this.toString();\n let column = this.source.start.column;\n let line = this.source.start.line;\n for (let i2 = 0; i2 < index2; i2++) {\n if (string[i2] === \"\\n\") {\n column = 1;\n line += 1;\n } else {\n column += 1;\n }\n }\n return { column, line };\n }\n prev() {\n if (!this.parent) return void 0;\n let index2 = this.parent.index(this);\n return this.parent.nodes[index2 - 1];\n }\n rangeBy(opts) {\n let start = {\n column: this.source.start.column,\n line: this.source.start.line\n };\n let end = this.source.end ? {\n column: this.source.end.column + 1,\n line: this.source.end.line\n } : {\n column: start.column + 1,\n line: start.line\n };\n if (opts.word) {\n let stringRepresentation = this.toString();\n let index2 = stringRepresentation.indexOf(opts.word);\n if (index2 !== -1) {\n start = this.positionInside(index2, stringRepresentation);\n end = this.positionInside(index2 + opts.word.length, stringRepresentation);\n }\n } else {\n if (opts.start) {\n start = {\n column: opts.start.column,\n line: opts.start.line\n };\n } else if (opts.index) {\n start = this.positionInside(opts.index);\n }\n if (opts.end) {\n end = {\n column: opts.end.column,\n line: opts.end.line\n };\n } else if (typeof opts.endIndex === \"number\") {\n end = this.positionInside(opts.endIndex);\n } else if (opts.index) {\n end = this.positionInside(opts.index + 1);\n }\n }\n if (end.line < start.line || end.line === start.line && end.column <= start.column) {\n end = { column: start.column + 1, line: start.line };\n }\n return { end, start };\n }\n raw(prop, defaultType) {\n let str = new Stringifier22();\n return str.raw(this, prop, defaultType);\n }\n remove() {\n if (this.parent) {\n this.parent.removeChild(this);\n }\n this.parent = void 0;\n return this;\n }\n replaceWith(...nodes) {\n if (this.parent) {\n let bookmark = this;\n let foundSelf = false;\n for (let node2 of nodes) {\n if (node2 === this) {\n foundSelf = true;\n } else if (foundSelf) {\n this.parent.insertAfter(bookmark, node2);\n bookmark = node2;\n } else {\n this.parent.insertBefore(bookmark, node2);\n }\n }\n if (!foundSelf) {\n this.remove();\n }\n }\n return this;\n }\n root() {\n let result2 = this;\n while (result2.parent && result2.parent.type !== \"document\") {\n result2 = result2.parent;\n }\n return result2;\n }\n toJSON(_, inputs) {\n let fixed = {};\n let emitInputs = inputs == null;\n inputs = inputs || /* @__PURE__ */ new Map();\n let inputsNextIndex = 0;\n for (let name in this) {\n if (!Object.prototype.hasOwnProperty.call(this, name)) {\n continue;\n }\n if (name === \"parent\" || name === \"proxyCache\") continue;\n let value = this[name];\n if (Array.isArray(value)) {\n fixed[name] = value.map((i2) => {\n if (typeof i2 === \"object\" && i2.toJSON) {\n return i2.toJSON(null, inputs);\n } else {\n return i2;\n }\n });\n } else if (typeof value === \"object\" && value.toJSON) {\n fixed[name] = value.toJSON(null, inputs);\n } else if (name === \"source\") {\n let inputId = inputs.get(value.input);\n if (inputId == null) {\n inputId = inputsNextIndex;\n inputs.set(value.input, inputsNextIndex);\n inputsNextIndex++;\n }\n fixed[name] = {\n end: value.end,\n inputId,\n start: value.start\n };\n } else {\n fixed[name] = value;\n }\n }\n if (emitInputs) {\n fixed.inputs = [...inputs.keys()].map((input2) => input2.toJSON());\n }\n return fixed;\n }\n toProxy() {\n if (!this.proxyCache) {\n this.proxyCache = new Proxy(this, this.getProxyProcessor());\n }\n return this.proxyCache;\n }\n toString(stringifier2 = stringify$3) {\n if (stringifier2.stringify) stringifier2 = stringifier2.stringify;\n let result2 = \"\";\n stringifier2(this, (i2) => {\n result2 += i2;\n });\n return result2;\n }\n warn(result2, text, opts) {\n let data = { node: this };\n for (let i2 in opts) data[i2] = opts[i2];\n return result2.warn(text, data);\n }\n get proxyOf() {\n return this;\n }\n};\nvar node = Node$4;\nNode$4.default = Node$4;\nlet Node$3 = node;\nlet Declaration$4 = class Declaration2 extends Node$3 {\n constructor(defaults) {\n if (defaults && typeof defaults.value !== \"undefined\" && typeof defaults.value !== \"string\") {\n defaults = { ...defaults, value: String(defaults.value) };\n }\n super(defaults);\n this.type = \"decl\";\n }\n get variable() {\n return this.prop.startsWith(\"--\") || this.prop[0] === \"$\";\n }\n};\nvar declaration = Declaration$4;\nDeclaration$4.default = Declaration$4;\nlet urlAlphabet = \"useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict\";\nlet customAlphabet = (alphabet, defaultSize = 21) => {\n return (size = defaultSize) => {\n let id = \"\";\n let i2 = size;\n while (i2--) {\n id += alphabet[Math.random() * alphabet.length | 0];\n }\n return id;\n };\n};\nlet nanoid$1 = (size = 21) => {\n let id = \"\";\n let i2 = size;\n while (i2--) {\n id += urlAlphabet[Math.random() * 64 | 0];\n }\n return id;\n};\nvar nonSecure = { nanoid: nanoid$1, customAlphabet };\nlet { SourceMapConsumer: SourceMapConsumer$2, SourceMapGenerator: SourceMapGenerator$2 } = require$$2;\nlet { existsSync, readFileSync } = require$$2;\nlet { dirname: dirname$1, join } = require$$2;\nfunction fromBase64(str) {\n if (Buffer) {\n return Buffer.from(str, \"base64\").toString();\n } else {\n return window.atob(str);\n }\n}\nlet PreviousMap$2 = class PreviousMap2 {\n constructor(css, opts) {\n if (opts.map === false) return;\n this.loadAnnotation(css);\n this.inline = this.startWith(this.annotation, \"data:\");\n let prev = opts.map ? opts.map.prev : void 0;\n let text = this.loadMap(opts.from, prev);\n if (!this.mapFile && opts.from) {\n this.mapFile = opts.from;\n }\n if (this.mapFile) this.root = dirname$1(this.mapFile);\n if (text) this.text = text;\n }\n consumer() {\n if (!this.consumerCache) {\n this.consumerCache = new SourceMapConsumer$2(this.text);\n }\n return this.consumerCache;\n }\n decodeInline(text) {\n let baseCharsetUri = /^data:application\\/json;charset=utf-?8;base64,/;\n let baseUri = /^data:application\\/json;base64,/;\n let charsetUri = /^data:application\\/json;charset=utf-?8,/;\n let uri = /^data:application\\/json,/;\n if (charsetUri.test(text) || uri.test(text)) {\n return decodeURIComponent(text.substr(RegExp.lastMatch.length));\n }\n if (baseCharsetUri.test(text) || baseUri.test(text)) {\n return fromBase64(text.substr(RegExp.lastMatch.length));\n }\n let encoding = text.match(/data:application\\/json;([^,]+),/)[1];\n throw new Error(\"Unsupported source map encoding \" + encoding);\n }\n getAnnotationURL(sourceMapString) {\n return sourceMapString.replace(/^\\/\\*\\s*# sourceMappingURL=/, \"\").trim();\n }\n isMap(map) {\n if (typeof map !== \"object\") return false;\n return typeof map.mappings === \"string\" || typeof map._mappings === \"string\" || Array.isArray(map.sections);\n }\n loadAnnotation(css) {\n let comments = css.match(/\\/\\*\\s*# sourceMappingURL=/gm);\n if (!comments) return;\n let start = css.lastIndexOf(comments.pop());\n let end = css.indexOf(\"*/\", start);\n if (start > -1 && end > -1) {\n this.annotation = this.getAnnotationURL(css.substring(start, end));\n }\n }\n loadFile(path) {\n this.root = dirname$1(path);\n if (existsSync(path)) {\n this.mapFile = path;\n return readFileSync(path, \"utf-8\").toString().trim();\n }\n }\n loadMap(file, prev) {\n if (prev === false) return false;\n if (prev) {\n if (typeof prev === \"string\") {\n return prev;\n } else if (typeof prev === \"function\") {\n let prevPath = prev(file);\n if (prevPath) {\n let map = this.loadFile(prevPath);\n if (!map) {\n throw new Error(\n \"Unable to load previous source map: \" + prevPath.toString()\n );\n }\n return map;\n }\n } else if (prev instanceof SourceMapConsumer$2) {\n return SourceMapGenerator$2.fromSourceMap(prev).toString();\n } else if (prev instanceof SourceMapGenerator$2) {\n return prev.toString();\n } else if (this.isMap(prev)) {\n return JSON.stringify(prev);\n } else {\n throw new Error(\n \"Unsupported previous source map format: \" + prev.toString()\n );\n }\n } else if (this.inline) {\n return this.decodeInline(this.annotation);\n } else if (this.annotation) {\n let map = this.annotation;\n if (file) map = join(dirname$1(file), map);\n return this.loadFile(map);\n }\n }\n startWith(string, start) {\n if (!string) return false;\n return string.substr(0, start.length) === start;\n }\n withContent() {\n return !!(this.consumer().sourcesContent && this.consumer().sourcesContent.length > 0);\n }\n};\nvar previousMap = PreviousMap$2;\nPreviousMap$2.default = PreviousMap$2;\nlet { SourceMapConsumer: SourceMapConsumer$1, SourceMapGenerator: SourceMapGenerator$1 } = require$$2;\nlet { fileURLToPath, pathToFileURL: pathToFileURL$1 } = require$$2;\nlet { isAbsolute, resolve: resolve$1 } = require$$2;\nlet { nanoid } = nonSecure;\nlet terminalHighlight = require$$2;\nlet CssSyntaxError$1 = cssSyntaxError;\nlet PreviousMap$1 = previousMap;\nlet fromOffsetCache = Symbol(\"fromOffsetCache\");\nlet sourceMapAvailable$1 = Boolean(SourceMapConsumer$1 && SourceMapGenerator$1);\nlet pathAvailable$1 = Boolean(resolve$1 && isAbsolute);\nlet Input$4 = class Input2 {\n constructor(css, opts = {}) {\n if (css === null || typeof css === \"undefined\" || typeof css === \"object\" && !css.toString) {\n throw new Error(`PostCSS received ${css} instead of CSS string`);\n }\n this.css = css.toString();\n if (this.css[0] === \"\\uFEFF\" || this.css[0] === \"￾\") {\n this.hasBOM = true;\n this.css = this.css.slice(1);\n } else {\n this.hasBOM = false;\n }\n if (opts.from) {\n if (!pathAvailable$1 || /^\\w+:\\/\\//.test(opts.from) || isAbsolute(opts.from)) {\n this.file = opts.from;\n } else {\n this.file = resolve$1(opts.from);\n }\n }\n if (pathAvailable$1 && sourceMapAvailable$1) {\n let map = new PreviousMap$1(this.css, opts);\n if (map.text) {\n this.map = map;\n let file = map.consumer().file;\n if (!this.file && file) this.file = this.mapResolve(file);\n }\n }\n if (!this.file) {\n this.id = \"<input css \" + nanoid(6) + \">\";\n }\n if (this.map) this.map.file = this.from;\n }\n error(message, line, column, opts = {}) {\n let result2, endLine, endColumn;\n if (line && typeof line === \"object\") {\n let start = line;\n let end = column;\n if (typeof start.offset === \"number\") {\n let pos = this.fromOffset(start.offset);\n line = pos.line;\n column = pos.col;\n } else {\n line = start.line;\n column = start.column;\n }\n if (typeof end.offset === \"number\") {\n let pos = this.fromOffset(end.offset);\n endLine = pos.line;\n endColumn = pos.col;\n } else {\n endLine = end.line;\n endColumn = end.column;\n }\n } else if (!column) {\n let pos = this.fromOffset(line);\n line = pos.line;\n column = pos.col;\n }\n let origin = this.origin(line, column, endLine, endColumn);\n if (origin) {\n result2 = new CssSyntaxError$1(\n message,\n origin.endLine === void 0 ? origin.line : { column: origin.column, line: origin.line },\n origin.endLine === void 0 ? origin.column : { column: origin.endColumn, line: origin.endLine },\n origin.source,\n origin.file,\n opts.plugin\n );\n } else {\n result2 = new CssSyntaxError$1(\n message,\n endLine === void 0 ? line : { column, line },\n endLine === void 0 ? column : { column: endColumn, line: endLine },\n this.css,\n this.file,\n opts.plugin\n );\n }\n result2.input = { column, endColumn, endLine, line, source: this.css };\n if (this.file) {\n if (pathToFileURL$1) {\n result2.input.url = pathToFileURL$1(this.file).toString();\n }\n result2.input.file = this.file;\n }\n return result2;\n }\n fromOffset(offset) {\n let lastLine, lineToIndex;\n if (!this[fromOffsetCache]) {\n let lines = this.css.split(\"\\n\");\n lineToIndex = new Array(lines.length);\n let prevIndex = 0;\n for (let i2 = 0, l2 = lines.length; i2 < l2; i2++) {\n lineToIndex[i2] = prevIndex;\n prevIndex += lines[i2].length + 1;\n }\n this[fromOffsetCache] = lineToIndex;\n } else {\n lineToIndex = this[fromOffsetCache];\n }\n lastLine = lineToIndex[lineToIndex.length - 1];\n let min = 0;\n if (offset >= lastLine) {\n min = lineToIndex.length - 1;\n } else {\n let max = lineToIndex.length - 2;\n let mid;\n while (min < max) {\n mid = min + (max - min >> 1);\n if (offset < lineToIndex[mid]) {\n max = mid - 1;\n } else if (offset >= lineToIndex[mid + 1]) {\n min = mid + 1;\n } else {\n min = mid;\n break;\n }\n }\n }\n return {\n col: offset - lineToIndex[min] + 1,\n line: min + 1\n };\n }\n mapResolve(file) {\n if (/^\\w+:\\/\\//.test(file)) {\n return file;\n }\n return resolve$1(this.map.consumer().sourceRoot || this.map.root || \".\", file);\n }\n origin(line, column, endLine, endColumn) {\n if (!this.map) return false;\n let consumer = this.map.consumer();\n let from = consumer.originalPositionFor({ column, line });\n if (!from.source) return false;\n let to;\n if (typeof endLine === \"number\") {\n to = consumer.originalPositionFor({ column: endColumn, line: endLine });\n }\n let fromUrl;\n if (isAbsolute(from.source)) {\n fromUrl = pathToFileURL$1(from.source);\n } else {\n fromUrl = new URL(\n from.source,\n this.map.consumer().sourceRoot || pathToFileURL$1(this.map.mapFile)\n );\n }\n let result2 = {\n column: from.column,\n endColumn: to && to.column,\n endLine: to && to.line,\n line: from.line,\n url: fromUrl.toString()\n };\n if (fromUrl.protocol === \"file:\") {\n if (fileURLToPath) {\n result2.file = fileURLToPath(fromUrl);\n } else {\n throw new Error(`file: protocol is not available in this PostCSS build`);\n }\n }\n let source = consumer.sourceContentFor(from.source);\n if (source) result2.source = source;\n return result2;\n }\n toJSON() {\n let json = {};\n for (let name of [\"hasBOM\", \"css\", \"file\", \"id\"]) {\n if (this[name] != null) {\n json[name] = this[name];\n }\n }\n if (this.map) {\n json.map = { ...this.map };\n if (json.map.consumerCache) {\n json.map.consumerCache = void 0;\n }\n }\n return json;\n }\n get from() {\n return this.file || this.id;\n }\n};\nvar input = Input$4;\nInput$4.default = Input$4;\nif (terminalHighlight && terminalHighlight.registerInput) {\n terminalHighlight.registerInput(Input$4);\n}\nlet { SourceMapConsumer, SourceMapGenerator } = require$$2;\nlet { dirname, relative, resolve, sep } = require$$2;\nlet { pathToFileURL } = require$$2;\nlet Input$3 = input;\nlet sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator);\nlet pathAvailable = Boolean(dirname && resolve && relative && sep);\nlet MapGenerator$2 = class MapGenerator2 {\n constructor(stringify2, root2, opts, cssString) {\n this.stringify = stringify2;\n this.mapOpts = opts.map || {};\n this.root = root2;\n this.opts = opts;\n this.css = cssString;\n this.originalCSS = cssString;\n this.usesFileUrls = !this.mapOpts.from && this.mapOpts.absolute;\n this.memoizedFileURLs = /* @__PURE__ */ new Map();\n this.memoizedPaths = /* @__PURE__ */ new Map();\n this.memoizedURLs = /* @__PURE__ */ new Map();\n }\n addAnnotation() {\n let content;\n if (this.isInline()) {\n content = \"data:application/json;base64,\" + this.toBase64(this.map.toString());\n } else if (typeof this.mapOpts.annotation === \"string\") {\n content = this.mapOpts.annotation;\n } else if (typeof this.mapOpts.annotation === \"function\") {\n content = this.mapOpts.annotation(this.opts.to, this.root);\n } else {\n content = this.outputFile() + \".map\";\n }\n let eol = \"\\n\";\n if (this.css.includes(\"\\r\\n\")) eol = \"\\r\\n\";\n this.css += eol + \"/*# sourceMappingURL=\" + content + \" */\";\n }\n applyPrevMaps() {\n for (let prev of this.previous()) {\n let from = this.toUrl(this.path(prev.file));\n let root2 = prev.root || dirname(prev.file);\n let map;\n if (this.mapOpts.sourcesContent === false) {\n map = new SourceMapConsumer(prev.text);\n if (map.sourcesContent) {\n map.sourcesContent = null;\n }\n } else {\n map = prev.consumer();\n }\n this.map.applySourceMap(map, from, this.toUrl(this.path(root2)));\n }\n }\n clearAnnotation() {\n if (this.mapOpts.annotation === false) return;\n if (this.root) {\n let node2;\n for (let i2 = this.root.nodes.length - 1; i2 >= 0; i2--) {\n node2 = this.root.nodes[i2];\n if (node2.type !== \"comment\") continue;\n if (node2.text.indexOf(\"# sourceMappingURL=\") === 0) {\n this.root.removeChild(i2);\n }\n }\n } else if (this.css) {\n this.css = this.css.replace(/\\n*?\\/\\*#[\\S\\s]*?\\*\\/$/gm, \"\");\n }\n }\n generate() {\n this.clearAnnotation();\n if (pathAvailable && sourceMapAvailable && this.isMap()) {\n return this.generateMap();\n } else {\n let result2 = \"\";\n this.stringify(this.root, (i2) => {\n result2 += i2;\n });\n return [result2];\n }\n }\n generateMap() {\n if (this.root) {\n this.generateString();\n } else if (this.previous().length === 1) {\n let prev = this.previous()[0].consumer();\n prev.file = this.outputFile();\n this.map = SourceMapGenerator.fromSourceMap(prev, {\n ignoreInvalidMapping: true\n });\n } else {\n this.map = new SourceMapGenerator({\n file: this.outputFile(),\n ignoreInvalidMapping: true\n });\n this.map.addMapping({\n generated: { column: 0, line: 1 },\n original: { column: 0, line: 1 },\n source: this.opts.from ? this.toUrl(this.path(this.opts.from)) : \"<no source>\"\n });\n }\n if (this.isSourcesContent()) this.setSourcesContent();\n if (this.root && this.previous().length > 0) this.applyPrevMaps();\n if (this.isAnnotation()) this.addAnnotation();\n if (this.isInline()) {\n return [this.css];\n } else {\n return [this.css, this.map];\n }\n }\n generateString() {\n this.css = \"\";\n this.map = new SourceMapGenerator({\n file: this.outputFile(),\n ignoreInvalidMapping: true\n });\n let line = 1;\n let column = 1;\n let noSource = \"<no source>\";\n let mapping = {\n generated: { column: 0, line: 0 },\n original: { column: 0, line: 0 },\n source: \"\"\n };\n let lines, last;\n this.stringify(this.root, (str, node2, type) => {\n this.css += str;\n if (node2 && type !== \"end\") {\n mapping.generated.line = line;\n mapping.generated.column = column - 1;\n if (node2.source && node2.source.start) {\n mapping.source = this.sourcePath(node2);\n mapping.original.line = node2.source.start.line;\n mapping.original.column = node2.source.start.column - 1;\n this.map.addMapping(mapping);\n } else {\n mapping.source = noSource;\n mapping.original.line = 1;\n mapping.original.column = 0;\n this.map.addMapping(mapping);\n }\n }\n lines = str.match(/\\n/g);\n if (lines) {\n line += lines.length;\n last = str.lastIndexOf(\"\\n\");\n column = str.length - last;\n } else {\n column += str.length;\n }\n if (node2 && type !== \"start\") {\n let p = node2.parent || { raws: {} };\n let childless = node2.type === \"decl\" || node2.type === \"atrule\" && !node2.nodes;\n if (!childless || node2 !== p.last || p.raws.semicolon) {\n if (node2.source && node2.source.end) {\n mapping.source = this.sourcePath(node2);\n mapping.original.line = node2.source.end.line;\n mapping.original.column = node2.source.end.column - 1;\n mapping.generated.line = line;\n mapping.generated.column = column - 2;\n this.map.addMapping(mapping);\n } else {\n mapping.source = noSource;\n mapping.original.line = 1;\n mapping.original.column = 0;\n mapping.generated.line = line;\n mapping.generated.column = column - 1;\n this.map.addMapping(mapping);\n }\n }\n }\n });\n }\n isAnnotation() {\n if (this.isInline()) {\n return true;\n }\n if (typeof this.mapOpts.annotation !== \"undefined\") {\n return this.mapOpts.annotation;\n }\n if (this.previous().length) {\n return this.previous().some((i2) => i2.annotation);\n }\n return true;\n }\n isInline() {\n if (typeof this.mapOpts.inline !== \"undefined\") {\n return this.mapOpts.inline;\n }\n let annotation = this.mapOpts.annotation;\n if (typeof annotation !== \"undefined\" && annotation !== true) {\n return false;\n }\n if (this.previous().length) {\n return this.previous().some((i2) => i2.inline);\n }\n return true;\n }\n isMap() {\n if (typeof this.opts.map !== \"undefined\") {\n return !!this.opts.map;\n }\n return this.previous().length > 0;\n }\n isSourcesContent() {\n if (typeof this.mapOpts.sourcesContent !== \"undefined\") {\n return this.mapOpts.sourcesContent;\n }\n if (this.previous().length) {\n return this.previous().some((i2) => i2.withContent());\n }\n return true;\n }\n outputFile() {\n if (this.opts.to) {\n return this.path(this.opts.to);\n } else if (this.opts.from) {\n return this.path(this.opts.from);\n } else {\n return \"to.css\";\n }\n }\n path(file) {\n if (this.mapOpts.absolute) return file;\n if (file.charCodeAt(0) === 60) return file;\n if (/^\\w+:\\/\\//.test(file)) return file;\n let cached = this.memoizedPaths.get(file);\n if (cached) return cached;\n let from = this.opts.to ? dirname(this.opts.to) : \".\";\n if (typeof this.mapOpts.annotation === \"string\") {\n from = dirname(resolve(from, this.mapOpts.annotation));\n }\n let path = relative(from, file);\n this.memoizedPaths.set(file, path);\n return path;\n }\n previous() {\n if (!this.previousMaps) {\n this.previousMaps = [];\n if (this.root) {\n this.root.walk((node2) => {\n if (node2.source && node2.source.input.map) {\n let map = node2.source.input.map;\n if (!this.previousMaps.includes(map)) {\n this.previousMaps.push(map);\n }\n }\n });\n } else {\n let input2 = new Input$3(this.originalCSS, this.opts);\n if (input2.map) this.previousMaps.push(input2.map);\n }\n }\n return this.previousMaps;\n }\n setSourcesContent() {\n let already = {};\n if (this.root) {\n this.root.walk((node2) => {\n if (node2.source) {\n let from = node2.source.input.from;\n if (from && !already[from]) {\n already[from] = true;\n let fromUrl = this.usesFileUrls ? this.toFileUrl(from) : this.toUrl(this.path(from));\n this.map.setSourceContent(fromUrl, node2.source.input.css);\n }\n }\n });\n } else if (this.css) {\n let from = this.opts.from ? this.toUrl(this.path(this.opts.from)) : \"<no source>\";\n this.map.setSourceContent(from, this.css);\n }\n }\n sourcePath(node2) {\n if (this.mapOpts.from) {\n return this.toUrl(this.mapOpts.from);\n } else if (this.usesFileUrls) {\n return this.toFileUrl(node2.source.input.from);\n } else {\n return this.toUrl(this.path(node2.source.input.from));\n }\n }\n toBase64(str) {\n if (Buffer) {\n return Buffer.from(str).toString(\"base64\");\n } else {\n return window.btoa(unescape(encodeURIComponent(str)));\n }\n }\n toFileUrl(path) {\n let cached = this.memoizedFileURLs.get(path);\n if (cached) return cached;\n if (pathToFileURL) {\n let fileURL = pathToFileURL(path).toString();\n this.memoizedFileURLs.set(path, fileURL);\n return fileURL;\n } else {\n throw new Error(\n \"`map.absolute` option is not available in this PostCSS build\"\n );\n }\n }\n toUrl(path) {\n let cached = this.memoizedURLs.get(path);\n if (cached) return cached;\n if (sep === \"\\\\\") {\n path = path.replace(/\\\\/g, \"/\");\n }\n let url = encodeURI(path).replace(/[#?]/g, encodeURIComponent);\n this.memoizedURLs.set(path, url);\n return url;\n }\n};\nvar mapGenerator = MapGenerator$2;\nlet Node$2 = node;\nlet Comment$4 = class Comment2 extends Node$2 {\n constructor(defaults) {\n super(defaults);\n this.type = \"comment\";\n }\n};\nvar comment = Comment$4;\nComment$4.default = Comment$4;\nlet { isClean: isClean$1, my: my$1 } = symbols;\nlet Declaration$3 = declaration;\nlet Comment$3 = comment;\nlet Node$1 = node;\nlet parse$4, Rule$4, AtRule$4, Root$6;\nfunction cleanSource(nodes) {\n return nodes.map((i2) => {\n if (i2.nodes) i2.nodes = cleanSource(i2.nodes);\n delete i2.source;\n return i2;\n });\n}\nfunction markDirtyUp(node2) {\n node2[isClean$1] = false;\n if (node2.proxyOf.nodes) {\n for (let i2 of node2.proxyOf.nodes) {\n markDirtyUp(i2);\n }\n }\n}\nlet Container$7 = class Container2 extends Node$1 {\n append(...children) {\n for (let child of children) {\n let nodes = this.normalize(child, this.last);\n for (let node2 of nodes) this.proxyOf.nodes.push(node2);\n }\n this.markDirty();\n return this;\n }\n cleanRaws(keepBetween) {\n super.cleanRaws(keepBetween);\n if (this.nodes) {\n for (let node2 of this.nodes) node2.cleanRaws(keepBetween);\n }\n }\n each(callback) {\n if (!this.proxyOf.nodes) return void 0;\n let iterator = this.getIterator();\n let index2, result2;\n while (this.indexes[iterator] < this.proxyOf.nodes.length) {\n index2 = this.indexes[iterator];\n result2 = callback(this.proxyOf.nodes[index2], index2);\n if (result2 === false) break;\n this.indexes[iterator] += 1;\n }\n delete this.indexes[iterator];\n return result2;\n }\n every(condition) {\n return this.nodes.every(condition);\n }\n getIterator() {\n if (!this.lastEach) this.lastEach = 0;\n if (!this.indexes) this.indexes = {};\n this.lastEach += 1;\n let iterator = this.lastEach;\n this.indexes[iterator] = 0;\n return iterator;\n }\n getProxyProcessor() {\n return {\n get(node2, prop) {\n if (prop === \"proxyOf\") {\n return node2;\n } else if (!node2[prop]) {\n return node2[prop];\n } else if (prop === \"each\" || typeof prop === \"string\" && prop.startsWith(\"walk\")) {\n return (...args) => {\n return node2[prop](\n ...args.map((i2) => {\n if (typeof i2 === \"function\") {\n return (child, index2) => i2(child.toProxy(), index2);\n } else {\n return i2;\n }\n })\n );\n };\n } else if (prop === \"every\" || prop === \"some\") {\n return (cb) => {\n return node2[prop](\n (child, ...other) => cb(child.toProxy(), ...other)\n );\n };\n } else if (prop === \"root\") {\n return () => node2.root().toProxy();\n } else if (prop === \"nodes\") {\n return node2.nodes.map((i2) => i2.toProxy());\n } else if (prop === \"first\" || prop === \"last\") {\n return node2[prop].toProxy();\n } else {\n return node2[prop];\n }\n },\n set(node2, prop, value) {\n if (node2[prop] === value) return true;\n node2[prop] = value;\n if (prop === \"name\" || prop === \"params\" || prop === \"selector\") {\n node2.markDirty();\n }\n return true;\n }\n };\n }\n index(child) {\n if (typeof child === \"number\") return child;\n if (child.proxyOf) child = child.proxyOf;\n return this.proxyOf.nodes.indexOf(child);\n }\n insertAfter(exist, add) {\n let existIndex = this.index(exist);\n let nodes = this.normalize(add, this.proxyOf.nodes[existIndex]).reverse();\n existIndex = this.index(exist);\n for (let node2 of nodes) this.proxyOf.nodes.splice(existIndex + 1, 0, node2);\n let index2;\n for (let id in this.indexes) {\n index2 = this.indexes[id];\n if (existIndex < index2) {\n this.indexes[id] = index2 + nodes.length;\n }\n }\n this.markDirty();\n return this;\n }\n insertBefore(exist, add) {\n let existIndex = this.index(exist);\n let type = existIndex === 0 ? \"prepend\" : false;\n let nodes = this.normalize(add, this.proxyOf.nodes[existIndex], type).reverse();\n existIndex = this.index(exist);\n for (let node2 of nodes) this.proxyOf.nodes.splice(existIndex, 0, node2);\n let index2;\n for (let id in this.indexes) {\n index2 = this.indexes[id];\n if (existIndex <= index2) {\n this.indexes[id] = index2 + nodes.length;\n }\n }\n this.markDirty();\n return this;\n }\n normalize(nodes, sample) {\n if (typeof nodes === \"string\") {\n nodes = cleanSource(parse$4(nodes).nodes);\n } else if (typeof nodes === \"undefined\") {\n nodes = [];\n } else if (Array.isArray(nodes)) {\n nodes = nodes.slice(0);\n for (let i2 of nodes) {\n if (i2.parent) i2.parent.removeChild(i2, \"ignore\");\n }\n } else if (nodes.type === \"root\" && this.type !== \"document\") {\n nodes = nodes.nodes.slice(0);\n for (let i2 of nodes) {\n if (i2.parent) i2.parent.removeChild(i2, \"ignore\");\n }\n } else if (nodes.type) {\n nodes = [nodes];\n } else if (nodes.prop) {\n if (typeof nodes.value === \"undefined\") {\n throw new Error(\"Value field is missed in node creation\");\n } else if (typeof nodes.value !== \"string\") {\n nodes.value = String(nodes.value);\n }\n nodes = [new Declaration$3(nodes)];\n } else if (nodes.selector) {\n nodes = [new Rule$4(nodes)];\n } else if (nodes.name) {\n nodes = [new AtRule$4(nodes)];\n } else if (nodes.text) {\n nodes = [new Comment$3(nodes)];\n } else {\n throw new Error(\"Unknown node type in node creation\");\n }\n let processed = nodes.map((i2) => {\n if (!i2[my$1]) Container2.rebuild(i2);\n i2 = i2.proxyOf;\n if (i2.parent) i2.parent.removeChild(i2);\n if (i2[isClean$1]) markDirtyUp(i2);\n if (typeof i2.raws.before === \"undefined\") {\n if (sample && typeof sample.raws.before !== \"undefined\") {\n i2.raws.before = sample.raws.before.replace(/\\S/g, \"\");\n }\n }\n i2.parent = this.proxyOf;\n return i2;\n });\n return processed;\n }\n prepend(...children) {\n children = children.reverse();\n for (let child of children) {\n let nodes = this.normalize(child, this.first, \"prepend\").reverse();\n for (let node2 of nodes) this.proxyOf.nodes.unshift(node2);\n for (let id in this.indexes) {\n this.indexes[id] = this.indexes[id] + nodes.length;\n }\n }\n this.markDirty();\n return this;\n }\n push(child) {\n child.parent = this;\n this.proxyOf.nodes.push(child);\n return this;\n }\n removeAll() {\n for (let node2 of this.proxyOf.nodes) node2.parent = void 0;\n this.proxyOf.nodes = [];\n this.markDirty();\n return this;\n }\n removeChild(child) {\n child = this.index(child);\n this.proxyOf.nodes[child].parent = void 0;\n this.proxyOf.nodes.splice(child, 1);\n let index2;\n for (let id in this.indexes) {\n index2 = this.indexes[id];\n if (index2 >= child) {\n this.indexes[id] = index2 - 1;\n }\n }\n this.markDirty();\n return this;\n }\n replaceValues(pattern, opts, callback) {\n if (!callback) {\n callback = opts;\n opts = {};\n }\n this.walkDecls((decl) => {\n if (opts.props && !opts.props.includes(decl.prop)) return;\n if (opts.fast && !decl.value.includes(opts.fast)) return;\n decl.value = decl.value.replace(pattern, callback);\n });\n this.markDirty();\n return this;\n }\n some(condition) {\n return this.nodes.some(condition);\n }\n walk(callback) {\n return this.each((child, i2) => {\n let result2;\n try {\n result2 = callback(child, i2);\n } catch (e2) {\n throw child.addToError(e2);\n }\n if (result2 !== false && child.walk) {\n result2 = child.walk(callback);\n }\n return result2;\n });\n }\n walkAtRules(name, callback) {\n if (!callback) {\n callback = name;\n return this.walk((child, i2) => {\n if (child.type === \"atrule\") {\n return callback(child, i2);\n }\n });\n }\n if (name instanceof RegExp) {\n return this.walk((child, i2) => {\n if (child.type === \"atrule\" && name.test(child.name)) {\n return callback(child, i2);\n }\n });\n }\n return this.walk((child, i2) => {\n if (child.type === \"atrule\" && child.name === name) {\n return callback(child, i2);\n }\n });\n }\n walkComments(callback) {\n return this.walk((child, i2) => {\n if (child.type === \"comment\") {\n return callback(child, i2);\n }\n });\n }\n walkDecls(prop, callback) {\n if (!callback) {\n callback = prop;\n return this.walk((child, i2) => {\n if (child.type === \"decl\") {\n return callback(child, i2);\n }\n });\n }\n if (prop instanceof RegExp) {\n return this.walk((child, i2) => {\n if (child.type === \"decl\" && prop.test(child.prop)) {\n return callback(child, i2);\n }\n });\n }\n return this.walk((child, i2) => {\n if (child.type === \"decl\" && child.prop === prop) {\n return callback(child, i2);\n }\n });\n }\n walkRules(selector, callback) {\n if (!callback) {\n callback = selector;\n return this.walk((child, i2) => {\n if (child.type === \"rule\") {\n return callback(child, i2);\n }\n });\n }\n if (selector instanceof RegExp) {\n return this.walk((child, i2) => {\n if (child.type === \"rule\" && selector.test(child.selector)) {\n return callback(child, i2);\n }\n });\n }\n return this.walk((child, i2) => {\n if (child.type === \"rule\" && child.selector === selector) {\n return callback(child, i2);\n }\n });\n }\n get first() {\n if (!this.proxyOf.nodes) return void 0;\n return this.proxyOf.nodes[0];\n }\n get last() {\n if (!this.proxyOf.nodes) return void 0;\n return this.proxyOf.nodes[this.proxyOf.nodes.length - 1];\n }\n};\nContainer$7.registerParse = (dependant) => {\n parse$4 = dependant;\n};\nContainer$7.registerRule = (dependant) => {\n Rule$4 = dependant;\n};\nContainer$7.registerAtRule = (dependant) => {\n AtRule$4 = dependant;\n};\nContainer$7.registerRoot = (dependant) => {\n Root$6 = dependant;\n};\nvar container = Container$7;\nContainer$7.default = Container$7;\nContainer$7.rebuild = (node2) => {\n if (node2.type === \"atrule\") {\n Object.setPrototypeOf(node2, AtRule$4.prototype);\n } else if (node2.type === \"rule\") {\n Object.setPrototypeOf(node2, Rule$4.prototype);\n } else if (node2.type === \"decl\") {\n Object.setPrototypeOf(node2, Declaration$3.prototype);\n } else if (node2.type === \"comment\") {\n Object.setPrototypeOf(node2, Comment$3.prototype);\n } else if (node2.type === \"root\") {\n Object.setPrototypeOf(node2, Root$6.prototype);\n }\n node2[my$1] = true;\n if (node2.nodes) {\n node2.nodes.forEach((child) => {\n Container$7.rebuild(child);\n });\n }\n};\nlet Container$6 = container;\nlet LazyResult$4, Processor$3;\nlet Document$3 = class Document23 extends Container$6 {\n constructor(defaults) {\n super({ type: \"document\", ...defaults });\n if (!this.nodes) {\n this.nodes = [];\n }\n }\n toResult(opts = {}) {\n let lazy = new LazyResult$4(new Processor$3(), this, opts);\n return lazy.stringify();\n }\n};\nDocument$3.registerLazyResult = (dependant) => {\n LazyResult$4 = dependant;\n};\nDocument$3.registerProcessor = (dependant) => {\n Processor$3 = dependant;\n};\nvar document$1 = Document$3;\nDocument$3.default = Document$3;\nlet printed = {};\nvar warnOnce$2 = function warnOnce2(message) {\n if (printed[message]) return;\n printed[message] = true;\n if (typeof console !== \"undefined\" && console.warn) {\n console.warn(message);\n }\n};\nlet Warning$2 = class Warning2 {\n constructor(text, opts = {}) {\n this.type = \"warning\";\n this.text = text;\n if (opts.node && opts.node.source) {\n let range = opts.node.rangeBy(opts);\n this.line = range.start.line;\n this.column = range.start.column;\n this.endLine = range.end.line;\n this.endColumn = range.end.column;\n }\n for (let opt in opts) this[opt] = opts[opt];\n }\n toString() {\n if (this.node) {\n return this.node.error(this.text, {\n index: this.index,\n plugin: this.plugin,\n word: this.word\n }).message;\n }\n if (this.plugin) {\n return this.plugin + \": \" + this.text;\n }\n return this.text;\n }\n};\nvar warning = Warning$2;\nWarning$2.default = Warning$2;\nlet Warning$1 = warning;\nlet Result$3 = class Result2 {\n constructor(processor2, root2, opts) {\n this.processor = processor2;\n this.messages = [];\n this.root = root2;\n this.opts = opts;\n this.css = void 0;\n this.map = void 0;\n }\n toString() {\n return this.css;\n }\n warn(text, opts = {}) {\n if (!opts.plugin) {\n if (this.lastPlugin && this.lastPlugin.postcssPlugin) {\n opts.plugin = this.lastPlugin.postcssPlugin;\n }\n }\n let warning2 = new Warning$1(text, opts);\n this.messages.push(warning2);\n return warning2;\n }\n warnings() {\n return this.messages.filter((i2) => i2.type === \"warning\");\n }\n get content() {\n return this.css;\n }\n};\nvar result = Result$3;\nResult$3.default = Result$3;\nconst SINGLE_QUOTE = \"'\".charCodeAt(0);\nconst DOUBLE_QUOTE = '\"'.charCodeAt(0);\nconst BACKSLASH = \"\\\\\".charCodeAt(0);\nconst SLASH = \"/\".charCodeAt(0);\nconst NEWLINE = \"\\n\".charCodeAt(0);\nconst SPACE = \" \".charCodeAt(0);\nconst FEED = \"\\f\".charCodeAt(0);\nconst TAB = \"\t\".charCodeAt(0);\nconst CR = \"\\r\".charCodeAt(0);\nconst OPEN_SQUARE = \"[\".charCodeAt(0);\nconst CLOSE_SQUARE = \"]\".charCodeAt(0);\nconst OPEN_PARENTHESES = \"(\".charCodeAt(0);\nconst CLOSE_PARENTHESES = \")\".charCodeAt(0);\nconst OPEN_CURLY = \"{\".charCodeAt(0);\nconst CLOSE_CURLY = \"}\".charCodeAt(0);\nconst SEMICOLON = \";\".charCodeAt(0);\nconst ASTERISK = \"*\".charCodeAt(0);\nconst COLON = \":\".charCodeAt(0);\nconst AT = \"@\".charCodeAt(0);\nconst RE_AT_END = /[\\t\\n\\f\\r \"#'()/;[\\\\\\]{}]/g;\nconst RE_WORD_END = /[\\t\\n\\f\\r !\"#'():;@[\\\\\\]{}]|\\/(?=\\*)/g;\nconst RE_BAD_BRACKET = /.[\\r\\n\"'(/\\\\]/;\nconst RE_HEX_ESCAPE = /[\\da-f]/i;\nvar tokenize = function tokenizer2(input2, options = {}) {\n let css = input2.css.valueOf();\n let ignore = options.ignoreErrors;\n let code, next, quote, content, escape;\n let escaped, escapePos, prev, n2, currentToken;\n let length = css.length;\n let pos = 0;\n let buffer = [];\n let returned = [];\n function position() {\n return pos;\n }\n function unclosed(what) {\n throw input2.error(\"Unclosed \" + what, pos);\n }\n function endOfFile() {\n return returned.length === 0 && pos >= length;\n }\n function nextToken(opts) {\n if (returned.length) return returned.pop();\n if (pos >= length) return;\n let ignoreUnclosed = opts ? opts.ignoreUnclosed : false;\n code = css.charCodeAt(pos);\n switch (code) {\n case NEWLINE:\n case SPACE:\n case TAB:\n case CR:\n case FEED: {\n next = pos;\n do {\n next += 1;\n code = css.charCodeAt(next);\n } while (code === SPACE || code === NEWLINE || code === TAB || code === CR || code === FEED);\n currentToken = [\"space\", css.slice(pos, next)];\n pos = next - 1;\n break;\n }\n case OPEN_SQUARE:\n case CLOSE_SQUARE:\n case OPEN_CURLY:\n case CLOSE_CURLY:\n case COLON:\n case SEMICOLON:\n case CLOSE_PARENTHESES: {\n let controlChar = String.fromCharCode(code);\n currentToken = [controlChar, controlChar, pos];\n break;\n }\n case OPEN_PARENTHESES: {\n prev = buffer.length ? buffer.pop()[1] : \"\";\n n2 = css.charCodeAt(pos + 1);\n if (prev === \"url\" && n2 !== SINGLE_QUOTE && n2 !== DOUBLE_QUOTE && n2 !== SPACE && n2 !== NEWLINE && n2 !== TAB && n2 !== FEED && n2 !== CR) {\n next = pos;\n do {\n escaped = false;\n next = css.indexOf(\")\", next + 1);\n if (next === -1) {\n if (ignore || ignoreUnclosed) {\n next = pos;\n break;\n } else {\n unclosed(\"bracket\");\n }\n }\n escapePos = next;\n while (css.charCodeAt(escapePos - 1) === BACKSLASH) {\n escapePos -= 1;\n escaped = !escaped;\n }\n } while (escaped);\n currentToken = [\"brackets\", css.slice(pos, next + 1), pos, next];\n pos = next;\n } else {\n next = css.indexOf(\")\", pos + 1);\n content = css.slice(pos, next + 1);\n if (next === -1 || RE_BAD_BRACKET.test(content)) {\n currentToken = [\"(\", \"(\", pos];\n } else {\n currentToken = [\"brackets\", content, pos, next];\n pos = next;\n }\n }\n break;\n }\n case SINGLE_QUOTE:\n case DOUBLE_QUOTE: {\n quote = code === SINGLE_QUOTE ? \"'\" : '\"';\n next = pos;\n do {\n escaped = false;\n next = css.indexOf(quote, next + 1);\n if (next === -1) {\n if (ignore || ignoreUnclosed) {\n next = pos + 1;\n break;\n } else {\n unclosed(\"string\");\n }\n }\n escapePos = next;\n while (css.charCodeAt(escapePos - 1) === BACKSLASH) {\n escapePos -= 1;\n escaped = !escaped;\n }\n } while (escaped);\n currentToken = [\"string\", css.slice(pos, next + 1), pos, next];\n pos = next;\n break;\n }\n case AT: {\n RE_AT_END.lastIndex = pos + 1;\n RE_AT_END.test(css);\n if (RE_AT_END.lastIndex === 0) {\n next = css.length - 1;\n } else {\n next = RE_AT_END.lastIndex - 2;\n }\n currentToken = [\"at-word\", css.slice(pos, next + 1), pos, next];\n pos = next;\n break;\n }\n case BACKSLASH: {\n next = pos;\n escape = true;\n while (css.charCodeAt(next + 1) === BACKSLASH) {\n next += 1;\n escape = !escape;\n }\n code = css.charCodeAt(next + 1);\n if (escape && code !== SLASH && code !== SPACE && code !== NEWLINE && code !== TAB && code !== CR && code !== FEED) {\n next += 1;\n if (RE_HEX_ESCAPE.test(css.charAt(next))) {\n while (RE_HEX_ESCAPE.test(css.charAt(next + 1))) {\n next += 1;\n }\n if (css.charCodeAt(next + 1) === SPACE) {\n next += 1;\n }\n }\n }\n currentToken = [\"word\", css.slice(pos, next + 1), pos, next];\n pos = next;\n break;\n }\n default: {\n if (code === SLASH && css.charCodeAt(pos + 1) === ASTERISK) {\n next = css.indexOf(\"*/\", pos + 2) + 1;\n if (next === 0) {\n if (ignore || ignoreUnclosed) {\n next = css.length;\n } else {\n unclosed(\"comment\");\n }\n }\n currentToken = [\"comment\", css.slice(pos, next + 1), pos, next];\n pos = next;\n } else {\n RE_WORD_END.lastIndex = pos + 1;\n RE_WORD_END.test(css);\n if (RE_WORD_END.lastIndex === 0) {\n next = css.length - 1;\n } else {\n next = RE_WORD_END.lastIndex - 2;\n }\n currentToken = [\"word\", css.slice(pos, next + 1), pos, next];\n buffer.push(currentToken);\n pos = next;\n }\n break;\n }\n }\n pos++;\n return currentToken;\n }\n function back(token) {\n returned.push(token);\n }\n return {\n back,\n endOfFile,\n nextToken,\n position\n };\n};\nlet Container$5 = container;\nlet AtRule$3 = class AtRule2 extends Container$5 {\n constructor(defaults) {\n super(defaults);\n this.type = \"atrule\";\n }\n append(...children) {\n if (!this.proxyOf.nodes) this.nodes = [];\n return super.append(...children);\n }\n prepend(...children) {\n if (!this.proxyOf.nodes) this.nodes = [];\n return super.prepend(...children);\n }\n};\nvar atRule = AtRule$3;\nAtRule$3.default = AtRule$3;\nContainer$5.registerAtRule(AtRule$3);\nlet Container$4 = container;\nlet LazyResult$3, Processor$2;\nlet Root$5 = class Root2 extends Container$4 {\n constructor(defaults) {\n super(defaults);\n this.type = \"root\";\n if (!this.nodes) this.nodes = [];\n }\n normalize(child, sample, type) {\n let nodes = super.normalize(child);\n if (sample) {\n if (type === \"prepend\") {\n if (this.nodes.length > 1) {\n sample.raws.before = this.nodes[1].raws.before;\n } else {\n delete sample.raws.before;\n }\n } else if (this.first !== sample) {\n for (let node2 of nodes) {\n node2.raws.before = sample.raws.before;\n }\n }\n }\n return nodes;\n }\n removeChild(child, ignore) {\n let index2 = this.index(child);\n if (!ignore && index2 === 0 && this.nodes.length > 1) {\n this.nodes[1].raws.before = this.nodes[index2].raws.before;\n }\n return super.removeChild(child);\n }\n toResult(opts = {}) {\n let lazy = new LazyResult$3(new Processor$2(), this, opts);\n return lazy.stringify();\n }\n};\nRoot$5.registerLazyResult = (dependant) => {\n LazyResult$3 = dependant;\n};\nRoot$5.registerProcessor = (dependant) => {\n Processor$2 = dependant;\n};\nvar root = Root$5;\nRoot$5.default = Root$5;\nContainer$4.registerRoot(Root$5);\nlet list$2 = {\n comma(string) {\n return list$2.split(string, [\",\"], true);\n },\n space(string) {\n let spaces = [\" \", \"\\n\", \"\t\"];\n return list$2.split(string, spaces);\n },\n split(string, separators, last) {\n let array = [];\n let current = \"\";\n let split = false;\n let func = 0;\n let inQuote = false;\n let prevQuote = \"\";\n let escape = false;\n for (let letter of string) {\n if (escape) {\n escape = false;\n } else if (letter === \"\\\\\") {\n escape = true;\n } else if (inQuote) {\n if (letter === prevQuote) {\n inQuote = false;\n }\n } else if (letter === '\"' || letter === \"'\") {\n inQuote = true;\n prevQuote = letter;\n } else if (letter === \"(\") {\n func += 1;\n } else if (letter === \")\") {\n if (func > 0) func -= 1;\n } else if (func === 0) {\n if (separators.includes(letter)) split = true;\n }\n if (split) {\n if (current !== \"\") array.push(current.trim());\n current = \"\";\n split = false;\n } else {\n current += letter;\n }\n }\n if (last || current !== \"\") array.push(current.trim());\n return array;\n }\n};\nvar list_1 = list$2;\nlist$2.default = list$2;\nlet Container$3 = container;\nlet list$1 = list_1;\nlet Rule$3 = class Rule2 extends Container$3 {\n constructor(defaults) {\n super(defaults);\n this.type = \"rule\";\n if (!this.nodes) this.nodes = [];\n }\n get selectors() {\n return list$1.comma(this.selector);\n }\n set selectors(values) {\n let match = this.selector ? this.selector.match(/,\\s*/) : null;\n let sep2 = match ? match[0] : \",\" + this.raw(\"between\", \"beforeOpen\");\n this.selector = values.join(sep2);\n }\n};\nvar rule = Rule$3;\nRule$3.default = Rule$3;\nContainer$3.registerRule(Rule$3);\nlet Declaration$2 = declaration;\nlet tokenizer22 = tokenize;\nlet Comment$2 = comment;\nlet AtRule$2 = atRule;\nlet Root$4 = root;\nlet Rule$2 = rule;\nconst SAFE_COMMENT_NEIGHBOR = {\n empty: true,\n space: true\n};\nfunction findLastWithPosition(tokens) {\n for (let i2 = tokens.length - 1; i2 >= 0; i2--) {\n let token = tokens[i2];\n let pos = token[3] || token[2];\n if (pos) return pos;\n }\n}\nlet Parser$1 = class Parser2 {\n constructor(input2) {\n this.input = input2;\n this.root = new Root$4();\n this.current = this.root;\n this.spaces = \"\";\n this.semicolon = false;\n this.createTokenizer();\n this.root.source = { input: input2, start: { column: 1, line: 1, offset: 0 } };\n }\n atrule(token) {\n let node2 = new AtRule$2();\n node2.name = token[1].slice(1);\n if (node2.name === \"\") {\n this.unnamedAtrule(node2, token);\n }\n this.init(node2, token[2]);\n let type;\n let prev;\n let shift;\n let last = false;\n let open = false;\n let params = [];\n let brackets = [];\n while (!this.tokenizer.endOfFile()) {\n token = this.tokenizer.nextToken();\n type = token[0];\n if (type === \"(\" || type === \"[\") {\n brackets.push(type === \"(\" ? \")\" : \"]\");\n } else if (type === \"{\" && brackets.length > 0) {\n brackets.push(\"}\");\n } else if (type === brackets[brackets.length - 1]) {\n brackets.pop();\n }\n if (brackets.length === 0) {\n if (type === \";\") {\n node2.source.end = this.getPosition(token[2]);\n node2.source.end.offset++;\n this.semicolon = true;\n break;\n } else if (type === \"{\") {\n open = true;\n break;\n } else if (type === \"}\") {\n if (params.length > 0) {\n shift = params.length - 1;\n prev = params[shift];\n while (prev && prev[0] === \"space\") {\n prev = params[--shift];\n }\n if (prev) {\n node2.source.end = this.getPosition(prev[3] || prev[2]);\n node2.source.end.offset++;\n }\n }\n this.end(token);\n break;\n } else {\n params.push(token);\n }\n } else {\n params.push(token);\n }\n if (this.tokenizer.endOfFile()) {\n last = true;\n break;\n }\n }\n node2.raws.between = this.spacesAndCommentsFromEnd(params);\n if (params.length) {\n node2.raws.afterName = this.spacesAndCommentsFromStart(params);\n this.raw(node2, \"params\", params);\n if (last) {\n token = params[params.length - 1];\n node2.source.end = this.getPosition(token[3] || token[2]);\n node2.source.end.offset++;\n this.spaces = node2.raws.between;\n node2.raws.between = \"\";\n }\n } else {\n node2.raws.afterName = \"\";\n node2.params = \"\";\n }\n if (open) {\n node2.nodes = [];\n this.current = node2;\n }\n }\n checkMissedSemicolon(tokens) {\n let colon = this.colon(tokens);\n if (colon === false) return;\n let founded = 0;\n let token;\n for (let j = colon - 1; j >= 0; j--) {\n token = tokens[j];\n if (token[0] !== \"space\") {\n founded += 1;\n if (founded === 2) break;\n }\n }\n throw this.input.error(\n \"Missed semicolon\",\n token[0] === \"word\" ? token[3] + 1 : token[2]\n );\n }\n colon(tokens) {\n let brackets = 0;\n let token, type, prev;\n for (let [i2, element] of tokens.entries()) {\n token = element;\n type = token[0];\n if (type === \"(\") {\n brackets += 1;\n }\n if (type === \")\") {\n brackets -= 1;\n }\n if (brackets === 0 && type === \":\") {\n if (!prev) {\n this.doubleColon(token);\n } else if (prev[0] === \"word\" && prev[1] === \"progid\") {\n continue;\n } else {\n return i2;\n }\n }\n prev = token;\n }\n return false;\n }\n comment(token) {\n let node2 = new Comment$2();\n this.init(node2, token[2]);\n node2.source.end = this.getPosition(token[3] || token[2]);\n node2.source.end.offset++;\n let text = token[1].slice(2, -2);\n if (/^\\s*$/.test(text)) {\n node2.text = \"\";\n node2.raws.left = text;\n node2.raws.right = \"\";\n } else {\n let match = text.match(/^(\\s*)([^]*\\S)(\\s*)$/);\n node2.text = match[2];\n node2.raws.left = match[1];\n node2.raws.right = match[3];\n }\n }\n createTokenizer() {\n this.tokenizer = tokenizer22(this.input);\n }\n decl(tokens, customProperty) {\n let node2 = new Declaration$2();\n this.init(node2, tokens[0][2]);\n let last = tokens[tokens.length - 1];\n if (last[0] === \";\") {\n this.semicolon = true;\n tokens.pop();\n }\n node2.source.end = this.getPosition(\n last[3] || last[2] || findLastWithPosition(tokens)\n );\n node2.source.end.offset++;\n while (tokens[0][0] !== \"word\") {\n if (tokens.length === 1) this.unknownWord(tokens);\n node2.raws.before += tokens.shift()[1];\n }\n node2.source.start = this.getPosition(tokens[0][2]);\n node2.prop = \"\";\n while (tokens.length) {\n let type = tokens[0][0];\n if (type === \":\" || type === \"space\" || type === \"comment\") {\n break;\n }\n node2.prop += tokens.shift()[1];\n }\n node2.raws.between = \"\";\n let token;\n while (tokens.length) {\n token = tokens.shift();\n if (token[0] === \":\") {\n node2.raws.between += token[1];\n break;\n } else {\n if (token[0] === \"word\" && /\\w/.test(token[1])) {\n this.unknownWord([token]);\n }\n node2.raws.between += token[1];\n }\n }\n if (node2.prop[0] === \"_\" || node2.prop[0] === \"*\") {\n node2.raws.before += node2.prop[0];\n node2.prop = node2.prop.slice(1);\n }\n let firstSpaces = [];\n let next;\n while (tokens.length) {\n next = tokens[0][0];\n if (next !== \"space\" && next !== \"comment\") break;\n firstSpaces.push(tokens.shift());\n }\n this.precheckMissedSemicolon(tokens);\n for (let i2 = tokens.length - 1; i2 >= 0; i2--) {\n token = tokens[i2];\n if (token[1].toLowerCase() === \"!important\") {\n node2.important = true;\n let string = this.stringFrom(tokens, i2);\n string = this.spacesFromEnd(tokens) + string;\n if (string !== \" !important\") node2.raws.important = string;\n break;\n } else if (token[1].toLowerCase() === \"important\") {\n let cache = tokens.slice(0);\n let str = \"\";\n for (let j = i2; j > 0; j--) {\n let type = cache[j][0];\n if (str.trim().indexOf(\"!\") === 0 && type !== \"space\") {\n break;\n }\n str = cache.pop()[1] + str;\n }\n if (str.trim().indexOf(\"!\") === 0) {\n node2.important = true;\n node2.raws.important = str;\n tokens = cache;\n }\n }\n if (token[0] !== \"space\" && token[0] !== \"comment\") {\n break;\n }\n }\n let hasWord = tokens.some((i2) => i2[0] !== \"space\" && i2[0] !== \"comment\");\n if (hasWord) {\n node2.raws.between += firstSpaces.map((i2) => i2[1]).join(\"\");\n firstSpaces = [];\n }\n this.raw(node2, \"value\", firstSpaces.concat(tokens), customProperty);\n if (node2.value.includes(\":\") && !customProperty) {\n this.checkMissedSemicolon(tokens);\n }\n }\n doubleColon(token) {\n throw this.input.error(\n \"Double colon\",\n { offset: token[2] },\n { offset: token[2] + token[1].length }\n );\n }\n emptyRule(token) {\n let node2 = new Rule$2();\n this.init(node2, token[2]);\n node2.selector = \"\";\n node2.raws.between = \"\";\n this.current = node2;\n }\n end(token) {\n if (this.current.nodes && this.current.nodes.length) {\n this.current.raws.semicolon = this.semicolon;\n }\n this.semicolon = false;\n this.current.raws.after = (this.current.raws.after || \"\") + this.spaces;\n this.spaces = \"\";\n if (this.current.parent) {\n this.current.source.end = this.getPosition(token[2]);\n this.current.source.end.offset++;\n this.current = this.current.parent;\n } else {\n this.unexpectedClose(token);\n }\n }\n endFile() {\n if (this.current.parent) this.unclosedBlock();\n if (this.current.nodes && this.current.nodes.length) {\n this.current.raws.semicolon = this.semicolon;\n }\n this.current.raws.after = (this.current.raws.after || \"\") + this.spaces;\n this.root.source.end = this.getPosition(this.tokenizer.position());\n }\n freeSemicolon(token) {\n this.spaces += token[1];\n if (this.current.nodes) {\n let prev = this.current.nodes[this.current.nodes.length - 1];\n if (prev && prev.type === \"rule\" && !prev.raws.ownSemicolon) {\n prev.raws.ownSemicolon = this.spaces;\n this.spaces = \"\";\n }\n }\n }\n // Helpers\n getPosition(offset) {\n let pos = this.input.fromOffset(offset);\n return {\n column: pos.col,\n line: pos.line,\n offset\n };\n }\n init(node2, offset) {\n this.current.push(node2);\n node2.source = {\n input: this.input,\n start: this.getPosition(offset)\n };\n node2.raws.before = this.spaces;\n this.spaces = \"\";\n if (node2.type !== \"comment\") this.semicolon = false;\n }\n other(start) {\n let end = false;\n let type = null;\n let colon = false;\n let bracket = null;\n let brackets = [];\n let customProperty = start[1].startsWith(\"--\");\n let tokens = [];\n let token = start;\n while (token) {\n type = token[0];\n tokens.push(token);\n if (type === \"(\" || type === \"[\") {\n if (!bracket) bracket = token;\n brackets.push(type === \"(\" ? \")\" : \"]\");\n } else if (customProperty && colon && type === \"{\") {\n if (!bracket) bracket = token;\n brackets.push(\"}\");\n } else if (brackets.length === 0) {\n if (type === \";\") {\n if (colon) {\n this.decl(tokens, customProperty);\n return;\n } else {\n break;\n }\n } else if (type === \"{\") {\n this.rule(tokens);\n return;\n } else if (type === \"}\") {\n this.tokenizer.back(tokens.pop());\n end = true;\n break;\n } else if (type === \":\") {\n colon = true;\n }\n } else if (type === brackets[brackets.length - 1]) {\n brackets.pop();\n if (brackets.length === 0) bracket = null;\n }\n token = this.tokenizer.nextToken();\n }\n if (this.tokenizer.endOfFile()) end = true;\n if (brackets.length > 0) this.unclosedBracket(bracket);\n if (end && colon) {\n if (!customProperty) {\n while (tokens.length) {\n token = tokens[tokens.length - 1][0];\n if (token !== \"space\" && token !== \"comment\") break;\n this.tokenizer.back(tokens.pop());\n }\n }\n this.decl(tokens, customProperty);\n } else {\n this.unknownWord(tokens);\n }\n }\n parse() {\n let token;\n while (!this.tokenizer.endOfFile()) {\n token = this.tokenizer.nextToken();\n switch (token[0]) {\n case \"space\":\n this.spaces += token[1];\n break;\n case \";\":\n this.freeSemicolon(token);\n break;\n case \"}\":\n this.end(token);\n break;\n case \"comment\":\n this.comment(token);\n break;\n case \"at-word\":\n this.atrule(token);\n break;\n case \"{\":\n this.emptyRule(token);\n break;\n default:\n this.other(token);\n break;\n }\n }\n this.endFile();\n }\n precheckMissedSemicolon() {\n }\n raw(node2, prop, tokens, customProperty) {\n let token, type;\n let length = tokens.length;\n let value = \"\";\n let clean = true;\n let next, prev;\n for (let i2 = 0; i2 < length; i2 += 1) {\n token = tokens[i2];\n type = token[0];\n if (type === \"space\" && i2 === length - 1 && !customProperty) {\n clean = false;\n } else if (type === \"comment\") {\n prev = tokens[i2 - 1] ? tokens[i2 - 1][0] : \"empty\";\n next = tokens[i2 + 1] ? tokens[i2 + 1][0] : \"empty\";\n if (!SAFE_COMMENT_NEIGHBOR[prev] && !SAFE_COMMENT_NEIGHBOR[next]) {\n if (value.slice(-1) === \",\") {\n clean = false;\n } else {\n value += token[1];\n }\n } else {\n clean = false;\n }\n } else {\n value += token[1];\n }\n }\n if (!clean) {\n let raw = tokens.reduce((all, i2) => all + i2[1], \"\");\n node2.raws[prop] = { raw, value };\n }\n node2[prop] = value;\n }\n rule(tokens) {\n tokens.pop();\n let node2 = new Rule$2();\n this.init(node2, tokens[0][2]);\n node2.raws.between = this.spacesAndCommentsFromEnd(tokens);\n this.raw(node2, \"selector\", tokens);\n this.current = node2;\n }\n spacesAndCommentsFromEnd(tokens) {\n let lastTokenType;\n let spaces = \"\";\n while (tokens.length) {\n lastTokenType = tokens[tokens.length - 1][0];\n if (lastTokenType !== \"space\" && lastTokenType !== \"comment\") break;\n spaces = tokens.pop()[1] + spaces;\n }\n return spaces;\n }\n // Errors\n spacesAndCommentsFromStart(tokens) {\n let next;\n let spaces = \"\";\n while (tokens.length) {\n next = tokens[0][0];\n if (next !== \"space\" && next !== \"comment\") break;\n spaces += tokens.shift()[1];\n }\n return spaces;\n }\n spacesFromEnd(tokens) {\n let lastTokenType;\n let spaces = \"\";\n while (tokens.length) {\n lastTokenType = tokens[tokens.length - 1][0];\n if (lastTokenType !== \"space\") break;\n spaces = tokens.pop()[1] + spaces;\n }\n return spaces;\n }\n stringFrom(tokens, from) {\n let result2 = \"\";\n for (let i2 = from; i2 < tokens.length; i2++) {\n result2 += tokens[i2][1];\n }\n tokens.splice(from, tokens.length - from);\n return result2;\n }\n unclosedBlock() {\n let pos = this.current.source.start;\n throw this.input.error(\"Unclosed block\", pos.line, pos.column);\n }\n unclosedBracket(bracket) {\n throw this.input.error(\n \"Unclosed bracket\",\n { offset: bracket[2] },\n { offset: bracket[2] + 1 }\n );\n }\n unexpectedClose(token) {\n throw this.input.error(\n \"Unexpected }\",\n { offset: token[2] },\n { offset: token[2] + 1 }\n );\n }\n unknownWord(tokens) {\n throw this.input.error(\n \"Unknown word\",\n { offset: tokens[0][2] },\n { offset: tokens[0][2] + tokens[0][1].length }\n );\n }\n unnamedAtrule(node2, token) {\n throw this.input.error(\n \"At-rule without name\",\n { offset: token[2] },\n { offset: token[2] + token[1].length }\n );\n }\n};\nvar parser = Parser$1;\nlet Container$2 = container;\nlet Parser22 = parser;\nlet Input$2 = input;\nfunction parse$3(css, opts) {\n let input2 = new Input$2(css, opts);\n let parser2 = new Parser22(input2);\n try {\n parser2.parse();\n } catch (e2) {\n if (process.env.NODE_ENV !== \"production\") {\n if (e2.name === \"CssSyntaxError\" && opts && opts.from) {\n if (/\\.scss$/i.test(opts.from)) {\n e2.message += \"\\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser\";\n } else if (/\\.sass/i.test(opts.from)) {\n e2.message += \"\\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser\";\n } else if (/\\.less$/i.test(opts.from)) {\n e2.message += \"\\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser\";\n }\n }\n }\n throw e2;\n }\n return parser2.root;\n}\nvar parse_1 = parse$3;\nparse$3.default = parse$3;\nContainer$2.registerParse(parse$3);\nlet { isClean, my } = symbols;\nlet MapGenerator$1 = mapGenerator;\nlet stringify$2 = stringify_1;\nlet Container$1 = container;\nlet Document$2 = document$1;\nlet warnOnce$1 = warnOnce$2;\nlet Result$2 = result;\nlet parse$2 = parse_1;\nlet Root$3 = root;\nconst TYPE_TO_CLASS_NAME = {\n atrule: \"AtRule\",\n comment: \"Comment\",\n decl: \"Declaration\",\n document: \"Document\",\n root: \"Root\",\n rule: \"Rule\"\n};\nconst PLUGIN_PROPS = {\n AtRule: true,\n AtRuleExit: true,\n Comment: true,\n CommentExit: true,\n Declaration: true,\n DeclarationExit: true,\n Document: true,\n DocumentExit: true,\n Once: true,\n OnceExit: true,\n postcssPlugin: true,\n prepare: true,\n Root: true,\n RootExit: true,\n Rule: true,\n RuleExit: true\n};\nconst NOT_VISITORS = {\n Once: true,\n postcssPlugin: true,\n prepare: true\n};\nconst CHILDREN = 0;\nfunction isPromise(obj) {\n return typeof obj === \"object\" && typeof obj.then === \"function\";\n}\nfunction getEvents(node2) {\n let key = false;\n let type = TYPE_TO_CLASS_NAME[node2.type];\n if (node2.type === \"decl\") {\n key = node2.prop.toLowerCase();\n } else if (node2.type === \"atrule\") {\n key = node2.name.toLowerCase();\n }\n if (key && node2.append) {\n return [\n type,\n type + \"-\" + key,\n CHILDREN,\n type + \"Exit\",\n type + \"Exit-\" + key\n ];\n } else if (key) {\n return [type, type + \"-\" + key, type + \"Exit\", type + \"Exit-\" + key];\n } else if (node2.append) {\n return [type, CHILDREN, type + \"Exit\"];\n } else {\n return [type, type + \"Exit\"];\n }\n}\nfunction toStack(node2) {\n let events;\n if (node2.type === \"document\") {\n events = [\"Document\", CHILDREN, \"DocumentExit\"];\n } else if (node2.type === \"root\") {\n events = [\"Root\", CHILDREN, \"RootExit\"];\n } else {\n events = getEvents(node2);\n }\n return {\n eventIndex: 0,\n events,\n iterator: 0,\n node: node2,\n visitorIndex: 0,\n visitors: []\n };\n}\nfunction cleanMarks(node2) {\n node2[isClean] = false;\n if (node2.nodes) node2.nodes.forEach((i2) => cleanMarks(i2));\n return node2;\n}\nlet postcss$2 = {};\nlet LazyResult$2 = class LazyResult2 {\n constructor(processor2, css, opts) {\n this.stringified = false;\n this.processed = false;\n let root2;\n if (typeof css === \"object\" && css !== null && (css.type === \"root\" || css.type === \"document\")) {\n root2 = cleanMarks(css);\n } else if (css instanceof LazyResult2 || css instanceof Result$2) {\n root2 = cleanMarks(css.root);\n if (css.map) {\n if (typeof opts.map === \"undefined\") opts.map = {};\n if (!opts.map.inline) opts.map.inline = false;\n opts.map.prev = css.map;\n }\n } else {\n let parser2 = parse$2;\n if (opts.syntax) parser2 = opts.syntax.parse;\n if (opts.parser) parser2 = opts.parser;\n if (parser2.parse) parser2 = parser2.parse;\n try {\n root2 = parser2(css, opts);\n } catch (error) {\n this.processed = true;\n this.error = error;\n }\n if (root2 && !root2[my]) {\n Container$1.rebuild(root2);\n }\n }\n this.result = new Result$2(processor2, root2, opts);\n this.helpers = { ...postcss$2, postcss: postcss$2, result: this.result };\n this.plugins = this.processor.plugins.map((plugin22) => {\n if (typeof plugin22 === \"object\" && plugin22.prepare) {\n return { ...plugin22, ...plugin22.prepare(this.result) };\n } else {\n return plugin22;\n }\n });\n }\n async() {\n if (this.error) return Promise.reject(this.error);\n if (this.processed) return Promise.resolve(this.result);\n if (!this.processing) {\n this.processing = this.runAsync();\n }\n return this.processing;\n }\n catch(onRejected) {\n return this.async().catch(onRejected);\n }\n finally(onFinally) {\n return this.async().then(onFinally, onFinally);\n }\n getAsyncError() {\n throw new Error(\"Use process(css).then(cb) to work with async plugins\");\n }\n handleError(error, node2) {\n let plugin22 = this.result.lastPlugin;\n try {\n if (node2) node2.addToError(error);\n this.error = error;\n if (error.name === \"CssSyntaxError\" && !error.plugin) {\n error.plugin = plugin22.postcssPlugin;\n error.setMessage();\n } else if (plugin22.postcssVersion) {\n if (process.env.NODE_ENV !== \"production\") {\n let pluginName = plugin22.postcssPlugin;\n let pluginVer = plugin22.postcssVersion;\n let runtimeVer = this.result.processor.version;\n let a2 = pluginVer.split(\".\");\n let b = runtimeVer.split(\".\");\n if (a2[0] !== b[0] || parseInt(a2[1]) > parseInt(b[1])) {\n console.error(\n \"Unknown error from PostCSS plugin. Your current PostCSS version is \" + runtimeVer + \", but \" + pluginName + \" uses \" + pluginVer + \". Perhaps this is the source of the error below.\"\n );\n }\n }\n }\n } catch (err) {\n if (console && console.error) console.error(err);\n }\n return error;\n }\n prepareVisitors() {\n this.listeners = {};\n let add = (plugin22, type, cb) => {\n if (!this.listeners[type]) this.listeners[type] = [];\n this.listeners[type].push([plugin22, cb]);\n };\n for (let plugin22 of this.plugins) {\n if (typeof plugin22 === \"object\") {\n for (let event in plugin22) {\n if (!PLUGIN_PROPS[event] && /^[A-Z]/.test(event)) {\n throw new Error(\n `Unknown event ${event} in ${plugin22.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`\n );\n }\n if (!NOT_VISITORS[event]) {\n if (typeof plugin22[event] === \"object\") {\n for (let filter in plugin22[event]) {\n if (filter === \"*\") {\n add(plugin22, event, plugin22[event][filter]);\n } else {\n add(\n plugin22,\n event + \"-\" + filter.toLowerCase(),\n plugin22[event][filter]\n );\n }\n }\n } else if (typeof plugin22[event] === \"function\") {\n add(plugin22, event, plugin22[event]);\n }\n }\n }\n }\n }\n this.hasListener = Object.keys(this.listeners).length > 0;\n }\n async runAsync() {\n this.plugin = 0;\n for (let i2 = 0; i2 < this.plugins.length; i2++) {\n let plugin22 = this.plugins[i2];\n let promise = this.runOnRoot(plugin22);\n if (isPromise(promise)) {\n try {\n await promise;\n } catch (error) {\n throw this.handleError(error);\n }\n }\n }\n this.prepareVisitors();\n if (this.hasListener) {\n let root2 = this.result.root;\n while (!root2[isClean]) {\n root2[isClean] = true;\n let stack = [toStack(root2)];\n while (stack.length > 0) {\n let promise = this.visitTick(stack);\n if (isPromise(promise)) {\n try {\n await promise;\n } catch (e2) {\n let node2 = stack[stack.length - 1].node;\n throw this.handleError(e2, node2);\n }\n }\n }\n }\n if (this.listeners.OnceExit) {\n for (let [plugin22, visitor] of this.listeners.OnceExit) {\n this.result.lastPlugin = plugin22;\n try {\n if (root2.type === \"document\") {\n let roots = root2.nodes.map(\n (subRoot) => visitor(subRoot, this.helpers)\n );\n await Promise.all(roots);\n } else {\n await visitor(root2, this.helpers);\n }\n } catch (e2) {\n throw this.handleError(e2);\n }\n }\n }\n }\n this.processed = true;\n return this.stringify();\n }\n runOnRoot(plugin22) {\n this.result.lastPlugin = plugin22;\n try {\n if (typeof plugin22 === \"object\" && plugin22.Once) {\n if (this.result.root.type === \"document\") {\n let roots = this.result.root.nodes.map(\n (root2) => plugin22.Once(root2, this.helpers)\n );\n if (isPromise(roots[0])) {\n return Promise.all(roots);\n }\n return roots;\n }\n return plugin22.Once(this.result.root, this.helpers);\n } else if (typeof plugin22 === \"function\") {\n return plugin22(this.result.root, this.result);\n }\n } catch (error) {\n throw this.handleError(error);\n }\n }\n stringify() {\n if (this.error) throw this.error;\n if (this.stringified) return this.result;\n this.stringified = true;\n this.sync();\n let opts = this.result.opts;\n let str = stringify$2;\n if (opts.syntax) str = opts.syntax.stringify;\n if (opts.stringifier) str = opts.stringifier;\n if (str.stringify) str = str.stringify;\n let map = new MapGenerator$1(str, this.result.root, this.result.opts);\n let data = map.generate();\n this.result.css = data[0];\n this.result.map = data[1];\n return this.result;\n }\n sync() {\n if (this.error) throw this.error;\n if (this.processed) return this.result;\n this.processed = true;\n if (this.processing) {\n throw this.getAsyncError();\n }\n for (let plugin22 of this.plugins) {\n let promise = this.runOnRoot(plugin22);\n if (isPromise(promise)) {\n throw this.getAsyncError();\n }\n }\n this.prepareVisitors();\n if (this.hasListener) {\n let root2 = this.result.root;\n while (!root2[isClean]) {\n root2[isClean] = true;\n this.walkSync(root2);\n }\n if (this.listeners.OnceExit) {\n if (root2.type === \"document\") {\n for (let subRoot of root2.nodes) {\n this.visitSync(this.listeners.OnceExit, subRoot);\n }\n } else {\n this.visitSync(this.listeners.OnceExit, root2);\n }\n }\n }\n return this.result;\n }\n then(onFulfilled, onRejected) {\n if (process.env.NODE_ENV !== \"production\") {\n if (!(\"from\" in this.opts)) {\n warnOnce$1(\n \"Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.\"\n );\n }\n }\n return this.async().then(onFulfilled, onRejected);\n }\n toString() {\n return this.css;\n }\n visitSync(visitors, node2) {\n for (let [plugin22, visitor] of visitors) {\n this.result.lastPlugin = plugin22;\n let promise;\n try {\n promise = visitor(node2, this.helpers);\n } catch (e2) {\n throw this.handleError(e2, node2.proxyOf);\n }\n if (node2.type !== \"root\" && node2.type !== \"document\" && !node2.parent) {\n return true;\n }\n if (isPromise(promise)) {\n throw this.getAsyncError();\n }\n }\n }\n visitTick(stack) {\n let visit2 = stack[stack.length - 1];\n let { node: node2, visitors } = visit2;\n if (node2.type !== \"root\" && node2.type !== \"document\" && !node2.parent) {\n stack.pop();\n return;\n }\n if (visitors.length > 0 && visit2.visitorIndex < visitors.length) {\n let [plugin22, visitor] = visitors[visit2.visitorIndex];\n visit2.visitorIndex += 1;\n if (visit2.visitorIndex === visitors.length) {\n visit2.visitors = [];\n visit2.visitorIndex = 0;\n }\n this.result.lastPlugin = plugin22;\n try {\n return visitor(node2.toProxy(), this.helpers);\n } catch (e2) {\n throw this.handleError(e2, node2);\n }\n }\n if (visit2.iterator !== 0) {\n let iterator = visit2.iterator;\n let child;\n while (child = node2.nodes[node2.indexes[iterator]]) {\n node2.indexes[iterator] += 1;\n if (!child[isClean]) {\n child[isClean] = true;\n stack.push(toStack(child));\n return;\n }\n }\n visit2.iterator = 0;\n delete node2.indexes[iterator];\n }\n let events = visit2.events;\n while (visit2.eventIndex < events.length) {\n let event = events[visit2.eventIndex];\n visit2.eventIndex += 1;\n if (event === CHILDREN) {\n if (node2.nodes && node2.nodes.length) {\n node2[isClean] = true;\n visit2.iterator = node2.getIterator();\n }\n return;\n } else if (this.listeners[event]) {\n visit2.visitors = this.listeners[event];\n return;\n }\n }\n stack.pop();\n }\n walkSync(node2) {\n node2[isClean] = true;\n let events = getEvents(node2);\n for (let event of events) {\n if (event === CHILDREN) {\n if (node2.nodes) {\n node2.each((child) => {\n if (!child[isClean]) this.walkSync(child);\n });\n }\n } else {\n let visitors = this.listeners[event];\n if (visitors) {\n if (this.visitSync(visitors, node2.toProxy())) return;\n }\n }\n }\n }\n warnings() {\n return this.sync().warnings();\n }\n get content() {\n return this.stringify().content;\n }\n get css() {\n return this.stringify().css;\n }\n get map() {\n return this.stringify().map;\n }\n get messages() {\n return this.sync().messages;\n }\n get opts() {\n return this.result.opts;\n }\n get processor() {\n return this.result.processor;\n }\n get root() {\n return this.sync().root;\n }\n get [Symbol.toStringTag]() {\n return \"LazyResult\";\n }\n};\nLazyResult$2.registerPostcss = (dependant) => {\n postcss$2 = dependant;\n};\nvar lazyResult = LazyResult$2;\nLazyResult$2.default = LazyResult$2;\nRoot$3.registerLazyResult(LazyResult$2);\nDocument$2.registerLazyResult(LazyResult$2);\nlet MapGenerator22 = mapGenerator;\nlet stringify$1 = stringify_1;\nlet warnOnce22 = warnOnce$2;\nlet parse$1 = parse_1;\nconst Result$1 = result;\nlet NoWorkResult$1 = class NoWorkResult2 {\n constructor(processor2, css, opts) {\n css = css.toString();\n this.stringified = false;\n this._processor = processor2;\n this._css = css;\n this._opts = opts;\n this._map = void 0;\n let root2;\n let str = stringify$1;\n this.result = new Result$1(this._processor, root2, this._opts);\n this.result.css = css;\n let self = this;\n Object.defineProperty(this.result, \"root\", {\n get() {\n return self.root;\n }\n });\n let map = new MapGenerator22(str, root2, this._opts, css);\n if (map.isMap()) {\n let [generatedCSS, generatedMap] = map.generate();\n if (generatedCSS) {\n this.result.css = generatedCSS;\n }\n if (generatedMap) {\n this.result.map = generatedMap;\n }\n } else {\n map.clearAnnotation();\n this.result.css = map.css;\n }\n }\n async() {\n if (this.error) return Promise.reject(this.error);\n return Promise.resolve(this.result);\n }\n catch(onRejected) {\n return this.async().catch(onRejected);\n }\n finally(onFinally) {\n return this.async().then(onFinally, onFinally);\n }\n sync() {\n if (this.error) throw this.error;\n return this.result;\n }\n then(onFulfilled, onRejected) {\n if (process.env.NODE_ENV !== \"production\") {\n if (!(\"from\" in this._opts)) {\n warnOnce22(\n \"Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.\"\n );\n }\n }\n return this.async().then(onFulfilled, onRejected);\n }\n toString() {\n return this._css;\n }\n warnings() {\n return [];\n }\n get content() {\n return this.result.css;\n }\n get css() {\n return this.result.css;\n }\n get map() {\n return this.result.map;\n }\n get messages() {\n return [];\n }\n get opts() {\n return this.result.opts;\n }\n get processor() {\n return this.result.processor;\n }\n get root() {\n if (this._root) {\n return this._root;\n }\n let root2;\n let parser2 = parse$1;\n try {\n root2 = parser2(this._css, this._opts);\n } catch (error) {\n this.error = error;\n }\n if (this.error) {\n throw this.error;\n } else {\n this._root = root2;\n return root2;\n }\n }\n get [Symbol.toStringTag]() {\n return \"NoWorkResult\";\n }\n};\nvar noWorkResult = NoWorkResult$1;\nNoWorkResult$1.default = NoWorkResult$1;\nlet NoWorkResult22 = noWorkResult;\nlet LazyResult$1 = lazyResult;\nlet Document$1 = document$1;\nlet Root$2 = root;\nlet Processor$1 = class Processor2 {\n constructor(plugins = []) {\n this.version = \"8.4.38\";\n this.plugins = this.normalize(plugins);\n }\n normalize(plugins) {\n let normalized = [];\n for (let i2 of plugins) {\n if (i2.postcss === true) {\n i2 = i2();\n } else if (i2.postcss) {\n i2 = i2.postcss;\n }\n if (typeof i2 === \"object\" && Array.isArray(i2.plugins)) {\n normalized = normalized.concat(i2.plugins);\n } else if (typeof i2 === \"object\" && i2.postcssPlugin) {\n normalized.push(i2);\n } else if (typeof i2 === \"function\") {\n normalized.push(i2);\n } else if (typeof i2 === \"object\" && (i2.parse || i2.stringify)) {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(\n \"PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.\"\n );\n }\n } else {\n throw new Error(i2 + \" is not a PostCSS plugin\");\n }\n }\n return normalized;\n }\n process(css, opts = {}) {\n if (!this.plugins.length && !opts.parser && !opts.stringifier && !opts.syntax) {\n return new NoWorkResult22(this, css, opts);\n } else {\n return new LazyResult$1(this, css, opts);\n }\n }\n use(plugin22) {\n this.plugins = this.plugins.concat(this.normalize([plugin22]));\n return this;\n }\n};\nvar processor = Processor$1;\nProcessor$1.default = Processor$1;\nRoot$2.registerProcessor(Processor$1);\nDocument$1.registerProcessor(Processor$1);\nlet Declaration$1 = declaration;\nlet PreviousMap22 = previousMap;\nlet Comment$1 = comment;\nlet AtRule$1 = atRule;\nlet Input$1 = input;\nlet Root$1 = root;\nlet Rule$1 = rule;\nfunction fromJSON$1(json, inputs) {\n if (Array.isArray(json)) return json.map((n2) => fromJSON$1(n2));\n let { inputs: ownInputs, ...defaults } = json;\n if (ownInputs) {\n inputs = [];\n for (let input2 of ownInputs) {\n let inputHydrated = { ...input2, __proto__: Input$1.prototype };\n if (inputHydrated.map) {\n inputHydrated.map = {\n ...inputHydrated.map,\n __proto__: PreviousMap22.prototype\n };\n }\n inputs.push(inputHydrated);\n }\n }\n if (defaults.nodes) {\n defaults.nodes = json.nodes.map((n2) => fromJSON$1(n2, inputs));\n }\n if (defaults.source) {\n let { inputId, ...source } = defaults.source;\n defaults.source = source;\n if (inputId != null) {\n defaults.source.input = inputs[inputId];\n }\n }\n if (defaults.type === \"root\") {\n return new Root$1(defaults);\n } else if (defaults.type === \"decl\") {\n return new Declaration$1(defaults);\n } else if (defaults.type === \"rule\") {\n return new Rule$1(defaults);\n } else if (defaults.type === \"comment\") {\n return new Comment$1(defaults);\n } else if (defaults.type === \"atrule\") {\n return new AtRule$1(defaults);\n } else {\n throw new Error(\"Unknown node type: \" + json.type);\n }\n}\nvar fromJSON_1 = fromJSON$1;\nfromJSON$1.default = fromJSON$1;\nlet CssSyntaxError22 = cssSyntaxError;\nlet Declaration22 = declaration;\nlet LazyResult22 = lazyResult;\nlet Container22 = container;\nlet Processor22 = processor;\nlet stringify = stringify_1;\nlet fromJSON = fromJSON_1;\nlet Document222 = document$1;\nlet Warning22 = warning;\nlet Comment22 = comment;\nlet AtRule22 = atRule;\nlet Result22 = result;\nlet Input22 = input;\nlet parse = parse_1;\nlet list = list_1;\nlet Rule22 = rule;\nlet Root22 = root;\nlet Node22 = node;\nfunction postcss(...plugins) {\n if (plugins.length === 1 && Array.isArray(plugins[0])) {\n plugins = plugins[0];\n }\n return new Processor22(plugins);\n}\npostcss.plugin = function plugin2(name, initializer) {\n let warningPrinted = false;\n function creator(...args) {\n if (console && console.warn && !warningPrinted) {\n warningPrinted = true;\n console.warn(\n name + \": postcss.plugin was deprecated. Migration guide:\\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration\"\n );\n if (process.env.LANG && process.env.LANG.startsWith(\"cn\")) {\n console.warn(\n name + \": 里面 postcss.plugin 被弃用. 迁移指南:\\nhttps://www.w3ctech.com/topic/2226\"\n );\n }\n }\n let transformer = initializer(...args);\n transformer.postcssPlugin = name;\n transformer.postcssVersion = new Processor22().version;\n return transformer;\n }\n let cache;\n Object.defineProperty(creator, \"postcss\", {\n get() {\n if (!cache) cache = creator();\n return cache;\n }\n });\n creator.process = function(css, processOpts, pluginOpts) {\n return postcss([creator(pluginOpts)]).process(css, processOpts);\n };\n return creator;\n};\npostcss.stringify = stringify;\npostcss.parse = parse;\npostcss.fromJSON = fromJSON;\npostcss.list = list;\npostcss.comment = (defaults) => new Comment22(defaults);\npostcss.atRule = (defaults) => new AtRule22(defaults);\npostcss.decl = (defaults) => new Declaration22(defaults);\npostcss.rule = (defaults) => new Rule22(defaults);\npostcss.root = (defaults) => new Root22(defaults);\npostcss.document = (defaults) => new Document222(defaults);\npostcss.CssSyntaxError = CssSyntaxError22;\npostcss.Declaration = Declaration22;\npostcss.Container = Container22;\npostcss.Processor = Processor22;\npostcss.Document = Document222;\npostcss.Comment = Comment22;\npostcss.Warning = Warning22;\npostcss.AtRule = AtRule22;\npostcss.Result = Result22;\npostcss.Input = Input22;\npostcss.Rule = Rule22;\npostcss.Root = Root22;\npostcss.Node = Node22;\nLazyResult22.registerPostcss(postcss);\nvar postcss_1 = postcss;\npostcss.default = postcss;\nconst postcss$1 = /* @__PURE__ */ getDefaultExportFromCjs(postcss_1);\npostcss$1.stringify;\npostcss$1.fromJSON;\npostcss$1.plugin;\npostcss$1.parse;\npostcss$1.list;\npostcss$1.document;\npostcss$1.comment;\npostcss$1.atRule;\npostcss$1.rule;\npostcss$1.decl;\npostcss$1.root;\npostcss$1.CssSyntaxError;\npostcss$1.Declaration;\npostcss$1.Container;\npostcss$1.Processor;\npostcss$1.Document;\npostcss$1.Comment;\npostcss$1.Warning;\npostcss$1.AtRule;\npostcss$1.Result;\npostcss$1.Input;\npostcss$1.Rule;\npostcss$1.Root;\npostcss$1.Node;\nvar NodeType$1 = /* @__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$1 || {});\nfunction parseCSSText(cssText) {\n const res = {};\n const listDelimiter = /;(?![^(]*\\))/g;\n const propertyDelimiter = /:(.+)/;\n const comment2 = /\\/\\*.*?\\*\\//g;\n cssText.replace(comment2, \"\").split(listDelimiter).forEach(function(item) {\n if (item) {\n const tmp = item.split(propertyDelimiter);\n tmp.length > 1 && (res[camelize(tmp[0].trim())] = tmp[1].trim());\n }\n });\n return res;\n}\nfunction toCSSText(style) {\n const properties = [];\n for (const name in style) {\n const value = style[name];\n if (typeof value !== \"string\") continue;\n const normalizedName = hyphenate(name);\n properties.push(`${normalizedName}: ${value};`);\n }\n return properties.join(\" \");\n}\nconst camelizeRE = /-([a-z])/g;\nconst CUSTOM_PROPERTY_REGEX = /^--[a-zA-Z0-9-]+$/;\nconst camelize = (str) => {\n if (CUSTOM_PROPERTY_REGEX.test(str)) return str;\n return str.replace(camelizeRE, (_, c2) => c2 ? c2.toUpperCase() : \"\");\n};\nconst hyphenateRE = /\\B([A-Z])/g;\nconst hyphenate = (str) => {\n return str.replace(hyphenateRE, \"-$1\").toLowerCase();\n};\nclass BaseRRNode {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any\n constructor(..._args) {\n __publicField2(this, \"parentElement\", null);\n __publicField2(this, \"parentNode\", null);\n __publicField2(this, \"ownerDocument\");\n __publicField2(this, \"firstChild\", null);\n __publicField2(this, \"lastChild\", null);\n __publicField2(this, \"previousSibling\", null);\n __publicField2(this, \"nextSibling\", null);\n __publicField2(this, \"ELEMENT_NODE\", 1);\n __publicField2(this, \"TEXT_NODE\", 3);\n __publicField2(this, \"nodeType\");\n __publicField2(this, \"nodeName\");\n __publicField2(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(node2) {\n if (!(node2 instanceof BaseRRNode)) return false;\n else if (node2.ownerDocument !== this.ownerDocument) return false;\n else if (node2 === this) return true;\n while (node2.parentNode) {\n if (node2.parentNode === this) return true;\n node2 = node2.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}\nclass BaseRRDocument extends BaseRRNode {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n constructor(...args) {\n super(args);\n __publicField2(this, \"nodeType\", 9);\n __publicField2(this, \"nodeName\", \"#document\");\n __publicField2(this, \"compatMode\", \"CSS1Compat\");\n __publicField2(this, \"RRNodeType\", NodeType$1.Document);\n __publicField2(this, \"textContent\", null);\n this.ownerDocument = this;\n }\n get documentElement() {\n return this.childNodes.find(\n (node2) => node2.RRNodeType === NodeType$1.Element && node2.tagName === \"HTML\"\n ) || null;\n }\n get body() {\n var _a2;\n return ((_a2 = this.documentElement) == null ? void 0 : _a2.childNodes.find(\n (node2) => node2.RRNodeType === NodeType$1.Element && node2.tagName === \"BODY\"\n )) || null;\n }\n get head() {\n var _a2;\n return ((_a2 = this.documentElement) == null ? void 0 : _a2.childNodes.find(\n (node2) => node2.RRNodeType === NodeType$1.Element && node2.tagName === \"HEAD\"\n )) || null;\n }\n get implementation() {\n return this;\n }\n get firstElementChild() {\n return this.documentElement;\n }\n appendChild(newChild) {\n const nodeType = newChild.RRNodeType;\n if (nodeType === NodeType$1.Element || nodeType === NodeType$1.DocumentType) {\n if (this.childNodes.some((s2) => s2.RRNodeType === nodeType)) {\n throw new Error(\n `RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${nodeType === NodeType$1.Element ? \"RRElement\" : \"RRDoctype\"} on RRDocument allowed.`\n );\n }\n }\n const child = appendChild(this, newChild);\n child.parentElement = null;\n return child;\n }\n insertBefore(newChild, refChild) {\n const nodeType = newChild.RRNodeType;\n if (nodeType === NodeType$1.Element || nodeType === NodeType$1.DocumentType) {\n if (this.childNodes.some((s2) => s2.RRNodeType === nodeType)) {\n throw new Error(\n `RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${nodeType === NodeType$1.Element ? \"RRElement\" : \"RRDoctype\"} on RRDocument allowed.`\n );\n }\n }\n const child = insertBefore(this, newChild, refChild);\n child.parentElement = null;\n return child;\n }\n removeChild(node2) {\n return removeChild(this, node2);\n }\n open() {\n this.firstChild = null;\n this.lastChild = null;\n }\n close() {\n }\n /**\n * Adhoc implementation for setting xhtml namespace in rebuilt.ts (rrweb-snapshot).\n * There are two lines used this function:\n * 1. doc.write('\\<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"\"\\>')\n * 2. doc.write('\\<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"\"\\>')\n */\n write(content) {\n let publicId;\n if (content === '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"\">')\n publicId = \"-//W3C//DTD XHTML 1.0 Transitional//EN\";\n else if (content === '<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"\">')\n publicId = \"-//W3C//DTD HTML 4.0 Transitional//EN\";\n if (publicId) {\n const doctype = this.createDocumentType(\"html\", publicId, \"\");\n this.open();\n this.appendChild(doctype);\n }\n }\n createDocument(_namespace, _qualifiedName, _doctype) {\n return new BaseRRDocument();\n }\n createDocumentType(qualifiedName, publicId, systemId) {\n const doctype = new BaseRRDocumentType(qualifiedName, publicId, systemId);\n doctype.ownerDocument = this;\n return doctype;\n }\n createElement(tagName) {\n const element = new BaseRRElement(tagName);\n element.ownerDocument = this;\n return element;\n }\n createElementNS(_namespaceURI, qualifiedName) {\n return this.createElement(qualifiedName);\n }\n createTextNode(data) {\n const text = new BaseRRText(data);\n text.ownerDocument = this;\n return text;\n }\n createComment(data) {\n const comment2 = new BaseRRComment(data);\n comment2.ownerDocument = this;\n return comment2;\n }\n createCDATASection(data) {\n const CDATASection = new BaseRRCDATASection(data);\n CDATASection.ownerDocument = this;\n return CDATASection;\n }\n toString() {\n return \"RRDocument\";\n }\n}\nclass BaseRRDocumentType extends BaseRRNode {\n constructor(qualifiedName, publicId, systemId) {\n super();\n __publicField2(this, \"nodeType\", 10);\n __publicField2(this, \"RRNodeType\", NodeType$1.DocumentType);\n __publicField2(this, \"name\");\n __publicField2(this, \"publicId\");\n __publicField2(this, \"systemId\");\n __publicField2(this, \"textContent\", null);\n this.name = qualifiedName;\n this.publicId = publicId;\n this.systemId = systemId;\n this.nodeName = qualifiedName;\n }\n toString() {\n return \"RRDocumentType\";\n }\n}\nclass BaseRRElement extends BaseRRNode {\n constructor(tagName) {\n super();\n __publicField2(this, \"nodeType\", 1);\n __publicField2(this, \"RRNodeType\", NodeType$1.Element);\n __publicField2(this, \"tagName\");\n __publicField2(this, \"attributes\", {});\n __publicField2(this, \"shadowRoot\", null);\n __publicField2(this, \"scrollLeft\");\n __publicField2(this, \"scrollTop\");\n this.tagName = tagName.toUpperCase();\n this.nodeName = tagName.toUpperCase();\n }\n get textContent() {\n let result2 = \"\";\n this.childNodes.forEach((node2) => result2 += node2.textContent);\n return result2;\n }\n set textContent(textContent2) {\n this.firstChild = null;\n this.lastChild = null;\n this.appendChild(this.ownerDocument.createTextNode(textContent2));\n }\n get classList() {\n return new ClassList(\n this.attributes.class,\n (newClassName) => {\n this.attributes.class = newClassName;\n }\n );\n }\n get id() {\n return this.attributes.id || \"\";\n }\n get className() {\n return this.attributes.class || \"\";\n }\n get style() {\n const style = this.attributes.style ? parseCSSText(this.attributes.style) : {};\n const hyphenateRE2 = /\\B([A-Z])/g;\n style.setProperty = (name, value, priority) => {\n if (hyphenateRE2.test(name)) return;\n const normalizedName = camelize(name);\n if (!value) delete style[normalizedName];\n else style[normalizedName] = value;\n if (priority === \"important\") style[normalizedName] += \" !important\";\n this.attributes.style = toCSSText(style);\n };\n style.removeProperty = (name) => {\n if (hyphenateRE2.test(name)) return \"\";\n const normalizedName = camelize(name);\n const value = style[normalizedName] || \"\";\n delete style[normalizedName];\n this.attributes.style = toCSSText(style);\n return value;\n };\n return style;\n }\n getAttribute(name) {\n if (this.attributes[name] === void 0) return null;\n return this.attributes[name];\n }\n setAttribute(name, attribute) {\n this.attributes[name] = attribute;\n }\n setAttributeNS(_namespace, qualifiedName, value) {\n this.setAttribute(qualifiedName, value);\n }\n removeAttribute(name) {\n delete this.attributes[name];\n }\n appendChild(newChild) {\n return appendChild(this, newChild);\n }\n insertBefore(newChild, refChild) {\n return insertBefore(this, newChild, refChild);\n }\n removeChild(node2) {\n return removeChild(this, node2);\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n attachShadow(_init) {\n const shadowRoot2 = this.ownerDocument.createElement(\"SHADOWROOT\");\n this.shadowRoot = shadowRoot2;\n return shadowRoot2;\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n dispatchEvent(_event) {\n return true;\n }\n toString() {\n let attributeString = \"\";\n for (const attribute in this.attributes) {\n attributeString += `${attribute}=\"${this.attributes[attribute]}\" `;\n }\n return `${this.tagName} ${attributeString}`;\n }\n}\nclass BaseRRMediaElement extends BaseRRElement {\n constructor() {\n super(...arguments);\n __publicField2(this, \"currentTime\");\n __publicField2(this, \"volume\");\n __publicField2(this, \"paused\");\n __publicField2(this, \"muted\");\n __publicField2(this, \"playbackRate\");\n __publicField2(this, \"loop\");\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n attachShadow(_init) {\n throw new Error(\n `RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow`\n );\n }\n play() {\n this.paused = false;\n }\n pause() {\n this.paused = true;\n }\n}\nclass BaseRRDialogElement extends BaseRRElement {\n constructor() {\n super(...arguments);\n __publicField2(this, \"tagName\", \"DIALOG\");\n __publicField2(this, \"nodeName\", \"DIALOG\");\n }\n get isModal() {\n return this.getAttribute(\"rr_open_mode\") === \"modal\";\n }\n get open() {\n return this.getAttribute(\"open\") !== null;\n }\n close() {\n this.removeAttribute(\"open\");\n this.removeAttribute(\"rr_open_mode\");\n }\n show() {\n this.setAttribute(\"open\", \"\");\n this.setAttribute(\"rr_open_mode\", \"non-modal\");\n }\n showModal() {\n this.setAttribute(\"open\", \"\");\n this.setAttribute(\"rr_open_mode\", \"modal\");\n }\n}\nclass BaseRRText extends BaseRRNode {\n constructor(data) {\n super();\n __publicField2(this, \"nodeType\", 3);\n __publicField2(this, \"nodeName\", \"#text\");\n __publicField2(this, \"RRNodeType\", NodeType$1.Text);\n __publicField2(this, \"data\");\n this.data = data;\n }\n get textContent() {\n return this.data;\n }\n set textContent(textContent2) {\n this.data = textContent2;\n }\n toString() {\n return `RRText text=${JSON.stringify(this.data)}`;\n }\n}\nclass BaseRRComment extends BaseRRNode {\n constructor(data) {\n super();\n __publicField2(this, \"nodeType\", 8);\n __publicField2(this, \"nodeName\", \"#comment\");\n __publicField2(this, \"RRNodeType\", NodeType$1.Comment);\n __publicField2(this, \"data\");\n this.data = data;\n }\n get textContent() {\n return this.data;\n }\n set textContent(textContent2) {\n this.data = textContent2;\n }\n toString() {\n return `RRComment text=${JSON.stringify(this.data)}`;\n }\n}\nclass BaseRRCDATASection extends BaseRRNode {\n constructor(data) {\n super();\n __publicField2(this, \"nodeName\", \"#cdata-section\");\n __publicField2(this, \"nodeType\", 4);\n __publicField2(this, \"RRNodeType\", NodeType$1.CDATA);\n __publicField2(this, \"data\");\n this.data = data;\n }\n get textContent() {\n return this.data;\n }\n set textContent(textContent2) {\n this.data = textContent2;\n }\n toString() {\n return `RRCDATASection data=${JSON.stringify(this.data)}`;\n }\n}\nclass ClassList {\n constructor(classText, onChange) {\n __publicField2(this, \"onChange\");\n __publicField2(this, \"classes\", []);\n __publicField2(this, \"add\", (...classNames) => {\n for (const item of classNames) {\n const className = String(item);\n if (this.classes.indexOf(className) >= 0) continue;\n this.classes.push(className);\n }\n this.onChange && this.onChange(this.classes.join(\" \"));\n });\n __publicField2(this, \"remove\", (...classNames) => {\n this.classes = this.classes.filter(\n (item) => classNames.indexOf(item) === -1\n );\n this.onChange && this.onChange(this.classes.join(\" \"));\n });\n if (classText) {\n const classes = classText.trim().split(/\\s+/);\n this.classes.push(...classes);\n }\n this.onChange = onChange;\n }\n}\nfunction appendChild(parent, newChild) {\n if (newChild.parentNode) newChild.parentNode.removeChild(newChild);\n if (parent.lastChild) {\n parent.lastChild.nextSibling = newChild;\n newChild.previousSibling = parent.lastChild;\n } else {\n parent.firstChild = newChild;\n newChild.previousSibling = null;\n }\n parent.lastChild = newChild;\n newChild.nextSibling = null;\n newChild.parentNode = parent;\n newChild.parentElement = parent;\n newChild.ownerDocument = parent.ownerDocument;\n return newChild;\n}\nfunction insertBefore(parent, newChild, refChild) {\n if (!refChild) return appendChild(parent, newChild);\n if (refChild.parentNode !== parent)\n throw new Error(\n \"Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.\"\n );\n if (newChild === refChild) return newChild;\n if (newChild.parentNode) newChild.parentNode.removeChild(newChild);\n newChild.previousSibling = refChild.previousSibling;\n refChild.previousSibling = newChild;\n newChild.nextSibling = refChild;\n if (newChild.previousSibling) newChild.previousSibling.nextSibling = newChild;\n else parent.firstChild = newChild;\n newChild.parentElement = parent;\n newChild.parentNode = parent;\n newChild.ownerDocument = parent.ownerDocument;\n return newChild;\n}\nfunction removeChild(parent, child) {\n if (child.parentNode !== parent)\n throw new Error(\n \"Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode.\"\n );\n if (child.previousSibling)\n child.previousSibling.nextSibling = child.nextSibling;\n else parent.firstChild = child.nextSibling;\n if (child.nextSibling)\n child.nextSibling.previousSibling = child.previousSibling;\n else parent.lastChild = child.previousSibling;\n child.previousSibling = null;\n child.nextSibling = null;\n child.parentElement = null;\n child.parentNode = null;\n return child;\n}\nvar NodeType$2 = /* @__PURE__ */ ((NodeType2) => {\n NodeType2[NodeType2[\"PLACEHOLDER\"] = 0] = \"PLACEHOLDER\";\n NodeType2[NodeType2[\"ELEMENT_NODE\"] = 1] = \"ELEMENT_NODE\";\n NodeType2[NodeType2[\"ATTRIBUTE_NODE\"] = 2] = \"ATTRIBUTE_NODE\";\n NodeType2[NodeType2[\"TEXT_NODE\"] = 3] = \"TEXT_NODE\";\n NodeType2[NodeType2[\"CDATA_SECTION_NODE\"] = 4] = \"CDATA_SECTION_NODE\";\n NodeType2[NodeType2[\"ENTITY_REFERENCE_NODE\"] = 5] = \"ENTITY_REFERENCE_NODE\";\n NodeType2[NodeType2[\"ENTITY_NODE\"] = 6] = \"ENTITY_NODE\";\n NodeType2[NodeType2[\"PROCESSING_INSTRUCTION_NODE\"] = 7] = \"PROCESSING_INSTRUCTION_NODE\";\n NodeType2[NodeType2[\"COMMENT_NODE\"] = 8] = \"COMMENT_NODE\";\n NodeType2[NodeType2[\"DOCUMENT_NODE\"] = 9] = \"DOCUMENT_NODE\";\n NodeType2[NodeType2[\"DOCUMENT_TYPE_NODE\"] = 10] = \"DOCUMENT_TYPE_NODE\";\n NodeType2[NodeType2[\"DOCUMENT_FRAGMENT_NODE\"] = 11] = \"DOCUMENT_FRAGMENT_NODE\";\n return NodeType2;\n})(NodeType$2 || {});\nconst NAMESPACES = {\n svg: \"http://www.w3.org/2000/svg\",\n \"xlink:href\": \"http://www.w3.org/1999/xlink\",\n xmlns: \"http://www.w3.org/2000/xmlns/\"\n};\nconst SVGTagMap = {\n altglyph: \"altGlyph\",\n altglyphdef: \"altGlyphDef\",\n altglyphitem: \"altGlyphItem\",\n animatecolor: \"animateColor\",\n animatemotion: \"animateMotion\",\n animatetransform: \"animateTransform\",\n clippath: \"clipPath\",\n feblend: \"feBlend\",\n fecolormatrix: \"feColorMatrix\",\n fecomponenttransfer: \"feComponentTransfer\",\n fecomposite: \"feComposite\",\n feconvolvematrix: \"feConvolveMatrix\",\n fediffuselighting: \"feDiffuseLighting\",\n fedisplacementmap: \"feDisplacementMap\",\n fedistantlight: \"feDistantLight\",\n fedropshadow: \"feDropShadow\",\n feflood: \"feFlood\",\n fefunca: \"feFuncA\",\n fefuncb: \"feFuncB\",\n fefuncg: \"feFuncG\",\n fefuncr: \"feFuncR\",\n fegaussianblur: \"feGaussianBlur\",\n feimage: \"feImage\",\n femerge: \"feMerge\",\n femergenode: \"feMergeNode\",\n femorphology: \"feMorphology\",\n feoffset: \"feOffset\",\n fepointlight: \"fePointLight\",\n fespecularlighting: \"feSpecularLighting\",\n fespotlight: \"feSpotLight\",\n fetile: \"feTile\",\n feturbulence: \"feTurbulence\",\n foreignobject: \"foreignObject\",\n glyphref: \"glyphRef\",\n lineargradient: \"linearGradient\",\n radialgradient: \"radialGradient\"\n};\nlet createdNodeSet = null;\nfunction diff(oldTree, newTree, replayer, rrnodeMirror = newTree.mirror || newTree.ownerDocument.mirror) {\n oldTree = diffBeforeUpdatingChildren(\n oldTree,\n newTree,\n replayer,\n rrnodeMirror\n );\n diffChildren(oldTree, newTree, replayer, rrnodeMirror);\n diffAfterUpdatingChildren(oldTree, newTree, replayer);\n}\nfunction diffBeforeUpdatingChildren(oldTree, newTree, replayer, rrnodeMirror) {\n var _a2;\n if (replayer.afterAppend && !createdNodeSet) {\n createdNodeSet = /* @__PURE__ */ new WeakSet();\n setTimeout(() => {\n createdNodeSet = null;\n }, 0);\n }\n if (!sameNodeType(oldTree, newTree)) {\n const calibratedOldTree = createOrGetNode(\n newTree,\n replayer.mirror,\n rrnodeMirror\n );\n (_a2 = oldTree.parentNode) == null ? void 0 : _a2.replaceChild(calibratedOldTree, oldTree);\n oldTree = calibratedOldTree;\n }\n switch (newTree.RRNodeType) {\n case NodeType$1.Document: {\n if (!nodeMatching(oldTree, newTree, replayer.mirror, rrnodeMirror)) {\n const newMeta = rrnodeMirror.getMeta(newTree);\n if (newMeta) {\n replayer.mirror.removeNodeFromMap(oldTree);\n oldTree.close();\n oldTree.open();\n replayer.mirror.add(oldTree, newMeta);\n createdNodeSet == null ? void 0 : createdNodeSet.add(oldTree);\n }\n }\n break;\n }\n case NodeType$1.Element: {\n const oldElement = oldTree;\n const newRRElement = newTree;\n switch (newRRElement.tagName) {\n case \"IFRAME\": {\n const oldContentDocument = oldTree.contentDocument;\n if (!oldContentDocument) break;\n diff(\n oldContentDocument,\n newTree.contentDocument,\n replayer,\n rrnodeMirror\n );\n break;\n }\n }\n if (newRRElement.shadowRoot) {\n if (!oldElement.shadowRoot) oldElement.attachShadow({ mode: \"open\" });\n diffChildren(\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n oldElement.shadowRoot,\n newRRElement.shadowRoot,\n replayer,\n rrnodeMirror\n );\n }\n diffProps(oldElement, newRRElement, rrnodeMirror);\n break;\n }\n }\n return oldTree;\n}\nfunction diffAfterUpdatingChildren(oldTree, newTree, replayer) {\n var _a2;\n switch (newTree.RRNodeType) {\n case NodeType$1.Document: {\n const scrollData = newTree.scrollData;\n scrollData && replayer.applyScroll(scrollData, true);\n break;\n }\n case NodeType$1.Element: {\n const oldElement = oldTree;\n const newRRElement = newTree;\n newRRElement.scrollData && replayer.applyScroll(newRRElement.scrollData, true);\n newRRElement.inputData && replayer.applyInput(newRRElement.inputData);\n switch (newRRElement.tagName) {\n case \"AUDIO\":\n case \"VIDEO\": {\n const oldMediaElement = oldTree;\n const newMediaRRElement = newRRElement;\n if (newMediaRRElement.paused !== void 0)\n newMediaRRElement.paused ? void oldMediaElement.pause() : void oldMediaElement.play();\n if (newMediaRRElement.muted !== void 0)\n oldMediaElement.muted = newMediaRRElement.muted;\n if (newMediaRRElement.volume !== void 0)\n oldMediaElement.volume = newMediaRRElement.volume;\n if (newMediaRRElement.currentTime !== void 0)\n oldMediaElement.currentTime = newMediaRRElement.currentTime;\n if (newMediaRRElement.playbackRate !== void 0)\n oldMediaElement.playbackRate = newMediaRRElement.playbackRate;\n if (newMediaRRElement.loop !== void 0)\n oldMediaElement.loop = newMediaRRElement.loop;\n break;\n }\n case \"CANVAS\": {\n const rrCanvasElement = newTree;\n if (rrCanvasElement.rr_dataURL !== null) {\n const image = document.createElement(\"img\");\n image.onload = () => {\n const ctx = oldElement.getContext(\"2d\");\n if (ctx) {\n ctx.drawImage(image, 0, 0, image.width, image.height);\n }\n };\n image.src = rrCanvasElement.rr_dataURL;\n }\n rrCanvasElement.canvasMutations.forEach(\n (canvasMutation2) => replayer.applyCanvas(\n canvasMutation2.event,\n canvasMutation2.mutation,\n oldTree\n )\n );\n break;\n }\n case \"STYLE\": {\n const styleSheet = oldElement.sheet;\n styleSheet && newTree.rules.forEach(\n (data) => replayer.applyStyleSheetMutation(data, styleSheet)\n );\n break;\n }\n case \"DIALOG\": {\n const dialog = oldElement;\n const rrDialog = newRRElement;\n const wasOpen = dialog.open;\n const wasModal = dialog.matches(\"dialog:modal\");\n const shouldBeOpen = rrDialog.open;\n const shouldBeModal = rrDialog.isModal;\n const modalChanged = wasModal !== shouldBeModal;\n const openChanged = wasOpen !== shouldBeOpen;\n if (modalChanged || wasOpen && openChanged) dialog.close();\n if (shouldBeOpen && (openChanged || modalChanged)) {\n try {\n if (shouldBeModal) dialog.showModal();\n else dialog.show();\n } catch (e2) {\n console.warn(e2);\n }\n }\n break;\n }\n }\n break;\n }\n case NodeType$1.Text:\n case NodeType$1.Comment:\n case NodeType$1.CDATA: {\n if (oldTree.textContent !== newTree.data)\n oldTree.textContent = newTree.data;\n break;\n }\n }\n if (createdNodeSet == null ? void 0 : createdNodeSet.has(oldTree)) {\n createdNodeSet.delete(oldTree);\n (_a2 = replayer.afterAppend) == null ? void 0 : _a2.call(replayer, oldTree, replayer.mirror.getId(oldTree));\n }\n}\nfunction diffProps(oldTree, newTree, rrnodeMirror) {\n const oldAttributes = oldTree.attributes;\n const newAttributes = newTree.attributes;\n for (const name in newAttributes) {\n const newValue = newAttributes[name];\n const sn = rrnodeMirror.getMeta(newTree);\n if ((sn == null ? void 0 : sn.isSVG) && NAMESPACES[name])\n oldTree.setAttributeNS(NAMESPACES[name], name, newValue);\n else if (newTree.tagName === \"CANVAS\" && name === \"rr_dataURL\") {\n const image = document.createElement(\"img\");\n image.src = newValue;\n image.onload = () => {\n const ctx = oldTree.getContext(\"2d\");\n if (ctx) {\n ctx.drawImage(image, 0, 0, image.width, image.height);\n }\n };\n } else if (newTree.tagName === \"IFRAME\" && name === \"srcdoc\") continue;\n else {\n try {\n oldTree.setAttribute(name, newValue);\n } catch (err) {\n console.warn(err);\n }\n }\n }\n for (const { name } of Array.from(oldAttributes))\n if (!(name in newAttributes)) oldTree.removeAttribute(name);\n newTree.scrollLeft && (oldTree.scrollLeft = newTree.scrollLeft);\n newTree.scrollTop && (oldTree.scrollTop = newTree.scrollTop);\n}\nfunction diffChildren(oldTree, newTree, replayer, rrnodeMirror) {\n const oldChildren = Array.from(oldTree.childNodes);\n const newChildren = newTree.childNodes;\n if (oldChildren.length === 0 && newChildren.length === 0) return;\n let oldStartIndex = 0, oldEndIndex = oldChildren.length - 1, newStartIndex = 0, newEndIndex = newChildren.length - 1;\n let oldStartNode = oldChildren[oldStartIndex], oldEndNode = oldChildren[oldEndIndex], newStartNode = newChildren[newStartIndex], newEndNode = newChildren[newEndIndex];\n let oldIdToIndex = void 0, indexInOld = void 0;\n while (oldStartIndex <= oldEndIndex && newStartIndex <= newEndIndex) {\n if (oldStartNode === void 0) {\n oldStartNode = oldChildren[++oldStartIndex];\n } else if (oldEndNode === void 0) {\n oldEndNode = oldChildren[--oldEndIndex];\n } else if (\n // same first node?\n nodeMatching(oldStartNode, newStartNode, replayer.mirror, rrnodeMirror)\n ) {\n oldStartNode = oldChildren[++oldStartIndex];\n newStartNode = newChildren[++newStartIndex];\n } else if (\n // same last node?\n nodeMatching(oldEndNode, newEndNode, replayer.mirror, rrnodeMirror)\n ) {\n oldEndNode = oldChildren[--oldEndIndex];\n newEndNode = newChildren[--newEndIndex];\n } else if (\n // is the first old node the same as the last new node?\n nodeMatching(oldStartNode, newEndNode, replayer.mirror, rrnodeMirror)\n ) {\n try {\n oldTree.insertBefore(oldStartNode, oldEndNode.nextSibling);\n } catch (e2) {\n console.warn(e2);\n }\n oldStartNode = oldChildren[++oldStartIndex];\n newEndNode = newChildren[--newEndIndex];\n } else if (\n // is the last old node the same as the first new node?\n nodeMatching(oldEndNode, newStartNode, replayer.mirror, rrnodeMirror)\n ) {\n try {\n oldTree.insertBefore(oldEndNode, oldStartNode);\n } catch (e2) {\n console.warn(e2);\n }\n oldEndNode = oldChildren[--oldEndIndex];\n newStartNode = newChildren[++newStartIndex];\n } else {\n if (!oldIdToIndex) {\n oldIdToIndex = {};\n for (let i2 = oldStartIndex; i2 <= oldEndIndex; i2++) {\n const oldChild2 = oldChildren[i2];\n if (oldChild2 && replayer.mirror.hasNode(oldChild2))\n oldIdToIndex[replayer.mirror.getId(oldChild2)] = i2;\n }\n }\n indexInOld = oldIdToIndex[rrnodeMirror.getId(newStartNode)];\n const nodeToMove = oldChildren[indexInOld];\n if (indexInOld !== void 0 && nodeToMove && nodeMatching(nodeToMove, newStartNode, replayer.mirror, rrnodeMirror)) {\n try {\n oldTree.insertBefore(nodeToMove, oldStartNode);\n } catch (e2) {\n console.warn(e2);\n }\n oldChildren[indexInOld] = void 0;\n } else {\n const newNode = createOrGetNode(\n newStartNode,\n replayer.mirror,\n rrnodeMirror\n );\n if (oldTree.nodeName === \"#document\" && oldStartNode && /**\n * Special case 1: one document isn't allowed to have two doctype nodes at the same time, so we need to remove the old one first before inserting the new one.\n * How this case happens: A parent document in the old tree already has a doctype node with an id e.g. #1. A new full snapshot rebuilds the replayer with a new doctype node with another id #2. According to the algorithm, the new doctype node will be inserted before the old one, which is not allowed by the Document standard.\n */\n (newNode.nodeType === newNode.DOCUMENT_TYPE_NODE && oldStartNode.nodeType === oldStartNode.DOCUMENT_TYPE_NODE || /**\n * Special case 2: one document isn't allowed to have two HTMLElements at the same time, so we need to remove the old one first before inserting the new one.\n * How this case happens: A mounted iframe element has an automatically created HTML element. We should delete it before inserting a serialized one. Otherwise, an error 'Only one element on document allowed' will be thrown.\n */\n newNode.nodeType === newNode.ELEMENT_NODE && oldStartNode.nodeType === oldStartNode.ELEMENT_NODE)) {\n oldTree.removeChild(oldStartNode);\n replayer.mirror.removeNodeFromMap(oldStartNode);\n oldStartNode = oldChildren[++oldStartIndex];\n }\n try {\n oldTree.insertBefore(newNode, oldStartNode || null);\n } catch (e2) {\n console.warn(e2);\n }\n }\n newStartNode = newChildren[++newStartIndex];\n }\n }\n if (oldStartIndex > oldEndIndex) {\n const referenceRRNode = newChildren[newEndIndex + 1];\n let referenceNode = null;\n if (referenceRRNode)\n referenceNode = replayer.mirror.getNode(\n rrnodeMirror.getId(referenceRRNode)\n );\n for (; newStartIndex <= newEndIndex; ++newStartIndex) {\n const newNode = createOrGetNode(\n newChildren[newStartIndex],\n replayer.mirror,\n rrnodeMirror\n );\n try {\n oldTree.insertBefore(newNode, referenceNode);\n } catch (e2) {\n console.warn(e2);\n }\n }\n } else if (newStartIndex > newEndIndex) {\n for (; oldStartIndex <= oldEndIndex; oldStartIndex++) {\n const node2 = oldChildren[oldStartIndex];\n if (!node2 || node2.parentNode !== oldTree) continue;\n try {\n oldTree.removeChild(node2);\n replayer.mirror.removeNodeFromMap(node2);\n } catch (e2) {\n console.warn(e2);\n }\n }\n }\n let oldChild = oldTree.firstChild;\n let newChild = newTree.firstChild;\n while (oldChild !== null && newChild !== null) {\n diff(oldChild, newChild, replayer, rrnodeMirror);\n oldChild = oldChild.nextSibling;\n newChild = newChild.nextSibling;\n }\n}\nfunction createOrGetNode(rrNode, domMirror, rrnodeMirror) {\n const nodeId = rrnodeMirror.getId(rrNode);\n const sn = rrnodeMirror.getMeta(rrNode);\n let node2 = null;\n if (nodeId > -1) node2 = domMirror.getNode(nodeId);\n if (node2 !== null && sameNodeType(node2, rrNode)) return node2;\n switch (rrNode.RRNodeType) {\n case NodeType$1.Document:\n node2 = new Document();\n break;\n case NodeType$1.DocumentType:\n node2 = document.implementation.createDocumentType(\n rrNode.name,\n rrNode.publicId,\n rrNode.systemId\n );\n break;\n case NodeType$1.Element: {\n let tagName = rrNode.tagName.toLowerCase();\n tagName = SVGTagMap[tagName] || tagName;\n if (sn && \"isSVG\" in sn && (sn == null ? void 0 : sn.isSVG)) {\n node2 = document.createElementNS(NAMESPACES[\"svg\"], tagName);\n } else node2 = document.createElement(rrNode.tagName);\n break;\n }\n case NodeType$1.Text:\n node2 = document.createTextNode(rrNode.data);\n break;\n case NodeType$1.Comment:\n node2 = document.createComment(rrNode.data);\n break;\n case NodeType$1.CDATA:\n node2 = document.createCDATASection(rrNode.data);\n break;\n }\n if (sn) domMirror.add(node2, { ...sn });\n try {\n createdNodeSet == null ? void 0 : createdNodeSet.add(node2);\n } catch (e2) {\n }\n return node2;\n}\nfunction sameNodeType(node1, node2) {\n if (node1.nodeType !== node2.nodeType) return false;\n return node1.nodeType !== node1.ELEMENT_NODE || node1.tagName.toUpperCase() === node2.tagName;\n}\nfunction nodeMatching(node1, node2, domMirror, rrdomMirror) {\n const node1Id = domMirror.getId(node1);\n const node2Id = rrdomMirror.getId(node2);\n if (node1Id === -1 || node1Id !== node2Id) return false;\n return sameNodeType(node1, node2);\n}\nclass RRDocument extends BaseRRDocument {\n constructor(mirror2) {\n super();\n __publicField2(this, \"UNSERIALIZED_STARTING_ID\", -2);\n __publicField2(this, \"_unserializedId\", this.UNSERIALIZED_STARTING_ID);\n __publicField2(this, \"mirror\", createMirror());\n __publicField2(this, \"scrollData\", null);\n if (mirror2) {\n this.mirror = mirror2;\n }\n }\n /**\n * Every time the id is used, it will minus 1 automatically to avoid collisions.\n */\n get unserializedId() {\n return this._unserializedId--;\n }\n createDocument(_namespace, _qualifiedName, _doctype) {\n return new RRDocument();\n }\n createDocumentType(qualifiedName, publicId, systemId) {\n const documentTypeNode = new RRDocumentType(\n qualifiedName,\n publicId,\n systemId\n );\n documentTypeNode.ownerDocument = this;\n return documentTypeNode;\n }\n createElement(tagName) {\n const upperTagName = tagName.toUpperCase();\n let element;\n switch (upperTagName) {\n case \"AUDIO\":\n case \"VIDEO\":\n element = new RRMediaElement(upperTagName);\n break;\n case \"IFRAME\":\n element = new RRIFrameElement(upperTagName, this.mirror);\n break;\n case \"CANVAS\":\n element = new RRCanvasElement(upperTagName);\n break;\n case \"STYLE\":\n element = new RRStyleElement(upperTagName);\n break;\n case \"DIALOG\":\n element = new RRDialogElement(upperTagName);\n break;\n default:\n element = new RRElement(upperTagName);\n break;\n }\n element.ownerDocument = this;\n return element;\n }\n createComment(data) {\n const commentNode = new RRComment(data);\n commentNode.ownerDocument = this;\n return commentNode;\n }\n createCDATASection(data) {\n const sectionNode = new RRCDATASection(data);\n sectionNode.ownerDocument = this;\n return sectionNode;\n }\n createTextNode(data) {\n const textNode = new RRText(data);\n textNode.ownerDocument = this;\n return textNode;\n }\n destroyTree() {\n this.firstChild = null;\n this.lastChild = null;\n this.mirror.reset();\n }\n open() {\n super.open();\n this._unserializedId = this.UNSERIALIZED_STARTING_ID;\n }\n}\nconst RRDocumentType = BaseRRDocumentType;\nclass RRElement extends BaseRRElement {\n constructor() {\n super(...arguments);\n __publicField2(this, \"inputData\", null);\n __publicField2(this, \"scrollData\", null);\n }\n}\nclass RRMediaElement extends BaseRRMediaElement {\n}\nclass RRDialogElement extends BaseRRDialogElement {\n}\nclass RRCanvasElement extends RRElement {\n constructor() {\n super(...arguments);\n __publicField2(this, \"rr_dataURL\", null);\n __publicField2(this, \"canvasMutations\", []);\n }\n /**\n * This is a dummy implementation to distinguish RRCanvasElement from real HTMLCanvasElement.\n */\n getContext() {\n return null;\n }\n}\nclass RRStyleElement extends RRElement {\n constructor() {\n super(...arguments);\n __publicField2(this, \"rules\", []);\n }\n}\nclass RRIFrameElement extends RRElement {\n constructor(upperTagName, mirror2) {\n super(upperTagName);\n __publicField2(this, \"contentDocument\", new RRDocument());\n this.contentDocument.mirror = mirror2;\n }\n}\nconst RRText = BaseRRText;\nconst RRComment = BaseRRComment;\nconst RRCDATASection = BaseRRCDATASection;\nfunction getValidTagName(element) {\n if (element instanceof HTMLFormElement) {\n return \"FORM\";\n }\n return element.tagName.toUpperCase();\n}\nfunction buildFromNode(node2, rrdom, domMirror, parentRRNode) {\n let rrNode;\n switch (node2.nodeType) {\n case NodeType$2.DOCUMENT_NODE:\n if (parentRRNode && parentRRNode.nodeName === \"IFRAME\")\n rrNode = parentRRNode.contentDocument;\n else {\n rrNode = rrdom;\n rrNode.compatMode = node2.compatMode;\n }\n break;\n case NodeType$2.DOCUMENT_TYPE_NODE: {\n const documentType = node2;\n rrNode = rrdom.createDocumentType(\n documentType.name,\n documentType.publicId,\n documentType.systemId\n );\n break;\n }\n case NodeType$2.ELEMENT_NODE: {\n const elementNode = node2;\n const tagName = getValidTagName(elementNode);\n rrNode = rrdom.createElement(tagName);\n const rrElement = rrNode;\n for (const { name, value } of Array.from(elementNode.attributes)) {\n rrElement.attributes[name] = value;\n }\n elementNode.scrollLeft && (rrElement.scrollLeft = elementNode.scrollLeft);\n elementNode.scrollTop && (rrElement.scrollTop = elementNode.scrollTop);\n break;\n }\n case NodeType$2.TEXT_NODE:\n rrNode = rrdom.createTextNode(node2.textContent || \"\");\n break;\n case NodeType$2.CDATA_SECTION_NODE:\n rrNode = rrdom.createCDATASection(node2.data);\n break;\n case NodeType$2.COMMENT_NODE:\n rrNode = rrdom.createComment(node2.textContent || \"\");\n break;\n case NodeType$2.DOCUMENT_FRAGMENT_NODE:\n rrNode = parentRRNode.attachShadow({ mode: \"open\" });\n break;\n default:\n return null;\n }\n let sn = domMirror.getMeta(node2);\n if (rrdom instanceof RRDocument) {\n if (!sn) {\n sn = getDefaultSN(rrNode, rrdom.unserializedId);\n domMirror.add(node2, sn);\n }\n rrdom.mirror.add(rrNode, { ...sn });\n }\n return rrNode;\n}\nfunction buildFromDom(dom, domMirror = createMirror$1(), rrdom = new RRDocument()) {\n function walk2(node2, parentRRNode) {\n const rrNode = buildFromNode(node2, rrdom, domMirror, parentRRNode);\n if (rrNode === null) return;\n if (\n // if the parentRRNode isn't a RRIFrameElement\n (parentRRNode == null ? void 0 : parentRRNode.nodeName) !== \"IFRAME\" && // if node isn't a shadow root\n node2.nodeType !== NodeType$2.DOCUMENT_FRAGMENT_NODE\n ) {\n parentRRNode == null ? void 0 : parentRRNode.appendChild(rrNode);\n rrNode.parentNode = parentRRNode;\n rrNode.parentElement = parentRRNode;\n }\n if (node2.nodeName === \"IFRAME\") {\n const iframeDoc = node2.contentDocument;\n iframeDoc && walk2(iframeDoc, rrNode);\n } else if (node2.nodeType === NodeType$2.DOCUMENT_NODE || node2.nodeType === NodeType$2.ELEMENT_NODE || node2.nodeType === NodeType$2.DOCUMENT_FRAGMENT_NODE) {\n if (node2.nodeType === NodeType$2.ELEMENT_NODE && node2.shadowRoot)\n walk2(node2.shadowRoot, rrNode);\n node2.childNodes.forEach((childNode) => walk2(childNode, rrNode));\n }\n }\n walk2(dom, null);\n return rrdom;\n}\nfunction createMirror() {\n return new Mirror22();\n}\nclass Mirror22 {\n constructor() {\n __publicField2(this, \"idNodeMap\", /* @__PURE__ */ new Map());\n __publicField2(this, \"nodeMetaMap\", /* @__PURE__ */ new WeakMap());\n }\n getId(n2) {\n var _a2;\n if (!n2) return -1;\n const id = (_a2 = this.getMeta(n2)) == 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(n2) {\n return this.nodeMetaMap.get(n2) || null;\n }\n // removes the node from idNodeMap\n // doesn't remove the node from nodeMetaMap\n removeNodeFromMap(n2) {\n const id = this.getId(n2);\n this.idNodeMap.delete(id);\n if (n2.childNodes) {\n n2.childNodes.forEach((childNode) => this.removeNodeFromMap(childNode));\n }\n }\n has(id) {\n return this.idNodeMap.has(id);\n }\n hasNode(node2) {\n return this.nodeMetaMap.has(node2);\n }\n add(n2, meta) {\n const id = meta.id;\n this.idNodeMap.set(id, n2);\n this.nodeMetaMap.set(n2, meta);\n }\n replace(id, n2) {\n const oldNode = this.getNode(id);\n if (oldNode) {\n const meta = this.nodeMetaMap.get(oldNode);\n if (meta) this.nodeMetaMap.set(n2, meta);\n }\n this.idNodeMap.set(id, n2);\n }\n reset() {\n this.idNodeMap = /* @__PURE__ */ new Map();\n this.nodeMetaMap = /* @__PURE__ */ new WeakMap();\n }\n}\nfunction getDefaultSN(node2, id) {\n switch (node2.RRNodeType) {\n case NodeType$1.Document:\n return {\n id,\n type: node2.RRNodeType,\n childNodes: []\n };\n case NodeType$1.DocumentType: {\n const doctype = node2;\n return {\n id,\n type: node2.RRNodeType,\n name: doctype.name,\n publicId: doctype.publicId,\n systemId: doctype.systemId\n };\n }\n case NodeType$1.Element:\n return {\n id,\n type: node2.RRNodeType,\n tagName: node2.tagName.toLowerCase(),\n // In rrweb data, all tagNames are lowercase.\n attributes: {},\n childNodes: []\n };\n case NodeType$1.Text:\n return {\n id,\n type: node2.RRNodeType,\n textContent: node2.textContent || \"\"\n };\n case NodeType$1.Comment:\n return {\n id,\n type: node2.RRNodeType,\n textContent: node2.textContent || \"\"\n };\n case NodeType$1.CDATA:\n return {\n id,\n type: node2.RRNodeType,\n textContent: \"\"\n };\n }\n}\nconst testableAccessors = {\n Node: [\"childNodes\", \"parentNode\", \"parentElement\", \"textContent\"],\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 childNodes(n2) {\n return getUntaintedAccessor(\"Node\", n2, \"childNodes\");\n}\nfunction parentNode(n2) {\n return getUntaintedAccessor(\"Node\", n2, \"parentNode\");\n}\nfunction parentElement(n2) {\n return getUntaintedAccessor(\"Node\", n2, \"parentElement\");\n}\nfunction textContent(n2) {\n return getUntaintedAccessor(\"Node\", n2, \"textContent\");\n}\nfunction contains(n2, other) {\n return getUntaintedMethod(\"Node\", n2, \"contains\")(other);\n}\nfunction getRootNode(n2) {\n return getUntaintedMethod(\"Node\", n2, \"getRootNode\")();\n}\nfunction host(n2) {\n if (!n2 || !(\"host\" in n2)) return null;\n return getUntaintedAccessor(\"ShadowRoot\", n2, \"host\");\n}\nfunction styleSheets(n2) {\n return n2.styleSheets;\n}\nfunction shadowRoot(n2) {\n if (!n2 || !(\"shadowRoot\" in n2)) return null;\n return getUntaintedAccessor(\"Element\", n2, \"shadowRoot\");\n}\nfunction querySelector(n2, selectors) {\n return getUntaintedAccessor(\"Element\", n2, \"querySelector\")(selectors);\n}\nfunction querySelectorAll(n2, selectors) {\n return getUntaintedAccessor(\"Element\", n2, \"querySelectorAll\")(selectors);\n}\nfunction mutationObserverCtor() {\n return getUntaintedPrototype(\"MutationObserver\").constructor;\n}\nconst index = {\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};\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 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}\nlet nowTimestamp = Date.now;\nif (!/* @__PURE__ */ /[1-9][0-9]{12}/.test(Date.now().toString())) {\n nowTimestamp = () => (/* @__PURE__ */ new Date()).getTime();\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(node2) {\n if (!node2) {\n return null;\n }\n const el = node2.nodeType === node2.ELEMENT_NODE ? node2 : index.parentElement(node2);\n return el;\n}\nfunction isBlocked(node2, blockClass, blockSelector, checkAncestors) {\n if (!node2) {\n return false;\n }\n const el = closestElementOfNode(node2);\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 (e2) {\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(n2, mirror2) {\n return mirror2.getId(n2) !== -1;\n}\nfunction isIgnored(n2, mirror2, slimDOMOptions) {\n if (n2.tagName === \"TITLE\" && slimDOMOptions.headTitleMutations) {\n return true;\n }\n return mirror2.getId(n2) === 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$1(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 queueToResolveTrees(queue) {\n const queueNodeMap = {};\n const putIntoMap = (m, parent) => {\n const nodeInTree = {\n value: m,\n parent,\n children: []\n };\n queueNodeMap[m.node.id] = nodeInTree;\n return nodeInTree;\n };\n const queueNodeTrees = [];\n for (const mutation of queue) {\n const { nextId, parentId } = mutation;\n if (nextId && nextId in queueNodeMap) {\n const nextInTree = queueNodeMap[nextId];\n if (nextInTree.parent) {\n const idx = nextInTree.parent.children.indexOf(nextInTree);\n nextInTree.parent.children.splice(\n idx,\n 0,\n putIntoMap(mutation, nextInTree.parent)\n );\n } else {\n const idx = queueNodeTrees.indexOf(nextInTree);\n queueNodeTrees.splice(idx, 0, putIntoMap(mutation, null));\n }\n continue;\n }\n if (parentId in queueNodeMap) {\n const parentInTree = queueNodeMap[parentId];\n parentInTree.children.push(putIntoMap(mutation, parentInTree));\n continue;\n }\n queueNodeTrees.push(putIntoMap(mutation, null));\n }\n return queueNodeTrees;\n}\nfunction iterateResolveTree(tree, cb) {\n cb(tree.value);\n for (let i2 = tree.children.length - 1; i2 >= 0; i2--) {\n iterateResolveTree(tree.children[i2], cb);\n }\n}\nfunction isSerializedIframe(n2, mirror2) {\n return Boolean(n2.nodeName === \"IFRAME\" && mirror2.getMeta(n2));\n}\nfunction isSerializedStylesheet(n2, mirror2) {\n return Boolean(\n n2.nodeName === \"LINK\" && n2.nodeType === n2.ELEMENT_NODE && n2.getAttribute && n2.getAttribute(\"rel\") === \"stylesheet\" && mirror2.getMeta(n2)\n );\n}\nfunction getBaseDimension(node2, rootIframe) {\n var _a2, _b;\n const frameElement = (_b = (_a2 = node2.ownerDocument) == null ? void 0 : _a2.defaultView) == null ? void 0 : _b.frameElement;\n if (!frameElement || frameElement === rootIframe) {\n return {\n x: 0,\n y: 0,\n relativeScale: 1,\n absoluteScale: 1\n };\n }\n const frameDimension = frameElement.getBoundingClientRect();\n const frameBaseDimension = getBaseDimension(frameElement, rootIframe);\n const relativeScale = frameDimension.height / frameElement.clientHeight;\n return {\n x: frameDimension.x * frameBaseDimension.relativeScale + frameBaseDimension.x,\n y: frameDimension.y * frameBaseDimension.relativeScale + frameBaseDimension.y,\n relativeScale,\n absoluteScale: frameBaseDimension.absoluteScale * relativeScale\n };\n}\nfunction hasShadowRoot(n2) {\n if (!n2) return false;\n if (n2 instanceof BaseRRNode && \"shadowRoot\" in n2) {\n return Boolean(n2.shadowRoot);\n }\n return Boolean(index.shadowRoot(n2));\n}\nfunction getNestedRule(rules2, position) {\n const rule2 = rules2[position[0]];\n if (position.length === 1) {\n return rule2;\n } else {\n return getNestedRule(\n rule2.cssRules[position[1]].cssRules,\n position.slice(2)\n );\n }\n}\nfunction getPositionsAndIndex(nestedIndex) {\n const positions = [...nestedIndex];\n const index2 = positions.pop();\n return { positions, index: index2 };\n}\nfunction uniqueTextMutations(mutations) {\n const idSet = /* @__PURE__ */ new Set();\n const uniqueMutations = [];\n for (let i2 = mutations.length; i2--; ) {\n const mutation = mutations[i2];\n if (!idSet.has(mutation.id)) {\n uniqueMutations.push(mutation);\n idSet.add(mutation.id);\n }\n }\n return uniqueMutations;\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(n2) {\n var _a2;\n let shadowHost = null;\n if (\"getRootNode\" in n2 && ((_a2 = index.getRootNode(n2)) == null ? void 0 : _a2.nodeType) === Node.DOCUMENT_FRAGMENT_NODE && index.host(index.getRootNode(n2)))\n shadowHost = index.host(index.getRootNode(n2));\n return shadowHost;\n}\nfunction getRootShadowHost(n2) {\n let rootShadowHost = n2;\n let shadowHost;\n while (shadowHost = getShadowHost(rootShadowHost))\n rootShadowHost = shadowHost;\n return rootShadowHost;\n}\nfunction shadowHostInDom(n2) {\n const doc = n2.ownerDocument;\n if (!doc) return false;\n const shadowHost = getRootShadowHost(n2);\n return index.contains(doc, shadowHost);\n}\nfunction inDom(n2) {\n const doc = n2.ownerDocument;\n if (!doc) return false;\n return index.contains(doc, n2) || shadowHostInDom(n2);\n}\nconst utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n StyleSheetMirror,\n get _mirror() {\n return _mirror;\n },\n closestElementOfNode,\n getBaseDimension,\n getNestedRule,\n getPositionsAndIndex,\n getRootShadowHost,\n getShadowHost,\n getWindowHeight,\n getWindowScroll,\n getWindowWidth,\n hasShadowRoot,\n hookSetter,\n inDom,\n isAncestorRemoved,\n isBlocked,\n isIgnored,\n isSerialized,\n isSerializedIframe,\n isSerializedStylesheet,\n iterateResolveTree,\n legacy_isTouchEvent,\n get nowTimestamp() {\n return nowTimestamp;\n },\n on,\n patch,\n polyfill: polyfill$1,\n queueToResolveTrees,\n shadowHostInDom,\n throttle,\n uniqueTextMutations\n}, Symbol.toStringTag, { value: \"Module\" }));\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 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 || {});\nfunction isNodeInLinkedList(n2) {\n return \"__ln\" in n2;\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(n2) {\n const node2 = {\n value: n2,\n previous: null,\n next: null\n };\n n2.__ln = node2;\n if (n2.previousSibling && isNodeInLinkedList(n2.previousSibling)) {\n const current = n2.previousSibling.__ln.next;\n node2.next = current;\n node2.previous = n2.previousSibling.__ln;\n n2.previousSibling.__ln.next = node2;\n if (current) {\n current.previous = node2;\n }\n } else if (n2.nextSibling && isNodeInLinkedList(n2.nextSibling) && n2.nextSibling.__ln.previous) {\n const current = n2.nextSibling.__ln.previous;\n node2.previous = current;\n node2.next = n2.nextSibling.__ln;\n n2.nextSibling.__ln.previous = node2;\n if (current) {\n current.next = node2;\n }\n } else {\n if (this.head) {\n this.head.previous = node2;\n }\n node2.next = this.head;\n this.head = node2;\n }\n if (node2.next === null) {\n this.tail = node2;\n }\n this.length++;\n }\n removeNode(n2) {\n const current = n2.__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 (n2.__ln) {\n delete n2.__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 = (n2) => {\n let ns = n2;\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 = (n2) => {\n const parent = index.parentNode(n2);\n if (!parent || !inDom(n2)) {\n return;\n }\n let cssCaptured = false;\n if (n2.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(n2)) : this.mirror.getId(parent);\n const nextId = getNextId(n2);\n if (parentId === -1 || nextId === -1) {\n return addList.addNode(n2);\n }\n const sn = serializeNodeWithId(n2, {\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(n2)) {\n this.shadowDomManager.addShadowRoot(index.shadowRoot(n2), 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 n2 of this.movedSet) {\n if (isParentRemoved(this.removesSubTreeCache, n2, this.mirror) && !this.movedSet.has(index.parentNode(n2))) {\n continue;\n }\n pushAdd(n2);\n }\n for (const n2 of this.addedSet) {\n if (!isAncestorInSet(this.droppedSet, n2) && !isParentRemoved(this.removesSubTreeCache, n2, this.mirror)) {\n pushAdd(n2);\n } else if (isAncestorInSet(this.movedSet, n2)) {\n pushAdd(n2);\n } else {\n this.droppedSet.add(n2);\n }\n }\n let candidate = null;\n while (addList.length) {\n let node2 = 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 node2 = candidate;\n }\n }\n if (!node2) {\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 node2 = _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 node2 = _node;\n break;\n }\n }\n }\n }\n }\n }\n if (!node2) {\n while (addList.head) {\n addList.removeNode(addList.head.value);\n }\n break;\n }\n candidate = node2.previous;\n addList.removeNode(node2.value);\n pushAdd(node2.value);\n }\n const payload = {\n texts: this.texts.map((text) => {\n const n2 = text.node;\n const parent = index.parentNode(n2);\n if (parent && parent.tagName === \"TEXTAREA\") {\n this.genTextAreaValueMutation(parent);\n }\n return {\n id: this.mirror.getId(n2),\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 item.attributes.value = Array.from(\n index.childNodes(textarea),\n (cn) => index.textContent(cn) || \"\"\n ).join(\"\");\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 (e2) {\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((n2) => this.genAdds(n2, m.target));\n m.removedNodes.forEach((n2) => {\n const nodeId = this.mirror.getId(n2);\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(n2, this.mirror, this.slimDOMOptions) || !isSerialized(n2, this.mirror)) {\n return;\n }\n if (this.addedSet.has(n2)) {\n deepDelete(this.addedSet, n2);\n this.droppedSet.add(n2);\n } else if (this.addedSet.has(m.target) && nodeId === -1) ;\n else if (isAncestorRemoved(m.target, this.mirror)) ;\n else if (this.movedSet.has(n2) && this.movedMap[moveKey(nodeId, parentId)]) {\n deepDelete(this.movedSet, n2);\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(n2, this.removesSubTreeCache);\n }\n this.mapRemoves.push(n2);\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\", (n2, target) => {\n if (this.processedNodeManager.inOtherBuffer(n2, this)) return;\n if (this.addedSet.has(n2) || this.movedSet.has(n2)) return;\n if (this.mirror.hasNode(n2)) {\n if (isIgnored(n2, this.mirror, this.slimDOMOptions)) {\n return;\n }\n this.movedSet.add(n2);\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(n2), targetId)] = true;\n }\n } else {\n this.addedSet.add(n2);\n this.droppedSet.delete(n2);\n }\n if (!isBlocked(n2, this.blockClass, this.blockSelector, false)) {\n index.childNodes(n2).forEach((childN) => this.genAdds(childN));\n if (hasShadowRoot(n2)) {\n index.childNodes(index.shadowRoot(n2)).forEach((childN) => {\n this.processedNodeManager.add(childN, this);\n this.genAdds(childN, n2);\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, n2) {\n addsSet.delete(n2);\n index.childNodes(n2).forEach((childN) => deepDelete(addsSet, childN));\n}\nfunction processRemoves(n2, cache) {\n const queue = [n2];\n while (queue.length) {\n const next = queue.pop();\n if (cache.has(next)) continue;\n cache.add(next);\n index.childNodes(next).forEach((n22) => queue.push(n22));\n }\n return;\n}\nfunction isParentRemoved(removes, n2, mirror2) {\n if (removes.size === 0) return false;\n return _isParentRemoved(removes, n2);\n}\nfunction _isParentRemoved(removes, n2, _mirror2) {\n const node2 = index.parentNode(n2);\n if (!node2) return false;\n return removes.has(node2);\n}\nfunction isAncestorInSet(set, n2) {\n if (set.size === 0) return false;\n return _isAncestorInSet(set, n2);\n}\nfunction _isAncestorInSet(set, n2) {\n const parent = index.parentNode(n2);\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 e2 = legacy_isTouchEvent(event) ? event.changedTouches[0] : event;\n if (!e2) {\n return;\n }\n const id = mirror2.getId(target);\n const { clientX, clientY } = e2;\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, v2) {\n const lastInputValue = lastInputValueMap.get(target);\n if (!lastInputValue || lastInputValue.text !== v2.text || lastInputValue.isChecked !== v2.isChecked) {\n lastInputValueMap.set(target, v2);\n const id = mirror2.getId(target);\n callbackWrapper(inputCb)({\n ...v2,\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(rule2) {\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 rules2 = Array.from(\n childRule.parentRule.cssRules\n );\n const index2 = rules2.indexOf(childRule);\n pos.unshift(index2);\n } else if (childRule.parentStyleSheet) {\n const rules2 = Array.from(childRule.parentStyleSheet.cssRules);\n const index2 = rules2.indexOf(childRule);\n pos.unshift(index2);\n }\n return pos;\n }\n return recurse(rule2, 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 [rule2, 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: rule2, 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 rule2 = `${selector} { ${styleBlock} }`;\n return win.CSSStyleSheet.prototype.insertRule.apply(this, [rule2, 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 [rule2, 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: rule2,\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 result2 = (_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 (e2) {\n }\n }\n return result2;\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 FontFace2(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 i2 = 0; i2 < count; i2++) {\n const range = selection.getRangeAt(i2);\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 (e2) {\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(o2, 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 } = o2;\n o2.mutationCb = (...p) => {\n if (hooks.mutation) {\n hooks.mutation(...p);\n }\n mutationCb(...p);\n };\n o2.mousemoveCb = (...p) => {\n if (hooks.mousemove) {\n hooks.mousemove(...p);\n }\n mousemoveCb(...p);\n };\n o2.mouseInteractionCb = (...p) => {\n if (hooks.mouseInteraction) {\n hooks.mouseInteraction(...p);\n }\n mouseInteractionCb(...p);\n };\n o2.scrollCb = (...p) => {\n if (hooks.scroll) {\n hooks.scroll(...p);\n }\n scrollCb(...p);\n };\n o2.viewportResizeCb = (...p) => {\n if (hooks.viewportResize) {\n hooks.viewportResize(...p);\n }\n viewportResizeCb(...p);\n };\n o2.inputCb = (...p) => {\n if (hooks.input) {\n hooks.input(...p);\n }\n inputCb(...p);\n };\n o2.mediaInteractionCb = (...p) => {\n if (hooks.mediaInteaction) {\n hooks.mediaInteaction(...p);\n }\n mediaInteractionCb(...p);\n };\n o2.styleSheetRuleCb = (...p) => {\n if (hooks.styleSheetRule) {\n hooks.styleSheetRule(...p);\n }\n styleSheetRuleCb(...p);\n };\n o2.styleDeclarationCb = (...p) => {\n if (hooks.styleDeclaration) {\n hooks.styleDeclaration(...p);\n }\n styleDeclarationCb(...p);\n };\n o2.canvasMutationCb = (...p) => {\n if (hooks.canvasMutation) {\n hooks.canvasMutation(...p);\n }\n canvasMutationCb(...p);\n };\n o2.fontCb = (...p) => {\n if (hooks.font) {\n hooks.font(...p);\n }\n fontCb(...p);\n };\n o2.selectionCb = (...p) => {\n if (hooks.selection) {\n hooks.selection(...p);\n }\n selectionCb(...p);\n };\n o2.customElementCb = (...c2) => {\n if (hooks.customElement) {\n hooks.customElement(...c2);\n }\n customElementCb(...c2);\n };\n}\nfunction initObservers(o2, hooks = {}) {\n const currentWindow = o2.doc.defaultView;\n if (!currentWindow) {\n return () => {\n };\n }\n mergeHooks(o2, hooks);\n let mutationObserver;\n if (o2.recordDOM) {\n mutationObserver = initMutationObserver(o2, o2.doc);\n }\n const mousemoveHandler = initMoveObserver(o2);\n const mouseInteractionHandler = initMouseInteractionObserver(o2);\n const scrollHandler = initScrollObserver(o2);\n const viewportResizeHandler = initViewportResizeObserver(o2, {\n win: currentWindow\n });\n const inputHandler = initInputObserver(o2);\n const mediaInteractionHandler = initMediaInteractionObserver(o2);\n let styleSheetObserver = () => {\n };\n let adoptedStyleSheetObserver = () => {\n };\n let styleDeclarationObserver = () => {\n };\n let fontObserver = () => {\n };\n if (o2.recordDOM) {\n styleSheetObserver = initStyleSheetObserver(o2, { win: currentWindow });\n adoptedStyleSheetObserver = initAdoptedStyleSheetObserver(o2, o2.doc);\n styleDeclarationObserver = initStyleDeclarationObserver(o2, {\n win: currentWindow\n });\n if (o2.collectFonts) {\n fontObserver = initFontObserver(o2);\n }\n }\n const selectionObserver = initSelectionObserver(o2);\n const customElementObserver = initCustomElementObserver(o2);\n const pluginHandlers = [];\n for (const plugin3 of o2.plugins) {\n pluginHandlers.push(\n plugin3.observer(plugin3.callback, currentWindow, plugin3.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, e2) {\n var _a2;\n switch (e2.type) {\n case EventType.FullSnapshot: {\n this.crossOriginIframeMirror.reset(iframeEl);\n this.crossOriginIframeStyleMirror.reset(iframeEl);\n this.replaceIdOnNode(e2.data.node, iframeEl);\n const rootId = e2.data.node.id;\n this.crossOriginIframeRootIdMap.set(iframeEl, rootId);\n this.patchRootIdOnNode(e2.data.node, rootId);\n return {\n timestamp: e2.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: e2.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 e2;\n }\n case EventType.Custom: {\n this.replaceIds(\n e2.data.payload,\n iframeEl,\n [\"id\", \"parentId\", \"previousId\", \"nextId\"]\n );\n return e2;\n }\n case EventType.IncrementalSnapshot: {\n switch (e2.data.source) {\n case IncrementalSource.Mutation: {\n e2.data.adds.forEach((n2) => {\n this.replaceIds(n2, iframeEl, [\n \"parentId\",\n \"nextId\",\n \"previousId\"\n ]);\n this.replaceIdOnNode(n2.node, iframeEl);\n const rootId = this.crossOriginIframeRootIdMap.get(iframeEl);\n rootId && this.patchRootIdOnNode(n2.node, rootId);\n });\n e2.data.removes.forEach((n2) => {\n this.replaceIds(n2, iframeEl, [\"parentId\", \"id\"]);\n });\n e2.data.attributes.forEach((n2) => {\n this.replaceIds(n2, iframeEl, [\"id\"]);\n });\n e2.data.texts.forEach((n2) => {\n this.replaceIds(n2, iframeEl, [\"id\"]);\n });\n return e2;\n }\n case IncrementalSource.Drag:\n case IncrementalSource.TouchMove:\n case IncrementalSource.MouseMove: {\n e2.data.positions.forEach((p) => {\n this.replaceIds(p, iframeEl, [\"id\"]);\n });\n return e2;\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(e2.data, iframeEl, [\"id\"]);\n return e2;\n }\n case IncrementalSource.StyleSheetRule:\n case IncrementalSource.StyleDeclaration: {\n this.replaceIds(e2.data, iframeEl, [\"id\"]);\n this.replaceStyleIds(e2.data, iframeEl, [\"styleId\"]);\n return e2;\n }\n case IncrementalSource.Font: {\n return e2;\n }\n case IncrementalSource.Selection: {\n e2.data.ranges.forEach((range) => {\n this.replaceIds(range, iframeEl, [\"start\", \"end\"]);\n });\n return e2;\n }\n case IncrementalSource.AdoptedStyleSheet: {\n this.replaceIds(e2.data, iframeEl, [\"id\"]);\n this.replaceStyleIds(e2.data, iframeEl, [\"styleIds\"]);\n (_a2 = e2.data.styles) == null ? void 0 : _a2.forEach((style) => {\n this.replaceStyleIds(style, iframeEl, [\"styleId\"]);\n });\n return e2;\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(node2, iframeEl) {\n this.replaceIds(node2, iframeEl, [\"id\", \"rootId\"]);\n if (\"childNodes\" in node2) {\n node2.childNodes.forEach((child) => {\n this.replaceIdOnNode(child, iframeEl);\n });\n }\n }\n patchRootIdOnNode(node2, rootId) {\n if (node2.type !== NodeType.Document && !node2.rootId) node2.rootId = rootId;\n if (\"childNodes\" in node2) {\n node2.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 (e2) {\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$1 = 0; i$1 < chars.length; i$1++) {\n lookup[chars.charCodeAt(i$1)] = i$1;\n}\nvar 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};\nvar decode = function(base64) {\n var bufferLength = base64.length * 0.75, len = base64.length, i2, p = 0, encoded1, encoded2, encoded3, encoded4;\n if (base64[base64.length - 1] === \"=\") {\n bufferLength--;\n if (base64[base64.length - 2] === \"=\") {\n bufferLength--;\n }\n }\n var arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer);\n for (i2 = 0; i2 < len; i2 += 4) {\n encoded1 = lookup[base64.charCodeAt(i2)];\n encoded2 = lookup[base64.charCodeAt(i2 + 1)];\n encoded3 = lookup[base64.charCodeAt(i2 + 2)];\n encoded4 = lookup[base64.charCodeAt(i2 + 3)];\n bytes[p++] = encoded1 << 2 | encoded2 >> 4;\n bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;\n bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;\n }\n return arraybuffer;\n};\nconst canvasVarMap = /* @__PURE__ */ new Map();\nfunction variableListFor$1(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 list2 = variableListFor$1(ctx, name);\n let index2 = list2.indexOf(value);\n if (index2 === -1) {\n index2 = list2.length;\n list2.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(v2) {\n cb(this.canvas, {\n type: CanvasContext[\"2D\"],\n property: prop,\n args: [v2],\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 result2 = original.apply(this, args);\n saveWebGLVar(result2, 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 result2;\n };\n }\n );\n handlers.push(restoreHandler);\n } catch {\n const hookHandler = hookSetter(prototype, prop, {\n set(v2) {\n cb(this.canvas, {\n type,\n property: prop,\n args: [v2],\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 handlers.push(\n ...patchGLPrototype(\n win.WebGLRenderingContext.prototype,\n CanvasContext.WebGL,\n cb,\n blockClass,\n blockSelector,\n win\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 encodedJs = \"KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFS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2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=\";\nconst decodeBase64 = (base64) => Uint8Array.from(atob(base64), (c2) => c2.charCodeAt(0));\nconst blob = typeof window !== \"undefined\" && window.Blob && new Blob([decodeBase64(encodedJs)], { type: \"text/javascript;charset=utf-8\" });\nfunction WorkerWrapper(options) {\n let objURL;\n try {\n objURL = blob && (window.URL || window.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 (window.URL || window.webkitURL).revokeObjectURL(objURL);\n });\n return worker;\n } catch (e2) {\n return new Worker(\n \"data:text/javascript;base64,\" + encodedJs,\n {\n name: options == null ? void 0 : options.name\n }\n );\n } finally {\n objURL && (window.URL || window.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 = (e2) => {\n const { id } = e2.data;\n snapshotInProgressMap.set(id, false);\n if (!(\"base64\" in e2.data)) return;\n const { base64, type, width, height } = e2.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, (r2, index2) => ({\n rule: stringifyRule(r2, 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(node2, thisBuffer) {\n const buffers = this.nodeMap.get(node2);\n return buffers && Array.from(buffers).some((buffer) => buffer !== thisBuffer);\n }\n add(node2, 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(node2, (this.nodeMap.get(node2) || /* @__PURE__ */ new Set()).add(buffer));\n }\n destroy() {\n }\n}\nlet wrappedEmit;\nlet takeFullSnapshot$1;\nlet canvasManager;\nlet recording = false;\ntry {\n if (Array.from([1], (x2) => x2 * 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$2();\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 (e2) {\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 = _slimDOMOptions === true || _slimDOMOptions === \"all\" ? {\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 } : _slimDOMOptions ? _slimDOMOptions : {};\n polyfill$1();\n let lastFullSnapshotEvent;\n let incrementalSnapshotCount = 0;\n const eventProcessor = (e2) => {\n for (const plugin3 of plugins || []) {\n if (plugin3.eventProcessor) {\n e2 = plugin3.eventProcessor(e2);\n }\n }\n if (packFn && // Disable packing events which will be emitted to parent frames.\n !passEmitsToParent) {\n e2 = packFn(e2);\n }\n return e2;\n };\n wrappedEmit = (r2, isCheckout) => {\n var _a2;\n const e2 = r2;\n e2.timestamp = nowTimestamp();\n if (((_a2 = mutationBuffers[0]) == null ? void 0 : _a2.isFrozen()) && e2.type !== EventType.FullSnapshot && !(e2.type === EventType.IncrementalSnapshot && e2.data.source === IncrementalSource.Mutation)) {\n mutationBuffers.forEach((buf) => buf.unfreeze());\n }\n if (inEmittingFrame) {\n emit == null ? void 0 : emit(eventProcessor(e2), isCheckout);\n } else if (passEmitsToParent) {\n const message = {\n type: \"rrweb\",\n event: eventProcessor(e2),\n origin: window.location.origin,\n isCheckout\n };\n window.parent.postMessage(message, \"*\");\n }\n if (e2.type === EventType.FullSnapshot) {\n lastFullSnapshotEvent = e2;\n incrementalSnapshotCount = 0;\n } else if (e2.type === EventType.IncrementalSnapshot) {\n if (e2.data.source === IncrementalSource.Mutation && e2.data.isAttachIframe) {\n return;\n }\n incrementalSnapshotCount++;\n const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;\n const exceedTime = checkoutEveryNms && e2.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;\n if (exceedCount || exceedTime) {\n takeFullSnapshot$1(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 = (a2) => wrappedEmit({\n type: EventType.IncrementalSnapshot,\n data: {\n source: IncrementalSource.AdoptedStyleSheet,\n ...a2\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 plugin3 of plugins || []) {\n if (plugin3.getMirror)\n plugin3.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$1 = (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 node2 = 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: (n2) => {\n if (isSerializedIframe(n2, mirror)) {\n iframeManager.addIframe(n2);\n }\n if (isSerializedStylesheet(n2, mirror)) {\n stylesheetManager.trackLinkElement(n2);\n }\n if (hasShadowRoot(n2)) {\n shadowDomManager.addShadowRoot(index.shadowRoot(n2), 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 (!node2) {\n return console.warn(\"Failed to snapshot the document\");\n }\n wrappedEmit(\n {\n type: EventType.FullSnapshot,\n data: {\n node: node2,\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: (v2) => wrappedEmit({\n type: EventType.IncrementalSnapshot,\n data: {\n source: IncrementalSource.Input,\n ...v2\n }\n }),\n mediaInteractionCb: (p) => wrappedEmit({\n type: EventType.IncrementalSnapshot,\n data: {\n source: IncrementalSource.MediaInteraction,\n ...p\n }\n }),\n styleSheetRuleCb: (r2) => wrappedEmit({\n type: EventType.IncrementalSnapshot,\n data: {\n source: IncrementalSource.StyleSheetRule,\n ...r2\n }\n }),\n styleDeclarationCb: (r2) => wrappedEmit({\n type: EventType.IncrementalSnapshot,\n data: {\n source: IncrementalSource.StyleDeclaration,\n ...r2\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: (c2) => {\n wrappedEmit({\n type: EventType.IncrementalSnapshot,\n data: {\n source: IncrementalSource.CustomElement,\n ...c2\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$1();\n handlers.push(observe(document));\n recording = true;\n };\n if (document.readyState === \"interactive\" || document.readyState === \"complete\") {\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((h) => h());\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$1(isCheckout);\n};\nrecord.mirror = mirror;\nfunction mitt$1(n2) {\n return { all: n2 = n2 || /* @__PURE__ */ new Map(), on: function(t2, e2) {\n var i2 = n2.get(t2);\n i2 ? i2.push(e2) : n2.set(t2, [e2]);\n }, off: function(t2, e2) {\n var i2 = n2.get(t2);\n i2 && (e2 ? i2.splice(i2.indexOf(e2) >>> 0, 1) : n2.set(t2, []));\n }, emit: function(t2, e2) {\n var i2 = n2.get(t2);\n i2 && i2.slice().map(function(n3) {\n n3(e2);\n }), (i2 = n2.get(\"*\")) && i2.slice().map(function(n3) {\n n3(t2, e2);\n });\n } };\n}\nconst mittProxy = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({\n __proto__: null,\n default: mitt$1\n}, Symbol.toStringTag, { value: \"Module\" }));\nfunction polyfill(w = window, d = document) {\n if (\"scrollBehavior\" in d.documentElement.style && w.__forceSmoothScrollPolyfill__ !== true) {\n return;\n }\n const Element2 = w.HTMLElement || w.Element;\n const SCROLL_TIME = 468;\n const original = {\n scroll: w.scroll || w.scrollTo,\n scrollBy: w.scrollBy,\n elementScroll: Element2.prototype.scroll || scrollElement,\n scrollIntoView: Element2.prototype.scrollIntoView\n };\n const now = w.performance && w.performance.now ? w.performance.now.bind(w.performance) : Date.now;\n function isMicrosoftBrowser(userAgent) {\n const userAgentPatterns = [\"MSIE \", \"Trident/\", \"Edge/\"];\n return new RegExp(userAgentPatterns.join(\"|\")).test(userAgent);\n }\n const ROUNDING_TOLERANCE = isMicrosoftBrowser(w.navigator.userAgent) ? 1 : 0;\n function scrollElement(x2, y) {\n this.scrollLeft = x2;\n this.scrollTop = y;\n }\n function ease(k) {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n }\n function shouldBailOut(firstArg) {\n if (firstArg === null || typeof firstArg !== \"object\" || firstArg.behavior === void 0 || firstArg.behavior === \"auto\" || firstArg.behavior === \"instant\") {\n return true;\n }\n if (typeof firstArg === \"object\" && firstArg.behavior === \"smooth\") {\n return false;\n }\n throw new TypeError(\n \"behavior member of ScrollOptions \" + firstArg.behavior + \" is not a valid value for enumeration ScrollBehavior.\"\n );\n }\n function hasScrollableSpace(el, axis) {\n if (axis === \"Y\") {\n return el.clientHeight + ROUNDING_TOLERANCE < el.scrollHeight;\n }\n if (axis === \"X\") {\n return el.clientWidth + ROUNDING_TOLERANCE < el.scrollWidth;\n }\n }\n function canOverflow(el, axis) {\n const overflowValue = w.getComputedStyle(el, null)[\"overflow\" + axis];\n return overflowValue === \"auto\" || overflowValue === \"scroll\";\n }\n function isScrollable(el) {\n const isScrollableY = hasScrollableSpace(el, \"Y\") && canOverflow(el, \"Y\");\n const isScrollableX = hasScrollableSpace(el, \"X\") && canOverflow(el, \"X\");\n return isScrollableY || isScrollableX;\n }\n function findScrollableParent(el) {\n while (el !== d.body && isScrollable(el) === false) {\n el = el.parentNode || el.host;\n }\n return el;\n }\n function step(context) {\n const time = now();\n let value;\n let currentX;\n let currentY;\n let elapsed = (time - context.startTime) / SCROLL_TIME;\n elapsed = elapsed > 1 ? 1 : elapsed;\n value = ease(elapsed);\n currentX = context.startX + (context.x - context.startX) * value;\n currentY = context.startY + (context.y - context.startY) * value;\n context.method.call(context.scrollable, currentX, currentY);\n if (currentX !== context.x || currentY !== context.y) {\n w.requestAnimationFrame(step.bind(w, context));\n }\n }\n function smoothScroll(el, x2, y) {\n let scrollable;\n let startX;\n let startY;\n let method;\n const startTime = now();\n if (el === d.body) {\n scrollable = w;\n startX = w.scrollX || w.pageXOffset;\n startY = w.scrollY || w.pageYOffset;\n method = original.scroll;\n } else {\n scrollable = el;\n startX = el.scrollLeft;\n startY = el.scrollTop;\n method = scrollElement;\n }\n step({\n scrollable,\n method,\n startTime,\n startX,\n startY,\n x: x2,\n y\n });\n }\n w.scroll = w.scrollTo = function() {\n if (arguments[0] === void 0) {\n return;\n }\n if (shouldBailOut(arguments[0]) === true) {\n original.scroll.call(\n w,\n arguments[0].left !== void 0 ? arguments[0].left : typeof arguments[0] !== \"object\" ? arguments[0] : w.scrollX || w.pageXOffset,\n // use top prop, second argument if present or fallback to scrollY\n arguments[0].top !== void 0 ? arguments[0].top : arguments[1] !== void 0 ? arguments[1] : w.scrollY || w.pageYOffset\n );\n return;\n }\n smoothScroll.call(\n w,\n d.body,\n arguments[0].left !== void 0 ? ~~arguments[0].left : w.scrollX || w.pageXOffset,\n arguments[0].top !== void 0 ? ~~arguments[0].top : w.scrollY || w.pageYOffset\n );\n };\n w.scrollBy = function() {\n if (arguments[0] === void 0) {\n return;\n }\n if (shouldBailOut(arguments[0])) {\n original.scrollBy.call(\n w,\n arguments[0].left !== void 0 ? arguments[0].left : typeof arguments[0] !== \"object\" ? arguments[0] : 0,\n arguments[0].top !== void 0 ? arguments[0].top : arguments[1] !== void 0 ? arguments[1] : 0\n );\n return;\n }\n smoothScroll.call(\n w,\n d.body,\n ~~arguments[0].left + (w.scrollX || w.pageXOffset),\n ~~arguments[0].top + (w.scrollY || w.pageYOffset)\n );\n };\n Element2.prototype.scroll = Element2.prototype.scrollTo = function() {\n if (arguments[0] === void 0) {\n return;\n }\n if (shouldBailOut(arguments[0]) === true) {\n if (typeof arguments[0] === \"number\" && arguments[1] === void 0) {\n throw new SyntaxError(\"Value could not be converted\");\n }\n original.elementScroll.call(\n this,\n // use left prop, first number argument or fallback to scrollLeft\n arguments[0].left !== void 0 ? ~~arguments[0].left : typeof arguments[0] !== \"object\" ? ~~arguments[0] : this.scrollLeft,\n // use top prop, second argument or fallback to scrollTop\n arguments[0].top !== void 0 ? ~~arguments[0].top : arguments[1] !== void 0 ? ~~arguments[1] : this.scrollTop\n );\n return;\n }\n const left = arguments[0].left;\n const top = arguments[0].top;\n smoothScroll.call(\n this,\n this,\n typeof left === \"undefined\" ? this.scrollLeft : ~~left,\n typeof top === \"undefined\" ? this.scrollTop : ~~top\n );\n };\n Element2.prototype.scrollBy = function() {\n if (arguments[0] === void 0) {\n return;\n }\n if (shouldBailOut(arguments[0]) === true) {\n original.elementScroll.call(\n this,\n arguments[0].left !== void 0 ? ~~arguments[0].left + this.scrollLeft : ~~arguments[0] + this.scrollLeft,\n arguments[0].top !== void 0 ? ~~arguments[0].top + this.scrollTop : ~~arguments[1] + this.scrollTop\n );\n return;\n }\n this.scroll({\n left: ~~arguments[0].left + this.scrollLeft,\n top: ~~arguments[0].top + this.scrollTop,\n behavior: arguments[0].behavior\n });\n };\n Element2.prototype.scrollIntoView = function() {\n if (shouldBailOut(arguments[0]) === true) {\n original.scrollIntoView.call(\n this,\n arguments[0] === void 0 ? true : arguments[0]\n );\n return;\n }\n const scrollableParent = findScrollableParent(this);\n const parentRects = scrollableParent.getBoundingClientRect();\n const clientRects = this.getBoundingClientRect();\n if (scrollableParent !== d.body) {\n smoothScroll.call(\n this,\n scrollableParent,\n scrollableParent.scrollLeft + clientRects.left - parentRects.left,\n scrollableParent.scrollTop + clientRects.top - parentRects.top\n );\n if (w.getComputedStyle(scrollableParent).position !== \"fixed\") {\n w.scrollBy({\n left: parentRects.left,\n top: parentRects.top,\n behavior: \"smooth\"\n });\n }\n } else {\n w.scrollBy({\n left: clientRects.left,\n top: clientRects.top,\n behavior: \"smooth\"\n });\n }\n };\n}\nclass Timer {\n constructor(actions = [], config) {\n __publicField(this, \"timeOffset\", 0);\n __publicField(this, \"speed\");\n __publicField(this, \"actions\");\n __publicField(this, \"raf\", null);\n __publicField(this, \"lastTimestamp\");\n this.actions = actions;\n this.speed = config.speed;\n }\n /**\n * Add an action, possibly after the timer starts.\n */\n addAction(action) {\n const rafWasActive = this.raf === true;\n if (!this.actions.length || this.actions[this.actions.length - 1].delay <= action.delay) {\n this.actions.push(action);\n } else {\n const index2 = this.findActionIndex(action);\n this.actions.splice(index2, 0, action);\n }\n if (rafWasActive) {\n this.raf = requestAnimationFrame(this.rafCheck.bind(this));\n }\n }\n start() {\n this.timeOffset = 0;\n this.lastTimestamp = performance.now();\n this.raf = requestAnimationFrame(this.rafCheck.bind(this));\n }\n rafCheck() {\n const time = performance.now();\n this.timeOffset += (time - this.lastTimestamp) * this.speed;\n this.lastTimestamp = time;\n while (this.actions.length) {\n const action = this.actions[0];\n if (this.timeOffset >= action.delay) {\n this.actions.shift();\n action.doAction();\n } else {\n break;\n }\n }\n if (this.actions.length > 0) {\n this.raf = requestAnimationFrame(this.rafCheck.bind(this));\n } else {\n this.raf = true;\n }\n }\n clear() {\n if (this.raf) {\n if (this.raf !== true) {\n cancelAnimationFrame(this.raf);\n }\n this.raf = null;\n }\n this.actions.length = 0;\n }\n setSpeed(speed) {\n this.speed = speed;\n }\n isActive() {\n return this.raf !== null;\n }\n findActionIndex(action) {\n let start = 0;\n let end = this.actions.length - 1;\n while (start <= end) {\n const mid = Math.floor((start + end) / 2);\n if (this.actions[mid].delay < action.delay) {\n start = mid + 1;\n } else if (this.actions[mid].delay > action.delay) {\n end = mid - 1;\n } else {\n return mid + 1;\n }\n }\n return start;\n }\n}\nfunction addDelay(event, baselineTime) {\n if (event.type === EventType.IncrementalSnapshot && event.data.source === IncrementalSource.MouseMove && event.data.positions && event.data.positions.length) {\n const firstOffset = event.data.positions[0].timeOffset;\n const firstTimestamp = event.timestamp + firstOffset;\n event.delay = firstTimestamp - baselineTime;\n return firstTimestamp - baselineTime;\n }\n event.delay = event.timestamp - baselineTime;\n return event.delay;\n}\n/*! *****************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\nfunction t(t2, n2) {\n var e2 = \"function\" == typeof Symbol && t2[Symbol.iterator];\n if (!e2) return t2;\n var r2, o2, i2 = e2.call(t2), a2 = [];\n try {\n for (; (void 0 === n2 || n2-- > 0) && !(r2 = i2.next()).done; ) a2.push(r2.value);\n } catch (t3) {\n o2 = { error: t3 };\n } finally {\n try {\n r2 && !r2.done && (e2 = i2.return) && e2.call(i2);\n } finally {\n if (o2) throw o2.error;\n }\n }\n return a2;\n}\nvar n;\n!function(t2) {\n t2[t2.NotStarted = 0] = \"NotStarted\", t2[t2.Running = 1] = \"Running\", t2[t2.Stopped = 2] = \"Stopped\";\n}(n || (n = {}));\nvar e = { type: \"xstate.init\" };\nfunction r(t2) {\n return void 0 === t2 ? [] : [].concat(t2);\n}\nfunction o(t2) {\n return { type: \"xstate.assign\", assignment: t2 };\n}\nfunction i(t2, n2) {\n return \"string\" == typeof (t2 = \"string\" == typeof t2 && n2 && n2[t2] ? n2[t2] : t2) ? { type: t2 } : \"function\" == typeof t2 ? { type: t2.name, exec: t2 } : t2;\n}\nfunction a(t2) {\n return function(n2) {\n return t2 === n2;\n };\n}\nfunction u(t2) {\n return \"string\" == typeof t2 ? { type: t2 } : t2;\n}\nfunction c(t2, n2) {\n return { value: t2, context: n2, actions: [], changed: false, matches: a(t2) };\n}\nfunction f(t2, n2, e2) {\n var r2 = n2, o2 = false;\n return [t2.filter(function(t3) {\n if (\"xstate.assign\" === t3.type) {\n o2 = true;\n var n3 = Object.assign({}, r2);\n return \"function\" == typeof t3.assignment ? n3 = t3.assignment(r2, e2) : Object.keys(t3.assignment).forEach(function(o3) {\n n3[o3] = \"function\" == typeof t3.assignment[o3] ? t3.assignment[o3](r2, e2) : t3.assignment[o3];\n }), r2 = n3, false;\n }\n return true;\n }), r2, o2];\n}\nfunction s(n2, o2) {\n void 0 === o2 && (o2 = {});\n var s2 = t(f(r(n2.states[n2.initial].entry).map(function(t2) {\n return i(t2, o2.actions);\n }), n2.context, e), 2), l2 = s2[0], v2 = s2[1], y = { config: n2, _options: o2, initialState: { value: n2.initial, actions: l2, context: v2, matches: a(n2.initial) }, transition: function(e2, o3) {\n var s3, l3, v3 = \"string\" == typeof e2 ? { value: e2, context: n2.context } : e2, p = v3.value, g = v3.context, d = u(o3), x2 = n2.states[p];\n if (x2.on) {\n var m = r(x2.on[d.type]);\n try {\n for (var h = function(t2) {\n var n3 = \"function\" == typeof Symbol && Symbol.iterator, e3 = n3 && t2[n3], r2 = 0;\n if (e3) return e3.call(t2);\n if (t2 && \"number\" == typeof t2.length) return { next: function() {\n return t2 && r2 >= t2.length && (t2 = void 0), { value: t2 && t2[r2++], done: !t2 };\n } };\n throw new TypeError(n3 ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n }(m), b = h.next(); !b.done; b = h.next()) {\n var S = b.value;\n if (void 0 === S) return c(p, g);\n var w = \"string\" == typeof S ? { target: S } : S, j = w.target, E = w.actions, R = void 0 === E ? [] : E, N = w.cond, O = void 0 === N ? function() {\n return true;\n } : N, _ = void 0 === j, k = null != j ? j : p, T = n2.states[k];\n if (O(g, d)) {\n var q = t(f((_ ? r(R) : [].concat(x2.exit, R, T.entry).filter(function(t2) {\n return t2;\n })).map(function(t2) {\n return i(t2, y._options.actions);\n }), g, d), 3), z = q[0], A = q[1], B = q[2], C = null != j ? j : p;\n return { value: C, context: A, actions: z, changed: j !== p || z.length > 0 || B, matches: a(C) };\n }\n }\n } catch (t2) {\n s3 = { error: t2 };\n } finally {\n try {\n b && !b.done && (l3 = h.return) && l3.call(h);\n } finally {\n if (s3) throw s3.error;\n }\n }\n }\n return c(p, g);\n } };\n return y;\n}\nvar l = function(t2, n2) {\n return t2.actions.forEach(function(e2) {\n var r2 = e2.exec;\n return r2 && r2(t2.context, n2);\n });\n};\nfunction v(t2) {\n var r2 = t2.initialState, o2 = n.NotStarted, i2 = /* @__PURE__ */ new Set(), c2 = { _machine: t2, send: function(e2) {\n o2 === n.Running && (r2 = t2.transition(r2, e2), l(r2, u(e2)), i2.forEach(function(t3) {\n return t3(r2);\n }));\n }, subscribe: function(t3) {\n return i2.add(t3), t3(r2), { unsubscribe: function() {\n return i2.delete(t3);\n } };\n }, start: function(i3) {\n if (i3) {\n var u2 = \"object\" == typeof i3 ? i3 : { context: t2.config.context, value: i3 };\n r2 = { value: u2.value, actions: [], context: u2.context, matches: a(u2.value) };\n }\n return o2 = n.Running, l(r2, e), c2;\n }, stop: function() {\n return o2 = n.Stopped, i2.clear(), c2;\n }, get state() {\n return r2;\n }, get status() {\n return o2;\n } };\n return c2;\n}\nfunction discardPriorSnapshots(events, baselineTime) {\n for (let idx = events.length - 1; idx >= 0; idx--) {\n const event = events[idx];\n if (event.type === EventType.Meta) {\n if (event.timestamp <= baselineTime) {\n return events.slice(idx);\n }\n }\n }\n return events;\n}\nfunction createPlayerService(context, { getCastFn, applyEventsSynchronously, emitter }) {\n const playerMachine = s(\n {\n id: \"player\",\n context,\n initial: \"paused\",\n states: {\n playing: {\n on: {\n PAUSE: {\n target: \"paused\",\n actions: [\"pause\"]\n },\n CAST_EVENT: {\n target: \"playing\",\n actions: \"castEvent\"\n },\n END: {\n target: \"paused\",\n actions: [\"resetLastPlayedEvent\", \"pause\"]\n },\n ADD_EVENT: {\n target: \"playing\",\n actions: [\"addEvent\"]\n }\n }\n },\n paused: {\n on: {\n PLAY: {\n target: \"playing\",\n actions: [\"recordTimeOffset\", \"play\"]\n },\n CAST_EVENT: {\n target: \"paused\",\n actions: \"castEvent\"\n },\n TO_LIVE: {\n target: \"live\",\n actions: [\"startLive\"]\n },\n ADD_EVENT: {\n target: \"paused\",\n actions: [\"addEvent\"]\n }\n }\n },\n live: {\n on: {\n ADD_EVENT: {\n target: \"live\",\n actions: [\"addEvent\"]\n },\n CAST_EVENT: {\n target: \"live\",\n actions: [\"castEvent\"]\n }\n }\n }\n }\n },\n {\n actions: {\n castEvent: o({\n lastPlayedEvent: (ctx, event) => {\n if (event.type === \"CAST_EVENT\") {\n return event.payload.event;\n }\n return ctx.lastPlayedEvent;\n }\n }),\n recordTimeOffset: o((ctx, event) => {\n let timeOffset = ctx.timeOffset;\n if (\"payload\" in event && \"timeOffset\" in event.payload) {\n timeOffset = event.payload.timeOffset;\n }\n return {\n ...ctx,\n timeOffset,\n baselineTime: ctx.events[0].timestamp + timeOffset\n };\n }),\n play(ctx) {\n var _a2;\n const { timer, events, baselineTime, lastPlayedEvent } = ctx;\n timer.clear();\n for (const event of events) {\n addDelay(event, baselineTime);\n }\n const neededEvents = discardPriorSnapshots(events, baselineTime);\n let lastPlayedTimestamp = lastPlayedEvent == null ? void 0 : lastPlayedEvent.timestamp;\n if ((lastPlayedEvent == null ? void 0 : lastPlayedEvent.type) === EventType.IncrementalSnapshot && lastPlayedEvent.data.source === IncrementalSource.MouseMove) {\n lastPlayedTimestamp = lastPlayedEvent.timestamp + ((_a2 = lastPlayedEvent.data.positions[0]) == null ? void 0 : _a2.timeOffset);\n }\n if (baselineTime < (lastPlayedTimestamp || 0)) {\n emitter.emit(ReplayerEvents.PlayBack);\n }\n const syncEvents = new Array();\n for (const event of neededEvents) {\n if (lastPlayedTimestamp && lastPlayedTimestamp < baselineTime && (event.timestamp <= lastPlayedTimestamp || event === lastPlayedEvent)) {\n continue;\n }\n if (event.timestamp < baselineTime) {\n syncEvents.push(event);\n } else {\n const castFn = getCastFn(event, false);\n timer.addAction({\n doAction: () => {\n castFn();\n },\n delay: event.delay\n });\n }\n }\n applyEventsSynchronously(syncEvents);\n emitter.emit(ReplayerEvents.Flush);\n timer.start();\n },\n pause(ctx) {\n ctx.timer.clear();\n },\n resetLastPlayedEvent: o((ctx) => {\n return {\n ...ctx,\n lastPlayedEvent: null\n };\n }),\n startLive: o({\n baselineTime: (ctx, event) => {\n ctx.timer.start();\n if (event.type === \"TO_LIVE\" && event.payload.baselineTime) {\n return event.payload.baselineTime;\n }\n return Date.now();\n }\n }),\n addEvent: o((ctx, machineEvent) => {\n const { baselineTime, timer, events } = ctx;\n if (machineEvent.type === \"ADD_EVENT\") {\n const { event } = machineEvent.payload;\n addDelay(event, baselineTime);\n let end = events.length - 1;\n if (!events[end] || events[end].timestamp <= event.timestamp) {\n events.push(event);\n } else {\n let insertionIndex = -1;\n let start = 0;\n while (start <= end) {\n const mid = Math.floor((start + end) / 2);\n if (events[mid].timestamp <= event.timestamp) {\n start = mid + 1;\n } else {\n end = mid - 1;\n }\n }\n if (insertionIndex === -1) {\n insertionIndex = start;\n }\n events.splice(insertionIndex, 0, event);\n }\n const isSync = event.timestamp < baselineTime;\n const castFn = getCastFn(event, isSync);\n if (isSync) {\n castFn();\n } else if (timer.isActive()) {\n timer.addAction({\n doAction: () => {\n castFn();\n },\n delay: event.delay\n });\n }\n }\n return { ...ctx, events };\n })\n }\n }\n );\n return v(playerMachine);\n}\nfunction createSpeedService(context) {\n const speedMachine = s(\n {\n id: \"speed\",\n context,\n initial: \"normal\",\n states: {\n normal: {\n on: {\n FAST_FORWARD: {\n target: \"skipping\",\n actions: [\"recordSpeed\", \"setSpeed\"]\n },\n SET_SPEED: {\n target: \"normal\",\n actions: [\"setSpeed\"]\n }\n }\n },\n skipping: {\n on: {\n BACK_TO_NORMAL: {\n target: \"normal\",\n actions: [\"restoreSpeed\"]\n },\n SET_SPEED: {\n target: \"normal\",\n actions: [\"setSpeed\"]\n }\n }\n }\n }\n },\n {\n actions: {\n setSpeed: (ctx, event) => {\n if (\"payload\" in event) {\n ctx.timer.setSpeed(event.payload.speed);\n }\n },\n recordSpeed: o({\n normalSpeed: (ctx) => ctx.timer.speed\n }),\n restoreSpeed: (ctx) => {\n ctx.timer.setSpeed(ctx.normalSpeed);\n }\n }\n }\n );\n return v(speedMachine);\n}\nconst rules = (blockClass) => [\n `.${blockClass} { background: currentColor }`,\n \"noscript { display: none !important; }\"\n];\nconst webGLVarMap = /* @__PURE__ */ new Map();\nfunction variableListFor(ctx, ctor) {\n let contextMap = webGLVarMap.get(ctx);\n if (!contextMap) {\n contextMap = /* @__PURE__ */ new Map();\n webGLVarMap.set(ctx, contextMap);\n }\n if (!contextMap.has(ctor)) {\n contextMap.set(ctor, []);\n }\n return contextMap.get(ctor);\n}\nfunction deserializeArg(imageMap, ctx, preload) {\n return async (arg) => {\n if (arg && typeof arg === \"object\" && \"rr_type\" in arg) {\n if (preload) preload.isUnchanged = false;\n if (arg.rr_type === \"ImageBitmap\" && \"args\" in arg) {\n const args = await deserializeArg(imageMap, ctx, preload)(arg.args);\n return await createImageBitmap.apply(null, args);\n } else if (\"index\" in arg) {\n if (preload || ctx === null) return arg;\n const { rr_type: name, index: index2 } = arg;\n return variableListFor(ctx, name)[index2];\n } else if (\"args\" in arg) {\n const { rr_type: name, args } = arg;\n const ctor = window[name];\n return new ctor(\n ...await Promise.all(\n args.map(deserializeArg(imageMap, ctx, preload))\n )\n );\n } else if (\"base64\" in arg) {\n return decode(arg.base64);\n } else if (\"src\" in arg) {\n const image = imageMap.get(arg.src);\n if (image) {\n return image;\n } else {\n const image2 = new Image();\n image2.src = arg.src;\n imageMap.set(arg.src, image2);\n return image2;\n }\n } else if (\"data\" in arg && arg.rr_type === \"Blob\") {\n const blobContents = await Promise.all(\n arg.data.map(deserializeArg(imageMap, ctx, preload))\n );\n const blob2 = new Blob(blobContents, {\n type: arg.type\n });\n return blob2;\n }\n } else if (Array.isArray(arg)) {\n const result2 = await Promise.all(\n arg.map(deserializeArg(imageMap, ctx, preload))\n );\n return result2;\n }\n return arg;\n };\n}\nfunction getContext(target, type) {\n try {\n if (type === CanvasContext.WebGL) {\n return target.getContext(\"webgl\") || target.getContext(\"experimental-webgl\");\n }\n return target.getContext(\"webgl2\");\n } catch (e2) {\n return null;\n }\n}\nconst WebGLVariableConstructorsNames = [\n \"WebGLActiveInfo\",\n \"WebGLBuffer\",\n \"WebGLFramebuffer\",\n \"WebGLProgram\",\n \"WebGLRenderbuffer\",\n \"WebGLShader\",\n \"WebGLShaderPrecisionFormat\",\n \"WebGLTexture\",\n \"WebGLUniformLocation\",\n \"WebGLVertexArrayObject\"\n];\nfunction saveToWebGLVarMap(ctx, result2) {\n if (!(result2 == null ? void 0 : result2.constructor)) return;\n const { name } = result2.constructor;\n if (!WebGLVariableConstructorsNames.includes(name)) return;\n const variables = variableListFor(ctx, name);\n if (!variables.includes(result2)) variables.push(result2);\n}\nasync function webglMutation({\n mutation,\n target,\n type,\n imageMap,\n errorHandler: errorHandler2\n}) {\n try {\n const ctx = getContext(target, type);\n if (!ctx) return;\n if (mutation.setter) {\n ctx[mutation.property] = mutation.args[0];\n return;\n }\n const original = ctx[mutation.property];\n const args = await Promise.all(\n mutation.args.map(deserializeArg(imageMap, ctx))\n );\n const result2 = original.apply(ctx, args);\n saveToWebGLVarMap(ctx, result2);\n const debugMode = false;\n if (debugMode) ;\n } catch (error) {\n errorHandler2(mutation, error);\n }\n}\nasync function canvasMutation$1({\n event,\n mutations,\n target,\n imageMap,\n errorHandler: errorHandler2\n}) {\n const ctx = target.getContext(\"2d\");\n if (!ctx) {\n errorHandler2(mutations[0], new Error(\"Canvas context is null\"));\n return;\n }\n const mutationArgsPromises = mutations.map(\n async (mutation) => {\n return Promise.all(mutation.args.map(deserializeArg(imageMap, ctx)));\n }\n );\n const args = await Promise.all(mutationArgsPromises);\n args.forEach((args2, index2) => {\n const mutation = mutations[index2];\n try {\n if (mutation.setter) {\n ctx[mutation.property] = mutation.args[0];\n return;\n }\n const original = ctx[mutation.property];\n if (mutation.property === \"drawImage\" && typeof mutation.args[0] === \"string\") {\n imageMap.get(event);\n original.apply(ctx, mutation.args);\n } else {\n original.apply(ctx, args2);\n }\n } catch (error) {\n errorHandler2(mutation, error);\n }\n return;\n });\n}\nasync function canvasMutation({\n event,\n mutation,\n target,\n imageMap,\n canvasEventMap,\n errorHandler: errorHandler2\n}) {\n try {\n const precomputedMutation = canvasEventMap.get(event) || mutation;\n const commands = \"commands\" in precomputedMutation ? precomputedMutation.commands : [precomputedMutation];\n if ([CanvasContext.WebGL, CanvasContext.WebGL2].includes(mutation.type)) {\n for (let i2 = 0; i2 < commands.length; i2++) {\n const command = commands[i2];\n await webglMutation({\n mutation: command,\n type: mutation.type,\n target,\n imageMap,\n errorHandler: errorHandler2\n });\n }\n return;\n }\n await canvasMutation$1({\n event,\n mutations: commands,\n target,\n imageMap,\n errorHandler: errorHandler2\n });\n } catch (error) {\n errorHandler2(mutation, error);\n }\n}\nclass MediaManager {\n constructor(options) {\n __publicField(this, \"mediaMap\", /* @__PURE__ */ new Map());\n __publicField(this, \"warn\");\n __publicField(this, \"service\");\n __publicField(this, \"speedService\");\n __publicField(this, \"emitter\");\n __publicField(this, \"getCurrentTime\");\n __publicField(this, \"metadataCallbackMap\", /* @__PURE__ */ new Map());\n this.warn = options.warn;\n this.service = options.service;\n this.speedService = options.speedService;\n this.emitter = options.emitter;\n this.getCurrentTime = options.getCurrentTime;\n this.emitter.on(ReplayerEvents.Start, this.start.bind(this));\n this.emitter.on(ReplayerEvents.SkipStart, this.start.bind(this));\n this.emitter.on(ReplayerEvents.Pause, this.pause.bind(this));\n this.emitter.on(ReplayerEvents.Finish, this.pause.bind(this));\n this.speedService.subscribe(() => {\n this.syncAllMediaElements();\n });\n }\n syncAllMediaElements(options = { pause: false }) {\n this.mediaMap.forEach((_mediaState, target) => {\n this.syncTargetWithState(target);\n if (options.pause) {\n target.pause();\n }\n });\n }\n start() {\n this.syncAllMediaElements();\n }\n pause() {\n this.syncAllMediaElements({ pause: true });\n }\n seekTo({\n time,\n target,\n mediaState\n }) {\n if (mediaState.isPlaying) {\n const differenceBetweenCurrentTimeAndMediaMutationTimestamp = time - mediaState.lastInteractionTimeOffset;\n const mediaPlaybackOffset = differenceBetweenCurrentTimeAndMediaMutationTimestamp / 1e3 * mediaState.playbackRate;\n const duration = \"duration\" in target && target.duration;\n if (Number.isNaN(duration)) {\n this.waitForMetadata(target);\n return;\n }\n let seekToTime = mediaState.currentTimeAtLastInteraction + mediaPlaybackOffset;\n if (target.loop && // RRMediaElement doesn't have a duration property\n duration !== false) {\n seekToTime = seekToTime % duration;\n }\n target.currentTime = seekToTime;\n } else {\n target.pause();\n target.currentTime = mediaState.currentTimeAtLastInteraction;\n }\n }\n waitForMetadata(target) {\n if (this.metadataCallbackMap.has(target)) return;\n if (!(\"addEventListener\" in target)) return;\n const onLoadedMetadata = () => {\n this.metadataCallbackMap.delete(target);\n const mediaState = this.mediaMap.get(target);\n if (!mediaState) return;\n this.seekTo({\n time: this.getCurrentTime(),\n target,\n mediaState\n });\n };\n this.metadataCallbackMap.set(target, onLoadedMetadata);\n target.addEventListener(\"loadedmetadata\", onLoadedMetadata, {\n once: true\n });\n }\n getMediaStateFromMutation({\n target,\n timeOffset,\n mutation\n }) {\n const lastState = this.mediaMap.get(target);\n const { type, playbackRate, currentTime, muted, volume, loop } = mutation;\n const isPlaying = type === MediaInteractions.Play || type !== MediaInteractions.Pause && ((lastState == null ? void 0 : lastState.isPlaying) || target.getAttribute(\"autoplay\") !== null);\n const mediaState = {\n isPlaying,\n currentTimeAtLastInteraction: currentTime ?? (lastState == null ? void 0 : lastState.currentTimeAtLastInteraction) ?? 0,\n lastInteractionTimeOffset: timeOffset,\n playbackRate: playbackRate ?? (lastState == null ? void 0 : lastState.playbackRate) ?? 1,\n volume: volume ?? (lastState == null ? void 0 : lastState.volume) ?? 1,\n muted: muted ?? (lastState == null ? void 0 : lastState.muted) ?? target.getAttribute(\"muted\") === null,\n loop: loop ?? (lastState == null ? void 0 : lastState.loop) ?? target.getAttribute(\"loop\") === null\n };\n return mediaState;\n }\n syncTargetWithState(target) {\n const mediaState = this.mediaMap.get(target);\n if (!mediaState) return;\n const { muted, loop, volume, isPlaying } = mediaState;\n const playerIsPaused = this.service.state.matches(\"paused\");\n const playbackRate = mediaState.playbackRate * this.speedService.state.context.timer.speed;\n try {\n this.seekTo({\n time: this.getCurrentTime(),\n target,\n mediaState\n });\n if (target.volume !== volume) {\n target.volume = volume;\n }\n target.muted = muted;\n target.loop = loop;\n if (target.playbackRate !== playbackRate) {\n target.playbackRate = playbackRate;\n }\n if (isPlaying && !playerIsPaused) {\n void target.play();\n } else {\n target.pause();\n }\n } catch (error) {\n this.warn(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/restrict-template-expressions\n `Failed to replay media interactions: ${error.message || error}`\n );\n }\n }\n addMediaElements(node2, timeOffset, mirror2) {\n if (![\"AUDIO\", \"VIDEO\"].includes(node2.nodeName)) return;\n const target = node2;\n const serializedNode = mirror2.getMeta(target);\n if (!serializedNode || !(\"attributes\" in serializedNode)) return;\n const playerIsPaused = this.service.state.matches(\"paused\");\n const mediaAttributes = serializedNode.attributes;\n let isPlaying = false;\n if (mediaAttributes.rr_mediaState) {\n isPlaying = mediaAttributes.rr_mediaState === \"played\";\n } else {\n isPlaying = target.getAttribute(\"autoplay\") !== null;\n }\n if (isPlaying && playerIsPaused) target.pause();\n let playbackRate = 1;\n if (typeof mediaAttributes.rr_mediaPlaybackRate === \"number\") {\n playbackRate = mediaAttributes.rr_mediaPlaybackRate;\n }\n let muted = false;\n if (typeof mediaAttributes.rr_mediaMuted === \"boolean\") {\n muted = mediaAttributes.rr_mediaMuted;\n } else {\n muted = target.getAttribute(\"muted\") !== null;\n }\n let loop = false;\n if (typeof mediaAttributes.rr_mediaLoop === \"boolean\") {\n loop = mediaAttributes.rr_mediaLoop;\n } else {\n loop = target.getAttribute(\"loop\") !== null;\n }\n let volume = 1;\n if (typeof mediaAttributes.rr_mediaVolume === \"number\") {\n volume = mediaAttributes.rr_mediaVolume;\n }\n let currentTimeAtLastInteraction = 0;\n if (typeof mediaAttributes.rr_mediaCurrentTime === \"number\") {\n currentTimeAtLastInteraction = mediaAttributes.rr_mediaCurrentTime;\n }\n this.mediaMap.set(target, {\n isPlaying,\n currentTimeAtLastInteraction,\n lastInteractionTimeOffset: timeOffset,\n playbackRate,\n volume,\n muted,\n loop\n });\n this.syncTargetWithState(target);\n }\n mediaMutation({\n target,\n timeOffset,\n mutation\n }) {\n this.mediaMap.set(\n target,\n this.getMediaStateFromMutation({\n target,\n timeOffset,\n mutation\n })\n );\n this.syncTargetWithState(target);\n }\n isSupportedMediaElement(node2) {\n return [\"AUDIO\", \"VIDEO\"].includes(node2.nodeName);\n }\n reset() {\n this.mediaMap.clear();\n }\n}\nfunction applyDialogToTopLevel(node2, attributeMutation) {\n if (node2.nodeName !== \"DIALOG\" || node2 instanceof BaseRRNode) return;\n const dialog = node2;\n const oldIsOpen = dialog.open;\n const oldIsModalState = oldIsOpen && dialog.matches(\"dialog:modal\");\n const rrOpenMode = dialog.getAttribute(\"rr_open_mode\");\n const newIsOpen = typeof (attributeMutation == null ? void 0 : attributeMutation.attributes.open) === \"string\" || typeof dialog.getAttribute(\"open\") === \"string\";\n const newIsModalState = rrOpenMode === \"modal\";\n const newIsNonModalState = rrOpenMode === \"non-modal\";\n const modalStateChanged = oldIsModalState && newIsNonModalState || !oldIsModalState && newIsModalState;\n if (oldIsOpen && !modalStateChanged) return;\n if (!dialog.isConnected) {\n console.warn(\"dialog is not attached to the dom\", dialog);\n return;\n }\n if (oldIsOpen) dialog.close();\n if (!newIsOpen) return;\n if (newIsModalState) dialog.showModal();\n else dialog.show();\n}\nfunction removeDialogFromTopLevel(node2, attributeMutation) {\n if (node2.nodeName !== \"DIALOG\" || node2 instanceof BaseRRNode) return;\n const dialog = node2;\n if (!dialog.isConnected) {\n console.warn(\"dialog is not attached to the dom\", dialog);\n return;\n }\n if (attributeMutation.attributes.open === null) {\n dialog.removeAttribute(\"open\");\n dialog.removeAttribute(\"rr_open_mode\");\n }\n}\nconst SKIP_TIME_INTERVAL = 5 * 1e3;\nconst mitt = mitt$1 || mittProxy;\nconst REPLAY_CONSOLE_PREFIX = \"[replayer]\";\nconst defaultMouseTailConfig = {\n duration: 500,\n lineCap: \"round\",\n lineWidth: 3,\n strokeStyle: \"red\"\n};\nfunction indicatesTouchDevice(e2) {\n return e2.type == EventType.IncrementalSnapshot && (e2.data.source == IncrementalSource.TouchMove || e2.data.source == IncrementalSource.MouseInteraction && e2.data.type == MouseInteractions.TouchStart);\n}\nclass Replayer {\n constructor(events, config) {\n __publicField(this, \"wrapper\");\n __publicField(this, \"iframe\");\n __publicField(this, \"service\");\n __publicField(this, \"speedService\");\n __publicField(this, \"config\");\n // In the fast-forward process, if the virtual-dom optimization is used, this flag value is true.\n __publicField(this, \"usingVirtualDom\", false);\n __publicField(this, \"virtualDom\", new RRDocument());\n __publicField(this, \"mouse\");\n __publicField(this, \"mouseTail\", null);\n __publicField(this, \"tailPositions\", []);\n __publicField(this, \"emitter\", mitt());\n __publicField(this, \"nextUserInteractionEvent\");\n __publicField(this, \"legacy_missingNodeRetryMap\", {});\n // The replayer uses the cache to speed up replay and scrubbing.\n __publicField(this, \"cache\", createCache());\n __publicField(this, \"imageMap\", /* @__PURE__ */ new Map());\n __publicField(this, \"canvasEventMap\", /* @__PURE__ */ new Map());\n __publicField(this, \"mirror\", createMirror$2());\n // Used to track StyleSheetObjects adopted on multiple document hosts.\n __publicField(this, \"styleMirror\", new StyleSheetMirror());\n // Used to track video & audio elements, and keep them in sync with general playback.\n __publicField(this, \"mediaManager\");\n __publicField(this, \"firstFullSnapshot\", null);\n __publicField(this, \"newDocumentQueue\", []);\n __publicField(this, \"mousePos\", null);\n __publicField(this, \"touchActive\", null);\n __publicField(this, \"lastMouseDownEvent\", null);\n // Keep the rootNode of the last hovered element. So when hovering a new element, we can remove the last hovered element's :hover style.\n __publicField(this, \"lastHoveredRootNode\");\n // In the fast-forward mode, only the last selection data needs to be applied.\n __publicField(this, \"lastSelectionData\", null);\n // In the fast-forward mode using VirtualDom optimization, all stylesheetRule, and styleDeclaration events on constructed StyleSheets will be delayed to get applied until the flush stage.\n __publicField(this, \"constructedStyleMutations\", []);\n // Similar to the reason for constructedStyleMutations.\n __publicField(this, \"adoptedStyleSheets\", []);\n __publicField(this, \"handleResize\", (dimension) => {\n this.iframe.style.display = \"inherit\";\n for (const el of [this.mouseTail, this.iframe]) {\n if (!el) {\n continue;\n }\n el.setAttribute(\"width\", String(dimension.width));\n el.setAttribute(\"height\", String(dimension.height));\n }\n });\n __publicField(this, \"applyEventsSynchronously\", (events) => {\n for (const event of events) {\n switch (event.type) {\n case EventType.DomContentLoaded:\n case EventType.Load:\n case EventType.Custom:\n continue;\n case EventType.FullSnapshot:\n case EventType.Meta:\n case EventType.Plugin:\n case EventType.IncrementalSnapshot:\n break;\n }\n const castFn = this.getCastFn(event, true);\n castFn();\n }\n });\n __publicField(this, \"getCastFn\", (event, isSync = false) => {\n let castFn;\n switch (event.type) {\n case EventType.DomContentLoaded:\n case EventType.Load:\n break;\n case EventType.Custom:\n castFn = () => {\n this.emitter.emit(ReplayerEvents.CustomEvent, event);\n };\n break;\n case EventType.Meta:\n castFn = () => this.emitter.emit(ReplayerEvents.Resize, {\n width: event.data.width,\n height: event.data.height\n });\n break;\n case EventType.FullSnapshot:\n castFn = () => {\n var _a2;\n if (this.firstFullSnapshot) {\n if (this.firstFullSnapshot === event) {\n this.firstFullSnapshot = true;\n return;\n }\n } else {\n this.firstFullSnapshot = true;\n }\n this.mediaManager.reset();\n this.styleMirror.reset();\n this.rebuildFullSnapshot(event, isSync);\n (_a2 = this.iframe.contentWindow) == null ? void 0 : _a2.scrollTo(event.data.initialOffset);\n };\n break;\n case EventType.IncrementalSnapshot:\n castFn = () => {\n this.applyIncremental(event, isSync);\n if (isSync) {\n return;\n }\n if (event === this.nextUserInteractionEvent) {\n this.nextUserInteractionEvent = null;\n this.backToNormal();\n }\n if (this.config.skipInactive && !this.nextUserInteractionEvent) {\n for (const _event of this.service.state.context.events) {\n if (_event.timestamp <= event.timestamp) {\n continue;\n }\n if (this.isUserInteraction(_event)) {\n if (\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n _event.delay - event.delay > this.config.inactivePeriodThreshold * this.speedService.state.context.timer.speed\n ) {\n this.nextUserInteractionEvent = _event;\n }\n break;\n }\n }\n if (this.nextUserInteractionEvent) {\n const skipTime = (\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this.nextUserInteractionEvent.delay - event.delay\n );\n const payload = {\n speed: Math.min(\n Math.round(skipTime / SKIP_TIME_INTERVAL),\n this.config.maxSpeed\n )\n };\n this.speedService.send({ type: \"FAST_FORWARD\", payload });\n this.emitter.emit(ReplayerEvents.SkipStart, payload);\n }\n }\n };\n break;\n }\n const wrappedCastFn = () => {\n if (castFn) {\n castFn();\n }\n for (const plugin3 of this.config.plugins || []) {\n if (plugin3.handler) plugin3.handler(event, isSync, { replayer: this });\n }\n this.service.send({ type: \"CAST_EVENT\", payload: { event } });\n const last_index = this.service.state.context.events.length - 1;\n if (!this.config.liveMode && event === this.service.state.context.events[last_index]) {\n const finish = () => {\n if (last_index < this.service.state.context.events.length - 1) {\n return;\n }\n this.backToNormal();\n this.service.send(\"END\");\n this.emitter.emit(ReplayerEvents.Finish);\n };\n let finish_buffer = 50;\n if (event.type === EventType.IncrementalSnapshot && event.data.source === IncrementalSource.MouseMove && event.data.positions.length) {\n finish_buffer += Math.max(0, -event.data.positions[0].timeOffset);\n }\n setTimeout(finish, finish_buffer);\n }\n this.emitter.emit(ReplayerEvents.EventCast, event);\n };\n return wrappedCastFn;\n });\n if (!(config == null ? void 0 : config.liveMode) && events.length < 2) {\n throw new Error(\"Replayer need at least 2 events.\");\n }\n const defaultConfig = {\n speed: 1,\n maxSpeed: 360,\n root: document.body,\n loadTimeout: 0,\n skipInactive: false,\n inactivePeriodThreshold: 10 * 1e3,\n showWarning: true,\n showDebug: false,\n blockClass: \"rr-block\",\n liveMode: false,\n insertStyleRules: [],\n triggerFocus: true,\n UNSAFE_replayCanvas: false,\n pauseAnimation: true,\n mouseTail: defaultMouseTailConfig,\n useVirtualDom: true,\n // Virtual-dom optimization is enabled by default.\n logger: console\n };\n this.config = Object.assign({}, defaultConfig, config);\n this.handleResize = this.handleResize.bind(this);\n this.getCastFn = this.getCastFn.bind(this);\n this.applyEventsSynchronously = this.applyEventsSynchronously.bind(this);\n this.emitter.on(ReplayerEvents.Resize, this.handleResize);\n this.setupDom();\n for (const plugin3 of this.config.plugins || []) {\n if (plugin3.getMirror) plugin3.getMirror({ nodeMirror: this.mirror });\n }\n this.emitter.on(ReplayerEvents.Flush, () => {\n if (this.usingVirtualDom) {\n const replayerHandler = {\n mirror: this.mirror,\n applyCanvas: (canvasEvent, canvasMutationData, target) => {\n void canvasMutation({\n event: canvasEvent,\n mutation: canvasMutationData,\n target,\n imageMap: this.imageMap,\n canvasEventMap: this.canvasEventMap,\n errorHandler: this.warnCanvasMutationFailed.bind(this)\n });\n },\n applyInput: this.applyInput.bind(this),\n applyScroll: this.applyScroll.bind(this),\n applyStyleSheetMutation: (data, styleSheet) => {\n if (data.source === IncrementalSource.StyleSheetRule)\n this.applyStyleSheetRule(data, styleSheet);\n else if (data.source === IncrementalSource.StyleDeclaration)\n this.applyStyleDeclaration(data, styleSheet);\n },\n afterAppend: (node2, id) => {\n for (const plugin3 of this.config.plugins || []) {\n if (plugin3.onBuild) plugin3.onBuild(node2, { id, replayer: this });\n }\n }\n };\n if (this.iframe.contentDocument)\n try {\n diff(\n this.iframe.contentDocument,\n this.virtualDom,\n replayerHandler,\n this.virtualDom.mirror\n );\n } catch (e2) {\n console.warn(e2);\n }\n this.virtualDom.destroyTree();\n this.usingVirtualDom = false;\n if (Object.keys(this.legacy_missingNodeRetryMap).length) {\n for (const key in this.legacy_missingNodeRetryMap) {\n try {\n const value = this.legacy_missingNodeRetryMap[key];\n const realNode = createOrGetNode(\n value.node,\n this.mirror,\n this.virtualDom.mirror\n );\n diff(\n realNode,\n value.node,\n replayerHandler,\n this.virtualDom.mirror\n );\n value.node = realNode;\n } catch (error) {\n this.warn(error);\n }\n }\n }\n this.constructedStyleMutations.forEach((data) => {\n this.applyStyleSheetMutation(data);\n });\n this.constructedStyleMutations = [];\n this.adoptedStyleSheets.forEach((data) => {\n this.applyAdoptedStyleSheet(data);\n });\n this.adoptedStyleSheets = [];\n }\n if (this.mousePos) {\n this.moveAndHover(\n this.mousePos.x,\n this.mousePos.y,\n this.mousePos.id,\n true,\n this.mousePos.debugData\n );\n this.mousePos = null;\n }\n if (this.touchActive === true) {\n this.mouse.classList.add(\"touch-active\");\n } else if (this.touchActive === false) {\n this.mouse.classList.remove(\"touch-active\");\n }\n this.touchActive = null;\n if (this.lastMouseDownEvent) {\n const [target, event] = this.lastMouseDownEvent;\n target.dispatchEvent(event);\n }\n this.lastMouseDownEvent = null;\n if (this.lastSelectionData) {\n this.applySelection(this.lastSelectionData);\n this.lastSelectionData = null;\n }\n });\n this.emitter.on(ReplayerEvents.PlayBack, () => {\n this.firstFullSnapshot = null;\n this.mirror.reset();\n this.styleMirror.reset();\n this.mediaManager.reset();\n });\n const timer = new Timer([], {\n speed: this.config.speed\n });\n this.service = createPlayerService(\n {\n events: events.map((e2) => {\n if (config && config.unpackFn) {\n return config.unpackFn(e2);\n }\n return e2;\n }).sort((a1, a2) => a1.timestamp - a2.timestamp),\n timer,\n timeOffset: 0,\n baselineTime: 0,\n lastPlayedEvent: null\n },\n {\n getCastFn: this.getCastFn,\n applyEventsSynchronously: this.applyEventsSynchronously,\n emitter: this.emitter\n }\n );\n this.service.start();\n this.service.subscribe((state) => {\n this.emitter.emit(ReplayerEvents.StateChange, {\n player: state\n });\n });\n this.speedService = createSpeedService({\n normalSpeed: -1,\n timer\n });\n this.speedService.start();\n this.speedService.subscribe((state) => {\n this.emitter.emit(ReplayerEvents.StateChange, {\n speed: state\n });\n });\n this.mediaManager = new MediaManager({\n warn: this.warn.bind(this),\n service: this.service,\n speedService: this.speedService,\n emitter: this.emitter,\n getCurrentTime: this.getCurrentTime.bind(this)\n });\n const firstMeta = this.service.state.context.events.find(\n (e2) => e2.type === EventType.Meta\n );\n const firstFullsnapshot = this.service.state.context.events.find(\n (e2) => e2.type === EventType.FullSnapshot\n );\n if (firstMeta) {\n const { width, height } = firstMeta.data;\n setTimeout(() => {\n this.emitter.emit(ReplayerEvents.Resize, {\n width,\n height\n });\n }, 0);\n }\n if (firstFullsnapshot) {\n setTimeout(() => {\n var _a2;\n if (this.firstFullSnapshot) {\n return;\n }\n this.firstFullSnapshot = firstFullsnapshot;\n this.rebuildFullSnapshot(\n firstFullsnapshot\n );\n (_a2 = this.iframe.contentWindow) == null ? void 0 : _a2.scrollTo(\n firstFullsnapshot.data.initialOffset\n );\n }, 1);\n }\n if (this.service.state.context.events.find(indicatesTouchDevice)) {\n this.mouse.classList.add(\"touch-device\");\n }\n }\n get timer() {\n return this.service.state.context.timer;\n }\n on(event, handler) {\n this.emitter.on(event, handler);\n return this;\n }\n off(event, handler) {\n this.emitter.off(event, handler);\n return this;\n }\n setConfig(config) {\n Object.keys(config).forEach((key) => {\n config[key];\n this.config[key] = config[key];\n });\n if (!this.config.skipInactive) {\n this.backToNormal();\n }\n if (typeof config.speed !== \"undefined\") {\n this.speedService.send({\n type: \"SET_SPEED\",\n payload: {\n speed: config.speed\n }\n });\n }\n if (typeof config.mouseTail !== \"undefined\") {\n if (config.mouseTail === false) {\n if (this.mouseTail) {\n this.mouseTail.style.display = \"none\";\n }\n } else {\n if (!this.mouseTail) {\n this.mouseTail = document.createElement(\"canvas\");\n this.mouseTail.width = Number.parseFloat(this.iframe.width);\n this.mouseTail.height = Number.parseFloat(this.iframe.height);\n this.mouseTail.classList.add(\"replayer-mouse-tail\");\n this.wrapper.insertBefore(this.mouseTail, this.iframe);\n }\n this.mouseTail.style.display = \"inherit\";\n }\n }\n }\n getMetaData() {\n const firstEvent = this.service.state.context.events[0];\n const lastEvent = this.service.state.context.events[this.service.state.context.events.length - 1];\n return {\n startTime: firstEvent.timestamp,\n endTime: lastEvent.timestamp,\n totalTime: lastEvent.timestamp - firstEvent.timestamp\n };\n }\n /**\n * Get the actual time offset the player is at now compared to the first event.\n */\n getCurrentTime() {\n return this.timer.timeOffset + this.getTimeOffset();\n }\n /**\n * Get the time offset the player is at now compared to the first event, but without regard for the timer.\n */\n getTimeOffset() {\n const { baselineTime, events } = this.service.state.context;\n return baselineTime - events[0].timestamp;\n }\n getMirror() {\n return this.mirror;\n }\n /**\n * This API was designed to be used as play at any time offset.\n * Since we minimized the data collected from recorder, we do not\n * have the ability of undo an event.\n * So the implementation of play at any time offset will always iterate\n * all of the events, cast event before the offset synchronously\n * and cast event after the offset asynchronously with timer.\n * @param timeOffset - number\n */\n play(timeOffset = 0) {\n var _a2, _b;\n if (this.service.state.matches(\"paused\")) {\n this.service.send({ type: \"PLAY\", payload: { timeOffset } });\n } else {\n this.service.send({ type: \"PAUSE\" });\n this.service.send({ type: \"PLAY\", payload: { timeOffset } });\n }\n (_b = (_a2 = this.iframe.contentDocument) == null ? void 0 : _a2.getElementsByTagName(\"html\")[0]) == null ? void 0 : _b.classList.remove(\"rrweb-paused\");\n this.emitter.emit(ReplayerEvents.Start);\n }\n pause(timeOffset) {\n var _a2, _b;\n if (timeOffset === void 0 && this.service.state.matches(\"playing\")) {\n this.service.send({ type: \"PAUSE\" });\n }\n if (typeof timeOffset === \"number\") {\n this.play(timeOffset);\n this.service.send({ type: \"PAUSE\" });\n }\n (_b = (_a2 = this.iframe.contentDocument) == null ? void 0 : _a2.getElementsByTagName(\"html\")[0]) == null ? void 0 : _b.classList.add(\"rrweb-paused\");\n this.emitter.emit(ReplayerEvents.Pause);\n }\n resume(timeOffset = 0) {\n this.warn(\n `The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface.`\n );\n this.play(timeOffset);\n this.emitter.emit(ReplayerEvents.Resume);\n }\n /**\n * Totally destroy this replayer and please be careful that this operation is irreversible.\n * Memory occupation can be released by removing all references to this replayer.\n */\n destroy() {\n this.pause();\n this.mirror.reset();\n this.styleMirror.reset();\n this.mediaManager.reset();\n this.config.root.removeChild(this.wrapper);\n this.emitter.emit(ReplayerEvents.Destroy);\n }\n startLive(baselineTime) {\n this.service.send({ type: \"TO_LIVE\", payload: { baselineTime } });\n }\n addEvent(rawEvent) {\n const event = this.config.unpackFn ? this.config.unpackFn(rawEvent) : rawEvent;\n if (indicatesTouchDevice(event)) {\n this.mouse.classList.add(\"touch-device\");\n }\n void Promise.resolve().then(\n () => this.service.send({ type: \"ADD_EVENT\", payload: { event } })\n );\n }\n enableInteract() {\n this.iframe.setAttribute(\"scrolling\", \"auto\");\n this.iframe.style.pointerEvents = \"auto\";\n }\n disableInteract() {\n this.iframe.setAttribute(\"scrolling\", \"no\");\n this.iframe.style.pointerEvents = \"none\";\n }\n /**\n * Empties the replayer's cache and reclaims memory.\n * The replayer will use this cache to speed up the playback.\n */\n resetCache() {\n this.cache = createCache();\n }\n setupDom() {\n this.wrapper = document.createElement(\"div\");\n this.wrapper.classList.add(\"replayer-wrapper\");\n this.config.root.appendChild(this.wrapper);\n this.mouse = document.createElement(\"div\");\n this.mouse.classList.add(\"replayer-mouse\");\n this.wrapper.appendChild(this.mouse);\n if (this.config.mouseTail !== false) {\n this.mouseTail = document.createElement(\"canvas\");\n this.mouseTail.classList.add(\"replayer-mouse-tail\");\n this.mouseTail.style.display = \"inherit\";\n this.wrapper.appendChild(this.mouseTail);\n }\n this.iframe = document.createElement(\"iframe\");\n const attributes = [\"allow-same-origin\"];\n if (this.config.UNSAFE_replayCanvas) {\n attributes.push(\"allow-scripts\");\n }\n this.iframe.style.display = \"none\";\n this.iframe.setAttribute(\"sandbox\", attributes.join(\" \"));\n this.disableInteract();\n this.wrapper.appendChild(this.iframe);\n if (this.iframe.contentWindow && this.iframe.contentDocument) {\n polyfill(\n this.iframe.contentWindow,\n this.iframe.contentDocument\n );\n polyfill$1(this.iframe.contentWindow);\n }\n }\n rebuildFullSnapshot(event, isSync = false) {\n if (!this.iframe.contentDocument) {\n return this.warn(\"Looks like your replayer has been destroyed.\");\n }\n if (Object.keys(this.legacy_missingNodeRetryMap).length) {\n this.warn(\n \"Found unresolved missing node map\",\n this.legacy_missingNodeRetryMap\n );\n }\n this.legacy_missingNodeRetryMap = {};\n const collectedIframes = [];\n const collectedDialogs = /* @__PURE__ */ new Set();\n const afterAppend = (builtNode, id) => {\n if (builtNode.nodeName === \"DIALOG\")\n collectedDialogs.add(builtNode);\n this.collectIframeAndAttachDocument(collectedIframes, builtNode);\n if (this.mediaManager.isSupportedMediaElement(builtNode)) {\n const { events } = this.service.state.context;\n this.mediaManager.addMediaElements(\n builtNode,\n event.timestamp - events[0].timestamp,\n this.mirror\n );\n }\n for (const plugin3 of this.config.plugins || []) {\n if (plugin3.onBuild)\n plugin3.onBuild(builtNode, {\n id,\n replayer: this\n });\n }\n };\n if (this.usingVirtualDom) {\n this.virtualDom.destroyTree();\n this.usingVirtualDom = false;\n }\n this.mirror.reset();\n rebuild(event.data.node, {\n doc: this.iframe.contentDocument,\n afterAppend,\n cache: this.cache,\n mirror: this.mirror\n });\n afterAppend(this.iframe.contentDocument, event.data.node.id);\n for (const { mutationInQueue, builtNode } of collectedIframes) {\n this.attachDocumentToIframe(mutationInQueue, builtNode);\n this.newDocumentQueue = this.newDocumentQueue.filter(\n (m) => m !== mutationInQueue\n );\n }\n const { documentElement, head } = this.iframe.contentDocument;\n this.insertStyleRules(documentElement, head);\n collectedDialogs.forEach((d) => applyDialogToTopLevel(d));\n if (!this.service.state.matches(\"playing\")) {\n this.iframe.contentDocument.getElementsByTagName(\"html\")[0].classList.add(\"rrweb-paused\");\n }\n this.emitter.emit(ReplayerEvents.FullsnapshotRebuilded, event);\n if (!isSync) {\n this.waitForStylesheetLoad();\n }\n if (this.config.UNSAFE_replayCanvas) {\n void this.preloadAllImages();\n }\n }\n insertStyleRules(documentElement, head) {\n var _a2;\n const injectStylesRules = rules(\n this.config.blockClass\n ).concat(this.config.insertStyleRules);\n if (this.config.pauseAnimation) {\n injectStylesRules.push(\n \"html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }\"\n );\n }\n if (!injectStylesRules.length) {\n return;\n }\n if (this.usingVirtualDom) {\n const styleEl = this.virtualDom.createElement(\"style\");\n this.virtualDom.mirror.add(\n styleEl,\n getDefaultSN(styleEl, this.virtualDom.unserializedId)\n );\n documentElement.insertBefore(styleEl, head);\n styleEl.rules.push({\n source: IncrementalSource.StyleSheetRule,\n adds: injectStylesRules.map((cssText, index2) => ({\n rule: cssText,\n index: index2\n }))\n });\n } else {\n const styleEl = document.createElement(\"style\");\n documentElement.insertBefore(\n styleEl,\n head\n );\n for (let idx = 0; idx < injectStylesRules.length; idx++) {\n (_a2 = styleEl.sheet) == null ? void 0 : _a2.insertRule(injectStylesRules[idx], idx);\n }\n }\n }\n attachDocumentToIframe(mutation, iframeEl) {\n const mirror2 = this.usingVirtualDom ? this.virtualDom.mirror : this.mirror;\n const collectedIframes = [];\n const collectedDialogs = /* @__PURE__ */ new Set();\n const afterAppend = (builtNode, id) => {\n if (builtNode.nodeName === \"DIALOG\")\n collectedDialogs.add(builtNode);\n this.collectIframeAndAttachDocument(collectedIframes, builtNode);\n const sn = mirror2.getMeta(builtNode);\n if ((sn == null ? void 0 : sn.type) === NodeType.Element && (sn == null ? void 0 : sn.tagName.toUpperCase()) === \"HTML\") {\n const { documentElement, head } = iframeEl.contentDocument;\n this.insertStyleRules(\n documentElement,\n head\n );\n }\n if (this.usingVirtualDom) return;\n for (const plugin3 of this.config.plugins || []) {\n if (plugin3.onBuild)\n plugin3.onBuild(builtNode, {\n id,\n replayer: this\n });\n }\n };\n buildNodeWithSN(mutation.node, {\n doc: iframeEl.contentDocument,\n mirror: mirror2,\n hackCss: true,\n skipChild: false,\n afterAppend,\n cache: this.cache\n });\n afterAppend(iframeEl.contentDocument, mutation.node.id);\n for (const { mutationInQueue, builtNode } of collectedIframes) {\n this.attachDocumentToIframe(mutationInQueue, builtNode);\n this.newDocumentQueue = this.newDocumentQueue.filter(\n (m) => m !== mutationInQueue\n );\n }\n collectedDialogs.forEach((d) => applyDialogToTopLevel(d));\n }\n collectIframeAndAttachDocument(collected, builtNode) {\n if (isSerializedIframe(builtNode, this.mirror)) {\n const mutationInQueue = this.newDocumentQueue.find(\n (m) => m.parentId === this.mirror.getId(builtNode)\n );\n if (mutationInQueue) {\n collected.push({\n mutationInQueue,\n builtNode\n });\n }\n }\n }\n /**\n * pause when loading style sheet, resume when loaded all timeout exceed\n */\n waitForStylesheetLoad() {\n var _a2;\n const head = (_a2 = this.iframe.contentDocument) == null ? void 0 : _a2.head;\n if (head) {\n const unloadSheets = /* @__PURE__ */ new Set();\n let timer;\n let beforeLoadState = this.service.state;\n const stateHandler = () => {\n beforeLoadState = this.service.state;\n };\n this.emitter.on(ReplayerEvents.Start, stateHandler);\n this.emitter.on(ReplayerEvents.Pause, stateHandler);\n const unsubscribe = () => {\n this.emitter.off(ReplayerEvents.Start, stateHandler);\n this.emitter.off(ReplayerEvents.Pause, stateHandler);\n };\n head.querySelectorAll('link[rel=\"stylesheet\"]').forEach((css) => {\n if (!css.sheet) {\n unloadSheets.add(css);\n css.addEventListener(\"load\", () => {\n unloadSheets.delete(css);\n if (unloadSheets.size === 0 && timer !== -1) {\n if (beforeLoadState.matches(\"playing\")) {\n this.play(this.getCurrentTime());\n }\n this.emitter.emit(ReplayerEvents.LoadStylesheetEnd);\n if (timer) {\n clearTimeout(timer);\n }\n unsubscribe();\n }\n });\n }\n });\n if (unloadSheets.size > 0) {\n this.service.send({ type: \"PAUSE\" });\n this.emitter.emit(ReplayerEvents.LoadStylesheetStart);\n timer = setTimeout(() => {\n if (beforeLoadState.matches(\"playing\")) {\n this.play(this.getCurrentTime());\n }\n timer = -1;\n unsubscribe();\n }, this.config.loadTimeout);\n }\n }\n }\n /**\n * pause when there are some canvas drawImage args need to be loaded\n */\n async preloadAllImages() {\n const promises = [];\n for (const event of this.service.state.context.events) {\n if (event.type === EventType.IncrementalSnapshot && event.data.source === IncrementalSource.CanvasMutation) {\n promises.push(\n this.deserializeAndPreloadCanvasEvents(event.data, event)\n );\n const commands = \"commands\" in event.data ? event.data.commands : [event.data];\n commands.forEach((c2) => {\n this.preloadImages(c2, event);\n });\n }\n }\n return Promise.all(promises);\n }\n preloadImages(data, event) {\n if (data.property === \"drawImage\" && typeof data.args[0] === \"string\" && !this.imageMap.has(event)) {\n const canvas = document.createElement(\"canvas\");\n const ctx = canvas.getContext(\"2d\");\n const imgd = ctx == null ? void 0 : ctx.createImageData(canvas.width, canvas.height);\n ctx == null ? void 0 : ctx.putImageData(imgd, 0, 0);\n }\n }\n async deserializeAndPreloadCanvasEvents(data, event) {\n if (!this.canvasEventMap.has(event)) {\n const status = {\n isUnchanged: true\n };\n if (\"commands\" in data) {\n const commands = await Promise.all(\n data.commands.map(async (c2) => {\n const args = await Promise.all(\n c2.args.map(deserializeArg(this.imageMap, null, status))\n );\n return { ...c2, args };\n })\n );\n if (status.isUnchanged === false)\n this.canvasEventMap.set(event, { ...data, commands });\n } else {\n const args = await Promise.all(\n data.args.map(deserializeArg(this.imageMap, null, status))\n );\n if (status.isUnchanged === false)\n this.canvasEventMap.set(event, { ...data, args });\n }\n }\n }\n applyIncremental(e2, isSync) {\n var _a2, _b, _c;\n const { data: d } = e2;\n switch (d.source) {\n case IncrementalSource.Mutation: {\n try {\n this.applyMutation(d, isSync);\n } catch (error) {\n this.warn(`Exception in mutation ${error.message || error}`, d);\n }\n break;\n }\n case IncrementalSource.Drag:\n case IncrementalSource.TouchMove:\n case IncrementalSource.MouseMove:\n if (isSync) {\n const lastPosition = d.positions[d.positions.length - 1];\n this.mousePos = {\n x: lastPosition.x,\n y: lastPosition.y,\n id: lastPosition.id,\n debugData: d\n };\n } else {\n d.positions.forEach((p) => {\n const action = {\n doAction: () => {\n this.moveAndHover(p.x, p.y, p.id, isSync, d);\n },\n delay: p.timeOffset + e2.timestamp - this.service.state.context.baselineTime\n };\n this.timer.addAction(action);\n });\n this.timer.addAction({\n doAction() {\n },\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n delay: e2.delay - ((_a2 = d.positions[0]) == null ? void 0 : _a2.timeOffset)\n });\n }\n break;\n case IncrementalSource.MouseInteraction: {\n if (d.id === -1) {\n break;\n }\n const event = new Event(toLowerCase(MouseInteractions[d.type]));\n const target = this.mirror.getNode(d.id);\n if (!target) {\n return this.debugNodeNotFound(d, d.id);\n }\n this.emitter.emit(ReplayerEvents.MouseInteraction, {\n type: d.type,\n target\n });\n const { triggerFocus } = this.config;\n switch (d.type) {\n case MouseInteractions.Blur:\n if (\"blur\" in target) {\n target.blur();\n }\n break;\n case MouseInteractions.Focus:\n if (triggerFocus && target.focus) {\n target.focus({\n preventScroll: true\n });\n }\n break;\n case MouseInteractions.Click:\n case MouseInteractions.TouchStart:\n case MouseInteractions.TouchEnd:\n case MouseInteractions.MouseDown:\n case MouseInteractions.MouseUp:\n if (isSync) {\n if (d.type === MouseInteractions.TouchStart) {\n this.touchActive = true;\n } else if (d.type === MouseInteractions.TouchEnd) {\n this.touchActive = false;\n }\n if (d.type === MouseInteractions.MouseDown) {\n this.lastMouseDownEvent = [target, event];\n } else if (d.type === MouseInteractions.MouseUp) {\n this.lastMouseDownEvent = null;\n }\n this.mousePos = {\n x: d.x || 0,\n y: d.y || 0,\n id: d.id,\n debugData: d\n };\n } else {\n if (d.type === MouseInteractions.TouchStart) {\n this.tailPositions.length = 0;\n }\n this.moveAndHover(d.x || 0, d.y || 0, d.id, isSync, d);\n if (d.type === MouseInteractions.Click) {\n this.mouse.classList.remove(\"active\");\n void this.mouse.offsetWidth;\n this.mouse.classList.add(\"active\");\n } else if (d.type === MouseInteractions.TouchStart) {\n void this.mouse.offsetWidth;\n this.mouse.classList.add(\"touch-active\");\n } else if (d.type === MouseInteractions.TouchEnd) {\n this.mouse.classList.remove(\"touch-active\");\n } else {\n target.dispatchEvent(event);\n }\n }\n break;\n case MouseInteractions.TouchCancel:\n if (isSync) {\n this.touchActive = false;\n } else {\n this.mouse.classList.remove(\"touch-active\");\n }\n break;\n default:\n target.dispatchEvent(event);\n }\n break;\n }\n case IncrementalSource.Scroll: {\n if (d.id === -1) {\n break;\n }\n if (this.usingVirtualDom) {\n const target = this.virtualDom.mirror.getNode(d.id);\n if (!target) {\n return this.debugNodeNotFound(d, d.id);\n }\n target.scrollData = d;\n break;\n }\n this.applyScroll(d, isSync);\n break;\n }\n case IncrementalSource.ViewportResize:\n this.emitter.emit(ReplayerEvents.Resize, {\n width: d.width,\n height: d.height\n });\n break;\n case IncrementalSource.Input: {\n if (d.id === -1) {\n break;\n }\n if (this.usingVirtualDom) {\n const target = this.virtualDom.mirror.getNode(d.id);\n if (!target) {\n return this.debugNodeNotFound(d, d.id);\n }\n target.inputData = d;\n break;\n }\n this.applyInput(d);\n break;\n }\n case IncrementalSource.MediaInteraction: {\n const target = this.usingVirtualDom ? this.virtualDom.mirror.getNode(d.id) : this.mirror.getNode(d.id);\n if (!target) {\n return this.debugNodeNotFound(d, d.id);\n }\n const mediaEl = target;\n const { events } = this.service.state.context;\n this.mediaManager.mediaMutation({\n target: mediaEl,\n timeOffset: e2.timestamp - events[0].timestamp,\n mutation: d\n });\n break;\n }\n case IncrementalSource.StyleSheetRule:\n case IncrementalSource.StyleDeclaration: {\n if (this.usingVirtualDom) {\n if (d.styleId) this.constructedStyleMutations.push(d);\n else if (d.id)\n (_b = this.virtualDom.mirror.getNode(d.id)) == null ? void 0 : _b.rules.push(d);\n } else this.applyStyleSheetMutation(d);\n break;\n }\n case IncrementalSource.CanvasMutation: {\n if (!this.config.UNSAFE_replayCanvas) {\n return;\n }\n if (this.usingVirtualDom) {\n const target = this.virtualDom.mirror.getNode(\n d.id\n );\n if (!target) {\n return this.debugNodeNotFound(d, d.id);\n }\n target.canvasMutations.push({\n event: e2,\n mutation: d\n });\n } else {\n const target = this.mirror.getNode(d.id);\n if (!target) {\n return this.debugNodeNotFound(d, d.id);\n }\n void canvasMutation({\n event: e2,\n mutation: d,\n target,\n imageMap: this.imageMap,\n canvasEventMap: this.canvasEventMap,\n errorHandler: this.warnCanvasMutationFailed.bind(this)\n });\n }\n break;\n }\n case IncrementalSource.Font: {\n try {\n const fontFace = new FontFace(\n d.family,\n d.buffer ? new Uint8Array(JSON.parse(d.fontSource)) : d.fontSource,\n d.descriptors\n );\n (_c = this.iframe.contentDocument) == null ? void 0 : _c.fonts.add(fontFace);\n } catch (error) {\n this.warn(error);\n }\n break;\n }\n case IncrementalSource.Selection: {\n if (isSync) {\n this.lastSelectionData = d;\n break;\n }\n this.applySelection(d);\n break;\n }\n case IncrementalSource.AdoptedStyleSheet: {\n if (this.usingVirtualDom) this.adoptedStyleSheets.push(d);\n else this.applyAdoptedStyleSheet(d);\n break;\n }\n }\n }\n /**\n * Apply the mutation to the virtual dom or the real dom.\n * @param d - The mutation data.\n * @param isSync - Whether the mutation should be applied synchronously (while fast-forwarding).\n */\n applyMutation(d, isSync) {\n if (this.config.useVirtualDom && !this.usingVirtualDom && isSync) {\n this.usingVirtualDom = true;\n buildFromDom(this.iframe.contentDocument, this.mirror, this.virtualDom);\n if (Object.keys(this.legacy_missingNodeRetryMap).length) {\n for (const key in this.legacy_missingNodeRetryMap) {\n try {\n const value = this.legacy_missingNodeRetryMap[key];\n const virtualNode = buildFromNode(\n value.node,\n this.virtualDom,\n this.mirror\n );\n if (virtualNode) value.node = virtualNode;\n } catch (error) {\n this.warn(error);\n }\n }\n }\n }\n const mirror2 = this.usingVirtualDom ? this.virtualDom.mirror : this.mirror;\n d.removes = d.removes.filter((mutation) => {\n if (!mirror2.getNode(mutation.id)) {\n this.warnNodeNotFound(d, mutation.id);\n return false;\n }\n return true;\n });\n d.removes.forEach((mutation) => {\n var _a2;\n const target = mirror2.getNode(mutation.id);\n if (!target) {\n return;\n }\n let parent = mirror2.getNode(\n mutation.parentId\n );\n if (!parent) {\n return this.warnNodeNotFound(d, mutation.parentId);\n }\n if (mutation.isShadow && hasShadowRoot(parent)) {\n parent = parent.shadowRoot;\n }\n mirror2.removeNodeFromMap(target);\n if (parent)\n try {\n parent.removeChild(target);\n if (this.usingVirtualDom && target.nodeName === \"#text\" && parent.nodeName === \"STYLE\" && ((_a2 = parent.rules) == null ? void 0 : _a2.length) > 0)\n parent.rules = [];\n } catch (error) {\n if (error instanceof DOMException) {\n this.warn(\n \"parent could not remove child in mutation\",\n parent,\n target,\n d\n );\n } else {\n throw error;\n }\n }\n });\n const legacy_missingNodeMap = {\n ...this.legacy_missingNodeRetryMap\n };\n const queue = [];\n const nextNotInDOM = (mutation) => {\n let next = null;\n if (mutation.nextId) {\n next = mirror2.getNode(mutation.nextId);\n }\n if (mutation.nextId !== null && mutation.nextId !== void 0 && mutation.nextId !== -1 && !next) {\n return true;\n }\n return false;\n };\n const appendNode = (mutation) => {\n var _a2, _b;\n if (!this.iframe.contentDocument) {\n return this.warn(\"Looks like your replayer has been destroyed.\");\n }\n let parent = mirror2.getNode(\n mutation.parentId\n );\n if (!parent) {\n if (mutation.node.type === NodeType.Document) {\n return this.newDocumentQueue.push(mutation);\n }\n return queue.push(mutation);\n }\n if (mutation.node.isShadow) {\n if (!hasShadowRoot(parent)) {\n parent.attachShadow({ mode: \"open\" });\n parent = parent.shadowRoot;\n } else parent = parent.shadowRoot;\n }\n let previous = null;\n let next = null;\n if (mutation.previousId) {\n previous = mirror2.getNode(mutation.previousId);\n }\n if (mutation.nextId) {\n next = mirror2.getNode(mutation.nextId);\n }\n if (nextNotInDOM(mutation)) {\n return queue.push(mutation);\n }\n if (mutation.node.rootId && !mirror2.getNode(mutation.node.rootId)) {\n return;\n }\n const targetDoc = mutation.node.rootId ? mirror2.getNode(mutation.node.rootId) : this.usingVirtualDom ? this.virtualDom : this.iframe.contentDocument;\n if (isSerializedIframe(parent, mirror2)) {\n this.attachDocumentToIframe(\n mutation,\n parent\n );\n return;\n }\n const afterAppend = (node2, id) => {\n if (this.usingVirtualDom) return;\n applyDialogToTopLevel(node2);\n for (const plugin3 of this.config.plugins || []) {\n if (plugin3.onBuild) plugin3.onBuild(node2, { id, replayer: this });\n }\n };\n const target = buildNodeWithSN(mutation.node, {\n doc: targetDoc,\n // can be Document or RRDocument\n mirror: mirror2,\n // can be this.mirror or virtualDom.mirror\n skipChild: true,\n hackCss: true,\n cache: this.cache,\n /**\n * caveat: `afterAppend` only gets called on child nodes of target\n * we have to call it again below when this target was added to the DOM\n */\n afterAppend\n });\n if (mutation.previousId === -1 || mutation.nextId === -1) {\n legacy_missingNodeMap[mutation.node.id] = {\n node: target,\n mutation\n };\n return;\n }\n const parentSn = mirror2.getMeta(parent);\n if (parentSn && parentSn.type === NodeType.Element && mutation.node.type === NodeType.Text) {\n const prospectiveSiblings = Array.isArray(parent.childNodes) ? parent.childNodes : Array.from(parent.childNodes);\n if (parentSn.tagName === \"textarea\") {\n for (const c2 of prospectiveSiblings) {\n if (c2.nodeType === parent.TEXT_NODE) {\n parent.removeChild(c2);\n }\n }\n } else if (parentSn.tagName === \"style\" && prospectiveSiblings.length === 1) {\n for (const cssText of prospectiveSiblings) {\n if (cssText.nodeType === parent.TEXT_NODE && !mirror2.hasNode(cssText)) {\n target.textContent = cssText.textContent;\n parent.removeChild(cssText);\n }\n }\n }\n } else if ((parentSn == null ? void 0 : parentSn.type) === NodeType.Document) {\n const parentDoc = parent;\n if (mutation.node.type === NodeType.DocumentType && ((_a2 = parentDoc.childNodes[0]) == null ? void 0 : _a2.nodeType) === Node.DOCUMENT_TYPE_NODE)\n parentDoc.removeChild(parentDoc.childNodes[0]);\n if (target.nodeName === \"HTML\" && parentDoc.documentElement)\n parentDoc.removeChild(\n parentDoc.documentElement\n );\n }\n if (previous && previous.nextSibling && previous.nextSibling.parentNode) {\n parent.insertBefore(\n target,\n previous.nextSibling\n );\n } else if (next && next.parentNode) {\n parent.contains(next) ? parent.insertBefore(target, next) : parent.insertBefore(target, null);\n } else {\n parent.appendChild(target);\n }\n afterAppend(target, mutation.node.id);\n if (this.usingVirtualDom && target.nodeName === \"#text\" && parent.nodeName === \"STYLE\" && ((_b = parent.rules) == null ? void 0 : _b.length) > 0)\n parent.rules = [];\n if (isSerializedIframe(target, this.mirror)) {\n const targetId = this.mirror.getId(target);\n const mutationInQueue = this.newDocumentQueue.find(\n (m) => m.parentId === targetId\n );\n if (mutationInQueue) {\n this.attachDocumentToIframe(\n mutationInQueue,\n target\n );\n this.newDocumentQueue = this.newDocumentQueue.filter(\n (m) => m !== mutationInQueue\n );\n }\n }\n if (mutation.previousId || mutation.nextId) {\n this.legacy_resolveMissingNode(\n legacy_missingNodeMap,\n parent,\n target,\n mutation\n );\n }\n };\n d.adds.forEach((mutation) => {\n appendNode(mutation);\n });\n const startTime = Date.now();\n while (queue.length) {\n const resolveTrees = queueToResolveTrees(queue);\n queue.length = 0;\n if (Date.now() - startTime > 500) {\n this.warn(\n \"Timeout in the loop, please check the resolve tree data:\",\n resolveTrees\n );\n break;\n }\n for (const tree of resolveTrees) {\n const parent = mirror2.getNode(tree.value.parentId);\n if (!parent) {\n this.debug(\n \"Drop resolve tree since there is no parent for the root node.\",\n tree\n );\n } else {\n iterateResolveTree(tree, (mutation) => {\n appendNode(mutation);\n });\n }\n }\n }\n if (Object.keys(legacy_missingNodeMap).length) {\n Object.assign(this.legacy_missingNodeRetryMap, legacy_missingNodeMap);\n }\n uniqueTextMutations(d.texts).forEach((mutation) => {\n var _a2;\n const target = mirror2.getNode(mutation.id);\n if (!target) {\n if (d.removes.find((r2) => r2.id === mutation.id)) {\n return;\n }\n return this.warnNodeNotFound(d, mutation.id);\n }\n const parentEl = target.parentElement;\n if (mutation.value && parentEl && parentEl.tagName === \"STYLE\") {\n target.textContent = adaptCssForReplay(mutation.value, this.cache);\n } else {\n target.textContent = mutation.value;\n }\n if (this.usingVirtualDom) {\n const parent = target.parentNode;\n if (((_a2 = parent == null ? void 0 : parent.rules) == null ? void 0 : _a2.length) > 0) parent.rules = [];\n }\n });\n d.attributes.forEach((mutation) => {\n var _a2;\n const target = mirror2.getNode(mutation.id);\n if (!target) {\n if (d.removes.find((r2) => r2.id === mutation.id)) {\n return;\n }\n return this.warnNodeNotFound(d, mutation.id);\n }\n for (const attributeName in mutation.attributes) {\n if (typeof attributeName === \"string\") {\n const value = mutation.attributes[attributeName];\n if (value === null) {\n target.removeAttribute(attributeName);\n if (attributeName === \"open\")\n removeDialogFromTopLevel(target, mutation);\n } else if (typeof value === \"string\") {\n try {\n if (attributeName === \"_cssText\" && (target.nodeName === \"LINK\" || target.nodeName === \"STYLE\")) {\n try {\n const newSn = mirror2.getMeta(\n target\n );\n Object.assign(\n newSn.attributes,\n mutation.attributes\n );\n const newNode = buildNodeWithSN(newSn, {\n doc: target.ownerDocument,\n // can be Document or RRDocument\n mirror: mirror2,\n skipChild: true,\n hackCss: true,\n cache: this.cache\n });\n const siblingNode = target.nextSibling;\n const parentNode2 = target.parentNode;\n if (newNode && parentNode2) {\n parentNode2.removeChild(target);\n parentNode2.insertBefore(\n newNode,\n siblingNode\n );\n mirror2.replace(mutation.id, newNode);\n break;\n }\n } catch (e2) {\n }\n }\n if (attributeName === \"value\" && target.nodeName === \"TEXTAREA\") {\n const textarea = target;\n textarea.childNodes.forEach(\n (c2) => textarea.removeChild(c2)\n );\n const tn = (_a2 = target.ownerDocument) == null ? void 0 : _a2.createTextNode(value);\n if (tn) {\n textarea.appendChild(tn);\n }\n } else {\n target.setAttribute(\n attributeName,\n value\n );\n }\n if (attributeName === \"rr_open_mode\" && target.nodeName === \"DIALOG\") {\n applyDialogToTopLevel(target, mutation);\n }\n } catch (error) {\n this.warn(\n \"An error occurred may due to the checkout feature.\",\n error\n );\n }\n } else if (attributeName === \"style\") {\n const styleValues = value;\n const targetEl = target;\n for (const s2 in styleValues) {\n if (styleValues[s2] === false) {\n targetEl.style.removeProperty(s2);\n } else if (styleValues[s2] instanceof Array) {\n const svp = styleValues[s2];\n targetEl.style.setProperty(s2, svp[0], svp[1]);\n } else {\n const svs = styleValues[s2];\n targetEl.style.setProperty(s2, svs);\n }\n }\n }\n }\n }\n });\n }\n /**\n * Apply the scroll data on real elements.\n * If the replayer is in sync mode, smooth scroll behavior should be disabled.\n * @param d - the scroll data\n * @param isSync - whether the replayer is in sync mode(fast-forward)\n */\n applyScroll(d, isSync) {\n var _a2, _b;\n const target = this.mirror.getNode(d.id);\n if (!target) {\n return this.debugNodeNotFound(d, d.id);\n }\n const sn = this.mirror.getMeta(target);\n if (target === this.iframe.contentDocument) {\n (_a2 = this.iframe.contentWindow) == null ? void 0 : _a2.scrollTo({\n top: d.y,\n left: d.x,\n behavior: isSync ? \"auto\" : \"smooth\"\n });\n } else if ((sn == null ? void 0 : sn.type) === NodeType.Document) {\n (_b = target.defaultView) == null ? void 0 : _b.scrollTo({\n top: d.y,\n left: d.x,\n behavior: isSync ? \"auto\" : \"smooth\"\n });\n } else {\n try {\n target.scrollTo({\n top: d.y,\n left: d.x,\n behavior: isSync ? \"auto\" : \"smooth\"\n });\n } catch (error) {\n }\n }\n }\n applyInput(d) {\n const target = this.mirror.getNode(d.id);\n if (!target) {\n return this.debugNodeNotFound(d, d.id);\n }\n try {\n target.checked = d.isChecked;\n target.value = d.text;\n } catch (error) {\n }\n }\n applySelection(d) {\n try {\n const selectionSet = /* @__PURE__ */ new Set();\n const ranges = d.ranges.map(({ start, startOffset, end, endOffset }) => {\n const startContainer = this.mirror.getNode(start);\n const endContainer = this.mirror.getNode(end);\n if (!startContainer || !endContainer) return;\n const result2 = new Range();\n result2.setStart(startContainer, startOffset);\n result2.setEnd(endContainer, endOffset);\n const doc = startContainer.ownerDocument;\n const selection = doc == null ? void 0 : doc.getSelection();\n selection && selectionSet.add(selection);\n return {\n range: result2,\n selection\n };\n });\n selectionSet.forEach((s2) => s2.removeAllRanges());\n ranges.forEach((r2) => {\n var _a2;\n return r2 && ((_a2 = r2.selection) == null ? void 0 : _a2.addRange(r2.range));\n });\n } catch (error) {\n }\n }\n applyStyleSheetMutation(data) {\n var _a2;\n let styleSheet = null;\n if (data.styleId) styleSheet = this.styleMirror.getStyle(data.styleId);\n else if (data.id)\n styleSheet = ((_a2 = this.mirror.getNode(data.id)) == null ? void 0 : _a2.sheet) || null;\n if (!styleSheet) return;\n if (data.source === IncrementalSource.StyleSheetRule)\n this.applyStyleSheetRule(data, styleSheet);\n else if (data.source === IncrementalSource.StyleDeclaration)\n this.applyStyleDeclaration(data, styleSheet);\n }\n applyStyleSheetRule(data, styleSheet) {\n var _a2, _b, _c, _d;\n (_a2 = data.adds) == null ? void 0 : _a2.forEach(({ rule: rule2, index: nestedIndex }) => {\n try {\n if (Array.isArray(nestedIndex)) {\n const { positions, index: index2 } = getPositionsAndIndex(nestedIndex);\n const nestedRule = getNestedRule(styleSheet.cssRules, positions);\n nestedRule.insertRule(rule2, index2);\n } else {\n const index2 = nestedIndex === void 0 ? void 0 : Math.min(nestedIndex, styleSheet.cssRules.length);\n styleSheet == null ? void 0 : styleSheet.insertRule(rule2, index2);\n }\n } catch (e2) {\n }\n });\n (_b = data.removes) == null ? void 0 : _b.forEach(({ index: nestedIndex }) => {\n try {\n if (Array.isArray(nestedIndex)) {\n const { positions, index: index2 } = getPositionsAndIndex(nestedIndex);\n const nestedRule = getNestedRule(styleSheet.cssRules, positions);\n nestedRule.deleteRule(index2 || 0);\n } else {\n styleSheet == null ? void 0 : styleSheet.deleteRule(nestedIndex);\n }\n } catch (e2) {\n }\n });\n if (data.replace)\n try {\n void ((_c = styleSheet.replace) == null ? void 0 : _c.call(styleSheet, data.replace));\n } catch (e2) {\n }\n if (data.replaceSync)\n try {\n (_d = styleSheet.replaceSync) == null ? void 0 : _d.call(styleSheet, data.replaceSync);\n } catch (e2) {\n }\n }\n applyStyleDeclaration(data, styleSheet) {\n if (data.set) {\n const rule2 = getNestedRule(\n styleSheet.rules,\n data.index\n );\n rule2.style.setProperty(\n data.set.property,\n data.set.value,\n data.set.priority\n );\n }\n if (data.remove) {\n const rule2 = getNestedRule(\n styleSheet.rules,\n data.index\n );\n rule2.style.removeProperty(data.remove.property);\n }\n }\n applyAdoptedStyleSheet(data) {\n var _a2;\n const targetHost = this.mirror.getNode(data.id);\n if (!targetHost) return;\n (_a2 = data.styles) == null ? void 0 : _a2.forEach((style) => {\n var _a3;\n let newStyleSheet = null;\n let hostWindow = null;\n if (hasShadowRoot(targetHost))\n hostWindow = ((_a3 = targetHost.ownerDocument) == null ? void 0 : _a3.defaultView) || null;\n else if (targetHost.nodeName === \"#document\")\n hostWindow = targetHost.defaultView;\n if (!hostWindow) return;\n try {\n newStyleSheet = new hostWindow.CSSStyleSheet();\n this.styleMirror.add(newStyleSheet, style.styleId);\n this.applyStyleSheetRule(\n {\n source: IncrementalSource.StyleSheetRule,\n adds: style.rules\n },\n newStyleSheet\n );\n } catch (e2) {\n }\n });\n const MAX_RETRY_TIME = 10;\n let count = 0;\n const adoptStyleSheets = (targetHost2, styleIds) => {\n const stylesToAdopt = styleIds.map((styleId) => this.styleMirror.getStyle(styleId)).filter((style) => style !== null);\n if (hasShadowRoot(targetHost2))\n targetHost2.shadowRoot.adoptedStyleSheets = stylesToAdopt;\n else if (targetHost2.nodeName === \"#document\")\n targetHost2.adoptedStyleSheets = stylesToAdopt;\n if (stylesToAdopt.length !== styleIds.length && count < MAX_RETRY_TIME) {\n setTimeout(\n () => adoptStyleSheets(targetHost2, styleIds),\n 0 + 100 * count\n );\n count++;\n }\n };\n adoptStyleSheets(targetHost, data.styleIds);\n }\n legacy_resolveMissingNode(map, parent, target, targetMutation) {\n const { previousId, nextId } = targetMutation;\n const previousInMap = previousId && map[previousId];\n const nextInMap = nextId && map[nextId];\n if (previousInMap) {\n const { node: node2, mutation } = previousInMap;\n parent.insertBefore(node2, target);\n delete map[mutation.node.id];\n delete this.legacy_missingNodeRetryMap[mutation.node.id];\n if (mutation.previousId || mutation.nextId) {\n this.legacy_resolveMissingNode(map, parent, node2, mutation);\n }\n }\n if (nextInMap) {\n const { node: node2, mutation } = nextInMap;\n parent.insertBefore(\n node2,\n target.nextSibling\n );\n delete map[mutation.node.id];\n delete this.legacy_missingNodeRetryMap[mutation.node.id];\n if (mutation.previousId || mutation.nextId) {\n this.legacy_resolveMissingNode(map, parent, node2, mutation);\n }\n }\n }\n moveAndHover(x2, y, id, isSync, debugData) {\n const target = this.mirror.getNode(id);\n if (!target) {\n return this.debugNodeNotFound(debugData, id);\n }\n const base = getBaseDimension(target, this.iframe);\n const _x = x2 * base.absoluteScale + base.x;\n const _y = y * base.absoluteScale + base.y;\n this.mouse.style.left = `${_x}px`;\n this.mouse.style.top = `${_y}px`;\n if (!isSync) {\n this.drawMouseTail({ x: _x, y: _y });\n }\n this.hoverElements(target);\n }\n drawMouseTail(position) {\n if (!this.mouseTail) {\n return;\n }\n const { lineCap, lineWidth, strokeStyle, duration } = this.config.mouseTail === true ? defaultMouseTailConfig : Object.assign({}, defaultMouseTailConfig, this.config.mouseTail);\n const draw = () => {\n if (!this.mouseTail) {\n return;\n }\n const ctx = this.mouseTail.getContext(\"2d\");\n if (!ctx || !this.tailPositions.length) {\n return;\n }\n ctx.clearRect(0, 0, this.mouseTail.width, this.mouseTail.height);\n ctx.beginPath();\n ctx.lineWidth = lineWidth;\n ctx.lineCap = lineCap;\n ctx.strokeStyle = strokeStyle;\n ctx.moveTo(this.tailPositions[0].x, this.tailPositions[0].y);\n this.tailPositions.forEach((p) => ctx.lineTo(p.x, p.y));\n ctx.stroke();\n };\n this.tailPositions.push(position);\n draw();\n setTimeout(() => {\n this.tailPositions = this.tailPositions.filter((p) => p !== position);\n draw();\n }, duration / this.speedService.state.context.timer.speed);\n }\n hoverElements(el) {\n var _a2;\n (_a2 = this.lastHoveredRootNode || this.iframe.contentDocument) == null ? void 0 : _a2.querySelectorAll(\".\\\\:hover\").forEach((hoveredEl) => {\n hoveredEl.classList.remove(\":hover\");\n });\n this.lastHoveredRootNode = el.getRootNode();\n let currentEl = el;\n while (currentEl) {\n if (currentEl.classList) {\n currentEl.classList.add(\":hover\");\n }\n currentEl = currentEl.parentElement;\n }\n }\n isUserInteraction(event) {\n if (event.type !== EventType.IncrementalSnapshot) {\n return false;\n }\n return event.data.source > IncrementalSource.Mutation && event.data.source <= IncrementalSource.Input;\n }\n backToNormal() {\n this.nextUserInteractionEvent = null;\n if (this.speedService.state.matches(\"normal\")) {\n return;\n }\n this.speedService.send({ type: \"BACK_TO_NORMAL\" });\n this.emitter.emit(ReplayerEvents.SkipEnd, {\n speed: this.speedService.state.context.normalSpeed\n });\n }\n warnNodeNotFound(d, id) {\n this.warn(`Node with id '${id}' not found. `, d);\n }\n warnCanvasMutationFailed(d, error) {\n this.warn(`Has error on canvas update`, error, \"canvas mutation:\", d);\n }\n debugNodeNotFound(d, id) {\n this.debug(`Node with id '${id}' not found. `, d);\n }\n warn(...args) {\n if (!this.config.showWarning) {\n return;\n }\n this.config.logger.warn(REPLAY_CONSOLE_PREFIX, ...args);\n }\n debug(...args) {\n if (!this.config.showDebug) {\n return;\n }\n this.config.logger.log(REPLAY_CONSOLE_PREFIX, ...args);\n }\n}\nconst { addCustomEvent } = record;\nconst { freezePage } = record;\nconst { takeFullSnapshot } = record;\nexport {\n EventType,\n IncrementalSource,\n MouseInteractions,\n Replayer,\n ReplayerEvents,\n addCustomEvent,\n canvasMutation,\n freezePage,\n _mirror as mirror,\n record,\n takeFullSnapshot,\n utils\n};\n//# sourceMappingURL=rrweb.js.map\n","/**\n * PowerIT CMS Tracker - Session Management\n * Handles session creation, persistence, and lifecycle\n */\n\nconst DEFAULT_SESSION_TIMEOUT = 30 * 60 * 1000; // 30 minutes\n\n/**\n * Session Manager\n * Manages visitor and session IDs with persistence\n */\nexport class SessionManager {\n /**\n * Create a session manager instance\n * @param {Object} [options] - Configuration options\n * @param {string} [options.storageKey='powerit_tracker'] - Storage key prefix\n * @param {number} [options.sessionTimeout=1800000] - Session timeout in ms (default: 30 min)\n */\n constructor(options = {}) {\n this.storageKey = options.storageKey || 'powerit_tracker';\n this.sessionTimeout = options.sessionTimeout || DEFAULT_SESSION_TIMEOUT;\n this.session = null;\n }\n\n /**\n * Get or create a session\n * Returns existing session if valid, otherwise creates a new one\n * @returns {Object}\n */\n getOrCreateSession() {\n const stored = this._getStoredSession();\n\n if (stored && !this._isExpired(stored)) {\n this.session = stored;\n this.session.lastActivityAt = Date.now();\n this._saveSession();\n return this.session;\n }\n\n return this._createSession();\n }\n\n /**\n * Get current session\n * @returns {Object|null}\n */\n getSession() {\n return this.session;\n }\n\n /**\n * Get visitor ID\n * @returns {string|null}\n */\n getVisitorId() {\n return this.session?.visitorId || null;\n }\n\n /**\n * Get session ID\n * @returns {string|null}\n */\n getSessionId() {\n return this.session?.sessionId || null;\n }\n\n /**\n * Link to analytics session if available\n * @param {Object} analyticsTracker - Analytics tracker instance\n */\n linkToAnalytics(analyticsTracker) {\n if (!this.session || !analyticsTracker) return;\n\n const analyticsVisitorId = analyticsTracker.getVisitorId?.();\n const analyticsSessionId = analyticsTracker.getSessionId?.();\n\n if (analyticsVisitorId) {\n this.session.visitorId = analyticsVisitorId;\n }\n if (analyticsSessionId) {\n this.session.linkedToAnalytics = true;\n this.session.analyticsSessionId = analyticsSessionId;\n }\n this._saveSession();\n }\n\n /**\n * Update activity timestamp (keep session alive)\n */\n touch() {\n if (this.session) {\n this.session.lastActivityAt = Date.now();\n this._saveSession();\n }\n }\n\n /**\n * Increment event count\n * @param {number} [count=1] - Number of events to add\n */\n incrementEventCount(count = 1) {\n if (this.session) {\n this.session.eventCount += count;\n }\n }\n\n /**\n * End the current session\n */\n endSession() {\n this._clearSession();\n this.session = null;\n }\n\n /**\n * Check if session is valid\n * @returns {boolean}\n */\n isSessionValid() {\n return this.session && !this._isExpired(this.session);\n }\n\n // ============================================================================\n // Private Methods\n // ============================================================================\n\n /**\n * Create a new session\n * @private\n */\n _createSession() {\n this.session = {\n sessionId: this._generateId(),\n visitorId: this._getOrCreateVisitorId(),\n startedAt: Date.now(),\n lastActivityAt: Date.now(),\n entryPage: typeof window !== 'undefined' ? window.location.pathname : '/',\n entryUrl: typeof window !== 'undefined' ? window.location.href : '/',\n eventCount: 0,\n linkedToAnalytics: false,\n analyticsSessionId: null\n };\n this._saveSession();\n return this.session;\n }\n\n /**\n * Generate a UUID v4\n * @private\n */\n _generateId() {\n // Use crypto.randomUUID if available (modern browsers)\n if (typeof crypto !== 'undefined' && crypto.randomUUID) {\n return crypto.randomUUID();\n }\n\n // Fallback to manual generation\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {\n const r = (Math.random() * 16) | 0;\n const v = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n }\n\n /**\n * Get or create a persistent visitor ID\n * @private\n */\n _getOrCreateVisitorId() {\n if (typeof localStorage === 'undefined') {\n return this._generateId();\n }\n\n const key = `${this.storageKey}_visitor`;\n let visitorId = localStorage.getItem(key);\n\n if (!visitorId) {\n visitorId = this._generateId();\n try {\n localStorage.setItem(key, visitorId);\n } catch {\n // Storage full or unavailable\n }\n }\n\n return visitorId;\n }\n\n /**\n * Get stored session from sessionStorage\n * @private\n */\n _getStoredSession() {\n if (typeof sessionStorage === 'undefined') return null;\n\n try {\n const data = sessionStorage.getItem(`${this.storageKey}_session`);\n return data ? JSON.parse(data) : null;\n } catch {\n return null;\n }\n }\n\n /**\n * Save session to sessionStorage\n * @private\n */\n _saveSession() {\n if (typeof sessionStorage === 'undefined' || !this.session) return;\n\n try {\n sessionStorage.setItem(\n `${this.storageKey}_session`,\n JSON.stringify(this.session)\n );\n } catch {\n // Storage full or unavailable\n }\n }\n\n /**\n * Clear session from sessionStorage\n * @private\n */\n _clearSession() {\n if (typeof sessionStorage === 'undefined') return;\n sessionStorage.removeItem(`${this.storageKey}_session`);\n }\n\n /**\n * Check if session has expired\n * @private\n */\n _isExpired(session) {\n return Date.now() - session.lastActivityAt > this.sessionTimeout;\n }\n}\n\n/**\n * Create a session manager instance\n * @param {Object} [options] - Configuration options\n * @returns {SessionManager}\n */\nexport function createSessionManager(options) {\n return new SessionManager(options);\n}\n\nexport default SessionManager;\n","/**\n * PowerIT CMS Tracker - Privacy Controls\n * Privacy utilities and default configuration\n */\n\n/**\n * Default privacy configuration\n * Privacy-first: mask inputs by default\n */\nexport const DEFAULT_PRIVACY_CONFIG = {\n respectDoNotTrack: true,\n blockClass: 'rr-block',\n blockSelector: null,\n ignoreClass: 'rr-ignore',\n ignoreSelector: null,\n maskTextClass: 'rr-mask',\n maskTextSelector: null,\n maskAllInputs: true, // Privacy-first default\n maskInputOptions: {\n password: true,\n email: true,\n tel: true,\n creditCard: true,\n text: false,\n textarea: false,\n select: false\n },\n blockedPages: [],\n allowedPages: []\n};\n\n/**\n * Sensitive selectors that should always be masked/blocked\n */\nexport const SENSITIVE_SELECTORS = [\n 'input[type=\"password\"]',\n 'input[name*=\"credit\"]',\n 'input[name*=\"card\"]',\n 'input[name*=\"cvv\"]',\n 'input[name*=\"ssn\"]',\n 'input[autocomplete=\"cc-number\"]',\n 'input[autocomplete=\"cc-csc\"]',\n 'input[autocomplete=\"cc-exp\"]',\n '[data-sensitive]',\n '[data-private]',\n '[data-no-record]'\n];\n\n/**\n * Check if Do Not Track is enabled in the browser\n * @returns {boolean}\n */\nexport function isDoNotTrackEnabled() {\n if (typeof navigator === 'undefined') return false;\n return (\n navigator.doNotTrack === '1' ||\n navigator.doNotTrack === 'yes' ||\n (typeof window !== 'undefined' && window.doNotTrack === '1')\n );\n}\n\n/**\n * Check if the current page should be recorded based on page filters\n * @param {Object} config - Privacy configuration\n * @param {string} currentPath - Current page path\n * @returns {boolean}\n */\nexport function shouldRecordPage(config, currentPath) {\n const { blockedPages = [], allowedPages = [] } = config;\n\n // If allowedPages is set, only record those pages\n if (allowedPages.length > 0) {\n return allowedPages.some(pattern => matchPattern(pattern, currentPath));\n }\n\n // Check if page is in blocked list\n if (blockedPages.length > 0) {\n return !blockedPages.some(pattern => matchPattern(pattern, currentPath));\n }\n\n return true;\n}\n\n/**\n * Match a path against a pattern (string or regex)\n * @param {string|RegExp} pattern - Pattern to match\n * @param {string} path - Path to check\n * @returns {boolean}\n */\nfunction matchPattern(pattern, path) {\n if (pattern instanceof RegExp) {\n return pattern.test(path);\n }\n // String patterns: match exact or prefix\n if (pattern.endsWith('*')) {\n return path.startsWith(pattern.slice(0, -1));\n }\n return path === pattern || path.startsWith(pattern + '/');\n}\n\n/**\n * Build rrweb-compatible privacy configuration\n * @param {Object} config - Privacy configuration\n * @returns {Object}\n */\nexport function buildRrwebPrivacyConfig(config) {\n const mergedConfig = { ...DEFAULT_PRIVACY_CONFIG, ...config };\n\n // Build block selector including sensitive elements\n let blockSelector = mergedConfig.blockSelector || '';\n if (blockSelector && !blockSelector.endsWith(',')) {\n blockSelector += ',';\n }\n blockSelector += SENSITIVE_SELECTORS.filter(sel => sel.includes('[data-')).join(',');\n\n // Build mask selector for sensitive inputs\n let maskTextSelector = mergedConfig.maskTextSelector || '';\n\n return {\n blockClass: mergedConfig.blockClass,\n blockSelector: blockSelector || null,\n ignoreClass: mergedConfig.ignoreClass,\n ignoreSelector: mergedConfig.ignoreSelector || null,\n maskTextClass: mergedConfig.maskTextClass,\n maskTextSelector: maskTextSelector || null,\n maskAllInputs: mergedConfig.maskAllInputs,\n maskInputOptions: {\n ...DEFAULT_PRIVACY_CONFIG.maskInputOptions,\n ...mergedConfig.maskInputOptions\n },\n maskInputFn: mergedConfig.maskInputFn,\n maskTextFn: mergedConfig.maskTextFn,\n inlineStylesheet: true,\n // Slim down DOM to reduce data\n slimDOMOptions: {\n script: true,\n comment: true,\n headFavicon: true,\n headWhitespace: true,\n headMetaDescKeywords: true,\n headMetaSocial: true,\n headMetaRobots: true,\n headMetaHttpEquiv: true,\n headMetaAuthorship: true,\n headMetaVerification: true\n }\n };\n}\n\n/**\n * Merge user privacy config with defaults\n * @param {Object} userConfig - User-provided privacy configuration\n * @returns {Object}\n */\nexport function mergePrivacyConfig(userConfig = {}) {\n return {\n ...DEFAULT_PRIVACY_CONFIG,\n ...userConfig,\n maskInputOptions: {\n ...DEFAULT_PRIVACY_CONFIG.maskInputOptions,\n ...userConfig.maskInputOptions\n }\n };\n}\n\nexport default {\n DEFAULT_PRIVACY_CONFIG,\n SENSITIVE_SELECTORS,\n isDoNotTrackEnabled,\n shouldRecordPage,\n buildRrwebPrivacyConfig,\n mergePrivacyConfig\n};\n","/**\n * PowerIT CMS Tracker - Event Compression\n * Utilities for compressing and decompressing rrweb events\n */\n\n/**\n * Compress events using browser's CompressionStream API\n * Falls back to uncompressed if not available\n * @param {Array} events - Array of rrweb events\n * @returns {Promise<Object>}\n */\nexport async function compressEvents(events) {\n const jsonString = JSON.stringify(events);\n\n // Use CompressionStream if available (Chrome 80+, Edge 80+, Safari 16.4+)\n if (typeof CompressionStream !== 'undefined') {\n try {\n const encoder = new TextEncoder();\n const data = encoder.encode(jsonString);\n\n const stream = new Blob([data])\n .stream()\n .pipeThrough(new CompressionStream('gzip'));\n\n const compressedBlob = await new Response(stream).blob();\n const arrayBuffer = await compressedBlob.arrayBuffer();\n const base64 = arrayBufferToBase64(arrayBuffer);\n\n return {\n type: 'gzip',\n data: base64,\n originalSize: jsonString.length,\n compressedSize: base64.length\n };\n } catch (error) {\n // Fall through to uncompressed\n console.warn('Compression failed, using uncompressed:', error.message);\n }\n }\n\n // Fallback: return uncompressed JSON\n return {\n type: 'none',\n data: jsonString,\n originalSize: jsonString.length,\n compressedSize: jsonString.length\n };\n}\n\n/**\n * Decompress events (for debugging/testing)\n * @param {Object} compressed - Compressed event object\n * @returns {Promise<Array>}\n */\nexport async function decompressEvents(compressed) {\n if (!compressed || !compressed.type) {\n throw new Error('Invalid compressed data');\n }\n\n if (compressed.type === 'none') {\n return JSON.parse(compressed.data);\n }\n\n if (compressed.type === 'gzip') {\n if (typeof DecompressionStream === 'undefined') {\n throw new Error('DecompressionStream not available');\n }\n\n try {\n const binaryString = atob(compressed.data);\n const bytes = new Uint8Array(binaryString.length);\n for (let i = 0; i < binaryString.length; i++) {\n bytes[i] = binaryString.charCodeAt(i);\n }\n\n const stream = new Blob([bytes])\n .stream()\n .pipeThrough(new DecompressionStream('gzip'));\n\n const text = await new Response(stream).text();\n return JSON.parse(text);\n } catch (error) {\n throw new Error(`Decompression failed: ${error.message}`);\n }\n }\n\n throw new Error(`Unknown compression type: ${compressed.type}`);\n}\n\n/**\n * Convert ArrayBuffer to Base64 string\n * @param {ArrayBuffer} buffer - ArrayBuffer to convert\n * @returns {string}\n */\nfunction arrayBufferToBase64(buffer) {\n const bytes = new Uint8Array(buffer);\n let binary = '';\n for (let i = 0; i < bytes.byteLength; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return btoa(binary);\n}\n\n/**\n * Estimate compression ratio for given events\n * @param {Array} events - Array of rrweb events\n * @returns {Promise<Object>}\n */\nexport async function estimateCompression(events) {\n const result = await compressEvents(events);\n const ratio = result.originalSize / result.compressedSize;\n\n return {\n originalSize: result.originalSize,\n compressedSize: result.compressedSize,\n ratio: ratio.toFixed(2),\n savings: `${((1 - 1 / ratio) * 100).toFixed(1)}%`,\n type: result.type\n };\n}\n\nexport default {\n compressEvents,\n decompressEvents,\n estimateCompression\n};\n","/**\n * PowerIT CMS Tracker - Session Recorder\n * Main recorder class using rrweb for DOM recording\n */\n\nimport { record } from 'rrweb';\nimport { createGrpcTransport } from '@powerit/cms-grpc';\nimport { SessionManager } from './session.js';\nimport {\n isDoNotTrackEnabled,\n shouldRecordPage,\n buildRrwebPrivacyConfig,\n mergePrivacyConfig\n} from './privacy.js';\nimport { compressEvents } from './compression.js';\n\n/**\n * Default recorder configuration\n */\nconst DEFAULT_CONFIG = {\n transport: 'http',\n batchSize: 50,\n flushInterval: 5000,\n maxQueueSize: 500,\n compress: true,\n checkoutEveryNth: 200,\n checkoutEveryNms: 300000, // 5 minutes\n sessionTimeout: 1800000, // 30 minutes\n storageKey: 'powerit_tracker'\n};\n\n/**\n * No-op logger\n */\nconst noopLogger = {\n debug: () => {},\n info: () => {},\n warn: () => {},\n error: () => {}\n};\n\n/**\n * Default console logger\n */\nconst defaultLogger = {\n debug: (...args) => console.debug('[Tracker]', ...args),\n info: (...args) => console.info('[Tracker]', ...args),\n warn: (...args) => console.warn('[Tracker]', ...args),\n error: (...args) => console.error('[Tracker]', ...args)\n};\n\n/**\n * Session Recorder\n * Records user sessions using rrweb and sends them to the CMS backend\n */\nexport class SessionRecorder {\n /**\n * Create a session recorder instance\n * @param {Object} client - CMS client instance\n * @param {Object} [config] - Recorder configuration\n */\n constructor(client, config = {}) {\n if (!client) {\n throw new Error('CMS client instance is required');\n }\n\n this.client = client;\n this.config = { ...DEFAULT_CONFIG, ...config };\n this.privacyConfig = mergePrivacyConfig(config.privacy);\n\n // State\n this.isInitialized = false;\n this.recording = false;\n this.enabled = true;\n this.stopFn = null;\n this.eventQueue = [];\n this.flushTimer = null;\n\n // Session management\n this.sessionManager = new SessionManager({\n storageKey: this.config.storageKey,\n sessionTimeout: this.config.sessionTimeout\n });\n\n // Transport\n this.transport = null;\n\n // Logger\n this._setupLogger();\n\n // Check Do Not Track\n if (this.privacyConfig.respectDoNotTrack && isDoNotTrackEnabled()) {\n this.enabled = false;\n this.logger.info('Tracker disabled due to Do Not Track preference');\n }\n }\n\n /**\n * Initialize the recorder\n * @returns {Promise<SessionRecorder>}\n */\n async init() {\n if (this.isInitialized || !this.enabled) return this;\n\n // Check page allowlist/blocklist\n if (typeof window !== 'undefined') {\n const currentPath = window.location.pathname;\n if (!shouldRecordPage(this.privacyConfig, currentPath)) {\n this.enabled = false;\n this.logger.info('Recording disabled for this page');\n return this;\n }\n }\n\n // Initialize transport\n const clientConfig = this.client.getConfig();\n this.transport = createGrpcTransport({\n baseUrl: this.config.transportUrl || clientConfig.baseUrl,\n apiKey: clientConfig.apiKey,\n logger: this.logger\n });\n\n await this.transport.connect();\n\n // Link to analytics if available\n if (this.client.analytics) {\n this.sessionManager.linkToAnalytics(this.client.analytics);\n }\n\n // Get or create session\n this.sessionManager.getOrCreateSession();\n\n // Setup page unload handler\n this._setupUnloadHandler();\n\n this.isInitialized = true;\n this.logger.debug('Tracker initialized');\n\n return this;\n }\n\n /**\n * Start recording\n */\n start() {\n if (!this.isInitialized || !this.enabled || this.recording) return;\n\n // Build rrweb configuration\n const rrwebConfig = {\n emit: (event, isCheckout) => this._handleEvent(event, isCheckout),\n checkoutEveryNth: this.config.checkoutEveryNth,\n checkoutEveryNms: this.config.checkoutEveryNms,\n\n // Privacy settings from buildRrwebPrivacyConfig\n ...buildRrwebPrivacyConfig(this.privacyConfig),\n\n // Recording settings\n recordCanvas: this.config.recording?.recordCanvas || false,\n recordCrossOriginIframes: this.config.recording?.recordCrossOriginIframes || false,\n inlineStylesheet: this.config.recording?.inlineStylesheet ?? true,\n inlineImages: this.config.recording?.inlineImages || false,\n collectFonts: this.config.recording?.collectFonts || false,\n\n // Sampling configuration\n sampling: this._buildSamplingConfig(),\n\n // Error handling\n errorHandler: error => {\n this.logger.error('rrweb error:', error);\n this.config.onError?.(error);\n }\n };\n\n this.stopFn = record(rrwebConfig);\n this.recording = true;\n\n // Start flush timer\n this._startFlushTimer();\n\n this.logger.debug('Recording started');\n }\n\n /**\n * Pause recording (keeps session active)\n */\n pause() {\n if (this.stopFn) {\n this.stopFn();\n this.stopFn = null;\n }\n this.recording = false;\n this._stopFlushTimer();\n this.logger.debug('Recording paused');\n }\n\n /**\n * Resume recording\n */\n resume() {\n if (!this.recording && this.enabled) {\n this.start();\n }\n }\n\n /**\n * Stop recording and flush events\n * @returns {Promise<void>}\n */\n async stop() {\n this.pause();\n await this.flush();\n this.logger.debug('Recording stopped');\n }\n\n /**\n * Check if currently recording\n * @returns {boolean}\n */\n isRecording() {\n return this.recording;\n }\n\n /**\n * Check if tracking is enabled\n * @returns {boolean}\n */\n isEnabled() {\n return this.enabled;\n }\n\n /**\n * Get current session info\n * @returns {Object|null}\n */\n getSession() {\n return this.sessionManager.getSession();\n }\n\n /**\n * Get visitor ID\n * @returns {string|null}\n */\n getVisitorId() {\n return this.sessionManager.getVisitorId();\n }\n\n /**\n * Get session ID\n * @returns {string|null}\n */\n getSessionId() {\n return this.sessionManager.getSessionId();\n }\n\n /**\n * Flush pending events\n * @returns {Promise<void>}\n */\n async flush() {\n if (this.eventQueue.length === 0) return;\n\n const events = [...this.eventQueue];\n this.eventQueue = [];\n\n // Prepare payload\n let eventsData;\n if (this.config.compress) {\n eventsData = await compressEvents(events);\n } else {\n eventsData = {\n type: 'none',\n data: JSON.stringify(events)\n };\n }\n\n const payload = {\n session_id: this.getSessionId(),\n visitor_id: this.getVisitorId(),\n events: eventsData,\n event_count: events.length,\n timestamp: Date.now()\n };\n\n try {\n await this.transport.send({\n endpoint: '/api/public/tracker/events',\n method: 'POST',\n data: payload\n });\n\n this.sessionManager.incrementEventCount(events.length);\n this.logger.debug(`Flushed ${events.length} events`);\n } catch (error) {\n // Re-queue events on failure\n this.eventQueue = [...events, ...this.eventQueue];\n this.logger.warn('Failed to flush events:', error.message);\n }\n }\n\n /**\n * Add a custom event to the recording\n * @param {string} tag - Event tag/name\n * @param {Object} [payload] - Event payload\n */\n addCustomEvent(tag, payload = {}) {\n if (!this.recording) return;\n\n // Use rrweb's addCustomEvent if available\n if (typeof record.addCustomEvent === 'function') {\n record.addCustomEvent(tag, payload);\n }\n }\n\n /**\n * Identify a user\n * @param {string} userId - User identifier\n * @param {Object} [traits] - User traits/properties\n */\n identify(userId, traits = {}) {\n this.addCustomEvent('identify', { userId, traits, timestamp: Date.now() });\n }\n\n /**\n * Take a full snapshot manually\n */\n takeSnapshot() {\n if (this.stopFn && typeof record.takeFullSnapshot === 'function') {\n record.takeFullSnapshot();\n }\n }\n\n /**\n * Update privacy settings at runtime\n * @param {Object} privacy - Privacy configuration updates\n */\n updatePrivacy(privacy) {\n this.privacyConfig = mergePrivacyConfig({ ...this.privacyConfig, ...privacy });\n\n // Restart recording with new config if active\n if (this.recording) {\n this.pause();\n this.start();\n }\n }\n\n /**\n * Enable recording\n */\n enable() {\n this.enabled = true;\n this.logger.info('Tracker enabled');\n }\n\n /**\n * Disable recording\n */\n disable() {\n this.enabled = false;\n this.pause();\n this.logger.info('Tracker disabled');\n }\n\n /**\n * Destroy the recorder and cleanup\n */\n destroy() {\n this.pause();\n this._removeUnloadHandler();\n\n if (this.transport) {\n this.transport.disconnect();\n }\n\n this.isInitialized = false;\n this.logger.debug('Tracker destroyed');\n }\n\n // ============================================================================\n // Private Methods\n // ============================================================================\n\n /**\n * Handle rrweb event\n * @private\n */\n _handleEvent(event, isCheckout) {\n this.eventQueue.push(event);\n this.sessionManager.touch();\n\n // Force flush on checkout or queue overflow\n if (isCheckout || this.eventQueue.length >= this.config.maxQueueSize) {\n this.flush();\n }\n }\n\n /**\n * Build sampling configuration for rrweb\n * @private\n */\n _buildSamplingConfig() {\n const sampling = this.config.sampling;\n if (!sampling?.enabled) return undefined;\n\n return {\n mousemove: sampling.mousemove ?? 50,\n mouseInteraction: sampling.mouseInteraction ?? true,\n scroll: sampling.scroll ?? 10,\n media: sampling.media ?? true,\n input: sampling.input ?? 'last'\n };\n }\n\n /**\n * Start flush timer\n * @private\n */\n _startFlushTimer() {\n this._stopFlushTimer();\n this.flushTimer = setInterval(() => {\n if (this.eventQueue.length > 0) {\n this.flush();\n }\n }, this.config.flushInterval);\n }\n\n /**\n * Stop flush timer\n * @private\n */\n _stopFlushTimer() {\n if (this.flushTimer) {\n clearInterval(this.flushTimer);\n this.flushTimer = null;\n }\n }\n\n /**\n * Setup page unload handler\n * @private\n */\n _setupUnloadHandler() {\n if (typeof window === 'undefined') return;\n\n this._unloadHandler = async () => {\n if (this.eventQueue.length > 0) {\n // Prepare payload for beacon\n let eventsData;\n if (this.config.compress) {\n eventsData = await compressEvents(this.eventQueue);\n } else {\n eventsData = {\n type: 'none',\n data: JSON.stringify(this.eventQueue)\n };\n }\n\n const payload = {\n session_id: this.getSessionId(),\n visitor_id: this.getVisitorId(),\n events: eventsData,\n event_count: this.eventQueue.length,\n timestamp: Date.now(),\n is_exit: true\n };\n\n this.transport.sendBeacon('/api/public/tracker/events', payload);\n }\n };\n\n window.addEventListener('beforeunload', this._unloadHandler);\n document.addEventListener('visibilitychange', () => {\n if (document.visibilityState === 'hidden') {\n this._unloadHandler();\n }\n });\n }\n\n /**\n * Remove page unload handler\n * @private\n */\n _removeUnloadHandler() {\n if (typeof window === 'undefined' || !this._unloadHandler) return;\n window.removeEventListener('beforeunload', this._unloadHandler);\n }\n\n /**\n * Setup logger\n * @private\n */\n _setupLogger() {\n if (this.config.logger === true) {\n this.logger = defaultLogger;\n } else if (this.config.logger && typeof this.config.logger === 'object') {\n this.logger = this.config.logger;\n } else if (this.client.logger) {\n this.logger = this.client.logger;\n } else {\n this.logger = noopLogger;\n }\n }\n}\n\n/**\n * Create a session recorder instance\n * @param {Object} client - CMS client instance\n * @param {Object} [config] - Recorder configuration\n * @returns {SessionRecorder}\n */\nexport function createRecorder(client, config) {\n return new SessionRecorder(client, config);\n}\n\nexport default SessionRecorder;\n","/**\n * PowerIT CMS Tracker Plugin\n * Session recording plugin for @powerit/cms-client using rrweb\n *\n * @example\n * ```javascript\n * import { createClient } from '@powerit/cms-client';\n * import { trackerPlugin } from '@powerit/cms-tracker';\n *\n * const client = createClient({\n * baseUrl: 'https://cms.example.com',\n * apiKey: 'your-api-key',\n * });\n *\n * // Add tracker plugin\n * client.use(trackerPlugin, {\n * privacy: {\n * maskAllInputs: true,\n * blockedPages: ['/admin', '/checkout']\n * },\n * compress: true\n * });\n *\n * // Initialize and start recording\n * await client.tracker.init();\n * client.startRecording();\n *\n * // Add custom events\n * client.addCustomEvent('button_click', { buttonId: 'cta-hero' });\n *\n * // Identify user\n * client.identifyUser('user_123', { plan: 'premium' });\n * ```\n */\n\nimport { SessionRecorder, createRecorder } from './recorder.js';\nimport { SessionManager, createSessionManager } from './session.js';\nimport {\n DEFAULT_PRIVACY_CONFIG,\n SENSITIVE_SELECTORS,\n isDoNotTrackEnabled,\n shouldRecordPage,\n buildRrwebPrivacyConfig,\n mergePrivacyConfig\n} from './privacy.js';\nimport { compressEvents, decompressEvents, estimateCompression } from './compression.js';\n\n// Re-export classes and utilities\nexport { SessionRecorder, createRecorder };\nexport { SessionManager, createSessionManager };\nexport {\n DEFAULT_PRIVACY_CONFIG,\n SENSITIVE_SELECTORS,\n isDoNotTrackEnabled,\n shouldRecordPage,\n buildRrwebPrivacyConfig,\n mergePrivacyConfig\n};\nexport { compressEvents, decompressEvents, estimateCompression };\n\n/**\n * Tracker plugin for @powerit/cms-client\n *\n * Adds session recording capabilities to the CMS client using rrweb.\n * Supports privacy controls, event batching, and compression.\n */\nexport const trackerPlugin = {\n name: 'tracker',\n\n /**\n * Install the tracker plugin\n * @param {Object} client - CMS client instance\n * @param {Object} [options] - Plugin options\n * @returns {Function} Cleanup function\n */\n install(client, options = {}) {\n // Create recorder using client instance\n const recorder = new SessionRecorder(client, options);\n\n // Expose recorder instance\n client.tracker = recorder;\n\n // Add convenience methods to client\n client.startRecording = () => recorder.start();\n client.stopRecording = () => recorder.stop();\n client.pauseRecording = () => recorder.pause();\n client.resumeRecording = () => recorder.resume();\n client.addCustomEvent = (tag, payload) => recorder.addCustomEvent(tag, payload);\n client.identifyUser = (userId, traits) => recorder.identify(userId, traits);\n client.takeSnapshot = () => recorder.takeSnapshot();\n\n // Return cleanup function\n return () => {\n recorder.destroy();\n delete client.tracker;\n delete client.startRecording;\n delete client.stopRecording;\n delete client.pauseRecording;\n delete client.resumeRecording;\n delete client.addCustomEvent;\n delete client.identifyUser;\n delete client.takeSnapshot;\n };\n }\n};\n\nexport default trackerPlugin;\n"],"names":["_a","__defProp","Object","defineProperty","__publicField","obj","key","value","enumerable","configurable","writable","__defNormalProp","__defProp$1","__publicField$1","__defNormalProp$1","NodeType$3","NodeType2","testableAccessors$1","Node","ShadowRoot","Element","MutationObserver","testableMethods$1","untaintedBasePrototype$1","getUntaintedPrototype$1","defaultObj","globalThis","defaultPrototype","prototype","accessorNames","isUntaintedAccessors","Boolean","every","accessor","_a2","_b","getOwnPropertyDescriptor","get","toString","includes","methodNames","isUntaintedMethods","method","Zone","iframeEl","document","createElement","body","appendChild","win","contentWindow","untaintedObject","removeChild","untaintedAccessorCache$1","getUntaintedAccessor$1","instance","cacheKey","String","call","untaintedPrototype","untaintedAccessor","untaintedMethodCache$1","getUntaintedMethod$1","bind","untaintedMethod","index$1","childNodes","n2","parentNode","parentElement","textContent","contains","other","getRootNode","host","styleSheets","shadowRoot","querySelector","selectors","querySelectorAll","mutationObserver","constructor","isElement","nodeType","ELEMENT_NODE","isShadowRoot","hostEl","isNativeShadowDom","shadowRoot2","stringifyStylesheet","s2","rules2","rules","cssRules","sheetHref","href","ownerNode","ownerDocument","location","stringifiedRules","Array","from","rule2","stringifyRule","join","cssText","replace","error","isCSSImportRule","importStringified","styleSheet","split","length","statement","JSON","stringify","layerName","push","supportsText","media","mediaText","escapeImportStatement","absolutifyURLs","ruleStringified","isCSSStyleRule","selectorText","cssStringified","regex","fixSafariColons","Mirror","this","Map","WeakMap","getId","getMeta","id","getNode","idNodeMap","getIds","keys","nodeMetaMap","removeNodeFromMap","delete","forEach","childNode","has","hasNode","node2","add","meta","set","oldNode","reset","maskInputValue","element","maskInputOptions","tagName","type","maskInputFn","text","actualType","toLowerCase","repeat","str","ORIGINAL_ATTRIBUTE_NAME","getInputType","hasAttribute","extractFileExtension","path","baseURL","url","URL","window","err","match","pathname","URL_IN_CSS_REF","URL_PROTOCOL_MATCH","URL_WWW_MATCH","DATA_URI","origin","quote1","path1","quote2","path2","path3","filePath","maybeQuote","test","indexOf","slice","extractOrigin","stack","parts","pop","part","normalizeCssString","markCssSplits","style","childNodes2","splits","cssTextNorm","i2","textContentNorm","j","bit","substring","splitNorm","k","splitCssText","_id","tagNameRegex","RegExp","genId","canvasService","canvasCtx","SRCSET_NOT_SPACES","SRCSET_COMMAS_OR_SPACES","cachedDocument","absoluteToDoc","doc","attributeValue","trim","getHref","isSVGElement","el","ownerSVGElement","customHref","a2","startsWith","setAttribute","transformAttribute","name","pos","collectCharacters","regEx","chars2","exec","output","descriptorsStr","inParens","c2","charAt","getAbsoluteSrcsetString","ignoreAttribute","_value","classMatchesRegex","checkAncestors","eIndex","classList","className","needMaskingText","maskTextClass","maskTextSelector","closest","matches","e2","serializeNode","options","mirror","mirror2","blockClass","blockSelector","needsMask","inlineStylesheet","maskTextFn","dataURLOptions","inlineImages","recordCanvas","keepIframeSrcFn","newlyAddedElement","cssCaptured","rootId","docId","getRootId","DOCUMENT_NODE","compatMode","Document","DOCUMENT_TYPE_NODE","DocumentType","publicId","systemId","needBlock","_isBlockedElement","HTMLFormElement","processedTagName","getValidTagName$1","attributes","len","attr","stylesheet","find","rel","_cssText","sheet","checked","selected","open","rr_open_mode","__context","canvas","ctx","getContext","x2","width","y","height","getImageData","originalGetImageData","Uint32Array","Math","min","data","buffer","some","pixel","is2DCanvasBlank","rr_dataURL","toDataURL","quality","canvasDataURL","blankCanvas","image","imageSrc","currentSrc","getAttribute","priorCrossOrigin","crossOrigin","recordInlineImage","removeEventListener","naturalWidth","naturalHeight","drawImage","complete","addEventListener","console","warn","removeAttribute","mediaAttributes","rr_mediaState","paused","rr_mediaCurrentTime","currentTime","rr_mediaPlaybackRate","playbackRate","rr_mediaMuted","muted","rr_mediaLoop","loop","rr_mediaVolume","volume","scrollLeft","rr_scrollLeft","scrollTop","rr_scrollTop","getBoundingClientRect","class","rr_width","rr_height","src","contentDocument","rr_src","isCustomElement","customElements","isSVG","isCustom","serializeElementNode","TEXT_NODE","parent","parentTagName","textContent2","isStyle","isScript","Text","serializeTextNode","CDATA_SECTION_NODE","CDATA","COMMENT_NODE","Comment","lowerIfExists","maybeAttr","serializeNodeWithId","skipChild","slimDOMOptions","onSerialize","onIframeLoad","iframeLoadTimeout","onStylesheetLoad","stylesheetLoadTimeout","preserveWhiteSpace","_serializedNode","sn","comment","script","as","headFavicon","headMetaDescKeywords","headMetaSocial","property","headMetaRobots","headMetaHttpEquiv","headMetaAuthorship","headMetaVerification","slimDOMExcluded","serializedNode","assign","recordChild","shadowRootEl","isShadowHost","headWhitespace","bypassOptions","childN","serializedChildNode","isShadow","listener","readyState","fired","timer","setTimeout","clearTimeout","blankUrl","onceIframeLoaded","iframeDoc","serializedIframeNode","link","styleSheetLoadTimeout","styleSheetLoaded","onceStylesheetLoaded","serializedLinkNode","getDefaultExportFromCjs$1","__esModule","hasOwnProperty","getAugmentedNamespace$1","f2","default","a22","Reflect","construct","arguments","apply","d","picocolors_browser$1","exports","x$1","create$1","isColorSupported","bold","dim","italic","underline","inverse","hidden","strikethrough","black","red","green","yellow","blue","magenta","cyan","white","gray","bgBlack","bgRed","bgGreen","bgYellow","bgBlue","bgMagenta","bgCyan","bgWhite","createColors","picocolors_browserExports$1","require$$2$1","freeze","__proto__","Symbol","toStringTag","pico$1","terminalHighlight$1$1","CssSyntaxError$3$1","CssSyntaxError","Error","message","line","column","source","file","plugin22","super","reason","plugin","endLine","endColumn","setMessage","captureStackTrace","showSourceCode","color","css","mark","aside","lines","start","max","end","maxWidth","map","index2","number","gutter","spacing","code","cssSyntaxError$1","symbols$1","isClean","my","DEFAULT_RAW$1","after","beforeClose","beforeComment","beforeDecl","beforeOpen","beforeRule","colon","commentLeft","commentRight","emptyBody","indent","semicolon","Stringifier$2$1","builder","atrule","params","rawValue","raws","afterName","nodes","block","between","beforeAfter","detect","raw","buf","depth","step","last","child","before","left","right","decl","string","prop","important","own","first","root2","root","rawCache","toUpperCase","walk","rawBeforeClose","rawBeforeComment","walkComments","rawBeforeDecl","walkDecls","rawBeforeOpen","rawBeforeRule","rawColon","rawEmptyBody","rawIndent","p","rawSemicolon","rule","ownSemicolon","stringifier$1","Stringifier$1$1","stringify$4$1","stringify_1$1","isClean$2$1","my$2$1","CssSyntaxError$2$1","Stringifier2$1","stringify$3$1","cloneNode$1","cloned","isArray","Node$4$1","defaults","clone","append","addToError","postcssNode","input","insertAfter","overrides","insertBefore","cleanRaws","keepBetween","cloneAfter","cloneBefore","opts","rangeBy","getProxyProcessor","toProxy","markDirty","next","index","positionBy","stringRepresentation","positionInside","word","prev","endIndex","defaultType","remove","replaceWith","bookmark","foundSelf","result2","toJSON","_","inputs","fixed","emitInputs","inputsNextIndex","inputId","input2","proxyCache","Proxy","stringifier2","node","proxyOf","node$1","Node$3$1","Declaration$4$1","variable","declaration$1","nonSecure$1","nanoid","size","random","SourceMapConsumer","SourceMapConsumer$2$1","SourceMapGenerator","SourceMapGenerator$2$1","existsSync","existsSync$1","readFileSync","readFileSync$1","dirname","dirname$1$1","join$1","PreviousMap$2$1","loadAnnotation","inline","startWith","annotation","loadMap","mapFile","consumer","consumerCache","decodeInline","decodeURIComponent","substr","lastMatch","Buffer","atob","encoding","getAnnotationURL","sourceMapString","isMap","mappings","_mappings","sections","comments","lastIndexOf","loadFile","fromSourceMap","prevPath","withContent","sourcesContent","previousMap$1","SourceMapConsumer$1$1","SourceMapGenerator$1$1","fileURLToPath","fileURLToPath$1","pathToFileURL","pathToFileURL$1$1","isAbsolute","isAbsolute$1","resolve","resolve$1$1","nanoid$2","terminalHighlight$2","CssSyntaxError$1$1","PreviousMap$1$1","fromOffsetCache$1","sourceMapAvailable$1$1","pathAvailable$1$1","Input$4$1","hasBOM","mapResolve","offset","fromOffset","col","lastLine","lineToIndex","prevIndex","l2","mid","sourceRoot","to","fromUrl","originalPositionFor","protocol","sourceContentFor","json","input$1","registerInput","SourceMapConsumer$3","SourceMapGenerator$3","dirname$2","relative","relative$1","resolve$2","sep","sep$1","pathToFileURL$2","Input$3$1","sourceMapAvailable$2","pathAvailable$2","mapGenerator$1","stringify2","cssString","mapOpts","originalCSS","usesFileUrls","absolute","memoizedFileURLs","memoizedPaths","memoizedURLs","addAnnotation","content","isInline","toBase64","outputFile","eol","applyPrevMaps","previous","toUrl","applySourceMap","clearAnnotation","generate","generateMap","generateString","ignoreInvalidMapping","addMapping","generated","original","isSourcesContent","setSourcesContent","isAnnotation","noSource","mapping","sourcePath","charCodeAt","cached","previousMaps","already","toFileUrl","setSourceContent","btoa","unescape","encodeURIComponent","fileURL","encodeURI","Node$2$1","Comment$4$1","comment$1","parse$4$1","Rule$4$1","AtRule$4$1","Root$6$1","isClean$1$1","my$1$1","Declaration$3$1","Comment$3$1","Node$1$1","cleanSource$1","markDirtyUp$1","Container$7$1","Container","children","normalize","each","callback","iterator","getIterator","indexes","condition","lastEach","args","cb","exist","existIndex","reverse","splice","sample","selector","rebuild","prepend","unshift","removeAll","replaceValues","pattern","props","fast","walkAtRules","walkRules","registerParse","dependant","registerRule","registerAtRule","registerRoot","container$1","setPrototypeOf","LazyResult$4$1","Processor$3$1","Container$6$1","Document$3$1","toResult","registerLazyResult","registerProcessor","document$1$1","printed$1","warnOnce$2$1","Warning$2$1","range","opt","warning$1","Warning$1$1","Result$3$1","processor2","processor","messages","lastPlugin","postcssPlugin","warning2","warnings","filter","result$1","SINGLE_QUOTE$1","DOUBLE_QUOTE$1","BACKSLASH$1","SLASH$1","NEWLINE$1","SPACE$1","FEED$1","TAB$1","CR$1","OPEN_SQUARE$1","CLOSE_SQUARE$1","OPEN_PARENTHESES$1","CLOSE_PARENTHESES$1","OPEN_CURLY$1","CLOSE_CURLY$1","SEMICOLON$1","ASTERISK$1","COLON$1","AT$1","RE_AT_END$1","RE_WORD_END$1","RE_BAD_BRACKET$1","RE_HEX_ESCAPE$1","Container$5$1","AtRule$3$1","atRule$1","LazyResult$3$1","Processor$2$1","Container$4$1","Root$5$1","ignore","root$1","list$2$1","comma","space","separators","array","current","func","inQuote","prevQuote","escape","letter","list_1$1","Container$3$1","list$1$1","Rule$3$1","values","sep2","rule$1","Declaration$2$1","tokenizer2$1","quote","escaped","escapePos","currentToken","valueOf","ignoreErrors","returned","unclosed","what","back","token","endOfFile","nextToken","ignoreUnclosed","controlChar","fromCharCode","lastIndex","position","Comment$2$1","AtRule$2$1","Root$4$1","Rule$2$1","SAFE_COMMENT_NEIGHBOR$1","empty","Container$2$1","Parser2$1","spaces","createTokenizer","shift","unnamedAtrule","init","brackets","tokenizer","getPosition","spacesAndCommentsFromEnd","spacesAndCommentsFromStart","checkMissedSemicolon","tokens","founded","entries","doubleColon","customProperty","findLastWithPosition$1","unknownWord","firstSpaces","precheckMissedSemicolon","stringFrom","spacesFromEnd","cache","concat","emptyRule","unexpectedClose","endFile","unclosedBlock","freeSemicolon","bracket","unclosedBracket","parse","clean","reduce","all","lastTokenType","Input$2$1","parse$3$1","parser2","process","env","NODE_ENV","parse_1$1","isClean$3","my$3","MapGenerator$1$1","stringify$2$1","Container$1$1","Document$2$1","warnOnce$1$1","Result$2$1","parse$2$1","Root$3$1","TYPE_TO_CLASS_NAME$1","PLUGIN_PROPS$1","AtRule","AtRuleExit","CommentExit","Declaration","DeclarationExit","DocumentExit","Once","OnceExit","prepare","Root","RootExit","Rule","RuleExit","NOT_VISITORS$1","isPromise$1","then","getEvents$1","toStack$1","events","eventIndex","visitorIndex","visitors","cleanMarks$1","postcss$2$1","LazyResult$2$1","LazyResult","stringified","processed","syntax","parser","result","helpers","postcss","plugins","async","Promise","reject","processing","runAsync","onRejected","catch","onFinally","getAsyncError","handleError","postcssVersion","pluginName","pluginVer","runtimeVer","version","b","parseInt","prepareVisitors","listeners","event","hasListener","promise","runOnRoot","visitTick","visitor","roots","subRoot","sync","stringifier","walkSync","visitSync","onFulfilled","visit2","registerPostcss","lazyResult$1","MapGenerator2$1","stringify$1$1","warnOnce2$1","parse$1$1","Result$1$1","NoWorkResult$1$1","_processor","_css","_opts","_map","self","generatedCSS","generatedMap","_root","noWorkResult$1","NoWorkResult2$1","LazyResult$1$1","Document$1$1","Root$2$1","Processor$1$1","normalized","use","processor$1","Declaration$1$1","PreviousMap2$1","Comment$1$1","AtRule$1$1","Input$1$1","Root$1$1","Rule$1$1","fromJSON$1$1","ownInputs","inputHydrated","fromJSON_1$1","CssSyntaxError2$1","Declaration2$1","LazyResult2$1","Container2$1","Processor2$1","stringify$5","fromJSON$2","Document22","Warning2$1","Comment2$1","AtRule2$1","Result2$1","Input2$1","parse$5","list$3","Rule2$1","Root2$1","Node2$1","postcss$3","initializer","warningPrinted","creator","LANG","transformer","processOpts","pluginOpts","fromJSON","list","atRule","Processor","Warning","Result","Input","postcss_1$1","postcss$1$1","__defProp2","__publicField2","__defNormalProp2","getDefaultExportFromCjs","getAugmentedNamespace","picocolors_browser","x","create","picocolors_browserExports","require$$2","pico","terminalHighlight$1","CssSyntaxError$3","CssSyntaxError2","cssSyntaxError","symbols","DEFAULT_RAW","Stringifier$2","Stringifier$1","stringify$4","stringify_1","isClean$2","my$2","CssSyntaxError$2","Stringifier22","stringify$3","cloneNode","Node$4","Node$3","Declaration$4","declaration","nonSecure","SourceMapConsumer$2","SourceMapGenerator$2","dirname$1","PreviousMap$2","previousMap","SourceMapConsumer$1","SourceMapGenerator$1","pathToFileURL$1","resolve$1","terminalHighlight","CssSyntaxError$1","PreviousMap$1","fromOffsetCache","sourceMapAvailable$1","pathAvailable$1","Input$4","Input$3","sourceMapAvailable","pathAvailable","mapGenerator","Node$2","Comment$4","parse$4","Rule$4","AtRule$4","Root$6","isClean$1","my$1","Declaration$3","Comment$3","Node$1","cleanSource","markDirtyUp","Container$7","Container2","container","LazyResult$4","Processor$3","Container$6","Document$3","document$1","printed","warnOnce$2","Warning$2","warning","Warning$1","Result$3","SINGLE_QUOTE","DOUBLE_QUOTE","BACKSLASH","SLASH","NEWLINE","SPACE","FEED","TAB","CR","OPEN_SQUARE","CLOSE_SQUARE","OPEN_PARENTHESES","CLOSE_PARENTHESES","OPEN_CURLY","CLOSE_CURLY","SEMICOLON","ASTERISK","COLON","AT","RE_AT_END","RE_WORD_END","RE_BAD_BRACKET","RE_HEX_ESCAPE","Container$5","AtRule$3","LazyResult$3","Processor$2","Container$4","Root$5","list$2","list_1","Container$3","list$1","Rule$3","Declaration$2","tokenizer22","Comment$2","AtRule$2","Root$4","Rule$2","SAFE_COMMENT_NEIGHBOR","Container$2","Parser22","findLastWithPosition","Input$2","parse$3","parse_1","MapGenerator$1","stringify$2","Container$1","Document$2","warnOnce$1","Result$2","parse$2","Root$3","TYPE_TO_CLASS_NAME","PLUGIN_PROPS","NOT_VISITORS","isPromise","getEvents","toStack","cleanMarks","postcss$2","LazyResult$2","LazyResult2","lazyResult","MapGenerator22","stringify$1","warnOnce22","parse$1","Result$1","NoWorkResult$1","noWorkResult","NoWorkResult22","LazyResult$1","Document$1","Root$2","Processor$1","Declaration$1","PreviousMap22","Comment$1","AtRule$1","Input$1","Root$1","Rule$1","fromJSON$1","fromJSON_1","CssSyntaxError22","Declaration22","LazyResult22","Container22","Processor22","Document222","Warning22","Comment22","AtRule22","Result22","Input22","Rule22","Root22","Node22","postcss_1","postcss$1","BaseRRNode","_args","childIterator","firstChild","nextSibling","_newChild","_refChild","_node","testableAccessors","testableMethods","untaintedBasePrototype","getUntaintedPrototype","untaintedAccessorCache","getUntaintedAccessor","untaintedMethodCache","getUntaintedMethod","mutationObserverCtor","on","fn","target","capture","passive","DEPARTED_MIRROR_ACCESS_WARNING","_mirror","throttle","wait","timeout","now","Date","leading","remaining","context","trailing","hookSetter","isRevoked","patch","replacement","wrapped","defineProperties","__rrweb_original__","receiver","nowTimestamp","getWindowScroll","_c","_d","scrollingElement","pageXOffset","documentElement","top","pageYOffset","getWindowHeight","innerHeight","clientHeight","getWindowWidth","innerWidth","clientWidth","closestElementOfNode","isBlocked","isIgnored","headTitleMutations","isAncestorRemoved","legacy_isTouchEvent","changedTouches","isSerializedIframe","nodeName","isSerializedStylesheet","hasShadowRoot","getTime","StyleSheetMirror","styleIDMap","newId","idStyleMap","getStyle","generateId","getShadowHost","shadowHost","DOCUMENT_FRAGMENT_NODE","shadowHostInDom","rootShadowHost","getRootShadowHost","inDom","EventType","EventType2","IncrementalSource","IncrementalSource2","MouseInteractions","MouseInteractions2","PointerTypes","PointerTypes2","CanvasContext","CanvasContext2","MediaInteractions","MediaInteractions2","NodeType","isNodeInLinkedList","DoubleLinkedList","head","addNode","__ln","previousSibling","tail","removeNode","moveKey","parentId","MutationBuffer","Set","mutations","processMutation","emit","frozen","locked","adds","addedIds","addList","getNextId","ns","nextId","pushAdd","parentTag","addedSet","currentN","iframeManager","addIframe","stylesheetManager","trackLinkElement","shadowDomManager","addShadowRoot","iframe","childSn","attachIframe","observeAttachShadow","attachLinkElement","mapRemoves","movedSet","isParentRemoved","removesSubTreeCache","isAncestorInSet","droppedSet","candidate","tailNode","unhandledNode","payload","texts","genTextAreaValueMutation","attribute","diffAsStr","styleDiff","unchangedAsStr","_unchangedStyles","removes","attributeMap","movedMap","mutationCb","textarea","item","cn","m","oldValue","attributeName","unattachedDoc","implementation","createHTMLDocument","old","pname","newValue","getPropertyValue","newPriority","getPropertyPriority","addedNodes","genAdds","removedNodes","nodeId","isSerialized","deepDelete","queue","n22","processRemoves","processedNodeManager","inOtherBuffer","targetId","canvasManager","unfreeze","isFrozen","lock","unlock","addsSet","_isParentRemoved","_isAncestorInSet","errorHandler","callbackWrapper","rest","mutationBuffers","getEventTarget","composedPath","initMutationObserver","rootEl","mutationBuffer","observer","processMutations","observe","attributeOldValue","characterData","characterDataOldValue","childList","subtree","initMouseInteractionObserver","mouseInteractionCb","sampling","mouseInteraction","disableMap","handlers","currentPointerType","Number","isNaN","endsWith","eventKey","eventName","handler","pointerType","thisEventKey","Mouse","Touch","Pen","MouseDown","MouseUp","Click","clientX","clientY","getHandler","PointerEvent","TouchStart","TouchEnd","h","initScrollObserver","scrollCb","evt","defaultView","scrollLeftTop","scroll","INPUT_TAGS","lastInputValueMap","getNestedCSSRulePositions","childRule","hasNestedCSSRule","parentRule","CSSGroupingRule","CSSMediaRule","CSSSupportsRule","CSSConditionRule","parentStyleSheet","recurse","getIdAndStyleId","styleMirror","styleId","initAdoptedStyleSheetObserver","host2","hostId","patchTarget","originalPropertyDescriptor","_a3","sheets","adoptStyleSheets","initObservers","o2","hooks","currentWindow","mousemoveCb","viewportResizeCb","inputCb","mediaInteractionCb","styleSheetRuleCb","styleDeclarationCb","canvasMutationCb","fontCb","selectionCb","customElementCb","mutation","mousemove","viewportResize","mediaInteaction","styleSheetRule","styleDeclaration","canvasMutation","font","selection","customElement","mergeHooks","recordDOM","mousemoveHandler","threshold","callbackThreshold","mousemoveCallback","timeBaseline","positions","wrappedCb","totalOffset","timeOffset","updatePosition","DragEvent","Drag","MouseEvent","MouseMove","TouchMove","initMoveObserver","mouseInteractionHandler","scrollHandler","viewportResizeHandler","lastH","lastW","initViewportResizeObserver","inputHandler","ignoreClass","ignoreSelector","userTriggeredOnInput","eventHandler","userTriggered","isTrusted","isChecked","cbWithDedup","text2","v2","lastInputValue","propertyDescriptor","HTMLInputElement","hookProperties","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement","initInputObserver","mediaInteractionHandler","Play","Pause","Seeked","VolumeChange","RateChange","initMediaInteractionObserver","styleSheetObserver","adoptedStyleSheetObserver","styleDeclarationObserver","fontObserver","CSSStyleSheet","insertRule","thisArg","argumentsList","addRule","styleBlock","deleteRule","replaceSync","removeRule","supportedNestedCSSRuleTypes","canMonkeyPatchNestedCSSRule","unmodifiedFunctions","typeKey","initStyleSheetObserver","ignoreCSSAttributes","setProperty","CSSStyleDeclaration","priority","removeProperty","initStyleDeclarationObserver","collectFonts","fontMap","originalFontFace","FontFace","family","descriptors","fontFace","fontSource","Uint8Array","restoreHandler","fonts","initFontObserver","selectionObserver","param","collapsed","updateSelection","getSelection","isCollapsed","ranges","count","rangeCount","getRangeAt","startContainer","startOffset","endContainer","endOffset","initSelectionObserver","customElementObserver","define","initCustomElementObserver","pluginHandlers","plugin3","disconnect","CrossOriginIframeMirror","generateIdFn","remoteId","idToRemoteMap","remoteToIdMap","idToRemoteIdMap","getIdToRemoteIdMap","remoteIdToIdMap","getRemoteIdToIdMap","getRemoteId","getRemoteIds","ids","iframeIdToRemoteIdMap","iframeRemoteIdToIdMap","IframeManager","wrappedEmit","recordCrossOriginIframes","crossOriginIframeStyleMirror","handleMessage","iframes","crossOriginIframeMap","addLoadListener","loadListener","isAttachIframe","adoptedStyleSheets","crossOriginMessageEvent","transformedEvent","transformCrossOriginEvent","isCheckout","FullSnapshot","crossOriginIframeMirror","replaceIdOnNode","crossOriginIframeRootIdMap","patchRootIdOnNode","timestamp","IncrementalSnapshot","Mutation","Meta","Load","DomContentLoaded","Plugin","Custom","replaceIds","ViewportResize","MediaInteraction","MouseInteraction","Scroll","CanvasMutation","StyleSheetRule","StyleDeclaration","replaceStyleIds","Font","Selection","AdoptedStyleSheet","styles","iframeMirror","ShadowDomManager","WeakSet","patchAttachShadow","shadowDoms","restoreHandlers","iframeElement","manager","option","sRoot","chars","lookup","i$1","canvasVarMap","saveWebGLVar","isInstanceOfWebGLObject","list2","ctor","contextMap","variableListFor$1","serializeArg","arg","Float32Array","Float64Array","Int32Array","Uint16Array","Int16Array","Int8Array","Uint8ClampedArray","rr_type","ArrayBuffer","base64","arraybuffer","bytes","encode","DataView","byteOffset","byteLength","HTMLImageElement","HTMLCanvasElement","ImageData","serializeArgs","supportedWebGLConstructorNames","initCanvasContextObserver","setPreserveDrawingBufferToTrue","contextType","ctxName","getNormalizedContextName","contextAttributes","preserveDrawingBuffer","patchGLPrototype","getOwnPropertyNames","recordArgs","hookHandler","setter","encodedJs","blob","Blob","WorkerWrapper","objURL","webkitURL","createObjectURL","worker","Worker","revokeObjectURL","CanvasManager","latestId","invokeId","rafStamps","pendingCanvasMutations","initCanvasMutationObserver","initCanvasFPSObserver","clear","resetObservers","fps","canvasContextReset","snapshotInProgressMap","onmessage","commands","timeBetweenSnapshots","rafId","lastSnapshotTime","takeCanvasSnapshots","matchedCanvas","getCanvas","getContextAttributes","COLOR_BUFFER_BIT","bitmap","createImageBitmap","postMessage","requestAnimationFrame","cancelAnimationFrame","startRAFTimestamping","startPendingCanvasMutationFlusher","canvas2DReset","props2D","CanvasRenderingContext2D","initCanvas2DMutationObserver","canvasWebGL1and2Reset","WebGLRenderingContext","WebGL","WebGL2RenderingContext","WebGL2","initCanvasWebGLMutationObserver","flushPendingCanvasMutations","setLatestRAFTimestamp","_values","flushPendingCanvasMutationFor","valuesWithType","type2","StylesheetManager","adoptedStyleSheetCb","linkEl","trackedLinkElements","trackStylesheetInLinkElement","adoptedStyleSheetData","styleIds","CSSRule","r2","_linkEl","ProcessedNodeManager","thisBuffer","buffers","nodeMap","active","destroy","takeFullSnapshot$1","recording","cleanFrame","debug","record","checkoutEveryNms","checkoutEveryNth","maskAllInputs","_maskInputOptions","_slimDOMOptions","packFn","mousemoveWait","recordAfter","errorHandler2","inEmittingFrame","passEmitsToParent","date","email","month","search","tel","time","week","select","password","lastFullSnapshotEvent","NodeList","DOMTokenList","polyfill$1","incrementalSnapshotCount","eventProcessor","exceedCount","exceedTime","wrappedMutationEmit","wrappedScrollEmit","wrappedCanvasMutationEmit","getMirror","nodeMirror","slimDOM","snapshot","initialOffset","CustomElement","n","t2","addCustomEvent","tag","freezePage","takeFullSnapshot","NotStarted","Running","Stopped","SessionManager","storageKey","sessionTimeout","session","getOrCreateSession","stored","_getStoredSession","_isExpired","lastActivityAt","_saveSession","_createSession","getSession","getVisitorId","visitorId","getSessionId","sessionId","linkToAnalytics","analyticsTracker","analyticsVisitorId","analyticsSessionId","linkedToAnalytics","touch","incrementEventCount","eventCount","endSession","_clearSession","isSessionValid","_generateId","_getOrCreateVisitorId","startedAt","entryPage","entryUrl","crypto","randomUUID","c","r","localStorage","getItem","setItem","sessionStorage","removeItem","createSessionManager","DEFAULT_PRIVACY_CONFIG","respectDoNotTrack","creditCard","blockedPages","allowedPages","SENSITIVE_SELECTORS","isDoNotTrackEnabled","navigator","doNotTrack","shouldRecordPage","config","currentPath","matchPattern","buildRrwebPrivacyConfig","mergedConfig","sel","mergePrivacyConfig","userConfig","compressEvents","jsonString","CompressionStream","TextEncoder","stream","pipeThrough","compressedBlob","Response","binary","i","arrayBufferToBase64","arrayBuffer","originalSize","compressedSize","decompressEvents","compressed","DecompressionStream","binaryString","estimateCompression","ratio","toFixed","savings","DEFAULT_CONFIG","transport","batchSize","flushInterval","maxQueueSize","compress","noopLogger","info","defaultLogger","SessionRecorder","client","privacyConfig","privacy","isInitialized","enabled","stopFn","eventQueue","flushTimer","sessionManager","_setupLogger","logger","clientConfig","getConfig","createGrpcTransport","baseUrl","transportUrl","apiKey","connect","analytics","_setupUnloadHandler","rrwebConfig","_handleEvent","_buildSamplingConfig","onError","_startFlushTimer","pause","_stopFlushTimer","resume","stop","flush","isRecording","isEnabled","eventsData","session_id","visitor_id","event_count","send","endpoint","identify","userId","traits","takeSnapshot","updatePrivacy","enable","disable","_removeUnloadHandler","setInterval","clearInterval","_unloadHandler","is_exit","sendBeacon","visibilityState","createRecorder","trackerPlugin","install","recorder","tracker","startRecording","stopRecording","pauseRecording","resumeRecording","identifyUser"],"mappings":"wDAAA,IAGIA,EAHAC,EAAYC,OAAOC,eAEnBC,EAAgB,CAACC,EAAKC,EAAKC,IADT,EAACF,EAAKC,EAAKC,IAAUD,KAAOD,EAAMJ,EAAUI,EAAKC,EAAK,CAAEE,YAAY,EAAMC,cAAc,EAAMC,UAAU,EAAMH,UAAWF,EAAIC,GAAOC,EACjHI,CAAgBN,EAAoB,iBAARC,EAAmBA,EAAM,GAAKA,EAAKC,GAEpGK,EAAcV,OAAOC,eAErBU,EAAkB,CAACR,EAAKC,EAAKC,IADT,EAACF,EAAKC,EAAKC,IAAUD,KAAOD,EAAMO,EAAYP,EAAKC,EAAK,CAAEE,YAAY,EAAMC,cAAc,EAAMC,UAAU,EAAMH,UAAWF,EAAIC,GAAOC,EACnHO,CAAkBT,EAAoB,iBAARC,EAAmBA,EAAM,GAAKA,EAAKC,GACxGQ,EAA6B,CAAEC,IACjCA,EAAUA,EAAoB,SAAI,GAAK,WACvCA,EAAUA,EAAwB,aAAI,GAAK,eAC3CA,EAAUA,EAAmB,QAAI,GAAK,UACtCA,EAAUA,EAAgB,KAAI,GAAK,OACnCA,EAAUA,EAAiB,MAAI,GAAK,QACpCA,EAAUA,EAAmB,QAAI,GAAK,UAC/BA,GAPwB,CAQ9BD,GAAc,CAAA,GACjB,MAAME,EAAsB,CAC1BC,KAAM,CAAC,aAAc,aAAc,gBAA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