PageSourceSearch

https://downstream.tackle.io/assets/amplitude-tKx3S5u4.js

js tackle.io collected 2026-10-02 06:20:54 UTC 563,562 bytes, 276 lines download raw bytes

1import{r as e}from"./rolldown-runtime-DAXXjFlN.js";var t=`modulepreload`,n=function(e){return`/`+e},r={},i=function(e,i,a){let o=Promise.resolve();if(i&&i.length>0){let e=document.getElementsByTagName(`link`),s=document.querySelector(`meta[property=csp-nonce]`),c=s?.nonce||s?.getAttribute(`nonce`);function l(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function u(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}o=l(i.map(i=>{if(i=n(i,a),i=u(i),i in r)return;r[i]=!0;let o=i.endsWith(`.css`);for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.href===i&&(!o||n.rel===`stylesheet`))return}let s=document.createElement(`link`);if(s.rel=o?`stylesheet`:t,o||(s.as=`script`),s.crossOrigin=``,s.href=i,c&&s.setAttribute(`nonce`,c),document.head.appendChild(s),o)return new Promise((e,t)=>{s.addEventListener(`load`,e),s.addEventListener(`error`,()=>t(Error(`Unable to preload CSS for ${i}`)))})}))}function s(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return o.then(t=>{for(let e of t||[])e.status===`rejected`&&s(e.reason);return e().catch(s)})},a=e({PLUGIN_NAME:()=>Ji,getRecordConsolePlugin:()=>Yi}),o=Object.defineProperty,s=(e,t,n)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c=(e,t,n)=>s(e,typeof t==`symbol`?t:t+``,n),l=Object.defineProperty,u=(e,t,n)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,d=(e,t,n)=>u(e,typeof t==`symbol`?t:t+``,n),f=Object.defineProperty,p=(e,t,n)=>t in e?f(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,m=(e,t,n)=>p(e,typeof t==`symbol`?t:t+``,n),h={Node:[`childNodes`,`parentNode`,`parentElement`,`textContent`],ShadowRoot:[`host`,`styleSheets`],Element:[`shadowRoot`,`querySelector`,`querySelectorAll`],MutationObserver:[]},g={Node:[`contains`,`getRootNode`],ShadowRoot:[`getSelection`],Element:[],MutationObserver:[`constructor`]},_={};function v(e){var t;let n=((t=globalThis==null?void 0:globalThis.Zone)?.__symbol__)?.call(t,e);if(n&&globalThis[n])return globalThis[n]}function y(e){if(_[e])return _[e];let t=v(e)||globalThis[e],n=t.prototype,r=e in h?h[e]:void 0,i=!!(r&&r.every(e=>!!(Object.getOwnPropertyDescriptor(n,e)?.get)?.toString().includes(`[native code]`))),a=e in g?g[e]:void 0,o=!!(a&&a.every(e=>typeof n[e]==`function`&&n[e]?.toString().includes(`[native code]`)));if(i&&o)return _[e]=t.prototype,t.prototype;try{let r=document.createElement(`iframe`);document.body.appendChild(r);let i=r.contentWindow;if(!i)return t.prototype;let a=i[e].prototype;return document.body.removeChild(r),a?_[e]=a:n}catch{return n}}var b={};function x(e,t,n){let r=`${e}.${String(n)}`;if(b[r])return b[r].call(t);let i=y(e),a=Object.getOwnPropertyDescriptor(i,n)?.get;return a?(b[r]=a,a.call(t)):t[n]}var S={};function C(e,t,n){let r=`${e}.${String(n)}`;if(S[r])return S[r].bind(t);let i=y(e)[n];return typeof i==`function`?(S[r]=i,i.bind(t)):t[n]}function w(e){return x(`Node`,e,`childNodes`)}function T(e){return x(`Node`,e,`parentNode`)}function E(e){return x(`Node`,e,`parentElement`)}function D(e){return x(`Node`,e,`textContent`)}function O(e,t){return C(`Node`,e,`contains`)(t)}function k(e){return C(`Node`,e,`getRootNode`)()}function A(e){return!e||!(`host`in e)?null:x(`ShadowRoot`,e,`host`)}function ee(e){return e.styleSheets}function te(e){return!e||!(`shadowRoot`in e)?null:x(`Element`,e,`shadowRoot`)}function j(e,t){return x(`Element`,e,`querySelector`)(t)}function ne(e,t){return x(`Element`,e,`querySelectorAll`)(t)}function re(){return y(`MutationObserver`).constructor}var ie={childNodes:w,parentNode:T,parentElement:E,textContent:D,contains:O,getRootNode:k,host:A,styleSheets:ee,shadowRoot:te,querySelector:j,querySelectorAll:ne,mutationObserver:re};function ae(e){let t=e&&`host`in e&&`mode`in e&&ie.host(e)||null;return!!(t&&`shadowRoot`in t&&ie.shadowRoot(t)===e)}var oe=class{constructor(){m(this,`idNodeMap`,new Map),m(this,`nodeMetaMap`,new WeakMap)}getId(e){return e?this.getMeta(e)?.id??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);
1this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){let n=this.getNode(e);if(n){let e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function se(){return new oe}var ce=-2;function le(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?le(ie.parentNode(e),t,n):!1;for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return n?le(ie.parentNode(e),t,n):!1}function ue(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function de(e){if(Object.prototype.hasOwnProperty.call(e,`__esModule`))return e;var t=e.default;if(typeof t==`function`){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var fe={exports:{}},pe;function me(){if(pe)return fe.exports;pe=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return fe.exports=t(),fe.exports.createColors=t,fe.exports}var he=de(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:`Module`}))),ge,_e;function ve(){if(_e)return ge;_e=1;let e=me(),t=he;class n extends Error{constructor(e,t,r,i,a,o){super(e),this.name=`CssSyntaxError`,this.reason=e,a&&(this.file=a),i&&(this.source=i),o&&(this.plugin=o),t!==void 0&&r!==void 0&&(typeof t==`number`?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,n)}setMessage(){this.message=this.plugin?this.plugin+`: `:``,this.message+=this.file?this.file:`<css input>`,this.line!==void 0&&(this.message+=`:`+this.line+`:`+this.column),this.message+=`: `+this.reason}showSourceCode(n){if(!this.source)return``;let r=this.source;n??=e.isColorSupported,t&&n&&(r=t(r));let i=r.split(/\r?\n/),a=Math.max(this.line-3,0),o=Math.min(this.line+2,i.length),s=String(o).length,c,l;if(n){let{bold:t,gray:n,red:r}=e.createColors(!0);c=e=>t(r(e)),l=e=>n(e)}else c=l=e=>e;return i.slice(a,o).map((e,t)=>{let n=a+1+t,r=` `+(` `+n).slice(-s)+` | `;if(n===this.line){let t=l(r.replace(/\d/g,` `))+e.slice(0,this.column-1).replace(/[^\t]/g,` `);return c(`>`)+l(r)+e+`
2 `+t+c(`^`)}return` `+l(r)+e}).join(`
3`)}toString(){let e=this.showSourceCode();return e&&=`
4
5`+e+`
6`,this.name+`: `+this.message+e}}return ge=n,n.default=n,ge}var ye={},be;function xe(){return be?ye:(be=1,ye.isClean=Symbol(`isClean`),ye.my=Symbol(`my`),ye)}var Se,Ce;function we(){if(Ce)return Se;Ce=1;let e={after:`
7`,beforeClose:`
8`,beforeComment:`
9`,beforeDecl:`
10`,beforeOpen:` `,beforeRule:`
11`,colon:`: `,commentLeft:` `,commentRight:` `,emptyBody:``,indent:`    `,semicolon:!1};function t(e){return e[0].toUpperCase()+e.slice(1)}class n{constructor(e){this.builder=e}atrule(e,t){let n=`@`+e.name,r=e.params?this.rawValue(e,`params`):``;if(e.raws.afterName===void 0?r&&(n+=` `):n+=e.raws.afterName,e.nodes)this.block(e,n+r);else{let i=(e.raws.between||``)+(t?`;`:``);this.builder(n+r+i,e)}}beforeAfter(e,t){let n;n=e.type===`decl`?this.raw(e,null,`beforeDecl`):e.type===`comment`?this.raw(e,null,`beforeComment`):t===`before`?this.raw(e,null,`beforeRule`):this.raw(e,null,`beforeClose`);let r=e.parent,i=0;for(;r&&r.type!==`root`;)i+=1,r=r.parent;if(n.includes(`
12`)){let t=this.raw(e,null,`indent`);if(t.length)for(let e=0;e<i;e++)n+=t}return n}block(e,t){let n=this.raw(e,`between`,`beforeOpen`);this.builder(t+n+`{`,e,`start`);let r;e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,`after`)):r=this.raw(e,`after`,`emptyBody`),r&&this.builder(r),this.builder(`}`,e,`end`)}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type===`comment`;)--t;let n=this.raw(e,`semicolon`);for(let r=0;r<e.nodes.length;r++){let i=e.nodes[r],a=this.raw(i,`before`);a&&this.builder(a),this.stringify(i,t!==r||n)}}comment(e){let t=this.raw(e,`left`,`commentLeft`),n=this.raw(e,`right`,`commentRight`);this.builder(`/*`+t+e.text+n+`*/`,e)}decl(e,t){let n=this.raw(e,`between`,`colon`),r=e.prop+n+this.rawValue(e,`value`);e.important&&(r+=e.raws.important||` !important`),t&&(r+=`;`),this.builder(r,e)}document(e){this.body(e)}raw(n,r,i){let a;if(i||=r,r&&(a=n.raws[r],a!==void 0))return a;let o=n.parent;if(i===`before`&&(!o||o.type===`root`&&o.first===n||o&&o.type===`document`))return``;if(!o)return e[i];let s=n.root();if(s.rawCache||={},s.rawCache[i]!==void 0)return s.rawCache[i];if(i===`before`||i===`after`)return this.beforeAfter(n,i);{let e=`raw`+t(i);this[e]?a=this[e](s,n):s.walk(e=>{if(a=e.raws[r],a!==void 0)return!1})}return a===void 0&&(a=e[i]),s.rawCache[i]=a,a}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&e.raws.after!==void 0)return t=e.raws.after,t.includes(`
13`)&&(t=t.replace(/[^\n]+$/,``)),!1}),t&&=t.replace(/\S/g,``),t}rawBeforeComment(e,t){let n;return e.walkComments(e=>{if(e.raws.before!==void 0)return n=e.raws.before,n.includes(`
14`)&&(n=n.replace(/[^\n]+$/,``)),!1}),n===void 0?n=this.raw(t,null,`beforeDecl`):n&&=n.replace(/\S/g,``),n}rawBeforeDecl(e,t){let n;return e.walkDecls(e=>{if(e.raws.before!==void 0)return n=e.raws.before,n.includes(`
15`)&&(n=n.replace(/[^\n]+$/,``)),!1}),n===void 0?n=this.raw(t,null,`beforeRule`):n&&=n.replace(/\S/g,``),n}rawBeforeOpen(e){let t;return e.walk(e=>{if(e.type!==`decl`&&(t=e.raws.between,t!==void 0))return!1}),t}rawBeforeRule(e){let t;return e.walk(n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&n.raws.before!==void 0)return t=n.raws.before,t.includes(`
16`)&&(t=t.replace(/[^\n]+$/,``)),!1}),t&&=t.replace(/\S/g,``),t}rawColon(e){let t;return e.walkDecls(e=>{if(e.raws.between!==void 0)return t=e.raws.between.replace(/[^\s:]/g,``),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length===0&&(t=e.raws.after,t!==void 0))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(n=>{let r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&n.raws.before!==void 0){let e=n.raws.before.split(`
17`);return t=e[e.length-1],t=t.replace(/\S/g,``),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&e.last.type===`decl`&&(t=e.raws.semicolon,t!==void 0))return!1}),t}rawValue(e,t){let n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,`selector`)),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,`end`)}stringify(e,t){if(!this[e.type])throw Error(`Unknown AST node type `+e.type+`. Maybe you need to change PostCSS stringifier.`);this[e.type](e,t)}}return Se=n,n.default=n,Se}var Te,Ee;function De(){if(Ee)return Te;Ee=1;let e=we();function t(t,n){new e(n).stringify(t)}return Te=t,t.default=t,Te}var Oe,ke;function Ae(){if(ke)return Oe;ke=1;let{isClean:e,my:t}=xe(),n=ve(),r=we(),i=De();function a(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r)||r===`proxyCache`)continue;let i=e[r],o=typeof i;r===`parent`&&o===`object`?t&&(n[r]=t):r===`source`?n[r]=i:Array.isArray(i)?n[r]=i.map(e=>a(e,n)):(o===`object`&&i!==null&&(i=a(i)),n[r]=i)}return n}class o{constructor(n={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in n)if(e===`nodes`){this.nodes=[];for(let t of n[e])typeof t.clone==`function`?this.append(t.clone()):this.append(t)}else this[e]=n[e]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=a(this);for(let n in e)t[n]=e[n];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}
17error(e,t={}){if(this.source){let{end:n,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:n.column,line:n.line},t)}return new n(e)}getProxyProcessor(){return{get(e,t){return t===`proxyOf`?e:t===`root`?()=>e.root().toProxy():e[t]},set(e,t,n){return e[t]===n?!0:(e[t]=n,(t===`prop`||t===`value`||t===`name`||t===`params`||t===`important`||t===`text`)&&e.markDirty(),!0)}}}markDirty(){if(this[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){t=this.toString();let r=t.indexOf(e.word);r!==-1&&(n=this.positionInside(r,t))}return n}positionInside(e,t){let n=t||this.toString(),r=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)n[t]===`
18`?(r=1,i+=1):r+=1;return{column:r,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let r=this.toString(),i=r.indexOf(e.word);i!==-1&&(t=this.positionInside(i,r),n=this.positionInside(i+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:typeof e.endIndex==`number`?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}}raw(e,t){return new r().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let r of e)r===this?n=!0:n?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);n||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!==`document`;)e=e.parent;return e}toJSON(e,t){let n={},r=t==null;t||=new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e)||e===`parent`||e===`proxyCache`)continue;let r=this[e];if(Array.isArray(r))n[e]=r.map(e=>typeof e==`object`&&e.toJSON?e.toJSON(null,t):e);else if(typeof r==`object`&&r.toJSON)n[e]=r.toJSON(null,t);else if(e===`source`){let a=t.get(r.input);a??(a=i,t.set(r.input,i),i++),n[e]={end:r.end,inputId:a,start:r.start}}else n[e]=r}return r&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||=new Proxy(this,this.getProxyProcessor()),this.proxyCache}toString(e=i){e.stringify&&(e=e.stringify);let t=``;return e(this,e=>{t+=e}),t}warn(e,t,n){let r={node:this};for(let e in n)r[e]=n[e];return e.warn(t,r)}get proxyOf(){return this}}return Oe=o,o.default=o,Oe}var je,Me;function Ne(){if(Me)return je;Me=1;let e=Ae();class t extends e{constructor(e){e&&e.value!==void 0&&typeof e.value!=`string`&&(e={...e,value:String(e.value)}),super(e),this.type=`decl`}get variable(){return this.prop.startsWith(`--`)||this.prop[0]===`$`}}return je=t,t.default=t,je}var Pe,Fe;function Ie(){return Fe?Pe:(Fe=1,Pe={nanoid:(e=21)=>{let t=``,n=e;for(;n--;)t+=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`[Math.random()*64|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r=``,i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r}},Pe)}var Le,Re;function ze(){if(Re)return Le;Re=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=he,{existsSync:n,readFileSync:r}=he,{dirname:i,join:a}=he;function o(e){return Buffer?Buffer.from(e,`base64`).toString():window.atob(e)}class s{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,`data:`);let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=i(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||=new e(this.text),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,n=/^data:application\/json;base64,/;if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||n.test(e))return o(e.substr(RegExp.lastMatch.length));let r=e.match(/data:application\/json;([^,]+),/)[1];throw Error(`Unsupported source map encoding `+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,``).trim()}isMap(e){return typeof e==`object`?typeof e.mappings==`string`||typeof e._mappings==`string`||Array.isArray(e.sections):!1}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);
18if(!t)return;let n=e.lastIndexOf(t.pop()),r=e.indexOf(`*/`,n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}loadFile(e){if(this.root=i(e),n(e))return this.mapFile=e,r(e,`utf-8`).toString().trim()}loadMap(n,r){if(r===!1)return!1;if(r){if(typeof r==`string`)return r;if(typeof r==`function`){let e=r(n);if(e){let t=this.loadFile(e);if(!t)throw Error(`Unable to load previous source map: `+e.toString());return t}}else if(r instanceof e)return t.fromSourceMap(r).toString();else if(r instanceof t)return r.toString();else if(this.isMap(r))return JSON.stringify(r);else throw Error(`Unsupported previous source map format: `+r.toString())}else if(this.inline)return this.decodeInline(this.annotation);else if(this.annotation){let e=this.annotation;return n&&(e=a(i(n),e)),this.loadFile(e)}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Le=s,s.default=s,Le}var Be,Ve;function He(){if(Ve)return Be;Ve=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=he,{fileURLToPath:n,pathToFileURL:r}=he,{isAbsolute:i,resolve:a}=he,{nanoid:o}
18=Ie(),s=he,c=ve(),l=ze(),u=Symbol(`fromOffsetCache`),d=!!(e&&t),f=!!(a&&i);class p{constructor(e,t={}){if(e==null||typeof e==`object`&&!e.toString)throw Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]===``||this.css[0]===`￾`?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!f||/^\w+:\/\//.test(t.from)||i(t.from)?this.file=t.from:this.file=a(t.from)),f&&d){let e=new l(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id=`<input css `+o(6)+`>`),this.map&&(this.map.file=this.from)}error(e,t,n,i={}){let a,o,s;if(t&&typeof t==`object`){let e=t,r=n;if(typeof e.offset==`number`){let r=this.fromOffset(e.offset);t=r.line,n=r.col}else t=e.line,n=e.column;if(typeof r.offset==`number`){let e=this.fromOffset(r.offset);o=e.line,s=e.col}else o=r.line,s=r.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let l=this.origin(t,n,o,s);return a=l?new c(e,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,i.plugin):new c(e,o===void 0?t:{column:n,line:t},o===void 0?n:{column:s,line:o},this.css,this.file,i.plugin),a.input={column:n,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(r&&(a.input.url=r(this.file).toString()),a.input.file=this.file),a}fromOffset(e){let t,n;if(this[u])n=this[u];else{let e=this.css.split(`
19`);n=Array(e.length);let t=0;for(let r=0,i=e.length;r<i;r++)n[r]=t,t+=e[r].length+1;this[u]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t=n.length-2,i;for(;r<t;)if(i=r+(t-r>>1),e<n[i])t=i-1;else if(e>=n[i+1])r=i+1;else{r=i;break}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:a(this.map.consumer().sourceRoot||this.map.root||`.`,e)}origin(e,t,a,o){if(!this.map)return!1;let s=this.map.consumer(),c=s.originalPositionFor({column:t,line:e});if(!c.source)return!1;let l;typeof a==`number`&&(l=s.originalPositionFor({column:o,line:a}));let u;u=i(c.source)?r(c.source):new URL(c.source,this.map.consumer().sourceRoot||r(this.map.mapFile));let d={column:c.column,endColumn:l&&l.column,endLine:l&&l.line,line:c.line,url:u.toString()};if(u.protocol===`file:`)if(n)d.file=n(u);else throw Error(`file: protocol is not available in this PostCSS build`);let f=s.sourceContentFor(c.source);return f&&(d.source=f),d}toJSON(){let e={};for(let t of[`hasBOM`,`css`,`file`,`id`])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}return Be=p,p.default=p,s&&s.registerInput&&s.registerInput(p),Be}var Ue,We;function Ge(){if(We)return Ue;We=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=he,{dirname:n,relative:r,resolve:i,sep:a}=he,{pathToFileURL:o}=he,s=He(),c=!!(e&&t),l=!!(n&&i&&r&&a);class u{constructor(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?`data:application/json;base64,`+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation==`string`?this.mapOpts.annotation:typeof this.mapOpts.annotation==`function`?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+`.map`;let t=`
20`;this.css.includes(`\r
21`)&&(t=`\r
22`),this.css+=t+`/*# sourceMappingURL=`+e+` */`}applyPrevMaps(){for(let t of this.previous()){let r=this.toUrl(this.path(t.file)),i=t.root||n(t.file),a;this.mapOpts.sourcesContent===!1?(a=new e(t.text),a.sourcesContent&&=null):a=t.consumer(),this.map.applySourceMap(a,r,this.toUrl(this.path(i)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type===`comment`&&e.text.indexOf(`# sourceMappingURL=`)===0&&this.root.removeChild(t)}else this.css&&=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,``)}generate(){if(this.clearAnnotation(),l&&c&&this.isMap())return this.generateMap();{let e=``;return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):`<no source>`});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css=``,this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,n=1,r=`<no source>`,i={generated:{column:0,line:0},original:{column:0,line:0},source:``},a,o;this.stringify(this.root,(t,s,c)=>{if(this.css+=t,s&&c!==`end`&&(i.generated.line=e,i.generated.column=n-1,s.source&&s.source.start?(i.source=this.sourcePath(s),i.original.line=s.source.start.line,i.original.column=s.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),a=t.match(/\n/g),a?(e+=a.length,o=t.lastIndexOf(`
23`),n=t.length-o):n+=t.length,s&&c!==`start`){let t=s.parent||{raws:{}};(!(s.type===`decl`||s.type===`atrule`&&!s.nodes)||s!==t.last||t.raws.semicolon)&&(s.source&&s.source.end?(i.source=this.sourcePath(s),i.original.line=s.source.end.line,i.original.column=s.source.end.column-1,i.generated.line=e,i.generated.column=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=e,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:this.mapOpts.annotation===void 0?!this.previous().length||this.previous().some(e=>e.annotation):this.mapOpts.annotation}isInline(){if(this.mapOpts.inline!==void 0)return this.mapOpts.inline;let e=this.mapOpts.annotation;return e!==void 0&&e!==!0?!1:!this.previous().length||this.previous().some(e=>e.inline)}isMap(){return this.opts.map===void 0?this.previous().length>0:!!this.opts.map}isSourcesContent(){return this.mapOpts.sourcesContent===void 0?!this.previous().length||this.previous().some(e=>e.withContent()):this.mapOpts.sourcesContent}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):`to.css`}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let a=this.opts.to?n(this.opts.to):`.`;typeof this.mapOpts.annotation==`string`&&(a=n(i(a,this.mapOpts.annotation)));
23let o=r(a,e);return this.memoizedPaths.set(e,o),o}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new s(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let r=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):`<no source>`;this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString(`base64`):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(o){let t=o(e).toString();return this.memoizedFileURLs.set(e,t),t}else throw Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;a===`\\`&&(e=e.replace(/\\/g,`/`));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}}return Ue=u,Ue}var Ke,qe;function Je(){if(qe)return Ke;qe=1;let e=Ae();class t extends e{constructor(e){super(e),this.type=`comment`}}return Ke=t,t.default=t,Ke}var Ye,Xe;function Ze(){if(Xe)return Ye;Xe=1;let{isClean:e,my:t}=xe(),n=Ne(),r=Je(),i=Ae(),a,o,s,c;function l(e){return e.map(e=>(e.nodes&&=l(e.nodes),delete e.source,e))}function u(t){if(t[e]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)u(e)}class d extends i{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),n,r;for(;this.indexes[t]<this.proxyOf.nodes.length&&(n=this.indexes[t],r=e(this.proxyOf.nodes[n],n),r!==!1);)this.indexes[t]+=1;return delete this.indexes[t],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||=0,this.indexes||={},this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return t===`proxyOf`?e:e[t]?t===`each`||typeof t==`string`&&t.startsWith(`walk`)?(...n)=>e[t](...n.map(e=>typeof e==`function`?(t,n)=>e(t.toProxy(),n):e)):t===`every`||t===`some`?n=>e[t]((e,...t)=>n(e.toProxy(),...t)):t===`root`?()=>e.root().toProxy():t===`nodes`?e.nodes.map(e=>e.toProxy()):t===`first`||t===`last`?e[t].toProxy():e[t]:e[t]},set(e,t,n){return e[t]===n?!0:(e[t]=n,(t===`name`||t===`params`||t===`selector`)&&e.markDirty(),!0)}}}index(e){return typeof e==`number`?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n=this.index(e),r=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of r)this.proxyOf.nodes.splice(n+1,0,e);let i;for(let e in this.indexes)i=this.indexes[e],n<i&&(this.indexes[e]=i+r.length);return this.markDirty(),this}insertBefore(e,t){let n=this.index(e),r=n===0&&`prepend`,i=this.normalize(t,this.proxyOf.nodes[n],r).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);let a;for(let e in this.indexes)a=this.indexes[e],n<=a&&(this.indexes[e]=a+i.length);return this.markDirty(),this}normalize(i,c){if(typeof i==`string`)i=l(a(i).nodes);else if(i===void 0)i=[];else if(Array.isArray(i)){i=i.slice(0);for(let e of i)e.parent&&e.parent.removeChild(e,`ignore`)}else if(i.type===`root`&&this.type!==`document`){i=i.nodes.slice(0);for(let e of i)e.parent&&e.parent.removeChild(e,`ignore`)}else if(i.type)i=[i];else if(i.prop){if(i.value===void 0)throw Error(`Value field is missed in node creation`);typeof i.value!=`string`&&(i.value=String(i.value)),i=[new n(i)]}else if(i.selector)i=[new o(i)];else if(i.name)i=[new s(i)];else if(i.text)i=[new r(i)];else throw Error(`Unknown node type in node creation`);return i.map(n=>(n[t]||d.rebuild(n),n=n.proxyOf,n.parent&&n.parent.removeChild(n),n[e]&&u(n),n.raws.before===void 0&&c&&c.raws.before!==void 0&&(n.raws.before=c.raws.before.replace(/\S/g,``)),n.parent=this.proxyOf,n))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,`prepend`).reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}
23replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,n)=>{let r;try{r=e(t,n)}catch(e){throw t.addToError(e)}return r!==!1&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`atrule`&&e.test(n.name))return t(n,r)}):this.walk((n,r)=>{if(n.type===`atrule`&&n.name===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`atrule`)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if(t.type===`comment`)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`decl`&&e.test(n.prop))return t(n,r)}):this.walk((n,r)=>{if(n.type===`decl`&&n.prop===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`decl`)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`rule`&&e.test(n.selector))return t(n,r)}):this.walk((n,r)=>{if(n.type===`rule`&&n.selector===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`rule`)return t(e,n)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return d.registerParse=e=>{a=e},d.registerRule=e=>{o=e},d.registerAtRule=e=>{s=e},d.registerRoot=e=>{c=e},Ye=d,d.default=d,d.rebuild=e=>{e.type===`atrule`?Object.setPrototypeOf(e,s.prototype):e.type===`rule`?Object.setPrototypeOf(e,o.prototype):e.type===`decl`?Object.setPrototypeOf(e,n.prototype):e.type===`comment`?Object.setPrototypeOf(e,r.prototype):e.type===`root`&&Object.setPrototypeOf(e,c.prototype),e[t]=!0,e.nodes&&e.nodes.forEach(e=>{d.rebuild(e)})},Ye}var Qe,$e;function et(){if($e)return Qe;$e=1;let e=Ze(),t,n;class r extends e{constructor(e){super({type:`document`,...e}),this.nodes||=[]}toResult(e={}){return new t(new n,this,e).stringify()}}return r.registerLazyResult=e=>{t=e},r.registerProcessor=e=>{n=e},Qe=r,r.default=r,Qe}var tt,nt;function rt(){if(nt)return tt;nt=1;let e={};return tt=function(t){e[t]||(e[t]=!0,typeof console<`u`&&console.warn&&console.warn(t))},tt}var it,at;function ot(){if(at)return it;at=1;class e{constructor(e,t={}){if(this.type=`warning`,this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+`: `+this.text:this.text}}return it=e,e.default=e,it}var st,ct;function lt(){if(ct)return st;ct=1;let e=ot();class t{constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let r=new e(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type===`warning`)}get content(){return this.css}}return st=t,t.default=t,st}var ut,dt;function ft(){if(dt)return ut;dt=1;let e=/[\t\n\f\r "#'()/;[\\\]{}]/g,t=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,n=/.[\r\n"'(/\\]/,r=/[\da-f]/i;return ut=function(i,a={}){let o=i.css.valueOf(),s=a.ignoreErrors,c,l,u,d,f,p,m,h,g,_,v=o.length,y=0,b=[],x=[];function S(){return y}function C(e){throw i.error(`Unclosed `+e,y)}function w(){return x.length===0&&y>=v}function T(i){if(x.length)return x.pop();if(y>=v)return;let a=i?i.ignoreUnclosed:!1;switch(c=o.charCodeAt(y),c){case 10:case 32:case 9:case 13:case 12:l=y;do l+=1,c=o.charCodeAt(l);while(c===32||c===10||c===9||c===13||c===12);_=[`space`,o.slice(y,l)],y=l-1;break;case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let e=String.fromCharCode(c);_=[e,e,y];break}
23case 40:if(h=b.length?b.pop()[1]:``,g=o.charCodeAt(y+1),h===`url`&&g!==39&&g!==34&&g!==32&&g!==10&&g!==9&&g!==12&&g!==13){l=y;do{if(p=!1,l=o.indexOf(`)`,l+1),l===-1)if(s||a){l=y;break}else C(`bracket`);for(m=l;o.charCodeAt(m-1)===92;)--m,p=!p}while(p);_=[`brackets`,o.slice(y,l+1),y,l],y=l}else l=o.indexOf(`)`,y+1),d=o.slice(y,l+1),l===-1||n.test(d)?_=[`(`,`(`,y]:(_=[`brackets`,d,y,l],y=l);break;case 39:case 34:u=c===39?`'`:`"`,l=y;do{if(p=!1,l=o.indexOf(u,l+1),l===-1)if(s||a){l=y+1;break}else C(`string`);for(m=l;o.charCodeAt(m-1)===92;)--m,p=!p}while(p);_=[`string`,o.slice(y,l+1),y,l],y=l;break;case 64:e.lastIndex=y+1,e.test(o),l=e.lastIndex===0?o.length-1:e.lastIndex-2,_=[`at-word`,o.slice(y,l+1),y,l],y=l;break;case 92:for(l=y,f=!0;o.charCodeAt(l+1)===92;)l+=1,f=!f;if(c=o.charCodeAt(l+1),f&&c!==47&&c!==32&&c!==10&&c!==9&&c!==13&&c!==12&&(l+=1,r.test(o.charAt(l)))){for(;r.test(o.charAt(l+1));)l+=1;o.charCodeAt(l+1)===32&&(l+=1)}_=[`word`,o.slice(y,l+1),y,l],y=l;break;default:c===47&&o.charCodeAt(y+1)===42?(l=o.indexOf(`*/`,y+2)+1,l===0&&(s||a?l=o.length:C(`comment`)),_=[`comment`,o.slice(y,l+1),y,l],y=l):(t.lastIndex=y+1,t.test(o),l=t.lastIndex===0?o.length-1:t.lastIndex-2,_=[`word`,o.slice(y,l+1),y,l],b.push(_),y=l);break}return y++,_}function E(e){x.push(e)}return{back:E,endOfFile:w,nextToken:T,position:S}},ut}var pt,mt;function ht(){if(mt)return pt;mt=1;let e=Ze();class t extends e{constructor(e){super(e),this.type=`atrule`}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}return pt=t,t.default=t,e.registerAtRule(t),pt}var gt,_t;function vt(){if(_t)return gt;_t=1;let e=Ze(),t,n;class r extends e{constructor(e){super(e),this.type=`root`,this.nodes||=[]}normalize(e,t,n){let r=super.normalize(e);if(t){if(n===`prepend`)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of r)e.raws.before=t.raws.before}return r}removeChild(e,t){let n=this.index(e);return!t&&n===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new t(new n,this,e).stringify()}}return r.registerLazyResult=e=>{t=e},r.registerProcessor=e=>{n=e},gt=r,r.default=r,e.registerRoot(r),gt}var yt,bt;function xt(){if(bt)return yt;bt=1;let e={comma(t){return e.split(t,[`,`],!0)},space(t){return e.split(t,[` `,`
24`,`	`])},split(e,t,n){let r=[],i=``,a=!1,o=0,s=!1,c=``,l=!1;for(let n of e)l?l=!1:n===`\\`?l=!0:s?n===c&&(s=!1):n===`"`||n===`'`?(s=!0,c=n):n===`(`?o+=1:n===`)`?o>0&&--o:o===0&&t.includes(n)&&(a=!0),a?(i!==``&&r.push(i.trim()),i=``,a=!1):i+=n;return(n||i!==``)&&r.push(i.trim()),r}};return yt=e,e.default=e,yt}var St,Ct;function wt(){if(Ct)return St;Ct=1;let e=Ze(),t=xt();class n extends e{constructor(e){super(e),this.type=`rule`,this.nodes||=[]}get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:`,`+this.raw(`between`,`beforeOpen`);this.selector=e.join(n)}}return St=n,n.default=n,e.registerRule(n),St}var Tt,Et;function Dt(){if(Et)return Tt;Et=1;let e=Ne(),t=ft(),n=Je(),r=ht(),i=vt(),a=wt(),o={empty:!0,space:!0};function s(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}class c{constructor(e){this.input=e,this.root=new i,this.current=this.root,this.spaces=``,this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new r;t.name=e[1].slice(1),t.name===``&&this.unnamedAtrule(t,e),this.init(t,e[2]);let n,i,a,o=!1,s=!1,c=[],l=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),n=e[0],n===`(`||n===`[`?l.push(n===`(`?`)`:`]`):n===`{`&&l.length>0?l.push(`}`):n===l[l.length-1]&&l.pop(),l.length===0)if(n===`;`){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(n===`{`){s=!0;break}else if(n===`}`){if(c.length>0){for(a=c.length-1,i=c[a];i&&i[0]===`space`;)i=c[--a];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}else c.push(e);else c.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(c),c.length?(t.raws.afterName=this.spacesAndCommentsFromStart(c),this.raw(t,`params`,c),o&&(e=c[c.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between=``)):(t.raws.afterName=``,t.params=``),s&&(t.no
vendor: 4,775 bytes, line 24
24des=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let n=0,r;for(let i=t-1;i>=0&&(r=e[i],!(r[0]!==`space`&&(n+=1,n===2)));i--);throw this.input.error(`Missed semicolon`,r[0]===`word`?r[3]+1:r[2])}colon(e){let t=0,n,r,i;for(let[a,o]of e.entries()){if(n=o,r=n[0],r===`(`&&(t+=1),r===`)`&&--t,t===0&&r===`:`)if(!i)this.doubleColon(n);else if(i[0]===`word`&&i[1]===`progid`)continue;else return a;i=n}return!1}comment(e){let t=new n;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text=``,t.raws.left=r,t.raws.right=``;else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,n){let r=new e;this.init(r,t[0][2]);let i=t[t.length-1];for(i[0]===`;`&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(i[3]||i[2]||s(t)),r.source.end.offset++;t[0][0]!==`word`;)t.length===1&&this.unknownWord(t),r.raws.before+=t.shift()[1];for(r.source.start=this.getPosition(t[0][2]),r.prop=``;t.length;){let e=t[0][0];if(e===`:`||e===`space`||e===`comment`)break;r.prop+=t.shift()[1]}r.raws.between=``;let a;for(;t.length;)if(a=t.shift(),a[0]===`:`){r.raws.between+=a[1];break}else a[0]===`word`&&/\w/.test(a[1])&&this.unknownWord([a]),r.raws.between+=a[1];(r.prop[0]===`_`||r.prop[0]===`*`)&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o=[],c;for(;t.length&&(c=t[0][0],!(c!==`space`&&c!==`comment`));)o.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(a=t[e],a[1].toLowerCase()===`!important`){r.important=!0;let n=this.stringFrom(t,e);n=this.spacesFromEnd(t)+n,n!==` !important`&&(r.raws.important=n);break}else if(a[1].toLowerCase()===`important`){let n=t.slice(0),i=``;for(let t=e;t>0;t--){let e=n[t][0];if(i.trim().indexOf(`!`)===0&&e!==`space`)break;i=n.pop()[1]+i}i.trim().indexOf(`!`)===0&&(r.important=!0,r.raws.important=i,t=n)}if(a[0]!==`space`&&a[0]!==`comment`)break}t.some(e=>e[0]!==`space`&&e[0]!==`comment`)&&(r.raws.between+=o.map(e=>e[1]).join(``),o=[]),this.raw(r,`value`,o.concat(t),n),r.value.includes(`:`)&&!n&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error(`Double colon`,{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new a;this.init(t,e[2]),t.selector=``,t.raws.between=``,this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||``)+this.spaces,this.spaces=``,this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||``)+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&e.type===`rule`&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces=``)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces=``,e.type!==`comment`&&(this.semicolon=!1)}other(e){let t=!1,n=null,r=!1,i=null,a=[],o=e[1].startsWith(`--`),s=[],c=e;for(;c;){if(n=c[0],s.push(c),n===`(`||n===`[`)i||=c,a.push(n===`(`?`)`:`]`);else if(o&&r&&n===`{`)i||=c,a.push(`}`);else if(a.length===0)if(n===`;`)if(r){this.decl(s,o);return}else break;else if(n===`{`){this.rule(s);return}else if(n===`}`){this.tokenizer.back(s.pop()),t=!0;break}else n===`:`&&(r=!0);else n===a[a.length-1]&&(a.pop(),a.length===0&&(i=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),a.length>0&&this.unclosedBracket(i),t&&r){if(!o)for(;s.length&&(c=s[s.length-1][0],!(c!==`space`&&c!==`comment`));)this.tokenizer.back(s.pop());this.decl(s,o)}else this.unknownWord(s)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case`space`:this.spaces+=e[1];break;case`;`:this.freeSemicolon(e);break;case`}`:this.end(e);break;case`comment`:this.comment(e);break;case`at-word`:this.atrule(e);break;case`{`:this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,r){let i,a,s=n.length,c=``,l=!0,u,d;for(let e=0;e<s;e+=1)i=n[e],a=i[0],a===`space`&&e===s-1&&!r?l=!1:a===`comment`?(d=n[e-1]?n[e-1][0]:`empty`,u=n[e+1]?n[e+1][0]:`empty`,!o[d]&&!o[u]?c.slice(-1)===`,`?l=!1:c+=i[1]:l=!1):c+=i[1];if(!l){let r=n.reduce((e,t)=>
vendor: 6,255 bytes, line 24
24e+t[1],``);e.raws[t]={raw:r,value:c}}e[t]=c}rule(e){e.pop();let t=new a;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,`selector`,e),this.current=t}spacesAndCommentsFromEnd(e){let t,n=``;for(;e.length&&(t=e[e.length-1][0],!(t!==`space`&&t!==`comment`));)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n=``;for(;e.length&&(t=e[0][0],!(t!==`space`&&t!==`comment`));)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n=``;for(;e.length&&(t=e[e.length-1][0],t===`space`);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n=``;for(let r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}unclosedBlock(){let e=this.current.source.start;throw this.input.error(`Unclosed block`,e.line,e.column)}unclosedBracket(e){throw this.input.error(`Unclosed bracket`,{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error(`Unexpected }`,{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error(`Unknown word`,{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error(`At-rule without name`,{offset:t[2]},{offset:t[2]+t[1].length})}}return Tt=c,Tt}var Ot,kt;function At(){if(kt)return Ot;kt=1;let e=Ze(),t=Dt(),n=He();function r(e,r){let i=new n(e,r),a=new t(i);try{a.parse()}catch(e){throw e}return a.root}return Ot=r,r.default=r,e.registerParse(r),Ot}var jt,Mt;function Nt(){if(Mt)return jt;Mt=1;let{isClean:e,my:t}=xe(),n=Ge(),r=De(),i=Ze(),a=et();rt();let o=lt(),s=At(),c=vt(),l={atrule:`AtRule`,comment:`Comment`,decl:`Declaration`,document:`Document`,root:`Root`,rule:`Rule`},u={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},d={Once:!0,postcssPlugin:!0,prepare:!0};function f(e){return typeof e==`object`&&typeof e.then==`function`}function p(e){let t=!1,n=l[e.type];return e.type===`decl`?t=e.prop.toLowerCase():e.type===`atrule`&&(t=e.name.toLowerCase()),t&&e.append?[n,n+`-`+t,0,n+`Exit`,n+`Exit-`+t]:t?[n,n+`-`+t,n+`Exit`,n+`Exit-`+t]:e.append?[n,0,n+`Exit`]:[n,n+`Exit`]}function m(e){let t;return t=e.type===`document`?[`Document`,0,`DocumentExit`]:e.type===`root`?[`Root`,0,`RootExit`]:p(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function h(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>h(e)),t}let g={};class _{constructor(e,n,r){this.stringified=!1,this.processed=!1;let a;if(typeof n==`object`&&n&&(n.type===`root`||n.type===`document`))a=h(n);else if(n instanceof _||n instanceof o)a=h(n.root),n.map&&(r.map===void 0&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let e=s;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{a=e(n,r)}catch(e){this.processed=!0,this.error=e}a&&!a[t]&&i.rebuild(a)}this.result=new o(e,a,r),this.helpers={...g,postcss:g,result:this.result},this.plugins=this.processor.plugins.map(e=>typeof e==`object`&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||=this.runAsync(),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw Error(`Use process(css).then(cb) to work with async plugins`)}handleError(e,t){let n=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,e.name===`CssSyntaxError`&&!e.plugin?(e.plugin=n.postcssPlugin,e.setMessage()):n.postcssVersion}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if(typeof t==`object`)for(let n in t){if(!u[n]&&/^[A-Z]/.test(n))throw Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[n])if(typeof t[n]==`object`)for(let r in t[n])r===`*`?e(t,n,t[n][r]):e(t,n+`-`+r.toLowerCase(),t[n][r]);else typeof t[n]==`function`&&e(t,n,t[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],n=this.runOnRoot(t);if(f(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let n=[m(t)];for(;n.length>0;){let e=this.visitTick(n);if(f(e))try{await e}catch(e){let t=n[n.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,n]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if(t.type===`document`){let e=t.nodes.map(e=>n(e,this.helpers));await Promise.all(e)}else await n(t,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e==`object`&&e.Once){if(this.result.root.type===`document`){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return f(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e==`function`)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=r;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new n(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(f(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type===`document`)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,r]of e){this.result.lastPlugin=n;let e;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if(t.type!==`root`&&t.type!==`document`&&!t.parent)return!0;
24if(f(e))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:i}=n;if(r.type!==`root`&&r.type!==`document`&&!r.parent){t.pop();return}if(i.length>0&&n.visitorIndex<i.length){let[e,t]=i[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===i.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=e;try{return t(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(n.iterator!==0){let i=n.iterator,a;for(;a=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!a[e]){a[e]=!0,t.push(m(a));return}n.iterator=0,delete r.indexes[i]}let a=n.events;for(;n.eventIndex<a.length;){let t=a[n.eventIndex];if(n.eventIndex+=1,t===0){r.nodes&&r.nodes.length&&(r[e]=!0,n.iterator=r.getIterator());return}else if(this.listeners[t]){n.visitors=this.listeners[t];return}}t.pop()}walkSync(t){t[e]=!0;let n=p(t);for(let r of n)if(r===0)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[r];if(e&&this.visitSync(e,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return`LazyResult`}}return _.registerPostcss=e=>{g=e},jt=_,_.default=_,c.registerLazyResult(_),a.registerLazyResult(_),jt}var Pt,Ft;function It(){if(Ft)return Pt;Ft=1;let e=Ge(),t=De();rt();let n=At(),r=lt();class i{constructor(n,i,a){i=i.toString(),this.stringified=!1,this._processor=n,this._css=i,this._opts=a,this._map=void 0;let o=t;this.result=new r(this._processor,void 0,this._opts),this.result.css=i;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let c=new e(o,void 0,this._opts,i);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=n;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return`NoWorkResult`}}return Pt=i,i.default=i,Pt}var Lt,Rt;function zt(){if(Rt)return Lt;Rt=1;let e=It(),t=Nt(),n=et(),r=vt();class i{constructor(e=[]){this.version=`8.4.38`,this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(n.postcss===!0?n=n():n.postcss&&(n=n.postcss),typeof n==`object`&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if(typeof n==`object`&&n.postcssPlugin)t.push(n);else if(typeof n==`function`)t.push(n);else if(!(typeof n==`object`&&(n.parse||n.stringify)))throw Error(n+` is not a PostCSS plugin`);return t}process(n,r={}){return!this.plugins.length&&!r.parser&&!r.stringifier&&!r.syntax?new e(this,n,r):new t(this,n,r)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Lt=i,i.default=i,r.registerProcessor(i),n.registerProcessor(i),Lt}var Bt,Vt;function Ht(){if(Vt)return Bt;Vt=1;let e=Ne(),t=ze(),n=Je(),r=ht(),i=He(),a=vt(),o=wt();function s(c,l){if(Array.isArray(c))return c.map(e=>s(e));let{inputs:u,...d}=c;if(u){l=[];for(let e of u){let n={...e,__proto__:i.prototype};n.map&&={...n.map,__proto__:t.prototype},l.push(n)}}if(d.nodes&&=c.nodes.map(e=>s(e,l)),d.source){let{inputId:e,...t}=d.source;d.source=t,e!=null&&(d.source.input=l[e])}if(d.type===`root`)return new a(d);if(d.type===`decl`)return new e(d);if(d.type===`rule`)return new o(d);if(d.type===`comment`)return new n(d);if(d.type===`atrule`)return new r(d);throw Error(`Unknown node type: `+c.type)}return Bt=s,s.default=s,Bt}var Ut,Wt;function Gt(){if(Wt)return Ut;Wt=1;let e=ve(),t=Ne(),n=Nt(),r=Ze(),i=zt(),a=De(),o=Ht(),s=et(),c=ot(),l=Je(),u=ht
24(),d=lt(),f=He(),p=At(),m=xt(),h=wt(),g=vt(),_=Ae();function v(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new i(e)}return v.plugin=function(e,t){let n=!1;function r(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
25https://evilmartians.com/chronicles/postcss-8-plugin-migration`),{}.LANG&&{}.LANG.startsWith(`cn`)&&console.warn(e+`: 里面 postcss.plugin 被弃用. 迁移指南:
26https://www.w3ctech.com/topic/2226`));let a=t(...r);return a.postcssPlugin=e,a.postcssVersion=new i().version,a}let a;return Object.defineProperty(r,"postcss",{get(){return a||=r(),a}}),r.process=function(e,t,n){return v([r(n)]).process(e,t)},r},v.stringify=a,v.parse=p,v.fromJSON=o,v.list=m,v.comment=e=>new l(e),v.atRule=e=>new u(e),v.decl=e=>new t(e),v.rule=e=>new h(e),v.root=e=>new g(e),v.document=e=>new s(e),v.CssSyntaxError=e,v.Declaration=t,v.Container=r,v.Processor=i,v.Document=s,v.Comment=l,v.Warning=c,v.AtRule=u,v.Result=d,v.Input=f,v.Rule=h,v.Root=g,v.Node=_,n.registerPostcss(v),Ut=v,v.default=v,Ut}var M=ue(Gt());M.stringify,M.fromJSON,M.plugin,M.parse,M.list,M.document,M.comment,M.atRule,M.rule,M.decl,M.root,M.CssSyntaxError,M.Declaration,M.Container,M.Processor,M.Document,M.Comment,M.Warning,M.AtRule,M.Result,M.Input,M.Rule,M.Root,M.Node;var Kt=Object.defineProperty,qt=(e,t,n)=>t in e?Kt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jt=(e,t,n)=>qt(e,typeof t==`symbol`?t:t+``,n);function Yt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function Xt(e){if(Object.prototype.hasOwnProperty.call(e,`__esModule`))return e;var t=e.default;if(typeof t==`function`){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var Zt={exports:{}},Qt;function $t(){if(Qt)return Zt.exports;Qt=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return Zt.exports=t(),Zt.exports.createColors=t,Zt.exports}var en=Xt(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:`Module`}))),tn,nn;function rn(){if(nn)return tn;nn=1;let e=$t(),t=en;
26class n extends Error{constructor(e,t,r,i,a,o){super(e),this.name=`CssSyntaxError`,this.reason=e,a&&(this.file=a),i&&(this.source=i),o&&(this.plugin=o),t!==void 0&&r!==void 0&&(typeof t==`number`?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,n)}setMessage(){this.message=this.plugin?this.plugin+`: `:``,this.message+=this.file?this.file:`<css input>`,this.line!==void 0&&(this.message+=`:`+this.line+`:`+this.column),this.message+=`: `+this.reason}showSourceCode(n){if(!this.source)return``;let r=this.source;n??=e.isColorSupported,t&&n&&(r=t(r));let i=r.split(/\r?\n/),a=Math.max(this.line-3,0),o=Math.min(this.line+2,i.length),s=String(o).length,c,l;if(n){let{bold:t,gray:n,red:r}=e.createColors(!0);c=e=>t(r(e)),l=e=>n(e)}else c=l=e=>e;return i.slice(a,o).map((e,t)=>{let n=a+1+t,r=` `+(` `+n).slice(-s)+` | `;if(n===this.line){let t=l(r.replace(/\d/g,` `))+e.slice(0,this.column-1).replace(/[^\t]/g,` `);return c(`>`)+l(r)+e+`
27 `+t+c(`^`)}return` `+l(r)+e}).join(`
28`)}toString(){let e=this.showSourceCode();return e&&=`
29
30`+e+`
31`,this.name+`: `+this.message+e}}return tn=n,n.default=n,tn}var an={},on;function sn(){return on?an:(on=1,an.isClean=Symbol(`isClean`),an.my=Symbol(`my`),an)}var cn,ln;function un(){if(ln)return cn;ln=1;let e={after:`
32`,beforeClose:`
33`,beforeComment:`
34`,beforeDecl:`
35`,beforeOpen:` `,beforeRule:`
36`,colon:`: `,commentLeft:` `,commentRight:` `,emptyBody:``,indent:`    `,semicolon:!1};function t(e){return e[0].toUpperCase()+e.slice(1)}class n{constructor(e){this.builder=e}atrule(e,t){let n=`@`+e.name,r=e.params?this.rawValue(e,`params`):``;if(e.raws.afterName===void 0?r&&(n+=` `):n+=e.raws.afterName,e.nodes)this.block(e,n+r);else{let i=(e.raws.between||``)+(t?`;`:``);this.builder(n+r+i,e)}}beforeAfter(e,t){let n;n=e.type===`decl`?this.raw(e,null,`beforeDecl`):e.type===`comment`?this.raw(e,null,`beforeComment`):t===`before`?this.raw(e,null,`beforeRule`):this.raw(e,null,`beforeClose`);let r=e.parent,i=0;for(;r&&r.type!==`root`;)i+=1,r=r.parent;if(n.includes(`
37`)){let t=this.raw(e,null,`indent`);if(t.length)for(let e=0;e<i;e++)n+=t}return n}block(e,t){let n=this.raw(e,`between`,`beforeOpen`);this.builder(t+n+`{`,e,`start`);let r;e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,`after`)):r=this.raw(e,`after`,`emptyBody`),r&&this.builder(r),this.builder(`}`,e,`end`)}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type===`comment`;)--t;let n=this.raw(e,`semicolon`);for(let r=0;r<e.nodes.length;r++){let i=e.nodes[r],a=this.raw(i,`before`);a&&this.builder(a),this.stringify(i,t!==r||n)}}comment(e){let t=this.raw(e,`left`,`commentLeft`),n=this.raw(e,`right`,`commentRight`);this.builder(`/*`+t+e.text+n+`*/`,e)}decl(e,t){let n=this.raw(e,`between`,`colon`),r=e.prop+n+this.rawValue(e,`value`);e.important&&(r+=e.raws.important||` !important`),t&&(r+=`;`),this.builder(r,e)}document(e){this.body(e)}raw(n,r,i){let a;if(i||=r,r&&(a=n.raws[r],a!==void 0))return a;let o=n.parent;if(i===`before`&&(!o||o.type===`root`&&o.first===n||o&&o.type===`document`))return``;if(!o)return e[i];let s=n.root();if(s.rawCache||={},s.rawCache[i]!==void 0)return s.rawCache[i];if(i===`before`||i===`after`)return this.beforeAfter(n,i);{let e=`raw`+t(i);this[e]?a=this[e](s,n):s.walk(e=>{if(a=e.raws[r],a!==void 0)return!1})}return a===void 0&&(a=e[i]),s.rawCache[i]=a,a}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&e.raws.after!==void 0)return t=e.raws.after,t.includes(`
38`)&&(t=t.replace(/[^\n]+$/,``)),!1}),t&&=t.replace(/\S/g,``),t}rawBeforeComment(e,t){let n;return e.walkComments(e=>{if(e.raws.before!==void 0)return n=e.raws.before,n.includes(`
39`)&&(n=n.replace(/[^\n]+$/,``)),!1}),n===void 0?n=this.raw(t,null,`beforeDecl`):n&&=n.replace(/\S/g,``),n}rawBeforeDecl(e,t){let n;return e.walkDecls(e=>{if(e.raws.before!==void 0)return n=e.raws.before,n.includes(`
40`)&&(n=n.replace(/[^\n]+$/,``)),!1}),n===void 0?n=this.raw(t,null,`beforeRule`):n&&=n.replace(/\S/g,``),n}rawBeforeOpen(e){let t;return e.walk(e=>{if(e.type!==`decl`&&(t=e.raws.between,t!==void 0))return!1}),t}rawBeforeRule(e){let t;return e.walk(n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&n.raws.before!==void 0)return t=n.raws.before,t.includes(`
41`)&&(t=t.replace(/[^\n]+$/,``)),!1}),t&&=t.replace(/\S/g,``),t}rawColon(e){let t;return e.walkDecls(e=>{if(e.raws.between!==void 0)return t=e.raws.between.replace(/[^\s:]/g,``),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length===0&&(t=e.raws.after,t!==void 0))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(n=>{let r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&n.raws.before!==void 0){let e=n.raws.before.split(`
42`);return t=e[e.length-1],t=t.replace(/\S/g,``),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&e.last.type===`decl`&&(t=e.raws.semicolon,t!==void 0))return!1}),t}rawValue(e,t){let n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,`selector`)),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,`end`)}stringify(e,t){if(!this[e.type])throw Error(`Unknown AST node type `+e.type+`. Maybe you need to change PostCSS stringifier.`);this[e.type](e,t)}}return cn=n,n.default=n,cn}var dn,fn;function pn(){if(fn)return dn;fn=1;let e=un();function t(t,n){new e(n).stringify(t)}return dn=t,t.default=t,dn}var mn,hn;function gn(){if(hn)return mn;hn=1;let{isClean:e,my:t}=sn(),n=rn(),r=un(),i=pn();function a(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r)||r===`proxyCache`)continue;let i=e[r],o=typeof i;r===`parent`&&o===`object`?t&&(n[r]=t):r===`source`?n[r]=i:Array.isArray(i)?n[r]=i.map(e=>a(e,n)):(o===`object`&&i!==null&&(i=a(i)),n[r]=i)}return n}class o{constructor(n={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in n)if(e===`nodes`){this.nodes=[];for(let t of n[e])typeof t.clone==`function`?this.append(t.clone()):this.append(t)}else this[e]=n[e]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=a(this);for(let n in e)t[n]=e[n];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}
42error(e,t={}){if(this.source){let{end:n,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:n.column,line:n.line},t)}return new n(e)}getProxyProcessor(){return{get(e,t){return t===`proxyOf`?e:t===`root`?()=>e.root().toProxy():e[t]},set(e,t,n){return e[t]===n?!0:(e[t]=n,(t===`prop`||t===`value`||t===`name`||t===`params`||t===`important`||t===`text`)&&e.markDirty(),!0)}}}markDirty(){if(this[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){t=this.toString();let r=t.indexOf(e.word);r!==-1&&(n=this.positionInside(r,t))}return n}positionInside(e,t){let n=t||this.toString(),r=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)n[t]===`
43`?(r=1,i+=1):r+=1;return{column:r,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let r=this.toString(),i=r.indexOf(e.word);i!==-1&&(t=this.positionInside(i,r),n=this.positionInside(i+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:typeof e.endIndex==`number`?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}}raw(e,t){return new r().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let r of e)r===this?n=!0:n?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);n||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!==`document`;)e=e.parent;return e}toJSON(e,t){let n={},r=t==null;t||=new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e)||e===`parent`||e===`proxyCache`)continue;let r=this[e];if(Array.isArray(r))n[e]=r.map(e=>typeof e==`object`&&e.toJSON?e.toJSON(null,t):e);else if(typeof r==`object`&&r.toJSON)n[e]=r.toJSON(null,t);else if(e===`source`){let a=t.get(r.input);a??(a=i,t.set(r.input,i),i++),n[e]={end:r.end,inputId:a,start:r.start}}else n[e]=r}return r&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||=new Proxy(this,this.getProxyProcessor()),this.proxyCache}toString(e=i){e.stringify&&(e=e.stringify);let t=``;return e(this,e=>{t+=e}),t}warn(e,t,n){let r={node:this};for(let e in n)r[e]=n[e];return e.warn(t,r)}get proxyOf(){return this}}return mn=o,o.default=o,mn}var _n,vn;function yn(){if(vn)return _n;vn=1;let e=gn();class t extends e{constructor(e){e&&e.value!==void 0&&typeof e.value!=`string`&&(e={...e,value:String(e.value)}),super(e),this.type=`decl`}get variable(){return this.prop.startsWith(`--`)||this.prop[0]===`$`}}return _n=t,t.default=t,_n}var bn,xn;function Sn(){return xn?bn:(xn=1,bn={nanoid:(e=21)=>{let t=``,n=e;for(;n--;)t+=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`[Math.random()*64|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r=``,i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r}},bn)}var Cn,wn;function Tn(){if(wn)return Cn;wn=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=en,{existsSync:n,readFileSync:r}=en,{dirname:i,join:a}=en;function o(e){return Buffer?Buffer.from(e,`base64`).toString():window.atob(e)}class s{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,`data:`);let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=i(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||=new e(this.text),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,n=/^data:application\/json;base64,/;if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||n.test(e))return o(e.substr(RegExp.lastMatch.length));let r=e.match(/data:application\/json;([^,]+),/)[1];throw Error(`Unsupported source map encoding `+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,``).trim()}isMap(e){return typeof e==`object`?typeof e.mappings==`string`||typeof e._mappings==`string`||Array.isArray(e.sections):!1}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);
43if(!t)return;let n=e.lastIndexOf(t.pop()),r=e.indexOf(`*/`,n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}loadFile(e){if(this.root=i(e),n(e))return this.mapFile=e,r(e,`utf-8`).toString().trim()}loadMap(n,r){if(r===!1)return!1;if(r){if(typeof r==`string`)return r;if(typeof r==`function`){let e=r(n);if(e){let t=this.loadFile(e);if(!t)throw Error(`Unable to load previous source map: `+e.toString());return t}}else if(r instanceof e)return t.fromSourceMap(r).toString();else if(r instanceof t)return r.toString();else if(this.isMap(r))return JSON.stringify(r);else throw Error(`Unsupported previous source map format: `+r.toString())}else if(this.inline)return this.decodeInline(this.annotation);else if(this.annotation){let e=this.annotation;return n&&(e=a(i(n),e)),this.loadFile(e)}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Cn=s,s.default=s,Cn}var En,Dn;function On(){if(Dn)return En;Dn=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=en,{fileURLToPath:n,pathToFileURL:r}=en,{isAbsolute:i,resolve:a}=en,{nanoid:o}
43=Sn(),s=en,c=rn(),l=Tn(),u=Symbol(`fromOffsetCache`),d=!!(e&&t),f=!!(a&&i);class p{constructor(e,t={}){if(e==null||typeof e==`object`&&!e.toString)throw Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]===``||this.css[0]===`￾`?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!f||/^\w+:\/\//.test(t.from)||i(t.from)?this.file=t.from:this.file=a(t.from)),f&&d){let e=new l(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id=`<input css `+o(6)+`>`),this.map&&(this.map.file=this.from)}error(e,t,n,i={}){let a,o,s;if(t&&typeof t==`object`){let e=t,r=n;if(typeof e.offset==`number`){let r=this.fromOffset(e.offset);t=r.line,n=r.col}else t=e.line,n=e.column;if(typeof r.offset==`number`){let e=this.fromOffset(r.offset);o=e.line,s=e.col}else o=r.line,s=r.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let l=this.origin(t,n,o,s);return a=l?new c(e,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,i.plugin):new c(e,o===void 0?t:{column:n,line:t},o===void 0?n:{column:s,line:o},this.css,this.file,i.plugin),a.input={column:n,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(r&&(a.input.url=r(this.file).toString()),a.input.file=this.file),a}fromOffset(e){let t,n;if(this[u])n=this[u];else{let e=this.css.split(`
44`);n=Array(e.length);let t=0;for(let r=0,i=e.length;r<i;r++)n[r]=t,t+=e[r].length+1;this[u]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t=n.length-2,i;for(;r<t;)if(i=r+(t-r>>1),e<n[i])t=i-1;else if(e>=n[i+1])r=i+1;else{r=i;break}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:a(this.map.consumer().sourceRoot||this.map.root||`.`,e)}origin(e,t,a,o){if(!this.map)return!1;let s=this.map.consumer(),c=s.originalPositionFor({column:t,line:e});if(!c.source)return!1;let l;typeof a==`number`&&(l=s.originalPositionFor({column:o,line:a}));let u;u=i(c.source)?r(c.source):new URL(c.source,this.map.consumer().sourceRoot||r(this.map.mapFile));let d={column:c.column,endColumn:l&&l.column,endLine:l&&l.line,line:c.line,url:u.toString()};if(u.protocol===`file:`)if(n)d.file=n(u);else throw Error(`file: protocol is not available in this PostCSS build`);let f=s.sourceContentFor(c.source);return f&&(d.source=f),d}toJSON(){let e={};for(let t of[`hasBOM`,`css`,`file`,`id`])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}return En=p,p.default=p,s&&s.registerInput&&s.registerInput(p),En}var kn,An;function jn(){if(An)return kn;An=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=en,{dirname:n,relative:r,resolve:i,sep:a}=en,{pathToFileURL:o}=en,s=On(),c=!!(e&&t),l=!!(n&&i&&r&&a);class u{constructor(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?`data:application/json;base64,`+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation==`string`?this.mapOpts.annotation:typeof this.mapOpts.annotation==`function`?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+`.map`;let t=`
45`;this.css.includes(`\r
46`)&&(t=`\r
47`),this.css+=t+`/*# sourceMappingURL=`+e+` */`}applyPrevMaps(){for(let t of this.previous()){let r=this.toUrl(this.path(t.file)),i=t.root||n(t.file),a;this.mapOpts.sourcesContent===!1?(a=new e(t.text),a.sourcesContent&&=null):a=t.consumer(),this.map.applySourceMap(a,r,this.toUrl(this.path(i)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type===`comment`&&e.text.indexOf(`# sourceMappingURL=`)===0&&this.root.removeChild(t)}else this.css&&=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,``)}generate(){if(this.clearAnnotation(),l&&c&&this.isMap())return this.generateMap();{let e=``;return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):`<no source>`});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css=``,this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,n=1,r=`<no source>`,i={generated:{column:0,line:0},original:{column:0,line:0},source:``},a,o;this.stringify(this.root,(t,s,c)=>{if(this.css+=t,s&&c!==`end`&&(i.generated.line=e,i.generated.column=n-1,s.source&&s.source.start?(i.source=this.sourcePath(s),i.original.line=s.source.start.line,i.original.column=s.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),a=t.match(/\n/g),a?(e+=a.length,o=t.lastIndexOf(`
48`),n=t.length-o):n+=t.length,s&&c!==`start`){let t=s.parent||{raws:{}};(!(s.type===`decl`||s.type===`atrule`&&!s.nodes)||s!==t.last||t.raws.semicolon)&&(s.source&&s.source.end?(i.source=this.sourcePath(s),i.original.line=s.source.end.line,i.original.column=s.source.end.column-1,i.generated.line=e,i.generated.column=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=e,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:this.mapOpts.annotation===void 0?!this.previous().length||this.previous().some(e=>e.annotation):this.mapOpts.annotation}isInline(){if(this.mapOpts.inline!==void 0)return this.mapOpts.inline;let e=this.mapOpts.annotation;return e!==void 0&&e!==!0?!1:!this.previous().length||this.previous().some(e=>e.inline)}isMap(){return this.opts.map===void 0?this.previous().length>0:!!this.opts.map}isSourcesContent(){return this.mapOpts.sourcesContent===void 0?!this.previous().length||this.previous().some(e=>e.withContent()):this.mapOpts.sourcesContent}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):`to.css`}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let a=this.opts.to?n(this.opts.to):`.`;typeof this.mapOpts.annotation==`string`&&(a=n(i(a,this.mapOpts.annotation)));
48let o=r(a,e);return this.memoizedPaths.set(e,o),o}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new s(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let r=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):`<no source>`;this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString(`base64`):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(o){let t=o(e).toString();return this.memoizedFileURLs.set(e,t),t}else throw Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;a===`\\`&&(e=e.replace(/\\/g,`/`));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}}return kn=u,kn}var Mn,Nn;function Pn(){if(Nn)return Mn;Nn=1;let e=gn();class t extends e{constructor(e){super(e),this.type=`comment`}}return Mn=t,t.default=t,Mn}var Fn,In;function Ln(){if(In)return Fn;In=1;let{isClean:e,my:t}=sn(),n=yn(),r=Pn(),i=gn(),a,o,s,c;function l(e){return e.map(e=>(e.nodes&&=l(e.nodes),delete e.source,e))}function u(t){if(t[e]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)u(e)}class d extends i{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),n,r;for(;this.indexes[t]<this.proxyOf.nodes.length&&(n=this.indexes[t],r=e(this.proxyOf.nodes[n],n),r!==!1);)this.indexes[t]+=1;return delete this.indexes[t],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||=0,this.indexes||={},this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return t===`proxyOf`?e:e[t]?t===`each`||typeof t==`string`&&t.startsWith(`walk`)?(...n)=>e[t](...n.map(e=>typeof e==`function`?(t,n)=>e(t.toProxy(),n):e)):t===`every`||t===`some`?n=>e[t]((e,...t)=>n(e.toProxy(),...t)):t===`root`?()=>e.root().toProxy():t===`nodes`?e.nodes.map(e=>e.toProxy()):t===`first`||t===`last`?e[t].toProxy():e[t]:e[t]},set(e,t,n){return e[t]===n?!0:(e[t]=n,(t===`name`||t===`params`||t===`selector`)&&e.markDirty(),!0)}}}index(e){return typeof e==`number`?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n=this.index(e),r=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of r)this.proxyOf.nodes.splice(n+1,0,e);let i;for(let e in this.indexes)i=this.indexes[e],n<i&&(this.indexes[e]=i+r.length);return this.markDirty(),this}insertBefore(e,t){let n=this.index(e),r=n===0&&`prepend`,i=this.normalize(t,this.proxyOf.nodes[n],r).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);let a;for(let e in this.indexes)a=this.indexes[e],n<=a&&(this.indexes[e]=a+i.length);return this.markDirty(),this}normalize(i,c){if(typeof i==`string`)i=l(a(i).nodes);else if(i===void 0)i=[];else if(Array.isArray(i)){i=i.slice(0);for(let e of i)e.parent&&e.parent.removeChild(e,`ignore`)}else if(i.type===`root`&&this.type!==`document`){i=i.nodes.slice(0);for(let e of i)e.parent&&e.parent.removeChild(e,`ignore`)}else if(i.type)i=[i];else if(i.prop){if(i.value===void 0)throw Error(`Value field is missed in node creation`);typeof i.value!=`string`&&(i.value=String(i.value)),i=[new n(i)]}else if(i.selector)i=[new o(i)];else if(i.name)i=[new s(i)];else if(i.text)i=[new r(i)];else throw Error(`Unknown node type in node creation`);return i.map(n=>(n[t]||d.rebuild(n),n=n.proxyOf,n.parent&&n.parent.removeChild(n),n[e]&&u(n),n.raws.before===void 0&&c&&c.raws.before!==void 0&&(n.raws.before=c.raws.before.replace(/\S/g,``)),n.parent=this.proxyOf,n))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,`prepend`).reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}
48replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,n)=>{let r;try{r=e(t,n)}catch(e){throw t.addToError(e)}return r!==!1&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`atrule`&&e.test(n.name))return t(n,r)}):this.walk((n,r)=>{if(n.type===`atrule`&&n.name===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`atrule`)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if(t.type===`comment`)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`decl`&&e.test(n.prop))return t(n,r)}):this.walk((n,r)=>{if(n.type===`decl`&&n.prop===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`decl`)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`rule`&&e.test(n.selector))return t(n,r)}):this.walk((n,r)=>{if(n.type===`rule`&&n.selector===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`rule`)return t(e,n)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return d.registerParse=e=>{a=e},d.registerRule=e=>{o=e},d.registerAtRule=e=>{s=e},d.registerRoot=e=>{c=e},Fn=d,d.default=d,d.rebuild=e=>{e.type===`atrule`?Object.setPrototypeOf(e,s.prototype):e.type===`rule`?Object.setPrototypeOf(e,o.prototype):e.type===`decl`?Object.setPrototypeOf(e,n.prototype):e.type===`comment`?Object.setPrototypeOf(e,r.prototype):e.type===`root`&&Object.setPrototypeOf(e,c.prototype),e[t]=!0,e.nodes&&e.nodes.forEach(e=>{d.rebuild(e)})},Fn}var Rn,zn;function Bn(){if(zn)return Rn;zn=1;let e=Ln(),t,n;class r extends e{constructor(e){super({type:`document`,...e}),this.nodes||=[]}toResult(e={}){return new t(new n,this,e).stringify()}}return r.registerLazyResult=e=>{t=e},r.registerProcessor=e=>{n=e},Rn=r,r.default=r,Rn}var Vn,Hn;function Un(){if(Hn)return Vn;Hn=1;let e={};return Vn=function(t){e[t]||(e[t]=!0,typeof console<`u`&&console.warn&&console.warn(t))},Vn}var Wn,Gn;function Kn(){if(Gn)return Wn;Gn=1;class e{constructor(e,t={}){if(this.type=`warning`,this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+`: `+this.text:this.text}}return Wn=e,e.default=e,Wn}var qn,Jn;function Yn(){if(Jn)return qn;Jn=1;let e=Kn();class t{constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let r=new e(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type===`warning`)}get content(){return this.css}}return qn=t,t.default=t,qn}var Xn,Zn;function Qn(){if(Zn)return Xn;Zn=1;let e=/[\t\n\f\r "#'()/;[\\\]{}]/g,t=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,n=/.[\r\n"'(/\\]/,r=/[\da-f]/i;return Xn=function(i,a={}){let o=i.css.valueOf(),s=a.ignoreErrors,c,l,u,d,f,p,m,h,g,_,v=o.length,y=0,b=[],x=[];function S(){return y}function C(e){throw i.error(`Unclosed `+e,y)}function w(){return x.length===0&&y>=v}function T(i){if(x.length)return x.pop();if(y>=v)return;let a=i?i.ignoreUnclosed:!1;switch(c=o.charCodeAt(y),c){case 10:case 32:case 9:case 13:case 12:l=y;do l+=1,c=o.charCodeAt(l);while(c===32||c===10||c===9||c===13||c===12);_=[`space`,o.slice(y,l)],y=l-1;break;case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let e=String.fromCharCode(c);_=[e,e,y];break}
48case 40:if(h=b.length?b.pop()[1]:``,g=o.charCodeAt(y+1),h===`url`&&g!==39&&g!==34&&g!==32&&g!==10&&g!==9&&g!==12&&g!==13){l=y;do{if(p=!1,l=o.indexOf(`)`,l+1),l===-1)if(s||a){l=y;break}else C(`bracket`);for(m=l;o.charCodeAt(m-1)===92;)--m,p=!p}while(p);_=[`brackets`,o.slice(y,l+1),y,l],y=l}else l=o.indexOf(`)`,y+1),d=o.slice(y,l+1),l===-1||n.test(d)?_=[`(`,`(`,y]:(_=[`brackets`,d,y,l],y=l);break;case 39:case 34:u=c===39?`'`:`"`,l=y;do{if(p=!1,l=o.indexOf(u,l+1),l===-1)if(s||a){l=y+1;break}else C(`string`);for(m=l;o.charCodeAt(m-1)===92;)--m,p=!p}while(p);_=[`string`,o.slice(y,l+1),y,l],y=l;break;case 64:e.lastIndex=y+1,e.test(o),l=e.lastIndex===0?o.length-1:e.lastIndex-2,_=[`at-word`,o.slice(y,l+1),y,l],y=l;break;case 92:for(l=y,f=!0;o.charCodeAt(l+1)===92;)l+=1,f=!f;if(c=o.charCodeAt(l+1),f&&c!==47&&c!==32&&c!==10&&c!==9&&c!==13&&c!==12&&(l+=1,r.test(o.charAt(l)))){for(;r.test(o.charAt(l+1));)l+=1;o.charCodeAt(l+1)===32&&(l+=1)}_=[`word`,o.slice(y,l+1),y,l],y=l;break;default:c===47&&o.charCodeAt(y+1)===42?(l=o.indexOf(`*/`,y+2)+1,l===0&&(s||a?l=o.length:C(`comment`)),_=[`comment`,o.slice(y,l+1),y,l],y=l):(t.lastIndex=y+1,t.test(o),l=t.lastIndex===0?o.length-1:t.lastIndex-2,_=[`word`,o.slice(y,l+1),y,l],b.push(_),y=l);break}return y++,_}function E(e){x.push(e)}return{back:E,endOfFile:w,nextToken:T,position:S}},Xn}var $n,er;function tr(){if(er)return $n;er=1;let e=Ln();class t extends e{constructor(e){super(e),this.type=`atrule`}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}return $n=t,t.default=t,e.registerAtRule(t),$n}var nr,rr;function ir(){if(rr)return nr;rr=1;let e=Ln(),t,n;class r extends e{constructor(e){super(e),this.type=`root`,this.nodes||=[]}normalize(e,t,n){let r=super.normalize(e);if(t){if(n===`prepend`)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of r)e.raws.before=t.raws.before}return r}removeChild(e,t){let n=this.index(e);return!t&&n===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new t(new n,this,e).stringify()}}return r.registerLazyResult=e=>{t=e},r.registerProcessor=e=>{n=e},nr=r,r.default=r,e.registerRoot(r),nr}var ar,or;function sr(){if(or)return ar;or=1;let e={comma(t){return e.split(t,[`,`],!0)},space(t){return e.split(t,[` `,`
49`,`	`])},split(e,t,n){let r=[],i=``,a=!1,o=0,s=!1,c=``,l=!1;for(let n of e)l?l=!1:n===`\\`?l=!0:s?n===c&&(s=!1):n===`"`||n===`'`?(s=!0,c=n):n===`(`?o+=1:n===`)`?o>0&&--o:o===0&&t.includes(n)&&(a=!0),a?(i!==``&&r.push(i.trim()),i=``,a=!1):i+=n;return(n||i!==``)&&r.push(i.trim()),r}};return ar=e,e.default=e,ar}var cr,lr;function ur(){if(lr)return cr;lr=1;let e=Ln(),t=sr();class n extends e{constructor(e){super(e),this.type=`rule`,this.nodes||=[]}get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:`,`+this.raw(`between`,`beforeOpen`);this.selector=e.join(n)}}return cr=n,n.default=n,e.registerRule(n),cr}var dr,fr;function pr(){if(fr)return dr;fr=1;let e=yn(),t=Qn(),n=Pn(),r=tr(),i=ir(),a=ur(),o={empty:!0,space:!0};function s(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}class c{constructor(e){this.input=e,this.root=new i,this.current=this.root,this.spaces=``,this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new r;t.name=e[1].slice(1),t.name===``&&this.unnamedAtrule(t,e),this.init(t,e[2]);let n,i,a,o=!1,s=!1,c=[],l=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),n=e[0],n===`(`||n===`[`?l.push(n===`(`?`)`:`]`):n===`{`&&l.length>0?l.push(`}`):n===l[l.length-1]&&l.pop(),l.length===0)if(n===`;`){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(n===`{`){s=!0;break}else if(n===`}`){if(c.length>0){for(a=c.length-1,i=c[a];i&&i[0]===`space`;)i=c[--a];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}else c.push(e);else c.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(c),c.length?(t.raws.afterName=this.spacesAndCommentsFromStart(c),this.raw(t,`params`,c),o&&(e=c[c.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between=``)):(t.raws.afterName=``,t.params=``),s&&(t.no
vendor: 4,775 bytes, line 49
49des=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let n=0,r;for(let i=t-1;i>=0&&(r=e[i],!(r[0]!==`space`&&(n+=1,n===2)));i--);throw this.input.error(`Missed semicolon`,r[0]===`word`?r[3]+1:r[2])}colon(e){let t=0,n,r,i;for(let[a,o]of e.entries()){if(n=o,r=n[0],r===`(`&&(t+=1),r===`)`&&--t,t===0&&r===`:`)if(!i)this.doubleColon(n);else if(i[0]===`word`&&i[1]===`progid`)continue;else return a;i=n}return!1}comment(e){let t=new n;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text=``,t.raws.left=r,t.raws.right=``;else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,n){let r=new e;this.init(r,t[0][2]);let i=t[t.length-1];for(i[0]===`;`&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(i[3]||i[2]||s(t)),r.source.end.offset++;t[0][0]!==`word`;)t.length===1&&this.unknownWord(t),r.raws.before+=t.shift()[1];for(r.source.start=this.getPosition(t[0][2]),r.prop=``;t.length;){let e=t[0][0];if(e===`:`||e===`space`||e===`comment`)break;r.prop+=t.shift()[1]}r.raws.between=``;let a;for(;t.length;)if(a=t.shift(),a[0]===`:`){r.raws.between+=a[1];break}else a[0]===`word`&&/\w/.test(a[1])&&this.unknownWord([a]),r.raws.between+=a[1];(r.prop[0]===`_`||r.prop[0]===`*`)&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o=[],c;for(;t.length&&(c=t[0][0],!(c!==`space`&&c!==`comment`));)o.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(a=t[e],a[1].toLowerCase()===`!important`){r.important=!0;let n=this.stringFrom(t,e);n=this.spacesFromEnd(t)+n,n!==` !important`&&(r.raws.important=n);break}else if(a[1].toLowerCase()===`important`){let n=t.slice(0),i=``;for(let t=e;t>0;t--){let e=n[t][0];if(i.trim().indexOf(`!`)===0&&e!==`space`)break;i=n.pop()[1]+i}i.trim().indexOf(`!`)===0&&(r.important=!0,r.raws.important=i,t=n)}if(a[0]!==`space`&&a[0]!==`comment`)break}t.some(e=>e[0]!==`space`&&e[0]!==`comment`)&&(r.raws.between+=o.map(e=>e[1]).join(``),o=[]),this.raw(r,`value`,o.concat(t),n),r.value.includes(`:`)&&!n&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error(`Double colon`,{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new a;this.init(t,e[2]),t.selector=``,t.raws.between=``,this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||``)+this.spaces,this.spaces=``,this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||``)+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&e.type===`rule`&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces=``)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces=``,e.type!==`comment`&&(this.semicolon=!1)}other(e){let t=!1,n=null,r=!1,i=null,a=[],o=e[1].startsWith(`--`),s=[],c=e;for(;c;){if(n=c[0],s.push(c),n===`(`||n===`[`)i||=c,a.push(n===`(`?`)`:`]`);else if(o&&r&&n===`{`)i||=c,a.push(`}`);else if(a.length===0)if(n===`;`)if(r){this.decl(s,o);return}else break;else if(n===`{`){this.rule(s);return}else if(n===`}`){this.tokenizer.back(s.pop()),t=!0;break}else n===`:`&&(r=!0);else n===a[a.length-1]&&(a.pop(),a.length===0&&(i=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),a.length>0&&this.unclosedBracket(i),t&&r){if(!o)for(;s.length&&(c=s[s.length-1][0],!(c!==`space`&&c!==`comment`));)this.tokenizer.back(s.pop());this.decl(s,o)}else this.unknownWord(s)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case`space`:this.spaces+=e[1];break;case`;`:this.freeSemicolon(e);break;case`}`:this.end(e);break;case`comment`:this.comment(e);break;case`at-word`:this.atrule(e);break;case`{`:this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,r){let i,a,s=n.length,c=``,l=!0,u,d;for(let e=0;e<s;e+=1)i=n[e],a=i[0],a===`space`&&e===s-1&&!r?l=!1:a===`comment`?(d=n[e-1]?n[e-1][0]:`empty`,u=n[e+1]?n[e+1][0]:`empty`,!o[d]&&!o[u]?c.slice(-1)===`,`?l=!1:c+=i[1]:l=!1):c+=i[1];if(!l){let r=n.reduce((e,t)=>
vendor: 6,255 bytes, line 49
49e+t[1],``);e.raws[t]={raw:r,value:c}}e[t]=c}rule(e){e.pop();let t=new a;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,`selector`,e),this.current=t}spacesAndCommentsFromEnd(e){let t,n=``;for(;e.length&&(t=e[e.length-1][0],!(t!==`space`&&t!==`comment`));)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n=``;for(;e.length&&(t=e[0][0],!(t!==`space`&&t!==`comment`));)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n=``;for(;e.length&&(t=e[e.length-1][0],t===`space`);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n=``;for(let r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}unclosedBlock(){let e=this.current.source.start;throw this.input.error(`Unclosed block`,e.line,e.column)}unclosedBracket(e){throw this.input.error(`Unclosed bracket`,{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error(`Unexpected }`,{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error(`Unknown word`,{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error(`At-rule without name`,{offset:t[2]},{offset:t[2]+t[1].length})}}return dr=c,dr}var mr,hr;function gr(){if(hr)return mr;hr=1;let e=Ln(),t=pr(),n=On();function r(e,r){let i=new n(e,r),a=new t(i);try{a.parse()}catch(e){throw e}return a.root}return mr=r,r.default=r,e.registerParse(r),mr}var _r,vr;function yr(){if(vr)return _r;vr=1;let{isClean:e,my:t}=sn(),n=jn(),r=pn(),i=Ln(),a=Bn();Un();let o=Yn(),s=gr(),c=ir(),l={atrule:`AtRule`,comment:`Comment`,decl:`Declaration`,document:`Document`,root:`Root`,rule:`Rule`},u={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},d={Once:!0,postcssPlugin:!0,prepare:!0};function f(e){return typeof e==`object`&&typeof e.then==`function`}function p(e){let t=!1,n=l[e.type];return e.type===`decl`?t=e.prop.toLowerCase():e.type===`atrule`&&(t=e.name.toLowerCase()),t&&e.append?[n,n+`-`+t,0,n+`Exit`,n+`Exit-`+t]:t?[n,n+`-`+t,n+`Exit`,n+`Exit-`+t]:e.append?[n,0,n+`Exit`]:[n,n+`Exit`]}function m(e){let t;return t=e.type===`document`?[`Document`,0,`DocumentExit`]:e.type===`root`?[`Root`,0,`RootExit`]:p(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function h(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>h(e)),t}let g={};class _{constructor(e,n,r){this.stringified=!1,this.processed=!1;let a;if(typeof n==`object`&&n&&(n.type===`root`||n.type===`document`))a=h(n);else if(n instanceof _||n instanceof o)a=h(n.root),n.map&&(r.map===void 0&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let e=s;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{a=e(n,r)}catch(e){this.processed=!0,this.error=e}a&&!a[t]&&i.rebuild(a)}this.result=new o(e,a,r),this.helpers={...g,postcss:g,result:this.result},this.plugins=this.processor.plugins.map(e=>typeof e==`object`&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||=this.runAsync(),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw Error(`Use process(css).then(cb) to work with async plugins`)}handleError(e,t){let n=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,e.name===`CssSyntaxError`&&!e.plugin?(e.plugin=n.postcssPlugin,e.setMessage()):n.postcssVersion}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if(typeof t==`object`)for(let n in t){if(!u[n]&&/^[A-Z]/.test(n))throw Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[n])if(typeof t[n]==`object`)for(let r in t[n])r===`*`?e(t,n,t[n][r]):e(t,n+`-`+r.toLowerCase(),t[n][r]);else typeof t[n]==`function`&&e(t,n,t[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],n=this.runOnRoot(t);if(f(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let n=[m(t)];for(;n.length>0;){let e=this.visitTick(n);if(f(e))try{await e}catch(e){let t=n[n.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,n]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if(t.type===`document`){let e=t.nodes.map(e=>n(e,this.helpers));await Promise.all(e)}else await n(t,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e==`object`&&e.Once){if(this.result.root.type===`document`){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return f(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e==`function`)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=r;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new n(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(f(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type===`document`)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,r]of e){this.result.lastPlugin=n;let e;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if(t.type!==`root`&&t.type!==`document`&&!t.parent)return!0;
49if(f(e))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:i}=n;if(r.type!==`root`&&r.type!==`document`&&!r.parent){t.pop();return}if(i.length>0&&n.visitorIndex<i.length){let[e,t]=i[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===i.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=e;try{return t(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(n.iterator!==0){let i=n.iterator,a;for(;a=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!a[e]){a[e]=!0,t.push(m(a));return}n.iterator=0,delete r.indexes[i]}let a=n.events;for(;n.eventIndex<a.length;){let t=a[n.eventIndex];if(n.eventIndex+=1,t===0){r.nodes&&r.nodes.length&&(r[e]=!0,n.iterator=r.getIterator());return}else if(this.listeners[t]){n.visitors=this.listeners[t];return}}t.pop()}walkSync(t){t[e]=!0;let n=p(t);for(let r of n)if(r===0)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[r];if(e&&this.visitSync(e,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return`LazyResult`}}return _.registerPostcss=e=>{g=e},_r=_,_.default=_,c.registerLazyResult(_),a.registerLazyResult(_),_r}var br,xr;function Sr(){if(xr)return br;xr=1;let e=jn(),t=pn();Un();let n=gr(),r=Yn();class i{constructor(n,i,a){i=i.toString(),this.stringified=!1,this._processor=n,this._css=i,this._opts=a,this._map=void 0;let o=t;this.result=new r(this._processor,void 0,this._opts),this.result.css=i;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let c=new e(o,void 0,this._opts,i);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=n;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return`NoWorkResult`}}return br=i,i.default=i,br}var Cr,wr;function Tr(){if(wr)return Cr;wr=1;let e=Sr(),t=yr(),n=Bn(),r=ir();class i{constructor(e=[]){this.version=`8.4.38`,this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(n.postcss===!0?n=n():n.postcss&&(n=n.postcss),typeof n==`object`&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if(typeof n==`object`&&n.postcssPlugin)t.push(n);else if(typeof n==`function`)t.push(n);else if(!(typeof n==`object`&&(n.parse||n.stringify)))throw Error(n+` is not a PostCSS plugin`);return t}process(n,r={}){return!this.plugins.length&&!r.parser&&!r.stringifier&&!r.syntax?new e(this,n,r):new t(this,n,r)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Cr=i,i.default=i,r.registerProcessor(i),n.registerProcessor(i),Cr}var Er,Dr;function Or(){if(Dr)return Er;Dr=1;let e=yn(),t=Tn(),n=Pn(),r=tr(),i=On(),a=ir(),o=ur();function s(c,l){if(Array.isArray(c))return c.map(e=>s(e));let{inputs:u,...d}=c;if(u){l=[];for(let e of u){let n={...e,__proto__:i.prototype};n.map&&={...n.map,__proto__:t.prototype},l.push(n)}}if(d.nodes&&=c.nodes.map(e=>s(e,l)),d.source){let{inputId:e,...t}=d.source;d.source=t,e!=null&&(d.source.input=l[e])}if(d.type===`root`)return new a(d);if(d.type===`decl`)return new e(d);if(d.type===`rule`)return new o(d);if(d.type===`comment`)return new n(d);if(d.type===`atrule`)return new r(d);throw Error(`Unknown node type: `+c.type)}return Er=s,s.default=s,Er}var kr,Ar;function jr(){if(Ar)return kr;
49Ar=1;let e=rn(),t=yn(),n=yr(),r=Ln(),i=Tr(),a=pn(),o=Or(),s=Bn(),c=Kn(),l=Pn(),u=tr(),d=Yn(),f=On(),p=gr(),m=sr(),h=ur(),g=ir(),_=gn();function v(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new i(e)}return v.plugin=function(e,t){let n=!1;function r(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
50https://evilmartians.com/chronicles/postcss-8-plugin-migration`),{}.LANG&&{}.LANG.startsWith(`cn`)&&console.warn(e+`: 里面 postcss.plugin 被弃用. 迁移指南:
51https://www.w3ctech.com/topic/2226`));let a=t(...r);return a.postcssPlugin=e,a.postcssVersion=new i().version,a}let a;return Object.defineProperty(r,"postcss",{get(){return a||=r(),a}}),r.process=function(e,t,n){return v([r(n)]).process(e,t)},r},v.stringify=a,v.parse=p,v.fromJSON=o,v.list=m,v.comment=e=>new l(e),v.atRule=e=>new u(e),v.decl=e=>new t(e),v.rule=e=>new h(e),v.root=e=>new g(e),v.document=e=>new s(e),v.CssSyntaxError=e,v.Declaration=t,v.Container=r,v.Processor=i,v.Document=s,v.Comment=l,v.Warning=c,v.AtRule=u,v.Result=d,v.Input=f,v.Rule=h,v.Root=g,v.Node=_,n.registerPostcss(v),kr=v,v.default=v,kr}var N=Yt(jr());N.stringify,N.fromJSON,N.plugin,N.parse,N.list,N.document,N.comment,N.atRule,N.rule,N.decl,N.root,N.CssSyntaxError,N.Declaration,N.Container,N.Processor,N.Document,N.Comment,N.Warning,N.AtRule,N.Result,N.Input,N.Rule,N.Root,N.Node;var Mr=class e{constructor(...e){Jt(this,`parentElement`,null),Jt(this,`parentNode`,null),Jt(this,`ownerDocument`),Jt(this,`firstChild`,null),Jt(this,`lastChild`,null),Jt(this,`previousSibling`,null),Jt(this,`nextSibling`,null),Jt(this,`ELEMENT_NODE`,1),Jt(this,`TEXT_NODE`,3),Jt(this,`nodeType`),Jt(this,`nodeName`),Jt(this,`RRNodeType`)}get childNodes(){let e=[],t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e)||t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(e){throw Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.`)}insertBefore(e,t){throw Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.`)}removeChild(e){throw Error(`RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.`)}toString(){return`RRNode`}},Nr={Node:[`childNodes`,`parentNode`,`parentElement`,`textContent`],ShadowRoot:[`host`,`styleSheets`],Element:[`shadowRoot`,`querySelector`,`querySelectorAll`],MutationObserver:[]},Pr={Node:[`contains`,`getRootNode`],ShadowRoot:[`getSelection`],Element:[],MutationObserver:[`constructor`]},Fr={};function Ir(e){var t;let n=((t=globalThis==null?void 0:globalThis.Zone)?.__symbol__)?.call(t,e);if(n&&globalThis[n])return globalThis[n]}function Lr(e){if(Fr[e])return Fr[e];let t=Ir(e)||globalThis[e],n=t.prototype,r=e in Nr?Nr[e]:void 0,i=!!(r&&r.every(e=>!!(Object.getOwnPropertyDescriptor(n,e)?.get)?.toString().includes(`[native code]`))),a=e in Pr?Pr[e]:void 0,o=!!(a&&a.every(e=>typeof n[e]==`function`&&n[e]?.toString().includes(`[native code]`)));if(i&&o)return Fr[e]=t.prototype,t.prototype;try{let r=document.createElement(`iframe`);document.body.appendChild(r);let i=r.contentWindow;if(!i)return t.prototype;let a=i[e].prototype;return document.body.removeChild(r),a?Fr[e]=a:n}catch{return n}}var Rr={};function zr(e,t,n){let r=`${e}.${String(n)}`;if(Rr[r])return Rr[r].call(t);let i=Lr(e),a=Object.getOwnPropertyDescriptor(i,n)?.get;return a?(Rr[r]=a,a.call(t)):t[n]}var Br={};function Vr(e,t,n){let r=`${e}.${String(n)}`;if(Br[r])return Br[r].bind(t);let i=Lr(e)[n];return typeof i==`function`?(Br[r]=i,i.bind(t)):t[n]}function Hr(e){return zr(`Node`,e,`childNodes`)}function Ur(e){return zr(`Node`,e,`parentNode`)}function Wr(e){return zr(`Node`,e,`parentElement`)}function Gr(e){return zr(`Node`,e,`textContent`)}function Kr(e,t){return Vr(`Node`,e,`contains`)(t)}function qr(e){return Vr(`Node`,e,`getRootNode`)()}function Jr(e){return!e||!(`host`in e)?null:zr(`ShadowRoot`,e,`host`)}function Yr(e){return e.styleSheets}function Xr(e){return!e||!(`shadowRoot`in e)?null:zr(`Element`,e,`shadowRoot`)}function Zr(e,t){return zr(`Element`,e,`querySelector`)(t)}function Qr(e,t){return zr(`Element`,e,`querySelectorAll`)(t)}function $r(){return Lr(`MutationObserver`).constructor}var ei={childNodes:Hr,parentNode:Ur,parentElement:Wr,textContent:Gr,contains:Kr,getRootNode:qr,host:Jr,styleSheets:Yr,shadowRoot:Xr,querySelector:Zr,querySelectorAll:Qr,mutationObserver:$r};function ti(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var ni=`Please stop import mirror directly. Instead of that,\r
52now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
53or you can use record.mirror to access the mirror instance during recording.`,ri={map:{},getId(){return console.error(ni),-1},getNode(){return console.error(ni),null},removeNodeFromMap(){console.error(ni)},has(){return console.error(ni),!1},reset(){console.error(ni)}};typeof window<`u`&&window.Proxy&&window.Reflect&&(ri=new Proxy(ri,{get(e,t,n){return t===`map`&&console.error(ni),Reflect.get(e,t,n)}}));function ii(e,t,n={}){let r=null,i=0;return function(...a){let o=Date.now();!i&&n.leading===!1&&(i=o);let s=t-(o-i),c=this;s<=0||s>t?(r&&=(clearTimeout(r),null),i=o,e.apply(c,a)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{i=n.leading===!1?0:Date.now(),r=null,e.apply(c,a)},s))}}function ai(e,t,n,r,i=window){let a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),a&&a.set&&a.set.call(this,e)}}),()=>ai(e,t,a||{},!0)}function oi(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return typeof i==`function`&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}var si=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(si=()=>new Date().getTime());function ci(e){let t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset===void 0?t.documentElement.scrollLeft||t?.body&&ei.parentElement(t.body)?.scrollLeft||t?.body?.scrollLeft||0:e.pageXOffset,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset===void 0?t?.documentElement.scrollTop||t?.body&&ei.parentElement(t.body)?.scrollTop||t?.body?.scrollTop||0:e.pageYOffset}}function li(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ui(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function di(e){return e?e.nodeType===e.ELEMENT_NODE?e:ei.parentElement(e):null}function fi(e,t,n,r){if(!e)return!1;let i=di(e);if(!i)return!1;try{if(typeof t==`string`){if(i.classList.contains(t)||r&&i.closest(`.`+t)!==null)return!0}else if(le(i,t,r))return!0}catch{}return!!(n&&(i.matches(n)||r&&i.closest(n)!==null))}function pi(e,t){return t.getId(e)!==-1}function mi(e,t,n){return e.tagName===`TITLE`&&n.headTitleMutations?!0:t.getId(e)===ce}function hi(e,t){if(ae(e))return!1;let n=t.getId(e);if(!t.has(n))return!0;let r=ei.parentNode(e);return r&&r.nodeType===e.DOCUMENT_NODE?!1:!r||hi(r,t)}function gi(e){return!!e.changedTouches}function _i(e=window){`NodeList`in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),`DOMTokenList`in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function vi(e){let t={},n=(e,n)=>{let r={value:e,parent:n,children:[]};return t[e.node.id]=r,r},r=[];for(let i of e){let{nextId:e,parentId:a}=i;if(e&&e in t){let a=t[e];if(a.parent){let e=a.parent.children.indexOf(a);a.parent.children.splice(e,0,n(i,a.parent))}else{let e=r.indexOf(a);r.splice(e,0,n(i,null))}continue}if(a in t){let e=t[a];e.children.push(n(i,e));continue}r.push(n(i,null))}return r}function yi(e,t){t(e.value);for(let n=e.children.length-1;n>=0;n--)yi(e.children[n],t)}function bi(e,t){return!!(e.nodeName===`IFRAME`&&t.getMeta(e))}function xi(e,t){return!!(e.nodeName===`LINK`&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute(`rel`)===`stylesheet`&&t.getMeta(e))}function Si(e,t){let n=e.ownerDocument?.defaultView?.frameElement;if(!n||n===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};let r=n.getBoundingClientRect(),i=Si(n,t),a=r.height/n.clientHeight;return{x:r.x*i.relativeScale+i.x,y:r.y*i.relativeScale+i.y,relativeScale:a,absoluteScale:i.absoluteScale*a}}function Ci(e){return e?e instanceof Mr&&`shadowRoot`in e?!!e.shadowRoot:!!ei.shadowRoot(e):!1}function wi(e,t){let n=e[t[0]];return t.length===1?n:wi(n.cssRules[t[1]].cssRules,t.slice(2))}function Ti(e){let t=[...e];return{positions:t,index:t.pop()}}function Ei(e){let t=new Set,n=[];for(let r=e.length;r--;){let i=e[r];t.has(i.id)||(n.push(i),t.add(i.id))}return n}var Di=class{constructor(){d(this,`id`,1),d(this,`styleIDMap`,new WeakMap),d(this,`idStyleMap`,new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=t===void 0?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function Oi(e){let t=null;return`getRootNode`in e&&ei.getRootNode(e)?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&ei.host(ei.getRootNode(e))&&(t=ei.host(ei.getRootNode(e))),t}function ki(e){let t=e,n;for(;n=Oi(t);)t=n;return t}function Ai(e){let t=e.ownerDocument;if(!t)return!1;let n=ki(e);return ei.contains(t,n)}function ji(e){let t=e.ownerDocument;return t?ei.contains(t,e)||Ai(e):!1}for(var Mi=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:Di,get _mirror(){return ri},closestElementOfNode:di,getBaseDimension:Si,getNestedRule:wi,getPositionsAndIndex:Ti,getRootShadowHost:ki,getShadowHost:Oi,getWindowHeight:li,getWindowScroll:ci,getWindowWidth:ui,hasShadowRoot:Ci,hookSetter:ai,inDom:ji,isAncestorRemoved:hi,isBlocked:fi,isIgnored:mi,isSerialized:pi,isSerializedIframe:bi,isSerializedStylesheet:xi,iterateResolveTree:yi,legacy_isTouchEvent:gi,get nowTimestamp(){return si}
53,on:ti,patch:oi,polyfill:_i,queueToResolveTrees:vi,shadowHostInDom:Ai,throttle:ii,uniqueTextMutations:Ei},Symbol.toStringTag,{value:`Module`})),Ni=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Pi=typeof Uint8Array>`u`?[]:new Uint8Array(256),Fi=0;Fi<Ni.length;Fi++)Pi[Ni.charCodeAt(Fi)]=Fi;typeof self<`u`&&self.Blob&&new Blob([`(function() {
54  "use strict";
55  var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
56  var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
57  for (var i = 0; i < chars.length; i++) {
58    lookup[chars.charCodeAt(i)] = i;
59  }
60  var encode = function(arraybuffer) {
61    var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";
62    for (i2 = 0; i2 < len; i2 += 3) {
63      base64 += chars[bytes[i2] >> 2];
64      base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];
65      base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];
66      base64 += chars[bytes[i2 + 2] & 63];
67    }
68    if (len % 3 === 2) {
69      base64 = base64.substring(0, base64.length - 1) + "=";
70    } else if (len % 3 === 1) {
71      base64 = base64.substring(0, base64.length - 2) + "==";
72    }
73    return base64;
74  };
75  const lastBlobMap = /* @__PURE__ */ new Map();
76  const transparentBlobMap = /* @__PURE__ */ new Map();
77  async function getTransparentBlobFor(width, height, dataURLOptions) {
78    const id = \`\${width}-\${height}\`;
79    if ("OffscreenCanvas" in globalThis) {
80      if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);
81      const offscreen = new OffscreenCanvas(width, height);
82      offscreen.getContext("2d");
83      const blob = await offscreen.convertToBlob(dataURLOptions);
84      const arrayBuffer = await blob.arrayBuffer();
85      const base64 = encode(arrayBuffer);
86      transparentBlobMap.set(id, base64);
87      return base64;
88    } else {
89      return "";
90    }
91  }
92  const worker = self;
93  worker.onmessage = async function(e) {
94    if ("OffscreenCanvas" in globalThis) {
95      const { id, bitmap, width, height, dataURLOptions } = e.data;
96      const transparentBase64 = getTransparentBlobFor(
97        width,
98        height,
99        dataURLOptions
100      );
101      const offscreen = new OffscreenCanvas(width, height);
102      const ctx = offscreen.getContext("2d");
103      ctx.drawImage(bitmap, 0, 0);
104      bitmap.close();
105      const blob = await offscreen.convertToBlob(dataURLOptions);
106      const type = blob.type;
107      const arrayBuffer = await blob.arrayBuffer();
108      const base64 = encode(arrayBuffer);
109      if (!lastBlobMap.has(id) && await transparentBase64 === base64) {
110        lastBlobMap.set(id, base64);
111        return worker.postMessage({ id });
112      }
113      if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });
114      worker.postMessage({
115        id,
116        type,
117        base64,
118        width,
119        height
120      });
121      lastBlobMap.set(id, base64);
122    } else {
123      return worker.postMessage({ id: e.data.id });
124    }
125  };
126})();
127//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map
128`],{type:`text/javascript;charset=utf-8`});try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement(`iframe`);document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug(`Unable to override Array.from`,e)}se();var Ii;(function(e){e[e.NotStarted=0]=`NotStarted`,e[e.Running=1]=`Running`,e[e.Stopped=2]=`Stopped`})(Ii||={});var Li=class{constructor(e){c(this,`fileName`),c(this,`functionName`),c(this,`lineNumber`),c(this,`columnNumber`),this.fileName=e.fileName||``,this.functionName=e.functionName||``,this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){let e=this.lineNumber||``,t=this.columnNumber||``;return this.functionName?`${this.functionName} (${this.fileName}:${e}:${t})`:`${this.fileName}:${e}:${t}`}},Ri=/(^|@)\S+:\d+/,zi=/^\s*at .*(\S+:\d+|\(native\))/m,Bi=/^(eval@)?(\[native code])?$/,Vi={parse:function(e){return e?e.stacktrace!==void 0||e[`opera#sourceloc`]!==void 0?this.parseOpera(e):e.stack&&e.stack.match(zi)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn(`[console-record-plugin]: Failed to parse error object:`,e),[]):[]},extractLocation:function(e){if(e.indexOf(`:`)===-1)return[e];let t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,``));if(!t)throw Error(`Cannot parse given url: ${e}`);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split(`
129`).filter(function(e){return!!e.match(zi)},this).map(function(e){e.indexOf(`(eval `)>-1&&(e=e.replace(/eval code/g,`eval`).replace(/(\(eval at [^()]*)|(\),.*$)/g,``));let t=e.replace(/^\s+/,``).replace(/\(eval code/g,`(`),n=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=n?t.replace(n[0],``):t;let r=t.split(/\s+/).slice(1),i=this.extractLocation(n?n[1]:r.pop());return new Li({functionName:r.join(` `)||void 0,fileName:[`eval`,`<anonymous>`].indexOf(i[0])>-1?void 0:i[0],lineNumber:i[1],columnNumber:i[2]})},this)},parseFFOrSafari:function(e){return e.stack.split(`
130`).filter(function(e){return!e.match(Bi)},this).map(function(e){if(e.indexOf(` > eval`)>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,`:$1`)),e.indexOf(`@`)===-1&&e.indexOf(`:`)===-1)return new Li({functionName:e});{let t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,i=this.extractLocation(e.replace(t,``));return new Li({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2]})}},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf(`
131`)>-1&&e.message.split(`
132`).length>e.stacktrace.split(`
133`).length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){let t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split(`
134`),r=[];for(let e=2,i=n.length;e<i;e+=2){let i=t.exec(n[e]);i&&r.push(new Li({fileName:i[2],lineNumber:parseFloat(i[1])}))}return r},parseOpera10:function(e){let t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split(`
135`),r=[];for(let e=0,i=n.length;e<i;e+=2){let i=t.exec(n[e]);i&&r.push(new Li({functionName:i[3]||void 0,fileName:i[2],lineNumber:parseFloat(i[1])}))}return r},parseOpera11:function(e){return e.stack.split(`
136`).filter(function(e){return!!e.match(Ri)&&!e.match(/^Error created at/)},this).map(function(e){let t=e.split(`@`),n=this.extractLocation(t.pop());return new Li({functionName:(t.shift()||``).replace(/<anonymous function(: (\w+))?>/,`$2`).replace(/\([^)]*\)/g,``)||void 0,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function Hi(e){if(!e||!e.outerHTML)return``;let t=``;for(;e.parentElement;){let n=e.localName;if(!n)break;n=n.toLowerCase();let r=e.parentElement,i=[];if(r.children&&r.children.length>0)for(let e=0;e<r.children.length;e++){let t=r.children[e];t.localName&&t.localName.toLowerCase&&t.localName.toLowerCase()===n&&i.push(t)}i.length>1&&(n+=`:eq(${i.indexOf(e)})`),t=n+(t?`>`+t:``),e=r}return t}function Ui(e){return Object.prototype.toString.call(e)===`[object Object]`}function Wi(e,t){if(t===0)return!0;let n=Object.keys(e);for(let r of n)if(Ui(e[r])&&Wi(e[r],t-1))return!0;return!1}function Gi(e,t){let n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);let r=[],i=[];return JSON.stringify(e,function(e,t){if(r.length>0){let n=r.indexOf(this);
136~n?r.splice(n+1):r.push(this),~n?i.splice(n,1/0,e):i.push(e),~r.indexOf(t)&&(t=r[0]===t?`[Circular ~]`:`[Circular ~.`+i.slice(0,r.indexOf(t)).join(`.`)+`]`)}else r.push(t);if(t===null)return t;if(t===void 0)return`undefined`;if(a(t))return o(t);if(typeof t==`bigint`)return t.toString()+`n`;if(t instanceof Event){let e={};for(let n in t){let r=t[n];Array.isArray(r)?e[n]=Hi(r.length?r[0]:null):e[n]=r}return e}else if(t instanceof Node)return t instanceof HTMLElement?t?t.outerHTML:``:t.nodeName;else if(t instanceof Error)return t.stack?t.stack+`
137End of stack for Error object`:t.name+`: `+t.message;return t});function a(e){return!!(Ui(e)&&Object.keys(e).length>n.numOfKeysLimit||typeof e==`function`||Ui(e)&&Wi(e,n.depthOfLimit))}function o(e){let t=e.toString();return n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t=`${t.slice(0,n.stringLengthLimit)}...`),t}}var Ki={level:[`assert`,`clear`,`count`,`countReset`,`debug`,`dir`,`dirxml`,`error`,`group`,`groupCollapsed`,`groupEnd`,`info`,`log`,`table`,`time`,`timeEnd`,`timeLog`,`trace`,`warn`],lengthThreshold:1e3,logger:`console`};function qi(e,t,n){let r=n?Object.assign({},Ki,n):Ki,i=r.logger;if(!i)return()=>{};let a;a=typeof i==`string`?t[i]:i;let o=0,s=!1,c=[];if(r.level.includes(`error`)){let n=t=>{let n=t.message,i=t.error;e({level:`error`,trace:Vi.parse(i).map(e=>e.toString()),payload:[Gi(n,r.stringifyOptions)]})};t.addEventListener(`error`,n),c.push(()=>{t.removeEventListener(`error`,n)});let i=t=>{let n,i;t.reason instanceof Error?(n=t.reason,i=[Gi(`Uncaught (in promise) ${n.name}: ${n.message}`,r.stringifyOptions)]):(n=Error(),i=[Gi(`Uncaught (in promise)`,r.stringifyOptions),Gi(t.reason,r.stringifyOptions)]),e({level:`error`,trace:Vi.parse(n).map(e=>e.toString()),payload:i})};t.addEventListener(`unhandledrejection`,i),c.push(()=>{t.removeEventListener(`unhandledrejection`,i)})}for(let e of r.level)c.push(l(a,e));return()=>{c.forEach(e=>e())};function l(t,n){return t[n]?Mi.patch(t,n,t=>(...i)=>{if(t.apply(this,i),!(n===`assert`&&i[0])&&!s){s=!0;try{let t=Vi.parse(Error()).map(e=>e.toString()).splice(1),a=(n===`assert`?i.slice(1):i).map(e=>Gi(e,r.stringifyOptions));o++,o<r.lengthThreshold?e({level:n,trace:t,payload:a}):o===r.lengthThreshold&&e({level:`warn`,trace:[],payload:[Gi(`The number of log records reached the threshold.`)]})}catch(e){t(`rrweb logger error:`,e,...i)}finally{s=!1}}}):()=>{}}}var Ji=`rrweb/console@1`,Yi=e=>({name:Ji,observer:qi,options:e}),Xi=e({record:()=>sf}),Zi=Object.defineProperty,Qi=(e,t,n)=>t in e?Zi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,P=(e,t,n)=>Qi(e,typeof t==`symbol`?t:t+``,n),$i=Object.defineProperty,ea=(e,t,n)=>t in e?$i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ta=(e,t,n)=>ea(e,typeof t==`symbol`?t:t+``,n),na=(e=>(e[e.Document=0]=`Document`,e[e.DocumentType=1]=`DocumentType`,e[e.Element=2]=`Element`,e[e.Text=3]=`Text`,e[e.CDATA=4]=`CDATA`,e[e.Comment=5]=`Comment`,e))(na||{}),ra={Node:[`childNodes`,`parentNode`,`parentElement`,`textContent`],ShadowRoot:[`host`,`styleSheets`],Element:[`shadowRoot`,`querySelector`,`querySelectorAll`],MutationObserver:[]},ia={Node:[`contains`,`getRootNode`],ShadowRoot:[`getSelection`],Element:[],MutationObserver:[`constructor`]},aa={};function oa(e){var t;let n=((t=globalThis==null?void 0:globalThis.Zone)?.__symbol__)?.call(t,e);if(n&&globalThis[n])return globalThis[n]}function sa(e){if(aa[e])return aa[e];let t=oa(e)||globalThis[e],n=t.prototype,r=e in ra?ra[e]:void 0,i=!!(r&&r.every(e=>!!(Object.getOwnPropertyDescriptor(n,e)?.get)?.toString().includes(`[native code]`))),a=e in ia?ia[e]:void 0,o=!!(a&&a.every(e=>typeof n[e]==`function`&&n[e]?.toString().includes(`[native code]`)));if(i&&o)return aa[e]=t.prototype,t.prototype;try{let r=document.createElement(`iframe`);document.body.appendChild(r);let i=r.contentWindow;if(!i)return t.prototype;let a=i[e].prototype;return document.body.removeChild(r),a?aa[e]=a:n}catch{return n}}var ca={};function la(e,t,n){let r=`${e}.${String(n)}`;if(ca[r])return ca[r].call(t);let i=sa(e),a=Object.getOwnPropertyDescriptor(i,n)?.get;return a?(ca[r]=a,a.call(t)):t[n]}var ua={};
137function da(e,t,n){let r=`${e}.${String(n)}`;if(ua[r])return ua[r].bind(t);let i=sa(e)[n];return typeof i==`function`?(ua[r]=i,i.bind(t)):t[n]}function fa(e){return la(`Node`,e,`childNodes`)}function pa(e){return la(`Node`,e,`parentNode`)}function ma(e){return la(`Node`,e,`parentElement`)}function ha(e){return la(`Node`,e,`textContent`)}function ga(e,t){return da(`Node`,e,`contains`)(t)}function _a(e){return da(`Node`,e,`getRootNode`)()}function va(e){return!e||!(`host`in e)?null:la(`ShadowRoot`,e,`host`)}function ya(e){return e.styleSheets}function ba(e){return!e||!(`shadowRoot`in e)?null:la(`Element`,e,`shadowRoot`)}function xa(e,t){return la(`Element`,e,`querySelector`)(t)}function Sa(e,t){return la(`Element`,e,`querySelectorAll`)(t)}function Ca(){return sa(`MutationObserver`).constructor}var wa={childNodes:fa,parentNode:pa,parentElement:ma,textContent:ha,contains:ga,getRootNode:_a,host:va,styleSheets:ya,shadowRoot:ba,querySelector:xa,querySelectorAll:Sa,mutationObserver:Ca};function Ta(e){return e.nodeType===e.ELEMENT_NODE}function Ea(e){let t=e&&`host`in e&&`mode`in e&&wa.host(e)||null;return!!(t&&`shadowRoot`in t&&wa.shadowRoot(t)===e)}function Da(e){return Object.prototype.toString.call(e)===`[object ShadowRoot]`}function Oa(e){return e.includes(` background-clip: text;`)&&!e.includes(` -webkit-background-clip: text;`)&&(e=e.replace(/\sbackground-clip:\s*text;/g,` -webkit-background-clip: text; background-clip: text;`)),e}function ka(e){let{cssText:t}=e;if(t.split(`"`).length<3)return t;let n=[`@import`,`url(${JSON.stringify(e.href)})`];return e.layerName===``?n.push(`layer`):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(` `)+`;`}function Aa(e){try{let t=e.rules||e.cssRules;if(!t)return null;let n=e.href;return!n&&e.ownerNode&&e.ownerNode.ownerDocument&&(n=e.ownerNode.ownerDocument.location.href),Oa(Array.from(t,e=>ja(e,n)).join(``))}catch{return null}}function ja(e,t){if(Na(e)){let t;try{t=Aa(e.styleSheet)||ka(e)}catch{t=e.cssText}return e.styleSheet.href?Ja(t,e.styleSheet.href):t}else{let n=e.cssText;return Pa(e)&&e.selectorText.includes(`:`)&&(n=Ma(n)),t?Ja(n,t):n}}function Ma(e){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,`$1\\$2`)}function Na(e){return`styleSheet`in e}function Pa(e){return`selectorText`in e}var Fa=class{constructor(){ta(this,`idNodeMap`,new Map),ta(this,`nodeMetaMap`,new WeakMap)}getId(e){return e?this.getMeta(e)?.id??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){let n=this.getNode(e);if(n){let e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Ia(){return new Fa}function La({element:e,maskInputOptions:t,tagName:n,type:r,value:i,maskInputFn:a}){let o=i||``,s=r&&Ra(r);return(t[n.toLowerCase()]||s&&t[s])&&(o=a?a(o,e):`*`.repeat(o.length)),o}function Ra(e){return e.toLowerCase()}var za=`__rrweb_original__`;function Ba(e){let t=e.getContext(`2d`);if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){let i=t.getImageData,a=za in i?i[za]:i;if(new Uint32Array(a.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(e=>e!==0))return!1}return!0}function Va(e){let t=e.type;return e.hasAttribute(`data-rr-is-password`)?`password`:t?Ra(t):null}function Ha(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}return n.pathname.match(/\.([0-9a-z]+)(?:$)/i)?.[1]??null}function Ua(e){let t=``;return t=e.indexOf(`//`)>-1?e.split(`/`).slice(0,3).join(`/`):e.split(`/`)[0],t=t.split(`?`)[0],t}var Wa=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ga=/^(?:[a-z+]+:)?\/\//i,Ka=/^www\..*/i,qa=/^(data:)([^,]*),(.*)/i;function Ja(e,t){return(e||``).replace(Wa,(e,n,r,i,a,o)=>{let s=r||a||o,c=n||i||``;if(!s)return e;if(Ga.test(s)||Ka.test(s)||qa.test(s))return`url(${c}${s}${c})`;if(s[0]===`/`)return`url(${c}${Ua(t)+s}${c})`;let l=t.split(`/`),u=s.split(`/`);l.pop();for(let e of u)if(e===`.`)continue;else e===`..`?l.pop():l.push(e);return`url(${c}${l.join(`/`)}${c})`})}function Ya(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,``):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,``).replace(/0px/g,`0`)}function Xa(e,t,n=!1){let r=Array.from(t.childNodes),i=[],a=0;if(r.length>1&&e&&typeof e==`string`){let t=Ya(e,n),o=t.length/e.length;for(let s=1;s<r.length;s++)if(r[s].textContent&&typeof r[s].textContent==`string`){let c=Ya(r[s].textContent,n),l=3;for(;l<c.length&&(c[l].match(/[a-zA-Z0-9]/)||c.indexOf(c.substring(0,l),1)!==-1);l++);for(;l<c.length;l++){let u=c.substring(0,l),d=t.split(u),f=-1;if(d.length===2)f=d[0].length;else if(d.length>2&&d[0]===``&&r[s-1].textContent!==``)f=t.indexOf(u,1);else if(d.length===1){if(u=u.substring(0,u.length-1),d=t.split(u),d.length<=1)return i.push(e),i;l=101}else l===c.length-1&&(f=t.indexOf(u));if(d.length>=2&&l>100){let e=r[s-1].textContent;if(e&&typeof e==`string`){let n=Ya(e).length;f=t.indexOf(u,n)}f===-1&&(f=d[0].length)}if(f!==-1){let s=Math.floor(f/o);for(;s>0&&s<e.length;){if(a+=1,a>50*r.length)return i.push(e),i;let c=Ya(e.substring(0,s),n);if(c.length===f){i.push(e.substring(0,s)),e=e.substring(s),t=t.substring(f);break}else c.length<f?s+=Math.max(1,Math.floor((f-c.length)/o)):s-=Math.max(1,Math.floor((c.length-f)*o))}break}}}}return i.push(e),i}function Za(e,t){return Xa(e,t).join(`/* rr_split */`)}var Qa=`lightgrey`,$a=1,eo=RegExp(`[^a-z0-9-_:]`),to=-2;function no(){return $a++}function ro(e){if(e instanceof HTMLFormElement)return`form`;let t=Ra(e.tagName);return eo.test(t)?`div`:t}var io,ao,oo=/^[^ \t\n\r\u000c]+/,so=/^[, \t\n\r\u000c]+/;function co(e,t){if(t.trim()===``)return t;let n=0;function r(e){let r,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):``}let i=[];for(;r(so),!(n>=t.length);){let a=r(oo);if(a.slice(-1)===`,`)a=uo(e,a.substring(0,a.length-1)),i.push(a);else{let r=``;a=uo(e,a);let o=!1;for(;;){let e=t.charAt(n);if(e===``){i.push((a+r).trim());break}else if(o)e===`)`&&(o=!1);else if(e===`,`){n+=1,i.push((a+r).trim());break}else e===`(`&&(o=!0);r+=e,n+=1}}}return i.join(`, `)}var lo=new WeakMap;function uo(e,t){return!t||t.trim()===``?t:po(e,t)}function fo(e){return!!(e.tagName===`svg`||e.ownerSVGElement)}function po(e,t){let n=lo.get(e);if(n||(n=e.createElement(`a`),lo.set(e,n)),!t)t=``;else if(t.startsWith(`blob:`)||t.startsWith(`data:`))return t;return n.setAttribute(`href`,t),n.href}function mo(e,t,n,r){return r&&(n===`src`||n===`href`&&!(t===`use`&&r[0]===`#`)||n===`xlink:href`&&r[0]!==`#`||n===`background`&&(t===`table`||t===`td`||t===`th`)?uo(e,r):n===`srcset`?co(e,r):n===`style`?Ja(r,po(e)):t===`object`&&n===`data`?uo(e,r):r)}
137function ho(e,t,n){return(e===`video`||e===`audio`)&&t===`autoplay`}function go(e,t,n){try{if(typeof t==`string`){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch{}return!1}function _o(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?_o(wa.parentNode(e),t,n):!1;for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return n?_o(wa.parentNode(e),t,n):!1}function vo(e,t,n,r){let i;if(Ta(e)){if(i=e,!wa.childNodes(i).length)return!1}else if(wa.parentElement(e)===null)return!1;else i=wa.parentElement(e);try{if(typeof t==`string`){if(r){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(_o(i,t,r))return!0;if(n){if(r){if(i.closest(n))return!0}else if(i.matches(n))return!0}}catch{}return!1}function yo(e,t,n){let r=e.contentWindow;if(!r)return;let i=!1,a;try{a=r.document.readyState}catch{return}if(a!==`complete`){let r=setTimeout(()=>{i||=(t(),!0)},n);e.addEventListener(`load`,()=>{clearTimeout(r),i=!0,t()});return}let o=`about:blank`;if(r.location.href!==o||e.src===o||e.src===``)return setTimeout(t,0),e.addEventListener(`load`,t);e.addEventListener(`load`,t)}function bo(e,t,n){let r=!1,i;try{i=e.sheet}catch{return}if(i)return;let a=setTimeout(()=>{r||=(t(),!0)},n);e.addEventListener(`load`,()=>{clearTimeout(a),r=!0,t()})}function xo(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:a,needsMask:o,inlineStylesheet:s,maskInputOptions:c={},maskTextFn:l,maskInputFn:u,maskAttributeFn:d,dataURLOptions:f={},inlineImages:p,recordCanvas:m,keepIframeSrcFn:h,newlyAddedElement:g=!1,cssCaptured:_=!1,applyBackgroundColorToBlockedElements:v=!1}=t,y=So(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode===`CSS1Compat`?{type:na.Document,childNodes:[]}:{type:na.Document,childNodes:[],compatMode:e.compatMode};case e.DOCUMENT_TYPE_NODE:return{type:na.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return wo(e,{doc:n,blockClass:i,blockSelector:a,inlineStylesheet:s,maskInputOptions:c,maskInputFn:u,maskAttributeFn:d,dataURLOptions:f,inlineImages:p,recordCanvas:m,keepIframeSrcFn:h,newlyAddedElement:g,rootId:y,applyBackgroundColorToBlockedElements:v});case e.TEXT_NODE:return Co(e,{doc:n,needsMask:o,maskTextFn:l,rootId:y,cssCaptured:_});case e.CDATA_SECTION_NODE:return{type:na.CDATA,textContent:``,rootId:y};case e.COMMENT_NODE:return{type:na.Comment,textContent:wa.textContent(e)||``,rootId:y};default:return!1}}function So(e,t){if(!t.hasNode(e))return;let n=t.getId(e);return n===1?void 0:n}function Co(e,t){let{needsMask:n,maskTextFn:r,rootId:i,cssCaptured:a}=t,o=wa.parentNode(e),s=o&&o.tagName,c=``,l=s===`STYLE`||void 0,u=s===`SCRIPT`||void 0;return u?c=`SCRIPT_PLACEHOLDER`:a||(c=wa.textContent(e),l&&c&&(c=Ja(c,po(t.doc)))),!l&&!u&&c&&n&&(c=r?r(c,wa.parentElement(e)):c.replace(/[\S]/g,`*`)),{type:na.Text,textContent:c||``,rootId:i}}function wo(e,t){let{doc:n,blockClass:r,blockSelector:i,inlineStylesheet:a,maskInputOptions:o={},maskInputFn:s,maskAttributeFn:c,dataURLOptions:l={},inlineImages:u,recordCanvas:d,keepIframeSrcFn:f,newlyAddedElement:p=!1,rootId:m,applyBackgroundColorToBlockedElements:h=!1}=t,g=go(e,r,i),_=ro(e),v={},y=e.attributes.length;for(let t=0;t<y;t++){let r=e.attributes[t];if(!ho(_,r.name,r.value)){let t=mo(n,_,Ra(r.name),r.value);if(c&&t!==null){let n=c(r.name,t,e);n!==null&&(v[r.name]=n)}else v[r.name]=t}}if(_===`link`&&a){let t=Array.from(n.styleSheets).find(t=>t.href===e.href),r=null;t&&(r=Aa(t)),r&&(delete v.rel,delete v.href,v._cssText=r)}if(_===`style`&&e.sheet){let t=Aa(e.sheet);t&&(e.childNodes.length>1&&(t=Za(t,e)),v._cssText=t)}if(_===`input`||_===`textarea`||_===`select`){let t=e.value,n=e.checked;v.type!==`radio`&&v.type!==`checkbox`&&v.type!==`submit`&&v.type!==`button`&&t?v.value=La({element:e,type:Va(e),tagName:_,value:t,maskInputOptions:o,maskInputFn:s}):n&&(v.checked=n)}if(_===`option`&&(e.selected&&!o.select?v.selected=!0:delete v.selected),_===`dialog`&&e.open&&(v.rr_open_mode=e.matches(`dialog:modal`)?`modal`:`non-modal`),_===`canvas`&&d){if(e.__context===`2d`)Ba(e)||(v.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!(`__context`in e)){let t=e.toDataURL(l.type,l.quality),r=n.createElement(`canvas`);r.width=e.width,r.height=e.height,t!==r.toDataURL(l.type,l.quality)&&(v.rr_dataURL=t)}}if(_===`img`&&u){io||(io=n.createElement(`canvas`),ao=io.getContext(`2d`));let t=e,r=t.currentSrc||t.getAttribute(`src`)||`<unknown-src>`,i=t.crossOrigin,a=()=>{t.removeEventListener(`load`,a);
137try{io.width=t.naturalWidth,io.height=t.naturalHeight,ao.drawImage(t,0,0),v.rr_dataURL=io.toDataURL(l.type,l.quality)}catch(e){if(t.crossOrigin!==`anonymous`){t.crossOrigin=`anonymous`,t.complete&&t.naturalWidth!==0?a():t.addEventListener(`load`,a);return}else console.warn(`Cannot inline img src=${r}! Error: ${e}`)}t.crossOrigin===`anonymous`&&(i?v.crossOrigin=i:t.removeAttribute(`crossorigin`))};t.complete&&t.naturalWidth!==0?a():t.addEventListener(`load`,a)}if(_===`audio`||_===`video`){let t=v;t.rr_mediaState=e.paused?`paused`:`played`,t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}if(p||(e.scrollLeft&&(v.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(v.rr_scrollTop=e.scrollTop)),g){let{width:t,height:n}=e.getBoundingClientRect();v={class:v.class,rr_width:`${t}px`,rr_height:`${n}px`,...h?{rr_background_color:Qa}:{}}}_===`iframe`&&!f(v.src)&&(e.contentDocument||(v.rr_src=v.src),delete v.src);let b;try{customElements.get(_)&&(b=!0)}catch{}return{type:na.Element,tagName:_,attributes:v,childNodes:[],isSVG:fo(e)||void 0,needBlock:g,rootId:m,isCustom:b}}function F(e){return e==null?``:e.toLowerCase()}function To(e,t){return!!(t.comment&&e.type===na.Comment||e.type===na.Element&&(t.script&&(e.tagName===`script`||e.tagName===`link`&&(e.attributes.rel===`preload`||e.attributes.rel===`modulepreload`)&&e.attributes.as===`script`||e.tagName===`link`&&e.attributes.rel===`prefetch`&&typeof e.attributes.href==`string`&&Ha(e.attributes.href)===`js`)||t.headFavicon&&(e.tagName===`link`&&e.attributes.rel===`shortcut icon`||e.tagName===`meta`&&(F(e.attributes.name).match(/^msapplication-tile(image|color)$/)||F(e.attributes.name)===`application-name`||F(e.attributes.rel)===`icon`||F(e.attributes.rel)===`apple-touch-icon`||F(e.attributes.rel)===`shortcut icon`))||e.tagName===`meta`&&(t.headMetaDescKeywords&&F(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(F(e.attributes.property).match(/^(og|twitter|fb):/)||F(e.attributes.name).match(/^(og|twitter):/)||F(e.attributes.name)===`pinterest`)||t.headMetaRobots&&(F(e.attributes.name)===`robots`||F(e.attributes.name)===`googlebot`||F(e.attributes.name)===`bingbot`)||t.headMetaHttpEquiv&&e.attributes[`http-equiv`]!==void 0||t.headMetaAuthorship&&(F(e.attributes.name)===`author`||F(e.attributes.name)===`generator`||F(e.attributes.name)===`framework`||F(e.attributes.name)===`publisher`||F(e.attributes.name)===`progid`||F(e.attributes.property).match(/^article:/)||F(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(F(e.attributes.name)===`google-site-verification`||F(e.attributes.name)===`yandex-verification`||F(e.attributes.name)===`csrf-token`||F(e.attributes.name)===`p:domain_verify`||F(e.attributes.name)===`verify-v1`||F(e.attributes.name)===`verification`||F(e.attributes.name)===`shopify-checkout-api-token`))))}function Eo(e,t,n){return Array.from(e).map(e=>{let r=t(e),i=[];if(!n.has(r)){n.add(r);try{i=Array.from(e.cssRules,(t,n)=>({rule:ja(t,e.href),index:n}))}catch(e){if(!(e instanceof DOMException&&e.name===`SecurityError`))throw e}}return{styleId:r,rules:i}})}function Do(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:a,maskTextClass:o,maskTextSelector:s,skipChild:c=!1,inlineStylesheet:l=!0,maskInputOptions:u={},maskTextFn:d,maskInputFn:f,maskAttributeFn:p,slimDOMOptions:m,dataURLOptions:h={},inlineImages:g=!1,recordCanvas:_=!1,onSerialize:v,onAdoptedStyleSheet:y,onIframeLoad:b,iframeLoadTimeout:x=5e3,onStylesheetLoad:S,stylesheetLoadTimeout:C=5e3,keepIframeSrcFn:w=()=>!1,newlyAddedElement:T=!1,cssCaptured:E=!1,applyBackgroundColorToBlockedElements:D=!1}=t,O=t._emittedStyleIds??new Set,{needsMask:k}=t,{preserveWhiteSpace:A=!0}=t;k||=vo(e,o,s,k===void 0);let ee=xo(e,{doc:n,mirror:r,blockClass:i,blockSelector:a,needsMask:k,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:f,maskAttributeFn:p,dataURLOptions:h,inlineImages:g,recordCanvas:_,keepIframeSrcFn:w,newlyAddedElement:T,cssCaptured:E,applyBackgroundColorToBlockedElements:D});if(!ee)return console.warn(e,`not serialized`),null;let te;te=r.hasNode(e)?r.getId(e):To(ee,m)||!A&&ee.type===na.Text&&!ee.textContent.replace(/^\s+|\s+$/gm,``).length?to:no();let j=Object.assign(ee,{id:te});if(r.add(e,j),te===to)return null;v&&v(e);let ne=!c;
137if(j.type===na.Element){ne&&=!j.needBlock,delete j.needBlock;let t=wa.shadowRoot(e);t&&Da(t)&&(j.isShadowHost=!0,y&&t.adoptedStyleSheets?.length&&(j.adoptedStyleSheets=Eo(t.adoptedStyleSheets,y,O)))}if(j.type===na.Document&&y){let t=e;t.adoptedStyleSheets?.length&&(j.adoptedStyleSheets=Eo(t.adoptedStyleSheets,y,O))}if((j.type===na.Document||j.type===na.Element)&&ne){m.headWhitespace&&j.type===na.Element&&j.tagName===`head`&&(A=!1);let t={doc:n,mirror:r,blockClass:i,blockSelector:a,needsMask:k,maskTextClass:o,maskTextSelector:s,skipChild:c,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:f,maskAttributeFn:p,slimDOMOptions:m,dataURLOptions:h,inlineImages:g,recordCanvas:_,preserveWhiteSpace:A,onSerialize:v,onAdoptedStyleSheet:y,_emittedStyleIds:O,onIframeLoad:b,iframeLoadTimeout:x,onStylesheetLoad:S,stylesheetLoadTimeout:C,keepIframeSrcFn:w,cssCaptured:!1,applyBackgroundColorToBlockedElements:D};if(!(j.type===na.Element&&j.tagName===`textarea`&&j.attributes.value!==void 0)){j.type===na.Element&&j.attributes._cssText!==void 0&&typeof j.attributes._cssText==`string`&&(t.cssCaptured=!0);for(let n of Array.from(wa.childNodes(e))){let e=Do(n,t);e&&j.childNodes.push(e)}}let T=null;if(Ta(e)&&(T=wa.shadowRoot(e)))for(let e of Array.from(wa.childNodes(T))){let n=Do(e,t);n&&(Da(T)&&(n.isShadow=!0),j.childNodes.push(n))}}let re=wa.parentNode(e);return re&&Ea(re)&&Da(re)&&(j.isShadow=!0),j.type===na.Element&&j.tagName===`iframe`&&yo(e,()=>{let t=e.contentDocument;if(t&&b){let n=Do(t,{doc:t,mirror:r,blockClass:i,blockSelector:a,needsMask:k,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:f,maskAttributeFn:p,slimDOMOptions:m,dataURLOptions:h,inlineImages:g,recordCanvas:_,preserveWhiteSpace:A,onSerialize:v,onAdoptedStyleSheet:y,onIframeLoad:b,iframeLoadTimeout:x,onStylesheetLoad:S,stylesheetLoadTimeout:C,keepIframeSrcFn:w});n&&b(e,n)}},x),j.type===na.Element&&j.tagName===`link`&&typeof j.attributes.rel==`string`&&(j.attributes.rel===`stylesheet`||j.attributes.rel===`preload`&&typeof j.attributes.href==`string`&&Ha(j.attributes.href)===`css`)&&bo(e,()=>{if(S){let t=Do(e,{doc:n,mirror:r,blockClass:i,blockSelector:a,needsMask:k,maskTextClass:o,maskTextSelector:s,skipChild:!1,inlineStylesheet:l,maskInputOptions:u,maskTextFn:d,maskInputFn:f,maskAttributeFn:p,slimDOMOptions:m,dataURLOptions:h,inlineImages:g,recordCanvas:_,preserveWhiteSpace:A,onSerialize:v,onIframeLoad:b,iframeLoadTimeout:x,onStylesheetLoad:S,stylesheetLoadTimeout:C,keepIframeSrcFn:w});t&&S(e,t)}},C),j}function Oo(e,t){let{mirror:n=new Fa,blockClass:r=`rr-block`,blockSelector:i=null,maskTextClass:a=`rr-mask`,maskTextSelector:o=null,inlineStylesheet:s=!0,inlineImages:c=!1,recordCanvas:l=!1,maskAllInputs:u=!1,maskTextFn:d,maskInputFn:f,maskAttributeFn:p,slimDOM:m=!1,dataURLOptions:h,preserveWhiteSpace:g,onSerialize:_,onAdoptedStyleSheet:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:x,stylesheetLoadTimeout:S,keepIframeSrcFn:C=()=>!1,applyBackgroundColorToBlockedElements:w=!1}=t||{};return Do(e,{doc:e,mirror:n,blockClass:r,blockSelector:i,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:s,maskInputOptions:u===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:u===!1?{password:!0}:u,maskTextFn:d,maskInputFn:f,maskAttributeFn:p,slimDOMOptions:m===!0||m===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:m===`all`,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:m===!1?{}:m,dataURLOptions:h,inlineImages:c,recordCanvas:l,preserveWhiteSpace:g,onSerialize:_,onAdoptedStyleSheet:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:x,stylesheetLoadTimeout:S,keepIframeSrcFn:C,newlyAddedElement:!1,applyBackgroundColorToBlockedElements:w})}function ko(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function Ao(e){if(Object.prototype.hasOwnProperty.call(e,`__esModule`))return e;var t=e.default;if(typeof t==`function`){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var jo={exports:{}},Mo;function No(){if(Mo)return jo.exports;Mo=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return jo.exports=t(),jo.exports.createColors=t,jo.exports}var Po=Ao(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:`Module`}))),Fo,Io;function Lo(){if(Io)return Fo;Io=1;let e=No(),t=Po;
137class n extends Error{constructor(e,t,r,i,a,o){super(e),this.name=`CssSyntaxError`,this.reason=e,a&&(this.file=a),i&&(this.source=i),o&&(this.plugin=o),t!==void 0&&r!==void 0&&(typeof t==`number`?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,n)}setMessage(){this.message=this.plugin?this.plugin+`: `:``,this.message+=this.file?this.file:`<css input>`,this.line!==void 0&&(this.message+=`:`+this.line+`:`+this.column),this.message+=`: `+this.reason}showSourceCode(n){if(!this.source)return``;let r=this.source;n??=e.isColorSupported,t&&n&&(r=t(r));let i=r.split(/\r?\n/),a=Math.max(this.line-3,0),o=Math.min(this.line+2,i.length),s=String(o).length,c,l;if(n){let{bold:t,gray:n,red:r}=e.createColors(!0);c=e=>t(r(e)),l=e=>n(e)}else c=l=e=>e;return i.slice(a,o).map((e,t)=>{let n=a+1+t,r=` `+(` `+n).slice(-s)+` | `;if(n===this.line){let t=l(r.replace(/\d/g,` `))+e.slice(0,this.column-1).replace(/[^\t]/g,` `);return c(`>`)+l(r)+e+`
138 `+t+c(`^`)}return` `+l(r)+e}).join(`
139`)}toString(){let e=this.showSourceCode();return e&&=`
140
141`+e+`
142`,this.name+`: `+this.message+e}}return Fo=n,n.default=n,Fo}var Ro={},zo;function Bo(){return zo?Ro:(zo=1,Ro.isClean=Symbol(`isClean`),Ro.my=Symbol(`my`),Ro)}var Vo,Ho;function Uo(){if(Ho)return Vo;Ho=1;let e={after:`
143`,beforeClose:`
144`,beforeComment:`
145`,beforeDecl:`
146`,beforeOpen:` `,beforeRule:`
147`,colon:`: `,commentLeft:` `,commentRight:` `,emptyBody:``,indent:`    `,semicolon:!1};function t(e){return e[0].toUpperCase()+e.slice(1)}class n{constructor(e){this.builder=e}atrule(e,t){let n=`@`+e.name,r=e.params?this.rawValue(e,`params`):``;if(e.raws.afterName===void 0?r&&(n+=` `):n+=e.raws.afterName,e.nodes)this.block(e,n+r);else{let i=(e.raws.between||``)+(t?`;`:``);this.builder(n+r+i,e)}}beforeAfter(e,t){let n;n=e.type===`decl`?this.raw(e,null,`beforeDecl`):e.type===`comment`?this.raw(e,null,`beforeComment`):t===`before`?this.raw(e,null,`beforeRule`):this.raw(e,null,`beforeClose`);let r=e.parent,i=0;for(;r&&r.type!==`root`;)i+=1,r=r.parent;if(n.includes(`
148`)){let t=this.raw(e,null,`indent`);if(t.length)for(let e=0;e<i;e++)n+=t}return n}block(e,t){let n=this.raw(e,`between`,`beforeOpen`);this.builder(t+n+`{`,e,`start`);let r;e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,`after`)):r=this.raw(e,`after`,`emptyBody`),r&&this.builder(r),this.builder(`}`,e,`end`)}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type===`comment`;)--t;let n=this.raw(e,`semicolon`);for(let r=0;r<e.nodes.length;r++){let i=e.nodes[r],a=this.raw(i,`before`);a&&this.builder(a),this.stringify(i,t!==r||n)}}comment(e){let t=this.raw(e,`left`,`commentLeft`),n=this.raw(e,`right`,`commentRight`);this.builder(`/*`+t+e.text+n+`*/`,e)}decl(e,t){let n=this.raw(e,`between`,`colon`),r=e.prop+n+this.rawValue(e,`value`);e.important&&(r+=e.raws.important||` !important`),t&&(r+=`;`),this.builder(r,e)}document(e){this.body(e)}raw(n,r,i){let a;if(i||=r,r&&(a=n.raws[r],a!==void 0))return a;let o=n.parent;if(i===`before`&&(!o||o.type===`root`&&o.first===n||o&&o.type===`document`))return``;if(!o)return e[i];let s=n.root();if(s.rawCache||={},s.rawCache[i]!==void 0)return s.rawCache[i];if(i===`before`||i===`after`)return this.beforeAfter(n,i);{let e=`raw`+t(i);this[e]?a=this[e](s,n):s.walk(e=>{if(a=e.raws[r],a!==void 0)return!1})}return a===void 0&&(a=e[i]),s.rawCache[i]=a,a}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&e.raws.after!==void 0)return t=e.raws.after,t.includes(`
149`)&&(t=t.replace(/[^\n]+$/,``)),!1}),t&&=t.replace(/\S/g,``),t}rawBeforeComment(e,t){let n;return e.walkComments(e=>{if(e.raws.before!==void 0)return n=e.raws.before,n.includes(`
150`)&&(n=n.replace(/[^\n]+$/,``)),!1}),n===void 0?n=this.raw(t,null,`beforeDecl`):n&&=n.replace(/\S/g,``),n}rawBeforeDecl(e,t){let n;return e.walkDecls(e=>{if(e.raws.before!==void 0)return n=e.raws.before,n.includes(`
151`)&&(n=n.replace(/[^\n]+$/,``)),!1}),n===void 0?n=this.raw(t,null,`beforeRule`):n&&=n.replace(/\S/g,``),n}rawBeforeOpen(e){let t;return e.walk(e=>{if(e.type!==`decl`&&(t=e.raws.between,t!==void 0))return!1}),t}rawBeforeRule(e){let t;return e.walk(n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&n.raws.before!==void 0)return t=n.raws.before,t.includes(`
152`)&&(t=t.replace(/[^\n]+$/,``)),!1}),t&&=t.replace(/\S/g,``),t}rawColon(e){let t;return e.walkDecls(e=>{if(e.raws.between!==void 0)return t=e.raws.between.replace(/[^\s:]/g,``),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length===0&&(t=e.raws.after,t!==void 0))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(n=>{let r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&n.raws.before!==void 0){let e=n.raws.before.split(`
153`);return t=e[e.length-1],t=t.replace(/\S/g,``),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&e.last.type===`decl`&&(t=e.raws.semicolon,t!==void 0))return!1}),t}rawValue(e,t){let n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,`selector`)),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,`end`)}stringify(e,t){if(!this[e.type])throw Error(`Unknown AST node type `+e.type+`. Maybe you need to change PostCSS stringifier.`);this[e.type](e,t)}}return Vo=n,n.default=n,Vo}var Wo,Go;function Ko(){if(Go)return Wo;Go=1;let e=Uo();function t(t,n){new e(n).stringify(t)}return Wo=t,t.default=t,Wo}var qo,Jo;function Yo(){if(Jo)return qo;Jo=1;let{isClean:e,my:t}=Bo(),n=Lo(),r=Uo(),i=Ko();function a(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r)||r===`proxyCache`)continue;let i=e[r],o=typeof i;r===`parent`&&o===`object`?t&&(n[r]=t):r===`source`?n[r]=i:Array.isArray(i)?n[r]=i.map(e=>a(e,n)):(o===`object`&&i!==null&&(i=a(i)),n[r]=i)}return n}class o{constructor(n={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in n)if(e===`nodes`){this.nodes=[];for(let t of n[e])typeof t.clone==`function`?this.append(t.clone()):this.append(t)}else this[e]=n[e]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=a(this);for(let n in e)t[n]=e[n];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}
153error(e,t={}){if(this.source){let{end:n,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:n.column,line:n.line},t)}return new n(e)}getProxyProcessor(){return{get(e,t){return t===`proxyOf`?e:t===`root`?()=>e.root().toProxy():e[t]},set(e,t,n){return e[t]===n?!0:(e[t]=n,(t===`prop`||t===`value`||t===`name`||t===`params`||t===`important`||t===`text`)&&e.markDirty(),!0)}}}markDirty(){if(this[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){t=this.toString();let r=t.indexOf(e.word);r!==-1&&(n=this.positionInside(r,t))}return n}positionInside(e,t){let n=t||this.toString(),r=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)n[t]===`
154`?(r=1,i+=1):r+=1;return{column:r,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let r=this.toString(),i=r.indexOf(e.word);i!==-1&&(t=this.positionInside(i,r),n=this.positionInside(i+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:typeof e.endIndex==`number`?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}}raw(e,t){return new r().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let r of e)r===this?n=!0:n?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);n||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!==`document`;)e=e.parent;return e}toJSON(e,t){let n={},r=t==null;t||=new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e)||e===`parent`||e===`proxyCache`)continue;let r=this[e];if(Array.isArray(r))n[e]=r.map(e=>typeof e==`object`&&e.toJSON?e.toJSON(null,t):e);else if(typeof r==`object`&&r.toJSON)n[e]=r.toJSON(null,t);else if(e===`source`){let a=t.get(r.input);a??(a=i,t.set(r.input,i),i++),n[e]={end:r.end,inputId:a,start:r.start}}else n[e]=r}return r&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||=new Proxy(this,this.getProxyProcessor()),this.proxyCache}toString(e=i){e.stringify&&(e=e.stringify);let t=``;return e(this,e=>{t+=e}),t}warn(e,t,n){let r={node:this};for(let e in n)r[e]=n[e];return e.warn(t,r)}get proxyOf(){return this}}return qo=o,o.default=o,qo}var Xo,Zo;function Qo(){if(Zo)return Xo;Zo=1;let e=Yo();class t extends e{constructor(e){e&&e.value!==void 0&&typeof e.value!=`string`&&(e={...e,value:String(e.value)}),super(e),this.type=`decl`}get variable(){return this.prop.startsWith(`--`)||this.prop[0]===`$`}}return Xo=t,t.default=t,Xo}var $o,es;function ts(){return es?$o:(es=1,$o={nanoid:(e=21)=>{let t=``,n=e;for(;n--;)t+=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`[Math.random()*64|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r=``,i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r}},$o)}var ns,rs;function is(){if(rs)return ns;rs=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Po,{existsSync:n,readFileSync:r}=Po,{dirname:i,join:a}=Po;function o(e){return Buffer?Buffer.from(e,`base64`).toString():window.atob(e)}class s{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,`data:`);let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=i(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||=new e(this.text),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,n=/^data:application\/json;base64,/;if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||n.test(e))return o(e.substr(RegExp.lastMatch.length));let r=e.match(/data:application\/json;([^,]+),/)[1];throw Error(`Unsupported source map encoding `+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,``).trim()}isMap(e){return typeof e==`object`?typeof e.mappings==`string`||typeof e._mappings==`string`||Array.isArray(e.sections):!1}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);
154if(!t)return;let n=e.lastIndexOf(t.pop()),r=e.indexOf(`*/`,n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}loadFile(e){if(this.root=i(e),n(e))return this.mapFile=e,r(e,`utf-8`).toString().trim()}loadMap(n,r){if(r===!1)return!1;if(r){if(typeof r==`string`)return r;if(typeof r==`function`){let e=r(n);if(e){let t=this.loadFile(e);if(!t)throw Error(`Unable to load previous source map: `+e.toString());return t}}else if(r instanceof e)return t.fromSourceMap(r).toString();else if(r instanceof t)return r.toString();else if(this.isMap(r))return JSON.stringify(r);else throw Error(`Unsupported previous source map format: `+r.toString())}else if(this.inline)return this.decodeInline(this.annotation);else if(this.annotation){let e=this.annotation;return n&&(e=a(i(n),e)),this.loadFile(e)}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return ns=s,s.default=s,ns}var as,os;function ss(){if(os)return as;os=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Po,{fileURLToPath:n,pathToFileURL:r}=Po,{isAbsolute:i,resolve:a}=Po,{nanoid:o}
154=ts(),s=Po,c=Lo(),l=is(),u=Symbol(`fromOffsetCache`),d=!!(e&&t),f=!!(a&&i);class p{constructor(e,t={}){if(e==null||typeof e==`object`&&!e.toString)throw Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]===``||this.css[0]===`￾`?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!f||/^\w+:\/\//.test(t.from)||i(t.from)?this.file=t.from:this.file=a(t.from)),f&&d){let e=new l(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id=`<input css `+o(6)+`>`),this.map&&(this.map.file=this.from)}error(e,t,n,i={}){let a,o,s;if(t&&typeof t==`object`){let e=t,r=n;if(typeof e.offset==`number`){let r=this.fromOffset(e.offset);t=r.line,n=r.col}else t=e.line,n=e.column;if(typeof r.offset==`number`){let e=this.fromOffset(r.offset);o=e.line,s=e.col}else o=r.line,s=r.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let l=this.origin(t,n,o,s);return a=l?new c(e,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,i.plugin):new c(e,o===void 0?t:{column:n,line:t},o===void 0?n:{column:s,line:o},this.css,this.file,i.plugin),a.input={column:n,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(r&&(a.input.url=r(this.file).toString()),a.input.file=this.file),a}fromOffset(e){let t,n;if(this[u])n=this[u];else{let e=this.css.split(`
155`);n=Array(e.length);let t=0;for(let r=0,i=e.length;r<i;r++)n[r]=t,t+=e[r].length+1;this[u]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t=n.length-2,i;for(;r<t;)if(i=r+(t-r>>1),e<n[i])t=i-1;else if(e>=n[i+1])r=i+1;else{r=i;break}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:a(this.map.consumer().sourceRoot||this.map.root||`.`,e)}origin(e,t,a,o){if(!this.map)return!1;let s=this.map.consumer(),c=s.originalPositionFor({column:t,line:e});if(!c.source)return!1;let l;typeof a==`number`&&(l=s.originalPositionFor({column:o,line:a}));let u;u=i(c.source)?r(c.source):new URL(c.source,this.map.consumer().sourceRoot||r(this.map.mapFile));let d={column:c.column,endColumn:l&&l.column,endLine:l&&l.line,line:c.line,url:u.toString()};if(u.protocol===`file:`)if(n)d.file=n(u);else throw Error(`file: protocol is not available in this PostCSS build`);let f=s.sourceContentFor(c.source);return f&&(d.source=f),d}toJSON(){let e={};for(let t of[`hasBOM`,`css`,`file`,`id`])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}return as=p,p.default=p,s&&s.registerInput&&s.registerInput(p),as}var cs,ls;function us(){if(ls)return cs;ls=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Po,{dirname:n,relative:r,resolve:i,sep:a}=Po,{pathToFileURL:o}=Po,s=ss(),c=!!(e&&t),l=!!(n&&i&&r&&a);class u{constructor(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?`data:application/json;base64,`+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation==`string`?this.mapOpts.annotation:typeof this.mapOpts.annotation==`function`?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+`.map`;let t=`
156`;this.css.includes(`\r
157`)&&(t=`\r
158`),this.css+=t+`/*# sourceMappingURL=`+e+` */`}applyPrevMaps(){for(let t of this.previous()){let r=this.toUrl(this.path(t.file)),i=t.root||n(t.file),a;this.mapOpts.sourcesContent===!1?(a=new e(t.text),a.sourcesContent&&=null):a=t.consumer(),this.map.applySourceMap(a,r,this.toUrl(this.path(i)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type===`comment`&&e.text.indexOf(`# sourceMappingURL=`)===0&&this.root.removeChild(t)}else this.css&&=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,``)}generate(){if(this.clearAnnotation(),l&&c&&this.isMap())return this.generateMap();{let e=``;return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):`<no source>`});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css=``,this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,n=1,r=`<no source>`,i={generated:{column:0,line:0},original:{column:0,line:0},source:``},a,o;this.stringify(this.root,(t,s,c)=>{if(this.css+=t,s&&c!==`end`&&(i.generated.line=e,i.generated.column=n-1,s.source&&s.source.start?(i.source=this.sourcePath(s),i.original.line=s.source.start.line,i.original.column=s.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),a=t.match(/\n/g),a?(e+=a.length,o=t.lastIndexOf(`
159`),n=t.length-o):n+=t.length,s&&c!==`start`){let t=s.parent||{raws:{}};(!(s.type===`decl`||s.type===`atrule`&&!s.nodes)||s!==t.last||t.raws.semicolon)&&(s.source&&s.source.end?(i.source=this.sourcePath(s),i.original.line=s.source.end.line,i.original.column=s.source.end.column-1,i.generated.line=e,i.generated.column=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=e,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:this.mapOpts.annotation===void 0?!this.previous().length||this.previous().some(e=>e.annotation):this.mapOpts.annotation}isInline(){if(this.mapOpts.inline!==void 0)return this.mapOpts.inline;let e=this.mapOpts.annotation;return e!==void 0&&e!==!0?!1:!this.previous().length||this.previous().some(e=>e.inline)}isMap(){return this.opts.map===void 0?this.previous().length>0:!!this.opts.map}isSourcesContent(){return this.mapOpts.sourcesContent===void 0?!this.previous().length||this.previous().some(e=>e.withContent()):this.mapOpts.sourcesContent}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):`to.css`}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let a=this.opts.to?n(this.opts.to):`.`;typeof this.mapOpts.annotation==`string`&&(a=n(i(a,this.mapOpts.annotation)));
159let o=r(a,e);return this.memoizedPaths.set(e,o),o}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new s(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let r=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):`<no source>`;this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString(`base64`):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(o){let t=o(e).toString();return this.memoizedFileURLs.set(e,t),t}else throw Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;a===`\\`&&(e=e.replace(/\\/g,`/`));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}}return cs=u,cs}var ds,fs;function ps(){if(fs)return ds;fs=1;let e=Yo();class t extends e{constructor(e){super(e),this.type=`comment`}}return ds=t,t.default=t,ds}var ms,hs;function gs(){if(hs)return ms;hs=1;let{isClean:e,my:t}=Bo(),n=Qo(),r=ps(),i=Yo(),a,o,s,c;function l(e){return e.map(e=>(e.nodes&&=l(e.nodes),delete e.source,e))}function u(t){if(t[e]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)u(e)}class d extends i{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),n,r;for(;this.indexes[t]<this.proxyOf.nodes.length&&(n=this.indexes[t],r=e(this.proxyOf.nodes[n],n),r!==!1);)this.indexes[t]+=1;return delete this.indexes[t],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||=0,this.indexes||={},this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return t===`proxyOf`?e:e[t]?t===`each`||typeof t==`string`&&t.startsWith(`walk`)?(...n)=>e[t](...n.map(e=>typeof e==`function`?(t,n)=>e(t.toProxy(),n):e)):t===`every`||t===`some`?n=>e[t]((e,...t)=>n(e.toProxy(),...t)):t===`root`?()=>e.root().toProxy():t===`nodes`?e.nodes.map(e=>e.toProxy()):t===`first`||t===`last`?e[t].toProxy():e[t]:e[t]},set(e,t,n){return e[t]===n?!0:(e[t]=n,(t===`name`||t===`params`||t===`selector`)&&e.markDirty(),!0)}}}index(e){return typeof e==`number`?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n=this.index(e),r=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of r)this.proxyOf.nodes.splice(n+1,0,e);let i;for(let e in this.indexes)i=this.indexes[e],n<i&&(this.indexes[e]=i+r.length);return this.markDirty(),this}insertBefore(e,t){let n=this.index(e),r=n===0&&`prepend`,i=this.normalize(t,this.proxyOf.nodes[n],r).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);let a;for(let e in this.indexes)a=this.indexes[e],n<=a&&(this.indexes[e]=a+i.length);return this.markDirty(),this}normalize(i,c){if(typeof i==`string`)i=l(a(i).nodes);else if(i===void 0)i=[];else if(Array.isArray(i)){i=i.slice(0);for(let e of i)e.parent&&e.parent.removeChild(e,`ignore`)}else if(i.type===`root`&&this.type!==`document`){i=i.nodes.slice(0);for(let e of i)e.parent&&e.parent.removeChild(e,`ignore`)}else if(i.type)i=[i];else if(i.prop){if(i.value===void 0)throw Error(`Value field is missed in node creation`);typeof i.value!=`string`&&(i.value=String(i.value)),i=[new n(i)]}else if(i.selector)i=[new o(i)];else if(i.name)i=[new s(i)];else if(i.text)i=[new r(i)];else throw Error(`Unknown node type in node creation`);return i.map(n=>(n[t]||d.rebuild(n),n=n.proxyOf,n.parent&&n.parent.removeChild(n),n[e]&&u(n),n.raws.before===void 0&&c&&c.raws.before!==void 0&&(n.raws.before=c.raws.before.replace(/\S/g,``)),n.parent=this.proxyOf,n))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,`prepend`).reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}
159replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,n)=>{let r;try{r=e(t,n)}catch(e){throw t.addToError(e)}return r!==!1&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`atrule`&&e.test(n.name))return t(n,r)}):this.walk((n,r)=>{if(n.type===`atrule`&&n.name===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`atrule`)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if(t.type===`comment`)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`decl`&&e.test(n.prop))return t(n,r)}):this.walk((n,r)=>{if(n.type===`decl`&&n.prop===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`decl`)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`rule`&&e.test(n.selector))return t(n,r)}):this.walk((n,r)=>{if(n.type===`rule`&&n.selector===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`rule`)return t(e,n)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return d.registerParse=e=>{a=e},d.registerRule=e=>{o=e},d.registerAtRule=e=>{s=e},d.registerRoot=e=>{c=e},ms=d,d.default=d,d.rebuild=e=>{e.type===`atrule`?Object.setPrototypeOf(e,s.prototype):e.type===`rule`?Object.setPrototypeOf(e,o.prototype):e.type===`decl`?Object.setPrototypeOf(e,n.prototype):e.type===`comment`?Object.setPrototypeOf(e,r.prototype):e.type===`root`&&Object.setPrototypeOf(e,c.prototype),e[t]=!0,e.nodes&&e.nodes.forEach(e=>{d.rebuild(e)})},ms}var _s,vs;function ys(){if(vs)return _s;vs=1;let e=gs(),t,n;class r extends e{constructor(e){super({type:`document`,...e}),this.nodes||=[]}toResult(e={}){return new t(new n,this,e).stringify()}}return r.registerLazyResult=e=>{t=e},r.registerProcessor=e=>{n=e},_s=r,r.default=r,_s}var bs,xs;function Ss(){if(xs)return bs;xs=1;let e={};return bs=function(t){e[t]||(e[t]=!0,typeof console<`u`&&console.warn&&console.warn(t))},bs}var Cs,ws;function Ts(){if(ws)return Cs;ws=1;class e{constructor(e,t={}){if(this.type=`warning`,this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+`: `+this.text:this.text}}return Cs=e,e.default=e,Cs}var Es,Ds;function Os(){if(Ds)return Es;Ds=1;let e=Ts();class t{constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let r=new e(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type===`warning`)}get content(){return this.css}}return Es=t,t.default=t,Es}var ks,As;function js(){if(As)return ks;As=1;let e=/[\t\n\f\r "#'()/;[\\\]{}]/g,t=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,n=/.[\r\n"'(/\\]/,r=/[\da-f]/i;return ks=function(i,a={}){let o=i.css.valueOf(),s=a.ignoreErrors,c,l,u,d,f,p,m,h,g,_,v=o.length,y=0,b=[],x=[];function S(){return y}function C(e){throw i.error(`Unclosed `+e,y)}function w(){return x.length===0&&y>=v}function T(i){if(x.length)return x.pop();if(y>=v)return;let a=i?i.ignoreUnclosed:!1;switch(c=o.charCodeAt(y),c){case 10:case 32:case 9:case 13:case 12:l=y;do l+=1,c=o.charCodeAt(l);while(c===32||c===10||c===9||c===13||c===12);_=[`space`,o.slice(y,l)],y=l-1;break;case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let e=String.fromCharCode(c);_=[e,e,y];break}
159case 40:if(h=b.length?b.pop()[1]:``,g=o.charCodeAt(y+1),h===`url`&&g!==39&&g!==34&&g!==32&&g!==10&&g!==9&&g!==12&&g!==13){l=y;do{if(p=!1,l=o.indexOf(`)`,l+1),l===-1)if(s||a){l=y;break}else C(`bracket`);for(m=l;o.charCodeAt(m-1)===92;)--m,p=!p}while(p);_=[`brackets`,o.slice(y,l+1),y,l],y=l}else l=o.indexOf(`)`,y+1),d=o.slice(y,l+1),l===-1||n.test(d)?_=[`(`,`(`,y]:(_=[`brackets`,d,y,l],y=l);break;case 39:case 34:u=c===39?`'`:`"`,l=y;do{if(p=!1,l=o.indexOf(u,l+1),l===-1)if(s||a){l=y+1;break}else C(`string`);for(m=l;o.charCodeAt(m-1)===92;)--m,p=!p}while(p);_=[`string`,o.slice(y,l+1),y,l],y=l;break;case 64:e.lastIndex=y+1,e.test(o),l=e.lastIndex===0?o.length-1:e.lastIndex-2,_=[`at-word`,o.slice(y,l+1),y,l],y=l;break;case 92:for(l=y,f=!0;o.charCodeAt(l+1)===92;)l+=1,f=!f;if(c=o.charCodeAt(l+1),f&&c!==47&&c!==32&&c!==10&&c!==9&&c!==13&&c!==12&&(l+=1,r.test(o.charAt(l)))){for(;r.test(o.charAt(l+1));)l+=1;o.charCodeAt(l+1)===32&&(l+=1)}_=[`word`,o.slice(y,l+1),y,l],y=l;break;default:c===47&&o.charCodeAt(y+1)===42?(l=o.indexOf(`*/`,y+2)+1,l===0&&(s||a?l=o.length:C(`comment`)),_=[`comment`,o.slice(y,l+1),y,l],y=l):(t.lastIndex=y+1,t.test(o),l=t.lastIndex===0?o.length-1:t.lastIndex-2,_=[`word`,o.slice(y,l+1),y,l],b.push(_),y=l);break}return y++,_}function E(e){x.push(e)}return{back:E,endOfFile:w,nextToken:T,position:S}},ks}var Ms,Ns;function Ps(){if(Ns)return Ms;Ns=1;let e=gs();class t extends e{constructor(e){super(e),this.type=`atrule`}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}return Ms=t,t.default=t,e.registerAtRule(t),Ms}var Fs,Is;function Ls(){if(Is)return Fs;Is=1;let e=gs(),t,n;class r extends e{constructor(e){super(e),this.type=`root`,this.nodes||=[]}normalize(e,t,n){let r=super.normalize(e);if(t){if(n===`prepend`)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of r)e.raws.before=t.raws.before}return r}removeChild(e,t){let n=this.index(e);return!t&&n===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new t(new n,this,e).stringify()}}return r.registerLazyResult=e=>{t=e},r.registerProcessor=e=>{n=e},Fs=r,r.default=r,e.registerRoot(r),Fs}var Rs,zs;function Bs(){if(zs)return Rs;zs=1;let e={comma(t){return e.split(t,[`,`],!0)},space(t){return e.split(t,[` `,`
160`,`	`])},split(e,t,n){let r=[],i=``,a=!1,o=0,s=!1,c=``,l=!1;for(let n of e)l?l=!1:n===`\\`?l=!0:s?n===c&&(s=!1):n===`"`||n===`'`?(s=!0,c=n):n===`(`?o+=1:n===`)`?o>0&&--o:o===0&&t.includes(n)&&(a=!0),a?(i!==``&&r.push(i.trim()),i=``,a=!1):i+=n;return(n||i!==``)&&r.push(i.trim()),r}};return Rs=e,e.default=e,Rs}var Vs,Hs;function Us(){if(Hs)return Vs;Hs=1;let e=gs(),t=Bs();class n extends e{constructor(e){super(e),this.type=`rule`,this.nodes||=[]}get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:`,`+this.raw(`between`,`beforeOpen`);this.selector=e.join(n)}}return Vs=n,n.default=n,e.registerRule(n),Vs}var Ws,Gs;function Ks(){if(Gs)return Ws;Gs=1;let e=Qo(),t=js(),n=ps(),r=Ps(),i=Ls(),a=Us(),o={empty:!0,space:!0};function s(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}class c{constructor(e){this.input=e,this.root=new i,this.current=this.root,this.spaces=``,this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new r;t.name=e[1].slice(1),t.name===``&&this.unnamedAtrule(t,e),this.init(t,e[2]);let n,i,a,o=!1,s=!1,c=[],l=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),n=e[0],n===`(`||n===`[`?l.push(n===`(`?`)`:`]`):n===`{`&&l.length>0?l.push(`}`):n===l[l.length-1]&&l.pop(),l.length===0)if(n===`;`){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(n===`{`){s=!0;break}else if(n===`}`){if(c.length>0){for(a=c.length-1,i=c[a];i&&i[0]===`space`;)i=c[--a];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}else c.push(e);else c.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(c),c.length?(t.raws.afterName=this.spacesAndCommentsFromStart(c),this.raw(t,`params`,c),o&&(e=c[c.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between=``)):(t.raws.afterName=``,t.params=``),s&&(t.no
vendor: 4,775 bytes, line 160
160des=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let n=0,r;for(let i=t-1;i>=0&&(r=e[i],!(r[0]!==`space`&&(n+=1,n===2)));i--);throw this.input.error(`Missed semicolon`,r[0]===`word`?r[3]+1:r[2])}colon(e){let t=0,n,r,i;for(let[a,o]of e.entries()){if(n=o,r=n[0],r===`(`&&(t+=1),r===`)`&&--t,t===0&&r===`:`)if(!i)this.doubleColon(n);else if(i[0]===`word`&&i[1]===`progid`)continue;else return a;i=n}return!1}comment(e){let t=new n;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text=``,t.raws.left=r,t.raws.right=``;else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,n){let r=new e;this.init(r,t[0][2]);let i=t[t.length-1];for(i[0]===`;`&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(i[3]||i[2]||s(t)),r.source.end.offset++;t[0][0]!==`word`;)t.length===1&&this.unknownWord(t),r.raws.before+=t.shift()[1];for(r.source.start=this.getPosition(t[0][2]),r.prop=``;t.length;){let e=t[0][0];if(e===`:`||e===`space`||e===`comment`)break;r.prop+=t.shift()[1]}r.raws.between=``;let a;for(;t.length;)if(a=t.shift(),a[0]===`:`){r.raws.between+=a[1];break}else a[0]===`word`&&/\w/.test(a[1])&&this.unknownWord([a]),r.raws.between+=a[1];(r.prop[0]===`_`||r.prop[0]===`*`)&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o=[],c;for(;t.length&&(c=t[0][0],!(c!==`space`&&c!==`comment`));)o.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(a=t[e],a[1].toLowerCase()===`!important`){r.important=!0;let n=this.stringFrom(t,e);n=this.spacesFromEnd(t)+n,n!==` !important`&&(r.raws.important=n);break}else if(a[1].toLowerCase()===`important`){let n=t.slice(0),i=``;for(let t=e;t>0;t--){let e=n[t][0];if(i.trim().indexOf(`!`)===0&&e!==`space`)break;i=n.pop()[1]+i}i.trim().indexOf(`!`)===0&&(r.important=!0,r.raws.important=i,t=n)}if(a[0]!==`space`&&a[0]!==`comment`)break}t.some(e=>e[0]!==`space`&&e[0]!==`comment`)&&(r.raws.between+=o.map(e=>e[1]).join(``),o=[]),this.raw(r,`value`,o.concat(t),n),r.value.includes(`:`)&&!n&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error(`Double colon`,{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new a;this.init(t,e[2]),t.selector=``,t.raws.between=``,this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||``)+this.spaces,this.spaces=``,this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||``)+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&e.type===`rule`&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces=``)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces=``,e.type!==`comment`&&(this.semicolon=!1)}other(e){let t=!1,n=null,r=!1,i=null,a=[],o=e[1].startsWith(`--`),s=[],c=e;for(;c;){if(n=c[0],s.push(c),n===`(`||n===`[`)i||=c,a.push(n===`(`?`)`:`]`);else if(o&&r&&n===`{`)i||=c,a.push(`}`);else if(a.length===0)if(n===`;`)if(r){this.decl(s,o);return}else break;else if(n===`{`){this.rule(s);return}else if(n===`}`){this.tokenizer.back(s.pop()),t=!0;break}else n===`:`&&(r=!0);else n===a[a.length-1]&&(a.pop(),a.length===0&&(i=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),a.length>0&&this.unclosedBracket(i),t&&r){if(!o)for(;s.length&&(c=s[s.length-1][0],!(c!==`space`&&c!==`comment`));)this.tokenizer.back(s.pop());this.decl(s,o)}else this.unknownWord(s)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case`space`:this.spaces+=e[1];break;case`;`:this.freeSemicolon(e);break;case`}`:this.end(e);break;case`comment`:this.comment(e);break;case`at-word`:this.atrule(e);break;case`{`:this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,r){let i,a,s=n.length,c=``,l=!0,u,d;for(let e=0;e<s;e+=1)i=n[e],a=i[0],a===`space`&&e===s-1&&!r?l=!1:a===`comment`?(d=n[e-1]?n[e-1][0]:`empty`,u=n[e+1]?n[e+1][0]:`empty`,!o[d]&&!o[u]?c.slice(-1)===`,`?l=!1:c+=i[1]:l=!1):c+=i[1];if(!l){let r=n.reduce((e,t)=>
vendor: 6,255 bytes, line 160
160e+t[1],``);e.raws[t]={raw:r,value:c}}e[t]=c}rule(e){e.pop();let t=new a;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,`selector`,e),this.current=t}spacesAndCommentsFromEnd(e){let t,n=``;for(;e.length&&(t=e[e.length-1][0],!(t!==`space`&&t!==`comment`));)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n=``;for(;e.length&&(t=e[0][0],!(t!==`space`&&t!==`comment`));)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n=``;for(;e.length&&(t=e[e.length-1][0],t===`space`);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n=``;for(let r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}unclosedBlock(){let e=this.current.source.start;throw this.input.error(`Unclosed block`,e.line,e.column)}unclosedBracket(e){throw this.input.error(`Unclosed bracket`,{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error(`Unexpected }`,{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error(`Unknown word`,{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error(`At-rule without name`,{offset:t[2]},{offset:t[2]+t[1].length})}}return Ws=c,Ws}var qs,Js;function Ys(){if(Js)return qs;Js=1;let e=gs(),t=Ks(),n=ss();function r(e,r){let i=new n(e,r),a=new t(i);try{a.parse()}catch(e){throw e}return a.root}return qs=r,r.default=r,e.registerParse(r),qs}var Xs,Zs;function Qs(){if(Zs)return Xs;Zs=1;let{isClean:e,my:t}=Bo(),n=us(),r=Ko(),i=gs(),a=ys();Ss();let o=Os(),s=Ys(),c=Ls(),l={atrule:`AtRule`,comment:`Comment`,decl:`Declaration`,document:`Document`,root:`Root`,rule:`Rule`},u={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},d={Once:!0,postcssPlugin:!0,prepare:!0};function f(e){return typeof e==`object`&&typeof e.then==`function`}function p(e){let t=!1,n=l[e.type];return e.type===`decl`?t=e.prop.toLowerCase():e.type===`atrule`&&(t=e.name.toLowerCase()),t&&e.append?[n,n+`-`+t,0,n+`Exit`,n+`Exit-`+t]:t?[n,n+`-`+t,n+`Exit`,n+`Exit-`+t]:e.append?[n,0,n+`Exit`]:[n,n+`Exit`]}function m(e){let t;return t=e.type===`document`?[`Document`,0,`DocumentExit`]:e.type===`root`?[`Root`,0,`RootExit`]:p(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function h(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>h(e)),t}let g={};class _{constructor(e,n,r){this.stringified=!1,this.processed=!1;let a;if(typeof n==`object`&&n&&(n.type===`root`||n.type===`document`))a=h(n);else if(n instanceof _||n instanceof o)a=h(n.root),n.map&&(r.map===void 0&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let e=s;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{a=e(n,r)}catch(e){this.processed=!0,this.error=e}a&&!a[t]&&i.rebuild(a)}this.result=new o(e,a,r),this.helpers={...g,postcss:g,result:this.result},this.plugins=this.processor.plugins.map(e=>typeof e==`object`&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||=this.runAsync(),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw Error(`Use process(css).then(cb) to work with async plugins`)}handleError(e,t){let n=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,e.name===`CssSyntaxError`&&!e.plugin?(e.plugin=n.postcssPlugin,e.setMessage()):n.postcssVersion}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if(typeof t==`object`)for(let n in t){if(!u[n]&&/^[A-Z]/.test(n))throw Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[n])if(typeof t[n]==`object`)for(let r in t[n])r===`*`?e(t,n,t[n][r]):e(t,n+`-`+r.toLowerCase(),t[n][r]);else typeof t[n]==`function`&&e(t,n,t[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],n=this.runOnRoot(t);if(f(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let n=[m(t)];for(;n.length>0;){let e=this.visitTick(n);if(f(e))try{await e}catch(e){let t=n[n.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,n]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if(t.type===`document`){let e=t.nodes.map(e=>n(e,this.helpers));await Promise.all(e)}else await n(t,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e==`object`&&e.Once){if(this.result.root.type===`document`){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return f(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e==`function`)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=r;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new n(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(f(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type===`document`)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,r]of e){this.result.lastPlugin=n;let e;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if(t.type!==`root`&&t.type!==`document`&&!t.parent)return!0;
160if(f(e))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:i}=n;if(r.type!==`root`&&r.type!==`document`&&!r.parent){t.pop();return}if(i.length>0&&n.visitorIndex<i.length){let[e,t]=i[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===i.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=e;try{return t(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(n.iterator!==0){let i=n.iterator,a;for(;a=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!a[e]){a[e]=!0,t.push(m(a));return}n.iterator=0,delete r.indexes[i]}let a=n.events;for(;n.eventIndex<a.length;){let t=a[n.eventIndex];if(n.eventIndex+=1,t===0){r.nodes&&r.nodes.length&&(r[e]=!0,n.iterator=r.getIterator());return}else if(this.listeners[t]){n.visitors=this.listeners[t];return}}t.pop()}walkSync(t){t[e]=!0;let n=p(t);for(let r of n)if(r===0)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[r];if(e&&this.visitSync(e,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return`LazyResult`}}return _.registerPostcss=e=>{g=e},Xs=_,_.default=_,c.registerLazyResult(_),a.registerLazyResult(_),Xs}var $s,ec;function tc(){if(ec)return $s;ec=1;let e=us(),t=Ko();Ss();let n=Ys(),r=Os();class i{constructor(n,i,a){i=i.toString(),this.stringified=!1,this._processor=n,this._css=i,this._opts=a,this._map=void 0;let o=t;this.result=new r(this._processor,void 0,this._opts),this.result.css=i;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let c=new e(o,void 0,this._opts,i);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=n;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return`NoWorkResult`}}return $s=i,i.default=i,$s}var nc,rc;function ic(){if(rc)return nc;rc=1;let e=tc(),t=Qs(),n=ys(),r=Ls();class i{constructor(e=[]){this.version=`8.4.38`,this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(n.postcss===!0?n=n():n.postcss&&(n=n.postcss),typeof n==`object`&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if(typeof n==`object`&&n.postcssPlugin)t.push(n);else if(typeof n==`function`)t.push(n);else if(!(typeof n==`object`&&(n.parse||n.stringify)))throw Error(n+` is not a PostCSS plugin`);return t}process(n,r={}){return!this.plugins.length&&!r.parser&&!r.stringifier&&!r.syntax?new e(this,n,r):new t(this,n,r)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return nc=i,i.default=i,r.registerProcessor(i),n.registerProcessor(i),nc}var ac,oc;function sc(){if(oc)return ac;oc=1;let e=Qo(),t=is(),n=ps(),r=Ps(),i=ss(),a=Ls(),o=Us();function s(c,l){if(Array.isArray(c))return c.map(e=>s(e));let{inputs:u,...d}=c;if(u){l=[];for(let e of u){let n={...e,__proto__:i.prototype};n.map&&={...n.map,__proto__:t.prototype},l.push(n)}}if(d.nodes&&=c.nodes.map(e=>s(e,l)),d.source){let{inputId:e,...t}=d.source;d.source=t,e!=null&&(d.source.input=l[e])}if(d.type===`root`)return new a(d);if(d.type===`decl`)return new e(d);if(d.type===`rule`)return new o(d);if(d.type===`comment`)return new n(d);if(d.type===`atrule`)return new r(d);throw Error(`Unknown node type: `+c.type)}return ac=s,s.default=s,ac}var cc,lc;function uc(){if(lc)return cc;lc=1;let e=Lo(),t=Qo(),n=Qs(),r=gs(),i=ic(),a=Ko(),o=sc(),s=ys(),c=Ts(),l=ps(),u=Ps(),d=Os(),f=ss(),p=Ys(),m=Bs(),h=Us(),g=Ls(),_=Yo();function v(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new i(e)}return v.plugin=function(e,t){let n=!1;function r(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
161https://evilmartians.com/chronicles/postcss-8-plugin-migration`),{}.LANG&&{}.LANG.startsWith(`cn`)&&console.warn(e+`: 里面 postcss.plugin 被弃用. 迁移指南:
162https://www.w3ctech.com/topic/2226`));let a=t(...r);return a.postcssPlugin=e,a.postcssVersion=new i().version,a}let a;return Object.defineProperty(r,"postcss",{get(){return a||=r(),a}}),r.process=function(e,t,n){return v([r(n)]).process(e,t)},r},v.stringify=a,v.parse=p,v.fromJSON=o,v.list=m,v.comment=e=>new l(e),v.atRule=e=>new u(e),v.decl=e=>new t(e),v.rule=e=>new h(e),v.root=e=>new g(e),v.document=e=>new s(e),v.CssSyntaxError=e,v.Declaration=t,v.Container=r,v.Processor=i,v.Document=s,v.Comment=l,v.Warning=c,v.AtRule=u,v.Result=d,v.Input=f,v.Rule=h,v.Root=g,v.Node=_,n.registerPostcss(v),cc=v,v.default=v,cc}var I=ko(uc());I.stringify,I.fromJSON,I.plugin,I.parse,I.list,I.document,I.comment,I.atRule,I.rule,I.decl,I.root,I.CssSyntaxError,I.Declaration,I.Container,I.Processor,I.Document,I.Comment,I.Warning,I.AtRule,I.Result,I.Input,I.Rule,I.Root,I.Node;var dc=Object.defineProperty,fc=(e,t,n)=>t in e?dc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pc=(e,t,n)=>fc(e,typeof t==`symbol`?t:t+``,n);
162function mc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function hc(e){if(Object.prototype.hasOwnProperty.call(e,`__esModule`))return e;var t=e.default;if(typeof t==`function`){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var gc={exports:{}},_c;function vc(){if(_c)return gc.exports;_c=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return gc.exports=t(),gc.exports.createColors=t,gc.exports}var yc=hc(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:`Module`}))),bc,xc;function Sc(){if(xc)return bc;xc=1;let e=vc(),t=yc;class n extends Error{constructor(e,t,r,i,a,o){super(e),this.name=`CssSyntaxError`,this.reason=e,a&&(this.file=a),i&&(this.source=i),o&&(this.plugin=o),t!==void 0&&r!==void 0&&(typeof t==`number`?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,n)}setMessage(){this.message=this.plugin?this.plugin+`: `:``,this.message+=this.file?this.file:`<css input>`,this.line!==void 0&&(this.message+=`:`+this.line+`:`+this.column),this.message+=`: `+this.reason}showSourceCode(n){if(!this.source)return``;let r=this.source;n??=e.isColorSupported,t&&n&&(r=t(r));let i=r.split(/\r?\n/),a=Math.max(this.line-3,0),o=Math.min(this.line+2,i.length),s=String(o).length,c,l;if(n){let{bold:t,gray:n,red:r}=e.createColors(!0);c=e=>t(r(e)),l=e=>n(e)}else c=l=e=>e;return i.slice(a,o).map((e,t)=>{let n=a+1+t,r=` `+(` `+n).slice(-s)+` | `;if(n===this.line){let t=l(r.replace(/\d/g,` `))+e.slice(0,this.column-1).replace(/[^\t]/g,` `);return c(`>`)+l(r)+e+`
163 `+t+c(`^`)}return` `+l(r)+e}).join(`
164`)}toString(){let e=this.showSourceCode();return e&&=`
165
166`+e+`
167`,this.name+`: `+this.message+e}}return bc=n,n.default=n,bc}var Cc={},wc;function Tc(){return wc?Cc:(wc=1,Cc.isClean=Symbol(`isClean`),Cc.my=Symbol(`my`),Cc)}var Ec,Dc;function Oc(){if(Dc)return Ec;Dc=1;let e={after:`
168`,beforeClose:`
169`,beforeComment:`
170`,beforeDecl:`
171`,beforeOpen:` `,beforeRule:`
172`,colon:`: `,commentLeft:` `,commentRight:` `,emptyBody:``,indent:`    `,semicolon:!1};function t(e){return e[0].toUpperCase()+e.slice(1)}class n{constructor(e){this.builder=e}atrule(e,t){let n=`@`+e.name,r=e.params?this.rawValue(e,`params`):``;if(e.raws.afterName===void 0?r&&(n+=` `):n+=e.raws.afterName,e.nodes)this.block(e,n+r);else{let i=(e.raws.between||``)+(t?`;`:``);this.builder(n+r+i,e)}}beforeAfter(e,t){let n;n=e.type===`decl`?this.raw(e,null,`beforeDecl`):e.type===`comment`?this.raw(e,null,`beforeComment`):t===`before`?this.raw(e,null,`beforeRule`):this.raw(e,null,`beforeClose`);let r=e.parent,i=0;for(;r&&r.type!==`root`;)i+=1,r=r.parent;if(n.includes(`
173`)){let t=this.raw(e,null,`indent`);if(t.length)for(let e=0;e<i;e++)n+=t}return n}block(e,t){let n=this.raw(e,`between`,`beforeOpen`);this.builder(t+n+`{`,e,`start`);let r;e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,`after`)):r=this.raw(e,`after`,`emptyBody`),r&&this.builder(r),this.builder(`}`,e,`end`)}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type===`comment`;)--t;let n=this.raw(e,`semicolon`);for(let r=0;r<e.nodes.length;r++){let i=e.nodes[r],a=this.raw(i,`before`);a&&this.builder(a),this.stringify(i,t!==r||n)}}comment(e){let t=this.raw(e,`left`,`commentLeft`),n=this.raw(e,`right`,`commentRight`);this.builder(`/*`+t+e.text+n+`*/`,e)}decl(e,t){let n=this.raw(e,`between`,`colon`),r=e.prop+n+this.rawValue(e,`value`);e.important&&(r+=e.raws.important||` !important`),t&&(r+=`;`),this.builder(r,e)}document(e){this.body(e)}raw(n,r,i){let a;if(i||=r,r&&(a=n.raws[r],a!==void 0))return a;let o=n.parent;if(i===`before`&&(!o||o.type===`root`&&o.first===n||o&&o.type===`document`))return``;if(!o)return e[i];let s=n.root();if(s.rawCache||={},s.rawCache[i]!==void 0)return s.rawCache[i];if(i===`before`||i===`after`)return this.beforeAfter(n,i);{let e=`raw`+t(i);this[e]?a=this[e](s,n):s.walk(e=>{if(a=e.raws[r],a!==void 0)return!1})}return a===void 0&&(a=e[i]),s.rawCache[i]=a,a}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&e.raws.after!==void 0)return t=e.raws.after,t.includes(`
174`)&&(t=t.replace(/[^\n]+$/,``)),!1}),t&&=t.replace(/\S/g,``),t}rawBeforeComment(e,t){let n;return e.walkComments(e=>{if(e.raws.before!==void 0)return n=e.raws.before,n.includes(`
175`)&&(n=n.replace(/[^\n]+$/,``)),!1}),n===void 0?n=this.raw(t,null,`beforeDecl`):n&&=n.replace(/\S/g,``),n}rawBeforeDecl(e,t){let n;return e.walkDecls(e=>{if(e.raws.before!==void 0)return n=e.raws.before,n.includes(`
176`)&&(n=n.replace(/[^\n]+$/,``)),!1}),n===void 0?n=this.raw(t,null,`beforeRule`):n&&=n.replace(/\S/g,``),n}rawBeforeOpen(e){let t;return e.walk(e=>{if(e.type!==`decl`&&(t=e.raws.between,t!==void 0))return!1}),t}rawBeforeRule(e){let t;return e.walk(n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&n.raws.before!==void 0)return t=n.raws.before,t.includes(`
177`)&&(t=t.replace(/[^\n]+$/,``)),!1}),t&&=t.replace(/\S/g,``),t}rawColon(e){let t;return e.walkDecls(e=>{if(e.raws.between!==void 0)return t=e.raws.between.replace(/[^\s:]/g,``),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length===0&&(t=e.raws.after,t!==void 0))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(n=>{let r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&n.raws.before!==void 0){let e=n.raws.before.split(`
178`);return t=e[e.length-1],t=t.replace(/\S/g,``),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&e.last.type===`decl`&&(t=e.raws.semicolon,t!==void 0))return!1}),t}rawValue(e,t){let n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,`selector`)),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,`end`)}stringify(e,t){if(!this[e.type])throw Error(`Unknown AST node type `+e.type+`. Maybe you need to change PostCSS stringifier.`);this[e.type](e,t)}}return Ec=n,n.default=n,Ec}var kc,Ac;function jc(){if(Ac)return kc;Ac=1;let e=Oc();function t(t,n){new e(n).stringify(t)}return kc=t,t.default=t,kc}var Mc,Nc;function Pc(){if(Nc)return Mc;Nc=1;let{isClean:e,my:t}=Tc(),n=Sc(),r=Oc(),i=jc();function a(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r)||r===`proxyCache`)continue;let i=e[r],o=typeof i;r===`parent`&&o===`object`?t&&(n[r]=t):r===`source`?n[r]=i:Array.isArray(i)?n[r]=i.map(e=>a(e,n)):(o===`object`&&i!==null&&(i=a(i)),n[r]=i)}return n}class o{constructor(n={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in n)if(e===`nodes`){this.nodes=[];for(let t of n[e])typeof t.clone==`function`?this.append(t.clone()):this.append(t)}else this[e]=n[e]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=a(this);for(let n in e)t[n]=e[n];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}
178error(e,t={}){if(this.source){let{end:n,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:n.column,line:n.line},t)}return new n(e)}getProxyProcessor(){return{get(e,t){return t===`proxyOf`?e:t===`root`?()=>e.root().toProxy():e[t]},set(e,t,n){return e[t]===n?!0:(e[t]=n,(t===`prop`||t===`value`||t===`name`||t===`params`||t===`important`||t===`text`)&&e.markDirty(),!0)}}}markDirty(){if(this[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){t=this.toString();let r=t.indexOf(e.word);r!==-1&&(n=this.positionInside(r,t))}return n}positionInside(e,t){let n=t||this.toString(),r=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)n[t]===`
179`?(r=1,i+=1):r+=1;return{column:r,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let r=this.toString(),i=r.indexOf(e.word);i!==-1&&(t=this.positionInside(i,r),n=this.positionInside(i+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:typeof e.endIndex==`number`?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}}raw(e,t){return new r().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let r of e)r===this?n=!0:n?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);n||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!==`document`;)e=e.parent;return e}toJSON(e,t){let n={},r=t==null;t||=new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e)||e===`parent`||e===`proxyCache`)continue;let r=this[e];if(Array.isArray(r))n[e]=r.map(e=>typeof e==`object`&&e.toJSON?e.toJSON(null,t):e);else if(typeof r==`object`&&r.toJSON)n[e]=r.toJSON(null,t);else if(e===`source`){let a=t.get(r.input);a??(a=i,t.set(r.input,i),i++),n[e]={end:r.end,inputId:a,start:r.start}}else n[e]=r}return r&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||=new Proxy(this,this.getProxyProcessor()),this.proxyCache}toString(e=i){e.stringify&&(e=e.stringify);let t=``;return e(this,e=>{t+=e}),t}warn(e,t,n){let r={node:this};for(let e in n)r[e]=n[e];return e.warn(t,r)}get proxyOf(){return this}}return Mc=o,o.default=o,Mc}var Fc,Ic;function Lc(){if(Ic)return Fc;Ic=1;let e=Pc();class t extends e{constructor(e){e&&e.value!==void 0&&typeof e.value!=`string`&&(e={...e,value:String(e.value)}),super(e),this.type=`decl`}get variable(){return this.prop.startsWith(`--`)||this.prop[0]===`$`}}return Fc=t,t.default=t,Fc}var Rc,zc;function Bc(){return zc?Rc:(zc=1,Rc={nanoid:(e=21)=>{let t=``,n=e;for(;n--;)t+=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`[Math.random()*64|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r=``,i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r}},Rc)}var Vc,Hc;function Uc(){if(Hc)return Vc;Hc=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=yc,{existsSync:n,readFileSync:r}=yc,{dirname:i,join:a}=yc;function o(e){return Buffer?Buffer.from(e,`base64`).toString():window.atob(e)}class s{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,`data:`);let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=i(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||=new e(this.text),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,n=/^data:application\/json;base64,/;if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||n.test(e))return o(e.substr(RegExp.lastMatch.length));let r=e.match(/data:application\/json;([^,]+),/)[1];throw Error(`Unsupported source map encoding `+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,``).trim()}isMap(e){return typeof e==`object`?typeof e.mappings==`string`||typeof e._mappings==`string`||Array.isArray(e.sections):!1}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);
179if(!t)return;let n=e.lastIndexOf(t.pop()),r=e.indexOf(`*/`,n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}loadFile(e){if(this.root=i(e),n(e))return this.mapFile=e,r(e,`utf-8`).toString().trim()}loadMap(n,r){if(r===!1)return!1;if(r){if(typeof r==`string`)return r;if(typeof r==`function`){let e=r(n);if(e){let t=this.loadFile(e);if(!t)throw Error(`Unable to load previous source map: `+e.toString());return t}}else if(r instanceof e)return t.fromSourceMap(r).toString();else if(r instanceof t)return r.toString();else if(this.isMap(r))return JSON.stringify(r);else throw Error(`Unsupported previous source map format: `+r.toString())}else if(this.inline)return this.decodeInline(this.annotation);else if(this.annotation){let e=this.annotation;return n&&(e=a(i(n),e)),this.loadFile(e)}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Vc=s,s.default=s,Vc}var Wc,Gc;function Kc(){if(Gc)return Wc;Gc=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=yc,{fileURLToPath:n,pathToFileURL:r}=yc,{isAbsolute:i,resolve:a}=yc,{nanoid:o}
179=Bc(),s=yc,c=Sc(),l=Uc(),u=Symbol(`fromOffsetCache`),d=!!(e&&t),f=!!(a&&i);class p{constructor(e,t={}){if(e==null||typeof e==`object`&&!e.toString)throw Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]===``||this.css[0]===`￾`?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!f||/^\w+:\/\//.test(t.from)||i(t.from)?this.file=t.from:this.file=a(t.from)),f&&d){let e=new l(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id=`<input css `+o(6)+`>`),this.map&&(this.map.file=this.from)}error(e,t,n,i={}){let a,o,s;if(t&&typeof t==`object`){let e=t,r=n;if(typeof e.offset==`number`){let r=this.fromOffset(e.offset);t=r.line,n=r.col}else t=e.line,n=e.column;if(typeof r.offset==`number`){let e=this.fromOffset(r.offset);o=e.line,s=e.col}else o=r.line,s=r.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let l=this.origin(t,n,o,s);return a=l?new c(e,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,i.plugin):new c(e,o===void 0?t:{column:n,line:t},o===void 0?n:{column:s,line:o},this.css,this.file,i.plugin),a.input={column:n,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(r&&(a.input.url=r(this.file).toString()),a.input.file=this.file),a}fromOffset(e){let t,n;if(this[u])n=this[u];else{let e=this.css.split(`
180`);n=Array(e.length);let t=0;for(let r=0,i=e.length;r<i;r++)n[r]=t,t+=e[r].length+1;this[u]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t=n.length-2,i;for(;r<t;)if(i=r+(t-r>>1),e<n[i])t=i-1;else if(e>=n[i+1])r=i+1;else{r=i;break}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:a(this.map.consumer().sourceRoot||this.map.root||`.`,e)}origin(e,t,a,o){if(!this.map)return!1;let s=this.map.consumer(),c=s.originalPositionFor({column:t,line:e});if(!c.source)return!1;let l;typeof a==`number`&&(l=s.originalPositionFor({column:o,line:a}));let u;u=i(c.source)?r(c.source):new URL(c.source,this.map.consumer().sourceRoot||r(this.map.mapFile));let d={column:c.column,endColumn:l&&l.column,endLine:l&&l.line,line:c.line,url:u.toString()};if(u.protocol===`file:`)if(n)d.file=n(u);else throw Error(`file: protocol is not available in this PostCSS build`);let f=s.sourceContentFor(c.source);return f&&(d.source=f),d}toJSON(){let e={};for(let t of[`hasBOM`,`css`,`file`,`id`])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}return Wc=p,p.default=p,s&&s.registerInput&&s.registerInput(p),Wc}var qc,Jc;function Yc(){if(Jc)return qc;Jc=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=yc,{dirname:n,relative:r,resolve:i,sep:a}=yc,{pathToFileURL:o}=yc,s=Kc(),c=!!(e&&t),l=!!(n&&i&&r&&a);class u{constructor(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?`data:application/json;base64,`+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation==`string`?this.mapOpts.annotation:typeof this.mapOpts.annotation==`function`?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+`.map`;let t=`
181`;this.css.includes(`\r
182`)&&(t=`\r
183`),this.css+=t+`/*# sourceMappingURL=`+e+` */`}applyPrevMaps(){for(let t of this.previous()){let r=this.toUrl(this.path(t.file)),i=t.root||n(t.file),a;this.mapOpts.sourcesContent===!1?(a=new e(t.text),a.sourcesContent&&=null):a=t.consumer(),this.map.applySourceMap(a,r,this.toUrl(this.path(i)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type===`comment`&&e.text.indexOf(`# sourceMappingURL=`)===0&&this.root.removeChild(t)}else this.css&&=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,``)}generate(){if(this.clearAnnotation(),l&&c&&this.isMap())return this.generateMap();{let e=``;return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=t.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):`<no source>`});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css=``,this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,n=1,r=`<no source>`,i={generated:{column:0,line:0},original:{column:0,line:0},source:``},a,o;this.stringify(this.root,(t,s,c)=>{if(this.css+=t,s&&c!==`end`&&(i.generated.line=e,i.generated.column=n-1,s.source&&s.source.start?(i.source=this.sourcePath(s),i.original.line=s.source.start.line,i.original.column=s.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),a=t.match(/\n/g),a?(e+=a.length,o=t.lastIndexOf(`
184`),n=t.length-o):n+=t.length,s&&c!==`start`){let t=s.parent||{raws:{}};(!(s.type===`decl`||s.type===`atrule`&&!s.nodes)||s!==t.last||t.raws.semicolon)&&(s.source&&s.source.end?(i.source=this.sourcePath(s),i.original.line=s.source.end.line,i.original.column=s.source.end.column-1,i.generated.line=e,i.generated.column=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=e,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:this.mapOpts.annotation===void 0?!this.previous().length||this.previous().some(e=>e.annotation):this.mapOpts.annotation}isInline(){if(this.mapOpts.inline!==void 0)return this.mapOpts.inline;let e=this.mapOpts.annotation;return e!==void 0&&e!==!0?!1:!this.previous().length||this.previous().some(e=>e.inline)}isMap(){return this.opts.map===void 0?this.previous().length>0:!!this.opts.map}isSourcesContent(){return this.mapOpts.sourcesContent===void 0?!this.previous().length||this.previous().some(e=>e.withContent()):this.mapOpts.sourcesContent}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):`to.css`}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let a=this.opts.to?n(this.opts.to):`.`;typeof this.mapOpts.annotation==`string`&&(a=n(i(a,this.mapOpts.annotation)));
184let o=r(a,e);return this.memoizedPaths.set(e,o),o}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new s(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let r=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):`<no source>`;this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString(`base64`):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(o){let t=o(e).toString();return this.memoizedFileURLs.set(e,t),t}else throw Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;a===`\\`&&(e=e.replace(/\\/g,`/`));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}}return qc=u,qc}var Xc,Zc;function Qc(){if(Zc)return Xc;Zc=1;let e=Pc();class t extends e{constructor(e){super(e),this.type=`comment`}}return Xc=t,t.default=t,Xc}var $c,el;function tl(){if(el)return $c;el=1;let{isClean:e,my:t}=Tc(),n=Lc(),r=Qc(),i=Pc(),a,o,s,c;function l(e){return e.map(e=>(e.nodes&&=l(e.nodes),delete e.source,e))}function u(t){if(t[e]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)u(e)}class d extends i{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),n,r;for(;this.indexes[t]<this.proxyOf.nodes.length&&(n=this.indexes[t],r=e(this.proxyOf.nodes[n],n),r!==!1);)this.indexes[t]+=1;return delete this.indexes[t],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||=0,this.indexes||={},this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return t===`proxyOf`?e:e[t]?t===`each`||typeof t==`string`&&t.startsWith(`walk`)?(...n)=>e[t](...n.map(e=>typeof e==`function`?(t,n)=>e(t.toProxy(),n):e)):t===`every`||t===`some`?n=>e[t]((e,...t)=>n(e.toProxy(),...t)):t===`root`?()=>e.root().toProxy():t===`nodes`?e.nodes.map(e=>e.toProxy()):t===`first`||t===`last`?e[t].toProxy():e[t]:e[t]},set(e,t,n){return e[t]===n?!0:(e[t]=n,(t===`name`||t===`params`||t===`selector`)&&e.markDirty(),!0)}}}index(e){return typeof e==`number`?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n=this.index(e),r=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of r)this.proxyOf.nodes.splice(n+1,0,e);let i;for(let e in this.indexes)i=this.indexes[e],n<i&&(this.indexes[e]=i+r.length);return this.markDirty(),this}insertBefore(e,t){let n=this.index(e),r=n===0&&`prepend`,i=this.normalize(t,this.proxyOf.nodes[n],r).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);let a;for(let e in this.indexes)a=this.indexes[e],n<=a&&(this.indexes[e]=a+i.length);return this.markDirty(),this}normalize(i,c){if(typeof i==`string`)i=l(a(i).nodes);else if(i===void 0)i=[];else if(Array.isArray(i)){i=i.slice(0);for(let e of i)e.parent&&e.parent.removeChild(e,`ignore`)}else if(i.type===`root`&&this.type!==`document`){i=i.nodes.slice(0);for(let e of i)e.parent&&e.parent.removeChild(e,`ignore`)}else if(i.type)i=[i];else if(i.prop){if(i.value===void 0)throw Error(`Value field is missed in node creation`);typeof i.value!=`string`&&(i.value=String(i.value)),i=[new n(i)]}else if(i.selector)i=[new o(i)];else if(i.name)i=[new s(i)];else if(i.text)i=[new r(i)];else throw Error(`Unknown node type in node creation`);return i.map(n=>(n[t]||d.rebuild(n),n=n.proxyOf,n.parent&&n.parent.removeChild(n),n[e]&&u(n),n.raws.before===void 0&&c&&c.raws.before!==void 0&&(n.raws.before=c.raws.before.replace(/\S/g,``)),n.parent=this.proxyOf,n))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,`prepend`).reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}
184replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,n)=>{let r;try{r=e(t,n)}catch(e){throw t.addToError(e)}return r!==!1&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`atrule`&&e.test(n.name))return t(n,r)}):this.walk((n,r)=>{if(n.type===`atrule`&&n.name===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`atrule`)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if(t.type===`comment`)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`decl`&&e.test(n.prop))return t(n,r)}):this.walk((n,r)=>{if(n.type===`decl`&&n.prop===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`decl`)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`rule`&&e.test(n.selector))return t(n,r)}):this.walk((n,r)=>{if(n.type===`rule`&&n.selector===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`rule`)return t(e,n)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return d.registerParse=e=>{a=e},d.registerRule=e=>{o=e},d.registerAtRule=e=>{s=e},d.registerRoot=e=>{c=e},$c=d,d.default=d,d.rebuild=e=>{e.type===`atrule`?Object.setPrototypeOf(e,s.prototype):e.type===`rule`?Object.setPrototypeOf(e,o.prototype):e.type===`decl`?Object.setPrototypeOf(e,n.prototype):e.type===`comment`?Object.setPrototypeOf(e,r.prototype):e.type===`root`&&Object.setPrototypeOf(e,c.prototype),e[t]=!0,e.nodes&&e.nodes.forEach(e=>{d.rebuild(e)})},$c}var nl,rl;function il(){if(rl)return nl;rl=1;let e=tl(),t,n;class r extends e{constructor(e){super({type:`document`,...e}),this.nodes||=[]}toResult(e={}){return new t(new n,this,e).stringify()}}return r.registerLazyResult=e=>{t=e},r.registerProcessor=e=>{n=e},nl=r,r.default=r,nl}var al,ol;function sl(){if(ol)return al;ol=1;let e={};return al=function(t){e[t]||(e[t]=!0,typeof console<`u`&&console.warn&&console.warn(t))},al}var cl,ll;function ul(){if(ll)return cl;ll=1;class e{constructor(e,t={}){if(this.type=`warning`,this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+`: `+this.text:this.text}}return cl=e,e.default=e,cl}var dl,fl;function pl(){if(fl)return dl;fl=1;let e=ul();class t{constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let r=new e(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type===`warning`)}get content(){return this.css}}return dl=t,t.default=t,dl}var ml,hl;function gl(){if(hl)return ml;hl=1;let e=/[\t\n\f\r "#'()/;[\\\]{}]/g,t=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,n=/.[\r\n"'(/\\]/,r=/[\da-f]/i;return ml=function(i,a={}){let o=i.css.valueOf(),s=a.ignoreErrors,c,l,u,d,f,p,m,h,g,_,v=o.length,y=0,b=[],x=[];function S(){return y}function C(e){throw i.error(`Unclosed `+e,y)}function w(){return x.length===0&&y>=v}function T(i){if(x.length)return x.pop();if(y>=v)return;let a=i?i.ignoreUnclosed:!1;switch(c=o.charCodeAt(y),c){case 10:case 32:case 9:case 13:case 12:l=y;do l+=1,c=o.charCodeAt(l);while(c===32||c===10||c===9||c===13||c===12);_=[`space`,o.slice(y,l)],y=l-1;break;case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let e=String.fromCharCode(c);_=[e,e,y];break}
184case 40:if(h=b.length?b.pop()[1]:``,g=o.charCodeAt(y+1),h===`url`&&g!==39&&g!==34&&g!==32&&g!==10&&g!==9&&g!==12&&g!==13){l=y;do{if(p=!1,l=o.indexOf(`)`,l+1),l===-1)if(s||a){l=y;break}else C(`bracket`);for(m=l;o.charCodeAt(m-1)===92;)--m,p=!p}while(p);_=[`brackets`,o.slice(y,l+1),y,l],y=l}else l=o.indexOf(`)`,y+1),d=o.slice(y,l+1),l===-1||n.test(d)?_=[`(`,`(`,y]:(_=[`brackets`,d,y,l],y=l);break;case 39:case 34:u=c===39?`'`:`"`,l=y;do{if(p=!1,l=o.indexOf(u,l+1),l===-1)if(s||a){l=y+1;break}else C(`string`);for(m=l;o.charCodeAt(m-1)===92;)--m,p=!p}while(p);_=[`string`,o.slice(y,l+1),y,l],y=l;break;case 64:e.lastIndex=y+1,e.test(o),l=e.lastIndex===0?o.length-1:e.lastIndex-2,_=[`at-word`,o.slice(y,l+1),y,l],y=l;break;case 92:for(l=y,f=!0;o.charCodeAt(l+1)===92;)l+=1,f=!f;if(c=o.charCodeAt(l+1),f&&c!==47&&c!==32&&c!==10&&c!==9&&c!==13&&c!==12&&(l+=1,r.test(o.charAt(l)))){for(;r.test(o.charAt(l+1));)l+=1;o.charCodeAt(l+1)===32&&(l+=1)}_=[`word`,o.slice(y,l+1),y,l],y=l;break;default:c===47&&o.charCodeAt(y+1)===42?(l=o.indexOf(`*/`,y+2)+1,l===0&&(s||a?l=o.length:C(`comment`)),_=[`comment`,o.slice(y,l+1),y,l],y=l):(t.lastIndex=y+1,t.test(o),l=t.lastIndex===0?o.length-1:t.lastIndex-2,_=[`word`,o.slice(y,l+1),y,l],b.push(_),y=l);break}return y++,_}function E(e){x.push(e)}return{back:E,endOfFile:w,nextToken:T,position:S}},ml}var _l,vl;function yl(){if(vl)return _l;vl=1;let e=tl();class t extends e{constructor(e){super(e),this.type=`atrule`}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}return _l=t,t.default=t,e.registerAtRule(t),_l}var bl,xl;function Sl(){if(xl)return bl;xl=1;let e=tl(),t,n;class r extends e{constructor(e){super(e),this.type=`root`,this.nodes||=[]}normalize(e,t,n){let r=super.normalize(e);if(t){if(n===`prepend`)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of r)e.raws.before=t.raws.before}return r}removeChild(e,t){let n=this.index(e);return!t&&n===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new t(new n,this,e).stringify()}}return r.registerLazyResult=e=>{t=e},r.registerProcessor=e=>{n=e},bl=r,r.default=r,e.registerRoot(r),bl}var Cl,wl;function Tl(){if(wl)return Cl;wl=1;let e={comma(t){return e.split(t,[`,`],!0)},space(t){return e.split(t,[` `,`
185`,`	`])},split(e,t,n){let r=[],i=``,a=!1,o=0,s=!1,c=``,l=!1;for(let n of e)l?l=!1:n===`\\`?l=!0:s?n===c&&(s=!1):n===`"`||n===`'`?(s=!0,c=n):n===`(`?o+=1:n===`)`?o>0&&--o:o===0&&t.includes(n)&&(a=!0),a?(i!==``&&r.push(i.trim()),i=``,a=!1):i+=n;return(n||i!==``)&&r.push(i.trim()),r}};return Cl=e,e.default=e,Cl}var El,Dl;function Ol(){if(Dl)return El;Dl=1;let e=tl(),t=Tl();class n extends e{constructor(e){super(e),this.type=`rule`,this.nodes||=[]}get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:`,`+this.raw(`between`,`beforeOpen`);this.selector=e.join(n)}}return El=n,n.default=n,e.registerRule(n),El}var kl,Al;function jl(){if(Al)return kl;Al=1;let e=Lc(),t=gl(),n=Qc(),r=yl(),i=Sl(),a=Ol(),o={empty:!0,space:!0};function s(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}class c{constructor(e){this.input=e,this.root=new i,this.current=this.root,this.spaces=``,this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new r;t.name=e[1].slice(1),t.name===``&&this.unnamedAtrule(t,e),this.init(t,e[2]);let n,i,a,o=!1,s=!1,c=[],l=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),n=e[0],n===`(`||n===`[`?l.push(n===`(`?`)`:`]`):n===`{`&&l.length>0?l.push(`}`):n===l[l.length-1]&&l.pop(),l.length===0)if(n===`;`){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(n===`{`){s=!0;break}else if(n===`}`){if(c.length>0){for(a=c.length-1,i=c[a];i&&i[0]===`space`;)i=c[--a];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}else c.push(e);else c.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(c),c.length?(t.raws.afterName=this.spacesAndCommentsFromStart(c),this.raw(t,`params`,c),o&&(e=c[c.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between=``)):(t.raws.afterName=``,t.params=``),s&&(t.no
vendor: 4,775 bytes, line 185
185des=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let n=0,r;for(let i=t-1;i>=0&&(r=e[i],!(r[0]!==`space`&&(n+=1,n===2)));i--);throw this.input.error(`Missed semicolon`,r[0]===`word`?r[3]+1:r[2])}colon(e){let t=0,n,r,i;for(let[a,o]of e.entries()){if(n=o,r=n[0],r===`(`&&(t+=1),r===`)`&&--t,t===0&&r===`:`)if(!i)this.doubleColon(n);else if(i[0]===`word`&&i[1]===`progid`)continue;else return a;i=n}return!1}comment(e){let t=new n;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text=``,t.raws.left=r,t.raws.right=``;else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,n){let r=new e;this.init(r,t[0][2]);let i=t[t.length-1];for(i[0]===`;`&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(i[3]||i[2]||s(t)),r.source.end.offset++;t[0][0]!==`word`;)t.length===1&&this.unknownWord(t),r.raws.before+=t.shift()[1];for(r.source.start=this.getPosition(t[0][2]),r.prop=``;t.length;){let e=t[0][0];if(e===`:`||e===`space`||e===`comment`)break;r.prop+=t.shift()[1]}r.raws.between=``;let a;for(;t.length;)if(a=t.shift(),a[0]===`:`){r.raws.between+=a[1];break}else a[0]===`word`&&/\w/.test(a[1])&&this.unknownWord([a]),r.raws.between+=a[1];(r.prop[0]===`_`||r.prop[0]===`*`)&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o=[],c;for(;t.length&&(c=t[0][0],!(c!==`space`&&c!==`comment`));)o.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(a=t[e],a[1].toLowerCase()===`!important`){r.important=!0;let n=this.stringFrom(t,e);n=this.spacesFromEnd(t)+n,n!==` !important`&&(r.raws.important=n);break}else if(a[1].toLowerCase()===`important`){let n=t.slice(0),i=``;for(let t=e;t>0;t--){let e=n[t][0];if(i.trim().indexOf(`!`)===0&&e!==`space`)break;i=n.pop()[1]+i}i.trim().indexOf(`!`)===0&&(r.important=!0,r.raws.important=i,t=n)}if(a[0]!==`space`&&a[0]!==`comment`)break}t.some(e=>e[0]!==`space`&&e[0]!==`comment`)&&(r.raws.between+=o.map(e=>e[1]).join(``),o=[]),this.raw(r,`value`,o.concat(t),n),r.value.includes(`:`)&&!n&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error(`Double colon`,{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new a;this.init(t,e[2]),t.selector=``,t.raws.between=``,this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||``)+this.spaces,this.spaces=``,this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||``)+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&e.type===`rule`&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces=``)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces=``,e.type!==`comment`&&(this.semicolon=!1)}other(e){let t=!1,n=null,r=!1,i=null,a=[],o=e[1].startsWith(`--`),s=[],c=e;for(;c;){if(n=c[0],s.push(c),n===`(`||n===`[`)i||=c,a.push(n===`(`?`)`:`]`);else if(o&&r&&n===`{`)i||=c,a.push(`}`);else if(a.length===0)if(n===`;`)if(r){this.decl(s,o);return}else break;else if(n===`{`){this.rule(s);return}else if(n===`}`){this.tokenizer.back(s.pop()),t=!0;break}else n===`:`&&(r=!0);else n===a[a.length-1]&&(a.pop(),a.length===0&&(i=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),a.length>0&&this.unclosedBracket(i),t&&r){if(!o)for(;s.length&&(c=s[s.length-1][0],!(c!==`space`&&c!==`comment`));)this.tokenizer.back(s.pop());this.decl(s,o)}else this.unknownWord(s)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case`space`:this.spaces+=e[1];break;case`;`:this.freeSemicolon(e);break;case`}`:this.end(e);break;case`comment`:this.comment(e);break;case`at-word`:this.atrule(e);break;case`{`:this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,r){let i,a,s=n.length,c=``,l=!0,u,d;for(let e=0;e<s;e+=1)i=n[e],a=i[0],a===`space`&&e===s-1&&!r?l=!1:a===`comment`?(d=n[e-1]?n[e-1][0]:`empty`,u=n[e+1]?n[e+1][0]:`empty`,!o[d]&&!o[u]?c.slice(-1)===`,`?l=!1:c+=i[1]:l=!1):c+=i[1];if(!l){let r=n.reduce((e,t)=>
vendor: 6,255 bytes, line 185
185e+t[1],``);e.raws[t]={raw:r,value:c}}e[t]=c}rule(e){e.pop();let t=new a;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,`selector`,e),this.current=t}spacesAndCommentsFromEnd(e){let t,n=``;for(;e.length&&(t=e[e.length-1][0],!(t!==`space`&&t!==`comment`));)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n=``;for(;e.length&&(t=e[0][0],!(t!==`space`&&t!==`comment`));)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n=``;for(;e.length&&(t=e[e.length-1][0],t===`space`);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n=``;for(let r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}unclosedBlock(){let e=this.current.source.start;throw this.input.error(`Unclosed block`,e.line,e.column)}unclosedBracket(e){throw this.input.error(`Unclosed bracket`,{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error(`Unexpected }`,{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error(`Unknown word`,{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error(`At-rule without name`,{offset:t[2]},{offset:t[2]+t[1].length})}}return kl=c,kl}var Ml,Nl;function Pl(){if(Nl)return Ml;Nl=1;let e=tl(),t=jl(),n=Kc();function r(e,r){let i=new n(e,r),a=new t(i);try{a.parse()}catch(e){throw e}return a.root}return Ml=r,r.default=r,e.registerParse(r),Ml}var Fl,Il;function Ll(){if(Il)return Fl;Il=1;let{isClean:e,my:t}=Tc(),n=Yc(),r=jc(),i=tl(),a=il();sl();let o=pl(),s=Pl(),c=Sl(),l={atrule:`AtRule`,comment:`Comment`,decl:`Declaration`,document:`Document`,root:`Root`,rule:`Rule`},u={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},d={Once:!0,postcssPlugin:!0,prepare:!0};function f(e){return typeof e==`object`&&typeof e.then==`function`}function p(e){let t=!1,n=l[e.type];return e.type===`decl`?t=e.prop.toLowerCase():e.type===`atrule`&&(t=e.name.toLowerCase()),t&&e.append?[n,n+`-`+t,0,n+`Exit`,n+`Exit-`+t]:t?[n,n+`-`+t,n+`Exit`,n+`Exit-`+t]:e.append?[n,0,n+`Exit`]:[n,n+`Exit`]}function m(e){let t;return t=e.type===`document`?[`Document`,0,`DocumentExit`]:e.type===`root`?[`Root`,0,`RootExit`]:p(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function h(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>h(e)),t}let g={};class _{constructor(e,n,r){this.stringified=!1,this.processed=!1;let a;if(typeof n==`object`&&n&&(n.type===`root`||n.type===`document`))a=h(n);else if(n instanceof _||n instanceof o)a=h(n.root),n.map&&(r.map===void 0&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let e=s;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{a=e(n,r)}catch(e){this.processed=!0,this.error=e}a&&!a[t]&&i.rebuild(a)}this.result=new o(e,a,r),this.helpers={...g,postcss:g,result:this.result},this.plugins=this.processor.plugins.map(e=>typeof e==`object`&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||=this.runAsync(),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw Error(`Use process(css).then(cb) to work with async plugins`)}handleError(e,t){let n=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,e.name===`CssSyntaxError`&&!e.plugin?(e.plugin=n.postcssPlugin,e.setMessage()):n.postcssVersion}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if(typeof t==`object`)for(let n in t){if(!u[n]&&/^[A-Z]/.test(n))throw Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!d[n])if(typeof t[n]==`object`)for(let r in t[n])r===`*`?e(t,n,t[n][r]):e(t,n+`-`+r.toLowerCase(),t[n][r]);else typeof t[n]==`function`&&e(t,n,t[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],n=this.runOnRoot(t);if(f(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let n=[m(t)];for(;n.length>0;){let e=this.visitTick(n);if(f(e))try{await e}catch(e){let t=n[n.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,n]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if(t.type===`document`){let e=t.nodes.map(e=>n(e,this.helpers));await Promise.all(e)}else await n(t,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e==`object`&&e.Once){if(this.result.root.type===`document`){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return f(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e==`function`)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=r;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new n(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(f(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type===`document`)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,r]of e){this.result.lastPlugin=n;let e;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if(t.type!==`root`&&t.type!==`document`&&!t.parent)return!0;
185if(f(e))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:i}=n;if(r.type!==`root`&&r.type!==`document`&&!r.parent){t.pop();return}if(i.length>0&&n.visitorIndex<i.length){let[e,t]=i[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===i.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=e;try{return t(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(n.iterator!==0){let i=n.iterator,a;for(;a=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!a[e]){a[e]=!0,t.push(m(a));return}n.iterator=0,delete r.indexes[i]}let a=n.events;for(;n.eventIndex<a.length;){let t=a[n.eventIndex];if(n.eventIndex+=1,t===0){r.nodes&&r.nodes.length&&(r[e]=!0,n.iterator=r.getIterator());return}else if(this.listeners[t]){n.visitors=this.listeners[t];return}}t.pop()}walkSync(t){t[e]=!0;let n=p(t);for(let r of n)if(r===0)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[r];if(e&&this.visitSync(e,t.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return`LazyResult`}}return _.registerPostcss=e=>{g=e},Fl=_,_.default=_,c.registerLazyResult(_),a.registerLazyResult(_),Fl}var Rl,zl;function Bl(){if(zl)return Rl;zl=1;let e=Yc(),t=jc();sl();let n=Pl(),r=pl();class i{constructor(n,i,a){i=i.toString(),this.stringified=!1,this._processor=n,this._css=i,this._opts=a,this._map=void 0;let o=t;this.result=new r(this._processor,void 0,this._opts),this.result.css=i;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let c=new e(o,void 0,this._opts,i);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=n;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return`NoWorkResult`}}return Rl=i,i.default=i,Rl}var Vl,Hl;function Ul(){if(Hl)return Vl;Hl=1;let e=Bl(),t=Ll(),n=il(),r=Sl();class i{constructor(e=[]){this.version=`8.4.38`,this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(n.postcss===!0?n=n():n.postcss&&(n=n.postcss),typeof n==`object`&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if(typeof n==`object`&&n.postcssPlugin)t.push(n);else if(typeof n==`function`)t.push(n);else if(!(typeof n==`object`&&(n.parse||n.stringify)))throw Error(n+` is not a PostCSS plugin`);return t}process(n,r={}){return!this.plugins.length&&!r.parser&&!r.stringifier&&!r.syntax?new e(this,n,r):new t(this,n,r)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return Vl=i,i.default=i,r.registerProcessor(i),n.registerProcessor(i),Vl}var Wl,Gl;function Kl(){if(Gl)return Wl;Gl=1;let e=Lc(),t=Uc(),n=Qc(),r=yl(),i=Kc(),a=Sl(),o=Ol();function s(c,l){if(Array.isArray(c))return c.map(e=>s(e));let{inputs:u,...d}=c;if(u){l=[];for(let e of u){let n={...e,__proto__:i.prototype};n.map&&={...n.map,__proto__:t.prototype},l.push(n)}}if(d.nodes&&=c.nodes.map(e=>s(e,l)),d.source){let{inputId:e,...t}=d.source;d.source=t,e!=null&&(d.source.input=l[e])}if(d.type===`root`)return new a(d);if(d.type===`decl`)return new e(d);if(d.type===`rule`)return new o(d);if(d.type===`comment`)return new n(d);if(d.type===`atrule`)return new r(d);throw Error(`Unknown node type: `+c.type)}return Wl=s,s.default=s,Wl}var ql,Jl;function Yl(){if(Jl)return ql;Jl=1;
185let e=Sc(),t=Lc(),n=Ll(),r=tl(),i=Ul(),a=jc(),o=Kl(),s=il(),c=ul(),l=Qc(),u=yl(),d=pl(),f=Kc(),p=Pl(),m=Tl(),h=Ol(),g=Sl(),_=Pc();function v(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new i(e)}return v.plugin=function(e,t){let n=!1;function r(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
186https://evilmartians.com/chronicles/postcss-8-plugin-migration`),{}.LANG&&{}.LANG.startsWith(`cn`)&&console.warn(e+`: 里面 postcss.plugin 被弃用. 迁移指南:
187https://www.w3ctech.com/topic/2226`));let a=t(...r);return a.postcssPlugin=e,a.postcssVersion=new i().version,a}let a;return Object.defineProperty(r,"postcss",{get(){return a||=r(),a}}),r.process=function(e,t,n){return v([r(n)]).process(e,t)},r},v.stringify=a,v.parse=p,v.fromJSON=o,v.list=m,v.comment=e=>new l(e),v.atRule=e=>new u(e),v.decl=e=>new t(e),v.rule=e=>new h(e),v.root=e=>new g(e),v.document=e=>new s(e),v.CssSyntaxError=e,v.Declaration=t,v.Container=r,v.Processor=i,v.Document=s,v.Comment=l,v.Warning=c,v.AtRule=u,v.Result=d,v.Input=f,v.Rule=h,v.Root=g,v.Node=_,n.registerPostcss(v),ql=v,v.default=v,ql}var L=mc(Yl());L.stringify,L.fromJSON,L.plugin,L.parse,L.list,L.document,L.comment,L.atRule,L.rule,L.decl,L.root,L.CssSyntaxError,L.Declaration,L.Container,L.Processor,L.Document,L.Comment,L.Warning,L.AtRule,L.Result,L.Input,L.Rule,L.Root,L.Node;var Xl=class e{constructor(...e){pc(this,`parentElement`,null),pc(this,`parentNode`,null),pc(this,`ownerDocument`),pc(this,`firstChild`,null),pc(this,`lastChild`,null),pc(this,`previousSibling`,null),pc(this,`nextSibling`,null),pc(this,`ELEMENT_NODE`,1),pc(this,`TEXT_NODE`,3),pc(this,`nodeType`),pc(this,`nodeName`),pc(this,`RRNodeType`)}get childNodes(){let e=[],t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e)||t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(e){throw Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.`)}insertBefore(e,t){throw Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.`)}removeChild(e){throw Error(`RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.`)}toString(){return`RRNode`}},Zl={Node:[`childNodes`,`parentNode`,`parentElement`,`textContent`],ShadowRoot:[`host`,`styleSheets`],Element:[`shadowRoot`,`querySelector`,`querySelectorAll`],MutationObserver:[]},Ql={Node:[`contains`,`getRootNode`],ShadowRoot:[`getSelection`],Element:[],MutationObserver:[`constructor`]},$l={};function eu(e){var t;let n=((t=globalThis==null?void 0:globalThis.Zone)?.__symbol__)?.call(t,e);if(n&&globalThis[n])return globalThis[n]}function tu(e){if($l[e])return $l[e];let t=eu(e)||globalThis[e],n=t.prototype,r=e in Zl?Zl[e]:void 0,i=!!(r&&r.every(e=>!!(Object.getOwnPropertyDescriptor(n,e)?.get)?.toString().includes(`[native code]`))),a=e in Ql?Ql[e]:void 0,o=!!(a&&a.every(e=>typeof n[e]==`function`&&n[e]?.toString().includes(`[native code]`)));if(i&&o)return $l[e]=t.prototype,t.prototype;try{let r=document.createElement(`iframe`);document.body.appendChild(r);let i=r.contentWindow;if(!i)return t.prototype;let a=i[e].prototype;return document.body.removeChild(r),a?$l[e]=a:n}catch{return n}}var nu={};function ru(e,t,n){let r=`${e}.${String(n)}`;if(nu[r])return nu[r].call(t);let i=tu(e),a=Object.getOwnPropertyDescriptor(i,n)?.get;return a?(nu[r]=a,a.call(t)):t[n]}var iu={};function au(e,t,n){let r=`${e}.${String(n)}`;if(iu[r])return iu[r].bind(t);let i=tu(e)[n];return typeof i==`function`?(iu[r]=i,i.bind(t)):t[n]}function ou(e){return ru(`Node`,e,`childNodes`)}function su(e){return ru(`Node`,e,`parentNode`)}function cu(e){return ru(`Node`,e,`parentElement`)}function lu(e){return ru(`Node`,e,`textContent`)}function uu(e,t){return au(`Node`,e,`contains`)(t)}function du(e){return au(`Node`,e,`getRootNode`)()}function fu(e){return!e||!(`host`in e)?null:ru(`ShadowRoot`,e,`host`)}function pu(e){return e.styleSheets}function mu(e){return!e||!(`shadowRoot`in e)?null:ru(`Element`,e,`shadowRoot`)}function hu(e,t){return ru(`Element`,e,`querySelector`)(t)}function gu(e,t){return ru(`Element`,e,`querySelectorAll`)(t)}function _u(){return tu(`MutationObserver`).constructor}var R={childNodes:ou,parentNode:su,parentElement:cu,textContent:lu,contains:uu,getRootNode:du,host:fu,styleSheets:pu,shadowRoot:mu,querySelector:hu,querySelectorAll:gu,mutationObserver:_u};function vu(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var yu=`Please stop import mirror directly. Instead of that,\r
188now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
189or you can use record.mirror to access the mirror instance during recording.`,bu={map:{},getId(){return console.error(yu),-1},getNode(){return console.error(yu),null},removeNodeFromMap(){console.error(yu)},has(){return console.error(yu),!1},reset(){console.error(yu)}};typeof window<`u`&&window.Proxy&&window.Reflect&&(bu=new Proxy(bu,{get(e,t,n){return t===`map`&&console.error(yu),Reflect.get(e,t,n)}}));function xu(e,t,n={}){let r=null,i=0;return function(...a){let o=Date.now();!i&&n.leading===!1&&(i=o);let s=t-(o-i),c=this;s<=0||s>t?(r&&=(clearTimeout(r),null),i=o,e.apply(c,a)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{i=n.leading===!1?0:Date.now(),r=null,e.apply(c,a)},s))}}function Su(e,t,n,r,i=window){let a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),a&&a.set&&a.set.call(this,e)}}),()=>Su(e,t,a||{},!0)}function Cu(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return typeof i==`function`&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}var wu=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(wu=()=>new Date().getTime());function Tu(e){let t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset===void 0?t.documentElement.scrollLeft||t?.body&&R.parentElement(t.body)?.scrollLeft||t?.body?.scrollLeft||0:e.pageXOffset,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset===void 0?t?.documentElement.scrollTop||t?.body&&R.parentElement(t.body)?.scrollTop||t?.body?.scrollTop||0:e.pageYOffset}}function Eu(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Du(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ou(e){return e?e.nodeType===e.ELEMENT_NODE?e:R.parentElement(e):null}function ku(e,t,n,r){if(!e)return!1;let i=Ou(e);if(!i)return!1;try{if(typeof t==`string`){if(i.classList.contains(t)||r&&i.closest(`.`+t)!==null)return!0}else if(_o(i,t,r))return!0}catch{}return!!(n&&(i.matches(n)||r&&i.closest(n)!==null))}function Au(e,t){return t.getId(e)!==-1}function ju(e,t,n){return e.tagName===`TITLE`&&n.headTitleMutations?!0:t.getId(e)===to}function Mu(e,t){if(Ea(e))return!1;let n=t.getId(e);if(!t.has(n))return!0;let r=R.parentNode(e);return r&&r.nodeType===e.DOCUMENT_NODE?!1:!r||Mu(r,t)}function Nu(e){return!!e.changedTouches}function Pu(e=window){`NodeList`in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),`DOMTokenList`in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function Fu(e,t){return!!(e.nodeName===`IFRAME`&&t.getMeta(e))}function Iu(e,t){return!!(e.nodeName===`LINK`&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute(`rel`)===`stylesheet`&&t.getMeta(e))}function Lu(e){return e?e instanceof Xl&&`shadowRoot`in e?!!e.shadowRoot:!!R.shadowRoot(e):!1}var Ru=class{constructor(){P(this,`id`,1),P(this,`styleIDMap`,new WeakMap),P(this,`idStyleMap`,new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=t===void 0?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function zu(e){let t=null;return`getRootNode`in e&&R.getRootNode(e)?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&R.host(R.getRootNode(e))&&(t=R.host(R.getRootNode(e))),t}function Bu(e){let t=e,n;for(;n=zu(t);)t=n;return t}function Vu(e){let t=e.ownerDocument;if(!t)return!1;let n=Bu(e);return R.contains(t,n)}function Hu(e){let t=e.ownerDocument;return t?R.contains(t,e)||Vu(e):!1}var z=(e=>(e[e.DomContentLoaded=0]=`DomContentLoaded`,e[e.Load=1]=`Load`,e[e.FullSnapshot=2]=`FullSnapshot`,e[e.IncrementalSnapshot=3]=`IncrementalSnapshot`,e[e.Meta=4]=`Meta`,e[e.Custom=5]=`Custom`,e[e.Plugin=6]=`Plugin`,e))(z||{}),B=(e=>(e[e.Mutation=0]=`Mutation`,e[e.MouseMove=1]=`MouseMove`,e[e.MouseInteraction=2]=`MouseInteraction`,e[e.Scroll=3]=`Scroll`,e[e.ViewportResize=4]=`ViewportResize`,e[e.Input=5]=`Input`,e[e.TouchMove=6]=`TouchMove`,e[e.MediaInteraction=7]=`MediaInteraction`,e[e.StyleSheetRule=8]=`StyleSheetRule`,e[e.CanvasMutation=9]=`CanvasMutation`,e[e.Font=10]=`Font`,e[e.Log=11]=`Log`,e[e.Drag=12]=`Drag`,e[e.StyleDeclaration=13]=`StyleDeclaration`,e[e.Selection=14]=`Selection`,e[e.AdoptedStyleSheet=15]=`AdoptedStyleSheet`,e[e.CustomElement=16]=`CustomElement`,e))(B||{}),Uu=(e=>(e[e.MouseUp=0]=`MouseUp`,e[e.MouseDown=1]=`MouseDown`,e[e.Click=2]=`Click`,e[e.ContextMenu=3]=`ContextMenu`,e[e.DblClick=4]=`DblClick`,e[e.Focus=5]=`Focus`,e[e.Blur=6]=`Blur`,e[e.TouchStart=7]=`TouchStart`,e[e.TouchMove_Departed=8]=`TouchMove_Departed`,e[e.TouchEnd=9]=`TouchEnd`,e[e.TouchCancel=10]=`TouchCancel`,e))(Uu||{}),Wu=(e=>(e[e.Mouse=0]=`Mouse`,e[e.Pen=1]=`Pen`,e[e.Touch=2]=`Touch`,e))(Wu||{}),Gu=(e=>(e[e[`2D`]=0]=`2D`,e[e.WebGL=1]=`WebGL`,e[e.WebGL2=2]=`WebGL2`,e))(Gu||{}),Ku=(e=>(e[e.Play=0]=`Play`,e[e.Pause=1]=`Pause`,e[e.Seeked=2]=`Seeked`,e[e.VolumeChange=3]=`VolumeChange`,e[e.RateChange=4]=`RateChange`,e))(Ku||{}),qu=(e=>(e[e.Document=0]=`Document`,e[e.DocumentType=1]=`DocumentType`,e[e.Element=2]=`Element`,e[e.Text=3]=`Text`,e[e.CDATA=4]=`CDATA`,e[e.Comment=5]=`Comment`,e))(qu||{});function Ju(e){return`__ln`in e}var Yu=class{constructor(){P(this,`length`,0),P(this,`head`,null),P(this,`tail`,null)}get(e){if(e>=this.length)throw Error(`Position outside of list range`);let t=this.head;for(let n=0;n<e;n++)t=t?.next||null;return t}addNode(e){let t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Ju(e.previousSibling)){let n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&
vendor: 5,981 bytes, line 189
189(n.previous=t)}else if(e.nextSibling&&Ju(e.nextSibling)&&e.nextSibling.__ln.previous){let n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){let t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}},Xu=(e,t)=>`${e}@${t}`,Zu=class{constructor(){P(this,`frozen`,!1),P(this,`locked`,!1),P(this,`texts`,[]),P(this,`attributes`,[]),P(this,`attributeMap`,new WeakMap),P(this,`removes`,[]),P(this,`mapRemoves`,[]),P(this,`movedMap`,{}),P(this,`addedSet`,new Set),P(this,`movedSet`,new Set),P(this,`droppedSet`,new Set),P(this,`removesSubTreeCache`,new Set),P(this,`mutationCb`),P(this,`blockClass`),P(this,`blockSelector`),P(this,`maskTextClass`),P(this,`maskTextSelector`),P(this,`inlineStylesheet`),P(this,`maskInputOptions`),P(this,`maskTextFn`),P(this,`maskInputFn`),P(this,`maskAttributeFn`),P(this,`keepIframeSrcFn`),P(this,`recordCanvas`),P(this,`inlineImages`),P(this,`slimDOMOptions`),P(this,`dataURLOptions`),P(this,`doc`),P(this,`mirror`),P(this,`iframeManager`),P(this,`stylesheetManager`),P(this,`shadowDomManager`),P(this,`canvasManager`),P(this,`processedNodeManager`),P(this,`unattachedDoc`),P(this,`processMutations`,e=>{e.forEach(this.processMutation),this.emit()}),P(this,`emit`,()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,n=new Yu,r=e=>{let t=e,n=to;for(;n===to;)t&&=t.nextSibling,n=t&&this.mirror.getId(t);return n},i=i=>{let a=R.parentNode(i);if(!a||!Hu(i))return;let o=!1;if(i.nodeType===Node.TEXT_NODE){let e=a.tagName;if(e===`TEXTAREA`)return;e===`STYLE`&&this.addedSet.has(a)&&(o=!0)}let s=Ea(a)?this.mirror.getId(zu(i)):this.mirror.getId(a),c=r(i);if(s===-1||c===-1)return n.addNode(i);let l=Do(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Fu(e,this.mirror)&&this.iframeManager.addIframe(e),Iu(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Lu(i)&&this.shadowDomManager.addShadowRoot(R.shadowRoot(i),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:o});l&&(e.push({parentId:s,nextId:c,node:l}),t.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let e of this.movedSet)ed(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(R.parentNode(e))||i(e);for(let e of this.addedSet)!nd(this.droppedSet,e)&&!ed(this.removesSubTreeCache,e,this.mirror)||nd(this.movedSet,e)?i(e):this.droppedSet.add(e);let a=null;for(;n.length;){let e=null;if(a){let t=this.mirror.getId(R.parentNode(a.value)),n=r(a.value);t!==-1&&n!==-1&&(e=a)}if(!e){let t=n.tail;for(;t;){let n=t;if(t=t.previous,n){let t=this.mirror.getId(R.parentNode(n.value));if(r(n.value)===-1)continue;if(t!==-1){e=n;break}else{let t=n.value,r=R.parentNode(t);if(r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let t=R.host(r);if(this.mirror.getId(t)!==-1){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}a=e.previous,n.removeNode(e.value),i(e.value)}let o={texts:this.texts.map(e=>{let t=e.node,n=R.parentNode(t);return n&&n.tagName===`TEXTAREA`&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(t),value:e.value}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{let{attributes:t}=e;if(typeof t.style==`string`){let n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split(`var(`).length===t.style.split(`var(`).length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};!o.texts.length&&!o.attributes.length&&!o.removes.length&&!o.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(o))}),P(this,`genTextAreaValueMutation`,e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));let n=Array.from(R.childNodes(e),e=>R.textContent(e)||``).join(``);t.attributes.value=La({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Va(e),value:n,maskInputFn:this.maskInputFn})}),P(this,`processMutation`,e=>{if(!ju(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case`characterData`:{let t=R.textContent(e.target);!ku(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:vo(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Ou(e.target)):t.replace(/[\S]/g,`*`):t,node:e.target});break}case`attributes`:{let t=e.target,n=e.attributeName,r=e.target.getAttribute(n);if(n===`value`){let e=Va(t);r=La({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:r,maskInputFn:this.maskInputFn})}if(ku(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue)return;let i=this.attributeMap.get(e.target);if(t.tagName===`IFRAME`&&n===`src`&&!this.keepIframeSrcFn(r))if(!t.contentDocument)n=`rr_src`;else return;if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}}
189,this.attributes.push(i),this.attributeMap.set(e.target,i)),n===`type`&&t.tagName===`INPUT`&&(e.oldValue||``).toLowerCase()===`password`&&t.setAttribute(`data-rr-is-password`,`true`),!ho(t.tagName,n)){if(i.attributes[n]=mo(this.doc,Ra(t.tagName),Ra(n),r),this.maskAttributeFn&&typeof i.attributes[n]==`string`){let e=this.maskAttributeFn(n,i.attributes[n],t);e===null?delete i.attributes[n]:i.attributes[n]=e}if(n===`style`){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let n=this.unattachedDoc.createElement(`span`);e.oldValue&&n.setAttribute(`style`,e.oldValue);for(let e of Array.from(t.style)){let r=t.style.getPropertyValue(e),a=t.style.getPropertyPriority(e);r!==n.style.getPropertyValue(e)||a!==n.style.getPropertyPriority(e)?a===``?i.styleDiff[e]=r:i.styleDiff[e]=[r,a]:i._unchangedStyles[e]=[r,a]}for(let e of Array.from(n.style))t.style.getPropertyValue(e)===``&&(i.styleDiff[e]=!1)}else n===`open`&&t.tagName===`DIALOG`&&(t.matches(`dialog:modal`)?i.attributes.rr_open_mode=`modal`:i.attributes.rr_open_mode=`non-modal`)}break}case`childList`:if(ku(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName===`TEXTAREA`){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{let n=this.mirror.getId(t),r=Ea(e.target)?this.mirror.getId(R.host(e.target)):this.mirror.getId(e.target);ku(e.target,this.blockClass,this.blockSelector,!1)||ju(t,this.mirror,this.slimDOMOptions)||!Au(t,this.mirror)||(this.addedSet.has(t)?(Qu(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&n===-1||Mu(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Xu(n,r)]?Qu(this.movedSet,t):(this.removes.push({parentId:r,id:n,isShadow:Ea(e.target)&&Da(e.target)?!0:void 0}),$u(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}),P(this,`genAdds`,(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(ju(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&n!==-1&&(this.movedMap[Xu(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ku(e,this.blockClass,this.blockSelector,!1)||(R.childNodes(e).forEach(e=>
189this.genAdds(e)),Lu(e)&&R.childNodes(R.shadowRoot(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){[`mutationCb`,`blockClass`,`blockSelector`,`maskTextClass`,`maskTextSelector`,`inlineStylesheet`,`maskInputOptions`,`maskTextFn`,`maskInputFn`,`maskAttributeFn`,`keepIframeSrcFn`,`recordCanvas`,`inlineImages`,`slimDOMOptions`,`dataURLOptions`,`doc`,`mirror`,`iframeManager`,`stylesheetManager`,`shadowDomManager`,`canvasManager`,`processedNodeManager`].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function Qu(e,t){e.delete(t),R.childNodes(t).forEach(t=>Qu(e,t))}function $u(e,t){let n=[e];for(;n.length;){let e=n.pop();t.has(e)||(t.add(e),R.childNodes(e).forEach(e=>n.push(e)))}}function ed(e,t,n){return e.size!==0&&td(e,t)}function td(e,t,n){let r=R.parentNode(t);return r?e.has(r):!1}function nd(e,t){return e.size!==0&&rd(e,t)}function rd(e,t){let n=R.parentNode(t);return n?e.has(n)?!0:rd(e,n):!1}var id;function ad(e){id=e}function od(){id=void 0}var V=e=>id?((...t)=>{try{return e(...t)}catch(e){if(id&&id(e)===!0)return;throw e}}):e;function sd(e){return(...t)=>{try{return e(...t)}catch(e){try{e._external_=!0}catch{}throw e}}}var cd=[];function ld(e){try{if(`composedPath`in e){let t=e.composedPath();if(t.length)return t[0]}else if(`path`in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function ud(e,t){let n=new Zu;cd.push(n),n.init(e);let r=new(_u())(V(n.processMutations.bind(n)));return r.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function dd({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};let i=typeof t.mousemove==`number`?t.mousemove:50,a=typeof t.mousemoveCallback==`number`?t.mousemoveCallback:500,o=[],s,c=xu(V(t=>{let n=Date.now()-s;e(o.map(e=>(e.timeOffset-=n,e)),t),o=[],s=null}),a),l=V(xu(V(e=>{let t=ld(e),{clientX:n,clientY:i}=Nu(e)?e.changedTouches[0]:e;s||=wu(),o.push({x:n,y:i,id:r.getId(t),timeOffset:wu()-s}),c(typeof DragEvent<`u`&&e instanceof DragEvent?B.Drag:e instanceof MouseEvent?B.MouseMove:B.TouchMove)}),i,{trailing:!1})),u=[vu(`mousemove`,l,n),vu(`touchmove`,l,n),vu(`drag`,l,n)];return V(()=>{u.forEach(e=>e())})}function fd({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:a}){if(a.mouseInteraction===!1)return()=>{};let o=a.mouseInteraction===!0||a.mouseInteraction===void 0?{}:a.mouseInteraction,s=[],c=null,l=t=>a=>{let o=ld(a);if(ku(o,r,i,!0))return;let s=null,l=t;if(`pointerType`in a){switch(a.pointerType){case`mouse`:s=Wu.Mouse;break;case`touch`:s=Wu.Touch;break;case`pen`:s=Wu.Pen;break}s===Wu.Touch?Uu[t]===Uu.MouseDown?l=`TouchStart`:Uu[t]===Uu.MouseUp&&(l=`TouchEnd`):Wu.Pen}else Nu(a)&&(s=Wu.Touch);s===null?Uu[t]===Uu.Click&&(s=c,c=null):(c=s,(l.startsWith(`Touch`)&&s===Wu.Touch||l.startsWith(`Mouse`)&&s===Wu.Mouse)&&(s=null));
vendor: 4,833 bytes, line 189
189let u=Nu(a)?a.changedTouches[0]:a;if(!u)return;let d=n.getId(o),{clientX:f,clientY:p}=u;V(e)({type:Uu[l],id:d,x:f,y:p,...s!==null&&{pointerType:s}})};return Object.keys(Uu).filter(e=>Number.isNaN(Number(e))&&!e.endsWith(`_Departed`)&&o[e]!==!1).forEach(e=>{let n=Ra(e),r=l(e);if(window.PointerEvent)switch(Uu[e]){case Uu.MouseDown:case Uu.MouseUp:n=n.replace(`mouse`,`pointer`);break;case Uu.TouchStart:case Uu.TouchEnd:return}s.push(vu(n,r,t))}),V(()=>{s.forEach(e=>e())})}function pd({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:a}){return vu(`scroll`,V(xu(V(a=>{let o=ld(a);if(!o||ku(o,r,i,!0))return;let s=n.getId(o);if(o===t&&t.defaultView){let n=Tu(t.defaultView);e({id:s,x:n.left,y:n.top})}else e({id:s,x:o.scrollLeft,y:o.scrollTop})}),a.scroll||100)),t)}function md({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return vu(`resize`,V(xu(V(()=>{let t=Eu(),i=Du();(n!==t||r!==i)&&(e({width:Number(i),height:Number(t)}),n=t,r=i)}),200)),t)}var hd=[`INPUT`,`TEXTAREA`,`SELECT`],gd=new WeakMap;function _d({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,ignoreClass:a,ignoreSelector:o,maskInputOptions:s,maskInputFn:c,sampling:l,userTriggeredOnInput:u}){function d(e){let n=ld(e),l=e.isTrusted,d=n&&n.tagName;if(n&&d===`OPTION`&&(n=R.parentElement(n)),!n||!d||hd.indexOf(d)<0||ku(n,r,i,!0)||n.classList.contains(a)||o&&n.matches(o))return;let p=n.value,m=!1,h=Va(n)||``;h===`radio`||h===`checkbox`?m=n.checked:(s[d.toLowerCase()]||s[h])&&(p=La({element:n,maskInputOptions:s,tagName:d,type:h,value:p,maskInputFn:c})),f(n,u?{text:p,isChecked:m,userTriggered:l}:{text:p,isChecked:m});let g=n.name;h===`radio`&&g&&m&&t.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(e=>{if(e!==n){let t=e.value;f(e,u?{text:t,isChecked:!m,userTriggered:!1}:{text:t,isChecked:!m})}})}function f(t,r){let i=gd.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){gd.set(t,r);let i=n.getId(t);V(e)({...r,id:i})}}let p=(l.input===`last`?[`change`]:[`input`,`change`]).map(e=>vu(e,V(d),t)),m=t.defaultView;if(!m)return()=>{p.forEach(e=>e())};let h=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,`value`),g=[[m.HTMLInputElement.prototype,`value`],[m.HTMLInputElement.prototype,`checked`],[m.HTMLSelectElement.prototype,`value`],[m.HTMLTextAreaElement.prototype,`value`],[m.HTMLSelectElement.prototype,`selectedIndex`],[m.HTMLOptionElement.prototype,`selected`]];return h&&h.set&&p.push(...g.map(e=>Su(e[0],e[1],{set(){V(d)({target:this,isTrusted:!1})}},!1,m))),V(()=>{p.forEach(e=>e())})}function vd(e){let t=[];function n(e,t){if(kd(`CSSGroupingRule`)&&e.parentRule instanceof CSSGroupingRule||kd(`CSSMediaRule`)&&e.parentRule instanceof CSSMediaRule||kd(`CSSSupportsRule`)&&e.parentRule instanceof CSSSupportsRule||kd(`CSSConditionRule`)&&e.parentRule instanceof CSSConditionRule){let n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){let n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}return n(e,t)}function yd(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function bd({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:V((r,i,a)=>{let[o,s]=a,{id:c,styleId:l}=yd(i,t,n.styleMirror);return(c&&c!==-1||l&&l!==-1)&&e({id:c,styleId:l,adds:[{rule:o,index:s}]}),sd(()=>r.apply(i,a))()})}),r.CSSStyleSheet.prototype.addRule=function(e,t,n=this.cssRules.length){let i=`${e} { ${t} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[i,n])};let a=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:V((r,i,a)=>{let[o]=a,{id:s,styleId:c}=yd(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,removes:[{index:o}]}),sd(()=>r.apply(i,a))()})}),r.CSSStyleSheet.prototype.removeRule=function(e){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[e])};let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:V((r,i,a)=>{let[o]=a,{id:s,styleId:c}=yd(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,replace:o}),r.apply(i,a)})}));let s;r.CSSStyleSheet.prototype.replaceSync&&(s=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(s,{apply:V((r,i,a)=>{let[o]=a,{id:s,styleId:c}=yd(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,replaceSync:o}),r.apply(i,a)})}));let c={};Ad(`CSSGroupingRule`)?c.CSSGroupingRule=r.CSSGroupingRule:(Ad(`CSSMediaRule`)&&(c.CSSMediaRule=r.CSSMediaRule),Ad(`CSSConditionRule`)&&(c.CSSConditionRule=r.CSSConditionRule),Ad(`CSSSupportsRule`)&&(c.CSSSupportsRule=r.CSSSupportsRule));let l={};
189return Object.entries(c).forEach(([r,i])=>{l[r]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(l[r].insertRule,{apply:V((r,i,a)=>{let[o,s]=a,{id:c,styleId:l}=yd(i.parentStyleSheet,t,n.styleMirror);return(c&&c!==-1||l&&l!==-1)&&e({id:c,styleId:l,adds:[{rule:o,index:[...vd(i),s||0]}]}),r.apply(i,a)})}),i.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:V((r,i,a)=>{let[o]=a,{id:s,styleId:c}=yd(i.parentStyleSheet,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,removes:[{index:[...vd(i),o]}]}),r.apply(i,a)})})}),V(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=a,o&&(r.CSSStyleSheet.prototype.replace=o),s&&(r.CSSStyleSheet.prototype.replaceSync=s),Object.entries(c).forEach(([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule})})}function xd({mirror:e,stylesheetManager:t},n){let r=null;r=n.nodeName===`#document`?e.getId(n):e.getId(R.host(n));let i=n.nodeName===`#document`?n.defaultView?.Document:n.ownerDocument?.defaultView?.ShadowRoot,a=i?.prototype?Object.getOwnPropertyDescriptor(i?.prototype,`adoptedStyleSheets`):void 0;return r===null||r===-1||!i||!a?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){return a.get?.call(this)},set(e){let n=a.set?.call(this,e);if(r!==null&&r!==-1)try{t.adoptStyleSheets(e,r)}catch{}return n}}),V(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function Sd({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){let a=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:V((i,o,s)=>{let[c,l,u]=s;if(n.has(c))return a.apply(o,[c,l,u]);let{id:d,styleId:f}=yd(o.parentRule?.parentStyleSheet,t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,set:{property:c,value:l,priority:u},index:vd(o.parentRule)}),i.apply(o,s)})});let o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:V((i,a,s)=>{let[c]=s;if(n.has(c))return o.apply(a,[c]);let{id:l,styleId:u}=yd(a.parentRule?.parentStyleSheet,t,r.styleMirror);return(l&&l!==-1||u&&u!==-1)&&e({id:l,styleId:u,remove:{property:c},index:vd(a.parentRule)}),i.apply(a,s)})}),V(()=>{i.CSSStyleDeclaration.prototype.setProperty=a,i.CSSStyleDeclaration.prototype.removeProperty=o})}function Cd({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:i,doc:a}){let o=V(a=>xu(V(i=>{let o=ld(i);if(!o||ku(o,t,n,!0))return;let{currentTime:s,volume:c,muted:l,playbackRate:u,loop:d}=o;e({type:a,id:r.getId(o),currentTime:s,volume:c,muted:l,playbackRate:u,loop:d})}),i.media||500)),s=[vu(`play`,o(Ku.Play),a),vu(`pause`,o(Ku.Pause),a),vu(`seeked`,o(Ku.Seeked),a),vu(`volumechange`,o(Ku.VolumeChange),a),vu(`ratechange`,o(Ku.RateChange),a)];return V(()=>{s.forEach(e=>e())})}function wd({fontCb:e,doc:t}){let n=t.defaultView;if(!n)return()=>{};let r=[],i=new WeakMap,a=n.FontFace;n.FontFace=function(e,t,n){let r=new a(e,t,n);return i.set(r,{family:e,buffer:typeof t!=`string`,descriptors:n,fontSource:typeof t==`string`?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};let o=Cu(t.fonts,`add`,function(t){return function(n){return setTimeout(V(()=>{let t=i.get(n);t&&(e(t),i.delete(n))}),0),t.apply(this,[n])}});return r.push(()=>{n.FontFace=a}),r.push(o),V(()=>{r.forEach(e=>e())})}function Td(e){let{doc:t,mirror:n,blockClass:r,blockSelector:i,selectionCb:a}=e,o=!0,s=V(()=>{let e=t.getSelection();if(!e||o&&e?.isCollapsed)return;o=e.isCollapsed||!1;let s=[],c=e.rangeCount||0;for(let t=0;t<c;t++){let{startContainer:a,startOffset:o,endContainer:c,endOffset:l}=e.getRangeAt(t);ku(a,r,i,!0)||ku(c,r,i,!0)||s.push({start:n.getId(a),startOffset:o,end:n.getId(c),endOffset:l})}a({ranges:s})});return s(),vu(`selectionchange`,s)}function Ed({doc:e,customElementCb:t}){let n=e.defaultView;return!n||!n.customElements?()=>{}:Cu(n.customElements,`define`,function(e){return function(n,r,i){try{t({define:{name:n}})}catch{console.warn(`Custom element callback failed for ${n}`)}return e.apply(this,[n,r,i])}})}function Dd(e,t){let{mutationCb:n,mousemoveCb:r,mouseInteractionCb:i,scrollCb:a,viewportResizeCb:o,inputCb:s,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:u,canvasMutationCb:d,fontCb:f,selectionCb:p,customElementCb:m}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),i(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),a(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),o(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),s(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),c(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),l(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),u(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),d(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),f(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)}
189,e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),m(...e)}}function Od(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};Dd(e,t);let r;e.recordDOM&&(r=ud(e,e.doc));let i=dd(e),a=fd(e),o=pd(e),s=md(e,{win:n}),c=_d(e),l=Cd(e),u=()=>{},d=()=>{},f=()=>{},p=()=>{};e.recordDOM&&(u=bd(e,{win:n}),d=xd(e,e.doc),f=Sd(e,{win:n}),e.collectFonts&&(p=wd(e)));let m=Td(e),h=Ed(e),g=[];for(let t of e.plugins)g.push(t.observer(t.callback,n,t.options));return V(()=>{cd.forEach(e=>e.reset()),r?.disconnect(),i(),a(),o(),s(),c(),l(),u(),d(),f(),p(),m(),h(),g.forEach(e=>e())})}function kd(e){return window[e]!==void 0}function Ad(e){return!!(window[e]!==void 0&&window[e].prototype&&`insertRule`in window[e].prototype&&`deleteRule`in window[e].prototype)}for(var jd=class{constructor(e){P(this,`iframeIdToRemoteIdMap`,new WeakMap),P(this,`iframeRemoteIdToIdMap`,new WeakMap),this.generateIdFn=e}getId(e,t,n,r){let i=n||this.getIdToRemoteIdMap(e),a=r||this.getRemoteIdToIdMap(e),o=i.get(t);return o||(o=this.generateIdFn(),i.set(t,o),a.set(o,t)),o}getIds(e,t){let n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}
vendor: 4,107 bytes, line 189
189getRemoteId(e,t,n){let r=n||this.getRemoteIdToIdMap(e);return typeof t==`number`?r.get(t)||-1:t}getRemoteIds(e,t){let n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}},Md=class{constructor(e){P(this,`iframes`,new WeakMap),P(this,`crossOriginIframeMap`,new WeakMap),P(this,`crossOriginIframeMirror`,new jd(no)),P(this,`crossOriginIframeStyleMirror`),P(this,`crossOriginIframeRootIdMap`,new WeakMap),P(this,`mirror`),P(this,`mutationCb`),P(this,`wrappedEmit`),P(this,`loadListener`),P(this,`stylesheetManager`),P(this,`recordCrossOriginIframes`),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new jd(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener(`message`,this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((n=e.contentWindow)==null||n.addEventListener(`message`,this.handleMessage.bind(this))),(r=this.loadListener)==null||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){let t=e;if(t.data.type!==`rrweb`||t.origin!==t.data.origin||!e.source)return;let n=this.crossOriginIframeMap.get(e.source);if(!n)return;let r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case z.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:z.IncrementalSnapshot,data:{source:B.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case z.Meta:case z.Load:case z.DomContentLoaded:return!1;case z.Plugin:return t;case z.Custom:return this.replaceIds(t.data.payload,e,[`id`,`parentId`,`previousId`,`nextId`]),t;case z.IncrementalSnapshot:switch(t.data.source){case B.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,[`parentId`,`nextId`,`previousId`]),this.replaceIdOnNode(t.node,e);let n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,[`parentId`,`id`])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,[`id`])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,[`id`])}),t;case B.Drag:case B.TouchMove:case B.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,[`id`])}),t;case B.ViewportResize:return!1;case B.MediaInteraction:case B.MouseInteraction:case B.Scroll:case B.CanvasMutation:case B.Input:return this.replaceIds(t.data,e,[`id`]),t;case B.StyleSheetRule:case B.StyleDeclaration:return this.replaceIds(t.data,e,[`id`]),this.replaceStyleIds(t.data,e,[`styleId`]),t;case B.Font:return t;case B.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,[`start`,`end`])}),t;case B.AdoptedStyleSheet:return this.replaceIds(t.data,e,[`id`]),this.replaceStyleIds(t.data,e,[`styleIds`]),(n=t.data.styles)==null||n.forEac
189h(t=>{this.replaceStyleIds(t,e,[`styleId`])}),t}}return!1}replace(e,t,n,r){for(let i of r)!Array.isArray(t[i])&&typeof t[i]!=`number`||(Array.isArray(t[i])?t[i]=e.getIds(n,t[i]):t[i]=e.getId(n,t[i]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,[`id`,`rootId`]),`childNodes`in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type!==qu.Document&&!e.rootId&&(e.rootId=t),`childNodes`in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}},Nd=class{constructor(e){P(this,`shadowDoms`,new WeakSet),P(this,`mutationCb`),P(this,`scrollCb`),P(this,`bypassOptions`),P(this,`mirror`),P(this,`restoreHandlers`,[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!Da(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);let n=ud({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(pd({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(R.host(e))),this.restoreHandlers.push(xd({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){let n=this;this.restoreHandlers.push(Cu(e.prototype,`attachShadow`,function(e){return function(r){let i=e.call(this,r),a=R.shadowRoot(this);return a&&Hu(this)&&n.addShadowRoot(a,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},Pd=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Fd=typeof Uint8Array>`u`?[]:new Uint8Array(256),Id=0;Id<Pd.length;Id++)Fd[Pd.charCodeAt(Id)]=Id;var Ld=function(e){var t=new Uint8Array(e),n,r=t.length,i=``;for(n=0;n<r;n+=3)i+=Pd[t[n]>>2],i+=Pd[(t[n]&3)<<4|t[n+1]>>4],i+=Pd[(t[n+1]&15)<<2|t[n+2]>>6],i+=Pd[t[n+2]&63];return r%3==2?i=i.substring(0,i.length-1)+`=`:r%3==1&&(i=i.substring(0,i.length-2)+`==`),i},Rd=new Map;function zd(e,t){let n=Rd.get(e);return n||(n=new Map,Rd.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}var Bd=(e,t,n)=>{if(!e||!(Ud(e,t)||typeof e==`object`))return;let r=e.constructor.name,i=zd(n,r),a=i.indexOf(e);return a===-1&&(a=i.length,i.push(e)),a};function Vd(e,t,n){if(e instanceof Array)return e.map(e=>Vd(e,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:Ld(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Vd(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}else if(e instanceof HTMLCanvasElement)return{rr_type:`HTMLImageElement`,src:e.toDataURL()};else if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Vd(e.data,t,n),e.width,e.height]};else if(Ud(e,t)||typeof e==`object`)return{rr_type:e.constructor.name,index:Bd(e,t,n)};return e}var Hd=(e,t,n)=>e.map(e=>Vd(e,t,n)),Ud=(e,t)=>!![`WebGLActiveInfo`,`WebGLBuffer`,`WebGLFramebuffer`,`WebGLProgram`,`WebGLRenderbuffer`,`WebGLShader`,`WebGLShaderPrecisionFormat`,`WebGLTexture`,`WebGLUniformLocation`,`WebGLVertexArrayObject`,`WebGLVertexArrayObjectOES`].filter(e=>typeof t[e]==`function`).find(n=>e instanceof t[n]);function Wd(e,t,n,r){let i=[],a=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let o of a)try{if(typeof t.CanvasRenderingContext2D.prototype[o]!=`function`)continue;let a=Cu(t.CanvasRenderingContext2D.prototype,o,function(i){return function(...a){return ku(this.canvas,n,r,!0)||setTimeout(()=>{let n=Hd(a,t,this);e(this.canvas,{type:Gu[`2D`],property:o,args:n})},0),i.apply(this,a)}});i.push(a)}catch{let n=Su(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:Gu[`2D`],property:o,args:[t],setter:!0})}});i.push(n)}return()=>
vendor: 5,522 bytes, lines 189-264
189{i.forEach(e=>e())}}function Gd(e){return e===`experimental-webgl`?`webgl`:e}function Kd(e,t,n,r){let i=[];try{let a=Cu(e.HTMLCanvasElement.prototype,`getContext`,function(e){return function(i,...a){if(!ku(this,t,n,!0)){let e=Gd(i);if(`__context`in this||(this.__context=e),r&&[`webgl`,`webgl2`].includes(e))if(a[0]&&typeof a[0]==`object`){let e=a[0];e.preserveDrawingBuffer||=!0}else a.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[i,...a])}});i.push(a)}catch{console.error(`failed to patch HTMLCanvasElement.prototype.getContext`)}return()=>{i.forEach(e=>e())}}function qd(e,t,n,r,i,a){let o=[],s=Object.getOwnPropertyNames(e);for(let c of s)if(![`isContextLost`,`canvas`,`drawingBufferWidth`,`drawingBufferHeight`].includes(c))try{if(typeof e[c]!=`function`)continue;let s=Cu(e,c,function(e){return function(...o){let s=e.apply(this,o);if(Bd(s,a,this),`tagName`in this.canvas&&!ku(this.canvas,r,i,!0)){let e=Hd(o,a,this),r={type:t,property:c,args:e};n(this.canvas,r)}return s}});o.push(s)}catch{let r=Su(e,c,{set(e){n(this.canvas,{type:t,property:c,args:[e],setter:!0})}});o.push(r)}return o}function Jd(e,t,n,r){let i=[];return i.push(...qd(t.WebGLRenderingContext.prototype,Gu.WebGL,e,n,r,t)),t.WebGL2RenderingContext!==void 0&&i.push(...qd(t.WebGL2RenderingContext.prototype,Gu.WebGL2,e,n,r,t)),()=>{i.forEach(e=>e())}}var Yd=`(function() {
190  "use strict";
191  var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
192  var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
193  for (var i = 0; i < chars.length; i++) {
194    lookup[chars.charCodeAt(i)] = i;
195  }
196  var encode = function(arraybuffer) {
197    var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";
198    for (i2 = 0; i2 < len; i2 += 3) {
199      base64 += chars[bytes[i2] >> 2];
200      base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];
201      base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];
202      base64 += chars[bytes[i2 + 2] & 63];
203    }
204    if (len % 3 === 2) {
205      base64 = base64.substring(0, base64.length - 1) + "=";
206    } else if (len % 3 === 1) {
207      base64 = base64.substring(0, base64.length - 2) + "==";
208    }
209    return base64;
210  };
211  const lastBlobMap = /* @__PURE__ */ new Map();
212  const transparentBlobMap = /* @__PURE__ */ new Map();
213  async function getTransparentBlobFor(width, height, dataURLOptions) {
214    const id = \`\${width}-\${height}\`;
215    if ("OffscreenCanvas" in globalThis) {
216      if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);
217      const offscreen = new OffscreenCanvas(width, height);
218      offscreen.getContext("2d");
219      const blob = await offscreen.convertToBlob(dataURLOptions);
220      const arrayBuffer = await blob.arrayBuffer();
221      const base64 = encode(arrayBuffer);
222      transparentBlobMap.set(id, base64);
223      return base64;
224    } else {
225      return "";
226    }
227  }
228  const worker = self;
229  worker.onmessage = async function(e) {
230    if ("OffscreenCanvas" in globalThis) {
231      const { id, bitmap, width, height, dataURLOptions } = e.data;
232      const transparentBase64 = getTransparentBlobFor(
233        width,
234        height,
235        dataURLOptions
236      );
237      const offscreen = new OffscreenCanvas(width, height);
238      const ctx = offscreen.getContext("2d");
239      ctx.drawImage(bitmap, 0, 0);
240      bitmap.close();
241      const blob = await offscreen.convertToBlob(dataURLOptions);
242      const type = blob.type;
243      const arrayBuffer = await blob.arrayBuffer();
244      const base64 = encode(arrayBuffer);
245      if (!lastBlobMap.has(id) && await transparentBase64 === base64) {
246        lastBlobMap.set(id, base64);
247        return worker.postMessage({ id });
248      }
249      if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });
250      worker.postMessage({
251        id,
252        type,
253        base64,
254        width,
255        height
256      });
257      lastBlobMap.set(id, base64);
258    } else {
259      return worker.postMessage({ id: e.data.id });
260    }
261  };
262})();
263//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map
264`,Xd=typeof self<`u`&&self.Blob&&new Blob([Yd],{type:`text/javascript;charset=utf-8`});function Zd(e){let t;try{if(t=Xd&&(self.URL||self.webkitURL).createObjectURL(Xd),!t)throw``;let n=new Worker(t,{name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(Yd),{name:e?.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var Qd=class{constructor(e){P(this,`pendingCanvasMutations`,new Map),P(this,`rafStamps`,{latestId:0,invokeId:null}),P(this,`mirror`),P(this,`mutationCb`),P(this,`resetObservers`),P(this,`frozen`,!1),P(this,`locked`,!1),P(this,`processMutation`,(e,t)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)});let{sampling:t=`all`,win:n,blockClass:r,blockSelector:i,recordCanvas:a,dataURLOptions:o}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,a&&t===`all`&&this.initCanvasMutationObserver(n,r,i),a&&typeof t==`number`&&this.initCanvasFPSObserver(t,n,r,i,{dataURLOptions:o})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}
264initCanvasFPSObserver(e,t,n,r,i){let a=Kd(t,n,r,!0),o=new Map,s=new Zd;s.onmessage=e=>{let{id:t}=e.data;if(o.set(t,!1),!(`base64`in e.data))return;let{base64:n,type:r,width:i,height:a}=e.data;this.mutationCb({id:t,type:Gu[`2D`],commands:[{property:`clearRect`,args:[0,0,i,a]},{property:`drawImage`,args:[{rr_type:`ImageBitmap`,args:[{rr_type:`Blob`,data:[{rr_type:`ArrayBuffer`,base64:n}],type:r}]},0,0]}]})};let c=1e3/e,l=0,u,d=()=>{let e=[];return t.document.querySelectorAll(`canvas`).forEach(t=>{ku(t,n,r,!0)||e.push(t)}),e},f=e=>{if(l&&e-l<c){u=requestAnimationFrame(f);return}l=e,d().forEach(async e=>{let t=this.mirror.getId(e);if(o.get(t)||e.width===0||e.height===0)return;if(o.set(t,!0),[`webgl`,`webgl2`].includes(e.__context)){let t=e.getContext(e.__context);t?.getContextAttributes()?.preserveDrawingBuffer===!1&&t.clear(t.COLOR_BUFFER_BIT)}let n=await createImageBitmap(e);s.postMessage({id:t,bitmap:n,width:e.width,height:e.height,dataURLOptions:i.dataURLOptions},[n])}),u=requestAnimationFrame(f)};u=requestAnimationFrame(f),this.resetObservers=()=>{a(),cancelAnimationFrame(u)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let r=Kd(e,t,n,!1),i=Wd(this.processMutation.bind(this),e,t,n),a=Jd(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{r(),i(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(e);if(!n||t===-1)return;let r=n.map(e=>{let{type:t,...n}=e;return n}),{type:i}=n[0];this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}},$d=class{constructor(e){P(this,`trackedLinkElements`,new WeakSet),P(this,`mutationCb`),P(this,`adoptedStyleSheetCb`),P(this,`styleMirror`,new Ru),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){`_cssText`in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;let n={id:t,styleIds:[]},r=[];for(let t of e){let e;if(this.styleMirror.has(t))e=this.styleMirror.getId(t);else{e=this.styleMirror.add(t);let n=[];try{n=Array.from(t.cssRules,(e,n)=>({rule:ja(e,t.href),index:n}))}catch(e){if(!(e instanceof DOMException&&e.name===`SecurityError`))throw e}r.push({styleId:e,rules:n})}n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},ef=class{constructor(){P(this,`nodeMap`,new WeakMap),P(this,`active`,!1)}inOtherBuffer(e,t){let n=this.nodeMap.get(e);return n&&Array.from(n).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}},tf,nf,rf,af=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement(`iframe`);document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug(`Unable to override Array.from`,e)}var of=Ia();function sf(e={}){let{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:i=`rr-block`,blockSelector:a=null,ignoreClass:o=`rr-ignore`,ignoreSelector:s=null,maskTextClass:c=`rr-mask`,maskTextSelector:l=null,inlineStylesheet:u=!0,maskAllInputs:d,maskInputOptions:f,slimDOMOptions:p,maskInputFn:m,maskTextFn:h,maskAttributeFn:g,hooks:_,packFn:v,sampling:y={},dataURLOptions:b={},mousemoveWait:x,recordDOM:S=!0,recordCanvas:C=!1,recordCrossOriginIframes:w=!1,recordAfter:T=e.recordAfter===`DOMContentLoaded`?e.recordAfter:`load`,userTriggeredOnInput:E=!1,collectFonts:D=!1,inl
264ineImages:O=!1,captureAdoptedStyleSheets:k=!0,plugins:A,keepIframeSrcFn:ee=()=>!1,ignoreCSSAttributes:te=new Set([]),errorHandler:j,applyBackgroundColorToBlockedElements:ne=!1}=e;ad(j);let re=!w||window.parent===window,ie=!1;if(!re)try{window.parent.document&&(ie=!1)}catch{ie=!0}if(re&&!t)throw Error(`emit function is required`);if(!re&&!ie)return()=>{};x!==void 0&&y.mousemove===void 0&&(y.mousemove=x),of.reset();let ae=d===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:f===void 0?{password:!0}:f,oe=p===!0||p===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:p===`all`,headMetaDescKeywords:p===`all`,headTitleMutations:p===`all`}:p||{};Pu();let se,ce=0,le=e=>{for(let t of A||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&!ie&&(e=v(e)),e};tf=(e,i)=>{let a=e;if(a.timestamp=wu(),cd[0]?.isFrozen()&&a.type!==z.FullSnapshot&&!(a.type===z.IncrementalSnapshot&&a.data.source===B.Mutation)&&cd.forEach(e=>e.unfreeze()),re)t?.(le(a),i);else if(ie){let e={type:`rrweb`,event:le(a),origin:window.location.origin,isCheckout:i};window.parent.postMessage(e,`*`)}if(a.type===z.FullSnapshot)se=a,ce=0;else if(a.type===z.IncrementalSnapshot){if(a.data.source===B.Mutation&&a.data.isAttachIframe)return;ce++;let e=r&&ce>=r,t=n&&a.timestamp-se.timestamp>n;(e||t)&&nf(!0)}};let ue=e=>{tf({type:z.IncrementalSnapshot,data:{source:B.Mutation,...e}})},de=e=>tf({type:z.IncrementalSnapshot,data:{source:B.Scroll,...e}}),fe=e=>tf({type:z.IncrementalSnapshot,data:{source:B.CanvasMutation,...e}}),pe=new $d({mutationCb:ue,adoptedStyleSheetCb:e=>tf({type:z.IncrementalSnapshot,data:{source:B.AdoptedStyleSheet,...e}})}),me=new Md({mirror:of,mutationCb:ue,stylesheetManager:pe,recordCrossOriginIframes:w,wrappedEmit:tf});for(let e of A||[])e.getMirror&&e.getMirror({nodeMirror:of,crossOriginIframeMirror:me.crossOriginIframeMirror,crossOriginIframeStyleMirror:me.crossOriginIframeStyleMirror});let he=new ef;rf=new Qd({recordCanvas:C,mutationCb:fe,win:window,blockClass:i,blockSelector:a,mirror:of,sampling:y.canvas,dataURLOptions:b});let ge=new Nd({mutationCb:ue,scrollCb:de,bypassOptions:{blockClass:i,blockSelector:a,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskInputOptions:ae,dataURLOptions:b,maskTextFn:h,maskInputFn:m,maskAttributeFn:g,recordCanvas:C,inlineImages:O,sampling:y,slimDOMOptions:oe,iframeManager:me,stylesheetManager:pe,canvasManager:rf,keepIframeSrcFn:ee,processedNodeManager:he},mirror:of});nf=(e=!1)=>{if(!S)return;tf({type:z.Meta,data:{href:window.location.href,width:Du(),height:Eu()}},e),pe.reset(),ge.init(),cd.forEach(e=>e.lock());let t=Oo(document,{mirror:of,blockClass:i,blockSelector:a,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskAllInputs:ae,maskTextFn:h,maskInputFn:m,maskAttributeFn:g,slimDOM:oe,dataURLOptions:b,recordCanvas:C,inlineImages:O,applyBackgroundColorToBlockedElements:ne,onSerialize:e=>{Fu(e,of)&&me.addIframe(e),Iu(e,of)&&pe.trackLinkElement(e),Lu(e)&&ge.addShadowRoot(R.shadowRoot(e),document)},onAdoptedStyleSheet:k?e=>pe.styleMirror.add(e):void 0,onIframeLoad:(e,t)=>{me.attachIframe(e,t),ge.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{pe.attachLinkElement(e,t)},keepIframeSrcFn:ee});if(!t)return console.warn(`Failed to snapshot the document`);tf({type:z.FullSnapshot,data:{node:t,initialOffset:Tu(window)}},e),cd.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&pe.adoptStyleSheets(document.adoptedStyleSheets,of.getId(document))};try{let e=[],t=e=>V(Od)({mutationCb:ue,mousemoveCb:(e,t)=>tf({type:z.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>tf({type:z.IncrementalSnapshot,data:{source:B.MouseInteraction,...e}}),scrollCb:de,viewportResizeCb:e=>tf({type:z.IncrementalSnapshot,data:{source:B.ViewportResize,...e}}),inputCb:e=>tf({type:z.IncrementalSnapshot,data:{source:B.Input,...e}}),mediaInteractionCb:e=>tf({type:z.IncrementalSnapshot,data:{source:B.MediaInteraction,...e}}),styleSheetRuleCb:e=>tf({type:z.IncrementalSnapshot,data:{source:B.StyleSheetRule,...e}}),styleDeclarationCb:e=>tf({type:z.IncrementalSnapshot,data:{source:B.StyleDeclaration,...e}}),canvasMutationCb:fe,fontCb:e=>tf({type:z.IncrementalSnapshot,data:{source:B.Font,...e}}),selectionCb:e=>{tf({type:z.IncrementalSnapshot,data:{source:B.Selection,...e}})},customElementCb:e=>{tf({type:z.IncrementalSnapshot,data:{source:B.CustomElement,...e}})},blockClass:i,ignoreClass:o,ignoreSelector:s,maskTextClass:c,maskTextSelector:l,maskInputOptions:ae,inlineStylesheet:u,sampling:y,recordDOM:S,recordCanvas:C,inl
264ineImages:O,userTriggeredOnInput:E,collectFonts:D,doc:e,maskInputFn:m,maskTextFn:h,maskAttributeFn:g,keepIframeSrcFn:ee,blockSelector:a,slimDOMOptions:oe,dataURLOptions:b,mirror:of,iframeManager:me,stylesheetManager:pe,shadowDomManager:ge,processedNodeManager:he,canvasManager:rf,ignoreCSSAttributes:te,plugins:(A?.filter(e=>e.observer))?.map(e=>({observer:e.observer,options:e.options,callback:t=>tf({type:z.Plugin,data:{plugin:e.name,payload:t}})}))||[]},_);me.addLoadListener(n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}});let n=()=>{nf(),e.push(t(document)),af=!0};return document.readyState===`interactive`||document.readyState===`complete`?n():(e.push(vu(`DOMContentLoaded`,()=>{tf({type:z.DomContentLoaded,data:{}}),T===`DOMContentLoaded`&&n()})),e.push(vu(`load`,()=>{tf({type:z.Load,data:{}}),T===`load`&&n()},window))),()=>{e.forEach(e=>e()),he.destroy(),af=!1,od()}}catch(e){console.warn(e)}}sf.addCustomEvent=(e,t)=>{if(!af)throw Error(`please add custom event after start recording`);tf({type:z.Custom,data:{tag:e,payload:t}})},sf.freezePage=()=>{cd.forEach(e=>e.freeze())},sf.takeFullSnapshot=e=>{if(!af)throw Error(`please take full snapshot after start recording`);nf(e)},sf.mirror=of;var cf;(function(e){e[e.NotStarted=0]=`NotStarted`,e[e.Running=1]=`Running`,e[e.Stopped=2]=`Stopped`})(cf||={});var{addCustomEvent:lf}=sf,{freezePage:uf}=sf,{takeFullSnapshot:df}=sf,ff=function(e,t){return ff=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ff(e,t)};function pf(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);ff(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var H=function(){return H=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},H.apply(this,arguments)};function mf(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function U(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function W(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function G(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function K(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function q(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;
264r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var hf;(function(e){e.SET=`$set`,e.SET_ONCE=`$setOnce`,e.ADD=`$add`,e.APPEND=`$append`,e.PREPEND=`$prepend`,e.REMOVE=`$remove`,e.PREINSERT=`$preInsert`,e.POSTINSERT=`$postInsert`,e.UNSET=`$unset`,e.CLEAR_ALL=`$clearAll`})(hf||={});var gf;(function(e){e.IDENTIFY=`$identify`,e.GROUP_IDENTIFY=`$groupidentify`,e.REVENUE=`revenue_amount`})(gf||={});var _f=`$default_instance`,vf=`https://api2.amplitude.com/2/httpapi`,yf=`https://api.eu.amplitude.com/2/httpapi`,bf=`https://api2.amplitude.com/batch`,xf=`https://api.eu.amplitude.com/batch`,Sf;(function(e){e.Unknown=`unknown`,e.Skipped=`skipped`,e.Success=`success`,e.RateLimit=`rate_limit`,e.PayloadTooLarge=`payload_too_large`,e.Invalid=`invalid`,e.Failed=`failed`,e.Timeout=`Timeout`,e.SystemError=`SystemError`})(Sf||={});var J=function(){var e=`ampIntegrationContext`;if(typeof globalThis<`u`&&globalThis[e]!==void 0)return globalThis[e];if(typeof globalThis<`u`)return globalThis;if(typeof window<`u`)return window;if(typeof self<`u`)return self;if(typeof global<`u`)return global},Cf=function(e){return e?(e^Math.random()*16>>e/4).toString(16):`10000000-1000-4000-8000-100000000000`.replace(/[018]/g,Tf)},wf=q([],K(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,`0`)}),Tf=function(e){var t=J();if(!t?.crypto?.getRandomValues)return Cf(e);var n=t.crypto.getRandomValues(new Uint8Array(16));return n[6]=n[6]&15|64,n[8]=n[8]&63|128,q([],K(n.entries()),!1).map(function(e){var t=K(e,2),n=t[0],r=t[1];return[4,6,8,10].includes(n)?`-${wf[r]}`:wf[r]}).join(``)},Ef=function(e){return{promise:e||Promise.resolve()}},Df;(function(e){e[e.None=0]=`None`,e[e.Error=1]=`Error`,e[e.Warn=2]=`Warn`,e[e.Verbose=3]=`Verbose`,e[e.Debug=4]=`Debug`})(Df||={});var Of=`Amplitude Logger `,kf=function(){function e(){this.logLevel=Df.None}return e.prototype.disable=function(){this.logLevel=Df.None},e.prototype.enable=function(e){e===void 0&&(e=Df.Warn),this.logLevel=e},e.prototype.log=function(){var e=[...arguments];this.logLevel<Df.Verbose||console.log(`${Of}[Log]: ${e.join(` `)}`)},e.prototype.warn=function(){var e=[...arguments];this.logLevel<Df.Warn||console.warn(`${Of}[Warn]: ${e.join(` `)}`)},e.prototype.error=function(){var e=[...arguments];this.logLevel<Df.Error||console.error(`${Of}[Error]: ${e.join(` `)}`)},e.prototype.debug=function(){var e=[...arguments];this.logLevel<Df.Debug||console.log(`${Of}[Debug]: ${e.join(` `)}`)},e}(),Af=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:_f,logLevel:Df.Warn,loggerProvider:new kf,offline:!1,optOut:!1,serverUrl:vf,serverZone:`US`,useBatch:!1}},jf=function(){function e(e){this._optOut=!1;var t=Af();this.apiKey=e.apiKey,this.flushIntervalMillis=e.flushIntervalMillis??t.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||t.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||t.flushQueueSize,this.instanceName=e.instanceName||t.instanceName,this.loggerProvider=e.loggerProvider||t.loggerProvider,this.logLevel=e.logLevel??t.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=e.offline===void 0?t.offline:e.offline,this.optOut=e.optOut??t.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||t.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=e.useBatch??t.useBatch,this.loggerProvider.enable(this.logLevel);var n=Nf(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=n.serverZone,this.serverUrl=n.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),Mf=function(e,t){return e===`EU`?t?xf:yf:t?bf:vf},Nf=function(e,t,n){if(e===void 0&&(e=``),t===void 0&&(t=Af().serverZone),n===void 0&&(n=Af().useBatch),e)return{serverUrl:e,serverZone:void 0};var r=[`US`,`EU`].includes(t)?t:Af().serverZone;return{serverZone:r,serverUrl:Mf(r,n)}};(function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e})();function Pf(e){return e>=200&&e<300}var Ff=function(e){return e===void 0&&(e=0),(Error().stack||``).split(`
265`).slice(2+e).map(function(e){return e.trim()})},If=function(e,t,n,r,i){return i===void 0&&(i=null),function(){var a=[...arguments],o=n(),s=o.logger,c=o.logLevel;if(c&&c<Df.Debug||!c||!s)return e.apply(i,a);var l={type:`invoke public method`,name:t,args:a,stacktrace:Ff(1),time:{start:new Date().toISOString()},states:{}};r&&l.states&&(l.states.before=r());var u=e.apply(i,a);return u&&u.promise?u.promise.then(function(){r&&l.states&&(l.states.after=r()),l.time&&(l.time.end=new Date().toISOString()),s.debug(JSON.stringify(l,null,2))}):(r&&l.states&&(l.states.after=r()),l.time&&(l.time.end=new Date().toISOString()),s.debug(JSON.stringify(l,null,2))),u}},Lf=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:Rf(),platform:`Web`,os:void 0,deviceModel:void 0}},e}(),Rf=function(){return typeof navigator<`u`&&(navigator.languages&&navigator.languages[0]||navigator.language)||``},zf=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(function(t){e(t)}),this.queue=[])},e}(),Bf=function(){return Bf=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}
265,Bf.apply(this,arguments)};function Vf(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function Hf(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}var Uf=function(e,t){var n,r,i=[`string`,`number`,`boolean`,`undefined`],a=typeof e;if(a!==typeof t)return!1;try{for(var o=Vf(i),s=o.next();!s.done;s=o.next())if(s.value===a)return e===t}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}if(e==null&&t==null)return!0;if(e==null||t==null||e.length!==t.length)return!1;var c=Array.isArray(e),l=Array.isArray(t);if(c!==l)return!1;if(c&&l){for(var u=0;u<e.length;u++)if(!Uf(e[u],t[u]))return!1}else{if(!Uf(Object.keys(e).sort(),Object.keys(t).sort()))return!1;var d=!0;return Object.keys(e).forEach(function(n){Uf(e[n],t[n])||(d=!1)}),d}return!0},Wf=`$set`,Gf=`$unset`,Kf=`$clearAll`;Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),n=t.length,r=Array(n);n--;)r[n]=[t[n],e[t[n]]];return r});var qf=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=Bf({},this.identity.userProperties),n=Bf(Bf({},this.identity),{userProperties:t});return{setUserId:function(e){return n.userId=e,this},setDeviceId:function(e){return n.deviceId=e,this},setUserProperties:function(e){return n.userProperties=e,this},setOptOut:function(e){return n.optOut=e,this},updateUserProperties:function(e){var t,r,i,a,o,s,c=n.userProperties||{};try{for(var l=Vf(Object.entries(e)),u=l.next();!u.done;u=l.next()){var d=Hf(u.value,2),f=d[0],p=d[1];switch(f){case Wf:try{for(var m=(i=void 0,Vf(Object.entries(p))),h=m.next();!h.done;h=m.next()){var g=Hf(h.value,2),_=g[0],v=g[1];c[_]=v}}catch(e){i={error:e}}finally{try{h&&!h.done&&(a=m.return)&&a.call(m)}finally{if(i)throw i.error}}break;case Gf:try{for(var y=(o=void 0,Vf(Object.keys(p))),b=y.next();!b.done;b=y.next()){var _=b.value;delete c[_]}}catch(e){o={error:e}}finally{try{b&&!b.done&&(s=y.return)&&s.call(y)}finally{if(o)throw o.error}}break;case Kf:c={};break}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return n.userProperties=c,this},commit:function(){return e.setIdentity(n),this}}},e.prototype.getIdentity=function(){return Bf({},this.identity)},e.prototype.setIdentity=function(e){var t=Bf({},this.identity);this.identity=Bf({},e),Uf(t,this.identity)||this.listeners.forEach(function(t){t(e)})},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),Jf=typeof globalThis<`u`?globalThis:typeof global<`u`?global:self,Yf=function(){function e(){this.identityStore=new qf,this.eventBridge=new zf,this.applicationContextProvider=new Lf}return e.getInstance=function(t){return Jf.analyticsConnectorInstances||={},Jf.analyticsConnectorInstances[t]||(Jf.analyticsConnectorInstances[t]=new e),Jf.analyticsConnectorInstances[t]},e}(),Xf=function(e){return e===void 0&&(e=_f),Yf.getInstance(e)},Zf=function(e){var t=0;if(e.length===0)return t;for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);t=(t<<5)-t+r,t|=0}return t},Qf=function(){function e(){}return e.prototype.send=function(e,t,n){return Promise.resolve(null)},e.prototype.buildResponse=function(e){if(typeof e!=`object`)return null;var t=e.code||0,n=this.buildStatus(t);switch(n){case Sf.Success:return{status:n,statusCode:t,body:{eventsIngested:e.events_ingested??0,payloadSizeBytes:e.payload_size_bytes??0,serverUploadTime:e.server_upload_time??0}};case Sf.Invalid:return{status:n,statusCode:t,body:{error:e.error??``,missingField:e.missing_field??``,eventsWithInvalidFields:e.events_with_invali
265d_fields??{},eventsWithMissingFields:e.events_with_missing_fields??{},eventsWithInvalidIdLengths:e.events_with_invalid_id_lengths??{},epsThreshold:e.eps_threshold??0,exceededDailyQuotaDevices:e.exceeded_daily_quota_devices??{},silencedDevices:e.silenced_devices??[],silencedEvents:e.silenced_events??[],throttledDevices:e.throttled_devices??{},throttledEvents:e.throttled_events??[]}};case Sf.PayloadTooLarge:return{status:n,statusCode:t,body:{error:e.error??``}};case Sf.RateLimit:return{status:n,statusCode:t,body:{error:e.error??``,epsThreshold:e.eps_threshold??0,throttledDevices:e.throttled_devices??{},throttledUsers:e.throttled_users??{},exceededDailyQuotaDevices:e.exceeded_daily_quota_devices??{},exceededDailyQuotaUsers:e.exceeded_daily_quota_users??{},throttledEvents:e.throttled_events??[]}};case Sf.Timeout:default:return{status:n,statusCode:t}}},e.prototype.buildStatus=function(e){return Pf(e)?Sf.Success:e===429?Sf.RateLimit:e===413?Sf.PayloadTooLarge:e===408?Sf.Timeout:e>=400&&e<500?Sf.Invalid:e>=500?Sf.Failed:Sf.Unknown},e}(),$f=function(e){pf(t,e);function t(t){t===void 0&&(t={});var n=e.call(this)||this;return n.customHeaders=t,n}return t.prototype.send=function(e,t){return U(this,void 0,void 0,function(){var n,r,i;return W(this,function(a){switch(a.label){case 0:if(typeof fetch>`u`)throw Error(`FetchTransport is not supported`);return n={headers:H({"Content-Type":`application/json`,Accept:`*/*`},this.customHeaders),body:JSON.stringify(t),method:`POST`},[4,fetch(e,n)];case 1:return r=a.sent(),[4,r.text()];case 2:i=a.sent();try{return[2,this.buildResponse(JSON.parse(i))]}catch{return[2,this.buildResponse({code:r.status})]}return[2]}})})},t}(Qf),ep=function(){function e(e,t){this.key=`AMP_remote_config_${e.substring(0,10)}`,this.logger=t}return e.prototype.fetchConfig=function(){var e=null,t={remoteConfig:null,lastFetch:new Date};try{e=localStorage.getItem(this.key)}catch(e){return this.logger.debug(`Remote config localstorage failed to access: `,e),Promise.resolve(t)}if(e===null)return this.logger.debug(`Remote config localstorage gets null because the key does not exist`),Promise.resolve(t);try{var n=JSON.parse(e);return this.logger.debug(`Remote config localstorage parsed successfully: ${JSON.stringify(n)}`),Promise.resolve({remoteConfig:n.remoteConfig,lastFetch:new Date(n.lastFetch)})}catch(e){return this.logger.debug(`Remote config localstorage failed to parse: `,e),localStorage.removeItem(this.key),Promise.resolve(t)}},e.prototype.setConfig=function(e){try{return localStorage.setItem(this.key,JSON.stringify(e)),this.logger.debug(`Remote config localstorage set successfully.`),Promise.resolve(!0)}catch(e){this.logger.debug(`Remote config localstorage failed to set: `,e)}return Promise.resolve(!1)},e}();function tp(e,t){return new Promise(function(n,r){var i=function(){var e=Error(`Remote config custom fetch aborted by timeout`);e.name=`AbortError`,r(e)};t.addEventListener(`abort`,i,{once:!0}),e.then(function(e){t.removeEventListener(`abort`,i),n(e)},function(e){t.removeEventListener(`abort`,i),r(e)})})}var np={INVALID_API_KEY:401,FORBIDDEN:403,RATE_LIMIT:429},rp=1e3,ip=300*1e3,ap=function(){function e(e,t,n,r,i){n===void 0&&(n=`US`),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.isLastFetchInvalidApiKey=!1,this.apiKey=e,this.serverUrl=r||(n===`US`?`https://sr-client-cfg.amplitude.com/config`:`https://sr-client-cfg.eu.amplitude.com/config`),this.logger=t,this.storage=new ep(e,t),this.customFetch=i}return e.prototype.subscribe=function(e,t,n){var r=Tf(),i={id:r,key:e,deliveryMode:t,callback:n};return this.callbackInfos.push(i),t===`all`?this.subscribeAll(i):this.subscribeWaitForRemote(i,t.timeout),r},e.prototype.unsubscribe=function(e){var t=this.callbackInfos.findIndex(function(t){return t.id===e});return t===-1?(this.logger.debug(`Remote config client unsubscribe failed because callback with id ${e} doesn't exist.`),!1):(this.callbackInfos.splice(t,1),this.logger.debug(`Remote config client unsubscribe succeeded removing callback with id ${e}.`),!0)},e.prototype.updateConfigs=function(){return U(this,void 0,void 0,function(){var e,t,n=this;return W(this,function(r){switch(r.label){case 0:return this.lastSuccessfulFetch&&(e=Date.now()-this.lastSuccessfulFetch,e<ip)?(this.logger.debug(`Remote config client skipping updateConfigs: Too recent`),[2]):[4,this.getOrCreateFetchPromise()];case 1:return t=r.sent(),this.storage.setConfig(t),this.callbackInfos.forEach(function(e){n.sendCallback(e,t,`remote`)}),[2]}})})},e.prototype.getOrCreateFetchPromise=function(){var e=this;return this.fetchPromise?this.fetchPromise:this.isLastFetchInvali
265dApiKey?(this.logger.debug(`Remote config client skipping fetch: Invalid API key`),this.fetchPromise=Promise.resolve({remoteConfig:null,lastFetch:new Date}).finally(function(){e.fetchPromise=null}),this.fetchPromise):(this.fetchPromise=this.fetch().then(function(t){return t.remoteConfig!==null&&(e.lastSuccessfulFetch=Date.now()),t}).finally(function(){e.fetchPromise=null}),this.fetchPromise)},e.prototype.subscribeAll=function(e){return U(this,void 0,void 0,function(){var t,n,r,i=this;return W(this,function(a){switch(a.label){case 0:return t=this.getOrCreateFetchPromise().then(function(t){i.logger.debug(`Remote config client subscription all mode fetched from remote: ${JSON.stringify(t)}`),i.sendCallback(e,t,`remote`),i.storage.setConfig(t)}),n=this.storage.fetchConfig().then(function(e){return e}),[4,Promise.race([t,n])];case 1:return r=a.sent(),r!==void 0&&(this.logger.debug(`Remote config client subscription all mode fetched from cache: ${JSON.stringify(r)}`),r.remoteConfig===null?this.logger.debug(`Remote config client skips sending c
265allback because cache is empty (first time user).`):this.sendCallback(e,r,`cache`)),[4,t];case 2:return a.sent(),[2]}})})},e.prototype.subscribeWaitForRemote=function(e,t){return U(this,void 0,void 0,function(){var n,r,r;return W(this,function(i){switch(i.label){case 0:n=new Promise(function(e,n){setTimeout(function(){n(`Timeout exceeded`)},t)}),i.label=1;case 1:return i.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),n])];case 2:return r=i.sent(),this.logger.debug(`Remote config client subscription wait for remote mode returns from remote.`),this.sendCallback(e,r,`remote`),this.storage.setConfig(r),[3,5];case 3:return i.sent(),this.logger.debug(`Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache.`),[4,this.storage.fetchConfig()];case 4:return r=i.sent(),r.remoteConfig===null?(this.logger.debug(`Remote config client subscription wait for remote mode failed to fetch cache.`),this.sendCallback(e,r,`remote`)):(this.logger.debug(`Remote config client subscription wait for remote mode returns a cached copy.`),this.sendCallback(e,r,`cache`)),[3,5];case 5:return[2]}})})},e.prototype.sendCallback=function(e,t,n){e.lastCallback=new Date;var r=e.key?e.key.split(`.`).reduce(function(e,t){return e===null?e:t in e?e[t]:null},t.remoteConfig):t.remoteConfig;e.callback(r,n,t.lastFetch)},e.prototype.fetch=function(e,t){return e===void 0&&(e=3),t===void 0&&(t=rp),U(this,void 0,void 0,function(){var n,r,i,a,o,s,c=this;return W(this,function(l){switch(l.label){case 0:n=t/e,r={remoteConfig:null,lastFetch:new Date},i=function(r){var i,o,s,l,u,d,f,p,m,h,g;return W(this,function(_){switch(_.label){case 0:i=!0,o=new AbortController,s=setTimeout(function(){return o.abort()},t),_.label=1;case 1:return _.trys.push([1,10,11,12]),l=a.getUrlParams(),u={Accept:`*/*`},a.customFetch?[4,tp(a.customFetch({url:l,method:`GET`,headers:u,signal:o.signal}),o.signal)]:[3,3];case 2:return f=_.sent(),[3,5];case 3:return[4,fetch(l,{method:`GET`,headers:u,signal:o.signal})];case 4:f=_.sent(),_.label=5;case 5:return d=f,p=d.ok||d.status>=200&&d.status<300,p?[3,7]:[4,d.text()];case 6:return m=_.sent(),a.logger.debug(`Remote config client fetch with retry time ${e} failed with ${d.status}: ${m}`),d.status===np.INVALID_API_KEY||d.status===np.FORBIDDEN?(a.logger.error(`Remote config client fetch failed with ${d.status}. Invalid API key; future fetches will be skipped.`),a.isLastFetchInvalidApiKey=!0,i=!1):d.status>=400&&d.status<500&&d.status!==np.RATE_LIMIT&&(i=!1),[3,9];case 7:return[4,d.json()];case 8:return h=_.sent(),[2,{value:{remoteConfig:h,lastFetch:new Date}}];case 9:return[3,12];case 10:return g=_.sent(),g instanceof Error&&g.name===`AbortError`?a.logger.debug(`Remote config client fetch with retry time ${e} timed out after ${t}ms`):a.logger.debug(`Remote config client fetch with retry time ${e} is rejected because: `,g),[3,12];case 11:return clearTimeout(s),[7];case 12:return i?r<e-1?[4,new Promise(function(e){return setTimeout(e,c.getJitterDelay(n))})]:[3,14]:[2,`break`];case 13:_.sent(),_.label=14;case 14:return[2]}})},a=this,o=0,l.label=1;case 1:return o<e?[5,i(o)]:[3,4];case 2:if(s=l.sent(),typeof s==`object`)return[2,s.value];if(s===`break`)return[3,4];l.label=3;case 3:return o++,[3,1];case 4:return[2,r]}})})},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),n=new URLSearchParams;return n.append(`config_group`,e.CONFIG_GROUP),`${this.serverUrl}/${t}?${n.toString()}`},e.CONFIG_GROUP=`browser`,e}(),op;(function(e){e.US=`US`,e.EU=`EU`,e.STAGING=`STAGING`})(op||={});function sp(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e==null}function cp(e,t,n){e&&lp({json:e,allowlist:t.map(up),excludelist:n.map(up),ancestors:[]})}function lp(e){var t,n,r=e.json,i=e.targetObject,a=e.allowlist,o=e.excludelist,s=e.ancestors,c=e.parentObject,l=e.targetKey;i||=r;var u=Object.keys(i);try{for(var d=G(u),f=d.next();!f.done;f=d.next()){var p=f.value,m=q(q([],K(s),!1),[p],!1);sp(i[p])?(!fp(m,a)||fp(m,o))&&delete i[p]:lp({json:r,targetObject:i[p],allowlist:a,excludelist:o,ancestors:m,parentObject:i,targetKey:p})}}catch(e){t={error:e}}finally{try{f&&!f.done&&(n=d.return)&&n.call(d)}finally{if(t)throw t.error}}
265Object.keys(i).length===0&&c&&l&&delete c[l]}function up(e){return e.startsWith(`/`)&&(e=e.slice(1)),e.split(`/`).map(function(e){return e.replace(/~0/g,`~`).replace(/~1/g,`/`)})}function dp(e,t,n,r){if(n===void 0&&(n=0),r===void 0&&(r=0),r===t.length)return n===e.length;if(n===e.length){for(;r<t.length&&t[r]===`**`;)r++;return r===t.length}var i=t[r];if(i===`**`){if(r+1===t.length)return!0;for(var a=n;a<=e.length;a++)if(dp(e,t,a,r+1))return!0;return!1}else if(i===`*`||i===e[n])return dp(e,t,n+1,r+1);else return!1}function fp(e,t){return t.some(function(t){return dp(e,t)})}var pp=`https://app.amplitude.com`,mp={US:pp,EU:`https://app.eu.amplitude.com`,STAGING:`https://apps.stag2.amplitude.com`},hp=`https://cdn.amplitude.com/libs/background-capture-1.0.3.js.gz`,gp=function(e){return document.querySelector(`script[src="${CSS.escape(e)}"]`)?Promise.resolve({status:!0}):new Promise(function(t,n){var r;try{var i=document.createElement(`script`);i.type=`text/javascript`,i.async=!0,i.src=e,i.addEventListener(`load`,function(){t({status:!0})},{once:!0}),i.addEventListener(`error`,function(){n({status:!1,message:`Failed to load the script ${e}`})}),(r=document.head)==null||r.appendChild(i)}catch(e){n(e)}})};function _p(){return`${Date.now()}-${Math.random().toString(36).substr(2,9)}`}var vp,yp=`__AMPLITUDE_MESSENGER_INSTANCE__`,bp=`__AMPLITUDE_MESSENGER__`,xp=function(){function e(e){var t=(e===void 0?{}:e).origin,n=t===void 0?pp:t;this[vp]=!0,this.isSetup=!1,this.messageHandler=null,this.requestCallbacks={},this.actionHandlers=new Map,this.pendingMessages=new Map,this.scriptLoadPromises=new Map,this.endpoint=n}return e.prototype.notify=function(e){var t,n,r,i;(n=(t=this.logger)?.debug)==null||n.call(t,`Message sent: `,JSON.stringify(e)),(i=(r=window.opener)?.postMessage)==null||i.call(r,e,this.endpoint)},e.prototype.sendRequest=function(e,t,n){var r=this;n===void 0&&(n={timeout:15e3});var i=_p(),a={id:i,action:e,args:t};return new Promise(function(t,o){r.requestCallbacks[i]={resolve:t,reject:o},r.notify(a),n.timeout>0&&setTimeout(function(){o(Error(`${e} timed out (id: ${i})`)),delete r.requestCallbacks[i]},n.timeout)})},e.prototype.handleResponse=function(e){var t;if(!this.requestCallbacks[e.id]){(t=this.logger)==null||t.warn(`No callback found for request id: ${e.id}`);return}this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]},e.prototype.registerActionHandler=function(e,t){var n,r,i,a;this.actionHandlers.has(e)&&((a=(i=this.logger)?.warn)==null||a.call(i,`Overwriting existing action handler for: ${e}`)),this.actionHandlers.set(e,t);var o=this.pendingMessages.get(e);if(o){this.pendingMessages.delete(e);try{for(var s=G(o),c=s.next();!c.done;c=s.next()){var l=c.value;t(l)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}}},e.prototype.loadScriptOnce=function(e){return U(this,void 0,void 0,function(){var t,n,r;return W(this,function(i){switch(i.label){case 0:if(t=this.scriptLoadPromises.get(e),t)return[2,t];n=gp(e).then(function(){}),this.scriptLoadPromises.set(e,n),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n];case 2:return i.sent(),[3,4];case 3:throw r=i.sent(),this.scriptLoadPromises.delete(e),r;case 4:return[2]}})})},e.prototype.setup=function(e){var t=this,n,r,i=e===void 0?{}:e,a=i.logger,o=i.endpoint;a&&(this.logger=a),o&&this.endpoint===`https://app.amplitude.com`&&(this.endpoint=o),!this.isSetup&&(this.isSetup=!0,(r=(n=this.logger)?.debug)==null||r.call(n,`Setting up messenger`),this.messageHandler=function(e){var n,r,i,a;if((r=(n=t.logger)?.debug)==null||r.call(n,`Message received: `,JSON.stringify(e)),t.endpoint===e.origin){var o=e.data,s=o?.action;if(s)if(`id`in o&&o.id)(a=(i=t.logger)?.debug)==null||a.call(i,`Received Response to previous request: `,JSON.stringify(e)),t.handleResponse(o);else{if(s===`ping`){t.notify({action:`pong`});return}var c=t.actionHandlers.get(s);if(c)c(o.data);else{var l=t.pendingMessages.get(s)??[];l.push(o.data),t.pendingMessages.set(s,l)}}}},window.addEventListener(`message`,this.messageHandler),this.notify({action:`page-loaded`}))},e.prototype.destroy=function(){this.messageHandler&&=(window.removeEventListener(`message`,this.messageHandler),null),this.isSetup=!1,this.actionHandlers.clear(),this.pendingMessages.clear(),this.requestCallbacks={},this.scriptLoadPromises.clear();var e=J();e?.[bp]===this&&delete e[bp]},e}();vp=yp;function Sp(e){return typeof e==`object`&&!!e&&yp in e&&e[yp]===!0}function Cp(e){var t=J(),n=t?.[bp];if(Sp(n))return n;var r=new xp(e);return t&&(t[bp]=r),r}var wp=`__AMPLITUDE_BACKGROUND_CAPTURE__`;function Tp(e,t){var n=e;if(n[wp]!==!0){n[wp]=!0;var r=t?.scriptUrl??hp,i=null,a=function(t,n){var r,i;t===`background-capture-complete`&&((i=(r=e.logger)?.debug)==null||i.call(r,`Backgroun
265d capture complete`),e.notify({action:`background-capture-complete`,data:n}))};e.registerActionHandler(`initialize-background-capture`,function(){var t,n;(n=(t=e.logger)?.debug)==null||n.call(t,`Initializing background capture (external script)`);var o=new URL(r,e.endpoint).toString();e.loadScriptOnce(o).then(function(){var t,n;(n=(t=e.logger)?.debug)==null||n.call(t,`Background capture script loaded (external)`),i=(window==null?void 0:window.amplitudeBackgroundCapture)?.call(window,{messenger:e,onBackgroundCapture:a}),e.notify({action:`background-capture-loaded`})}).catch(function(){var t;(t=e.logger)==null||t.warn(`Failed to initialize background capture`)})}),e.registerActionHandler(`close-background-capture`,function(){var e;(e=i?.close)==null||e.call(i),i=null})}}var Ep=function(e){return e===void 0?!1:typeof e==`boolean`?e:e.enabled!==!1},Dp=function(e){return typeof e==`object`&&e?{allowlist:e.allowlist??[],excludelist:e.excludelist||e.blocklist||[]}:{allowlist:[],excludelist:[]}},Op=function(e,t,n){if(t.length===0&&n.length===0)return e;var r=t.length>0?t:[`/**`];try{var i=JSON.parse(e);return cp(i,r,n),JSON.stringify(i)}catch{return e}},kp=function(e,t,n,r){var i=Dp(t),a=i.allowlist,o=i.excludelist;return r(Op(e,a,o),n)},Ap=e({NetworkObservers:()=>Ip}),jp=10240,Mp=[`image/`,`audio/`,`video/`,`application/octet-stream`,`font/`];function Np(e){return e?Mp.some(function(t){return e.toLowerCase().startsWith(t)}):!1}function Pp(e){if(e!=null){if(typeof e==`string`)return e;if(e instanceof URLSearchParams)return e.toString();if(e instanceof FormData){var t=[];return e.forEach(function(e,n){t.push(`${n}=${typeof e==`string`?e:`[File]`}`)}),t.join(`&`)}}}function Fp(e,t){if(new Blob([e]).size<=t)return{value:e,truncated:!1};for(var n=0,r=Math.min(e.length,t);n<r;){var i=Math.ceil((n+r)/2);new Blob([e.slice(0,i)]).size<=t?n=i:r=i-1}return n>0&&e.charCodeAt(n-1)>=55296&&e.charCodeAt(n-1)<=56319&&--n,{value:e.slice(0,n),truncated:!0}}var Ip=function(){function e(){this.fetchObserver=null}return e.prototype.start=function(e,t){this.eventCallback=e,this.networkConfig=t,this.observeFetch()},e.prototype.stop=function(){var e;(e=this.fetchObserver)==null||e.call(this),this.fetchObserver=null,this.eventCallback=void 0,this.networkConfig=void 0},e.prototype.notifyEvent=function(e){var t;(t=this.eventCallback)==null||t.call(this,e)},e.prototype.observeFetch=function(){var e=this,t=J();if(t){var n=t.fetch;n&&(t.fetch=function(t,r){return U(e,void 0,void 0,function(){var e,i,a,o,s,c,l,u,d,f,p,l,m,h=this;return W(this,function(g){switch(g.label){case 0:e=Date.now(),i={timestamp:e,type:`fetch`,method:r?.method||`GET`,url:t.toString(),requestHeaders:r?.headers},a=this.networkConfig?.body,a&&Ep(a.request)&&(o=Pp(r?.body),o!==void 0&&(s=a.maxBodySizeBytes??jp,i.requestBody=kp(o,a.request,s,Fp).value)),g.label=1;case 1:return g.trys.push([1,3,,4]),[4,n(t,r)];case 2:return c=g.sent(),l=Date.now(),i.status=c.status,i.duration=l-e,u={},c.headers.forEach(function(e,t){u[t]=e}),i.responseHeaders=u,a&&Ep(a.response)?(d=u[`content-type`]||null,Np(d)?(i.responseBodyStatus=`skipped_binary`,this.notifyEvent(i)):(f=c.clone(),f.text().then(function(e){var t=a.maxBodySizeBytes??jp,n=kp(e,a.response,t,Fp),r=n.value,o=n.truncated;i.responseBody=r,i.responseBodyStatus=o?`truncated`:`captured`,h.notifyEvent(i)},function(){i.responseBodyStatus=`error`,h.notifyEvent(i)}))):this.notifyEvent(i),[2,c];case 3:throw p=g.sent(),l=Date.now(),i.duration=l-e,m=p,i.error={name:m.name||`UnknownError`,message:m.message||`An unknown error occurred`},this.notifyEvent(i),p;case 4:return[2]}})})},this.fetchObserver=function(){t.fetch=n})}},e}(),Lp=e({compressionScript:()=>Rp,trackDestinationScript:()=>zp}),Rp=`var WebWorker=function(e){"use strict";onmessage=function(e){var s="string"==typeof e.data?JSON.parse(e.data):e.data,t=s.event,a=s.sessionId,n=t.type,r=t.timestamp,i=t.delay,o=t.data,d=null!=i?JSON.stringify({type:n,timestamp:r,delay:i,data:o}):JSON.stringify({type:n,timestamp:r,data:o});postMessage({compressedEvent:d,sessionId:a})};var s=onmessage;
265return e.compressionOnMessage=s,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
266`,zp=`var WebWorker=function(e){"use strict";var t,r=function(){return r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},r.apply(this,arguments)};function n(e,t,r,n){return new(r||(r=Promise))(function(s,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function i(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,i)}u((n=n.apply(e,t||[])).next())})}function s(e,t){var r,n,s,o={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=i(0),a.throw=i(1),a.return=i(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,i[0]&&(o=0)),o;)try{if(r=1,n&&(s=2&i[0]?n.return:i[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,i[1])).done)return s;switch(n=0,s&&(i=[2&i[0],s.value]),i[0]){case 0:case 1:s=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(s=o.trys,(s=s.length>0&&s[s.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!s||i[1]>s[0]&&i[1]<s[3])){o.label=i[1];break}if(6===i[0]&&o.label<s[1]){o.label=s[1],s=i;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(i);break}s[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],n=0}finally{r=s=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}"function"==typeof SuppressedError&&SuppressedError,function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(t||(t={})),t.US;var o,a=/payload.*exceed/i,i="X-Session-Replay-Event-Skipped";!function(e){e.GET_SR_PROPS="get-sr-props",e.DEBUG_INFO="debug-info",e.FETCH_REQUEST="fetch-request",e.METADATA="metadata",e.TARGETING_DECISION="targeting-decision",e.REPLAY_GATE_DECISION="replay-gate-decision"}(o||(o={}));var u="Network error occurred, event batch rejected";function c(e,t){return n(this,void 0,void 0,function(){var r,o,a,i,u,c,l,d,p,f,v,y,h,b,g=this;return s(this,function(m){switch(m.label){case 0:return m.trys.push([0,4,,5]),r=t.CompressionStream,o=new r("gzip"),a=o.writable.getWriter(),i=o.readable.getReader(),u=[],c=n(g,void 0,void 0,function(){var e,t,r;return s(this,function(n){switch(n.label){case 0:return[4,i.read()];case 1:if(e=n.sent(),t=e.done,r=e.value,t)return[3,3];u.push(r),n.label=2;case 2:return[3,0];case 3:return[2]}})}),[4,a.write((new TextEncoder).encode(e))];case 1:return m.sent(),[4,a.close()];case 2:return m.sent(),[4,c];case 3:m.sent(),l=u.reduce(function(e,t){return e+t.length},0),d=new Uint8Array(l),p=0;try{for(f=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(u),v=f.next();!v.done;v=f.next())y=v.value,d.set(y,p),p+=y.length}catch(e){h={error:e}}finally{try{v&&!v.done&&(b=f.return)&&b.call(f)}finally{if(h)throw h.error}}return[2,d];case 4:return m.sent(),[2,null];case 5:return[2]}})})}var l=0,d=new Map,p=function(e,t){return fetch(e,t)},f=function(e,t){var r="".concat(++l);return new Promise(function(n,s){var o=t.signal,a=function(){d.delete(r);var e=new Error("Delegated session replay fetch aborted by send timeout");e.name="AbortError",s(e)};o.addEventListener("abort",a,{once:!0}),d.set(r,function(e){o.removeEventListener("abort",a),e.error?s(new Error(e.body)):n({status:e.status,headers:{get:function(t){return t===i?e.skipHeader:null}},text:function(){return Promise.resolve(e.body)}})}),postMessage({type:"fetch-request",requestId:r,url:e,method:"POST",headers:t.headers,body:t.body,keepalive:t.keepalive})})};function v(e,t,o){var l,d,p,f,v,y,h,b;return n(this,void 0,void 0,function(){var n,g,m,w,S,T,E,k,R,x,C,I,A,M,O;return s(this,function(s){switch(s.label){case 0:n=null!==(l=t.sendTimeoutMs)&&void 0!==l?l:1e4,s.label=1;case 1:return s.trys.push([1,14,,15]),!1!==t.enableTransportCompression&&"CompressionStream"in self?[4,c(e,self)]:[3,3];case 2:return m=s.sent(),[3,4];case 3:m=null,s.label=4;
266case 4:g=m,w="".concat(null!==(p=null===(d=t.version)||void 0===d?void 0:d.type)&&void 0!==p?p:"standalone","/").concat(null!==(v=null===(f=t.version)||void 0===f?void 0:f.version)&&void 0!==v?v:t.sdkVersion),S=new URLSearchParams({device_id:t.deviceId,session_id:"".concat(t.sessionId),type:t.eventType}),T="".concat((U=t.serverZone,P=t.trackServerUrl,P||("STAGING"===U?"https://api-sr.stag2.amplitude.com/sessions/v2/track":"EU"===U?"https://api-sr.eu.amplitude.com/sessions/v2/track":"https://api-sr.amplitude.com/sessions/v2/track")),"?").concat(S.toString()),E=r({"Content-Type":"application/json",Accept:"*/*",Authorization:"Bearer ".concat(t.apiKey),"X-Client-Version":t.sdkVersion,"X-Client-Library":w,"X-Client-Url":t.currentUrl.substring(0,1e3),"X-Client-Sample-Rate":"".concat(t.sampleRate),"X-Sampling-Hash-Alg":"xxhash32"},g?{"Content-Encoding":"gzip"}:{}),k=g?g.byteLength:new Blob([e]).size,R=new AbortController,x=n>0?setTimeout(function(){R.abort()},n):void 0,C=void 0,s.label=5;case 5:return s.trys.push([5,,7,8]),[4,o(T,{method:"POST",headers:E,body:null!=g?g:e,keepalive:k<=65536,signal:R.signal})];case 6:return C=s.sent(),[3,8];case 7:return x&&clearTimeout(x),[7];case 8:if(null===C)return[2,{shouldRetry:!1,success:!1,message:"Unexpected error occurred"}];if(C.status>=200&&C.status<300)return I=Math.round(new Blob(t.events).size/1024),A=null!==(b=null===(h=null===(y=C.headers)||void 0===y?void 0:y.get)||void 0===h?void 0:h.call(y,i))&&void 0!==b?b:null,[2,{shouldRetry:!1,success:!0,message:"Session replay event batch tracked successfully for session id ".concat(t.sessionId,", size of events: ").concat(I," KB"),skipCode:A}];if(413!==C.status)return[3,13];M="",s.label=9;case 9:return s.trys.push([9,11,,12]),[4,C.text()];case 10:return M=s.sent(),[3,12];case 11:return s.sent(),[3,12];case 12:return[2,{shouldRetry:!1,success:!1,message:u,payloadTooLarge:!0,isWaf:a.test(M)}];case 13:return C.status>=500||408===C.status||429===C.status||499===C.status?[2,{shouldRetry:!0,success:!1,message:"HTTP ".concat(C.status)}]:[2,{shouldRetry:!1,success:!1,message:u}];case 14:return(O=s.sent())&&"object"==typeof O&&"AbortError"===O.name?[2,{shouldRetry:!0,success:!1,message:"Session replay worker request timed out after ".concat(n,"ms")}]:[2,{shouldRetry:!1,success:!1,message:String(O)}];case 15:return[2]}var U,P})})}function y(e,t,r,o,a){var i;return n(this,void 0,void 0,function(){var n,u,c;return s(this,function(s){switch(s.label){case 0:n=1,s.label=1;case 1:return[4,v(t,r,a)];case 2:return(u=s.sent()).success?(postMessage({type:"log",id:e,message:u.message}),postMessage({type:"complete",id:e,skipCode:null!==(i=u.skipCode)&&void 0!==i?i:null}),[2]):u.payloadTooLarge&&o?(postMessage({type:"payload_too_large",id:e,isWaf:!0===u.isWaf}),[2]):o&&u.shouldRetry&&n<r.flushMaxRetries?[4,new Promise(function(e){return setTimeout(e,Math.random()*n*1e3)})]:[3,4];case 3:return s.sent(),n++,[3,5];case 4:return c=n>=r.flushMaxRetries?"Session replay event batch rejected due to exceeded retry count":u.message,postMessage({type:"warn",id:e,message:c}),postMessage({type:"complete",id:e}),[2];case 5:return[3,1];case 6:return[2]}})})}onmessage=function(e){return n(void 0,void 0,void 0,function(){var t,r,n,o,a,i,u,c;return s(this,function(s){switch(s.label){case 0:return"fetch-response"===(t=e.data).type?((r=d.get(t.requestId))&&(d.delete(t.requestId),r(t)),[2]):"send"!==t.type?[3,2]:(n=t.id,o=t.payload,a=t.context,i=t.useRetry,u=t.useCustomTransport,c=JSON.stringify(o),[4,y(n,c,a,i,u?f:p)]);case 1:s.sent(),s.label=2;case 2:return[2]}})})};var h=onmessage;return e.trackDestinationOnMessage=h,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
267`,Bp=function(){return Bp=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Bp.apply(this,arguments)};function Vp(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function Hp(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(
267o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}var Up=function(e,t){return Up=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Up(e,t)};function Wp(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);Up(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Gp=function(){return Gp=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Gp.apply(this,arguments)};function Kp(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function qp(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function Jp(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function Yp(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function Xp(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Y={IS:`is`,IS_NOT:`is not`,CONTAINS:`contains`,DOES_NOT_CONTAIN:`does not contain`,LESS_THAN:`less`,LESS_THAN_EQUALS:`less or equal`,GREATER_THAN:`greater`,GREATER_THAN_EQUALS:`greater or equal`,VERSION_LESS_THAN:`version less`,VERSION_LESS_THAN_EQUALS:`version less or equal`,VERSION_GREATER_THAN:`version greater`,VERSION_GREATER_THAN_EQUALS:`version greater or equal`,SET_IS:`set is`,SET_IS_NOT:`set is not`,SET_CONTAINS:`set contains`,SET_DOES_NOT_CONTAIN:`set does not contain`,SET_CONTAINS_ANY:`set contains any`,SET_DOES_NOT_CONTAIN_ANY:`set does not contain any`,REGEX_MATCH:`regex match`,REGEX_DOES_NOT_MATCH:`regex does not match`},Zp=function(e){for(var t=[],n=0,r=0;r<e.length;r++){var i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)==55296&&r+1<e.length&&(e.charCodeAt(r+1)&64512)==56320?(i=65536+((i&1023)<<10)+(e.charCodeAt(++r)&1023),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128)}return Uint8Array.from(t)},Qp=-862048943,$p=461845907,em=15,tm=13,nm=5,rm=-430675100,im=function(e,t){t===void 0&&(t=0);for(var n=Zp(e),r=n.length,i=r>>2,a=t,o=0;o<i;o++)a=am(cm(n,o<<2),a);var s=i<<2,c=0;switch(r-s){case 3:c^=n[s+2]<<16,c^=n[s+1]<<8,c^=n[s],c=Math.imul(c,Qp),c=sm(c,em),c=Math.imul(c,$p),a^=c;break;case 2:c^=n[s+1]<<8,c^=n[s],c=Math.imul(c,Qp),c=sm(c,em),c=Math.imul(c,$p),a^=c;break;case 1:c^=n[s],c=Math.imul(c,Qp),c=sm(c,em),c=Math.imul(c,$p),a^=c;break}return a^=r,om(a)>>>0},am=function(e,t){var n=e,r=t;return n=Math.imul(n,Qp),n=sm(n,em),n=Math.imul(n,$p),r^=n,r=sm(r,tm),r=Math.imul(r,nm),r+rm|0},om=function(e){var t=e;return t^=t>>>16,t=Math.imul(t,-2048144789),t^=t>>>
26713,t=Math.imul(t,-1028477387),t^=t>>>16,t},sm=function(e,t,n){n===void 0&&(n=32),t>n&&(t%=n);var r=(e&4294967295<<n-t>>>0)>>>0>>>n-t>>>0;return(e<<t|r)>>>0},cm=function(e,t){return t===void 0&&(t=0),lm(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])},lm=function(e){return(e&-16777216)>>>24|(e&16711680)>>>8|(e&65280)<<8|(e&255)<<24},um=function(e,t){var n,r;if(!(!t||t.length===0)){try{for(var i=Jp(t),a=i.next();!a.done;a=i.next()){var o=a.value;if(!o||!e||typeof e!=`object`)return;e=e[o]}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}if(e)return e}},dm=`^(\\d+)\\.(\\d+)(\\.(\\d+)(-(([-\\w]+\\.?)*))?)?$`,fm=function(){function e(e,t,n,r){r===void 0&&(r=void 0),this.major=e,this.minor=t,this.patch=n,this.preRelease=r}return e.parse=function(t){if(t){var n=new RegExp(dm).exec(t);if(n){var r=Number(n[1]),i=Number(n[2]);if(!(isNaN(r)||isNaN(i)))return new e(r,i,Number(n[4])||0,n[5]||void 0)}}},e.prototype.compareTo=function(e){return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:this.patch>e.patch?1:this.patch<e.patch||this.preRelease&&!e.preRelease?-1:!this.preRelease&&e.preRelease?1:this.preRelease&&e.preRelease?this.preRelease>e.preRelease?1:this.preRelease<e.preRelease?-1:0:0},e}(),pm=function(){function e(){}return e.prototype.evaluate=function(e,t){var n,r,i={},a={context:e,result:i};try{for(var o=Jp(t),s=o.next();!s.done;s=o.next()){var c=s.value,l=this.evaluateFlag(a,c);l&&(i[c.key]=l)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},e.prototype.evaluateFlag=function(e,t){var n,r,i;try{for(var a=Jp(t.segments),o=a.next();!o.done;o=a.next()){var s=o.value;if(i=this.evaluateSegment(e,t,s),i){var c=Gp(Gp(Gp({},t.metadata),s.metadata),i.metadata);i=Gp(Gp({},i),{metadata:c});break}}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},e.prototype.evaluateSegment=function(e,t,n){var r,i,a,o;if(!n.conditions){var s=this.bucket(e,n);return s===void 0?void 0:t.variants[s]}try{for(var c=Jp(n.conditions),l=c.next();!l.done;l=c.next()){var u=l.value,d=!0;try{for(var f=(a=void 0,Jp(u)),p=f.next();!p.done;p=f.next()){var m=p.value;if(d=this.matchCondition(e,m),!d)break}}catch(e){a={error:e}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(a)throw a.error}}if(d){var s=this.bucket(e,n);return s===void 0?void 0:t.variants[s]}}}catch(e){r={error:e}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}},e.prototype.matchCondition=function(e,t){var n=um(e,t.selector);if(!n)return this.matchNull(t.op,t.values);if(this.isSetOperator(t.op)){var r=this.coerceStringArray(n);return r?this.matchSet(r,t.op,t.values):!1}else{var i=this.coerceString(n);return i!==void 0&&this.matchString(i,t.op,t.values)}},e.prototype.getHash=function(e){return im(e)},e.prototype.bucket=function(e,t){var n,r,i,a;if(!t.bucket)return t.variant;var o=this.coerceString(um(e,t.bucket.selector));if(!o||o.length===0)return t.variant;var s=`${t.bucket.salt}/${o}`,c=this.getHash(s),l=c%100,u=Math.floor(c/100);try{for(var d=Jp(t.bucket.allocations),f=d.next();!f.done;f=d.next()){var p=f.value,m=p.range[0],h=p.range[1];if(l>=m&&l<h)try{for(var g=(i=void 0,Jp(p.distributions)),_=g.next();!_.done;_=g.next()){var v=_.value,y=v.range[0],b=v.range[1];if(u>=y&&u<b)return v.variant}}catch(e){i={error:e}}finally{try{_&&!_.done&&(a=g.return)&&a.call(g)}finally{if(i)throw i.error}}}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}return t.variant},e.prototype.matchNull=function(e,t){var n=this.containsNone(t);switch(e){case Y.IS:case Y.CONTAINS:case Y.LESS_THAN:case Y.LESS_THAN_EQUALS:case Y.GREATER_THAN:case Y.GREATER_THAN_EQUALS:case Y.VERSION_LESS_THAN:case Y.VERSION_LESS_THAN_EQUALS:case Y.VERSION_GREATER_THAN:case Y.VERSION_GREATER_THAN_EQUALS:case Y.SET_IS:case Y.SET_CONTAINS:case Y.SET_CONTAINS_ANY:return n;case Y.IS_NOT:case Y.DOES_NOT_CONTAIN:case Y.SET_DOES_NOT_CONTAIN:case Y.SET_DOES_NOT_CONTAIN_ANY:return!n;default:return!1}},e.prototype.matchSet=function(e,t,n){switch(t){case Y.SET_IS:return this.setEquals(e,n);case Y.SET_IS_NOT:return!this.setEquals(e,n);case Y.SET_CONTAINS:return this.matchesSetContainsAll(e,n);case Y.SET_DOES_NOT_CONTAIN:return!this.matchesSetContainsAll(e,n);case Y.SET_CONTAINS_ANY:return this.matchesSetContainsAny(e,n);case Y.SET_DOES_NOT_CONTAIN_ANY:return!this.matchesSetContainsAny(e,n);default:return!1}},e.prototype.matchString=function(e,t,n){var r=this;switch(t){case Y.IS:return this.matchesIs(e,n);case Y.IS_NOT:return!this.matchesIs(e,n);case Y.CONTAINS:return this.matchesContains(e,n);case Y.DOES_NOT_CONTAIN:return!this.matchesContains(e,n);case Y.LESS_THAN:case Y.LESS_THAN_EQUALS:case Y.GREATER_THAN:case Y.GREATER_THAN_EQUALS:return this.matchesComparable(e,t,n,function(e){return r.parseNumber(e)},this.comparator);case Y.VERSION_LESS_THAN:case Y.VERSION_LESS_THAN_EQUALS:case Y.VERSION_GREATER_THAN:case Y.VERSION_GREATER_THAN_EQUALS:return this.matchesComparable(e,t,n,function(e){return fm.parse(e)},this.versionComparator);case Y.REGEX_MATCH:return this.matchesRegex(e,n);case Y.REGEX_DOES_NOT_MATCH:return!this.matchesRegex(e,n);default:return!1}},e.prototype.matchesIs=function(e,t){if(this.containsBooleans(t)){var n=e.toLowerCase();if(n===`true`||n===`false`)return t.some(function(e){return e.toLowerCase()===n})}return t.some(function(t){return e===t})},e.prototype.matchesContains=function(e,t){var n,r;try{for(var i=Jp(t),a=i.next();!a.done;a=i.next()){var o=a.value;if(e.toLowerCase().includes(o.toLowerCase()))return!0}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!1},e.prototype.matchesComparable=function(e,t,n,r,i){var a=this,o=r(e),s=n.map(function(e){return r(e)}).filter(function(e){return e!==void 0});return o===void 0||s.length===0?n.some(function(n){return a.comparator(e,t,n)}):s.some(function(e){return i(o,t,e)})},e.prototype.comparator=function(e,t,n){switch(t){case Y.LESS_THAN:case Y.VERSION_LESS_THAN:return e<n;case Y.LESS_THAN_EQUALS:case Y.VERSION_LESS_THAN_EQUALS:return e<=n;case Y.GREATER_THAN:case Y.VERSION_GREATER_THAN:return e>n;case Y.GREATER_THAN_EQUALS:case Y.VERSION_GREATER_THAN_EQUALS:return e>=n;default:return!1}},e.prototype.versionComparator=function(e,t,n){var r=e.compareTo(n);switch(t){case Y.LESS_THAN:case Y.VERSION_LESS_THAN:return r<0;case Y.LESS_THAN_EQUALS:case Y.VERSION_LESS_THAN_EQUALS:return r<=0;case Y.GREATER_THAN:case Y.VERSION_GREATER_THAN:return r>0;case Y.GREATER_THAN_EQUALS:case Y.VERSION_GREATER_THAN_EQUALS:return r>=0;default:return!1}},e.prototype.matchesRegex=function(e,t){return t.some(function(t){return!!new RegExp(t).exec(e)})},e.prototype.containsNone=function(e){return e.some(function(e){return e===`(none)`})},e.prototype.containsBooleans=function(e){return e.some(function(e){switch(e.toLowerCase()){case`true`:case`false`:return!0;default:return!1}})},e.prototype.parseNumber=function(e){return Number(e)??void 0},e.prototype.coerceString=function(e){if(e)return typeof e==`object`?JSON.stringify(e):String(e)},e.prototype.coerceStringArray=function(e){var t=this;if(Array.isArray(e)){var n=e;return n.map(function(e){return t.coerceString(e)}
vendor: 4,185 bytes, line 267
267).filter(Boolean)}var r=String(e);try{var i=JSON.parse(r);if(Array.isArray(i)){var n=e;return n.map(function(e){return t.coerceString(e)}).filter(Boolean)}else return}catch{return}},e.prototype.isSetOperator=function(e){switch(e){case Y.SET_IS:case Y.SET_IS_NOT:case Y.SET_CONTAINS:case Y.SET_DOES_NOT_CONTAIN:case Y.SET_CONTAINS_ANY:case Y.SET_DOES_NOT_CONTAIN_ANY:return!0;default:return!1}},e.prototype.setEquals=function(e,t){var n=new Set(e),r=new Set(t);return n.size===r.size&&Xp([],Yp(r),!1).every(function(e){return n.has(e)})},e.prototype.matchesSetContainsAll=function(e,t){var n,r;if(e.length<t.length)return!1;try{for(var i=Jp(t),a=i.next();!a.done;a=i.next()){var o=a.value;if(!this.matchesIs(o,e))return!1}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!0},e.prototype.matchesSetContainsAny=function(e,t){var n,r;try{for(var i=Jp(t),a=i.next();!a.done;a=i.next()){var o=a.value;if(this.matchesIs(o,e))return!0}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!1},e}(),mm=`3.7.5`,hm=mm,gm=typeof atob==`function`,_m=typeof btoa==`function`,vm=typeof Buffer==`function`,ym=typeof TextDecoder==`function`?new TextDecoder:void 0,bm=typeof TextEncoder==`function`?new TextEncoder:void 0,xm=Array.prototype.slice.call(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`),Sm=(e=>{let t={};return e.forEach((e,n)=>t[e]=n),t})(xm),Cm=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,wm=String.fromCharCode.bind(String),Tm=typeof Uint8Array.from==`function`?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),Em=e=>e.replace(/=/g,``).replace(/[+\/]/g,e=>e==`+`?`-`:`_`),Dm=e=>e.replace(/[^A-Za-z0-9\+\/]/g,``),Om=e=>{let t,n,r,i,a=``,o=e.length%3;for(let o=0;o<e.length;){if((n=e.charCodeAt(o++))>255||(r=e.charCodeAt(o++))>255||(i=e.charCodeAt(o++))>255)throw TypeError(`invalid character found`);t=n<<16|r<<8|i,a+=xm[t>>18&63]+xm[t>>12&63]+xm[t>>6&63]+xm[t&63]}return o?a.slice(0,o-3)+`===`.substring(o):a},km=_m?e=>btoa(e):vm?e=>Buffer.from(e,`binary`).toString(`base64`):Om,Am=vm?e=>Buffer.from(e).toString(`base64`):e=>{let t=4096,n=[];for(let r=0,i=e.length;r<i;r+=t)n.push(wm.apply(null,e.subarray(r,r+t)));return km(n.join(``))},jm=(e,t=!1)=>t?Em(Am(e)):Am(e),Mm=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?wm(192|t>>>6)+wm(128|t&63):wm(224|t>>>12&15)+wm(128|t>>>6&63)+wm(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return wm(240|t>>>18&7)+wm(128|t>>>12&63)+wm(128|t>>>6&63)+wm(128|t&63)}},Nm=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Pm=e=>e.replace(Nm,Mm),Fm=vm?e=>Buffer.from(e,`utf8`).toString(`base64`):bm?e=>Am(bm.encode(e)):e=>km(Pm(e)),Im=(e,t=!1)=>t?Em(Fm(e)):Fm(e),Lm=e=>Im(e,!0),Rm=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,zm=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return wm((t>>>10)+55296)+wm((t&1023)+56320);case 3:return wm((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return wm((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},Bm=e=>e.replace(Rm,zm),Vm=e=>{if(e=e.replace(/\s+/g,``),!Cm.test(e))throw TypeError(`malformed base64.`);e+=`==`.slice(2-(e.length&3));let t,n=``,r,i;for(let a=0;a<e.length;)t=Sm[e.charAt(a++)]<<18|Sm[e.charAt(a++)]<<12|(r=Sm[e.charAt(a++)])<<6|(i=Sm[e.charAt(a++)]),n+=r===64?wm(t>>16&255):i===64?wm(t>>16&255,t>>8&255):wm(t>>16&255,t>>8&255,t&255);return n},Hm=gm?e=>atob(Dm(e)):vm?e=>Buffer.from(e,`base64`).toString(`binary`):Vm,Um=vm?e=>Tm(Buffer.from(e,`base64`)):e=>Tm(Hm(e).split(``).map(e=>e.charCodeAt(0))),Wm=e=>Um(Km(e)),Gm=vm?e=>Buffer.from(e,`base64`).toString(`utf8`):ym?e=>ym.decode(Um(e)):e=>Bm(Hm(e)),Km=e=>Dm(e.replace(/[-_]/g,e=>e==`-`?`+`:`/`)),qm=e=>Gm(Km(e)),Jm=e=>{if(typeof e!=`string`)return!1;let t=e.replace(/\s+/g,``).replace(/={0,2}$/,``);return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},Ym=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),Xm=function(){let e=(e,t)=>
267Object.defineProperty(String.prototype,e,Ym(t));e(`fromBase64`,function(){return qm(this)}),e(`toBase64`,function(e){return Im(this,e)}),e(`toBase64URI`,function(){return Im(this,!0)}),e(`toBase64URL`,function(){return Im(this,!0)}),e(`toUint8Array`,function(){return Wm(this)})},Zm=function(){let e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,Ym(t));e(`toBase64`,function(e){return jm(this,e)}),e(`toBase64URI`,function(){return jm(this,!0)}),e(`toBase64URL`,function(){return jm(this,!0)})},Qm={version:mm,VERSION:hm,atob:Hm,atobPolyfill:Vm,btoa:km,btoaPolyfill:Om,fromBase64:qm,toBase64:Im,encode:Im,encodeURI:Lm,encodeURL:Lm,utob:Pm,btou:Bm,decode:qm,isValid:Jm,fromUint8Array:jm,toUint8Array:Wm,extendString:Xm,extendUint8Array:Zm,extendBuiltins:()=>{Xm(),Zm()}},$m=function(e){Wp(t,e);function t(n,r){var i=e.call(this,r)||this;return i.statusCode=n,Object.setPrototypeOf(i,t.prototype),i}return t}(Error);(function(){function e(e,t,n){this.deploymentKey=e,this.serverUrl=t,this.httpClient=n}return e.prototype.getVariants=function(e,t){return Kp(this,void 0,void 0,function(){var n,r,i;return qp(this,function(a){switch(a.label){case 0:return n=Qm.encodeURL(JSON.stringify(e)),r={Authorization:`Api-Key ${this.deploymentKey}`,"X-Amp-Exp-User":n},t?.flagKeys&&(r[`X-Amp-Exp-Flag-Keys`]=Qm.encodeURL(JSON.stringify(t.flagKeys))),t?.trackingOption&&(r[`X-Amp-Exp-Track`]=t.trackingOption),[4,this.httpClient.request({requestUrl:`${this.serverUrl}/sdk/v2/vardata?v=0`,method:`GET`,headers:r,timeoutMillis:t?.timeoutMillis})];case 1:if(i=a.sent(),i.status!=200)throw new $m(i.status,`Fetch error response: status=${i.status}`);return[2,JSON.parse(i.body)]}})})},e})(),function(){function e(e,t,n){this.deploymentKey=e,this.serverUrl=t,this.httpClient=n}return e.prototype.getFlags=function(e){return Kp(this,void 0,void 0,function(){var t,n,r;return qp(this,function(i){switch(i.label){case 0:return t={Authorization:`Api-Key ${this.deploymentKey}`},e?.libraryName&&e?.libraryVersion&&(t[`X-Amp-Exp-Library`]=`${e.libraryName}/${e.libraryVersion}`),[4,this.httpClient.request({requestUrl:`${this.serverUrl}/sdk/v2/flags`,method:`GET`,headers:t,timeoutMillis:e?.timeoutMillis})];case 1:if(n=i.sent(),n.status!=200)throw Error(`Flags error response: status=${n.status}`);return r=JSON.parse(n.body),[2,r.reduce(function(e,t){return e[t.key]=t,e},{})]}})})},e}();var eh=typeof globalThis<`u`?globalThis:global||self;(function(){function e(e,t){this.poller=void 0,this.action=e,this.ms=t}return e.prototype.start=function(){this.poller||(this.poller=eh.setInterval(this.action,this.ms),this.action())},e.prototype.stop=function(){this.poller&&=(eh.clearInterval(this.poller),void 0)},e})();var th=(e,t)=>t.some(t=>e instanceof t),nh,rh;function ih(){return nh||=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]}function ah(){return rh||=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey]}var oh=new WeakMap,sh=new WeakMap,ch=new WeakMap;function lh(e){let t=new Promise((t,n)=>{let r=()=>{e.removeEventListener(`success`,i),e.removeEventListener(`error`,a)},i=()=>{t(hh(e.result)),r()},a=()=>{n(e.error),r()};e.addEventListener(`success`,i),e.addEventListener(`error`,a)});return ch.set(t,e),t}function uh(e){if(oh.has(e))return;let t=new Promise((t,n)=>{let r=()=>{e.removeEventListener(`complete`,i),e.removeEventListener(`error`,a),e.removeEventListener(`abort`,a)},i=()=>{t(),r()},a=()=>{n(e.error||new DOMException(`AbortError`,`AbortError`)),r()};e.addEventListener(`complete`,i),e.addEventListener(`error`,a),e.addEventListener(`abort`,a)});oh.set(e,t)}var dh={get(e,t,n){if(e instanceof IDBTransaction){if(t===`done`)return oh.get(e);if(t===`store`)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return hh(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t===`done`||t===`store`)||t in e}};function fh(e){dh=e(dh)}function ph(e){return ah().includes(e)?function(...t){return e.apply(gh(this),t),hh(this.request)}:function(...t){return hh(e.apply(gh(this),t))}}function mh(e){return typeof e==`function`?ph(e):(e instanceof IDBTransaction&&uh(e),th(e,ih())?new Proxy(e,dh):e)}function hh(e){if(e instanceof IDBRequest)return lh(e);if(sh.has(e))return sh.get(e);let t=mh(e);return t!==e&&(sh.set(e,t),ch.set(t,e)),t}var gh=e=>ch.get(e);function _h(e,t,{blocked:n,upgrade:r,blocking:i,terminated:a}={}){let o=indexedDB.open(e,t),s=hh(o);return r&&o.addEventListener(`upgradeneeded`,e=>{r(hh(o.result),e.oldVersion,e.newVersion,hh(o.transaction),e)}),n&&o.addEventListener(`blocked`,e=>n(e.oldVersion,e.newVersion,e)),s.then(e=>{a&&e.addEventListener(`close`,()=>a()),i&&e.addEventListener(`versionchange`,e=>i(e.oldVersion,e.newVersion,e))}).catch(()=>{}),s}var vh=[`get`,`getKey`,`getAll`,`getAllKeys`,`count`],yh=[`put`,`add`,`delete`,`clear`],bh=new Map;function xh(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t==`string`))return;if(bh.get(t))return bh.get(t);let n=t.replace(/FromIndex$/,``),r=t!==n,i=yh.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||vh.includes(n)))return;let a=async function(e,...t){let a=this.transaction(e,i?`readwrite`:`readonly`),o=a.store;
267return r&&(o=o.index(t.shift())),(await Promise.all([o[n](...t),i&&a.done]))[0]};return bh.set(t,a),a}fh(e=>({...e,get:(t,n,r)=>xh(t,n)||e.get(t,n,r),has:(t,n)=>!!xh(t,n)||e.has(t,n)}));var Sh=[`continue`,`continuePrimaryKey`,`advance`],Ch={},wh=new WeakMap,Th=new WeakMap,Eh={get(e,t){if(!Sh.includes(t))return e[t];let n=Ch[t];return n||=Ch[t]=function(...e){wh.set(this,Th.get(this)[t](...e))},n}};async function*Dh(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;t=t;let n=new Proxy(t,Eh);for(Th.set(n,t),ch.set(n,gh(t));t;)yield n,t=await(wh.get(n)||t.continue()),wh.delete(n)}function Oh(e,t){return t===Symbol.asyncIterator&&th(e,[IDBIndex,IDBObjectStore,IDBCursor])||t===`iterate`&&th(e,[IDBIndex,IDBObjectStore])}fh(e=>({...e,get(t,n,r){return Oh(t,n)?Dh:e.get(t,n,r)},has(t,n){return Oh(t,n)||e.has(t,n)}}));var kh=new(function(){function e(){var e=this;this.dbs={},this.createStore=function(t){return Vp(e,void 0,void 0,function(){return Hp(this,function(e){switch(e.label){case 0:return[4,_h(t,1,{upgrade:function(e){e.objectStoreNames.contains(`eventTypesForSession`)||e.createObjectStore(`eventTypesForSession`,{keyPath:`sessionId`})}})];case 1:return[2,e.sent()]}})})},this.openOrCreateDB=function(t){return Vp(e,void 0,void 0,function(){var e,n;return Hp(this,function(r){switch(r.label){case 0:return this.dbs&&this.dbs[t]?[2,this.dbs[t]]:(e=`${t.substring(0,10)}_amp_targeting`,[4,this.createStore(e)]);case 1:return n=r.sent(),this.dbs[t]=n,[2,n]}})})},this.updateEventListForSession=function(t){var n=t.sessionId,r=t.eventType,i=t.eventTime,a=t.loggerProvider,o=t.tx;return Vp(e,void 0,void 0,function(){var e,t,s,c,l,u,d,f,p;return Hp(this,function(m){switch(m.label){case 0:return m.trys.push([0,3,,4]),e=String(n),[4,o.store.get(e)];case 1:return t=m.sent(),s=t?t.eventTypes:{},c=s[r]||{},l=Bp(Bp({},s),(f={},f[r]=Bp(Bp({},c),(p={},p[i]={event_type:r},p)),f)),u={sessionId:e,eventTypes:l,lastUpdated:Date.now()},[4,o.store.put(u)];case 2:return m.sent(),[2,l];case 3:return d=m.sent(),a.warn(`Failed to store events for targeting ${n}: ${d}`),[3,4];case 4:return[2,void 0]}})})},this.deleteOldSessionEventTypes=function(t){var n=t.currentSessionId,r=t.loggerProvider,i=t.tx;return Vp(e,void 0,void 0,function(){var e,t,a,o,s,c;return Hp(this,function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),e=String(n),[4,i.store.getAll()];case 1:t=l.sent(),a=0,l.label=2;case 2:return a<t.length?(o=t[a],s=Date.now()-o.lastUpdated,o.sessionId!==e&&s>1728e5?[4,i.store.delete(o.sessionId)]:[3,4]):[3,5];case 3:l.sent(),l.label=4;case 4:return a++,[3,2];case 5:return[3,7];case 6:return c=l.sent(),r.warn(`Failed to clear old session event types for targeting: ${c}`),[3,7];case 7:return[2]}})})},this.storeEventTypeForSession=function(t){var n=t.loggerProvider,r=t.sessionId,i=t.eventType,a=t.eventTime,o=t.apiKey;return Vp(e,void 0,void 0,function(){var e,t,s,c;return Hp(this,function(l){switch(l.label){case 0:return l.trys.push([0,5,,6]),[4,this.openOrCreateDB(o)];case 1:return e=l.sent(),t=e.transaction(`eventTypesForSession`,`readwrite`),t?[4,this.updateEventListForSession({sessionId:r,tx:t,loggerProvider:n,eventType:i,eventTime:a})]:[2];case 2:return s=l.sent(),[4,this.deleteOldSessionEventTypes({currentSessionId:r,tx:t,loggerProvider:n})];case 3:return l.sent(),[4,t.done];case 4:return l.sent(),[2,s];case 5:return c=l.sent(),n.warn(`Failed to store events for targeting ${r}: ${c}`),[3,6];case 6:return[2,void 0]}})})}}return e}()),Ah=function(){function e(){var e=this;this.evaluateTargeting=function(t){var n=t.apiKey,r=t.loggerProvider,i=t.event,a=t.sessionId,o=t.userProperties,s=t.deviceId,c=t.page,l=t.flag;return Vp(e,void 0,void 0,function(){var e,t,u,d,f;return Hp(this,function(p){switch(p.label){case 0:return i&&i.time?[4,kh.storeEventTypeForSession({loggerProvider:r,apiKey:n,sessionId:a,eventType:i.event_type,eventTime:i.time})]:[3,2];case 1:return t=p.sent(),[3,3];case 2:t=void 0,p.label=3;case 3:return e=t,u=e&&new Set(Object.keys(e)),d={session_id:a,event:i,event_types:u&&Array.from(u),user:Bp(Bp({},o),{device_id:s,user_properties:o}),page:c},f=this.evaluationEngine.evaluate(d,[l]),[2,f]}})})},this.evaluationEngine=new pm}return e}(),jh=function(){var e=new Ah;return{evaluateTargeting:e.evaluateTargeting.bind(e)}}(),Mh=e({evaluateTargeting:()=>Nh}),Nh=jh.evaluateTargeting,X=function(){return X=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},X.apply(this,arguments)};function Ph(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Z(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function Q(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(
267o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function Fh(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function Ih(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function Lh(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Rh;(function(e){e.SET=`$set`,e.SET_ONCE=`$setOnce`,e.ADD=`$add`,e.APPEND=`$append`,e.PREPEND=`$prepend`,e.REMOVE=`$remove`,e.PREINSERT=`$preInsert`,e.POSTINSERT=`$postInsert`,e.UNSET=`$unset`,e.CLEAR_ALL=`$clearAll`})(Rh||={});var zh;(function(e){e.IDENTIFY=`$identify`,e.GROUP_IDENTIFY=`$groupidentify`,e.REVENUE=`revenue_amount`})(zh||={});var Bh=`AMP_unsent`,Vh=`$default_instance`,Hh=`https://api2.amplitude.com/2/httpapi`,Uh=`https://api.eu.amplitude.com/2/httpapi`,Wh=`https://api2.amplitude.com/batch`,Gh=`https://api.eu.amplitude.com/batch`,Kh=`utm_campaign`,qh=`utm_content`,Jh=`utm_id`,Yh=`utm_medium`,Xh=`utm_source`,Zh=`utm_term`,Qh=`dclid`,$h=`fbclid`,eg=`gbraid`,tg=`gclid`,ng=`ko_click_id`,rg=`li_fat_id`,ig=`msclkid`,ag=`rdt_cid`,og=`ttclid`,sg=`twclid`,cg=`wbraid`,lg={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},ug=1e3,dg=function(e){if(Object.keys(e).length>ug)return!1;for(var t in e){var n=e[t];if(!fg(t,n))return!1}return!0},fg=function(e,t){var n,r;if(typeof e!=`string`)return!1;if(Array.isArray(t)){var i=!0;try{for(var a=Fh(t),o=a.next();!o.done;o=a.next()){var s=o.value;if(Array.isArray(s))return!1;if(typeof s==`object`)i&&=dg(s);else if(![`number`,`string`].includes(typeof s))return!1;if(!i)return!1}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}}else if(t==null)return!1;else if(typeof t==`object`)return dg(t);else if(![`number`,`string`,`boolean`].includes(typeof t))return!1;return!0},pg=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return X({},this._properties)},e.prototype.set=function(e,t){return this._safeSet($.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet($.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet($.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet($.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet($.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet($.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet($.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet($.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet($.UNSET,e,`-`),this},e.prototype.clearAll=function(){return this._properties={},this._properties[$.CLEAR_ALL]=`-`,this}
267,e.prototype._safeSet=function(e,t,n){if(this._validate(e,t,n)){var r=this._properties[e];return r===void 0&&(r={},this._properties[e]=r),r[t]=n,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,n){return this._properties[$.CLEAR_ALL]!==void 0||this._propertySet.has(t)?!1:e===$.ADD?typeof n==`number`:e!==$.UNSET&&e!==$.REMOVE?fg(t,n):!0},e}(),$;(function(e){e.SET=`$set`,e.SET_ONCE=`$setOnce`,e.ADD=`$add`,e.APPEND=`$append`,e.PREPEND=`$prepend`,e.REMOVE=`$remove`,e.PREINSERT=`$preInsert`,e.POSTINSERT=`$postInsert`,e.UNSET=`$unset`,e.CLEAR_ALL=`$clearAll`})($||={});var mg=[$.CLEAR_ALL,$.UNSET,$.SET,$.SET_ONCE,$.ADD,$.APPEND,$.PREPEND,$.PREINSERT,$.POSTINSERT,$.REMOVE],hg=`Event tracked successfully`,gg=`Unexpected error occurred`,_g=`Event rejected due to exceeded retry count`,vg=`Event skipped due to optOut config`,yg=`Event rejected due to missing API key`,bg=`Client not initialized`,xg;(function(e){e.Unknown=`unknown`,e.Skipped=`skipped`,e.Success=`success`,e.RateLimit=`rate_limit`,e.PayloadTooLarge=`payload_too_large`,e.Invalid=`invalid`,e.Failed=`failed`,e.Timeout=`Timeout`,e.SystemError=`SystemError`})(xg||={});var Sg=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=xg.Unknown),{event:e,code:t,message:n}},Cg=function(){var e=`ampIntegrationContext`;if(typeof globalThis<`u`&&globalThis[e]!==void 0)return globalThis[e];if(typeof globalThis<`u`)return globalThis;if(typeof window<`u`)return window;if(typeof self<`u`)return self;if(typeof global<`u`)return global},wg=function(e){return e?(e^Math.random()*16>>e/4).toString(16):`10000000-1000-4000-8000-100000000000`.replace(/[018]/g,Eg)},Tg=Lh([],Ih(Array(256).keys()),!1).map(function(e){return e.toString(16).padStart(2,`0`)}),Eg=function(e){var t=Cg();if(!t?.crypto?.getRandomValues)return wg(e);var n=t.crypto.getRandomValues(new Uint8Array(16));return n[6]=n[6]&15|64,n[8]=n[8]&63|128,Lh([],Ih(n.entries()),!1).map(function(e){var t=Ih(e,2),n=t[0],r=t[1];return[4,6,8,10].includes(n)?`-${Tg[r]}`:Tg[r]}).join(``)},Dg=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[],this._optOutListeners=[]}return e.prototype.register=function(e,t){return Z(this,void 0,void 0,function(){return Q(this,function(n){switch(n.label){case 0:return this.plugins.some(function(t){return t.name===e.name})?(this.loggerProvider.warn(`Plugin with name ${e.name} already exists, skipping registration`),[2]):(e.name===void 0&&(e.name=Eg(),this.loggerProvider.warn(`Plugin name is undefined. 
268      Generating a random UUID for plugin name: ${e.name}. 
269      Set a name for the plugin to prevent it from being added multiple times.`)),e.type=e.type??`enrichment`,[4,e.setup?.call(e,t,this.client)]);case 1:return n.sent(),this.plugins.push(e),[2]}})})},e.prototype.deregister=function(e,t){return Z(this,void 0,void 0,function(){var n,r;return Q(this,function(i){switch(i.label){case 0:return n=this.plugins.findIndex(function(t){return t.name===e}),n===-1?(t.loggerProvider.warn(`Plugin with name ${e} does not exist, skipping deregistration`),[2]):(r=this.plugins[n],this.plugins.splice(n,1),[4,r.teardown?.call(r)]);case 1:return i.sent(),[2]}})})},e.prototype.reset=function(e){this._clearOptOutListeners(),this.applying=!1,this.plugins.map(function(e){return e.teardown?.call(e)}),this.plugins=[],this.client=e},e.prototype.push=function(e){var t=this;return new Promise(function(n){t.queue.push([e,n]),t.scheduleApply(0)})},e.prototype.scheduleApply=function(e){var t=this;this.applying||(this.applying=!0,setTimeout(function(){t.apply(t.queue.shift()).then(function(){t.applying=!1,t.queue.length>0&&t.scheduleApply(0)})},e))},e.prototype.apply=function(e){return Z(this,void 0,void 0,function(){var t,n,r,i,a,o,s,c,l,u,d,f,p,c,l,m,h,g,_,v,y,b;return Q(this,function(x){switch(x.label){case 0:if(!e)return[2];t=Ih(e,1),n=t[0],r=Ih(e,2),i=r[1],this.loggerProvider.log(`Timeline.apply: Initial event`,n),a=this.plugins.filter(function(e){return e.type===`before`}),x.label=1;case 1:x.trys.push([1,6,7,8]),o=Fh(a),s=o.next(),x.label=2;case 2:return s.done?[3,5]:(c=s.value,c.execute?[4,c.execute(X({},n))]:[3,4]);case 3:if(l=x.sent(),l===null)return this.loggerProvider.log(`Timeline.apply: Event filtered out by before plugin '${String(c.name)}', event: ${JSON.stringify(n)}`),i({event:n,code:0,message:``}),[2];n=l,this.loggerProvider.log(`Timeline.apply: Event after before plugin '${String(c.name)}', event: ${JSON.stringify(n)}`),x.label=4;case 4:return s=o.next(),[3,2];case 5:return[3,8];case 6:return u=x.sent(),_={error:u},[3,8];case 7:try{s&&!s.done&&(v=o.return)&&v.call(o)}finally{if(_)throw _.error}
269return[7];case 8:d=this.plugins.filter(function(e){return e.type===`enrichment`||e.type===void 0}),x.label=9;case 9:x.trys.push([9,14,15,16]),f=Fh(d),p=f.next(),x.label=10;case 10:return p.done?[3,13]:(c=p.value,c.execute?[4,c.execute(X({},n))]:[3,12]);case 11:if(l=x.sent(),l===null)return this.loggerProvider.log(`Timeline.apply: Event filtered out by enrichment plugin '${String(c.name)}', event: ${JSON.stringify(n)}`),i({event:n,code:0,message:``}),[2];n=l,this.loggerProvider.log(`Timeline.apply: Event after enrichment plugin '${String(c.name)}', event: ${JSON.stringify(n)}`),x.label=12;case 12:return p=f.next(),[3,10];case 13:return[3,16];case 14:return m=x.sent(),y={error:m},[3,16];case 15:try{p&&!p.done&&(b=f.return)&&b.call(f)}finally{if(y)throw y.error}return[7];case 16:return h=this.plugins.filter(function(e){return e.type===`destination`}),this.loggerProvider.log(`Timeline.apply: Final event before destinations, event: ${JSON.stringify(n)}`),g=h.map(function(e){var t=X({},n);return e.execute(t).catch(function(e){return Sg(t,0,String(e))})}),Promise.all(g).then(function(e){var t=Ih(e,1)[0]||Sg(n,100,`Event not tracked, no destination plugins on the instance`);i(t)}),[2]}})})},e.prototype.flush=function(){return Z(this,void 0,void 0,function(){var e,t,n,r=this;return Q(this,function(i){switch(i.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map(function(e){return r.apply(e)}))];case 1:return i.sent(),t=this.plugins.filter(function(e){return e.type===`destination`}),n=t.map(function(e){return e.flush&&e.flush()}),[4,Promise.all(n)];case 2:return i.sent(),[2]}})})},e.prototype.addOptOutListener=function(e){this._optOutListeners.push(e)},e.prototype._clearOptOutListeners=function(){this._optOutListeners=[]},e.prototype.onIdentityChanged=function(e){this.plugins.forEach(function(t){var n;(n=t.onIdentityChanged)==null||n.call(t,e)})},e.prototype.onSessionIdChanged=function(e){this.plugins.forEach(function(t){var n;(n=t.onSessionIdChanged)==null||n.call(t,e)})},e.prototype.onOptOutChanged=function(e){this.plugins.forEach(function(t){var n;(n=t.onOptOutChanged)==null||n.call(t,e)}),this._callOptOutListeners(e)},e.prototype._callOptOutListeners=function(e){return Z(this,void 0,void 0,function(){var t,n,r,i,a,o,s;return Q(this,function(c){switch(c.label){case 0:c.trys.push([0,7,8,9]),t=Fh(this._optOutListeners),n=t.next(),c.label=1;case 1:if(n.done)return[3,6];r=n.value,c.label=2;case 2:return c.trys.push([2,4,,5]),[4,r(e)];case 3:return c.sent(),[3,5];case 4:return i=c.sent(),this.loggerProvider.error(`Error calling optOut listener`,i),[3,5];case 5:return n=t.next(),[3,1];case 6:return[3,9];case 7:return a=c.sent(),o={error:a},[3,9];case 8:try{n&&!n.done&&(s=t.return)&&s.call(t)}finally{if(o)throw o.error}return[7];case 9:return[2]}})})},e.prototype.onReset=function(){this.plugins.forEach(function(e){var t;(t=e.onReset)==null||t.call(e)})},e}(),Og=function(e,t,n){return X(X(X({},typeof e==`string`?{event_type:e}:e),n),t&&{event_properties:t})},kg=function(e,t){return X(X({},t),{event_type:zh.IDENTIFY,user_properties:e.getUserProperties()})},Ag=function(e,t,n,r){var i;return X(X({},r),{event_type:zh.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(i={},i[e]=t,i)})},jg=function(e,t,n){var r,i=new pg;return i.set(e,t),X(X({},n),{event_type:zh.IDENTIFY,user_properties:i.getUserProperties(),groups:(r={},r[e]=t,r)})},Mg=function(e,t){return X(X({},t),{event_type:zh.REVENUE,event_properties:e.getEventProperties()})},Ng=function(e){return{promise:e||Promise.resolve()}},Pg=function(){function e(e){e===void 0&&(e=`$default`),this.initializing=!1,this.isReady=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new Dg(this),this.name=e}return e.prototype._init=function(e){return Z(this,void 0,void 0,function(){return Q(this,function(t){switch(t.label){case 0:return this.config=e,this.timeline.reset(this),this.timeline.loggerProvider=this.config.loggerProvider,[4,this.runQueuedFunctions(`q`)];case 1:return t.sent(),this.isReady=!0,[2]}})})},e.prototype.runQueuedFunctions=function(e){return Z(this,void 0,void 0,function(){var t,n,r,i,a,o,s,c;return Q(this,function(l){switch(l.label){case 0:t=this[e],this[e]=[],l.label=1;case 1:l.trys.push([1,8,9,10]),n=Fh(t),r=n.next(),l.label=2;case 2:return r.done?[3,7]:(i=r.value,a=i(),a&&`promise`in a?[4,a.promise]:[3,4]);case 3:return l.sent(),[3,6];case 4:return[4,a];case 5:l.sent(),l.label=6;case 6:return r=n.next(),[3,2];case 7:return[3,10];case 8:return o=l.sent(),s={error:o},[3,10];case 9:try{r&&!r.done&&(c=n.return)&&c.call(n)}finally{if(s)throw s.error}
269return[7];case 10:return this[e].length?[4,this.runQueuedFunctions(e)]:[3,12];case 11:l.sent(),l.label=12;case 12:return[2]}})})},e.prototype.track=function(e,t,n){var r=Og(e,t,n);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),Ng(this.dispatch(r))},e.prototype.identify=function(e,t){var n=kg(e,t);return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),Ng(this.dispatch(n))},e.prototype.groupIdentify=function(e,t,n,r){var i=Ag(e,t,n,r);return Ng(this.dispatch(i))},e.prototype.setGroup=function(e,t,n){var r=jg(e,t,n);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),Ng(this.dispatch(r))},e.prototype.revenue=function(e,t){var n=Mg(e,t);return Ng(this.dispatch(n))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),Ng())},e.prototype._addPlugin=function(e){return Ng(this.timeline.register(e,this.config))},e.prototype.remove=function(e){return this.isReady?this._removePlugin(e):(this.q.push(this._removePlugin.bind(this,e)),Ng())},e.prototype._removePlugin=function(e){return Ng(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(Sg(e,0,bg));this.process(e).then(t)},e.prototype.dispatch=function(e){return Z(this,void 0,void 0,function(){var t=this;return Q(this,function(n){return this.isReady?[2,this.process(e)]:[2,new Promise(function(n){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,n))})]})})},e.prototype.getOperationAppliedUserProperties=function(e){var t=X({},this.userProperties??{});if(e===void 0)return t;var n={};return Object.keys(e).forEach(function(t){Object.values(Rh).includes(t)||(n[t]=e[t])}),mg.forEach(function(n){if(Object.keys(e).includes(n)){var r=e[n];switch(n){case Rh.CLEAR_ALL:Object.keys(t).forEach(function(e){delete t[e]});break;case Rh.UNSET:Object.keys(r).forEach(function(e){delete t[e]});break;case Rh.SET:Object.assign(t,r);break}}}),Object.assign(t,n),t},e.prototype.process=function(e){return Z(this,void 0,void 0,function(){var t,n,r,t;return Q(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this.config.optOut?[2,Sg(e,0,vg)]:(e.event_type===zh.IDENTIFY&&this.timeline.onIdentityChanged({userProperties:this.userProperties}),[4,this.timeline.push(e)]);case 1:return t=i.sent(),t.code===200?this.config.loggerProvider.log(t.message):t.code===100?this.config.loggerProvider.warn(t.message):this.config.loggerProvider.error(t.message),[2,t];case 2:return n=i.sent(),r=String(n),this.config.loggerProvider.error(r),t=Sg(e,0,r),[2,t];case 3:return[2]}})})},e.prototype.setOptOut=function(e){if(!this.isReady){this.q.push(this._setOptOut.bind(this,!!e));return}this._setOptOut(e)},e.prototype._setOptOut=function(e){this.config.optOut!==e&&(this.config.optOut=!!e,this.timeline.onOptOutChanged(e))},e.prototype.flush=function(){return Ng(this.timeline.flush())},e.prototype.plugin=function(e){var t=this.timeline.plugins.find(function(t){return t.name===e});if(t===void 0){this.config.loggerProvider.debug(`Cannot find plugin with name ${e}`);return}return t},e.prototype.plugins=function(e){return this.timeline.plugins.filter(function(t){return t instanceof e})},e}(),Fg=function(){function e(){this.productId=``,this.quantity=1,this.price=0}return e.prototype.setProductId=function(e){return this.productId=e,this},e.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},e.prototype.setPrice=function(e){return this.price=e,this},e.prototype.setRevenueType=function(e){return this.revenueType=e,this},e.prototype.setCurrency=function(e){return this.currency=e,this},e.prototype.setRevenue=function(e){return this.revenue=e,this},e.prototype.setReceipt=function(e){return this.receipt=e,this},e.prototype.setReceiptSig=function(e){return this.receiptSig=e,this},e.prototype.setEventProperties=function(e){try{var t=JSON.parse(JSON.stringify(e));dg(t)&&(this.properties=t)}catch{}return this},e.prototype.getEventProperties=function(){var e=this.properties?X({},this.properties):{};return e[Ig.REVENUE_PRODUCT_ID]=this.productId,e[Ig.REVENUE_QUANTITY]=this.quantity,e[Ig.REVENUE_PRICE]=this.price,e[Ig.REVENUE_TYPE]=this.revenueType,e[Ig.REVENUE_CURRENCY]=this.currency,e[Ig.REVENUE]=this.revenue,e[Ig.RECEIPT]=this.receipt,e[Ig.RECEIPT_SIG]=this.receiptSig,e},e}(),Ig;(function(e){e.REVENUE_PRODUCT_ID=`$productId`,e.REVENUE_QUANTITY=`$quantity`,e.REVENUE_PRICE=`$price`,e.REVENUE_TYPE=`$revenueType`,e.REVENUE_CURRENCY=`$currency`,e.REVENUE=`$revenue`,e.RECEIPT=`$receipt`,e.RECEIPT_SIG=`$receiptSig`})(Ig||={});var Lg=function(e,t){var n=Math.max(t,1);return e.reduce(function(e,t,r){var i=Math.floor(r/n);return e[i]||(e[i]=[]),e[i].push(t),e},[])},Rg;(function(e){e[e.None=0]=`None`,e[e.Error=1]=`Error`,e[e.Warn=2]=`Warn`,e[e.Verbose=3]=`Verbose`,e[e.Debug=4]=`Debug`})(Rg||={});var zg=`Amplitude Logger `,Bg=function(){function e(){this.logLevel=Rg.None}return e.prototype.disable=function(){this.logLevel=Rg.None},e.prototype.enable=function(e){e===void 0&&(e=Rg.Warn),this.logLevel=e},e.prototype.log=function(){var e=[...arguments];this.logLevel<Rg.Verbose||console.log(`${zg}[Log]: ${e.join(` `)}`)},e.prototype.warn=function(){var e=[...arguments];this.logLevel<Rg.Warn||console.warn(`${zg}[Warn]: ${e.join(` `)}`)},e.prototype.error=function(){var e=[...arguments];this.logLevel<Rg.Error||console.error(`${zg}[Error]: ${e.join(` `)}`)},e.prototype.debug=function(){var e=[...arguments];this.logLevel<Rg.Debug||console.log(`${zg}[Debug]: ${e.join(` `)}`)},e}(),Vg=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:Vh,logLevel:Rg.Warn,loggerProvider:new Bg,offline:!1,optOut:!1,serverUrl:Hh,serverZone:`US`,useBatch:!1}},Hg=function(){function e(e){this._optOut=!1;var t=Vg();this.apiKey=e.apiKey,this.flushIntervalMillis=e.flushIntervalMillis??t.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||t.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||t.flushQueueSize,this.instanceName=e.instanceName||t.instanceName,this.loggerProvider=e.loggerProvider||t.loggerProvider,this.logLevel=e.logLevel??t.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=e.offline===void 0?t.offline:e.offline,this.optOut=e.optOut??t.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||t.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=e.useBatch??t.useBatch,this.loggerProvider.enable(this.logLevel);var n=Wg(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=n.serverZone,this.serverUrl=n.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e}
269,enumerable:!1,configurable:!0}),e}(),Ug=function(e,t){return e===`EU`?t?Gh:Uh:t?Wh:Hh},Wg=function(e,t,n){if(e===void 0&&(e=``),t===void 0&&(t=Vg().serverZone),n===void 0&&(n=Vg().useBatch),e)return{serverUrl:e,serverZone:void 0};var r=[`US`,`EU`].includes(t)?t:Vg().serverZone;return{serverZone:r,serverUrl:Ug(r,n)}},Gg=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}();function Kg(e){return e>=200&&e<300}var qg=function(e){return e===void 0&&(e=0),(Error().stack||``).split(`
270`).slice(2+e).map(function(e){return e.trim()})},Jg=function(e){return function(){var t=X({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},Yg=function(e,t){var n,r;t=t.replace(/\[(\w+)\]/g,`.$1`),t=t.replace(/^\./,``);try{for(var i=Fh(t.split(`.`)),a=i.next();!a.done;a=i.next()){var o=a.value;if(o in e)e=e[o];else return}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e},Xg=function(e,t){return function(){var n,r,i={};try{for(var a=Fh(t),o=a.next();!o.done;o=a.next()){var s=o.value;i[s]=Yg(e,s)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i}},Zg=function(e,t,n,r,i){return i===void 0&&(i=null),function(){var a=[...arguments],o=n(),s=o.logger,c=o.logLevel;if(c&&c<Rg.Debug||!c||!s)return e.apply(i,a);var l={type:`invoke public method`,name:t,args:a,stacktrace:qg(1),time:{start:new Date().toISOString()},states:{}};r&&l.states&&(l.states.before=r());var u=e.apply(i,a);return u&&u.promise?u.promise.then(function(){r&&l.states&&(l.states.after=r()),l.time&&(l.time.end=new Date().toISOString()),s.debug(JSON.stringify(l,null,2))}):(r&&l.states&&(l.states.after=r()),l.time&&(l.time.end=new Date().toISOString()),s.debug(JSON.stringify(l,null,2))),u}},Qg=new Set([Hh,Uh,Wh,Gh]),$g=function(e,t){return t===void 0&&(t=!1),Qg.has(e)?!0:t};function e_(e){return e instanceof Error?e.message:String(e)}function t_(e){var t=``;try{`body`in e&&(t=JSON.stringify(e.body,null,2))}catch{}return t}var n_=function(){function e(e){this.name=`amplitude`,this.type=`destination`,this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey=``,this.scheduleId=null,this.scheduledTimeout=0,this.flushId=null,this.queue=[],this.diagnosticsClient=e?.diagnosticsClient}return e.prototype.setup=function(e){return Z(this,void 0,void 0,function(){var t,n=this;return Q(this,function(r){switch(r.label){case 0:return this.config=e,this.storageKey=`${Bh}_${this.config.apiKey.substring(0,10)}`,[4,this.config.storageProvider?.get(this.storageKey)];case 1:return t=r.sent(),t&&t.length>0&&Promise.all(t.map(function(e){return n.execute(e)})).catch(),[2,Promise.resolve(void 0)]}})})},e.prototype.execute=function(e){var t=this;return e.insert_id||=Eg(),new Promise(function(n){var r={event:e,attempts:0,callback:function(e){return n(e)},timeout:0};t.queue.push(r),t.schedule(t.config.flushIntervalMillis),t.saveEvents()})},e.prototype.removeEventsExceedFlushMaxRetries=function(e){var t=this;return e.filter(function(e){return e.attempts+=1,e.attempts<t.config.flushMaxRetries?!0:(t.fulfillRequest([e],500,_g),!1)})},e.prototype.scheduleEvents=function(e){var t=this;e.forEach(function(e){t.schedule(e.timeout===0?t.config.flushIntervalMillis:e.timeout)})},e.prototype.schedule=function(e){var t=this;if(!this.config.offline&&(this.scheduleId===null||this.scheduleId&&e>this.scheduledTimeout)){this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=e,this.scheduleId=setTimeout(function(){t.queue=t.queue.map(function(e){return e.timeout=0,e}),t.flush(!0)},e);return}},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(e){return e===void 0&&(e=!1),Z(this,void 0,void 0,function(){var t,n,r,i=this;return Q(this,function(a){switch(a.label){case 0:return this.config.offline?(this.resetSchedule(),this.config.loggerProvider.debug(`Skipping flush while offline.`),[2]):this.flushId?(this.resetSchedule(),this.config.loggerProvider.debug(`Skipping flush because previous flush has not resolved.`),[2]):(this.flushId=this.scheduleId,this.resetSchedule(),t=[],n=[],this.queue.forEach(function(e){return e.timeout===0?t.push(e):n.push(e)}),r=Lg(t,this.config.flushQueueSize),[4,r.reduce(function(t,n){return Z(i,void 0,void 0,function(){return Q(this,function(r){switch(r.label){case 0:return[4,t];case 1:return r.sent(),[4,this.send(n,e)];case 2:return[2,r.sent()]}})})},Promise.resolve())]);case 1:return a.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}})})},e.prototype.send=function(e,t){var n;return t===void 0&&(t=!0),Z(this,void 0,void 0,function(){var r,i,a,o,s,c;return Q(this,function(l){switch(l.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,yg)];r={api_key:this.config.apiKey,events:e.map(function(e){var t=e.event;return t.extra,Ph(t,[`extra`])}),options:{min_id_length:this.config.minIdLength},client_upload_time:new Date().toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new Gg,l.label=1;case 1:return l.trys.push([1,3,,4]),i=Wg(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,a=$g(i,this.config.enableRequestBodyCompression),[4,this.config.transportProvider.send(i,r,this.config._enableRequestBodyCompressionExperimental&&a)];case 2:return o=l.sent(),o===null?(this.fulfillRequest(e,0,gg),[2]):t?(this.handleResponse(o,e),[3,4]):(`body`in o?this.fulfillRequest(e,o.statusCode,`${o.status}: ${t_(o)}`):this.fulfillRequest(e,o.statusCode,o.status),[2]);case 3:return s=l.sent(),c=e_(s),this.config.loggerProvider.error(c),(n=this.diagnosticsClient)==null||n.recordEvent(`anal
270ytics.events.unsuccessful.from.catch.error`,{events:e.map(function(e){return e.event.event_type}),message:c,stack_trace:qg()}),this.handleResponse({status:xg.Failed,statusCode:0},e),[3,4];case 4:return[2]}})})},e.prototype.handleResponse=function(e,t){var n;Kg(e.statusCode)||(n=this.diagnosticsClient)==null||n.recordEvent(`analytics.events.unsuccessful`,{events:t.map(function(e){return e.event.event_type}),code:e.statusCode,status:e.status,body:t_(e),stack_trace:qg()});var r=e.status;switch(r){case xg.Success:this.handleSuccessResponse(e,t);break;case xg.Invalid:this.handleInvalidResponse(e,t);break;case xg.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case xg.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.config.loggerProvider.warn(`{code: 0, error: "Status '${r}' provided for ${t.length} events"}`),this.handleOtherResponse(t);break}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,hg)},e.prototype.handleInvalidResponse=function(e,t){var n=this;if(e.body.missingField||e.body.error.startsWith(`Invalid API key`)){this.fulfillRequest(t,e.statusCode,e.body.error);return}var r=Lh(Lh(Lh(Lh([],Ih(Object.values(e.body.eventsWithInvalidFields)),!1),Ih(Object.values(e.body.eventsWithMissingFields)),!1),Ih(Object.values(e.body.eventsWithInvalidIdLengths)),!1),Ih(e.body.silencedEvents),!1).flat(),i=new Set(r),a=t.filter(function(t,r){if(i.has(r)){n.fulfillRequest([t],e.statusCode,e.body.error);return}return!0});a.length>0&&this.config.loggerProvider.warn(t_(e));var o=this.removeEventsExceedFlushMaxRetries(a);this.scheduleEvents(o)},e.prototype.handlePayloadTooLargeResponse=function(e,t){if(t.length===1){this.fulfillRequest(t,e.statusCode,e.body.error);return}this.config.loggerProvider.warn(t_(e)),this.config.flushQueueSize/=2;var n=this.removeEventsExceedFlushMaxRetries(t);this.scheduleEvents(n)},e.prototype.handleRateLimitResponse=function(e,t){var n=this,r=Object.keys(e.body.exceededDailyQuotaUsers),i=Object.keys(e.body.exceededDailyQuotaDevices),a=e.body.throttledEvents,o=new Set(r),s=new Set(i),c=new Set(a),l=t.filter(function(t,r){if(t.event.user_id&&o.has(t.event.user_id)||t.event.device_id&&s.has(t.event.device_id)){n.fulfillRequest([t],e.statusCode,e.body.error);return}return c.has(r)&&(t.timeout=n.throttleTimeout),!0});l.length>0&&this.config.loggerProvider.warn(t_(e));var u=this.removeEventsExceedFlushMaxRetries(l);this.scheduleEvents(u)},e.prototype.handleOtherResponse=function(e){var t=this,n=e.map(function(e){return e.timeout=e.attempts*t.retryTimeout,e}),r=this.removeEventsExceedFlushMaxRetries(n);this.scheduleEvents(r)},e.prototype.fulfillRequest=function(e,t,n){var r,i,a;Kg(t)?(a=this.diagnosticsClient)==null||a.increment(`analytics.events.sent`,e.length):((r=this.diagnosticsClient)==null||r.increment(`analytics.events.dropped`,e.length),(i=this.diagnosticsClient)==null||i.recordEvent(`analytics.events.dropped`,{events:e.map(function(e){return e.event.event_type}),code:t,message:n,stack_trace:qg()})),this.removeEvents(e),e.forEach(function(e){return e.callback(Sg(e.event,t,n))})},e.prototype.saveEvents=function(){if(this.config.storageProvider){var e=this.queue.map(function(e){return e.event});this.config.storageProvider.set(this.storageKey,e)}},e.prototype.removeEvents=function(e){this.queue=this.queue.filter(function(t){return!e.some(function(e){return e.event.insert_id===t.event.insert_id})}),this.saveEvents()},e}(),r_=function(){var e=Cg();return e?.location?.search?e.location.search.substring(1).split(`&`).filter(Boolean).reduce(function(e,t){var n=t.split(`=`,2),r=i_(n[0]),i=i_(n[1]);return i&&(e[r]=i),e},{}):{}},i_=function(e){e===void 0&&(e=``);try{return decodeURIComponent(e)}catch{return``}},a_=function(e){var t={};for(var n in e){var r=e[n];r&&(t[n]=r)}return t},o_=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return Z(this,void 0,void 0,function(){return Q(this,function(e){return[2,!0]})})},e.prototype.get=function(e){return Z(this,void 0,void 0,function(){return Q(this,function(t){return[2,this.memoryStorage.get(e)]})})},e.prototype.getRaw=function(e){return Z(this,void 0,void 0,function(){var t;return Q(this,function(n){switch(n.label){case 0:return[4,this.get(e)];case 1:return t=n.sent(),[2,t?JSON.stringify(t):void 0]}})})},e.prototype.set=function(e,t){return Z(this,void 0,void 0,function(){return Q(this,function(n){return this.memoryStorage.set(e,t),[2]})})},e.prototype.remove=function(e){return Z(this,void 0,void 0,function(){return Q(this,function(t){return this.memoryStorage.delete(e),[2]})})},e.prototype.reset=function(){return Z(this,void 0,void 0,function(){return Q(this,function(e){return this.memoryStorage.clear(),[2]})})},e}(),s_=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return Z(this,void 0,void 0,function(){var t,n,r,i;return Q(this,function(a){switch(a.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),n=new e(this.storage),r=`AMP_TEST`,a.label=1;case 1:return a.trys.push([1,4,5,7]),[4,n.set(r,t)];case 2:return a.sent(),[4,n.get(r)];case 3:return i=a.sent(),[2,i===t];case 4:return a.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return a.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(e){return Z(this,void 0,void 0,function(){var t;return Q(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return t=n.sent(),t?[2,JSON.parse(t)]:[2,void 0];case 2:return n.sent(),console.error(`[Amplitude] Error: Could not get value from storage`),[2,void 0];case 3:return[2]}})})},e.prototype.getRaw=function(e){return Z(this,void 0,void 0,function(){return Q(this,function(t){return[2,this.storage?.getItem(e)||void 0]})})},e.prototype.set=function(e,t){var n;return Z(this,void 0,void 0,function(){return Q(this,function(r){try{(n=this.storage)==null||n.setItem(e,JSON.stringify(t))}catch{}return[2]})})},e.prototype.remove=function(e){var t;return Z(this,void 0,void 0,function(){return Q(this,function(n){try{(t=this.storage)==null||t.removeItem(e)}catch{}return[2]})})},e.prototype.reset=function(){var e;return Z(this,void 0,void 0,function(){return Q(this,function(t){try{(e=this.storage)==null||e.clear()}catch{}return[2]})})},e}(),c_=function(){function e(){}return e.prototype.send=function(e,t,n){return Promise.resolve(null)},e.prototype.buildResponse=function(e){if(typeof e!=`object`)return null;var t=e.code||0,n=this.buildStatus(t);switch(n){case xg.Success:return{status:n,statusCode:t,body:{eventsIngested:e.events_ingested??0,payloadSizeBytes:e.payload_size_bytes??0,serverUploadTime:e.server_upload_time??0}};case xg.Invalid:return{status:n,statusCode:t,body:{error:e.error??``,missingField:e.missing_field??``,eventsWithInvalidFields:e.events_with_invali
270d_fields??{},eventsWithMissingFields:e.events_with_missing_fields??{},eventsWithInvalidIdLengths:e.events_with_invalid_id_lengths??{},epsThreshold:e.eps_threshold??0,exceededDailyQuotaDevices:e.exceeded_daily_quota_devices??{},silencedDevices:e.silenced_devices??[],silencedEvents:e.silenced_events??[],throttledDevices:e.throttled_devices??{},throttledEvents:e.throttled_events??[]}};case xg.PayloadTooLarge:return{status:n,statusCode:t,body:{error:e.error??``}};case xg.RateLimit:return{status:n,statusCode:t,body:{error:e.error??``,epsThreshold:e.eps_threshold??0,throttledDevices:e.throttled_devices??{},throttledUsers:e.throttled_users??{},exceededDailyQuotaDevices:e.exceeded_daily_quota_devices??{},exceededDailyQuotaUsers:e.exceeded_daily_quota_users??{},throttledEvents:e.throttled_events??[]}};case xg.Timeout:default:return{status:n,statusCode:t}}},e.prototype.buildStatus=function(e){return Kg(e)?xg.Success:e===429?xg.RateLimit:e===413?xg.PayloadTooLarge:e===408?xg.Timeout:e>=400&&e<500?xg.Invalid:e>=500?xg.Failed:xg.Unknown},e}(),l_=function(){function e(){}return e.prototype.parse=function(){return Z(this,void 0,void 0,function(){return Q(this,function(e){return[2,X(X(X(X({},lg),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var e=r_();return{utm_campaign:e[Kh],utm_content:e[qh],utm_id:e[Jh],utm_medium:e[Yh],utm_source:e[Xh],utm_term:e[Zh]}},e.prototype.getReferrer=function(){var e={referrer:void 0,referring_domain:void 0};try{e.referrer=document.referrer||void 0,e.referring_domain=e.referrer?.split(`/`)[2]??void 0}catch{}return e},e.prototype.getClickIds=function(){var e,t=r_();return e={},e[Qh]=t[Qh],e[$h]=t[$h],e[eg]=t[eg],e[tg]=t[tg],e[ng]=t[ng],e[rg]=t[rg],e[ig]=t[ig],e[ag]=t[ag],e[og]=t[og],e[sg]=t[sg],e[cg]=t[cg],e},e}(),u_=`*****`,d_=/\b(?:\d[ -]*?){13,16}\b/,f_=/(\d{3}-?\d{2}-?\d{4})/g,p_=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,m_=function(e,t){var n,r;if(t===void 0&&(t=[]),typeof e!=`string`)return``;var i=e;i=i.replace(d_,u_),i=i.replace(f_,u_),i=i.replace(p_,u_);try{for(var a=Fh(t),o=a.next();!o.done;o=a.next()){var s=o.value;try{i=i.replace(s,u_)}catch{}}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},h_=function(e){if(typeof document>`u`||!document.title)return``;var t=document.querySelector(`title`);return t&&t.hasAttribute(`data-amp-mask`)?u_:e?e(document.title):document.title},g_=function(e,t){return g_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},g_(e,t)};function __(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);g_(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var v_=function(){return v_=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},v_.apply(this,arguments)};function y_(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function b_(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>
2700&&a[a.length-1]))&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function x_(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}var S_=function(e,t){return S_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},S_(e,t)};function C_(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);S_(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var w_=function(){return w_=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},w_.apply(this,arguments)};function T_(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function E_(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function D_(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function O_(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}var k_=function(){var e=`ampIntegrationContext`;if(typeof globalThis<`u`&&globalThis[e]!==void 0)return globalThis[e];if(typeof globalThis<`u`)return globalThis;if(typeof window<`u`)return window;if(typeof self<`u`)return self;if(typeof global<`u`)return global},A_=function(){var e=k_();return e?.location?.search?e.location.search.substring(1).split(`&`).filter(Boolean).reduce(function(e,t){var n=t.split(`=`,2),r=j_(n[0]),i=j_(n[1]);return i&&(e[r]=i),e},{}):{}},j_=function(e){e===void 0&&(e=``);try{return decodeURIComponent(e)}catch{return``}},M_=`utm_campaign`,N_=`utm_content`,P_=`utm_id`,F_=`utm_medium`,I_=`utm_source`,L_=`utm_term`,R_=`dclid`,z_=`fbclid`,B_=`gbraid`,V_=`gclid`,H_=`ko_click_id`,U_=`li_fat_id`,W_=`msclkid`,G_=`rdt_cid`,K_=`ttclid`,q_=`twclid`,J_=`wbraid`,Y_={utm_campaign:void 0,utm_c
270ontent:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},X_=function(){function e(){}return e.prototype.parse=function(){return E_(this,void 0,void 0,function(){return D_(this,function(e){return[2,w_(w_(w_(w_({},Y_),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},e.prototype.getUtmParam=function(){var e=A_();return{utm_campaign:e[M_],utm_content:e[N_],utm_id:e[P_],utm_medium:e[F_],utm_source:e[I_],utm_term:e[L_]}},e.prototype.getReferrer=function(){var e={referrer:void 0,referring_domain:void 0};try{e.referrer=document.referrer||void 0,e.referring_domain=e.referrer?.split(`/`)[2]??void 0}catch{}return e},e.prototype.getClickIds=function(){var e,t=A_();return e={},e[R_]=t[R_],e[z_]=t[z_],e[B_]=t[B_],e[V_]=t[V_],e[H_]=t[H_],e[U_]=t[U_],e[W_]=t[W_],e[G_]=t[G_],e[K_]=t[K_],e[q_]=t[q_],e[J_]=t[J_],e},e}(),Z_=function(e,t,n){return t===void 0&&(t=``),n===void 0&&(n=10),[`AMP`,t,e.substring(0,n)].filter(Boolean).join(`_`)},Q_=function(e){return`amp_${e.substring(0,6)}`},$_=function(e){var t=e.split(`.`);return t.length<=2?e:t.slice(t.length-2,t.length).join(`.`)},ev=function(e){return Object.values(e).every(function(e){return!e})},tv=function(e,t,n,r,i){i===void 0&&(i=!0),e.referrer;var a=e.referring_domain,o=T_(e,[`referrer`,`referring_domain`]),s=t||{};s.referrer;var c=s.referring_domain,l=T_(s,[`referrer`,`referring_domain`]);if(nv(n.excludeReferrers,e.referring_domain))return r.debug(`This is not a new campaign because ${e.referring_domain} is in the exclude referrer list.`),!1;if(!i&&ev(e)&&t)return r.debug(`This is not a new campaign because this is a direct traffic in the same session.`),!1;var u=JSON.stringify(o)!==JSON.stringify(l),d=$_(a||``)!==$_(c||``),f=!t||u||d;return f?r.debug(`This is a new campaign. An $identify event will be sent.`):r.debug(`This is not a new campaign because it's the same as the previous one.`),f},nv=function(e,t){return e===void 0&&(e=[]),t===void 0&&(t=``),e.some(function(e){return e instanceof RegExp?e.test(t):e===t})},rv=function(e,t){var n=w_(w_({},Y_),e);return kg(Object.entries(n).reduce(function(e,n){var r=O_(n,2),i=r[0],a=r[1];return e.setOnce(`initial_${i}`,a??t.initialEmptyValue??`EMPTY`),a?e.set(i,a):e.unset(i)},new pg))},iv=function(e){var t=e;return t?(t.startsWith(`.`)&&(t=t.substring(1)),[RegExp(`${t.replace(`.`,`\\.`)}\$`)]):[]},av=function(e,t,n){return t===void 0&&(t=``),n===void 0&&(n=10),[`AMP`,t,e.substring(0,n)].filter(Boolean).join(`_`)},ov=function(e,t){return t===void 0&&(t=Date.now()),Date.now()-t>e},sv=function(){function e(e,t){this.shouldTrackNewCampaign=!1,this.options=w_({initialEmptyValue:`EMPTY`,resetSessionOnNewCampaign:!1,excludeReferrers:iv(t.cookieOptions?.domain)},e),this.storage=t.cookieStorage,this.storageKey=av(t.apiKey,`MKTG`),this.currentCampaign=Y_,this.sessionTimeout=t.sessionTimeout,this.lastEventTime=t.lastEventTime,this.logger=t.loggerProvider,t.loggerProvider.log(`Installing web attribution tracking.`)}return e.prototype.init=function(){return E_(this,void 0,void 0,function(){var e,t;return D_(this,function(n){switch(n.label){case 0:return[4,this.fetchCampaign()];case 1:return t=O_.apply(void 0,[n.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||ov(this.sessionTimeout,this.lastEventTime),tv(this.currentCampaign,this.previousCampaign,this.options,this.logger,e)?(this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)]):[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}})})},e.prototype.fetchCampaign=function(){return E_(this,void 0,void 0,function(){return D_(this,function(e){switch(e.label){case 0:return[4,Promise.all([new X_().parse(),this.storage.get(this.storageKey)])];case 1:return[2,e.sent()]}})})},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var t=rv(this.currentCampaign,this.options);return e&&(t.event_id=e),t},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),cv=function(){function e(e){this.options=w_({},e)}return e.prototype.isEnabled=function(){return E_(this,void 0,void 0,function(){var t,n,r;return D_(this,function(i){switch(i.label){case 0:if(!k_())return[2,!1];e.testValue=String(Date.now()),t=new e(this.options),n=`AMP_TEST`,i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,t.set(n,e.testValue)];case 2:return i.sent(),[4,t.get(n)];case 3:return r=i.sent(),[2,r===e.testValue];case 4:return i.sent(),[2,!1];case 5:return[4,t.remove(n)];case 6:return i.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(e){return E_(this,void 0,void 0,function(){var t,n;return D_(this,function(r){switch(r.label){case 0:return[4,this.getRaw(e)];case 1:if(t=r.sent(),!t)return[2,void 0];try{return n=lv(t)??uv(t),n===void 0?(console.error(`Amplitude Logger [Error]: Failed to decode cookie value for key: ${e}, value: ${t}`),[2,void 0]):[2,JSON.parse(n)]}catch{return console.error(`Amplitude Logger [Error]: Failed to parse cookie value for key: ${e}, value: ${t}`),[2,void 0]}return[2]}})})},e.prototype.getRaw=function(e){return E_(this,void 0,void 0,function(){var t,n,r;return D_(this,function(i){return t=k_(),n=(t?.document)?.cookie.split(`; `)??[],r=n.find(function(t){return t.indexOf(e+`=`)===0}),r?[2,r.substring(e.length+1)]:[2,void 0]})})},e.prototype.set=function(e,t){return E_(this,void 0,void 0,function(){var n,r,i,a,o,s,c;return D_(this,function(l){try{n=this.options.expirationDays??0,r=t===null?-1:n,i=void 0,r&&(a=new Date,a.setTime(a.getTime()+r*24*60*60*1e3),i=a),o=`${e}=${btoa(encodeURIComponent(JSON.stringify(t)))}`,i&&(o+=`; expires=${i.toUTCString()}`),o+=`; path=/`,this.options.domain&&(o+=`; domain=${this.options.domain}`),this.options.secure&&(o+=`; Secure`),this.options.sameSite&&(o+=`; SameSite=${this.options.sameSite}`),s=k_(),s&&(s.document.cookie=o)}catch(t){c=t instanceof Error?t.message:String(t),console.error(`Amplitude Logger [Error]: Failed to set cookie for key: ${e}. Error: ${c}`)}return[2]})})},e.prototype.remove=function(e){return E_(this,void 0,void 0,function(){return D_(this,function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}})})},e.prototype.reset=function(){return E_(this,void 0,void 0,function(){return D_(this,function(e){return[2]})})},e}(),lv=function(e){try{return decodeURIComponent(atob(e))}catch{return}},uv=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch{return}},dv=function(e){C_(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.send=function(e,t){return E_(this,void 0,void 0,function(){var n,r,i;return D_(this,function(a){switch(a.label){case 0:if(typeof fetch>`u`)throw Error(`FetchTransport is not supported`);return n={headers:{"Content-Type":`application/json`,Accept:`*/*`},body:JSON.stringify(t),method:`POST`}
270,[4,fetch(e,n)];case 1:return r=a.sent(),[4,r.text()];case 2:i=a.sent();try{return[2,this.buildResponse(JSON.parse(i))]}catch{return[2,this.buildResponse({code:r.status})]}return[2]}})})},t}(c_),fv=function(e){return e===void 0&&(e=`$default_instance`),Yf.getInstance(e)},pv=function(e,t){fv(t).identityStore.editIdentity().setUserId(e).commit()},mv=function(e,t){fv(t).identityStore.editIdentity().setDeviceId(e).commit()},hv=function(){function e(){this.name=`identity`,this.type=`before`,this.identityStore=fv().identityStore}return e.prototype.execute=function(e){return E_(this,void 0,void 0,function(){var t;return D_(this,function(n){return t=e.user_properties,t&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]})})},e.prototype.setup=function(e){return E_(this,void 0,void 0,function(){return D_(this,function(t){return e.instanceName&&(this.identityStore=fv(e.instanceName).identityStore),[2]})})},e}(),gv=function(){if(typeof navigator>`u`)return``;var e=navigator.userLanguage;return navigator.languages?.[0]??navigator.language??e??``},_v=function(e,t){return typeof e==`boolean`?e:e?.[t]!==!1},vv=function(e){return _v(e,`attribution`)},yv=function(e){return _v(e,`fileDownloads`)},bv=function(e){return _v(e,`formInteractions`)},xv=function(e){return _v(e,`pageViews`)},Sv=function(e){return _v(e,`sessions`)},Cv=function(e){var t=function(){return!1},n=void 0,r,i=e.pageCounter;return xv(e.defaultTracking)&&(t=void 0,r=void 0,e.defaultTracking&&typeof e.defaultTracking==`object`&&e.defaultTracking.pageViews&&typeof e.defaultTracking.pageViews==`object`&&(`trackOn`in e.defaultTracking.pageViews&&(t=e.defaultTracking.pageViews.trackOn),`trackHistoryChanges`in e.defaultTracking.pageViews&&(n=e.defaultTracking.pageViews.trackHistoryChanges),`eventType`in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(r=e.defaultTracking.pageViews.eventType))),{trackOn:t,trackHistoryChanges:n,eventType:r,pageCounter:i}},wv=function(e){return vv(e.defaultTracking)&&e.defaultTracking&&typeof e.defaultTracking==`object`&&e.defaultTracking.attribution&&typeof e.defaultTracking.attribution==`object`?w_({},e.defaultTracking.attribution):{}},Tv=function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.name,a=r.args,o=r.resolve,s=e&&e[i];if(typeof s==`function`){var c=s.apply(e,a);typeof o==`function`&&o(c?.promise)}}return e},Ev=function(e){var t=e;return t&&t._q!==void 0},Dv=`2.3.8`,Ov=`Web`,kv=`$remote`,Av=function(){function e(){this.name=`@amplitude/plugin-context-browser`,this.type=`before`,this.library=`amplitude-ts/${Dv}`,typeof navigator<`u`&&(this.userAgent=navigator.userAgent)}return e.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},e.prototype.execute=function(e){return y_(this,void 0,void 0,function(){var t,n,r,i;return b_(this,function(a){return t=new Date().getTime(),n=this.config.lastEventId??-1,r=e.event_id??n+1,this.config.lastEventId=r,e.time||(this.config.lastEventTime=t),i=v_(v_(v_(v_(v_(v_(v_(v_({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:t},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:Ov}),this.config.trackingOptions.language&&{language:gv()}),this.config.trackingOptions.ipAddress&&{ip:kv}),{insert_id:Eg(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),e),{event_id:r,library:this.library,user_agent:this.userAgent}),[2,i]})})},e}(),jv;(function(e){e.SET=`$set`,e.SET_ONCE=`$setOnce`,e.ADD=`$add`,e.APPEND=`$append`,e.PREPEND=`$prepend`,e.REMOVE=`$remove`,e.PREINSERT=`$preInsert`,e.POSTINSERT=`$postInsert`,e.UNSET=`$unset`,e.CLEAR_ALL=`$clearAll`})(jv||={});var Mv;(function(e){e.REVENUE_PRODUCT_ID=`$productId`,e.REVENUE_QUANTITY=`$quantity`,e.REVENUE_PRICE=`$price`,e.REVENUE_TYPE=`$revenueType`,e.REVENUE_CURRENCY=`$currency`,e.REVENUE=`$revenue`})(Mv||={});var Nv;(function(e){e.IDENTIFY=`$identify`,e.GROUP_IDENTIFY=`$groupidentify`,e.REVENUE=`revenue_amount`})(Nv||={});var Pv;(function(e){e[e.None=0]=`None`,e[e.Error=1]=`Error`,e[e.Warn=2]=`Warn`,e[e.Verbose=3]=`Verbose`,e[e.Debug=4]=`Debug`})(Pv||={});var Fv=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return y_(this,void 0,void 0,function(){var t,n,r,i;return b_(this,function(a){switch(a.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),n=new e(this.storage),r=`AMP_TEST`,a.label=1;case 1:return a.trys.push([1,4,5,7]),[4,n.set(r,t)];case 2:return a.sent(),[4,n.get(r)];case 3:return i=a.sent(),[2,i===t];case 4:return a.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return a.sent(),[7];case 7:return[2]}})})},e.prototype.get=function(e){return y_(this,void 0,void 0,function(){var t;return b_(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return t=n.sent(),t?[2,JSON.parse(t)]:[2,void 0];case 2:return n.sent(),console.error(`[Amplitude] Error: Could not get value from storage`),[2,void 0];case 3:return[2]}})})},e.prototype.getRaw=function(e){return y_(this,void 0,void 0,function(){return b_(this,function(t){return[2,this.storage?.getItem(e)||void 0]})})},e.prototype.set=function(e,t){var n;return y_(this,void 0,void 0,function(){return b_(this,function(r){try{(n=this.storage)==null||n.setItem(e,JSON.stringify(t))}catch{}return[2]})})},e.prototype.remove=function(e){var t;return y_(this,void 0,void 0,function(){return b_(this,function(n){try{(t=this.storage)==null||t.removeItem(e)}catch{}return[2]})})},e.prototype.reset=function(){var e;return y_(this,void 0,void 0,function(){return b_(this,function(t){try{(e=this.storage)==null||e.clear()}catch{}return[2]})})},e}(),Iv=1e3,Lv=function(e){__(t,e);function t(t){var n=this;return n=e.call(this,k_()?.localStorage)||this,n.loggerProvider=t?.loggerProvider,n}return t.prototype.set=function(t,n){var r;return y_(this,void 0,void 0,function(){var i;return b_(this,function(a){switch(a.label){case 0:return Array.isArray(n)&&n.length>Iv?(i=n.length-Iv,[4,e.prototype.set.call(this,t,n.slice(0,Iv))]):[3,2];case 1:return a.sent(),(r=this.loggerProvider)==null||r.error(`Failed to save ${i} events because the queue length exceeded ${Iv}.`),[3,4];case 2:return[4,e.prototype.set.call(this,t,n)];case 3:a.sent(),a.label=4;case 4:return[2]}})})},t}(Fv),Rv=function(e){__(t,e);function t(){return e.call(this,k_()?.sessionStorage)||this}return t}(Fv),zv=function(e){__(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.state={done:4},t}return t.prototype.send=function(e,t){return y_(this,void 0,void 0,function(){var n=this;return b_(this,function(r){return[2,new Promise(function(r,i){typeof XMLHttpRequest>`u`&&i(Error(`XHRTransport is not supported.`));var a=new XMLHttpRequest;a.open(`POST`,e,!0),a.onreadystatechange=function(){if(a.readyState===n.state.done)try{var e=a.responseText,t=JSON.parse(e);r(n.buildResponse(t))}catch(e){i(e)}},a.setRequestHeader(`Content-Type`,`application/json`),a.setRequestHeader(`Accept`,`*/*`),a.send(JSON.stringify(t))})]})})},t}(c_),Bv=function(e){__(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.send=function(e,t){return y_(this,void 0,void 0,function(){var n=this;return b_(this,function(r){return[2,new Promise(function(r,i){var a=k_();if(!a?.navigator.sendBeacon)throw Error(`SendBeaconTransport is not supported`);try{var o=JSON.stringify(t);return a.navigator.sendBeacon(e,JSON.stringify(t))?r(n.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:o.length,server_upload_time:Date.now()})):r(n.buildResponse({code:500}))}catch(e){i(e)}})]})})},t}(c_),Vv=function(e,t,n){return n===void 0&&(n=!0),y_(void 0,void 0,void 0,function(){var r,i,a,o,s,c,l,u,d;return b_(this,function(f){switch(f.label){case 0:return r=Q_(e),[4,t.getRaw(r)];case 1:return i=f.sent(),i?n?[4,t.remove(r)]:[3,3]:[2,{optOut:!1}];case 2:f.sent(),f.label=3;case 3:return a=x_(i.split(`.`),6),o=a[0],s=a[1],c=a[2],l=a[3],u=a[4],d=a[5],[2,{deviceId:o,userId:Uv(s),sessionId:Hv(l),lastEventId:Hv(d),lastEventTime:Hv(u),optOut:!!c}
270]}})})},Hv=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},Uv=function(e){if(!(!atob||!escape||!e))try{return decodeURIComponent(escape(atob(e)))}catch{return}},Wv=`[Amplitude]`;`${Wv}`;var Gv=`${Wv} Form Started`,Kv=`${Wv} Form Submitted`,qv=`${Wv} File Downloaded`,Jv=`session_start`,Yv=`session_end`,Xv=`${Wv} File Extension`,Zv=`${Wv} File Name`,Qv=`${Wv} Link ID`,$v=`${Wv} Link Text`,ey=`${Wv} Link URL`,ty=`${Wv} Form ID`,ny=`${Wv} Form Name`,ry=`${Wv} Form Destination`,iy=`cookie`,ay=function(e){__(t,e);function t(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k){r===void 0&&(r=new o_),i===void 0&&(i={domain:``,expiration:365,sameSite:`Lax`,secure:!1,upgrade:!0}),s===void 0&&(s=1e3),c===void 0&&(c=5),l===void 0&&(l=30),u===void 0&&(u=iy),h===void 0&&(h=new Bg),g===void 0&&(g=Pv.Warn),v===void 0&&(v=!1),x===void 0&&(x=``),S===void 0&&(S=`US`),w===void 0&&(w=1800*1e3),T===void 0&&(T=new Lv({loggerProvider:h})),E===void 0&&(E={ipAddress:!0,language:!0,platform:!0}),D===void 0&&(D=`fetch`),O===void 0&&(O=!1);var A=e.call(this,{apiKey:t,storageProvider:T,transportProvider:cy(D)})||this;return A.apiKey=t,A.appVersion=n,A.cookieOptions=i,A.defaultTracking=a,A.flushIntervalMillis=s,A.flushMaxRetries=c,A.flushQueueSize=l,A.identityStorage=u,A.ingestionMetadata=d,A.instanceName=f,A.loggerProvider=h,A.logLevel=g,A.minIdLength=_,A.partnerId=y,A.plan=b,A.serverUrl=x,A.serverZone=S,A.sessionTimeout=w,A.storageProvider=T,A.trackingOptions=E,A.transport=D,A.useBatch=O,A._optOut=!1,A._cookieStorage=r,A.deviceId=o,A.lastEventId=p,A.lastEventTime=m,A.optOut=v,A.sessionId=C,A.userId=k,A.loggerProvider.enable(A.logLevel),A}return Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(e){this._cookieStorage!==e&&(this._cookieStorage=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(e){this._deviceId!==e&&(this._deviceId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(e){this._userId!==e&&(this._userId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(e){this._sessionId!==e&&(this._sessionId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut!==e&&(this._optOut=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(e){this._lastEventTime!==e&&(this._lastEventTime=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(e){this._lastEventId!==e&&(this._lastEventId=e,this.updateStorage())},enumerable:!1,configurable:!0}),t.prototype.updateStorage=function(){var e={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId};this.cookieStorage.set(Z_(this.apiKey),e)},t}(Hg),oy=function(e,t,n){return t===void 0&&(t={}),y_(void 0,void 0,void 0,function(){var r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y;return b_(this,function(b){switch(b.label){case 0:return r=t.identityStorage||`cookie`,v={},r===`cookie`?[3,1]:(a=``,[3,5]);case 1:return(y=t.cookieOptions?.domain)==null?[3,2]:(o=y,[3,4]);case 2:return[4,ly()];case 3:o=b.sent(),b.label=4;case 4:a=o,b.label=5;case 5:return i=v_.apply(void 0,[(v.domain=a,v.expiration=365,v.sameSite=`Lax`,v.secure=!1,v.upgrade=!0,v),t.cookieOptions]),s=sy(t.identityStorage,i),[4,Vv(e,s,t.cookieOptions?.upgrade??!0)];case 6:return c=b.sent(),[4,s.get(Z_(e))];case 7:return l=b.sent(),u=A_(),d=t.deviceId??u.deviceId??l?.deviceId??c.deviceId??Eg(),f=l?.lastEventId??c.lastEventId,p=l?.lastEventTime??c.lastEventTime,m=t.optOut??l?.optOut??c.optOut,h=l?.sessionId??c.sessionId,g=t.userId??l?.userId??c.userId,n.previousSessionDeviceId=l?.deviceId??c.deviceId,n.previousSessionUserId=l?.userId??c.userId,_={ipAddress:t.trackingOptions?.ipAddress??!0,language:t.trackingOptions?.language??!0,platform:t.trackingOptions?.platform??!0},[2,new ay(e,t.appVersion,s,i,t.defaultTracking,d,t.flushIntervalMillis,t.flushMaxRetries,t.flushQueueSize,r,t.ingestionMetadata,t.instanceName,f,p,t.loggerProvider,t.logLevel,t.minIdLength,m,t.partnerId,t.plan,t.serverUrl,t.serverZone,h,t.sessionTimeout,t.storageProvider,_,t.transport,t.useBatch,g)]}})})},sy=function(e,t){switch(e===void 0&&(e=iy),t===void 0&&(t={}),e){case`localStorage`:return new Lv;case`sessionStorage`:return new Rv;case`none`:return new o_;default:return new cv(v_(v_({},t),{expirationDays:t.expiration}))}},cy=function(e){return e===`xhr`?new zv:e===`beacon`?new Bv:new dv},ly=function(e){return y_(void 0,void 0,void 0,function(){var t,n,r,i,a,a,o,s,c,l;return b_(this,function(u){switch(u.label){case 0:return[4,new cv().isEnabled()];case 1:if(!u.sent()||!e&&typeof location>`u`)return[2,``];for(t=e??location.hostname,n=t.split(`.`),r=[],i=`AMP_TLDTEST`,a=n.length-2;a>=0;--a)r.push(n.slice(a).join(`.`));a=0,u.label=2;case 2:return a<r.length?(o=r[a],s={domain:`.`+o},c=new cv(s),[4,c.set(i,1)]):[3,7];case 3:return u.sent(),[4,c.get(i)];case 4:return l=u.sent(),l?[4,c.remove(i)]:[3,6];case 5:return u.sent(),[2,`.`+o];case 6:return a++,[3,2];case 7:return[2,``]}})})};function uy(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function dy(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(
270o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}var fy=function(e){var t=this;return e===void 0&&(e={}),{name:`@amplitude/plugin-web-attribution-browser`,type:`before`,setup:function(t,n){return uy(this,void 0,void 0,function(){var r,i,a,o,s,c;return dy(this,function(l){switch(l.label){case 0:return r=new sv(e,t),[4,r.init()];case 1:return l.sent(),i=r.options,a=r.currentCampaign,o=r.previousCampaign,s=ov(t.sessionTimeout,t.lastEventTime),tv(a,o,i,t.loggerProvider,s)&&(i.resetSessionOnNewCampaign&&(n.setSessionId(Date.now()),t.loggerProvider.log(`Created a new session for new campaign.`)),t.loggerProvider.log(`Tracking attribution.`),c=r.generateCampaignEvent(),n.track(c)),[2]}})})},execute:function(e){return uy(t,void 0,void 0,function(){return dy(this,function(t){return[2,e]})})}}},py=function(){return py=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},py.apply(this,arguments)};function my(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function hy(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function gy(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function _y(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var vy=`[Amplitude] Page Viewed`,yy=`AMP_PAGE_VIEW`,by=function(e){e===void 0&&(e={});var t,n=Cg(),r=void 0,i=!1,a,o,s=e.trackOn,c=e.trackHistoryChanges,l=e.eventType,u=l===void 0?vy:l,d=function(e){var t=e;try{t=decodeURI(e)}catch(e){r?.error(`Malformed URI sequence: `,e)}return t},f=function(e){return my(void 0,void 0,void 0,function(){var t,n,r;return hy(this,function(i){switch(i.label){case 0:return t=d(typeof location<`u`&&location.href||``),r={event_type:u},n=[{}],[4,xy()];case 1:return[2,(r.event_properties=py.apply(void 0,[py.apply(void 0,n.concat([i.sent()])),{"[Amplitude] Page Domain":typeof location<`u`&&location.hostname||``,"[Amplitude] Page Location":t,"[Amplitude] Page Path":typeof location<`u`&&d(location.pathname)||``,"[Amplitude] Page Title":h_(m_),"[Amplitude] Page URL":t.split(`?`)[0],"[Amplitude] Page View ID":e}]),r)]}})})},p=function(){return s===void 0||typeof s==`function`&&s()},m=typeof location<`u`?location.href:null,h=function(){return my(void 0,void 0,void 0,function(){var e,n,i,a,s;return hy(this,function(l){switch(l.label){case 0:return e=location.href,n=Cy(c,e,m||``)&&p(),m=e,n?(i=void 0,o&&(i=Eg(),o.set(yy,{pageViewId:i})),r?.log(`Tracking page view event`),t==null?[3,3]:[3,1]):[3,4];case 1:return s=(a=t).track,[4,f(i)];case 2:s.apply(a,[l.sent()]),l.label=3;case 3:l.label=4;case 4:return[2]}})})},g=function(){h()};return{name:`@amplitude/plugin-page-view-tracking-browser`,type:`enrichment`,setup:function(e,s){return my(void 0,void 0,void 0,function(){var c,l,u;return hy(this,function(d){switch(d.label){case 0:if(t=s,a=e,r=e.loggerProvider,r.log(`Installing @amplitude/plugin-page-view-tracking-browser`),i=!0,n){try{o=new s_(n.sessionStorage)}catch{r?.debug(`sessionStorage is not available in this environment.`)}n.addEventListener(`popstate`,g),n.history.pushState=new Proxy(n.history.pushState,{apply:function(e,t,n){var r=gy(n,3),a=r[0],o=r[1],s=r[2];e.apply(t,[a,o,s]),i&&g()}})}return p()?(r.log(`Tracking page view event`),c=void 0,o&&(c=Eg(),o.set(yy,{pageViewId:c})),u=(l=t).track,[4,f(c)]):[3,2];case 1:u.apply(l,[d.sent()]),d.label=2;case 2:return[2]}})})},execute:function(e){return my(void 0,void 0,void 0,function(){var t,n,i;return hy(this,function(c){switch(c.label){case 0:return s===`attribution`&&Sy(e)?(r?.log(`Enriching c
270ampaign event to page view event with campaign parameters`),t=void 0,o?[4,o.get(yy)]:[3,2]):[3,4];case 1:n=c.sent(),t=n?.pageViewId,c.label=2;case 2:return[4,f(t)];case 3:i=c.sent(),e.event_type=i.event_type,e.event_properties=py(py({},e.event_properties),i.event_properties),c.label=4;case 4:return a&&e.event_type===u&&(a.pageCounter=a.pageCounter?a.pageCounter+1:1,e.event_properties=py(py({},e.event_properties),{"[Amplitude] Page Counter":a.pageCounter})),[2,e]}})})},teardown:function(){return my(void 0,void 0,void 0,function(){return hy(this,function(e){return n&&(n.removeEventListener(`popstate`,g),i=!1),[2]})})}}},xy=function(){return my(void 0,void 0,void 0,function(){var e;return hy(this,function(t){switch(t.label){case 0:return e=a_,[4,new l_().parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}})})},Sy=function(e){if(e.event_type===`$identify`&&e.user_properties){var t=e.user_properties,n=t[Rh.SET]||{},r=t[Rh.UNSET]||{},i=_y(_y([],gy(Object.keys(n)),!1),gy(Object.keys(r)),!1);return Object.keys(lg).every(function(e){return i.includes(e)})}return!1},Cy=function(e,t,n){switch(e){case`pathOnly`:if(n==``)return!0;var r=new URL(t),i=new URL(n);return r.origin+r.pathname!==i.origin+i.pathname;default:return t!==n}},wy=function(){var e,t=[],n=function(e,n,r){e.addEventListener(n,r),t.push({element:e,type:n,handler:r})},r=function(){t.forEach(function(e){var t=e.element,n=e.type,r=e.handler;t?.removeEventListener(n,r)}),t=[]};return{name:`@amplitude/plugin-form-interaction-tracking-browser`,type:`enrichment`,setup:function(t,r){return y_(void 0,void 0,void 0,function(){var i,a;return b_(this,function(o){return r?typeof document>`u`?[2]:(i=function(e){var t=!1;n(e,`change`,function(){var n;t||r.track(Gv,(n={},n[ty]=Ty(e.id),n[ny]=Ty(e.name),n[ry]=e.action,n)),t=!0}),n(e,`submit`,function(){var n,i;t||r.track(Gv,(n={},n[ty]=Ty(e.id),n[ny]=Ty(e.name),n[ry]=e.action,n)),r.track(Kv,(i={},i[ty]=Ty(e.id),i[ny]=Ty(e.name),i[ry]=e.action,i)),t=!1})},a=Array.from(document.getElementsByTagName(`form`)),a.forEach(i),typeof MutationObserver<`u`&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){e.nodeName===`FORM`&&i(e),`querySelectorAll`in e&&typeof e.querySelectorAll==`function`&&Array.from(e.querySelectorAll(`form`)).map(i)})})}),e.observe(document.body,{subtree:!0,childList:!0})),[2]):(t.loggerProvider.warn(`Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.`),[2])})})},execute:function(e){return y_(void 0,void 0,void 0,function(){return b_(this,function(t){return[2,e]})})},teardown:function(){return y_(void 0,void 0,void 0,function(){return b_(this,function(t){return e?.disconnect(),r(),[2]})})}}},Ty=function(e){if(typeof e==`string`)return e},Ey=function(){var e,t=[],n=function(e,n,r){e.addEventListener(n,r),t.push({element:e,type:n,handler:r})},r=function(){t.forEach(function(e){var t=e.element,n=e.type,r=e.handler;t?.removeEventListener(n,r)}),t=[]};return{name:`@amplitude/plugin-file-download-tracking-browser`,type:`enrichment`,setup:function(t,r){return y_(void 0,void 0,void 0,function(){var i,a,o;return b_(this,function(s){return r?typeof document>`u`?[2]:(i=function(e){var t;try{t=new URL(e.href,window.location.href)}catch{return}var i=a.exec(t.href)?.[1];i&&n(e,`click`,function(){var n;i&&r.track(qv,(n={},n[Xv]=i,n[Zv]=t.pathname,n[Qv]=e.id,n[$v]=e.text,n[ey]=e.href,n))})},a=/\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)$/,o=Array.from(document.getElementsByTagName(`a`)),o.forEach(i),typeof MutationObserver<`u`&&(e=new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){e.nodeName===`A`&&i(e),`querySelectorAll`in e&&typeof e.querySelectorAll==`function`&&Array.from(e.querySelectorAll(`a`)).map(i)})})}),e.observe(document.body,{subtree:!0,childList:!0})),[2]):(t.loggerProvider.warn(`File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.`),[2])})})},execute:function(e){return y_(void 0,void 0,void 0,function(){return b_(this,function(t){return[2,e]})})},teardown:function(){return y_(void 0,void 0,void 0,function(){return b_(this,function(t){return e?.disconnect(),r(),[2]})})}}},Dy=!1,Oy=function(e){Dy||e.defaultTracking!==void 0||(e.loggerProvider.warn(`\`options.defaultTracking\` is set to undefined. This implicitly configures your Amplitude instance to track Page Views, Sessions, File Downloads, and Form Interactions. You can suppress this warning by explicitly setting a value to \`options.defaultTracking\`. The value must either be a boolean, to enable and disable all default events, or an object, for advanced configuration. For example:
271
272amplitude.init(<YOUR_API_KEY>, {
273  defaultTracking: true,
274});
275
276Visit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details.`),Dy=!0)},ky=function(e){__(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.init=function(e,t,n){e===void 0&&(e=``);var r,i;return arguments.length>
2762?(r=t,i=n):typeof t==`string`?(r=t,i=void 0):(r=t?.userId,i=t),Ng(this._init(v_(v_({},i),{userId:r,apiKey:e})))},t.prototype._init=function(t){return y_(this,void 0,void 0,function(){var n,r,i,a,o=this;return b_(this,function(s){switch(s.label){case 0:return this.initializing?[2]:(this.initializing=!0,[4,oy(t.apiKey,t,this)]);case 1:return n=s.sent(),[4,e.prototype._init.call(this,n)];case 2:return s.sent(),this.setSessionId(t.sessionId??this.config.sessionId??Date.now()),r=fv(t.instanceName),r.identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),[4,this.add(new n_).promise];case 3:return s.sent(),[4,this.add(new Av).promise];case 4:return s.sent(),[4,this.add(new hv).promise];case 5:return s.sent(),Oy(this.config),yv(this.config.defaultTracking)?[4,this.add(Ey()).promise]:[3,7];case 6:s.sent(),s.label=7;case 7:return bv(this.config.defaultTracking)?[4,this.add(wy()).promise]:[3,9];case 8:s.sent(),s.label=9;case 9:return vv(this.config.defaultTracking)?(i=wv(this.config),a=fy(i),[4,this.add(a).promise]):[3,11];case 10:s.sent(),s.label=11;case 11:return[4,this.add(by(Cv(this.config))).promise];case 12:return s.sent(),this.initializing=!1,[4,this.runQueuedFunctions(`dispatchQ`)];case 13:return s.sent(),r.eventBridge.setEventReceiver(function(e){o.track(e.eventType,e.eventProperties)}),[2]}})})},t.prototype.getUserId=function(){return this.config?.userId},t.prototype.setUserId=function(e){if(!this.config){this.q.push(this.setUserId.bind(this,e));return}(e!==this.config.userId||e===void 0)&&(this.config.userId=e,pv(e,this.config.instanceName))},t.prototype.getDeviceId=function(){return this.config?.deviceId},t.prototype.setDeviceId=function(e){if(!this.config){this.q.push(this.setDeviceId.bind(this,e));return}this.config.deviceId=e,mv(e,this.config.instanceName)},t.prototype.reset=function(){this.setDeviceId(Eg()),this.setUserId(void 0)},t.prototype.getSessionId=function(){return this.config?.sessionId},t.prototype.setSessionId=function(e){if(!this.config){this.q.push(this.setSessionId.bind(this,e));return}if(e!==this.config.sessionId){var t=this.getSessionId(),n=this.config.lastEventTime,r=this.config.lastEventId??-1;this.config.sessionId=e,this.config.lastEventTime=void 0,Sv(this.config.defaultTracking)&&(t&&n&&this.track(Yv,void 0,{device_id:this.previousSessionDeviceId,event_id:++r,session_id:t,time:n+1,user_id:this.previousSessionUserId}),this.config.lastEventTime=this.config.sessionId,this.track(Jv,void 0,{event_id:++r,session_id:this.config.sessionId,time:this.config.lastEventTime})),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId}},t.prototype.extendSession=function(){if(!this.config){this.q.push(this.extendSession.bind(this));return}this.config.lastEventTime=Date.now()},t.prototype.setTransport=function(e){if(!this.config){this.q.push(this.setTransport.bind(this,e));return}this.config.transportProvider=cy(e)},t.prototype.identify=function(t,n){if(Ev(t)){var r=t._q;t._q=[],t=Tv(new pg,r)}return n?.user_id&&this.setUserId(n.user_id),n?.device_id&&this.setDeviceId(n.device_id),e.prototype.identify.call(this,t,n)},t.prototype.groupIdentify=function(t,n,r,i){if(Ev(r)){var a=r._q;r._q=[],r=Tv(new pg,a)}return e.prototype.groupIdentify.call(this,t,n,r,i)},t.prototype.revenue=function(t,n){if(Ev(t)){var r=t._q;t._q=[],t=Tv(new Fg,r)}return e.prototype.revenue.call(this,t,n)},t.prototype.process=function(t){return y_(this,void 0,void 0,function(){var n,r;return b_(this,function(i){return n=Date.now(),r=ov(this.config.sessionTimeout,this.config.lastEventTime),t.event_type!==`session_start`&&t.event_type!==`session_end`&&(!t.session_id||t.session_id===this.getSessionId())&&r&&this.setSessionId(n),[2,e.prototype.process.call(this,t)]})})},t}(Pg),Ay=function(){var e=new ky;return{init:Zg(e.init.bind(e),`init`,Jg(e),Xg(e,[`config`])),add:Zg(e.add.bind(e),`add`,Jg(e),Xg(e,[`config.apiKey`,`timeline.plugins`])),remove:Zg(e.remove.bind(e),`remove`,Jg(e),Xg(e,[`config.apiKey`,`timeline.plugins`])),track:Zg(e.track.bind(e),`track`,Jg(e),Xg(e,[`config.apiKey`,`timeline.queue.length`])),logEvent:Zg(e.logEvent.bind(e),`logEvent`,Jg(e),Xg(e,[`config.apiKey`,`timeline.queue.length`])),identify:Zg(e.identify.bind(e),`identify`,Jg(e),Xg(e,[`config.apiKey`,`timeline.queue.length`])),groupIdentify:Zg(e.groupIdentify.bind(e),`groupIdentify`,Jg(e),Xg(e,[`config.apiKey`,`timeline.queue.length`])),setGroup:Zg(e.setGroup.bind(e),`setGroup`,Jg(e),Xg(e,[`config.apiKey`,`timeline.queue.length`])),revenue:Zg(e.revenue.bind(e),`revenue`,Jg(e),Xg(e,[`config.apiKey`,`timeline.queue.length`])),flush:Zg(e.flush.bind(e),`flush`,Jg(e),Xg(e,[`config.apiKey`,`timeline.queue.length`])),getUserId:Zg(e.getUserId.bind(e),`getUserId`,Jg(e),Xg(e,[`config`,`config.userId`])),setUserId:Zg(e.setUserId.bind(e),`setUserId`,Jg(e),Xg(e,[`config`,`config.userId`])),getDeviceId:Zg(e.getDeviceId.bind(e),`getDeviceId`,Jg(e),Xg(e,[`config`,`config.deviceId`])),setDeviceId:Zg(e.setDeviceId.bind(e),`setDeviceId`,Jg(e),Xg(e,[`config`,`config.deviceId`])),reset:Zg(e.reset.bind(e),`reset`,Jg(e),Xg(e,[`config`,`config.userId`,`config.deviceId`])),getSessionId:Zg(e.getSessionId.bind(e),`getSessionId`,Jg(e),Xg(e,[`config`])),setSessionId:Zg(e.setSessionId.bind(e),`setSessionId`,Jg(e),Xg(e,[`config`])),extendSession:Zg(e.extendSession.bind(e),`extendSession`,Jg(e),Xg(e,[`config`])),setOptOut:Zg(e.setOptOut.bind(e),`setOptOut`,Jg(e),Xg(e,[`config`])),setTransport:Zg(e.setTransport.bind(e),`setTransport`,Jg(e),Xg(e,[`config`]))}};Ay();var jy=function(){return jy=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},jy.apply(this,arguments)};function My(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function Ny(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(
276o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}var Py;(function(e){e.SET=`$set`,e.SET_ONCE=`$setOnce`,e.ADD=`$add`,e.APPEND=`$append`,e.PREPEND=`$prepend`,e.REMOVE=`$remove`,e.PREINSERT=`$preInsert`,e.POSTINSERT=`$postInsert`,e.UNSET=`$unset`,e.CLEAR_ALL=`$clearAll`})(Py||={});var Fy;(function(e){e.IDENTIFY=`$identify`,e.GROUP_IDENTIFY=`$groupidentify`,e.REVENUE=`revenue_amount`})(Fy||={});var Iy=function(){var e=`ampIntegrationContext`;if(typeof globalThis<`u`&&globalThis[e]!==void 0)return globalThis[e];if(typeof globalThis<`u`)return globalThis;if(typeof window<`u`)return window;if(typeof self<`u`)return self;if(typeof global<`u`)return global},Ly=`[Amplitude]`,Ry=`${Ly} Session Replay ID`,zy=op.US,By={enabled:!0},Vy=1e3,Hy=`${Ly} Session Replay Debug`,Uy=`amp-block`,Wy=`amp-mask`,Gy=`amp-unmask`,Ky=`https://api-sr.amplitude.com/sessions/v2/track`,qy=`https://api-sr.eu.amplitude.com/sessions/v2/track`,Jy=`https://api-sr.stag2.amplitude.com/sessions/v2/track`,Yy=2e6,Xy=6e6,Zy=9*1e6,Qy=/payload.*exceed/i,$y=3e4,eb=6e4,tb=10*1e3,nb=1e3,rb=10*1e3,ib=1024,ab=1e3,ob=64*1024,sb=1e4,cb=6e4;2*Yy;var lb=`amplitude-sr-iframe`,ub;(function(e){e.GET_SR_PROPS=`get-sr-props`,e.DEBUG_INFO=`debug-info`,e.FETCH_REQUEST=`fetch-request`,e.METADATA=`metadata`,e.TARGETING_DECISION=`targeting-decision`,e.REPLAY_GATE_DECISION=`replay-gate-decision`})(ub||={});var db=function(){function e(e){this.logger=e,this.log=this.getSafeMethod(`log`),this.warn=this.getSafeMethod(`warn`),this.error=this.getSafeMethod(`error`),this.debug=this.getSafeMethod(`debug`)}return e.prototype.getSafeMethod=function(e){if(!this.logger)return(function(){});var t=this.logger[e];return typeof t==`function`?(t.__rrweb_original__??t).bind(this.logger):(function(){})},e.prototype.enable=function(e){this.logger.enable(e)},e.prototype.disable=function(){this.logger.disable()},e}(),fb=`medium`;function pb(e){return e.toLowerCase()}function mb(e){var t=e.type;return e.hasAttribute(`data-rr-is-password`)?`password`:t?pb(t):null}function hb(e,t){return t||(e===`STAGING`?Jy:e===`EU`?qy:Ky)}var gb=function(e,t,n){switch(t){case`light`:if(e!==`input`)return!1;var r=n?mb(n):``;return r?!!([`password`,`hidden`,`email`,`tel`].includes(r)||n.autocomplete.startsWith(`cc-`)):!1;case`medium`:return e===`input`;case`conservative`:return!0;default:return gb(e,fb,n)}},_b=function(e,t){var n,r;if(e&&t.urlMaskLevels)try{for(var i=G(t.urlMaskLevels),a=i.next();!a.done;a=i.next()){var o=a.value;if(Tb(o.match).test(e))return o.maskLevel}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return t.defaultMaskLevel??fb},vb=function(e,t,n,r){if(t===void 0&&(t={defaultMaskLevel:fb}),n){if(n.closest(`.amp-mask`)||(t.maskSelector??[]).some(function(e){return n.closest(e)}))return!0;if(n.closest(`.amp-unmask`)||(t.unmaskSelector??[]).some(function(e){return n.closest(e)}))return!1}return gb(e,_b(r,t),n)},yb=function(e,t,n){return function(r,i){return vb(e,t,i,n?.())?r.replace(/[^\s]/g,`*`):r}},bb=function(e,t){return function(n,r,i){return n===`style`||!(e?.maskAttributes??[]).includes(n)?r:vb([`INPUT`,`SELECT`,`TEXTAREA`].includes(i.tagName)?`input`:`text`,e,i,t?.())?r.replace(/[^\s]/g,`*`):r}},xb=function(){var e=J();return e?.location?e.location.href:``},Sb=function(e,t){return`${t}/${e}`},Cb=function(e){return!(typeof e!=`string`||e.trim()===``||!/^\/|^https?:\/\/[^\s]+$/.test(e))},wb=new Map,Tb=function(e){var t=wb.get(e);if(t)return t;var n=`\0TRAIL\0`,r=`\0MID\0`,i=`\0DS\0`,a=`\0ST\0`,o=`\0QU\0`,s=e;s=s.replace(/\/\*\*$/,n),s=s.replace(/\/\*\*\//g,r),s=s.replace(/\*\*/g,i),s=s.replace(/\*/g,a),s=s.replace(/\?/g,o),s=s.replace(/[.+^${}()|[\]\\]/g,`\\$&`),s=s.split(n).join(`(/.*)?`),s=s.split(r).join(`/(.*\\/)?`),s=s.split(i).join(`.*`),s=s.split(a).join(`.*`),s=s.split(o).join(`.`);var c=RegExp(`^${s}\$`);return wb.set(e,c),c},Eb=function(e){if(!e.every(function(e){return typeof e.selector==`string`&&typeof e.replacement==`string`}))throw Error(`ugcFilterRules must be an array of objects with selector and replacement properties`);
276if(!e.every(function(e){return Cb(e.selector)}))throw Error(`ugcFilterRules must be an array of objects with valid globs`)},Db=function(e,t){var n,r;try{for(var i=G(t),a=i.next();!a.done;a=i.next()){var o=a.value,s=Tb(o.selector);if(s.test(e))return e.replace(s,o.replacement)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e},Ob=function(){return U(void 0,void 0,void 0,function(){var e,t,n,r,i,a,o;return W(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),e=J(),e?[4,e.navigator.storage.estimate()]:[3,2];case 1:return t=s.sent(),n=t.usage,r=t.quota,i=t.usageDetails,a=n?Math.round(n/ib):0,o=n&&r?Math.round((n/r+2**-52)*1e3)/1e3:0,[2,{totalStorageSize:a,percentOfQuota:o,usageDetails:JSON.stringify(i)}];case 2:return[3,4];case 3:return s.sent(),[3,4];case 4:return[2,{totalStorageSize:0,percentOfQuota:0,usageDetails:``}]}})})},kb=function(e){var t=H({},e),n=t.apiKey;return t.apiKey=`****${n.substring(n.length-4)}`,t},Ab=function(){return{flushMaxRetries:2,logLevel:Df.Warn,loggerProvider:new kf,transportProvider:new $f}},jb=function(e){pf(t,e);function t(t,n){var r=this,i=Ab();r=e.call(this,H(H({transportProvider:i.transportProvider,loggerProvider:new db(n.loggerProvider||i.loggerProvider)},n),{apiKey:t}))||this,r.flushMaxRetries=n.flushMaxRetries!==void 0&&n.flushMaxRetries<=i.flushMaxRetries?n.flushMaxRetries:i.flushMaxRetries,r.apiKey=t,r.sampleRate=n.sampleRate||0,r.serverZone=n.serverZone||zy,r.configServerUrl=n.configServerUrl,r.trackServerUrl=n.trackServerUrl,r.shouldInlineStylesheet=n.shouldInlineStylesheet,r.version=n.version,r.performanceConfig=n.performanceConfig||By,r.storeType=n.storeType??`memory`,r.applyBackgroundColorToBlockedElements=n.applyBackgroundColorToBlockedElements??!1,r.enableUrlChangePolling=n.enableUrlChangePolling??!1,r.urlChangePollingInterval=n.urlChangePollingInterval??Vy,r.captureDocumentTitle=n.captureDocumentTitle??!1,n.fullSnapshotIntervalMs!==void 0&&(r.fullSnapshotIntervalMs=n.fullSnapshotIntervalMs),n.eagerFullSnapshotSend!==void 0&&(r.eagerFullSnapshotSend=n.eagerFullSnapshotSend),r.captureFullSnapshotOnFocus=n.captureFullSnapshotOnFocus??!1,n.maxPersistedEventsSizeBytes!==void 0&&(r.maxPersistedEventsSizeBytes=Ib(n.maxPer
276sistedEventsSizeBytes,Nb,Pb,`maxPersistedEventsSizeBytes`,r.loggerProvider)),n.maxSingleEventSizeBytes!==void 0&&(r.maxSingleEventSizeBytes=Ib(n.maxSingleEventSizeBytes,Nb,Fb,`maxSingleEventSizeBytes`,r.loggerProvider)),r.privacyConfig=H(H({},n.privacyConfig??{}),{unmaskSelector:Array.from(new Set(q([`.${Gy}`],K(n.privacyConfig?.unmaskSelector??[]),!1)))}),n.interactionConfig&&(r.interactionConfig=n.interactionConfig,r.interactionConfig.ugcFilterRules&&Eb(r.interactionConfig.ugcFilterRules)),n.debugMode&&(r.debugMode=n.debugMode);var a=n;return r.useWebWorker=n.useWebWorker??a.experimental?.useWebWorker??!0,r.enableTransportCompression=n.enableTransportCompression??!0,r.sendTimeoutMs=n.sendTimeoutMs,r.captureAdoptedStyleSheets=n.captureAdoptedStyleSheets??!0,n.crossOriginIframes&&(r.crossOriginIframes=n.crossOriginIframes),n.flushIntervalConfig?r.flushIntervalConfig=Lb(n.flushIntervalConfig,r.loggerProvider):r.flushIntervalConfig={minIntervalMs:nb,maxIntervalMs:rb},r.handleSendEvents=n.handleSendEvents,r.handleFetchConfig=n.handleFetchConfig,r}return t}(jf),Mb=100,Nb=1e3,Pb=8e6,Fb=1e7;function Ib(e,t,n,r,i){if(!Number.isFinite(e)){i.warn(`${r} value is not a finite number (got ${String(e)}); ignoring.`);return}return e<t?(i.warn(`${r} ${e} is below floor ${t}; clamping.`),t):e>n?(i.warn(`${r} ${e} exceeds ceiling ${n}; clamping.`),n):e}function Lb(e,t){var n={};if(e.minIntervalMs!==void 0&&(!Number.isFinite(e.minIntervalMs)||e.minIntervalMs<Mb?(t.warn(`flushIntervalConfig.minIntervalMs ${e.minIntervalMs} is below floor ${Mb}ms; clamping.`),n.minIntervalMs=Mb):n.minIntervalMs=e.minIntervalMs),e.maxIntervalMs!==void 0&&(Number.isNaN(e.maxIntervalMs)||e.maxIntervalMs<Mb?(t.warn(`flushIntervalConfig.maxIntervalMs ${e.maxIntervalMs} is below floor ${Mb}ms; clamping.`),n.maxIntervalMs=Mb):n.maxIntervalMs=e.maxIntervalMs),n.minIntervalMs!==void 0||n.maxIntervalMs!==void 0){var r=n.minIntervalMs??500,i=n.maxIntervalMs??tb;i<r&&(n.maxIntervalMs===void 0?(t.warn(`flushIntervalConfig.minIntervalMs (${r}) exceeds the default maxIntervalMs (${tb}); raising max to match min.`),n.maxIntervalMs=r):n.minIntervalMs===void 0?(t.warn(`flushIntervalConfig.maxIntervalMs (${i}) is below the default minIntervalMs (500); lowering min to match max.`),n.minIntervalMs=i):(t.warn(`flushIntervalConfig.maxIntervalMs (${n.maxIntervalMs}) is less than minIntervalMs (${n.minIntervalMs}); raising max to match min.`),n.maxIntervalMs=n.minIntervalMs))}return n}var Rb=(e=>(e[e.DomContentLoaded=0]=`DomContentLoaded`,e[e.Load=1]=`Load`,e[e.FullSnapshot=2]=`FullSnapshot`,e[e.IncrementalSnapshot=3]=`IncrementalSnapshot`,e[e.Meta=4]=`Meta`,e[e.Custom=5]=`Custom`,e[e.Plugin=6]=`Plugin`,e))(Rb||{}),zb=(e=>(e[e.Mutation=0]=`Mutation`,e[e.MouseMove=1]=`MouseMove`,e[e.MouseInteraction=2]=`MouseInteraction`,e[e.Scroll=3]=`Scroll`,e[e.ViewportResize=4]=`ViewportResize`,e[e.Input=5]=`Input`,e[e.TouchMove=6]=`TouchMove`,e[e.MediaInteraction=7]=`MediaInteraction`,e[e.StyleSheetRule=8]=`StyleSheetRule`,e[e.CanvasMutation=9]=`CanvasMutation`,e[e.Font=10]=`Font`,e[e.Log=11]=`Log`,e[e.Drag=12]=`Drag`,e[e.StyleDeclaration=13]=`StyleDeclaration`,e[e.Selection=14]=`Selection`,e[e.AdoptedStyleSheet=15]=`AdoptedStyleSheet`,e[e.CustomElement=16]=`CustomElement`,e))(zb||{}),Bb=(e=>(e[e.MouseUp=0]=`MouseUp`,e[e.MouseDown=1]=`MouseDown`,e[e.Click=2]=`Click`,e[e.ContextMenu=3]=`ContextMenu`,e[e.DblClick=4]=`DblClick`,e[e.Focus=5]=`Focus`,e[e.Blur=6]=`Blur`,e[e.TouchStart=7]=`TouchStart`,e[e.TouchMove_Departed=8]=`TouchMove_Departed`,e[e.TouchEnd=9]=`TouchEnd`,e[e.TouchCancel=10]=`TouchCancel`,e))(Bb||{}),Vb=1500,Hb=function(e,t){var n=document.createDocumentFragment(),r=function(e){if(e===void 0&&(e=[]),typeof e==`string`&&(e=[e]),e=e.filter(function(e){try{n.querySelector(e)}catch{return t.warn(`[session-replay-browser] omitting selector "${e}" because it is invalid`),!1}return!0}),e.length!==0)return e};return e.blockSelector=r(e.blockSelector),e.maskSelector=r(e.maskSelector),e.unmaskSelector=r(e.unmaskSelector),e},Ub=function(){function e(e,t){this.localConfig=t,this.remoteConfigClient=e}return e.prototype.generateJoinedConfig=function(){return U(this,void 0,void 0,function(){var e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_=this;return W(this,function(v){switch(v.label){case 0:e=H({},this.localConfig),e.optOut=this.localConfig.optOut,e.captureEnabled=!0,v.label=1;case 1:return v.trys.push([1,3,,4]),[4,new Promise(function(n,r){_.remoteConfigClient.subscribe(`configs.sessionReplay`,{timeout:Vb},function(i,a){if(_.localConfig.loggerProvider.debug(`Session Replay remote configuration received from ${a}:`,JSON.stringify(i,null,2)),!i){r(Error(`No remote config received`));return}var o=i,s=o.sr_sampling_config,c=o.sr_privacy_config,l=o.sr_targeting_config,u=e.interactionConfig?.ugcFilterRules;e.interactionConfig=o.sr_interaction_config,e.interactionConfig&&u&&(e.interactionConfig.ugcFilterRules=u),e.loggingConfig=o.sr_logging_config,(s||c||l)&&(t={},s&&(t.sr_sampling_config=s),c&&(t.sr_privacy_config=c),l&&(t.sr_targeting_config=l)),n()})})];case 2:return v.sent(),[3,4];case 3:return n=v.sent(),this.localConfig.loggerProvider.error(`Failed to generate joined config: `,n),e.captureEnabled=!1,[2,{localConfig:this.localConfig,joinedConfig:e,remoteConfig:void 0}];case 4:if(!t)return[2,{localConfig:this.localConfig,joinedConfig:e,remoteConfig:t}];if(r=t.sr_sampling_config,i=t.sr_privacy_config,a=t.sr_targeting_config,r&&Object.keys(r).length>0?(Object.prototype.hasOwnProperty.call(r,`capture_enabled`)?e.captureEnabled=r.capture_enabled:e.captureEnabled=!1,Object.prototype.hasOwnProperty.call(r,`sample_rate`)&&(e.sampleRate=r.sample_rate),Object.prototype.hasOwnProperty.call(r,`min_session_duration_ms`)&&(e.minSessionDurationMs=this.sanitizeMinSessionDurationMs(r.min_session_duration_ms))):(e.captureEnabled=!0,this.localConfig.loggerProvider.debug(`Remote config successfully fetched, but no values set for project, Session Replay capture enabled.`)),i){o=e.privacyConfig??{},s={defaultMaskLevel:i.defaultMaskLevel??o.defaultMaskLevel??`medium`,blockSelector:[],maskSelector:[],unmaskSelector:[],maskAttributes:q([],K(new Set(q(q([],K(o.maskAttributes??[]),!1),K(i.maskAttributes??[]),!1))),!1),urlMaskLevels:q(q([],K(i.urlMaskLevels??[]),!1),K(o.urlMaskLevels??[]),!1)},c=function(e){var t,n,r,i,a,o,s={};typeof e.blockSelector==`string`&&(e.blockSelector=[e.blockSelector]);try{for(var c=G(e.blockSelector??[]),l=c.next();!l.done;l=c.next()){var u=l.value;s[u]=`block`}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}try{for(var d=G(e.maskSelector??[]),f=d.next();!f.done;f=d.next()){var u=f.value;s[u]=`mask`}}catch(e){r={error:e}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}try{for(var p=G(e.unmaskSelector??[]),m=p.next();!m.done;m=p.next()){var u=m.value;s[u]=`unmask`}}catch(e){a={error:e}}finally{try{m&&!m.done&&(o=p.return)&&o.call(p)}finally{if(a)throw a.error}}return s},l=H(H({},c(o)),c(i));try{for(u=G(Object.entries(l)),d=u.next();!d.done;d=u.next())f=K(d.value,2),p=f[0],m=f[1],m===`mask`?s.maskSelector.push(p):m===`block`?s.blockSelector.push(p):m===`unmask`&&s.unmaskSelector.push(p)}catch(e){h={error:e}}finally{try{d&&!d.done&&(g=u.return)&&g.call(u)}finally{if(h)throw h.error}}e.privacyConfig=Hb(s,this.localConfig.loggerProvider)}return a&&Object.keys(a).length>0&&(e.targetingConfig=a),this.localConfig.loggerProvider.debug(JSON.stringify({name:`session replay joined config`,config:kb(e)},null,2)),[2,{localConfig:this.localConfig,joinedConfig:e,remoteConfig:t}]}})})},e.prototype.sanitizeMinSessionDurationMs=function(e){if(typeof e!=`number`||!Number.isFinite(e)){this.localConfig.loggerProvider.warn(`min_session_duration_ms remote value is not a finite number (got ${String(e)}); ignoring.`);return}if(e<0){this.localConfig.loggerProvider.warn(`min_session_duration_ms remote value is negative (${e}); ignoring.`);return}return e>6e4?(this.localConfig.loggerProvider.warn(`min_session_duration_ms remote value ${e} exceeds ${Wb}ms ceiling; clamping.`),Wb):e},e}(),Wb=6e4,Gb=function(e,t){return U(void 0,void 0,void 0,function(){var n,r;return W(this,function(i){return n=new jb(e,t),r=new ap(e,n.loggerProvider,n.serverZone,t.configServerUrl,t.handleFetchConfig),[2,new Ub(r,n)]})})};function Kb(e){if(e.type!==Rb.IncrementalSnapshot)return!1;var t=e.data;return t.source===zb.Mutation&&!t.isAttachIframe}function qb(e){return typeof e==`object`&&!!e}function Jb(e){var t,n,r,i,a={};try{for(var o=G(e),s=o.next();!s.done;s=o.next()){var c=s.value;try{for(var l=(r=void 0,G(Object.keys(c))),u=l.next();!u.done;u=l.next()){var d=u.value;a[d]=c[d]}}catch(e){r={error:e}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return a}function Yb(e){var t,n,r=new Map;if(e.forEach(function(e,t){if(e.attributes&&`style`in e.attributes){var n=r.get(e.id);n?n.push(t):r.set(e.id,[t])}}),r.size===0)return e;var i=function(t){return e[t].attributes.style},a=new Set,o=new Map,s=function(e){if(e.length===1)return`continue`;var t=-1;e.forEach(function(e,n){qb(i(e))||(t=n)});var n=[];
276if(e.forEach(function(e,r){r!==t&&(a.add(e),r>t&&n.push(e))}),n.length>0){var r=n[n.length-1],s=Jb(n.map(function(e){return i(e)}));a.delete(r),o.set(r,s)}};try{for(var c=G(r.values()),l=c.next();!l.done;l=c.next()){var u=l.value;s(u)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}if(a.size===0&&o.size===0)return e;var d=[];return e.forEach(function(e,t){var n=o.get(t);if(n!==void 0){d.push(H(H({},e),{attributes:H(H({},e.attributes),{style:n})}));return}if(!a.has(t)){d.push(e);return}var r=H({},e.attributes);delete r.style,Object.keys(r).length>0&&d.push(H(H({},e),{attributes:r}))}),d}function Xb(e){var t,n,r,i,a=e[0],o=new Map,s=new Map,c=new Map,l=new Map,u=new Map;e.forEach(function(e,t){var n,r,i,a,d=e.data;try{for(var f=G(d.adds),p=f.next();!p.done;p=f.next()){var m=p.value;o.has(m.node.id)||o.set(m.node.id,t),s.set(m.node.id,t),u.set(m.node.id,m.parentId)}}catch(e){n={error:e}}finally{try{p&&!p.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}try{for(var h=G(d.removes),g=h.next();!g.done;g=h.next()){var _=g.value;c.has(_.id)||c.set(_.id,t),l.set(_.id,t)}}catch(e){i={error:e}}finally{try{g&&!g.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}});var d=new Set,f=new Set;try{for(var p=G(o),m=p.next();!m.done;m=p.next()){var h=K(m.value,2),g=h[0],_=h[1],v=c.get(g);v!==void 0&&(s.get(g)>=l.get(g)||(_<v?d.add(g):v<_&&f.add(g)))}}catch(e){t={error:e}}finally{try{m&&!m.done&&(n=p.return)&&n.call(p)}finally{if(t)throw t.error}}var y=new Set;if(d.size>0||f.size>0)for(var b=!0;b;){b=!1;try{for(var x=(r=void 0,G(u)),S=x.next();!S.done;S=x.next()){var C=K(S.value,2),w=C[0],T=C[1];if(!d.has(w)&&!f.has(w)&&!y.has(w)&&(d.has(T)||f.has(T)||y.has(T))){var E=c.get(w),D=o.get(w);E!==void 0&&D!==void 0&&E<D?f.add(w):E!==void 0&&D!==void 0&&E===D?y.add(w):d.add(w),b=!0}}}catch(e){r={error:e}}finally{try{S&&!S.done&&(i=x.return)&&i.call(x)}finally{if(r)throw r.error}}}var O=d.size>0||f.size>0||y.size>0,k=[];e.forEach(function(e,t){var n,r;try{for(var i=G(e.data.removes),a=i.next();!a.done;a=i.next()){var s=a.value;d.has(s.id)||f.has(s.id)&&t>=o.get(s.id)||y.has(s.id)&&(d.has(s.parentId)||f.has(s.parentId)||y.has(s.parentId))||k.push(s)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}});var A=e.flatMap(function(e){return e.data.adds}),ee=e.flatMap(function(e){return e.data.texts}),te=e.flatMap(function(e){return e.data.attributes}),j=O?te.filter(function(e){return!d.has(e.id)&&!f.has(e.id)&&!y.has(e.id)}):te,ne={source:zb.Mutation,removes:k,adds:O?A.filter(function(e){return!d.has(e.node.id)&&!f.has(e.node.id)&&!y.has(e.node.id)}):A,texts:O?ee.filter(function(e){return!d.has(e.id)&&!f.has(e.id)&&!y.has(e.id)}):ee,attributes:Yb(j)};return H(H({},a),{data:ne})}function Zb(e){if(e.length<=1)return e;for(var t=[],n=0;n<e.length;){if(!Kb(e[n])){t.push(e[n]),n++;continue}for(var r=n+1;r<e.length&&Kb(e[r]);)r++;t.push(r>n+1?Xb(e.slice(n,r)):e[n]),n=r}return t}var Qb=2e3,$b=function(){function e(e,t,n,r,i){var a=this;this.taskQueue=[],this.pendingQueue=[],this.isProcessing=!1,this.compressEvent=function(e){var t=e,n=t.type,r=t.timestamp,i=t.delay,a=t.data;return JSON.stringify(i==null?{type:n,timestamp:r,data:a}:{type:n,timestamp:r,delay:i,data:a})},this.addCompressedEventToManager=function(e,t){var n=new Blob([e]).size;if(n>(a.config.maxSingleEventSizeBytes??9e6)){a.config.loggerProvider.warn(`Session replay event dropped: serialized size ${Math.round(n/1024)} KB exceeds maximum allowed event size. If this recurs, please open a GitHub issue at https://github.com/amplitude/Amplitude-TypeScript/issues or contact Amplitude support.`);return}a.eventsManager&&a.deviceId&&a.eventsManager.addEvent({event:{type:`replay`,data:e},sessionId:t,deviceId:a.deviceId})},this.addCompressedEvent=function(e,t){if(a.worker)try{a.worker.postMessage({event:e,sessionId:t})}catch(n){n.name===`DataCloneError`?a.worker.postMessage(JSON.stringify({event:e,sessionId:t})):a.config.loggerProvider.warn(`Unexpected error while posting message to worker:`,n)}else{var n=a.compressEvent(e);a.addCompressedEventToManager(n,t)}},this.flushQueue=function(){var e;
276for(a.pendingQueue.length>0&&(e=a.taskQueue).push.apply(e,q([],K(a.mergeMutationTasks(a.pendingQueue.splice(0))),!1));a.taskQueue.length>0;){var t=a.taskQueue.shift();if(t){var n=t.event,r=t.sessionId,i=a.compressEvent(n);a.addCompressedEventToManager(i,r)}}a.isProcessing=!1},this.terminate=function(){var e;(e=a.worker)==null||e.terminate()};var o=J();if(this.canUseIdleCallback=o&&`requestIdleCallback`in o,this.eventsManager=e,this.config=t,this.deviceId=n,this.timeout=t.performanceConfig?.timeout||Qb,this.onFullSnapshotProcessed=i,r){t.loggerProvider.log(`Enabling web worker for compression`);try{var s=new Blob([r],{type:`application/javascript`}),c=URL.createObjectURL(s),l=new Worker(c);l.onerror=function(e){e.preventDefault(),t.loggerProvider.error(`Worker failed, falling back to non-worker compression: ${e.message} (${e.filename}:${e.lineno})`),l.terminate(),a.worker=void 0},l.onmessage=function(e){var t=e.data,n=t.compressedEvent,r=t.sessionId;a.addCompressedEventToManager(n,r)},this.worker=l}catch(e){t.loggerProvider.error(`Failed to create worker, falling back to non-worker compression:`,e)}}}return e.prototype.scheduleIdleProcessing=function(){var e=this;this.isProcessing||(this.isProcessing=!0,requestIdleCallback(function(t){e.processQueue(t)},{timeout:this.timeout}))},e.prototype.enqueueEvent=function(e,t){var n,r,i;if(e.type===Rb.FullSnapshot){if(this.config.loggerProvider.debug(`Processing full snapshot immediately.`),this.taskQueue.length>0||this.pendingQueue.length>0){var a=q(q([],K(this.taskQueue.splice(0)),!1),K(this.mergeMutationTasks(this.pendingQueue.splice(0))),!1);try{for(var o=G(a),s=o.next();!s.done;s=o.next()){var c=s.value,l=this.compressEvent(c.event);this.addCompressedEventToManager(l,c.sessionId)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}this.isProcessing=!1}var u=this.compressEvent(e);this.addCompressedEventToManager(u,t),(i=this.onFullSnapshotProcessed)==null||i.call(this);return}this.canUseIdleCallback&&this.config.performanceConfig?.enabled?(this.config.loggerProvider.debug(`Enqueuing event for processing during idle time.`),this.pendingQueue.push({event:e,sessionId:t}),this.scheduleIdleProcessing()):(this.config.loggerProvider.debug(`Processing event without idle callback.`),this.addCompressedEvent(e,t))},e.prototype.processQueue=function(e){var t,n=this;for(this.pendingQueue.length>0&&(t=this.taskQueue).push.apply(t,q([],K(this.mergeMutationTasks(this.pendingQueue.splice(0))),!1));this.taskQueue.length>0&&(e.timeRemaining()>0||e.didTimeout);){var r=this.taskQueue.shift();if(r){var i=r.event,a=r.sessionId;this.addCompressedEvent(i,a)}}this.taskQueue.length>0||this.pendingQueue.length>0?requestIdleCallback(function(e){n.processQueue(e)},{timeout:this.timeout}):this.isProcessing=!1},e.prototype.mergeMutationTasks=function(e){var t,n;if(this.config.performanceConfig?.mergeMutations===!1||e.length<=1)return e;for(var r=[],i=0;i<e.length;){for(var a=e[i].sessionId,o=i+1;o<e.length&&e[o].sessionId===a;)o++;var s=Zb(e.slice(i,o).map(function(e){return e.event}));try{for(var c=(t=void 0,G(s)),l=c.next();!l.done;l=c.next()){var u=l.value;r.push({event:u,sessionId:a})}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}i=o}return r},e}(),ex=`Unexpected error occurred`,tx=`Network error occurred, event batch rejected`,nx=`Session replay event batch rejected due to exceeded retry count`,rx=`Failed to store session replay events in IndexedDB`,ix=`Session replay event batch not sent due to missing device ID`,ax=`Session replay event batch not sent due to missing api key`,ox=`Session replay event batch dropped: server signalled capture disabled or session out of valid range for this session`,sx=`1.48.1`;function cx(e,t){return U(this,void 0,void 0,function(){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,g=this;return W(this,function(_){switch(_.label){case 0:return _.trys.push([0,4,,5]),n=t.CompressionStream,r=new n(`gzip`),i=r.writable.getWriter(),a=r.readable.getReader(),o=[],s=(function(){return U(g,void 0,void 0,function(){var e,t,n;return W(this,function(r){switch(r.label){case 0:return[4,a.read()];case 1:if(e=r.sent(),t=e.done,n=e.value,t)return[3,3];o.push(n),r.label=2;case 2:return[3,0];case 3:return[2]}})})})(),[4,i.write(new TextEncoder().encode(e))];case 1:return _.sent(),[4,i.close()];case 2:return _.sent(),[4,s];case 3:_.sent(),c=o.reduce(function(e,t){return e+t.length},0),l=new Uint8Array(c),u=0;try{for(d=G(o),f=d.next();!f.done;f=d.next())p=f.value,l.set(p,u),u+=p.length}catch(e){m={error:e}}finally{try{f&&!f.done&&(h=d.return)&&h.call(d)}finally{if(m)throw m.error}}return[2,l];case 4:return _.sent(),[2,null];case 5:return[2]}})})}var lx=256,ux=256;function dx(e,t){return new Promise(function(n,r){var i=function(){var e=Error(`Custom session replay transport aborted by send timeout`);e.name=`AbortError`,r(e)};t.addEventListener(`abort`,i,{once:!0}),e.then(function(e){t.removeEventListener(`abort`,i),n(e)},function(e){t.removeEventListener(`abort`,i),r(e)})})}var fx=function(){function e(e){var t=e.trackServerUrl,n=e.loggerProvider,r=e.payloadBatcher,i=e.workerScript,a=e.enableTransportCompression,o=e.sendTimeoutMs,s=e.handleSendEvents,c=this;if(this.storageKey=``,this.retryTimeout=1e3,this.scheduled=null,this.queue=[],this.sendIdCounter=0,this.pendingWorkerRequests=new Map,this.timedOutWorkerRequests=new Map,this.flushPauseUntilMs=0,this.mergeOnNextFlush=!1,this.coalesceNextFlush=!1,this.mergeLogFiredThisPause=!1,this.killedSessions=new Set,this.loggerProvider=n,this.payloadBatcher=r||function(e){return e},this.trackServerUrl=t,this.enableTransportCompression=a??!0,this.sendTimeoutMs=o??sb,this.handleSendEvents=s,i)try{var l=new Blob([i],{type:`application/javascript`}),u=URL.createObjectURL(l),d=new Worker(u);d.onerror=function(e){var t,r;e.preventDefault(),n.error(`Track destination worker failed, falling back to main-thread sending: ${e.message} (${e.filename}:${e.lineno})`),d.terminate(),c.worker=void 0;try{for(var i=G(c.pendingWorkerRequests),a=i.next();!a.done;a=i.next()){var o=K(a.value,2)[1];o.timeout&&clearTimeout(o.timeout),n.warn(`Session replay event send failed due to worker crash: ${e.message}`),o.resolve()}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}c.pendingWorkerRequests.clear(),c.timedOutWorkerRequests.clear()},d.onmessage=function(e){var t=e.data;if(t.type===`log`)n.log(t.message);else if(t.type===`warn`)n.warn(t.message);else if(t.type===`payload_too_large`){var r=c.pendingWorkerRequests.get(t.id);if(r)r.timeout&&clearTimeout(r.timeout),c.handlePayloadTooLargeResponse(r.context,t.isWaf),r.resolve(),c.pendingWorkerRequests.delete(t.id);else{var i=c.timedOutWorkerRequests.get(t.id);i&&(c.timedOutWorkerRequests.delete(t.id),c.handlePayloadTooLargeResponse(i,t.isWaf))}}else if(t.type===`complete`){var a=c.pendingWorkerRequests.get(t.id);if(a)a.timeout&&clearTimeout(a.timeout),t.skipCode!==void 0&&c.applyServerDirective(a.context.sessionId,t.skipCode),c.completeRequest({context:a.context}),a.resolve(),c.pendingWorkerRequests.delete(t.id);else{var i=c.timedOutWorkerRequests.get(t.id);i&&(c.timedOutWorkerRequests.delete(t.id),t.skipCode!==void 0&&c.applyServerDirective(i.sessionId,t.skipCode),c.completeRequest({context:i}))}}else t.type===`fetch-request`&&c.handleDelegatedFetch(d,t).catch(function(e){n.warn(`Failed to handle delegated session replay fetch:`,e)})},this.worker=d}catch(e){n.error(`Failed to create track destination worker, falling back to main-thread sending:`,e)}}return e.prototype.sendEventsList=function(e){this.addToQueue(H(H({},e),{attempts:0,timeout:0}))},e.prototype.markCoalesceNextFlush=function(){this.coalesceNextFlush=!0,this.schedule(0)},e.prototype.sendBeacon=function(e){var t=this,n,r=e.events,i=e.sessionId,a=e.deviceId,o=e.apiKey,s=e.serverZone,c=64*1024,l=function(e){return new Blob([e]).size},u=r,d=JSON.stringify({version:2,events:u});if(l(d)>c){for(var f=0,p=u.length;f<p;){var m=Math.floor((f+p+1)/2);
276l(JSON.stringify({version:2,events:u.slice(0,m)}))<=c?f=m:p=m-1}u=u.slice(0,f),d=JSON.stringify({version:2,events:u}),this.loggerProvider.warn(`sendBeacon payload exceeded 64 KB limit, trimmed from ${r.length} to ${u.length} events`)}if(u.length!==0){if(this.handleSendEvents){var h=new URLSearchParams({device_id:a,session_id:String(i),type:`replay`}),g=`${hb(s,this.trackServerUrl)}?${h.toString()}`,_={"Content-Type":`application/json`,Accept:`*/*`,Authorization:`Bearer ${o}`};this.loggerProvider.debug(`Routing session replay exit batch (${u.length} events) through custom transport for session id ${i}.`);try{this.handleSendEvents({url:g,method:`POST`,headers:_,body:d,keepalive:!0}).catch(function(e){t.loggerProvider.warn(`Custom transport failed to send session replay exit batch:`,e)})}catch(e){this.loggerProvider.warn(`Custom transport threw while sending session replay exit batch:`,e)}return}var v=new URLSearchParams({device_id:a,session_id:String(i),type:`replay`,api_key:o}),y=`${hb(s,this.trackServerUrl)}?${v.toString()}`,b=J();try{var x=new Blob([d],{type:`application/json`});((n=b?.navigator)?.sendBeacon)?.call(n,y,x)===!1&&this.loggerProvider.warn(`sendBeacon failed to queue session replay payload`)}catch{}}},e.prototype.addToQueue=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];t.filter(function(t){return e.killedSessions.has(t.sessionId)?(e.completeRequest({context:t,err:ox}),!1):t.attempts<(t.flushMaxRetries||0)?(t.attempts+=1,!0):(e.completeRequest({context:t,err:nx}),!1)}).forEach(function(t){e.queue=e.queue.concat(t),e.schedule(0)})},e.prototype.schedule=function(e){var t=this;if(!this.scheduled){var n=this.flushPauseUntilMs-Date.now(),r=n>0,i=n>e?n:e;r&&(this.mergeOnNextFlush=!0),this.scheduled=setTimeout(function(){t.flush(!0).then(function(){t.queue.length>0&&t.schedule(e)})},i)}},e.prototype.flush=function(e){return e===void 0&&(e=!1),U(this,void 0,void 0,function(){var t,n,r,i,a,o,s;return W(this,function(c){switch(c.label){case 0:t=this.queue,this.queue=[],this.scheduled&&=(clearTimeout(this.scheduled),null),this.mergeOnNextFlush?(this.mergeOnNextFlush=!1,this.coalesceNextFlush=!1,t=this.mergeQueueAfterThrottle(t)):this.coalesceNextFlush&&(this.coalesceNextFlush=!1,t=this.mergeDrainBacklog(t)),c.label=1;case 1:c.trys.push([1,6,7,8]),n=G(t),r=n.next(),c.label=2;case 2:return r.done?[3,5]:(i=r.value,[4,this.send(i,e)]);case 3:c.sent(),c.label=4;case 4:return r=n.next(),[3,2];case 5:return[3,8];case 6:return a=c.sent(),o={error:a},[3,8];case 7:try{r&&!r.done&&(s=n.return)&&s.call(n)}finally{if(o)throw o.error}return[7];case 8:return[2]}})})},e.prototype.mergeQueueAfterThrottle=function(e){var t=this.coalesceByIdentity(e);return t.length<e.length&&!this.mergeLogFiredThisPause&&(this.mergeLogFiredThisPause=!0,this.loggerProvider.log(`Session replay throttle pause ended; merged ${e.length} queued batches into ${t.length} request(s)`)),t},e.prototype.mergeDrainBacklog=function(e){var t=this.coalesceByIdentity(e);return t.length<e.length&&this.loggerProvider.log(`Session replay coalesced ${e.length} persisted page-load backlog batches into ${t.length} request(s)`),t},e.prototype.coalesceByIdentity=function(e){var t,n,r,i,a=this;if(e.length<=1)return e;var o=new Map;try{for(var s=G(e),c=s.next();!c.done;c=s.next()){var l=c.value,u=[l.sessionId,l.deviceId??``,l.apiKey??``,l.type,l.serverZone??``,l.sampleRate,l.version?.type??``,l.version?.version??``].join(`|`),d=o.get(u);d?d.push(l):o.set(u,[l])}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}var f=[],p=function(e){var t,n;if(e.length===1)return f.push(e[0]),`continue`;var r=null,i=0,o=function(){r&&f.push(r),r=null,i=0},s=function(e){var t=e.events.reduce(function(e,t){return e+new Blob([t]).size},0);if(r===null)return r=H(H({},e),{events:q([],K(e.events),!1),attempts:0}),i=t,`continue`;if(i+t>4e6)return o(),r=H(H({},e),{events:q([],K(e.events),!1),attempts:0}),i=t,`continue`;var n=r.onComplete,s=e.onComplete;r.events=r.events.concat(e.events),i+=t,r.onComplete=function(){return U(a,void 0,void 0,function(){return W(this,function(e){switch(e.label){case 0:return[4,Promise.allSettled([n(),s()])];case 1:return e.sent(),[2]}})})}};try{for(var c=(t=void 0,G(e)),l=c.next();!l.done;l=c.next()){var u=l.value;s(u)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}o()};try{for(var m=G(o.values()),h=m.next();!h.done;h=m.next()){var g=h.value;p(g)}}catch(e){r={error:e}}finally{try{h&&!h.done&&(i=m.return)&&i.call(m)}finally{if(r)throw r.error}}return f},e.prototype.send=function(e,t){return t===void 0&&(t=!0),U(this,void 0,void 0,function(){var n,r,i,a;return W(this,function(o){return this.killedSessions.has(e.sessionId)?[2,this.completeRequest({context:e,err:ox})]:(n=e.apiKey,n?(r=e.deviceId,r?(i=this.payloadBatcher({version:1,events:e.events}),i.events.length===0?(this.completeRequest({context:e}),[2]):(a=this.worker,a?[2,this.sendViaWorker(a,e,i,t)]:[2,this.sendOnMainThread(n,r,e,i,t)])):[2,this.completeRequest({context:e,err:ix})]):[2,this.completeRequest({context:e,err:ax})])})})},e.prototype.sendViaWorker=function(e,t,n,r){return U(this,void 0,void 0,function(){var i,a=this;return W(this,function(o){return i=`${++this.sendIdCounter}`,[2,new Promise(function(o){var s=a.sendTimeoutMs>0?setTimeout(function(){var e=a.pendingWorkerRequests.get(i);
276e&&(a.pendingWorkerRequests.delete(i),a.rememberTimedOutRequest(i,e.context),a.loggerProvider.warn(`Session replay worker send timed out after ${a.sendTimeoutMs}ms; leaving events for retry`),e.resolve())},a.sendTimeoutMs):void 0;a.pendingWorkerRequests.set(i,{context:t,resolve:o,timeout:s}),e.postMessage({type:`send`,id:i,payload:n,useRetry:r,useCustomTransport:!!a.handleSendEvents,context:{apiKey:t.apiKey,deviceId:t.deviceId,sessionId:t.sessionId,events:t.events,eventType:t.type,flushMaxRetries:t.flushMaxRetries??0,sampleRate:t.sampleRate,serverZone:t.serverZone,trackServerUrl:a.trackServerUrl,version:t.version,currentUrl:xb(),sdkVersion:sx,enableTransportCompression:a.enableTransportCompression,sendTimeoutMs:a.sendTimeoutMs}})})]})})},e.prototype.rememberTimedOutRequest=function(e,t){var n,r;if(this.timedOutWorkerRequests.set(e,t),this.timedOutWorkerRequests.size>ux)try{for(var i=G(this.timedOutWorkerRequests.keys()),a=i.next();!a.done;a=i.next()){var o=a.value;this.timedOutWorkerRequests.delete(o);break}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},e.prototype.handleDelegatedFetch=function(e,t){var n;return U(this,void 0,void 0,function(){var r,i,a,o,s,c,l,u,d,f,p;return W(this,function(m){switch(m.label){case 0:r=t.requestId,i=t.url,a=t.method,o=t.headers,s=t.body,c=t.keepalive,m.label=1;case 1:return m.trys.push([1,10,,11]),l=void 0,this.handleSendEvents?[4,this.handleSendEvents({url:i,method:a,headers:o,body:s,keepalive:c})]:[3,3];case 2:return l=m.sent(),[3,5];case 3:return this.loggerProvider.warn(`Delegated session replay fetch received without a custom transport configured; falling back to built-in fetch.`),[4,fetch(i,{method:a,headers:o,body:s,keepalive:c})];case 4:l=m.sent(),m.label=5;case 5:if(u=l.status,d=null,f=``,u>=200&&u<300&&(d=((n=l.headers)?.get)?.call(n,`X-Session-Replay-Event-Skipped`)??null),u!==413)return[3,9];m.label=6;case 6:return m.trys.push([6,8,,9]),[4,l.text()];case 7:return f=m.sent(),[3,9];case 8:return m.sent(),[3,9];case 9:return this.loggerProvider.debug(`Delegated session replay fetch (request ${r}) returned status ${u}.`),e.postMessage({type:`fetch-response`,requestId:r,status:u,skipHeader:d,body:f}),[3,11];case 10:return p=m.sent(),this.loggerProvider.debug(`Delegated session replay fetch (request ${r}) failed:`,p),e.postMessage({type:`fetch-response`,requestId:r,status:0,skipHeader:null,body:String(p),error:!0}),[3,11];case 11:return[2]}})})},e.prototype.sendOnMainThread=function(e,t,n,r,i){var a;return U(this,void 0,void 0,function(){var o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,E,D,O;return W(this,function(k){switch(k.label){case 0:o=xb(),s=sx,c=n.sampleRate,l=new URLSearchParams({device_id:t,session_id:`${n.sessionId}`,type:`${n.type}`}),u=`${n.version?.type??`standalone`}/${n.version?.version??s}`,k.label=1;case 1:return k.trys.push([1,19,,23]),d=JSON.stringify(r),f=J(),this.enableTransportCompression&&f&&`CompressionStream`in f?[4,cx(d,f)]:[3,3];case 2:return m=k.sent(),[3,4];case 3:m=null,k.label=4;case 4:if(p=m,h=p?p.byteLength:new Blob([d]).size,g=new AbortController,_=H({"Content-Type":`application/json`,Accept:`*/*`,Authorization:`Bearer ${e}`,"X-Client-Version":s,"X-Client-Library":u,"X-Client-Url":o.substring(0,ab),"X-Client-Sample-Rate":`${c}`,"X-Sampling-Hash-Alg":`xxhash32`},p?{"Content-Encoding":`gzip`}:{}),v=p??d,y=h<=ob,b={headers:_,body:v,method:`POST`,keepalive:y,signal:g.signal},x=`${hb(n.serverZone,this.trackServerUrl)}?${l.toString()}`,r.events.length===0)return this.completeRequest({context:n}),[2];S=this.sendTimeoutMs>0?setTimeout(function(){g.abort()},this.sendTimeoutMs):void 0,C=void 0,k.label=5;case 5:return k.trys.push([5,,10,11]),this.handleSendEvents?[4,dx(this.handleSendEvents({url:x,method:`POST`,headers:_,body:v,keepalive:y}),g.signal)]:[3,7];case 6:return w=k.sent(),[3,9];case 7:return[4,fetch(x,b)];case 8:w=k.sent(),k.label=9;case 9:return C=w,[3,11];case 10:return S&&clearTimeout(S),[7];case 11:if(C===null)return this.completeRequest({context:n,err:ex}),[2];if(C.status>=200&&C.status<300&&(T=((a=C.headers)?.get)?.call(a,`X-Session-Replay-Event-Skipped`)??null,this.applyServerDirective(n.sessionId,T)),i)return[3,12];E=``;try{E=JSON.stringify(C.body,null,2)}catch{}return this.completeRequest({context:n,success:`${C.status}: ${E}`}),[3,18];
276case 12:if(E=``,C.status!==413)return[3,16];k.label=13;case 13:return k.trys.push([13,15,,16]),[4,C.text()];case 14:return E=k.sent(),[3,16];case 15:return k.sent(),[3,16];case 16:return[4,this.handleReponse(C.status,n,E)];case 17:k.sent(),k.label=18;case 18:return[3,23];case 19:return D=k.sent(),O=!!D&&typeof D==`object`&&D.name===`AbortError`,O&&i?[4,this.handleOtherResponse(n)]:[3,21];case 20:return k.sent(),[3,22];case 21:this.completeRequest({context:n,err:D}),k.label=22;case 22:return[3,23];case 23:return[2]}})})},e.prototype.handleReponse=function(e,t,n){return n===void 0&&(n=``),U(this,void 0,void 0,function(){var r,i;return W(this,function(a){switch(a.label){case 0:switch(r=new Qf().buildStatus(e),i=r,i){case Sf.Success:return[3,1];case Sf.Failed:return[3,2];case Sf.Timeout:return[3,2];case Sf.RateLimit:return[3,2];case Sf.PayloadTooLarge:return[3,4]}return[3,5];case 1:return this.handleSuccessResponse(t),[3,8];case 2:return[4,this.handleOtherResponse(t)];case 3:return a.sent(),[3,8];case 4:return this.handlePayloadTooLargeResponse(t,Qy.test(n)),[3,8];case 5:return e===499?[4,this.handleOtherResponse(t)]:[3,7];case 6:return a.sent(),[3,8];case 7:this.completeRequest({context:t,err:tx}),a.label=8;case 8:return[2]}})})},e.prototype.handlePayloadTooLargeResponse=function(e,t){var n=t?`WAF (compressed payload too large)`:`server (event too large)`,r=Math.round(e.events.reduce(function(e,t){return e+t.length},0)/ib);if(!t){this.completeRequest({context:e,err:`Session replay event batch dropped: ${n} rejected payload (${e.events.length} events, ${r} KB) — not retrying non-WAF 413`});return}if(e.events.length===1){this.completeRequest({context:e,err:`Session replay event dropped: single event (${r} KB, 1 event) rejected by ${n} — cannot split further`});return}this.loggerProvider.warn(`Session replay event batch rejected by ${n} (${e.events.length} events, ${r} KB total) — splitting and retrying`),e.onComplete();var i=function(){return Promise.resolve()},a=Math.floor(e.events.length/2);this.sendEventsList(H(H({},e),{events:e.events.slice(0,a),onComplete:i})),this.sendEventsList(H(H({},e),{events:e.events.slice(a),onComplete:i}))},e.prototype.handleSuccessResponse=function(e){var t=Math.round(new Blob(e.events).size/ib);this.completeRequest({context:e,success:`Session replay event batch tracked successfully for session id ${e.sessionId}, size of events: ${t} KB`})},e.prototype.handleOtherResponse=function(e){return U(this,void 0,void 0,function(){var t;return W(this,function(n){switch(n.label){case 0:return t=Math.random()*e.attempts*this.retryTimeout,e.attempts++,e.attempts>(e.flushMaxRetries||0)?(this.completeRequest({context:e,err:nx}),[2]):[4,new Promise(function(e){return setTimeout(e,t)})];case 1:return n.sent(),[4,this.send(e,!0)];case 2:return n.sent(),[2]}})})},e.prototype.completeRequest=function(e){var t=e.context,n=e.err,r=e.success;t.onComplete(),n?this.loggerProvider.warn(n):r&&this.loggerProvider.log(r)},e.prototype.applyServerDirective=function(e,t){if(t===null){this.flushPauseUntilMs=0,this.mergeLogFiredThisPause=!1;return}if(t===`429`){var n=this.flushPauseUntilMs>Date.now();this.flushPauseUntilMs=Date.now()+cb,n||this.loggerProvider.log(`Session replay throttled by server; pausing flush schedule for ${cb/1e3}s`);return}(t===`4005`||t===`4004`)&&this.killSession(e,t)},e.prototype.killSession=function(e,t){var n,r,i,a;if(!this.killedSessions.has(e)){if(this.killedSessions.add(e),this.killedSessions.size>lx)try{for(var o=G(this.killedSessions),s=o.next();!s.done;s=o.next()){var c=s.value;this.killedSessions.delete(c);break}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}this.loggerProvider.log(`Session replay capture stopped for session ${e} by server directive ${t}; remaining events will be dropped`);var l=[];try{for(var u=G(this.queue),d=u.next();!d.done;d=u.next()){var f=d.value;f.sessionId===e?this.completeRequest({context:f,err:ox}):l.push(f)}}catch(e){i={error:e}}finally{try{d&&!d.done&&(a=u.return)&&a.call(u)}finally{if(i)throw i.error}}this.queue=l}},e}(),px=function(){function e(e){var t=this;
276this.minInterval=500,this.maxInterval=tb,this.maxPersistedEventsSize=Xy,this._timeAtLastSplit=Date.now(),this.shouldSplitEventsList=function(e,n){var r=t.getStringSize(n);return t.getEventsArraySize(e)+r>=t.maxPersistedEventsSize?!0:Date.now()-t.timeAtLastSplit>t.interval&&e.length?(t.interval=Math.min(t.maxInterval,t.interval+t.minInterval),t._timeAtLastSplit=Date.now(),!0):!1},this.loggerProvider=e.loggerProvider,this.minInterval=e.minInterval??this.minInterval,this.maxInterval=e.maxInterval??this.maxInterval,this.maxPersistedEventsSize=e.maxPersistedEventsSize??this.maxPersistedEventsSize,this.interval=this.minInterval}return Object.defineProperty(e.prototype,"timeAtLastSplit",{get:function(){return this._timeAtLastSplit},enumerable:!1,configurable:!0}),e.prototype.getStringSize=function(e){for(var t=0,n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r<=127)t++;else if(r<=2047)t+=2;else if(r>=55296&&r<=56319){var i=n+1<e.length?e.charCodeAt(n+1):NaN;i>=56320&&i<=57343?(t+=4,n++):t+=3}else t+=3}return t},e.prototype.getEventsArraySize=function(e){var t,n,r=0;try{for(var i=G(e),a=i.next();!a.done;a=i.next()){var o=a.value;r+=this.getStringSize(o)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}var s=2+Math.max(0,e.length-1)+e.length*2;return r+s},e}(),mx=function(e){return typeof e==`object`&&!!e&&e.name===`AbortError`},hx=function(e,t,n){mx(n)?e.debug(t):e.warn(t)};function gx(){try{return crypto.randomUUID()}catch{return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,function(e){var t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}}var _x=`sessionCurrentSequence`,vx=`sequencesToSend`,yx=2e3,bx=5e3;function xx(e,t,n){return n===void 0&&(n=`IDB operation timed out`),new Promise(function(r,i){var a=setTimeout(function(){return i(Error(`${n} after ${t}ms`))},t);e.then(function(e){clearTimeout(a),r(e)},function(e){clearTimeout(a),i(e)})})}function Sx(e,t,n){var r=setTimeout(n,t);return e.then(function(){return clearTimeout(r)},function(){return clearTimeout(r)}),function(){return clearTimeout(r)}}var Cx=function(e){var t,n;return e.objectStoreNames.contains(`sessionCurrentSequence`)||(n=e.createObjectStore(_x,{keyPath:`sessionId`})),e.objectStoreNames.contains(`sequencesToSend`)||(t=e.createObjectStore(vx,{keyPath:`sequenceId`,autoIncrement:!0}),t.createIndex(`sessionId`,`sessionId`)),{sequencesStore:t,currentSequenceStore:n}},wx=function(e){return U(void 0,void 0,void 0,function(){return W(this,function(t){switch(t.label){case 0:return[4,xx(_h(e,1,{upgrade:Cx}),yx,`IDB openDB timed out`)];case 1:return[2,t.sent()]}})})},Tx=function(e){pf(t,e);function t(t){var n=this;return n=e.call(this,t)||this,n.consecutiveFailures=0,n.hasTriggeredFallback=!1,n.emptyFilteredCount=0,n.getSequencesToSend=function(){return U(n,void 0,void 0,function(){var e,t,n,r,i,a,o,s,c,l,u=this;return W(this,function(d){switch(d.label){case 0:e=!1,t=!1,d.label=1;case 1:return d.trys.push([1,9,,10]),n=[],r=this.db.transaction(`sequencesToSend`,`readwrite`),r.done.catch(function(n){!e&&!t&&(hx(u.loggerProvider,`${rx}: ${n}`,n),u.recordFailure())}),i=Sx(r.done,bx,function(){!e&&!t&&(t=!0,hx(u.loggerProvider,`${rx}: transaction timed out`),u.recordFailure())}),[4,r.store.openCursor()];case 2:a=d.sent(),d.label=3;case 3:return a?(o=a.value,s=o.sessionId,c=o.events,c.length===0?(this.maybeLogEmptyFiltered(`getSequencesToSend`),[4,a.delete()]):[3,5]):[3,8];case 4:return d.sent(),[3,6];case 5:n.push({events:c,sequenceId:a.key,sessionId:s}),d.label=6;case 6:return[4,a.continue()];case 7:return a=d.sent(),[3,3];case 8:return this.recordSuccess(),i(),[2,n];case 9:return l=d.sent(),t||(e=!0,hx(this.loggerProvider,`${rx}: ${l}`,l),this.recordFailure()),[3,10];case 10:return[2,void 0]}})})},n.storeCurrentSequence=function(e){return U(n,void 0,void 0,function(){var t,n,r,i,a,o,s,c,l=this;return W(this,function(u){switch(u.label){case 0:t=!1,n=!1,u.label=1;case 1:return u.trys.push([1,5,,6]),r=this.db.transaction([_x,vx],`readwrite`),r.done.catch(function(e){!t&&!n&&(hx(l.loggerProvider,`${rx}: ${e}`,e),l.recordFailure())}),i=Sx(r.done,bx,function(){!t&&!n&&(n=!0,hx(l.loggerProvider,`${rx}: transaction timed out`),l.recordFailure())}),[4,r.objectStore(_x).get(e)];case 2:return a=u.sent(),!a||a.tabId&&a.tabId!==this.tabId?(i(),[2,void 0]):a.events.length===0?(this.maybeLogEmptyFiltered(`storeCurrentSequence`),i(),[2,void 0]):[4,r.objectStore(vx).put({sessionId:e,events:a.events,tabId:this.tabId})];case 3:return o=u.sent(),[4,r.objectStore(_x).put({sessionId:e,events:[],tabId:this.tabId})];case 4:return u.sent(),this.recordSuccess(),i(),a.tabId,s=mf(a,[`tabId`]),[2,H(H({},s),{sessionId:e,sequenceId:o})];case 5:return c=u.sent(),n||(t=!0,hx(this.loggerProvider,`${rx}: ${c}`,c),this.recordFailure()),[3,6];case 6:return[2,void 0]}})})},n.addEventToCurrentSequence=function(e,t){return U(n,void 0,void 0,function(){var n,r,i,a,o,s,c,l,u,d=this;return W(this,function(f){switch(f.label){case 0:n=!1,r=!1,f.label=1;case 1:return f.trys.push([1,15,,16]),i=this.db.transaction([_x,vx],`readwrite`),i.done.catch(function(e){!n&&!r&&(hx(d.loggerProvider,`${rx}: ${e}`,e),d.recordFailure())}),a=Sx(i.done,bx,function(){!n&&!r&&(r=!0,hx(d.loggerProvider,`${rx}: transaction timed out`),d.recordFailure())}),[4,i.objectStore(_x).get(e)];case 2:return o=f.sent(),o?.tabId&&o.tabId!==this.tabId?o.events.length>0?[4,i.objectStore(vx).put({sessionId:e,events:o.events,tabId:o.tabId})]:[3,4]:[3,6];case 3:f.sent(),f.label=4;case 4:return[4,i.objectStore(_x).put({sessionId:e,events:[t],tabId:this.tabId})];case 5:return f.sent(),this.recordSuccess(),a(),[2,void 0];case 6:return s=o,s?[3,8]:[4,i.objectStore(_x).put({sessionId:e,events:[t],tabId:this.tabId})];case 7:return f.sent(),this.recordSuccess(),a(),[2,void 0];case 8:return this.shouldSplitEventsList(s.events,t)?[3,10]:[4,i.objectStore(_x).put({sessionId:e,events:s.events.concat(t),tabId:this.tabId})];case 9:return f.sent(),this.recordSuccess(),a(),[2,void 0];case 10:return c=s.events,c.length===0?(this.maybeLogEmptyFiltered(`addEventToCurrentSequence`),[4,i.objectStore(_x).put({sessionId:e,events:[t],tabId:this.tabId})]):[3,12];case 11:return f.sent(),this.recordSuccess(),a(),[2,void 0];case 12:return[4,i.objectStore(_x).put({sessionId:e,events:[t],tabId:this.tabId})];case 13:return f.sent(),[4,i.objectStore(vx).put({sessionId:e,events:c,tabId:this.tabId})];case 14:return l=f.sent(),this.recordSuccess(),a(),[2,{events:c,sessionId:e,sequenceId:l}];case 15:return u=f.sent(),r||(n=!0,hx(this.loggerProvider,`${rx}: ${u}`,u),this.recordFailure()),[3,16];case 16:return[2,void 0]}})})},n.storeSendingEvents=function(e,t){return U(n,void 0,void 0,function(){var n,r;return W(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.db.put(vx,{sessionId:e,events:t,tabId:this.tabId})];case 1:return n=i.sent(),this.recordSuccess(),[2,n];case 2:return r=i.sent(),hx(this.loggerProvider,`${rx}: ${r}`,r),this.recordFailure(),[3,3];case 3:return[2,void 0]}})})},n.cleanUpSessionEventsStore=function(e,t){return U(n,void 0,void 0,function(){var e;return W(this,function(n){switch(n.label){case 0:if(!t)return[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.db.delete(vx,t)];case 2:return n.sent(),this.recordSuccess(),[3,4];case 3:return e=n.sent(),hx(this.loggerProvider,`${rx}: ${e}`,e),this.recordFailure(),[3,4];case 4:return[2]}})})},n.db=t.db,n.tabId=t.tabId,n.onPersistentFailure=t.onPersistentFailure,n.consecutiveFailureThreshold=t.consecutiveFailureThreshold??1,n}return t.prototype.maybeLogEmptyFiltered=function(e){this.emptyFilteredCount++%100==0&&this.loggerProvider.debug(`Filtered empty session replay sequence at ${e} (idb store)`)},t.prototype.recordFailure=function(){var e;this.consecutiveFailures++,!this.hasTriggeredFallback&&this.consecutiveFailures>=this.consecutiveFailureThreshold&&(this.hasTriggeredFallback=!0,(e=this.onPersistentFailure)==null||e.call(this))},t.prototype.recordSuccess=function(){this.consecutiveFailures=0},t.new=function(e,n){return U(this,void 0,void 0,function(){var r,i,a,o,s;return W(this,function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),r=e===`replay`?``:`_${e}`,i=`${n.apiKey.substring(0,10)}_amp_session_replay_events${r}`,[4,wx(i)];case 1:return a=c.sent(),o=n.tabId??gx(),[2,new t(H(H({},n),{db:a,tabId:o}))];case 2:return s=c.sent(),hx(n.loggerProvider,`${rx}: ${s}`,s),[3,3];case 3:return[2]}})})},t.prototype.getCurrentSequenceEvents=function(e){return U(this,void 0,void 0,function(){var t,n,r,i,a,t,n,o,s,c;return W(this,function(l){switch(l.label){case 0:return e?[4,this.db.get(`sessionCurrentSequence`,e)]:[3,2];case 1:return t=l.sent(),!t||t.tabId&&t.tabId!==this.tabId?[2,void 0]:(t.tabId,n=mf(t,[`tabId`]),[2,[n]]);case 2:r=[],l.label=3;case 3:return l.trys.push([3,8,9,10]),[4,this.db.getAll(`sessionCurrentSequence`)];case 4:i=G.apply(void 0,[l.sent()]),a=i.next(),l.label=5;case 5:if(a.done)return[3,7];if(t=a.value,t.tabId&&t.tabId!==this.tabId)return[3,6];t.tabId,n=mf(t,[`tabId`]),r.push(n),l.label=6;case 6:return a=i.next(),[3,5];case 7:return[3,10];case 8:return o=l.sent(),s={error:o},[3,10];case 9:try{a&&!a.done&&(c=i.return)&&c.call(i)}finally{if(s)throw s.error}
276return[7];case 10:return[2,r]}})})},t}(px),Ex=function(e){pf(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.finalizedSequences={},t.sequences={},t.sequenceId=0,t.emptyFilteredCount=0,t}return t.prototype.resetCurrentSequence=function(e){this.sequences[e]=[]},t.prototype.addSequence=function(e){var t=this.sequenceId++,n=q([],K(this.sequences[e]),!1);return this.finalizedSequences[t]={sessionId:e,events:n},this.resetCurrentSequence(e),{sequenceId:t,events:n,sessionId:e}},t.prototype.maybeLogEmptyFiltered=function(e){this.emptyFilteredCount++%100==0&&this.loggerProvider.debug(`Filtered empty session replay sequence at ${e} (in-memory store)`)},t.prototype.getSequencesToSend=function(){return U(this,void 0,void 0,function(){var e,t,n,r,i,a,o,s,c,l;return W(this,function(u){e=[];try{for(t=G(Object.entries(this.finalizedSequences)),n=t.next();!n.done;n=t.next()){if(r=K(n.value,2),i=r[0],a=r[1],o=a.sessionId,s=a.events,s.length===0){this.maybeLogEmptyFiltered(`getSequencesToSend`),delete this.finalizedSequences[Number(i)];continue}e.push({sequenceId:Number(i),sessionId:o,events:s})}}catch(e){c={error:e}}finally{try{n&&!n.done&&(l=t.return)&&l.call(t)}finally{if(c)throw c.error}}return[2,e]})})},t.prototype.storeCurrentSequence=function(e){return U(this,void 0,void 0,function(){var t;return W(this,function(n){return t=this.sequences[e],t?t.length===0?(this.maybeLogEmptyFiltered(`storeCurrentSequence`),[2,void 0]):[2,this.addSequence(e)]:[2,void 0]})})},t.prototype.addEventToCurrentSequence=function(e,t){return U(this,void 0,void 0,function(){var n;return W(this,function(r){return this.sequences[e]||this.resetCurrentSequence(e),this.shouldSplitEventsList(this.sequences[e],t)&&(this.sequences[e].length===0?this.maybeLogEmptyFiltered(`addEventToCurrentSequence`):n=this.addSequence(e)),this.sequences[e].push(t),[2,n]})})},t.prototype.storeSendingEvents=function(e,t){return U(this,void 0,void 0,function(){return W(this,function(n){return this.finalizedSequences[this.sequenceId]={sessionId:e,events:t},[2,this.sequenceId++]})})},t.prototype.cleanUpSessionEventsStore=function(e,t){return U(this,void 0,void 0,function(){return W(this,function(e){return t!==void 0&&delete this.finalizedSequences[t],[2]})})},t}(px),Dx=function(e){var t=e.config,n=e.minInterval,r=e.maxInterval,i=e.maxPersistedEventsSize,a=e.type,o=e.payloadBatcher,s=e.storeType,c=e.trackDestinationWorkerScript,l=e.shouldSend;return U(void 0,void 0,void 0,function(){function e(e){return e===void 0&&(e=!1),U(this,void 0,void 0,function(){return W(this,function(t){return[2,d.flush(e)]})})}var u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D;return W(this,function(O){switch(O.label){case 0:return u=t.maxSingleEventSizeBytes??Zy,d=new fx(H(H({},t),{loggerProvider:t.loggerProvider,payloadBatcher:o,workerScript:c})),f=function(){return new Ex({loggerProvider:t.loggerProvider,maxInterval:r,minInterval:n,maxPersistedEventsSize:i})},m=!1,g=function(){return U(void 0,void 0,void 0,function(){var e,n,r;return W(this,function(i){switch(i.label){case 0:return m?(m=!1,t.loggerProvider.warn(`IDB store is experiencing repeated failures; falling back to in-memory event store.`),p?[4,h.getSequencesToSend()]:[3,2]):[2];case 1:return n=i.sent(),[3,3];case 2:n=void 0,i.label=3;case 3:return e=n,h=f(),e&&p&&(r=p,e.forEach(function(e){S({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:r})})),[2]}})})},_=function(){return U(void 0,void 0,void 0,function(){var e;return W(this,function(o){switch(o.label){case 0:return[4,Tx.new(a,{loggerProvider:t.loggerProvider,minInterval:n,maxInterval:r,maxPersistedEventsSize:i,apiKey:t.apiKey,onPersistentFailure:function(){g()}})];case 1:return e=o.sent(),e?(m=!0,[2,e]):(t.loggerProvider.log(`Failed to initialize idb store, falling back to memory store.`),[2,f()])}})})},s===`idb`?[4,_()]:[3,2];case 1:return v=O.sent(),[3,3];case 2:v=f(),O.label=3;case 3:return h=v,y=[],b=0,x=function(e){if(!(e<=b)){var t=Math.min(e-b,y.length);t>0&&(y.splice(0,t),b=e)}},S=function(e){var n=e.events,r=e.sessionId,i=e.deviceId,o=e.sequenceId,s=n.map(function(e){return{event:e,bytes:new Blob([e]).size}}
276),c=s.filter(function(e){return e.bytes>u});c.length>0&&t.loggerProvider.warn(`Dropping ${c.length} oversized event(s) from session replay sequence before send. Sizes: ${c.map(function(e){return`${Math.round(e.bytes/1024)} KB`}).join(`, `)}. If this recurs, please open a GitHub issue at https://github.com/amplitude/Amplitude-TypeScript/issues or contact Amplitude support.`);var l=c.length>0?s.filter(function(e){return e.bytes<=u}).map(function(e){return e.event}):n;if(l.length===0){h.cleanUpSessionEventsStore(r,o).catch(function(e){t.loggerProvider.warn(`Failed to clean up session replay events store:`,e)});return}t.debugMode&&Ob().then(function(e){var n=e.totalStorageSize,r=e.percentOfQuota,i=e.usageDetails;t.loggerProvider.debug(`Total storage size: ${n} KB, percentage of quota: ${r}%, usage details: ${i}`)}).catch(function(){}),d.sendEventsList({events:l,sessionId:r,flushMaxRetries:t.flushMaxRetries,apiKey:t.apiKey,deviceId:i,sampleRate:t.sampleRate,serverZone:t.serverZone,version:t.version,type:a,onComplete:function(){return U(void 0,void 0,void 0,function(){return W(this,function(e){switch(e.label){case 0:return[4,h.cleanUpSessionEventsStore(r,o)];case 1:return e.sent(),[2]}})})}})},C=function(e){var n=e.sessionId,r=e.deviceId;if(p=r,!(l&&!l())){var i=b+y.length;h.storeCurrentSequence(n).then(function(e){e&&(x(i),S({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:r}))}).catch(function(e){t.loggerProvider.warn(`Failed to get current sequence of session replay events for session:`,e)})}},w=function(e){var n=e.deviceId;return U(void 0,void 0,void 0,function(){var e;return W(this,function(r){switch(r.label){case 0:return p=n,[4,h.getSequencesToSend()];case 1:return e=r.sent(),e?.length?(t.loggerProvider.log(`Draining ${e.length} stored sequence(s) from previous session.`),e.length>1&&d.markCoalesceNextFlush(),e.forEach(function(e){S({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:n})}),[2]):[2]}})})},T=function(e){var n=e.event,r=e.sessionId,i=e.deviceId;p=i;var a=!l||l(),o=b+y.length;y.push(n.data),h.addEventToCurrentSequence(r,n.data).then(function(e){if(e){if(!a){h.cleanUpSessionEventsStore(e.sessionId,e.sequenceId).catch(function(e){t.loggerProvider.warn(`Failed to clean up dropped session replay sequence:`,e)}),x(o);return}x(o),S({sequenceId:e.sequenceId,events:e.events,sessionId:e.sessionId,deviceId:i})}}).catch(function(e){t.loggerProvider.warn(`Failed to add event to session replay capture:`,e)})},E=function(){return q([],K(y),!1)},D=function(){x(b+y.length)},[2,{sendCurrentSequenceEvents:C,addEvent:T,sendStoredEvents:w,flush:e,getBeaconEvents:E,dropPendingBeaconEvents:D,trackDestination:d}]}})})},Ox=function(){function e(){var e=[...arguments],t=new Map;e.forEach(function(e){t.set(e.name,e.manager)}),this.managers=t}return e.prototype.sendStoredEvents=function(e){return U(this,void 0,void 0,function(){var t;return W(this,function(n){switch(n.label){case 0:return t=[],this.managers.forEach(function(n){t.push(n.sendStoredEvents(e))}),[4,Promise.all(t)];case 1:return n.sent(),[2]}})})},e.prototype.addEvent=function(e){var t,n=e.sessionId,r=e.event,i=e.deviceId;(t=this.managers.get(r.type))==null||t.addEvent({sessionId:n,event:r,deviceId:i})},e.prototype.sendCurrentSequenceEvents=function(e){var t=e.sessionId,n=e.deviceId;this.managers.forEach(function(e){e.sendCurrentSequenceEvents({sessionId:t,deviceId:n})})},e.prototype.flush=function(e){return U(this,void 0,void 0,function(){var t;return W(this,function(n){switch(n.label){case 0:return t=[],this.managers.forEach(function(n){t.push(n.flush(e))}),[4,Promise.all(t)];case 1:return n.sent(),[2]}})})},e}(),kx,Ax,jx;function Mx(e,t){if(jx=new Date,e.nodeType!==Node.ELEMENT_NODE)throw Error(`Can't generate CSS selector for non-element node type.`);if(e.tagName.toLowerCase()===`html`)return`html`;var n={root:document.body,idName:function(e){return!0},className:function(e){return!0},tagName:function(e){return!0},attr:function(e,t){return!1},seedMinLength:1,optimizedMinLength:2,threshold:1e3,maxNumberOfTries:1e4,timeoutMs:void 0};kx=H(H({},n),t),Ax=Nx(kx.root,n);var r=Px(e,`all`,function(){return Px(e,`two`,function(){return Px(e,`one`,function(){return Px(e,`none`)})})});if(r){var i=Xx(Zx(r,e));return i.length>0&&(r=i[0]),Ix(r)}else throw Error(`Selector was not found.`)}
276function Nx(e,t){return e.nodeType===Node.DOCUMENT_NODE?e:e===t.root?e.ownerDocument:e}function Px(e,t,n){for(var r=null,i=[],a=e,o=0,s=function(){var e,s,c=new Date().getTime()-jx.getTime();if(kx.timeoutMs!==void 0&&c>kx.timeoutMs)throw Error(`Timeout: Can't find a unique selector after ${c}ms`);var l=qx(zx(a))||qx.apply(void 0,q([],K(Bx(a)),!1))||qx.apply(void 0,q([],K(Vx(a)),!1))||qx(Hx(a))||[Ux()],u=Wx(a);if(t==`all`)u&&(l=l.concat(l.filter(Kx).map(function(e){return Gx(e,u)})));else if(t==`two`)l=l.slice(0,1),u&&(l=l.concat(l.filter(Kx).map(function(e){return Gx(e,u)})));else if(t==`one`){var d=K(l=l.slice(0,1),1)[0];u&&Kx(d)&&(l=[Gx(d,u)])}else t==`none`&&(l=[Ux()],u&&(l=[Gx(l[0],u)]));try{for(var f=(e=void 0,G(l)),p=f.next();!p.done;p=f.next()){var d=p.value;d.level=o}}catch(t){e={error:t}}finally{try{p&&!p.done&&(s=f.return)&&s.call(f)}finally{if(e)throw e.error}}if(i.push(l),i.length>=kx.seedMinLength&&(r=Fx(i,n),r))return`break`;a=a.parentElement,o++};a&&s()!==`break`;);return r||=Fx(i,n),!r&&n?n():r}function Fx(e,t){var n,r,i=Xx(Yx(e));if(i.length>kx.threshold)return t?t():null;try{for(var a=G(i),o=a.next();!o.done;o=a.next()){var s=o.value;if(Rx(s))return s}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return null}function Ix(e){for(var t=e[0],n=t.name,r=1;r<e.length;r++){var i=e[r].level||0;n=t.level===i-1?`${e[r].name} > ${n}`:`${e[r].name} ${n}`,t=e[r]}return n}function Lx(e){return e.map(function(e){return e.penalty}).reduce(function(e,t){return e+t},0)}function Rx(e){var t=Ix(e);switch(Ax.querySelectorAll(t).length){case 0:throw Error(`Can't select any node with this selector: ${t}`);case 1:return!0;default:return!1}}function zx(e){var t=e.getAttribute(`id`);return t&&kx.idName(t)?{name:`#`+CSS.escape(t),penalty:0}:null}function Bx(e){return Array.from(e.attributes).filter(function(e){return kx.attr(e.name,e.value)}).map(function(e){return{name:`[${CSS.escape(e.name)}="${CSS.escape(e.value)}"]`,penalty:.5}})}function Vx(e){return Array.from(e.classList).filter(kx.className).map(function(e){return{name:`.`+CSS.escape(e),penalty:1}})}function Hx(e){var t=e.tagName.toLowerCase();return kx.tagName(t)?{name:t,penalty:2}:null}function Ux(){return{name:`*`,penalty:3}}function Wx(e){var t=e.parentNode;if(!t)return null;var n=t.firstChild;if(!n)return null;for(var r=0;n&&(n.nodeType===Node.ELEMENT_NODE&&r++,n!==e);)n=n.nextSibling;return r}function Gx(e,t){return{name:e.name+`:nth-child(${t})`,penalty:e.penalty+1}}function Kx(e){return e.name!==`html`&&!e.name.startsWith(`#`)}function qx(){var e=[...arguments].filter(Jx);return e.length>0?e:null}function Jx(e){return e!=null}function Yx(e,t){var n,r,i,a,o,s;return t===void 0&&(t=[]),W(this,function(c){switch(c.label){case 0:if(!(e.length>0))return[3,9];c.label=1;case 1:c.trys.push([1,6,7,8]),n=G(e[0]),r=n.next(),c.label=2;case 2:return r.done?[3,5]:(i=r.value,[5,G(Yx(e.slice(1,e.length),t.concat(i)))]);case 3:c.sent(),c.label=4;case 4:return r=n.next(),[3,2];case 5:return[3,8];case 6:return a=c.sent(),o={error:a},[3,8];case 7:try{r&&!r.done&&(s=n.return)&&s.call(n)}finally{if(o)throw o.error}return[7];case 8:return[3,11];case 9:return[4,t];case 10:c.sent(),c.label=11;case 11:return[2]}})}function Xx(e){return q([],K(e),!1).sort(function(e,t){return Lx(e)-Lx(t)})}function Zx(e,t,n){var r,i,a;return n===void 0&&(n={counter:0,visited:new Map}),W(this,function(o){switch(o.label){case 0:if(!(e.length>2&&e.length>kx.optimizedMinLength))return[3,5];r=1,o.label=1;case 1:return r<e.length-1?n.counter>kx.maxNumberOfTries||(n.counter+=1,i=q([],K(e),!1),i.splice(r,1),a=Ix(i),n.visited.has(a))?[2]:Rx(i)&&Qx(i,t)?[4,i]:[3,4]:[3,5];case 2:return o.sent(),n.visited.set(a,!0),[5,G(Zx(i,t,n))];case 3:o.sent(),o.label=4;case 4:return r++,[3,1];case 5:return[2]}})}function Qx(e,t){return Ax.querySelector(Ix(e))===t}var $x=36e5,eS=function(e){var t=e.version,n=e.events,r=[];return n.forEach(function(e){var t=JSON.parse(e);t.count=1,t.type===`click`&&r.push(t)}),{version:t,events:r}},tS=function(e){var t=e.version,n=e.events,r=[];
276n.forEach(function(e){var t=JSON.parse(e);t.type===`click`&&r.push(t)});var i=r.reduce(function(e,t){var n=t.x,r=t.y,i=t.selector,a=t.timestamp,o=a-a%$x,s=`${n}:${r}:${i??``}:${o}`;return e[s]?e[s].count+=1:e[s]=H(H({},t),{timestamp:o,count:1}),e},{});return{version:t,events:Object.values(i)}},nS=function(){function e(e,t){var n=this;this.createHook=function(e){var t=e.eventsManager,r=e.sessionId,i=e.deviceIdFn,a=e.mirror,o=e.ugcFilterRules,s=e.performanceOptions;return function(e){if(e.type===Bb.Click){var c=J();if(c){var l=c.location,u=c.innerHeight,d=c.innerWidth;if(l){var f=e.x,p=e.y;if(!(f===void 0||p===void 0)){var m=a.getNode(e.id),h;if(m)try{h=Mx(m,s)}catch{n.logger.debug(`error resolving selector from finder`)}var g=Db(l.href,o),_={x:f+n.scrollWatcher.currentScrollX,y:p+n.scrollWatcher.currentScrollY,selector:h,viewportHeight:u,viewportWidth:d,pageUrl:g,timestamp:Date.now(),type:`click`},v=i();v&&t.addEvent({sessionId:r,event:{type:`interaction`,data:JSON.stringify(_)},deviceId:v})}}}}}},this.logger=e,this.scrollWatcher=t}return e}();function rS(){return J()?.innerHeight||document.documentElement&&document.documentElement.clientHeight||0}function iS(){return J()?.innerWidth||document.documentElement&&document.documentElement.clientWidth||0}var aS=function(){function e(e,t){var n=J();n&&n.navigator&&typeof n.navigator.sendBeacon==`function`?this.sendBeacon=function(e,t){try{if(n.navigator.sendBeacon(e,JSON.stringify(t)))return!0}catch{}return!1}:this.sendBeacon=function(){return!1},this.sendXhr=function(e,t){var n=new XMLHttpRequest;return n.open(`POST`,e,!0),n.setRequestHeader(`Accept`,`*/*`),n.send(JSON.stringify(t)),!0},this.basePageUrl=hb(t.serverZone,t.trackServerUrl),this.apiKey=t.apiKey,this.context=e,this.handleSendEvents=t.handleSendEvents,this.loggerProvider=t.loggerProvider}return e.prototype.send=function(e,t){var n=this,r,i=this.context,a=i.sessionId,o=i.t
276ype;if(this.handleSendEvents){var s=new URLSearchParams({device_id:e,session_id:String(a),type:String(o)}),c=`${this.basePageUrl}?${s.toString()}`,l={"Content-Type":`application/json`,Accept:`*/*`,Authorization:`Bearer ${this.apiKey}`};try{this.handleSendEvents({url:c,method:`POST`,headers:l,body:JSON.stringify(t),keepalive:!0}).catch(function(e){var t;(t=n.loggerProvider)==null||t.warn(`Custom transport failed to send session replay interaction beacon:`,e)})}catch(e){(r=this.loggerProvider)==null||r.warn(`Custom transport threw while sending session replay interaction beacon:`,e)}return}var u=new URLSearchParams({device_id:e,session_id:String(a),type:String(o),api_key:this.apiKey}),d=`${this.basePageUrl}?${u.toString()}`;this.sendBeacon(d,t)||this.sendXhr(d,t)},e}(),oS=function(){function e(e,t){var n=this;this.timestamp=Date.now(),this.hook=function(e){n.update(e)},this.send=function(e){return function(t){var r=e(),i=J();if(i&&r){var a=i.scrollX??0,o=i.scrollY??0;(a>0||o>0)&&n.update({id:1,x:a,y:o}),n.transport.send(r,{version:1,events:[{maxScrollX:n._maxScrollX,maxScrollY:n._maxScrollY,maxScrollWidth:n._maxScrollWidth,maxScrollHeight:n._maxScrollHeight,viewportHeight:rS(),viewportWidth:iS(),pageUrl:Db(i.location.href,n.config.interactionConfig?.ugcFilterRules??[]),timestamp:n.timestamp,type:`scroll`}]})}}},this._maxScrollX=0,this._maxScrollY=0,this._currentScrollX=0,this._currentScrollY=0,this._maxScrollWidth=iS(),this._maxScrollHeight=rS(),this.config=t,this.transport=e}return e.default=function(t,n){return new e(new aS(t,n),n)},Object.defineProperty(e.prototype,"maxScrollX",{get:function(){return this._maxScrollX},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollY",{get:function(){return this._maxScrollY},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollWidth",{get:function(){return this._maxScrollWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxScrollHeight",{get:function(){return this._maxScrollHeight},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentScrollX",{get:function(){return this._currentScrollX},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentScrollY",{get:function(){return this._currentScrollY},enumerable:!1,configurable:!0}),e.prototype.update=function(e){var t=Date.now();if(this._currentScrollX=e.x,this._currentScrollY=e.y,e.x>this._maxScrollX){var n=iS();this._maxScrollX=e.x;var r=e.x+n;r>this._maxScrollWidth&&(this._maxScrollWidth=r),this.timestamp=t}if(e.y>this._maxScrollY){var i=rS();this._maxScrollY=e.y;var a=e.y+i;a>this._maxScrollHeight&&(this._maxScrollHeight=a),this.timestamp=t}},e}(),sS=function(){function e(e){var t=e.sessionId,n=e.deviceId;this.deviceId=n,this.sessionId=t,t&&n&&(this.sessionReplayId=Sb(t,n))}return e}(),cS=`AMP_SR_START_`,lS=10,uS=function(e){return`${cS}${e.substring(0,lS)}_`},dS=function(e,t){return`${uS(e)}${t}`},fS=function(){try{return J()?.localStorage}catch{return}},pS=function(e,t,n,r){var i=fS();if(i){var a=dS(e,t);try{var o=i.getItem(a);if(o!==null){var s=Number(o);if(Number.isFinite(s)&&s>0&&s<=n&&n-s<864e5)return s}return i.setItem(a,String(n)),n}catch(e){r?.debug(`Failed to read/write replay start time from storage: ${String(e)}`);return}}},mS=function(e,t,n,r){var i=fS();if(i)try{i.setItem(dS(e,t),String(n))}catch(e){r?.debug(`Failed to write replay start time to storage: ${String(e)}`)}},hS=function(e,t,n){var r=fS();if(r)try{r.removeItem(dS(e,t))}catch(e){n?.debug(`Failed to remove replay start time from storage: ${String(e)}`)}},gS=function(e,t,n){var r,i,a=fS();if(a){var o=uS(e);try{for(var s=[],c=0;c<a.length;c++){var l=a.key(c);if(!(!l||!l.startsWith(o))){var u=a.getItem(l);if(u!==null){var d=Number(u);(!Number.isFinite(d)||d<=0||t-d>=864e5)&&s.push(l)}}}try{for(var f=G(s),p=f.next();!p.done;p=f.next()){var l=p.value;a.removeItem(l)}}catch(e){r={error:e}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}catch(e){n?.debug(`Failed to prune stale replay start times: ${String(e)}`)}}},_S=new(function(){function e(){var e=this;this.dbs={},this.createStore=function(t){return U(e,void 0,void 0,function(){return W(this,function(e){switch(e.label){case 0:return[4,_h(t,1,{upgrade:function(e){e.objectStoreNames.contains(`sessionTargetingMatch`)||e.createObjectStore(`sessionTargetingMatch`,{keyPath:`sessionId`})}})];case 1:return[2,e.sent()]}})})},this.openOrCreateDB=function(t){return U(e,void 0,void 0,function(){var e,n;return W(this,function(r){switch(r.label){case 0:return this.dbs&&this.dbs[t]?[2,this.dbs[t]]:(e=`${t.substring(0,10)}_amp_session_replay_targeting`,[4,this.createStore(e)]);case 1:return n=r.sent(),this.dbs[t]=n,[2,n]}})})},this.getTargetingMatchForSession=function(t){var n=t.loggerProvider,r=t.apiKey,i=t.sessionId;return U(e,void 0,void 0,function(){var e,t,a,o;return W(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),[4,this.openOrCreateDB(r)];case 1:return e=s.sent(),t=String(i),[4,e.get(`sessionTargetingMatch`,t)];case 2:return a=s.sent(),[2,a?.targetingMatch];case 3:return o=s.sent(),hx(n,`Failed to get targeting match for session id ${i}: ${o}`,o),[3,4];case 4:return[2,void 0]}})})},this.storeTargetingMatchForSession=function(t){var n=t.loggerProvider,r=t.apiKey,i=t.sessionId,a=t.targetingMatch;return U(e,void 0,void 0,function(){var e,t,o,s;return W(this,function(c){switch(c.label){case 0:return c.trys.push([0,3,,4]),[4,this.openOrCreateDB(r)];case 1:return e=c.sent(),t=String(i),[4,e.put(`sessionTargetingMatch`,{targetingMatch:a,sessionId:t,lastUpdated:Date.now()})];case 2:return o=c.sent(),[2,o];case 3:return s=c.sent(),hx(n,`Failed to store targeting match for session id ${i}: ${s}`,s),[3,4];case 4:return[2,void 0]}})})},this.clearStoreOfOldSessions=function(t){var n=t.loggerProvider,r=t.apiKey,i=t.currentSessionId;return U(e,void 0,void 0,function(){var e,t,a,o,s,c,l,u;return W(this,function(d){switch(d.label){case 0:return d.trys.push([0,8,,9]),[4,this.openOrCreateDB(r)];case 1:return e=d.sent(),t=String(i),a=e.transaction(`sessionTargetingMatch`,`readwrite`),[4,a.store.getAll()];case 2:o=d.sent(),s=0,d.label=3;case 3:return s<o.length?(c=o[s],l=Date.now()-c.lastUpdated,c.sessionId!==t&&l>1728e5?[4,a.store.delete(c.sessionId)]:[3,5]):[3,6];case 4:d.sent(),d.label=5;case 5:return s++,[3,3];case 6:return[4,a.done];case 7:return d.sent(),[3,9];case 8:return u=d.sent(),hx(n,`Failed to clear old targeting matches for sessions: ${u}`,u),[3,9];case 9:return[2]}})})}}return e}()),vS=function(e){var t=e.sessionId,n=e.targetingConfig,r=e.loggerProvider,a=e.apiKey,o=e.targetingParams,s=e.urlChange,c=s!==void 0&&s;return U(void 0,void 0,void 0,function(){var e,s,l,u,d,f,p;return W(this,function(m){switch(m.label){case 0:return[4,_S.clearStoreOfOldSessions({loggerProvider:r,apiKey:a,currentSessionId:t})];case 1:return m.sent(),[4,_S.getTargetingMatchForSession({loggerProvider:r,apiKey:a,sessionId:t})];case 2:if(e=m.sent(),e===!0&&!c)return[2,!0];s=!0,m.label=3;case 3:return m.trys.push([3,6,,7]),[4,i(()=>Promise.resolve().then(()=>Mh),void 0)];case 4:return l=m.sent().evaluateTargeting,u=H(H({},o),{flag:n,sessionId:typeof t==`string`?parseInt(t,10):t,apiKey:a,loggerProvider:r}),[4,l(u)];case 5:return d=m.sent(),d&&d.sr_targeting_config&&(s=d.sr_targeting_config.key===`on`),_S.storeTargetingMatchForSession({loggerProvider:r,apiKey:a,sessionId:t,targetingMatch:s}
276),[3,7];case 6:return f=m.sent(),p=f,r.warn(p.message),[3,7];case 7:return[2,s]}})})},yS=2654435761,bS=2246822519,xS=3266489917,SS=668265263,CS=374761393;function wS(e,t){return(e<<t|e>>>32-t)>>>0}function TS(e,t){return e=e+Math.imul(t,bS)>>>0,e=wS(e,13),e=Math.imul(e,yS)>>>0,e}function ES(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function DS(e){for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r>=55296&&r<=56319&&n+1<e.length){var i=e.charCodeAt(n+1);i>=56320&&i<=57343&&(r=(r-55296<<10)+(i-56320)+65536,n++)}r<128?t.push(r):r<2048?t.push(192|r>>6,128|r&63):r<65536?t.push(224|r>>12,128|r>>6&63,128|r&63):t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|r&63)}return new Uint8Array(t)}function OS(e,t){t===void 0&&(t=0);var n=DS(e),r=n.length,i,a=0;if(r>=16){for(var o=t+yS+bS>>>0,s=t+bS>>>0,c=t>>>0,l=t-yS>>>0;a<=r-16;)o=TS(o,ES(n,a)),a+=4,s=TS(s,ES(n,a)),a+=4,c=TS(c,ES(n,a)),a+=4,l=TS(l,ES(n,a)),a+=4;i=wS(o,1)+wS(s,7)+wS(c,12)+wS(l,18)>>>0}else i=t+CS>>>0;for(i=i+r>>>0;a<=r-4;)i=i+Math.imul(ES(n,a),xS)>>>0,i=Math.imul(wS(i,17),SS)>>>0,a+=4;for(;a<r;)i=i+Math.imul(n[a],CS)>>>0,i=Math.imul(wS(i,11),yS)>>>0,a++;return i^=i>>>15,i=Math.imul(i,bS)>>>0,i^=i>>>13,i=Math.imul(i,xS)>>>0,i^=i>>>16,i>>>0}function kS(e,t){return OS(e.toString())%1e6/1e6<t}var AS=`__amplitude_url_tracking_patched__`,jS=new WeakMap;function MS(e,t,n){if(n===void 0&&(n={}),!e?.location)return function(){};var r=n.enablePolling,i=r!==void 0&&r,a=n.pollingInterval,o=a===void 0?Vy:a;if(i){var s=function(){return e.location.href??``},c=s(),l=e.setInterval(function(){var e=s();e!==c&&(c=e,t(e))},o);return function(){l!=null&&e.clearInterval(l)}}var u=jS.get(e);if(!u){var d=void 0,f=new Set,p=function(){return e.location.href??``},m=function(){var e=p();d!==void 0&&e===d||(d=e,f.forEach(function(t){return t(e)}))},h=function(e){var t=function(){var t=[...arguments],n=e.apply(this,t);return m(),n};return t[AS]=!0,t},g=e.history;if(g?.pushState){var _=Reflect.get(g,`pushState`);_[AS]||(g.pushState=h(_))}if(g?.replaceState){var v=Reflect.get(g,`replaceState`);v[AS]||(g.replaceState=h(v))}u={callbacks:f,notify:m,onPopStateOrHashChange:function(){return m()},listenersAttached:!1},jS.set(e,u)}var y=u;return y.listenersAttached||=(e.addEventListener(`popstate`,y.onPopStateOrHashChange),e.addEventListener(`hashchange`,y.onPopStateOrHashChange),!0),y.callbacks.add(t),function(){y.callbacks.delete(t),y.callbacks.size===0&&(y.listenersAttached&&=(e.removeEventListener(`popstate`,y.onPopStateOrHashChange),e.removeEventListener(`hashchange`,y.onPopStateOrHashChange),!1))}}function NS(e){return e===void 0&&(e={}),{name:`amplitude/url-tracking@1`,observer:function(t,n,r){var i=H(H({},e),r),a=i.ugcFilterRules||[],o=i.enablePolling??!1,s=i.pollingInterval??Vy,c=i.captureDocumentTitle??!1;if(!n)return function(){};var l=void 0,u=function(){return n.location&&n.location.href||``},d=function(){var e=n.innerHeight,t=n.innerWidth,r=n.document,i=u(),o=``;return c&&(o=r?.title||``),{href:a.length>0?Db(i,a):i,title:o,viewportHeight:e,viewportWidth:t,type:`url-change-event`}},f=function(){var e=u();(l===void 0||e!==l)&&(l=e,t(d()))},p=MS(n,function(){return f()},o?{enablePolling:!0,pollingInterval:s}:{});return f(),function(){return p()}},options:e}}NS();function PS(){try{var e=J();return e?e.parent!==e:!1}catch{return!0}}var FS=function(){function e(){this.pendingLoadListeners=new Map}return e.prototype.start=function(){var e=this,t;(t=this.mutationObserver)==null||t.disconnect(),J()&&(this.sendToAllIframes({type:lb,action:`start`}),this.mutationObserver=new MutationObserver(function(t){var n,r,i,a,o,s;try{for(var c=G(t),l=c.next();!l.done;l=c.next()){var u=l.value;try{for(var d=(i=void 0,G(Array.from(u.addedNodes))),f=d.next();!f.done;f=d.next()){var p=f.value;p instanceof HTMLIFrameElement?e.sendToIframeAfterLoad(p):p instanceof Element&&p.querySelectorAll(`iframe`).forEach(function(t){e.sendToIframeAfterLoad(t)})}}catch(e){i={error:e}}finally{try{f&&!f.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}try{for(var m=(o=void 0,G(Array.from(u.removedNodes))),h=m.next();!h.done;h=m.next()){var p=h.value;if(p instanceof HTMLIFrameElement){var g=e.pendingLoadListeners.get(p);g&&(p.removeEventListener(`load`,g),e.pendingLoadListeners.delete(p))}}}catch(e){o={error:e}}finally{try{h&&!h.done&&(s=m.return)&&s.call(m)}finally{if(o)throw o.error}}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}),this.mutationObserver.observe(document.documentElement,{childList:!0,subtree:!0}))},e.prototype.stop=function(){var e;(e=this.mutationObserver)==null||e.disconnect(),this.mutationObserver=void 0,this.pendingLoadListeners.forEac
276h(function(e,t){t.removeEventListener(`load`,e)}),this.pendingLoadListeners.clear(),this.sendToAllIframes({type:lb,action:`stop`})},e.prototype.sendToIframeAfterLoad=function(e){var t=this,n=function(){t.pendingLoadListeners.delete(e),t.sendToIframe(e,{type:lb,action:`start`})};this.pendingLoadListeners.set(e,n),e.addEventListener(`load`,n,{once:!0})},e.prototype.sendToAllIframes=function(e){var t=this;document.querySelectorAll(`iframe`).forEach(function(n){return t.sendToIframe(n,e)})},e.prototype.sendToIframe=function(e,t){var n;try{(n=e.contentWindow)==null||n.postMessage(t,`*`)}catch{}},e}();function IS(e){var t=J();if(!t)return function(){};var n=t.parent;function r(t){if(t.source===n){var r=t.data;r?.type===`amplitude-sr-iframe`&&(r.action===`start`?e.onStart():r.action===`stop`&&e.onStop())}}return t.addEventListener(`message`,r),function(){return t.removeEventListener(`message`,r)}}var LS=function(){function e(){var e=this;this.name=`@amplitude/session-replay-browser`,this.recordCancelCallback=null,this.eventCount=0,this.sessionTargetingMatch=!1,this.pageLeaveFns=[],this.suppressedSendCount=0,this.hasEmittedGateDecision=!1,this.recordFunction=null,this.recordEventsInFlight=!1,this.pendingEmitEvents=[],this.currentPageUrl=``,this.recordEventsPendingShouldLogMetadata=null,this.urlChangeCleanup=null,this.crossOriginIframeCoordinator=null,this.crossOriginParentSignalCleanup=null,this.latestUrlChangeTargetingEvaluationId=0,this.teardownEventListeners=function(t){var n=J();n&&(n.removeEventListener(`blur`,e.blurListener),n.removeEventListener(`focus`,e.focusListener),!t&&n.addEventListener(`blur`,e.blurListener),!t&&n.addEventListener(`focus`,e.focusListener),n.self&&`onpagehide`in n.self?(n.removeEventListener(`pagehide`,e.pageLeaveListener),!t&&n.addEventListener(`pagehide`,e.pageLeaveListener)):(n.removeEventListener(`beforeunload`,e.pageLeaveListener),!t&&n.addEventListener(`beforeunload`,e.pageLeaveListener)))},this.blurListener=function(){e.sendEvents()},this.focusListener=function(){if(e.recordCancelCallback&&e.recordFunction){if(e.config?.captureFullSnapshotOnFocus===!1)return;try{e.recordFunction.takeFullSnapshot(!0)}catch(t){e.loggerProvider.warn(`Failed to take full snapshot on focus:`,t)}}else e.recordEventsInFlight||e.recordEvents(!1)},this.pageLeaveListener=function(t){var n;(n=e.eventCompressor)==null||n.flushQueue(),e.sendEvents(),e.pageLeaveFns.forEach(function(e){e(t)})},this.evaluateTargetingAndCapture=function(t,n,r,i){return n===void 0&&(n=!1),r===void 0&&(r=!1),i===void 0&&(i=!1),U(e,void 0,void 0,function(){var e,a,o,s,c,l,u;return W(this,function(d){switch(d.label){case 0:if(!this.identifiers||!this.identifiers.sessionId||!this.config)return this.identifiers&&!this.identifiers.sessionId?this.loggerProvider.log(`Session ID has not been set yet, cannot evaluate targeting for Session Replay.`):this.loggerProvider.warn(`Session replay init has not been called, cannot evaluate targeting.`),[2];if(!this.config.targetingConfig)if(n)this.loggerProvider.log(`Targeting config has not been set yet, cannot evaluate targeting.`);else return this.loggerProvider.log(`No targeting config set, skipping initialization/recording for event.`),[2];return this.lastTargetingParams=t,e=this.config.targetingConfig,a=e&&!this.sessionTargetingMatch,a?(o=i?this.latestUrlChangeTargetingEvaluationId:void 0,s=t.event,s&&Object.values(gf).includes(s.event_type)&&(s=void 0),c=t.page?.url??J()?.location?.href??``,l=t.page??(c===``?void 0:{url:c}),[4,vS({sessionId:this.identifiers.sessionId,targetingConfig:e,loggerProvider:this.loggerProvider,apiKey:this.config.apiKey,targetingParams:{userProperties:t.userProperties,event:s,page:l},urlChange:i})]):[3,2];case 1:if(u=d.sent(),i&&o!==void 0&&o!==this.latestUrlChangeTargetingEvaluationId)return this.loggerProvider.debug(`Ignoring stale URL-change targeting result #${o}; latest is #${this.latestUrlChangeTargetingEvaluationId}.`),[2];this.sessionTargetingMatch=this.sessionTargetingMatch||u,this.loggerProvider.debug(JSON.stringify({name:`targeted replay capture config`,sessionTargetingMatch:this.sessionTargetingMatch,event:s,targetingParams:t},null,2)),d.label=2;case 2:return n?(this.initialize(!0),[3,5]):[3,3];case 3:return r||!this.recordCancelCallback?(this.loggerProvider.log(`Recording events for session due to forceRestart or no ongoing recording.`),[4,this.recordEvents()]):[3,5];case 4:d.sent(),d.label=5;case 5:return[2]}})})},this.addCustomRRWebEvent=function(t,n,r){return n===void 0&&(n={}),r===void 0&&(r=!0),U(e,void 0,void 0,function(){var e,i,a,o;return W(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),e=void 0,i=this.config,!(i&&t!==ub.METADATA)||(e={config:kb(i),version:sx},!r)?[3,2]:[4,Ob()];case 1:a=s.sent(),e=H(H({},a),e),s.label=2;case 2:return this.recordCancelCallback&&this.recordFunction?this.recordFunction.addCustomEvent(t,H(H({},n),e)):this.loggerProvider.debug(`Not able to add custom replay capture event ${t} due to no ongoing recording.`),[3,4];case 3:return o=s.sent(),this.loggerProvider.debug(`Error while adding custom replay capture event: `,o),[3,4];case 4:return[2]}})})},this.stopRecordingEvents=function(){var t,n,r;try{e.loggerProvider.log(`Session Replay capture stopping.`),e.recordCancelCallback&&e.recordCancelCallback(),e.recordCancelCallback=null,(t=e.networkObservers)==null||t.stop(),(n=e.crossOriginIframeC
276oordinator)==null||n.stop(),e.crossOriginIframeCoordinator=null,(r=e.crossOriginParentSignalCleanup)==null||r.call(e),e.crossOriginParentSignalCleanup=null}catch(t){var i=t;e.loggerProvider.warn(`Error occurred while stopping replay capture: ${i.toString()}`)}},this.loggerProvider=new db(new kf)}return e.prototype.init=function(e,t){return Ef(this._init(e,t))},e.prototype.setupUrlChangeListener=function(){var e=this,t;(t=this.urlChangeCleanup)==null||t.call(this);var n=J();if(n?.location){var r=!!this.config?.targetingConfig,i=MS(n,function(t){if(e.currentPageUrl=t,r){var n=++e.latestUrlChangeTargetingEvaluationId;e.evaluateTargetingAndCapture({userProperties:{},event:void 0,page:{url:t}},!1,!1,!0),e.loggerProvider.debug(`Queued URL-change targeting re-evaluation #${n} for ${t}.`)}});this.urlChangeCleanup=function(){i(),e.urlChangeCleanup=null}}},e.prototype.isBelowMinSessionDuration=function(){var e=this.config?.minSessionDurationMs;return e===void 0||this.sessionStartTime===void 0?!1:Date.now()-this.sessionStartTime<e},e.prototype.getCurrentPageForTargeting=function(){var e=J()?.location?.href;return e==null?void 0:{url:e}},e.prototype._init=function(e,t){var n;return U(this,void 0,void 0,function(){var r,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,x,T,E,D,O,k,A,ee,te,j,ne,re,ie=this;return W(this,function(ae){switch(ae.label){case 0:return(n=this.urlChangeCleanup)==null||n.call(this),this.loggerProvider=new db(t.loggerProvider||new kf),Object.prototype.hasOwnProperty.call(t,`logLevel`)&&this.loggerProvider.enable(t.logLevel),this.currentPageUrl=xb(),this.identifiers=new sS({sessionId:t.sessionId,deviceId:t.deviceId}
276),r=Date.now(),gS(e,r,this.loggerProvider),this.sessionStartTime=t.sessionId===void 0?r:pS(e,t.sessionId,r,this.loggerProvider)??r,a=this,[4,Gb(e,t)];case 1:return a.joinedConfigGenerator=ae.sent(),[4,this.joinedConfigGenerator.generateJoinedConfig()];case 2:return o=ae.sent(),s=o.joinedConfig,c=o.localConfig,l=o.remoteConfig,this.config=s,this.setMetadata(t.sessionId,s,c,l,t.version?.version,sx,t.version?.type),this.pageLeaveFns=[],t.sessionId&&this.config.interactionConfig?.enabled&&(u=oS.default({sessionId:t.sessionId,type:`interaction`},this.config),this.pageLeaveFns=[u.send(this.getDeviceId.bind(this)).bind(u)],this.scrollHook=u.hook.bind(u),this.clickHandler=new nS(this.loggerProvider,u)),d=[],f=this.config.storeType,f===`idb`&&!J()?.indexedDB&&(f=`memory`,this.loggerProvider.warn(`Could not use preferred indexedDB storage, reverting to in memory option.`)),this.loggerProvider.log(`Using ${f} for event storage.`),h=J(),this.config.useWebWorker&&h&&h.Worker?[4,i(()=>Promise.resolve().then(()=>Lp),void 0)]:[3,4];case 3:g=ae.sent(),_=g.compressionScript,v=g.trackDestinationScript,p=_,m=v,ae.label=4;case 4:return ae.trys.push([4,6,,7]),[4,Dx({config:this.config,type:`replay`,minInterval:this.config.flushIntervalConfig?.minIntervalMs,maxInterval:this.config.flushIntervalConfig?.maxIntervalMs,maxPersistedEventsSize:this.config.maxPersistedEventsSizeBytes,storeType:f,trackDestinationWorkerScript:m,shouldSe
276nd:function(){return!ie.isBelowMinSessionDuration()}})];case 5:return y=ae.sent(),this.rrwebEventManager=y,d.push({name:`replay`,manager:y}),[3,7];case 6:return b=ae.sent(),x=b,this.loggerProvider.warn(`Error occurred while creating replay events manager: ${x.toString()}`),[3,7];case 7:if(!this.config.interactionConfig?.enabled)return[3,11];S=this.config.interactionConfig.batch?tS:eS,ae.label=8;case 8:return ae.trys.push([8,10,,11]),[4,Dx({config:this.config,type:`interaction`,minInterval:this.config.interactionConfig.trackEveryNms??$y,maxInterval:eb,maxPersistedEventsSize:this.config.maxPersistedEventsSizeBytes,payloadBatcher:S,storeType:f,trackDestinationWorkerScript:m})];case 9:return C=ae.sent(),d.push({name:`interaction`,manager:C}),[3,11];case 10:return w=ae.sent(),x=w,this.loggerProvider.warn(`Error occurred while creating interaction events manager: ${x.toString()}`),[3,11];case 11:if(this.eventsManager=new(Ox.bind.apply(Ox,q([void 0],K(d),!1))),this.eventCompressor&&this.eventCompressor.terminate(),T=this.config.eagerFullSnapshotSend===!0?function(){return ie.sendEvents()}:void 0,this.eventCompressor=new $b(this.eventsManager,this.config,this.getDeviceId(),p,T),this.pendingEmitEvents.length>0){E=this.pendingEmitEvents.splice(0);try{for(D=G(E),O=D.next();!O.done;O=D.next())k=O.value,A=k.event,ee=k.sessionId,this.eventCompressor.enqueueEvent(A,ee)}catch(e){ne={error:e}}finally{try{O&&!O.done&&(re=D.return)&&re.call(D)}finally{if(ne)throw ne.error}}}return this.pageLeaveFns=q(q([],K(this.pageLeaveFns),!1),[function(){if(!(!ie.config||!ie.identifiers?.sessionId||!y)){var e=y.getBeaconEvents();if(e.length){var t=ie.getDeviceId();t&&(ie.isBelowMinSessionDuration()||y.trackDestination.sendBeacon({events:e,sessionId:ie.identifiers.sessionId,deviceId:t,apiKey:ie.config.apiKey,serverZone:ie.config.serverZone}))}}}],!1),[4,this.initializeNetworkObservers()];case 12:return ae.sent(),J()?.opener&&(te=Cp(),Tp(te),te.setup(H({logger:this.loggerProvider},this.config.serverZone&&{endpoint:mp[this.config.serverZone]}))),this.loggerProvider.log(`Installing @amplitude/session-replay-browser.`),this.teardownEventListeners(!1),[4,this.evaluateTargetingAndCapture({userProperties:t.userProperties,page:this.getCurrentPageForTargeting()},!0)];case 13:return ae.sent(),j=this.config.targetingConfig||(this.config.privacyConfig?.urlMaskLevels?.length??0)>0,j&&this.setupUrlChangeListener(),[2]}})})},e.prototype.setSessionId=function(e,t){return Ef(this.asyncSetSessionId(e,t))},e.prototype.asyncSetSessionId=function(e,t,n){var r;return U(this,void 0,void 0,function(){var i,a,o,s,c;return W(this,function(l){switch(l.label){case 0:return i=this.identifiers?.sessionId,a=this.getDeviceId(),i!==void 0&&i===e&&(t===void 0||t===a)&&(n?.userProperties===void 0||Object.keys(n.userProperties).length===0)?[2]:(this.latestUrlChangeTargetingEvaluationId++,this.sessionTargetingMatch=!1,this.lastShouldRecordDecision=void 0,i&&this.sendEvents(i),o=i!==e,o&&((r=this.rrwebEventManager)==null||r.dropPendingBeaconEvents()),s=t||this.getDeviceId(),this.identifiers=new sS({sessionId:e,deviceId:s}),o&&(this.sessionStartTime=Date.now(),this.suppressedSendCount=0,this.hasEmittedGateDecision=!1,this.config?.apiKey&&(mS(this.config.apiKey,e,this.sessionStartTime,this.loggerProvider),i!==void 0&&hS(this.config.apiKey,i,this.loggerProvider))),this.joinedConfigGenerator&&i?[4,this.joinedConfigGenerator.generateJoinedConfig()]:[3,2]);case 1:c=l.sent().joinedConfig,this.config=c,l.label=2;case 2:return this.config?.targetingConfig?[4,this.evaluateTargetingAndCapture({userProperties:n?.userProperties,page:this.getCurrentPageForTargeting()},!1,!0)]:[3,4];case 3:return l.sent(),[3,6];case 4:return[4,this.recordEvents()];case 5:l.sent(),l.label=6;case 6:return[2]}})})},e.prototype.getSessionReplayProperties=function(){var e,t=this.config,n=this.identifiers;if(!t||!n)return this.loggerProvider.warn(`Session replay init has not been called, cannot get session replay properties.`),{};var r=this.getShouldRecord(),i={};return r&&(i=(e={},e[Ry]=n.sessionReplayId?n.sessionReplayId:null,e),t.debugMode&&(i[Hy]=JSON.stringify({appHash:Zf(t.apiKey).toString()}))),this.addCustomRRWebEvent(ub.GET_SR_PROPS,{shouldRecord:r,eventProperties:i},this.eventCount===10),this.eventCount===10&&(this.eventCount=0),this.eventCount++,i},e.prototype.sendEvents=function(e){var t=e||this.identifiers?.sessionId,n=this.getDeviceId();if(this.eventsManager&&t&&n){if(this.isBelowMinSessionDuration()){var r=this.sessionStartTime,i=this.config.minSessionDurationMs;this.loggerProvider.log(`Session ${t} not sent: duration ${Date.now()-r}ms is below minimum ${i}ms.`),this.suppressedSendCount++;return}if(!this.hasEmittedGateDecision&&this.config?.minSessionDurationMs!==void 0&&this.recordCancelCallback&&this.recordFunction){this.hasEmittedGateDecision=!0;var a=this.sessionStartTime===void 0?void 0:Date.now()-this.sessionStartTime;this.addCustomRRWebEvent(ub.REPLAY_GATE_DECISION,{sessionId:t,suppressedSendCount:this.suppressedSendCount,elapsedMs:a,minSessionDurationMs:this.config.minSessionDurationMs},!1)}this.eventsManager.sendCurrentSequenceEvents({sessionId:t,deviceId:n})}},e.prototype.initialize=function(e){return e===void 0&&(e=!1),U(this,void 0,void 0,function(){var t;return W(this,function(n){return this.identifiers?.sessionId?(t=this.getDeviceId(),t?(this.eventsManager&&e&&this.eventsManager.sendStoredEvents({deviceId:t}),[2,this.recordEvents()]):(this.loggerProvider.log(`Session is not being recorded due to lack of device id.`),[2,Promise.resolve()])):(this.loggerProvider.log(`Session is not being recorded due to lack of session id.`),[2,Promise.resolve()])})})},e.prototype.shouldOptOut=function(){var e;return this.config?.instanceName&&(e=Xf(this.config.instanceName).identityStore.getIdentity().optOut),e===void 0?this.config?.optOut:e},e.prototype.getShouldRecord=function(){if(!this.identifiers||!this.config||!this.identifiers.sessionId)return this.loggerProvider.warn(`Session is not being recorded due to lack of config, please call sessionReplay.init.`),!1;if(!this.config.captureEnabled)return this.loggerProvider.log(`Session ${this.identifiers.sessionId}
276 not being captured due to capture being disabled for project or because the remote config could not be fetched.`),!1;if(this.shouldOptOut())return this.loggerProvider.log(`Opting session ${this.identifiers.sessionId} out of recording due to optOut config.`),!1;var e=!1,t=``,n=!1;return this.config.targetingConfig?this.sessionTargetingMatch?(t=`Capturing replays for session ${this.identifiers.sessionId} due to matching targeting conditions.`,this.loggerProvider.log(t),e=!0,n=!0):(t=`Not capturing replays for session ${this.identifiers.sessionId} due to not matching targeting conditions.`,this.loggerProvider.log(t),e=!1,n=!1):kS(this.identifiers.sessionId,this.config.sampleRate)?(e=!0,n=!0):(t=`Opting session ${this.identifiers.sessionId} out of recording due to sample rate.`,this.loggerProvider.log(t),e=!1,n=!1),this.lastShouldRecordDecision!==e&&this.config.targetingConfig&&(this.addCustomRRWebEvent(ub.TARGETING_DECISION,{message:t,sessionId:this.identifiers.sessionId,matched:n,targetingParams:this.lastTargetingParams}),this.lastShouldRecordDecision=e),e},e.prototype.getBlockSelectors=function(){var e=this.config?.privacyConfig?.blockSelector??[];if(e.length!==0)return e},e.prototype.getMaskTextSelectors=function(){var e=this.config?.privacyConfig;if((e?_b(this.currentPageUrl,e):void 0)===`conservative`||(e?.urlMaskLevels)?.some(function(e){return e.maskLevel===`conservative`}))return`*`;var t=e?.urlMaskLevels;if(e?.defaultMaskLevel===`conservative`&&t&&t.length>0)return`*`;var n=e?.maskSelector;if(n)return n},e.prototype.getRecordingPlugins=function(e){return U(this,void 0,void 0,function(){var t,n,r,o;return W(this,function(s){switch(s.label){case 0:t=[];try{n=NS({ugcFilterRules:this.config?.interactionConfig?.ugcFilterRules||[],enablePolling:this.config?.enableUrlChangePolling||!1,pollingInterval:this.config?.urlChangePollingInterval,captureDocumentTitle:this.config?.captureDocumentTitle}),t.push(n)}catch(e){this.loggerProvider.warn(`Failed to create URL tracking plugin:`,e)}if(!e?.console?.enabled)return[3,4];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,i(()=>Promise.resolve().then(()=>a),void 0)];case 2:return r=s.sent().getRecordConsolePlugin,t.push(r({level:e.console.levels})),[3,4];case 3:return o=s.sent(),this.loggerProvider.warn(`Failed to load console plugin:`,o),[3,4];case 4:return[2,t.length>0?t:void 0]}})})},e.prototype.getRecordFunction=function(){return U(this,void 0,void 0,function(){var e,t;return W(this,function(n){switch(n.label){case 0:if(this.recordFunction)return[2,this.recordFunction];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,i(()=>Promise.resolve().then(()=>Xi),void 0)];case 2:return e=n.sent().record,this.recordFunction=e,[2,e];case 3:return t=n.sent(),this.loggerProvider.warn(`Failed to load rrweb-record module:`,t),[2,null];case 4:return[2]}})})},e.prototype.recordEvents=function(e){return e===void 0&&(e=!0),U(this,void 0,void 0,function(){var t;return W(this,function(n){switch(n.label){case 0:if(this.recordEventsInFlight)return this.recordEventsPendingShouldLogMetadata=e,[2];this.recordEventsInFlight=!0,n.label=1;case 1:return n.trys.push([1,,6,7]),[4,this._recordEvents(e)];case 2:n.sent(),n.label=3;case 3:return this.recordEventsPendingShouldLogMetadata===null?[3,5]:(t=this.recordEventsPendingShouldLogMetadata,this.recordEventsPendingShouldLogMetadata=null,[4,this._recordEvents(t)]);case 4:return n.sent(),[3,3];case 5:return[3,7];case 6:return this.recordEventsInFlight=!1,this.recordEventsPendingShouldLogMetadata=null,[7];case 7:return[2]}})})},e.prototype._recordEvents=function(e){var t;return e===void 0&&(e=!0),U(this,void 0,void 0,function(){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x=this;return W(this,function(S){switch(S.label){case 0:return n=this.config,r=this.getShouldRecord(),i=this.identifiers?.sessionId,!r||!i||!n?[2]:(this.stopRecordingEvents(),[4,this.getRecordFunction()]);case 1:return a=S.sent(),a?[4,this.initializeNetworkObservers()]:[2];case 2:S.sent(),o=n.loggingConfig?.network,s=hb(n.serverZone,n.trackServerUrl),c=[Ky,qy,Jy,s],(t=this.networkObservers)==null||t.start(function(e){c.some(function(t){return e.url.
276startsWith(t)})||x.addCustomRRWebEvent(ub.FETCH_REQUEST,e)},o),l=n.interactionConfig,u=n.loggingConfig,d=l?.enabled?{mouseInteraction:this.eventsManager&&this.clickHandler?.createHook({eventsManager:this.eventsManager,sessionId:i,deviceIdFn:this.getDeviceId.bind(this),mirror:a.mirror,ugcFilterRules:l.ugcFilterRules??[],performanceOptions:n.performanceConfig?.interaction}),scroll:this.scrollHook}:{},f=l?.enabled&&l.ugcFilterRules?l.ugcFilterRules:[],this.loggerProvider.log(`Session Replay capture beginning for ${i}.`),S.label=3;case 3:return S.trys.push([3,5,,6]),p=!!n.crossOriginIframes?.enabled,m=n.crossOriginIframes?.coordinateChildren!==!1,h=p&&PS(),h&&m?(this.crossOriginParentSignalCleanup=IS({onStart:function(){return x._recordEventsInChildMode(a,i,n,d)},onStop:function(){try{x.recordCancelCallback&&x.recordCancelCallback(),x.recordCancelCallback=null}catch(t){var e=t;x.loggerProvider.warn(`Error occurred while stopping child iframe replay capture: ${e.toString()}`)}}}),[2]):(g=this,_=a,v=[H({},this.buildRRWebRecordOptions(n,d,function(e){if(x.shouldOptOut()){x.loggerProvider.log(`Opting session ${i} out of recording due to optOut config.`),x.stopRecordingEvents(),x.sendEvents();return}e.type===Rb.Meta&&(e.data.href=Db(e.data.href,f)),x.eventCompressor?x.eventCompressor.enqueueEvent(e,i):x.pendingEmitEvents.push({event:e,sessionId:i})},`Error while capturing replay: `))],b={},[4,this.getRecordingPlugins(u)]);case 4:return g.recordCancelCallback=_.apply(void 0,[H.apply(void 0,v.concat([(b.plugins=S.sent(),b.recordCrossOriginIframes=p,b)]))]),p&&!h&&m&&(this.crossOriginIframeCoordinator||=new FS,this.crossOriginIframeCoordinator.start()),this.addCustomRRWebEvent(ub.DEBUG_INFO),e&&this.addCustomRRWebEvent(ub.METADATA,this.metadata),[3,6];case 5:return y=S.sent(),this.loggerProvider.warn(`Failed to initialize session replay:`,y),[3,6];case 6:return[2]}})})},e.prototype.buildRRWebRecordOptions=function(e,t,n,r){var i=this,a=e.privacyConfig;return H(H({emit:n,inlineStylesheet:e.shouldInlineStylesheet,hooks:t,maskAllInputs:!0,maskTextClass:Wy,blockClass:Uy,blockSelector:this.getBlockSelectors(),applyBackgroundColorToBlockedElements:e.applyBackgroundColorToBlockedElements,maskInputFn:yb(`input`,a,function(){return i.currentPageUrl}),maskTextFn:yb(`text`,a,function(){return i.currentPageUrl}),maskAttributeFn:bb(a,function(){return i.currentPageUrl}),maskTextSelector:this.getMaskTextSelectors()},e.fullSnapshotIntervalMs!==void 0&&{checkoutEveryNms:e.fullSnapshotIntervalMs}),{recordCanvas:!1,captureAdoptedStyleSheets:e.captureAdoptedStyleSheets,slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0},errorHandler:function(e){var t=e;if(t.message.includes(`insertRule`)&&t.message.includes(`CSSStyleSheet`)||t._external_)throw t;return i.loggerProvider.warn(r,t.toString()),!0}})},e.prototype._recordEventsInChildMode=function(e,t,n,r){try{this.recordCancelCallback&&this.recordCancelCallback(),this.recordCancelCallback=null,this.recordCancelCallback=e(H(H({},this.buildRRWebRecordOptions(n,r,function(){},`Error while capturing replay (child iframe): `)),{recordCrossOriginIframes:!0})),this.loggerProvider.log(`Session Replay child iframe capture beginning for session ${t}.`)}catch(e){this.loggerProvider.warn(`Failed to initialize session replay in child iframe mode:`,e)}},e.prototype.getDeviceId=function(){return this.identifiers?.deviceId},e.prototype.getSessionId=function(){return this.identifiers?.sessionId},e.prototype.flush=function(e){return e===void 0&&(e=!1),U(this,void 0,void 0,function(){return W(this,function(t){return[2,this.eventsManager?.flush(e)]})})},e.prototype.shutdown=function(){var e,t;(e=this.urlChangeCleanup)==null||e.call(this),(t=this.crossOriginParentSignalCleanup)==null||t.call(this),this.crossOriginParentSignalCleanup=null,this.teardownEventListeners(!0),this.stopRecordingEvents(),this.sendEvents()},e.prototype.mapSDKType=function(e){return e===`plugin`?`@amplitude/plugin-session-replay-browser`:e===`segment`?`@amplitude/segment-session-replay-plugin`:null},e.prototype.setMetadata=function(e,t,n,r,i,a,o){var s=e?.toString()?Zf(e.toString()):void 0;this.metadata={joinedConfig:t,localConfig:n,remoteConfig:r,sessionId:e,hashValue:s,sampleRate:t.sampleRate,replaySDKType:this.mapSDKType(o),replaySDKVersion:i,standaloneSDKType:`@amplitude/session-replay-browser`,standaloneSDKVersion:a}},e.prototype.initializeNetworkObservers=function(){return U(this,void 0,void 0,function(){var e,t;return W(this,function(n){switch(n.label){case 0:if(!(this.config?.loggingConfig?.network?.enabled&&!this.networkObservers))return[3,4];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,i(()=>Promise.resolve().then(()=>Ap),void 0)];case 2:return e=n.sent().NetworkObservers,this.networkObservers=new e,[3,4];case 3:return t=n.sent(),this.loggerProvider.warn(`Failed to import or instantiate NetworkObservers:`,t),[3,4];case 4:return[2]}})})},e}(),RS=function(e){return function(){var t=e.config||Ab();return{logger:t.loggerProvider,logLevel:t.logLevel}}},zS=function(){var e=new LS;
276return{init:If(e.init.bind(e),`init`,RS(e)),evaluateTargetingAndCapture:If(e.evaluateTargetingAndCapture.bind(e),`evaluateTargetingAndRecord`,RS(e)),setSessionId:If(e.setSessionId.bind(e),`setSessionId`,RS(e)),getSessionId:If(e.getSessionId.bind(e),`getSessionId`,RS(e)),getSessionReplayProperties:If(e.getSessionReplayProperties.bind(e),`getSessionReplayProperties`,RS(e)),flush:If(e.flush.bind(e),`flush`,RS(e)),shutdown:If(e.shutdown.bind(e),`shutdown`,RS(e))}}(),BS=zS.init,VS=zS.setSessionId,HS=zS.getSessionId,US=zS.getSessionReplayProperties,WS=zS.flush,GS=zS.shutdown,KS=zS.evaluateTargetingAndCapture,qS=function(e){return e===void 0&&(e=`$default_instance`),Yf.getInstance(e)},JS=[jv.SET,jv.SET_ONCE,jv.ADD,jv.APPEND,jv.PREPEND,jv.POSTINSERT],YS=function(e){if(e.user_properties){var t={};return Object.keys(e.user_properties).forEach(function(n){if(JS.includes(n)){var r=e.user_properties&&e.user_properties[n];t=jy(jy({},t),r)}}),t}},XS=`1.33.7`,ZS=`[Amplitude] Session Replay ID`,QS=function(){function e(t){this.name=e.pluginName,this.type=`enrichment`,this.config=null,this.sessionReplay={flush:WS,getSessionId:HS,getSessionReplayProperties:US,init:BS,setSessionId:VS,shutdown:GS,evaluateTargetingAndCapture:KS},this.options=jy({forceSessionTracking:!1},t),this.srInitOptions=this.options}return e.prototype.setup=function(e,t){return My(this,void 0,void 0,function(){var t,n,r;return Ny(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e?.loggerProvider.log(`Installing @amplitude/plugin-session-replay, version 1.33.7.`),this.config=e,this.options.forceSessionTracking&&(typeof e.defaultTracking==`boolean`?e.defaultTracking===!1&&(e.defaultTracking={pageViews:!1,formInteractions:!1,fileDownloads:!1,sessions:!0}):e.defaultTracking=jy(jy({},e.defaultTracking),{sessions:!0})),t=qS(this.config.instanceName).identityStore,n=t.getIdentity().userProperties,this.srInitOptions={instanceName:this.config.instanceName,deviceId:this.options.deviceId??this.config.deviceId,optOut:this.config.optOut,sessionId:this.options.customSessionId?void 0:this.config.sessionId,loggerProvider:this.config.loggerProvider,logLevel:this.config.logLevel,flushMaxRetries:this.config.flushMaxRetries,serverZone:this.config.serverZone,configServerUrl:this.options.configServerUrl||this.config.remoteConfig?.serverUrl,trackServerUrl:this.options.trackServerUrl,sampleRate:this.options.sampleRate,privacyConfig:{blockSelector:this.options.privacyConfig?.blockSelector,maskSelector:this.options.privacyConfig?.maskSelector,unmaskSelector:this.options.privacyConfig?.unmaskSelector,defaultMaskLevel:this.options.privacyConfig?.defaultMaskLevel},debugMode:this.options.debugMode,shouldInlineStylesheet:this.options.shouldInlineStylesheet,version:{type:`plugin`,version:XS},performanceConfig:this.options.performanceConfig,storeType:this.options.storeType,useWebWorker:this.options.useWebWorker??this.options.experimental?.useWebWorker,userProperties:n,applyBackgroundColorToBlockedElements:this.options.applyBackgroundColorToBlockedElements,interactionConfig:this.options.interactionConfig,captureDocumentTitle:this.options.captureDocumentTitle,enableUrlChangePolling:this.options.enableUrlChangePolling,urlChangePollingInterval:this.options.urlChangePollingInterval,captureAdoptedStyleSheets:this.options.captureAdoptedStyleSheets,crossOriginIframes:this.options.crossOriginIframes,flushIntervalConfig:this.options.flushIntervalConfig,eagerFullSnapshotSend:this.options.eagerFullSnapshotSend,captureFullSnapshotOnFocus:this.options.captureFullSnapshotOnFocus,maxPersistedEventsSizeBytes:this.options.maxPersistedEventsSizeBytes,maxSingleEventSizeBytes:this.options.maxSingleEventSizeBytes,sendTimeoutMs:this.options.sendTimeoutMs,handleSendEvents:this.options.handleSendEvents,handleFetchConfig:this.options.handleFetchConfig},[4,this.sessionReplay.init(e.apiKey,this.srInitOptions).promise];case 1:return i.sent(),[3,3];case 2:return r=i.sent(),e?.loggerProvider.error(`Session Replay: Failed to initialize due to ${r.message}`),[3,3];case 3:return[2]}})})},e.prototype.onSessionIdChanged=function(e){var t;return My(this,void 0,void 0,function(){return Ny(this,function(n){switch(n.label){case 0:return(t=this.config)==null||t.loggerProvider.debug(`Analytics session id is changed to ${e}, SR session id is ${String(this.sessionReplay.getSessionId())}.`),[4,this.sessionReplay.setSessionId(e).promise];case 1:return n.sent(),[2]}})})},e.prototype.onOptOutChanged=function(e){var t;return My(this,void 0,void 0,function(){var n;return Ny(this,function(r){switch(r.label){case 0:return(t=this.config)==null||t.loggerProvider.debug(`optOut is changed to ${String(e)}, calling ${e?`sessionReplay.shutdown()`:`sessionReplay.init()`}.`),e?(this.sessionReplay.shutdown(),[3,4]):[3,1];case 1:return n=this.config!=null,n?[4,this.sessionReplay.init(this.config.apiKey,this.srInitOptions).promise]:[3,3];case 2:n=r.sent(),r.label=3;case 3:r.label=4;case 4:return[2]}})})},e.prototype.execute=function(e){var t;return My(this,void 0,void 0,function(){var n,r,n,i,a,r,o;return Ny(this,function(s){switch(s.label){case 0:return s.trys.push([0,9,,10]),this.options.customSessionId?(n=this.options.customSessionId(e),n?n===this.sessionReplay.getSessionId()?[3,2]:[4,this.sessionReplay.setSessionId(n).promise]:[3,3]):[3,4];case 1:s.sent(),s.label=2;case 2:r=this.sessionReplay.getSessionReplayProperties(),e.event_properties=jy(jy({},e.event_properties),r),s.label=3;case 3:return[3,8];case 4:return n=this.config?.sessionId,n&&n!==this.sessionReplay.getSessionId()?[4,this.sessionReplay.setSessionId(n).promise]:[3,6];case 5:s.sent(),s.label=6;case 6:return n&&n===e.session_id?(i=void 0,e.event_type===Fy.IDENTIFY&&(i=YS(e)),a=Iy(),[4,this.sessionReplay.evaluateTargetingAndCapture({event:e,userProperties:i,page:a?.location?.href==null?void 0:{url:a.location.href}})]):[3,8];case 7:s.sent(),r=this.sessionReplay.getSessionReplayProperties(),e.event_properties=jy(jy({},e.event_properties),r),s.label=8;case 8:return e.event_type===Fy.IDENTIFY&&e.event_properties&&delete e.event_properties[ZS],[2,Promise.resolve(e)];case 9:return o=s.sent(),(t=this.config)==null||t.loggerProvider.error(`Session Replay: Failed to enrich event due to ${o.message}`),[2,Promise.resolve(e)];case 10:return[2]}})})},e.prototype.teardown=function(){var e;return My(this,void 0,void 0,function(){return Ny(this,function(t){try{this.sessionReplay.shutdown(),this.config=null}catch(t){(e=this.config)==null||e.loggerProvider.error(`Session Replay: teardown failed due to ${t.message}`)}return[2]})})},e.prototype.getSessionReplayProperties=function(){return this.sessionReplay.getSessionReplayProperties()},e.pluginName=`@amplitude/plugin-session-replay-browser`,e}(),$S=function(e){return new QS(e)};
276export{i,Ay as n,pg as r,$S as t};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.