{"version":3,"file":"static/js/225.c2c9cf4f.chunk.js","mappings":"4IAAe,SAASA,EAAuBC,EAASC,GAItD,OAHKA,IACHA,EAAMD,EAAQE,MAAM,IAEfC,OAAOC,OAAOD,OAAOE,iBAAiBL,EAAS,CACpDC,IAAK,CACHK,MAAOH,OAAOC,OAAOH,MAG3B,C,o6DCDA,IAAMM,EAAgB,gCAEtB,SAASC,EAAgBC,GACvB,OAAOC,EAAgBD,EAAIE,WAAW,GACxC,CAEA,IAAMD,EAAkB,CACtB,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,MACA,MACA,MACA,UACA,MACA,MACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,GACA,GACA,MACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,OACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,UACA,WCrKWE,EAAQT,OAAOC,OAAO,CAAC,GAgU7B,SAASS,EAAqBJ,EAASK,GAC5C,IAAMC,EAAcN,EAAQK,GAE5B,MAA2B,iBAAhBC,EAEFA,EACyB,mBAAhBA,EAET,CAC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ASNkO,EAAKtK,OAASsK,EAAKtK,OAAO/sD,MAAMgC,EAAOd,QAEvCm2D,EAAKlO,oBAAoBwO,SACxBN,EAAKlO,oBAAoBwO,SAAS33D,MAAMmC,EAASjB,QAClDm2D,EAAKlO,oBAAoB1a,OAAS4oB,EAAKlO,oBAAoB1a,OAAOzuC,MACjEoC,EAAOlB,QAERokD,GAAmBxjD,GAAa,yBAAA01D,EAAA71B,OAAA,GAAA21B,EAAA,GApFhCj3B,EAoFgC,GACjC,IAAA/uB,IAAA,mBAAAlR,MAEQ,WACF,KAAA2+B,OAAO4nB,IAAI,uBAAwB,CACvC8R,mBAAoBtnD,KAAKi3C,yBACzBvnB,iBAAkB1vB,KAAKm8C,oBAExBznB,GAAOwG,kBAAiB,GACxBl7B,KAAKi3C,yBAA2B,EAChCj3C,KAAKm8C,mBAAoB,IAAI/qC,MAAO0B,SACrC,MAAA3S,IAAA,SAAAlR,MApsCA,SAAcQ,GACN,WAAI4mD,EAAU5mD,EACtB,KAAA4mD,CAAA,CAhDY,E","sources":["../node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js","../node_modules/client/node_modules/graphql/language/printString.mjs","../node_modules/client/node_modules/graphql/language/visitor.mjs","../node_modules/client/node_modules/graphql/language/printer.mjs","../rrweb/packages/rrweb/dist/rrweb.js","../rrweb/packages/plugins/rrweb-plugin-sequential-id-record/dist/rrweb-plugin-sequential-id-record.js","../node_modules/client/node_modules/graphql-request/build/esm/defaultJsonSerializer.js","../node_modules/client/node_modules/graphql-request/build/esm/helpers.js","../node_modules/client/node_modules/graphql-request/build/esm/parseArgs.js","../node_modules/client/node_modules/graphql-request/build/esm/resolveRequestDocument.js","../node_modules/client/node_modules/graphql-request/build/esm/types.js","../node_modules/cross-fetch/dist/browser-ponyfill.js","../node_modules/client/node_modules/graphql-request/build/esm/index.js","../node_modules/tslib/tslib.es6.js","../node_modules/client/node_modules/graphql-tag/lib/index.js","../node_modules/client/src/graph/generated/operations.ts","../node_modules/client/src/utils/privacy.ts","../node_modules/client/src/listeners/segment-integration-listener.tsx","../node_modules/client/src/utils/dom/index.ts","../node_modules/client/src/listeners/session-shortcut/session-shortcut-listener.tsx","../node_modules/web-vitals/dist/web-vitals.js","../node_modules/client/src/graph/generated/schemas.ts","../node_modules/client/src/listeners/web-vitals-listener/web-vitals-listener.tsx","../node_modules/client/src/utils/performance/performance.tsx","../node_modules/client/src/listeners/performance-listener/performance-listener.ts","../node_modules/client/src/utils/highlight-logging.ts","../node_modules/client/src/utils/graph.ts","../node_modules/client/src/workers/types.ts","../node_modules/client/src/index.tsx","../node_modules/client/src/logger.ts","../node_modules/client/src/listeners/jank-listener/jank-listener.ts","../node_modules/client/src/types/iframe.ts","../node_modules/client/src/listeners/path-listener.tsx","../node_modules/client/src/listeners/viewport-resize-listener.tsx","../node_modules/client/src/listeners/click-listener/click-listener.ts","../node_modules/client/src/listeners/focus-listener/focus-listener.ts","../node_modules/client/src/listeners/page-visibility-listener.tsx"],"sourcesContent":["export default function _taggedTemplateLiteral(strings, raw) {\n if (!raw) {\n raw = strings.slice(0);\n }\n return Object.freeze(Object.defineProperties(strings, {\n raw: {\n value: Object.freeze(raw)\n }\n }));\n}","/**\n * Prints a string as a GraphQL StringValue literal. Replaces control characters\n * and excluded characters (\" U+0022 and \\\\ U+005C) with escape sequences.\n */\nexport function printString(str) {\n return `\"${str.replace(escapedRegExp, escapedReplacer)}\"`;\n} // eslint-disable-next-line no-control-regex\n\nconst escapedRegExp = /[\\x00-\\x1f\\x22\\x5c\\x7f-\\x9f]/g;\n\nfunction escapedReplacer(str) {\n return escapeSequences[str.charCodeAt(0)];\n} // prettier-ignore\n\nconst escapeSequences = [\n '\\\\u0000',\n '\\\\u0001',\n '\\\\u0002',\n '\\\\u0003',\n '\\\\u0004',\n '\\\\u0005',\n '\\\\u0006',\n '\\\\u0007',\n '\\\\b',\n '\\\\t',\n '\\\\n',\n '\\\\u000B',\n '\\\\f',\n '\\\\r',\n '\\\\u000E',\n '\\\\u000F',\n '\\\\u0010',\n '\\\\u0011',\n '\\\\u0012',\n '\\\\u0013',\n '\\\\u0014',\n '\\\\u0015',\n '\\\\u0016',\n '\\\\u0017',\n '\\\\u0018',\n '\\\\u0019',\n '\\\\u001A',\n '\\\\u001B',\n '\\\\u001C',\n '\\\\u001D',\n '\\\\u001E',\n '\\\\u001F',\n '',\n '',\n '\\\\\"',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '', // 2F\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '', // 3F\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '', // 4F\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '\\\\\\\\',\n '',\n '',\n '', // 5F\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '', // 6F\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '\\\\u007F',\n '\\\\u0080',\n '\\\\u0081',\n '\\\\u0082',\n '\\\\u0083',\n '\\\\u0084',\n '\\\\u0085',\n '\\\\u0086',\n '\\\\u0087',\n '\\\\u0088',\n '\\\\u0089',\n '\\\\u008A',\n '\\\\u008B',\n '\\\\u008C',\n '\\\\u008D',\n '\\\\u008E',\n '\\\\u008F',\n '\\\\u0090',\n '\\\\u0091',\n '\\\\u0092',\n '\\\\u0093',\n '\\\\u0094',\n '\\\\u0095',\n '\\\\u0096',\n '\\\\u0097',\n '\\\\u0098',\n '\\\\u0099',\n '\\\\u009A',\n '\\\\u009B',\n '\\\\u009C',\n '\\\\u009D',\n '\\\\u009E',\n '\\\\u009F',\n];\n","import { devAssert } from '../jsutils/devAssert.mjs';\nimport { inspect } from '../jsutils/inspect.mjs';\nimport { isNode, QueryDocumentKeys } from './ast.mjs';\nimport { Kind } from './kinds.mjs';\n/**\n * A visitor is provided to visit, it contains the collection of\n * relevant functions to be called during the visitor's traversal.\n */\n\nexport const BREAK = Object.freeze({});\n/**\n * visit() will walk through an AST using a depth-first traversal, calling\n * the visitor's enter function at each node in the traversal, and calling the\n * leave function after visiting that node and all of its child nodes.\n *\n * By returning different values from the enter and leave functions, the\n * behavior of the visitor can be altered, including skipping over a sub-tree of\n * the AST (by returning false), editing the AST by returning a value or null\n * to remove the value, or to stop the whole traversal by returning BREAK.\n *\n * When using visit() to edit an AST, the original AST will not be modified, and\n * a new version of the AST with the changes applied will be returned from the\n * visit function.\n *\n * ```ts\n * const editedAST = visit(ast, {\n * enter(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: skip visiting this node\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * },\n * leave(node, key, parent, path, ancestors) {\n * // @return\n * // undefined: no action\n * // false: no action\n * // visitor.BREAK: stop visiting altogether\n * // null: delete this node\n * // any value: replace this node with the returned value\n * }\n * });\n * ```\n *\n * Alternatively to providing enter() and leave() functions, a visitor can\n * instead provide functions named the same as the kinds of AST nodes, or\n * enter/leave visitors at a named key, leading to three permutations of the\n * visitor API:\n *\n * 1) Named visitors triggered when entering a node of a specific kind.\n *\n * ```ts\n * visit(ast, {\n * Kind(node) {\n * // enter the \"Kind\" node\n * }\n * })\n * ```\n *\n * 2) Named visitors that trigger upon entering and leaving a node of a specific kind.\n *\n * ```ts\n * visit(ast, {\n * Kind: {\n * enter(node) {\n * // enter the \"Kind\" node\n * }\n * leave(node) {\n * // leave the \"Kind\" node\n * }\n * }\n * })\n * ```\n *\n * 3) Generic visitors that trigger upon entering and leaving any node.\n *\n * ```ts\n * visit(ast, {\n * enter(node) {\n * // enter any node\n * },\n * leave(node) {\n * // leave any node\n * }\n * })\n * ```\n */\n\nexport function visit(root, visitor, visitorKeys = QueryDocumentKeys) {\n const enterLeaveMap = new Map();\n\n for (const kind of Object.values(Kind)) {\n enterLeaveMap.set(kind, getEnterLeaveForKind(visitor, kind));\n }\n /* eslint-disable no-undef-init */\n\n let stack = undefined;\n let inArray = Array.isArray(root);\n let keys = [root];\n let index = -1;\n let edits = [];\n let node = root;\n let key = undefined;\n let parent = undefined;\n const path = [];\n const ancestors = [];\n /* eslint-enable no-undef-init */\n\n do {\n index++;\n const isLeaving = index === keys.length;\n const isEdited = isLeaving && edits.length !== 0;\n\n if (isLeaving) {\n key = ancestors.length === 0 ? undefined : path[path.length - 1];\n node = parent;\n parent = ancestors.pop();\n\n if (isEdited) {\n if (inArray) {\n node = node.slice();\n let editOffset = 0;\n\n for (const [editKey, editValue] of edits) {\n const arrayKey = editKey - editOffset;\n\n if (editValue === null) {\n node.splice(arrayKey, 1);\n editOffset++;\n } else {\n node[arrayKey] = editValue;\n }\n }\n } else {\n node = Object.defineProperties(\n {},\n Object.getOwnPropertyDescriptors(node),\n );\n\n for (const [editKey, editValue] of edits) {\n node[editKey] = editValue;\n }\n }\n }\n\n index = stack.index;\n keys = stack.keys;\n edits = stack.edits;\n inArray = stack.inArray;\n stack = stack.prev;\n } else if (parent) {\n key = inArray ? index : keys[index];\n node = parent[key];\n\n if (node === null || node === undefined) {\n continue;\n }\n\n path.push(key);\n }\n\n let result;\n\n if (!Array.isArray(node)) {\n var _enterLeaveMap$get, _enterLeaveMap$get2;\n\n isNode(node) || devAssert(false, `Invalid AST Node: ${inspect(node)}.`);\n const visitFn = isLeaving\n ? (_enterLeaveMap$get = enterLeaveMap.get(node.kind)) === null ||\n _enterLeaveMap$get === void 0\n ? void 0\n : _enterLeaveMap$get.leave\n : (_enterLeaveMap$get2 = enterLeaveMap.get(node.kind)) === null ||\n _enterLeaveMap$get2 === void 0\n ? void 0\n : _enterLeaveMap$get2.enter;\n result =\n visitFn === null || visitFn === void 0\n ? void 0\n : visitFn.call(visitor, node, key, parent, path, ancestors);\n\n if (result === BREAK) {\n break;\n }\n\n if (result === false) {\n if (!isLeaving) {\n path.pop();\n continue;\n }\n } else if (result !== undefined) {\n edits.push([key, result]);\n\n if (!isLeaving) {\n if (isNode(result)) {\n node = result;\n } else {\n path.pop();\n continue;\n }\n }\n }\n }\n\n if (result === undefined && isEdited) {\n edits.push([key, node]);\n }\n\n if (isLeaving) {\n path.pop();\n } else {\n var _node$kind;\n\n stack = {\n inArray,\n index,\n keys,\n edits,\n prev: stack,\n };\n inArray = Array.isArray(node);\n keys = inArray\n ? node\n : (_node$kind = visitorKeys[node.kind]) !== null &&\n _node$kind !== void 0\n ? _node$kind\n : [];\n index = -1;\n edits = [];\n\n if (parent) {\n ancestors.push(parent);\n }\n\n parent = node;\n }\n } while (stack !== undefined);\n\n if (edits.length !== 0) {\n // New root\n return edits[edits.length - 1][1];\n }\n\n return root;\n}\n/**\n * Creates a new visitor instance which delegates to many visitors to run in\n * parallel. Each visitor will be visited for each node before moving on.\n *\n * If a prior visitor edits a node, no following visitors will see that node.\n */\n\nexport function visitInParallel(visitors) {\n const skipping = new Array(visitors.length).fill(null);\n const mergedVisitor = Object.create(null);\n\n for (const kind of Object.values(Kind)) {\n let hasVisitor = false;\n const enterList = new Array(visitors.length).fill(undefined);\n const leaveList = new Array(visitors.length).fill(undefined);\n\n for (let i = 0; i < visitors.length; ++i) {\n const { enter, leave } = getEnterLeaveForKind(visitors[i], kind);\n hasVisitor || (hasVisitor = enter != null || leave != null);\n enterList[i] = enter;\n leaveList[i] = leave;\n }\n\n if (!hasVisitor) {\n continue;\n }\n\n const mergedEnterLeave = {\n enter(...args) {\n const node = args[0];\n\n for (let i = 0; i < visitors.length; i++) {\n if (skipping[i] === null) {\n var _enterList$i;\n\n const result =\n (_enterList$i = enterList[i]) === null || _enterList$i === void 0\n ? void 0\n : _enterList$i.apply(visitors[i], args);\n\n if (result === false) {\n skipping[i] = node;\n } else if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined) {\n return result;\n }\n }\n }\n },\n\n leave(...args) {\n const node = args[0];\n\n for (let i = 0; i < visitors.length; i++) {\n if (skipping[i] === null) {\n var _leaveList$i;\n\n const result =\n (_leaveList$i = leaveList[i]) === null || _leaveList$i === void 0\n ? void 0\n : _leaveList$i.apply(visitors[i], args);\n\n if (result === BREAK) {\n skipping[i] = BREAK;\n } else if (result !== undefined && result !== false) {\n return result;\n }\n } else if (skipping[i] === node) {\n skipping[i] = null;\n }\n }\n },\n };\n mergedVisitor[kind] = mergedEnterLeave;\n }\n\n return mergedVisitor;\n}\n/**\n * Given a visitor instance and a node kind, return EnterLeaveVisitor for that kind.\n */\n\nexport function getEnterLeaveForKind(visitor, kind) {\n const kindVisitor = visitor[kind];\n\n if (typeof kindVisitor === 'object') {\n // { Kind: { enter() {}, leave() {} } }\n return kindVisitor;\n } else if (typeof kindVisitor === 'function') {\n // { Kind() {} }\n return {\n enter: kindVisitor,\n leave: undefined,\n };\n } // { enter() {}, leave() {} }\n\n return {\n enter: visitor.enter,\n leave: visitor.leave,\n };\n}\n/**\n * Given a visitor instance, if it is leaving or not, and a node kind, return\n * the function the visitor runtime should call.\n *\n * @deprecated Please use `getEnterLeaveForKind` instead. Will be removed in v17\n */\n\n/* c8 ignore next 8 */\n\nexport function getVisitFn(visitor, kind, isLeaving) {\n const { enter, leave } = getEnterLeaveForKind(visitor, kind);\n return isLeaving ? leave : enter;\n}\n","import { printBlockString } from './blockString.mjs';\nimport { printString } from './printString.mjs';\nimport { visit } from './visitor.mjs';\n/**\n * Converts an AST into a string, using one set of reasonable\n * formatting rules.\n */\n\nexport function print(ast) {\n return visit(ast, printDocASTReducer);\n}\nconst MAX_LINE_LENGTH = 80;\nconst printDocASTReducer = {\n Name: {\n leave: (node) => node.value,\n },\n Variable: {\n leave: (node) => '$' + node.name,\n },\n // Document\n Document: {\n leave: (node) => join(node.definitions, '\\n\\n'),\n },\n OperationDefinition: {\n leave(node) {\n const varDefs = wrap('(', join(node.variableDefinitions, ', '), ')');\n const prefix = join(\n [\n node.operation,\n join([node.name, varDefs]),\n join(node.directives, ' '),\n ],\n ' ',\n ); // Anonymous queries with no directives or variable definitions can use\n // the query short form.\n\n return (prefix === 'query' ? '' : prefix + ' ') + node.selectionSet;\n },\n },\n VariableDefinition: {\n leave: ({ variable, type, defaultValue, directives }) =>\n variable +\n ': ' +\n type +\n wrap(' = ', defaultValue) +\n wrap(' ', join(directives, ' ')),\n },\n SelectionSet: {\n leave: ({ selections }) => block(selections),\n },\n Field: {\n leave({ alias, name, arguments: args, directives, selectionSet }) {\n const prefix = wrap('', alias, ': ') + name;\n let argsLine = prefix + wrap('(', join(args, ', '), ')');\n\n if (argsLine.length > MAX_LINE_LENGTH) {\n argsLine = prefix + wrap('(\\n', indent(join(args, '\\n')), '\\n)');\n }\n\n return join([argsLine, join(directives, ' '), selectionSet], ' ');\n },\n },\n Argument: {\n leave: ({ name, value }) => name + ': ' + value,\n },\n // Fragments\n FragmentSpread: {\n leave: ({ name, directives }) =>\n '...' + name + wrap(' ', join(directives, ' ')),\n },\n InlineFragment: {\n leave: ({ typeCondition, directives, selectionSet }) =>\n join(\n [\n '...',\n wrap('on ', typeCondition),\n join(directives, ' '),\n selectionSet,\n ],\n ' ',\n ),\n },\n FragmentDefinition: {\n leave: (\n { name, typeCondition, variableDefinitions, directives, selectionSet }, // Note: fragment variable definitions are experimental and may be changed\n ) =>\n // or removed in the future.\n `fragment ${name}${wrap('(', join(variableDefinitions, ', '), ')')} ` +\n `on ${typeCondition} ${wrap('', join(directives, ' '), ' ')}` +\n selectionSet,\n },\n // Value\n IntValue: {\n leave: ({ value }) => value,\n },\n FloatValue: {\n leave: ({ value }) => value,\n },\n StringValue: {\n leave: ({ value, block: isBlockString }) =>\n isBlockString ? printBlockString(value) : printString(value),\n },\n BooleanValue: {\n leave: ({ value }) => (value ? 'true' : 'false'),\n },\n NullValue: {\n leave: () => 'null',\n },\n EnumValue: {\n leave: ({ value }) => value,\n },\n ListValue: {\n leave: ({ values }) => '[' + join(values, ', ') + ']',\n },\n ObjectValue: {\n leave: ({ fields }) => '{' + join(fields, ', ') + '}',\n },\n ObjectField: {\n leave: ({ name, value }) => name + ': ' + value,\n },\n // Directive\n Directive: {\n leave: ({ name, arguments: args }) =>\n '@' + name + wrap('(', join(args, ', '), ')'),\n },\n // Type\n NamedType: {\n leave: ({ name }) => name,\n },\n ListType: {\n leave: ({ type }) => '[' + type + ']',\n },\n NonNullType: {\n leave: ({ type }) => type + '!',\n },\n // Type System Definitions\n SchemaDefinition: {\n leave: ({ description, directives, operationTypes }) =>\n wrap('', description, '\\n') +\n join(['schema', join(directives, ' '), block(operationTypes)], ' '),\n },\n OperationTypeDefinition: {\n leave: ({ operation, type }) => operation + ': ' + type,\n },\n ScalarTypeDefinition: {\n leave: ({ description, name, directives }) =>\n wrap('', description, '\\n') +\n join(['scalar', name, join(directives, ' ')], ' '),\n },\n ObjectTypeDefinition: {\n leave: ({ description, name, interfaces, directives, fields }) =>\n wrap('', description, '\\n') +\n join(\n [\n 'type',\n name,\n wrap('implements ', join(interfaces, ' & ')),\n join(directives, ' '),\n block(fields),\n ],\n ' ',\n ),\n },\n FieldDefinition: {\n leave: ({ description, name, arguments: args, type, directives }) =>\n wrap('', description, '\\n') +\n name +\n (hasMultilineItems(args)\n ? wrap('(\\n', indent(join(args, '\\n')), '\\n)')\n : wrap('(', join(args, ', '), ')')) +\n ': ' +\n type +\n wrap(' ', join(directives, ' ')),\n },\n InputValueDefinition: {\n leave: ({ description, name, type, defaultValue, directives }) =>\n wrap('', description, '\\n') +\n join(\n [name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')],\n ' ',\n ),\n },\n InterfaceTypeDefinition: {\n leave: ({ description, name, interfaces, directives, fields }) =>\n wrap('', description, '\\n') +\n join(\n [\n 'interface',\n name,\n wrap('implements ', join(interfaces, ' & ')),\n join(directives, ' '),\n block(fields),\n ],\n ' ',\n ),\n },\n UnionTypeDefinition: {\n leave: ({ description, name, directives, types }) =>\n wrap('', description, '\\n') +\n join(\n ['union', name, join(directives, ' '), wrap('= ', join(types, ' | '))],\n ' ',\n ),\n },\n EnumTypeDefinition: {\n leave: ({ description, name, directives, values }) =>\n wrap('', description, '\\n') +\n join(['enum', name, join(directives, ' '), block(values)], ' '),\n },\n EnumValueDefinition: {\n leave: ({ description, name, directives }) =>\n wrap('', description, '\\n') + join([name, join(directives, ' ')], ' '),\n },\n InputObjectTypeDefinition: {\n leave: ({ description, name, directives, fields }) =>\n wrap('', description, '\\n') +\n join(['input', name, join(directives, ' '), block(fields)], ' '),\n },\n DirectiveDefinition: {\n leave: ({ description, name, arguments: args, repeatable, locations }) =>\n wrap('', description, '\\n') +\n 'directive @' +\n name +\n (hasMultilineItems(args)\n ? wrap('(\\n', indent(join(args, '\\n')), '\\n)')\n : wrap('(', join(args, ', '), ')')) +\n (repeatable ? ' repeatable' : '') +\n ' on ' +\n join(locations, ' | '),\n },\n SchemaExtension: {\n leave: ({ directives, operationTypes }) =>\n join(\n ['extend schema', join(directives, ' '), block(operationTypes)],\n ' ',\n ),\n },\n ScalarTypeExtension: {\n leave: ({ name, directives }) =>\n join(['extend scalar', name, join(directives, ' ')], ' '),\n },\n ObjectTypeExtension: {\n leave: ({ name, interfaces, directives, fields }) =>\n join(\n [\n 'extend type',\n name,\n wrap('implements ', join(interfaces, ' & ')),\n join(directives, ' '),\n block(fields),\n ],\n ' ',\n ),\n },\n InterfaceTypeExtension: {\n leave: ({ name, interfaces, directives, fields }) =>\n join(\n [\n 'extend interface',\n name,\n wrap('implements ', join(interfaces, ' & ')),\n join(directives, ' '),\n block(fields),\n ],\n ' ',\n ),\n },\n UnionTypeExtension: {\n leave: ({ name, directives, types }) =>\n join(\n [\n 'extend union',\n name,\n join(directives, ' '),\n wrap('= ', join(types, ' | ')),\n ],\n ' ',\n ),\n },\n EnumTypeExtension: {\n leave: ({ name, directives, values }) =>\n join(['extend enum', name, join(directives, ' '), block(values)], ' '),\n },\n InputObjectTypeExtension: {\n leave: ({ name, directives, fields }) =>\n join(['extend input', name, join(directives, ' '), block(fields)], ' '),\n },\n};\n/**\n * Given maybeArray, print an empty string if it is null or empty, otherwise\n * print all items together separated by separator if provided\n */\n\nfunction join(maybeArray, separator = '') {\n var _maybeArray$filter$jo;\n\n return (_maybeArray$filter$jo =\n maybeArray === null || maybeArray === void 0\n ? void 0\n : maybeArray.filter((x) => x).join(separator)) !== null &&\n _maybeArray$filter$jo !== void 0\n ? _maybeArray$filter$jo\n : '';\n}\n/**\n * Given array, print each item on its own line, wrapped in an indented `{ }` block.\n */\n\nfunction block(array) {\n return wrap('{\\n', indent(join(array, '\\n')), '\\n}');\n}\n/**\n * If maybeString is not null or empty, then wrap with start and end, otherwise print an empty string.\n */\n\nfunction wrap(start, maybeString, end = '') {\n return maybeString != null && maybeString !== ''\n ? start + maybeString + end\n : '';\n}\n\nfunction indent(str) {\n return wrap(' ', str.replace(/\\n/g, '\\n '));\n}\n\nfunction hasMultilineItems(maybeArray) {\n var _maybeArray$some;\n\n // FIXME: https://github.com/graphql/graphql-js/issues/2203\n\n /* c8 ignore next */\n return (_maybeArray$some =\n maybeArray === null || maybeArray === void 0\n ? void 0\n : maybeArray.some((str) => str.includes('\\n'))) !== null &&\n _maybeArray$some !== void 0\n ? _maybeArray$some\n : false;\n}\n","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) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\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) => {\n __defNormalProp$1(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nvar NodeType$2 = /* @__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$2 || {});\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 = {};\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) {\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)\n return defaultObj.prototype;\n const untaintedObject = win[key].prototype;\n document.body.removeChild(iframeEl);\n if (!untaintedObject)\n 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)\n 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\")\n 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))\n 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))\n 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(rule) {\n const { cssText } = rule;\n if (cssText.split('\"').length < 3)\n return cssText;\n const statement = [\"@import\", `url(${JSON.stringify(rule.href)})`];\n if (rule.layerName === \"\") {\n statement.push(`layer`);\n } else if (rule.layerName) {\n statement.push(`layer(${rule.layerName})`);\n }\n if (rule.supportsText) {\n statement.push(`supports(${rule.supportsText})`);\n }\n if (rule.media.length) {\n statement.push(rule.media.mediaText);\n }\n return statement.join(\" \") + \";\";\n}\nfunction stringifyStylesheet(s2) {\n try {\n const rules2 = s2.rules || s2.cssRules;\n if (!rules2) {\n return null;\n }\n const stringifiedRules = Array.from(\n rules2,\n (rule) => stringifyRule(rule, s2.href)\n ).join(\"\");\n return fixBrowserCompatibilityIssuesInCSS(stringifiedRules);\n } catch (error) {\n return null;\n }\n}\nfunction stringifyRule(rule, sheetHref) {\n if (isCSSImportRule(rule)) {\n let importStringified;\n try {\n importStringified = // for same-origin stylesheets,\n // we can access the imported stylesheet rules directly\n stringifyStylesheet(rule.styleSheet) || // work around browser issues with the raw string `@import url(...)` statement\n escapeImportStatement(rule);\n } catch (error) {\n importStringified = rule.cssText;\n }\n if (rule.styleSheet.href) {\n return absolutifyURLs(importStringified, rule.styleSheet.href);\n }\n return importStringified;\n } else {\n let ruleStringified = rule.cssText;\n if (isCSSStyleRule(rule) && rule.selectorText.includes(\":\")) {\n ruleStringified = fixSafariColons(ruleStringified);\n }\n if (sheetHref) {\n return absolutifyURLs(ruleStringified, sheetHref);\n }\n return ruleStringified;\n }\n}\nfunction fixSafariColons(cssStringified) {\n const regex = /(\\[(?:[\\w-]+)[^\\\\])(:(?:[\\w-]+)\\])/gm;\n return cssStringified.replace(regex, \"$1\\\\$2\");\n}\nfunction isCSSImportRule(rule) {\n return \"styleSheet\" in rule;\n}\nfunction isCSSStyleRule(rule) {\n return \"selectorText\" in rule;\n}\nclass Mirror {\n constructor() {\n __publicField$1(this, \"idNodeMap\", /* @__PURE__ */ new Map());\n __publicField$1(this, \"nodeMetaMap\", /* @__PURE__ */ new WeakMap());\n }\n getId(n2) {\n var _a2;\n if (!n2)\n 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(node) {\n return this.nodeMetaMap.has(node);\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)\n 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 overwriteRecord,\n maskInputFn\n}) {\n let text = value || \"\";\n if (maskedInputType({\n maskInputOptions,\n tagName,\n type,\n overwriteRecord\n })) {\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)\n return true;\n const chunkSize = 50;\n for (let x = 0; x < canvas.width; x += chunkSize) {\n for (let y = 0; y < canvas.height; y += chunkSize) {\n const getImageData = ctx.getImageData;\n const originalGetImageData = ORIGINAL_ATTRIBUTE_NAME in getImageData ? getImageData[ORIGINAL_ATTRIBUTE_NAME] : getImageData;\n const pixelBuffer = new Uint32Array(\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access\n originalGetImageData.call(\n ctx,\n x,\n y,\n Math.min(chunkSize, canvas.width - x),\n Math.min(chunkSize, canvas.height - y)\n ).data.buffer\n );\n if (pixelBuffer.some((pixel) => pixel !== 0))\n return false;\n }\n }\n return true;\n}\nfunction isNodeMetaEqual(a2, b) {\n if (!a2 || !b || a2.type !== b.type)\n return false;\n if (a2.type === NodeType$2.Document)\n return a2.compatMode === b.compatMode;\n else if (a2.type === NodeType$2.DocumentType)\n return a2.name === b.name && a2.publicId === b.publicId && a2.systemId === b.systemId;\n else if (a2.type === NodeType$2.Comment || a2.type === NodeType$2.Text || a2.type === NodeType$2.CDATA)\n return a2.textContent === b.textContent;\n else if (a2.type === NodeType$2.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 obfuscateText(text) {\n text = text.replace(/[^ -~]+/g, \"\");\n text = (text == null ? void 0 : text.split(\" \").map((word) => Math.random().toString(20).substr(2, word.length)).join(\" \")) || \"\";\n return text;\n}\nfunction isElementSrcBlocked(tagName) {\n return tagName === \"img\" || tagName === \"video\" || tagName === \"audio\" || tagName === \"source\";\n}\nconst EMAIL_REGEX = new RegExp(\n /[a-zA-Z0-9.!#$%&'*+=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*/\n);\nconst LONG_NUMBER_REGEX = new RegExp(/[0-9]{9,16}/);\nconst SSN_REGEX = new RegExp(/[0-9]{3}-?[0-9]{2}-?[0-9]{4}/);\nconst PHONE_NUMBER_REGEX = new RegExp(\n /[+]?[(]?[0-9]{3}[)]?[-\\s.]?[0-9]{3}[-\\s.]?[0-9]{4,6}/\n);\nconst CREDIT_CARD_REGEX = new RegExp(/[0-9]{4}-?[0-9]{4}-?[0-9]{4}-?[0-9]{4}/);\nconst ADDRESS_REGEX = new RegExp(\n /[0-9]{1,5}.?[0-9]{0,3}\\s[a-zA-Z]{2,30}\\s[a-zA-Z]{2,15}/\n);\nconst IP_REGEX = new RegExp(/(?:[0-9]{1,3}.){3}[0-9]{1,3}/);\nconst DEFAULT_OBFUSCATE_REGEXES = [\n EMAIL_REGEX,\n LONG_NUMBER_REGEX,\n SSN_REGEX,\n PHONE_NUMBER_REGEX,\n CREDIT_CARD_REGEX,\n ADDRESS_REGEX,\n IP_REGEX\n];\nfunction shouldObfuscateTextByDefault(text) {\n if (!text)\n return false;\n return DEFAULT_OBFUSCATE_REGEXES.some((regex) => regex.test(text));\n}\nconst maskedInputType = ({\n maskInputOptions,\n tagName,\n type,\n overwriteRecord\n}) => {\n const actualType = type && type.toLowerCase();\n return overwriteRecord !== \"true\" && (!!maskInputOptions[tagName.toLowerCase()] || !!(actualType && maskInputOptions[actualType]));\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(node, regex, checkAncestors) {\n if (!node)\n return false;\n if (node.nodeType !== node.ELEMENT_NODE) {\n if (!checkAncestors)\n return false;\n return classMatchesRegex(index$1.parentNode(node), regex, checkAncestors);\n }\n for (let eIndex = node.classList.length; eIndex--; ) {\n const className = node.classList[eIndex];\n if (regex.test(className)) {\n return true;\n }\n }\n if (!checkAncestors)\n return false;\n return classMatchesRegex(index$1.parentNode(node), regex, checkAncestors);\n}\nfunction needMaskingText(node, maskTextClass, maskTextSelector, checkAncestors) {\n let el;\n if (isElement(node)) {\n el = node;\n if (!index$1.childNodes(el).length) {\n return false;\n }\n } else if (index$1.parentElement(node) === null) {\n return false;\n } else {\n el = index$1.parentElement(node);\n }\n try {\n if (typeof maskTextClass === \"string\") {\n if (checkAncestors) {\n if (el.closest(`.${maskTextClass}`))\n return true;\n } else {\n if (el.classList.contains(maskTextClass))\n return true;\n }\n } else {\n if (classMatchesRegex(el, maskTextClass, checkAncestors))\n return true;\n }\n if (maskTextSelector) {\n if (checkAncestors) {\n if (el.closest(maskTextSelector))\n return true;\n } else {\n if (el.matches(maskTextSelector))\n 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)\n 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 maskTextClass,\n maskTextFn,\n maskInputFn,\n dataURLOptions = {},\n inlineImages,\n recordCanvas,\n keepIframeSrcFn,\n newlyAddedElement = false,\n privacySetting\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$2.Document,\n childNodes: [],\n compatMode: n2.compatMode\n // probably \"BackCompat\"\n };\n } else {\n return {\n type: NodeType$2.Document,\n childNodes: []\n };\n }\n case n2.DOCUMENT_TYPE_NODE:\n return {\n type: NodeType$2.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 maskTextClass,\n dataURLOptions,\n inlineImages,\n recordCanvas,\n keepIframeSrcFn,\n newlyAddedElement,\n privacySetting,\n rootId\n });\n case n2.TEXT_NODE:\n return serializeTextNode(n2, {\n doc,\n needsMask,\n maskTextFn,\n privacySetting,\n rootId\n });\n case n2.CDATA_SECTION_NODE:\n return {\n type: NodeType$2.CDATA,\n textContent: \"\",\n rootId\n };\n case n2.COMMENT_NODE:\n return {\n type: NodeType$2.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))\n return void 0;\n const docId = mirror2.getId(doc);\n return docId === 1 ? void 0 : docId;\n}\nfunction serializeTextNode(n2, options) {\n var _a2, _b;\n const {\n needsMask,\n maskTextFn,\n privacySetting,\n rootId\n } = options;\n const parent = index$1.parentNode(n2);\n const parentTagName = parent && parent.tagName;\n let text = index$1.textContent(n2);\n const isStyle = parentTagName === \"STYLE\" ? true : void 0;\n const isScript = parentTagName === \"SCRIPT\" ? true : void 0;\n let textContentHandled = false;\n if (isStyle && text) {\n try {\n if (n2.nextSibling || n2.previousSibling) {\n } else if ((_a2 = parent.sheet) == null ? void 0 : _a2.cssRules) {\n text = stringifyStylesheet(parent.sheet);\n }\n } catch (err) {\n console.warn(\n `Cannot get CSS styles from text's parentNode. Error: ${err}`,\n n2\n );\n }\n text = absolutifyURLs(text, getHref(options.doc));\n textContentHandled = true;\n }\n if (isScript) {\n text = \"SCRIPT_PLACEHOLDER\";\n textContentHandled = true;\n } else if (parentTagName === \"NOSCRIPT\") {\n text = \"\";\n textContentHandled = true;\n }\n if (!isStyle && !isScript && text && needsMask) {\n text = maskTextFn ? maskTextFn(text, index$1.parentElement(n2)) : text.replace(/[\\S]/g, \"*\");\n }\n const enableStrictPrivacy = privacySetting === \"strict\";\n const highlightOverwriteRecord = (_b = n2.parentElement) == null ? void 0 : _b.getAttribute(\"data-hl-record\");\n const obfuscateDefaultPrivacy = privacySetting === \"default\" && shouldObfuscateTextByDefault(text);\n if ((enableStrictPrivacy || obfuscateDefaultPrivacy) && !highlightOverwriteRecord && !textContentHandled && parentTagName) {\n const IGNORE_TAG_NAMES = /* @__PURE__ */ new Set([\n \"HEAD\",\n \"TITLE\",\n \"STYLE\",\n \"SCRIPT\",\n \"HTML\",\n \"BODY\",\n \"NOSCRIPT\"\n ]);\n if (!IGNORE_TAG_NAMES.has(parentTagName) && text) {\n text = obfuscateText(text);\n }\n }\n return {\n type: NodeType$2.Text,\n textContent: text || \"\",\n isStyle,\n rootId\n };\n}\nfunction serializeElementNode(n2, options) {\n const {\n doc,\n blockClass,\n blockSelector,\n inlineStylesheet,\n maskInputOptions = {},\n maskInputFn,\n maskTextClass,\n dataURLOptions = {},\n inlineImages,\n recordCanvas,\n keepIframeSrcFn,\n newlyAddedElement = false,\n privacySetting,\n rootId\n } = options;\n let needBlock = _isBlockedElement(n2, blockClass, blockSelector);\n const needMask = _isBlockedElement(n2, maskTextClass, null);\n const enableStrictPrivacy = privacySetting === \"strict\";\n let 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 && // TODO: Currently we only try to get dynamic stylesheet when it is an empty style element\n !(n2.innerText || index$1.textContent(n2) || \"\").trim().length) {\n const cssText = stringifyStylesheet(\n n2.sheet\n );\n if (cssText) {\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 overwriteRecord: n2.getAttribute(\"data-hl-record\"),\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 && !needBlock && !needMask && !enableStrictPrivacy) {\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\") || \"\";\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\n 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)\n recordInlineImage();\n else\n 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 || needMask || enableStrictPrivacy && isElementSrcBlocked(tagName)) {\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 (enableStrictPrivacy && isElementSrcBlocked(tagName)) {\n needBlock = true;\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))\n isCustomElement = true;\n } catch (e2) {\n }\n if (inlineImages && tagName === \"video\") {\n const video = n2;\n if (video.src === \"\" || video.src.indexOf(\"blob:\") !== -1) {\n const { width, height } = n2.getBoundingClientRect();\n attributes = {\n width,\n height,\n rr_width: `${width}px`,\n rr_height: `${height}px`,\n rr_inlined_video: true\n };\n tagName = \"canvas\";\n const blankCanvas = doc.createElement(\"canvas\");\n blankCanvas.width = n2.width;\n blankCanvas.height = n2.height;\n attributes.rr_dataURL = blankCanvas.toDataURL(\n dataURLOptions.type,\n dataURLOptions.quality\n );\n }\n }\n return {\n type: NodeType$2.Element,\n tagName,\n attributes,\n childNodes: [],\n isSVG: isSVGElement(n2) || void 0,\n needBlock,\n needMask,\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$2.Comment) {\n return true;\n } else if (sn.type === NodeType$2.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 privacySetting\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 maskTextClass,\n maskTextFn,\n maskInputFn,\n dataURLOptions,\n inlineImages,\n recordCanvas,\n keepIframeSrcFn,\n newlyAddedElement,\n privacySetting\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$2.Text && !_serializedNode.isStyle && !_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 let overwrittenPrivacySetting = privacySetting;\n let strictPrivacy = privacySetting === \"strict\";\n if (serializedNode.type === NodeType$2.Element) {\n recordChild = recordChild && !serializedNode.needBlock;\n strictPrivacy || (strictPrivacy = !!serializedNode.needBlock || !!serializedNode.needMask);\n overwrittenPrivacySetting = strictPrivacy ? \"strict\" : overwrittenPrivacySetting;\n if (strictPrivacy && isElementSrcBlocked(serializedNode.tagName)) {\n const clone = n2.cloneNode();\n clone.src = \"\";\n mirror2.add(clone, serializedNode);\n }\n delete serializedNode.needBlock;\n delete serializedNode.needMask;\n const shadowRootEl = index$1.shadowRoot(n2);\n if (shadowRootEl && isNativeShadowDom(shadowRootEl))\n serializedNode.isShadowHost = true;\n }\n if ((serializedNode.type === NodeType$2.Document || serializedNode.type === NodeType$2.Element) && recordChild) {\n if (slimDOMOptions.headWhitespace && serializedNode.type === NodeType$2.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 privacySetting: overwrittenPrivacySetting\n };\n if (serializedNode.type === NodeType$2.Element && serializedNode.tagName === \"textarea\" && serializedNode.attributes.value !== void 0)\n ;\n else {\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$2.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 privacySetting\n });\n if (serializedIframeNode) {\n onIframeLoad(\n n2,\n serializedIframeNode\n );\n }\n }\n },\n iframeLoadTimeout\n );\n }\n if (serializedNode.type === NodeType$2.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 privacySetting\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 = \"highlight-block\",\n blockSelector = null,\n maskTextClass = \"highlight-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 privacySetting = \"default\"\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 || 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 ? {} : 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 privacySetting\n });\n}\nconst commentre = /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g;\nfunction parse(css, options = {}) {\n let lineno = 1;\n let column = 1;\n function updatePosition(str) {\n const lines = str.match(/\\n/g);\n if (lines) {\n lineno += lines.length;\n }\n const i2 = str.lastIndexOf(\"\\n\");\n column = i2 === -1 ? column + str.length : str.length - i2;\n }\n function position() {\n const start = { line: lineno, column };\n return (node) => {\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }\n const _Position = class _Position2 {\n constructor(start) {\n __publicField$1(this, \"content\");\n __publicField$1(this, \"start\");\n __publicField$1(this, \"end\");\n __publicField$1(this, \"source\");\n this.start = start;\n this.end = { line: lineno, column };\n this.source = options.source;\n this.content = _Position2.content;\n }\n };\n __publicField$1(_Position, \"content\");\n let Position = _Position;\n Position.content = css;\n const errorsList = [];\n function error(msg) {\n const err = new Error(\n `${options.source || \"\"}:${lineno}:${column}: ${msg}`\n );\n err.reason = msg;\n err.filename = options.source;\n err.line = lineno;\n err.column = column;\n err.source = css;\n if (options.silent) {\n errorsList.push(err);\n } else {\n throw err;\n }\n }\n function stylesheet() {\n const rulesList = rules2();\n return {\n type: \"stylesheet\",\n stylesheet: {\n source: options.source,\n rules: rulesList,\n parsingErrors: errorsList\n }\n };\n }\n function open() {\n return match(/^{\\s*/);\n }\n function close() {\n return match(/^}/);\n }\n function rules2() {\n let node;\n const rules22 = [];\n whitespace();\n comments(rules22);\n while (css.length && css.charAt(0) !== \"}\" && (node = atrule() || rule())) {\n if (node) {\n rules22.push(node);\n comments(rules22);\n }\n }\n return rules22;\n }\n function match(re) {\n const m = re.exec(css);\n if (!m) {\n return;\n }\n const str = m[0];\n updatePosition(str);\n css = css.slice(str.length);\n return m;\n }\n function whitespace() {\n match(/^\\s*/);\n }\n function comments(rules22 = []) {\n let c2;\n while (c2 = comment()) {\n if (c2) {\n rules22.push(c2);\n }\n c2 = comment();\n }\n return rules22;\n }\n function comment() {\n const pos = position();\n if (\"/\" !== css.charAt(0) || \"*\" !== css.charAt(1)) {\n return;\n }\n let i2 = 2;\n while (\"\" !== css.charAt(i2) && (\"*\" !== css.charAt(i2) || \"/\" !== css.charAt(i2 + 1))) {\n ++i2;\n }\n i2 += 2;\n if (\"\" === css.charAt(i2 - 1)) {\n return error(\"End of comment missing\");\n }\n const str = css.slice(2, i2 - 2);\n column += 2;\n updatePosition(str);\n css = css.slice(i2);\n column += 2;\n return pos({\n type: \"comment\",\n comment: str\n });\n }\n const selectorMatcher = new RegExp(\n \"^((\" + [\n /[^\\\\]\"(?:\\\\\"|[^\"])*\"/.source,\n // consume any quoted parts (checking that the double quote isn't itself escaped)\n /[^\\\\]'(?:\\\\'|[^'])*'/.source,\n // same but for single quotes\n \"[^{]\"\n ].join(\"|\") + \")+)\"\n );\n function selector() {\n whitespace();\n while (css[0] == \"}\") {\n error(\"extra closing bracket\");\n css = css.slice(1);\n whitespace();\n }\n const m = match(selectorMatcher);\n if (!m) {\n return;\n }\n const cleanedInput = m[0].trim().replace(/\\/\\*([^*]|[\\r\\n]|(\\*+([^*/]|[\\r\\n])))*\\*\\/+/g, \"\").replace(/\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'/g, (m2) => {\n return m2.replace(/,/g, \"‌\");\n });\n return customSplit(cleanedInput).map(\n (s2) => s2.replace(/\\u200C/g, \",\").trim()\n );\n }\n function customSplit(input) {\n const result = [];\n let currentSegment = \"\";\n let depthParentheses = 0;\n let depthBrackets = 0;\n let currentStringChar = null;\n for (const char of input) {\n const hasStringEscape = currentSegment.endsWith(\"\\\\\");\n if (currentStringChar) {\n if (currentStringChar === char && !hasStringEscape) {\n currentStringChar = null;\n }\n } else if (char === \"(\") {\n depthParentheses++;\n } else if (char === \")\") {\n depthParentheses--;\n } else if (char === \"[\") {\n depthBrackets++;\n } else if (char === \"]\") {\n depthBrackets--;\n } else if (`'\"`.includes(char)) {\n currentStringChar = char;\n }\n if (char === \",\" && depthParentheses === 0 && depthBrackets === 0) {\n result.push(currentSegment);\n currentSegment = \"\";\n } else {\n currentSegment += char;\n }\n }\n if (currentSegment) {\n result.push(currentSegment);\n }\n return result;\n }\n function declaration() {\n const pos = position();\n const propMatch = match(/^(\\*?[-#\\/\\*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)\\s*/);\n if (!propMatch) {\n return;\n }\n const prop = trim(propMatch[0]);\n if (!match(/^:\\s*/)) {\n return error(`property missing ':'`);\n }\n const val = match(/^((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^\\)]*?\\)|[^};])+)/);\n const ret = pos({\n type: \"declaration\",\n property: prop.replace(commentre, \"\"),\n value: val ? trim(val[0]).replace(commentre, \"\") : \"\"\n });\n match(/^[;\\s]*/);\n return ret;\n }\n function declarations() {\n const decls = [];\n if (!open()) {\n return error(`missing '{'`);\n }\n comments(decls);\n let decl;\n while (decl = declaration()) {\n if (decl !== false) {\n decls.push(decl);\n comments(decls);\n }\n decl = declaration();\n }\n if (!close()) {\n return error(`missing '}'`);\n }\n return decls;\n }\n function keyframe() {\n let m;\n const vals = [];\n const pos = position();\n while (m = match(/^((\\d+\\.\\d+|\\.\\d+|\\d+)%?|[a-z]+)\\s*/)) {\n vals.push(m[1]);\n match(/^,\\s*/);\n }\n if (!vals.length) {\n return;\n }\n return pos({\n type: \"keyframe\",\n values: vals,\n declarations: declarations()\n });\n }\n function atkeyframes() {\n const pos = position();\n let m = match(/^@([-\\w]+)?keyframes\\s*/);\n if (!m) {\n return;\n }\n const vendor = m[1];\n m = match(/^([-\\w]+)\\s*/);\n if (!m) {\n return error(\"@keyframes missing name\");\n }\n const name = m[1];\n if (!open()) {\n return error(`@keyframes missing '{'`);\n }\n let frame;\n let frames = comments();\n while (frame = keyframe()) {\n frames.push(frame);\n frames = frames.concat(comments());\n }\n if (!close()) {\n return error(`@keyframes missing '}'`);\n }\n return pos({\n type: \"keyframes\",\n name,\n vendor,\n keyframes: frames\n });\n }\n function atsupports() {\n const pos = position();\n const m = match(/^@supports *([^{]+)/);\n if (!m) {\n return;\n }\n const supports = trim(m[1]);\n if (!open()) {\n return error(`@supports missing '{'`);\n }\n const style = comments().concat(rules2());\n if (!close()) {\n return error(`@supports missing '}'`);\n }\n return pos({\n type: \"supports\",\n supports,\n rules: style\n });\n }\n function athost() {\n const pos = position();\n const m = match(/^@host\\s*/);\n if (!m) {\n return;\n }\n if (!open()) {\n return error(`@host missing '{'`);\n }\n const style = comments().concat(rules2());\n if (!close()) {\n return error(`@host missing '}'`);\n }\n return pos({\n type: \"host\",\n rules: style\n });\n }\n function atmedia() {\n const pos = position();\n const m = match(/^@media *([^{]+)/);\n if (!m) {\n return;\n }\n const media = trim(m[1]);\n if (!open()) {\n return error(`@media missing '{'`);\n }\n const style = comments().concat(rules2());\n if (!close()) {\n return error(`@media missing '}'`);\n }\n return pos({\n type: \"media\",\n media,\n rules: style\n });\n }\n function atcustommedia() {\n const pos = position();\n const m = match(/^@custom-media\\s+(--[^\\s]+)\\s*([^{;]+);/);\n if (!m) {\n return;\n }\n return pos({\n type: \"custom-media\",\n name: trim(m[1]),\n media: trim(m[2])\n });\n }\n function atpage() {\n const pos = position();\n const m = match(/^@page */);\n if (!m) {\n return;\n }\n const sel = selector() || [];\n if (!open()) {\n return error(`@page missing '{'`);\n }\n let decls = comments();\n let decl;\n while (decl = declaration()) {\n decls.push(decl);\n decls = decls.concat(comments());\n }\n if (!close()) {\n return error(`@page missing '}'`);\n }\n return pos({\n type: \"page\",\n selectors: sel,\n declarations: decls\n });\n }\n function atdocument() {\n const pos = position();\n const m = match(/^@([-\\w]+)?document *([^{]+)/);\n if (!m) {\n return;\n }\n const vendor = trim(m[1]);\n const doc = trim(m[2]);\n if (!open()) {\n return error(`@document missing '{'`);\n }\n const style = comments().concat(rules2());\n if (!close()) {\n return error(`@document missing '}'`);\n }\n return pos({\n type: \"document\",\n document: doc,\n vendor,\n rules: style\n });\n }\n function atfontface() {\n const pos = position();\n const m = match(/^@font-face\\s*/);\n if (!m) {\n return;\n }\n if (!open()) {\n return error(`@font-face missing '{'`);\n }\n let decls = comments();\n let decl;\n while (decl = declaration()) {\n decls.push(decl);\n decls = decls.concat(comments());\n }\n if (!close()) {\n return error(`@font-face missing '}'`);\n }\n return pos({\n type: \"font-face\",\n declarations: decls\n });\n }\n const atimport = _compileAtrule(\"import\");\n const atcharset = _compileAtrule(\"charset\");\n const atnamespace = _compileAtrule(\"namespace\");\n function _compileAtrule(name) {\n const re = new RegExp(\n \"^@\" + name + \"\\\\s*((?:\" + [\n /[^\\\\]\"(?:\\\\\"|[^\"])*\"/.source,\n // consume any quoted parts (checking that the double quote isn't itself escaped)\n /[^\\\\]'(?:\\\\'|[^'])*'/.source,\n // same but for single quotes\n \"[^;]\"\n ].join(\"|\") + \")+);\"\n );\n return () => {\n const pos = position();\n const m = match(re);\n if (!m) {\n return;\n }\n const ret = { type: name };\n ret[name] = m[1].trim();\n return pos(ret);\n };\n }\n function atrule() {\n if (css[0] !== \"@\") {\n return;\n }\n return atkeyframes() || atmedia() || atcustommedia() || atsupports() || atimport() || atcharset() || atnamespace() || atdocument() || atpage() || athost() || atfontface();\n }\n function rule() {\n const pos = position();\n const sel = selector();\n if (!sel) {\n return error(\"selector missing\");\n }\n comments();\n return pos({\n type: \"rule\",\n selectors: sel,\n declarations: declarations()\n });\n }\n return addParent(stylesheet());\n}\nfunction trim(str) {\n return str ? str.replace(/^\\s+|\\s+$/g, \"\") : \"\";\n}\nfunction addParent(obj, parent) {\n const isNode = obj && typeof obj.type === \"string\";\n const childParent = isNode ? obj : parent;\n for (const k of Object.keys(obj)) {\n const value = obj[k];\n if (Array.isArray(value)) {\n value.forEach((v2) => {\n addParent(v2, childParent);\n });\n } else if (value && typeof value === \"object\") {\n addParent(value, childParent);\n }\n }\n if (isNode) {\n Object.defineProperty(obj, \"parent\", {\n configurable: true,\n writable: true,\n enumerable: false,\n value: parent || null\n });\n }\n return obj;\n}\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 escapeRegExp(str) {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\nconst MEDIA_SELECTOR = /(max|min)-device-(width|height)/;\nconst MEDIA_SELECTOR_GLOBAL = new RegExp(MEDIA_SELECTOR.source, \"g\");\nconst HOVER_SELECTOR = /([^\\\\]):hover/;\nconst HOVER_SELECTOR_GLOBAL = new RegExp(HOVER_SELECTOR.source, \"g\");\nfunction adaptCssForReplay(cssText, cache) {\n const cachedStyle = cache == null ? void 0 : cache.stylesWithHoverClass.get(cssText);\n if (cachedStyle)\n return cachedStyle;\n const ast = parse(cssText, {\n silent: true\n });\n if (!ast.stylesheet) {\n return cssText;\n }\n const selectors = [];\n const medias = [];\n function getSelectors(rule) {\n if (\"selectors\" in rule && rule.selectors) {\n rule.selectors.forEach((selector) => {\n if (HOVER_SELECTOR.test(selector)) {\n selectors.push(selector);\n }\n });\n }\n if (\"media\" in rule && rule.media && MEDIA_SELECTOR.test(rule.media)) {\n medias.push(rule.media);\n }\n if (\"rules\" in rule && rule.rules) {\n rule.rules.forEach(getSelectors);\n }\n }\n getSelectors(ast.stylesheet);\n let result = cssText;\n if (selectors.length > 0) {\n const selectorMatcher = new RegExp(\n selectors.filter((selector, index2) => selectors.indexOf(selector) === index2).sort((a2, b) => b.length - a2.length).map((selector) => {\n return escapeRegExp(selector);\n }).join(\"|\"),\n \"g\"\n );\n result = result.replace(selectorMatcher, (selector) => {\n const newSelector = selector.replace(\n HOVER_SELECTOR_GLOBAL,\n \"$1.\\\\:hover\"\n );\n return `${selector}, ${newSelector}`;\n });\n }\n if (medias.length > 0) {\n const mediaMatcher = new RegExp(\n medias.filter((media, index2) => medias.indexOf(media) === index2).sort((a2, b) => b.length - a2.length).map((media) => {\n return escapeRegExp(media);\n }).join(\"|\"),\n \"g\"\n );\n result = result.replace(mediaMatcher, (media) => {\n return media.replace(MEDIA_SELECTOR_GLOBAL, \"$1-$2\");\n });\n }\n cache == null ? void 0 : cache.stylesWithHoverClass.set(cssText, result);\n return result;\n}\nfunction createCache() {\n const stylesWithHoverClass = /* @__PURE__ */ new Map();\n return {\n stylesWithHoverClass\n };\n}\nfunction buildNode(n2, options) {\n var _a2;\n const { doc, hackCss, cache } = options;\n switch (n2.type) {\n case NodeType$2.Document:\n return doc.implementation.createDocument(null, \"\", null);\n case NodeType$2.DocumentType:\n return doc.implementation.createDocumentType(\n n2.name || \"html\",\n n2.publicId,\n n2.systemId\n );\n case NodeType$2.Element: {\n const tagName = getTagName(n2);\n let node;\n if (n2.isSVG) {\n node = 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 node = 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)\n value = \"\";\n if (name.startsWith(\"rr_\")) {\n specialAttributes[name] = value;\n continue;\n }\n const isTextarea = tagName === \"textarea\" && name === \"value\";\n const isRemoteOrDynamicCss = tagName === \"style\" && name === \"_cssText\";\n if (isRemoteOrDynamicCss && hackCss && typeof value === \"string\") {\n value = adaptCssForReplay(value, cache);\n }\n if ((isTextarea || isRemoteOrDynamicCss) && typeof value === \"string\") {\n node.appendChild(doc.createTextNode(value));\n n2.childNodes = [];\n continue;\n }\n try {\n if (n2.isSVG && name === \"xlink:href\") {\n node.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 node.setAttribute(\"_\" + name, value.toString());\n } else if (tagName === \"meta\" && n2.attributes[\"http-equiv\"] === \"Content-Security-Policy\" && name === \"content\") {\n node.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 node.setAttribute(\n \"rrweb-original-srcset\",\n n2.attributes.srcset\n );\n } else {\n node.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 = node.getContext(\"2d\");\n if (ctx) {\n ctx.drawImage(image, 0, 0, image.width, image.height);\n }\n };\n image.src = value.toString();\n if (node.RRNodeType)\n node.rr_dataURL = value.toString();\n } else if (tagName === \"img\" && name === \"rr_dataURL\") {\n const image = node;\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 node.style.width = value.toString();\n } else if (name === \"rr_height\") {\n node.style.height = value.toString();\n } else if (name === \"rr_mediaCurrentTime\" && typeof value === \"number\") {\n node.currentTime = value;\n } else if (name === \"rr_mediaState\") {\n switch (value) {\n case \"played\":\n node.play().catch((e2) => console.warn(\"media playback error\", e2));\n break;\n case \"paused\":\n node.pause();\n break;\n }\n } else if (name === \"rr_mediaPlaybackRate\" && typeof value === \"number\") {\n node.playbackRate = value;\n } else if (name === \"rr_mediaMuted\" && typeof value === \"boolean\") {\n node.muted = value;\n } else if (name === \"rr_mediaLoop\" && typeof value === \"boolean\") {\n node.loop = value;\n } else if (name === \"rr_mediaVolume\" && typeof value === \"number\") {\n node.volume = value;\n } else if (name === \"rr_open_mode\") {\n node.setAttribute(\n \"rr_open_mode\",\n value\n );\n }\n }\n if (n2.isShadowHost) {\n if (!node.shadowRoot) {\n node.attachShadow({ mode: \"open\" });\n } else {\n while (node.shadowRoot.firstChild) {\n node.shadowRoot.removeChild(node.shadowRoot.firstChild);\n }\n }\n }\n return node;\n }\n case NodeType$2.Text:\n return doc.createTextNode(\n n2.isStyle && hackCss ? adaptCssForReplay(n2.textContent, cache) : n2.textContent\n );\n case NodeType$2.CDATA:\n return doc.createCDATASection(n2.textContent);\n case NodeType$2.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))\n return mirror2.getNode(n2.id);\n }\n let node = buildNode(n2, { doc, hackCss, cache });\n if (!node) {\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$2.Document) {\n doc.close();\n doc.open();\n if (n2.compatMode === \"BackCompat\" && n2.childNodes && n2.childNodes[0].type !== NodeType$2.DocumentType) {\n if (n2.childNodes[0].type === NodeType$2.Element && \"xmlns\" in n2.childNodes[0].attributes && n2.childNodes[0].attributes.xmlns === \"http://www.w3.org/1999/xhtml\") {\n doc.write(\n ''\n );\n } else {\n doc.write(\n ''\n );\n }\n }\n node = doc;\n }\n mirror2.add(node, n2);\n if ((n2.type === NodeType$2.Document || n2.type === NodeType$2.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(node) && node.shadowRoot) {\n node.shadowRoot.appendChild(childNode);\n } else if (n2.type === NodeType$2.Document && childN.type == NodeType$2.Element) {\n const htmlElement = childNode;\n let body = null;\n htmlElement.childNodes.forEach((child) => {\n if (child.nodeName === \"BODY\")\n body = child;\n });\n if (body) {\n htmlElement.removeChild(body);\n node.appendChild(childNode);\n htmlElement.appendChild(body);\n } else {\n node.appendChild(childNode);\n }\n } else {\n node.appendChild(childNode);\n }\n if (afterAppend) {\n afterAppend(childNode, childN.id);\n }\n }\n }\n return node;\n}\nfunction visit(mirror2, onVisit) {\n function walk(node) {\n onVisit(node);\n }\n for (const id of mirror2.getIds()) {\n if (mirror2.has(id)) {\n walk(mirror2.getNode(id));\n }\n }\n}\nfunction handleScroll(node, mirror2) {\n const n2 = mirror2.getMeta(node);\n if ((n2 == null ? void 0 : n2.type) !== NodeType$2.Element) {\n return;\n }\n const el = node;\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 node = 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 node;\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) => {\n __defNormalProp2(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\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) => {\n __defNormalProp22(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\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 || {});\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)\n 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(node) {\n return this.nodeMetaMap.has(node);\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)\n 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 parseCSSText(cssText) {\n const res = {};\n const listDelimiter = /;(?![^(]*\\))/g;\n const propertyDelimiter = /:(.+)/;\n const comment = /\\/\\*.*?\\*\\//g;\n cssText.replace(comment, \"\").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\")\n 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))\n 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(node) {\n if (!(node instanceof BaseRRNode))\n return false;\n else if (node.ownerDocument !== this.ownerDocument)\n return false;\n else if (node === this)\n return true;\n while (node.parentNode) {\n if (node.parentNode === this)\n return true;\n node = node.parentNode;\n }\n return false;\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n appendChild(_newChild) {\n throw new Error(\n `RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.`\n );\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n insertBefore(_newChild, _refChild) {\n throw new Error(\n `RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.`\n );\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n removeChild(_node) {\n throw new Error(\n `RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.`\n );\n }\n toString() {\n return \"RRNode\";\n }\n}\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 (node) => node.RRNodeType === NodeType$1.Element && node.tagName === \"HTML\"\n ) || null;\n }\n get body() {\n var _a2;\n return ((_a2 = this.documentElement) == null ? void 0 : _a2.childNodes.find(\n (node) => node.RRNodeType === NodeType$1.Element && node.tagName === \"BODY\"\n )) || null;\n }\n get head() {\n var _a2;\n return ((_a2 = this.documentElement) == null ? void 0 : _a2.childNodes.find(\n (node) => node.RRNodeType === NodeType$1.Element && node.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(node) {\n return removeChild(this, node);\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('\\')\n * 2. doc.write('\\')\n */\n write(content) {\n let publicId;\n if (content === '')\n publicId = \"-//W3C//DTD XHTML 1.0 Transitional//EN\";\n else if (content === '')\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 comment = new BaseRRComment(data);\n comment.ownerDocument = this;\n return comment;\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 result = \"\";\n this.childNodes.forEach((node) => result += node.textContent);\n return result;\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))\n return;\n const normalizedName = camelize(name);\n if (!value)\n delete style[normalizedName];\n else\n style[normalizedName] = value;\n if (priority === \"important\")\n style[normalizedName] += \" !important\";\n this.attributes.style = toCSSText(style);\n };\n style.removeProperty = (name) => {\n if (hyphenateRE2.test(name))\n 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)\n 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(node) {\n return removeChild(this, node);\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)\n 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)\n 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)\n 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)\n return newChild;\n if (newChild.parentNode)\n newChild.parentNode.removeChild(newChild);\n newChild.previousSibling = refChild.previousSibling;\n refChild.previousSibling = newChild;\n newChild.nextSibling = refChild;\n if (newChild.previousSibling)\n newChild.previousSibling.nextSibling = newChild;\n else\n 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\n parent.firstChild = child.nextSibling;\n if (child.nextSibling)\n child.nextSibling.previousSibling = child.previousSibling;\n else\n 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 = /* @__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 || {});\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)\n 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)\n 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)\n dialog.close();\n if (shouldBeOpen && (openChanged || modalChanged)) {\n try {\n if (shouldBeModal)\n dialog.showModal();\n else\n 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\")\n continue;\n else\n oldTree.setAttribute(name, newValue);\n }\n for (const { name } of Array.from(oldAttributes))\n if (!(name in newAttributes))\n 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)\n 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 node = oldChildren[oldStartIndex];\n if (!node || node.parentNode !== oldTree)\n continue;\n try {\n oldTree.removeChild(node);\n replayer.mirror.removeNodeFromMap(node);\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 node = null;\n if (nodeId > -1)\n node = domMirror.getNode(nodeId);\n if (node !== null && sameNodeType(node, rrNode))\n return node;\n switch (rrNode.RRNodeType) {\n case NodeType$1.Document:\n node = new Document();\n break;\n case NodeType$1.DocumentType:\n node = 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 node = document.createElementNS(NAMESPACES[\"svg\"], tagName);\n } else\n node = document.createElement(rrNode.tagName);\n break;\n }\n case NodeType$1.Text:\n node = document.createTextNode(rrNode.data);\n break;\n case NodeType$1.Comment:\n node = document.createComment(rrNode.data);\n break;\n case NodeType$1.CDATA:\n node = document.createCDATASection(rrNode.data);\n break;\n }\n if (sn)\n domMirror.add(node, { ...sn });\n try {\n createdNodeSet == null ? void 0 : createdNodeSet.add(node);\n } catch (e2) {\n }\n return node;\n}\nfunction sameNodeType(node1, node2) {\n if (node1.nodeType !== node2.nodeType)\n 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)\n 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(node, rrdom, domMirror, parentRRNode) {\n let rrNode;\n switch (node.nodeType) {\n case NodeType.DOCUMENT_NODE:\n if (parentRRNode && parentRRNode.nodeName === \"IFRAME\")\n rrNode = parentRRNode.contentDocument;\n else {\n rrNode = rrdom;\n rrNode.compatMode = node.compatMode;\n }\n break;\n case NodeType.DOCUMENT_TYPE_NODE: {\n const documentType = node;\n rrNode = rrdom.createDocumentType(\n documentType.name,\n documentType.publicId,\n documentType.systemId\n );\n break;\n }\n case NodeType.ELEMENT_NODE: {\n const elementNode = node;\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.TEXT_NODE:\n rrNode = rrdom.createTextNode(node.textContent || \"\");\n break;\n case NodeType.CDATA_SECTION_NODE:\n rrNode = rrdom.createCDATASection(node.data);\n break;\n case NodeType.COMMENT_NODE:\n rrNode = rrdom.createComment(node.textContent || \"\");\n break;\n case NodeType.DOCUMENT_FRAGMENT_NODE:\n rrNode = parentRRNode.attachShadow({ mode: \"open\" });\n break;\n default:\n return null;\n }\n let sn = domMirror.getMeta(node);\n if (rrdom instanceof RRDocument) {\n if (!sn) {\n sn = getDefaultSN(rrNode, rrdom.unserializedId);\n domMirror.add(node, 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(node, parentRRNode) {\n const rrNode = buildFromNode(node, rrdom, domMirror, parentRRNode);\n if (rrNode === null)\n 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 node.nodeType !== NodeType.DOCUMENT_FRAGMENT_NODE\n ) {\n parentRRNode == null ? void 0 : parentRRNode.appendChild(rrNode);\n rrNode.parentNode = parentRRNode;\n rrNode.parentElement = parentRRNode;\n }\n if (node.nodeName === \"IFRAME\") {\n const iframeDoc = node.contentDocument;\n iframeDoc && walk2(iframeDoc, rrNode);\n } else if (node.nodeType === NodeType.DOCUMENT_NODE || node.nodeType === NodeType.ELEMENT_NODE || node.nodeType === NodeType.DOCUMENT_FRAGMENT_NODE) {\n if (node.nodeType === NodeType.ELEMENT_NODE && node.shadowRoot)\n walk2(node.shadowRoot, rrNode);\n node.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)\n 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(node) {\n return this.nodeMetaMap.has(node);\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)\n 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(node, id) {\n switch (node.RRNodeType) {\n case NodeType$1.Document:\n return {\n id,\n type: node.RRNodeType,\n childNodes: []\n };\n case NodeType$1.DocumentType: {\n const doctype = node;\n return {\n id,\n type: node.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: node.RRNodeType,\n tagName: node.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: node.RRNodeType,\n textContent: node.textContent || \"\"\n };\n case NodeType$1.Comment:\n return {\n id,\n type: node.RRNodeType,\n textContent: node.textContent || \"\"\n };\n case NodeType$1.CDATA:\n return {\n id,\n type: node.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 = {};\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) {\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)\n return defaultObj.prototype;\n const untaintedObject = win[key].prototype;\n document.body.removeChild(iframeEl);\n if (!untaintedObject)\n 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)\n 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\")\n 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))\n 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))\n 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 };\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(node) {\n if (!node) {\n return null;\n }\n const el = node.nodeType === node.ELEMENT_NODE ? node : index.parentElement(node);\n return el;\n}\nconst isCanvasNode = (node) => {\n try {\n if (node instanceof HTMLElement) {\n return node.tagName === \"CANVAS\";\n }\n } catch {\n return false;\n }\n return false;\n};\nfunction isBlocked(node, blockClass, blockSelector, checkAncestors) {\n if (!node) {\n return false;\n }\n const el = closestElementOfNode(node);\n if (!el) {\n return false;\n }\n try {\n if (typeof blockClass === \"string\") {\n if (el.classList.contains(blockClass))\n return true;\n if (checkAncestors && el.closest(\".\" + blockClass) !== null)\n return true;\n } else {\n if (classMatchesRegex(el, blockClass, checkAncestors))\n return true;\n }\n } catch (e2) {\n }\n if (blockSelector) {\n if (el.matches(blockSelector))\n return true;\n if (checkAncestors && el.closest(blockSelector) !== null)\n 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(node, rootIframe) {\n var _a2, _b;\n const frameElement = (_b = (_a2 = node.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)\n 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 rule = rules2[position[0]];\n if (position.length === 1) {\n return rule;\n } else {\n return getNestedRule(\n rule.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))\n return this.getId(stylesheet);\n let newId;\n if (id === void 0) {\n newId = this.id++;\n } else\n 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)\n 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)\n 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 isCanvasNode,\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 || {});\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 node = {\n value: n2,\n previous: null,\n next: null\n };\n n2.__ln = node;\n if (n2.previousSibling && isNodeInLinkedList(n2.previousSibling)) {\n const current = n2.previousSibling.__ln.next;\n node.next = current;\n node.previous = n2.previousSibling.__ln;\n n2.previousSibling.__ln.next = node;\n if (current) {\n current.previous = node;\n }\n } else if (n2.nextSibling && isNodeInLinkedList(n2.nextSibling) && n2.nextSibling.__ln.previous) {\n const current = n2.nextSibling.__ln.previous;\n node.previous = current;\n node.next = n2.nextSibling.__ln;\n n2.nextSibling.__ln.previous = node;\n if (current) {\n current.next = node;\n }\n } else {\n if (this.head) {\n this.head.previous = node;\n }\n node.next = this.head;\n this.head = node;\n }\n if (node.next === null) {\n this.tail = node;\n }\n this.length++;\n }\n removeNode(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, \"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, \"privacySetting\");\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) || parent.tagName === \"TEXTAREA\") {\n return;\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 privacySetting: this.privacySetting,\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 });\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.removes, 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.removes, 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 node = null;\n if (candidate) {\n const parentId = this.mirror.getId(index.parentNode(candidate.value));\n const nextId = getNextId(candidate.value);\n if (parentId !== -1 && nextId !== -1) {\n node = candidate;\n }\n }\n if (!node) {\n let tailNode = addList.tail;\n while (tailNode) {\n const _node = tailNode;\n tailNode = tailNode.previous;\n if (_node) {\n const parentId = this.mirror.getId(index.parentNode(_node.value));\n const nextId = getNextId(_node.value);\n if (nextId === -1)\n continue;\n else if (parentId !== -1) {\n node = _node;\n break;\n } else {\n const unhandledNode = _node.value;\n const parent = index.parentNode(unhandledNode);\n if (parent && parent.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n const shadowHost = index.host(parent);\n const parentId2 = this.mirror.getId(shadowHost);\n if (parentId2 !== -1) {\n node = _node;\n break;\n }\n }\n }\n }\n }\n }\n if (!node) {\n while (addList.head) {\n addList.removeNode(addList.head.value);\n }\n break;\n }\n candidate = node.previous;\n addList.removeNode(node.value);\n pushAdd(node.value);\n }\n const payload = {\n texts: this.texts.map((text) => {\n var _a2, _b;\n const n2 = text.node;\n const parent = index.parentNode(n2);\n if (parent && parent.tagName === \"TEXTAREA\") {\n this.genTextAreaValueMutation(parent);\n }\n let value = text.value;\n const enableStrictPrivacy = this.privacySetting === \"strict\";\n const obfuscateDefaultPrivacy = this.privacySetting === \"default\" && shouldObfuscateTextByDefault(value);\n const highlightOverwriteRecord = (_b = (_a2 = text.node) == null ? void 0 : _a2.parentElement) == null ? void 0 : _b.getAttribute(\"data-hl-record\");\n if ((enableStrictPrivacy || obfuscateDefaultPrivacy) && !highlightOverwriteRecord && value) {\n value = obfuscateText(value);\n }\n return {\n id: this.mirror.getId(n2),\n 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.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 overwriteRecord: target.getAttribute(\"data-hl-record\"),\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 const tagName = m.target.tagName;\n if (tagName === \"INPUT\") {\n const node = m.target;\n if (node.type === \"password\") {\n item.attributes[\"value\"] = \"*\".repeat(node.value.length);\n break;\n }\n }\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 ;\n else if (isAncestorRemoved(m.target, this.mirror))\n ;\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 }\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))\n return;\n if (this.addedSet.has(n2) || this.movedSet.has(n2))\n 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 \"privacySetting\",\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 isParentRemoved(removes, n2, mirror2) {\n if (removes.length === 0)\n return false;\n return _isParentRemoved(removes, n2, mirror2);\n}\nfunction _isParentRemoved(removes, n2, mirror2) {\n let node = index.parentNode(n2);\n while (node) {\n const parentId = mirror2.getId(node);\n if (removes.some((r2) => r2.id === parentId)) {\n return true;\n }\n node = index.parentNode(node);\n }\n return false;\n}\nfunction isAncestorInSet(set, n2) {\n if (set.size === 0)\n 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) || // We ignore canvas elements for rage click detection because we cannot infer what inside the canvas is getting interacted with.\n isCanvasNode(target)) {\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 ;\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 const overwriteRecord = target.getAttribute(\"data-hl-record\");\n if (type === \"radio\" || type === \"checkbox\") {\n isChecked = target.checked;\n } else if (maskedInputType({\n maskInputOptions,\n type,\n tagName,\n overwriteRecord\n })) {\n text = maskInputValue({\n element: target,\n maskInputOptions,\n tagName,\n type,\n value: text,\n overwriteRecord,\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(rule) {\n const positions = [];\n function recurse(childRule, pos) {\n if (hasNestedCSSRule(\"CSSGroupingRule\") && childRule.parentRule instanceof CSSGroupingRule || hasNestedCSSRule(\"CSSMediaRule\") && childRule.parentRule instanceof CSSMediaRule || hasNestedCSSRule(\"CSSSupportsRule\") && childRule.parentRule instanceof CSSSupportsRule || hasNestedCSSRule(\"CSSConditionRule\") && childRule.parentRule instanceof CSSConditionRule) {\n const 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(rule, positions);\n}\nfunction getIdAndStyleId(sheet, mirror2, styleMirror) {\n let id, styleId;\n if (!sheet)\n return {};\n if (sheet.ownerNode)\n id = mirror2.getId(sheet.ownerNode);\n else\n styleId = styleMirror.getId(sheet);\n return {\n styleId,\n id\n };\n}\nfunction initStyleSheetObserver({ styleSheetRuleCb, mirror: mirror2, stylesheetManager }, { win }) {\n if (!win.CSSStyleSheet || !win.CSSStyleSheet.prototype) {\n return () => {\n };\n }\n const insertRule = win.CSSStyleSheet.prototype.insertRule;\n win.CSSStyleSheet.prototype.insertRule = new Proxy(insertRule, {\n apply: callbackWrapper(\n (target, thisArg, argumentsList) => {\n const [rule, index2] = argumentsList;\n const { id, styleId } = getIdAndStyleId(\n thisArg,\n mirror2,\n stylesheetManager.styleMirror\n );\n if (id && id !== -1 || styleId && styleId !== -1) {\n styleSheetRuleCb({\n id,\n styleId,\n adds: [{ rule, index: index2 }]\n });\n }\n return target.apply(thisArg, argumentsList);\n }\n )\n });\n win.CSSStyleSheet.prototype.addRule = function(selector, styleBlock, index2 = this.cssRules.length) {\n const rule = `${selector} { ${styleBlock} }`;\n return win.CSSStyleSheet.prototype.insertRule.apply(this, [rule, index2]);\n };\n const deleteRule = win.CSSStyleSheet.prototype.deleteRule;\n win.CSSStyleSheet.prototype.deleteRule = new Proxy(deleteRule, {\n apply: callbackWrapper(\n (target, thisArg, argumentsList) => {\n const [index2] = argumentsList;\n const { id, styleId } = getIdAndStyleId(\n thisArg,\n mirror2,\n stylesheetManager.styleMirror\n );\n if (id && id !== -1 || styleId && styleId !== -1) {\n styleSheetRuleCb({\n id,\n styleId,\n removes: [{ index: index2 }]\n });\n }\n return target.apply(thisArg, argumentsList);\n }\n )\n });\n win.CSSStyleSheet.prototype.removeRule = function(index2) {\n return win.CSSStyleSheet.prototype.deleteRule.apply(this, [index2]);\n };\n let replace;\n if (win.CSSStyleSheet.prototype.replace) {\n replace = win.CSSStyleSheet.prototype.replace;\n win.CSSStyleSheet.prototype.replace = new Proxy(replace, {\n apply: callbackWrapper(\n (target, thisArg, argumentsList) => {\n const [text] = argumentsList;\n const { id, styleId } = getIdAndStyleId(\n thisArg,\n mirror2,\n stylesheetManager.styleMirror\n );\n if (id && id !== -1 || styleId && styleId !== -1) {\n styleSheetRuleCb({\n id,\n styleId,\n replace: text\n });\n }\n return target.apply(thisArg, argumentsList);\n }\n )\n });\n }\n let replaceSync;\n if (win.CSSStyleSheet.prototype.replaceSync) {\n replaceSync = win.CSSStyleSheet.prototype.replaceSync;\n win.CSSStyleSheet.prototype.replaceSync = new Proxy(replaceSync, {\n apply: callbackWrapper(\n (target, thisArg, argumentsList) => {\n const [text] = argumentsList;\n const { id, styleId } = getIdAndStyleId(\n thisArg,\n mirror2,\n stylesheetManager.styleMirror\n );\n if (id && id !== -1 || styleId && styleId !== -1) {\n styleSheetRuleCb({\n id,\n styleId,\n replaceSync: text\n });\n }\n return target.apply(thisArg, argumentsList);\n }\n )\n });\n }\n const supportedNestedCSSRuleTypes = {};\n if (canMonkeyPatchNestedCSSRule(\"CSSGroupingRule\")) {\n supportedNestedCSSRuleTypes.CSSGroupingRule = win.CSSGroupingRule;\n } else {\n if (canMonkeyPatchNestedCSSRule(\"CSSMediaRule\")) {\n supportedNestedCSSRuleTypes.CSSMediaRule = win.CSSMediaRule;\n }\n if (canMonkeyPatchNestedCSSRule(\"CSSConditionRule\")) {\n supportedNestedCSSRuleTypes.CSSConditionRule = win.CSSConditionRule;\n }\n if (canMonkeyPatchNestedCSSRule(\"CSSSupportsRule\")) {\n supportedNestedCSSRuleTypes.CSSSupportsRule = win.CSSSupportsRule;\n }\n }\n const unmodifiedFunctions = {};\n Object.entries(supportedNestedCSSRuleTypes).forEach(([typeKey, type]) => {\n unmodifiedFunctions[typeKey] = {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n insertRule: type.prototype.insertRule,\n // eslint-disable-next-line @typescript-eslint/unbound-method\n deleteRule: type.prototype.deleteRule\n };\n type.prototype.insertRule = new Proxy(\n unmodifiedFunctions[typeKey].insertRule,\n {\n apply: callbackWrapper(\n (target, thisArg, argumentsList) => {\n const [rule, index2] = argumentsList;\n const { id, styleId } = getIdAndStyleId(\n thisArg.parentStyleSheet,\n mirror2,\n stylesheetManager.styleMirror\n );\n if (id && id !== -1 || styleId && styleId !== -1) {\n styleSheetRuleCb({\n id,\n styleId,\n adds: [\n {\n rule,\n index: [\n ...getNestedCSSRulePositions(thisArg),\n index2 || 0\n // defaults to 0\n ]\n }\n ]\n });\n }\n return target.apply(thisArg, argumentsList);\n }\n )\n }\n );\n type.prototype.deleteRule = new Proxy(\n unmodifiedFunctions[typeKey].deleteRule,\n {\n apply: callbackWrapper(\n (target, thisArg, argumentsList) => {\n const [index2] = argumentsList;\n const { id, styleId } = getIdAndStyleId(\n thisArg.parentStyleSheet,\n mirror2,\n stylesheetManager.styleMirror\n );\n if (id && id !== -1 || styleId && styleId !== -1) {\n styleSheetRuleCb({\n id,\n styleId,\n removes: [\n { index: [...getNestedCSSRulePositions(thisArg), index2] }\n ]\n });\n }\n return target.apply(thisArg, argumentsList);\n }\n )\n }\n );\n });\n return callbackWrapper(() => {\n win.CSSStyleSheet.prototype.insertRule = insertRule;\n win.CSSStyleSheet.prototype.deleteRule = deleteRule;\n replace && (win.CSSStyleSheet.prototype.replace = replace);\n replaceSync && (win.CSSStyleSheet.prototype.replaceSync = replaceSync);\n Object.entries(supportedNestedCSSRuleTypes).forEach(([typeKey, type]) => {\n type.prototype.insertRule = unmodifiedFunctions[typeKey].insertRule;\n type.prototype.deleteRule = unmodifiedFunctions[typeKey].deleteRule;\n });\n });\n}\nfunction initAdoptedStyleSheetObserver({\n mirror: mirror2,\n stylesheetManager\n}, host2) {\n var _a2, _b, _c;\n let hostId = null;\n if (host2.nodeName === \"#document\")\n hostId = mirror2.getId(host2);\n else\n hostId = mirror2.getId(index.host(host2));\n const patchTarget = host2.nodeName === \"#document\" ? (_a2 = host2.defaultView) == null ? void 0 : _a2.Document : (_c = (_b = host2.ownerDocument) == null ? void 0 : _b.defaultView) == null ? void 0 : _c.ShadowRoot;\n const originalPropertyDescriptor = (patchTarget == null ? void 0 : patchTarget.prototype) ? Object.getOwnPropertyDescriptor(\n patchTarget == null ? void 0 : patchTarget.prototype,\n \"adoptedStyleSheets\"\n ) : void 0;\n if (hostId === null || hostId === -1 || !patchTarget || !originalPropertyDescriptor)\n return () => {\n };\n Object.defineProperty(host2, \"adoptedStyleSheets\", {\n configurable: originalPropertyDescriptor.configurable,\n enumerable: originalPropertyDescriptor.enumerable,\n get() {\n var _a3;\n return (_a3 = originalPropertyDescriptor.get) == null ? void 0 : _a3.call(this);\n },\n set(sheets) {\n var _a3;\n const result = (_a3 = originalPropertyDescriptor.set) == null ? void 0 : _a3.call(this, sheets);\n if (hostId !== null && hostId !== -1) {\n try {\n stylesheetManager.adoptStyleSheets(sheets, hostId);\n } catch (e2) {\n }\n }\n return result;\n }\n });\n return callbackWrapper(() => {\n Object.defineProperty(host2, \"adoptedStyleSheets\", {\n configurable: originalPropertyDescriptor.configurable,\n enumerable: originalPropertyDescriptor.enumerable,\n // eslint-disable-next-line @typescript-eslint/unbound-method\n get: originalPropertyDescriptor.get,\n // eslint-disable-next-line @typescript-eslint/unbound-method\n set: originalPropertyDescriptor.set\n });\n });\n}\nfunction initStyleDeclarationObserver({\n styleDeclarationCb,\n mirror: mirror2,\n ignoreCSSAttributes,\n stylesheetManager\n}, { win }) {\n const setProperty = win.CSSStyleDeclaration.prototype.setProperty;\n win.CSSStyleDeclaration.prototype.setProperty = new Proxy(setProperty, {\n apply: callbackWrapper(\n (target, thisArg, argumentsList) => {\n var _a2;\n const [property, value, priority] = argumentsList;\n if (ignoreCSSAttributes.has(property)) {\n return setProperty.apply(thisArg, [property, value, priority]);\n }\n const { id, styleId } = getIdAndStyleId(\n (_a2 = thisArg.parentRule) == null ? void 0 : _a2.parentStyleSheet,\n mirror2,\n stylesheetManager.styleMirror\n );\n if (id && id !== -1 || styleId && styleId !== -1) {\n styleDeclarationCb({\n id,\n styleId,\n set: {\n property,\n value,\n priority\n },\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n index: getNestedCSSRulePositions(thisArg.parentRule)\n });\n }\n return target.apply(thisArg, argumentsList);\n }\n )\n });\n const removeProperty = win.CSSStyleDeclaration.prototype.removeProperty;\n win.CSSStyleDeclaration.prototype.removeProperty = new Proxy(removeProperty, {\n apply: callbackWrapper(\n (target, thisArg, argumentsList) => {\n var _a2;\n const [property] = argumentsList;\n if (ignoreCSSAttributes.has(property)) {\n return removeProperty.apply(thisArg, [property]);\n }\n const { id, styleId } = getIdAndStyleId(\n (_a2 = thisArg.parentRule) == null ? void 0 : _a2.parentStyleSheet,\n mirror2,\n stylesheetManager.styleMirror\n );\n if (id && id !== -1 || styleId && styleId !== -1) {\n styleDeclarationCb({\n id,\n styleId,\n remove: {\n property\n },\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n index: getNestedCSSRulePositions(thisArg.parentRule)\n });\n }\n return target.apply(thisArg, argumentsList);\n }\n )\n });\n return callbackWrapper(() => {\n win.CSSStyleDeclaration.prototype.setProperty = setProperty;\n win.CSSStyleDeclaration.prototype.removeProperty = removeProperty;\n });\n}\nfunction initMediaInteractionObserver({\n mediaInteractionCb,\n blockClass,\n blockSelector,\n mirror: mirror2,\n sampling,\n doc\n}) {\n const handler = callbackWrapper(\n (type) => throttle(\n callbackWrapper((event) => {\n const target = getEventTarget(event);\n if (!target || isBlocked(target, blockClass, blockSelector, true)) {\n return;\n }\n const { currentTime, volume, muted, playbackRate, loop } = target;\n mediaInteractionCb({\n type,\n id: mirror2.getId(target),\n currentTime,\n volume,\n muted,\n playbackRate,\n loop\n });\n }),\n sampling.media || 500\n )\n );\n const handlers = [\n on(\"play\", handler(MediaInteractions.Play), doc),\n on(\"pause\", handler(MediaInteractions.Pause), doc),\n on(\"seeked\", handler(MediaInteractions.Seeked), doc),\n on(\"volumechange\", handler(MediaInteractions.VolumeChange), doc),\n on(\"ratechange\", handler(MediaInteractions.RateChange), doc)\n ];\n return callbackWrapper(() => {\n handlers.forEach((h) => h());\n });\n}\nfunction initFontObserver({ fontCb, doc }) {\n const win = doc.defaultView;\n if (!win) {\n return () => {\n };\n }\n const handlers = [];\n const fontMap = /* @__PURE__ */ new WeakMap();\n const originalFontFace = win.FontFace;\n win.FontFace = function 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))\n 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)\n 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)\n 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 plugin of o2.plugins) {\n pluginHandlers.push(\n plugin.observer(plugin.callback, currentWindow, plugin.options)\n );\n }\n return callbackWrapper(() => {\n mutationBuffers.forEach((b) => b.reset());\n mutationObserver == null ? void 0 : mutationObserver.disconnect();\n mousemoveHandler();\n mouseInteractionHandler();\n scrollHandler();\n viewportResizeHandler();\n inputHandler();\n mediaInteractionHandler();\n styleSheetObserver();\n adoptedStyleSheetObserver();\n styleDeclarationObserver();\n fontObserver();\n selectionObserver();\n customElementObserver();\n pluginHandlers.forEach((h) => h());\n });\n}\nfunction hasNestedCSSRule(prop) {\n return typeof window[prop] !== \"undefined\";\n}\nfunction canMonkeyPatchNestedCSSRule(prop) {\n return Boolean(\n typeof window[prop] !== \"undefined\" && // Note: Generally, this check _shouldn't_ be necessary\n // However, in some scenarios (e.g. jsdom) this can sometimes fail, so we check for it here\n window[prop].prototype && \"insertRule\" in window[prop].prototype && \"deleteRule\" in window[prop].prototype\n );\n}\nclass CrossOriginIframeMirror {\n constructor(generateIdFn) {\n __publicField(this, \"iframeIdToRemoteIdMap\", /* @__PURE__ */ new WeakMap());\n __publicField(this, \"iframeRemoteIdToIdMap\", /* @__PURE__ */ new WeakMap());\n this.generateIdFn = generateIdFn;\n }\n getId(iframe, remoteId, idToRemoteMap, remoteToIdMap) {\n const idToRemoteIdMap = idToRemoteMap || this.getIdToRemoteIdMap(iframe);\n const remoteIdToIdMap = remoteToIdMap || this.getRemoteIdToIdMap(iframe);\n let id = idToRemoteIdMap.get(remoteId);\n if (!id) {\n id = this.generateIdFn();\n idToRemoteIdMap.set(remoteId, id);\n remoteIdToIdMap.set(id, remoteId);\n }\n return id;\n }\n getIds(iframe, remoteId) {\n const idToRemoteIdMap = this.getIdToRemoteIdMap(iframe);\n const remoteIdToIdMap = this.getRemoteIdToIdMap(iframe);\n return remoteId.map(\n (id) => this.getId(iframe, id, idToRemoteIdMap, remoteIdToIdMap)\n );\n }\n getRemoteId(iframe, id, map) {\n const remoteIdToIdMap = map || this.getRemoteIdToIdMap(iframe);\n if (typeof id !== \"number\")\n return id;\n const remoteId = remoteIdToIdMap.get(id);\n if (!remoteId)\n 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)\n return;\n const iframeEl = this.crossOriginIframeMap.get(iframeSourceWindow);\n if (!iframeEl)\n 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\")\n continue;\n if (Array.isArray(obj[key])) {\n obj[key] = iframeMirror.getIds(\n iframeEl,\n obj[key]\n );\n } else {\n obj[key] = iframeMirror.getId(iframeEl, obj[key]);\n }\n }\n return obj;\n }\n replaceIds(obj, iframeEl, keys) {\n return this.replace(this.crossOriginIframeMirror, obj, iframeEl, keys);\n }\n replaceStyleIds(obj, iframeEl, keys) {\n return this.replace(this.crossOriginIframeStyleMirror, obj, iframeEl, keys);\n }\n replaceIdOnNode(node, iframeEl) {\n this.replaceIds(node, iframeEl, [\"id\", \"rootId\"]);\n if (\"childNodes\" in node) {\n node.childNodes.forEach((child) => {\n this.replaceIdOnNode(child, iframeEl);\n });\n }\n }\n patchRootIdOnNode(node, rootId) {\n if (node.type !== NodeType$2.Document && !node.rootId)\n node.rootId = rootId;\n if (\"childNodes\" in node) {\n node.childNodes.forEach((child) => {\n this.patchRootIdOnNode(child, rootId);\n });\n }\n }\n}\nclass ShadowDomManager {\n constructor(options) {\n __publicField(this, \"shadowDoms\", /* @__PURE__ */ new WeakSet());\n __publicField(this, \"mutationCb\");\n __publicField(this, \"scrollCb\");\n __publicField(this, \"bypassOptions\");\n __publicField(this, \"mirror\");\n __publicField(this, \"restoreHandlers\", []);\n this.mutationCb = options.mutationCb;\n this.scrollCb = options.scrollCb;\n this.bypassOptions = options.bypassOptions;\n this.mirror = options.mirror;\n this.init();\n }\n init() {\n this.reset();\n this.patchAttachShadow(Element, document);\n }\n addShadowRoot(shadowRoot2, doc) {\n if (!isNativeShadowDom(shadowRoot2))\n return;\n if (this.shadowDoms.has(shadowRoot2))\n 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)\n 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 list = variableListFor$1(ctx, name);\n let index2 = list.indexOf(value);\n if (index2 === -1) {\n index2 = list.length;\n list.push(value);\n }\n return index2;\n};\nfunction serializeArg(value, win, ctx) {\n if (value instanceof Array) {\n return value.map((arg) => serializeArg(arg, win, ctx));\n } else if (value === null) {\n return value;\n } else if (value instanceof Float32Array || value instanceof Float64Array || value instanceof Int32Array || value instanceof Uint32Array || value instanceof Uint8Array || value instanceof Uint16Array || value instanceof Int16Array || value instanceof Int8Array || value instanceof Uint8ClampedArray) {\n const name = value.constructor.name;\n return {\n rr_type: name,\n args: [Object.values(value)]\n };\n } else if (\n // SharedArrayBuffer disabled on most browsers due to spectre.\n // More info: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer/SharedArrayBuffer\n // value instanceof SharedArrayBuffer ||\n value instanceof ArrayBuffer\n ) {\n const name = value.constructor.name;\n const base64 = encode(value);\n return {\n rr_type: name,\n base64\n };\n } else if (value instanceof DataView) {\n const name = value.constructor.name;\n return {\n rr_type: name,\n args: [\n serializeArg(value.buffer, win, ctx),\n value.byteOffset,\n value.byteLength\n ]\n };\n } else if (value instanceof HTMLImageElement) {\n const name = value.constructor.name;\n const { src } = value;\n return {\n rr_type: name,\n src\n };\n } else if (value instanceof HTMLCanvasElement) {\n const name = \"HTMLImageElement\";\n const src = value.toDataURL();\n return {\n rr_type: name,\n src\n };\n } else if (value instanceof ImageData) {\n const name = value.constructor.name;\n return {\n rr_type: name,\n args: [serializeArg(value.data, win, ctx), value.width, value.height]\n };\n } else if (isInstanceOfWebGLObject(value, win) || typeof value === \"object\") {\n const name = value.constructor.name;\n const index2 = saveWebGLVar(value, win, ctx);\n return {\n rr_type: name,\n index: index2\n };\n }\n return value;\n}\nconst serializeArgs = (args, win, ctx) => {\n return args.map((arg) => serializeArg(arg, win, ctx));\n};\nconst isInstanceOfWebGLObject = (value, win) => {\n const webGLConstructorNames = [\n \"WebGLActiveInfo\",\n \"WebGLBuffer\",\n \"WebGLFramebuffer\",\n \"WebGLProgram\",\n \"WebGLRenderbuffer\",\n \"WebGLShader\",\n \"WebGLShaderPrecisionFormat\",\n \"WebGLTexture\",\n \"WebGLUniformLocation\",\n \"WebGLVertexArrayObject\",\n // In old Chrome versions, value won't be an instanceof WebGLVertexArrayObject.\n \"WebGLVertexArrayObjectOES\"\n ];\n const supportedWebGLConstructorNames = webGLConstructorNames.filter(\n (name) => typeof win[name] === \"function\"\n );\n return Boolean(\n supportedWebGLConstructorNames.find(\n (name) => value instanceof win[name]\n )\n );\n};\nfunction initCanvas2DMutationObserver(cb, win, blockClass, blockSelector) {\n const handlers = [];\n const props2D = Object.getOwnPropertyNames(\n win.CanvasRenderingContext2D.prototype\n );\n for (const prop of props2D) {\n try {\n if (typeof win.CanvasRenderingContext2D.prototype[prop] !== \"function\") {\n continue;\n }\n const restoreHandler = patch(\n win.CanvasRenderingContext2D.prototype,\n prop,\n function(original) {\n return function(...args) {\n if (!isBlocked(this.canvas, blockClass, blockSelector, true)) {\n setTimeout(() => {\n const recordArgs = serializeArgs(args, win, this);\n cb(this.canvas, {\n type: CanvasContext[\"2D\"],\n property: prop,\n args: recordArgs\n });\n }, 0);\n }\n return original.apply(this, args);\n };\n }\n );\n handlers.push(restoreHandler);\n } catch {\n const hookHandler = hookSetter(\n win.CanvasRenderingContext2D.prototype,\n prop,\n {\n set(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 restoreGetContext = 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))\n 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(restoreGetContext);\n } catch {\n console.error(\"failed to patch HTMLCanvasElement.prototype.getContext\");\n }\n return () => {\n handlers.forEach((h) => h());\n };\n}\nfunction patchGLPrototype(prototype, type, cb, blockClass, blockSelector, win) {\n const handlers = [];\n const props = Object.getOwnPropertyNames(prototype);\n for (const prop of props) {\n if (\n //prop.startsWith('get') || // e.g. getProgramParameter, but too risky\n [\n \"isContextLost\",\n \"canvas\",\n \"drawingBufferWidth\",\n \"drawingBufferHeight\"\n ].includes(prop)\n ) {\n continue;\n }\n try {\n if (typeof prototype[prop] !== \"function\") {\n continue;\n }\n const restoreHandler = patch(\n prototype,\n prop,\n function(original) {\n return function(...args) {\n const result = original.apply(this, args);\n saveWebGLVar(result, win, this);\n if (\"tagName\" in this.canvas && !isBlocked(\n this.canvas,\n blockClass,\n blockSelector,\n true\n )) {\n const recordArgs = serializeArgs(args, win, this);\n const mutation = {\n type,\n property: prop,\n args: recordArgs\n };\n cb(this.canvas, mutation);\n }\n return result;\n };\n }\n );\n handlers.push(restoreHandler);\n } catch {\n const hookHandler = hookSetter(prototype, prop, {\n set(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 = \"KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4g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c3NhZ2UobXNnKTsKICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgfSBlbHNlIHsKICAgICAgZGVidWcoIltoaWdobGlnaHQtd29ya2VyXSBubyBvZmZzY3JlZW5jYW52YXMgc3VwcG9ydCIsIHsKICAgICAgICBpZDogZS5kYXRhLmlkCiAgICAgIH0pOwogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCwgc3RhdHVzOiAidW5zdXBwb3J0ZWQiIH0pOwogICAgfQogIH07Cn0pKCk7Ci8vIyBzb3VyY2VNYXBwaW5nVVJMPWltYWdlLWJpdG1hcC1kYXRhLXVybC13b3JrZXItS0tvQ2VrWjEuanMubWFwCg==\";\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)\n 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, \"logger\");\n __publicField(this, \"worker\");\n __publicField(this, \"snapshotInProgressMap\", /* @__PURE__ */ new Map());\n __publicField(this, \"lastSnapshotTime\", /* @__PURE__ */ new Map());\n __publicField(this, \"options\");\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,\n win,\n blockClass,\n blockSelector,\n recordCanvas,\n recordVideos,\n initialSnapshotDelay,\n dataURLOptions\n } = options;\n this.mutationCb = options.mutationCb;\n this.mirror = options.mirror;\n this.logger = options.logger;\n this.worker = new WorkerWrapper();\n this.worker.onmessage = (e2) => {\n const { id } = e2.data;\n this.snapshotInProgressMap.set(id, false);\n if (!(\"base64\" in e2.data)) {\n this.debug(null, \"canvas worker received empty message\", {\n data: e2.data,\n status: e2.data.status\n });\n return;\n }\n const { base64, type, dx, dy, dw, dh } = e2.data;\n const mutation = {\n id,\n type: CanvasContext[\"2D\"],\n commands: [\n {\n property: \"clearRect\",\n // wipe canvas\n args: [dx, dy, dw, dh]\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 dx,\n dy,\n dw,\n dh\n ]\n }\n ]\n };\n this.debug(null, \"canvas worker recording mutation\", mutation);\n this.mutationCb(mutation);\n };\n this.options = options;\n if (recordCanvas && sampling === \"all\") {\n this.debug(null, \"initializing canvas mutation observer\", { sampling });\n this.initCanvasMutationObserver(win, blockClass, blockSelector);\n } else if (recordCanvas && typeof sampling === \"number\") {\n this.debug(null, \"initializing canvas fps observer\", { sampling });\n this.initCanvasFPSObserver(\n recordVideos,\n sampling,\n win,\n blockClass,\n blockSelector,\n {\n initialSnapshotDelay,\n dataURLOptions\n },\n options.resizeFactor,\n options.maxSnapshotDimension\n );\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 debug(element, ...args) {\n if (!this.logger)\n return;\n const id = this.mirror.getId(element);\n let prefix = \"[highlight-canvas-manager]\";\n if (element) {\n prefix = `[highlight-canvas] [id:${id}]`;\n if (element.tagName.toLowerCase() === \"canvas\") {\n prefix += ` [ctx:${element.__context}]`;\n }\n }\n this.logger.debug(prefix, element, ...args);\n }\n async snapshot(canvas) {\n var _a2;\n const id = this.mirror.getId(canvas);\n if (this.snapshotInProgressMap.get(id)) {\n this.debug(canvas, \"snapshotting already in progress for\", id);\n return;\n }\n const timeBetweenSnapshots = 1e3 / (typeof this.options.samplingManual === \"number\" ? this.options.samplingManual : 1);\n const lastSnapshotTime = this.lastSnapshotTime.get(id);\n if (lastSnapshotTime && (/* @__PURE__ */ new Date()).getTime() - lastSnapshotTime < timeBetweenSnapshots) {\n return;\n }\n this.debug(canvas, \"starting snapshotting\");\n if (canvas.width === 0 || canvas.height === 0) {\n this.debug(canvas, \"not yet ready\", {\n width: canvas.width,\n height: canvas.height\n });\n return;\n }\n this.lastSnapshotTime.set(id, (/* @__PURE__ */ new Date()).getTime());\n this.snapshotInProgressMap.set(id, true);\n try {\n if (this.options.clearWebGLBuffer !== false && [\"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 this.debug(canvas, \"cleared webgl canvas to load it into memory\", {\n attributes: context == null ? void 0 : context.getContextAttributes()\n });\n }\n }\n if (canvas.width === 0 || canvas.height === 0) {\n this.debug(canvas, \"not yet ready\", {\n width: canvas.width,\n height: canvas.height\n });\n return;\n }\n let scale = this.options.resizeFactor || 1;\n if (this.options.maxSnapshotDimension) {\n const maxDim = Math.max(canvas.width, canvas.height);\n scale = Math.min(scale, this.options.maxSnapshotDimension / maxDim);\n }\n const width = canvas.width * scale;\n const height = canvas.height * scale;\n const bitmap = await createImageBitmap(canvas, {\n resizeWidth: width,\n resizeHeight: height\n });\n this.debug(canvas, \"created image bitmap\", {\n width: bitmap.width,\n height: bitmap.height\n });\n this.worker.postMessage(\n {\n id,\n bitmap,\n width,\n height,\n dx: 0,\n dy: 0,\n dw: canvas.width,\n dh: canvas.height,\n dataURLOptions: this.options.dataURLOptions,\n logDebug: !!this.logger\n },\n [bitmap]\n );\n this.debug(canvas, \"sent message\");\n } catch (e2) {\n this.debug(canvas, \"failed to snapshot\", e2);\n } finally {\n this.snapshotInProgressMap.set(id, false);\n }\n }\n initCanvasFPSObserver(recordVideos, fps, win, blockClass, blockSelector, options, resizeFactor, maxSnapshotDimension) {\n const canvasContextReset = initCanvasContextObserver(\n win,\n blockClass,\n blockSelector,\n true\n );\n const timeBetweenSnapshots = 1e3 / fps;\n let lastSnapshotTime = 0;\n let rafId;\n const elementFoundTime = /* @__PURE__ */ new Map();\n const getCanvas = (timestamp) => {\n const matchedCanvas = [];\n win.document.querySelectorAll(\"canvas\").forEach((canvas) => {\n if (!isBlocked(canvas, blockClass, blockSelector, true)) {\n this.debug(canvas, \"discovered canvas\");\n matchedCanvas.push(canvas);\n const id = this.mirror.getId(canvas);\n if (!elementFoundTime.has(id)) {\n elementFoundTime.set(id, timestamp);\n }\n }\n });\n return matchedCanvas;\n };\n const getVideos = (timestamp) => {\n const matchedVideos = [];\n if (recordVideos) {\n win.document.querySelectorAll(\"video\").forEach((video) => {\n if (video.src !== \"\" && video.src.indexOf(\"blob:\") === -1)\n return;\n if (!isBlocked(video, blockClass, blockSelector, true)) {\n matchedVideos.push(video);\n const id = this.mirror.getId(video);\n if (!elementFoundTime.has(id)) {\n elementFoundTime.set(id, timestamp);\n }\n }\n });\n }\n return matchedVideos;\n };\n const takeSnapshots = async (timestamp) => {\n if (lastSnapshotTime && timestamp - lastSnapshotTime < timeBetweenSnapshots) {\n rafId = requestAnimationFrame(takeSnapshots);\n return;\n }\n lastSnapshotTime = timestamp;\n const filterElementStartTime = (canvas) => {\n const id = this.mirror.getId(canvas);\n const foundTime = elementFoundTime.get(id);\n const hadLoadingTime = !options.initialSnapshotDelay || timestamp - foundTime > options.initialSnapshotDelay;\n this.debug(canvas, {\n delay: options.initialSnapshotDelay,\n delta: timestamp - foundTime,\n hadLoadingTime\n });\n return hadLoadingTime;\n };\n const promises = [];\n promises.push(\n ...getCanvas(timestamp).filter(filterElementStartTime).map((canvas) => this.snapshot(canvas))\n );\n promises.push(\n ...getVideos(timestamp).filter(filterElementStartTime).map(async (video) => {\n this.debug(video, \"starting video snapshotting\");\n const id = this.mirror.getId(video);\n if (this.snapshotInProgressMap.get(id)) {\n this.debug(\n video,\n \"video snapshotting already in progress for\",\n id\n );\n return;\n }\n this.snapshotInProgressMap.set(id, true);\n try {\n const { width: boxWidth, height: boxHeight } = video.getBoundingClientRect();\n const { actualWidth, actualHeight } = {\n actualWidth: video.videoWidth,\n actualHeight: video.videoHeight\n };\n const maxDim = Math.max(actualWidth, actualHeight);\n if (video.width === 0 || video.height === 0 || actualWidth === 0 || actualHeight === 0 || boxWidth === 0 || boxHeight === 0) {\n this.debug(video, \"not yet ready\", {\n width: video.width,\n height: video.height\n });\n return;\n }\n let scale = resizeFactor || 1;\n if (maxSnapshotDimension) {\n scale = Math.min(scale, maxSnapshotDimension / maxDim);\n }\n const width = actualWidth * scale;\n const height = actualHeight * scale;\n const bitmap = await createImageBitmap(video, {\n resizeWidth: width,\n resizeHeight: height\n });\n const outputScale = Math.max(boxWidth, boxHeight) / maxDim;\n const outputWidth = actualWidth * outputScale;\n const outputHeight = actualHeight * outputScale;\n const offsetX = (boxWidth - outputWidth) / 2;\n const offsetY = (boxHeight - outputHeight) / 2;\n this.debug(video, \"created image bitmap\", {\n actualWidth,\n actualHeight,\n boxWidth,\n boxHeight,\n outputWidth,\n outputHeight,\n resizeWidth: width,\n resizeHeight: height,\n scale,\n outputScale,\n offsetX,\n offsetY\n });\n this.worker.postMessage(\n {\n id,\n bitmap,\n width,\n height,\n dx: offsetX,\n dy: offsetY,\n dw: outputWidth,\n dh: outputHeight,\n dataURLOptions: options.dataURLOptions,\n logDebug: !!this.logger\n },\n [bitmap]\n );\n this.debug(video, \"send message\");\n } catch (e2) {\n this.debug(video, \"failed to snapshot\", e2);\n } finally {\n this.snapshotInProgressMap.set(id, false);\n }\n })\n );\n await Promise.all(promises).catch(console.error);\n rafId = requestAnimationFrame(takeSnapshots);\n };\n rafId = requestAnimationFrame(takeSnapshots);\n this.resetObservers = () => {\n canvasContextReset();\n if (rafId) {\n cancelAnimationFrame(rafId);\n }\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)\n 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))\n return;\n this.trackedLinkElements.add(linkEl);\n this.trackStylesheetInLinkElement(linkEl);\n }\n adoptStyleSheets(sheets, hostId) {\n if (sheets.length === 0)\n 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\n styleId = this.styleMirror.getId(sheet);\n adoptedStyleSheetData.styleIds.push(styleId);\n }\n if (styles.length > 0)\n adoptedStyleSheetData.styles = styles;\n this.adoptedStyleSheetCb(adoptedStyleSheetData);\n }\n reset() {\n this.styleMirror.reset();\n this.trackedLinkElements = /* @__PURE__ */ new WeakSet();\n }\n // TODO: take snapshot on stylesheet reload by applying event listener\n trackStylesheetInLinkElement(_linkEl) {\n }\n}\nclass ProcessedNodeManager {\n constructor() {\n __publicField(this, \"nodeMap\", /* @__PURE__ */ new WeakMap());\n __publicField(this, \"active\", false);\n }\n inOtherBuffer(node, thisBuffer) {\n const buffers = this.nodeMap.get(node);\n return buffers && Array.from(buffers).some((buffer) => buffer !== thisBuffer);\n }\n add(node, buffer) {\n if (!this.active) {\n this.active = true;\n requestAnimationFrame(() => {\n this.nodeMap = /* @__PURE__ */ new WeakMap();\n this.active = false;\n });\n }\n this.nodeMap.set(node, (this.nodeMap.get(node) || /* @__PURE__ */ new Set()).add(buffer));\n }\n destroy() {\n }\n}\nlet wrappedEmit;\nlet takeFullSnapshot$1;\nlet canvasManager;\nlet recording = false;\ntry {\n if (Array.from([1], (x) => x * 2)[0] !== 2) {\n const cleanFrame = document.createElement(\"iframe\");\n document.body.appendChild(cleanFrame);\n Array.from = ((_a = cleanFrame.contentWindow) == null ? void 0 : _a.Array.from) || Array.from;\n document.body.removeChild(cleanFrame);\n }\n} catch (err) {\n console.debug(\"Unable to override Array.from\", err);\n}\nconst mirror = createMirror$2();\nfunction record(options = {}) {\n var _a2, _b, _c, _d, _e, _f, _g, _h;\n const {\n emit,\n checkoutEveryNms,\n checkoutEveryNth,\n blockClass = \"highlight-block\",\n blockSelector = null,\n ignoreClass = \"highlight-ignore\",\n ignoreSelector = null,\n maskTextClass = \"highlight-mask\",\n maskTextSelector = null,\n inlineStylesheet = true,\n maskAllInputs,\n maskInputOptions: _maskInputOptions,\n slimDOMOptions: _slimDOMOptions,\n maskInputFn,\n maskTextFn = obfuscateText,\n hooks,\n packFn,\n sampling = {},\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 privacySetting = \"default\",\n ignoreCSSAttributes = /* @__PURE__ */ new Set([]),\n errorHandler: errorHandler2,\n logger\n } = options;\n const dataURLOptions = {\n ...options.dataURLOptions,\n ...(_b = (_a2 = options.sampling) == null ? void 0 : _a2.canvas) == null ? void 0 : _b.dataURLOptions\n };\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 plugin of plugins || []) {\n if (plugin.eventProcessor) {\n e2 = plugin.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 _a3;\n const e2 = r2;\n e2.timestamp = nowTimestamp();\n if (((_a3 = mutationBuffers[0]) == null ? void 0 : _a3.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 plugin of plugins || []) {\n if (plugin.getMirror)\n plugin.getMirror({\n nodeMirror: mirror,\n crossOriginIframeMirror: iframeManager.crossOriginIframeMirror,\n crossOriginIframeStyleMirror: iframeManager.crossOriginIframeStyleMirror\n });\n }\n const processedNodeManager = new ProcessedNodeManager();\n canvasManager = new CanvasManager({\n recordCanvas,\n recordVideos: inlineImages,\n mutationCb: wrappedCanvasMutationEmit,\n win: window,\n blockClass,\n blockSelector,\n mirror,\n sampling: (_c = sampling == null ? void 0 : sampling.canvas) == null ? void 0 : _c.fps,\n samplingManual: (_d = sampling == null ? void 0 : sampling.canvas) == null ? void 0 : _d.fpsManual,\n clearWebGLBuffer: (_e = sampling == null ? void 0 : sampling.canvas) == null ? void 0 : _e.clearWebGLBuffer,\n initialSnapshotDelay: (_f = sampling == null ? void 0 : sampling.canvas) == null ? void 0 : _f.initialSnapshotDelay,\n dataURLOptions,\n resizeFactor: (_g = sampling == null ? void 0 : sampling.canvas) == null ? void 0 : _g.resizeFactor,\n maxSnapshotDimension: (_h = sampling == null ? void 0 : sampling.canvas) == null ? void 0 : _h.maxSnapshotDimension,\n logger\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 privacySetting,\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 node = snapshot(document, {\n mirror,\n blockClass,\n blockSelector,\n maskTextClass,\n maskTextSelector,\n inlineStylesheet,\n maskAllInputs: maskInputOptions,\n maskTextFn,\n maskInputFn,\n slimDOM: slimDOMOptions,\n dataURLOptions,\n recordCanvas,\n inlineImages,\n privacySetting,\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 (!node) {\n return console.warn(\"Failed to snapshot the document\");\n }\n wrappedEmit(\n {\n type: EventType.FullSnapshot,\n data: {\n node,\n initialOffset: getWindowScroll(window)\n }\n },\n isCheckout\n );\n mutationBuffers.forEach((buf) => buf.unlock());\n if (document.adoptedStyleSheets && document.adoptedStyleSheets.length > 0)\n stylesheetManager.adoptStyleSheets(\n document.adoptedStyleSheets,\n mirror.getId(document)\n );\n };\n try {\n const handlers = [];\n const observe = (doc) => {\n var _a3;\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 privacySetting,\n plugins: ((_a3 = plugins == null ? void 0 : plugins.filter((p) => p.observer)) == null ? void 0 : _a3.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\")\n init();\n })\n );\n handlers.push(\n on(\n \"load\",\n () => {\n wrappedEmit({\n type: EventType.Load,\n data: {}\n });\n if (recordAfter === \"load\")\n 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 return;\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.snapshotCanvas = async (element) => {\n if (!canvasManager) {\n throw new Error(\"canvas manager is not initialized\");\n }\n await canvasManager.snapshot(element);\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(x, y) {\n this.scrollLeft = x;\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, x, 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,\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 /* Begin Highlight Code */\n /**\n * Add all actions before the timer starts\n */\n addActions(actions) {\n this.actions = this.actions.concat(actions);\n }\n replaceActions(actions) {\n this.actions.length = 0;\n this.actions.splice(0, 0, ...actions);\n }\n /* End Highlight Code */\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)\n return t2;\n var r2, o2, i2 = e2.call(t2), a2 = [];\n try {\n for (; (void 0 === n2 || n2-- > 0) && !(r2 = i2.next()).done; )\n 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)\n 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), x = n2.states[p];\n if (x.on) {\n var m = r(x.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)\n return e3.call(t2);\n if (t2 && \"number\" == typeof t2.length)\n 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)\n 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 === j;\n if ((void 0 === N ? function() {\n return true;\n } : N)(g, d)) {\n var _ = n2.states[null != j ? j : p], k = t(f((O ? r(R) : [].concat(x.exit, R, _.entry).filter(function(t2) {\n return t2;\n })).map(function(t2) {\n return i(t2, y._options.actions);\n }), g, d), 3), T = k[0], q = k[1], z = k[2], A = null != j ? j : p;\n return { value: A, context: q, actions: T, changed: j !== p || T.length > 0 || z, matches: a(A) };\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)\n 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 REPLACE_EVENTS: {\n target: \"playing\",\n actions: [\"replaceEvents\"]\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 REPLACE_EVENTS: {\n target: \"paused\",\n actions: [\"replaceEvents\"]\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 /* Highlight Code Start */\n replaceEvents: o((ctx, machineEvent) => {\n const { events: curEvents, timer, baselineTime } = ctx;\n if (machineEvent.type === \"REPLACE_EVENTS\") {\n const { events: newEvents } = machineEvent.payload;\n curEvents.length = 0;\n const actions = [];\n for (const event of newEvents) {\n addDelay(event, baselineTime);\n curEvents.push(event);\n if (event.timestamp >= timer.timeOffset + baselineTime) {\n const castFn = getCastFn(event, false);\n actions.push({\n doAction: () => {\n castFn();\n },\n delay: event.delay\n });\n }\n }\n if (timer.isActive()) {\n timer.replaceActions(actions);\n }\n }\n return { ...ctx, events: curEvents };\n }),\n /* Highlight Code End */\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 \"noscript { display: none !important; }\",\n `.${blockClass} { background: currentColor; border-radius: 5px; }`,\n `.${blockClass}:hover::after {content: 'Redacted'; color: white; background: black; text-align: center; width: 100%; display: block;}`\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)\n 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)\n 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 result = await Promise.all(\n arg.map(deserializeArg(imageMap, ctx, preload))\n );\n return result;\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, result) {\n if (!(result == null ? void 0 : result.constructor))\n return;\n const { name } = result.constructor;\n if (!WebGLVariableConstructorsNames.includes(name))\n return;\n const variables = variableListFor(ctx, name);\n if (!variables.includes(result))\n variables.push(result);\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)\n 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 result = original.apply(ctx, args);\n saveToWebGLVarMap(ctx, result);\n const debugMode = false;\n if (debugMode)\n ;\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))\n return;\n if (!(\"addEventListener\" in target))\n return;\n const onLoadedMetadata = () => {\n this.metadataCallbackMap.delete(target);\n const mediaState = this.mediaMap.get(target);\n if (!mediaState)\n 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)\n 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(node, timeOffset, mirror2) {\n if (![\"AUDIO\", \"VIDEO\"].includes(node.nodeName))\n return;\n const target = node;\n const serializedNode = mirror2.getMeta(target);\n if (!serializedNode || !(\"attributes\" in serializedNode))\n 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)\n 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(node) {\n return [\"AUDIO\", \"VIDEO\"].includes(node.nodeName);\n }\n reset() {\n this.mediaMap.clear();\n }\n}\nfunction applyDialogToTopLevel(node, attributeMutation) {\n if (node.nodeName !== \"DIALOG\" || node instanceof BaseRRNode)\n return;\n const dialog = node;\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)\n return;\n if (!dialog.isConnected) {\n console.warn(\"dialog is not attached to the dom\", dialog);\n return;\n }\n if (oldIsOpen)\n dialog.close();\n if (!newIsOpen)\n return;\n if (newIsModalState)\n dialog.showModal();\n else\n dialog.show();\n}\nfunction removeDialogFromTopLevel(node, attributeMutation) {\n if (node.nodeName !== \"DIALOG\" || node instanceof BaseRRNode)\n return;\n const dialog = node;\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 SKIP_TIME_MIN = 1 * 1e3;\nconst SKIP_DURATION_LIMIT = 60 * 60 * 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, \"activityIntervals\", []);\n __publicField(this, \"inactiveEndTimestamp\");\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 this.handleInactivity(event.timestamp);\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 plugin of this.config.plugins || []) {\n if (plugin.handler)\n plugin.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: \"highlight-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 inactiveThreshold: 0.02,\n inactiveSkipTime: SKIP_TIME_INTERVAL\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 plugin of this.config.plugins || []) {\n if (plugin.getMirror)\n plugin.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: (node, id) => {\n for (const plugin of this.config.plugins || []) {\n if (plugin.onBuild)\n plugin.onBuild(node, { 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 /* Start Highlight Code */\n getActivityIntervals() {\n if (this.activityIntervals.length == 0) {\n const allIntervals = [];\n const metadata = this.getMetaData();\n const userInteractionEvents = [\n { timestamp: metadata.startTime },\n ...this.service.state.context.events.filter(\n (ev) => this.isUserInteraction(ev)\n ),\n { timestamp: metadata.endTime }\n ];\n for (let i2 = 1; i2 < userInteractionEvents.length; i2++) {\n const currentInterval2 = userInteractionEvents[i2 - 1];\n const _event = userInteractionEvents[i2];\n if (_event.timestamp - currentInterval2.timestamp > this.config.inactivePeriodThreshold) {\n allIntervals.push({\n startTime: currentInterval2.timestamp,\n endTime: _event.timestamp,\n duration: _event.timestamp - currentInterval2.timestamp,\n active: false\n });\n } else {\n allIntervals.push({\n startTime: currentInterval2.timestamp,\n endTime: _event.timestamp,\n duration: _event.timestamp - currentInterval2.timestamp,\n active: true\n });\n }\n }\n const mergedIntervals = [];\n let currentInterval = allIntervals[0];\n for (let i2 = 1; i2 < allIntervals.length; i2++) {\n if (allIntervals[i2].active != allIntervals[i2 - 1].active) {\n mergedIntervals.push({\n startTime: currentInterval.startTime,\n endTime: allIntervals[i2 - 1].endTime,\n duration: allIntervals[i2 - 1].endTime - currentInterval.startTime,\n active: allIntervals[i2 - 1].active\n });\n currentInterval = allIntervals[i2];\n }\n }\n if (currentInterval && allIntervals.length > 0) {\n mergedIntervals.push({\n startTime: currentInterval.startTime,\n endTime: allIntervals[allIntervals.length - 1].endTime,\n duration: allIntervals[allIntervals.length - 1].endTime - currentInterval.startTime,\n active: allIntervals[allIntervals.length - 1].active\n });\n }\n currentInterval = mergedIntervals[0];\n for (let i2 = 1; i2 < mergedIntervals.length; i2++) {\n if (!mergedIntervals[i2].active && mergedIntervals[i2].duration > this.config.inactiveThreshold * metadata.totalTime || !mergedIntervals[i2 - 1].active && mergedIntervals[i2 - 1].duration > this.config.inactiveThreshold * metadata.totalTime) {\n this.activityIntervals.push({\n startTime: currentInterval.startTime,\n endTime: mergedIntervals[i2 - 1].endTime,\n duration: mergedIntervals[i2 - 1].endTime - currentInterval.startTime,\n active: mergedIntervals[i2 - 1].active\n });\n currentInterval = mergedIntervals[i2];\n }\n }\n if (currentInterval && mergedIntervals.length > 0) {\n this.activityIntervals.push({\n startTime: currentInterval.startTime,\n endTime: mergedIntervals[mergedIntervals.length - 1].endTime,\n duration: mergedIntervals[mergedIntervals.length - 1].endTime - currentInterval.startTime,\n active: mergedIntervals[mergedIntervals.length - 1].active\n });\n }\n }\n return this.activityIntervals;\n }\n /* End Highlight Code */\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 replaceEvents(events) {\n for (const event of events) {\n if (indicatesTouchDevice(event)) {\n this.mouse.classList.add(\"touch-device\");\n break;\n }\n }\n this.service.send({ type: \"REPLACE_EVENTS\", payload: { events } });\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 /* Start of Highlight Code */\n handleInactivity(timestamp, resetNext) {\n if (timestamp === this.inactiveEndTimestamp || resetNext) {\n this.inactiveEndTimestamp = null;\n this.backToNormal();\n }\n if (this.config.skipInactive && !this.inactiveEndTimestamp) {\n for (const interval of this.getActivityIntervals()) {\n if (timestamp >= interval.startTime && timestamp < interval.endTime && !interval.active) {\n this.inactiveEndTimestamp = interval.endTime;\n break;\n }\n }\n if (this.inactiveEndTimestamp) {\n const skipTime = this.inactiveEndTimestamp - timestamp;\n const payload = {\n speed: skipTime / SKIP_DURATION_LIMIT * this.config.inactiveSkipTime < SKIP_TIME_MIN ? skipTime / SKIP_TIME_MIN : Math.round(\n Math.max(skipTime, SKIP_DURATION_LIMIT) / this.config.inactiveSkipTime\n )\n };\n this.speedService.send({ type: \"FAST_FORWARD\", payload });\n this.emitter.emit(ReplayerEvents.SkipStart, payload);\n }\n }\n }\n /* End of Highlight Code */\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 plugin of this.config.plugins || []) {\n if (plugin.onBuild)\n plugin.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 (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$2.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)\n return;\n for (const plugin of this.config.plugins || []) {\n if (plugin.onBuild)\n plugin.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)\n 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\n 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)\n this.adoptedStyleSheets.push(d);\n else\n 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)\n 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$2.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\n 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 = (node, id) => {\n if (this.usingVirtualDom)\n return;\n applyDialogToTopLevel(node);\n for (const plugin of this.config.plugins || []) {\n if (plugin.onBuild)\n plugin.onBuild(node, { 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$2.Element && mutation.node.type === NodeType$2.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$2.Document) {\n const parentDoc = parent;\n if (mutation.node.type === NodeType$2.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 target.textContent = mutation.value;\n if (this.usingVirtualDom) {\n const parent = target.parentNode;\n if (((_a2 = parent == null ? void 0 : parent.rules) == null ? void 0 : _a2.length) > 0)\n 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$2.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)\n return;\n const result = new Range();\n result.setStart(startContainer, startOffset);\n result.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: result,\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)\n 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)\n 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, 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(rule, index2);\n } else {\n const index2 = nestedIndex === void 0 ? void 0 : Math.min(nestedIndex, styleSheet.cssRules.length);\n styleSheet == null ? void 0 : styleSheet.insertRule(rule, 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 rule = getNestedRule(\n styleSheet.rules,\n data.index\n );\n rule.style.setProperty(\n data.set.property,\n data.set.value,\n data.set.priority\n );\n }\n if (data.remove) {\n const rule = getNestedRule(\n styleSheet.rules,\n data.index\n );\n rule.style.removeProperty(data.remove.property);\n }\n }\n applyAdoptedStyleSheet(data) {\n var _a2;\n const targetHost = this.mirror.getNode(data.id);\n if (!targetHost)\n 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)\n 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, mutation } = previousInMap;\n parent.insertBefore(node, 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, node, mutation);\n }\n }\n if (nextInMap) {\n const { node, mutation } = nextInMap;\n parent.insertBefore(\n node,\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, node, mutation);\n }\n }\n }\n moveAndHover(x, 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 = x * 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","const defaultOptions = {\n key: \"_sid\"\n};\nconst PLUGIN_NAME = \"rrweb/sequential-id@1\";\nconst getRecordSequentialIdPlugin = (options) => {\n const _options = options ? Object.assign({}, defaultOptions, options) : defaultOptions;\n let id = 0;\n return {\n name: PLUGIN_NAME,\n eventProcessor(event) {\n Object.assign(event, {\n [_options.key]: ++id\n });\n return event;\n },\n options: _options\n };\n};\nexport {\n PLUGIN_NAME,\n getRecordSequentialIdPlugin\n};\n//# sourceMappingURL=rrweb-plugin-sequential-id-record.js.map\n","export const defaultJsonSerializer = JSON;\n//# sourceMappingURL=defaultJsonSerializer.js.map","export const uppercase = (str) => str.toUpperCase();\n/**\n * Convert Headers instance into regular object\n */\nexport const HeadersInstanceToPlainObject = (headers) => {\n const o = {};\n headers.forEach((v, k) => {\n o[k] = v;\n });\n return o;\n};\n//# sourceMappingURL=helpers.js.map","export const parseRequestArgs = (documentOrOptions, variables, requestHeaders) => {\n return documentOrOptions.document\n ? documentOrOptions\n : {\n document: documentOrOptions,\n variables: variables,\n requestHeaders: requestHeaders,\n signal: undefined,\n };\n};\nexport const parseRawRequestArgs = (queryOrOptions, variables, requestHeaders) => {\n return queryOrOptions.query\n ? queryOrOptions\n : {\n query: queryOrOptions,\n variables: variables,\n requestHeaders: requestHeaders,\n signal: undefined,\n };\n};\nexport const parseBatchRequestArgs = (documentsOrOptions, requestHeaders) => {\n return documentsOrOptions.documents\n ? documentsOrOptions\n : {\n documents: documentsOrOptions,\n requestHeaders: requestHeaders,\n signal: undefined,\n };\n};\nexport const parseRequestExtendedArgs = (urlOrOptions, document, ...variablesAndRequestHeaders) => {\n const [variables, requestHeaders] = variablesAndRequestHeaders;\n return urlOrOptions.document\n ? urlOrOptions\n : {\n url: urlOrOptions,\n document: document,\n variables,\n requestHeaders,\n signal: undefined,\n };\n};\nexport const parseRawRequestExtendedArgs = (urlOrOptions, query, ...variablesAndRequestHeaders) => {\n const [variables, requestHeaders] = variablesAndRequestHeaders;\n return urlOrOptions.query\n ? urlOrOptions\n : {\n url: urlOrOptions,\n query: query,\n variables,\n requestHeaders,\n signal: undefined,\n };\n};\n//# sourceMappingURL=parseArgs.js.map","import { parse, print } from 'graphql';\n/**\n * helpers\n */\nconst extractOperationName = (document) => {\n let operationName = undefined;\n const operationDefinitions = document.definitions.filter((definition) => definition.kind === `OperationDefinition`);\n if (operationDefinitions.length === 1) {\n operationName = operationDefinitions[0]?.name?.value;\n }\n return operationName;\n};\nexport const resolveRequestDocument = (document) => {\n if (typeof document === `string`) {\n let operationName = undefined;\n try {\n const parsedDocument = parse(document);\n operationName = extractOperationName(parsedDocument);\n }\n catch (err) {\n // Failed parsing the document, the operationName will be undefined\n }\n return { query: document, operationName };\n }\n const operationName = extractOperationName(document);\n return { query: print(document), operationName };\n};\n//# sourceMappingURL=resolveRequestDocument.js.map","export class ClientError extends Error {\n constructor(response, request) {\n const message = `${ClientError.extractMessage(response)}: ${JSON.stringify({\n response,\n request,\n })}`;\n super(message);\n Object.setPrototypeOf(this, ClientError.prototype);\n this.response = response;\n this.request = request;\n // this is needed as Safari doesn't support .captureStackTrace\n if (typeof Error.captureStackTrace === `function`) {\n Error.captureStackTrace(this, ClientError);\n }\n }\n static extractMessage(response) {\n return response.errors?.[0]?.message ?? `GraphQL Error (Code: ${response.status})`;\n }\n}\n//# sourceMappingURL=types.js.map","var global = typeof self !== 'undefined' ? self : this;\nvar __self__ = (function () {\nfunction F() {\nthis.fetch = false;\nthis.DOMException = global.DOMException\n}\nF.prototype = global;\nreturn new F();\n})();\n(function(self) {\n\nvar irrelevant = (function (exports) {\n\n var support = {\n searchParams: 'URLSearchParams' in self,\n iterable: 'Symbol' in self && 'iterator' in Symbol,\n blob:\n 'FileReader' in self &&\n 'Blob' in self &&\n (function() {\n try {\n new Blob();\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in self,\n arrayBuffer: 'ArrayBuffer' in self\n };\n\n function isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n }\n\n if (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ];\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n };\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name);\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~]/i.test(name)) {\n throw new TypeError('Invalid character in header field name')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value);\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {};\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value);\n }, this);\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1]);\n }, this);\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name]);\n }, this);\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name);\n value = normalizeValue(value);\n var oldValue = this.map[name];\n this.map[name] = oldValue ? oldValue + ', ' + value : value;\n };\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)];\n };\n\n Headers.prototype.get = function(name) {\n name = normalizeName(name);\n return this.has(name) ? this.map[name] : null\n };\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n };\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value);\n };\n\n Headers.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this);\n }\n }\n };\n\n Headers.prototype.keys = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push(name);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.values = function() {\n var items = [];\n this.forEach(function(value) {\n items.push(value);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.entries = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push([name, value]);\n });\n return iteratorFor(items)\n };\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries;\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true;\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result);\n };\n reader.onerror = function() {\n reject(reader.error);\n };\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsArrayBuffer(blob);\n return promise\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsText(blob);\n return promise\n }\n\n function readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf);\n var chars = new Array(view.length);\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i]);\n }\n return chars.join('')\n }\n\n function bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength);\n view.set(new Uint8Array(buf));\n return view.buffer\n }\n }\n\n function Body() {\n this.bodyUsed = false;\n\n this._initBody = function(body) {\n this._bodyInit = body;\n if (!body) {\n this._bodyText = '';\n } else if (typeof body === 'string') {\n this._bodyText = body;\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body;\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body;\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString();\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer);\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer]);\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body);\n } else {\n this._bodyText = body = Object.prototype.toString.call(body);\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8');\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type);\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');\n }\n }\n };\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n };\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n return consumed(this) || Promise.resolve(this._bodyArrayBuffer)\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n };\n }\n\n this.text = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n };\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n };\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n };\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase();\n return methods.indexOf(upcased) > -1 ? upcased : method\n }\n\n function Request(input, options) {\n options = options || {};\n var body = options.body;\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url;\n this.credentials = input.credentials;\n if (!options.headers) {\n this.headers = new Headers(input.headers);\n }\n this.method = input.method;\n this.mode = input.mode;\n this.signal = input.signal;\n if (!body && input._bodyInit != null) {\n body = input._bodyInit;\n input.bodyUsed = true;\n }\n } else {\n this.url = String(input);\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin';\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers);\n }\n this.method = normalizeMethod(options.method || this.method || 'GET');\n this.mode = options.mode || this.mode || null;\n this.signal = options.signal || this.signal;\n this.referrer = null;\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body);\n }\n\n Request.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n };\n\n function decode(body) {\n var form = new FormData();\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=');\n var name = split.shift().replace(/\\+/g, ' ');\n var value = split.join('=').replace(/\\+/g, ' ');\n form.append(decodeURIComponent(name), decodeURIComponent(value));\n }\n });\n return form\n }\n\n function parseHeaders(rawHeaders) {\n var headers = new Headers();\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ');\n preProcessedHeaders.split(/\\r?\\n/).forEach(function(line) {\n var parts = line.split(':');\n var key = parts.shift().trim();\n if (key) {\n var value = parts.join(':').trim();\n headers.append(key, value);\n }\n });\n return headers\n }\n\n Body.call(Request.prototype);\n\n function Response(bodyInit, options) {\n if (!options) {\n options = {};\n }\n\n this.type = 'default';\n this.status = options.status === undefined ? 200 : options.status;\n this.ok = this.status >= 200 && this.status < 300;\n this.statusText = 'statusText' in options ? options.statusText : 'OK';\n this.headers = new Headers(options.headers);\n this.url = options.url || '';\n this._initBody(bodyInit);\n }\n\n Body.call(Response.prototype);\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n };\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''});\n response.type = 'error';\n return response\n };\n\n var redirectStatuses = [301, 302, 303, 307, 308];\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n };\n\n exports.DOMException = self.DOMException;\n try {\n new exports.DOMException();\n } catch (err) {\n exports.DOMException = function(message, name) {\n this.message = message;\n this.name = name;\n var error = Error(message);\n this.stack = error.stack;\n };\n exports.DOMException.prototype = Object.create(Error.prototype);\n exports.DOMException.prototype.constructor = exports.DOMException;\n }\n\n function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init);\n\n if (request.signal && request.signal.aborted) {\n return reject(new exports.DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest();\n\n function abortXhr() {\n xhr.abort();\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n };\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n resolve(new Response(body, options));\n };\n\n xhr.onerror = function() {\n reject(new TypeError('Network request failed'));\n };\n\n xhr.ontimeout = function() {\n reject(new TypeError('Network request failed'));\n };\n\n xhr.onabort = function() {\n reject(new exports.DOMException('Aborted', 'AbortError'));\n };\n\n xhr.open(request.method, request.url, true);\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true;\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false;\n }\n\n if ('responseType' in xhr && support.blob) {\n xhr.responseType = 'blob';\n }\n\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value);\n });\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr);\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr);\n }\n };\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);\n })\n }\n\n fetch.polyfill = true;\n\n if (!self.fetch) {\n self.fetch = fetch;\n self.Headers = Headers;\n self.Request = Request;\n self.Response = Response;\n }\n\n exports.Headers = Headers;\n exports.Request = Request;\n exports.Response = Response;\n exports.fetch = fetch;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n return exports;\n\n})({});\n})(__self__);\n__self__.fetch.ponyfill = true;\n// Remove \"polyfill\" property added by whatwg-fetch\ndelete __self__.fetch.polyfill;\n// Choose between native implementation (global) or custom implementation (__self__)\n// var ctx = global.fetch ? global : __self__;\nvar ctx = __self__; // this line disable service worker support temporarily\nexports = ctx.fetch // To enable: import fetch from 'cross-fetch'\nexports.default = ctx.fetch // For TypeScript consumers without esModuleInterop.\nexports.fetch = ctx.fetch // To enable: import {fetch} from 'cross-fetch'\nexports.Headers = ctx.Headers\nexports.Request = ctx.Request\nexports.Response = ctx.Response\nmodule.exports = exports\n","import { defaultJsonSerializer } from './defaultJsonSerializer.js';\nimport { HeadersInstanceToPlainObject, uppercase } from './helpers.js';\nimport { parseBatchRequestArgs, parseRawRequestArgs, parseRawRequestExtendedArgs, parseRequestArgs, parseRequestExtendedArgs, } from './parseArgs.js';\nimport { resolveRequestDocument } from './resolveRequestDocument.js';\nimport { ClientError, } from './types.js';\nimport crossFetch, * as CrossFetch from 'cross-fetch';\n/**\n * Convert the given headers configuration into a plain object.\n */\nconst resolveHeaders = (headers) => {\n let oHeaders = {};\n if (headers) {\n if ((typeof Headers !== `undefined` && headers instanceof Headers) ||\n (CrossFetch && CrossFetch.Headers && headers instanceof CrossFetch.Headers)) {\n oHeaders = HeadersInstanceToPlainObject(headers);\n }\n else if (Array.isArray(headers)) {\n headers.forEach(([name, value]) => {\n if (name && value !== undefined) {\n oHeaders[name] = value;\n }\n });\n }\n else {\n oHeaders = headers;\n }\n }\n return oHeaders;\n};\n/**\n * Clean a GraphQL document to send it via a GET query\n */\nconst cleanQuery = (str) => str.replace(/([\\s,]|#[^\\n\\r]+)+/g, ` `).trim();\n/**\n * Create query string for GraphQL request\n */\nconst buildRequestConfig = (params) => {\n if (!Array.isArray(params.query)) {\n const params_ = params;\n const search = [`query=${encodeURIComponent(cleanQuery(params_.query))}`];\n if (params.variables) {\n search.push(`variables=${encodeURIComponent(params_.jsonSerializer.stringify(params_.variables))}`);\n }\n if (params_.operationName) {\n search.push(`operationName=${encodeURIComponent(params_.operationName)}`);\n }\n return search.join(`&`);\n }\n if (typeof params.variables !== `undefined` && !Array.isArray(params.variables)) {\n throw new Error(`Cannot create query with given variable type, array expected`);\n }\n // Batch support\n const params_ = params;\n const payload = params.query.reduce((acc, currentQuery, index) => {\n acc.push({\n query: cleanQuery(currentQuery),\n variables: params_.variables ? params_.jsonSerializer.stringify(params_.variables[index]) : undefined,\n });\n return acc;\n }, []);\n return `query=${encodeURIComponent(params_.jsonSerializer.stringify(payload))}`;\n};\nconst createHttpMethodFetcher = (method) => async (params) => {\n const { url, query, variables, operationName, fetch, fetchOptions, middleware } = params;\n const headers = { ...params.headers };\n let queryParams = ``;\n let body = undefined;\n if (method === `POST`) {\n body = createRequestBody(query, variables, operationName, fetchOptions.jsonSerializer);\n if (typeof body === `string`) {\n // @ts-expect-error todo\n headers[`Content-Type`] = `application/json`;\n }\n }\n else {\n // @ts-expect-error todo needs ADT for TS to understand the different states\n queryParams = buildRequestConfig({\n query,\n variables,\n operationName,\n jsonSerializer: fetchOptions.jsonSerializer ?? defaultJsonSerializer,\n });\n }\n const init = {\n method,\n headers,\n body,\n ...fetchOptions,\n };\n let urlResolved = url;\n let initResolved = init;\n if (middleware) {\n const result = await Promise.resolve(middleware({ ...init, url, operationName, variables }));\n const { url: urlNew, ...initNew } = result;\n urlResolved = urlNew;\n initResolved = initNew;\n }\n if (queryParams) {\n urlResolved = `${urlResolved}?${queryParams}`;\n }\n return await fetch(urlResolved, initResolved);\n};\n/**\n * GraphQL Client.\n */\nclass GraphQLClient {\n constructor(url, requestConfig = {}) {\n this.url = url;\n this.requestConfig = requestConfig;\n /**\n * Send a GraphQL query to the server.\n */\n this.rawRequest = async (...args) => {\n const [queryOrOptions, variables, requestHeaders] = args;\n const rawRequestOptions = parseRawRequestArgs(queryOrOptions, variables, requestHeaders);\n const { headers, fetch = crossFetch, method = `POST`, requestMiddleware, responseMiddleware, ...fetchOptions } = this.requestConfig;\n const { url } = this;\n if (rawRequestOptions.signal !== undefined) {\n fetchOptions.signal = rawRequestOptions.signal;\n }\n const { operationName } = resolveRequestDocument(rawRequestOptions.query);\n return makeRequest({\n url,\n query: rawRequestOptions.query,\n variables: rawRequestOptions.variables,\n headers: {\n ...resolveHeaders(callOrIdentity(headers)),\n ...resolveHeaders(rawRequestOptions.requestHeaders),\n },\n operationName,\n fetch,\n method,\n fetchOptions,\n middleware: requestMiddleware,\n })\n .then((response) => {\n if (responseMiddleware) {\n responseMiddleware(response);\n }\n return response;\n })\n .catch((error) => {\n if (responseMiddleware) {\n responseMiddleware(error);\n }\n throw error;\n });\n };\n }\n async request(documentOrOptions, ...variablesAndRequestHeaders) {\n const [variables, requestHeaders] = variablesAndRequestHeaders;\n const requestOptions = parseRequestArgs(documentOrOptions, variables, requestHeaders);\n const { headers, fetch = crossFetch, method = `POST`, requestMiddleware, responseMiddleware, ...fetchOptions } = this.requestConfig;\n const { url } = this;\n if (requestOptions.signal !== undefined) {\n fetchOptions.signal = requestOptions.signal;\n }\n const { query, operationName } = resolveRequestDocument(requestOptions.document);\n return makeRequest({\n url,\n query,\n variables: requestOptions.variables,\n headers: {\n ...resolveHeaders(callOrIdentity(headers)),\n ...resolveHeaders(requestOptions.requestHeaders),\n },\n operationName,\n fetch,\n method,\n fetchOptions,\n middleware: requestMiddleware,\n })\n .then((response) => {\n if (responseMiddleware) {\n responseMiddleware(response);\n }\n return response.data;\n })\n .catch((error) => {\n if (responseMiddleware) {\n responseMiddleware(error);\n }\n throw error;\n });\n }\n // prettier-ignore\n batchRequests(documentsOrOptions, requestHeaders) {\n const batchRequestOptions = parseBatchRequestArgs(documentsOrOptions, requestHeaders);\n const { headers, ...fetchOptions } = this.requestConfig;\n if (batchRequestOptions.signal !== undefined) {\n fetchOptions.signal = batchRequestOptions.signal;\n }\n const queries = batchRequestOptions.documents.map(({ document }) => resolveRequestDocument(document).query);\n const variables = batchRequestOptions.documents.map(({ variables }) => variables);\n return makeRequest({\n url: this.url,\n query: queries,\n // @ts-expect-error TODO reconcile batch variables into system.\n variables,\n headers: {\n ...resolveHeaders(callOrIdentity(headers)),\n ...resolveHeaders(batchRequestOptions.requestHeaders),\n },\n operationName: undefined,\n fetch: this.requestConfig.fetch ?? crossFetch,\n method: this.requestConfig.method || `POST`,\n fetchOptions,\n middleware: this.requestConfig.requestMiddleware,\n })\n .then((response) => {\n if (this.requestConfig.responseMiddleware) {\n this.requestConfig.responseMiddleware(response);\n }\n return response.data;\n })\n .catch((error) => {\n if (this.requestConfig.responseMiddleware) {\n this.requestConfig.responseMiddleware(error);\n }\n throw error;\n });\n }\n setHeaders(headers) {\n this.requestConfig.headers = headers;\n return this;\n }\n /**\n * Attach a header to the client. All subsequent requests will have this header.\n */\n setHeader(key, value) {\n const { headers } = this.requestConfig;\n if (headers) {\n // todo what if headers is in nested array form... ?\n //@ts-expect-error todo\n headers[key] = value;\n }\n else {\n this.requestConfig.headers = { [key]: value };\n }\n return this;\n }\n /**\n * Change the client endpoint. All subsequent requests will send to this endpoint.\n */\n setEndpoint(value) {\n this.url = value;\n return this;\n }\n}\nconst makeRequest = async (params) => {\n const { query, variables, fetchOptions } = params;\n const fetcher = createHttpMethodFetcher(uppercase(params.method ?? `post`));\n const isBatchingQuery = Array.isArray(params.query);\n const response = await fetcher(params);\n const result = await getResult(response, fetchOptions.jsonSerializer ?? defaultJsonSerializer);\n const successfullyReceivedData = Array.isArray(result)\n ? !result.some(({ data }) => !data)\n : Boolean(result.data);\n const successfullyPassedErrorPolicy = Array.isArray(result) ||\n !result.errors ||\n (Array.isArray(result.errors) && !result.errors.length) ||\n fetchOptions.errorPolicy === `all` ||\n fetchOptions.errorPolicy === `ignore`;\n if (response.ok && successfullyPassedErrorPolicy && successfullyReceivedData) {\n // @ts-expect-error TODO fixme\n const { errors: _, ...rest } = Array.isArray(result) ? result : result;\n const data = fetchOptions.errorPolicy === `ignore` ? rest : result;\n const dataEnvelope = isBatchingQuery ? { data } : data;\n // @ts-expect-error TODO\n return {\n ...dataEnvelope,\n headers: response.headers,\n status: response.status,\n };\n }\n else {\n const errorResult = typeof result === `string`\n ? {\n error: result,\n }\n : result;\n throw new ClientError(\n // @ts-expect-error TODO\n { ...errorResult, status: response.status, headers: response.headers }, { query, variables });\n }\n};\n/**\n * Send a GraphQL Query to the GraphQL server for execution.\n */\nconst rawRequest = async (...args) => {\n const [urlOrOptions, query, ...variablesAndRequestHeaders] = args;\n const requestOptions = parseRawRequestExtendedArgs(urlOrOptions, query, ...variablesAndRequestHeaders);\n const client = new GraphQLClient(requestOptions.url);\n return client.rawRequest({\n ...requestOptions,\n });\n};\n// prettier-ignore\n// eslint-disable-next-line\nasync function request(urlOrOptions, document, ...variablesAndRequestHeaders) {\n const requestOptions = parseRequestExtendedArgs(urlOrOptions, document, ...variablesAndRequestHeaders);\n const client = new GraphQLClient(requestOptions.url);\n return client.request({\n ...requestOptions,\n });\n}\n/**\n * Send a batch of GraphQL Document to the GraphQL server for execution.\n *\n * @example\n *\n * ```ts\n * // You can pass a raw string\n *\n * await batchRequests('https://foo.bar/graphql', [\n * {\n * query: `\n * {\n * query {\n * users\n * }\n * }`\n * },\n * {\n * query: `\n * {\n * query {\n * users\n * }\n * }`\n * }])\n *\n * // You can also pass a GraphQL DocumentNode as query. Convenient if you\n * // are using graphql-tag package.\n *\n * import gql from 'graphql-tag'\n *\n * await batchRequests('https://foo.bar/graphql', [{ query: gql`...` }])\n * ```\n */\nconst batchRequests = async (...args) => {\n const params = parseBatchRequestsArgsExtended(args);\n const client = new GraphQLClient(params.url);\n return client.batchRequests(params);\n};\nconst parseBatchRequestsArgsExtended = (args) => {\n if (args.length === 1) {\n return args[0];\n }\n else {\n return {\n url: args[0],\n documents: args[1],\n requestHeaders: args[2],\n signal: undefined,\n };\n }\n};\nconst createRequestBody = (query, variables, operationName, jsonSerializer) => {\n const jsonSerializer_ = jsonSerializer ?? defaultJsonSerializer;\n if (!Array.isArray(query)) {\n return jsonSerializer_.stringify({ query, variables, operationName });\n }\n if (typeof variables !== `undefined` && !Array.isArray(variables)) {\n throw new Error(`Cannot create request body with given variable type, array expected`);\n }\n // Batch support\n const payload = query.reduce((acc, currentQuery, index) => {\n acc.push({ query: currentQuery, variables: variables ? variables[index] : undefined });\n return acc;\n }, []);\n return jsonSerializer_.stringify(payload);\n};\nconst getResult = async (response, jsonSerializer) => {\n let contentType;\n response.headers.forEach((value, key) => {\n if (key.toLowerCase() === `content-type`) {\n contentType = value;\n }\n });\n if (contentType &&\n (contentType.toLowerCase().startsWith(`application/json`) ||\n contentType.toLowerCase().startsWith(`application/graphql+json`) ||\n contentType.toLowerCase().startsWith(`application/graphql-response+json`))) {\n return jsonSerializer.parse(await response.text());\n }\n else {\n return response.text();\n }\n};\nconst callOrIdentity = (value) => {\n return typeof value === `function` ? value() : value;\n};\n/**\n * Convenience passthrough template tag to get the benefits of tooling for the gql template tag. This does not actually parse the input into a GraphQL DocumentNode like graphql-tag package does. It just returns the string with any variables given interpolated. Can save you a bit of performance and having to install another package.\n *\n * @example\n * ```\n * import { gql } from 'graphql-request'\n *\n * await request('https://foo.bar/graphql', gql`...`)\n * ```\n *\n * @remarks\n *\n * Several tools in the Node GraphQL ecosystem are hardcoded to specially treat any template tag named \"gql\". For example see this prettier issue: https://github.com/prettier/prettier/issues/4360. Using this template tag has no runtime effect beyond variable interpolation.\n */\nexport const gql = (chunks, ...variables) => {\n return chunks.reduce((acc, chunk, index) => `${acc}${chunk}${index in variables ? String(variables[index]) : ``}`, ``);\n};\nexport { GraphQLWebSocketClient } from './graphql-ws.js';\nexport { resolveRequestDocument } from './resolveRequestDocument.js';\nexport { batchRequests, ClientError, GraphQLClient, rawRequest, request, };\nexport default request;\n//# sourceMappingURL=index.js.map","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","import { __assign } from \"tslib\";\nimport { parse } from 'graphql';\nvar docCache = new Map();\nvar fragmentSourceMap = new Map();\nvar printFragmentWarnings = true;\nvar experimentalFragmentVariables = false;\nfunction normalize(string) {\n return string.replace(/[\\s,]+/g, ' ').trim();\n}\nfunction cacheKeyFromLoc(loc) {\n return normalize(loc.source.body.substring(loc.start, loc.end));\n}\nfunction processFragments(ast) {\n var seenKeys = new Set();\n var definitions = [];\n ast.definitions.forEach(function (fragmentDefinition) {\n if (fragmentDefinition.kind === 'FragmentDefinition') {\n var fragmentName = fragmentDefinition.name.value;\n var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc);\n var sourceKeySet = fragmentSourceMap.get(fragmentName);\n if (sourceKeySet && !sourceKeySet.has(sourceKey)) {\n if (printFragmentWarnings) {\n console.warn(\"Warning: fragment with name \" + fragmentName + \" already exists.\\n\"\n + \"graphql-tag enforces all fragment names across your application to be unique; read more about\\n\"\n + \"this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names\");\n }\n }\n else if (!sourceKeySet) {\n fragmentSourceMap.set(fragmentName, sourceKeySet = new Set);\n }\n sourceKeySet.add(sourceKey);\n if (!seenKeys.has(sourceKey)) {\n seenKeys.add(sourceKey);\n definitions.push(fragmentDefinition);\n }\n }\n else {\n definitions.push(fragmentDefinition);\n }\n });\n return __assign(__assign({}, ast), { definitions: definitions });\n}\nfunction stripLoc(doc) {\n var workSet = new Set(doc.definitions);\n workSet.forEach(function (node) {\n if (node.loc)\n delete node.loc;\n Object.keys(node).forEach(function (key) {\n var value = node[key];\n if (value && typeof value === 'object') {\n workSet.add(value);\n }\n });\n });\n var loc = doc.loc;\n if (loc) {\n delete loc.startToken;\n delete loc.endToken;\n }\n return doc;\n}\nfunction parseDocument(source) {\n var cacheKey = normalize(source);\n if (!docCache.has(cacheKey)) {\n var parsed = parse(source, {\n experimentalFragmentVariables: experimentalFragmentVariables,\n allowLegacyFragmentVariables: experimentalFragmentVariables\n });\n if (!parsed || parsed.kind !== 'Document') {\n throw new Error('Not a valid GraphQL document.');\n }\n docCache.set(cacheKey, stripLoc(processFragments(parsed)));\n }\n return docCache.get(cacheKey);\n}\nexport function gql(literals) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (typeof literals === 'string') {\n literals = [literals];\n }\n var result = literals[0];\n args.forEach(function (arg, i) {\n if (arg && arg.kind === 'Document') {\n result += arg.loc.source.body;\n }\n else {\n result += arg;\n }\n result += literals[i + 1];\n });\n return parseDocument(result);\n}\nexport function resetCaches() {\n docCache.clear();\n fragmentSourceMap.clear();\n}\nexport function disableFragmentWarnings() {\n printFragmentWarnings = false;\n}\nexport function enableExperimentalFragmentVariables() {\n experimentalFragmentVariables = true;\n}\nexport function disableExperimentalFragmentVariables() {\n experimentalFragmentVariables = false;\n}\nvar extras = {\n gql: gql,\n resetCaches: resetCaches,\n disableFragmentWarnings: disableFragmentWarnings,\n enableExperimentalFragmentVariables: enableExperimentalFragmentVariables,\n disableExperimentalFragmentVariables: disableExperimentalFragmentVariables\n};\n(function (gql_1) {\n gql_1.gql = extras.gql, gql_1.resetCaches = extras.resetCaches, gql_1.disableFragmentWarnings = extras.disableFragmentWarnings, gql_1.enableExperimentalFragmentVariables = extras.enableExperimentalFragmentVariables, gql_1.disableExperimentalFragmentVariables = extras.disableExperimentalFragmentVariables;\n})(gql || (gql = {}));\ngql[\"default\"] = gql;\nexport default gql;\n//# sourceMappingURL=index.js.map","import { GraphQLClient } from 'graphql-request'\nimport { GraphQLClientRequestHeaders } from 'graphql-request/build/cjs/types'\nimport gql from 'graphql-tag'\nexport type Maybe = T | null\nexport type InputMaybe = Maybe\nexport type Exact = {\n\t[K in keyof T]: T[K]\n}\nexport type MakeOptional = Omit & {\n\t[SubKey in K]?: Maybe\n}\nexport type MakeMaybe = Omit & {\n\t[SubKey in K]: Maybe\n}\nexport type MakeEmpty<\n\tT extends { [key: string]: unknown },\n\tK extends keyof T,\n> = { [_ in K]?: never }\nexport type Incremental =\n\t| T\n\t| {\n\t\t\t[P in keyof T]?: P extends ' $fragmentName' | '__typename'\n\t\t\t\t? T[P]\n\t\t\t\t: never\n\t }\n/** All built-in and custom scalars, mapped to their actual values */\nexport type Scalars = {\n\tID: { input: string; output: string }\n\tString: { input: string; output: string }\n\tBoolean: { input: boolean; output: boolean }\n\tInt: { input: number; output: number }\n\tFloat: { input: number; output: number }\n\tAny: { input: any; output: any }\n\tInt64: { input: any; output: any }\n\tTimestamp: { input: any; output: any }\n}\n\nexport type BackendErrorObjectInput = {\n\tenvironment: Scalars['String']['input']\n\tevent: Scalars['String']['input']\n\tlog_cursor?: InputMaybe\n\tpayload?: InputMaybe\n\trequest_id?: InputMaybe\n\tservice: ServiceInput\n\tsession_secure_id?: InputMaybe\n\tsource: Scalars['String']['input']\n\tspan_id?: InputMaybe\n\tstackTrace: Scalars['String']['input']\n\ttimestamp: Scalars['Timestamp']['input']\n\ttrace_id?: InputMaybe\n\ttype: Scalars['String']['input']\n\turl: Scalars['String']['input']\n}\n\nexport type ErrorObjectInput = {\n\tcolumnNumber: Scalars['Int']['input']\n\tevent: Scalars['String']['input']\n\tlineNumber: Scalars['Int']['input']\n\tpayload?: InputMaybe\n\tsource: Scalars['String']['input']\n\tstackTrace: Array>\n\ttimestamp: Scalars['Timestamp']['input']\n\ttype: Scalars['String']['input']\n\turl: Scalars['String']['input']\n}\n\nexport type InitializeSessionResponse = {\n\t__typename?: 'InitializeSessionResponse'\n\tproject_id: Scalars['ID']['output']\n\tsecure_id: Scalars['String']['output']\n}\n\nexport type MetricInput = {\n\tcategory?: InputMaybe\n\tgroup?: InputMaybe\n\tname: Scalars['String']['input']\n\tparent_span_id?: InputMaybe\n\tsession_secure_id: Scalars['String']['input']\n\tspan_id?: InputMaybe\n\ttags?: InputMaybe>\n\ttimestamp: Scalars['Timestamp']['input']\n\ttrace_id?: InputMaybe\n\tvalue: Scalars['Float']['input']\n}\n\nexport type MetricTag = {\n\tname: Scalars['String']['input']\n\tvalue: Scalars['String']['input']\n}\n\nexport type Mutation = {\n\t__typename?: 'Mutation'\n\taddSessionFeedback: Scalars['String']['output']\n\taddSessionProperties: Scalars['String']['output']\n\tidentifySession: Scalars['String']['output']\n\tinitializeSession: InitializeSessionResponse\n\tmarkBackendSetup?: Maybe\n\tpushBackendPayload?: Maybe\n\tpushMetrics: Scalars['Int']['output']\n\tpushPayload: Scalars['Int']['output']\n\tpushPayloadCompressed?: Maybe\n}\n\nexport type MutationAddSessionFeedbackArgs = {\n\tsession_secure_id: Scalars['String']['input']\n\ttimestamp: Scalars['Timestamp']['input']\n\tuser_email?: InputMaybe\n\tuser_name?: InputMaybe\n\tverbatim: Scalars['String']['input']\n}\n\nexport type MutationAddSessionPropertiesArgs = {\n\tproperties_object?: InputMaybe\n\tsession_secure_id: Scalars['String']['input']\n}\n\nexport type MutationIdentifySessionArgs = {\n\tsession_secure_id: Scalars['String']['input']\n\tuser_identifier: Scalars['String']['input']\n\tuser_object?: InputMaybe\n}\n\nexport type MutationInitializeSessionArgs = {\n\tappVersion?: InputMaybe\n\tclientConfig: Scalars['String']['input']\n\tclientVersion: Scalars['String']['input']\n\tclient_id: Scalars['String']['input']\n\tdisable_session_recording?: InputMaybe\n\tenable_recording_network_contents: Scalars['Boolean']['input']\n\tenable_strict_privacy: Scalars['Boolean']['input']\n\tenvironment: Scalars['String']['input']\n\tfingerprint: Scalars['String']['input']\n\tfirstloadVersion: Scalars['String']['input']\n\tnetwork_recording_domains?: InputMaybe>\n\torganization_verbose_id: Scalars['String']['input']\n\tprivacy_setting?: InputMaybe\n\tserviceName?: InputMaybe\n\tsession_secure_id: Scalars['String']['input']\n}\n\nexport type MutationMarkBackendSetupArgs = {\n\tproject_id?: InputMaybe\n\tsession_secure_id?: InputMaybe\n\ttype?: InputMaybe\n}\n\nexport type MutationPushBackendPayloadArgs = {\n\terrors: Array>\n\tproject_id?: InputMaybe\n}\n\nexport type MutationPushMetricsArgs = {\n\tmetrics: Array>\n}\n\nexport type MutationPushPayloadArgs = {\n\terrors: Array>\n\tevents: ReplayEventsInput\n\thas_session_unloaded?: InputMaybe\n\thighlight_logs?: InputMaybe\n\tis_beacon?: InputMaybe\n\tmessages: Scalars['String']['input']\n\tpayload_id?: InputMaybe\n\tresources: Scalars['String']['input']\n\tsession_secure_id: Scalars['String']['input']\n\tweb_socket_events?: InputMaybe\n}\n\nexport type MutationPushPayloadCompressedArgs = {\n\tdata: Scalars['String']['input']\n\tpayload_id: Scalars['ID']['input']\n\tsession_secure_id: Scalars['String']['input']\n}\n\nexport enum PublicGraphError {\n\tBillingQuotaExceeded = 'BillingQuotaExceeded',\n}\n\nexport type Query = {\n\t__typename?: 'Query'\n\tignore?: Maybe\n}\n\nexport type QueryIgnoreArgs = {\n\tid: Scalars['ID']['input']\n}\n\nexport type ReplayEventInput = {\n\t_sid: Scalars['Float']['input']\n\tdata: Scalars['Any']['input']\n\ttimestamp: Scalars['Float']['input']\n\ttype: Scalars['Int']['input']\n}\n\nexport type ReplayEventsInput = {\n\tevents: Array>\n}\n\nexport type ServiceInput = {\n\tname: Scalars['String']['input']\n\tversion: Scalars['String']['input']\n}\n\nexport type Session = {\n\t__typename?: 'Session'\n\tid?: Maybe\n\torganization_id: Scalars['ID']['output']\n\tproject_id: Scalars['ID']['output']\n\tsecure_id: Scalars['String']['output']\n}\n\nexport type StackFrameInput = {\n\targs?: InputMaybe>>\n\tcolumnNumber?: InputMaybe\n\tfileName?: InputMaybe\n\tfunctionName?: InputMaybe\n\tisEval?: InputMaybe\n\tisNative?: InputMaybe\n\tlineNumber?: InputMaybe\n\tsource?: InputMaybe\n}\n\nexport type PushPayloadMutationVariables = Exact<{\n\tsession_secure_id: Scalars['String']['input']\n\tpayload_id: Scalars['ID']['input']\n\tevents: ReplayEventsInput\n\tmessages: Scalars['String']['input']\n\tresources: Scalars['String']['input']\n\tweb_socket_events: Scalars['String']['input']\n\terrors: Array> | InputMaybe\n\tis_beacon?: InputMaybe\n\thas_session_unloaded?: InputMaybe\n\thighlight_logs?: InputMaybe\n}>\n\nexport type PushPayloadMutation = {\n\t__typename?: 'Mutation'\n\tpushPayload: number\n}\n\nexport type PushPayloadCompressedMutationVariables = Exact<{\n\tsession_secure_id: Scalars['String']['input']\n\tpayload_id: Scalars['ID']['input']\n\tdata: Scalars['String']['input']\n}>\n\nexport type PushPayloadCompressedMutation = {\n\t__typename?: 'Mutation'\n\tpushPayloadCompressed?: any | null\n}\n\nexport type IdentifySessionMutationVariables = Exact<{\n\tsession_secure_id: Scalars['String']['input']\n\tuser_identifier: Scalars['String']['input']\n\tuser_object?: InputMaybe\n}>\n\nexport type IdentifySessionMutation = {\n\t__typename?: 'Mutation'\n\tidentifySession: string\n}\n\nexport type AddSessionPropertiesMutationVariables = Exact<{\n\tsession_secure_id: Scalars['String']['input']\n\tproperties_object?: InputMaybe\n}>\n\nexport type AddSessionPropertiesMutation = {\n\t__typename?: 'Mutation'\n\taddSessionProperties: string\n}\n\nexport type PushMetricsMutationVariables = Exact<{\n\tmetrics: Array> | InputMaybe\n}>\n\nexport type PushMetricsMutation = {\n\t__typename?: 'Mutation'\n\tpushMetrics: number\n}\n\nexport type AddSessionFeedbackMutationVariables = Exact<{\n\tsession_secure_id: Scalars['String']['input']\n\tuser_name?: InputMaybe\n\tuser_email?: InputMaybe\n\tverbatim: Scalars['String']['input']\n\ttimestamp: Scalars['Timestamp']['input']\n}>\n\nexport type AddSessionFeedbackMutation = {\n\t__typename?: 'Mutation'\n\taddSessionFeedback: string\n}\n\nexport type InitializeSessionMutationVariables = Exact<{\n\tsession_secure_id: Scalars['String']['input']\n\torganization_verbose_id: Scalars['String']['input']\n\tenable_strict_privacy: Scalars['Boolean']['input']\n\tprivacy_setting: Scalars['String']['input']\n\tenable_recording_network_contents: Scalars['Boolean']['input']\n\tclientVersion: Scalars['String']['input']\n\tfirstloadVersion: Scalars['String']['input']\n\tclientConfig: Scalars['String']['input']\n\tenvironment: Scalars['String']['input']\n\tid: Scalars['String']['input']\n\tappVersion?: InputMaybe\n\tserviceName: Scalars['String']['input']\n\tclient_id: Scalars['String']['input']\n\tnetwork_recording_domains?: InputMaybe<\n\t\tArray | Scalars['String']['input']\n\t>\n\tdisable_session_recording?: InputMaybe\n}>\n\nexport type InitializeSessionMutation = {\n\t__typename?: 'Mutation'\n\tinitializeSession: {\n\t\t__typename?: 'InitializeSessionResponse'\n\t\tsecure_id: string\n\t\tproject_id: string\n\t}\n}\n\nexport type IgnoreQueryVariables = Exact<{\n\tid: Scalars['ID']['input']\n}>\n\nexport type IgnoreQuery = { __typename?: 'Query'; ignore?: any | null }\n\nexport const PushPayloadDocument = gql`\n\tmutation PushPayload(\n\t\t$session_secure_id: String!\n\t\t$payload_id: ID!\n\t\t$events: ReplayEventsInput!\n\t\t$messages: String!\n\t\t$resources: String!\n\t\t$web_socket_events: String!\n\t\t$errors: [ErrorObjectInput]!\n\t\t$is_beacon: Boolean\n\t\t$has_session_unloaded: Boolean\n\t\t$highlight_logs: String\n\t) {\n\t\tpushPayload(\n\t\t\tsession_secure_id: $session_secure_id\n\t\t\tpayload_id: $payload_id\n\t\t\tevents: $events\n\t\t\tmessages: $messages\n\t\t\tresources: $resources\n\t\t\tweb_socket_events: $web_socket_events\n\t\t\terrors: $errors\n\t\t\tis_beacon: $is_beacon\n\t\t\thas_session_unloaded: $has_session_unloaded\n\t\t\thighlight_logs: $highlight_logs\n\t\t)\n\t}\n`\nexport const PushPayloadCompressedDocument = gql`\n\tmutation PushPayloadCompressed(\n\t\t$session_secure_id: String!\n\t\t$payload_id: ID!\n\t\t$data: String!\n\t) {\n\t\tpushPayloadCompressed(\n\t\t\tsession_secure_id: $session_secure_id\n\t\t\tpayload_id: $payload_id\n\t\t\tdata: $data\n\t\t)\n\t}\n`\nexport const IdentifySessionDocument = gql`\n\tmutation identifySession(\n\t\t$session_secure_id: String!\n\t\t$user_identifier: String!\n\t\t$user_object: Any\n\t) {\n\t\tidentifySession(\n\t\t\tsession_secure_id: $session_secure_id\n\t\t\tuser_identifier: $user_identifier\n\t\t\tuser_object: $user_object\n\t\t)\n\t}\n`\nexport const AddSessionPropertiesDocument = gql`\n\tmutation addSessionProperties(\n\t\t$session_secure_id: String!\n\t\t$properties_object: Any\n\t) {\n\t\taddSessionProperties(\n\t\t\tsession_secure_id: $session_secure_id\n\t\t\tproperties_object: $properties_object\n\t\t)\n\t}\n`\nexport const PushMetricsDocument = gql`\n\tmutation pushMetrics($metrics: [MetricInput]!) {\n\t\tpushMetrics(metrics: $metrics)\n\t}\n`\nexport const AddSessionFeedbackDocument = gql`\n\tmutation addSessionFeedback(\n\t\t$session_secure_id: String!\n\t\t$user_name: String\n\t\t$user_email: String\n\t\t$verbatim: String!\n\t\t$timestamp: Timestamp!\n\t) {\n\t\taddSessionFeedback(\n\t\t\tsession_secure_id: $session_secure_id\n\t\t\tuser_name: $user_name\n\t\t\tuser_email: $user_email\n\t\t\tverbatim: $verbatim\n\t\t\ttimestamp: $timestamp\n\t\t)\n\t}\n`\nexport const InitializeSessionDocument = gql`\n\tmutation initializeSession(\n\t\t$session_secure_id: String!\n\t\t$organization_verbose_id: String!\n\t\t$enable_strict_privacy: Boolean!\n\t\t$privacy_setting: String!\n\t\t$enable_recording_network_contents: Boolean!\n\t\t$clientVersion: String!\n\t\t$firstloadVersion: String!\n\t\t$clientConfig: String!\n\t\t$environment: String!\n\t\t$id: String!\n\t\t$appVersion: String\n\t\t$serviceName: String!\n\t\t$client_id: String!\n\t\t$network_recording_domains: [String!]\n\t\t$disable_session_recording: Boolean\n\t) {\n\t\tinitializeSession(\n\t\t\tsession_secure_id: $session_secure_id\n\t\t\torganization_verbose_id: $organization_verbose_id\n\t\t\tenable_strict_privacy: $enable_strict_privacy\n\t\t\tenable_recording_network_contents: $enable_recording_network_contents\n\t\t\tclientVersion: $clientVersion\n\t\t\tfirstloadVersion: $firstloadVersion\n\t\t\tclientConfig: $clientConfig\n\t\t\tenvironment: $environment\n\t\t\tappVersion: $appVersion\n\t\t\tserviceName: $serviceName\n\t\t\tfingerprint: $id\n\t\t\tclient_id: $client_id\n\t\t\tnetwork_recording_domains: $network_recording_domains\n\t\t\tdisable_session_recording: $disable_session_recording\n\t\t\tprivacy_setting: $privacy_setting\n\t\t) {\n\t\t\tsecure_id\n\t\t\tproject_id\n\t\t}\n\t}\n`\nexport const IgnoreDocument = gql`\n\tquery Ignore($id: ID!) {\n\t\tignore(id: $id)\n\t}\n`\n\nexport type SdkFunctionWrapper = (\n\taction: (requestHeaders?: Record) => Promise,\n\toperationName: string,\n\toperationType?: string,\n\tvariables?: any,\n) => Promise\n\nconst defaultWrapper: SdkFunctionWrapper = (\n\taction,\n\t_operationName,\n\t_operationType,\n\tvariables,\n) => action()\n\nexport function getSdk(\n\tclient: GraphQLClient,\n\twithWrapper: SdkFunctionWrapper = defaultWrapper,\n) {\n\treturn {\n\t\tPushPayload(\n\t\t\tvariables: PushPayloadMutationVariables,\n\t\t\trequestHeaders?: GraphQLClientRequestHeaders,\n\t\t): Promise {\n\t\t\treturn withWrapper(\n\t\t\t\t(wrappedRequestHeaders) =>\n\t\t\t\t\tclient.request(\n\t\t\t\t\t\tPushPayloadDocument,\n\t\t\t\t\t\tvariables,\n\t\t\t\t\t\t{ ...requestHeaders, ...wrappedRequestHeaders },\n\t\t\t\t\t),\n\t\t\t\t'PushPayload',\n\t\t\t\t'mutation',\n\t\t\t\tvariables,\n\t\t\t)\n\t\t},\n\t\tPushPayloadCompressed(\n\t\t\tvariables: PushPayloadCompressedMutationVariables,\n\t\t\trequestHeaders?: GraphQLClientRequestHeaders,\n\t\t): Promise {\n\t\t\treturn withWrapper(\n\t\t\t\t(wrappedRequestHeaders) =>\n\t\t\t\t\tclient.request(\n\t\t\t\t\t\tPushPayloadCompressedDocument,\n\t\t\t\t\t\tvariables,\n\t\t\t\t\t\t{ ...requestHeaders, ...wrappedRequestHeaders },\n\t\t\t\t\t),\n\t\t\t\t'PushPayloadCompressed',\n\t\t\t\t'mutation',\n\t\t\t\tvariables,\n\t\t\t)\n\t\t},\n\t\tidentifySession(\n\t\t\tvariables: IdentifySessionMutationVariables,\n\t\t\trequestHeaders?: GraphQLClientRequestHeaders,\n\t\t): Promise {\n\t\t\treturn withWrapper(\n\t\t\t\t(wrappedRequestHeaders) =>\n\t\t\t\t\tclient.request(\n\t\t\t\t\t\tIdentifySessionDocument,\n\t\t\t\t\t\tvariables,\n\t\t\t\t\t\t{ ...requestHeaders, ...wrappedRequestHeaders },\n\t\t\t\t\t),\n\t\t\t\t'identifySession',\n\t\t\t\t'mutation',\n\t\t\t\tvariables,\n\t\t\t)\n\t\t},\n\t\taddSessionProperties(\n\t\t\tvariables: AddSessionPropertiesMutationVariables,\n\t\t\trequestHeaders?: GraphQLClientRequestHeaders,\n\t\t): Promise {\n\t\t\treturn withWrapper(\n\t\t\t\t(wrappedRequestHeaders) =>\n\t\t\t\t\tclient.request(\n\t\t\t\t\t\tAddSessionPropertiesDocument,\n\t\t\t\t\t\tvariables,\n\t\t\t\t\t\t{ ...requestHeaders, ...wrappedRequestHeaders },\n\t\t\t\t\t),\n\t\t\t\t'addSessionProperties',\n\t\t\t\t'mutation',\n\t\t\t\tvariables,\n\t\t\t)\n\t\t},\n\t\tpushMetrics(\n\t\t\tvariables: PushMetricsMutationVariables,\n\t\t\trequestHeaders?: GraphQLClientRequestHeaders,\n\t\t): Promise {\n\t\t\treturn withWrapper(\n\t\t\t\t(wrappedRequestHeaders) =>\n\t\t\t\t\tclient.request(\n\t\t\t\t\t\tPushMetricsDocument,\n\t\t\t\t\t\tvariables,\n\t\t\t\t\t\t{ ...requestHeaders, ...wrappedRequestHeaders },\n\t\t\t\t\t),\n\t\t\t\t'pushMetrics',\n\t\t\t\t'mutation',\n\t\t\t\tvariables,\n\t\t\t)\n\t\t},\n\t\taddSessionFeedback(\n\t\t\tvariables: AddSessionFeedbackMutationVariables,\n\t\t\trequestHeaders?: GraphQLClientRequestHeaders,\n\t\t): Promise {\n\t\t\treturn withWrapper(\n\t\t\t\t(wrappedRequestHeaders) =>\n\t\t\t\t\tclient.request(\n\t\t\t\t\t\tAddSessionFeedbackDocument,\n\t\t\t\t\t\tvariables,\n\t\t\t\t\t\t{ ...requestHeaders, ...wrappedRequestHeaders },\n\t\t\t\t\t),\n\t\t\t\t'addSessionFeedback',\n\t\t\t\t'mutation',\n\t\t\t\tvariables,\n\t\t\t)\n\t\t},\n\t\tinitializeSession(\n\t\t\tvariables: InitializeSessionMutationVariables,\n\t\t\trequestHeaders?: GraphQLClientRequestHeaders,\n\t\t): Promise {\n\t\t\treturn withWrapper(\n\t\t\t\t(wrappedRequestHeaders) =>\n\t\t\t\t\tclient.request(\n\t\t\t\t\t\tInitializeSessionDocument,\n\t\t\t\t\t\tvariables,\n\t\t\t\t\t\t{ ...requestHeaders, ...wrappedRequestHeaders },\n\t\t\t\t\t),\n\t\t\t\t'initializeSession',\n\t\t\t\t'mutation',\n\t\t\t\tvariables,\n\t\t\t)\n\t\t},\n\t\tIgnore(\n\t\t\tvariables: IgnoreQueryVariables,\n\t\t\trequestHeaders?: GraphQLClientRequestHeaders,\n\t\t): Promise {\n\t\t\treturn withWrapper(\n\t\t\t\t(wrappedRequestHeaders) =>\n\t\t\t\t\tclient.request(IgnoreDocument, variables, {\n\t\t\t\t\t\t...requestHeaders,\n\t\t\t\t\t\t...wrappedRequestHeaders,\n\t\t\t\t\t}),\n\t\t\t\t'Ignore',\n\t\t\t\t'query',\n\t\t\t\tvariables,\n\t\t\t)\n\t\t},\n\t}\n}\nexport type Sdk = ReturnType\n","import { MaskInputOptions } from 'rrweb-snapshot'\nimport { PrivacySettingOption } from '../types/types'\n\n// returns (1) whether all inputs should be masked and (2) which inputs should be masked\nexport const determineMaskInputOptions = (\n\tprivacyPolicy: PrivacySettingOption,\n): [maskAllOptions: boolean, maskOptions?: MaskInputOptions] => {\n\tswitch (privacyPolicy) {\n\t\tcase 'strict':\n\t\t\treturn [true, undefined]\n\t\tcase 'default':\n\t\t\treturn [true, undefined]\n\t\tcase 'none': {\n\t\t\treturn [false, { password: true }]\n\t\t}\n\t}\n}\n","import { SESSION_STORAGE_KEYS } from '../utils/sessionStorage/sessionStorageKeys'\nimport { getItem, monkeyPatchLocalStorage, setItem } from '../utils/storage'\n\nenum SEGMENT_LOCAL_STORAGE_KEYS {\n\tUSER_ID = 'ajs_user_id',\n\tUSER_TRAITS = 'ajs_user_traits',\n\tANONYMOUS_ID = 'ajs_anonymous_id',\n}\n\nexport const SegmentIntegrationListener = (callback: (obj: any) => void) => {\n\tcallback(window.location.href)\n\tvar send = XMLHttpRequest.prototype.send\n\tXMLHttpRequest.prototype.send = function (data: any) {\n\t\tsetTimeout(() => {\n\t\t\tvar obj: any\n\t\t\ttry {\n\t\t\t\tobj = JSON.parse(data?.toString() ?? '')\n\t\t\t} catch (e) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (obj.type === 'track' || obj.type === 'identify') {\n\t\t\t\tif (shouldSend(obj)) {\n\t\t\t\t\tcallback(obj)\n\t\t\t\t}\n\t\t\t}\n\t\t}, 100)\n\t\tsend.call(this, data)\n\t}\n\n\tconst localStorageHandler = (e: Pick) => {\n\t\tif (\n\t\t\te.key === SEGMENT_LOCAL_STORAGE_KEYS['USER_ID'] ||\n\t\t\te.key === SEGMENT_LOCAL_STORAGE_KEYS['ANONYMOUS_ID'] ||\n\t\t\te.key === SEGMENT_LOCAL_STORAGE_KEYS['USER_TRAITS']\n\t\t) {\n\t\t\tconst { userId, userTraits } = getLocalStorageValues()\n\n\t\t\tif (userId) {\n\t\t\t\tlet parsedUserTraits = {}\n\t\t\t\tif (userTraits) {\n\t\t\t\t\tparsedUserTraits = JSON.parse(userTraits)\n\t\t\t\t}\n\t\t\t\tconst payload = {\n\t\t\t\t\ttype: 'identify',\n\t\t\t\t\tuserId: userId.toString(),\n\t\t\t\t\ttraits: parsedUserTraits,\n\t\t\t\t}\n\n\t\t\t\tif (shouldSend(payload)) {\n\t\t\t\t\tcallback(payload)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tconst { userId, userTraits } = getLocalStorageValues()\n\n\tif (userId) {\n\t\tlet parsedUserTraits = {}\n\t\tif (userTraits) {\n\t\t\tparsedUserTraits = JSON.parse(userTraits)\n\t\t}\n\t\tconst payload = {\n\t\t\ttype: 'identify',\n\t\t\tuserId: userId.toString(),\n\t\t\ttraits: parsedUserTraits,\n\t\t}\n\n\t\tif (shouldSend(payload)) {\n\t\t\tcallback(payload)\n\t\t}\n\t}\n\n\twindow.addEventListener('storage', localStorageHandler)\n\n\t// `window.addEventListener('storage', localStorageHandler)` only gets called when the storage\n\t// is changed on a different window/tab. Same-page changes do not cause an event to get created.\n\t// This breaks our use case here since Segment sets the localStorage values on the same tab that\n\t// Highlight is running on. Without this, we won't be able to read the Segment identify values.\n\tmonkeyPatchLocalStorage(({ keyName }) => {\n\t\tconst mockStorageEvent = {\n\t\t\tkey: keyName,\n\t\t}\n\n\t\tlocalStorageHandler(mockStorageEvent)\n\t})\n\n\treturn () => {\n\t\twindow.removeEventListener('storage', localStorageHandler)\n\t\tXMLHttpRequest.prototype.send = send\n\t}\n}\n\nconst getLocalStorageValues = () => {\n\tconst userId = getItem(SEGMENT_LOCAL_STORAGE_KEYS['USER_ID'])\n\tconst userTraits = getItem(SEGMENT_LOCAL_STORAGE_KEYS['USER_TRAITS'])\n\tconst anonymousId = getItem(SEGMENT_LOCAL_STORAGE_KEYS['ANONYMOUS_ID'])\n\n\treturn {\n\t\tuserId,\n\t\tuserTraits,\n\t\tanonymousId,\n\t}\n}\n\n/**\n * Whether or not to send a Segment event.\n * We need to do this so we don't send duplicate events.\n * Duplicates are triggered whenever a localStorage change happens even when it's not changing a Segment value.\n */\nconst shouldSend = (payload: any) => {\n\tif (!Boolean(payload)) {\n\t\treturn false\n\t}\n\tlet hashMessage = ''\n\n\ttry {\n\t\thashMessage = JSON.stringify(payload)\n\t} catch {\n\t\treturn false\n\t}\n\n\tconst hashDigest = hashCode(hashMessage)\n\n\tconst lastSentHash = getItem(\n\t\tSESSION_STORAGE_KEYS.SEGMENT_LAST_SENT_HASH_KEY,\n\t)\n\n\tif (lastSentHash === undefined) {\n\t\tsetItem(SESSION_STORAGE_KEYS.SEGMENT_LAST_SENT_HASH_KEY, hashDigest)\n\t\treturn true\n\t}\n\n\tif (hashDigest !== lastSentHash) {\n\t\tsetItem(SESSION_STORAGE_KEYS.SEGMENT_LAST_SENT_HASH_KEY, hashDigest)\n\t\treturn true\n\t}\n\n\treturn false\n}\n\n/**\n * Returns a hash code for a string.\n * (Compatible to Java's String.hashCode())\n *\n * The hash code for a string object is computed as\n * s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]\n * using number arithmetic, where s[i] is the i th character\n * of the given string, n is the length of the string,\n * and ^ indicates exponentiation.\n * (The hash value of the empty string is zero.)\n *\n * @param {string} s a string\n * @return {number} a hash code value for the given string.\n */\nconst hashCode = (s: string) => {\n\tvar h = 0,\n\t\tl = s.length,\n\t\ti = 0\n\tif (l > 0) while (i < l) h = ((h << 5) - h + s.charCodeAt(i++)) | 0\n\n\treturn h.toString()\n}\n","type Node = {\n\tname: string\n\tpenalty: number\n\tlevel?: number\n}\n\ntype Path = Node[]\n\nenum Limit {\n\tAll,\n\tTwo,\n\tOne,\n}\n\nexport type Options = {\n\troot: Element\n\tidName: (name: string) => boolean\n\tclassName: (name: string) => boolean\n\ttagName: (name: string) => boolean\n\tattr: (name: string, value: string) => boolean\n\tseedMinLength: number\n\toptimizedMinLength: number\n\tthreshold: number\n\tmaxNumberOfTries: number\n\toptimized: boolean\n}\n\nlet config: Options\n\nlet rootDocument: Document | Element\n\n/**\n * Gets a CSS selector for a given element. Will default to the element's tag name if there are no class name or id.\n * Source: https://github.com/antonmedv/finder\n */\nexport function getElementSelector(input: Element, options?: Partial) {\n\tconst useOldLogic = true\n\tif (input.nodeType !== Node.ELEMENT_NODE || useOldLogic) {\n\t\treturn getElementSelectorFallback(input)\n\t}\n\n\treturn getElementSelectorNew(input, options)\n}\n\n/*\n * Create a simple selector string for the element using its id or class names if available.\n * Defaults to generic nodeName for the element if not.\n * This does not attempt to create the 'best' selector but should be used\n * when a general identified of an Element is necessary.\n */\nexport function getSimpleSelector(input: Element) {\n\tif (input.id.length) {\n\t\treturn `#${input.id}`\n\t} else if (input.classList.length) {\n\t\tlet classes = []\n\t\tfor (const c of input.classList) {\n\t\t\tclasses.push(`.${c}`)\n\t\t}\n\t\treturn `${input.nodeName.toLowerCase()}${classes.join(',')}`\n\t}\n\treturn input.nodeName.toLowerCase()\n}\n\nexport function getElementSelectorNew(\n\tinput: Element,\n\toptions?: Partial,\n) {\n\tif ('html' === input.tagName.toLowerCase()) {\n\t\treturn 'html'\n\t}\n\n\ttry {\n\t\tconst defaults: Options = {\n\t\t\troot: document.body,\n\t\t\tidName: (name: string) => true,\n\t\t\tclassName: (name: string) => true,\n\t\t\ttagName: (name: string) => true,\n\t\t\tattr: (name: string, value: string) => false,\n\t\t\tseedMinLength: 1,\n\t\t\toptimizedMinLength: 2,\n\t\t\tthreshold: 50,\n\t\t\tmaxNumberOfTries: 1000,\n\t\t\toptimized: true,\n\t\t}\n\n\t\tconfig = { ...defaults, ...options }\n\n\t\trootDocument = findRootDocument(config.root, defaults)\n\n\t\tlet path = bottomUpSearch(input, Limit.All, () =>\n\t\t\tbottomUpSearch(input, Limit.Two, () =>\n\t\t\t\tbottomUpSearch(input, Limit.One),\n\t\t\t),\n\t\t)\n\n\t\tif (path) {\n\t\t\tif (config.optimized) {\n\t\t\t\tconst optimized = sort(optimize(path, input))\n\n\t\t\t\tif (optimized.length > 0) {\n\t\t\t\t\tpath = optimized[0]\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn selector(path)\n\t\t} else {\n\t\t\treturn getElementSelectorFallback(input)\n\t\t}\n\t} catch {\n\t\treturn getElementSelectorFallback(input)\n\t}\n}\n\nfunction findRootDocument(rootNode: Element | Document, defaults: Options) {\n\tif (rootNode.nodeType === Node.DOCUMENT_NODE) {\n\t\treturn rootNode\n\t}\n\tif (rootNode === defaults.root) {\n\t\treturn rootNode.ownerDocument as Document\n\t}\n\treturn rootNode\n}\n\nfunction bottomUpSearch(\n\tinput: Element,\n\tlimit: Limit,\n\tfallback?: () => Path | null,\n): Path | null {\n\tlet path: Path | null = null\n\tlet stack: Node[][] = []\n\tlet current: Element | null = input\n\tlet i = 0\n\n\twhile (current && current !== config.root.parentElement) {\n\t\tlet level: Node[] = maybe(id(current)) ||\n\t\t\tmaybe(...attr(current)) ||\n\t\t\tmaybe(...classNames(current)) ||\n\t\t\tmaybe(tagName(current)) || [any()]\n\n\t\tconst nth = index(current)\n\n\t\tif (limit === Limit.All) {\n\t\t\tif (nth) {\n\t\t\t\tlevel = level.concat(\n\t\t\t\t\tlevel\n\t\t\t\t\t\t.filter(dispensableNth)\n\t\t\t\t\t\t.map((node) => nthChild(node, nth)),\n\t\t\t\t)\n\t\t\t}\n\t\t} else if (limit === Limit.Two) {\n\t\t\tlevel = level.slice(0, 1)\n\n\t\t\tif (nth) {\n\t\t\t\tlevel = level.concat(\n\t\t\t\t\tlevel\n\t\t\t\t\t\t.filter(dispensableNth)\n\t\t\t\t\t\t.map((node) => nthChild(node, nth)),\n\t\t\t\t)\n\t\t\t}\n\t\t} else if (limit === Limit.One) {\n\t\t\tconst [node] = (level = level.slice(0, 1))\n\n\t\t\tif (nth && dispensableNth(node)) {\n\t\t\t\tlevel = [nthChild(node, nth)]\n\t\t\t}\n\t\t}\n\n\t\tfor (let node of level) {\n\t\t\tnode.level = i\n\t\t}\n\n\t\tstack.push(level)\n\n\t\tif (stack.length >= config.seedMinLength) {\n\t\t\tpath = findUniquePath(stack, fallback)\n\t\t\tif (path) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tcurrent = current.parentElement\n\t\ti++\n\t}\n\n\tif (!path) {\n\t\tpath = findUniquePath(stack, fallback)\n\t}\n\n\treturn path\n}\n\nfunction findUniquePath(\n\tstack: Node[][],\n\tfallback?: () => Path | null,\n): Path | null {\n\tconst paths = sort(combinations(stack))\n\n\tif (paths.length > config.threshold) {\n\t\treturn fallback ? fallback() : null\n\t}\n\n\tfor (let candidate of paths) {\n\t\tif (unique(candidate)) {\n\t\t\treturn candidate\n\t\t}\n\t}\n\n\treturn null\n}\n\nfunction selector(path: Path): string {\n\tlet node = path[0]\n\tlet query = node.name\n\tfor (let i = 1; i < path.length; i++) {\n\t\tconst level = path[i].level || 0\n\n\t\tif (node.level === level - 1) {\n\t\t\tquery = `${path[i].name} > ${query}`\n\t\t} else {\n\t\t\tquery = `${path[i].name} ${query}`\n\t\t}\n\n\t\tnode = path[i]\n\t}\n\treturn query\n}\n\nfunction penalty(path: Path): number {\n\treturn path.map((node) => node.penalty).reduce((acc, i) => acc + i, 0)\n}\n\nfunction unique(path: Path) {\n\tswitch (rootDocument.querySelectorAll(selector(path)).length) {\n\t\tcase 0:\n\t\t\treturn true\n\t\tcase 1:\n\t\t\treturn true\n\t\tdefault:\n\t\t\treturn false\n\t}\n}\n\nfunction id(input: Element): Node | null {\n\tconst elementId = input.getAttribute('id')\n\tif (elementId && config.idName(elementId)) {\n\t\treturn {\n\t\t\tname: '#' + cssesc(elementId, { isIdentifier: true }),\n\t\t\tpenalty: 0,\n\t\t}\n\t}\n\treturn null\n}\n\nfunction attr(input: Element): Node[] {\n\tconst attrs = Array.from(input.attributes).filter((attr) =>\n\t\tconfig.attr(attr.name, attr.value),\n\t)\n\n\treturn attrs.map(\n\t\t(attr): Node => ({\n\t\t\tname:\n\t\t\t\t'[' +\n\t\t\t\tcssesc(attr.name, { isIdentifier: true }) +\n\t\t\t\t'=\"' +\n\t\t\t\tcssesc(attr.value) +\n\t\t\t\t'\"]',\n\t\t\tpenalty: 0.5,\n\t\t}),\n\t)\n}\n\nfunction classNames(input: Element): Node[] {\n\tconst names = Array.from(input.classList).filter(config.className)\n\n\treturn names.map(\n\t\t(name): Node => ({\n\t\t\tname: '.' + cssesc(name, { isIdentifier: true }),\n\t\t\tpenalty: 1,\n\t\t}),\n\t)\n}\n\nfunction tagName(input: Element): Node | null {\n\tconst name = input.tagName.toLowerCase()\n\tif (config.tagName(name)) {\n\t\treturn {\n\t\t\tname,\n\t\t\tpenalty: 2,\n\t\t}\n\t}\n\treturn null\n}\n\nfunction any(): Node {\n\treturn {\n\t\tname: '*',\n\t\tpenalty: 3,\n\t}\n}\n\nfunction index(input: Element): number | null {\n\tconst parent = input.parentNode\n\tif (!parent) {\n\t\treturn null\n\t}\n\n\tlet child = parent.firstChild\n\tif (!child) {\n\t\treturn null\n\t}\n\n\tlet i = 0\n\twhile (child) {\n\t\tif (child.nodeType === Node.ELEMENT_NODE) {\n\t\t\ti++\n\t\t}\n\n\t\tif (child === input) {\n\t\t\tbreak\n\t\t}\n\n\t\tchild = child.nextSibling\n\t}\n\n\treturn i\n}\n\nfunction nthChild(node: Node, i: number): Node {\n\treturn {\n\t\tname: node.name + `:nth-child(${i})`,\n\t\tpenalty: node.penalty + 1,\n\t}\n}\n\nfunction dispensableNth(node: Node) {\n\treturn node.name !== 'html' && !node.name.startsWith('#')\n}\n\nfunction maybe(...level: (Node | null)[]): Node[] | null {\n\tconst list = level.filter(notEmpty)\n\tif (list.length > 0) {\n\t\treturn list\n\t}\n\treturn null\n}\n\nfunction notEmpty(value: T | null | undefined): value is T {\n\treturn value !== null && value !== undefined\n}\n\nfunction* combinations(stack: Node[][], path: Node[] = []): Generator {\n\tif (stack.length > 0) {\n\t\tfor (let node of stack[0]) {\n\t\t\tyield* combinations(stack.slice(1, stack.length), path.concat(node))\n\t\t}\n\t} else {\n\t\tyield path\n\t}\n}\n\nfunction sort(paths: Iterable): Path[] {\n\treturn Array.from(paths).sort((a, b) => penalty(a) - penalty(b))\n}\n\ntype Scope = {\n\tcounter: number\n\tvisited: Map\n}\n\nfunction* optimize(\n\tpath: Path,\n\tinput: Element,\n\tscope: Scope = {\n\t\tcounter: 0,\n\t\tvisited: new Map(),\n\t},\n): Generator {\n\tif (path.length > 2 && path.length > config.optimizedMinLength) {\n\t\tfor (let i = 1; i < path.length - 1; i++) {\n\t\t\tif (scope.counter > config.maxNumberOfTries) {\n\t\t\t\treturn // Okay At least I tried!\n\t\t\t}\n\t\t\tscope.counter += 1\n\t\t\tconst newPath = [...path]\n\t\t\tnewPath.splice(i, 1)\n\t\t\tconst newPathKey = selector(newPath)\n\t\t\tif (scope.visited.has(newPathKey)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (unique(newPath) && same(newPath, input)) {\n\t\t\t\tyield newPath\n\t\t\t\tscope.visited.set(newPathKey, true)\n\t\t\t\tyield* optimize(newPath, input, scope)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction same(path: Path, input: Element) {\n\treturn rootDocument.querySelector(selector(path)) === input\n}\n\nconst regexAnySingleEscape = /[ -,\\.\\/:-@\\[-\\^`\\{-~]/\nconst regexSingleEscape = /[ -,\\.\\/:-@\\[\\]\\^`\\{-~]/\nconst regexExcessiveSpaces = /(^|\\\\+)?(\\\\[A-F0-9]{1,6})\\x20(?![a-fA-F0-9\\x20])/g\n\nconst defaultOptions = {\n\tescapeEverything: false,\n\tisIdentifier: false,\n\tquotes: 'single',\n\twrap: false,\n}\n\nfunction cssesc(string: string, opt: Partial = {}) {\n\tconst options = { ...defaultOptions, ...opt }\n\tif (options.quotes != 'single' && options.quotes != 'double') {\n\t\toptions.quotes = 'single'\n\t}\n\tconst quote = options.quotes == 'double' ? '\"' : \"'\"\n\tconst isIdentifier = options.isIdentifier\n\n\tconst firstChar = string.charAt(0)\n\tlet output = ''\n\tlet counter = 0\n\tconst length = string.length\n\twhile (counter < length) {\n\t\tconst character = string.charAt(counter++)\n\t\tlet codePoint = character.charCodeAt(0)\n\t\tlet value: string | undefined = void 0\n\t\t// If it’s not a printable ASCII character…\n\t\tif (codePoint < 0x20 || codePoint > 0x7e) {\n\t\t\tif (\n\t\t\t\tcodePoint >= 0xd800 &&\n\t\t\t\tcodePoint <= 0xdbff &&\n\t\t\t\tcounter < length\n\t\t\t) {\n\t\t\t\t// It’s a high surrogate, and there is a next character.\n\t\t\t\tconst extra = string.charCodeAt(counter++)\n\t\t\t\tif ((extra & 0xfc00) == 0xdc00) {\n\t\t\t\t\t// next character is low surrogate\n\t\t\t\t\tcodePoint =\n\t\t\t\t\t\t((codePoint & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000\n\t\t\t\t} else {\n\t\t\t\t\t// It’s an unmatched surrogate; only append this code unit, in case\n\t\t\t\t\t// the next code unit is the high surrogate of a surrogate pair.\n\t\t\t\t\tcounter--\n\t\t\t\t}\n\t\t\t}\n\t\t\tvalue = '\\\\' + codePoint.toString(16).toUpperCase() + ' '\n\t\t} else {\n\t\t\tif (options.escapeEverything) {\n\t\t\t\tif (regexAnySingleEscape.test(character)) {\n\t\t\t\t\tvalue = '\\\\' + character\n\t\t\t\t} else {\n\t\t\t\t\tvalue = '\\\\' + codePoint.toString(16).toUpperCase() + ' '\n\t\t\t\t}\n\t\t\t} else if (/[\\t\\n\\f\\r\\x0B]/.test(character)) {\n\t\t\t\tvalue = '\\\\' + codePoint.toString(16).toUpperCase() + ' '\n\t\t\t} else if (\n\t\t\t\tcharacter == '\\\\' ||\n\t\t\t\t(!isIdentifier &&\n\t\t\t\t\t((character == '\"' && quote == character) ||\n\t\t\t\t\t\t(character == \"'\" && quote == character))) ||\n\t\t\t\t(isIdentifier && regexSingleEscape.test(character))\n\t\t\t) {\n\t\t\t\tvalue = '\\\\' + character\n\t\t\t} else {\n\t\t\t\tvalue = character\n\t\t\t}\n\t\t}\n\t\toutput += value\n\t}\n\n\tif (isIdentifier) {\n\t\tif (/^-[-\\d]/.test(output)) {\n\t\t\toutput = '\\\\-' + output.slice(1)\n\t\t} else if (/\\d/.test(firstChar)) {\n\t\t\toutput = '\\\\3' + firstChar + ' ' + output.slice(1)\n\t\t}\n\t}\n\n\t// Remove spaces after `\\HEX` escapes that are not followed by a hex digit,\n\t// since they’re redundant. Note that this is only possible if the escape\n\t// sequence isn’t preceded by an odd number of backslashes.\n\toutput = output.replace(regexExcessiveSpaces, function ($0, $1, $2) {\n\t\tif ($1 && $1.length % 2) {\n\t\t\t// It’s not safe to remove the space, so don’t.\n\t\t\treturn $0\n\t\t}\n\t\t// Strip the space.\n\t\treturn ($1 || '') + $2\n\t})\n\n\tif (!isIdentifier && options.wrap) {\n\t\treturn quote + output + quote\n\t}\n\treturn output\n}\n\nconst getElementSelectorFallback = (element: Element) => {\n\tlet selector = ''\n\tconst classNames = element.getAttribute('class')\n\tconst ids = element.getAttribute('id')\n\n\tif (ids) {\n\t\tselector = selector.concat(getSelectorString(ids, '#'))\n\t}\n\tif (classNames) {\n\t\tselector = selector.concat(getSelectorString(classNames, '.'))\n\t}\n\n\t// Default to the element's tag if the element doesn't have ids or class names.\n\tif (selector === '') {\n\t\tselector = selector.concat(element.tagName.toLowerCase())\n\t}\n\n\treturn selector\n}\n\nconst getSelectorString = (selector: string, delimiter: string) => {\n\treturn `${delimiter}${selector.trim().split(' ').join(delimiter)}`\n}\n","const SessionShortcutListener = (\n\tshortcutString: string,\n\tcallback: () => void,\n) => {\n\tconst keys = getKeys(shortcutString)\n\tlet mods = []\n\tconst keyup = false\n\tconst keydown = true\n\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tlet key: any = keys[i].split('+')\n\t\tmods = []\n\n\t\tif (key.length > 1) mods = getMods(_modifier, key)\n\n\t\tkey = key[key.length - 1]\n\t\tkey = key === '*' ? '*' : code(key)\n\n\t\t// @ts-expect-error\n\t\tif (!(key in handlers)) handlers[key] = []\n\t\t// @ts-expect-error\n\t\thandlers[key].push({\n\t\t\tmods,\n\t\t\tshortcut: keys[i],\n\t\t\tkey: keys[i],\n\t\t\tmethod: callback,\n\t\t\tkeyup,\n\t\t\tkeydown,\n\t\t\tscope: 'all',\n\t\t\tsplitKey: '+',\n\t\t})\n\t}\n\taddEvent(document, 'keydown', (e: any) => {\n\t\tdispatch(e)\n\t})\n}\n\nexport default SessionShortcutListener\n\n// @ts-expect-error\nlet _downKeys = []\n\nfunction getKeys(key: string) {\n\tif (typeof key !== 'string') key = ''\n\tkey = key.replace(/\\s/g, '')\n\tconst keys = key.split(',')\n\tlet index = keys.lastIndexOf('')\n\n\tfor (; index >= 0; ) {\n\t\tkeys[index - 1] += ','\n\t\tkeys.splice(index, 1)\n\t\tindex = keys.lastIndexOf('')\n\t}\n\n\treturn keys\n}\n\nconst handlers = {}\n\nconst isff =\n\ttypeof navigator !== 'undefined'\n\t\t? navigator.userAgent.toLowerCase().indexOf('firefox') > 0\n\t\t: false\n\nconst _keyMap = {\n\tbackspace: 8,\n\ttab: 9,\n\tclear: 12,\n\tenter: 13,\n\treturn: 13,\n\tesc: 27,\n\tescape: 27,\n\tspace: 32,\n\tleft: 37,\n\tup: 38,\n\tright: 39,\n\tdown: 40,\n\tdel: 46,\n\tdelete: 46,\n\tins: 45,\n\tinsert: 45,\n\thome: 36,\n\tend: 35,\n\tpageup: 33,\n\tpagedown: 34,\n\tcapslock: 20,\n\tnum_0: 96,\n\tnum_1: 97,\n\tnum_2: 98,\n\tnum_3: 99,\n\tnum_4: 100,\n\tnum_5: 101,\n\tnum_6: 102,\n\tnum_7: 103,\n\tnum_8: 104,\n\tnum_9: 105,\n\tnum_multiply: 106,\n\tnum_add: 107,\n\tnum_enter: 108,\n\tnum_subtract: 109,\n\tnum_decimal: 110,\n\tnum_divide: 111,\n\t'⇪': 20,\n\t',': 188,\n\t'.': 190,\n\t'/': 191,\n\t'`': 192,\n\t'-': isff ? 173 : 189,\n\t'=': isff ? 61 : 187,\n\t';': isff ? 59 : 186,\n\t\"'\": 222,\n\t'[': 219,\n\t']': 221,\n\t'\\\\': 220,\n}\n\nconst modifierMap = {\n\t16: 'shiftKey',\n\t18: 'altKey',\n\t17: 'ctrlKey',\n\t91: 'metaKey',\n\n\tshiftKey: 16,\n\tctrlKey: 17,\n\taltKey: 18,\n\tmetaKey: 91,\n}\n\nconst _mods = {\n\t16: false,\n\t18: false,\n\t17: false,\n\t91: false,\n}\n\n// Modifier Keys\nconst _modifier = {\n\t// shiftKey\n\t'⇧': 16,\n\tshift: 16,\n\t// altKey\n\t'⌥': 18,\n\talt: 18,\n\toption: 18,\n\t// ctrlKey\n\t'⌃': 17,\n\tctrl: 17,\n\tcontrol: 17,\n\t// metaKey\n\t'⌘': 91,\n\tcmd: 91,\n\tcommand: 91,\n}\n\nconst code = (x: string) =>\n\t// @ts-expect-error\n\t_keyMap[x.toLowerCase()] ||\n\t// @ts-expect-error\n\t_modifier[x.toLowerCase()] ||\n\tx.toUpperCase().charCodeAt(0)\n\nfunction getMods(modifier: any, key: any) {\n\tconst mods = key.slice(0, key.length - 1)\n\tfor (let i = 0; i < mods.length; i++)\n\t\tmods[i] = modifier[mods[i].toLowerCase()]\n\treturn mods\n}\n\n// @ts-expect-error\nfunction addEvent(object, event, method) {\n\tif (object.addEventListener) {\n\t\tobject.addEventListener(event, method, false)\n\t} else if (object.attachEvent) {\n\t\tobject.attachEvent(`on${event}`, () => {\n\t\t\tmethod(window.event)\n\t\t})\n\t}\n}\n\n// @ts-expect-error\nfunction eventHandler(event, handler, scope) {\n\tlet modifiersMatch\n\n\tif (handler.scope === scope || handler.scope === 'all') {\n\t\tmodifiersMatch = handler.mods.length > 0\n\n\t\tfor (const y in _mods) {\n\t\t\tif (Object.prototype.hasOwnProperty.call(_mods, y)) {\n\t\t\t\tif (\n\t\t\t\t\t// @ts-expect-error\n\t\t\t\t\t(!_mods[y] && handler.mods.indexOf(+y) > -1) ||\n\t\t\t\t\t// @ts-expect-error\n\t\t\t\t\t(_mods[y] && handler.mods.indexOf(+y) === -1)\n\t\t\t\t) {\n\t\t\t\t\tmodifiersMatch = false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\t(handler.mods.length === 0 &&\n\t\t\t\t!_mods[16] &&\n\t\t\t\t!_mods[18] &&\n\t\t\t\t!_mods[17] &&\n\t\t\t\t!_mods[91]) ||\n\t\t\tmodifiersMatch ||\n\t\t\thandler.shortcut === '*'\n\t\t) {\n\t\t\tif (handler.method(event, handler) === false) {\n\t\t\t\tif (event.preventDefault) event.preventDefault()\n\t\t\t\telse event.returnValue = false\n\t\t\t\tif (event.stopPropagation) event.stopPropagation()\n\t\t\t\tif (event.cancelBubble) event.cancelBubble = true\n\t\t\t}\n\t\t}\n\t}\n}\n\n// @ts-expect-error\nfunction dispatch(event) {\n\t// @ts-expect-error\n\tconst asterisk = handlers['*']\n\tlet key = event.keyCode || event.which || event.charCode\n\n\tif (key === 93 || key === 224) key = 91\n\n\t/**\n\t * Collect bound keys\n\t * If an Input Method Editor is processing key input and the event is keydown, return 229.\n\t * https://stackoverflow.com/questions/25043934/is-it-ok-to-ignore-keydown-events-with-keycode-229\n\t * http://lists.w3.org/Archives/Public/www-dom/2010JulSep/att-0182/keyCode-spec.html\n\t */\n\t// @ts-expect-error\n\tif (_downKeys.indexOf(key) === -1 && key !== 229)\n\t\t_downKeys.push(key)\n\t\t/**\n\t\t * Jest test cases are required.\n\t\t * ===============================\n\t\t */\n\t;['ctrlKey', 'altKey', 'shiftKey', 'metaKey'].forEach((keyName) => {\n\t\t// @ts-expect-error\n\t\tconst keyNum = modifierMap[keyName]\n\t\t// @ts-expect-error\n\t\tif (event[keyName] && _downKeys.indexOf(keyNum) === -1) {\n\t\t\t_downKeys.push(keyNum)\n\t\t\t// @ts-expect-error\n\t\t} else if (!event[keyName] && _downKeys.indexOf(keyNum) > -1) {\n\t\t\t// @ts-expect-error\n\t\t\t_downKeys.splice(_downKeys.indexOf(keyNum), 1)\n\t\t} else if (\n\t\t\tkeyName === 'metaKey' &&\n\t\t\tevent[keyName] &&\n\t\t\t_downKeys.length === 3\n\t\t) {\n\t\t\t/**\n\t\t\t * Fix if Command is pressed:\n\t\t\t * ===============================\n\t\t\t */\n\t\t\tif (!(event.ctrlKey || event.shiftKey || event.altKey)) {\n\t\t\t\t// @ts-expect-error\n\t\t\t\t_downKeys = _downKeys.slice(_downKeys.indexOf(keyNum))\n\t\t\t}\n\t\t}\n\t})\n\n\tif (key in _mods) {\n\t\t// @ts-expect-error\n\t\t_mods[key] = true\n\n\t\tif (!asterisk) return\n\t}\n\n\tfor (const e in _mods) {\n\t\tif (Object.prototype.hasOwnProperty.call(_mods, e)) {\n\t\t\t// @ts-expect-error\n\t\t\t_mods[e] = event[modifierMap[e]]\n\t\t}\n\t}\n\t/**\n\t * https://github.com/jaywcjlove/hotkeys/pull/129\n\t * This solves the issue in Firefox on Windows where hotkeys corresponding to special characters would not trigger.\n\t * An example of this is ctrl+alt+m on a Swedish keyboard which is used to type μ.\n\t * Browser support: https://caniuse.com/#feat=keyboardevent-getmodifierstate\n\t */\n\tif (\n\t\tevent.getModifierState &&\n\t\t!(event.altKey && !event.ctrlKey) &&\n\t\tevent.getModifierState('AltGraph')\n\t) {\n\t\t// @ts-expect-error\n\t\tif (_downKeys.indexOf(17) === -1) {\n\t\t\t_downKeys.push(17)\n\t\t}\n\n\t\t// @ts-expect-error\n\t\tif (_downKeys.indexOf(18) === -1) {\n\t\t\t_downKeys.push(18)\n\t\t}\n\n\t\t_mods[17] = true\n\t\t_mods[18] = true\n\t}\n\n\tif (!(key in handlers)) return\n\n\t// @ts-expect-error\n\tfor (let i = 0; i < handlers[key].length; i++) {\n\t\tif (\n\t\t\t// @ts-expect-error\n\t\t\t(event.type === 'keydown' && handlers[key][i].keydown) ||\n\t\t\t// @ts-expect-error\n\t\t\t(event.type === 'keyup' && handlers[key][i].keyup)\n\t\t) {\n\t\t\t// @ts-expect-error\n\t\t\tif (handlers[key][i].key) {\n\t\t\t\t// @ts-expect-error\n\t\t\t\tconst record = handlers[key][i]\n\n\t\t\t\teventHandler(event, record, 'all')\n\t\t\t}\n\t\t}\n\t}\n}\n","var e,n,t,r,i,a=-1,o=function(e){addEventListener(\"pageshow\",(function(n){n.persisted&&(a=n.timeStamp,e(n))}),!0)},c=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType(\"navigation\")[0]},u=function(){var e=c();return e&&e.activationStart||0},f=function(e,n){var t=c(),r=\"navigate\";a>=0?r=\"back-forward-cache\":t&&(document.prerendering||u()>0?r=\"prerender\":document.wasDiscarded?r=\"restore\":t.type&&(r=t.type.replace(/_/g,\"-\")));return{name:e,value:void 0===n?-1:n,rating:\"good\",delta:0,entries:[],id:\"v3-\".concat(Date.now(),\"-\").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},s=function(e,n,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){n(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},t||{})),r}}catch(e){}},d=function(e,n,t,r){var i,a;return function(o){n.value>=0&&(o||r)&&((a=n.value-(i||0))||void 0===i)&&(i=n.value,n.delta=a,n.rating=function(e,n){return e>n[1]?\"poor\":e>n[0]?\"needs-improvement\":\"good\"}(n.value,t),e(n))}},l=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},p=function(e){var n=function(n){\"pagehide\"!==n.type&&\"hidden\"!==document.visibilityState||e(n)};addEventListener(\"visibilitychange\",n,!0),addEventListener(\"pagehide\",n,!0)},v=function(e){var n=!1;return function(t){n||(e(t),n=!0)}},m=-1,h=function(){return\"hidden\"!==document.visibilityState||document.prerendering?1/0:0},g=function(e){\"hidden\"===document.visibilityState&&m>-1&&(m=\"visibilitychange\"===e.type?e.timeStamp:0,T())},y=function(){addEventListener(\"visibilitychange\",g,!0),addEventListener(\"prerenderingchange\",g,!0)},T=function(){removeEventListener(\"visibilitychange\",g,!0),removeEventListener(\"prerenderingchange\",g,!0)},E=function(){return m<0&&(m=h(),y(),o((function(){setTimeout((function(){m=h(),y()}),0)}))),{get firstHiddenTime(){return m}}},C=function(e){document.prerendering?addEventListener(\"prerenderingchange\",(function(){return e()}),!0):e()},L=[1800,3e3],b=function(e,n){n=n||{},C((function(){var t,r=E(),i=f(\"FCP\"),a=s(\"paint\",(function(e){e.forEach((function(e){\"first-contentful-paint\"===e.name&&(a.disconnect(),e.startTimer.value&&(r.value=i,r.entries=a,t())},u=s(\"layout-shift\",c);u&&(t=d(e,r,w,n.reportAllChanges),p((function(){c(u.takeRecords()),t(!0)})),o((function(){i=0,r=f(\"CLS\",0),t=d(e,r,w,n.reportAllChanges),l((function(){return t()}))})),setTimeout(t,0))})))},A={passive:!0,capture:!0},I=new Date,P=function(r,i){e||(e=i,n=r,t=new Date,k(removeEventListener),F())},F=function(){if(n>=0&&n1e12?new Date:performance.now())-e.timeStamp;\"pointerdown\"==e.type?function(e,n){var t=function(){P(e,n),i()},r=function(){i()},i=function(){removeEventListener(\"pointerup\",t,A),removeEventListener(\"pointercancel\",r,A)};addEventListener(\"pointerup\",t,A),addEventListener(\"pointercancel\",r,A)}(n,e):P(n,e)}},k=function(e){[\"mousedown\",\"keydown\",\"touchstart\",\"pointerdown\"].forEach((function(n){return e(n,M,A)}))},D=[100,300],x=function(t,i){i=i||{},C((function(){var a,c=E(),u=f(\"FID\"),l=function(e){e.startTimen.latency){if(t)t.entries.push(e),t.latency=Math.max(t.latency,e.duration);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};J[r.id]=r,G.push(r)}G.sort((function(e,n){return n.latency-e.latency})),G.splice(10).forEach((function(e){delete J[e.id]}))}},Q=function(e,n){n=n||{},C((function(){var t;q();var r,i=f(\"INP\"),a=function(e){e.forEach((function(e){(e.interactionId&&K(e),\"first-input\"===e.entryType)&&(!G.some((function(n){return n.entries.some((function(n){return e.duration===n.duration&&e.startTime===n.startTime}))}))&&K(e))}));var n,t=(n=Math.min(G.length-1,Math.floor(z()/50)),G[n]);t&&t.latency!==i.value&&(i.value=t.latency,i.entries=t.entries,r())},c=s(\"event\",a,{durationThreshold:null!==(t=n.durationThreshold)&&void 0!==t?t:40});r=d(e,i,j,n.reportAllChanges),c&&(\"interactionId\"in PerformanceEventTiming.prototype&&c.observe({type:\"first-input\",buffered:!0}),p((function(){a(c.takeRecords()),i.value<0&&z()>0&&(i.value=0,i.entries=[]),r(!0)})),o((function(){G=[],_=O(),i=f(\"INP\"),r=d(e,i,j,n.reportAllChanges)})))}))},U=[2500,4e3],V={},W=function(e,n){n=n||{},C((function(){var t,r=E(),i=f(\"LCP\"),a=function(e){var n=e[e.length-1];n&&n.startTimeperformance.now())return;t.value=Math.max(a-u(),0),t.entries=[i],r(!0),o((function(){t=f(\"TTFB\",0),(r=d(e,t,X,n.reportAllChanges))(!0)}))}}))};export{w as CLSThresholds,L as FCPThresholds,D as FIDThresholds,j as INPThresholds,U as LCPThresholds,X as TTFBThresholds,S as getCLS,b as getFCP,x as getFID,Q as getINP,W as getLCP,Z as getTTFB,S as onCLS,b as onFCP,x as onFID,Q as onINP,W as onLCP,Z as onTTFB};\n","export type Maybe = T | null\nexport type InputMaybe = Maybe\nexport type Exact = {\n\t[K in keyof T]: T[K]\n}\nexport type MakeOptional = Omit & {\n\t[SubKey in K]?: Maybe\n}\nexport type MakeMaybe = Omit & {\n\t[SubKey in K]: Maybe\n}\nexport type MakeEmpty<\n\tT extends { [key: string]: unknown },\n\tK extends keyof T,\n> = { [_ in K]?: never }\nexport type Incremental =\n\t| T\n\t| {\n\t\t\t[P in keyof T]?: P extends ' $fragmentName' | '__typename'\n\t\t\t\t? T[P]\n\t\t\t\t: never\n\t }\n/** All built-in and custom scalars, mapped to their actual values */\nexport type Scalars = {\n\tID: { input: string; output: string }\n\tString: { input: string; output: string }\n\tBoolean: { input: boolean; output: boolean }\n\tInt: { input: number; output: number }\n\tFloat: { input: number; output: number }\n\tAny: { input: any; output: any }\n\tInt64: { input: any; output: any }\n\tTimestamp: { input: any; output: any }\n}\n\nexport type BackendErrorObjectInput = {\n\tenvironment: Scalars['String']['input']\n\tevent: Scalars['String']['input']\n\tlog_cursor?: InputMaybe\n\tpayload?: InputMaybe\n\trequest_id?: InputMaybe\n\tservice: ServiceInput\n\tsession_secure_id?: InputMaybe\n\tsource: Scalars['String']['input']\n\tspan_id?: InputMaybe\n\tstackTrace: Scalars['String']['input']\n\ttimestamp: Scalars['Timestamp']['input']\n\ttrace_id?: InputMaybe\n\ttype: Scalars['String']['input']\n\turl: Scalars['String']['input']\n}\n\nexport type ErrorObjectInput = {\n\tcolumnNumber: Scalars['Int']['input']\n\tevent: Scalars['String']['input']\n\tlineNumber: Scalars['Int']['input']\n\tpayload?: InputMaybe\n\tsource: Scalars['String']['input']\n\tstackTrace: Array>\n\ttimestamp: Scalars['Timestamp']['input']\n\ttype: Scalars['String']['input']\n\turl: Scalars['String']['input']\n}\n\nexport type InitializeSessionResponse = {\n\t__typename?: 'InitializeSessionResponse'\n\tproject_id: Scalars['ID']['output']\n\tsecure_id: Scalars['String']['output']\n}\n\nexport type MetricInput = {\n\tcategory?: InputMaybe\n\tgroup?: InputMaybe\n\tname: Scalars['String']['input']\n\tparent_span_id?: InputMaybe\n\tsession_secure_id: Scalars['String']['input']\n\tspan_id?: InputMaybe\n\ttags?: InputMaybe>\n\ttimestamp: Scalars['Timestamp']['input']\n\ttrace_id?: InputMaybe\n\tvalue: Scalars['Float']['input']\n}\n\nexport type MetricTag = {\n\tname: Scalars['String']['input']\n\tvalue: Scalars['String']['input']\n}\n\nexport type Mutation = {\n\t__typename?: 'Mutation'\n\taddSessionFeedback: Scalars['String']['output']\n\taddSessionProperties: Scalars['String']['output']\n\tidentifySession: Scalars['String']['output']\n\tinitializeSession: InitializeSessionResponse\n\tmarkBackendSetup?: Maybe\n\tpushBackendPayload?: Maybe\n\tpushMetrics: Scalars['Int']['output']\n\tpushPayload: Scalars['Int']['output']\n\tpushPayloadCompressed?: Maybe\n}\n\nexport type MutationAddSessionFeedbackArgs = {\n\tsession_secure_id: Scalars['String']['input']\n\ttimestamp: Scalars['Timestamp']['input']\n\tuser_email?: InputMaybe\n\tuser_name?: InputMaybe\n\tverbatim: Scalars['String']['input']\n}\n\nexport type MutationAddSessionPropertiesArgs = {\n\tproperties_object?: InputMaybe\n\tsession_secure_id: Scalars['String']['input']\n}\n\nexport type MutationIdentifySessionArgs = {\n\tsession_secure_id: Scalars['String']['input']\n\tuser_identifier: Scalars['String']['input']\n\tuser_object?: InputMaybe\n}\n\nexport type MutationInitializeSessionArgs = {\n\tappVersion?: InputMaybe\n\tclientConfig: Scalars['String']['input']\n\tclientVersion: Scalars['String']['input']\n\tclient_id: Scalars['String']['input']\n\tdisable_session_recording?: InputMaybe\n\tenable_recording_network_contents: Scalars['Boolean']['input']\n\tenable_strict_privacy: Scalars['Boolean']['input']\n\tenvironment: Scalars['String']['input']\n\tfingerprint: Scalars['String']['input']\n\tfirstloadVersion: Scalars['String']['input']\n\tnetwork_recording_domains?: InputMaybe>\n\torganization_verbose_id: Scalars['String']['input']\n\tprivacy_setting?: InputMaybe\n\tserviceName?: InputMaybe\n\tsession_secure_id: Scalars['String']['input']\n}\n\nexport type MutationMarkBackendSetupArgs = {\n\tproject_id?: InputMaybe\n\tsession_secure_id?: InputMaybe\n\ttype?: InputMaybe\n}\n\nexport type MutationPushBackendPayloadArgs = {\n\terrors: Array>\n\tproject_id?: InputMaybe\n}\n\nexport type MutationPushMetricsArgs = {\n\tmetrics: Array>\n}\n\nexport type MutationPushPayloadArgs = {\n\terrors: Array>\n\tevents: ReplayEventsInput\n\thas_session_unloaded?: InputMaybe\n\thighlight_logs?: InputMaybe\n\tis_beacon?: InputMaybe\n\tmessages: Scalars['String']['input']\n\tpayload_id?: InputMaybe\n\tresources: Scalars['String']['input']\n\tsession_secure_id: Scalars['String']['input']\n\tweb_socket_events?: InputMaybe\n}\n\nexport type MutationPushPayloadCompressedArgs = {\n\tdata: Scalars['String']['input']\n\tpayload_id: Scalars['ID']['input']\n\tsession_secure_id: Scalars['String']['input']\n}\n\nexport enum PublicGraphError {\n\tBillingQuotaExceeded = 'BillingQuotaExceeded',\n}\n\nexport type Query = {\n\t__typename?: 'Query'\n\tignore?: Maybe\n}\n\nexport type QueryIgnoreArgs = {\n\tid: Scalars['ID']['input']\n}\n\nexport type ReplayEventInput = {\n\t_sid: Scalars['Float']['input']\n\tdata: Scalars['Any']['input']\n\ttimestamp: Scalars['Float']['input']\n\ttype: Scalars['Int']['input']\n}\n\nexport type ReplayEventsInput = {\n\tevents: Array>\n}\n\nexport type ServiceInput = {\n\tname: Scalars['String']['input']\n\tversion: Scalars['String']['input']\n}\n\nexport type Session = {\n\t__typename?: 'Session'\n\tid?: Maybe\n\torganization_id: Scalars['ID']['output']\n\tproject_id: Scalars['ID']['output']\n\tsecure_id: Scalars['String']['output']\n}\n\nexport type StackFrameInput = {\n\targs?: InputMaybe>>\n\tcolumnNumber?: InputMaybe\n\tfileName?: InputMaybe\n\tfunctionName?: InputMaybe\n\tisEval?: InputMaybe\n\tisNative?: InputMaybe\n\tlineNumber?: InputMaybe\n\tsource?: InputMaybe\n}\n","import { onCLS, onFCP, onFID, onLCP, onTTFB, onINP, Metric } from 'web-vitals'\n\nexport const WebVitalsListener = (callback: (metric: Metric) => void) => {\n\tonCLS(callback)\n\tonFCP(callback)\n\tonFID(callback)\n\tonLCP(callback)\n\tonTTFB(callback)\n\tonINP(callback)\n\n\treturn () => {}\n}\n","interface PerformanceMethods {\n\t/**\n\t * Returns data that doesn't change during the session.\n\t */\n\tgetDeviceDetails?: () => {\n\t\tdeviceMemory: number\n\t}\n\t/**\n\t * Returns data that can change during the session.\n\t */\n\tgetCurrentDeviceDetails?: () => {\n\t\tjsHeapSizeLimit: number\n\t\ttotalJSHeapSize: number\n\t\tusedJSHeapSize: number\n\t}\n}\n\nexport const getPerformanceMethods = (): PerformanceMethods => {\n\t// Some browsers don't support the performance API.\n\tif (!('performance' in window && 'memory' in performance)) {\n\t\treturn {\n\t\t\tgetDeviceDetails: undefined,\n\t\t\tgetCurrentDeviceDetails: undefined,\n\t\t}\n\t}\n\n\tconst performanceAPI = window.performance as any\n\n\tconst getDeviceDetails = () => {\n\t\t/**\n\t\t * How much RAM that device has.\n\t\t */\n\t\tconst deviceMemory = gigabytesToMegabytes(\n\t\t\t(navigator as any).deviceMemory || 0,\n\t\t)\n\n\t\treturn {\n\t\t\tdeviceMemory,\n\t\t}\n\t}\n\n\tconst getCurrentDeviceDetails = () => {\n\t\t/**\n\t\t * The amount of memory that the OS/browser allows the tab to ask for.\n\t\t */\n\t\tconst jsHeapSizeLimit = bytesToMegabytes(\n\t\t\tperformanceAPI.memory.jsHeapSizeLimit,\n\t\t)\n\t\t/**\n\t\t * The total amount of memory the tab as allocated.\n\t\t */\n\t\tconst totalJSHeapSize = bytesToMegabytes(\n\t\t\tperformanceAPI.memory.totalJSHeapSize,\n\t\t)\n\t\t/**\n\t\t * The total amount of memory actually used.\n\t\t *\n\t\t * Heap Size Limit: The max amount of memory that can be allocated.\n\t\t * Allocated memory: Memory that the tab can use.\n\t\t */\n\t\tconst usedJSHeapSize = bytesToMegabytes(\n\t\t\tperformanceAPI.memory.usedJSHeapSize,\n\t\t)\n\n\t\treturn {\n\t\t\tjsHeapSizeLimit,\n\t\t\ttotalJSHeapSize,\n\t\t\tusedJSHeapSize,\n\t\t}\n\t}\n\n\treturn {\n\t\tgetDeviceDetails,\n\t\tgetCurrentDeviceDetails,\n\t}\n}\n\nconst bytesToMegabytes = (bytes: number) => {\n\treturn bytes / Math.pow(1000, 2)\n}\n\nconst gigabytesToMegabytes = (gigabytes: number) => {\n\treturn 1024 * gigabytes\n}\n","const IN_BROWSER = !(typeof window === 'undefined')\n\ntype Perf = {\n\tmemory: PerformancePayload\n}\n\nexport interface PerformancePayload {\n\ttotalJSHeapSize?: number\n\tusedJSHeapSize?: number\n\tjsHeapSizeLimit?: number\n\tfps?: number\n\t/** Timestamp relative to the current session. If a measurement was taking 5 seconds into the session, then the timestamp will be 5. */\n\trelativeTimestamp: number\n}\n\nconst perf: Perf =\n\tIN_BROWSER && 'performance' in window && 'memory' in performance // works in Chrome only\n\t\t? (performance as any)\n\t\t: { memory: {} }\n\nexport const PerformanceListener = (\n\tcallback: (payload: PerformancePayload) => void,\n\trecordingStartTime: number,\n) => {\n\tlet latestFPSValue = 0\n\tlet requestAnimationFrameId = 0\n\n\tconst memoryWorker = () => {\n\t\tconst now = new Date().getTime()\n\t\tconst relativeTimestamp = (now - recordingStartTime) / 1000\n\t\tconst jsHeapSizeLimit = perf.memory.jsHeapSizeLimit || 0\n\t\tconst usedJSHeapSize = perf.memory.usedJSHeapSize || 0\n\t\tcallback({\n\t\t\tjsHeapSizeLimit,\n\t\t\tusedJSHeapSize,\n\t\t\trelativeTimestamp,\n\t\t\tfps: latestFPSValue,\n\t\t})\n\t}\n\n\tmemoryWorker()\n\n\tlet intervalId: number | undefined = undefined\n\tintervalId = setInterval(() => {\n\t\tmemoryWorker()\n\t}, 1000 * 5) as unknown as number\n\n\tlet frameCount = 0\n\tlet lastTime = Date.now()\n\n\tconst frameRateWorker = function () {\n\t\tvar now = Date.now()\n\t\tframeCount++\n\n\t\tif (now > 1000 + lastTime) {\n\t\t\tconst FPS = Math.round((frameCount * 1000) / (now - lastTime))\n\t\t\tlatestFPSValue = FPS\n\t\t\tframeCount = 0\n\t\t\tlastTime = now\n\t\t}\n\n\t\trequestAnimationFrameId = requestAnimationFrame(frameRateWorker)\n\t}\n\n\tframeRateWorker()\n\n\treturn () => {\n\t\tclearInterval(intervalId)\n\t\tcancelAnimationFrame(requestAnimationFrameId)\n\t}\n}\n","import { getItem, setItem } from './storage'\n\nconst HIGHLIGHT_LOGS_KEY = 'highlightLogs'\n\n// Logs emitted from the highlight SDK itself. Use extremely sparingly!\n// These will persist across sessions until they have been successfully uploaded\n// (which is important for debugging issues related to poor network).\n// Logs are newline delimited, so do not put newlines in your logtext.\nexport const logForHighlight = (logText: string) => {\n\tlet highlightLogs = getItem(HIGHLIGHT_LOGS_KEY) || ''\n\thighlightLogs =\n\t\thighlightLogs + '[' + new Date().getTime() + '] ' + logText + '\\n'\n\tsetItem(HIGHLIGHT_LOGS_KEY, highlightLogs)\n}\n\nexport const getHighlightLogs = (): string => {\n\treturn getItem(HIGHLIGHT_LOGS_KEY) || ''\n}\n\nexport const clearHighlightLogs = (logsToClear: string) => {\n\tif (!logsToClear) {\n\t\treturn\n\t}\n\tlet highlightLogs = getItem(HIGHLIGHT_LOGS_KEY) || ''\n\tif (!highlightLogs) {\n\t\treturn\n\t}\n\tif (highlightLogs.startsWith(logsToClear)) {\n\t\thighlightLogs = highlightLogs.slice(logsToClear.length)\n\t\tsetItem(HIGHLIGHT_LOGS_KEY, highlightLogs)\n\t} else {\n\t\tlogForHighlight(\n\t\t\t'Unable to clear logs ' +\n\t\t\t\tlogsToClear.replace('\\n', ' ') +\n\t\t\t\t' from ' +\n\t\t\t\thighlightLogs.replace('\\n', ' '),\n\t\t)\n\t}\n}\n","import { ClientError } from 'graphql-request'\nimport { PublicGraphError } from '../graph/generated/schemas'\n\nexport const MAX_PUBLIC_GRAPH_RETRY_ATTEMPTS = 10\n\n// Initial backoff for retrying graphql requests.\nexport const BASE_DELAY_MS = 1000\nexport const BACKOFF_DELAY_MS = 500\n\n// Do not retry if any of these public graph errors are thrown\nconst NON_RETRYABLE_ERRORS = [PublicGraphError.BillingQuotaExceeded.toString()]\n\n// A `ClientError` is retryable if none of the response errors is non-retryable\nconst isErrorRetryable = (error: ClientError): boolean => {\n\tconst match = error.response.errors?.find((e) =>\n\t\tNON_RETRYABLE_ERRORS.includes(e.message),\n\t)\n\treturn match === undefined\n}\n\nexport const getGraphQLRequestWrapper = (sessionSecureID: string) => {\n\tconst graphQLRequestWrapper = async (\n\t\trequestFn: () => Promise,\n\t\toperationName: string,\n\t\toperationType?: string,\n\t\tvariables?: any,\n\t\tretries: number = 0,\n\t): Promise => {\n\t\ttry {\n\t\t\treturn await requestFn()\n\t\t} catch (error: any) {\n\t\t\tif (error instanceof ClientError && !isErrorRetryable(error)) {\n\t\t\t\tthrow error\n\t\t\t}\n\n\t\t\tif (retries < MAX_PUBLIC_GRAPH_RETRY_ATTEMPTS) {\n\t\t\t\tawait new Promise((resolve) =>\n\t\t\t\t\tsetTimeout(\n\t\t\t\t\t\tresolve,\n\t\t\t\t\t\tBASE_DELAY_MS + BACKOFF_DELAY_MS * Math.pow(2, retries),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\treturn await graphQLRequestWrapper(\n\t\t\t\t\trequestFn,\n\t\t\t\t\toperationName,\n\t\t\t\t\toperationType,\n\t\t\t\t\tvariables,\n\t\t\t\t\tretries + 1,\n\t\t\t\t)\n\t\t\t}\n\t\t\tconsole.error(\n\t\t\t\t`highlight.io: [${\n\t\t\t\t\tsessionSecureID || sessionSecureID\n\t\t\t\t}] data request failed after ${retries} retries`,\n\t\t\t)\n\t\t\tthrow error\n\t\t}\n\t}\n\treturn graphQLRequestWrapper\n}\n","import { eventWithTime } from '@rrweb/types'\nimport { ConsoleMessage, ErrorMessage } from '../types/shared-types'\nimport { MetricCategory } from '../types/client'\n\nexport type Source = 'segment' | undefined\n\nexport type PropertyType = {\n\ttype?: 'track' | 'session'\n\tsource?: Source\n}\n\nexport enum MessageType {\n\tInitialize,\n\tAsyncEvents,\n\tIdentify,\n\tProperties,\n\tMetrics,\n\tFeedback,\n\tCustomEvent,\n\tStop,\n}\n\nexport type InitializeMessage = {\n\ttype: MessageType.Initialize\n\tbackend: string\n\tsessionSecureID: string\n\tdebug: boolean\n\trecordingStartTime: number\n}\n\nexport type AsyncEventsMessage = {\n\ttype: MessageType.AsyncEvents\n\tid: number\n\thasSessionUnloaded: boolean\n\thighlightLogs: string\n\tevents: eventWithTime[]\n\tmessages: ConsoleMessage[]\n\terrors: ErrorMessage[]\n\tresourcesString: string\n\twebSocketEventsString: string\n}\n\nexport type AsyncEventsResponse = {\n\ttype: MessageType.AsyncEvents\n\tid: number\n\teventsSize: number\n\tcompressedSize: number\n}\n\nexport type IdentifyMessage = {\n\ttype: MessageType.Identify\n\tuserIdentifier: string\n\tuserObject: any\n\tsource?: Source\n}\n\nexport type PropertiesMessage = {\n\ttype: MessageType.Properties\n\tpropertiesObject: any\n\tpropertyType?: PropertyType\n}\n\nexport type MetricsMessage = {\n\ttype: MessageType.Metrics\n\tmetrics: {\n\t\tname: string\n\t\tvalue: number\n\t\tcategory: MetricCategory\n\t\tgroup: string\n\t\ttimestamp: Date\n\t\ttags: { name: string; value: string }[]\n\t}[]\n}\n\nexport type FeedbackMessage = {\n\ttype: MessageType.Feedback\n\tverbatim: string\n\ttimestamp: string\n\tuserName?: string\n\tuserEmail?: string\n}\n\nexport type CustomEventResponse = {\n\ttype: MessageType.CustomEvent\n\ttag: string\n\tpayload: any\n}\n\nexport type StopEventResponse = {\n\ttype: MessageType.Stop\n\trequestStart: number\n\tasyncEventsResponse: AsyncEventsResponse\n}\n\nexport type HighlightClientWorkerParams = {\n\tmessage:\n\t\t| InitializeMessage\n\t\t| AsyncEventsMessage\n\t\t| IdentifyMessage\n\t\t| PropertiesMessage\n\t\t| MetricsMessage\n\t\t| FeedbackMessage\n}\n\nexport type HighlightClientWorkerResponse = {\n\tresponse?: AsyncEventsResponse | CustomEventResponse | StopEventResponse\n}\n","import { addCustomEvent as rrwebAddCustomEvent, record } from 'rrweb'\nimport { getRecordSequentialIdPlugin } from '@rrweb/rrweb-plugin-sequential-id-record'\nimport { eventWithTime, listenerHandler } from '@rrweb/types'\nimport { FirstLoadListeners } from './listeners/first-load-listeners'\nimport {\n\tAmplitudeIntegrationOptions,\n\tConsoleMethods,\n\tDebugOptions,\n\tMetricCategory,\n\tMetricName,\n\tMixpanelIntegrationOptions,\n\tNetworkRecordingOptions,\n\tSessionShortcutOptions,\n} from './types/client'\nimport {\n\tHighlightOptions,\n\tHighlightPublicInterface,\n\tIntegration,\n\tMetadata,\n\tMetric,\n\tPrivacySettingOption,\n\tSamplingStrategy,\n\tSessionDetails,\n\tStartOptions,\n} from './types/types'\nimport { PathListener } from './listeners/path-listener'\nimport { GraphQLClient } from 'graphql-request'\nimport ErrorStackParser from 'error-stack-parser'\nimport {\n\tgetSdk,\n\tPushPayloadDocument,\n\tPushPayloadMutationVariables,\n\tSdk,\n} from './graph/generated/operations'\nimport stringify from 'json-stringify-safe'\nimport { print } from 'graphql'\nimport { determineMaskInputOptions } from './utils/privacy'\n\nimport {\n\tViewportResizeListener,\n\ttype ViewportResizeListenerArgs,\n} from './listeners/viewport-resize-listener'\nimport { SegmentIntegrationListener } from './listeners/segment-integration-listener'\nimport { ClickListener } from './listeners/click-listener/click-listener'\nimport { FocusListener } from './listeners/focus-listener/focus-listener'\nimport { SESSION_STORAGE_KEYS } from './utils/sessionStorage/sessionStorageKeys'\nimport SessionShortcutListener from './listeners/session-shortcut/session-shortcut-listener'\nimport { WebVitalsListener } from './listeners/web-vitals-listener/web-vitals-listener'\nimport { getPerformanceMethods } from './utils/performance/performance'\nimport {\n\tPerformanceListener,\n\tPerformancePayload,\n} from './listeners/performance-listener/performance-listener'\nimport { PageVisibilityListener } from './listeners/page-visibility-listener'\nimport { clearHighlightLogs, getHighlightLogs } from './utils/highlight-logging'\nimport { GenerateSecureID } from './utils/secure-id'\nimport { getSimpleSelector } from './utils/dom'\nimport {\n\tgetPreviousSessionData,\n\tSessionData,\n\tsetSessionData,\n\tsetSessionSecureID,\n} from './utils/sessionStorage/highlightSession'\nimport type { HighlightClientRequestWorker } from './workers/highlight-client-worker'\nimport HighlightClientWorker from './workers/highlight-client-worker?worker&inline'\nimport { getGraphQLRequestWrapper } from './utils/graph'\nimport { ReplayEventsInput } from './graph/generated/schemas'\nimport { MessageType, PropertyType, Source } from './workers/types'\nimport { Logger } from './logger'\nimport { HighlightFetchWindow } from './listeners/network-listener/utils/fetch-listener'\nimport { ConsoleMessage, ErrorMessageType } from './types/shared-types'\nimport { RequestResponsePair } from './listeners/network-listener/utils/models'\nimport {\n\tJankListener,\n\tJankPayload,\n} from './listeners/jank-listener/jank-listener'\nimport {\n\tHighlightIframeMessage,\n\tHighlightIframeReponse,\n\tIFRAME_PARENT_READY,\n\tIFRAME_PARENT_RESPONSE,\n} from './types/iframe'\nimport {\n\tgetItem,\n\tremoveItem,\n\tsetCookieWriteEnabled,\n\tsetItem,\n\tsetStorageMode,\n} from './utils/storage'\nimport {\n\tFIRST_SEND_FREQUENCY,\n\tHIGHLIGHT_URL,\n\tMAX_SESSION_LENGTH,\n\tSEND_FREQUENCY,\n\tSNAPSHOT_SETTINGS,\n\tVISIBILITY_DEBOUNCE_MS,\n} from './constants/sessions'\nimport { getDefaultDataURLOptions } from './utils/utils'\nimport { getTracer, setupBrowserTracing } from './otel'\n\nexport const HighlightWarning = (context: string, msg: any) => {\n\tconsole.warn(`Highlight Warning: (${context}): `, { output: msg })\n}\n\nenum LOCAL_STORAGE_KEYS {\n\tCLIENT_ID = 'highlightClientID',\n}\n\nexport type HighlightClassOptions = {\n\torganizationID: number | string\n\tdebug?: boolean | DebugOptions\n\tbackendUrl?: string\n\ttracingOrigins?: boolean | (string | RegExp)[]\n\tdisableNetworkRecording?: boolean\n\tnetworkRecording?: boolean | NetworkRecordingOptions\n\tdisableBackgroundRecording?: boolean\n\tdisableConsoleRecording?: boolean\n\tdisableSessionRecording?: boolean\n\treportConsoleErrors?: boolean\n\tconsoleMethodsToRecord?: ConsoleMethods[]\n\tprivacySetting?: PrivacySettingOption\n\tenableSegmentIntegration?: boolean\n\tenableCanvasRecording?: boolean\n\tenablePerformanceRecording?: boolean\n\tenablePromisePatch?: boolean\n\tsamplingStrategy?: SamplingStrategy\n\tinlineImages?: boolean\n\tinlineStylesheet?: boolean\n\trecordCrossOriginIframe?: boolean\n\tfirstloadVersion?: string\n\tenvironment?: 'development' | 'production' | 'staging' | string\n\tappVersion?: string\n\tserviceName?: string\n\tsessionShortcut?: SessionShortcutOptions\n\tsessionSecureID: string // Introduced in firstLoad 3.0.1\n\tstorageMode?: 'sessionStorage' | 'localStorage'\n\tskipCookieSessionDataLoad?: true\n\tsendMode?: 'webworker' | 'local'\n\tenableOtelTracing?: HighlightOptions['enableOtelTracing']\n\totlpEndpoint?: HighlightOptions['otlpEndpoint']\n}\n\n/**\n * Subset of HighlightClassOptions that is stored with the session. These fields are stored for debugging purposes.\n */\ntype HighlightClassOptionsInternal = Omit<\n\tHighlightClassOptions,\n\t'firstloadVersion'\n>\n\nexport class Highlight {\n\toptions!: HighlightClassOptions\n\t/** Determines if the client is running on a Highlight property (e.g. frontend). */\n\tisRunningOnHighlight!: boolean\n\t/** Verbose project ID that is exposed to users. Legacy users may still be using ints. */\n\torganizationID!: string\n\tgraphqlSDK!: Sdk\n\tevents!: eventWithTime[]\n\tsessionData!: SessionData\n\tready!: boolean\n\tmanualStopped!: boolean\n\tstate!: 'NotRecording' | 'Recording'\n\tlogger!: Logger\n\tenableSegmentIntegration!: boolean\n\tprivacySetting!: PrivacySettingOption\n\tenableCanvasRecording!: boolean\n\tenablePerformanceRecording!: boolean\n\tsamplingStrategy!: SamplingStrategy\n\tinlineImages!: boolean\n\tinlineStylesheet!: boolean\n\tdebugOptions!: DebugOptions\n\tlisteners!: listenerHandler[]\n\tfirstloadVersion!: string\n\tenvironment!: string\n\tsessionShortcut!: SessionShortcutOptions\n\t/** The end-user's app version. This isn't Highlight's version. */\n\tappVersion!: string | undefined\n\tserviceName!: string\n\t_worker!: HighlightClientRequestWorker\n\t_optionsInternal!: HighlightClassOptionsInternal\n\t_backendUrl!: string\n\t_recordingStartTime!: number\n\t_isOnLocalHost!: boolean\n\t_onToggleFeedbackFormVisibility!: () => void\n\t_firstLoadListeners!: FirstLoadListeners\n\t_isCrossOriginIframe!: boolean\n\t_eventBytesSinceSnapshot!: number\n\t_lastSnapshotTime!: number\n\t_lastVisibilityChangeTime!: number\n\tpushPayloadTimerId!: ReturnType | undefined\n\thasSessionUnloaded!: boolean\n\thasPushedData!: boolean\n\treloaded!: boolean\n\t_hasPreviouslyInitialized!: boolean\n\t_recordStop!: listenerHandler | undefined\n\n\tstatic create(options: HighlightClassOptions): Highlight {\n\t\treturn new Highlight(options)\n\t}\n\n\tconstructor(\n\t\toptions: HighlightClassOptions,\n\t\tfirstLoadListeners?: FirstLoadListeners,\n\t) {\n\t\tif (!options.sessionSecureID) {\n\t\t\t// Firstload versions before 3.0.1 did not have this property\n\t\t\toptions.sessionSecureID = GenerateSecureID()\n\t\t}\n\t\tthis.options = options\n\t\tif (typeof this.options?.debug === 'boolean') {\n\t\t\tthis.debugOptions = this.options.debug\n\t\t\t\t? { clientInteractions: true }\n\t\t\t\t: {}\n\t\t} else {\n\t\t\tthis.debugOptions = this.options?.debug ?? {}\n\t\t}\n\t\tthis.logger = new Logger(this.debugOptions.clientInteractions)\n\t\tif (options.storageMode) {\n\t\t\tthis.logger.log(\n\t\t\t\t`initializing in ${options.storageMode} session mode`,\n\t\t\t)\n\t\t\tsetStorageMode(options.storageMode)\n\t\t}\n\t\tsetCookieWriteEnabled(!options?.skipCookieSessionDataLoad)\n\n\t\tthis._worker =\n\t\t\tnew HighlightClientWorker() as HighlightClientRequestWorker\n\t\tthis._worker.onmessage = (e) => {\n\t\t\tif (e.data.response?.type === MessageType.AsyncEvents) {\n\t\t\t\tthis._eventBytesSinceSnapshot += e.data.response.eventsSize\n\t\t\t\tthis.logger.log(\n\t\t\t\t\t`Web worker sent payloadID ${e.data.response.id} size ${\n\t\t\t\t\t\te.data.response.eventsSize\n\t\t\t\t\t} bytes, compression ratio ${\n\t\t\t\t\t\te.data.response.eventsSize /\n\t\t\t\t\t\te.data.response.compressedSize\n\t\t\t\t\t}.\n Total since snapshot: ${(\n\t\t\t\t\tthis._eventBytesSinceSnapshot / 1000000\n\t\t\t\t).toFixed(1)}MB`,\n\t\t\t\t)\n\t\t\t} else if (e.data.response?.type === MessageType.CustomEvent) {\n\t\t\t\tthis.addCustomEvent(\n\t\t\t\t\te.data.response.tag,\n\t\t\t\t\te.data.response.payload,\n\t\t\t\t)\n\t\t\t} else if (e.data.response?.type === MessageType.Stop) {\n\t\t\t\tHighlightWarning(\n\t\t\t\t\t'Stopping recording due to worker failure',\n\t\t\t\t\te.data.response,\n\t\t\t\t)\n\t\t\t\tthis.stopRecording(false)\n\t\t\t}\n\t\t}\n\n\t\tlet storedSessionData = getPreviousSessionData()\n\t\tthis.reloaded = false\n\t\t// only fetch session data from local storage on the first `initialize` call\n\t\tif (\n\t\t\t!this.sessionData?.sessionSecureID &&\n\t\t\tstoredSessionData?.sessionSecureID\n\t\t) {\n\t\t\tthis.sessionData = storedSessionData\n\t\t\tthis.options.sessionSecureID = storedSessionData.sessionSecureID\n\t\t\tthis.reloaded = true\n\t\t\tthis.logger.log(\n\t\t\t\t`Tab reloaded, continuing previous session: ${this.sessionData.sessionSecureID}`,\n\t\t\t)\n\t\t} else {\n\t\t\t// new session. we should clear any session storage data\n\t\t\tfor (const storageKeyName of Object.values(SESSION_STORAGE_KEYS)) {\n\t\t\t\tremoveItem(storageKeyName)\n\t\t\t}\n\t\t\tthis.sessionData = {\n\t\t\t\tsessionSecureID: this.options.sessionSecureID,\n\t\t\t\tprojectID: 0,\n\t\t\t\tpayloadID: 1,\n\t\t\t\tsessionStartTime: Date.now(),\n\t\t\t}\n\t\t}\n\t\t// these should not be in initMembers since we want them to\n\t\t// persist across session resets\n\t\tthis._hasPreviouslyInitialized = false\n\t\t// Old firstLoad versions (Feb 2022) do not pass in FirstLoadListeners, so we have to fallback to creating it\n\t\tthis._firstLoadListeners =\n\t\t\tfirstLoadListeners || new FirstLoadListeners(this.options)\n\t\ttry {\n\t\t\t// throws if parent is cross-origin\n\t\t\tif (window.parent.document) {\n\t\t\t\tthis._isCrossOriginIframe = false\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t// if recordCrossOriginIframe is set to false, operate as if highlight is only recording the iframe as a dedicated web app.\n\t\t\t// this is useful if you are running highlight on your app that is used in a cross-origin iframe with no access to the parent page.\n\t\t\tthis._isCrossOriginIframe =\n\t\t\t\tthis.options.recordCrossOriginIframe ?? true\n\t\t}\n\t\tthis._initMembers(this.options)\n\t}\n\n\t// Start a new session\n\tasync _reset({ forceNew }: { forceNew?: boolean }) {\n\t\tif (this.pushPayloadTimerId) {\n\t\t\tclearTimeout(this.pushPayloadTimerId)\n\t\t\tthis.pushPayloadTimerId = undefined\n\t\t}\n\n\t\tlet user_identifier, user_object\n\t\tif (!forceNew) {\n\t\t\ttry {\n\t\t\t\tuser_identifier = getItem(SESSION_STORAGE_KEYS.USER_IDENTIFIER)\n\t\t\t\tconst user_object_string = getItem(\n\t\t\t\t\tSESSION_STORAGE_KEYS.USER_OBJECT,\n\t\t\t\t)\n\t\t\t\tif (user_object_string) {\n\t\t\t\t\tuser_object = JSON.parse(user_object_string)\n\t\t\t\t}\n\t\t\t} catch (err) {}\n\t\t}\n\t\tfor (const storageKeyName of Object.values(SESSION_STORAGE_KEYS)) {\n\t\t\tremoveItem(storageKeyName)\n\t\t}\n\n\t\t// no need to set the sessionStorage value here since firstload won't call\n\t\t// init again after a reset, and `this.initialize()` will set sessionStorage\n\t\tthis.sessionData.sessionSecureID = GenerateSecureID()\n\t\tthis.sessionData.sessionStartTime = Date.now()\n\t\tthis.options.sessionSecureID = this.sessionData.sessionSecureID\n\t\tthis.stopRecording()\n\t\tthis._firstLoadListeners = new FirstLoadListeners(this.options)\n\t\tawait this.initialize()\n\t\tif (user_identifier && user_object) {\n\t\t\tthis.identify(user_identifier, user_object)\n\t\t}\n\t}\n\n\t_initMembers(options: HighlightClassOptions) {\n\t\tthis.sessionShortcut = false\n\t\tthis._recordingStartTime = 0\n\t\tthis._isOnLocalHost =\n\t\t\twindow.location.hostname === 'localhost' ||\n\t\t\twindow.location.hostname === '127.0.0.1' ||\n\t\t\twindow.location.hostname === ''\n\n\t\tthis.ready = false\n\t\tthis.state = 'NotRecording'\n\t\tthis.manualStopped = false\n\t\tthis.enableSegmentIntegration = !!options.enableSegmentIntegration\n\t\tthis.privacySetting = options.privacySetting ?? 'default'\n\t\tthis.enableCanvasRecording = options.enableCanvasRecording ?? false\n\t\tthis.enablePerformanceRecording =\n\t\t\toptions.enablePerformanceRecording ?? true\n\t\t// default to inlining stylesheets/images locally to help with recording accuracy\n\t\tthis.inlineImages = options.inlineImages ?? this._isOnLocalHost\n\t\tthis.inlineStylesheet = options.inlineStylesheet ?? true\n\t\tthis.samplingStrategy = {\n\t\t\tcanvasFactor: 0.5,\n\t\t\tcanvasMaxSnapshotDimension: 360,\n\t\t\tcanvasClearWebGLBuffer: true,\n\t\t\tdataUrlOptions: getDefaultDataURLOptions(),\n\t\t\t...(options.samplingStrategy ?? {\n\t\t\t\tcanvas: 2,\n\t\t\t}),\n\t\t}\n\t\tthis._backendUrl = options?.backendUrl ?? 'https://pub.highlight.io'\n\n\t\t// If _backendUrl is a relative URL, convert it to an absolute URL\n\t\t// so that it's usable from a web worker.\n\t\tif (this._backendUrl[0] === '/') {\n\t\t\tthis._backendUrl = new URL(this._backendUrl, document.baseURI).href\n\t\t}\n\n\t\tconst client = new GraphQLClient(`${this._backendUrl}`, {\n\t\t\theaders: {},\n\t\t})\n\t\tthis.graphqlSDK = getSdk(\n\t\t\tclient,\n\t\t\tgetGraphQLRequestWrapper(\n\t\t\t\tthis.sessionData?.sessionSecureID ||\n\t\t\t\t\tthis.options?.sessionSecureID,\n\t\t\t),\n\t\t)\n\t\tthis.environment = options.environment ?? 'production'\n\t\tthis.appVersion = options.appVersion\n\t\tthis.serviceName = options.serviceName ?? ''\n\n\t\tif (typeof options.organizationID === 'string') {\n\t\t\tthis.organizationID = options.organizationID\n\t\t} else {\n\t\t\tthis.organizationID = options.organizationID.toString()\n\t\t}\n\t\tthis.isRunningOnHighlight =\n\t\t\tthis.organizationID === '1' || this.organizationID === '1jdkoe52'\n\t\tthis.firstloadVersion = options.firstloadVersion || 'unknown'\n\t\tthis.sessionShortcut = options.sessionShortcut || false\n\t\tthis._onToggleFeedbackFormVisibility = () => {}\n\t\t// We only want to store a subset of the options for debugging purposes. Firstload version is stored as another field so we don't need to store it here.\n\t\tconst { firstloadVersion: _, ...optionsInternal } = options\n\t\tthis._optionsInternal = optionsInternal\n\t\tthis.listeners = []\n\n\t\tthis.events = []\n\t\tthis.hasSessionUnloaded = false\n\t\tthis.hasPushedData = false\n\n\t\tif (window.Intercom) {\n\t\t\twindow.Intercom('onShow', () => {\n\t\t\t\twindow.Intercom('update', {\n\t\t\t\t\thighlightSessionURL:\n\t\t\t\t\t\tthis.getCurrentSessionURLWithTimestamp(),\n\t\t\t\t})\n\t\t\t\tthis.addProperties({ event: 'Intercom onShow' })\n\t\t\t})\n\t\t}\n\n\t\tthis._eventBytesSinceSnapshot = 0\n\t\tthis._lastSnapshotTime = new Date().getTime()\n\t\tthis._lastVisibilityChangeTime = new Date().getTime()\n\t}\n\n\tidentify(user_identifier: string, user_object = {}, source?: Source) {\n\t\tif (!user_identifier || user_identifier === '') {\n\t\t\tconsole.warn(\n\t\t\t\t`Highlight's identify() call was passed an empty identifier.`,\n\t\t\t\t{ user_identifier, user_object },\n\t\t\t)\n\t\t\treturn\n\t\t}\n\t\tthis.sessionData.userIdentifier = user_identifier.toString()\n\t\tthis.sessionData.userObject = user_object\n\t\tsetItem(\n\t\t\tSESSION_STORAGE_KEYS.USER_IDENTIFIER,\n\t\t\tuser_identifier.toString(),\n\t\t)\n\t\tsetItem(SESSION_STORAGE_KEYS.USER_OBJECT, JSON.stringify(user_object))\n\t\tthis._worker.postMessage({\n\t\t\tmessage: {\n\t\t\t\ttype: MessageType.Identify,\n\t\t\t\tuserIdentifier: user_identifier,\n\t\t\t\tuserObject: user_object,\n\t\t\t\tsource,\n\t\t\t},\n\t\t})\n\t}\n\n\tpushCustomError(message: string, payload?: string) {\n\t\treturn this.consumeCustomError(new Error(message), undefined, payload)\n\t}\n\n\tconsumeCustomError(error: Error, message?: string, payload?: string) {\n\t\tlet obj = {}\n\t\tif (payload) {\n\t\t\ttry {\n\t\t\t\tobj = { ...JSON.parse(payload), ...obj }\n\t\t\t} catch (e) {}\n\t\t}\n\t\treturn this.consumeError(error, {\n\t\t\tmessage,\n\t\t\tpayload: obj,\n\t\t})\n\t}\n\n\tconsumeError(\n\t\terror: Error,\n\t\t{\n\t\t\tmessage,\n\t\t\tpayload,\n\t\t\tsource,\n\t\t\ttype,\n\t\t}: {\n\t\t\tmessage?: string\n\t\t\tpayload?: object\n\t\t\tsource?: string\n\t\t\ttype?: ErrorMessageType\n\t\t},\n\t) {\n\t\tif (error.cause) {\n\t\t\tpayload = { ...payload, 'exception.cause': error.cause }\n\t\t}\n\t\tlet event = message ? message + ':' + error.message : error.message\n\t\tif (type === 'React.ErrorBoundary') {\n\t\t\tevent = 'ErrorBoundary: ' + event\n\t\t}\n\t\tconst res = ErrorStackParser.parse(error)\n\t\tthis._firstLoadListeners.errors.push({\n\t\t\tevent,\n\t\t\ttype: type ?? 'custom',\n\t\t\turl: window.location.href,\n\t\t\tsource: source ?? '',\n\t\t\tlineNumber: res[0]?.lineNumber ? res[0]?.lineNumber : 0,\n\t\t\tcolumnNumber: res[0]?.columnNumber ? res[0]?.columnNumber : 0,\n\t\t\tstackTrace: res,\n\t\t\ttimestamp: new Date().toISOString(),\n\t\t\tpayload: JSON.stringify(payload),\n\t\t})\n\t}\n\n\taddProperties(properties_obj = {}, typeArg?: PropertyType) {\n\t\t// Remove any properties which throw on structuredClone\n\t\t// (structuredClone is used when posting messages to the worker)\n\t\tconst obj = { ...properties_obj } as any\n\t\tObject.entries(obj).forEach(([key, val]) => {\n\t\t\ttry {\n\t\t\t\tstructuredClone(val)\n\t\t\t} catch {\n\t\t\t\tdelete obj[key]\n\t\t\t}\n\t\t})\n\t\tthis._worker.postMessage({\n\t\t\tmessage: {\n\t\t\t\ttype: MessageType.Properties,\n\t\t\t\tpropertiesObject: obj,\n\t\t\t\tpropertyType: typeArg,\n\t\t\t},\n\t\t})\n\t}\n\n\tasync initialize(options?: StartOptions): Promise {\n\t\tthis.logger.log(\n\t\t\t`Initializing...`,\n\t\t\toptions,\n\t\t\tthis.sessionData,\n\t\t\tthis.options,\n\t\t)\n\n\t\tif (\n\t\t\t(navigator?.webdriver && !window.Cypress) ||\n\t\t\tnavigator?.userAgent?.includes('Googlebot') ||\n\t\t\tnavigator?.userAgent?.includes('AdsBot')\n\t\t) {\n\t\t\tthis._firstLoadListeners?.stopListening()\n\t\t\treturn\n\t\t}\n\n\t\ttry {\n\t\t\tif (options?.forceNew) {\n\t\t\t\tawait this._reset(options)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.sessionData =\n\t\t\t\tgetPreviousSessionData(this.sessionData.sessionSecureID) ??\n\t\t\t\tthis.sessionData\n\t\t\tif (!this.sessionData?.sessionStartTime) {\n\t\t\t\tthis._recordingStartTime = new Date().getTime()\n\t\t\t\tthis.sessionData.sessionStartTime = this._recordingStartTime\n\t\t\t} else {\n\t\t\t\tthis._recordingStartTime = this.sessionData?.sessionStartTime\n\t\t\t}\n\t\t\t// To handle the 'Duplicate Tab' function, remove id from storage until page unload\n\t\t\tsetSessionSecureID('')\n\t\t\tsetSessionData(this.sessionData)\n\n\t\t\tlet clientID = getItem(LOCAL_STORAGE_KEYS['CLIENT_ID'])\n\n\t\t\tif (!clientID) {\n\t\t\t\tclientID = GenerateSecureID()\n\t\t\t\tsetItem(LOCAL_STORAGE_KEYS['CLIENT_ID'], clientID)\n\t\t\t}\n\n\t\t\t// Duplicate of logic inside FirstLoadListeners.setupNetworkListener,\n\t\t\t// needed for initializeSession\n\t\t\tlet enableNetworkRecording\n\t\t\tif (this.options.disableSessionRecording) {\n\t\t\t\tenableNetworkRecording = false\n\t\t\t} else if (this.options.disableNetworkRecording !== undefined) {\n\t\t\t\tenableNetworkRecording = false\n\t\t\t} else if (typeof this.options.networkRecording === 'boolean') {\n\t\t\t\tenableNetworkRecording = false\n\t\t\t} else {\n\t\t\t\tenableNetworkRecording =\n\t\t\t\t\tthis.options.networkRecording?.recordHeadersAndBody || false\n\t\t\t}\n\n\t\t\tlet destinationDomains: string[] = []\n\t\t\tif (\n\t\t\t\ttypeof this.options.networkRecording === 'object' &&\n\t\t\t\tthis.options.networkRecording.destinationDomains?.length\n\t\t\t) {\n\t\t\t\tdestinationDomains =\n\t\t\t\t\tthis.options.networkRecording.destinationDomains\n\t\t\t}\n\t\t\tif (this._isCrossOriginIframe) {\n\t\t\t\t// wait for 'cross-origin iframe ready' message\n\t\t\t\tawait this._setupCrossOriginIframe()\n\t\t\t} else {\n\t\t\t\tconst gr = await this.graphqlSDK.initializeSession({\n\t\t\t\t\torganization_verbose_id: this.organizationID,\n\t\t\t\t\tenable_strict_privacy: this.privacySetting === 'strict',\n\t\t\t\t\tprivacy_setting: this.privacySetting,\n\t\t\t\t\tenable_recording_network_contents: enableNetworkRecording,\n\t\t\t\t\tclientVersion: this.firstloadVersion,\n\t\t\t\t\tfirstloadVersion: this.firstloadVersion,\n\t\t\t\t\tclientConfig: JSON.stringify(this._optionsInternal),\n\t\t\t\t\tenvironment: this.environment,\n\t\t\t\t\tid: clientID,\n\t\t\t\t\tappVersion: this.appVersion,\n\t\t\t\t\tserviceName: this.serviceName,\n\t\t\t\t\tsession_secure_id: this.sessionData.sessionSecureID,\n\t\t\t\t\tclient_id: clientID,\n\t\t\t\t\tnetwork_recording_domains: destinationDomains,\n\t\t\t\t\tdisable_session_recording:\n\t\t\t\t\t\tthis.options.disableSessionRecording,\n\t\t\t\t})\n\t\t\t\tif (\n\t\t\t\t\tgr.initializeSession.secure_id !==\n\t\t\t\t\tthis.sessionData.sessionSecureID\n\t\t\t\t) {\n\t\t\t\t\tthis.logger.log(\n\t\t\t\t\t\t`Unexpected secure id returned by initializeSession: ${gr.initializeSession.secure_id}, ` +\n\t\t\t\t\t\t\t`expected ${this.sessionData.sessionSecureID}`,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tthis.sessionData.sessionSecureID =\n\t\t\t\t\tgr.initializeSession.secure_id\n\t\t\t\tthis.sessionData.projectID = parseInt(\n\t\t\t\t\tgr?.initializeSession?.project_id || '0',\n\t\t\t\t)\n\n\t\t\t\tif (\n\t\t\t\t\t!this.sessionData.projectID ||\n\t\t\t\t\t!this.sessionData.sessionSecureID\n\t\t\t\t) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Failed to initialize Highlight; an error occurred on our end.',\n\t\t\t\t\t\tthis.sessionData,\n\t\t\t\t\t)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.logger.log(\n\t\t\t\t`Loaded Highlight\nRemote: ${this._backendUrl}\nProject ID: ${this.sessionData.projectID}\nSessionSecureID: ${this.sessionData.sessionSecureID}`,\n\t\t\t)\n\t\t\tthis.options.sessionSecureID = this.sessionData.sessionSecureID\n\t\t\tthis._worker.postMessage({\n\t\t\t\tmessage: {\n\t\t\t\t\ttype: MessageType.Initialize,\n\t\t\t\t\tsessionSecureID: this.sessionData.sessionSecureID,\n\t\t\t\t\tbackend: this._backendUrl,\n\t\t\t\t\tdebug: !!this.debugOptions.clientInteractions,\n\t\t\t\t\trecordingStartTime: this._recordingStartTime,\n\t\t\t\t},\n\t\t\t})\n\n\t\t\tif (this.sessionData.userIdentifier) {\n\t\t\t\tthis.identify(\n\t\t\t\t\tthis.sessionData.userIdentifier,\n\t\t\t\t\tthis.sessionData.userObject,\n\t\t\t\t)\n\t\t\t}\n\n\t\t\tif (!this._firstLoadListeners.isListening()) {\n\t\t\t\tthis._firstLoadListeners.startListening()\n\t\t\t} else if (!this._firstLoadListeners.hasNetworkRecording) {\n\t\t\t\t// for firstload versions < 3.0. even if they are listening, add network listeners\n\t\t\t\tFirstLoadListeners.setupNetworkListener(\n\t\t\t\t\tthis._firstLoadListeners,\n\t\t\t\t\tthis.options,\n\t\t\t\t)\n\t\t\t}\n\n\t\t\tif (this.pushPayloadTimerId) {\n\t\t\t\tclearTimeout(this.pushPayloadTimerId)\n\t\t\t\tthis.pushPayloadTimerId = undefined\n\t\t\t}\n\t\t\tif (!this._isCrossOriginIframe) {\n\t\t\t\tthis.pushPayloadTimerId = setTimeout(() => {\n\t\t\t\t\tthis._save()\n\t\t\t\t}, FIRST_SEND_FREQUENCY)\n\t\t\t}\n\n\t\t\t// if disabled, do not record session events / rrweb events.\n\t\t\t// we still use firstload listeners to record frontend js console logs and errors.\n\t\t\tif (this.options.disableSessionRecording) {\n\t\t\t\tthis.logger.log(\n\t\t\t\t\t`Highlight is NOT RECORDING a session replay per H.init setting.`,\n\t\t\t\t)\n\t\t\t\tthis.ready = true\n\t\t\t\tthis.state = 'Recording'\n\t\t\t\tthis.manualStopped = false\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst { getDeviceDetails } = getPerformanceMethods()\n\t\t\tif (getDeviceDetails) {\n\t\t\t\tthis.recordMetric([\n\t\t\t\t\t{\n\t\t\t\t\t\tname: MetricName.DeviceMemory,\n\t\t\t\t\t\tvalue: getDeviceDetails().deviceMemory,\n\t\t\t\t\t\tcategory: MetricCategory.Device,\n\t\t\t\t\t\tgroup: window.location.href,\n\t\t\t\t\t},\n\t\t\t\t])\n\t\t\t}\n\n\t\t\tconst emit = (\n\t\t\t\tevent: eventWithTime,\n\t\t\t\tisCheckout?: boolean | undefined,\n\t\t\t) => {\n\t\t\t\tif (isCheckout) {\n\t\t\t\t\tthis.logger.log('received isCheckout emit', { event })\n\t\t\t\t}\n\t\t\t\tthis.events.push(event)\n\t\t\t}\n\t\t\temit.bind(this)\n\n\t\t\tconst alreadyRecording = !!this._recordStop\n\t\t\t// if we were already recording, stop recording to reset rrweb state (eg. reset _sid)\n\t\t\tif (this._recordStop) {\n\t\t\t\tthis._recordStop()\n\t\t\t\tthis._recordStop = undefined\n\t\t\t}\n\n\t\t\tconst [maskAllInputs, maskInputOptions] = determineMaskInputOptions(\n\t\t\t\tthis.privacySetting,\n\t\t\t)\n\n\t\t\tthis._recordStop = record({\n\t\t\t\tignoreClass: 'highlight-ignore',\n\t\t\t\tblockClass: 'highlight-block',\n\t\t\t\temit,\n\t\t\t\trecordCrossOriginIframes: this.options.recordCrossOriginIframe,\n\t\t\t\tprivacySetting: this.privacySetting,\n\t\t\t\tmaskAllInputs,\n\t\t\t\tmaskInputOptions: maskInputOptions,\n\t\t\t\trecordCanvas: this.enableCanvasRecording,\n\t\t\t\tsampling: {\n\t\t\t\t\tcanvas: {\n\t\t\t\t\t\tfps: this.samplingStrategy.canvas,\n\t\t\t\t\t\tfpsManual: this.samplingStrategy.canvasManualSnapshot,\n\t\t\t\t\t\tresizeFactor: this.samplingStrategy.canvasFactor,\n\t\t\t\t\t\tclearWebGLBuffer:\n\t\t\t\t\t\t\tthis.samplingStrategy.canvasClearWebGLBuffer,\n\t\t\t\t\t\tinitialSnapshotDelay:\n\t\t\t\t\t\t\tthis.samplingStrategy.canvasInitialSnapshotDelay,\n\t\t\t\t\t\tdataURLOptions: this.samplingStrategy.dataUrlOptions,\n\t\t\t\t\t\tmaxSnapshotDimension:\n\t\t\t\t\t\t\tthis.samplingStrategy.canvasMaxSnapshotDimension,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tkeepIframeSrcFn: (_src: string) => {\n\t\t\t\t\treturn !this.options.recordCrossOriginIframe\n\t\t\t\t},\n\t\t\t\tinlineImages: this.inlineImages,\n\t\t\t\tcollectFonts: this.inlineImages,\n\t\t\t\tinlineStylesheet: this.inlineStylesheet,\n\t\t\t\tplugins: [getRecordSequentialIdPlugin()],\n\t\t\t\tlogger:\n\t\t\t\t\t(typeof this.options.debug === 'boolean' &&\n\t\t\t\t\t\tthis.options.debug) ||\n\t\t\t\t\t(typeof this.options.debug === 'object' &&\n\t\t\t\t\t\tthis.options.debug.domRecording)\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tdebug: this.logger.log,\n\t\t\t\t\t\t\t\twarn: HighlightWarning,\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: undefined,\n\t\t\t})\n\n\t\t\t// recordStop is not part of listeners because we do not actually want to stop rrweb\n\t\t\t// rrweb has some bugs that make the stop -> restart workflow broken (eg iframe listeners)\n\t\t\tif (!alreadyRecording) {\n\t\t\t\tif (this.options.recordCrossOriginIframe) {\n\t\t\t\t\tthis._setupCrossOriginIframeParent()\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (document.referrer) {\n\t\t\t\t// Don't record the referrer if it's the same origin.\n\t\t\t\t// Non-single page apps might have the referrer set to the same origin.\n\t\t\t\t// If we record this then the referrer data will not be useful.\n\t\t\t\t// Most users will want to see referrers outside of their website/app.\n\t\t\t\t// This will be a configuration set in `H.init()` later.\n\t\t\t\tif (\n\t\t\t\t\t!(\n\t\t\t\t\t\twindow &&\n\t\t\t\t\t\tdocument.referrer.includes(window.location.origin)\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tthis.addCustomEvent('Referrer', document.referrer)\n\t\t\t\t\tthis.addProperties(\n\t\t\t\t\t\t{ referrer: document.referrer },\n\t\t\t\t\t\t{ type: 'session' },\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._setupWindowListeners()\n\t\t\tthis.ready = true\n\t\t\tthis.state = 'Recording'\n\t\t\tthis.manualStopped = false\n\t\t} catch (e) {\n\t\t\tif (this._isOnLocalHost) {\n\t\t\t\tconsole.error(e)\n\t\t\t\tHighlightWarning('initializeSession', e)\n\t\t\t}\n\t\t}\n\t}\n\n\tasync _visibilityHandler(hidden: boolean) {\n\t\tif (this.manualStopped) {\n\t\t\tthis.logger.log(`Ignoring visibility event due to manual stop.`)\n\t\t\treturn\n\t\t}\n\t\tif (\n\t\t\tnew Date().getTime() - this._lastVisibilityChangeTime <\n\t\t\tVISIBILITY_DEBOUNCE_MS\n\t\t) {\n\t\t\treturn\n\t\t}\n\t\tthis._lastVisibilityChangeTime = new Date().getTime()\n\t\tthis.logger.log(`Detected window ${hidden ? 'hidden' : 'visible'}.`)\n\t\tif (!hidden) {\n\t\t\tif (this.options.disableBackgroundRecording) {\n\t\t\t\tawait this.initialize()\n\t\t\t}\n\t\t\tthis.addCustomEvent('TabHidden', false)\n\t\t} else {\n\t\t\tthis.addCustomEvent('TabHidden', true)\n\t\t\tif (this.options.disableBackgroundRecording) {\n\t\t\t\tthis.stopRecording()\n\t\t\t}\n\t\t}\n\t}\n\n\tasync _setupCrossOriginIframe() {\n\t\tthis.logger.log(`highlight in cross-origin iframe is waiting `)\n\t\t// wait until we get a initialization message from the parent window\n\t\tawait new Promise((r) => {\n\t\t\tconst listener = (message: MessageEvent) => {\n\t\t\t\tif (message.data.highlight === IFRAME_PARENT_READY) {\n\t\t\t\t\tconst msg = message.data as HighlightIframeMessage\n\t\t\t\t\tthis.logger.log(`highlight got window message `, msg)\n\t\t\t\t\tthis.sessionData.projectID = msg.projectID\n\t\t\t\t\tthis.sessionData.sessionSecureID = msg.sessionSecureID\n\t\t\t\t\t// reply back that we got the message and are set up\n\t\t\t\t\twindow.parent.postMessage(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thighlight: IFRAME_PARENT_RESPONSE,\n\t\t\t\t\t\t} as HighlightIframeReponse,\n\t\t\t\t\t\t'*',\n\t\t\t\t\t)\n\t\t\t\t\t// stop listening to parent messages\n\t\t\t\t\twindow.removeEventListener('message', listener)\n\t\t\t\t\tr()\n\t\t\t\t}\n\t\t\t}\n\t\t\twindow.addEventListener('message', listener)\n\t\t})\n\t}\n\n\t_setupCrossOriginIframeParent() {\n\t\tthis.logger.log(\n\t\t\t`highlight setting up cross origin iframe parent notification`,\n\t\t)\n\t\t// notify iframes that highlight is ready\n\t\tsetInterval(() => {\n\t\t\twindow.document.querySelectorAll('iframe').forEach((iframe) => {\n\t\t\t\tiframe.contentWindow?.postMessage(\n\t\t\t\t\t{\n\t\t\t\t\t\thighlight: IFRAME_PARENT_READY,\n\t\t\t\t\t\tprojectID: this.sessionData.projectID,\n\t\t\t\t\t\tsessionSecureID: this.sessionData.sessionSecureID,\n\t\t\t\t\t} as HighlightIframeMessage,\n\t\t\t\t\t'*',\n\t\t\t\t)\n\t\t\t})\n\t\t}, FIRST_SEND_FREQUENCY)\n\t\twindow.addEventListener('message', (message: MessageEvent) => {\n\t\t\tif (message.data.highlight === IFRAME_PARENT_RESPONSE) {\n\t\t\t\tthis.logger.log(\n\t\t\t\t\t`highlight got response from initialized iframe`,\n\t\t\t\t)\n\t\t\t}\n\t\t})\n\t}\n\n\t_setupWindowListeners() {\n\t\ttry {\n\t\t\tconst highlightThis = this\n\t\t\tif (this.enableSegmentIntegration) {\n\t\t\t\tthis.listeners.push(\n\t\t\t\t\tSegmentIntegrationListener((obj: any) => {\n\t\t\t\t\t\tif (obj.type === 'track') {\n\t\t\t\t\t\t\tconst properties: { [key: string]: string } = {}\n\t\t\t\t\t\t\tproperties['segment-event'] = obj.event\n\t\t\t\t\t\t\thighlightThis.addProperties(properties, {\n\t\t\t\t\t\t\t\ttype: 'track',\n\t\t\t\t\t\t\t\tsource: 'segment',\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t} else if (obj.type === 'identify') {\n\t\t\t\t\t\t\t// Removes the starting and end quotes\n\t\t\t\t\t\t\t// Example: \"boba\" -> boba\n\t\t\t\t\t\t\tconst trimmedUserId = obj.userId.replace(\n\t\t\t\t\t\t\t\t/^\"(.*)\"$/,\n\t\t\t\t\t\t\t\t'$1',\n\t\t\t\t\t\t\t)\n\n\t\t\t\t\t\t\thighlightThis.identify(\n\t\t\t\t\t\t\t\ttrimmedUserId,\n\t\t\t\t\t\t\t\tobj.traits,\n\t\t\t\t\t\t\t\t'segment',\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t}),\n\t\t\t\t)\n\t\t\t}\n\t\t\tthis.listeners.push(\n\t\t\t\tPathListener((url: string) => {\n\t\t\t\t\tif (this.reloaded) {\n\t\t\t\t\t\tthis.addCustomEvent('Reload', url)\n\t\t\t\t\t\tthis.reloaded = false\n\t\t\t\t\t\thighlightThis.addProperties(\n\t\t\t\t\t\t\t{ reload: true },\n\t\t\t\t\t\t\t{ type: 'session' },\n\t\t\t\t\t\t)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.addCustomEvent('Navigate', url)\n\t\t\t\t\t}\n\t\t\t\t\thighlightThis.addProperties(\n\t\t\t\t\t\t{ 'visited-url': url },\n\t\t\t\t\t\t{ type: 'session' },\n\t\t\t\t\t)\n\t\t\t\t}),\n\t\t\t)\n\n\t\t\tthis.listeners.push(\n\t\t\t\tViewportResizeListener(\n\t\t\t\t\t(viewport: ViewportResizeListenerArgs) => {\n\t\t\t\t\t\tthis.addCustomEvent('Viewport', viewport)\n\t\t\t\t\t\tthis.submitViewportMetrics(viewport)\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t)\n\t\t\tthis.listeners.push(\n\t\t\t\tClickListener((clickTarget, event) => {\n\t\t\t\t\tif (clickTarget) {\n\t\t\t\t\t\tthis.addCustomEvent('Click', clickTarget)\n\t\t\t\t\t}\n\t\t\t\t\tlet selector = null\n\t\t\t\t\tlet textContent = null\n\t\t\t\t\tif (event && event.target) {\n\t\t\t\t\t\tconst t = event.target as HTMLElement\n\t\t\t\t\t\tselector = getSimpleSelector(t)\n\t\t\t\t\t\ttextContent = t.textContent\n\t\t\t\t\t\t// avoid sending huge strings here\n\t\t\t\t\t\tif (textContent && textContent.length > 2000) {\n\t\t\t\t\t\t\ttextContent = textContent.substring(0, 2000)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\thighlightThis.addProperties(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tclickTextContent: textContent,\n\t\t\t\t\t\t\tclickSelector: selector,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{ type: 'session' },\n\t\t\t\t\t)\n\t\t\t\t}),\n\t\t\t)\n\t\t\tthis.listeners.push(\n\t\t\t\tFocusListener((focusTarget) => {\n\t\t\t\t\tif (focusTarget) {\n\t\t\t\t\t\tthis.addCustomEvent('Focus', focusTarget)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\n\t\t\tthis.listeners.push(\n\t\t\t\tWebVitalsListener((data) => {\n\t\t\t\t\tconst { name, value } = data\n\t\t\t\t\tthis.recordMetric([\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\tgroup: window.location.href,\n\t\t\t\t\t\t\tcategory: MetricCategory.WebVital,\n\t\t\t\t\t\t},\n\t\t\t\t\t])\n\t\t\t\t}),\n\t\t\t)\n\n\t\t\tif (this.sessionShortcut) {\n\t\t\t\tSessionShortcutListener(this.sessionShortcut, () => {\n\t\t\t\t\twindow.open(\n\t\t\t\t\t\tthis.getCurrentSessionURLWithTimestamp(),\n\t\t\t\t\t\t'_blank',\n\t\t\t\t\t)\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tif (this.enablePerformanceRecording) {\n\t\t\t\tthis.listeners.push(\n\t\t\t\t\tPerformanceListener((payload: PerformancePayload) => {\n\t\t\t\t\t\tthis.addCustomEvent('Performance', stringify(payload))\n\t\t\t\t\t\tthis.recordMetric(\n\t\t\t\t\t\t\tObject.entries(payload)\n\t\t\t\t\t\t\t\t.map(([name, value]) =>\n\t\t\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t\t\t\t\tcategory:\n\t\t\t\t\t\t\t\t\t\t\t\t\tMetricCategory.Performance,\n\t\t\t\t\t\t\t\t\t\t\t\tgroup: window.location.href,\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t.filter((m) => m) as {\n\t\t\t\t\t\t\t\tname: string\n\t\t\t\t\t\t\t\tvalue: any\n\t\t\t\t\t\t\t\tcategory: MetricCategory\n\t\t\t\t\t\t\t\tgroup: string\n\t\t\t\t\t\t\t}[],\n\t\t\t\t\t\t)\n\t\t\t\t\t}, this._recordingStartTime),\n\t\t\t\t)\n\t\t\t\tthis.listeners.push(\n\t\t\t\t\tJankListener((payload: JankPayload) => {\n\t\t\t\t\t\tthis.addCustomEvent('Jank', stringify(payload))\n\t\t\t\t\t\tthis.recordMetric([\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Jank',\n\t\t\t\t\t\t\t\tvalue: payload.jankAmount,\n\t\t\t\t\t\t\t\tcategory: MetricCategory.WebVital,\n\t\t\t\t\t\t\t\tgroup: payload.querySelector,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t])\n\t\t\t\t\t}, this._recordingStartTime),\n\t\t\t\t)\n\t\t\t}\n\n\t\t\t// only do this once, since we want to keep the visibility listener attached even when recoding is stopped\n\t\t\tif (!this._hasPreviouslyInitialized) {\n\t\t\t\t// setup electron main thread window visiblity events listener\n\t\t\t\tif (window.electron?.ipcRenderer) {\n\t\t\t\t\twindow.electron.ipcRenderer.on(\n\t\t\t\t\t\t'highlight.run',\n\t\t\t\t\t\t({ visible }: { visible: boolean }) => {\n\t\t\t\t\t\t\tthis._visibilityHandler(!visible)\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t\tthis.logger.log('Set up Electron highlight.run events.')\n\t\t\t\t} else {\n\t\t\t\t\t// Send the payload every time the page is no longer visible - this includes when the tab is closed, as well\n\t\t\t\t\t// as when switching tabs or apps on mobile. Non-blocking.\n\t\t\t\t\tPageVisibilityListener((isTabHidden) =>\n\t\t\t\t\t\tthis._visibilityHandler(isTabHidden),\n\t\t\t\t\t)\n\t\t\t\t\tthis.logger.log('Set up document visibility listener.')\n\t\t\t\t}\n\t\t\t\tthis._hasPreviouslyInitialized = true\n\t\t\t}\n\n\t\t\t// Clear the timer so it doesn't block the next page navigation.\n\t\t\tconst unloadListener = () => {\n\t\t\t\tthis.hasSessionUnloaded = true\n\t\t\t\tif (this.pushPayloadTimerId) {\n\t\t\t\t\tclearTimeout(this.pushPayloadTimerId)\n\t\t\t\t\tthis.pushPayloadTimerId = undefined\n\t\t\t\t}\n\t\t\t}\n\t\t\twindow.addEventListener('beforeunload', unloadListener)\n\t\t\tthis.listeners.push(() =>\n\t\t\t\twindow.removeEventListener('beforeunload', unloadListener),\n\t\t\t)\n\t\t} catch (e) {\n\t\t\tif (this._isOnLocalHost) {\n\t\t\t\tconsole.error(e)\n\t\t\t\tHighlightWarning('initializeSession _setupWindowListeners', e)\n\t\t\t}\n\t\t}\n\n\t\tconst unloadListener = () => {\n\t\t\tthis.addCustomEvent('Page Unload', '')\n\t\t\tsetSessionSecureID(this.sessionData.sessionSecureID)\n\t\t\tsetSessionData(this.sessionData)\n\t\t}\n\t\twindow.addEventListener('beforeunload', unloadListener)\n\t\tthis.listeners.push(() =>\n\t\t\twindow.removeEventListener('beforeunload', unloadListener),\n\t\t)\n\n\t\t// beforeunload is not supported on iOS on Safari. Apple docs recommend using `pagehide` instead.\n\t\tconst isOnIOS =\n\t\t\tnavigator.userAgent.match(/iPad/i) ||\n\t\t\tnavigator.userAgent.match(/iPhone/i)\n\t\tif (isOnIOS) {\n\t\t\tconst unloadListener = () => {\n\t\t\t\tthis.addCustomEvent('Page Unload', '')\n\t\t\t\tsetSessionSecureID(this.sessionData.sessionSecureID)\n\t\t\t\tsetSessionData(this.sessionData)\n\t\t\t}\n\t\t\twindow.addEventListener('pagehide', unloadListener)\n\t\t\tthis.listeners.push(() =>\n\t\t\t\twindow.removeEventListener('beforeunload', unloadListener),\n\t\t\t)\n\t\t}\n\t}\n\n\tsubmitViewportMetrics({\n\t\theight,\n\t\twidth,\n\t\tavailHeight,\n\t\tavailWidth,\n\t}: ViewportResizeListenerArgs) {\n\t\tthis.recordMetric([\n\t\t\t{\n\t\t\t\tname: MetricName.ViewportHeight,\n\t\t\t\tvalue: height,\n\t\t\t\tcategory: MetricCategory.Device,\n\t\t\t\tgroup: window.location.href,\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: MetricName.ViewportWidth,\n\t\t\t\tvalue: width,\n\t\t\t\tcategory: MetricCategory.Device,\n\t\t\t\tgroup: window.location.href,\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: MetricName.ScreenHeight,\n\t\t\t\tvalue: availHeight,\n\t\t\t\tcategory: MetricCategory.Device,\n\t\t\t\tgroup: window.location.href,\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: MetricName.ScreenWidth,\n\t\t\t\tvalue: availWidth,\n\t\t\t\tcategory: MetricCategory.Device,\n\t\t\t\tgroup: window.location.href,\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: MetricName.ViewportArea,\n\t\t\t\tvalue: height * width,\n\t\t\t\tcategory: MetricCategory.Device,\n\t\t\t\tgroup: window.location.href,\n\t\t\t},\n\t\t])\n\t}\n\n\trecordMetric(\n\t\tmetrics: {\n\t\t\tname: string\n\t\t\tvalue: number\n\t\t\tcategory?: MetricCategory\n\t\t\tgroup?: string\n\t\t\ttags?: { name: string; value: string }[]\n\t\t}[],\n\t) {\n\t\tthis._worker.postMessage({\n\t\t\tmessage: {\n\t\t\t\ttype: MessageType.Metrics,\n\t\t\t\tmetrics: metrics.map((m) => ({\n\t\t\t\t\t...m,\n\t\t\t\t\ttags: m.tags || [],\n\t\t\t\t\tgroup: m.group || window.location.href,\n\t\t\t\t\tcategory: m.category || MetricCategory.Frontend,\n\t\t\t\t\ttimestamp: new Date(),\n\t\t\t\t})),\n\t\t\t},\n\t\t})\n\t}\n\n\t/**\n\t * Stops Highlight from recording.\n\t * @param manual The end user requested to stop recording.\n\t */\n\tstopRecording(manual?: boolean) {\n\t\tthis.manualStopped = !!manual\n\t\tif (this.manualStopped) {\n\t\t\tthis.addCustomEvent(\n\t\t\t\t'Stop',\n\t\t\t\t'H.stop() was called which stops Highlight from recording.',\n\t\t\t)\n\t\t}\n\t\tthis.state = 'NotRecording'\n\t\t// stop rrweb recording mutation observers\n\t\tif (manual && this._recordStop) {\n\t\t\tthis._recordStop()\n\t\t\tthis._recordStop = undefined\n\t\t}\n\t\t// stop all other event listeners, to be restarted on initialize()\n\t\tthis.listeners.forEach((stop) => stop())\n\t\tthis.listeners = []\n\t}\n\n\tgetCurrentSessionTimestamp() {\n\t\treturn this._recordingStartTime\n\t}\n\n\t/**\n\t * Returns the current timestamp for the current session.\n\t */\n\tgetCurrentSessionURLWithTimestamp() {\n\t\tconst now = new Date().getTime()\n\t\tconst { projectID, sessionSecureID } = this.sessionData\n\t\tconst relativeTimestamp = (now - this._recordingStartTime) / 1000\n\t\treturn `https://${HIGHLIGHT_URL}/${projectID}/sessions/${sessionSecureID}?ts=${relativeTimestamp}`\n\t}\n\n\tgetCurrentSessionURL() {\n\t\tconst projectID = this.sessionData.projectID\n\t\tconst sessionSecureID = this.sessionData.sessionSecureID\n\t\tif (projectID && sessionSecureID) {\n\t\t\treturn `https://${HIGHLIGHT_URL}/${projectID}/sessions/${sessionSecureID}`\n\t\t}\n\t\treturn null\n\t}\n\n\tasync snapshot(element: HTMLCanvasElement) {\n\t\tawait record.snapshotCanvas(element)\n\t}\n\n\taddSessionFeedback({\n\t\ttimestamp,\n\t\tverbatim,\n\t\tuser_email,\n\t\tuser_name,\n\t}: {\n\t\tverbatim: string\n\t\ttimestamp: string\n\t\tuser_name?: string\n\t\tuser_email?: string\n\t}) {\n\t\tthis._worker.postMessage({\n\t\t\tmessage: {\n\t\t\t\ttype: MessageType.Feedback,\n\t\t\t\tverbatim,\n\t\t\t\ttimestamp,\n\t\t\t\tuserName: user_name || this.sessionData.userIdentifier,\n\t\t\t\tuserEmail:\n\t\t\t\t\tuser_email || (this.sessionData.userObject as any)?.name,\n\t\t\t},\n\t\t})\n\t}\n\n\t// Reset the events array and push to a backend.\n\tasync _save() {\n\t\ttry {\n\t\t\tif (\n\t\t\t\tthis.state === 'Recording' &&\n\t\t\t\tthis.listeners &&\n\t\t\t\tthis.sessionData.sessionStartTime &&\n\t\t\t\tDate.now() - this.sessionData.sessionStartTime >\n\t\t\t\t\tMAX_SESSION_LENGTH\n\t\t\t) {\n\t\t\t\tthis.logger.log(`Resetting session`, {\n\t\t\t\t\tstart: this.sessionData.sessionStartTime,\n\t\t\t\t})\n\t\t\t\tawait this._reset({})\n\t\t\t}\n\t\t\tlet sendFn = undefined\n\t\t\tif (this.options?.sendMode === 'local') {\n\t\t\t\tsendFn = async (payload: any) => {\n\t\t\t\t\tlet blob = new Blob(\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\t\tquery: print(PushPayloadDocument),\n\t\t\t\t\t\t\t\tvariables: payload,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t],\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: 'application/json',\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t\tawait window.fetch(`${this._backendUrl}`, {\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\tbody: blob,\n\t\t\t\t\t})\n\t\t\t\t\treturn 0\n\t\t\t\t}\n\t\t\t}\n\t\t\tawait this._sendPayload({ sendFn })\n\t\t\tthis.hasPushedData = true\n\t\t\tthis.sessionData.lastPushTime = Date.now()\n\t\t\tsetSessionData(this.sessionData)\n\t\t} catch (e) {\n\t\t\tif (this._isOnLocalHost) {\n\t\t\t\tconsole.error(e)\n\t\t\t\tHighlightWarning('_save', e)\n\t\t\t}\n\t\t}\n\t\tif (this.state === 'Recording') {\n\t\t\tif (this.pushPayloadTimerId) {\n\t\t\t\tclearTimeout(this.pushPayloadTimerId)\n\t\t\t\tthis.pushPayloadTimerId = undefined\n\t\t\t}\n\t\t\tthis.pushPayloadTimerId = setTimeout(() => {\n\t\t\t\tthis._save()\n\t\t\t}, SEND_FREQUENCY)\n\t\t}\n\t}\n\n\t/**\n\t * This proxy should be used instead of rrweb's native addCustomEvent.\n\t * The proxy makes sure recording has started before emitting a custom event.\n\t */\n\taddCustomEvent(tag: string, payload: T): void {\n\t\tif (this.state === 'NotRecording') {\n\t\t\tlet intervalId: ReturnType\n\t\t\tconst worker = () => {\n\t\t\t\tclearInterval(intervalId)\n\t\t\t\tif (this.state === 'Recording' && this.events.length > 0) {\n\t\t\t\t\trrwebAddCustomEvent(tag, payload)\n\t\t\t\t} else {\n\t\t\t\t\tintervalId = setTimeout(worker, 500)\n\t\t\t\t}\n\t\t\t}\n\t\t\tintervalId = setTimeout(worker, 500)\n\t\t} else if (\n\t\t\tthis.state === 'Recording' &&\n\t\t\t(this.events.length > 0 || this.hasPushedData)\n\t\t) {\n\t\t\trrwebAddCustomEvent(tag, payload)\n\t\t}\n\t}\n\n\tasync _sendPayload({\n\t\tsendFn,\n\t}: {\n\t\tsendFn?: (payload: PushPayloadMutationVariables) => Promise\n\t}) {\n\t\tconst resources = FirstLoadListeners.getRecordedNetworkResources(\n\t\t\tthis._firstLoadListeners,\n\t\t\tthis._recordingStartTime,\n\t\t)\n\t\tconst webSocketEvents = FirstLoadListeners.getRecordedWebSocketEvents(\n\t\t\tthis._firstLoadListeners,\n\t\t)\n\t\tconst events = [...this.events]\n\t\tconst messages = [...this._firstLoadListeners.messages]\n\t\tconst errors = [...this._firstLoadListeners.errors]\n\n\t\t// if it is time to take a full snapshot,\n\t\t// ensure the snapshot is at the beginning of the next payload\n\t\t// After snapshot thresholds have been met,\n\t\t// take a full snapshot and reset the counters\n\t\tconst { bytes, time } = this.enableCanvasRecording\n\t\t\t? SNAPSHOT_SETTINGS.canvas\n\t\t\t: SNAPSHOT_SETTINGS.normal\n\t\tif (\n\t\t\tthis._eventBytesSinceSnapshot >= bytes &&\n\t\t\tnew Date().getTime() - this._lastSnapshotTime >= time\n\t\t) {\n\t\t\tthis.takeFullSnapshot()\n\t\t}\n\n\t\tthis.logger.log(\n\t\t\t`Sending: ${events.length} events, ${messages.length} messages, ${resources.length} network resources, ${errors.length} errors \\nTo: ${this._backendUrl}\\nOrg: ${this.organizationID}\\nSessionSecureID: ${this.sessionData.sessionSecureID}`,\n\t\t)\n\t\tconst highlightLogs = getHighlightLogs()\n\t\tif (sendFn) {\n\t\t\tawait sendFn({\n\t\t\t\tsession_secure_id: this.sessionData.sessionSecureID,\n\t\t\t\tpayload_id: this.sessionData.payloadID.toString(),\n\t\t\t\tevents: { events } as ReplayEventsInput,\n\t\t\t\tmessages: stringify({ messages: messages }),\n\t\t\t\tresources: JSON.stringify({ resources: resources }),\n\t\t\t\tweb_socket_events: JSON.stringify({\n\t\t\t\t\twebSocketEvents: webSocketEvents,\n\t\t\t\t}),\n\t\t\t\terrors,\n\t\t\t\tis_beacon: false,\n\t\t\t\thas_session_unloaded: this.hasSessionUnloaded,\n\t\t\t})\n\t\t} else {\n\t\t\tthis._worker.postMessage({\n\t\t\t\tmessage: {\n\t\t\t\t\ttype: MessageType.AsyncEvents,\n\t\t\t\t\tid: this.sessionData.payloadID++,\n\t\t\t\t\tevents,\n\t\t\t\t\tmessages,\n\t\t\t\t\terrors,\n\t\t\t\t\tresourcesString: JSON.stringify({ resources: resources }),\n\t\t\t\t\twebSocketEventsString: JSON.stringify({\n\t\t\t\t\t\twebSocketEvents: webSocketEvents,\n\t\t\t\t\t}),\n\t\t\t\t\thasSessionUnloaded: this.hasSessionUnloaded,\n\t\t\t\t\thighlightLogs: highlightLogs,\n\t\t\t\t},\n\t\t\t})\n\t\t}\n\t\tsetSessionData(this.sessionData)\n\n\t\t// If sendFn throws an exception, the data below will not be cleared, and it will be re-uploaded on the next PushPayload.\n\t\tFirstLoadListeners.clearRecordedNetworkResources(\n\t\t\tthis._firstLoadListeners,\n\t\t)\n\t\t// We are creating a weak copy of the events. rrweb could have pushed more events to this.events while we send the request with the events as a payload.\n\t\t// Originally, we would clear this.events but this could lead to a race condition.\n\t\t// Example Scenario:\n\t\t// 1. Create the events payload from this.events (with N events)\n\t\t// 2. rrweb pushes to this.events (with M events)\n\t\t// 3. Network request made to push payload (Only includes N events)\n\t\t// 4. this.events is cleared (we lose M events)\n\t\tthis.events = this.events.slice(events.length)\n\n\t\tthis._firstLoadListeners.messages =\n\t\t\tthis._firstLoadListeners.messages.slice(messages.length)\n\t\tthis._firstLoadListeners.errors = this._firstLoadListeners.errors.slice(\n\t\t\terrors.length,\n\t\t)\n\t\tclearHighlightLogs(highlightLogs)\n\t}\n\n\tprivate takeFullSnapshot() {\n\t\tthis.logger.log(`taking full snapshot`, {\n\t\t\tbytesSinceSnapshot: this._eventBytesSinceSnapshot,\n\t\t\tlastSnapshotTime: this._lastSnapshotTime,\n\t\t})\n\t\trecord.takeFullSnapshot(true)\n\t\tthis._eventBytesSinceSnapshot = 0\n\t\tthis._lastSnapshotTime = new Date().getTime()\n\t}\n}\n\ninterface HighlightWindow extends Window {\n\tHighlight: Highlight\n\tIntercom?: any\n\telectron?: {\n\t\tipcRenderer: {\n\t\t\ton: (channel: string, listener: (...args: any[]) => void) => {}\n\t\t}\n\t}\n\tCypress?: any\n}\n\ndeclare var window: HighlightWindow\n\ndeclare global {\n\tinterface Console {\n\t\tdefaultLog: any\n\t\tdefaultError: any\n\t\tdefaultWarn: any\n\t\tdefaultDebug: any\n\t}\n}\nexport {\n\tFirstLoadListeners,\n\tGenerateSecureID,\n\tMetricCategory,\n\tgetPreviousSessionData,\n\tsetupBrowserTracing,\n\tgetTracer,\n}\nexport type {\n\tAmplitudeIntegrationOptions,\n\tConsoleMessage,\n\tMixpanelIntegrationOptions,\n\tIntegration,\n\tMetadata,\n\tMetric,\n\tHighlightFetchWindow,\n\tHighlightOptions,\n\tHighlightPublicInterface,\n\tRequestResponsePair,\n\tSessionDetails,\n}\n","export class Logger {\n\tdebug: boolean | undefined\n\tname: string | undefined\n\n\tconstructor(debug?: boolean, name?: string) {\n\t\tthis.debug = debug\n\t\tthis.name = name\n\t}\n\n\tlog(...data: any[]) {\n\t\tif (this.debug) {\n\t\t\tlet prefix = `[${Date.now()}]`\n\t\t\tif (this.name) {\n\t\t\t\tprefix += ` - ${this.name}`\n\t\t\t}\n\t\t\tconsole.log.apply(console, [prefix, ...data])\n\t\t}\n\t}\n}\n","import { getSimpleSelector } from '../../utils/dom'\n\n// samples taken to calculate expected RAF\nconst RAF_SAMPLES = 30\n\nexport interface JankPayload {\n\trelativeTimestamp: number\n\tjankAmount: number\n\tquerySelector: string\n\tnewLocation?: string\n}\n\nconst getRAFDuration = () => {\n\treturn new Promise((resolve) =>\n\t\trequestAnimationFrame((t1) =>\n\t\t\trequestAnimationFrame((t2) => resolve(t2 - t1)),\n\t\t),\n\t)\n}\n\nconst getExpectedRAFDuration = async () => {\n\tconst rafs: number[] = []\n\tfor (let i = 0; i < RAF_SAMPLES; i++) {\n\t\trafs.push(await getRAFDuration())\n\t}\n\treturn rafs.reduce((a, b) => a + b, 0) / rafs.length\n}\n\nexport const JankListener = (\n\tcallback: (payload: JankPayload) => void,\n\trecordingStartTime: number,\n) => {\n\tlet jankState: { event?: UIEvent; location?: string; timerStart?: number } =\n\t\t{}\n\t// use 60 fps refresh rate as a default until we measure expected\n\tlet expectedRAFDuration = 1000 / 60\n\tgetExpectedRAFDuration().then((raf) => (expectedRAFDuration = raf))\n\n\tconst listener = (e: MouseEvent | KeyboardEvent) => {\n\t\t// only one event listener at a time\n\t\tif (jankState?.event) return\n\t\tjankState = {\n\t\t\tevent: e,\n\t\t\tlocation: window.location.href,\n\t\t\ttimerStart: window.performance?.now(),\n\t\t}\n\t\twindow.requestAnimationFrame(onAnimationFrame)\n\t}\n\n\tconst onAnimationFrame = () => {\n\t\tif (!jankState?.timerStart) return\n\t\t// the amount of time (ms) that a frame is delayed due to JS execution.\n\t\tconst jankAmount =\n\t\t\twindow.performance.now() -\n\t\t\tjankState.timerStart -\n\t\t\texpectedRAFDuration\n\n\t\treportJank(jankAmount)\n\n\t\t// Reset jankState so we capture the next event\n\t\tjankState = {}\n\t}\n\n\tconst reportJank = (jank: number) => {\n\t\tconst relativeTimestamp =\n\t\t\t(new Date().getTime() - recordingStartTime) / 1000\n\t\tcallback({\n\t\t\trelativeTimestamp,\n\t\t\tjankAmount: jank,\n\t\t\tquerySelector: generateQuerySelector(),\n\t\t\tnewLocation:\n\t\t\t\twindow.location.href != jankState.location\n\t\t\t\t\t? window.location.href\n\t\t\t\t\t: undefined,\n\t\t})\n\t}\n\n\tconst generateQuerySelector = () => {\n\t\tif (!jankState?.event?.target) return ''\n\t\treturn getSimpleSelector(jankState.event.target as HTMLElement)\n\t}\n\n\twindow.addEventListener('click', listener, true)\n\twindow.addEventListener('keydown', listener, true)\n\n\treturn () => {\n\t\twindow.removeEventListener('keydown', listener, true)\n\t\twindow.removeEventListener('click', listener, true)\n\t}\n}\n","export const IFRAME_PARENT_READY = 'iframe parent ready'\n\nexport interface HighlightIframeMessage {\n\thighlight: typeof IFRAME_PARENT_READY\n\tprojectID: number\n\tsessionSecureID: string\n}\n\nexport const IFRAME_PARENT_RESPONSE = 'iframe ok'\n\nexport interface HighlightIframeReponse {\n\thighlight: typeof IFRAME_PARENT_RESPONSE\n}\n","// taken from: https://stackoverflow.com/questions/6390341/how-to-detect-if-url-has-changed-after-hash-in-javascript/52809105#52809105\nexport const PathListener = (callback: (url: string) => void) => {\n\tcallback(window.location.href)\n\tconst initialPushState = history.pushState\n\thistory.pushState = ((f) =>\n\t\tfunction pushState() {\n\t\t\t// @ts-ignore\n\t\t\tvar ret = f.apply(this, arguments)\n\t\t\twindow.dispatchEvent(new Event('pushstate'))\n\t\t\twindow.dispatchEvent(new Event('locationchange'))\n\t\t\treturn ret\n\t\t})(history.pushState)\n\n\tconst initialReplaceState = history.replaceState\n\thistory.replaceState = ((f) =>\n\t\tfunction replaceState() {\n\t\t\t// @ts-ignore\n\t\t\tvar ret = f.apply(this, arguments)\n\t\t\twindow.dispatchEvent(new Event('replacestate'))\n\t\t\twindow.dispatchEvent(new Event('locationchange'))\n\t\t\treturn ret\n\t\t})(history.replaceState)\n\n\tconst onPopState = () => {\n\t\twindow.dispatchEvent(new Event('locationchange'))\n\t}\n\twindow.addEventListener('popstate', onPopState)\n\n\tconst onLocationChange = function () {\n\t\tcallback(window.location.href)\n\t}\n\twindow.addEventListener('locationchange', onLocationChange)\n\n\treturn () => {\n\t\twindow.removeEventListener('popstate', onPopState)\n\t\twindow.removeEventListener('locationchange', onLocationChange)\n\t\thistory.pushState = initialPushState\n\t\thistory.replaceState = initialReplaceState\n\t}\n}\n","export type ViewportResizeListenerArgs = Omit & {\n\torientation: number\n}\n\nexport const ViewportResizeListener = (\n\tcallback: (args: ViewportResizeListenerArgs) => void,\n) => {\n\tlet id: ReturnType\n\tconst DELAY = 500\n\n\tconst onResize = () => {\n\t\tclearTimeout(id)\n\t\tid = setTimeout(() => {\n\t\t\tcallback({\n\t\t\t\theight: window.innerHeight,\n\t\t\t\twidth: window.innerWidth,\n\t\t\t\tavailHeight: window.screen.availHeight,\n\t\t\t\tavailWidth: window.screen.availWidth,\n\t\t\t\tcolorDepth: window.screen.colorDepth,\n\t\t\t\tpixelDepth: window.screen.pixelDepth,\n\t\t\t\torientation: window.screen.orientation.angle,\n\t\t\t})\n\t\t}, DELAY)\n\t}\n\twindow.addEventListener('resize', onResize)\n\n\t// call on initial listener creation\n\tonResize()\n\treturn () => window.removeEventListener('resize', onResize)\n}\n","import { getElementSelector } from '../../utils/dom'\n\nexport const ClickListener = (\n\tcallback: (targetSelector: string, event: MouseEvent) => void,\n) => {\n\tconst recordClick = (event: MouseEvent) => {\n\t\tif (event.target) {\n\t\t\tconst element = event.target as Element\n\t\t\tconst targetSelector = getElementSelector(element)\n\n\t\t\tcallback(targetSelector, event)\n\t\t}\n\t}\n\twindow.addEventListener('click', recordClick)\n\treturn () => window.removeEventListener('click', recordClick)\n}\n","import { getElementSelector } from '../../utils/dom'\n\nexport const FocusListener = (callback: (targetSelector: string) => void) => {\n\tconst recordFocus = (event: FocusEvent) => {\n\t\tif (event.target) {\n\t\t\tconst targetSelector = getElementSelector(event.target as Element)\n\t\t\tcallback(targetSelector)\n\t\t}\n\t}\n\twindow.addEventListener('focusin', recordFocus)\n\treturn () => window.removeEventListener('focusin', recordFocus)\n}\n","export const PageVisibilityListener = (\n\tcallback: (isTabHidden: boolean) => void,\n) => {\n\tlet hidden: string | undefined = undefined\n\tlet visibilityChangeEventName: string | undefined = undefined\n\n\tif (typeof document.hidden !== 'undefined') {\n\t\t// Opera 12.10 and Firefox 18 and later support\n\t\thidden = 'hidden'\n\t\tvisibilityChangeEventName = 'visibilitychange'\n\t\t// @ts-expect-error\n\t} else if (typeof document.msHidden !== 'undefined') {\n\t\thidden = 'msHidden'\n\t\tvisibilityChangeEventName = 'msvisibilitychange'\n\t\t// @ts-expect-error\n\t} else if (typeof document.webkitHidden !== 'undefined') {\n\t\thidden = 'webkitHidden'\n\t\tvisibilityChangeEventName = 'webkitvisibilitychange'\n\t}\n\n\tif (visibilityChangeEventName === undefined) {\n\t\treturn () => {}\n\t}\n\tif (hidden === undefined) {\n\t\treturn () => {}\n\t}\n\n\tconst hiddenPropertyName = hidden\n\tconst listener = () => {\n\t\t// @ts-expect-error\n\t\tconst tabState = document[hiddenPropertyName]\n\n\t\tif (tabState) {\n\t\t\tcallback(true)\n\t\t} else {\n\t\t\tcallback(false)\n\t\t}\n\t}\n\n\tdocument.addEventListener(visibilityChangeEventName, listener)\n\n\tconst eventNameToRemove = visibilityChangeEventName\n\n\treturn () => document.removeEventListener(eventNameToRemove, listener)\n}\n"],"names":["_taggedTemplateLiteral","strings","raw","slice","Object","freeze","defineProperties","value","gl","Vl","e","Wl","charCodeAt","fl","Sl","t","i","enter","leave","$n","arguments","length","undefined","ol","n","Map","_i2","_Object$values","values","nl","V","set","s","d","u","l","Array","isArray","o","r","a","c","p","h","I","pop","_step3","G","_iterator3","_createForOfIteratorHelper","done","_step3$value","_slicedToArray","w","U","f","splice","err","getOwnPropertyDescriptors","_step4","_iterator4","_step4$value","index","keys","edits","inArray","prev","push","W","y","Z","b","_i","sl","concat","ll","get","kind","call","Il","Cl","Name","Variable","name","Document","S","definitions","OperationDefinition","v","variableDefinitions","operation","directives","selectionSet","VariableDefinition","_ref","variable","type","defaultValue","SelectionSet","_ref2","me","selections","Field","_ref3","alias","Ct","Argument","_ref4","FragmentSpread","_ref5","InlineFragment","_ref6","typeCondition","FragmentDefinition","_ref7","IntValue","_ref8","FloatValue","_ref9","StringValue","_ref10","block","al","replace","Xl","BooleanValue","_ref11","NullValue","EnumValue","_ref12","ListValue","_ref13","ObjectValue","_ref14","fields","ObjectField","_ref15","Directive","_ref16","NamedType","_ref17","ListType","_ref18","NonNullType","_ref19","SchemaDefinition","_ref20","description","operationTypes","OperationTypeDefinition","_ref21","ScalarTypeDefinition","_ref22","ObjectTypeDefinition","_ref23","interfaces","FieldDefinition","_ref24","sn","InputValueDefinition","_ref25","InterfaceTypeDefinition","_ref26","UnionTypeDefinition","_ref27","types","EnumTypeDefinition","_ref28","EnumValueDefinition","_ref29","InputObjectTypeDefinition","_ref30","DirectiveDefinition","_ref31","repeatable","locations","SchemaExtension","_ref32","ScalarTypeExtension","_ref33","ObjectTypeExtension","_ref34","InterfaceTypeExtension","_ref35","UnionTypeExtension","_ref36","EnumTypeExtension","_ref37","InputObjectTypeExtension","_ref38","filter","join","some","includes","ln","Ll","defineProperty","g","enumerable","configurable","writable","Yl","Nl","on","kl","_","DocumentType","Element","Text","CDATA","Comment","an","Node","ShadowRoot","MutationObserver","rn","gt","Ji","globalThis","prototype","every","getOwnPropertyDescriptor","toString","document","createElement","body","appendChild","contentWindow","removeChild","oi","Ye","String","ai","es","bind","$","childNodes","parentNode","parentElement","textContent","contains","getRootNode","host","styleSheets","shadowRoot","querySelector","querySelectorAll","mutationObserver","constructor","ts","nodeType","ELEMENT_NODE","lt","ot","Jt","rules","cssRules","Pl","from","is","href","Dl","styleSheet","cssText","split","JSON","stringify","layerName","supportsText","media","mediaText","El","wt","Ql","selectorText","Ol","ns","_classCallCheck","this","WeakMap","_createClass","key","getMeta","id","idNodeMap","nodeMetaMap","_this","getId","delete","forEach","removeNodeFromMap","has","getNode","wi","_ref39","element","maskInputOptions","tagName","overwriteRecord","maskInputFn","os","repeat","Qe","toLowerCase","cn","Ti","hasAttribute","ss","URL","window","location","pathname","match","ql","$l","eo","to","test","indexOf","_l","_step5","_iterator5","vi","map","Math","random","substr","fi","co","RegExp","ls","Ue","dn","_ref40","uo","mo","dt","as","po","bo","un","Be","trim","xi","yo","ownerSVGElement","startsWith","setAttribute","rs","exec","substring","charAt","Zo","cs","mn","classList","matches","Tt","ds","closest","go","doc","mirror","blockClass","blockSelector","needsMask","inlineStylesheet","_t$maskInputOptions","maskTextClass","maskTextFn","_t$dataURLOptions","dataURLOptions","inlineImages","recordCanvas","keepIframeSrcFn","_t$newlyAddedElement","newlyAddedElement","privacySetting","hasNode","Vo","DOCUMENT_NODE","compatMode","DOCUMENT_TYPE_NODE","publicId","systemId","rootId","_t$maskInputOptions2","_t$dataURLOptions2","_t$newlyAddedElement2","HTMLFormElement","ho","attributes","C","find","z","rel","_cssText","sheet","innerText","checked","getAttribute","selected","select","open","rr_open_mode","__context","getContext","width","height","getImageData","Uint32Array","min","data","buffer","Al","rr_dataURL","toDataURL","quality","currentSrc","crossOrigin","J","removeEventListener","naturalWidth","naturalHeight","drawImage","M","complete","addEventListener","console","warn","removeAttribute","rr_mediaState","paused","rr_mediaCurrentTime","currentTime","rr_mediaPlaybackRate","playbackRate","rr_mediaMuted","muted","rr_mediaLoop","loop","rr_mediaVolume","volume","scrollLeft","rr_scrollLeft","scrollTop","rr_scrollTop","_e$getBoundingClientR","getBoundingClientRect","class","rr_width","rr_height","src","contentDocument","rr_src","customElements","_e$getBoundingClientR2","rr_inlined_video","isSVG","needBlock","needMask","isCustom","fo","TEXT_NODE","nextSibling","previousSibling","Set","isStyle","Wo","CDATA_SECTION_NODE","COMMENT_NODE","O","Pe","maskTextSelector","_t$skipChild","skipChild","_t$inlineStylesheet","_t$maskInputOptions3","slimDOMOptions","_t$dataURLOptions3","_t$inlineImages","_t$recordCanvas","onSerialize","onIframeLoad","_t$iframeLoadTimeout","iframeLoadTimeout","onStylesheetLoad","_t$stylesheetLoadTime","stylesheetLoadTimeout","_t$keepIframeSrcFn","_t$newlyAddedElement3","_t$preserveWhiteSpace","preserveWhiteSpace","q","comment","script","headFavicon","headMetaDescKeywords","headMetaSocial","property","headMetaRobots","headMetaHttpEquiv","headMetaAuthorship","headMetaVerification","Io","k","assign","add","m","X","L","Y","cloneNode","T","isShadowHost","headWhitespace","_i4","_Array$from","ee","_i5","_Array$from2","isShadow","E","readyState","setTimeout","clearTimeout","Go","Xo","Ro","ae","Co","Ki","firstChild","ownerDocument","Error","hn","pn","Vt","Fi","ri","Ne","ci","us","ms","x","se","capture","Me","bn","error","reset","ut","_len","_key","Date","now","leading","apply","trailing","Et","_this2","_e","__rrweb_original__","Proxy","Reflect","vt","hs","left","scrollingElement","pageXOffset","documentElement","top","pageYOffset","ps","innerHeight","clientHeight","bs","innerWidth","clientWidth","Zs","getTime","Uo","HTMLElement","te","di","headTitleMutations","ys","Ii","changedTouches","Gs","nodeName","Xs","Si","zo","styleIDMap","idStyleMap","gs","DOCUMENT_FRAGMENT_NODE","Po","Bo","Vs","H","DomContentLoaded","Load","FullSnapshot","IncrementalSnapshot","Meta","Custom","Plugin","K","Mutation","MouseMove","MouseInteraction","Scroll","ViewportResize","Input","TouchMove","MediaInteraction","StyleSheetRule","CanvasMutation","Font","Log","Drag","StyleDeclaration","Selection","AdoptedStyleSheet","CustomElement","le","MouseUp","MouseDown","Click","ContextMenu","DblClick","Focus","Blur","TouchStart","TouchMove_Departed","TouchEnd","TouchCancel","Ie","Mouse","Pen","Touch","je","WebGL","WebGL2","ze","Play","Pause","Seeked","VolumeChange","RateChange","Zn","at","Eo","head","next","previous","__ln","tail","yn","Oo","_this3","processMutation","emit","frozen","locked","addNode","iframeManager","addIframe","stylesheetManager","trackLinkElement","shadowDomManager","addShadowRoot","attachIframe","observeAttachShadow","attachLinkElement","parentId","nextId","node","mapRemoves","shift","_step6","_iterator6","movedSet","Gn","removes","_step7","_iterator7","addedSet","Xn","droppedSet","removeNode","texts","genTextAreaValueMutation","style","styleDiff","_unchangedStyles","adds","attributeMap","movedMap","mutationCb","target","oldValue","attributeName","unattachedDoc","implementation","createHTMLDocument","_i7","_Array$from3","getPropertyValue","getPropertyPriority","_i8","_Array$from4","addedNodes","genAdds","removedNodes","Ho","Ri","processedNodeManager","inOtherBuffer","_this4","canvasManager","unfreeze","lock","unlock","_ret","_loop3","Do","size","Ws","F","Te","ht","composedPath","path","fs","init","processMutations","observe","attributeOldValue","characterData","characterDataOldValue","childList","subtree","_o","_ref44","mouseInteractionCb","sampling","mouseInteraction","Number","isNaN","endsWith","pointerType","clientX","clientY","R","PointerEvent","Is","_ref45","scrollCb","defaultView","scroll","$o","gn","xt","Wt","parentRule","CSSGroupingRule","CSSMediaRule","CSSSupportsRule","CSSConditionRule","unshift","parentStyleSheet","Se","ownerNode","styleId","Ss","_ref55","adoptStyleSheets","ra","mousemoveCb","viewportResizeCb","inputCb","mediaInteractionCb","styleSheetRuleCb","styleDeclarationCb","canvasMutationCb","fontCb","selectionCb","customElementCb","mutation","mousemove","viewportResize","input","mediaInteaction","styleSheetRule","styleDeclaration","canvasMutation","font","selection","customElement","aa","recordDOM","_ref42","mousemoveCallback","timeOffset","_ref43","DragEvent","MouseEvent","Ao","_ref46","_ref47","win","qo","_ref48","ignoreClass","ignoreSelector","userTriggeredOnInput","isTrusted","text","isChecked","userTriggered","ge","HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement","_toConsumableArray","ea","_ref58","na","_ref49","_ref50","CSSStyleSheet","insertRule","_p","_Se","styleMirror","rule","addRule","deleteRule","_Se2","removeRule","_Se3","replaceSync","_Se4","ft","entries","_ref51","_ref52","_Z","_Se5","_Se6","_ref53","_ref54","ta","_ref56","_ref57","ignoreCSSAttributes","CSSStyleDeclaration","setProperty","_c2","_Se7","priority","removeProperty","_Se8","remove","ia","collectFonts","_ref59","FontFace","family","descriptors","fontSource","Uint8Array","fonts","sa","_step8","getSelection","isCollapsed","rangeCount","getRangeAt","startContainer","startOffset","endContainer","endOffset","start","end","ranges","la","_ref60","define","oa","_iterator8","plugins","observer","callback","options","disconnect","Vn","generateIdFn","getIdToRemoteIdMap","getRemoteIdToIdMap","_this5","_this6","getRemoteId","iframeIdToRemoteIdMap","iframeRemoteIdToIdMap","ca","wrappedEmit","recordCrossOriginIframes","crossOriginIframeStyleMirror","generateId","handleMessage","iframes","crossOriginIframeMap","loadListener","isAttachIframe","adoptedStyleSheets","origin","source","transformCrossOriginEvent","event","isCheckout","_this7","crossOriginIframeMirror","replaceIdOnNode","crossOriginIframeRootIdMap","patchRootIdOnNode","timestamp","replaceIds","payload","positions","replaceStyleIds","styles","_step9","_iterator9","getIds","_this8","_this9","da","WeakSet","bypassOptions","patchAttachShadow","_this10","shadowDoms","restoreHandlers","Ee","ua","It","Wn","Rs","Ls","ha","Lt","Float32Array","Float64Array","Int32Array","Uint16Array","Int16Array","Int8Array","Uint8ClampedArray","rr_type","args","ArrayBuffer","ma","base64","DataView","byteOffset","byteLength","HTMLImageElement","HTMLCanvasElement","ImageData","Cs","fn","_len3","_key3","ba","preserveDrawingBuffer","In","_step11","getOwnPropertyNames","_iterator11","_loop5","_len4","_key4","canvas","setter","Ys","Sn","Blob","atob","ya","Ga","webkitURL","createObjectURL","Worker","revokeObjectURL","j","Yt","rt","Xa","_this12","latestId","invokeId","rafStamps","pendingCanvasMutations","recordVideos","initialSnapshotDelay","logger","worker","onmessage","snapshotInProgressMap","_d$data","dx","dy","dw","dh","commands","debug","status","initCanvasMutationObserver","initCanvasFPSObserver","resizeFactor","maxSnapshotDimension","clear","resetObservers","_this$logger","_len5","_key5","A","_regeneratorRuntime","mark","_callee","_d3","wrap","_context","abrupt","samplingManual","lastSnapshotTime","clearWebGLBuffer","getContextAttributes","COLOR_BUFFER_BIT","max","createImageBitmap","resizeWidth","resizeHeight","sent","postMessage","bitmap","logDebug","t0","finish","stop","_this13","requestAnimationFrame","_callee3","_this14","_context3","delay","delta","hadLoadingTime","snapshot","_callee2","_G$getBoundingClientR","_actualWidth$actualHe","_context2","actualWidth","videoWidth","actualHeight","videoHeight","boxWidth","boxHeight","outputWidth","outputHeight","scale","outputScale","offsetX","offsetY","Promise","all","catch","cancelAnimationFrame","startRAFTimestamping","startPendingCanvasMutationFlusher","_step10","CanvasRenderingContext2D","_iterator10","_loop4","_this11","_len2","_key2","pa","WebGLRenderingContext","WebGL2RenderingContext","Za","_this15","flushPendingCanvasMutations","_this16","_this17","flushPendingCanvasMutationFor","fe","ga","adoptedStyleSheetCb","trackedLinkElements","trackStylesheetInLinkElement","_this18","_step12","styleIds","_iterator12","_loop6","CSSRule","Va","nodeMap","_this19","active","Kt","Rn","he","We","checkoutEveryNms","checkoutEveryNth","_e$blockClass","_e$blockSelector","_e$ignoreClass","_e$ignoreSelector","_e$maskTextClass","_e$maskTextSelector","_e$inlineStylesheet","maskAllInputs","_e$maskTextFn","hooks","packFn","_e$sampling","mousemoveWait","_e$recordDOM","_e$recordCanvas","_e$recordCrossOriginI","_e$recordAfter","recordAfter","_e$userTriggeredOnInp","_e$collectFonts","_e$inlineImages","_e$keepIframeSrcFn","oe","_e$privacySetting","_e$ignoreCSSAttribute","$e","As","errorHandler","_s","bt","Qo","Zt","parent","et","B","jt","color","date","email","month","number","range","search","tel","time","url","week","textarea","password","At","NodeList","DOMTokenList","Mo","Ei","_t","Oi","_step13","_iterator13","ue","eventProcessor","D","Q","isFrozen","be","P","_step14","yt","Di","Qi","Je","we","_iterator14","getMirror","nodeMirror","qt","fps","fpsManual","Gt","_ref41","_ref41$mirror","_ref41$blockClass","_ref41$blockSelector","_ref41$maskTextClass","_ref41$maskTextSelect","_ref41$inlineStyleshe","_ref41$inlineImages","_ref41$recordCanvas","_ref41$maskAllInputs","_ref41$slimDOM","slimDOM","_ref41$keepIframeSrcF","_ref41$privacySetting","So","initialOffset","$t","plugin","addLoadListener","destroy","addCustomEvent","tag","freezePage","takeFullSnapshot","snapshotCanvas","_callee4","_context4","NotStarted","Running","Stopped","Cn","Ln","fa","_defineProperty","Ui","Sa","toUpperCase","Ca","variables","requestHeaders","signal","La","query","Yn","ui","qn","operationName","De","_Error","_inherits","_super","_createSuper","_this20","extractMessage","response","request","setPrototypeOf","_assertThisInitialized","captureStackTrace","errors","message","_wrapNativeSuper","self","cl","fetch","DOMException","Symbol","isView","TypeError","iterator","append","bodyUsed","reject","onload","result","onerror","FileReader","readAsArrayBuffer","_initBody","_bodyInit","_bodyText","isPrototypeOf","_bodyBlob","FormData","_bodyFormData","URLSearchParams","_bodyArrayBuffer","headers","blob","resolve","arrayBuffer","then","readAsText","fromCharCode","formData","json","parse","hasOwnProperty","credentials","method","mode","referrer","decodeURIComponent","ok","statusText","clone","redirect","RangeError","stack","create","aborted","XMLHttpRequest","abort","getAllResponseHeaders","responseURL","responseText","ontimeout","onabort","withCredentials","responseType","setRequestHeader","onreadystatechange","send","polyfill","Headers","Request","Response","ponyfill","default","exports","He","Na","Ft","Ra","_ref61","_ref62","Nn","ka","encodeURIComponent","jsonSerializer","reduce","Ja","_callee5","_context5","fetchOptions","middleware","Ta","wa","_this21","requestConfig","rawRequest","_len6","_key6","_callee6","_W$fetch","_W$method","_ui","_context6","Nt","requestMiddleware","responseMiddleware","mi","hi","_len7","_key7","_callee7","_b$fetch","_b$method","_ui2","_context7","_this22","documents","Ya","_ref63","_ref64","_callee8","_context8","va","_ref65","errorPolicy","_callee9","_context9","t1","t2","Ut","kt","Li","Ns","Ht","ks","Ka","xa","loc","Ua","experimentalFragmentVariables","allowLegacyFragmentVariables","startToken","endToken","Fa","Ae","it","gql","resetCaches","disableFragmentWarnings","enableExperimentalFragmentVariables","disableExperimentalFragmentVariables","kn","ke","BillingQuotaExceeded","Js","_templateObject","Pa","_templateObject2","Ea","_templateObject3","Oa","_templateObject4","Da","_templateObject5","Qa","_templateObject6","ja","_templateObject7","Aa","_templateObject8","_a","Ce","$a","USER_ID","USER_TRAITS","ANONYMOUS_ID","Le","Jn","userId","Xe","userTraits","anonymousId","pi","ir","Ve","SEGMENT_LAST_SENT_HASH_KEY","ve","ws","Yi","Ts","_step15","_iterator15","All","Two","One","vn","Xr","lastIndexOf","gr","fr","Us","Wr","ye","mods","shortcut","keyup","keydown","scope","splitKey","attachEvent","Ir","keyCode","which","charCode","ie","xn","ctrlKey","shiftKey","altKey","ne","getModifierState","Sr","Rr","Gi","navigator","userAgent","Vr","backspace","tab","return","esc","escape","space","up","right","down","del","ins","insert","home","pageup","pagedown","capslock","num_0","num_1","num_2","num_3","num_4","num_5","num_6","num_7","num_8","num_9","num_multiply","num_add","num_enter","num_subtract","num_decimal","num_divide","metaKey","alt","option","ctrl","control","cmd","command","preventDefault","returnValue","stopPropagation","cancelBubble","Re","ct","Hs","zt","Ni","ki","Ms","xe","persisted","timeStamp","Mi","performance","getEntriesByType","Dt","activationStart","ce","prerendering","wasDiscarded","rating","floor","navigationType","qe","PerformanceObserver","supportedEntryTypes","getEntries","buffered","de","zi","Qt","visibilityState","Bi","Oe","Kn","Bt","Cr","Fn","Pi","firstHiddenTime","pt","Un","zs","startTime","reportAllChanges","Hn","st","passive","Yr","Mn","Ps","Bs","entryType","cancelable","processingStart","Nr","zn","Es","Xi","Rt","Jr","interactionId","Os","interactionCount","Bn","Ds","Pn","Ge","gi","En","duration","latency","sort","Tr","durationThreshold","PerformanceEventTiming","takeRecords","On","Vi","Dn","xr","Kr","responseStart","Fr","hadRecentInput","Lr","kr","vr","Ur","getDeviceDetails","getCurrentDeviceDetails","deviceMemory","Hr","jsHeapSizeLimit","Wi","memory","totalJSHeapSize","usedJSHeapSize","pow","Qn","mt","Or","Pr","Qs","jn","Dr","pe","qr","$r","Initialize","AsyncEvents","Identify","Properties","Metrics","Feedback","CustomEvent","Stop","Pt","tc","N","_len9","_key9","log","lc","_callee13","_context13","timerStart","relativeTimestamp","jankAmount","newLocation","An","_n","nt","output","CLIENT_ID","js","_this23","sessionSecureID","ni","debugOptions","clientInteractions","storageMode","Zl","yl","skipCookieSessionDataLoad","_worker","Qr","_eventBytesSinceSnapshot","eventsSize","compressedSize","toFixed","stopRecording","qi","reloaded","sessionData","_i9","_Object$values2","$i","projectID","payloadID","sessionStartTime","_hasPreviouslyInitialized","_firstLoadListeners","Ke","_isCrossOriginIframe","recordCrossOriginIframe","_initMembers","_ref67","_this24","forceNew","_callee14","_i10","_Object$values3","_l2","_context14","pushPayloadTimerId","USER_IDENTIFIER","USER_OBJECT","initialize","identify","_this25","sessionShortcut","_recordingStartTime","_isOnLocalHost","hostname","ready","state","manualStopped","enableSegmentIntegration","enableCanvasRecording","enablePerformanceRecording","samplingStrategy","canvasFactor","canvasMaxSnapshotDimension","canvasClearWebGLBuffer","dataUrlOptions","ul","_backendUrl","backendUrl","baseURI","graphqlSDK","PushPayload","PushPayloadCompressed","identifySession","addSessionProperties","pushMetrics","addSessionFeedback","initializeSession","Ignore","qa","_callee12","_context12","ec","environment","appVersion","serviceName","organizationID","isRunningOnHighlight","firstloadVersion","_onToggleFeedbackFormVisibility","_optionsInternal","listeners","events","hasSessionUnloaded","hasPushedData","Intercom","highlightSessionURL","getCurrentSessionURLWithTimestamp","addProperties","_lastSnapshotTime","_lastVisibilityChangeTime","userIdentifier","userObject","user_identifier","user_object","consumeCustomError","consumeError","_ref68","cause","ml","lineNumber","columnNumber","stackTrace","toISOString","_ref69","_ref70","structuredClone","propertiesObject","propertyType","_callee15","_Ur","_$a","_$a2","_this26","_context15","webdriver","Cypress","stopListening","_reset","si","tt","disableSessionRecording","disableNetworkRecording","networkRecording","recordHeadersAndBody","destinationDomains","_setupCrossOriginIframe","organization_verbose_id","enable_strict_privacy","privacy_setting","enable_recording_network_contents","clientVersion","clientConfig","session_secure_id","client_id","network_recording_domains","disable_session_recording","secure_id","parseInt","project_id","backend","recordingStartTime","isListening","hasNetworkRecording","setupNetworkListener","startListening","_save","en","recordMetric","Fe","DeviceMemory","category","Ze","Device","group","_recordStop","canvasManualSnapshot","canvasInitialSnapshotDelay","domRecording","_setupCrossOriginIframeParent","_setupWindowListeners","_callee16","_context16","hl","disableBackgroundRecording","_callee17","_this27","_context17","highlight","_this28","setInterval","_this29","_Jn2","traits","_Jn","dl","_ref66","keyName","tr","history","pushState","dispatchEvent","Event","replaceState","Ia","reload","availHeight","screen","availWidth","colorDepth","pixelDepth","orientation","angle","er","submitViewportMetrics","yr","clickTextContent","clickSelector","Gr","WebVital","round","clearInterval","zr","li","_ref71","_ref72","Performance","electron","ipcRenderer","_ref73","visible","_visibilityHandler","hidden","msHidden","webkitHidden","Br","_ref74","ViewportHeight","ViewportWidth","ScreenHeight","ScreenWidth","ViewportArea","metrics","tags","Frontend","_this$sessionData","tn","_callee18","_context18","_ref75","verbatim","user_email","user_name","userName","userEmail","_callee20","_this30","_context20","pl","sendMode","_callee19","_context19","_sendPayload","sendFn","lastPushTime","bl","_this31","_ref76","_this32","_callee21","_ref77","_context21","getRecordedNetworkResources","getRecordedWebSocketEvents","messages","nn","normal","bytes","payload_id","resources","web_socket_events","webSocketEvents","is_beacon","has_session_unloaded","resourcesString","webSocketEventsString","highlightLogs","clearRecordedNetworkResources","bytesSinceSnapshot"],"sourceRoot":""}