@monoscopetech/browser 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- var Monoscope=function(){"use strict";var e,t=Object.defineProperty,n=(e,n,r)=>((e,n,r)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r)(e,"symbol"!=typeof n?n+"":n,r),r=Object.defineProperty,s=(e,t,n)=>((e,t,n)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),o=Object.defineProperty,i=(e,t,n)=>((e,t,n)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);const a={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},c={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},l={};function u(e){if(l[e])return l[e];const t=globalThis[e],n=t.prototype,r=e in a?a[e]:void 0,s=Boolean(r&&r.every(e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))})),o=e in c?c[e]:void 0,i=Boolean(o&&o.every(e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))}));if(s&&i&&!globalThis.Zone)return l[e]=t.prototype,t.prototype;try{const r=document.createElement("iframe");document.body.appendChild(r);const s=r.contentWindow;if(!s)return t.prototype;const o=s[e].prototype;return document.body.removeChild(r),o?l[e]=o:n}catch{return n}}const h={};function d(e,t,n){var r;const s=`${e}.${String(n)}`;if(h[s])return h[s].call(t);const o=u(e),i=null==(r=Object.getOwnPropertyDescriptor(o,n))?void 0:r.get;return i?(h[s]=i,i.call(t)):t[n]}const p={};function f(e,t,n){const r=`${e}.${String(n)}`;if(p[r])return p[r].bind(t);const s=u(e)[n];return"function"!=typeof s?t[n]:(p[r]=s,s.bind(t))}const g={childNodes:function(e){return d("Node",e,"childNodes")},parentNode:function(e){return d("Node",e,"parentNode")},parentElement:function(e){return d("Node",e,"parentElement")},textContent:function(e){return d("Node",e,"textContent")},contains:function(e,t){return f("Node",e,"contains")(t)},getRootNode:function(e){return f("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?d("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?d("Element",e,"shadowRoot"):null},querySelector:function(e,t){return d("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return d("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return u("MutationObserver").constructor}};let m=class{constructor(){i(this,"idNodeMap",new Map),i(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-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){const 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){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const 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 y(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&y(g.parentNode(e),t,n);for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!!n&&y(g.parentNode(e),t,n)}function v(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function b(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){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 w={exports:{}},C=String,S=function(){return{isColorSupported:!1,reset:C,bold:C,dim:C,italic:C,underline:C,inverse:C,hidden:C,strikethrough:C,black:C,red:C,green:C,yellow:C,blue:C,magenta:C,cyan:C,white:C,gray:C,bgBlack:C,bgRed:C,bgGreen:C,bgYellow:C,bgBlue:C,bgMagenta:C,bgCyan:C,bgWhite:C}};w.exports=S(),w.exports.createColors=S;var _=w.exports;const I=b(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let E=_,T=I,A=class e extends Error{constructor(t,n,r,s,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),void 0!==n&&void 0!==r&&("number"==typeof n?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=E.isColorSupported),T&&e&&(t=T(t));let n,r,s=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,s.length),a=String(i).length;if(e){let{bold:e,gray:t,red:s}=E.createColors(!0);n=t=>e(s(t)),r=e=>t(e)}else n=r=e=>e;return s.slice(o,i).map((e,t)=>{let s=o+1+t,i=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=r(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+r(i)+e+"\n "+t+n("^")}return" "+r(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var k=A;A.default=A;var O={};O.isClean=Symbol("isClean"),O.my=Symbol("my");const R={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let x=class{constructor(e){this.builder=e}atrule(e,t){let n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes)this.block(e,n+r);else{let s=(e.raws.between||"")+(t?";":"");this.builder(n+r+s,e)}}beforeAfter(e,t){let n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let r=e.parent,s=0;for(;r&&"root"!==r.type;)s+=1,r=r.parent;if(n.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;e++)n+=t}return n}block(e,t){let n,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let n=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let s=e.nodes[r],o=this.raw(s,"before");o&&this.builder(o),this.stringify(s,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(e,t,n){let r;if(n||(n=t),t&&(r=e.raws[t],void 0!==r))return r;let s=e.parent;if("before"===n){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return R[n];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);{let s="raw"+((i=n)[0].toUpperCase()+i.slice(1));this[s]?r=this[s](o,e):o.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var i;return void 0===r&&(r=R[n]),o.rawCache[n]=r,r}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let n;return e.walkComments(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(e,t){let n;return e.walkDecls(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return t=n.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))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&&void 0!==n.raws.before){let e=n.raws.before.split("\n");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&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))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 new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var N=x;x.default=x;let L=N;function M(e,t){new L(t).stringify(e)}var P=M;M.default=M;let{isClean:D,my:F}=O,B=k,U=N,j=P;function Z(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if("proxyCache"===r)continue;let s=e[r],o=typeof s;"parent"===r&&"object"===o?t&&(n[r]=t):"source"===r?n[r]=s:Array.isArray(s)?n[r]=s.map(e=>Z(e,n)):("object"===o&&null!==s&&(s=Z(s)),n[r]=s)}return n}let z=class{constructor(e={}){this.raws={},this[D]=!1,this[F]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let n of e[t])"function"==typeof n.clone?this.append(n.clone()):this.append(n)}else this[t]=e[t]}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=Z(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}error(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 B(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[D]){this[D]=!1;let e=this;for(;e=e.parent;)e[D]=!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){let r=(t=this.toString()).indexOf(e.word);-1!==r&&(n=this.positionInside(r,t))}return n}positionInside(e,t){let n=t||this.toString(),r=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===n[t]?(r=1,s+=1):r+=1;return{column:r,line:s}}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(),s=r.indexOf(e.word);-1!==s&&(t=this.positionInside(s,r),n=this.positionInside(s+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}:"number"==typeof e.endIndex?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 U).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&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let n={},r=null==t;t=t||new Map;let s=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let r=this[e];if(Array.isArray(r))n[e]=r.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof r&&r.toJSON)n[e]=r.toJSON(null,t);else if("source"===e){let o=t.get(r.input);null==o&&(o=s,t.set(r.input,s),s++),n[e]={end:r.end,inputId:o,start:r.start}}else n[e]=r}return r&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=j){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}};var V=z;z.default=z;let H=V,G=class extends H{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var W=G;G.default=G;var Y={nanoid:(e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:K,SourceMapGenerator:J}=I,{existsSync:X,readFileSync:$}=I,{dirname:q,join:Q}=I;let ee=class{constructor(e,t){if(!1===t.map)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=q(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new K(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!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=q(e),X(e))return this.mapFile=e,$(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof K)return J.fromSourceMap(t).toString();if(t instanceof J)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let n=t(e);if(n){let e=this.loadFile(n);if(!e)throw new Error("Unable to load previous source map: "+n.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=Q(q(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var te=ee;ee.default=ee;let{SourceMapConsumer:ne,SourceMapGenerator:re}=I,{fileURLToPath:se,pathToFileURL:oe}=I,{isAbsolute:ie,resolve:ae}=I,{nanoid:ce}=Y,le=I,ue=k,he=te,de=Symbol("fromOffsetCache"),pe=Boolean(ne&&re),fe=Boolean(ae&&ie),ge=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!fe||/^\w+:\/\//.test(t.from)||ie(t.from)?this.file=t.from:this.file=ae(t.from)),fe&&pe){let e=new he(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 "+ce(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,r={}){let s,o,i;if(t&&"object"==typeof t){let e=t,r=n;if("number"==typeof e.offset){let r=this.fromOffset(e.offset);t=r.line,n=r.col}else t=e.line,n=e.column;if("number"==typeof r.offset){let e=this.fromOffset(r.offset);o=e.line,i=e.col}else o=r.line,i=r.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let a=this.origin(t,n,o,i);return s=a?new ue(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,r.plugin):new ue(e,void 0===o?t:{column:n,line:t},void 0===o?n:{column:i,line:o},this.css,this.file,r.plugin),s.input={column:n,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(oe&&(s.input.url=oe(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,n;if(this[de])n=this[de];else{let e=this.css.split("\n");n=new Array(e.length);let t=0;for(let r=0,s=e.length;r<s;r++)n[r]=t,t+=e[r].length+1;this[de]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t,s=n.length-2;for(;r<s;)if(t=r+(s-r>>1),e<n[t])s=t-1;else{if(!(e>=n[t+1])){r=t;break}r=t+1}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:ae(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,r){if(!this.map)return!1;let s,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof n&&(s=i.originalPositionFor({column:r,line:n})),o=ie(a.source)?oe(a.source):new URL(a.source,this.map.consumer().sourceRoot||oe(this.map.mapFile));let c={column:a.column,endColumn:s&&s.column,endLine:s&&s.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!se)throw new Error("file: protocol is not available in this PostCSS build");c.file=se(o)}let l=i.sourceContentFor(a.source);return l&&(c.source=l),c}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(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}};var me=ge;ge.default=ge,le&&le.registerInput&&le.registerInput(ge);let{SourceMapConsumer:ye,SourceMapGenerator:ve}=I,{dirname:be,relative:we,resolve:Ce,sep:Se}=I,{pathToFileURL:_e}=I,Ie=me,Ee=Boolean(ye&&ve),Te=Boolean(be&&Ce&&we&&Se);var Ae=class{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()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,n=this.toUrl(this.path(e.file)),r=e.root||be(e.file);!1===this.mapOpts.sourcesContent?(t=new ye(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Te&&Ee&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=ve.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new ve({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 ve({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,n=1,r=1,s="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,c)=>{if(this.css+=i,a&&"end"!==c&&(o.generated.line=n,o.generated.column=r-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=i.match(/\n/g),e?(n+=e.length,t=i.lastIndexOf("\n"),r=i.length-t):r+=i.length,a&&"start"!==c){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=n,o.generated.column=r-2,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=r-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}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)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let n=this.opts.to?be(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=be(Ce(n,this.mapOpts.annotation)));let r=we(n,e);return this.memoizedPaths.set(e,r),r}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 Ie(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(_e){let t=_e(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===Se&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}};let ke=V,Oe=class extends ke{constructor(e){super(e),this.type="comment"}};var Re=Oe;Oe.default=Oe;let xe,Ne,Le,Me,{isClean:Pe,my:De}=O,Fe=W,Be=Re,Ue=V;function je(e){return e.map(e=>(e.nodes&&(e.nodes=je(e.nodes)),delete e.source,e))}function Ze(e){if(e[Pe]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Ze(t)}let ze=class e extends Ue{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,n,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],n=e(this.proxyOf.nodes[t],t),!1!==n);)this.indexes[r]+=1;return delete this.indexes[r],n}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...n)=>e[t](...n.map(e=>"function"==typeof e?(t,n)=>e(t.toProxy(),n):e)):"every"===t||"some"===t?n=>e[t]((e,...t)=>n(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n,r=this.index(e),s=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let e of s)this.proxyOf.nodes.splice(r+1,0,e);for(let e in this.indexes)n=this.indexes[e],r<n&&(this.indexes[e]=n+s.length);return this.markDirty(),this}insertBefore(e,t){let n,r=this.index(e),s=0===r&&"prepend",o=this.normalize(t,this.proxyOf.nodes[r],s).reverse();r=this.index(e);for(let e of o)this.proxyOf.nodes.splice(r,0,e);for(let e in this.indexes)n=this.indexes[e],r<=n&&(this.indexes[e]=n+o.length);return this.markDirty(),this}normalize(t,n){if("string"==typeof t)t=je(xe(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new Fe(t)]}else if(t.selector)t=[new Ne(t)];else if(t.name)t=[new Le(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Be(t)]}return t.map(t=>(t[De]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Pe]&&Ze(t),void 0===t.raws.before&&n&&void 0!==n.raws.before&&(t.raws.before=n.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}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){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(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!1!==r&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("atrule"===n.type&&e.test(n.name))return t(n,r)}):this.walk((n,r)=>{if("atrule"===n.type&&n.name===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("atrule"===e.type)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if("comment"===t.type)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("decl"===n.type&&e.test(n.prop))return t(n,r)}):this.walk((n,r)=>{if("decl"===n.type&&n.prop===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("decl"===e.type)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("rule"===n.type&&e.test(n.selector))return t(n,r)}):this.walk((n,r)=>{if("rule"===n.type&&n.selector===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("rule"===e.type)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]}};ze.registerParse=e=>{xe=e},ze.registerRule=e=>{Ne=e},ze.registerAtRule=e=>{Le=e},ze.registerRoot=e=>{Me=e};var Ve=ze;ze.default=ze,ze.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Le.prototype):"rule"===e.type?Object.setPrototypeOf(e,Ne.prototype):"decl"===e.type?Object.setPrototypeOf(e,Fe.prototype):"comment"===e.type?Object.setPrototypeOf(e,Be.prototype):"root"===e.type&&Object.setPrototypeOf(e,Me.prototype),e[De]=!0,e.nodes&&e.nodes.forEach(e=>{ze.rebuild(e)})};let He,Ge,We=Ve,Ye=class extends We{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new He(new Ge,this,e).stringify()}};Ye.registerLazyResult=e=>{He=e},Ye.registerProcessor=e=>{Ge=e};var Ke=Ye;Ye.default=Ye;let Je={};var Xe=function(e){Je[e]||(Je[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let $e=class{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}};var qe=$e;$e.default=$e;let Qe=qe,et=class{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(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let n=new Qe(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var tt=et;et.default=et;const nt="'".charCodeAt(0),rt='"'.charCodeAt(0),st="\\".charCodeAt(0),ot="/".charCodeAt(0),it="\n".charCodeAt(0),at=" ".charCodeAt(0),ct="\f".charCodeAt(0),lt="\t".charCodeAt(0),ut="\r".charCodeAt(0),ht="[".charCodeAt(0),dt="]".charCodeAt(0),pt="(".charCodeAt(0),ft=")".charCodeAt(0),gt="{".charCodeAt(0),mt="}".charCodeAt(0),yt=";".charCodeAt(0),vt="*".charCodeAt(0),bt=":".charCodeAt(0),wt="@".charCodeAt(0),Ct=/[\t\n\f\r "#'()/;[\\\]{}]/g,St=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,_t=/.[\r\n"'(/\\]/,It=/[\da-f]/i;let Et=Ve,Tt=class extends Et{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)}};var At=Tt;Tt.default=Tt,Et.registerAtRule(Tt);let kt,Ot,Rt=Ve,xt=class extends Rt{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,n){let r=super.normalize(e);if(t)if("prepend"===n)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&&0===n&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new kt(new Ot,this,e).stringify()}};xt.registerLazyResult=e=>{kt=e},xt.registerProcessor=e=>{Ot=e};var Nt=xt;xt.default=xt,Rt.registerRoot(xt);let Lt={comma:e=>Lt.split(e,[","],!0),space:e=>Lt.split(e,[" ","\n","\t"]),split(e,t,n){let r=[],s="",o=!1,i=0,a=!1,c="",l=!1;for(let n of e)l?l=!1:"\\"===n?l=!0:a?n===c&&(a=!1):'"'===n||"'"===n?(a=!0,c=n):"("===n?i+=1:")"===n?i>0&&(i-=1):0===i&&t.includes(n)&&(o=!0),o?(""!==s&&r.push(s.trim()),s="",o=!1):s+=n;return(n||""!==s)&&r.push(s.trim()),r}};var Mt=Lt;Lt.default=Lt;let Pt=Ve,Dt=Mt,Ft=class extends Pt{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Dt.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)}};var Bt=Ft;Ft.default=Ft,Pt.registerRule(Ft);let Ut=W,jt=function(e,t={}){let n,r,s,o,i,a,c,l,u,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,g=0,m=[],y=[];function v(t){throw e.error("Unclosed "+t,g)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&g>=f},nextToken:function(e){if(y.length)return y.pop();if(g>=f)return;let t=!!e&&e.ignoreUnclosed;switch(n=d.charCodeAt(g),n){case it:case at:case lt:case ut:case ct:r=g;do{r+=1,n=d.charCodeAt(r)}while(n===at||n===it||n===lt||n===ut||n===ct);h=["space",d.slice(g,r)],g=r-1;break;case ht:case dt:case gt:case mt:case bt:case yt:case ft:{let e=String.fromCharCode(n);h=[e,e,g];break}case pt:if(l=m.length?m.pop()[1]:"",u=d.charCodeAt(g+1),"url"===l&&u!==nt&&u!==rt&&u!==at&&u!==it&&u!==lt&&u!==ct&&u!==ut){r=g;do{if(a=!1,r=d.indexOf(")",r+1),-1===r){if(p||t){r=g;break}v("bracket")}for(c=r;d.charCodeAt(c-1)===st;)c-=1,a=!a}while(a);h=["brackets",d.slice(g,r+1),g,r],g=r}else r=d.indexOf(")",g+1),o=d.slice(g,r+1),-1===r||_t.test(o)?h=["(","(",g]:(h=["brackets",o,g,r],g=r);break;case nt:case rt:s=n===nt?"'":'"',r=g;do{if(a=!1,r=d.indexOf(s,r+1),-1===r){if(p||t){r=g+1;break}v("string")}for(c=r;d.charCodeAt(c-1)===st;)c-=1,a=!a}while(a);h=["string",d.slice(g,r+1),g,r],g=r;break;case wt:Ct.lastIndex=g+1,Ct.test(d),r=0===Ct.lastIndex?d.length-1:Ct.lastIndex-2,h=["at-word",d.slice(g,r+1),g,r],g=r;break;case st:for(r=g,i=!0;d.charCodeAt(r+1)===st;)r+=1,i=!i;if(n=d.charCodeAt(r+1),i&&n!==ot&&n!==at&&n!==it&&n!==lt&&n!==ut&&n!==ct&&(r+=1,It.test(d.charAt(r)))){for(;It.test(d.charAt(r+1));)r+=1;d.charCodeAt(r+1)===at&&(r+=1)}h=["word",d.slice(g,r+1),g,r],g=r;break;default:n===ot&&d.charCodeAt(g+1)===vt?(r=d.indexOf("*/",g+2)+1,0===r&&(p||t?r=d.length:v("comment")),h=["comment",d.slice(g,r+1),g,r],g=r):(St.lastIndex=g+1,St.test(d),r=0===St.lastIndex?d.length-1:St.lastIndex-2,h=["word",d.slice(g,r+1),g,r],m.push(h),g=r)}return g++,h},position:function(){return g}}},Zt=Re,zt=At,Vt=Nt,Ht=Bt;const Gt={empty:!0,space:!0};var Wt=class{constructor(e){this.input=e,this.root=new Vt,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,n,r,s=new zt;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,e[2]);let o=!1,i=!1,a=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(r=a.length-1,n=a[r];n&&"space"===n[0];)n=a[--r];n&&(s.source.end=this.getPosition(n[3]||n[2]),s.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),o&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),i&&(s.nodes=[],this.current=s)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let n,r=0;for(let s=t-1;s>=0&&(n=e[s],"space"===n[0]||(r+=1,2!==r));s--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}colon(e){let t,n,r,s=0;for(let[o,i]of e.entries()){if(t=i,n=t[0],"("===n&&(s+=1),")"===n&&(s-=1),0===s&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return o}this.doubleColon(t)}r=t}return!1}comment(e){let t=new Zt;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=jt(this.input)}decl(e,t){let n=new Ut;this.init(n,e[0][2]);let r,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(s[3]||s[2]||function(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(r=e[t],"!important"===r[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(n.raws.important=r);break}if("important"===r[1].toLowerCase()){let r=e.slice(0),s="";for(let e=t;e>0;e--){let t=r[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=r.pop()[1]+s}0===s.trim().indexOf("!")&&(n.important=!0,n.raws.important=s,e=r)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(n,"value",i.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Ht;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&&"rule"===e.type&&!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="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,n=null,r=!1,s=null,o=[],i=e[1].startsWith("--"),a=[],c=e;for(;c;){if(n=c[0],a.push(c),"("===n||"["===n)s||(s=c),o.push("("===n?")":"]");else if(i&&r&&"{"===n)s||(s=c),o.push("}");else if(0===o.length){if(";"===n){if(r)return void this.decl(a,i);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(r=!0)}else n===o[o.length-1]&&(o.pop(),0===o.length&&(s=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(s),t&&r){if(!i)for(;a.length&&(c=a[a.length-1][0],"space"===c||"comment"===c);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}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)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,r){let s,o,i,a,c=n.length,l="",u=!0;for(let e=0;e<c;e+=1)s=n[e],o=s[0],"space"!==o||e!==c-1||r?"comment"===o?(a=n[e-1]?n[e-1][0]:"empty",i=n[e+1]?n[e+1][0]:"empty",Gt[a]||Gt[i]||","===l.slice(-1)?u=!1:l+=s[1]):l+=s[1]:u=!1;if(!u){let r=n.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:r,value:l}}e[t]=l}rule(e){e.pop();let t=new Ht;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],"space"===t||"comment"===t);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)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})}};let Yt=Ve,Kt=Wt,Jt=me;function Xt(e,t){let n=new Jt(e,t),r=new Kt(n);try{r.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return r.root}var $t=Xt;Xt.default=Xt,Yt.registerParse(Xt);let{isClean:qt,my:Qt}=O,en=Ae,tn=P,nn=Ve,rn=Ke,sn=Xe,on=tt,an=$t,cn=Nt;const ln={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},un={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},hn={Once:!0,postcssPlugin:!0,prepare:!0};function dn(e){return"object"==typeof e&&"function"==typeof e.then}function pn(e){let t=!1,n=ln[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(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 fn(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:pn(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function gn(e){return e[qt]=!1,e.nodes&&e.nodes.forEach(e=>gn(e)),e}let mn={},yn=class e{constructor(t,n,r){let s;if(this.stringified=!1,this.processed=!1,"object"!=typeof n||null===n||"root"!==n.type&&"document"!==n.type)if(n instanceof e||n instanceof on)s=gn(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let e=an;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{s=e(n,r)}catch(e){this.processed=!0,this.error=e}s&&!s[Qt]&&nn.rebuild(s)}else s=gn(n);this.result=new on(t,s,r),this.helpers={...mn,postcss:mn,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&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.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let n=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(n.postcssVersion&&"production"!==process.env.NODE_ENV){let e=n.postcssPlugin,t=n.postcssVersion,r=this.result.processor.version,s=t.split("."),o=r.split(".");(s[0]!==o[0]||parseInt(s[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+r+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=n.postcssPlugin,e.setMessage()}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("object"==typeof t)for(let n in t){if(!un[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!hn[n])if("object"==typeof t[n])for(let r in t[n])e(t,"*"===r?n:n+"-"+r.toLowerCase(),t[n][r]);else"function"==typeof t[n]&&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(dn(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[qt];){e[qt]=!0;let t=[fn(e)];for(;t.length>0;){let e=this.visitTick(t);if(dn(e))try{await e}catch(e){let n=t[t.length-1].node;throw this.handleError(e,n)}}}if(this.listeners.OnceExit)for(let[t,n]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>n(e,this.helpers));await Promise.all(t)}else await n(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return dn(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)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=tn;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new en(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[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(dn(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[qt];)e[qt]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||sn("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,r]of e){let e;this.result.lastPlugin=n;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(dn(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:n,visitors:r}=t;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void e.pop();if(r.length>0&&t.visitorIndex<r.length){let[e,s]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){let r,s=t.iterator;for(;r=n.nodes[n.indexes[s]];)if(n.indexes[s]+=1,!r[qt])return r[qt]=!0,void e.push(fn(r));t.iterator=0,delete n.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(n.nodes&&n.nodes.length&&(n[qt]=!0,t.iterator=n.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[qt]=!0;let t=pn(e);for(let n of t)if(0===n)e.nodes&&e.each(e=>{e[qt]||this.walkSync(e)});else{let t=this.listeners[n];if(t&&this.visitSync(t,e.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"}};yn.registerPostcss=e=>{mn=e};var vn=yn;yn.default=yn,cn.registerLazyResult(yn),rn.registerLazyResult(yn);let bn=Ae,wn=P,Cn=Xe,Sn=$t;const _n=tt;let In=class{constructor(e,t,n){let r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let s=wn;this.result=new _n(this._processor,r,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new bn(s,r,this._opts,t);if(i.isMap()){let[e,t]=i.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else i.clearAnnotation(),this.result.css=i.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"production"!==process.env.NODE_ENV&&("from"in this._opts||Cn("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),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=Sn;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"}};var En=In;In.default=In;let Tn=En,An=vn,kn=Ke,On=Nt,Rn=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(!0===n.postcss?n=n():n.postcss&&(n=n.postcss),"object"==typeof n&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if("object"==typeof n&&n.postcssPlugin)t.push(n);else if("function"==typeof n)t.push(n);else{if("object"!=typeof n||!n.parse&&!n.stringify)throw new Error(n+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new An(this,e,t):new Tn(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var xn=Rn;Rn.default=Rn,On.registerProcessor(Rn),kn.registerProcessor(Rn);let Nn=W,Ln=te,Mn=Re,Pn=At,Dn=me,Fn=Nt,Bn=Bt;function Un(e,t){if(Array.isArray(e))return e.map(e=>Un(e));let{inputs:n,...r}=e;if(n){t=[];for(let e of n){let n={...e,__proto__:Dn.prototype};n.map&&(n.map={...n.map,__proto__:Ln.prototype}),t.push(n)}}if(r.nodes&&(r.nodes=e.nodes.map(e=>Un(e,t))),r.source){let{inputId:e,...n}=r.source;r.source=n,null!=e&&(r.source.input=t[e])}if("root"===r.type)return new Fn(r);if("decl"===r.type)return new Nn(r);if("rule"===r.type)return new Bn(r);if("comment"===r.type)return new Mn(r);if("atrule"===r.type)return new Pn(r);throw new Error("Unknown node type: "+e.type)}var jn=Un;Un.default=Un;let Zn=k,zn=W,Vn=vn,Hn=Ve,Gn=xn,Wn=P,Yn=jn,Kn=Ke,Jn=qe,Xn=Re,$n=At,qn=tt,Qn=me,er=$t,tr=Mt,nr=Bt,rr=Nt,sr=V;function or(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Gn(e)}or.plugin=function(e,t){let n,r=!1;function s(...n){console&&console.warn&&!r&&(r=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let s=t(...n);return s.postcssPlugin=e,s.postcssVersion=(new Gn).version,s}return Object.defineProperty(s,"postcss",{get:()=>(n||(n=s()),n)}),s.process=function(e,t,n){return or([s(n)]).process(e,t)},s},or.stringify=Wn,or.parse=er,or.fromJSON=Yn,or.list=tr,or.comment=e=>new Xn(e),or.atRule=e=>new $n(e),or.decl=e=>new zn(e),or.rule=e=>new nr(e),or.root=e=>new rr(e),or.document=e=>new Kn(e),or.CssSyntaxError=Zn,or.Declaration=zn,or.Container=Hn,or.Processor=Gn,or.Document=Kn,or.Comment=Xn,or.Warning=Jn,or.AtRule=$n,or.Result=qn,or.Input=Qn,or.Rule=nr,or.Root=rr,or.Node=sr,Vn.registerPostcss(or);var ir=or;or.default=or;const ar=v(ir);ar.stringify,ar.fromJSON,ar.plugin,ar.parse,ar.list,ar.document,ar.comment,ar.atRule,ar.rule,ar.decl,ar.root,ar.CssSyntaxError,ar.Declaration,ar.Container,ar.Processor,ar.Document,ar.Comment,ar.Warning,ar.AtRule,ar.Result,ar.Input,ar.Rule,ar.Root,ar.Node;var cr=Object.defineProperty,lr=(e,t,n)=>((e,t,n)=>t in e?cr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);function ur(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function hr(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){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 dr={exports:{}},pr=String,fr=function(){return{isColorSupported:!1,reset:pr,bold:pr,dim:pr,italic:pr,underline:pr,inverse:pr,hidden:pr,strikethrough:pr,black:pr,red:pr,green:pr,yellow:pr,blue:pr,magenta:pr,cyan:pr,white:pr,gray:pr,bgBlack:pr,bgRed:pr,bgGreen:pr,bgYellow:pr,bgBlue:pr,bgMagenta:pr,bgCyan:pr,bgWhite:pr}};dr.exports=fr(),dr.exports.createColors=fr;var gr=dr.exports;const mr=hr(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let yr=gr,vr=mr,br=class e extends Error{constructor(t,n,r,s,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),void 0!==n&&void 0!==r&&("number"==typeof n?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=yr.isColorSupported),vr&&e&&(t=vr(t));let n,r,s=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,s.length),a=String(i).length;if(e){let{bold:e,gray:t,red:s}=yr.createColors(!0);n=t=>e(s(t)),r=e=>t(e)}else n=r=e=>e;return s.slice(o,i).map((e,t)=>{let s=o+1+t,i=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=r(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+r(i)+e+"\n "+t+n("^")}return" "+r(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var wr=br;br.default=br;var Cr={};Cr.isClean=Symbol("isClean"),Cr.my=Symbol("my");const Sr={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let _r=class{constructor(e){this.builder=e}atrule(e,t){let n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes)this.block(e,n+r);else{let s=(e.raws.between||"")+(t?";":"");this.builder(n+r+s,e)}}beforeAfter(e,t){let n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let r=e.parent,s=0;for(;r&&"root"!==r.type;)s+=1,r=r.parent;if(n.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;e++)n+=t}return n}block(e,t){let n,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let n=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let s=e.nodes[r],o=this.raw(s,"before");o&&this.builder(o),this.stringify(s,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(e,t,n){let r;if(n||(n=t),t&&(r=e.raws[t],void 0!==r))return r;let s=e.parent;if("before"===n){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return Sr[n];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);{let s="raw"+((i=n)[0].toUpperCase()+i.slice(1));this[s]?r=this[s](o,e):o.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var i;return void 0===r&&(r=Sr[n]),o.rawCache[n]=r,r}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let n;return e.walkComments(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(e,t){let n;return e.walkDecls(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return t=n.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))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&&void 0!==n.raws.before){let e=n.raws.before.split("\n");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&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))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 new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var Ir=_r;_r.default=_r;let Er=Ir;function Tr(e,t){new Er(t).stringify(e)}var Ar=Tr;Tr.default=Tr;let{isClean:kr,my:Or}=Cr,Rr=wr,xr=Ir,Nr=Ar;function Lr(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if("proxyCache"===r)continue;let s=e[r],o=typeof s;"parent"===r&&"object"===o?t&&(n[r]=t):"source"===r?n[r]=s:Array.isArray(s)?n[r]=s.map(e=>Lr(e,n)):("object"===o&&null!==s&&(s=Lr(s)),n[r]=s)}return n}let Mr=class{constructor(e={}){this.raws={},this[kr]=!1,this[Or]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let n of e[t])"function"==typeof n.clone?this.append(n.clone()):this.append(n)}else this[t]=e[t]}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=Lr(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}error(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 Rr(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[kr]){this[kr]=!1;let e=this;for(;e=e.parent;)e[kr]=!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){let r=(t=this.toString()).indexOf(e.word);-1!==r&&(n=this.positionInside(r,t))}return n}positionInside(e,t){let n=t||this.toString(),r=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===n[t]?(r=1,s+=1):r+=1;return{column:r,line:s}}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(),s=r.indexOf(e.word);-1!==s&&(t=this.positionInside(s,r),n=this.positionInside(s+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}:"number"==typeof e.endIndex?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 xr).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&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let n={},r=null==t;t=t||new Map;let s=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let r=this[e];if(Array.isArray(r))n[e]=r.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof r&&r.toJSON)n[e]=r.toJSON(null,t);else if("source"===e){let o=t.get(r.input);null==o&&(o=s,t.set(r.input,s),s++),n[e]={end:r.end,inputId:o,start:r.start}}else n[e]=r}return r&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Nr){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}};var Pr=Mr;Mr.default=Mr;let Dr=Pr,Fr=class extends Dr{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var Br=Fr;Fr.default=Fr;var Ur={nanoid:(e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:jr,SourceMapGenerator:Zr}=mr,{existsSync:zr,readFileSync:Vr}=mr,{dirname:Hr,join:Gr}=mr;let Wr=class{constructor(e,t){if(!1===t.map)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=Hr(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new jr(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!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=Hr(e),zr(e))return this.mapFile=e,Vr(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof jr)return Zr.fromSourceMap(t).toString();if(t instanceof Zr)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let n=t(e);if(n){let e=this.loadFile(n);if(!e)throw new Error("Unable to load previous source map: "+n.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=Gr(Hr(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Yr=Wr;Wr.default=Wr;let{SourceMapConsumer:Kr,SourceMapGenerator:Jr}=mr,{fileURLToPath:Xr,pathToFileURL:$r}=mr,{isAbsolute:qr,resolve:Qr}=mr,{nanoid:es}=Ur,ts=mr,ns=wr,rs=Yr,ss=Symbol("fromOffsetCache"),os=Boolean(Kr&&Jr),is=Boolean(Qr&&qr),as=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!is||/^\w+:\/\//.test(t.from)||qr(t.from)?this.file=t.from:this.file=Qr(t.from)),is&&os){let e=new rs(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 "+es(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,r={}){let s,o,i;if(t&&"object"==typeof t){let e=t,r=n;if("number"==typeof e.offset){let r=this.fromOffset(e.offset);t=r.line,n=r.col}else t=e.line,n=e.column;if("number"==typeof r.offset){let e=this.fromOffset(r.offset);o=e.line,i=e.col}else o=r.line,i=r.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let a=this.origin(t,n,o,i);return s=a?new ns(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,r.plugin):new ns(e,void 0===o?t:{column:n,line:t},void 0===o?n:{column:i,line:o},this.css,this.file,r.plugin),s.input={column:n,endColumn:i,endLine:o,line:t,source:this.css},this.file&&($r&&(s.input.url=$r(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,n;if(this[ss])n=this[ss];else{let e=this.css.split("\n");n=new Array(e.length);let t=0;for(let r=0,s=e.length;r<s;r++)n[r]=t,t+=e[r].length+1;this[ss]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t,s=n.length-2;for(;r<s;)if(t=r+(s-r>>1),e<n[t])s=t-1;else{if(!(e>=n[t+1])){r=t;break}r=t+1}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Qr(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,r){if(!this.map)return!1;let s,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof n&&(s=i.originalPositionFor({column:r,line:n})),o=qr(a.source)?$r(a.source):new URL(a.source,this.map.consumer().sourceRoot||$r(this.map.mapFile));let c={column:a.column,endColumn:s&&s.column,endLine:s&&s.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!Xr)throw new Error("file: protocol is not available in this PostCSS build");c.file=Xr(o)}let l=i.sourceContentFor(a.source);return l&&(c.source=l),c}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(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}};var cs=as;as.default=as,ts&&ts.registerInput&&ts.registerInput(as);let{SourceMapConsumer:ls,SourceMapGenerator:us}=mr,{dirname:hs,relative:ds,resolve:ps,sep:fs}=mr,{pathToFileURL:gs}=mr,ms=cs,ys=Boolean(ls&&us),vs=Boolean(hs&&ps&&ds&&fs);var bs=class{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()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,n=this.toUrl(this.path(e.file)),r=e.root||hs(e.file);!1===this.mapOpts.sourcesContent?(t=new ls(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),vs&&ys&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=us.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new us({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 us({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,n=1,r=1,s="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,c)=>{if(this.css+=i,a&&"end"!==c&&(o.generated.line=n,o.generated.column=r-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=i.match(/\n/g),e?(n+=e.length,t=i.lastIndexOf("\n"),r=i.length-t):r+=i.length,a&&"start"!==c){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=n,o.generated.column=r-2,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=r-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}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)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let n=this.opts.to?hs(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=hs(ps(n,this.mapOpts.annotation)));let r=ds(n,e);return this.memoizedPaths.set(e,r),r}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 ms(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(gs){let t=gs(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===fs&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}};let ws=Pr,Cs=class extends ws{constructor(e){super(e),this.type="comment"}};var Ss=Cs;Cs.default=Cs;let _s,Is,Es,Ts,{isClean:As,my:ks}=Cr,Os=Br,Rs=Ss,xs=Pr;function Ns(e){return e.map(e=>(e.nodes&&(e.nodes=Ns(e.nodes)),delete e.source,e))}function Ls(e){if(e[As]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Ls(t)}let Ms=class e extends xs{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,n,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],n=e(this.proxyOf.nodes[t],t),!1!==n);)this.indexes[r]+=1;return delete this.indexes[r],n}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...n)=>e[t](...n.map(e=>"function"==typeof e?(t,n)=>e(t.toProxy(),n):e)):"every"===t||"some"===t?n=>e[t]((e,...t)=>n(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n,r=this.index(e),s=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let e of s)this.proxyOf.nodes.splice(r+1,0,e);for(let e in this.indexes)n=this.indexes[e],r<n&&(this.indexes[e]=n+s.length);return this.markDirty(),this}insertBefore(e,t){let n,r=this.index(e),s=0===r&&"prepend",o=this.normalize(t,this.proxyOf.nodes[r],s).reverse();r=this.index(e);for(let e of o)this.proxyOf.nodes.splice(r,0,e);for(let e in this.indexes)n=this.indexes[e],r<=n&&(this.indexes[e]=n+o.length);return this.markDirty(),this}normalize(t,n){if("string"==typeof t)t=Ns(_s(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new Os(t)]}else if(t.selector)t=[new Is(t)];else if(t.name)t=[new Es(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Rs(t)]}return t.map(t=>(t[ks]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[As]&&Ls(t),void 0===t.raws.before&&n&&void 0!==n.raws.before&&(t.raws.before=n.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}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){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(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!1!==r&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("atrule"===n.type&&e.test(n.name))return t(n,r)}):this.walk((n,r)=>{if("atrule"===n.type&&n.name===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("atrule"===e.type)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if("comment"===t.type)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("decl"===n.type&&e.test(n.prop))return t(n,r)}):this.walk((n,r)=>{if("decl"===n.type&&n.prop===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("decl"===e.type)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("rule"===n.type&&e.test(n.selector))return t(n,r)}):this.walk((n,r)=>{if("rule"===n.type&&n.selector===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("rule"===e.type)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]}};Ms.registerParse=e=>{_s=e},Ms.registerRule=e=>{Is=e},Ms.registerAtRule=e=>{Es=e},Ms.registerRoot=e=>{Ts=e};var Ps=Ms;Ms.default=Ms,Ms.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Es.prototype):"rule"===e.type?Object.setPrototypeOf(e,Is.prototype):"decl"===e.type?Object.setPrototypeOf(e,Os.prototype):"comment"===e.type?Object.setPrototypeOf(e,Rs.prototype):"root"===e.type&&Object.setPrototypeOf(e,Ts.prototype),e[ks]=!0,e.nodes&&e.nodes.forEach(e=>{Ms.rebuild(e)})};let Ds,Fs,Bs=Ps,Us=class extends Bs{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Ds(new Fs,this,e).stringify()}};Us.registerLazyResult=e=>{Ds=e},Us.registerProcessor=e=>{Fs=e};var js=Us;Us.default=Us;let Zs={};var zs=function(e){Zs[e]||(Zs[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Vs=class{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}};var Hs=Vs;Vs.default=Vs;let Gs=Hs,Ws=class{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(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let n=new Gs(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Ys=Ws;Ws.default=Ws;const Ks="'".charCodeAt(0),Js='"'.charCodeAt(0),Xs="\\".charCodeAt(0),$s="/".charCodeAt(0),qs="\n".charCodeAt(0),Qs=" ".charCodeAt(0),eo="\f".charCodeAt(0),to="\t".charCodeAt(0),no="\r".charCodeAt(0),ro="[".charCodeAt(0),so="]".charCodeAt(0),oo="(".charCodeAt(0),io=")".charCodeAt(0),ao="{".charCodeAt(0),co="}".charCodeAt(0),lo=";".charCodeAt(0),uo="*".charCodeAt(0),ho=":".charCodeAt(0),po="@".charCodeAt(0),fo=/[\t\n\f\r "#'()/;[\\\]{}]/g,go=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,mo=/.[\r\n"'(/\\]/,yo=/[\da-f]/i;let vo=Ps,bo=class extends vo{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)}};var wo=bo;bo.default=bo,vo.registerAtRule(bo);let Co,So,_o=Ps,Io=class extends _o{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,n){let r=super.normalize(e);if(t)if("prepend"===n)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&&0===n&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new Co(new So,this,e).stringify()}};Io.registerLazyResult=e=>{Co=e},Io.registerProcessor=e=>{So=e};var Eo=Io;Io.default=Io,_o.registerRoot(Io);let To={comma:e=>To.split(e,[","],!0),space:e=>To.split(e,[" ","\n","\t"]),split(e,t,n){let r=[],s="",o=!1,i=0,a=!1,c="",l=!1;for(let n of e)l?l=!1:"\\"===n?l=!0:a?n===c&&(a=!1):'"'===n||"'"===n?(a=!0,c=n):"("===n?i+=1:")"===n?i>0&&(i-=1):0===i&&t.includes(n)&&(o=!0),o?(""!==s&&r.push(s.trim()),s="",o=!1):s+=n;return(n||""!==s)&&r.push(s.trim()),r}};var Ao=To;To.default=To;let ko=Ps,Oo=Ao,Ro=class extends ko{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Oo.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)}};var xo=Ro;Ro.default=Ro,ko.registerRule(Ro);let No=Br,Lo=function(e,t={}){let n,r,s,o,i,a,c,l,u,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,g=0,m=[],y=[];function v(t){throw e.error("Unclosed "+t,g)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&g>=f},nextToken:function(e){if(y.length)return y.pop();if(g>=f)return;let t=!!e&&e.ignoreUnclosed;switch(n=d.charCodeAt(g),n){case qs:case Qs:case to:case no:case eo:r=g;do{r+=1,n=d.charCodeAt(r)}while(n===Qs||n===qs||n===to||n===no||n===eo);h=["space",d.slice(g,r)],g=r-1;break;case ro:case so:case ao:case co:case ho:case lo:case io:{let e=String.fromCharCode(n);h=[e,e,g];break}case oo:if(l=m.length?m.pop()[1]:"",u=d.charCodeAt(g+1),"url"===l&&u!==Ks&&u!==Js&&u!==Qs&&u!==qs&&u!==to&&u!==eo&&u!==no){r=g;do{if(a=!1,r=d.indexOf(")",r+1),-1===r){if(p||t){r=g;break}v("bracket")}for(c=r;d.charCodeAt(c-1)===Xs;)c-=1,a=!a}while(a);h=["brackets",d.slice(g,r+1),g,r],g=r}else r=d.indexOf(")",g+1),o=d.slice(g,r+1),-1===r||mo.test(o)?h=["(","(",g]:(h=["brackets",o,g,r],g=r);break;case Ks:case Js:s=n===Ks?"'":'"',r=g;do{if(a=!1,r=d.indexOf(s,r+1),-1===r){if(p||t){r=g+1;break}v("string")}for(c=r;d.charCodeAt(c-1)===Xs;)c-=1,a=!a}while(a);h=["string",d.slice(g,r+1),g,r],g=r;break;case po:fo.lastIndex=g+1,fo.test(d),r=0===fo.lastIndex?d.length-1:fo.lastIndex-2,h=["at-word",d.slice(g,r+1),g,r],g=r;break;case Xs:for(r=g,i=!0;d.charCodeAt(r+1)===Xs;)r+=1,i=!i;if(n=d.charCodeAt(r+1),i&&n!==$s&&n!==Qs&&n!==qs&&n!==to&&n!==no&&n!==eo&&(r+=1,yo.test(d.charAt(r)))){for(;yo.test(d.charAt(r+1));)r+=1;d.charCodeAt(r+1)===Qs&&(r+=1)}h=["word",d.slice(g,r+1),g,r],g=r;break;default:n===$s&&d.charCodeAt(g+1)===uo?(r=d.indexOf("*/",g+2)+1,0===r&&(p||t?r=d.length:v("comment")),h=["comment",d.slice(g,r+1),g,r],g=r):(go.lastIndex=g+1,go.test(d),r=0===go.lastIndex?d.length-1:go.lastIndex-2,h=["word",d.slice(g,r+1),g,r],m.push(h),g=r)}return g++,h},position:function(){return g}}},Mo=Ss,Po=wo,Do=Eo,Fo=xo;const Bo={empty:!0,space:!0};var Uo=class{constructor(e){this.input=e,this.root=new Do,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,n,r,s=new Po;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,e[2]);let o=!1,i=!1,a=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(r=a.length-1,n=a[r];n&&"space"===n[0];)n=a[--r];n&&(s.source.end=this.getPosition(n[3]||n[2]),s.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),o&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),i&&(s.nodes=[],this.current=s)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let n,r=0;for(let s=t-1;s>=0&&(n=e[s],"space"===n[0]||(r+=1,2!==r));s--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}colon(e){let t,n,r,s=0;for(let[o,i]of e.entries()){if(t=i,n=t[0],"("===n&&(s+=1),")"===n&&(s-=1),0===s&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return o}this.doubleColon(t)}r=t}return!1}comment(e){let t=new Mo;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=Lo(this.input)}decl(e,t){let n=new No;this.init(n,e[0][2]);let r,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(s[3]||s[2]||function(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(r=e[t],"!important"===r[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(n.raws.important=r);break}if("important"===r[1].toLowerCase()){let r=e.slice(0),s="";for(let e=t;e>0;e--){let t=r[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=r.pop()[1]+s}0===s.trim().indexOf("!")&&(n.important=!0,n.raws.important=s,e=r)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(n,"value",i.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Fo;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&&"rule"===e.type&&!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="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,n=null,r=!1,s=null,o=[],i=e[1].startsWith("--"),a=[],c=e;for(;c;){if(n=c[0],a.push(c),"("===n||"["===n)s||(s=c),o.push("("===n?")":"]");else if(i&&r&&"{"===n)s||(s=c),o.push("}");else if(0===o.length){if(";"===n){if(r)return void this.decl(a,i);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(r=!0)}else n===o[o.length-1]&&(o.pop(),0===o.length&&(s=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(s),t&&r){if(!i)for(;a.length&&(c=a[a.length-1][0],"space"===c||"comment"===c);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}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)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,r){let s,o,i,a,c=n.length,l="",u=!0;for(let e=0;e<c;e+=1)s=n[e],o=s[0],"space"!==o||e!==c-1||r?"comment"===o?(a=n[e-1]?n[e-1][0]:"empty",i=n[e+1]?n[e+1][0]:"empty",Bo[a]||Bo[i]||","===l.slice(-1)?u=!1:l+=s[1]):l+=s[1]:u=!1;if(!u){let r=n.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:r,value:l}}e[t]=l}rule(e){e.pop();let t=new Fo;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],"space"===t||"comment"===t);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)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})}};let jo=Ps,Zo=Uo,zo=cs;function Vo(e,t){let n=new zo(e,t),r=new Zo(n);try{r.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return r.root}var Ho=Vo;Vo.default=Vo,jo.registerParse(Vo);let{isClean:Go,my:Wo}=Cr,Yo=bs,Ko=Ar,Jo=Ps,Xo=js,$o=zs,qo=Ys,Qo=Ho,ei=Eo;const ti={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},ni={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},ri={Once:!0,postcssPlugin:!0,prepare:!0};function si(e){return"object"==typeof e&&"function"==typeof e.then}function oi(e){let t=!1,n=ti[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(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 ii(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:oi(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function ai(e){return e[Go]=!1,e.nodes&&e.nodes.forEach(e=>ai(e)),e}let ci={},li=class e{constructor(t,n,r){let s;if(this.stringified=!1,this.processed=!1,"object"!=typeof n||null===n||"root"!==n.type&&"document"!==n.type)if(n instanceof e||n instanceof qo)s=ai(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let e=Qo;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{s=e(n,r)}catch(e){this.processed=!0,this.error=e}s&&!s[Wo]&&Jo.rebuild(s)}else s=ai(n);this.result=new qo(t,s,r),this.helpers={...ci,postcss:ci,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&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.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let n=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(n.postcssVersion&&"production"!==process.env.NODE_ENV){let e=n.postcssPlugin,t=n.postcssVersion,r=this.result.processor.version,s=t.split("."),o=r.split(".");(s[0]!==o[0]||parseInt(s[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+r+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=n.postcssPlugin,e.setMessage()}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("object"==typeof t)for(let n in t){if(!ni[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!ri[n])if("object"==typeof t[n])for(let r in t[n])e(t,"*"===r?n:n+"-"+r.toLowerCase(),t[n][r]);else"function"==typeof t[n]&&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(si(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Go];){e[Go]=!0;let t=[ii(e)];for(;t.length>0;){let e=this.visitTick(t);if(si(e))try{await e}catch(e){let n=t[t.length-1].node;throw this.handleError(e,n)}}}if(this.listeners.OnceExit)for(let[t,n]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>n(e,this.helpers));await Promise.all(t)}else await n(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return si(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)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=Ko;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new Yo(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[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(si(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Go];)e[Go]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||$o("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,r]of e){let e;this.result.lastPlugin=n;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(si(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:n,visitors:r}=t;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void e.pop();if(r.length>0&&t.visitorIndex<r.length){let[e,s]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){let r,s=t.iterator;for(;r=n.nodes[n.indexes[s]];)if(n.indexes[s]+=1,!r[Go])return r[Go]=!0,void e.push(ii(r));t.iterator=0,delete n.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(n.nodes&&n.nodes.length&&(n[Go]=!0,t.iterator=n.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Go]=!0;let t=oi(e);for(let n of t)if(0===n)e.nodes&&e.each(e=>{e[Go]||this.walkSync(e)});else{let t=this.listeners[n];if(t&&this.visitSync(t,e.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"}};li.registerPostcss=e=>{ci=e};var ui=li;li.default=li,ei.registerLazyResult(li),Xo.registerLazyResult(li);let hi=bs,di=Ar,pi=zs,fi=Ho;const gi=Ys;let mi=class{constructor(e,t,n){let r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let s=di;this.result=new gi(this._processor,r,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new hi(s,r,this._opts,t);if(i.isMap()){let[e,t]=i.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else i.clearAnnotation(),this.result.css=i.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"production"!==process.env.NODE_ENV&&("from"in this._opts||pi("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),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=fi;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"}};var yi=mi;mi.default=mi;let vi=yi,bi=ui,wi=js,Ci=Eo,Si=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(!0===n.postcss?n=n():n.postcss&&(n=n.postcss),"object"==typeof n&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if("object"==typeof n&&n.postcssPlugin)t.push(n);else if("function"==typeof n)t.push(n);else{if("object"!=typeof n||!n.parse&&!n.stringify)throw new Error(n+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new bi(this,e,t):new vi(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var _i=Si;Si.default=Si,Ci.registerProcessor(Si),wi.registerProcessor(Si);let Ii=Br,Ei=Yr,Ti=Ss,Ai=wo,ki=cs,Oi=Eo,Ri=xo;function xi(e,t){if(Array.isArray(e))return e.map(e=>xi(e));let{inputs:n,...r}=e;if(n){t=[];for(let e of n){let n={...e,__proto__:ki.prototype};n.map&&(n.map={...n.map,__proto__:Ei.prototype}),t.push(n)}}if(r.nodes&&(r.nodes=e.nodes.map(e=>xi(e,t))),r.source){let{inputId:e,...n}=r.source;r.source=n,null!=e&&(r.source.input=t[e])}if("root"===r.type)return new Oi(r);if("decl"===r.type)return new Ii(r);if("rule"===r.type)return new Ri(r);if("comment"===r.type)return new Ti(r);if("atrule"===r.type)return new Ai(r);throw new Error("Unknown node type: "+e.type)}var Ni=xi;xi.default=xi;let Li=wr,Mi=Br,Pi=ui,Di=Ps,Fi=_i,Bi=Ar,Ui=Ni,ji=js,Zi=Hs,zi=Ss,Vi=wo,Hi=Ys,Gi=cs,Wi=Ho,Yi=Ao,Ki=xo,Ji=Eo,Xi=Pr;function $i(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Fi(e)}$i.plugin=function(e,t){let n,r=!1;function s(...n){console&&console.warn&&!r&&(r=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let s=t(...n);return s.postcssPlugin=e,s.postcssVersion=(new Fi).version,s}return Object.defineProperty(s,"postcss",{get:()=>(n||(n=s()),n)}),s.process=function(e,t,n){return $i([s(n)]).process(e,t)},s},$i.stringify=Bi,$i.parse=Wi,$i.fromJSON=Ui,$i.list=Yi,$i.comment=e=>new zi(e),$i.atRule=e=>new Vi(e),$i.decl=e=>new Mi(e),$i.rule=e=>new Ki(e),$i.root=e=>new Ji(e),$i.document=e=>new ji(e),$i.CssSyntaxError=Li,$i.Declaration=Mi,$i.Container=Di,$i.Processor=Fi,$i.Document=ji,$i.Comment=zi,$i.Warning=Zi,$i.AtRule=Vi,$i.Result=Hi,$i.Input=Gi,$i.Rule=Ki,$i.Root=Ji,$i.Node=Xi,Pi.registerPostcss($i);var qi=$i;$i.default=$i;const Qi=ur(qi);Qi.stringify,Qi.fromJSON,Qi.plugin,Qi.parse,Qi.list,Qi.document,Qi.comment,Qi.atRule,Qi.rule,Qi.decl,Qi.root,Qi.CssSyntaxError,Qi.Declaration,Qi.Container,Qi.Processor,Qi.Document,Qi.Comment,Qi.Warning,Qi.AtRule,Qi.Result,Qi.Input,Qi.Rule,Qi.Root,Qi.Node;class ea{constructor(...e){lr(this,"parentElement",null),lr(this,"parentNode",null),lr(this,"ownerDocument"),lr(this,"firstChild",null),lr(this,"lastChild",null),lr(this,"previousSibling",null),lr(this,"nextSibling",null),lr(this,"ELEMENT_NODE",1),lr(this,"TEXT_NODE",3),lr(this,"nodeType"),lr(this,"nodeName"),lr(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof ea))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const ta={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},na={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ra={};function sa(e){if(ra[e])return ra[e];const t=globalThis[e],n=t.prototype,r=e in ta?ta[e]:void 0,s=Boolean(r&&r.every(e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))})),o=e in na?na[e]:void 0,i=Boolean(o&&o.every(e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))}));if(s&&i&&!globalThis.Zone)return ra[e]=t.prototype,t.prototype;try{const r=document.createElement("iframe");document.body.appendChild(r);const s=r.contentWindow;if(!s)return t.prototype;const o=s[e].prototype;return document.body.removeChild(r),o?ra[e]=o:n}catch{return n}}const oa={};function ia(e,t,n){var r;const s=`${e}.${String(n)}`;if(oa[s])return oa[s].call(t);const o=sa(e),i=null==(r=Object.getOwnPropertyDescriptor(o,n))?void 0:r.get;return i?(oa[s]=i,i.call(t)):t[n]}const aa={};function ca(e,t,n){const r=`${e}.${String(n)}`;if(aa[r])return aa[r].bind(t);const s=sa(e)[n];return"function"!=typeof s?t[n]:(aa[r]=s,s.bind(t))}const la={childNodes:function(e){return ia("Node",e,"childNodes")},parentNode:function(e){return ia("Node",e,"parentNode")},parentElement:function(e){return ia("Node",e,"parentElement")},textContent:function(e){return ia("Node",e,"textContent")},contains:function(e,t){return ca("Node",e,"contains")(t)},getRootNode:function(e){return ca("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ia("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ia("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ia("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ia("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return sa("MutationObserver").constructor}};const ua="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let ha={map:{},getId:()=>(console.error(ua),-1),getNode:()=>(console.error(ua),null),removeNodeFromMap(){console.error(ua)},has:()=>(console.error(ua),!1),reset(){console.error(ua)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ha=new Proxy(ha,{get:(e,t,n)=>("map"===t&&console.error(ua),Reflect.get(e,t,n))}));let da=Date.now;function pa(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:la.parentElement(e)}/[1-9][0-9]{12}/.test(Date.now().toString())||(da=()=>(new Date).getTime());function fa(e){var t;let n=null;return"getRootNode"in e&&(null==(t=la.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&la.host(la.getRootNode(e))&&(n=la.host(la.getRootNode(e))),n}function ga(e){let t,n=e;for(;t=fa(n);)n=t;return n}function ma(e){const t=e.ownerDocument;if(!t)return!1;const n=ga(e);return la.contains(t,n)}const ya=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){s(this,"id",1),s(this,"styleIDMap",new WeakMap),s(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=void 0===t?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++}},get _mirror(){return ha},closestElementOfNode:pa,getBaseDimension:function e(t,n){var r,s;const o=null==(s=null==(r=t.ownerDocument)?void 0:r.defaultView)?void 0:s.frameElement;if(!o||o===n)return{x:0,y:0,relativeScale:1,absoluteScale:1};const i=o.getBoundingClientRect(),a=e(o,n),c=i.height/o.clientHeight;return{x:i.x*a.relativeScale+a.x,y:i.y*a.relativeScale+a.y,relativeScale:c,absoluteScale:a.absoluteScale*c}},getNestedRule:function e(t,n){const r=t[n[0]];return 1===n.length?r:e(r.cssRules[n[1]].cssRules,n.slice(2))},getPositionsAndIndex:function(e){const t=[...e],n=t.pop();return{positions:t,index:n}},getRootShadowHost:ga,getShadowHost:fa,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,n,r,s;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=la.parentElement(o.body))?void 0:t.scrollLeft)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(r=la.parentElement(o.body))?void 0:r.scrollTop)||(null==(s=null==o?void 0:o.body)?void 0:s.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof ea&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(la.shadowRoot(e)))},hookSetter:function e(t,n,r,s,o=window){const i=o.Object.getOwnPropertyDescriptor(t,n);return o.Object.defineProperty(t,n,s?r:{set(e){setTimeout(()=>{r.set.call(this,e)},0),i&&i.set&&i.set.call(this,e)}}),()=>e(t,n,i||{},!0)},inDom:function(e){const t=e.ownerDocument;return!!t&&(la.contains(t,e)||ma(e))},isAncestorRemoved:function e(t,n){if(function(e){const t=e&&"host"in e&&"mode"in e&&g.host(e)||null;return Boolean(t&&"shadowRoot"in t&&g.shadowRoot(t)===e)}(t))return!1;const r=n.getId(t);if(!n.has(r))return!0;const s=la.parentNode(t);return(!s||s.nodeType!==t.DOCUMENT_NODE)&&(!s||e(s,n))},isBlocked:function(e,t,n,r){if(!e)return!1;const s=pa(e);if(!s)return!1;try{if("string"==typeof t){if(s.classList.contains(t))return!0;if(r&&null!==s.closest("."+t))return!0}else if(y(s,t,r))return!0}catch(e){}if(n){if(s.matches(n))return!0;if(r&&null!==s.closest(n))return!0}return!1},isIgnored:function(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||-2===t.getId(e)},isSerialized:function(e,t){return-1!==t.getId(e)},isSerializedIframe:function(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))},isSerializedStylesheet:function(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))},iterateResolveTree:function e(t,n){n(t.value);for(let r=t.children.length-1;r>=0;r--)e(t.children[r],n)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return da},on:function(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)},patch:function(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],s=n(r);return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=s,()=>{e[t]=r}}catch{return()=>{}}},polyfill:function(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)},queueToResolveTrees:function(e){const t={},n=(e,n)=>{const r={value:e,parent:n,children:[]};return t[e.node.id]=r,r},r=[];for(const s of e){const{nextId:e,parentId:o}=s;if(e&&e in t){const o=t[e];if(o.parent){const e=o.parent.children.indexOf(o);o.parent.children.splice(e,0,n(s,o.parent))}else{const e=r.indexOf(o);r.splice(e,0,n(s,null))}continue}if(o in t){const e=t[o];e.children.push(n(s,e));continue}r.push(n(s,null))}return r},shadowHostInDom:ma,throttle:function(e,t,n={}){let r=null,s=0;return function(...o){const i=Date.now();s||!1!==n.leading||(s=i);const a=t-(i-s),c=this;a<=0||a>t?(r&&(clearTimeout(r),r=null),s=i,e.apply(c,o)):r||!1===n.trailing||(r=setTimeout(()=>{s=!1===n.leading?0:Date.now(),r=null,e.apply(c,o)},a))}},uniqueTextMutations:function(e){const t=new Set,n=[];for(let r=e.length;r--;){const s=e[r];t.has(s.id)||(n.push(s),t.add(s.id))}return n}},Symbol.toStringTag,{value:"Module"}));for(var va="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ba="undefined"==typeof Uint8Array?[]:new Uint8Array(256),wa=0;wa<64;wa++)ba[va.charCodeAt(wa)]=wa;var Ca,Sa,_a;"undefined"!=typeof window&&window.Blob&&new Blob([(Ca="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Uint8Array.from(atob(Ca),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],e=>2*e)[0]){const t=document.createElement("iframe");document.body.appendChild(t),Array.from=(null==(e=t.contentWindow)?void 0:e.Array.from)||Array.from,document.body.removeChild(t)}}catch(e){console.debug("Unable to override Array.from",e)}new m,(_a=Sa||(Sa={}))[_a.NotStarted=0]="NotStarted",_a[_a.Running=1]="Running",_a[_a.Stopped=2]="Stopped";class Ia{constructor(e){n(this,"fileName"),n(this,"functionName"),n(this,"lineNumber"),n(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){const e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${e}:${t})`:`${this.fileName}:${e}:${t}`}}const Ea=/(^|@)\S+:\d+/,Ta=/^\s*at .*(\S+:\d+|\(native\))/m,Aa=/^(eval@)?(\[native code])?$/,ka={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Ta)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error(`Cannot parse given url: ${e}`);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(Ta)},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,"(");const n=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=n?t.replace(n[0],""):t;const r=t.split(/\s+/).slice(1),s=this.extractLocation(n?n[1]:r.pop()),o=r.join(" ")||void 0,i=["eval","<anonymous>"].indexOf(s[0])>-1?void 0:s[0];return new Ia({functionName:o,fileName:i,lineNumber:s[1],columnNumber:s[2]})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(Aa)},this).map(function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Ia({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,s=this.extractLocation(e.replace(t,""));return new Ia({functionName:r,fileName:s[0],lineNumber:s[1],columnNumber:s[2]})}},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){const t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[];for(let e=2,s=n.length;e<s;e+=2){const s=t.exec(n[e]);s&&r.push(new Ia({fileName:s[2],lineNumber:parseFloat(s[1])}))}return r},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[];for(let e=0,s=n.length;e<s;e+=2){const s=t.exec(n[e]);s&&r.push(new Ia({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(Ea)&&!e.match(/^Error created at/)},this).map(function(e){const t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Ia({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function Oa(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let n=e.localName;if(!n)break;n=n.toLowerCase();const r=e.parentElement,s=[];if(r.children&&r.children.length>0)for(let e=0;e<r.children.length;e++){const t=r.children[e];t.localName&&t.localName.toLowerCase&&t.localName.toLowerCase()===n&&s.push(t)}s.length>1&&(n+=`:eq(${s.indexOf(e)})`),t=n+(t?">"+t:""),e=r}return t}function Ra(e){return"[object Object]"===Object.prototype.toString.call(e)}function xa(e,t){if(0===t)return!0;const n=Object.keys(e);for(const r of n)if(Ra(e[r])&&xa(e[r],t-1))return!0;return!1}function Na(e,t){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);const r=[],s=[];return JSON.stringify(e,function(e,t){if(r.length>0){const n=r.indexOf(this);~n?r.splice(n+1):r.push(this),~n?s.splice(n,1/0,e):s.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+s.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Ra(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Ra(e)&&xa(e,n.depthOfLimit))return!0;return!1}(t))return function(e){let t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t=`${t.slice(0,n.stringLengthLimit)}...`);return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){const e={};for(const n in t){const r=t[n];Array.isArray(r)?e[n]=Oa(r.length?r[0]:null):e[n]=r}return e}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t})}const La={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 Ma(e,t,n){const r=n?Object.assign({},La,n):La,s=r.logger;if(!s)return()=>{};let o;o="string"==typeof s?t[s]:s;let i=0,a=!1;const c=[];if(r.level.includes("error")){const n=t=>{const n=t.message,s=t.error,o=ka.parse(s).map(e=>e.toString()),i=[Na(n,r.stringifyOptions)];e({level:"error",trace:o,payload:i})};t.addEventListener("error",n),c.push(()=>{t.removeEventListener("error",n)});const s=t=>{let n,s;t.reason instanceof Error?(n=t.reason,s=[Na(`Uncaught (in promise) ${n.name}: ${n.message}`,r.stringifyOptions)]):(n=new Error,s=[Na("Uncaught (in promise)",r.stringifyOptions),Na(t.reason,r.stringifyOptions)]);const o=ka.parse(n).map(e=>e.toString());e({level:"error",trace:o,payload:s})};t.addEventListener("unhandledrejection",s),c.push(()=>{t.removeEventListener("unhandledrejection",s)})}for(const e of r.level)c.push(l(o,e));return()=>{c.forEach(e=>e())};function l(t,n){return t[n]?ya.patch(t,n,t=>(...s)=>{if(t.apply(this,s),!("assert"===n&&s[0]||a)){a=!0;try{const t=ka.parse(new Error).map(e=>e.toString()).splice(1),o=("assert"===n?s.slice(1):s).map(e=>Na(e,r.stringifyOptions));i++,i<r.lengthThreshold?e({level:n,trace:t,payload:o}):i===r.lengthThreshold&&e({level:"warn",trace:[],payload:[Na("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...s)}finally{a=!1}}}):()=>{}}}var Pa;function Da(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function Fa(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Ba(e){try{var t=e.rules||e.cssRules;return t?((n=Array.from(t).map(Ua).join("")).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),n):null}catch(e){return null}var n}function Ua(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=Ba(e.styleSheet)||t}catch(e){}return t}!function(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"}(Pa||(Pa={}));var ja=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(function(e){return t.removeNodeFromMap(e)})},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var n=this.getNode(e);if(n){var r=this.nodeMetaMap.get(n);r&&this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function Za(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,s=e.value,o=e.maskInputFn,i=s||"";return(t[n.toLowerCase()]||t[r])&&(i=o?o(i):"*".repeat(i.length)),i}var za="__rrweb_original__";var Va,Ha,Ga=1,Wa=new RegExp("[^a-z0-9-_:]");function Ya(){return Ga++}var Ka=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Ja=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,Xa=/^(data:)([^,]*),(.*)/i;function $a(e,t){return(e||"").replace(Ka,function(e,n,r,s,o,i){var a,c=r||o||i,l=n||s||"";if(!c)return e;if(!Ja.test(c))return"url(".concat(l).concat(c).concat(l,")");if(Xa.test(c))return"url(".concat(l).concat(c).concat(l,")");if("/"===c[0])return"url(".concat(l).concat((a=t,(a.indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+c)).concat(l,")");var u=t.split("/"),h=c.split("/");u.pop();for(var d=0,p=h;d<p.length;d++){var f=p[d];"."!==f&&(".."===f?u.pop():u.push(f))}return"url(".concat(l).concat(u.join("/")).concat(l,")")})}var qa=/^[^ \t\n\r\u000c]+/,Qa=/^[, \t\n\r\u000c]+/;function ec(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function tc(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function nc(){var e=document.createElement("a");return e.href="",e.href}function rc(e,t,n,r){return"src"===n||"href"===n&&r&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&r&&"#"!==r[0]?ec(e,r):"background"!==n||!r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n&&r?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,s=e.exec(t.substring(n));return s?(r=s[0],n+=r.length,r):""}for(var s=[];r(Qa),!(n>=t.length);){var o=r(qa);if(","===o.slice(-1))o=ec(e,o.substring(0,o.length-1)),s.push(o);else{var i="";o=ec(e,o);for(var a=!1;;){var c=t.charAt(n);if(""===c){s.push((o+i).trim());break}if(a)")"===c&&(a=!1);else{if(","===c){n+=1,s.push((o+i).trim());break}"("===c&&(a=!0)}i+=c,n+=1}}}return s.join(", ")}(e,r):"style"===n&&r?$a(r,nc()):"object"===t&&"data"===n&&r?ec(e,r):r:ec(e,r)}function sc(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&sc(e.parentNode,t,n);for(var r=e.classList.length;r--;){var s=e.classList[r];if(t.test(s))return!0}return!!n&&sc(e.parentNode,t,n)}function oc(e,t,n){var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===r)return!1;if("string"==typeof t){if(r.classList.contains(t))return!0;if(r.closest(".".concat(t)))return!0}else if(sc(r,t,!0))return!0;if(n){if(r.matches(n))return!0;if(r.closest(n))return!0}return!1}function ic(e,t){var n=t.doc,r=t.mirror,s=t.blockClass,o=t.blockSelector,i=t.maskTextClass,a=t.maskTextSelector,c=t.inlineStylesheet,l=t.maskInputOptions,u=void 0===l?{}:l,h=t.maskTextFn,d=t.maskInputFn,p=t.dataURLOptions,f=void 0===p?{}:p,g=t.inlineImages,m=t.recordCanvas,y=t.keepIframeSrcFn,v=t.newlyAddedElement,b=void 0!==v&&v,w=function(e,t){if(!t.hasNode(e))return;var n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:Pa.Document,childNodes:[],compatMode:e.compatMode}:{type:Pa.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Pa.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:w};case e.ELEMENT_NODE:return function(e,t){for(var n=t.doc,r=t.blockClass,s=t.blockSelector,o=t.inlineStylesheet,i=t.maskInputOptions,a=void 0===i?{}:i,c=t.maskInputFn,l=t.dataURLOptions,u=void 0===l?{}:l,h=t.inlineImages,d=t.recordCanvas,p=t.keepIframeSrcFn,f=t.newlyAddedElement,g=void 0!==f&&f,m=t.rootId,y=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var s=e.classList[r];if(t.test(s))return!0}return!!n&&e.matches(n)}(e,r,s),v=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return Wa.test(t)?"div":t}(e),b={},w=e.attributes.length,C=0;C<w;C++){var S=e.attributes[C];b[S.name]=rc(n,v,S.name,S.value)}if("link"===v&&o){var _=Array.from(n.styleSheets).find(function(t){return t.href===e.href}),I=null;_&&(I=Ba(_)),I&&(delete b.rel,delete b.href,b._cssText=$a(I,_.href))}if("style"===v&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){(I=Ba(e.sheet))&&(b._cssText=$a(I,nc()))}if("input"===v||"textarea"===v||"select"===v){var E=e.value,T=e.checked;"radio"!==b.type&&"checkbox"!==b.type&&"submit"!==b.type&&"button"!==b.type&&E?b.value=Za({type:b.type,tagName:v,value:E,maskInputOptions:a,maskInputFn:c}):T&&(b.checked=T)}"option"===v&&(e.selected&&!a.select?b.selected=!0:delete b.selected);if("canvas"===v&&d)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var s=t.getImageData,o=za in s?s[za]:s;if(new Uint32Array(o.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(function(e){return 0!==e}))return!1}return!0})(e)||(b.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var A=e.toDataURL(u.type,u.quality),k=document.createElement("canvas");k.width=e.width,k.height=e.height,A!==k.toDataURL(u.type,u.quality)&&(b.rr_dataURL=A)}if("img"===v&&h){Va||(Va=n.createElement("canvas"),Ha=Va.getContext("2d"));var O=e,R=O.crossOrigin;O.crossOrigin="anonymous";var x=function(){try{Va.width=O.naturalWidth,Va.height=O.naturalHeight,Ha.drawImage(O,0,0),b.rr_dataURL=Va.toDataURL(u.type,u.quality)}catch(e){console.warn("Cannot inline img src=".concat(O.currentSrc,"! Error: ").concat(e))}R?b.crossOrigin=R:O.removeAttribute("crossorigin")};O.complete&&0!==O.naturalWidth?x():O.onload=x}"audio"!==v&&"video"!==v||(b.rr_mediaState=e.paused?"paused":"played",b.rr_mediaCurrentTime=e.currentTime);g||(e.scrollLeft&&(b.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(b.rr_scrollTop=e.scrollTop));if(y){var N=e.getBoundingClientRect(),L=N.width,M=N.height;b={class:b.class,rr_width:"".concat(L,"px"),rr_height:"".concat(M,"px")}}"iframe"!==v||p(b.src)||(e.contentDocument||(b.rr_src=b.src),delete b.src);return{type:Pa.Element,tagName:v,attributes:b,childNodes:[],isSVG:tc(e)||void 0,needBlock:y,rootId:m}}(e,{doc:n,blockClass:s,blockSelector:o,inlineStylesheet:c,maskInputOptions:u,maskInputFn:d,dataURLOptions:f,inlineImages:g,recordCanvas:m,keepIframeSrcFn:y,newlyAddedElement:b,rootId:w});case e.TEXT_NODE:return function(e,t){var n,r=t.maskTextClass,s=t.maskTextSelector,o=t.maskTextFn,i=t.rootId,a=e.parentNode&&e.parentNode.tagName,c=e.textContent,l="STYLE"===a||void 0,u="SCRIPT"===a||void 0;if(l&&c){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(c=(h=e.parentNode.sheet).cssRules?Array.from(h.cssRules).map(function(e){return e.cssText||""}).join(""):"")}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}c=$a(c,nc())}var h;u&&(c="SCRIPT_PLACEHOLDER");!l&&!u&&c&&oc(e,r,s)&&(c=o?o(c):c.replace(/[\S]/g,"*"));return{type:Pa.Text,textContent:c||"",isStyle:l,rootId:i}}(e,{maskTextClass:i,maskTextSelector:a,maskTextFn:h,rootId:w});case e.CDATA_SECTION_NODE:return{type:Pa.CDATA,textContent:"",rootId:w};case e.COMMENT_NODE:return{type:Pa.Comment,textContent:e.textContent||"",rootId:w};default:return!1}}function ac(e){return void 0===e?"":e.toLowerCase()}function cc(e,t){var n,r=t.doc,s=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,c=t.maskTextSelector,l=t.skipChild,u=void 0!==l&&l,h=t.inlineStylesheet,d=void 0===h||h,p=t.maskInputOptions,f=void 0===p?{}:p,g=t.maskTextFn,m=t.maskInputFn,y=t.slimDOMOptions,v=t.dataURLOptions,b=void 0===v?{}:v,w=t.inlineImages,C=void 0!==w&&w,S=t.recordCanvas,_=void 0!==S&&S,I=t.onSerialize,E=t.onIframeLoad,T=t.iframeLoadTimeout,A=void 0===T?5e3:T,k=t.onStylesheetLoad,O=t.stylesheetLoadTimeout,R=void 0===O?5e3:O,x=t.keepIframeSrcFn,N=void 0===x?function(){return!1}:x,L=t.newlyAddedElement,M=void 0!==L&&L,P=t.preserveWhiteSpace,D=void 0===P||P,F=ic(e,{doc:r,mirror:s,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:f,maskTextFn:g,maskInputFn:m,dataURLOptions:b,inlineImages:C,recordCanvas:_,keepIframeSrcFn:N,newlyAddedElement:M});if(!F)return console.warn(e,"not serialized"),null;n=s.hasNode(e)?s.getId(e):!function(e,t){if(t.comment&&e.type===Pa.Comment)return!0;if(e.type===Pa.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&"preload"===e.attributes.rel&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(ac(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===ac(e.attributes.name)||"icon"===ac(e.attributes.rel)||"apple-touch-icon"===ac(e.attributes.rel)||"shortcut icon"===ac(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&ac(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ac(e.attributes.property).match(/^(og|twitter|fb):/)||ac(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===ac(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===ac(e.attributes.name)||"googlebot"===ac(e.attributes.name)||"bingbot"===ac(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===ac(e.attributes.name)||"generator"===ac(e.attributes.name)||"framework"===ac(e.attributes.name)||"publisher"===ac(e.attributes.name)||"progid"===ac(e.attributes.name)||ac(e.attributes.property).match(/^article:/)||ac(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===ac(e.attributes.name)||"yandex-verification"===ac(e.attributes.name)||"csrf-token"===ac(e.attributes.name)||"p:domain_verify"===ac(e.attributes.name)||"verify-v1"===ac(e.attributes.name)||"verification"===ac(e.attributes.name)||"shopify-checkout-api-token"===ac(e.attributes.name)))return!0}}return!1}(F,y)&&(D||F.type!==Pa.Text||F.isStyle||F.textContent.replace(/^\s+|\s+$/gm,"").length)?Ya():-2;var B=Object.assign(F,{id:n});if(s.add(e,B),-2===n)return null;I&&I(e);var U=!u;if(B.type===Pa.Element){U=U&&!B.needBlock,delete B.needBlock;var j=e.shadowRoot;j&&Fa(j)&&(B.isShadowHost=!0)}if((B.type===Pa.Document||B.type===Pa.Element)&&U){y.headWhitespace&&B.type===Pa.Element&&"head"===B.tagName&&(D=!1);for(var Z={doc:r,mirror:s,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:c,skipChild:u,inlineStylesheet:d,maskInputOptions:f,maskTextFn:g,maskInputFn:m,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:_,preserveWhiteSpace:D,onSerialize:I,onIframeLoad:E,iframeLoadTimeout:A,onStylesheetLoad:k,stylesheetLoadTimeout:R,keepIframeSrcFn:N},z=0,V=Array.from(e.childNodes);z<V.length;z++){(W=cc(V[z],Z))&&B.childNodes.push(W)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(var H=0,G=Array.from(e.shadowRoot.childNodes);H<G.length;H++){var W;(W=cc(G[H],Z))&&(Fa(e.shadowRoot)&&(W.isShadow=!0),B.childNodes.push(W))}}return e.parentNode&&Da(e.parentNode)&&Fa(e.parentNode)&&(B.isShadow=!0),B.type===Pa.Element&&"iframe"===B.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var s,o=!1;try{s=r.document.readyState}catch(e){return}if("complete"===s){var i="about:blank";if(r.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var a=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(a),o=!0,t()})}}}(e,function(){var t=e.contentDocument;if(t&&E){var n=cc(t,{doc:t,mirror:s,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:g,maskInputFn:m,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:_,preserveWhiteSpace:D,onSerialize:I,onIframeLoad:E,iframeLoadTimeout:A,onStylesheetLoad:k,stylesheetLoadTimeout:R,keepIframeSrcFn:N});n&&E(e,n)}},A),B.type===Pa.Element&&"link"===B.tagName&&"stylesheet"===B.attributes.rel&&function(e,t,n){var r,s=!1;try{r=e.sheet}catch(e){return}if(!r){var o=setTimeout(function(){s||(t(),s=!0)},n);e.addEventListener("load",function(){clearTimeout(o),s=!0,t()})}}(e,function(){if(k){var t=cc(e,{doc:r,mirror:s,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:g,maskInputFn:m,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:_,preserveWhiteSpace:D,onSerialize:I,onIframeLoad:E,iframeLoadTimeout:A,onStylesheetLoad:k,stylesheetLoadTimeout:R,keepIframeSrcFn:N});t&&k(e,t)}},R),B}function lc(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const uc="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let hc={map:{},getId:()=>(console.error(uc),-1),getNode:()=>(console.error(uc),null),removeNodeFromMap(){console.error(uc)},has:()=>(console.error(uc),!1),reset(){console.error(uc)}};function dc(e,t,n={}){let r=null,s=0;return function(...o){const i=Date.now();s||!1!==n.leading||(s=i);const a=t-(i-s),c=this;a<=0||a>t?(r&&(clearTimeout(r),r=null),s=i,e.apply(c,o)):r||!1===n.trailing||(r=setTimeout(()=>{s=!1===n.leading?0:Date.now(),r=null,e.apply(c,o)},a))}}function pc(e,t,n,r,s=window){const o=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,r?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>pc(e,t,o||{},!0)}function fc(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],s=n(r);return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=s,()=>{e[t]=r}}catch(e){return()=>{}}}function gc(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function mc(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function yc(e,t,n,r){if(!e)return!1;const s=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!s)return!1;if("string"==typeof t){if(s.classList.contains(t))return!0;if(r&&null!==s.closest("."+t))return!0}else if(sc(s,t,r))return!0;if(n){if(e.matches(n))return!0;if(r&&null!==s.closest(n))return!0}return!1}function vc(e,t){return-2===t.getId(e)}function bc(e,t){if(Da(e))return!1;const n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||bc(e.parentNode,t))}function wc(e){return Boolean(e.changedTouches)}function Cc(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Sc(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function _c(e){return Boolean(null==e?void 0:e.shadowRoot)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(hc=new Proxy(hc,{get:(e,t,n)=>("map"===t&&console.error(uc),Reflect.get(e,t,n))}));class Ic{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?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++}}var Ec=(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))(Ec||{}),Tc=(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))(Tc||{}),Ac=(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))(Ac||{}),kc=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(kc||{});function Oc(e){return"__ln"in e}class Rc{constructor(){this.length=0,this.head=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Oc(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&Oc(e.nextSibling)&&e.nextSibling.__ln.previous){const 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;this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)}}const xc=(e,t)=>`${e}@${t}`;class Nc{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],t=new Rc,n=e=>{let t=e,n=-2;for(;-2===n;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},r=r=>{var s,o,i,a;let c=null;(null===(o=null===(s=r.getRootNode)||void 0===s?void 0:s.call(r))||void 0===o?void 0:o.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&r.getRootNode().host&&(c=r.getRootNode().host);let l=c;for(;(null===(a=null===(i=null==l?void 0:l.getRootNode)||void 0===i?void 0:i.call(l))||void 0===a?void 0:a.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&l.getRootNode().host;)l=l.getRootNode().host;const u=!(this.doc.contains(r)||l&&this.doc.contains(l));if(!r.parentNode||u)return;const h=Da(r.parentNode)?this.mirror.getId(c):this.mirror.getId(r.parentNode),d=n(r);if(-1===h||-1===d)return t.addNode(r);const p=cc(r,{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=>{Cc(e,this.mirror)&&this.iframeManager.addIframe(e),Sc(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),_c(r)&&this.shadowDomManager.addShadowRoot(r.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});p&&e.push({parentId:h,nextId:d,node:p})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of Array.from(this.movedSet.values()))Mc(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||r(e);for(const e of Array.from(this.addedSet.values()))Dc(this.droppedSet,e)||Mc(this.removes,e,this.mirror)?Dc(this.movedSet,e)?r(e):this.droppedSet.add(e):r(e);let s=null;for(;t.length;){let e=null;if(s){const t=this.mirror.getId(s.value.parentNode),r=n(s.value);-1!==t&&-1!==r&&(e=s)}if(!e)for(let r=t.length-1;r>=0;r--){const s=t.get(r);if(s){const t=this.mirror.getId(s.value.parentNode);if(-1===n(s.value))continue;if(-1!==t){e=s;break}{const t=s.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const n=t.parentNode.host;if(-1!==this.mirror.getId(n)){e=s;break}}}}}if(!e){for(;t.head;)t.removeNode(t.head.value);break}s=e.previous,t.removeNode(e.value),r(e.value)}const o={texts:this.texts.map(e=>({id:this.mirror.getId(e.node),value:e.value})).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>({id:this.mirror.getId(e.node),attributes:e.attributes})).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.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(o))},this.processMutation=e=>{if(!vc(e.target,this.mirror))switch(e.type){case"characterData":{const t=e.target.textContent;yc(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:oc(e.target,this.maskTextClass,this.maskTextSelector)&&t?this.maskTextFn?this.maskTextFn(t):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.target.getAttribute(e.attributeName);if("value"===e.attributeName&&(n=Za({maskInputOptions:this.maskInputOptions,tagName:e.target.tagName,type:e.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),yc(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;let r=this.attributes.find(t=>t.node===e.target);if("IFRAME"===t.tagName&&"src"===e.attributeName&&!this.keepIframeSrcFn(n)){if(t.contentDocument)return;e.attributeName="rr_src"}if(r||(r={node:e.target,attributes:{}},this.attributes.push(r)),"style"===e.attributeName){const n=this.doc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue),void 0!==r.attributes.style&&null!==r.attributes.style||(r.attributes.style={});const s=r.attributes.style;for(const e of Array.from(t.style)){const r=t.style.getPropertyValue(e),o=t.style.getPropertyPriority(e);r===n.style.getPropertyValue(e)&&o===n.style.getPropertyPriority(e)||(s[e]=""===o?r:[r,o])}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(s[e]=!1)}else r.attributes[e.attributeName]=rc(this.doc,t.tagName,e.attributeName,n);break}case"childList":if(yc(e.target,this.blockClass,this.blockSelector,!0))return;e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const n=this.mirror.getId(t),r=Da(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);yc(e.target,this.blockClass,this.blockSelector,!1)||vc(t,this.mirror)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Lc(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||bc(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[xc(n,r)]?Lc(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!(!Da(e.target)||!Fa(e.target))||void 0})),this.mapRemoves.push(t))})}},this.genAdds=(e,t)=>{if(this.mirror.hasNode(e)){if(vc(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[xc(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);yc(e,this.blockClass,this.blockSelector,!1)||e.childNodes.forEach(e=>this.genAdds(e))}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].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 Lc(e,t){e.delete(t),t.childNodes.forEach(t=>Lc(e,t))}function Mc(e,t,n){return 0!==e.length&&Pc(e,t,n)}function Pc(e,t,n){const{parentNode:r}=t;if(!r)return!1;const s=n.getId(r);return!!e.some(e=>e.id===s)||Pc(e,r,n)}function Dc(e,t){return 0!==e.size&&Fc(e,t)}function Fc(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||Fc(e,n))}const Bc=[],Uc="undefined"!=typeof CSSGroupingRule,jc="undefined"!=typeof CSSMediaRule,Zc="undefined"!=typeof CSSSupportsRule,zc="undefined"!=typeof CSSConditionRule;function Vc(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function Hc(e,t){var n,r;const s=new Nc;Bc.push(s),s.init(e);let o=window.MutationObserver||window.__rrMutationObserver;const i=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");i&&window[i]&&(o=window[i]);const a=new o(s.processMutations.bind(s));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function Gc({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const i=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,a=[];return Object.keys(Ac).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e]).forEach(o=>{const i=o.toLowerCase(),c=(t=>o=>{const i=Vc(o);if(yc(i,r,s,!0))return;const a=wc(o)?o.changedTouches[0]:o;if(!a)return;const c=n.getId(i),{clientX:l,clientY:u}=a;e({type:Ac[t],id:c,x:l,y:u})})(o);a.push(lc(i,c,t))}),()=>{a.forEach(e=>e())}}function Wc({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,sampling:o}){return lc("scroll",dc(o=>{const i=Vc(o);if(!i||yc(i,r,s,!0))return;const a=n.getId(i);if(i===t){const n=t.scrollingElement||t.documentElement;e({id:a,x:n.scrollLeft,y:n.scrollTop})}else e({id:a,x:i.scrollLeft,y:i.scrollTop})},o.scroll||100),t)}function Yc(e,t){const n=Object.assign({},e);return t||delete n.userTriggered,n}const Kc=["INPUT","TEXTAREA","SELECT"],Jc=new WeakMap;function Xc(e){return function(e,t){if(Uc&&e.parentRule instanceof CSSGroupingRule||jc&&e.parentRule instanceof CSSMediaRule||Zc&&e.parentRule instanceof CSSSupportsRule||zc&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function $c(e,t,n){let r,s;return e?(e.ownerNode?r=t.getId(e.ownerNode):s=n.getId(e),{styleId:s,id:r}):{}}function qc({mirror:e,stylesheetManager:t},n){var r,s,o;let i=null;i="#document"===n.nodeName?e.getId(n):e.getId(n.host);const a="#document"===n.nodeName?null===(r=n.defaultView)||void 0===r?void 0:r.Document:null===(o=null===(s=n.ownerDocument)||void 0===s?void 0:s.defaultView)||void 0===o?void 0:o.ShadowRoot,c=Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets");return null!==i&&-1!==i&&a&&c?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null===(e=c.get)||void 0===e?void 0:e.call(this)},set(e){var n;const r=null===(n=c.set)||void 0===n?void 0:n.call(this,e);if(null!==i&&-1!==i)try{t.adoptStyleSheets(e,i)}catch(e){}return r}}),()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}):()=>{}}function Qc(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:s,scrollCb:o,viewportResizeCb:i,inputCb:a,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:u,canvasMutationCb:h,fontCb:d,selectionCb:p}=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),s(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),o(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),i(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...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),h(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),d(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)}}(e,t);const r=Hc(e,e.doc),s=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(!1===t.mousemove)return()=>{};const s="number"==typeof t.mousemove?t.mousemove:50,o="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let i,a=[];const c=dc(t=>{const n=Date.now()-i;e(a.map(e=>(e.timeOffset-=n,e)),t),a=[],i=null},o),l=dc(e=>{const t=Vc(e),{clientX:n,clientY:s}=wc(e)?e.changedTouches[0]:e;i||(i=Date.now()),a.push({x:n,y:s,id:r.getId(t),timeOffset:Date.now()-i}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?Tc.Drag:e instanceof MouseEvent?Tc.MouseMove:Tc.TouchMove)},s,{trailing:!1}),u=[lc("mousemove",l,n),lc("touchmove",l,n),lc("drag",l,n)];return()=>{u.forEach(e=>e())}}(e),o=Gc(e),i=Wc(e),a=function({viewportResizeCb:e}){let t=-1,n=-1;return lc("resize",dc(()=>{const r=gc(),s=mc();t===r&&n===s||(e({width:Number(s),height:Number(r)}),t=r,n=s)},200),window)}(e),c=function({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,ignoreClass:o,maskInputOptions:i,maskInputFn:a,sampling:c,userTriggeredOnInput:l}){function u(e){let n=Vc(e);const c=e.isTrusted;if(n&&"OPTION"===n.tagName&&(n=n.parentElement),!n||!n.tagName||Kc.indexOf(n.tagName)<0||yc(n,r,s,!0))return;const u=n.type;if(n.classList.contains(o))return;let d=n.value,p=!1;"radio"===u||"checkbox"===u?p=n.checked:(i[n.tagName.toLowerCase()]||i[u])&&(d=Za({maskInputOptions:i,tagName:n.tagName,type:u,value:d,maskInputFn:a})),h(n,Yc({text:d,isChecked:p,userTriggered:c},l));const f=n.name;"radio"===u&&f&&p&&t.querySelectorAll(`input[type="radio"][name="${f}"]`).forEach(e=>{e!==n&&h(e,Yc({text:e.value,isChecked:!p,userTriggered:!1},l))})}function h(t,r){const s=Jc.get(t);if(!s||s.text!==r.text||s.isChecked!==r.isChecked){Jc.set(t,r);const s=n.getId(t);e(Object.assign(Object.assign({},r),{id:s}))}}const d=("last"===c.input?["change"]:["input","change"]).map(e=>lc(e,u,t)),p=t.defaultView;if(!p)return()=>{d.forEach(e=>e())};const f=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value"),g=[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]];return f&&f.set&&d.push(...g.map(e=>pc(e[0],e[1],{set(){u({target:this})}},!1,p))),()=>{d.forEach(e=>e())}}(e),l=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:s}){const o=o=>dc(s=>{const i=Vc(s);if(!i||yc(i,t,n,!0))return;const{currentTime:a,volume:c,muted:l,playbackRate:u}=i;e({type:o,id:r.getId(i),currentTime:a,volume:c,muted:l,playbackRate:u})},s.media||500),i=[lc("play",o(0)),lc("pause",o(1)),lc("seeked",o(2)),lc("volumechange",o(3)),lc("ratechange",o(4))];return()=>{i.forEach(e=>e())}}(e),u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){const s=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=function(r,o){const{id:i,styleId:a}=$c(this,t,n.styleMirror);return(i&&-1!==i||a&&-1!==a)&&e({id:i,styleId:a,adds:[{rule:r,index:o}]}),s.apply(this,[r,o])};const o=r.CSSStyleSheet.prototype.deleteRule;let i,a;r.CSSStyleSheet.prototype.deleteRule=function(r){const{id:s,styleId:i}=$c(this,t,n.styleMirror);return(s&&-1!==s||i&&-1!==i)&&e({id:s,styleId:i,removes:[{index:r}]}),o.apply(this,[r])},r.CSSStyleSheet.prototype.replace&&(i=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=function(r){const{id:s,styleId:o}=$c(this,t,n.styleMirror);return(s&&-1!==s||o&&-1!==o)&&e({id:s,styleId:o,replace:r}),i.apply(this,[r])}),r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=function(r){const{id:s,styleId:o}=$c(this,t,n.styleMirror);return(s&&-1!==s||o&&-1!==o)&&e({id:s,styleId:o,replaceSync:r}),a.apply(this,[r])});const c={};Uc?c.CSSGroupingRule=r.CSSGroupingRule:(jc&&(c.CSSMediaRule=r.CSSMediaRule),zc&&(c.CSSConditionRule=r.CSSConditionRule),Zc&&(c.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(c).forEach(([r,s])=>{l[r]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=function(s,o){const{id:i,styleId:a}=$c(this.parentStyleSheet,t,n.styleMirror);return(i&&-1!==i||a&&-1!==a)&&e({id:i,styleId:a,adds:[{rule:s,index:[...Xc(this),o||0]}]}),l[r].insertRule.apply(this,[s,o])},s.prototype.deleteRule=function(s){const{id:o,styleId:i}=$c(this.parentStyleSheet,t,n.styleMirror);return(o&&-1!==o||i&&-1!==i)&&e({id:o,styleId:i,removes:[{index:[...Xc(this),s]}]}),l[r].deleteRule.apply(this,[s])}}),()=>{r.CSSStyleSheet.prototype.insertRule=s,r.CSSStyleSheet.prototype.deleteRule=o,i&&(r.CSSStyleSheet.prototype.replace=i),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach(([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule})}}(e,{win:n}),h=qc(e,e.doc),d=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:s}){const o=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=function(s,i,a){var c;if(n.has(s))return o.apply(this,[s,i,a]);const{id:l,styleId:u}=$c(null===(c=this.parentRule)||void 0===c?void 0:c.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,set:{property:s,value:i,priority:a},index:Xc(this.parentRule)}),o.apply(this,[s,i,a])};const i=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=function(s){var o;if(n.has(s))return i.apply(this,[s]);const{id:a,styleId:c}=$c(null===(o=this.parentRule)||void 0===o?void 0:o.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,remove:{property:s},index:Xc(this.parentRule)}),i.apply(this,[s])},()=>{s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=i}}(e,{win:n}),p=e.collectFonts?function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],s=new WeakMap,o=n.FontFace;n.FontFace=function(e,t,n){const r=new o(e,t,n);return s.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const i=fc(t.fonts,"add",function(t){return function(n){return setTimeout(()=>{const t=s.get(n);t&&(e(t),s.delete(n))},0),t.apply(this,[n])}});return r.push(()=>{n.FontFace=o}),r.push(i),()=>{r.forEach(e=>e())}}(e):()=>{},f=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:s,selectionCb:o}=e;let i=!0;const a=()=>{const e=t.getSelection();if(!e||i&&(null==e?void 0:e.isCollapsed))return;i=e.isCollapsed||!1;const a=[],c=e.rangeCount||0;for(let t=0;t<c;t++){const o=e.getRangeAt(t),{startContainer:i,startOffset:c,endContainer:l,endOffset:u}=o;yc(i,r,s,!0)||yc(l,r,s,!0)||a.push({start:n.getId(i),startOffset:c,end:n.getId(l),endOffset:u})}o({ranges:a})};return a(),lc("selectionchange",a)}(e),g=[];for(const t of e.plugins)g.push(t.observer(t.callback,n,t.options));return()=>{Bc.forEach(e=>e.reset()),r.disconnect(),s(),o(),i(),a(),c(),l(),u(),h(),d(),p(),f(),g.forEach(e=>e())}}class el{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,r){const s=n||this.getIdToRemoteIdMap(e),o=r||this.getRemoteIdToIdMap(e);let i=s.get(t);return i||(i=this.generateIdFn(),s.set(t,i),o.set(i,t)),i}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const s=r.get(t);return s||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);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}}class tl{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new el(Ya),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new el(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;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.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){if("rrweb"===e.data.type){if(!e.source)return;const t=this.crossOriginIframeMap.get(e.source);if(!t)return;const n=this.transformCrossOriginEvent(t,e.data.event);n&&this.wrappedEmit(n,e.data.isCheckout)}}transformCrossOriginEvent(e,t){var n;switch(t.type){case Ec.FullSnapshot:return this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e),{timestamp:t.timestamp,type:Ec.IncrementalSnapshot,data:{source:Tc.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Ec.Meta:case Ec.Load:case Ec.DomContentLoaded:return!1;case Ec.Plugin:return t;case Ec.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Ec.IncrementalSnapshot:switch(t.data.source){case Tc.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e)}),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 Tc.Drag:case Tc.TouchMove:case Tc.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Tc.ViewportResize:return!1;case Tc.MediaInteraction:case Tc.MouseInteraction:case Tc.Scroll:case Tc.CanvasMutation:case Tc.Input:return this.replaceIds(t.data,e,["id"]),t;case Tc.StyleSheetRule:case Tc.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Tc.Font:return t;case Tc.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case Tc.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(n=t.data.styles)||void 0===n||n.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}}replace(e,t,n,r){for(const s of r)(Array.isArray(t[s])||"number"==typeof t[s])&&(Array.isArray(t[s])?t[s]=e.getIds(n,t[s]):t[s]=e.getId(n,t[s]));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"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}}class nl{constructor(e){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;const t=this;this.restorePatches.push(fc(Element.prototype,"attachShadow",function(e){return function(n){const r=e.call(this,n);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),r}}))}addShadowRoot(e,t){Fa(e)&&(this.shadowDoms.has(e)||(this.shadowDoms.add(e),Hc(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),Wc(Object.assign(Object.assign({},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(e.host)),qc({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)},0)))}observeAttachShadow(e){if(e.contentWindow){const t=this;this.restorePatches.push(fc(e.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(r){const s=n.call(this,r);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),s}}))}}reset(){this.restorePatches.forEach(e=>e()),this.shadowDoms=new WeakSet}}
1
+ var Monoscope=function(){"use strict";var e,t=Object.defineProperty,n=(e,n,r)=>((e,n,r)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r)(e,"symbol"!=typeof n?n+"":n,r),r=Object.defineProperty,s=(e,t,n)=>((e,t,n)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),o=Object.defineProperty,i=(e,t,n)=>((e,t,n)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);const a={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},c={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},l={};function u(e){if(l[e])return l[e];const t=globalThis[e],n=t.prototype,r=e in a?a[e]:void 0,s=Boolean(r&&r.every(e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))})),o=e in c?c[e]:void 0,i=Boolean(o&&o.every(e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))}));if(s&&i&&!globalThis.Zone)return l[e]=t.prototype,t.prototype;try{const r=document.createElement("iframe");document.body.appendChild(r);const s=r.contentWindow;if(!s)return t.prototype;const o=s[e].prototype;return document.body.removeChild(r),o?l[e]=o:n}catch{return n}}const h={};function d(e,t,n){var r;const s=`${e}.${String(n)}`;if(h[s])return h[s].call(t);const o=u(e),i=null==(r=Object.getOwnPropertyDescriptor(o,n))?void 0:r.get;return i?(h[s]=i,i.call(t)):t[n]}const p={};function f(e,t,n){const r=`${e}.${String(n)}`;if(p[r])return p[r].bind(t);const s=u(e)[n];return"function"!=typeof s?t[n]:(p[r]=s,s.bind(t))}const g={childNodes:function(e){return d("Node",e,"childNodes")},parentNode:function(e){return d("Node",e,"parentNode")},parentElement:function(e){return d("Node",e,"parentElement")},textContent:function(e){return d("Node",e,"textContent")},contains:function(e,t){return f("Node",e,"contains")(t)},getRootNode:function(e){return f("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?d("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?d("Element",e,"shadowRoot"):null},querySelector:function(e,t){return d("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return d("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return u("MutationObserver").constructor}};let m=class{constructor(){i(this,"idNodeMap",new Map),i(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-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){const 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){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const 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 y(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&y(g.parentNode(e),t,n);for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!!n&&y(g.parentNode(e),t,n)}function v(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function b(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){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 w={exports:{}},C=String,S=function(){return{isColorSupported:!1,reset:C,bold:C,dim:C,italic:C,underline:C,inverse:C,hidden:C,strikethrough:C,black:C,red:C,green:C,yellow:C,blue:C,magenta:C,cyan:C,white:C,gray:C,bgBlack:C,bgRed:C,bgGreen:C,bgYellow:C,bgBlue:C,bgMagenta:C,bgCyan:C,bgWhite:C}};w.exports=S(),w.exports.createColors=S;var _=w.exports;const I=b(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let E=_,T=I,A=class e extends Error{constructor(t,n,r,s,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),void 0!==n&&void 0!==r&&("number"==typeof n?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=E.isColorSupported),T&&e&&(t=T(t));let n,r,s=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,s.length),a=String(i).length;if(e){let{bold:e,gray:t,red:s}=E.createColors(!0);n=t=>e(s(t)),r=e=>t(e)}else n=r=e=>e;return s.slice(o,i).map((e,t)=>{let s=o+1+t,i=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=r(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+r(i)+e+"\n "+t+n("^")}return" "+r(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var k=A;A.default=A;var O={};O.isClean=Symbol("isClean"),O.my=Symbol("my");const R={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let x=class{constructor(e){this.builder=e}atrule(e,t){let n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes)this.block(e,n+r);else{let s=(e.raws.between||"")+(t?";":"");this.builder(n+r+s,e)}}beforeAfter(e,t){let n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let r=e.parent,s=0;for(;r&&"root"!==r.type;)s+=1,r=r.parent;if(n.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;e++)n+=t}return n}block(e,t){let n,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let n=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let s=e.nodes[r],o=this.raw(s,"before");o&&this.builder(o),this.stringify(s,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(e,t,n){let r;if(n||(n=t),t&&(r=e.raws[t],void 0!==r))return r;let s=e.parent;if("before"===n){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return R[n];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);{let s="raw"+((i=n)[0].toUpperCase()+i.slice(1));this[s]?r=this[s](o,e):o.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var i;return void 0===r&&(r=R[n]),o.rawCache[n]=r,r}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let n;return e.walkComments(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(e,t){let n;return e.walkDecls(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return t=n.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))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&&void 0!==n.raws.before){let e=n.raws.before.split("\n");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&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))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 new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var N=x;x.default=x;let L=N;function M(e,t){new L(t).stringify(e)}var P=M;M.default=M;let{isClean:D,my:F}=O,B=k,U=N,j=P;function Z(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if("proxyCache"===r)continue;let s=e[r],o=typeof s;"parent"===r&&"object"===o?t&&(n[r]=t):"source"===r?n[r]=s:Array.isArray(s)?n[r]=s.map(e=>Z(e,n)):("object"===o&&null!==s&&(s=Z(s)),n[r]=s)}return n}let z=class{constructor(e={}){this.raws={},this[D]=!1,this[F]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let n of e[t])"function"==typeof n.clone?this.append(n.clone()):this.append(n)}else this[t]=e[t]}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=Z(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}error(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 B(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[D]){this[D]=!1;let e=this;for(;e=e.parent;)e[D]=!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){let r=(t=this.toString()).indexOf(e.word);-1!==r&&(n=this.positionInside(r,t))}return n}positionInside(e,t){let n=t||this.toString(),r=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===n[t]?(r=1,s+=1):r+=1;return{column:r,line:s}}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(),s=r.indexOf(e.word);-1!==s&&(t=this.positionInside(s,r),n=this.positionInside(s+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}:"number"==typeof e.endIndex?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 U).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&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let n={},r=null==t;t=t||new Map;let s=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let r=this[e];if(Array.isArray(r))n[e]=r.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof r&&r.toJSON)n[e]=r.toJSON(null,t);else if("source"===e){let o=t.get(r.input);null==o&&(o=s,t.set(r.input,s),s++),n[e]={end:r.end,inputId:o,start:r.start}}else n[e]=r}return r&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=j){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}};var V=z;z.default=z;let H=V,G=class extends H{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var W=G;G.default=G;var Y={nanoid:(e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:K,SourceMapGenerator:$}=I,{existsSync:J,readFileSync:X}=I,{dirname:q,join:Q}=I;let ee=class{constructor(e,t){if(!1===t.map)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=q(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new K(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!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=q(e),J(e))return this.mapFile=e,X(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof K)return $.fromSourceMap(t).toString();if(t instanceof $)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let n=t(e);if(n){let e=this.loadFile(n);if(!e)throw new Error("Unable to load previous source map: "+n.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=Q(q(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var te=ee;ee.default=ee;let{SourceMapConsumer:ne,SourceMapGenerator:re}=I,{fileURLToPath:se,pathToFileURL:oe}=I,{isAbsolute:ie,resolve:ae}=I,{nanoid:ce}=Y,le=I,ue=k,he=te,de=Symbol("fromOffsetCache"),pe=Boolean(ne&&re),fe=Boolean(ae&&ie),ge=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!fe||/^\w+:\/\//.test(t.from)||ie(t.from)?this.file=t.from:this.file=ae(t.from)),fe&&pe){let e=new he(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 "+ce(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,r={}){let s,o,i;if(t&&"object"==typeof t){let e=t,r=n;if("number"==typeof e.offset){let r=this.fromOffset(e.offset);t=r.line,n=r.col}else t=e.line,n=e.column;if("number"==typeof r.offset){let e=this.fromOffset(r.offset);o=e.line,i=e.col}else o=r.line,i=r.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let a=this.origin(t,n,o,i);return s=a?new ue(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,r.plugin):new ue(e,void 0===o?t:{column:n,line:t},void 0===o?n:{column:i,line:o},this.css,this.file,r.plugin),s.input={column:n,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(oe&&(s.input.url=oe(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,n;if(this[de])n=this[de];else{let e=this.css.split("\n");n=new Array(e.length);let t=0;for(let r=0,s=e.length;r<s;r++)n[r]=t,t+=e[r].length+1;this[de]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t,s=n.length-2;for(;r<s;)if(t=r+(s-r>>1),e<n[t])s=t-1;else{if(!(e>=n[t+1])){r=t;break}r=t+1}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:ae(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,r){if(!this.map)return!1;let s,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof n&&(s=i.originalPositionFor({column:r,line:n})),o=ie(a.source)?oe(a.source):new URL(a.source,this.map.consumer().sourceRoot||oe(this.map.mapFile));let c={column:a.column,endColumn:s&&s.column,endLine:s&&s.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!se)throw new Error("file: protocol is not available in this PostCSS build");c.file=se(o)}let l=i.sourceContentFor(a.source);return l&&(c.source=l),c}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(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}};var me=ge;ge.default=ge,le&&le.registerInput&&le.registerInput(ge);let{SourceMapConsumer:ye,SourceMapGenerator:ve}=I,{dirname:be,relative:we,resolve:Ce,sep:Se}=I,{pathToFileURL:_e}=I,Ie=me,Ee=Boolean(ye&&ve),Te=Boolean(be&&Ce&&we&&Se);var Ae=class{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()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,n=this.toUrl(this.path(e.file)),r=e.root||be(e.file);!1===this.mapOpts.sourcesContent?(t=new ye(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Te&&Ee&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=ve.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new ve({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 ve({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,n=1,r=1,s="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,c)=>{if(this.css+=i,a&&"end"!==c&&(o.generated.line=n,o.generated.column=r-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=i.match(/\n/g),e?(n+=e.length,t=i.lastIndexOf("\n"),r=i.length-t):r+=i.length,a&&"start"!==c){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=n,o.generated.column=r-2,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=r-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}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)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let n=this.opts.to?be(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=be(Ce(n,this.mapOpts.annotation)));let r=we(n,e);return this.memoizedPaths.set(e,r),r}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 Ie(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(_e){let t=_e(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===Se&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}};let ke=V,Oe=class extends ke{constructor(e){super(e),this.type="comment"}};var Re=Oe;Oe.default=Oe;let xe,Ne,Le,Me,{isClean:Pe,my:De}=O,Fe=W,Be=Re,Ue=V;function je(e){return e.map(e=>(e.nodes&&(e.nodes=je(e.nodes)),delete e.source,e))}function Ze(e){if(e[Pe]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Ze(t)}let ze=class e extends Ue{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,n,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],n=e(this.proxyOf.nodes[t],t),!1!==n);)this.indexes[r]+=1;return delete this.indexes[r],n}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...n)=>e[t](...n.map(e=>"function"==typeof e?(t,n)=>e(t.toProxy(),n):e)):"every"===t||"some"===t?n=>e[t]((e,...t)=>n(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n,r=this.index(e),s=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let e of s)this.proxyOf.nodes.splice(r+1,0,e);for(let e in this.indexes)n=this.indexes[e],r<n&&(this.indexes[e]=n+s.length);return this.markDirty(),this}insertBefore(e,t){let n,r=this.index(e),s=0===r&&"prepend",o=this.normalize(t,this.proxyOf.nodes[r],s).reverse();r=this.index(e);for(let e of o)this.proxyOf.nodes.splice(r,0,e);for(let e in this.indexes)n=this.indexes[e],r<=n&&(this.indexes[e]=n+o.length);return this.markDirty(),this}normalize(t,n){if("string"==typeof t)t=je(xe(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new Fe(t)]}else if(t.selector)t=[new Ne(t)];else if(t.name)t=[new Le(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Be(t)]}return t.map(t=>(t[De]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Pe]&&Ze(t),void 0===t.raws.before&&n&&void 0!==n.raws.before&&(t.raws.before=n.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}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){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(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!1!==r&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("atrule"===n.type&&e.test(n.name))return t(n,r)}):this.walk((n,r)=>{if("atrule"===n.type&&n.name===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("atrule"===e.type)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if("comment"===t.type)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("decl"===n.type&&e.test(n.prop))return t(n,r)}):this.walk((n,r)=>{if("decl"===n.type&&n.prop===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("decl"===e.type)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("rule"===n.type&&e.test(n.selector))return t(n,r)}):this.walk((n,r)=>{if("rule"===n.type&&n.selector===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("rule"===e.type)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]}};ze.registerParse=e=>{xe=e},ze.registerRule=e=>{Ne=e},ze.registerAtRule=e=>{Le=e},ze.registerRoot=e=>{Me=e};var Ve=ze;ze.default=ze,ze.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Le.prototype):"rule"===e.type?Object.setPrototypeOf(e,Ne.prototype):"decl"===e.type?Object.setPrototypeOf(e,Fe.prototype):"comment"===e.type?Object.setPrototypeOf(e,Be.prototype):"root"===e.type&&Object.setPrototypeOf(e,Me.prototype),e[De]=!0,e.nodes&&e.nodes.forEach(e=>{ze.rebuild(e)})};let He,Ge,We=Ve,Ye=class extends We{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new He(new Ge,this,e).stringify()}};Ye.registerLazyResult=e=>{He=e},Ye.registerProcessor=e=>{Ge=e};var Ke=Ye;Ye.default=Ye;let $e={};var Je=function(e){$e[e]||($e[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Xe=class{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}};var qe=Xe;Xe.default=Xe;let Qe=qe,et=class{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(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let n=new Qe(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var tt=et;et.default=et;const nt="'".charCodeAt(0),rt='"'.charCodeAt(0),st="\\".charCodeAt(0),ot="/".charCodeAt(0),it="\n".charCodeAt(0),at=" ".charCodeAt(0),ct="\f".charCodeAt(0),lt="\t".charCodeAt(0),ut="\r".charCodeAt(0),ht="[".charCodeAt(0),dt="]".charCodeAt(0),pt="(".charCodeAt(0),ft=")".charCodeAt(0),gt="{".charCodeAt(0),mt="}".charCodeAt(0),yt=";".charCodeAt(0),vt="*".charCodeAt(0),bt=":".charCodeAt(0),wt="@".charCodeAt(0),Ct=/[\t\n\f\r "#'()/;[\\\]{}]/g,St=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,_t=/.[\r\n"'(/\\]/,It=/[\da-f]/i;let Et=Ve,Tt=class extends Et{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)}};var At=Tt;Tt.default=Tt,Et.registerAtRule(Tt);let kt,Ot,Rt=Ve,xt=class extends Rt{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,n){let r=super.normalize(e);if(t)if("prepend"===n)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&&0===n&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new kt(new Ot,this,e).stringify()}};xt.registerLazyResult=e=>{kt=e},xt.registerProcessor=e=>{Ot=e};var Nt=xt;xt.default=xt,Rt.registerRoot(xt);let Lt={comma:e=>Lt.split(e,[","],!0),space:e=>Lt.split(e,[" ","\n","\t"]),split(e,t,n){let r=[],s="",o=!1,i=0,a=!1,c="",l=!1;for(let n of e)l?l=!1:"\\"===n?l=!0:a?n===c&&(a=!1):'"'===n||"'"===n?(a=!0,c=n):"("===n?i+=1:")"===n?i>0&&(i-=1):0===i&&t.includes(n)&&(o=!0),o?(""!==s&&r.push(s.trim()),s="",o=!1):s+=n;return(n||""!==s)&&r.push(s.trim()),r}};var Mt=Lt;Lt.default=Lt;let Pt=Ve,Dt=Mt,Ft=class extends Pt{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Dt.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)}};var Bt=Ft;Ft.default=Ft,Pt.registerRule(Ft);let Ut=W,jt=function(e,t={}){let n,r,s,o,i,a,c,l,u,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,g=0,m=[],y=[];function v(t){throw e.error("Unclosed "+t,g)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&g>=f},nextToken:function(e){if(y.length)return y.pop();if(g>=f)return;let t=!!e&&e.ignoreUnclosed;switch(n=d.charCodeAt(g),n){case it:case at:case lt:case ut:case ct:r=g;do{r+=1,n=d.charCodeAt(r)}while(n===at||n===it||n===lt||n===ut||n===ct);h=["space",d.slice(g,r)],g=r-1;break;case ht:case dt:case gt:case mt:case bt:case yt:case ft:{let e=String.fromCharCode(n);h=[e,e,g];break}case pt:if(l=m.length?m.pop()[1]:"",u=d.charCodeAt(g+1),"url"===l&&u!==nt&&u!==rt&&u!==at&&u!==it&&u!==lt&&u!==ct&&u!==ut){r=g;do{if(a=!1,r=d.indexOf(")",r+1),-1===r){if(p||t){r=g;break}v("bracket")}for(c=r;d.charCodeAt(c-1)===st;)c-=1,a=!a}while(a);h=["brackets",d.slice(g,r+1),g,r],g=r}else r=d.indexOf(")",g+1),o=d.slice(g,r+1),-1===r||_t.test(o)?h=["(","(",g]:(h=["brackets",o,g,r],g=r);break;case nt:case rt:s=n===nt?"'":'"',r=g;do{if(a=!1,r=d.indexOf(s,r+1),-1===r){if(p||t){r=g+1;break}v("string")}for(c=r;d.charCodeAt(c-1)===st;)c-=1,a=!a}while(a);h=["string",d.slice(g,r+1),g,r],g=r;break;case wt:Ct.lastIndex=g+1,Ct.test(d),r=0===Ct.lastIndex?d.length-1:Ct.lastIndex-2,h=["at-word",d.slice(g,r+1),g,r],g=r;break;case st:for(r=g,i=!0;d.charCodeAt(r+1)===st;)r+=1,i=!i;if(n=d.charCodeAt(r+1),i&&n!==ot&&n!==at&&n!==it&&n!==lt&&n!==ut&&n!==ct&&(r+=1,It.test(d.charAt(r)))){for(;It.test(d.charAt(r+1));)r+=1;d.charCodeAt(r+1)===at&&(r+=1)}h=["word",d.slice(g,r+1),g,r],g=r;break;default:n===ot&&d.charCodeAt(g+1)===vt?(r=d.indexOf("*/",g+2)+1,0===r&&(p||t?r=d.length:v("comment")),h=["comment",d.slice(g,r+1),g,r],g=r):(St.lastIndex=g+1,St.test(d),r=0===St.lastIndex?d.length-1:St.lastIndex-2,h=["word",d.slice(g,r+1),g,r],m.push(h),g=r)}return g++,h},position:function(){return g}}},Zt=Re,zt=At,Vt=Nt,Ht=Bt;const Gt={empty:!0,space:!0};var Wt=class{constructor(e){this.input=e,this.root=new Vt,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,n,r,s=new zt;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,e[2]);let o=!1,i=!1,a=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(r=a.length-1,n=a[r];n&&"space"===n[0];)n=a[--r];n&&(s.source.end=this.getPosition(n[3]||n[2]),s.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),o&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),i&&(s.nodes=[],this.current=s)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let n,r=0;for(let s=t-1;s>=0&&(n=e[s],"space"===n[0]||(r+=1,2!==r));s--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}colon(e){let t,n,r,s=0;for(let[o,i]of e.entries()){if(t=i,n=t[0],"("===n&&(s+=1),")"===n&&(s-=1),0===s&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return o}this.doubleColon(t)}r=t}return!1}comment(e){let t=new Zt;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=jt(this.input)}decl(e,t){let n=new Ut;this.init(n,e[0][2]);let r,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(s[3]||s[2]||function(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(r=e[t],"!important"===r[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(n.raws.important=r);break}if("important"===r[1].toLowerCase()){let r=e.slice(0),s="";for(let e=t;e>0;e--){let t=r[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=r.pop()[1]+s}0===s.trim().indexOf("!")&&(n.important=!0,n.raws.important=s,e=r)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(n,"value",i.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Ht;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&&"rule"===e.type&&!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="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,n=null,r=!1,s=null,o=[],i=e[1].startsWith("--"),a=[],c=e;for(;c;){if(n=c[0],a.push(c),"("===n||"["===n)s||(s=c),o.push("("===n?")":"]");else if(i&&r&&"{"===n)s||(s=c),o.push("}");else if(0===o.length){if(";"===n){if(r)return void this.decl(a,i);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(r=!0)}else n===o[o.length-1]&&(o.pop(),0===o.length&&(s=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(s),t&&r){if(!i)for(;a.length&&(c=a[a.length-1][0],"space"===c||"comment"===c);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}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)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,r){let s,o,i,a,c=n.length,l="",u=!0;for(let e=0;e<c;e+=1)s=n[e],o=s[0],"space"!==o||e!==c-1||r?"comment"===o?(a=n[e-1]?n[e-1][0]:"empty",i=n[e+1]?n[e+1][0]:"empty",Gt[a]||Gt[i]||","===l.slice(-1)?u=!1:l+=s[1]):l+=s[1]:u=!1;if(!u){let r=n.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:r,value:l}}e[t]=l}rule(e){e.pop();let t=new Ht;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],"space"===t||"comment"===t);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)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})}};let Yt=Ve,Kt=Wt,$t=me;function Jt(e,t){let n=new $t(e,t),r=new Kt(n);try{r.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return r.root}var Xt=Jt;Jt.default=Jt,Yt.registerParse(Jt);let{isClean:qt,my:Qt}=O,en=Ae,tn=P,nn=Ve,rn=Ke,sn=Je,on=tt,an=Xt,cn=Nt;const ln={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},un={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},hn={Once:!0,postcssPlugin:!0,prepare:!0};function dn(e){return"object"==typeof e&&"function"==typeof e.then}function pn(e){let t=!1,n=ln[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(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 fn(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:pn(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function gn(e){return e[qt]=!1,e.nodes&&e.nodes.forEach(e=>gn(e)),e}let mn={},yn=class e{constructor(t,n,r){let s;if(this.stringified=!1,this.processed=!1,"object"!=typeof n||null===n||"root"!==n.type&&"document"!==n.type)if(n instanceof e||n instanceof on)s=gn(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let e=an;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{s=e(n,r)}catch(e){this.processed=!0,this.error=e}s&&!s[Qt]&&nn.rebuild(s)}else s=gn(n);this.result=new on(t,s,r),this.helpers={...mn,postcss:mn,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&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.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let n=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(n.postcssVersion&&"production"!==process.env.NODE_ENV){let e=n.postcssPlugin,t=n.postcssVersion,r=this.result.processor.version,s=t.split("."),o=r.split(".");(s[0]!==o[0]||parseInt(s[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+r+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=n.postcssPlugin,e.setMessage()}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("object"==typeof t)for(let n in t){if(!un[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!hn[n])if("object"==typeof t[n])for(let r in t[n])e(t,"*"===r?n:n+"-"+r.toLowerCase(),t[n][r]);else"function"==typeof t[n]&&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(dn(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[qt];){e[qt]=!0;let t=[fn(e)];for(;t.length>0;){let e=this.visitTick(t);if(dn(e))try{await e}catch(e){let n=t[t.length-1].node;throw this.handleError(e,n)}}}if(this.listeners.OnceExit)for(let[t,n]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>n(e,this.helpers));await Promise.all(t)}else await n(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return dn(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)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=tn;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new en(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[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(dn(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[qt];)e[qt]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||sn("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,r]of e){let e;this.result.lastPlugin=n;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(dn(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:n,visitors:r}=t;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void e.pop();if(r.length>0&&t.visitorIndex<r.length){let[e,s]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){let r,s=t.iterator;for(;r=n.nodes[n.indexes[s]];)if(n.indexes[s]+=1,!r[qt])return r[qt]=!0,void e.push(fn(r));t.iterator=0,delete n.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(n.nodes&&n.nodes.length&&(n[qt]=!0,t.iterator=n.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[qt]=!0;let t=pn(e);for(let n of t)if(0===n)e.nodes&&e.each(e=>{e[qt]||this.walkSync(e)});else{let t=this.listeners[n];if(t&&this.visitSync(t,e.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"}};yn.registerPostcss=e=>{mn=e};var vn=yn;yn.default=yn,cn.registerLazyResult(yn),rn.registerLazyResult(yn);let bn=Ae,wn=P,Cn=Je,Sn=Xt;const _n=tt;let In=class{constructor(e,t,n){let r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let s=wn;this.result=new _n(this._processor,r,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new bn(s,r,this._opts,t);if(i.isMap()){let[e,t]=i.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else i.clearAnnotation(),this.result.css=i.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"production"!==process.env.NODE_ENV&&("from"in this._opts||Cn("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),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=Sn;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"}};var En=In;In.default=In;let Tn=En,An=vn,kn=Ke,On=Nt,Rn=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(!0===n.postcss?n=n():n.postcss&&(n=n.postcss),"object"==typeof n&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if("object"==typeof n&&n.postcssPlugin)t.push(n);else if("function"==typeof n)t.push(n);else{if("object"!=typeof n||!n.parse&&!n.stringify)throw new Error(n+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new An(this,e,t):new Tn(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var xn=Rn;Rn.default=Rn,On.registerProcessor(Rn),kn.registerProcessor(Rn);let Nn=W,Ln=te,Mn=Re,Pn=At,Dn=me,Fn=Nt,Bn=Bt;function Un(e,t){if(Array.isArray(e))return e.map(e=>Un(e));let{inputs:n,...r}=e;if(n){t=[];for(let e of n){let n={...e,__proto__:Dn.prototype};n.map&&(n.map={...n.map,__proto__:Ln.prototype}),t.push(n)}}if(r.nodes&&(r.nodes=e.nodes.map(e=>Un(e,t))),r.source){let{inputId:e,...n}=r.source;r.source=n,null!=e&&(r.source.input=t[e])}if("root"===r.type)return new Fn(r);if("decl"===r.type)return new Nn(r);if("rule"===r.type)return new Bn(r);if("comment"===r.type)return new Mn(r);if("atrule"===r.type)return new Pn(r);throw new Error("Unknown node type: "+e.type)}var jn=Un;Un.default=Un;let Zn=k,zn=W,Vn=vn,Hn=Ve,Gn=xn,Wn=P,Yn=jn,Kn=Ke,$n=qe,Jn=Re,Xn=At,qn=tt,Qn=me,er=Xt,tr=Mt,nr=Bt,rr=Nt,sr=V;function or(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Gn(e)}or.plugin=function(e,t){let n,r=!1;function s(...n){console&&console.warn&&!r&&(r=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let s=t(...n);return s.postcssPlugin=e,s.postcssVersion=(new Gn).version,s}return Object.defineProperty(s,"postcss",{get:()=>(n||(n=s()),n)}),s.process=function(e,t,n){return or([s(n)]).process(e,t)},s},or.stringify=Wn,or.parse=er,or.fromJSON=Yn,or.list=tr,or.comment=e=>new Jn(e),or.atRule=e=>new Xn(e),or.decl=e=>new zn(e),or.rule=e=>new nr(e),or.root=e=>new rr(e),or.document=e=>new Kn(e),or.CssSyntaxError=Zn,or.Declaration=zn,or.Container=Hn,or.Processor=Gn,or.Document=Kn,or.Comment=Jn,or.Warning=$n,or.AtRule=Xn,or.Result=qn,or.Input=Qn,or.Rule=nr,or.Root=rr,or.Node=sr,Vn.registerPostcss(or);var ir=or;or.default=or;const ar=v(ir);ar.stringify,ar.fromJSON,ar.plugin,ar.parse,ar.list,ar.document,ar.comment,ar.atRule,ar.rule,ar.decl,ar.root,ar.CssSyntaxError,ar.Declaration,ar.Container,ar.Processor,ar.Document,ar.Comment,ar.Warning,ar.AtRule,ar.Result,ar.Input,ar.Rule,ar.Root,ar.Node;var cr=Object.defineProperty,lr=(e,t,n)=>((e,t,n)=>t in e?cr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);function ur(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function hr(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){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 dr={exports:{}},pr=String,fr=function(){return{isColorSupported:!1,reset:pr,bold:pr,dim:pr,italic:pr,underline:pr,inverse:pr,hidden:pr,strikethrough:pr,black:pr,red:pr,green:pr,yellow:pr,blue:pr,magenta:pr,cyan:pr,white:pr,gray:pr,bgBlack:pr,bgRed:pr,bgGreen:pr,bgYellow:pr,bgBlue:pr,bgMagenta:pr,bgCyan:pr,bgWhite:pr}};dr.exports=fr(),dr.exports.createColors=fr;var gr=dr.exports;const mr=hr(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let yr=gr,vr=mr,br=class e extends Error{constructor(t,n,r,s,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),s&&(this.source=s),i&&(this.plugin=i),void 0!==n&&void 0!==r&&("number"==typeof n?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=yr.isColorSupported),vr&&e&&(t=vr(t));let n,r,s=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,s.length),a=String(i).length;if(e){let{bold:e,gray:t,red:s}=yr.createColors(!0);n=t=>e(s(t)),r=e=>t(e)}else n=r=e=>e;return s.slice(o,i).map((e,t)=>{let s=o+1+t,i=" "+(" "+s).slice(-a)+" | ";if(s===this.line){let t=r(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+r(i)+e+"\n "+t+n("^")}return" "+r(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var wr=br;br.default=br;var Cr={};Cr.isClean=Symbol("isClean"),Cr.my=Symbol("my");const Sr={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let _r=class{constructor(e){this.builder=e}atrule(e,t){let n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes)this.block(e,n+r);else{let s=(e.raws.between||"")+(t?";":"");this.builder(n+r+s,e)}}beforeAfter(e,t){let n;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let r=e.parent,s=0;for(;r&&"root"!==r.type;)s+=1,r=r.parent;if(n.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<s;e++)n+=t}return n}block(e,t){let n,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let n=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let s=e.nodes[r],o=this.raw(s,"before");o&&this.builder(o),this.stringify(s,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(e,t,n){let r;if(n||(n=t),t&&(r=e.raws[t],void 0!==r))return r;let s=e.parent;if("before"===n){if(!s||"root"===s.type&&s.first===e)return"";if(s&&"document"===s.type)return""}if(!s)return Sr[n];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[n])return o.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);{let s="raw"+((i=n)[0].toUpperCase()+i.slice(1));this[s]?r=this[s](o,e):o.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var i;return void 0===r&&(r=Sr[n]),o.rawCache[n]=r,r}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let n;return e.walkComments(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(e,t){let n;return e.walkDecls(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return t=n.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))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&&void 0!==n.raws.before){let e=n.raws.before.split("\n");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&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))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 new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var Ir=_r;_r.default=_r;let Er=Ir;function Tr(e,t){new Er(t).stringify(e)}var Ar=Tr;Tr.default=Tr;let{isClean:kr,my:Or}=Cr,Rr=wr,xr=Ir,Nr=Ar;function Lr(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if("proxyCache"===r)continue;let s=e[r],o=typeof s;"parent"===r&&"object"===o?t&&(n[r]=t):"source"===r?n[r]=s:Array.isArray(s)?n[r]=s.map(e=>Lr(e,n)):("object"===o&&null!==s&&(s=Lr(s)),n[r]=s)}return n}let Mr=class{constructor(e={}){this.raws={},this[kr]=!1,this[Or]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let n of e[t])"function"==typeof n.clone?this.append(n.clone()):this.append(n)}else this[t]=e[t]}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=Lr(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}error(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 Rr(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[kr]){this[kr]=!1;let e=this;for(;e=e.parent;)e[kr]=!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){let r=(t=this.toString()).indexOf(e.word);-1!==r&&(n=this.positionInside(r,t))}return n}positionInside(e,t){let n=t||this.toString(),r=this.source.start.column,s=this.source.start.line;for(let t=0;t<e;t++)"\n"===n[t]?(r=1,s+=1):r+=1;return{column:r,line:s}}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(),s=r.indexOf(e.word);-1!==s&&(t=this.positionInside(s,r),n=this.positionInside(s+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}:"number"==typeof e.endIndex?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 xr).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&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let n={},r=null==t;t=t||new Map;let s=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let r=this[e];if(Array.isArray(r))n[e]=r.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof r&&r.toJSON)n[e]=r.toJSON(null,t);else if("source"===e){let o=t.get(r.input);null==o&&(o=s,t.set(r.input,s),s++),n[e]={end:r.end,inputId:o,start:r.start}}else n[e]=r}return r&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Nr){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}};var Pr=Mr;Mr.default=Mr;let Dr=Pr,Fr=class extends Dr{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var Br=Fr;Fr.default=Fr;var Ur={nanoid:(e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:jr,SourceMapGenerator:Zr}=mr,{existsSync:zr,readFileSync:Vr}=mr,{dirname:Hr,join:Gr}=mr;let Wr=class{constructor(e,t){if(!1===t.map)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=Hr(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new jr(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!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=Hr(e),zr(e))return this.mapFile=e,Vr(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof jr)return Zr.fromSourceMap(t).toString();if(t instanceof Zr)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let n=t(e);if(n){let e=this.loadFile(n);if(!e)throw new Error("Unable to load previous source map: "+n.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=Gr(Hr(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Yr=Wr;Wr.default=Wr;let{SourceMapConsumer:Kr,SourceMapGenerator:$r}=mr,{fileURLToPath:Jr,pathToFileURL:Xr}=mr,{isAbsolute:qr,resolve:Qr}=mr,{nanoid:es}=Ur,ts=mr,ns=wr,rs=Yr,ss=Symbol("fromOffsetCache"),os=Boolean(Kr&&$r),is=Boolean(Qr&&qr),as=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!is||/^\w+:\/\//.test(t.from)||qr(t.from)?this.file=t.from:this.file=Qr(t.from)),is&&os){let e=new rs(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 "+es(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,r={}){let s,o,i;if(t&&"object"==typeof t){let e=t,r=n;if("number"==typeof e.offset){let r=this.fromOffset(e.offset);t=r.line,n=r.col}else t=e.line,n=e.column;if("number"==typeof r.offset){let e=this.fromOffset(r.offset);o=e.line,i=e.col}else o=r.line,i=r.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let a=this.origin(t,n,o,i);return s=a?new ns(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,r.plugin):new ns(e,void 0===o?t:{column:n,line:t},void 0===o?n:{column:i,line:o},this.css,this.file,r.plugin),s.input={column:n,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(Xr&&(s.input.url=Xr(this.file).toString()),s.input.file=this.file),s}fromOffset(e){let t,n;if(this[ss])n=this[ss];else{let e=this.css.split("\n");n=new Array(e.length);let t=0;for(let r=0,s=e.length;r<s;r++)n[r]=t,t+=e[r].length+1;this[ss]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t,s=n.length-2;for(;r<s;)if(t=r+(s-r>>1),e<n[t])s=t-1;else{if(!(e>=n[t+1])){r=t;break}r=t+1}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Qr(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,r){if(!this.map)return!1;let s,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof n&&(s=i.originalPositionFor({column:r,line:n})),o=qr(a.source)?Xr(a.source):new URL(a.source,this.map.consumer().sourceRoot||Xr(this.map.mapFile));let c={column:a.column,endColumn:s&&s.column,endLine:s&&s.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!Jr)throw new Error("file: protocol is not available in this PostCSS build");c.file=Jr(o)}let l=i.sourceContentFor(a.source);return l&&(c.source=l),c}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(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}};var cs=as;as.default=as,ts&&ts.registerInput&&ts.registerInput(as);let{SourceMapConsumer:ls,SourceMapGenerator:us}=mr,{dirname:hs,relative:ds,resolve:ps,sep:fs}=mr,{pathToFileURL:gs}=mr,ms=cs,ys=Boolean(ls&&us),vs=Boolean(hs&&ps&&ds&&fs);var bs=class{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()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,n=this.toUrl(this.path(e.file)),r=e.root||hs(e.file);!1===this.mapOpts.sourcesContent?(t=new ls(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,n,this.toUrl(this.path(r)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),vs&&ys&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=us.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new us({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 us({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,n=1,r=1,s="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,c)=>{if(this.css+=i,a&&"end"!==c&&(o.generated.line=n,o.generated.column=r-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=i.match(/\n/g),e?(n+=e.length,t=i.lastIndexOf("\n"),r=i.length-t):r+=i.length,a&&"start"!==c){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=n,o.generated.column=r-2,this.map.addMapping(o)):(o.source=s,o.original.line=1,o.original.column=0,o.generated.line=n,o.generated.column=r-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}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)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let n=this.opts.to?hs(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=hs(ps(n,this.mapOpts.annotation)));let r=ds(n,e);return this.memoizedPaths.set(e,r),r}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 ms(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(gs){let t=gs(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===fs&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}};let ws=Pr,Cs=class extends ws{constructor(e){super(e),this.type="comment"}};var Ss=Cs;Cs.default=Cs;let _s,Is,Es,Ts,{isClean:As,my:ks}=Cr,Os=Br,Rs=Ss,xs=Pr;function Ns(e){return e.map(e=>(e.nodes&&(e.nodes=Ns(e.nodes)),delete e.source,e))}function Ls(e){if(e[As]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Ls(t)}let Ms=class e extends xs{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,n,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],n=e(this.proxyOf.nodes[t],t),!1!==n);)this.indexes[r]+=1;return delete this.indexes[r],n}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...n)=>e[t](...n.map(e=>"function"==typeof e?(t,n)=>e(t.toProxy(),n):e)):"every"===t||"some"===t?n=>e[t]((e,...t)=>n(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n,r=this.index(e),s=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let e of s)this.proxyOf.nodes.splice(r+1,0,e);for(let e in this.indexes)n=this.indexes[e],r<n&&(this.indexes[e]=n+s.length);return this.markDirty(),this}insertBefore(e,t){let n,r=this.index(e),s=0===r&&"prepend",o=this.normalize(t,this.proxyOf.nodes[r],s).reverse();r=this.index(e);for(let e of o)this.proxyOf.nodes.splice(r,0,e);for(let e in this.indexes)n=this.indexes[e],r<=n&&(this.indexes[e]=n+o.length);return this.markDirty(),this}normalize(t,n){if("string"==typeof t)t=Ns(_s(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new Os(t)]}else if(t.selector)t=[new Is(t)];else if(t.name)t=[new Es(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Rs(t)]}return t.map(t=>(t[ks]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[As]&&Ls(t),void 0===t.raws.before&&n&&void 0!==n.raws.before&&(t.raws.before=n.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}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){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(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!1!==r&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("atrule"===n.type&&e.test(n.name))return t(n,r)}):this.walk((n,r)=>{if("atrule"===n.type&&n.name===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("atrule"===e.type)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if("comment"===t.type)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("decl"===n.type&&e.test(n.prop))return t(n,r)}):this.walk((n,r)=>{if("decl"===n.type&&n.prop===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("decl"===e.type)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("rule"===n.type&&e.test(n.selector))return t(n,r)}):this.walk((n,r)=>{if("rule"===n.type&&n.selector===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("rule"===e.type)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]}};Ms.registerParse=e=>{_s=e},Ms.registerRule=e=>{Is=e},Ms.registerAtRule=e=>{Es=e},Ms.registerRoot=e=>{Ts=e};var Ps=Ms;Ms.default=Ms,Ms.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Es.prototype):"rule"===e.type?Object.setPrototypeOf(e,Is.prototype):"decl"===e.type?Object.setPrototypeOf(e,Os.prototype):"comment"===e.type?Object.setPrototypeOf(e,Rs.prototype):"root"===e.type&&Object.setPrototypeOf(e,Ts.prototype),e[ks]=!0,e.nodes&&e.nodes.forEach(e=>{Ms.rebuild(e)})};let Ds,Fs,Bs=Ps,Us=class extends Bs{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Ds(new Fs,this,e).stringify()}};Us.registerLazyResult=e=>{Ds=e},Us.registerProcessor=e=>{Fs=e};var js=Us;Us.default=Us;let Zs={};var zs=function(e){Zs[e]||(Zs[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Vs=class{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}};var Hs=Vs;Vs.default=Vs;let Gs=Hs,Ws=class{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(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let n=new Gs(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Ys=Ws;Ws.default=Ws;const Ks="'".charCodeAt(0),$s='"'.charCodeAt(0),Js="\\".charCodeAt(0),Xs="/".charCodeAt(0),qs="\n".charCodeAt(0),Qs=" ".charCodeAt(0),eo="\f".charCodeAt(0),to="\t".charCodeAt(0),no="\r".charCodeAt(0),ro="[".charCodeAt(0),so="]".charCodeAt(0),oo="(".charCodeAt(0),io=")".charCodeAt(0),ao="{".charCodeAt(0),co="}".charCodeAt(0),lo=";".charCodeAt(0),uo="*".charCodeAt(0),ho=":".charCodeAt(0),po="@".charCodeAt(0),fo=/[\t\n\f\r "#'()/;[\\\]{}]/g,go=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,mo=/.[\r\n"'(/\\]/,yo=/[\da-f]/i;let vo=Ps,bo=class extends vo{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)}};var wo=bo;bo.default=bo,vo.registerAtRule(bo);let Co,So,_o=Ps,Io=class extends _o{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,n){let r=super.normalize(e);if(t)if("prepend"===n)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&&0===n&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new Co(new So,this,e).stringify()}};Io.registerLazyResult=e=>{Co=e},Io.registerProcessor=e=>{So=e};var Eo=Io;Io.default=Io,_o.registerRoot(Io);let To={comma:e=>To.split(e,[","],!0),space:e=>To.split(e,[" ","\n","\t"]),split(e,t,n){let r=[],s="",o=!1,i=0,a=!1,c="",l=!1;for(let n of e)l?l=!1:"\\"===n?l=!0:a?n===c&&(a=!1):'"'===n||"'"===n?(a=!0,c=n):"("===n?i+=1:")"===n?i>0&&(i-=1):0===i&&t.includes(n)&&(o=!0),o?(""!==s&&r.push(s.trim()),s="",o=!1):s+=n;return(n||""!==s)&&r.push(s.trim()),r}};var Ao=To;To.default=To;let ko=Ps,Oo=Ao,Ro=class extends ko{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Oo.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)}};var xo=Ro;Ro.default=Ro,ko.registerRule(Ro);let No=Br,Lo=function(e,t={}){let n,r,s,o,i,a,c,l,u,h,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,g=0,m=[],y=[];function v(t){throw e.error("Unclosed "+t,g)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&g>=f},nextToken:function(e){if(y.length)return y.pop();if(g>=f)return;let t=!!e&&e.ignoreUnclosed;switch(n=d.charCodeAt(g),n){case qs:case Qs:case to:case no:case eo:r=g;do{r+=1,n=d.charCodeAt(r)}while(n===Qs||n===qs||n===to||n===no||n===eo);h=["space",d.slice(g,r)],g=r-1;break;case ro:case so:case ao:case co:case ho:case lo:case io:{let e=String.fromCharCode(n);h=[e,e,g];break}case oo:if(l=m.length?m.pop()[1]:"",u=d.charCodeAt(g+1),"url"===l&&u!==Ks&&u!==$s&&u!==Qs&&u!==qs&&u!==to&&u!==eo&&u!==no){r=g;do{if(a=!1,r=d.indexOf(")",r+1),-1===r){if(p||t){r=g;break}v("bracket")}for(c=r;d.charCodeAt(c-1)===Js;)c-=1,a=!a}while(a);h=["brackets",d.slice(g,r+1),g,r],g=r}else r=d.indexOf(")",g+1),o=d.slice(g,r+1),-1===r||mo.test(o)?h=["(","(",g]:(h=["brackets",o,g,r],g=r);break;case Ks:case $s:s=n===Ks?"'":'"',r=g;do{if(a=!1,r=d.indexOf(s,r+1),-1===r){if(p||t){r=g+1;break}v("string")}for(c=r;d.charCodeAt(c-1)===Js;)c-=1,a=!a}while(a);h=["string",d.slice(g,r+1),g,r],g=r;break;case po:fo.lastIndex=g+1,fo.test(d),r=0===fo.lastIndex?d.length-1:fo.lastIndex-2,h=["at-word",d.slice(g,r+1),g,r],g=r;break;case Js:for(r=g,i=!0;d.charCodeAt(r+1)===Js;)r+=1,i=!i;if(n=d.charCodeAt(r+1),i&&n!==Xs&&n!==Qs&&n!==qs&&n!==to&&n!==no&&n!==eo&&(r+=1,yo.test(d.charAt(r)))){for(;yo.test(d.charAt(r+1));)r+=1;d.charCodeAt(r+1)===Qs&&(r+=1)}h=["word",d.slice(g,r+1),g,r],g=r;break;default:n===Xs&&d.charCodeAt(g+1)===uo?(r=d.indexOf("*/",g+2)+1,0===r&&(p||t?r=d.length:v("comment")),h=["comment",d.slice(g,r+1),g,r],g=r):(go.lastIndex=g+1,go.test(d),r=0===go.lastIndex?d.length-1:go.lastIndex-2,h=["word",d.slice(g,r+1),g,r],m.push(h),g=r)}return g++,h},position:function(){return g}}},Mo=Ss,Po=wo,Do=Eo,Fo=xo;const Bo={empty:!0,space:!0};var Uo=class{constructor(e){this.input=e,this.root=new Do,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,n,r,s=new Po;s.name=e[1].slice(1),""===s.name&&this.unnamedAtrule(s,e),this.init(s,e[2]);let o=!1,i=!1,a=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){s.source.end=this.getPosition(e[2]),s.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(r=a.length-1,n=a[r];n&&"space"===n[0];)n=a[--r];n&&(s.source.end=this.getPosition(n[3]||n[2]),s.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}s.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(s.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(s,"params",a),o&&(e=a[a.length-1],s.source.end=this.getPosition(e[3]||e[2]),s.source.end.offset++,this.spaces=s.raws.between,s.raws.between="")):(s.raws.afterName="",s.params=""),i&&(s.nodes=[],this.current=s)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let n,r=0;for(let s=t-1;s>=0&&(n=e[s],"space"===n[0]||(r+=1,2!==r));s--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}colon(e){let t,n,r,s=0;for(let[o,i]of e.entries()){if(t=i,n=t[0],"("===n&&(s+=1),")"===n&&(s-=1),0===s&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return o}this.doubleColon(t)}r=t}return!1}comment(e){let t=new Mo;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=Lo(this.input)}decl(e,t){let n=new No;this.init(n,e[0][2]);let r,s=e[e.length-1];for(";"===s[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(s[3]||s[2]||function(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(r=e[t],"!important"===r[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(n.raws.important=r);break}if("important"===r[1].toLowerCase()){let r=e.slice(0),s="";for(let e=t;e>0;e--){let t=r[e][0];if(0===s.trim().indexOf("!")&&"space"!==t)break;s=r.pop()[1]+s}0===s.trim().indexOf("!")&&(n.important=!0,n.raws.important=s,e=r)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(n,"value",i.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Fo;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&&"rule"===e.type&&!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="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,n=null,r=!1,s=null,o=[],i=e[1].startsWith("--"),a=[],c=e;for(;c;){if(n=c[0],a.push(c),"("===n||"["===n)s||(s=c),o.push("("===n?")":"]");else if(i&&r&&"{"===n)s||(s=c),o.push("}");else if(0===o.length){if(";"===n){if(r)return void this.decl(a,i);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(r=!0)}else n===o[o.length-1]&&(o.pop(),0===o.length&&(s=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(s),t&&r){if(!i)for(;a.length&&(c=a[a.length-1][0],"space"===c||"comment"===c);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}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)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,r){let s,o,i,a,c=n.length,l="",u=!0;for(let e=0;e<c;e+=1)s=n[e],o=s[0],"space"!==o||e!==c-1||r?"comment"===o?(a=n[e-1]?n[e-1][0]:"empty",i=n[e+1]?n[e+1][0]:"empty",Bo[a]||Bo[i]||","===l.slice(-1)?u=!1:l+=s[1]):l+=s[1]:u=!1;if(!u){let r=n.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:r,value:l}}e[t]=l}rule(e){e.pop();let t=new Fo;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],"space"===t||"comment"===t);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)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})}};let jo=Ps,Zo=Uo,zo=cs;function Vo(e,t){let n=new zo(e,t),r=new Zo(n);try{r.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return r.root}var Ho=Vo;Vo.default=Vo,jo.registerParse(Vo);let{isClean:Go,my:Wo}=Cr,Yo=bs,Ko=Ar,$o=Ps,Jo=js,Xo=zs,qo=Ys,Qo=Ho,ei=Eo;const ti={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},ni={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},ri={Once:!0,postcssPlugin:!0,prepare:!0};function si(e){return"object"==typeof e&&"function"==typeof e.then}function oi(e){let t=!1,n=ti[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(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 ii(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:oi(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function ai(e){return e[Go]=!1,e.nodes&&e.nodes.forEach(e=>ai(e)),e}let ci={},li=class e{constructor(t,n,r){let s;if(this.stringified=!1,this.processed=!1,"object"!=typeof n||null===n||"root"!==n.type&&"document"!==n.type)if(n instanceof e||n instanceof qo)s=ai(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let e=Qo;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{s=e(n,r)}catch(e){this.processed=!0,this.error=e}s&&!s[Wo]&&$o.rebuild(s)}else s=ai(n);this.result=new qo(t,s,r),this.helpers={...ci,postcss:ci,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&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.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let n=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(n.postcssVersion&&"production"!==process.env.NODE_ENV){let e=n.postcssPlugin,t=n.postcssVersion,r=this.result.processor.version,s=t.split("."),o=r.split(".");(s[0]!==o[0]||parseInt(s[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+r+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=n.postcssPlugin,e.setMessage()}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("object"==typeof t)for(let n in t){if(!ni[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!ri[n])if("object"==typeof t[n])for(let r in t[n])e(t,"*"===r?n:n+"-"+r.toLowerCase(),t[n][r]);else"function"==typeof t[n]&&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(si(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Go];){e[Go]=!0;let t=[ii(e)];for(;t.length>0;){let e=this.visitTick(t);if(si(e))try{await e}catch(e){let n=t[t.length-1].node;throw this.handleError(e,n)}}}if(this.listeners.OnceExit)for(let[t,n]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>n(e,this.helpers));await Promise.all(t)}else await n(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return si(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)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=Ko;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new Yo(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[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(si(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Go];)e[Go]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||Xo("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,r]of e){let e;this.result.lastPlugin=n;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(si(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:n,visitors:r}=t;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void e.pop();if(r.length>0&&t.visitorIndex<r.length){let[e,s]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return s(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){let r,s=t.iterator;for(;r=n.nodes[n.indexes[s]];)if(n.indexes[s]+=1,!r[Go])return r[Go]=!0,void e.push(ii(r));t.iterator=0,delete n.indexes[s]}let s=t.events;for(;t.eventIndex<s.length;){let e=s[t.eventIndex];if(t.eventIndex+=1,0===e)return void(n.nodes&&n.nodes.length&&(n[Go]=!0,t.iterator=n.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Go]=!0;let t=oi(e);for(let n of t)if(0===n)e.nodes&&e.each(e=>{e[Go]||this.walkSync(e)});else{let t=this.listeners[n];if(t&&this.visitSync(t,e.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"}};li.registerPostcss=e=>{ci=e};var ui=li;li.default=li,ei.registerLazyResult(li),Jo.registerLazyResult(li);let hi=bs,di=Ar,pi=zs,fi=Ho;const gi=Ys;let mi=class{constructor(e,t,n){let r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let s=di;this.result=new gi(this._processor,r,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new hi(s,r,this._opts,t);if(i.isMap()){let[e,t]=i.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else i.clearAnnotation(),this.result.css=i.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"production"!==process.env.NODE_ENV&&("from"in this._opts||pi("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),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=fi;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"}};var yi=mi;mi.default=mi;let vi=yi,bi=ui,wi=js,Ci=Eo,Si=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(!0===n.postcss?n=n():n.postcss&&(n=n.postcss),"object"==typeof n&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if("object"==typeof n&&n.postcssPlugin)t.push(n);else if("function"==typeof n)t.push(n);else{if("object"!=typeof n||!n.parse&&!n.stringify)throw new Error(n+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new bi(this,e,t):new vi(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var _i=Si;Si.default=Si,Ci.registerProcessor(Si),wi.registerProcessor(Si);let Ii=Br,Ei=Yr,Ti=Ss,Ai=wo,ki=cs,Oi=Eo,Ri=xo;function xi(e,t){if(Array.isArray(e))return e.map(e=>xi(e));let{inputs:n,...r}=e;if(n){t=[];for(let e of n){let n={...e,__proto__:ki.prototype};n.map&&(n.map={...n.map,__proto__:Ei.prototype}),t.push(n)}}if(r.nodes&&(r.nodes=e.nodes.map(e=>xi(e,t))),r.source){let{inputId:e,...n}=r.source;r.source=n,null!=e&&(r.source.input=t[e])}if("root"===r.type)return new Oi(r);if("decl"===r.type)return new Ii(r);if("rule"===r.type)return new Ri(r);if("comment"===r.type)return new Ti(r);if("atrule"===r.type)return new Ai(r);throw new Error("Unknown node type: "+e.type)}var Ni=xi;xi.default=xi;let Li=wr,Mi=Br,Pi=ui,Di=Ps,Fi=_i,Bi=Ar,Ui=Ni,ji=js,Zi=Hs,zi=Ss,Vi=wo,Hi=Ys,Gi=cs,Wi=Ho,Yi=Ao,Ki=xo,$i=Eo,Ji=Pr;function Xi(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Fi(e)}Xi.plugin=function(e,t){let n,r=!1;function s(...n){console&&console.warn&&!r&&(r=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let s=t(...n);return s.postcssPlugin=e,s.postcssVersion=(new Fi).version,s}return Object.defineProperty(s,"postcss",{get:()=>(n||(n=s()),n)}),s.process=function(e,t,n){return Xi([s(n)]).process(e,t)},s},Xi.stringify=Bi,Xi.parse=Wi,Xi.fromJSON=Ui,Xi.list=Yi,Xi.comment=e=>new zi(e),Xi.atRule=e=>new Vi(e),Xi.decl=e=>new Mi(e),Xi.rule=e=>new Ki(e),Xi.root=e=>new $i(e),Xi.document=e=>new ji(e),Xi.CssSyntaxError=Li,Xi.Declaration=Mi,Xi.Container=Di,Xi.Processor=Fi,Xi.Document=ji,Xi.Comment=zi,Xi.Warning=Zi,Xi.AtRule=Vi,Xi.Result=Hi,Xi.Input=Gi,Xi.Rule=Ki,Xi.Root=$i,Xi.Node=Ji,Pi.registerPostcss(Xi);var qi=Xi;Xi.default=Xi;const Qi=ur(qi);Qi.stringify,Qi.fromJSON,Qi.plugin,Qi.parse,Qi.list,Qi.document,Qi.comment,Qi.atRule,Qi.rule,Qi.decl,Qi.root,Qi.CssSyntaxError,Qi.Declaration,Qi.Container,Qi.Processor,Qi.Document,Qi.Comment,Qi.Warning,Qi.AtRule,Qi.Result,Qi.Input,Qi.Rule,Qi.Root,Qi.Node;class ea{constructor(...e){lr(this,"parentElement",null),lr(this,"parentNode",null),lr(this,"ownerDocument"),lr(this,"firstChild",null),lr(this,"lastChild",null),lr(this,"previousSibling",null),lr(this,"nextSibling",null),lr(this,"ELEMENT_NODE",1),lr(this,"TEXT_NODE",3),lr(this,"nodeType"),lr(this,"nodeName"),lr(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof ea))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const ta={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},na={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ra={};function sa(e){if(ra[e])return ra[e];const t=globalThis[e],n=t.prototype,r=e in ta?ta[e]:void 0,s=Boolean(r&&r.every(e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))})),o=e in na?na[e]:void 0,i=Boolean(o&&o.every(e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))}));if(s&&i&&!globalThis.Zone)return ra[e]=t.prototype,t.prototype;try{const r=document.createElement("iframe");document.body.appendChild(r);const s=r.contentWindow;if(!s)return t.prototype;const o=s[e].prototype;return document.body.removeChild(r),o?ra[e]=o:n}catch{return n}}const oa={};function ia(e,t,n){var r;const s=`${e}.${String(n)}`;if(oa[s])return oa[s].call(t);const o=sa(e),i=null==(r=Object.getOwnPropertyDescriptor(o,n))?void 0:r.get;return i?(oa[s]=i,i.call(t)):t[n]}const aa={};function ca(e,t,n){const r=`${e}.${String(n)}`;if(aa[r])return aa[r].bind(t);const s=sa(e)[n];return"function"!=typeof s?t[n]:(aa[r]=s,s.bind(t))}const la={childNodes:function(e){return ia("Node",e,"childNodes")},parentNode:function(e){return ia("Node",e,"parentNode")},parentElement:function(e){return ia("Node",e,"parentElement")},textContent:function(e){return ia("Node",e,"textContent")},contains:function(e,t){return ca("Node",e,"contains")(t)},getRootNode:function(e){return ca("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ia("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ia("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ia("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ia("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return sa("MutationObserver").constructor}};const ua="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let ha={map:{},getId:()=>(console.error(ua),-1),getNode:()=>(console.error(ua),null),removeNodeFromMap(){console.error(ua)},has:()=>(console.error(ua),!1),reset(){console.error(ua)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(ha=new Proxy(ha,{get:(e,t,n)=>("map"===t&&console.error(ua),Reflect.get(e,t,n))}));let da=Date.now;function pa(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:la.parentElement(e)}/[1-9][0-9]{12}/.test(Date.now().toString())||(da=()=>(new Date).getTime());function fa(e){var t;let n=null;return"getRootNode"in e&&(null==(t=la.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&la.host(la.getRootNode(e))&&(n=la.host(la.getRootNode(e))),n}function ga(e){let t,n=e;for(;t=fa(n);)n=t;return n}function ma(e){const t=e.ownerDocument;if(!t)return!1;const n=ga(e);return la.contains(t,n)}const ya=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){s(this,"id",1),s(this,"styleIDMap",new WeakMap),s(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=void 0===t?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++}},get _mirror(){return ha},closestElementOfNode:pa,getBaseDimension:function e(t,n){var r,s;const o=null==(s=null==(r=t.ownerDocument)?void 0:r.defaultView)?void 0:s.frameElement;if(!o||o===n)return{x:0,y:0,relativeScale:1,absoluteScale:1};const i=o.getBoundingClientRect(),a=e(o,n),c=i.height/o.clientHeight;return{x:i.x*a.relativeScale+a.x,y:i.y*a.relativeScale+a.y,relativeScale:c,absoluteScale:a.absoluteScale*c}},getNestedRule:function e(t,n){const r=t[n[0]];return 1===n.length?r:e(r.cssRules[n[1]].cssRules,n.slice(2))},getPositionsAndIndex:function(e){const t=[...e],n=t.pop();return{positions:t,index:n}},getRootShadowHost:ga,getShadowHost:fa,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,n,r,s;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=la.parentElement(o.body))?void 0:t.scrollLeft)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(r=la.parentElement(o.body))?void 0:r.scrollTop)||(null==(s=null==o?void 0:o.body)?void 0:s.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof ea&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(la.shadowRoot(e)))},hookSetter:function e(t,n,r,s,o=window){const i=o.Object.getOwnPropertyDescriptor(t,n);return o.Object.defineProperty(t,n,s?r:{set(e){setTimeout(()=>{r.set.call(this,e)},0),i&&i.set&&i.set.call(this,e)}}),()=>e(t,n,i||{},!0)},inDom:function(e){const t=e.ownerDocument;return!!t&&(la.contains(t,e)||ma(e))},isAncestorRemoved:function e(t,n){if(function(e){const t=e&&"host"in e&&"mode"in e&&g.host(e)||null;return Boolean(t&&"shadowRoot"in t&&g.shadowRoot(t)===e)}(t))return!1;const r=n.getId(t);if(!n.has(r))return!0;const s=la.parentNode(t);return(!s||s.nodeType!==t.DOCUMENT_NODE)&&(!s||e(s,n))},isBlocked:function(e,t,n,r){if(!e)return!1;const s=pa(e);if(!s)return!1;try{if("string"==typeof t){if(s.classList.contains(t))return!0;if(r&&null!==s.closest("."+t))return!0}else if(y(s,t,r))return!0}catch(e){}if(n){if(s.matches(n))return!0;if(r&&null!==s.closest(n))return!0}return!1},isIgnored:function(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||-2===t.getId(e)},isSerialized:function(e,t){return-1!==t.getId(e)},isSerializedIframe:function(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))},isSerializedStylesheet:function(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))},iterateResolveTree:function e(t,n){n(t.value);for(let r=t.children.length-1;r>=0;r--)e(t.children[r],n)},legacy_isTouchEvent:function(e){return Boolean(e.changedTouches)},get nowTimestamp(){return da},on:function(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)},patch:function(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],s=n(r);return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=s,()=>{e[t]=r}}catch{return()=>{}}},polyfill:function(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)},queueToResolveTrees:function(e){const t={},n=(e,n)=>{const r={value:e,parent:n,children:[]};return t[e.node.id]=r,r},r=[];for(const s of e){const{nextId:e,parentId:o}=s;if(e&&e in t){const o=t[e];if(o.parent){const e=o.parent.children.indexOf(o);o.parent.children.splice(e,0,n(s,o.parent))}else{const e=r.indexOf(o);r.splice(e,0,n(s,null))}continue}if(o in t){const e=t[o];e.children.push(n(s,e));continue}r.push(n(s,null))}return r},shadowHostInDom:ma,throttle:function(e,t,n={}){let r=null,s=0;return function(...o){const i=Date.now();s||!1!==n.leading||(s=i);const a=t-(i-s),c=this;a<=0||a>t?(r&&(clearTimeout(r),r=null),s=i,e.apply(c,o)):r||!1===n.trailing||(r=setTimeout(()=>{s=!1===n.leading?0:Date.now(),r=null,e.apply(c,o)},a))}},uniqueTextMutations:function(e){const t=new Set,n=[];for(let r=e.length;r--;){const s=e[r];t.has(s.id)||(n.push(s),t.add(s.id))}return n}},Symbol.toStringTag,{value:"Module"}));for(var va="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ba="undefined"==typeof Uint8Array?[]:new Uint8Array(256),wa=0;wa<64;wa++)ba[va.charCodeAt(wa)]=wa;var Ca,Sa,_a;"undefined"!=typeof window&&window.Blob&&new Blob([(Ca="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Uint8Array.from(atob(Ca),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],e=>2*e)[0]){const t=document.createElement("iframe");document.body.appendChild(t),Array.from=(null==(e=t.contentWindow)?void 0:e.Array.from)||Array.from,document.body.removeChild(t)}}catch(e){console.debug("Unable to override Array.from",e)}new m,(_a=Sa||(Sa={}))[_a.NotStarted=0]="NotStarted",_a[_a.Running=1]="Running",_a[_a.Stopped=2]="Stopped";class Ia{constructor(e){n(this,"fileName"),n(this,"functionName"),n(this,"lineNumber"),n(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){const e=this.lineNumber||"",t=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${e}:${t})`:`${this.fileName}:${e}:${t}`}}const Ea=/(^|@)\S+:\d+/,Ta=/^\s*at .*(\S+:\d+|\(native\))/m,Aa=/^(eval@)?(\[native code])?$/,ka={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Ta)?this.parseV8OrIE(e):e.stack?this.parseFFOrSafari(e):(console.warn("[console-record-plugin]: Failed to parse error object:",e),[]):[]},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!t)throw new Error(`Cannot parse given url: ${e}`);return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(Ta)},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,"(");const n=t.match(/ (\((.+):(\d+):(\d+)\)$)/);t=n?t.replace(n[0],""):t;const r=t.split(/\s+/).slice(1),s=this.extractLocation(n?n[1]:r.pop()),o=r.join(" ")||void 0,i=["eval","<anonymous>"].indexOf(s[0])>-1?void 0:s[0];return new Ia({functionName:o,fileName:i,lineNumber:s[1],columnNumber:s[2]})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(Aa)},this).map(function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Ia({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,s=this.extractLocation(e.replace(t,""));return new Ia({functionName:r,fileName:s[0],lineNumber:s[1],columnNumber:s[2]})}},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){const t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[];for(let e=2,s=n.length;e<s;e+=2){const s=t.exec(n[e]);s&&r.push(new Ia({fileName:s[2],lineNumber:parseFloat(s[1])}))}return r},parseOpera10:function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[];for(let e=0,s=n.length;e<s;e+=2){const s=t.exec(n[e]);s&&r.push(new Ia({functionName:s[3]||void 0,fileName:s[2],lineNumber:parseFloat(s[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(Ea)&&!e.match(/^Error created at/)},this).map(function(e){const t=e.split("@"),n=this.extractLocation(t.pop()),r=(t.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Ia({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function Oa(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let n=e.localName;if(!n)break;n=n.toLowerCase();const r=e.parentElement,s=[];if(r.children&&r.children.length>0)for(let e=0;e<r.children.length;e++){const t=r.children[e];t.localName&&t.localName.toLowerCase&&t.localName.toLowerCase()===n&&s.push(t)}s.length>1&&(n+=`:eq(${s.indexOf(e)})`),t=n+(t?">"+t:""),e=r}return t}function Ra(e){return"[object Object]"===Object.prototype.toString.call(e)}function xa(e,t){if(0===t)return!0;const n=Object.keys(e);for(const r of n)if(Ra(e[r])&&xa(e[r],t-1))return!0;return!1}function Na(e,t){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);const r=[],s=[];return JSON.stringify(e,function(e,t){if(r.length>0){const n=r.indexOf(this);~n?r.splice(n+1):r.push(this),~n?s.splice(n,1/0,e):s.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+s.slice(0,r.indexOf(t)).join(".")+"]")}else r.push(t);if(null===t)return t;if(void 0===t)return"undefined";if(function(e){if(Ra(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Ra(e)&&xa(e,n.depthOfLimit))return!0;return!1}(t))return function(e){let t=e.toString();n.stringLengthLimit&&t.length>n.stringLengthLimit&&(t=`${t.slice(0,n.stringLengthLimit)}...`);return t}(t);if("bigint"==typeof t)return t.toString()+"n";if(t instanceof Event){const e={};for(const n in t){const r=t[n];Array.isArray(r)?e[n]=Oa(r.length?r[0]:null):e[n]=r}return e}return t instanceof Node?t instanceof HTMLElement?t?t.outerHTML:"":t.nodeName:t instanceof Error?t.stack?t.stack+"\nEnd of stack for Error object":t.name+": "+t.message:t})}const La={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 Ma(e,t,n){const r=n?Object.assign({},La,n):La,s=r.logger;if(!s)return()=>{};let o;o="string"==typeof s?t[s]:s;let i=0,a=!1;const c=[];if(r.level.includes("error")){const n=t=>{const n=t.message,s=t.error,o=ka.parse(s).map(e=>e.toString()),i=[Na(n,r.stringifyOptions)];e({level:"error",trace:o,payload:i})};t.addEventListener("error",n),c.push(()=>{t.removeEventListener("error",n)});const s=t=>{let n,s;t.reason instanceof Error?(n=t.reason,s=[Na(`Uncaught (in promise) ${n.name}: ${n.message}`,r.stringifyOptions)]):(n=new Error,s=[Na("Uncaught (in promise)",r.stringifyOptions),Na(t.reason,r.stringifyOptions)]);const o=ka.parse(n).map(e=>e.toString());e({level:"error",trace:o,payload:s})};t.addEventListener("unhandledrejection",s),c.push(()=>{t.removeEventListener("unhandledrejection",s)})}for(const e of r.level)c.push(l(o,e));return()=>{c.forEach(e=>e())};function l(t,n){return t[n]?ya.patch(t,n,t=>(...s)=>{if(t.apply(this,s),!("assert"===n&&s[0]||a)){a=!0;try{const t=ka.parse(new Error).map(e=>e.toString()).splice(1),o=("assert"===n?s.slice(1):s).map(e=>Na(e,r.stringifyOptions));i++,i<r.lengthThreshold?e({level:n,trace:t,payload:o}):i===r.lengthThreshold&&e({level:"warn",trace:[],payload:[Na("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...s)}finally{a=!1}}}):()=>{}}}var Pa;function Da(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function Fa(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Ba(e){try{var t=e.rules||e.cssRules;return t?((n=Array.from(t).map(Ua).join("")).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),n):null}catch(e){return null}var n}function Ua(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=Ba(e.styleSheet)||t}catch(e){}return t}!function(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"}(Pa||(Pa={}));var ja=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(function(e){return t.removeNodeFromMap(e)})},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var n=this.getNode(e);if(n){var r=this.nodeMetaMap.get(n);r&&this.nodeMetaMap.set(t,r)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function Za(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,s=e.value,o=e.maskInputFn,i=s||"";return(t[n.toLowerCase()]||t[r])&&(i=o?o(i):"*".repeat(i.length)),i}var za="__rrweb_original__";var Va,Ha,Ga=1,Wa=new RegExp("[^a-z0-9-_:]");function Ya(){return Ga++}var Ka=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,$a=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,Ja=/^(data:)([^,]*),(.*)/i;function Xa(e,t){return(e||"").replace(Ka,function(e,n,r,s,o,i){var a,c=r||o||i,l=n||s||"";if(!c)return e;if(!$a.test(c))return"url(".concat(l).concat(c).concat(l,")");if(Ja.test(c))return"url(".concat(l).concat(c).concat(l,")");if("/"===c[0])return"url(".concat(l).concat((a=t,(a.indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+c)).concat(l,")");var u=t.split("/"),h=c.split("/");u.pop();for(var d=0,p=h;d<p.length;d++){var f=p[d];"."!==f&&(".."===f?u.pop():u.push(f))}return"url(".concat(l).concat(u.join("/")).concat(l,")")})}var qa=/^[^ \t\n\r\u000c]+/,Qa=/^[, \t\n\r\u000c]+/;function ec(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function tc(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function nc(){var e=document.createElement("a");return e.href="",e.href}function rc(e,t,n,r){return"src"===n||"href"===n&&r&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&r&&"#"!==r[0]?ec(e,r):"background"!==n||!r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n&&r?function(e,t){if(""===t.trim())return t;var n=0;function r(e){var r,s=e.exec(t.substring(n));return s?(r=s[0],n+=r.length,r):""}for(var s=[];r(Qa),!(n>=t.length);){var o=r(qa);if(","===o.slice(-1))o=ec(e,o.substring(0,o.length-1)),s.push(o);else{var i="";o=ec(e,o);for(var a=!1;;){var c=t.charAt(n);if(""===c){s.push((o+i).trim());break}if(a)")"===c&&(a=!1);else{if(","===c){n+=1,s.push((o+i).trim());break}"("===c&&(a=!0)}i+=c,n+=1}}}return s.join(", ")}(e,r):"style"===n&&r?Xa(r,nc()):"object"===t&&"data"===n&&r?ec(e,r):r:ec(e,r)}function sc(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&sc(e.parentNode,t,n);for(var r=e.classList.length;r--;){var s=e.classList[r];if(t.test(s))return!0}return!!n&&sc(e.parentNode,t,n)}function oc(e,t,n){var r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===r)return!1;if("string"==typeof t){if(r.classList.contains(t))return!0;if(r.closest(".".concat(t)))return!0}else if(sc(r,t,!0))return!0;if(n){if(r.matches(n))return!0;if(r.closest(n))return!0}return!1}function ic(e,t){var n=t.doc,r=t.mirror,s=t.blockClass,o=t.blockSelector,i=t.maskTextClass,a=t.maskTextSelector,c=t.inlineStylesheet,l=t.maskInputOptions,u=void 0===l?{}:l,h=t.maskTextFn,d=t.maskInputFn,p=t.dataURLOptions,f=void 0===p?{}:p,g=t.inlineImages,m=t.recordCanvas,y=t.keepIframeSrcFn,v=t.newlyAddedElement,b=void 0!==v&&v,w=function(e,t){if(!t.hasNode(e))return;var n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:Pa.Document,childNodes:[],compatMode:e.compatMode}:{type:Pa.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Pa.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:w};case e.ELEMENT_NODE:return function(e,t){for(var n=t.doc,r=t.blockClass,s=t.blockSelector,o=t.inlineStylesheet,i=t.maskInputOptions,a=void 0===i?{}:i,c=t.maskInputFn,l=t.dataURLOptions,u=void 0===l?{}:l,h=t.inlineImages,d=t.recordCanvas,p=t.keepIframeSrcFn,f=t.newlyAddedElement,g=void 0!==f&&f,m=t.rootId,y=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var s=e.classList[r];if(t.test(s))return!0}return!!n&&e.matches(n)}(e,r,s),v=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return Wa.test(t)?"div":t}(e),b={},w=e.attributes.length,C=0;C<w;C++){var S=e.attributes[C];b[S.name]=rc(n,v,S.name,S.value)}if("link"===v&&o){var _=Array.from(n.styleSheets).find(function(t){return t.href===e.href}),I=null;_&&(I=Ba(_)),I&&(delete b.rel,delete b.href,b._cssText=Xa(I,_.href))}if("style"===v&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){(I=Ba(e.sheet))&&(b._cssText=Xa(I,nc()))}if("input"===v||"textarea"===v||"select"===v){var E=e.value,T=e.checked;"radio"!==b.type&&"checkbox"!==b.type&&"submit"!==b.type&&"button"!==b.type&&E?b.value=Za({type:b.type,tagName:v,value:E,maskInputOptions:a,maskInputFn:c}):T&&(b.checked=T)}"option"===v&&(e.selected&&!a.select?b.selected=!0:delete b.selected);if("canvas"===v&&d)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var s=t.getImageData,o=za in s?s[za]:s;if(new Uint32Array(o.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(function(e){return 0!==e}))return!1}return!0})(e)||(b.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var A=e.toDataURL(u.type,u.quality),k=document.createElement("canvas");k.width=e.width,k.height=e.height,A!==k.toDataURL(u.type,u.quality)&&(b.rr_dataURL=A)}if("img"===v&&h){Va||(Va=n.createElement("canvas"),Ha=Va.getContext("2d"));var O=e,R=O.crossOrigin;O.crossOrigin="anonymous";var x=function(){try{Va.width=O.naturalWidth,Va.height=O.naturalHeight,Ha.drawImage(O,0,0),b.rr_dataURL=Va.toDataURL(u.type,u.quality)}catch(e){console.warn("Cannot inline img src=".concat(O.currentSrc,"! Error: ").concat(e))}R?b.crossOrigin=R:O.removeAttribute("crossorigin")};O.complete&&0!==O.naturalWidth?x():O.onload=x}"audio"!==v&&"video"!==v||(b.rr_mediaState=e.paused?"paused":"played",b.rr_mediaCurrentTime=e.currentTime);g||(e.scrollLeft&&(b.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(b.rr_scrollTop=e.scrollTop));if(y){var N=e.getBoundingClientRect(),L=N.width,M=N.height;b={class:b.class,rr_width:"".concat(L,"px"),rr_height:"".concat(M,"px")}}"iframe"!==v||p(b.src)||(e.contentDocument||(b.rr_src=b.src),delete b.src);return{type:Pa.Element,tagName:v,attributes:b,childNodes:[],isSVG:tc(e)||void 0,needBlock:y,rootId:m}}(e,{doc:n,blockClass:s,blockSelector:o,inlineStylesheet:c,maskInputOptions:u,maskInputFn:d,dataURLOptions:f,inlineImages:g,recordCanvas:m,keepIframeSrcFn:y,newlyAddedElement:b,rootId:w});case e.TEXT_NODE:return function(e,t){var n,r=t.maskTextClass,s=t.maskTextSelector,o=t.maskTextFn,i=t.rootId,a=e.parentNode&&e.parentNode.tagName,c=e.textContent,l="STYLE"===a||void 0,u="SCRIPT"===a||void 0;if(l&&c){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(c=(h=e.parentNode.sheet).cssRules?Array.from(h.cssRules).map(function(e){return e.cssText||""}).join(""):"")}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}c=Xa(c,nc())}var h;u&&(c="SCRIPT_PLACEHOLDER");!l&&!u&&c&&oc(e,r,s)&&(c=o?o(c):c.replace(/[\S]/g,"*"));return{type:Pa.Text,textContent:c||"",isStyle:l,rootId:i}}(e,{maskTextClass:i,maskTextSelector:a,maskTextFn:h,rootId:w});case e.CDATA_SECTION_NODE:return{type:Pa.CDATA,textContent:"",rootId:w};case e.COMMENT_NODE:return{type:Pa.Comment,textContent:e.textContent||"",rootId:w};default:return!1}}function ac(e){return void 0===e?"":e.toLowerCase()}function cc(e,t){var n,r=t.doc,s=t.mirror,o=t.blockClass,i=t.blockSelector,a=t.maskTextClass,c=t.maskTextSelector,l=t.skipChild,u=void 0!==l&&l,h=t.inlineStylesheet,d=void 0===h||h,p=t.maskInputOptions,f=void 0===p?{}:p,g=t.maskTextFn,m=t.maskInputFn,y=t.slimDOMOptions,v=t.dataURLOptions,b=void 0===v?{}:v,w=t.inlineImages,C=void 0!==w&&w,S=t.recordCanvas,_=void 0!==S&&S,I=t.onSerialize,E=t.onIframeLoad,T=t.iframeLoadTimeout,A=void 0===T?5e3:T,k=t.onStylesheetLoad,O=t.stylesheetLoadTimeout,R=void 0===O?5e3:O,x=t.keepIframeSrcFn,N=void 0===x?function(){return!1}:x,L=t.newlyAddedElement,M=void 0!==L&&L,P=t.preserveWhiteSpace,D=void 0===P||P,F=ic(e,{doc:r,mirror:s,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:f,maskTextFn:g,maskInputFn:m,dataURLOptions:b,inlineImages:C,recordCanvas:_,keepIframeSrcFn:N,newlyAddedElement:M});if(!F)return console.warn(e,"not serialized"),null;n=s.hasNode(e)?s.getId(e):!function(e,t){if(t.comment&&e.type===Pa.Comment)return!0;if(e.type===Pa.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&"preload"===e.attributes.rel&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(ac(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===ac(e.attributes.name)||"icon"===ac(e.attributes.rel)||"apple-touch-icon"===ac(e.attributes.rel)||"shortcut icon"===ac(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&ac(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ac(e.attributes.property).match(/^(og|twitter|fb):/)||ac(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===ac(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===ac(e.attributes.name)||"googlebot"===ac(e.attributes.name)||"bingbot"===ac(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===ac(e.attributes.name)||"generator"===ac(e.attributes.name)||"framework"===ac(e.attributes.name)||"publisher"===ac(e.attributes.name)||"progid"===ac(e.attributes.name)||ac(e.attributes.property).match(/^article:/)||ac(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===ac(e.attributes.name)||"yandex-verification"===ac(e.attributes.name)||"csrf-token"===ac(e.attributes.name)||"p:domain_verify"===ac(e.attributes.name)||"verify-v1"===ac(e.attributes.name)||"verification"===ac(e.attributes.name)||"shopify-checkout-api-token"===ac(e.attributes.name)))return!0}}return!1}(F,y)&&(D||F.type!==Pa.Text||F.isStyle||F.textContent.replace(/^\s+|\s+$/gm,"").length)?Ya():-2;var B=Object.assign(F,{id:n});if(s.add(e,B),-2===n)return null;I&&I(e);var U=!u;if(B.type===Pa.Element){U=U&&!B.needBlock,delete B.needBlock;var j=e.shadowRoot;j&&Fa(j)&&(B.isShadowHost=!0)}if((B.type===Pa.Document||B.type===Pa.Element)&&U){y.headWhitespace&&B.type===Pa.Element&&"head"===B.tagName&&(D=!1);for(var Z={doc:r,mirror:s,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:c,skipChild:u,inlineStylesheet:d,maskInputOptions:f,maskTextFn:g,maskInputFn:m,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:_,preserveWhiteSpace:D,onSerialize:I,onIframeLoad:E,iframeLoadTimeout:A,onStylesheetLoad:k,stylesheetLoadTimeout:R,keepIframeSrcFn:N},z=0,V=Array.from(e.childNodes);z<V.length;z++){(W=cc(V[z],Z))&&B.childNodes.push(W)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(var H=0,G=Array.from(e.shadowRoot.childNodes);H<G.length;H++){var W;(W=cc(G[H],Z))&&(Fa(e.shadowRoot)&&(W.isShadow=!0),B.childNodes.push(W))}}return e.parentNode&&Da(e.parentNode)&&Fa(e.parentNode)&&(B.isShadow=!0),B.type===Pa.Element&&"iframe"===B.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var s,o=!1;try{s=r.document.readyState}catch(e){return}if("complete"===s){var i="about:blank";if(r.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var a=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(a),o=!0,t()})}}}(e,function(){var t=e.contentDocument;if(t&&E){var n=cc(t,{doc:t,mirror:s,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:g,maskInputFn:m,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:_,preserveWhiteSpace:D,onSerialize:I,onIframeLoad:E,iframeLoadTimeout:A,onStylesheetLoad:k,stylesheetLoadTimeout:R,keepIframeSrcFn:N});n&&E(e,n)}},A),B.type===Pa.Element&&"link"===B.tagName&&"stylesheet"===B.attributes.rel&&function(e,t,n){var r,s=!1;try{r=e.sheet}catch(e){return}if(!r){var o=setTimeout(function(){s||(t(),s=!0)},n);e.addEventListener("load",function(){clearTimeout(o),s=!0,t()})}}(e,function(){if(k){var t=cc(e,{doc:r,mirror:s,blockClass:o,blockSelector:i,maskTextClass:a,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:f,maskTextFn:g,maskInputFn:m,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:_,preserveWhiteSpace:D,onSerialize:I,onIframeLoad:E,iframeLoadTimeout:A,onStylesheetLoad:k,stylesheetLoadTimeout:R,keepIframeSrcFn:N});t&&k(e,t)}},R),B}function lc(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const uc="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let hc={map:{},getId:()=>(console.error(uc),-1),getNode:()=>(console.error(uc),null),removeNodeFromMap(){console.error(uc)},has:()=>(console.error(uc),!1),reset(){console.error(uc)}};function dc(e,t,n={}){let r=null,s=0;return function(...o){const i=Date.now();s||!1!==n.leading||(s=i);const a=t-(i-s),c=this;a<=0||a>t?(r&&(clearTimeout(r),r=null),s=i,e.apply(c,o)):r||!1===n.trailing||(r=setTimeout(()=>{s=!1===n.leading?0:Date.now(),r=null,e.apply(c,o)},a))}}function pc(e,t,n,r,s=window){const o=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,r?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>pc(e,t,o||{},!0)}function fc(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],s=n(r);return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=s,()=>{e[t]=r}}catch(e){return()=>{}}}function gc(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function mc(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function yc(e,t,n,r){if(!e)return!1;const s=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!s)return!1;if("string"==typeof t){if(s.classList.contains(t))return!0;if(r&&null!==s.closest("."+t))return!0}else if(sc(s,t,r))return!0;if(n){if(e.matches(n))return!0;if(r&&null!==s.closest(n))return!0}return!1}function vc(e,t){return-2===t.getId(e)}function bc(e,t){if(Da(e))return!1;const n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||bc(e.parentNode,t))}function wc(e){return Boolean(e.changedTouches)}function Cc(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Sc(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function _c(e){return Boolean(null==e?void 0:e.shadowRoot)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(hc=new Proxy(hc,{get:(e,t,n)=>("map"===t&&console.error(uc),Reflect.get(e,t,n))}));class Ic{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?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++}}var Ec=(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))(Ec||{}),Tc=(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))(Tc||{}),Ac=(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))(Ac||{}),kc=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(kc||{});function Oc(e){return"__ln"in e}class Rc{constructor(){this.length=0,this.head=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Oc(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&Oc(e.nextSibling)&&e.nextSibling.__ln.previous){const 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;this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)}}const xc=(e,t)=>`${e}@${t}`;class Nc{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],t=new Rc,n=e=>{let t=e,n=-2;for(;-2===n;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},r=r=>{var s,o,i,a;let c=null;(null===(o=null===(s=r.getRootNode)||void 0===s?void 0:s.call(r))||void 0===o?void 0:o.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&r.getRootNode().host&&(c=r.getRootNode().host);let l=c;for(;(null===(a=null===(i=null==l?void 0:l.getRootNode)||void 0===i?void 0:i.call(l))||void 0===a?void 0:a.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&l.getRootNode().host;)l=l.getRootNode().host;const u=!(this.doc.contains(r)||l&&this.doc.contains(l));if(!r.parentNode||u)return;const h=Da(r.parentNode)?this.mirror.getId(c):this.mirror.getId(r.parentNode),d=n(r);if(-1===h||-1===d)return t.addNode(r);const p=cc(r,{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=>{Cc(e,this.mirror)&&this.iframeManager.addIframe(e),Sc(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),_c(r)&&this.shadowDomManager.addShadowRoot(r.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});p&&e.push({parentId:h,nextId:d,node:p})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of Array.from(this.movedSet.values()))Mc(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||r(e);for(const e of Array.from(this.addedSet.values()))Dc(this.droppedSet,e)||Mc(this.removes,e,this.mirror)?Dc(this.movedSet,e)?r(e):this.droppedSet.add(e):r(e);let s=null;for(;t.length;){let e=null;if(s){const t=this.mirror.getId(s.value.parentNode),r=n(s.value);-1!==t&&-1!==r&&(e=s)}if(!e)for(let r=t.length-1;r>=0;r--){const s=t.get(r);if(s){const t=this.mirror.getId(s.value.parentNode);if(-1===n(s.value))continue;if(-1!==t){e=s;break}{const t=s.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const n=t.parentNode.host;if(-1!==this.mirror.getId(n)){e=s;break}}}}}if(!e){for(;t.head;)t.removeNode(t.head.value);break}s=e.previous,t.removeNode(e.value),r(e.value)}const o={texts:this.texts.map(e=>({id:this.mirror.getId(e.node),value:e.value})).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>({id:this.mirror.getId(e.node),attributes:e.attributes})).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.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(o))},this.processMutation=e=>{if(!vc(e.target,this.mirror))switch(e.type){case"characterData":{const t=e.target.textContent;yc(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:oc(e.target,this.maskTextClass,this.maskTextSelector)&&t?this.maskTextFn?this.maskTextFn(t):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.target.getAttribute(e.attributeName);if("value"===e.attributeName&&(n=Za({maskInputOptions:this.maskInputOptions,tagName:e.target.tagName,type:e.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),yc(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;let r=this.attributes.find(t=>t.node===e.target);if("IFRAME"===t.tagName&&"src"===e.attributeName&&!this.keepIframeSrcFn(n)){if(t.contentDocument)return;e.attributeName="rr_src"}if(r||(r={node:e.target,attributes:{}},this.attributes.push(r)),"style"===e.attributeName){const n=this.doc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue),void 0!==r.attributes.style&&null!==r.attributes.style||(r.attributes.style={});const s=r.attributes.style;for(const e of Array.from(t.style)){const r=t.style.getPropertyValue(e),o=t.style.getPropertyPriority(e);r===n.style.getPropertyValue(e)&&o===n.style.getPropertyPriority(e)||(s[e]=""===o?r:[r,o])}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(s[e]=!1)}else r.attributes[e.attributeName]=rc(this.doc,t.tagName,e.attributeName,n);break}case"childList":if(yc(e.target,this.blockClass,this.blockSelector,!0))return;e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const n=this.mirror.getId(t),r=Da(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);yc(e.target,this.blockClass,this.blockSelector,!1)||vc(t,this.mirror)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Lc(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||bc(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[xc(n,r)]?Lc(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!(!Da(e.target)||!Fa(e.target))||void 0})),this.mapRemoves.push(t))})}},this.genAdds=(e,t)=>{if(this.mirror.hasNode(e)){if(vc(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[xc(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);yc(e,this.blockClass,this.blockSelector,!1)||e.childNodes.forEach(e=>this.genAdds(e))}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].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 Lc(e,t){e.delete(t),t.childNodes.forEach(t=>Lc(e,t))}function Mc(e,t,n){return 0!==e.length&&Pc(e,t,n)}function Pc(e,t,n){const{parentNode:r}=t;if(!r)return!1;const s=n.getId(r);return!!e.some(e=>e.id===s)||Pc(e,r,n)}function Dc(e,t){return 0!==e.size&&Fc(e,t)}function Fc(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||Fc(e,n))}const Bc=[],Uc="undefined"!=typeof CSSGroupingRule,jc="undefined"!=typeof CSSMediaRule,Zc="undefined"!=typeof CSSSupportsRule,zc="undefined"!=typeof CSSConditionRule;function Vc(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function Hc(e,t){var n,r;const s=new Nc;Bc.push(s),s.init(e);let o=window.MutationObserver||window.__rrMutationObserver;const i=null===(r=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===r?void 0:r.call(n,"MutationObserver");i&&window[i]&&(o=window[i]);const a=new o(s.processMutations.bind(s));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function Gc({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const i=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,a=[];return Object.keys(Ac).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e]).forEach(o=>{const i=o.toLowerCase(),c=(t=>o=>{const i=Vc(o);if(yc(i,r,s,!0))return;const a=wc(o)?o.changedTouches[0]:o;if(!a)return;const c=n.getId(i),{clientX:l,clientY:u}=a;e({type:Ac[t],id:c,x:l,y:u})})(o);a.push(lc(i,c,t))}),()=>{a.forEach(e=>e())}}function Wc({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,sampling:o}){return lc("scroll",dc(o=>{const i=Vc(o);if(!i||yc(i,r,s,!0))return;const a=n.getId(i);if(i===t){const n=t.scrollingElement||t.documentElement;e({id:a,x:n.scrollLeft,y:n.scrollTop})}else e({id:a,x:i.scrollLeft,y:i.scrollTop})},o.scroll||100),t)}function Yc(e,t){const n=Object.assign({},e);return t||delete n.userTriggered,n}const Kc=["INPUT","TEXTAREA","SELECT"],$c=new WeakMap;function Jc(e){return function(e,t){if(Uc&&e.parentRule instanceof CSSGroupingRule||jc&&e.parentRule instanceof CSSMediaRule||Zc&&e.parentRule instanceof CSSSupportsRule||zc&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function Xc(e,t,n){let r,s;return e?(e.ownerNode?r=t.getId(e.ownerNode):s=n.getId(e),{styleId:s,id:r}):{}}function qc({mirror:e,stylesheetManager:t},n){var r,s,o;let i=null;i="#document"===n.nodeName?e.getId(n):e.getId(n.host);const a="#document"===n.nodeName?null===(r=n.defaultView)||void 0===r?void 0:r.Document:null===(o=null===(s=n.ownerDocument)||void 0===s?void 0:s.defaultView)||void 0===o?void 0:o.ShadowRoot,c=Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets");return null!==i&&-1!==i&&a&&c?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null===(e=c.get)||void 0===e?void 0:e.call(this)},set(e){var n;const r=null===(n=c.set)||void 0===n?void 0:n.call(this,e);if(null!==i&&-1!==i)try{t.adoptStyleSheets(e,i)}catch(e){}return r}}),()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}):()=>{}}function Qc(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:s,scrollCb:o,viewportResizeCb:i,inputCb:a,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:u,canvasMutationCb:h,fontCb:d,selectionCb:p}=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),s(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),o(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),i(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...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),h(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),d(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)}}(e,t);const r=Hc(e,e.doc),s=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(!1===t.mousemove)return()=>{};const s="number"==typeof t.mousemove?t.mousemove:50,o="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let i,a=[];const c=dc(t=>{const n=Date.now()-i;e(a.map(e=>(e.timeOffset-=n,e)),t),a=[],i=null},o),l=dc(e=>{const t=Vc(e),{clientX:n,clientY:s}=wc(e)?e.changedTouches[0]:e;i||(i=Date.now()),a.push({x:n,y:s,id:r.getId(t),timeOffset:Date.now()-i}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?Tc.Drag:e instanceof MouseEvent?Tc.MouseMove:Tc.TouchMove)},s,{trailing:!1}),u=[lc("mousemove",l,n),lc("touchmove",l,n),lc("drag",l,n)];return()=>{u.forEach(e=>e())}}(e),o=Gc(e),i=Wc(e),a=function({viewportResizeCb:e}){let t=-1,n=-1;return lc("resize",dc(()=>{const r=gc(),s=mc();t===r&&n===s||(e({width:Number(s),height:Number(r)}),t=r,n=s)},200),window)}(e),c=function({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,ignoreClass:o,maskInputOptions:i,maskInputFn:a,sampling:c,userTriggeredOnInput:l}){function u(e){let n=Vc(e);const c=e.isTrusted;if(n&&"OPTION"===n.tagName&&(n=n.parentElement),!n||!n.tagName||Kc.indexOf(n.tagName)<0||yc(n,r,s,!0))return;const u=n.type;if(n.classList.contains(o))return;let d=n.value,p=!1;"radio"===u||"checkbox"===u?p=n.checked:(i[n.tagName.toLowerCase()]||i[u])&&(d=Za({maskInputOptions:i,tagName:n.tagName,type:u,value:d,maskInputFn:a})),h(n,Yc({text:d,isChecked:p,userTriggered:c},l));const f=n.name;"radio"===u&&f&&p&&t.querySelectorAll(`input[type="radio"][name="${f}"]`).forEach(e=>{e!==n&&h(e,Yc({text:e.value,isChecked:!p,userTriggered:!1},l))})}function h(t,r){const s=$c.get(t);if(!s||s.text!==r.text||s.isChecked!==r.isChecked){$c.set(t,r);const s=n.getId(t);e(Object.assign(Object.assign({},r),{id:s}))}}const d=("last"===c.input?["change"]:["input","change"]).map(e=>lc(e,u,t)),p=t.defaultView;if(!p)return()=>{d.forEach(e=>e())};const f=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value"),g=[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]];return f&&f.set&&d.push(...g.map(e=>pc(e[0],e[1],{set(){u({target:this})}},!1,p))),()=>{d.forEach(e=>e())}}(e),l=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:s}){const o=o=>dc(s=>{const i=Vc(s);if(!i||yc(i,t,n,!0))return;const{currentTime:a,volume:c,muted:l,playbackRate:u}=i;e({type:o,id:r.getId(i),currentTime:a,volume:c,muted:l,playbackRate:u})},s.media||500),i=[lc("play",o(0)),lc("pause",o(1)),lc("seeked",o(2)),lc("volumechange",o(3)),lc("ratechange",o(4))];return()=>{i.forEach(e=>e())}}(e),u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){const s=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=function(r,o){const{id:i,styleId:a}=Xc(this,t,n.styleMirror);return(i&&-1!==i||a&&-1!==a)&&e({id:i,styleId:a,adds:[{rule:r,index:o}]}),s.apply(this,[r,o])};const o=r.CSSStyleSheet.prototype.deleteRule;let i,a;r.CSSStyleSheet.prototype.deleteRule=function(r){const{id:s,styleId:i}=Xc(this,t,n.styleMirror);return(s&&-1!==s||i&&-1!==i)&&e({id:s,styleId:i,removes:[{index:r}]}),o.apply(this,[r])},r.CSSStyleSheet.prototype.replace&&(i=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=function(r){const{id:s,styleId:o}=Xc(this,t,n.styleMirror);return(s&&-1!==s||o&&-1!==o)&&e({id:s,styleId:o,replace:r}),i.apply(this,[r])}),r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=function(r){const{id:s,styleId:o}=Xc(this,t,n.styleMirror);return(s&&-1!==s||o&&-1!==o)&&e({id:s,styleId:o,replaceSync:r}),a.apply(this,[r])});const c={};Uc?c.CSSGroupingRule=r.CSSGroupingRule:(jc&&(c.CSSMediaRule=r.CSSMediaRule),zc&&(c.CSSConditionRule=r.CSSConditionRule),Zc&&(c.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(c).forEach(([r,s])=>{l[r]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=function(s,o){const{id:i,styleId:a}=Xc(this.parentStyleSheet,t,n.styleMirror);return(i&&-1!==i||a&&-1!==a)&&e({id:i,styleId:a,adds:[{rule:s,index:[...Jc(this),o||0]}]}),l[r].insertRule.apply(this,[s,o])},s.prototype.deleteRule=function(s){const{id:o,styleId:i}=Xc(this.parentStyleSheet,t,n.styleMirror);return(o&&-1!==o||i&&-1!==i)&&e({id:o,styleId:i,removes:[{index:[...Jc(this),s]}]}),l[r].deleteRule.apply(this,[s])}}),()=>{r.CSSStyleSheet.prototype.insertRule=s,r.CSSStyleSheet.prototype.deleteRule=o,i&&(r.CSSStyleSheet.prototype.replace=i),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach(([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule})}}(e,{win:n}),h=qc(e,e.doc),d=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:s}){const o=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=function(s,i,a){var c;if(n.has(s))return o.apply(this,[s,i,a]);const{id:l,styleId:u}=Xc(null===(c=this.parentRule)||void 0===c?void 0:c.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,set:{property:s,value:i,priority:a},index:Jc(this.parentRule)}),o.apply(this,[s,i,a])};const i=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=function(s){var o;if(n.has(s))return i.apply(this,[s]);const{id:a,styleId:c}=Xc(null===(o=this.parentRule)||void 0===o?void 0:o.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,remove:{property:s},index:Jc(this.parentRule)}),i.apply(this,[s])},()=>{s.CSSStyleDeclaration.prototype.setProperty=o,s.CSSStyleDeclaration.prototype.removeProperty=i}}(e,{win:n}),p=e.collectFonts?function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],s=new WeakMap,o=n.FontFace;n.FontFace=function(e,t,n){const r=new o(e,t,n);return s.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const i=fc(t.fonts,"add",function(t){return function(n){return setTimeout(()=>{const t=s.get(n);t&&(e(t),s.delete(n))},0),t.apply(this,[n])}});return r.push(()=>{n.FontFace=o}),r.push(i),()=>{r.forEach(e=>e())}}(e):()=>{},f=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:s,selectionCb:o}=e;let i=!0;const a=()=>{const e=t.getSelection();if(!e||i&&(null==e?void 0:e.isCollapsed))return;i=e.isCollapsed||!1;const a=[],c=e.rangeCount||0;for(let t=0;t<c;t++){const o=e.getRangeAt(t),{startContainer:i,startOffset:c,endContainer:l,endOffset:u}=o;yc(i,r,s,!0)||yc(l,r,s,!0)||a.push({start:n.getId(i),startOffset:c,end:n.getId(l),endOffset:u})}o({ranges:a})};return a(),lc("selectionchange",a)}(e),g=[];for(const t of e.plugins)g.push(t.observer(t.callback,n,t.options));return()=>{Bc.forEach(e=>e.reset()),r.disconnect(),s(),o(),i(),a(),c(),l(),u(),h(),d(),p(),f(),g.forEach(e=>e())}}class el{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,r){const s=n||this.getIdToRemoteIdMap(e),o=r||this.getRemoteIdToIdMap(e);let i=s.get(t);return i||(i=this.generateIdFn(),s.set(t,i),o.set(i,t)),i}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const s=r.get(t);return s||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);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}}class tl{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new el(Ya),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new el(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;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.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){if("rrweb"===e.data.type){if(!e.source)return;const t=this.crossOriginIframeMap.get(e.source);if(!t)return;const n=this.transformCrossOriginEvent(t,e.data.event);n&&this.wrappedEmit(n,e.data.isCheckout)}}transformCrossOriginEvent(e,t){var n;switch(t.type){case Ec.FullSnapshot:return this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e),{timestamp:t.timestamp,type:Ec.IncrementalSnapshot,data:{source:Tc.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Ec.Meta:case Ec.Load:case Ec.DomContentLoaded:return!1;case Ec.Plugin:return t;case Ec.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Ec.IncrementalSnapshot:switch(t.data.source){case Tc.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e)}),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 Tc.Drag:case Tc.TouchMove:case Tc.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Tc.ViewportResize:return!1;case Tc.MediaInteraction:case Tc.MouseInteraction:case Tc.Scroll:case Tc.CanvasMutation:case Tc.Input:return this.replaceIds(t.data,e,["id"]),t;case Tc.StyleSheetRule:case Tc.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Tc.Font:return t;case Tc.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case Tc.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(n=t.data.styles)||void 0===n||n.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}}replace(e,t,n,r){for(const s of r)(Array.isArray(t[s])||"number"==typeof t[s])&&(Array.isArray(t[s])?t[s]=e.getIds(n,t[s]):t[s]=e.getId(n,t[s]));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"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}}class nl{constructor(e){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;const t=this;this.restorePatches.push(fc(Element.prototype,"attachShadow",function(e){return function(n){const r=e.call(this,n);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),r}}))}addShadowRoot(e,t){Fa(e)&&(this.shadowDoms.has(e)||(this.shadowDoms.add(e),Hc(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),Wc(Object.assign(Object.assign({},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(e.host)),qc({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)},0)))}observeAttachShadow(e){if(e.contentWindow){const t=this;this.restorePatches.push(fc(e.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(r){const s=n.call(this,r);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),s}}))}}reset(){this.restorePatches.forEach(e=>e()),this.shadowDoms=new WeakSet}}
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -12,10 +12,10 @@ var Monoscope=function(){"use strict";var e,t=Object.defineProperty,n=(e,n,r)=>(
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function rl(e,t,n,r){return new(n||(n=Promise))(function(t,s){function o(e){try{a(r.next(e))}catch(e){s(e)}}function i(e){try{a(r.throw(e))}catch(e){s(e)}}function a(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n(function(e){e(r)})).then(o,i)}a((r=r.apply(e,[])).next())})}for(var sl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ol="undefined"==typeof Uint8Array?[]:new Uint8Array(256),il=0;il<64;il++)ol[sl.charCodeAt(il)]=il;const al=new Map;const cl=(e,t,n)=>{if(!e||!hl(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=al.get(e);return n||(n=new Map,al.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let s=r.indexOf(e);return-1===s&&(s=r.length,r.push(e)),s};function ll(e,t,n){if(e instanceof Array)return e.map(e=>ll(e,t,n));if(null===e)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){const t=e.constructor.name,n=function(e){var t,n=new Uint8Array(e),r=n.length,s="";for(t=0;t<r;t+=3)s+=sl[n[t]>>2],s+=sl[(3&n[t])<<4|n[t+1]>>4],s+=sl[(15&n[t+1])<<2|n[t+2]>>6],s+=sl[63&n[t+2]];return r%3==2?s=s.substring(0,s.length-1)+"=":r%3==1&&(s=s.substring(0,s.length-2)+"=="),s}(e);return{rr_type:t,base64:n}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[ll(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[ll(e.data,t,n),e.width,e.height]}}if(hl(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:cl(e,t,n)}}return e}const ul=(e,t,n)=>[...e].map(e=>ll(e,t,n)),hl=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(n.find(n=>e instanceof t[n]))};function dl(e,t,n){const r=[];try{const s=fc(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(r,...s){return yc(this,t,n,!0)||"__context"in this||(this.__context=r),e.apply(this,[r,...s])}});r.push(s)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(e=>e())}}function pl(e,t,n,r,s,o,i){const a=[],c=Object.getOwnPropertyNames(e);for(const o of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(o))try{if("function"!=typeof e[o])continue;const c=fc(e,o,function(e){return function(...a){const c=e.apply(this,a);if(cl(c,i,this),!yc(this.canvas,r,s,!0)){const e=ul([...a],i,this),r={type:t,property:o,args:e};n(this.canvas,r)}return c}});a.push(c)}catch(r){const s=pc(e,o,{set(e){n(this.canvas,{type:t,property:o,args:[e],setter:!0})}});a.push(s)}return a}var fl=null;try{var gl="undefined"!=typeof module&&"function"==typeof module.require&&module.require("worker_threads")||"function"==typeof __non_webpack_require__&&__non_webpack_require__("worker_threads")||"function"==typeof require&&require("worker_threads");fl=gl.Worker}catch(ty){}function ml(e,t,n){var r=function(e){return Buffer.from(e,"base64").toString("utf8")}(e),s=r.indexOf("\n",10)+1,o=r.substring(s)+"";return function(e){return new fl(o,Object.assign({},e,{eval:!0}))}}function yl(e,t,n){var r=function(e){return atob(e)}(e),s=r.indexOf("\n",10)+1,o=r.substring(s)+"",i=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(i)}var vl="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);var bl=function(e){return vl?ml(e):function(e){var t;return function(n){return t=t||yl(e),new Worker(t,n)}}(e)}("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=");class wl{constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,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)};const{sampling:t="all",win:n,blockClass:r,blockSelector:s,recordCanvas:o,dataURLOptions:i}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(n,r,s),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,s,{dataURLOptions:i})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,r,s){const o=dl(t,n,r),i=new Map,a=new bl;a.onmessage=e=>{const{id:t}=e.data;if(i.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:s,height:o}=e.data;this.mutationCb({id:t,type:kc["2D"],commands:[{property:"clearRect",args:[0,0,s,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const c=1e3/e;let l,u=0;const h=e=>{u&&e-u<c||(u=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{yc(t,n,r,!0)||e.push(t)}),e})().forEach(e=>rl(this,0,void 0,function*(){var t;const n=this.mirror.getId(e);if(i.get(n))return;if(i.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null===(t=null==n?void 0:n.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&(null==n||n.clear(n.COLOR_BUFFER_BIT))}const r=yield createImageBitmap(e);a.postMessage({id:n,bitmap:r,width:e.width,height:e.height,dataURLOptions:s.dataURLOptions},[r])}))),l=requestAnimationFrame(h)};l=requestAnimationFrame(h),this.resetObservers=()=>{o(),cancelAnimationFrame(l)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=dl(e,t,n),s=function(e,t,n,r){const s=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const i of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])continue;const o=fc(t.CanvasRenderingContext2D.prototype,i,function(s){return function(...o){return yc(this.canvas,n,r,!0)||setTimeout(()=>{const n=ul([...o],t,this);e(this.canvas,{type:kc["2D"],property:i,args:n})},0),s.apply(this,o)}});s.push(o)}catch(n){const r=pc(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:kc["2D"],property:i,args:[t],setter:!0})}});s.push(r)}return()=>{s.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n),o=function(e,t,n,r){const s=[];return s.push(...pl(t.WebGLRenderingContext.prototype,kc.WebGL,e,n,r,0,t)),void 0!==t.WebGL2RenderingContext&&s.push(...pl(t.WebGL2RenderingContext.prototype,kc.WebGL2,e,n,r,0,t)),()=>{s.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=()=>{r(),s(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map(e=>{const t=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]])}return n}(e,["type"]);return t}),{type:s}=n[0];this.mutationCb({id:t,type:s,commands:r}),this.pendingCanvasMutations.delete(e)}}class Cl{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new Ic,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(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const t of e){let e;if(this.styleMirror.has(t))e=this.styleMirror.getId(t);else{e=this.styleMirror.add(t);const n=Array.from(t.rules||CSSRule);r.push({styleId:e,rules:n.map((e,t)=>({rule:Ua(e),index:t}))})}n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}function Sl(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}let _l,Il,El,Tl=!1;const Al=new ja;function kl(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:i="rr-ignore",maskTextClass:a="rr-mask",maskTextSelector:c=null,inlineStylesheet:l=!0,maskAllInputs:u,maskInputOptions:h,slimDOMOptions:d,maskInputFn:p,maskTextFn:f,hooks:g,packFn:m,sampling:y={},dataURLOptions:v={},mousemoveWait:b,recordCanvas:w=!1,recordCrossOriginIframes:C=!1,userTriggeredOnInput:S=!1,collectFonts:_=!1,inlineImages:I=!1,plugins:E,keepIframeSrcFn:T=()=>!1,ignoreCSSAttributes:A=new Set([])}=e,k=!C||window.parent===window;let O=!1;if(!k)try{window.parent.document,O=!1}catch(e){O=!0}if(k&&!t)throw new Error("emit function is required");void 0!==b&&void 0===y.mousemove&&(y.mousemove=b),Al.reset();const R=!0===u?{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}:void 0!==h?h:{password:!0},x=!0===d||"all"===d?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===d,headMetaDescKeywords:"all"===d}:d||{};let N;!function(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),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}();let L=0;const M=e=>{for(const t of E||[])t.eventProcessor&&(e=t.eventProcessor(e));return m&&(e=m(e)),e};_l=(e,s)=>{var o;if(!(null===(o=Bc[0])||void 0===o?void 0:o.isFrozen())||e.type===Ec.FullSnapshot||e.type===Ec.IncrementalSnapshot&&e.data.source===Tc.Mutation||Bc.forEach(e=>e.unfreeze()),k)null==t||t(M(e),s);else if(O){const t={type:"rrweb",event:M(e),isCheckout:s};window.parent.postMessage(t,"*")}if(e.type===Ec.FullSnapshot)N=e,L=0;else if(e.type===Ec.IncrementalSnapshot){if(e.data.source===Tc.Mutation&&e.data.isAttachIframe)return;L++;const t=r&&L>=r,s=n&&e.timestamp-N.timestamp>n;(t||s)&&Il(!0)}};const P=e=>{_l(Sl({type:Ec.IncrementalSnapshot,data:Object.assign({source:Tc.Mutation},e)}))},D=e=>_l(Sl({type:Ec.IncrementalSnapshot,data:Object.assign({source:Tc.Scroll},e)})),F=e=>_l(Sl({type:Ec.IncrementalSnapshot,data:Object.assign({source:Tc.CanvasMutation},e)})),B=new Cl({mutationCb:P,adoptedStyleSheetCb:e=>_l(Sl({type:Ec.IncrementalSnapshot,data:Object.assign({source:Tc.AdoptedStyleSheet},e)}))}),U=new tl({mirror:Al,mutationCb:P,stylesheetManager:B,recordCrossOriginIframes:C,wrappedEmit:_l});for(const e of E||[])e.getMirror&&e.getMirror({nodeMirror:Al,crossOriginIframeMirror:U.crossOriginIframeMirror,crossOriginIframeStyleMirror:U.crossOriginIframeStyleMirror});El=new wl({recordCanvas:w,mutationCb:F,win:window,blockClass:s,blockSelector:o,mirror:Al,sampling:y.canvas,dataURLOptions:v});const j=new nl({mutationCb:P,scrollCb:D,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:a,maskTextSelector:c,inlineStylesheet:l,maskInputOptions:R,dataURLOptions:v,maskTextFn:f,maskInputFn:p,recordCanvas:w,inlineImages:I,sampling:y,slimDOMOptions:x,iframeManager:U,stylesheetManager:B,canvasManager:El,keepIframeSrcFn:T},mirror:Al});Il=(e=!1)=>{var t,n,r,i,u,h;_l(Sl({type:Ec.Meta,data:{href:window.location.href,width:mc(),height:gc()}}),e),B.reset(),Bc.forEach(e=>e.lock());const d=function(e,t){var n=t||{},r=n.mirror,s=void 0===r?new ja:r,o=n.blockClass,i=void 0===o?"rr-block":o,a=n.blockSelector,c=void 0===a?null:a,l=n.maskTextClass,u=void 0===l?"rr-mask":l,h=n.maskTextSelector,d=void 0===h?null:h,p=n.inlineStylesheet,f=void 0===p||p,g=n.inlineImages,m=void 0!==g&&g,y=n.recordCanvas,v=void 0!==y&&y,b=n.maskAllInputs,w=void 0!==b&&b,C=n.maskTextFn,S=n.maskInputFn,_=n.slimDOM,I=void 0!==_&&_,E=n.dataURLOptions,T=n.preserveWhiteSpace,A=n.onSerialize,k=n.onIframeLoad,O=n.iframeLoadTimeout,R=n.onStylesheetLoad,x=n.stylesheetLoadTimeout,N=n.keepIframeSrcFn;return cc(e,{doc:e,mirror:s,blockClass:i,blockSelector:c,maskTextClass:u,maskTextSelector:d,skipChild:!1,inlineStylesheet:f,maskInputOptions:!0===w?{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}:!1===w?{password:!0}:w,maskTextFn:C,maskInputFn:S,slimDOMOptions:!0===I||"all"===I?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===I,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===I?{}:I,dataURLOptions:E,inlineImages:m,recordCanvas:v,preserveWhiteSpace:T,onSerialize:A,onIframeLoad:k,iframeLoadTimeout:O,onStylesheetLoad:R,stylesheetLoadTimeout:x,keepIframeSrcFn:void 0===N?function(){return!1}:N,newlyAddedElement:!1})}(document,{mirror:Al,blockClass:s,blockSelector:o,maskTextClass:a,maskTextSelector:c,inlineStylesheet:l,maskAllInputs:R,maskTextFn:f,slimDOM:x,dataURLOptions:v,recordCanvas:w,inlineImages:I,onSerialize:e=>{Cc(e,Al)&&U.addIframe(e),Sc(e,Al)&&B.trackLinkElement(e),_c(e)&&j.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{U.attachIframe(e,t),j.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{B.attachLinkElement(e,t)},keepIframeSrcFn:T});if(!d)return console.warn("Failed to snapshot the document");_l(Sl({type:Ec.FullSnapshot,data:{node:d,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(r=null===document||void 0===document?void 0:document.body)||void 0===r?void 0:r.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(u=null===(i=null===document||void 0===document?void 0:document.body)||void 0===i?void 0:i.parentElement)||void 0===u?void 0:u.scrollTop)||(null===(h=null===document||void 0===document?void 0:document.body)||void 0===h?void 0:h.scrollTop)||0}}})),Bc.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&B.adoptStyleSheets(document.adoptedStyleSheets,Al.getId(document))};try{const e=[];e.push(lc("DOMContentLoaded",()=>{_l(Sl({type:Ec.DomContentLoaded,data:{}}))}));const t=e=>{var t;return Qc({mutationCb:P,mousemoveCb:(e,t)=>_l(Sl({type:Ec.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>_l(Sl({type:Ec.IncrementalSnapshot,data:Object.assign({source:Tc.MouseInteraction},e)})),scrollCb:D,viewportResizeCb:e=>_l(Sl({type:Ec.IncrementalSnapshot,data:Object.assign({source:Tc.ViewportResize},e)})),inputCb:e=>_l(Sl({type:Ec.IncrementalSnapshot,data:Object.assign({source:Tc.Input},e)})),mediaInteractionCb:e=>_l(Sl({type:Ec.IncrementalSnapshot,data:Object.assign({source:Tc.MediaInteraction},e)})),styleSheetRuleCb:e=>_l(Sl({type:Ec.IncrementalSnapshot,data:Object.assign({source:Tc.StyleSheetRule},e)})),styleDeclarationCb:e=>_l(Sl({type:Ec.IncrementalSnapshot,data:Object.assign({source:Tc.StyleDeclaration},e)})),canvasMutationCb:F,fontCb:e=>_l(Sl({type:Ec.IncrementalSnapshot,data:Object.assign({source:Tc.Font},e)})),selectionCb:e=>{_l(Sl({type:Ec.IncrementalSnapshot,data:Object.assign({source:Tc.Selection},e)}))},blockClass:s,ignoreClass:i,maskTextClass:a,maskTextSelector:c,maskInputOptions:R,inlineStylesheet:l,sampling:y,recordCanvas:w,inlineImages:I,userTriggeredOnInput:S,collectFonts:_,doc:e,maskInputFn:p,maskTextFn:f,keepIframeSrcFn:T,blockSelector:o,slimDOMOptions:x,dataURLOptions:v,mirror:Al,iframeManager:U,stylesheetManager:B,shadowDomManager:j,canvasManager:El,ignoreCSSAttributes:A,plugins:(null===(t=null==E?void 0:E.filter(e=>e.observer))||void 0===t?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>_l(Sl({type:Ec.Plugin,data:{plugin:e.name,payload:t}}))})))||[]},g)};U.addLoadListener(n=>{e.push(t(n.contentDocument))});const n=()=>{Il(),e.push(t(document)),Tl=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():e.push(lc("load",()=>{_l(Sl({type:Ec.Load,data:{}})),n()},window)),()=>{e.forEach(e=>e()),Tl=!1}}catch(e){console.warn(e)}}kl.addCustomEvent=(e,t)=>{if(!Tl)throw new Error("please add custom event after start recording");_l(Sl({type:Ec.Custom,data:{tag:e,payload:t}}))},kl.freezePage=()=>{Bc.forEach(e=>e.freeze())},kl.takeFullSnapshot=e=>{if(!Tl)throw new Error("please take full snapshot after start recording");Il(e)},kl.mirror=Al;const Ol=5e3;class Rl{constructor(e,t,n){this.events=[],this.stopRecording=void 0,this.saveInterval=null,this.isSaving=!1,this.isConfigured=!1,this._enabled=!0,this.userAttributes={},this._listenersAttached=!1,this.handleUnload=()=>this.save(!0),this.handleVisibilityChange=()=>{"hidden"===document.visibilityState&&this.save()},this.sessionId=t,this.tabId=n,this.config=e,this.setupListeners()}setupListeners(){"undefined"==typeof window||this._listenersAttached||(this._listenersAttached=!0,window.addEventListener("beforeunload",this.handleUnload),window.addEventListener("pagehide",this.handleUnload),document.addEventListener("visibilitychange",this.handleVisibilityChange))}removeListeners(){"undefined"!=typeof window&&this._listenersAttached&&(this._listenersAttached=!1,window.removeEventListener("beforeunload",this.handleUnload),window.removeEventListener("pagehide",this.handleUnload),document.removeEventListener("visibilitychange",this.handleVisibilityChange))}trimEvents(){if(this.events.length<=Ol)return;this.config.debug&&console.warn("Event queue exceeded 5000, dropping middle events (preserving snapshots)");const e=this.events.filter(e=>2===e.type),t=this.events.filter(e=>2!==e.type),n=Math.max(0,Ol-e.length);this.events=[...e,...t.slice(-n)],this.events.sort((e,t)=>e.timestamp-t.timestamp)}configure(){if("undefined"==typeof window)return;if(this.isConfigured)return;this.setupListeners();const e=Math.max(0,Math.min(1,this.config.replaySampleRate??1));if(Math.random()>=e)return this._enabled=!1,void(this.config.debug&&console.log("MonoscopeReplay: sampled out"));try{this.stopRecording=kl({emit:e=>{this._enabled&&(this.events.push(e),this.events.length>=50&&this.save())},blockClass:"rr-block",maskAllInputs:!0,maskInputOptions:{password:!0,email:!0,tel:!0},maskTextClass:"rr-mask",checkoutEveryNms:15e3,sampling:{mouseInteraction:{MouseUp:!1,MouseDown:!1,Click:!0,ContextMenu:!1,DblClick:!0,Focus:!1,Blur:!1,TouchStart:!0,TouchEnd:!1},mousemove:!0,scroll:150,media:800,input:"last"},plugins:[(t={level:["info","log","warn","error"],lengthThreshold:1e4,stringifyOptions:{stringLengthLimit:1e3,numOfKeysLimit:100,depthOfLimit:2}},{name:"rrweb/console@1",observer:Ma,options:t})]}),this.saveInterval=setInterval(()=>this.save(),2e3),this.isConfigured=!0,this.config.debug&&console.log("MonoscopeReplay configured successfully")}catch(e){console.warn("Monoscope: failed to configure replay",e)}var t}async save(e=!1){if(this.isSaving&&!e)return;if(0===this.events.length)return;this.trimEvents(),this.isSaving=!0;const t=this.config.apiKey||this.config.projectId||"",n=`${this.config.replayEventsBaseUrl||"https://app.monoscope.tech"}/api/v1/rrweb`,r=[...this.events];this.events=[];const s={events:r,sessionId:this.sessionId,tabId:this.tabId,timestamp:(new Date).toISOString(),eventCount:r.length,user:Object.keys(this.userAttributes).length>0?this.userAttributes:void 0},o={"Content-Type":"application/json",Authorization:`Bearer ${t}`};try{if(e&&"undefined"!=typeof navigator&&navigator.sendBeacon){const e=new Blob([JSON.stringify(s)],{type:"application/json"});navigator.sendBeacon(n,e)||fetch(n,{method:"POST",headers:o,body:JSON.stringify(s),keepalive:!0}).catch(()=>{})}else{const e=JSON.stringify(s),t=await fetch(n,{method:"POST",headers:o,body:e,keepalive:e.length<63e3});if(!t.ok){const e=t.status;throw 401===e||403===e?console.warn("[Monoscope] Replay upload authentication failed. Your apiKey may be invalid."):console.warn(`[Monoscope] Replay upload failed (${e}). Check your apiKey and network.`),new Error(`Failed to save replay events: ${e} ${t.statusText}`)}this.config.debug&&console.log(`Successfully saved ${r.length} replay events`)}}catch(e){console.warn("Monoscope: failed to save replay events:",e),this.events=[...r,...this.events],this.trimEvents()}finally{this.isSaving=!1}}stop(){this.save(!0).catch(()=>{}),this.stopRecording&&(this.stopRecording(),this.stopRecording=void 0),this.saveInterval&&(clearInterval(this.saveInterval),this.saveInterval=null),this.removeListeners(),this.isConfigured=!1,this.config.debug&&console.log("MonoscopeReplay stopped")}setEnabled(e){this._enabled=e,e||this.stop()}setUser(e){this.userAttributes={...this.userAttributes,...e}}getEventCount(){return this.events.length}updateSessionId(e){this.sessionId=e}getSessionId(){return this.sessionId}isRecording(){return this.isConfigured&&void 0!==this.stopRecording}}const xl="1.9.1",Nl=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;const Ll=function(e){const t=new Set([e]),n=new Set,r=e.match(Nl);if(!r)return()=>!1;const s=+r[1],o=+r[2],i=+r[3];if(null!=r[4])return function(t){return t===e};function a(e){return n.add(e),!1}function c(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;const r=e.match(Nl);if(!r)return a(e);const l=+r[1],u=+r[2],h=+r[3];return null!=r[4]||s!==l?a(e):0===s?o===u&&i<=h?c(e):a(e):o<=u?c(e):a(e)}}(xl),Ml=xl.split(".")[0],Pl=Symbol.for(`opentelemetry.js.api.${Ml}`),Dl="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{};function Fl(e,t,n,r=!1){var s;const o=Dl[Pl]=null!==(s=Dl[Pl])&&void 0!==s?s:{version:xl};if(!r&&o[e]){const t=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(t.stack||t.message),!1}if(o.version!==xl){const t=new Error(`@opentelemetry/api: Registration of version v${o.version} for ${e} does not match previously registered API v${xl}`);return n.error(t.stack||t.message),!1}return o[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${xl}.`),!0}function Bl(e){var t,n;const r=null===(t=Dl[Pl])||void 0===t?void 0:t.version;if(r&&Ll(r))return null===(n=Dl[Pl])||void 0===n?void 0:n[e]}function Ul(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${xl}.`);const n=Dl[Pl];n&&delete n[e]}class jl{constructor(e){this._namespace=e.namespace||"DiagComponentLogger"}debug(...e){return Zl("debug",this._namespace,e)}error(...e){return Zl("error",this._namespace,e)}info(...e){return Zl("info",this._namespace,e)}warn(...e){return Zl("warn",this._namespace,e)}verbose(...e){return Zl("verbose",this._namespace,e)}}function Zl(e,t,n){const r=Bl("diag");if(r)return r[e](t,...n)}var zl;!function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"}(zl||(zl={}));class Vl{static instance(){return this._instance||(this._instance=new Vl),this._instance}constructor(){function e(e){return function(...t){const n=Bl("diag");if(n)return n[e](...t)}}const t=this;t.setLogger=(e,n={logLevel:zl.INFO})=>{var r,s,o;if(e===t){const e=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error(null!==(r=e.stack)&&void 0!==r?r:e.message),!1}"number"==typeof n&&(n={logLevel:n});const i=Bl("diag"),a=function(e,t){function n(n,r){const s=t[n];return"function"==typeof s&&e>=r?s.bind(t):function(){}}return e<zl.NONE?e=zl.NONE:e>zl.ALL&&(e=zl.ALL),t=t||{},{error:n("error",zl.ERROR),warn:n("warn",zl.WARN),info:n("info",zl.INFO),debug:n("debug",zl.DEBUG),verbose:n("verbose",zl.VERBOSE)}}(null!==(s=n.logLevel)&&void 0!==s?s:zl.INFO,e);if(i&&!n.suppressOverrideMessage){const e=null!==(o=(new Error).stack)&&void 0!==o?o:"<failed to generate stacktrace>";i.warn(`Current logger will be overwritten from ${e}`),a.warn(`Current logger will overwrite one already registered from ${e}`)}return Fl("diag",a,t,!0)},t.disable=()=>{Ul("diag",t)},t.createComponentLogger=e=>new jl(e),t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}}class Hl{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){const t=this._entries.get(e);if(t)return Object.assign({},t)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(e,t){const n=new Hl(this._entries);return n._entries.set(e,t),n}removeEntry(e){const t=new Hl(this._entries);return t._entries.delete(e),t}removeEntries(...e){const t=new Hl(this._entries);for(const n of e)t._entries.delete(n);return t}clear(){return new Hl}}const Gl=Symbol("BaggageEntryMetadata"),Wl=Vl.instance();function Yl(e={}){return new Hl(new Map(Object.entries(e)))}function Kl(e){return Symbol.for(e)}class Jl{constructor(e){const t=this;t._currentContext=e?new Map(e):new Map,t.getValue=e=>t._currentContext.get(e),t.setValue=(e,n)=>{const r=new Jl(t._currentContext);return r._currentContext.set(e,n),r},t.deleteValue=e=>{const n=new Jl(t._currentContext);return n._currentContext.delete(e),n}}}const Xl=new Jl;class $l{}class ql{addCallback(e){}removeCallback(e){}}const Ql=new class{constructor(){}createGauge(e,t){return tu}createHistogram(e,t){return nu}createCounter(e,t){return eu}createUpDownCounter(e,t){return ru}createObservableGauge(e,t){return ou}createObservableCounter(e,t){return su}createObservableUpDownCounter(e,t){return iu}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},eu=new class extends $l{add(e,t){}},tu=new class extends $l{record(e,t){}},nu=new class extends $l{record(e,t){}},ru=new class extends $l{add(e,t){}},su=new class extends ql{},ou=new class extends ql{},iu=new class extends ql{};const au={get(e,t){if(null!=e)return e[t]},keys:e=>null==e?[]:Object.keys(e)},cu={set(e,t,n){null!=e&&(e[t]=n)}};const lu="context",uu=new class{active(){return Xl}with(e,t,n,...r){return t.call(n,...r)}bind(e,t){return t}enable(){return this}disable(){return this}};class hu{constructor(){}static getInstance(){return this._instance||(this._instance=new hu),this._instance}setGlobalContextManager(e){return Fl(lu,e,Vl.instance())}active(){return this._getContextManager().active()}with(e,t,n,...r){return this._getContextManager().with(e,t,n,...r)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return Bl(lu)||uu}disable(){this._getContextManager().disable(),Ul(lu,Vl.instance())}}var du;!function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"}(du||(du={}));const pu="0000000000000000",fu="00000000000000000000000000000000",gu={traceId:fu,spanId:pu,traceFlags:du.NONE};class mu{constructor(e=gu){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}}const yu=Kl("OpenTelemetry Context Key SPAN");function vu(e){return e.getValue(yu)||void 0}function bu(){return vu(hu.getInstance().active())}function wu(e,t){return e.setValue(yu,t)}function Cu(e){return e.deleteValue(yu)}function Su(e,t){return wu(e,new mu(t))}function _u(e){var t;return null===(t=vu(e))||void 0===t?void 0:t.spanContext()}const Iu=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]);function Eu(e,t){if("string"!=typeof e||e.length!==t)return!1;let n=0;for(let t=0;t<e.length;t+=4)n+=(0|Iu[e.charCodeAt(t)])+(0|Iu[e.charCodeAt(t+1)])+(0|Iu[e.charCodeAt(t+2)])+(0|Iu[e.charCodeAt(t+3)]);return n===t}function Tu(e){return Eu(e,32)&&e!==fu}function Au(e){return Tu(e.traceId)&&(Eu(t=e.spanId,16)&&t!==pu);var t}function ku(e){return new mu(e)}const Ou=hu.getInstance();class Ru{startSpan(e,t,n=Ou.active()){if(Boolean(null==t?void 0:t.root))return new mu;const r=n&&_u(n);return null!==(s=r)&&"object"==typeof s&&"spanId"in s&&"string"==typeof s.spanId&&"traceId"in s&&"string"==typeof s.traceId&&"traceFlags"in s&&"number"==typeof s.traceFlags&&Au(r)?new mu(r):new mu;var s}startActiveSpan(e,t,n,r){let s,o,i;if(arguments.length<2)return;2===arguments.length?i=t:3===arguments.length?(s=t,i=n):(s=t,o=n,i=r);const a=null!=o?o:Ou.active(),c=this.startSpan(e,s,a),l=wu(a,c);return Ou.with(l,i,void 0,c)}}const xu=new Ru;class Nu{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}startSpan(e,t,n){return this._getTracer().startSpan(e,t,n)}startActiveSpan(e,t,n,r){const s=this._getTracer();return Reflect.apply(s.startActiveSpan,s,arguments)}_getTracer(){if(this._delegate)return this._delegate;const e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):xu}}const Lu=new class{getTracer(e,t,n){return new Ru}};class Mu{getTracer(e,t,n){var r;return null!==(r=this.getDelegateTracer(e,t,n))&&void 0!==r?r:new Nu(this,e,t,n)}getDelegate(){var e;return null!==(e=this._delegate)&&void 0!==e?e:Lu}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,n){var r;return null===(r=this._delegate)||void 0===r?void 0:r.getTracer(e,t,n)}}var Pu,Du,Fu;!function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(Pu||(Pu={})),function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"}(Du||(Du={})),function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"}(Fu||(Fu={}));const Bu=hu.getInstance(),Uu=Vl.instance();const ju=new class{getMeter(e,t,n){return Ql}},Zu="metrics";class zu{constructor(){}static getInstance(){return this._instance||(this._instance=new zu),this._instance}setGlobalMeterProvider(e){return Fl(Zu,e,Vl.instance())}getMeterProvider(){return Bl(Zu)||ju}getMeter(e,t,n){return this.getMeterProvider().getMeter(e,t,n)}disable(){Ul(Zu,Vl.instance())}}const Vu=zu.getInstance();const Hu=Kl("OpenTelemetry Baggage Key");function Gu(e){return e.getValue(Hu)||void 0}function Wu(){return Gu(hu.getInstance().active())}function Yu(e,t){return e.setValue(Hu,t)}function Ku(e){return e.deleteValue(Hu)}const Ju="propagation",Xu=new class{inject(e,t){}extract(e,t){return e}fields(){return[]}};class $u{constructor(){this.createBaggage=Yl,this.getBaggage=Gu,this.getActiveBaggage=Wu,this.setBaggage=Yu,this.deleteBaggage=Ku}static getInstance(){return this._instance||(this._instance=new $u),this._instance}setGlobalPropagator(e){return Fl(Ju,e,Vl.instance())}inject(e,t,n=cu){return this._getGlobalPropagator().inject(e,t,n)}extract(e,t,n=au){return this._getGlobalPropagator().extract(e,t,n)}fields(){return this._getGlobalPropagator().fields()}disable(){Ul(Ju,Vl.instance())}_getGlobalPropagator(){return Bl(Ju)||Xu}}const qu=$u.getInstance(),Qu="trace";class eh{constructor(){this._proxyTracerProvider=new Mu,this.wrapSpanContext=ku,this.isSpanContextValid=Au,this.deleteSpan=Cu,this.getSpan=vu,this.getActiveSpan=bu,this.getSpanContext=_u,this.setSpan=wu,this.setSpanContext=Su}static getInstance(){return this._instance||(this._instance=new eh),this._instance}setGlobalTracerProvider(e){const t=Fl(Qu,this._proxyTracerProvider,Vl.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return Bl(Qu)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){Ul(Qu,Vl.instance()),this._proxyTracerProvider=new Mu}}const th=eh.getInstance(),nh=Kl("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function rh(e){return!0===e.getValue(nh)}const sh="baggage";function oh(e){if(!e)return;const t=e.indexOf(";"),n=-1===t?e:e.substring(0,t),r=n.indexOf("=");if(r<=0)return;const s=n.substring(0,r).trim(),o=n.substring(r+1).trim();if(!s||!o)return;let i,a,c;try{i=decodeURIComponent(s),a=decodeURIComponent(o)}catch{return}if(-1!==t&&t<e.length-1){const n=e.substring(t+1);"string"!=typeof(l=n)&&(Wl.error("Cannot create baggage metadata from unknown type: "+typeof l),l=""),c={__TYPE__:Gl,toString:()=>l}}var l;return{key:i,value:a,metadata:c}}class ih{inject(e,t,n){const r=qu.getBaggage(e);if(!r||rh(e))return;const s=function(e){return e.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return void 0!==t.metadata&&(n+=";"+t.metadata.toString()),n})}(r).filter(e=>e.length<=4096).slice(0,180),o=function(e){return e.reduce((e,t)=>{const n=`${e}${""!==e?",":""}${t}`;return n.length>8192?e:n},"")}(s);o.length>0&&n.set(t,sh,o)}extract(e,t,n){const r=n.get(t,sh),s=Array.isArray(r)?r.join(","):r;if(!s)return e;const o={};if(0===s.length)return e;return s.split(",").forEach(e=>{const t=oh(e);if(t){const e={value:t.value};t.metadata&&(e.metadata=t.metadata),o[t.key]=e}}),0===Object.entries(o).length?e:qu.setBaggage(e,qu.createBaggage(o))}fields(){return[sh]}}function ah(e){const t={};if("object"!=typeof e||null==e)return t;for(const n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!ch(n)){Uu.warn(`Invalid attribute key: ${n}`);continue}const r=e[n];lh(r)?Array.isArray(r)?t[n]=r.slice():t[n]=r:Uu.warn(`Invalid attribute value set for key: ${n}`)}return t}function ch(e){return"string"==typeof e&&""!==e}function lh(e){return null==e||(Array.isArray(e)?function(e){let t;for(const n of e){if(null==n)continue;const e=typeof n;if(e!==t){if(!t){if(uh(e)){t=e;continue}return!1}return!1}}return!0}(e):uh(typeof e))}function uh(e){switch(e){case"number":case"boolean":case"string":return!0}return!1}let hh=e=>{Uu.error(function(e){return"string"==typeof e?e:JSON.stringify(function(e){const t={};let n=e;for(;null!==n;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;const r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}(e))}(e))};function dh(e){try{hh(e)}catch{}}const ph="http.url",fh="error.type",gh="exception.message",mh="exception.type",yh="http.request.method",vh="http.request.method_original",bh="http.response.status_code",wh="server.address",Ch="server.port",Sh="service.name",_h="telemetry.sdk.language",Ih="telemetry.sdk.name",Eh="telemetry.sdk.version",Th="url.full",Ah="process.runtime.name",kh={[Ih]:"opentelemetry",[Ah]:"browser",[_h]:"webjs",[Eh]:"2.6.1"},Oh=performance,Rh=Math.pow(10,6),xh=Math.pow(10,9);function Nh(e){const t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*Rh)]}function Lh(e){return Dh(Nh(Oh.timeOrigin),Nh("number"==typeof e?e:Oh.now()))}function Mh(e){return Array.isArray(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]}function Ph(e){return Mh(e)||"number"==typeof e||e instanceof Date}function Dh(e,t){const n=[e[0]+t[0],e[1]+t[1]];return n[1]>=xh&&(n[1]-=xh,n[0]+=1),n}var Fh;!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"}(Fh||(Fh={}));class Bh{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(e=>"function"==typeof e.fields?e.fields():[]).reduce((e,t)=>e.concat(t),[])))}inject(e,t,n){for(const r of this._propagators)try{r.inject(e,t,n)}catch(e){Uu.warn(`Failed to inject with ${r.constructor.name}. Err: ${e.message}`)}}extract(e,t,n){return this._propagators.reduce((e,r)=>{try{return r.extract(e,t,n)}catch(e){Uu.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}}const Uh="[_0-9a-z-*/]",jh=new RegExp(`^(?:${`[a-z]${Uh}{0,255}`}|${`[a-z0-9]${Uh}{0,240}@[a-z]${Uh}{0,13}`})$`),Zh=/^[ -~]{0,255}[!-~]$/,zh=/,|=/;class Vh{_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,t){const n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,t),n}unset(e){const t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+"="+this.get(t)),e),[]).join(",")}_parse(e){e.length>512||(this._internalState=e.split(",").reverse().reduce((e,t)=>{const n=t.trim(),r=n.indexOf("=");if(-1!==r){const s=n.slice(0,r),o=n.slice(r+1,t.length);(function(e){return jh.test(e)})(s)&&function(e){return Zh.test(e)&&!zh.test(e)}(o)&&e.set(s,o)}return e},new Map),this._internalState.size>32&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,32))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){const e=new Vh;return e._internalState=new Map(this._internalState),e}}const Hh="traceparent",Gh="tracestate",Wh=new RegExp("^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$");class Yh{inject(e,t,n){const r=th.getSpanContext(e);if(!r||rh(e)||!Au(r))return;const s=`00-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||du.NONE).toString(16)}`;n.set(t,Hh,s),r.traceState&&n.set(t,Gh,r.traceState.serialize())}extract(e,t,n){const r=n.get(t,Hh);if(!r)return e;const s=Array.isArray(r)?r[0]:r;if("string"!=typeof s)return e;const o=function(e){const t=Wh.exec(e);return t?"00"===t[1]&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}:null}(s);if(!o)return e;o.isRemote=!0;const i=n.get(t,Gh);if(i){const e=Array.isArray(i)?i.join(","):i;o.traceState=new Vh("string"==typeof e?e:void 0)}return th.setSpanContext(e,o)}fields(){return[Hh,Gh]}}const Kh="[object Null]",Jh="[object Undefined]",Xh=Function.prototype.toString,$h=Xh.call(Object),qh=Object.getPrototypeOf,Qh=Object.prototype,ed=Qh.hasOwnProperty,td=Symbol?Symbol.toStringTag:void 0,nd=Qh.toString;function rd(e){if(!function(e){return null!=e&&"object"==typeof e}(e)||"[object Object]"!==function(e){if(null==e)return void 0===e?Jh:Kh;return td&&td in Object(e)?function(e){const t=ed.call(e,td),n=e[td];let r=!1;try{e[td]=void 0,r=!0}catch{}const s=nd.call(e);r&&(t?e[td]=n:delete e[td]);return s}(e):function(e){return nd.call(e)}(e)}(e))return!1;const t=qh(e);if(null===t)return!0;const n=ed.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Xh.call(n)===$h}function sd(e){return ad(e)?e.slice():e}function od(e,t,n=0,r){let s;if(!(n>20)){if(n++,ud(e)||ud(t)||cd(t))s=sd(t);else if(ad(e)){if(s=e.slice(),ad(t))for(let e=0,n=t.length;e<n;e++)s.push(sd(t[e]));else if(ld(t)){const e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){const r=e[n];s[r]=sd(t[r])}}}else if(ld(e))if(ld(t)){if(!function(e,t){if(!rd(e)||!rd(t))return!1;return!0}(e,t))return t;s=Object.assign({},e);const o=Object.keys(t);for(let i=0,a=o.length;i<a;i++){const a=o[i],c=t[a];if(ud(c))void 0===c?delete s[a]:s[a]=c;else{const o=s[a],i=c;if(id(e,a,r)||id(t,a,r))delete s[a];else{if(ld(o)&&ld(i)){const n=r.get(o)||[],s=r.get(i)||[];n.push({obj:e,key:a}),s.push({obj:t,key:a}),r.set(o,n),r.set(i,s)}s[a]=od(s[a],c,n,r)}}}}else s=t;return s}}function id(e,t,n){const r=n.get(e[t])||[];for(let n=0,s=r.length;n<s;n++){const s=r[n];if(s.key===t&&s.obj===e)return!0}return!1}function ad(e){return Array.isArray(e)}function cd(e){return"function"==typeof e}function ld(e){return!ud(e)&&!ad(e)&&!cd(e)&&"object"==typeof e}function ud(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||void 0===e||e instanceof Date||e instanceof RegExp||null===e}class hd{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}class dd{_isCalled=!1;_deferred=new hd;_callback;_that;constructor(e,t){this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}}let pd;function fd(){if(void 0===pd)try{const e=globalThis.process.argv0;pd=e?`unknown_service:${e}`:"unknown_service"}catch{pd="unknown_service"}return pd}const gd=e=>null!==e&&"object"==typeof e&&"function"==typeof e.then;class md{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(e,t){const n=new md({},t);return n._rawAttributes=vd(e),n._asyncAttributesPending=e.filter(([e,t])=>gd(t)).length>0,n}constructor(e,t){const n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([e,t])=>(gd(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=vd(this._rawAttributes),this._schemaUrl=function(e){if("string"==typeof e||void 0===e)return e;return void Uu.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",e)}(t?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){const[t,n]=this._rawAttributes[e];this._rawAttributes[e]=[t,gd(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Uu.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const e={};for(const[t,n]of this._rawAttributes)gd(n)?Uu.debug(`Unsettled resource attribute ${t} skipped`):null!=n&&(e[t]??=n);return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(e){if(null==e)return this;const t=function(e,t){const n=e?.schemaUrl,r=t?.schemaUrl,s=void 0===n||""===n,o=void 0===r||""===r;if(s)return r;if(o)return n;if(n===r)return n;return void Uu.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',n,r)}(this,e),n=t?{schemaUrl:t}:void 0;return md.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()],n)}}function yd(e,t){return md.FromAttributeList(Object.entries(e),t)}function vd(e){return e.map(([e,t])=>gd(t)?[e,t.catch(t=>{Uu.debug("promise rejection for resource attribute: %s - %s",e,t)})]:[e,t])}class bd{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:Fu.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){const t=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=Oh.now(),this._performanceOffset=t-(this._performanceStartTime+Oh.timeOrigin),this._startTimeProvided=null!=e.startTime,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,e.links)for(const t of e.links)this.addLink(t);this.startTime=this._getTime(e.startTime??t),this.resource=e.resource,this.instrumentationScope=e.scope,this._recordEndMetrics=e.recordEndMetrics,null!=e.attributes&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(null==t||this._isSpanEnded())return this;if(0===e.length)return Uu.warn(`Invalid attribute key: ${e}`),this;if(!lh(t))return Uu.warn(`Invalid attribute value set for key: ${e}`),this;const{attributeCountLimit:n}=this._spanLimits,r=!Object.prototype.hasOwnProperty.call(this.attributes,e);return void 0!==n&&this._attributesCount>=n&&r?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),r&&this._attributesCount++,this)}setAttributes(e){for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.setAttribute(t,e[t]);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;const{eventCountLimit:r}=this._spanLimits;if(0===r)return Uu.warn("No events allowed."),this._droppedEventsCount++,this;void 0!==r&&this.events.length>=r&&(0===this._droppedEventsCount&&Uu.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),Ph(t)&&(Ph(n)||(n=t),t=void 0);const s=ah(t),{attributePerEventCountLimit:o}=this._spanLimits,i={};let a=0,c=0;for(const e in s){if(!Object.prototype.hasOwnProperty.call(s,e))continue;const t=s[e];void 0!==o&&c>=o?a++:(i[e]=this._truncateToSize(t),c++)}return this.events.push({name:e,attributes:i,time:this._getTime(n),droppedAttributesCount:a}),this}addLink(e){if(this._isSpanEnded())return this;const{linkCountLimit:t}=this._spanLimits;if(0===t)return this._droppedLinksCount++,this;void 0!==t&&this.links.length>=t&&(0===this._droppedLinksCount&&Uu.debug("Dropping extra links."),this.links.shift(),this._droppedLinksCount++);const{attributePerLinkCountLimit:n}=this._spanLimits,r=ah(e.attributes),s={};let o=0,i=0;for(const e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;const t=r[e];void 0!==n&&i>=n?o++:(s[e]=this._truncateToSize(t),i++)}const a={context:e.context};return i>0&&(a.attributes=s),o>0&&(a.droppedAttributesCount=o),this.links.push(a),this}addLinks(e){for(const t of e)this.addLink(t);return this}setStatus(e){if(this._isSpanEnded())return this;if(e.code===Fu.UNSET)return this;if(this.status.code===Fu.OK)return this;const t={code:e.code};return e.code===Fu.ERROR&&("string"==typeof e.message?t.message=e.message:null!=e.message&&Uu.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)),this.status=t,this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){this._isSpanEnded()?Uu.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`):(this.endTime=this._getTime(e),this._duration=function(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(n-=1,r+=xh),[n,r]}(this.startTime,this.endTime),this._duration[0]<0&&(Uu.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&Uu.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&Uu.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this))}_getTime(e){if("number"==typeof e&&e<=Oh.now())return Lh(e+this._performanceOffset);if("number"==typeof e)return Nh(e);if(e instanceof Date)return Nh(e.getTime());if(Mh(e))return e;if(this._startTimeProvided)return Nh(Date.now());const t=Oh.now()-this._performanceStartTime;return Dh(this.startTime,Nh(t))}isRecording(){return!1===this._ended}recordException(e,t){const n={};"string"==typeof e?n[gh]=e:e&&(e.code?n[mh]=e.code.toString():e.name&&(n[mh]=e.name),e.message&&(n[gh]=e.message),e.stack&&(n["exception.stacktrace"]=e.stack)),n[mh]||n[gh]?this.addEvent("exception",n,t):Uu.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){const e=new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);Uu.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){const t=this._attributeValueLengthLimit;return t<=0?(Uu.warn(`Attribute value limit must be positive, got ${t}`),e):"string"==typeof e?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>"string"==typeof e?this._truncateToLimitUtil(e,t):e):e}}var wd,Cd;!function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(wd||(wd={}));class Sd{shouldSample(){return{decision:wd.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class _d{shouldSample(){return{decision:wd.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class Id{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||(dh(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new _d),this._remoteParentSampled=e.remoteParentSampled??new _d,this._remoteParentNotSampled=e.remoteParentNotSampled??new Sd,this._localParentSampled=e.localParentSampled??new _d,this._localParentNotSampled=e.localParentNotSampled??new Sd}shouldSample(e,t,n,r,s,o){const i=th.getSpanContext(e);return i&&Au(i)?i.isRemote?i.traceFlags&du.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,s,o):this._remoteParentNotSampled.shouldSample(e,t,n,r,s,o):i.traceFlags&du.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,s,o):this._localParentNotSampled.shouldSample(e,t,n,r,s,o):this._root.shouldSample(e,t,n,r,s,o)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}class Ed{_ratio;_upperBound;constructor(e=0){this._ratio=this._normalize(e),this._upperBound=Math.floor(4294967295*this._ratio)}shouldSample(e,t){return{decision:Tu(t)&&this._accumulate(t)<this._upperBound?wd.RECORD_AND_SAMPLED:wd.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return"number"!=typeof e||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<e.length/8;n++){const r=8*n;t=(t^parseInt(e.slice(r,r+8),16))>>>0}return t}}!function(e){e.AlwaysOff="always_off",e.AlwaysOn="always_on",e.ParentBasedAlwaysOff="parentbased_always_off",e.ParentBasedAlwaysOn="parentbased_always_on",e.ParentBasedTraceIdRatio="parentbased_traceidratio",e.TraceIdRatio="traceidratio"}(Cd||(Cd={}));function Td(){return{sampler:Ad(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function Ad(){const e=Cd.ParentBasedAlwaysOn;switch(e){case Cd.AlwaysOn:return new _d;case Cd.AlwaysOff:return new Sd;case Cd.ParentBasedAlwaysOn:return new Id({root:new _d});case Cd.ParentBasedAlwaysOff:return new Id({root:new Sd});case Cd.TraceIdRatio:return new Ed(kd());case Cd.ParentBasedTraceIdRatio:return new Id({root:new Ed(kd())});default:return Uu.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${Cd.ParentBasedAlwaysOn}".`),new Id({root:new _d})}}function kd(){return Uu.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to 1."),1}const Od=1/0;class Rd{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e,t){this._exporter=e,this._maxExportBatchSize="number"==typeof t?.maxExportBatchSize?t.maxExportBatchSize:512,this._maxQueueSize="number"==typeof t?.maxQueueSize?t.maxQueueSize:2048,this._scheduledDelayMillis="number"==typeof t?.scheduledDelayMillis?t.scheduledDelayMillis:5e3,this._exportTimeoutMillis="number"==typeof t?.exportTimeoutMillis?t.exportTimeoutMillis:3e4,this._shutdownOnce=new dd(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Uu.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||0!==(e.spanContext().traceFlags&du.SAMPLED)&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize)return 0===this._droppedSpansCount&&Uu.debug("maxQueueSize reached, dropping spans"),void this._droppedSpansCount++;this._droppedSpansCount>0&&(Uu.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{const n=[];for(let e=0,t=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);e<t;e++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),0===this._finishedSpans.length?Promise.resolve():new Promise((e,t)=>{const n=setTimeout(()=>{t(new Error("Timeout"))},this._exportTimeoutMillis);Bu.with(function(e){return e.setValue(nh,!0)}(Bu.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);const s=()=>this._exporter.export(r,r=>{clearTimeout(n),r.code===Fh.SUCCESS?e():t(r.error??new Error("BatchSpanProcessor: span export failed"))});let o=null;for(let e=0,t=r.length;e<t;e++){const t=r[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(o??=[],o.push(t.resource.waitForAsyncAttributes()))}null===o?s():Promise.all(o).then(s,e=>{dh(e),t(e)})})})}_maybeStartTimer(){if(this._isExporting)return;const e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{this._isExporting=!1,dh(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();void 0===this._timer&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),"number"!=typeof this._timer&&this._timer.unref())}_clearTimer(){void 0!==this._timer&&(clearTimeout(this._timer),this._timer=void 0)}}class xd extends Rd{_visibilityChangeListener;_pageHideListener;constructor(e,t){super(e,t),this.onInit(t)}onInit(e){!0!==e?.disableAutoFlushOnDocumentHide&&"undefined"!=typeof document&&(this._visibilityChangeListener=()=>{"hidden"===document.visibilityState&&this.forceFlush().catch(e=>{dh(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{dh(e)})},document.addEventListener("visibilitychange",this._visibilityChangeListener),document.addEventListener("pagehide",this._pageHideListener))}onShutdown(){"undefined"!=typeof document&&(this._visibilityChangeListener&&document.removeEventListener("visibilitychange",this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener("pagehide",this._pageHideListener))}}const Nd=new Uint8Array(16),Ld=new Uint8Array(8),Md=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Pd(e){for(let t=0;t<e.length;t++)e[t]=256*Math.random()>>>0;for(let t=0;t<e.length;t++)if(e[t]>0)return;e[e.length-1]=1}function Dd(e){let t="";for(let n=0;n<e.length;n++)t+=Md[e[n]];return t}class Fd{generateTraceId(){return Pd(Nd),Dd(Nd)}generateSpanId(){return Pd(Ld),Dd(Ld)}}const Bd="otel.span.parent.origin",Ud="otel.span.sampling_result";class jd{startedSpans;liveSpans;constructor(e){this.startedSpans=e.createCounter("otel.sdk.span.started",{unit:"{span}",description:"The number of created spans."}),this.liveSpans=e.createUpDownCounter("otel.sdk.span.live",{unit:"{span}",description:"The number of currently live spans."})}startSpan(e,t){const n=function(e){switch(e){case wd.RECORD_AND_SAMPLED:return"RECORD_AND_SAMPLE";case wd.RECORD:return"RECORD_ONLY";case wd.NOT_RECORD:return"DROP"}}(t);if(this.startedSpans.add(1,{[Bd]:Zd(e),[Ud]:n}),t===wd.NOT_RECORD)return()=>{};const r={[Ud]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}}function Zd(e){return e?e.isRemote?"remote":"local":"none"}class zd{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(e,t,n,r){const s=function(e){const t={sampler:Ad()},n=Td(),r=Object.assign({},n,t,e);return r.generalLimits=Object.assign({},n.generalLimits,e.generalLimits||{}),r.spanLimits=Object.assign({},n.spanLimits,e.spanLimits||{}),r}(t);this._sampler=s.sampler,this._generalLimits=s.generalLimits,this._spanLimits=s.spanLimits,this._idGenerator=t.idGenerator||new Fd,this._resource=n,this._spanProcessor=r,this.instrumentationScope=e;const o=s.meterProvider?s.meterProvider.getMeter("@opentelemetry/sdk-trace","2.6.1"):Ql;this._tracerMetrics=new jd(o)}startSpan(e,t={},n=Bu.active()){t.root&&(n=th.deleteSpan(n));const r=th.getSpan(n);if(rh(n)){Uu.debug("Instrumentation suppressed, returning Noop Span");return th.wrapSpanContext(gu)}const s=r?.spanContext(),o=this._idGenerator.generateSpanId();let i,a,c;s&&th.isSpanContextValid(s)?(a=s.traceId,c=s.traceState,i=s):a=this._idGenerator.generateTraceId();const l=t.kind??Du.INTERNAL,u=(t.links??[]).map(e=>({context:e.context,attributes:ah(e.attributes)})),h=ah(t.attributes),d=this._sampler.shouldSample(n,a,e,l,h,u),p=this._tracerMetrics.startSpan(s,d.decision);c=d.traceState??c;const f={traceId:a,spanId:o,traceFlags:d.decision===Pu.RECORD_AND_SAMPLED?du.SAMPLED:du.NONE,traceState:c};if(d.decision===Pu.NOT_RECORD){Uu.debug("Recording is off, propagating context in a non-recording span");return th.wrapSpanContext(f)}const g=ah(Object.assign(h,d.attributes));return new bd({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:f,name:e,kind:l,links:u,parentSpanContext:i,attributes:g,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:p})}startActiveSpan(e,t,n,r){let s,o,i;if(arguments.length<2)return;2===arguments.length?i=t:3===arguments.length?(s=t,i=n):(s=t,o=n,i=r);const a=o??Bu.active(),c=this.startSpan(e,s,a),l=th.setSpan(a,c);return Bu.with(l,i,void 0,c)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class Vd{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){const e=[];for(const t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{dh(e||new Error("MultiSpanProcessor: forceFlush failed")),t()})})}onStart(e,t){for(const n of this._spanProcessors)n.onStart(e,t)}onEnding(e){for(const t of this._spanProcessors)t.onEnding&&t.onEnding(e)}onEnd(e){for(const t of this._spanProcessors)t.onEnd(e)}shutdown(){const e=[];for(const t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}}var Hd,Gd;!function(e){e[e.resolved=0]="resolved",e[e.timeout=1]="timeout",e[e.error=2]="error",e[e.unresolved=3]="unresolved"}(Hd||(Hd={}));class Wd{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){const t=function(...e){let t=e.shift();const n=new WeakMap;for(;e.length>0;)t=od(t,e.shift(),0,n);return t}({},Td(),function(e){const t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??void 0??void 0??128,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??void 0??void 0??Od,Object.assign({},e,{spanLimits:t})}(e));this._resource=t.resource??yd({[Sh]:fd(),[_h]:kh[_h],[Ih]:kh[Ih],[Eh]:kh[Eh]}),this._config=Object.assign({},t,{resource:this._resource});const n=[];e.spanProcessors?.length&&n.push(...e.spanProcessors),this._activeSpanProcessor=new Vd(n)}getTracer(e,t,n){const r=`${e}@${t||""}:${n?.schemaUrl||""}`;return this._tracers.has(r)||this._tracers.set(r,new zd({name:e,version:t,schemaUrl:n?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(r)}forceFlush(){const e=this._config.forceFlushTimeoutMillis,t=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(n=>{let r;const s=setTimeout(()=>{n(new Error(`Span processor did not completed within timeout period of ${e} ms`)),r=Hd.timeout},e);t.forceFlush().then(()=>{clearTimeout(s),r!==Hd.timeout&&(r=Hd.resolved,n(r))}).catch(e=>{clearTimeout(s),r=Hd.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{const r=t.filter(e=>e!==Hd.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}class Yd{_enabled=!1;_currentContext=Xl;_bindFunction(e=Xl,t){const n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}active(){return this._currentContext}bind(e,t){return void 0===e&&(e=this.active()),"function"==typeof t?this._bindFunction(e,t):t}disable(){return this._currentContext=Xl,this._enabled=!1,this}enable(){return this._enabled||(this._enabled=!0,this._currentContext=Xl),this}with(e,t,n,...r){const s=this._currentContext;this._currentContext=e||Xl;try{return t.call(n,...r)}finally{this._currentContext=s}}}class Kd extends Wd{constructor(e={}){super(e)}register(e={}){var t;th.setGlobalTracerProvider(this),null!==(t=e.propagator)&&(void 0!==t?qu.setGlobalPropagator(t):qu.setGlobalPropagator(new Bh({propagators:[new Yh,new ih]}))),function(e){if(null!==e){if(void 0===e){const e=new Yd;return e.enable(),void Bu.setGlobalContextManager(e)}e.enable(),Bu.setGlobalContextManager(e)}}(e.contextManager)}}!function(e){e.CONNECT_END="connectEnd",e.CONNECT_START="connectStart",e.DECODED_BODY_SIZE="decodedBodySize",e.DOM_COMPLETE="domComplete",e.DOM_CONTENT_LOADED_EVENT_END="domContentLoadedEventEnd",e.DOM_CONTENT_LOADED_EVENT_START="domContentLoadedEventStart",e.DOM_INTERACTIVE="domInteractive",e.DOMAIN_LOOKUP_END="domainLookupEnd",e.DOMAIN_LOOKUP_START="domainLookupStart",e.ENCODED_BODY_SIZE="encodedBodySize",e.FETCH_START="fetchStart",e.LOAD_EVENT_END="loadEventEnd",e.LOAD_EVENT_START="loadEventStart",e.NAVIGATION_START="navigationStart",e.REDIRECT_END="redirectEnd",e.REDIRECT_START="redirectStart",e.REQUEST_START="requestStart",e.RESPONSE_END="responseEnd",e.RESPONSE_START="responseStart",e.SECURE_CONNECTION_START="secureConnectionStart",e.START_TIME="startTime",e.UNLOAD_EVENT_END="unloadEventEnd",e.UNLOAD_EVENT_START="unloadEventStart"}(Gd||(Gd={}));function Jd(e,t){return t in e}function Xd(e,t,n,r=!0){if(Jd(n,t)&&"number"==typeof n[t]&&(!r||0!==n[t]))return e.addEvent(t,n[t])}function $d(e,t,n=!1,r,s){void 0===r&&(r=0!==t[Gd.START_TIME]),n||(Xd(e,Gd.FETCH_START,t,r),Xd(e,Gd.DOMAIN_LOOKUP_START,t,r),Xd(e,Gd.DOMAIN_LOOKUP_END,t,r),Xd(e,Gd.CONNECT_START,t,r),Xd(e,Gd.SECURE_CONNECTION_START,t,r),Xd(e,Gd.CONNECT_END,t,r),Xd(e,Gd.REQUEST_START,t,r),Xd(e,Gd.RESPONSE_START,t,r),Xd(e,Gd.RESPONSE_END,t,r));{const n=t[Gd.ENCODED_BODY_SIZE];void 0!==n&&e.setAttribute("http.response_content_length",n);const r=t[Gd.DECODED_BODY_SIZE];void 0!==r&&n!==r&&e.setAttribute("http.response_content_length_uncompressed",r)}}function qd(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return"/";const n=function(e){const t=e.nodeType,n=function(e){if(!e.parentNode)return 0;const t=[e.nodeType];e.nodeType===Node.CDATA_SECTION_NODE&&t.push(Node.TEXT_NODE);let n=Array.from(e.parentNode.childNodes);if(n=n.filter(n=>{const r=n.localName;return t.indexOf(n.nodeType)>=0&&r===e.localName}),n.length>=1)return n.indexOf(e)+1;return 0}(e);let r="";if(t===Node.ELEMENT_NODE){const t=e.getAttribute("id");if(t)return`//*[@id="${t}"]`;r=e.localName}else if(t===Node.TEXT_NODE||t===Node.CDATA_SECTION_NODE)r="text()";else{if(t!==Node.COMMENT_NODE)return"";r="comment()"}if(r&&n>1)return`/${r}[${n}]`;return`/${r}`}(e);if(n.indexOf("@id")>0)return n;let r="";return e.parentNode&&(r+=qd(e.parentNode)),r+=n,r}let Qd=class{emit(e){}};const ep=new Qd;const tp=new class{getLogger(e,t,n){return new Qd}};let np=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;const e=this._provider.getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):ep}},rp=class{getLogger(e,t,n){var r;return null!==(r=this.getDelegateLogger(e,t,n))&&void 0!==r?r:new np(this,e,t,n)}getDelegate(){var e;return null!==(e=this._delegate)&&void 0!==e?e:tp}setDelegate(e){this._delegate=e}getDelegateLogger(e,t,n){var r;return null===(r=this._delegate)||void 0===r?void 0:r.getLogger(e,t,n)}};const sp="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},op=Symbol.for("io.opentelemetry.js.api.logs"),ip=sp;const ap=class e{constructor(){this._proxyLoggerProvider=new rp}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(e){return ip[op]?this.getLoggerProvider():(ip[op]=(t=1,n=e,r=tp,e=>e===t?n:r),this._proxyLoggerProvider.setDelegate(e),e);var t,n,r}getLoggerProvider(){var e,t;return null!==(t=null===(e=ip[op])||void 0===e?void 0:e.call(ip,1))&&void 0!==t?t:this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete ip[op],this._proxyLoggerProvider=new rp}}.getInstance();let cp=console.error.bind(console);function lp(e,t,n){const r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}const up=(e,t,n)=>{if(!e||!e[t])return void cp("no original function "+String(t)+" to wrap");if(!n)return cp("no wrapper function"),void cp((new Error).stack);const r=e[t];if("function"!=typeof r||"function"!=typeof n)return void cp("original object and wrapper must be functions");const s=n(r,t);return lp(s,"__original",r),lp(s,"__unwrap",()=>{e[t]===s&&lp(e,t,r)}),lp(s,"__wrapped",!0),lp(e,t,s),s},hp=(e,t,n)=>{if(!e)return cp("must provide one or more modules to patch"),void cp((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{up(e,t,n)})}):cp("must provide one or more functions to wrap on modules")},dp=(e,t)=>{if(!e||!e[t])return cp("no function to unwrap."),void cp((new Error).stack);const n=e[t];n.__unwrap?n.__unwrap():cp("no original to unwrap to -- has "+String(t)+" already been unwrapped?")},pp=(e,t)=>{if(!e)return cp("must provide one or more modules to patch"),void cp((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{dp(e,t)})}):cp("must provide one or more functions to unwrap on modules")};let fp=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,t,n){this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=Uu.createComponentLogger({namespace:e}),this._tracer=th.getTracer(e,t),this._meter=Vu.getMeter(e,t),this._logger=ap.getLogger(e,t),this._updateMetricInstruments()}_wrap=up;_unwrap=dp;_massWrap=hp;_massUnwrap=pp;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){const e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:t},e)}}},gp=class extends fp{constructor(e,t,n){super(e,t,n),this._config.enabled&&this.enable()}};function mp(e,t,n){let r,s;try{s=e()}catch(e){r=e}finally{return t(r,s),s}}function yp(e){return"function"==typeof e&&"function"==typeof e.__original&&"function"==typeof e.__unwrap&&!0===e.__wrapped}var vp,bp;function wp(e,t){let n=vp.OLD;const r=t?.split(",").map(e=>e.trim()).filter(e=>""!==e);for(const t of r??[]){if(t.toLowerCase()===e+"/dup"){n=vp.DUPLICATE;break}t.toLowerCase()===e&&(n=vp.STABLE)}return n}!function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"}(vp||(vp={})),function(e){e.DOCUMENT_LOAD="documentLoad",e.DOCUMENT_FETCH="documentFetch",e.RESOURCE_FETCH="resourceFetch"}(bp||(bp={}));var Cp;!function(e){e.FIRST_PAINT="firstPaint",e.FIRST_CONTENTFUL_PAINT="firstContentfulPaint"}(Cp||(Cp={}));const Sp={"first-paint":Cp.FIRST_PAINT,"first-contentful-paint":Cp.FIRST_CONTENTFUL_PAINT};class _p extends gp{component="document-load";version="1";moduleName=this.component;constructor(e={}){super("@opentelemetry/instrumentation-document-load","0.48.0",e)}init(){}_onDocumentLoaded(){window.setTimeout(()=>{this._collectPerformance()})}_addResourcesSpans(e){const t=Oh.getEntriesByType?.("resource");t&&t.forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){const e=Array.from(document.getElementsByTagName("meta")).find(e=>e.getAttribute("name")===Hh),t=(()=>{const e={},t=Oh.getEntriesByType?.("navigation")[0];if(t)Object.values(Gd).forEach(n=>{if(Jd(t,n)){const r=t[n];"number"==typeof r&&(e[n]=r)}});else{const t=Oh.timing;t&&Object.values(Gd).forEach(n=>{if(Jd(t,n)){const r=t[n];"number"==typeof r&&(e[n]=r)}})}return e})(),n=e&&e.content||"";Bu.with(qu.extract(Xl,{traceparent:n}),()=>{const e=this._startSpan(bp.DOCUMENT_LOAD,Gd.FETCH_START,t);e&&(Bu.with(th.setSpan(Bu.active(),e),()=>{const e=this._startSpan(bp.DOCUMENT_FETCH,Gd.FETCH_START,t);e&&(e.setAttribute(ph,location.href),Bu.with(th.setSpan(Bu.active(),e),()=>{$d(e,t,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentFetch),this._endSpan(e,Gd.RESPONSE_END,t)}))}),e.setAttribute(ph,location.href),e.setAttribute("http.user_agent",navigator.userAgent),this._addResourcesSpans(e),this.getConfig().ignoreNetworkEvents||(Xd(e,Gd.FETCH_START,t),Xd(e,Gd.UNLOAD_EVENT_START,t),Xd(e,Gd.UNLOAD_EVENT_END,t),Xd(e,Gd.DOM_INTERACTIVE,t),Xd(e,Gd.DOM_CONTENT_LOADED_EVENT_START,t),Xd(e,Gd.DOM_CONTENT_LOADED_EVENT_END,t),Xd(e,Gd.DOM_COMPLETE,t),Xd(e,Gd.LOAD_EVENT_START,t),Xd(e,Gd.LOAD_EVENT_END,t)),this.getConfig().ignorePerformancePaintEvents||(e=>{const t=Oh.getEntriesByType?.("paint");t&&t.forEach(({name:t,startTime:n})=>{Jd(Sp,t)&&e.addEvent(Sp[t],n)})})(e),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentLoad),this._endSpan(e,Gd.LOAD_EVENT_END,t))})}_endSpan(e,t,n){e&&(Jd(n,t)?e.end(n[t]):e.end())}_initResourceSpan(e,t){const n=this._startSpan(bp.RESOURCE_FETCH,Gd.FETCH_START,e,t);n&&(n.setAttribute(ph,e.name),$d(n,e,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnResourceSpan(n,e,this.getConfig().applyCustomAttributesOnSpan?.resourceFetch),this._endSpan(n,Gd.RESPONSE_END,e))}_startSpan(e,t,n,r){if(Jd(n,t)&&"number"==typeof n[t]){return this.tracer.startSpan(e,{startTime:n[t]},r?th.setSpan(Bu.active(),r):void 0)}}_waitForPageLoad(){"complete"===window.document.readyState?this._onDocumentLoaded():(this._onDocumentLoaded=this._onDocumentLoaded.bind(this),window.addEventListener("load",this._onDocumentLoaded))}_addCustomAttributesOnSpan(e,t){t&&mp(()=>t(e),e=>{e&&this._diag.error("addCustomAttributesOnSpan",e)})}_addCustomAttributesOnResourceSpan(e,t,n){n&&mp(()=>n(e,t),e=>{e&&this._diag.error("addCustomAttributesOnResourceSpan",e)})}enable(){window.removeEventListener("load",this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener("load",this._onDocumentLoaded)}}const Ip="OT_ZONE_CONTEXT";class Ep{_enabled=!1;_bindFunction(e,t){const n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}_bindListener(e,t){const n=t;return void 0!==n.__ot_listeners||(n.__ot_listeners={},"function"==typeof n.addEventListener&&(n.addEventListener=this._patchAddEventListener(n,n.addEventListener,e)),"function"==typeof n.removeEventListener&&(n.removeEventListener=this._patchRemoveEventListener(n,n.removeEventListener))),t}_createZone(e,t){return Zone.current.fork({name:e,properties:{[Ip]:t}})}_patchAddEventListener(e,t,n){const r=this;return function(s,o,i){void 0===e.__ot_listeners&&(e.__ot_listeners={});let a=e.__ot_listeners[s];void 0===a&&(a=new WeakMap,e.__ot_listeners[s]=a);const c=r.bind(n,o);return a.set(o,c),t.call(this,s,c,i)}}_patchRemoveEventListener(e,t){return function(n,r){if(void 0===e.__ot_listeners||void 0===e.__ot_listeners[n])return t.call(this,n,r);const s=e.__ot_listeners[n],o=s.get(r);return s.delete(r),t.call(this,n,o||r)}}active(){return this._enabled&&Zone.current&&Zone.current.get(Ip)||Xl}bind(e,t){return"function"==typeof t?this._bindFunction(e,t):("object"==typeof(n=t)&&null!==n&&"addEventListener"in n&&"function"==typeof n.addEventListener&&"removeEventListener"in n&&"function"==typeof n.removeEventListener&&this._bindListener(e,t),t);var n}disable(){return this._enabled=!1,this}enable(){return this._enabled=!0,this}with(e,t,n,...r){let s="otel:with";return t.name&&(s+=`:${t.name}`),this._createZone(s,e).run(t,n,r)}}
15
+ ***************************************************************************** */function rl(e,t,n,r){return new(n||(n=Promise))(function(t,s){function o(e){try{a(r.next(e))}catch(e){s(e)}}function i(e){try{a(r.throw(e))}catch(e){s(e)}}function a(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n(function(e){e(r)})).then(o,i)}a((r=r.apply(e,[])).next())})}for(var sl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ol="undefined"==typeof Uint8Array?[]:new Uint8Array(256),il=0;il<64;il++)ol[sl.charCodeAt(il)]=il;const al=new Map;const cl=(e,t,n)=>{if(!e||!hl(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=al.get(e);return n||(n=new Map,al.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let s=r.indexOf(e);return-1===s&&(s=r.length,r.push(e)),s};function ll(e,t,n){if(e instanceof Array)return e.map(e=>ll(e,t,n));if(null===e)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){const t=e.constructor.name,n=function(e){var t,n=new Uint8Array(e),r=n.length,s="";for(t=0;t<r;t+=3)s+=sl[n[t]>>2],s+=sl[(3&n[t])<<4|n[t+1]>>4],s+=sl[(15&n[t+1])<<2|n[t+2]>>6],s+=sl[63&n[t+2]];return r%3==2?s=s.substring(0,s.length-1)+"=":r%3==1&&(s=s.substring(0,s.length-2)+"=="),s}(e);return{rr_type:t,base64:n}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[ll(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[ll(e.data,t,n),e.width,e.height]}}if(hl(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:cl(e,t,n)}}return e}const ul=(e,t,n)=>[...e].map(e=>ll(e,t,n)),hl=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(n.find(n=>e instanceof t[n]))};function dl(e,t,n){const r=[];try{const s=fc(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(r,...s){return yc(this,t,n,!0)||"__context"in this||(this.__context=r),e.apply(this,[r,...s])}});r.push(s)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(e=>e())}}function pl(e,t,n,r,s,o,i){const a=[],c=Object.getOwnPropertyNames(e);for(const o of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(o))try{if("function"!=typeof e[o])continue;const c=fc(e,o,function(e){return function(...a){const c=e.apply(this,a);if(cl(c,i,this),!yc(this.canvas,r,s,!0)){const e=ul([...a],i,this),r={type:t,property:o,args:e};n(this.canvas,r)}return c}});a.push(c)}catch(r){const s=pc(e,o,{set(e){n(this.canvas,{type:t,property:o,args:[e],setter:!0})}});a.push(s)}return a}var fl=null;try{var gl="undefined"!=typeof module&&"function"==typeof module.require&&module.require("worker_threads")||"function"==typeof __non_webpack_require__&&__non_webpack_require__("worker_threads")||"function"==typeof require&&require("worker_threads");fl=gl.Worker}catch(ry){}function ml(e,t,n){var r=function(e){return Buffer.from(e,"base64").toString("utf8")}(e),s=r.indexOf("\n",10)+1,o=r.substring(s)+"";return function(e){return new fl(o,Object.assign({},e,{eval:!0}))}}function yl(e,t,n){var r=function(e){return atob(e)}(e),s=r.indexOf("\n",10)+1,o=r.substring(s)+"",i=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(i)}var vl="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);var bl=function(e){return vl?ml(e):function(e){var t;return function(n){return t=t||yl(e),new Worker(t,n)}}(e)}("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=");class wl{constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,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)};const{sampling:t="all",win:n,blockClass:r,blockSelector:s,recordCanvas:o,dataURLOptions:i}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(n,r,s),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,s,{dataURLOptions:i})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,r,s){const o=dl(t,n,r),i=new Map,a=new bl;a.onmessage=e=>{const{id:t}=e.data;if(i.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:s,height:o}=e.data;this.mutationCb({id:t,type:kc["2D"],commands:[{property:"clearRect",args:[0,0,s,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const c=1e3/e;let l,u=0;const h=e=>{u&&e-u<c||(u=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{yc(t,n,r,!0)||e.push(t)}),e})().forEach(e=>rl(this,0,void 0,function*(){var t;const n=this.mirror.getId(e);if(i.get(n))return;if(i.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null===(t=null==n?void 0:n.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&(null==n||n.clear(n.COLOR_BUFFER_BIT))}const r=yield createImageBitmap(e);a.postMessage({id:n,bitmap:r,width:e.width,height:e.height,dataURLOptions:s.dataURLOptions},[r])}))),l=requestAnimationFrame(h)};l=requestAnimationFrame(h),this.resetObservers=()=>{o(),cancelAnimationFrame(l)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=dl(e,t,n),s=function(e,t,n,r){const s=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const i of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])continue;const o=fc(t.CanvasRenderingContext2D.prototype,i,function(s){return function(...o){return yc(this.canvas,n,r,!0)||setTimeout(()=>{const n=ul([...o],t,this);e(this.canvas,{type:kc["2D"],property:i,args:n})},0),s.apply(this,o)}});s.push(o)}catch(n){const r=pc(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:kc["2D"],property:i,args:[t],setter:!0})}});s.push(r)}return()=>{s.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n),o=function(e,t,n,r){const s=[];return s.push(...pl(t.WebGLRenderingContext.prototype,kc.WebGL,e,n,r,0,t)),void 0!==t.WebGL2RenderingContext&&s.push(...pl(t.WebGL2RenderingContext.prototype,kc.WebGL2,e,n,r,0,t)),()=>{s.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=()=>{r(),s(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map(e=>{const t=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]])}return n}(e,["type"]);return t}),{type:s}=n[0];this.mutationCb({id:t,type:s,commands:r}),this.pendingCanvasMutations.delete(e)}}class Cl{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new Ic,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(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const t of e){let e;if(this.styleMirror.has(t))e=this.styleMirror.getId(t);else{e=this.styleMirror.add(t);const n=Array.from(t.rules||CSSRule);r.push({styleId:e,rules:n.map((e,t)=>({rule:Ua(e),index:t}))})}n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}function Sl(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}let _l,Il,El,Tl=!1;const Al=new ja;function kl(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:s="rr-block",blockSelector:o=null,ignoreClass:i="rr-ignore",maskTextClass:a="rr-mask",maskTextSelector:c=null,inlineStylesheet:l=!0,maskAllInputs:u,maskInputOptions:h,slimDOMOptions:d,maskInputFn:p,maskTextFn:f,hooks:g,packFn:m,sampling:y={},dataURLOptions:v={},mousemoveWait:b,recordCanvas:w=!1,recordCrossOriginIframes:C=!1,userTriggeredOnInput:S=!1,collectFonts:_=!1,inlineImages:I=!1,plugins:E,keepIframeSrcFn:T=()=>!1,ignoreCSSAttributes:A=new Set([])}=e,k=!C||window.parent===window;let O=!1;if(!k)try{window.parent.document,O=!1}catch(e){O=!0}if(k&&!t)throw new Error("emit function is required");void 0!==b&&void 0===y.mousemove&&(y.mousemove=b),Al.reset();const R=!0===u?{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}:void 0!==h?h:{password:!0},x=!0===d||"all"===d?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===d,headMetaDescKeywords:"all"===d}:d||{};let N;!function(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),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}();let L=0;const M=e=>{for(const t of E||[])t.eventProcessor&&(e=t.eventProcessor(e));return m&&(e=m(e)),e};_l=(e,s)=>{var o;if(!(null===(o=Bc[0])||void 0===o?void 0:o.isFrozen())||e.type===Ec.FullSnapshot||e.type===Ec.IncrementalSnapshot&&e.data.source===Tc.Mutation||Bc.forEach(e=>e.unfreeze()),k)null==t||t(M(e),s);else if(O){const t={type:"rrweb",event:M(e),isCheckout:s};window.parent.postMessage(t,"*")}if(e.type===Ec.FullSnapshot)N=e,L=0;else if(e.type===Ec.IncrementalSnapshot){if(e.data.source===Tc.Mutation&&e.data.isAttachIframe)return;L++;const t=r&&L>=r,s=n&&e.timestamp-N.timestamp>n;(t||s)&&Il(!0)}};const P=e=>{_l(Sl({type:Ec.IncrementalSnapshot,data:Object.assign({source:Tc.Mutation},e)}))},D=e=>_l(Sl({type:Ec.IncrementalSnapshot,data:Object.assign({source:Tc.Scroll},e)})),F=e=>_l(Sl({type:Ec.IncrementalSnapshot,data:Object.assign({source:Tc.CanvasMutation},e)})),B=new Cl({mutationCb:P,adoptedStyleSheetCb:e=>_l(Sl({type:Ec.IncrementalSnapshot,data:Object.assign({source:Tc.AdoptedStyleSheet},e)}))}),U=new tl({mirror:Al,mutationCb:P,stylesheetManager:B,recordCrossOriginIframes:C,wrappedEmit:_l});for(const e of E||[])e.getMirror&&e.getMirror({nodeMirror:Al,crossOriginIframeMirror:U.crossOriginIframeMirror,crossOriginIframeStyleMirror:U.crossOriginIframeStyleMirror});El=new wl({recordCanvas:w,mutationCb:F,win:window,blockClass:s,blockSelector:o,mirror:Al,sampling:y.canvas,dataURLOptions:v});const j=new nl({mutationCb:P,scrollCb:D,bypassOptions:{blockClass:s,blockSelector:o,maskTextClass:a,maskTextSelector:c,inlineStylesheet:l,maskInputOptions:R,dataURLOptions:v,maskTextFn:f,maskInputFn:p,recordCanvas:w,inlineImages:I,sampling:y,slimDOMOptions:x,iframeManager:U,stylesheetManager:B,canvasManager:El,keepIframeSrcFn:T},mirror:Al});Il=(e=!1)=>{var t,n,r,i,u,h;_l(Sl({type:Ec.Meta,data:{href:window.location.href,width:mc(),height:gc()}}),e),B.reset(),Bc.forEach(e=>e.lock());const d=function(e,t){var n=t||{},r=n.mirror,s=void 0===r?new ja:r,o=n.blockClass,i=void 0===o?"rr-block":o,a=n.blockSelector,c=void 0===a?null:a,l=n.maskTextClass,u=void 0===l?"rr-mask":l,h=n.maskTextSelector,d=void 0===h?null:h,p=n.inlineStylesheet,f=void 0===p||p,g=n.inlineImages,m=void 0!==g&&g,y=n.recordCanvas,v=void 0!==y&&y,b=n.maskAllInputs,w=void 0!==b&&b,C=n.maskTextFn,S=n.maskInputFn,_=n.slimDOM,I=void 0!==_&&_,E=n.dataURLOptions,T=n.preserveWhiteSpace,A=n.onSerialize,k=n.onIframeLoad,O=n.iframeLoadTimeout,R=n.onStylesheetLoad,x=n.stylesheetLoadTimeout,N=n.keepIframeSrcFn;return cc(e,{doc:e,mirror:s,blockClass:i,blockSelector:c,maskTextClass:u,maskTextSelector:d,skipChild:!1,inlineStylesheet:f,maskInputOptions:!0===w?{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}:!1===w?{password:!0}:w,maskTextFn:C,maskInputFn:S,slimDOMOptions:!0===I||"all"===I?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===I,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===I?{}:I,dataURLOptions:E,inlineImages:m,recordCanvas:v,preserveWhiteSpace:T,onSerialize:A,onIframeLoad:k,iframeLoadTimeout:O,onStylesheetLoad:R,stylesheetLoadTimeout:x,keepIframeSrcFn:void 0===N?function(){return!1}:N,newlyAddedElement:!1})}(document,{mirror:Al,blockClass:s,blockSelector:o,maskTextClass:a,maskTextSelector:c,inlineStylesheet:l,maskAllInputs:R,maskTextFn:f,slimDOM:x,dataURLOptions:v,recordCanvas:w,inlineImages:I,onSerialize:e=>{Cc(e,Al)&&U.addIframe(e),Sc(e,Al)&&B.trackLinkElement(e),_c(e)&&j.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{U.attachIframe(e,t),j.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{B.attachLinkElement(e,t)},keepIframeSrcFn:T});if(!d)return console.warn("Failed to snapshot the document");_l(Sl({type:Ec.FullSnapshot,data:{node:d,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(r=null===document||void 0===document?void 0:document.body)||void 0===r?void 0:r.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(u=null===(i=null===document||void 0===document?void 0:document.body)||void 0===i?void 0:i.parentElement)||void 0===u?void 0:u.scrollTop)||(null===(h=null===document||void 0===document?void 0:document.body)||void 0===h?void 0:h.scrollTop)||0}}})),Bc.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&B.adoptStyleSheets(document.adoptedStyleSheets,Al.getId(document))};try{const e=[];e.push(lc("DOMContentLoaded",()=>{_l(Sl({type:Ec.DomContentLoaded,data:{}}))}));const t=e=>{var t;return Qc({mutationCb:P,mousemoveCb:(e,t)=>_l(Sl({type:Ec.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>_l(Sl({type:Ec.IncrementalSnapshot,data:Object.assign({source:Tc.MouseInteraction},e)})),scrollCb:D,viewportResizeCb:e=>_l(Sl({type:Ec.IncrementalSnapshot,data:Object.assign({source:Tc.ViewportResize},e)})),inputCb:e=>_l(Sl({type:Ec.IncrementalSnapshot,data:Object.assign({source:Tc.Input},e)})),mediaInteractionCb:e=>_l(Sl({type:Ec.IncrementalSnapshot,data:Object.assign({source:Tc.MediaInteraction},e)})),styleSheetRuleCb:e=>_l(Sl({type:Ec.IncrementalSnapshot,data:Object.assign({source:Tc.StyleSheetRule},e)})),styleDeclarationCb:e=>_l(Sl({type:Ec.IncrementalSnapshot,data:Object.assign({source:Tc.StyleDeclaration},e)})),canvasMutationCb:F,fontCb:e=>_l(Sl({type:Ec.IncrementalSnapshot,data:Object.assign({source:Tc.Font},e)})),selectionCb:e=>{_l(Sl({type:Ec.IncrementalSnapshot,data:Object.assign({source:Tc.Selection},e)}))},blockClass:s,ignoreClass:i,maskTextClass:a,maskTextSelector:c,maskInputOptions:R,inlineStylesheet:l,sampling:y,recordCanvas:w,inlineImages:I,userTriggeredOnInput:S,collectFonts:_,doc:e,maskInputFn:p,maskTextFn:f,keepIframeSrcFn:T,blockSelector:o,slimDOMOptions:x,dataURLOptions:v,mirror:Al,iframeManager:U,stylesheetManager:B,shadowDomManager:j,canvasManager:El,ignoreCSSAttributes:A,plugins:(null===(t=null==E?void 0:E.filter(e=>e.observer))||void 0===t?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>_l(Sl({type:Ec.Plugin,data:{plugin:e.name,payload:t}}))})))||[]},g)};U.addLoadListener(n=>{e.push(t(n.contentDocument))});const n=()=>{Il(),e.push(t(document)),Tl=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():e.push(lc("load",()=>{_l(Sl({type:Ec.Load,data:{}})),n()},window)),()=>{e.forEach(e=>e()),Tl=!1}}catch(e){console.warn(e)}}kl.addCustomEvent=(e,t)=>{if(!Tl)throw new Error("please add custom event after start recording");_l(Sl({type:Ec.Custom,data:{tag:e,payload:t}}))},kl.freezePage=()=>{Bc.forEach(e=>e.freeze())},kl.takeFullSnapshot=e=>{if(!Tl)throw new Error("please take full snapshot after start recording");Il(e)},kl.mirror=Al;const Ol=5e3;class Rl{constructor(e,t,n){this.events=[],this.stopRecording=void 0,this.saveInterval=null,this.isSaving=!1,this.isConfigured=!1,this._enabled=!0,this.userAttributes={},this._listenersAttached=!1,this.handleUnload=()=>this.save(!0),this.handleVisibilityChange=()=>{"hidden"===document.visibilityState&&this.save()},this.sessionId=t,this.tabId=n,this.config=e,this.setupListeners()}setupListeners(){"undefined"==typeof window||this._listenersAttached||(this._listenersAttached=!0,window.addEventListener("beforeunload",this.handleUnload),window.addEventListener("pagehide",this.handleUnload),document.addEventListener("visibilitychange",this.handleVisibilityChange))}removeListeners(){"undefined"!=typeof window&&this._listenersAttached&&(this._listenersAttached=!1,window.removeEventListener("beforeunload",this.handleUnload),window.removeEventListener("pagehide",this.handleUnload),document.removeEventListener("visibilitychange",this.handleVisibilityChange))}trimEvents(){if(this.events.length<=Ol)return;this.config.debug&&console.warn("Event queue exceeded 5000, dropping middle events (preserving snapshots)");const e=this.events.filter(e=>2===e.type),t=this.events.filter(e=>2!==e.type),n=Math.max(0,Ol-e.length);this.events=[...e,...t.slice(-n)],this.events.sort((e,t)=>e.timestamp-t.timestamp)}configure(){if("undefined"==typeof window)return;if(this.isConfigured)return;this.setupListeners();const e=Math.max(0,Math.min(1,this.config.replaySampleRate??1));if(Math.random()>=e)return this._enabled=!1,void(this.config.debug&&console.log("MonoscopeReplay: sampled out"));try{this.stopRecording=kl({emit:e=>{this._enabled&&(this.events.push(e),this.events.length>=50&&this.save())},blockClass:"rr-block",maskAllInputs:!0,maskInputOptions:{password:!0,email:!0,tel:!0},maskTextClass:"rr-mask",checkoutEveryNms:15e3,sampling:{mouseInteraction:{MouseUp:!1,MouseDown:!1,Click:!0,ContextMenu:!1,DblClick:!0,Focus:!1,Blur:!1,TouchStart:!0,TouchEnd:!1},mousemove:!0,scroll:150,media:800,input:"last"},plugins:[(t={level:["info","log","warn","error"],lengthThreshold:1e4,stringifyOptions:{stringLengthLimit:1e3,numOfKeysLimit:100,depthOfLimit:2}},{name:"rrweb/console@1",observer:Ma,options:t})]}),this.saveInterval=setInterval(()=>this.save(),2e3),this.isConfigured=!0,this.config.debug&&console.log("MonoscopeReplay configured successfully")}catch(e){console.warn("Monoscope: failed to configure replay",e)}var t}async save(e=!1){if(this.isSaving&&!e)return;if(0===this.events.length)return;this.trimEvents(),this.isSaving=!0;const t=this.config.apiKey||this.config.projectId||"",n=`${this.config.replayEventsBaseUrl||"https://app.monoscope.tech"}/api/v1/rrweb`,r=[...this.events];this.events=[];const s={events:r,sessionId:this.sessionId,tabId:this.tabId,timestamp:(new Date).toISOString(),eventCount:r.length,user:Object.keys(this.userAttributes).length>0?this.userAttributes:void 0},o={"Content-Type":"application/json",Authorization:`Bearer ${t}`};try{if(e&&"undefined"!=typeof navigator&&navigator.sendBeacon){const e=new Blob([JSON.stringify(s)],{type:"application/json"});navigator.sendBeacon(n,e)||fetch(n,{method:"POST",headers:o,body:JSON.stringify(s),keepalive:!0}).catch(()=>{})}else{const e=JSON.stringify(s),t=await fetch(n,{method:"POST",headers:o,body:e,keepalive:e.length<63e3});if(!t.ok){const e=t.status;throw 401===e||403===e?console.warn("[Monoscope] Replay upload authentication failed. Your apiKey may be invalid."):console.warn(`[Monoscope] Replay upload failed (${e}). Check your apiKey and network.`),new Error(`Failed to save replay events: ${e} ${t.statusText}`)}this.config.debug&&console.log(`Successfully saved ${r.length} replay events`)}}catch(e){console.warn("Monoscope: failed to save replay events:",e),this.events=[...r,...this.events],this.trimEvents()}finally{this.isSaving=!1}}stop(){this.save(!0).catch(()=>{}),this.stopRecording&&(this.stopRecording(),this.stopRecording=void 0),this.saveInterval&&(clearInterval(this.saveInterval),this.saveInterval=null),this.removeListeners(),this.isConfigured=!1,this.config.debug&&console.log("MonoscopeReplay stopped")}setEnabled(e){this._enabled=e,e||this.stop()}setUser(e){this.userAttributes={...this.userAttributes,...e}}getEventCount(){return this.events.length}updateSessionId(e){this.sessionId=e}getSessionId(){return this.sessionId}isRecording(){return this.isConfigured&&void 0!==this.stopRecording}}const xl="1.9.1",Nl=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;const Ll=function(e){const t=new Set([e]),n=new Set,r=e.match(Nl);if(!r)return()=>!1;const s=+r[1],o=+r[2],i=+r[3];if(null!=r[4])return function(t){return t===e};function a(e){return n.add(e),!1}function c(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;const r=e.match(Nl);if(!r)return a(e);const l=+r[1],u=+r[2],h=+r[3];return null!=r[4]||s!==l?a(e):0===s?o===u&&i<=h?c(e):a(e):o<=u?c(e):a(e)}}(xl),Ml=xl.split(".")[0],Pl=Symbol.for(`opentelemetry.js.api.${Ml}`),Dl="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{};function Fl(e,t,n,r=!1){var s;const o=Dl[Pl]=null!==(s=Dl[Pl])&&void 0!==s?s:{version:xl};if(!r&&o[e]){const t=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(t.stack||t.message),!1}if(o.version!==xl){const t=new Error(`@opentelemetry/api: Registration of version v${o.version} for ${e} does not match previously registered API v${xl}`);return n.error(t.stack||t.message),!1}return o[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${xl}.`),!0}function Bl(e){var t,n;const r=null===(t=Dl[Pl])||void 0===t?void 0:t.version;if(r&&Ll(r))return null===(n=Dl[Pl])||void 0===n?void 0:n[e]}function Ul(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${xl}.`);const n=Dl[Pl];n&&delete n[e]}class jl{constructor(e){this._namespace=e.namespace||"DiagComponentLogger"}debug(...e){return Zl("debug",this._namespace,e)}error(...e){return Zl("error",this._namespace,e)}info(...e){return Zl("info",this._namespace,e)}warn(...e){return Zl("warn",this._namespace,e)}verbose(...e){return Zl("verbose",this._namespace,e)}}function Zl(e,t,n){const r=Bl("diag");if(r)return r[e](t,...n)}var zl;!function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"}(zl||(zl={}));class Vl{static instance(){return this._instance||(this._instance=new Vl),this._instance}constructor(){function e(e){return function(...t){const n=Bl("diag");if(n)return n[e](...t)}}const t=this;t.setLogger=(e,n={logLevel:zl.INFO})=>{var r,s,o;if(e===t){const e=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error(null!==(r=e.stack)&&void 0!==r?r:e.message),!1}"number"==typeof n&&(n={logLevel:n});const i=Bl("diag"),a=function(e,t){function n(n,r){const s=t[n];return"function"==typeof s&&e>=r?s.bind(t):function(){}}return e<zl.NONE?e=zl.NONE:e>zl.ALL&&(e=zl.ALL),t=t||{},{error:n("error",zl.ERROR),warn:n("warn",zl.WARN),info:n("info",zl.INFO),debug:n("debug",zl.DEBUG),verbose:n("verbose",zl.VERBOSE)}}(null!==(s=n.logLevel)&&void 0!==s?s:zl.INFO,e);if(i&&!n.suppressOverrideMessage){const e=null!==(o=(new Error).stack)&&void 0!==o?o:"<failed to generate stacktrace>";i.warn(`Current logger will be overwritten from ${e}`),a.warn(`Current logger will overwrite one already registered from ${e}`)}return Fl("diag",a,t,!0)},t.disable=()=>{Ul("diag",t)},t.createComponentLogger=e=>new jl(e),t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}}class Hl{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){const t=this._entries.get(e);if(t)return Object.assign({},t)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(e,t){const n=new Hl(this._entries);return n._entries.set(e,t),n}removeEntry(e){const t=new Hl(this._entries);return t._entries.delete(e),t}removeEntries(...e){const t=new Hl(this._entries);for(const n of e)t._entries.delete(n);return t}clear(){return new Hl}}const Gl=Symbol("BaggageEntryMetadata"),Wl=Vl.instance();function Yl(e={}){return new Hl(new Map(Object.entries(e)))}function Kl(e){return Symbol.for(e)}class $l{constructor(e){const t=this;t._currentContext=e?new Map(e):new Map,t.getValue=e=>t._currentContext.get(e),t.setValue=(e,n)=>{const r=new $l(t._currentContext);return r._currentContext.set(e,n),r},t.deleteValue=e=>{const n=new $l(t._currentContext);return n._currentContext.delete(e),n}}}const Jl=new $l;class Xl{}class ql{addCallback(e){}removeCallback(e){}}const Ql=new class{constructor(){}createGauge(e,t){return tu}createHistogram(e,t){return nu}createCounter(e,t){return eu}createUpDownCounter(e,t){return ru}createObservableGauge(e,t){return ou}createObservableCounter(e,t){return su}createObservableUpDownCounter(e,t){return iu}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},eu=new class extends Xl{add(e,t){}},tu=new class extends Xl{record(e,t){}},nu=new class extends Xl{record(e,t){}},ru=new class extends Xl{add(e,t){}},su=new class extends ql{},ou=new class extends ql{},iu=new class extends ql{};const au={get(e,t){if(null!=e)return e[t]},keys:e=>null==e?[]:Object.keys(e)},cu={set(e,t,n){null!=e&&(e[t]=n)}};const lu="context",uu=new class{active(){return Jl}with(e,t,n,...r){return t.call(n,...r)}bind(e,t){return t}enable(){return this}disable(){return this}};class hu{constructor(){}static getInstance(){return this._instance||(this._instance=new hu),this._instance}setGlobalContextManager(e){return Fl(lu,e,Vl.instance())}active(){return this._getContextManager().active()}with(e,t,n,...r){return this._getContextManager().with(e,t,n,...r)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return Bl(lu)||uu}disable(){this._getContextManager().disable(),Ul(lu,Vl.instance())}}var du;!function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"}(du||(du={}));const pu="0000000000000000",fu="00000000000000000000000000000000",gu={traceId:fu,spanId:pu,traceFlags:du.NONE};class mu{constructor(e=gu){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}}const yu=Kl("OpenTelemetry Context Key SPAN");function vu(e){return e.getValue(yu)||void 0}function bu(){return vu(hu.getInstance().active())}function wu(e,t){return e.setValue(yu,t)}function Cu(e){return e.deleteValue(yu)}function Su(e,t){return wu(e,new mu(t))}function _u(e){var t;return null===(t=vu(e))||void 0===t?void 0:t.spanContext()}const Iu=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]);function Eu(e,t){if("string"!=typeof e||e.length!==t)return!1;let n=0;for(let t=0;t<e.length;t+=4)n+=(0|Iu[e.charCodeAt(t)])+(0|Iu[e.charCodeAt(t+1)])+(0|Iu[e.charCodeAt(t+2)])+(0|Iu[e.charCodeAt(t+3)]);return n===t}function Tu(e){return Eu(e,32)&&e!==fu}function Au(e){return Tu(e.traceId)&&(Eu(t=e.spanId,16)&&t!==pu);var t}function ku(e){return new mu(e)}const Ou=hu.getInstance();class Ru{startSpan(e,t,n=Ou.active()){if(Boolean(null==t?void 0:t.root))return new mu;const r=n&&_u(n);return null!==(s=r)&&"object"==typeof s&&"spanId"in s&&"string"==typeof s.spanId&&"traceId"in s&&"string"==typeof s.traceId&&"traceFlags"in s&&"number"==typeof s.traceFlags&&Au(r)?new mu(r):new mu;var s}startActiveSpan(e,t,n,r){let s,o,i;if(arguments.length<2)return;2===arguments.length?i=t:3===arguments.length?(s=t,i=n):(s=t,o=n,i=r);const a=null!=o?o:Ou.active(),c=this.startSpan(e,s,a),l=wu(a,c);return Ou.with(l,i,void 0,c)}}const xu=new Ru;class Nu{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}startSpan(e,t,n){return this._getTracer().startSpan(e,t,n)}startActiveSpan(e,t,n,r){const s=this._getTracer();return Reflect.apply(s.startActiveSpan,s,arguments)}_getTracer(){if(this._delegate)return this._delegate;const e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):xu}}const Lu=new class{getTracer(e,t,n){return new Ru}};class Mu{getTracer(e,t,n){var r;return null!==(r=this.getDelegateTracer(e,t,n))&&void 0!==r?r:new Nu(this,e,t,n)}getDelegate(){var e;return null!==(e=this._delegate)&&void 0!==e?e:Lu}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,n){var r;return null===(r=this._delegate)||void 0===r?void 0:r.getTracer(e,t,n)}}var Pu,Du,Fu;!function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(Pu||(Pu={})),function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"}(Du||(Du={})),function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"}(Fu||(Fu={}));const Bu=hu.getInstance(),Uu=Vl.instance();const ju=new class{getMeter(e,t,n){return Ql}},Zu="metrics";class zu{constructor(){}static getInstance(){return this._instance||(this._instance=new zu),this._instance}setGlobalMeterProvider(e){return Fl(Zu,e,Vl.instance())}getMeterProvider(){return Bl(Zu)||ju}getMeter(e,t,n){return this.getMeterProvider().getMeter(e,t,n)}disable(){Ul(Zu,Vl.instance())}}const Vu=zu.getInstance();const Hu=Kl("OpenTelemetry Baggage Key");function Gu(e){return e.getValue(Hu)||void 0}function Wu(){return Gu(hu.getInstance().active())}function Yu(e,t){return e.setValue(Hu,t)}function Ku(e){return e.deleteValue(Hu)}const $u="propagation",Ju=new class{inject(e,t){}extract(e,t){return e}fields(){return[]}};class Xu{constructor(){this.createBaggage=Yl,this.getBaggage=Gu,this.getActiveBaggage=Wu,this.setBaggage=Yu,this.deleteBaggage=Ku}static getInstance(){return this._instance||(this._instance=new Xu),this._instance}setGlobalPropagator(e){return Fl($u,e,Vl.instance())}inject(e,t,n=cu){return this._getGlobalPropagator().inject(e,t,n)}extract(e,t,n=au){return this._getGlobalPropagator().extract(e,t,n)}fields(){return this._getGlobalPropagator().fields()}disable(){Ul($u,Vl.instance())}_getGlobalPropagator(){return Bl($u)||Ju}}const qu=Xu.getInstance(),Qu="trace";class eh{constructor(){this._proxyTracerProvider=new Mu,this.wrapSpanContext=ku,this.isSpanContextValid=Au,this.deleteSpan=Cu,this.getSpan=vu,this.getActiveSpan=bu,this.getSpanContext=_u,this.setSpan=wu,this.setSpanContext=Su}static getInstance(){return this._instance||(this._instance=new eh),this._instance}setGlobalTracerProvider(e){const t=Fl(Qu,this._proxyTracerProvider,Vl.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return Bl(Qu)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){Ul(Qu,Vl.instance()),this._proxyTracerProvider=new Mu}}const th=eh.getInstance(),nh=Kl("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function rh(e){return!0===e.getValue(nh)}const sh="baggage";function oh(e){if(!e)return;const t=e.indexOf(";"),n=-1===t?e:e.substring(0,t),r=n.indexOf("=");if(r<=0)return;const s=n.substring(0,r).trim(),o=n.substring(r+1).trim();if(!s||!o)return;let i,a,c;try{i=decodeURIComponent(s),a=decodeURIComponent(o)}catch{return}if(-1!==t&&t<e.length-1){const n=e.substring(t+1);"string"!=typeof(l=n)&&(Wl.error("Cannot create baggage metadata from unknown type: "+typeof l),l=""),c={__TYPE__:Gl,toString:()=>l}}var l;return{key:i,value:a,metadata:c}}class ih{inject(e,t,n){const r=qu.getBaggage(e);if(!r||rh(e))return;const s=function(e){return e.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return void 0!==t.metadata&&(n+=";"+t.metadata.toString()),n})}(r).filter(e=>e.length<=4096).slice(0,180),o=function(e){return e.reduce((e,t)=>{const n=`${e}${""!==e?",":""}${t}`;return n.length>8192?e:n},"")}(s);o.length>0&&n.set(t,sh,o)}extract(e,t,n){const r=n.get(t,sh),s=Array.isArray(r)?r.join(","):r;if(!s)return e;const o={};if(0===s.length)return e;return s.split(",").forEach(e=>{const t=oh(e);if(t){const e={value:t.value};t.metadata&&(e.metadata=t.metadata),o[t.key]=e}}),0===Object.entries(o).length?e:qu.setBaggage(e,qu.createBaggage(o))}fields(){return[sh]}}function ah(e){const t={};if("object"!=typeof e||null==e)return t;for(const n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!ch(n)){Uu.warn(`Invalid attribute key: ${n}`);continue}const r=e[n];lh(r)?Array.isArray(r)?t[n]=r.slice():t[n]=r:Uu.warn(`Invalid attribute value set for key: ${n}`)}return t}function ch(e){return"string"==typeof e&&""!==e}function lh(e){return null==e||(Array.isArray(e)?function(e){let t;for(const n of e){if(null==n)continue;const e=typeof n;if(e!==t){if(!t){if(uh(e)){t=e;continue}return!1}return!1}}return!0}(e):uh(typeof e))}function uh(e){switch(e){case"number":case"boolean":case"string":return!0}return!1}let hh=e=>{Uu.error(function(e){return"string"==typeof e?e:JSON.stringify(function(e){const t={};let n=e;for(;null!==n;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;const r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}(e))}(e))};function dh(e){try{hh(e)}catch{}}const ph="http.url",fh="error.type",gh="exception.message",mh="exception.type",yh="http.request.method",vh="http.request.method_original",bh="http.response.status_code",wh="server.address",Ch="server.port",Sh="service.name",_h="telemetry.sdk.language",Ih="telemetry.sdk.name",Eh="telemetry.sdk.version",Th="url.full",Ah="process.runtime.name",kh={[Ih]:"opentelemetry",[Ah]:"browser",[_h]:"webjs",[Eh]:"2.6.1"},Oh=performance,Rh=Math.pow(10,6),xh=Math.pow(10,9);function Nh(e){const t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*Rh)]}function Lh(e){return Dh(Nh(Oh.timeOrigin),Nh("number"==typeof e?e:Oh.now()))}function Mh(e){return Array.isArray(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]}function Ph(e){return Mh(e)||"number"==typeof e||e instanceof Date}function Dh(e,t){const n=[e[0]+t[0],e[1]+t[1]];return n[1]>=xh&&(n[1]-=xh,n[0]+=1),n}var Fh;!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"}(Fh||(Fh={}));class Bh{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[],this._fields=Array.from(new Set(this._propagators.map(e=>"function"==typeof e.fields?e.fields():[]).reduce((e,t)=>e.concat(t),[])))}inject(e,t,n){for(const r of this._propagators)try{r.inject(e,t,n)}catch(e){Uu.warn(`Failed to inject with ${r.constructor.name}. Err: ${e.message}`)}}extract(e,t,n){return this._propagators.reduce((e,r)=>{try{return r.extract(e,t,n)}catch(e){Uu.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}}const Uh="[_0-9a-z-*/]",jh=new RegExp(`^(?:${`[a-z]${Uh}{0,255}`}|${`[a-z0-9]${Uh}{0,240}@[a-z]${Uh}{0,13}`})$`),Zh=/^[ -~]{0,255}[!-~]$/,zh=/,|=/;class Vh{_internalState=new Map;constructor(e){e&&this._parse(e)}set(e,t){const n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,t),n}unset(e){const t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+"="+this.get(t)),e),[]).join(",")}_parse(e){e.length>512||(this._internalState=e.split(",").reverse().reduce((e,t)=>{const n=t.trim(),r=n.indexOf("=");if(-1!==r){const s=n.slice(0,r),o=n.slice(r+1,t.length);(function(e){return jh.test(e)})(s)&&function(e){return Zh.test(e)&&!zh.test(e)}(o)&&e.set(s,o)}return e},new Map),this._internalState.size>32&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,32))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){const e=new Vh;return e._internalState=new Map(this._internalState),e}}const Hh="traceparent",Gh="tracestate",Wh=new RegExp("^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$");class Yh{inject(e,t,n){const r=th.getSpanContext(e);if(!r||rh(e)||!Au(r))return;const s=`00-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||du.NONE).toString(16)}`;n.set(t,Hh,s),r.traceState&&n.set(t,Gh,r.traceState.serialize())}extract(e,t,n){const r=n.get(t,Hh);if(!r)return e;const s=Array.isArray(r)?r[0]:r;if("string"!=typeof s)return e;const o=function(e){const t=Wh.exec(e);return t?"00"===t[1]&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}:null}(s);if(!o)return e;o.isRemote=!0;const i=n.get(t,Gh);if(i){const e=Array.isArray(i)?i.join(","):i;o.traceState=new Vh("string"==typeof e?e:void 0)}return th.setSpanContext(e,o)}fields(){return[Hh,Gh]}}const Kh="[object Null]",$h="[object Undefined]",Jh=Function.prototype.toString,Xh=Jh.call(Object),qh=Object.getPrototypeOf,Qh=Object.prototype,ed=Qh.hasOwnProperty,td=Symbol?Symbol.toStringTag:void 0,nd=Qh.toString;function rd(e){if(!function(e){return null!=e&&"object"==typeof e}(e)||"[object Object]"!==function(e){if(null==e)return void 0===e?$h:Kh;return td&&td in Object(e)?function(e){const t=ed.call(e,td),n=e[td];let r=!1;try{e[td]=void 0,r=!0}catch{}const s=nd.call(e);r&&(t?e[td]=n:delete e[td]);return s}(e):function(e){return nd.call(e)}(e)}(e))return!1;const t=qh(e);if(null===t)return!0;const n=ed.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Jh.call(n)===Xh}function sd(e){return ad(e)?e.slice():e}function od(e,t,n=0,r){let s;if(!(n>20)){if(n++,ud(e)||ud(t)||cd(t))s=sd(t);else if(ad(e)){if(s=e.slice(),ad(t))for(let e=0,n=t.length;e<n;e++)s.push(sd(t[e]));else if(ld(t)){const e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){const r=e[n];s[r]=sd(t[r])}}}else if(ld(e))if(ld(t)){if(!function(e,t){if(!rd(e)||!rd(t))return!1;return!0}(e,t))return t;s=Object.assign({},e);const o=Object.keys(t);for(let i=0,a=o.length;i<a;i++){const a=o[i],c=t[a];if(ud(c))void 0===c?delete s[a]:s[a]=c;else{const o=s[a],i=c;if(id(e,a,r)||id(t,a,r))delete s[a];else{if(ld(o)&&ld(i)){const n=r.get(o)||[],s=r.get(i)||[];n.push({obj:e,key:a}),s.push({obj:t,key:a}),r.set(o,n),r.set(i,s)}s[a]=od(s[a],c,n,r)}}}}else s=t;return s}}function id(e,t,n){const r=n.get(e[t])||[];for(let n=0,s=r.length;n<s;n++){const s=r[n];if(s.key===t&&s.obj===e)return!0}return!1}function ad(e){return Array.isArray(e)}function cd(e){return"function"==typeof e}function ld(e){return!ud(e)&&!ad(e)&&!cd(e)&&"object"==typeof e}function ud(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||void 0===e||e instanceof Date||e instanceof RegExp||null===e}class hd{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}}class dd{_isCalled=!1;_deferred=new hd;_callback;_that;constructor(e,t){this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}}let pd;function fd(){if(void 0===pd)try{const e=globalThis.process.argv0;pd=e?`unknown_service:${e}`:"unknown_service"}catch{pd="unknown_service"}return pd}const gd=e=>null!==e&&"object"==typeof e&&"function"==typeof e.then;class md{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(e,t){const n=new md({},t);return n._rawAttributes=vd(e),n._asyncAttributesPending=e.filter(([e,t])=>gd(t)).length>0,n}constructor(e,t){const n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([e,t])=>(gd(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=vd(this._rawAttributes),this._schemaUrl=function(e){if("string"==typeof e||void 0===e)return e;return void Uu.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",e)}(t?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){const[t,n]=this._rawAttributes[e];this._rawAttributes[e]=[t,gd(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Uu.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const e={};for(const[t,n]of this._rawAttributes)gd(n)?Uu.debug(`Unsettled resource attribute ${t} skipped`):null!=n&&(e[t]??=n);return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(e){if(null==e)return this;const t=function(e,t){const n=e?.schemaUrl,r=t?.schemaUrl,s=void 0===n||""===n,o=void 0===r||""===r;if(s)return r;if(o)return n;if(n===r)return n;return void Uu.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',n,r)}(this,e),n=t?{schemaUrl:t}:void 0;return md.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()],n)}}function yd(e,t){return md.FromAttributeList(Object.entries(e),t)}function vd(e){return e.map(([e,t])=>gd(t)?[e,t.catch(t=>{Uu.debug("promise rejection for resource attribute: %s - %s",e,t)})]:[e,t])}class bd{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:Fu.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){const t=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=Oh.now(),this._performanceOffset=t-(this._performanceStartTime+Oh.timeOrigin),this._startTimeProvided=null!=e.startTime,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,e.links)for(const t of e.links)this.addLink(t);this.startTime=this._getTime(e.startTime??t),this.resource=e.resource,this.instrumentationScope=e.scope,this._recordEndMetrics=e.recordEndMetrics,null!=e.attributes&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(null==t||this._isSpanEnded())return this;if(0===e.length)return Uu.warn(`Invalid attribute key: ${e}`),this;if(!lh(t))return Uu.warn(`Invalid attribute value set for key: ${e}`),this;const{attributeCountLimit:n}=this._spanLimits,r=!Object.prototype.hasOwnProperty.call(this.attributes,e);return void 0!==n&&this._attributesCount>=n&&r?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),r&&this._attributesCount++,this)}setAttributes(e){for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.setAttribute(t,e[t]);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;const{eventCountLimit:r}=this._spanLimits;if(0===r)return Uu.warn("No events allowed."),this._droppedEventsCount++,this;void 0!==r&&this.events.length>=r&&(0===this._droppedEventsCount&&Uu.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),Ph(t)&&(Ph(n)||(n=t),t=void 0);const s=ah(t),{attributePerEventCountLimit:o}=this._spanLimits,i={};let a=0,c=0;for(const e in s){if(!Object.prototype.hasOwnProperty.call(s,e))continue;const t=s[e];void 0!==o&&c>=o?a++:(i[e]=this._truncateToSize(t),c++)}return this.events.push({name:e,attributes:i,time:this._getTime(n),droppedAttributesCount:a}),this}addLink(e){if(this._isSpanEnded())return this;const{linkCountLimit:t}=this._spanLimits;if(0===t)return this._droppedLinksCount++,this;void 0!==t&&this.links.length>=t&&(0===this._droppedLinksCount&&Uu.debug("Dropping extra links."),this.links.shift(),this._droppedLinksCount++);const{attributePerLinkCountLimit:n}=this._spanLimits,r=ah(e.attributes),s={};let o=0,i=0;for(const e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;const t=r[e];void 0!==n&&i>=n?o++:(s[e]=this._truncateToSize(t),i++)}const a={context:e.context};return i>0&&(a.attributes=s),o>0&&(a.droppedAttributesCount=o),this.links.push(a),this}addLinks(e){for(const t of e)this.addLink(t);return this}setStatus(e){if(this._isSpanEnded())return this;if(e.code===Fu.UNSET)return this;if(this.status.code===Fu.OK)return this;const t={code:e.code};return e.code===Fu.ERROR&&("string"==typeof e.message?t.message=e.message:null!=e.message&&Uu.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)),this.status=t,this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){this._isSpanEnded()?Uu.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`):(this.endTime=this._getTime(e),this._duration=function(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(n-=1,r+=xh),[n,r]}(this.startTime,this.endTime),this._duration[0]<0&&(Uu.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&Uu.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&Uu.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this))}_getTime(e){if("number"==typeof e&&e<=Oh.now())return Lh(e+this._performanceOffset);if("number"==typeof e)return Nh(e);if(e instanceof Date)return Nh(e.getTime());if(Mh(e))return e;if(this._startTimeProvided)return Nh(Date.now());const t=Oh.now()-this._performanceStartTime;return Dh(this.startTime,Nh(t))}isRecording(){return!1===this._ended}recordException(e,t){const n={};"string"==typeof e?n[gh]=e:e&&(e.code?n[mh]=e.code.toString():e.name&&(n[mh]=e.name),e.message&&(n[gh]=e.message),e.stack&&(n["exception.stacktrace"]=e.stack)),n[mh]||n[gh]?this.addEvent("exception",n,t):Uu.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){const e=new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);Uu.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){const t=this._attributeValueLengthLimit;return t<=0?(Uu.warn(`Attribute value limit must be positive, got ${t}`),e):"string"==typeof e?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>"string"==typeof e?this._truncateToLimitUtil(e,t):e):e}}var wd,Cd;!function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(wd||(wd={}));class Sd{shouldSample(){return{decision:wd.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class _d{shouldSample(){return{decision:wd.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class Id{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||(dh(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new _d),this._remoteParentSampled=e.remoteParentSampled??new _d,this._remoteParentNotSampled=e.remoteParentNotSampled??new Sd,this._localParentSampled=e.localParentSampled??new _d,this._localParentNotSampled=e.localParentNotSampled??new Sd}shouldSample(e,t,n,r,s,o){const i=th.getSpanContext(e);return i&&Au(i)?i.isRemote?i.traceFlags&du.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,s,o):this._remoteParentNotSampled.shouldSample(e,t,n,r,s,o):i.traceFlags&du.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,s,o):this._localParentNotSampled.shouldSample(e,t,n,r,s,o):this._root.shouldSample(e,t,n,r,s,o)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}class Ed{_ratio;_upperBound;constructor(e=0){this._ratio=this._normalize(e),this._upperBound=Math.floor(4294967295*this._ratio)}shouldSample(e,t){return{decision:Tu(t)&&this._accumulate(t)<this._upperBound?wd.RECORD_AND_SAMPLED:wd.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return"number"!=typeof e||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<e.length/8;n++){const r=8*n;t=(t^parseInt(e.slice(r,r+8),16))>>>0}return t}}!function(e){e.AlwaysOff="always_off",e.AlwaysOn="always_on",e.ParentBasedAlwaysOff="parentbased_always_off",e.ParentBasedAlwaysOn="parentbased_always_on",e.ParentBasedTraceIdRatio="parentbased_traceidratio",e.TraceIdRatio="traceidratio"}(Cd||(Cd={}));function Td(){return{sampler:Ad(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function Ad(){const e=Cd.ParentBasedAlwaysOn;switch(e){case Cd.AlwaysOn:return new _d;case Cd.AlwaysOff:return new Sd;case Cd.ParentBasedAlwaysOn:return new Id({root:new _d});case Cd.ParentBasedAlwaysOff:return new Id({root:new Sd});case Cd.TraceIdRatio:return new Ed(kd());case Cd.ParentBasedTraceIdRatio:return new Id({root:new Ed(kd())});default:return Uu.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${Cd.ParentBasedAlwaysOn}".`),new Id({root:new _d})}}function kd(){return Uu.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to 1."),1}const Od=1/0;class Rd{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e,t){this._exporter=e,this._maxExportBatchSize="number"==typeof t?.maxExportBatchSize?t.maxExportBatchSize:512,this._maxQueueSize="number"==typeof t?.maxQueueSize?t.maxQueueSize:2048,this._scheduledDelayMillis="number"==typeof t?.scheduledDelayMillis?t.scheduledDelayMillis:5e3,this._exportTimeoutMillis="number"==typeof t?.exportTimeoutMillis?t.exportTimeoutMillis:3e4,this._shutdownOnce=new dd(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Uu.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||0!==(e.spanContext().traceFlags&du.SAMPLED)&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize)return 0===this._droppedSpansCount&&Uu.debug("maxQueueSize reached, dropping spans"),void this._droppedSpansCount++;this._droppedSpansCount>0&&(Uu.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{const n=[];for(let e=0,t=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);e<t;e++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),0===this._finishedSpans.length?Promise.resolve():new Promise((e,t)=>{const n=setTimeout(()=>{t(new Error("Timeout"))},this._exportTimeoutMillis);Bu.with(function(e){return e.setValue(nh,!0)}(Bu.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);const s=()=>this._exporter.export(r,r=>{clearTimeout(n),r.code===Fh.SUCCESS?e():t(r.error??new Error("BatchSpanProcessor: span export failed"))});let o=null;for(let e=0,t=r.length;e<t;e++){const t=r[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(o??=[],o.push(t.resource.waitForAsyncAttributes()))}null===o?s():Promise.all(o).then(s,e=>{dh(e),t(e)})})})}_maybeStartTimer(){if(this._isExporting)return;const e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{this._isExporting=!1,dh(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();void 0===this._timer&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),"number"!=typeof this._timer&&this._timer.unref())}_clearTimer(){void 0!==this._timer&&(clearTimeout(this._timer),this._timer=void 0)}}class xd extends Rd{_visibilityChangeListener;_pageHideListener;constructor(e,t){super(e,t),this.onInit(t)}onInit(e){!0!==e?.disableAutoFlushOnDocumentHide&&"undefined"!=typeof document&&(this._visibilityChangeListener=()=>{"hidden"===document.visibilityState&&this.forceFlush().catch(e=>{dh(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{dh(e)})},document.addEventListener("visibilitychange",this._visibilityChangeListener),document.addEventListener("pagehide",this._pageHideListener))}onShutdown(){"undefined"!=typeof document&&(this._visibilityChangeListener&&document.removeEventListener("visibilitychange",this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener("pagehide",this._pageHideListener))}}const Nd=new Uint8Array(16),Ld=new Uint8Array(8),Md=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Pd(e){for(let t=0;t<e.length;t++)e[t]=256*Math.random()>>>0;for(let t=0;t<e.length;t++)if(e[t]>0)return;e[e.length-1]=1}function Dd(e){let t="";for(let n=0;n<e.length;n++)t+=Md[e[n]];return t}class Fd{generateTraceId(){return Pd(Nd),Dd(Nd)}generateSpanId(){return Pd(Ld),Dd(Ld)}}const Bd="otel.span.parent.origin",Ud="otel.span.sampling_result";class jd{startedSpans;liveSpans;constructor(e){this.startedSpans=e.createCounter("otel.sdk.span.started",{unit:"{span}",description:"The number of created spans."}),this.liveSpans=e.createUpDownCounter("otel.sdk.span.live",{unit:"{span}",description:"The number of currently live spans."})}startSpan(e,t){const n=function(e){switch(e){case wd.RECORD_AND_SAMPLED:return"RECORD_AND_SAMPLE";case wd.RECORD:return"RECORD_ONLY";case wd.NOT_RECORD:return"DROP"}}(t);if(this.startedSpans.add(1,{[Bd]:Zd(e),[Ud]:n}),t===wd.NOT_RECORD)return()=>{};const r={[Ud]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}}function Zd(e){return e?e.isRemote?"remote":"local":"none"}class zd{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(e,t,n,r){const s=function(e){const t={sampler:Ad()},n=Td(),r=Object.assign({},n,t,e);return r.generalLimits=Object.assign({},n.generalLimits,e.generalLimits||{}),r.spanLimits=Object.assign({},n.spanLimits,e.spanLimits||{}),r}(t);this._sampler=s.sampler,this._generalLimits=s.generalLimits,this._spanLimits=s.spanLimits,this._idGenerator=t.idGenerator||new Fd,this._resource=n,this._spanProcessor=r,this.instrumentationScope=e;const o=s.meterProvider?s.meterProvider.getMeter("@opentelemetry/sdk-trace","2.6.1"):Ql;this._tracerMetrics=new jd(o)}startSpan(e,t={},n=Bu.active()){t.root&&(n=th.deleteSpan(n));const r=th.getSpan(n);if(rh(n)){Uu.debug("Instrumentation suppressed, returning Noop Span");return th.wrapSpanContext(gu)}const s=r?.spanContext(),o=this._idGenerator.generateSpanId();let i,a,c;s&&th.isSpanContextValid(s)?(a=s.traceId,c=s.traceState,i=s):a=this._idGenerator.generateTraceId();const l=t.kind??Du.INTERNAL,u=(t.links??[]).map(e=>({context:e.context,attributes:ah(e.attributes)})),h=ah(t.attributes),d=this._sampler.shouldSample(n,a,e,l,h,u),p=this._tracerMetrics.startSpan(s,d.decision);c=d.traceState??c;const f={traceId:a,spanId:o,traceFlags:d.decision===Pu.RECORD_AND_SAMPLED?du.SAMPLED:du.NONE,traceState:c};if(d.decision===Pu.NOT_RECORD){Uu.debug("Recording is off, propagating context in a non-recording span");return th.wrapSpanContext(f)}const g=ah(Object.assign(h,d.attributes));return new bd({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:f,name:e,kind:l,links:u,parentSpanContext:i,attributes:g,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:p})}startActiveSpan(e,t,n,r){let s,o,i;if(arguments.length<2)return;2===arguments.length?i=t:3===arguments.length?(s=t,i=n):(s=t,o=n,i=r);const a=o??Bu.active(),c=this.startSpan(e,s,a),l=th.setSpan(a,c);return Bu.with(l,i,void 0,c)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class Vd{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){const e=[];for(const t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{dh(e||new Error("MultiSpanProcessor: forceFlush failed")),t()})})}onStart(e,t){for(const n of this._spanProcessors)n.onStart(e,t)}onEnding(e){for(const t of this._spanProcessors)t.onEnding&&t.onEnding(e)}onEnd(e){for(const t of this._spanProcessors)t.onEnd(e)}shutdown(){const e=[];for(const t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}}var Hd,Gd;!function(e){e[e.resolved=0]="resolved",e[e.timeout=1]="timeout",e[e.error=2]="error",e[e.unresolved=3]="unresolved"}(Hd||(Hd={}));class Wd{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){const t=function(...e){let t=e.shift();const n=new WeakMap;for(;e.length>0;)t=od(t,e.shift(),0,n);return t}({},Td(),function(e){const t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??void 0??void 0??128,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??void 0??void 0??Od,Object.assign({},e,{spanLimits:t})}(e));this._resource=t.resource??yd({[Sh]:fd(),[_h]:kh[_h],[Ih]:kh[Ih],[Eh]:kh[Eh]}),this._config=Object.assign({},t,{resource:this._resource});const n=[];e.spanProcessors?.length&&n.push(...e.spanProcessors),this._activeSpanProcessor=new Vd(n)}getTracer(e,t,n){const r=`${e}@${t||""}:${n?.schemaUrl||""}`;return this._tracers.has(r)||this._tracers.set(r,new zd({name:e,version:t,schemaUrl:n?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(r)}forceFlush(){const e=this._config.forceFlushTimeoutMillis,t=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(n=>{let r;const s=setTimeout(()=>{n(new Error(`Span processor did not completed within timeout period of ${e} ms`)),r=Hd.timeout},e);t.forceFlush().then(()=>{clearTimeout(s),r!==Hd.timeout&&(r=Hd.resolved,n(r))}).catch(e=>{clearTimeout(s),r=Hd.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{const r=t.filter(e=>e!==Hd.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}class Yd{_enabled=!1;_currentContext=Jl;_bindFunction(e=Jl,t){const n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}active(){return this._currentContext}bind(e,t){return void 0===e&&(e=this.active()),"function"==typeof t?this._bindFunction(e,t):t}disable(){return this._currentContext=Jl,this._enabled=!1,this}enable(){return this._enabled||(this._enabled=!0,this._currentContext=Jl),this}with(e,t,n,...r){const s=this._currentContext;this._currentContext=e||Jl;try{return t.call(n,...r)}finally{this._currentContext=s}}}class Kd extends Wd{constructor(e={}){super(e)}register(e={}){var t;th.setGlobalTracerProvider(this),null!==(t=e.propagator)&&(void 0!==t?qu.setGlobalPropagator(t):qu.setGlobalPropagator(new Bh({propagators:[new Yh,new ih]}))),function(e){if(null!==e){if(void 0===e){const e=new Yd;return e.enable(),void Bu.setGlobalContextManager(e)}e.enable(),Bu.setGlobalContextManager(e)}}(e.contextManager)}}!function(e){e.CONNECT_END="connectEnd",e.CONNECT_START="connectStart",e.DECODED_BODY_SIZE="decodedBodySize",e.DOM_COMPLETE="domComplete",e.DOM_CONTENT_LOADED_EVENT_END="domContentLoadedEventEnd",e.DOM_CONTENT_LOADED_EVENT_START="domContentLoadedEventStart",e.DOM_INTERACTIVE="domInteractive",e.DOMAIN_LOOKUP_END="domainLookupEnd",e.DOMAIN_LOOKUP_START="domainLookupStart",e.ENCODED_BODY_SIZE="encodedBodySize",e.FETCH_START="fetchStart",e.LOAD_EVENT_END="loadEventEnd",e.LOAD_EVENT_START="loadEventStart",e.NAVIGATION_START="navigationStart",e.REDIRECT_END="redirectEnd",e.REDIRECT_START="redirectStart",e.REQUEST_START="requestStart",e.RESPONSE_END="responseEnd",e.RESPONSE_START="responseStart",e.SECURE_CONNECTION_START="secureConnectionStart",e.START_TIME="startTime",e.UNLOAD_EVENT_END="unloadEventEnd",e.UNLOAD_EVENT_START="unloadEventStart"}(Gd||(Gd={}));function $d(e,t){return t in e}function Jd(e,t,n,r=!0){if($d(n,t)&&"number"==typeof n[t]&&(!r||0!==n[t]))return e.addEvent(t,n[t])}function Xd(e,t,n=!1,r,s){void 0===r&&(r=0!==t[Gd.START_TIME]),n||(Jd(e,Gd.FETCH_START,t,r),Jd(e,Gd.DOMAIN_LOOKUP_START,t,r),Jd(e,Gd.DOMAIN_LOOKUP_END,t,r),Jd(e,Gd.CONNECT_START,t,r),Jd(e,Gd.SECURE_CONNECTION_START,t,r),Jd(e,Gd.CONNECT_END,t,r),Jd(e,Gd.REQUEST_START,t,r),Jd(e,Gd.RESPONSE_START,t,r),Jd(e,Gd.RESPONSE_END,t,r));{const n=t[Gd.ENCODED_BODY_SIZE];void 0!==n&&e.setAttribute("http.response_content_length",n);const r=t[Gd.DECODED_BODY_SIZE];void 0!==r&&n!==r&&e.setAttribute("http.response_content_length_uncompressed",r)}}function qd(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return"/";const n=function(e){const t=e.nodeType,n=function(e){if(!e.parentNode)return 0;const t=[e.nodeType];e.nodeType===Node.CDATA_SECTION_NODE&&t.push(Node.TEXT_NODE);let n=Array.from(e.parentNode.childNodes);if(n=n.filter(n=>{const r=n.localName;return t.indexOf(n.nodeType)>=0&&r===e.localName}),n.length>=1)return n.indexOf(e)+1;return 0}(e);let r="";if(t===Node.ELEMENT_NODE){const t=e.getAttribute("id");if(t)return`//*[@id="${t}"]`;r=e.localName}else if(t===Node.TEXT_NODE||t===Node.CDATA_SECTION_NODE)r="text()";else{if(t!==Node.COMMENT_NODE)return"";r="comment()"}if(r&&n>1)return`/${r}[${n}]`;return`/${r}`}(e);if(n.indexOf("@id")>0)return n;let r="";return e.parentNode&&(r+=qd(e.parentNode)),r+=n,r}let Qd=class{emit(e){}};const ep=new Qd;const tp=new class{getLogger(e,t,n){return new Qd}};let np=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;const e=this._provider.getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):ep}},rp=class{getLogger(e,t,n){var r;return null!==(r=this.getDelegateLogger(e,t,n))&&void 0!==r?r:new np(this,e,t,n)}getDelegate(){var e;return null!==(e=this._delegate)&&void 0!==e?e:tp}setDelegate(e){this._delegate=e}getDelegateLogger(e,t,n){var r;return null===(r=this._delegate)||void 0===r?void 0:r.getLogger(e,t,n)}};const sp="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},op=Symbol.for("io.opentelemetry.js.api.logs"),ip=sp;const ap=class e{constructor(){this._proxyLoggerProvider=new rp}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(e){return ip[op]?this.getLoggerProvider():(ip[op]=(t=1,n=e,r=tp,e=>e===t?n:r),this._proxyLoggerProvider.setDelegate(e),e);var t,n,r}getLoggerProvider(){var e,t;return null!==(t=null===(e=ip[op])||void 0===e?void 0:e.call(ip,1))&&void 0!==t?t:this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete ip[op],this._proxyLoggerProvider=new rp}}.getInstance();let cp=console.error.bind(console);function lp(e,t,n){const r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}const up=(e,t,n)=>{if(!e||!e[t])return void cp("no original function "+String(t)+" to wrap");if(!n)return cp("no wrapper function"),void cp((new Error).stack);const r=e[t];if("function"!=typeof r||"function"!=typeof n)return void cp("original object and wrapper must be functions");const s=n(r,t);return lp(s,"__original",r),lp(s,"__unwrap",()=>{e[t]===s&&lp(e,t,r)}),lp(s,"__wrapped",!0),lp(e,t,s),s},hp=(e,t,n)=>{if(!e)return cp("must provide one or more modules to patch"),void cp((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{up(e,t,n)})}):cp("must provide one or more functions to wrap on modules")},dp=(e,t)=>{if(!e||!e[t])return cp("no function to unwrap."),void cp((new Error).stack);const n=e[t];n.__unwrap?n.__unwrap():cp("no original to unwrap to -- has "+String(t)+" already been unwrapped?")},pp=(e,t)=>{if(!e)return cp("must provide one or more modules to patch"),void cp((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{dp(e,t)})}):cp("must provide one or more functions to unwrap on modules")};let fp=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,t,n){this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=Uu.createComponentLogger({namespace:e}),this._tracer=th.getTracer(e,t),this._meter=Vu.getMeter(e,t),this._logger=ap.getLogger(e,t),this._updateMetricInstruments()}_wrap=up;_unwrap=dp;_massWrap=hp;_massUnwrap=pp;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){const e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:t},e)}}},gp=class extends fp{constructor(e,t,n){super(e,t,n),this._config.enabled&&this.enable()}};function mp(e,t,n){let r,s;try{s=e()}catch(e){r=e}finally{return t(r,s),s}}function yp(e){return"function"==typeof e&&"function"==typeof e.__original&&"function"==typeof e.__unwrap&&!0===e.__wrapped}var vp,bp;function wp(e,t){let n=vp.OLD;const r=t?.split(",").map(e=>e.trim()).filter(e=>""!==e);for(const t of r??[]){if(t.toLowerCase()===e+"/dup"){n=vp.DUPLICATE;break}t.toLowerCase()===e&&(n=vp.STABLE)}return n}!function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"}(vp||(vp={})),function(e){e.DOCUMENT_LOAD="documentLoad",e.DOCUMENT_FETCH="documentFetch",e.RESOURCE_FETCH="resourceFetch"}(bp||(bp={}));var Cp;!function(e){e.FIRST_PAINT="firstPaint",e.FIRST_CONTENTFUL_PAINT="firstContentfulPaint"}(Cp||(Cp={}));const Sp={"first-paint":Cp.FIRST_PAINT,"first-contentful-paint":Cp.FIRST_CONTENTFUL_PAINT};class _p extends gp{component="document-load";version="1";moduleName=this.component;constructor(e={}){super("@opentelemetry/instrumentation-document-load","0.48.0",e)}init(){}_onDocumentLoaded(){window.setTimeout(()=>{this._collectPerformance()})}_addResourcesSpans(e){const t=Oh.getEntriesByType?.("resource");t&&t.forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){const e=Array.from(document.getElementsByTagName("meta")).find(e=>e.getAttribute("name")===Hh),t=(()=>{const e={},t=Oh.getEntriesByType?.("navigation")[0];if(t)Object.values(Gd).forEach(n=>{if($d(t,n)){const r=t[n];"number"==typeof r&&(e[n]=r)}});else{const t=Oh.timing;t&&Object.values(Gd).forEach(n=>{if($d(t,n)){const r=t[n];"number"==typeof r&&(e[n]=r)}})}return e})(),n=e&&e.content||"";Bu.with(qu.extract(Jl,{traceparent:n}),()=>{const e=this._startSpan(bp.DOCUMENT_LOAD,Gd.FETCH_START,t);e&&(Bu.with(th.setSpan(Bu.active(),e),()=>{const e=this._startSpan(bp.DOCUMENT_FETCH,Gd.FETCH_START,t);e&&(e.setAttribute(ph,location.href),Bu.with(th.setSpan(Bu.active(),e),()=>{Xd(e,t,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentFetch),this._endSpan(e,Gd.RESPONSE_END,t)}))}),e.setAttribute(ph,location.href),e.setAttribute("http.user_agent",navigator.userAgent),this._addResourcesSpans(e),this.getConfig().ignoreNetworkEvents||(Jd(e,Gd.FETCH_START,t),Jd(e,Gd.UNLOAD_EVENT_START,t),Jd(e,Gd.UNLOAD_EVENT_END,t),Jd(e,Gd.DOM_INTERACTIVE,t),Jd(e,Gd.DOM_CONTENT_LOADED_EVENT_START,t),Jd(e,Gd.DOM_CONTENT_LOADED_EVENT_END,t),Jd(e,Gd.DOM_COMPLETE,t),Jd(e,Gd.LOAD_EVENT_START,t),Jd(e,Gd.LOAD_EVENT_END,t)),this.getConfig().ignorePerformancePaintEvents||(e=>{const t=Oh.getEntriesByType?.("paint");t&&t.forEach(({name:t,startTime:n})=>{$d(Sp,t)&&e.addEvent(Sp[t],n)})})(e),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentLoad),this._endSpan(e,Gd.LOAD_EVENT_END,t))})}_endSpan(e,t,n){e&&($d(n,t)?e.end(n[t]):e.end())}_initResourceSpan(e,t){const n=this._startSpan(bp.RESOURCE_FETCH,Gd.FETCH_START,e,t);n&&(n.setAttribute(ph,e.name),Xd(n,e,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnResourceSpan(n,e,this.getConfig().applyCustomAttributesOnSpan?.resourceFetch),this._endSpan(n,Gd.RESPONSE_END,e))}_startSpan(e,t,n,r){if($d(n,t)&&"number"==typeof n[t]){return this.tracer.startSpan(e,{startTime:n[t]},r?th.setSpan(Bu.active(),r):void 0)}}_waitForPageLoad(){"complete"===window.document.readyState?this._onDocumentLoaded():(this._onDocumentLoaded=this._onDocumentLoaded.bind(this),window.addEventListener("load",this._onDocumentLoaded))}_addCustomAttributesOnSpan(e,t){t&&mp(()=>t(e),e=>{e&&this._diag.error("addCustomAttributesOnSpan",e)})}_addCustomAttributesOnResourceSpan(e,t,n){n&&mp(()=>n(e,t),e=>{e&&this._diag.error("addCustomAttributesOnResourceSpan",e)})}enable(){window.removeEventListener("load",this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener("load",this._onDocumentLoaded)}}const Ip="OT_ZONE_CONTEXT";class Ep{_enabled=!1;_bindFunction(e,t){const n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}_bindListener(e,t){const n=t;return void 0!==n.__ot_listeners||(n.__ot_listeners={},"function"==typeof n.addEventListener&&(n.addEventListener=this._patchAddEventListener(n,n.addEventListener,e)),"function"==typeof n.removeEventListener&&(n.removeEventListener=this._patchRemoveEventListener(n,n.removeEventListener))),t}_createZone(e,t){return Zone.current.fork({name:e,properties:{[Ip]:t}})}_patchAddEventListener(e,t,n){const r=this;return function(s,o,i){void 0===e.__ot_listeners&&(e.__ot_listeners={});let a=e.__ot_listeners[s];void 0===a&&(a=new WeakMap,e.__ot_listeners[s]=a);const c=r.bind(n,o);return a.set(o,c),t.call(this,s,c,i)}}_patchRemoveEventListener(e,t){return function(n,r){if(void 0===e.__ot_listeners||void 0===e.__ot_listeners[n])return t.call(this,n,r);const s=e.__ot_listeners[n],o=s.get(r);return s.delete(r),t.call(this,n,o||r)}}active(){return this._enabled&&Zone.current&&Zone.current.get(Ip)||Jl}bind(e,t){return"function"==typeof t?this._bindFunction(e,t):("object"==typeof(n=t)&&null!==n&&"addEventListener"in n&&"function"==typeof n.addEventListener&&"removeEventListener"in n&&"function"==typeof n.removeEventListener&&this._bindListener(e,t),t);var n}disable(){return this._enabled=!1,this}enable(){return this._enabled=!0,this}with(e,t,n,...r){let s="otel:with";return t.name&&(s+=`:${t.name}`),this._createZone(s,e).run(t,n,r)}}
16
16
  /**
17
17
  * @license Angular
18
18
  * (c) 2010-2026 Google LLC. https://angular.dev/
19
19
  * License: MIT
20
- */var Tp=Object.defineProperty,Ap=Object.defineProperties,kp=Object.getOwnPropertyDescriptors,Op=Object.getOwnPropertySymbols,Rp=Object.prototype.hasOwnProperty,xp=Object.prototype.propertyIsEnumerable,Np=(e,t,n)=>t in e?Tp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Lp=(e,t)=>{for(var n in t||(t={}))Rp.call(t,n)&&Np(e,n,t[n]);if(Op)for(var n of Op(t))xp.call(t,n)&&Np(e,n,t[n]);return e},Mp=(e,t,n)=>(Np(e,"symbol"!=typeof t?t+"":t,n),n),Pp=globalThis;function Dp(e){return(Pp.__Zone_symbol_prefix||"__zone_symbol__")+e}var Fp=Object.getOwnPropertyDescriptor,Bp=Object.defineProperty,Up=Object.getPrototypeOf,jp=Object.create,Zp=Array.prototype.slice,zp="addEventListener",Vp="removeEventListener",Hp=Dp(zp),Gp=Dp(Vp),Wp="true",Yp="false",Kp=Dp("");function Jp(e,t){return Zone.current.wrap(e,t)}function Xp(e,t,n,r,s){return Zone.current.scheduleMacroTask(e,t,n,r,s)}var $p=Dp,qp="undefined"!=typeof window,Qp=qp?window:void 0,ef=qp&&Qp||globalThis;function tf(e,t){for(let n=e.length-1;n>=0;n--)"function"==typeof e[n]&&(e[n]=Jp(e[n],t+"_"+n));return e}function nf(e){return!e||!1!==e.writable&&!("function"==typeof e.get&&void 0===e.set)}var rf="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,sf=!("nw"in ef)&&void 0!==ef.process&&"[object process]"===ef.process.toString(),of=!sf&&!rf&&!(!qp||!Qp.HTMLElement),af=void 0!==ef.process&&"[object process]"===ef.process.toString()&&!rf&&!(!qp||!Qp.HTMLElement),cf={},lf=$p("enable_beforeunload"),uf=function(e){if(!(e=e||ef.event))return;let t=cf[e.type];t||(t=cf[e.type]=$p("ON_PROPERTY"+e.type));const n=this||e.target||ef,r=n[t];let s;if(of&&n===Qp&&"error"===e.type){const t=e;s=r&&r.call(this,t.message,t.filename,t.lineno,t.colno,t.error),!0===s&&e.preventDefault()}else s=r&&r.apply(this,arguments),"beforeunload"===e.type&&ef[lf]&&"string"==typeof s?e.returnValue=s:null==s||s||e.preventDefault();return s};function hf(e,t,n){let r=Fp(e,t);if(!r&&n){Fp(n,t)&&(r={enumerable:!0,configurable:!0})}if(!r||!r.configurable)return;const s=$p("on"+t+"patched");if(e.hasOwnProperty(s)&&e[s])return;delete r.writable,delete r.value;const o=r.get,i=r.set,a=t.slice(2);let c=cf[a];c||(c=cf[a]=$p("ON_PROPERTY"+a)),r.set=function(t){let n=this;if(n||e!==ef||(n=ef),!n)return;"function"==typeof n[c]&&n.removeEventListener(a,uf),null==i||i.call(n,null),n[c]=t,"function"==typeof t&&n.addEventListener(a,uf,!1)},r.get=function(){let n=this;if(n||e!==ef||(n=ef),!n)return null;const s=n[c];if(s)return s;if(o){let e=o.call(this);if(e)return r.set.call(this,e),"function"==typeof n.removeAttribute&&n.removeAttribute(t),e}return null},Bp(e,t,r),e[s]=!0}function df(e,t,n){if(t)for(let r=0;r<t.length;r++)hf(e,"on"+t[r],n);else{const t=[];for(const n in e)"on"==n.slice(0,2)&&t.push(n);for(let r=0;r<t.length;r++)hf(e,t[r],n)}}var pf=$p("originalInstance");function ff(e){const t=ef[e];if(!t)return;ef[$p(e)]=t,ef[e]=function(){const n=tf(arguments,e);switch(n.length){case 0:this[pf]=new t;break;case 1:this[pf]=new t(n[0]);break;case 2:this[pf]=new t(n[0],n[1]);break;case 3:this[pf]=new t(n[0],n[1],n[2]);break;case 4:this[pf]=new t(n[0],n[1],n[2],n[3]);break;default:throw new Error("Arg list too long.")}},yf(ef[e],t);const n=new t(function(){});let r;for(r in n)"XMLHttpRequest"===e&&"responseBlob"===r||function(t){"function"==typeof n[t]?ef[e].prototype[t]=function(){return this[pf][t].apply(this[pf],arguments)}:Bp(ef[e].prototype,t,{set:function(n){"function"==typeof n?(this[pf][t]=Jp(n,e+"."+t),yf(this[pf][t],n)):this[pf][t]=n},get:function(){return this[pf][t]}})}(r);for(r in t)"prototype"!==r&&t.hasOwnProperty(r)&&(ef[e][r]=t[r])}function gf(e,t,n){let r=e;for(;r&&!r.hasOwnProperty(t);)r=Up(r);!r&&e[t]&&(r=e);const s=$p(t);let o=null;if(r&&(!(o=r[s])||!r.hasOwnProperty(s))){o=r[s]=r[t];if(nf(r&&Fp(r,t))){const e=n(o,s,t);r[t]=function(){return e(this,arguments)},yf(r[t],o)}}return o}function mf(e,t,n){let r=null;function s(e){const t=e.data;return t.args[t.cbIdx]=function(){e.invoke.apply(this,arguments)},r.apply(t.target,t.args),e}r=gf(e,t,e=>function(t,r){const o=n(t,r);return o.cbIdx>=0&&"function"==typeof r[o.cbIdx]?Xp(o.name,r[o.cbIdx],o,s):e.apply(t,r)})}function yf(e,t){e[$p("OriginalDelegate")]=t}function vf(e){return"function"==typeof e}function bf(e){return"number"==typeof e}var wf={useG:!0},Cf={},Sf={},_f=new RegExp("^"+Kp+"(\\w+)(true|false)$"),If=$p("propagationStopped");function Ef(e,t){const n=(t?t(e):e)+Yp,r=(t?t(e):e)+Wp,s=Kp+n,o=Kp+r;Cf[e]={},Cf[e][Yp]=s,Cf[e][Wp]=o}function Tf(e,t,n,r){const s=r&&r.add||zp,o=r&&r.rm||Vp,i=r&&r.listeners||"eventListeners",a=r&&r.rmAll||"removeAllListeners",c=$p(s),l="."+s+":",u="prependListener",h="."+u+":",d=function(e,t,n){if(e.isRemoved)return;const r=e.callback;let s;"object"==typeof r&&r.handleEvent&&(e.callback=e=>r.handleEvent(e),e.originalDelegate=r);try{e.invoke(e,t,[n])}catch(e){s=e}const i=e.options;if(i&&"object"==typeof i&&i.once){const r=e.originalDelegate?e.originalDelegate:e.callback;t[o].call(t,n.type,r,i)}return s};function p(n,r,s){if(!(r=r||e.event))return;const o=n||r.target||e,i=o[Cf[r.type][s?Wp:Yp]];if(i){const e=[];if(1===i.length){const t=d(i[0],o,r);t&&e.push(t)}else{const t=i.slice();for(let n=0;n<t.length&&(!r||!0!==r[If]);n++){const s=d(t[n],o,r);s&&e.push(s)}}if(1===e.length)throw e[0];for(let n=0;n<e.length;n++){const r=e[n];t.nativeScheduleMicroTask(()=>{throw r})}}}const f=function(e){return p(this,e,!1)},g=function(e){return p(this,e,!0)};function m(t,n){if(!t)return!1;let r=!0;n&&void 0!==n.useG&&(r=n.useG);const d=n&&n.vh;let p=!0;n&&void 0!==n.chkDup&&(p=n.chkDup);let m=!1;n&&void 0!==n.rt&&(m=n.rt);let y=t;for(;y&&!y.hasOwnProperty(s);)y=Up(y);if(!y&&t[s]&&(y=t),!y)return!1;if(y[c])return!1;const v=n&&n.eventNameToString,b={},w=y[c]=y[s],C=y[$p(o)]=y[o],S=y[$p(i)]=y[i],_=y[$p(a)]=y[a];let I;function E(e,t){return t?"boolean"==typeof e?{capture:e,passive:!0}:e?"object"==typeof e&&!1!==e.passive?((e,t)=>Ap(e,kp(t)))(Lp({},e),{passive:!0}):e:{passive:!0}:e}n&&n.prepend&&(I=y[$p(n.prepend)]=y[n.prepend]);const T=function(e){return I.call(b.target,b.eventName,e.invoke,b.options)},A=r?function(e){if(!b.isExisting)return w.call(b.target,b.eventName,b.capture?g:f,b.options)}:function(e){return w.call(b.target,b.eventName,e.invoke,b.options)},k=r?function(e){if(!e.isRemoved){const t=Cf[e.eventName];let n;t&&(n=t[e.capture?Wp:Yp]);const r=n&&e.target[n];if(r)for(let t=0;t<r.length;t++){if(r[t]===e){r.splice(t,1),e.isRemoved=!0,e.removeAbortListener&&(e.removeAbortListener(),e.removeAbortListener=null),0===r.length&&(e.allRemoved=!0,e.target[n]=null);break}}}if(e.allRemoved)return C.call(e.target,e.eventName,e.capture?g:f,e.options)}:function(e){return C.call(e.target,e.eventName,e.invoke,e.options)},O=(null==n?void 0:n.diff)||function(e,t){const n=typeof t;return"function"===n&&e.callback===t||"object"===n&&e.originalDelegate===t},R=Zone[$p("UNPATCHED_EVENTS")],x=e[$p("PASSIVE_EVENTS")];const N=function(t,s,o,i,a=!1,c=!1){return function(){const l=this||e;let u=arguments[0];n&&n.transferEventName&&(u=n.transferEventName(u));let h=arguments[1];if(!h)return t.apply(this,arguments);if(sf&&"uncaughtException"===u)return t.apply(this,arguments);let f=!1;if("function"!=typeof h){if(!h.handleEvent)return t.apply(this,arguments);f=!0}if(d&&!d(t,h,l,arguments))return;const g=!!x&&-1!==x.indexOf(u),m=function(e){if("object"==typeof e&&null!==e){const t=Lp({},e);return e.signal&&(t.signal=e.signal),t}return e}(E(arguments[2],g)),y=null==m?void 0:m.signal;if(null==y?void 0:y.aborted)return;if(R)for(let e=0;e<R.length;e++)if(u===R[e])return g?t.call(l,u,h,m):t.apply(this,arguments);const w=!!m&&("boolean"==typeof m||m.capture),C=!(!m||"object"!=typeof m)&&m.once,S=Zone.current;let _=Cf[u];_||(Ef(u,v),_=Cf[u]);const I=_[w?Wp:Yp];let T,A=l[I],k=!1;if(A){if(k=!0,p)for(let e=0;e<A.length;e++)if(O(A[e],h))return}else A=l[I]=[];const N=l.constructor.name,L=Sf[N];L&&(T=L[u]),T||(T=N+s+(v?v(u):u)),b.options=m,C&&(b.options.once=!1),b.target=l,b.capture=w,b.eventName=u,b.isExisting=k;const M=r?wf:void 0;M&&(M.taskData=b),y&&(b.options.signal=void 0);const P=S.scheduleEventTask(T,h,M,o,i);if(y){b.options.signal=y;const e=()=>P.zone.cancelTask(P);t.call(y,"abort",e,{once:!0}),P.removeAbortListener=()=>y.removeEventListener("abort",e)}return b.target=null,M&&(M.taskData=null),C&&(b.options.once=!0),"boolean"!=typeof P.options&&(P.options=m),P.target=l,P.capture=w,P.eventName=u,f&&(P.originalDelegate=h),c?A.unshift(P):A.push(P),a?l:void 0}};return y[s]=N(w,l,A,k,m),I&&(y[u]=N(I,h,T,k,m,!0)),y[o]=function(){const t=this||e;let r=arguments[0];n&&n.transferEventName&&(r=n.transferEventName(r));const s=arguments[2],o=!!s&&("boolean"==typeof s||s.capture),i=arguments[1];if(!i)return C.apply(this,arguments);if(d&&!d(C,i,t,arguments))return;const a=Cf[r];let c;a&&(c=a[o?Wp:Yp]);const l=c&&t[c];if(l)for(let e=0;e<l.length;e++){const n=l[e];if(O(n,i)){if(l.splice(e,1),n.isRemoved=!0,0===l.length&&(n.allRemoved=!0,t[c]=null,!o&&"string"==typeof r)){t[Kp+"ON_PROPERTY"+r]=null}return n.zone.cancelTask(n),m?t:void 0}}return C.apply(this,arguments)},y[i]=function(){const t=this||e;let r=arguments[0];n&&n.transferEventName&&(r=n.transferEventName(r));const s=[],o=Af(t,v?v(r):r);for(let e=0;e<o.length;e++){const t=o[e];let n=t.originalDelegate?t.originalDelegate:t.callback;s.push(n)}return s},y[a]=function(){const t=this||e;let r=arguments[0];if(r){n&&n.transferEventName&&(r=n.transferEventName(r));const e=Cf[r];if(e){const n=e[Yp],s=e[Wp],i=t[n],a=t[s];if(i){const e=i.slice();for(let t=0;t<e.length;t++){const n=e[t];let s=n.originalDelegate?n.originalDelegate:n.callback;this[o].call(this,r,s,n.options)}}if(a){const e=a.slice();for(let t=0;t<e.length;t++){const n=e[t];let s=n.originalDelegate?n.originalDelegate:n.callback;this[o].call(this,r,s,n.options)}}}}else{const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t],r=_f.exec(n);let s=r&&r[1];s&&"removeListener"!==s&&this[a].call(this,s)}this[a].call(this,"removeListener")}if(m)return this},yf(y[s],w),yf(y[o],C),_&&yf(y[a],_),S&&yf(y[i],S),!0}let y=[];for(let e=0;e<n.length;e++)y[e]=m(n[e],r);return y}function Af(e,t){if(!t){const n=[];for(let r in e){const s=_f.exec(r);let o=s&&s[1];if(o&&(!t||o===t)){const t=e[r];if(t)for(let e=0;e<t.length;e++)n.push(t[e])}}return n}let n=Cf[t];n||(Ef(t),n=Cf[t]);const r=e[n[Yp]],s=e[n[Wp]];return r?s?r.concat(s):r.slice():s?s.slice():[]}function kf(e,t){const n=e.Event;n&&n.prototype&&t.patchMethod(n.prototype,"stopImmediatePropagation",e=>function(t,n){t[If]=!0,e&&e.apply(t,n)})}var Of=$p("zoneTask");function Rf(e,t,n,r){let s=null,o=null;n+=r;const i={};function a(t){const n=t.data;n.args[0]=function(){return t.invoke.apply(this,arguments)};const r=s.apply(e,n.args);return bf(r)?n.handleId=r:(n.handle=r,n.isRefreshable=vf(r.refresh)),t}function c(t){const{handle:n,handleId:r}=t.data;return o.call(e,null!=n?n:r)}s=gf(e,t+=r,n=>function(s,o){var l;if(vf(o[0])){const e={isRefreshable:!1,isPeriodic:"Interval"===r,delay:"Timeout"===r||"Interval"===r?o[1]||0:void 0,args:o},n=o[0];o[0]=function(){try{return n.apply(this,arguments)}finally{const{handle:t,handleId:n,isPeriodic:r,isRefreshable:s}=e;r||s||(n?delete i[n]:t&&(t[Of]=null))}};const s=Xp(t,o[0],e,a,c);if(!s)return s;const{handleId:u,handle:h,isRefreshable:d,isPeriodic:p}=s.data;if(u)i[u]=s;else if(h&&(h[Of]=s,d&&!p)){const e=h.refresh;h.refresh=function(){const{zone:t,state:n}=s;return"notScheduled"===n?(s._state="scheduled",t._updateTaskCount(s,1)):"running"===n&&(s._state="scheduling"),e.call(this)}}return null!=(l=null!=h?h:u)?l:s}return n.apply(e,o)}),o=gf(e,n,t=>function(n,r){const s=r[0];let o;bf(s)?(o=i[s],delete i[s]):(o=null==s?void 0:s[Of],o?s[Of]=null:o=s),(null==o?void 0:o.type)?o.cancelFn&&o.zone.cancelTask(o):t.apply(e,r)})}function xf(e,t,n){if(!n||0===n.length)return t;const r=n.filter(t=>t.target===e);if(0===r.length)return t;const s=r[0].ignoreProperties;return t.filter(e=>-1===s.indexOf(e))}function Nf(e,t,n,r){if(!e)return;df(e,xf(e,t,n),r)}function Lf(e){return Object.getOwnPropertyNames(e).filter(e=>e.startsWith("on")&&e.length>2).map(e=>e.substring(2))}function Mf(e){e.__load_patch("ZoneAwarePromise",(e,t,n)=>{const r=Object.getOwnPropertyDescriptor,s=Object.defineProperty;const o=n.symbol,i=[],a=!1!==e[o("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")],c=o("Promise"),l=o("then");n.onUnhandledError=e=>{if(n.showUncaughtError()){const t=e&&e.rejection;t?console.error("Unhandled Promise rejection:",t instanceof Error?t.message:t,"; Zone:",e.zone.name,"; Task:",e.task&&e.task.source,"; Value:",t,t instanceof Error?t.stack:void 0):console.error(e)}},n.microtaskDrainDone=()=>{for(;i.length;){const e=i.shift();try{e.zone.runGuarded(()=>{if(e.throwOriginal)throw e.rejection;throw e})}catch(e){h(e)}}};const u=o("unhandledPromiseRejectionHandler");function h(e){n.onUnhandledError(e);try{const n=t[u];"function"==typeof n&&n.call(this,e)}catch(e){}}function d(e){return e&&"function"==typeof e.then}function p(e){return e}function f(e){return L.reject(e)}const g=o("state"),m=o("value"),y=o("finally"),v=o("parentPromiseValue"),b=o("parentPromiseState"),w=null,C=!0,S=!1;function _(e,t){return n=>{try{A(e,t,n)}catch(t){A(e,!1,t)}}}const I=function(){let e=!1;return function(t){return function(){e||(e=!0,t.apply(null,arguments))}}},E="Promise resolved with itself",T=o("currentTaskTrace");function A(e,r,o){const c=I();if(e===o)throw new TypeError(E);if(e[g]===w){let l=null;try{"object"!=typeof o&&"function"!=typeof o||(l=o&&o.then)}catch(t){return c(()=>{A(e,!1,t)})(),e}if(r!==S&&o instanceof L&&o.hasOwnProperty(g)&&o.hasOwnProperty(m)&&o[g]!==w)O(o),A(e,o[g],o[m]);else if(r!==S&&"function"==typeof l)try{l.call(o,c(_(e,r)),c(_(e,!1)))}catch(t){c(()=>{A(e,!1,t)})()}else{e[g]=r;const c=e[m];if(e[m]=o,e[y]===y&&r===C&&(e[g]=e[b],e[m]=e[v]),r===S&&o instanceof Error){const e=t.currentTask&&t.currentTask.data&&t.currentTask.data.__creationTrace__;e&&s(o,T,{configurable:!0,enumerable:!1,writable:!0,value:e})}for(let t=0;t<c.length;)R(e,c[t++],c[t++],c[t++],c[t++]);if(0==c.length&&r==S){e[g]=0;let r=o;try{throw new Error("Uncaught (in promise): "+function(e){if(e&&e.toString===Object.prototype.toString){return(e.constructor&&e.constructor.name||"")+": "+JSON.stringify(e)}return e?e.toString():Object.prototype.toString.call(e)}(o)+(o&&o.stack?"\n"+o.stack:""))}catch(e){r=e}a&&(r.throwOriginal=!0),r.rejection=o,r.promise=e,r.zone=t.current,r.task=t.currentTask,i.push(r),n.scheduleMicroTask()}}}return e}const k=o("rejectionHandledHandler");function O(e){if(0===e[g]){try{const n=t[k];n&&"function"==typeof n&&n.call(this,{rejection:e[m],promise:e})}catch(e){}e[g]=S;for(let t=0;t<i.length;t++)e===i[t].promise&&i.splice(t,1)}}function R(e,t,n,r,s){O(e);const o=e[g],i=o?"function"==typeof r?r:p:"function"==typeof s?s:f;t.scheduleMicroTask("Promise.then",()=>{try{const r=e[m],s=!!n&&y===n[y];s&&(n[v]=r,n[b]=o);const a=t.run(i,void 0,s&&i!==f&&i!==p?[]:[r]);A(n,!0,a)}catch(e){A(n,!1,e)}},n)}const x=function(){},N=e.AggregateError;class L{static toString(){return"function ZoneAwarePromise() { [native code] }"}static resolve(e){return e instanceof L?e:A(new this(null),C,e)}static reject(e){return A(new this(null),S,e)}static withResolvers(){const e={};return e.promise=new L((t,n)=>{e.resolve=t,e.reject=n}),e}static any(e){if(!e||"function"!=typeof e[Symbol.iterator])return Promise.reject(new N([],"All promises were rejected"));const t=[];let n=0;try{for(let r of e)n++,t.push(L.resolve(r))}catch(e){return Promise.reject(new N([],"All promises were rejected"))}if(0===n)return Promise.reject(new N([],"All promises were rejected"));let r=!1;const s=[];return new L((e,o)=>{for(let i=0;i<t.length;i++)t[i].then(t=>{r||(r=!0,e(t))},e=>{s.push(e),n--,0===n&&(r=!0,o(new N(s,"All promises were rejected")))})})}static race(e){let t,n,r=new this((e,r)=>{t=e,n=r});function s(e){t(e)}function o(e){n(e)}for(let t of e)d(t)||(t=this.resolve(t)),t.then(s,o);return r}static all(e){return L.allWithCallback(e)}static allSettled(e){return(this&&this.prototype instanceof L?this:L).allWithCallback(e,{thenCallback:e=>({status:"fulfilled",value:e}),errorCallback:e=>({status:"rejected",reason:e})})}static allWithCallback(e,t){let n,r,s=new this((e,t)=>{n=e,r=t}),o=2,i=0;const a=[];for(let s of e){d(s)||(s=this.resolve(s));const e=i;try{s.then(r=>{a[e]=t?t.thenCallback(r):r,o--,0===o&&n(a)},s=>{t?(a[e]=t.errorCallback(s),o--,0===o&&n(a)):r(s)})}catch(e){r(e)}o++,i++}return o-=2,0===o&&n(a),s}constructor(e){const t=this;if(!(t instanceof L))throw new Error("Must be an instanceof Promise.");t[g]=w,t[m]=[];try{const n=I();e&&e(n(_(t,C)),n(_(t,S)))}catch(e){A(t,!1,e)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return L}then(e,n){var r;let s=null==(r=this.constructor)?void 0:r[Symbol.species];s&&"function"==typeof s||(s=this.constructor||L);const o=new s(x),i=t.current;return this[g]==w?this[m].push(i,o,e,n):R(this,i,o,e,n),o}catch(e){return this.then(null,e)}finally(e){var n;let r=null==(n=this.constructor)?void 0:n[Symbol.species];r&&"function"==typeof r||(r=L);const s=new r(x);s[y]=y;const o=t.current;return this[g]==w?this[m].push(o,s,e,e):R(this,o,s,e,e),s}}L.resolve=L.resolve,L.reject=L.reject,L.race=L.race,L.all=L.all;const M=e[c]=e.Promise;e.Promise=L;const P=o("thenPatched");function D(e){const t=e.prototype,n=r(t,"then");if(n&&(!1===n.writable||!n.configurable))return;const s=t.then;t[l]=s,e.prototype.then=function(e,t){const n=new L((e,t)=>{s.call(this,e,t)});return n.then(e,t)},e[P]=!0}if(n.patchThen=D,M){D(M);const t=M.try;t&&"function"==typeof t&&(L.try=t),gf(e,"fetch",e=>{return t=e,function(e,n){let r=t.apply(e,n);if(r instanceof L)return r;let s=r.constructor;return s[P]||D(s),r};var t})}return Promise[t.__symbol__("uncaughtPromiseErrors")]=i,L})}function Pf(e,t,n,r,s){const o=Zone.__symbol__(r);if(t[o])return;const i=t[o]=t[r];t[r]=function(o,a,c){return a&&a.prototype&&s.forEach(function(t){const s=`${n}.${r}::`+t,o=a.prototype;try{if(o.hasOwnProperty(t)){const n=e.ObjectGetOwnPropertyDescriptor(o,t);n&&n.value?(n.value=e.wrapWithCurrentZone(n.value,s),e._redefineProperty(a.prototype,t,n)):o[t]&&(o[t]=e.wrapWithCurrentZone(o[t],s))}else o[t]&&(o[t]=e.wrapWithCurrentZone(o[t],s))}catch(e){}}),i.call(t,o,a,c)},e.attachOriginToPatched(t[r],i)}var Df,Ff=function(){const e=globalThis,t=!0===e[Dp("forceDuplicateZoneCheck")];if(e.Zone&&(t||"function"!=typeof e.Zone.__symbol__))throw new Error("Zone already loaded.");return null!=e.Zone||(e.Zone=function(){const e=Pp.performance;function t(t){e&&e.mark&&e.mark(t)}function n(t,n){e&&e.measure&&e.measure(t,n)}t("Zone");const r=class e{constructor(e,t){Mp(this,"_parent"),Mp(this,"_name"),Mp(this,"_properties"),Mp(this,"_zoneDelegate"),this._parent=e,this._name=t?t.name||"unnamed":"<root>",this._properties=t&&t.properties||{},this._zoneDelegate=new i(this,this._parent&&this._parent._zoneDelegate,t)}static assertZonePatched(){if(Pp.Promise!==A.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let t=e.current;for(;t.parent;)t=t.parent;return t}static get current(){return O.zone}static get currentTask(){return R}static __load_patch(r,s,o=!1){if(A.hasOwnProperty(r)){const e=!0===Pp[Dp("forceDuplicateZoneCheck")];if(!o&&e)throw Error("Already loaded patch: "+r)}else if(!Pp["__Zone_disable_"+r]){const o="Zone:"+r;t(o),A[r]=s(Pp,e,k),n(o,o)}}get parent(){return this._parent}get name(){return this._name}get(e){const t=this.getZoneWith(e);if(t)return t._properties[e]}getZoneWith(e){let t=this;for(;t;){if(t._properties.hasOwnProperty(e))return t;t=t._parent}return null}fork(e){if(!e)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)}wrap(e,t){if("function"!=typeof e)throw new Error("Expecting function got: "+e);const n=this._zoneDelegate.intercept(this,e,t),r=this;return function(){return r.runGuarded(n,this,arguments,t)}}run(e,t,n,r){O={parent:O,zone:this};try{return this._zoneDelegate.invoke(this,e,t,n,r)}finally{O=O.parent}}runGuarded(e,t=null,n,r){O={parent:O,zone:this};try{try{return this._zoneDelegate.invoke(this,e,t,n,r)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{O=O.parent}}runTask(e,t,n){if(e.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(e.zone||y).name+"; Execution: "+this.name+")");const r=e,{type:s,data:{isPeriodic:o=!1,isRefreshable:i=!1}={}}=e;if(e.state===v&&(s===T||s===E))return;const a=e.state!=C;a&&r._transitionTo(C,w);const c=R;R=r,O={parent:O,zone:this};try{s!=E||!e.data||o||i||(e.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,r,t,n)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{const t=e.state;if(t!==v&&t!==_)if(s==T||o||i&&t===b)a&&r._transitionTo(w,C,b);else{const e=r._zoneDelegates;this._updateTaskCount(r,-1),a&&r._transitionTo(v,C,v),i&&(r._zoneDelegates=e)}O=O.parent,R=c}}scheduleTask(e){if(e.zone&&e.zone!==this){let t=this;for(;t;){if(t===e.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${e.zone.name}`);t=t.parent}}e._transitionTo(b,v);const t=[];e._zoneDelegates=t,e._zone=this;try{e=this._zoneDelegate.scheduleTask(this,e)}catch(t){throw e._transitionTo(_,b,v),this._zoneDelegate.handleError(this,t),t}return e._zoneDelegates===t&&this._updateTaskCount(e,1),e.state==b&&e._transitionTo(w,b),e}scheduleMicroTask(e,t,n,r){return this.scheduleTask(new a(I,e,t,n,r,void 0))}scheduleMacroTask(e,t,n,r,s){return this.scheduleTask(new a(E,e,t,n,r,s))}scheduleEventTask(e,t,n,r,s){return this.scheduleTask(new a(T,e,t,n,r,s))}cancelTask(e){if(e.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(e.zone||y).name+"; Execution: "+this.name+")");if(e.state===w||e.state===C){e._transitionTo(S,w,C);try{this._zoneDelegate.cancelTask(this,e)}catch(t){throw e._transitionTo(_,S),this._zoneDelegate.handleError(this,t),t}return this._updateTaskCount(e,-1),e._transitionTo(v,S),e.runCount=-1,e}}_updateTaskCount(e,t){const n=e._zoneDelegates;-1==t&&(e._zoneDelegates=null);for(let r=0;r<n.length;r++)n[r]._updateTaskCount(e.type,t)}};Mp(r,"__symbol__",Dp);let s=r;const o={name:"",onHasTask:(e,t,n,r)=>e.hasTask(n,r),onScheduleTask:(e,t,n,r)=>e.scheduleTask(n,r),onInvokeTask:(e,t,n,r,s,o)=>e.invokeTask(n,r,s,o),onCancelTask:(e,t,n,r)=>e.cancelTask(n,r)};class i{constructor(e,t,n){Mp(this,"_zone"),Mp(this,"_taskCounts",{microTask:0,macroTask:0,eventTask:0}),Mp(this,"_parentDelegate"),Mp(this,"_forkDlgt"),Mp(this,"_forkZS"),Mp(this,"_forkCurrZone"),Mp(this,"_interceptDlgt"),Mp(this,"_interceptZS"),Mp(this,"_interceptCurrZone"),Mp(this,"_invokeDlgt"),Mp(this,"_invokeZS"),Mp(this,"_invokeCurrZone"),Mp(this,"_handleErrorDlgt"),Mp(this,"_handleErrorZS"),Mp(this,"_handleErrorCurrZone"),Mp(this,"_scheduleTaskDlgt"),Mp(this,"_scheduleTaskZS"),Mp(this,"_scheduleTaskCurrZone"),Mp(this,"_invokeTaskDlgt"),Mp(this,"_invokeTaskZS"),Mp(this,"_invokeTaskCurrZone"),Mp(this,"_cancelTaskDlgt"),Mp(this,"_cancelTaskZS"),Mp(this,"_cancelTaskCurrZone"),Mp(this,"_hasTaskDlgt"),Mp(this,"_hasTaskDlgtOwner"),Mp(this,"_hasTaskZS"),Mp(this,"_hasTaskCurrZone"),this._zone=e,this._parentDelegate=t,this._forkZS=n&&(n&&n.onFork?n:t._forkZS),this._forkDlgt=n&&(n.onFork?t:t._forkDlgt),this._forkCurrZone=n&&(n.onFork?this._zone:t._forkCurrZone),this._interceptZS=n&&(n.onIntercept?n:t._interceptZS),this._interceptDlgt=n&&(n.onIntercept?t:t._interceptDlgt),this._interceptCurrZone=n&&(n.onIntercept?this._zone:t._interceptCurrZone),this._invokeZS=n&&(n.onInvoke?n:t._invokeZS),this._invokeDlgt=n&&(n.onInvoke?t:t._invokeDlgt),this._invokeCurrZone=n&&(n.onInvoke?this._zone:t._invokeCurrZone),this._handleErrorZS=n&&(n.onHandleError?n:t._handleErrorZS),this._handleErrorDlgt=n&&(n.onHandleError?t:t._handleErrorDlgt),this._handleErrorCurrZone=n&&(n.onHandleError?this._zone:t._handleErrorCurrZone),this._scheduleTaskZS=n&&(n.onScheduleTask?n:t._scheduleTaskZS),this._scheduleTaskDlgt=n&&(n.onScheduleTask?t:t._scheduleTaskDlgt),this._scheduleTaskCurrZone=n&&(n.onScheduleTask?this._zone:t._scheduleTaskCurrZone),this._invokeTaskZS=n&&(n.onInvokeTask?n:t._invokeTaskZS),this._invokeTaskDlgt=n&&(n.onInvokeTask?t:t._invokeTaskDlgt),this._invokeTaskCurrZone=n&&(n.onInvokeTask?this._zone:t._invokeTaskCurrZone),this._cancelTaskZS=n&&(n.onCancelTask?n:t._cancelTaskZS),this._cancelTaskDlgt=n&&(n.onCancelTask?t:t._cancelTaskDlgt),this._cancelTaskCurrZone=n&&(n.onCancelTask?this._zone:t._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;const r=n&&n.onHasTask,s=t&&t._hasTaskZS;(r||s)&&(this._hasTaskZS=r?n:o,this._hasTaskDlgt=t,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=this._zone,n.onScheduleTask||(this._scheduleTaskZS=o,this._scheduleTaskDlgt=t,this._scheduleTaskCurrZone=this._zone),n.onInvokeTask||(this._invokeTaskZS=o,this._invokeTaskDlgt=t,this._invokeTaskCurrZone=this._zone),n.onCancelTask||(this._cancelTaskZS=o,this._cancelTaskDlgt=t,this._cancelTaskCurrZone=this._zone))}get zone(){return this._zone}fork(e,t){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,e,t):new s(e,t)}intercept(e,t,n){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,e,t,n):t}invoke(e,t,n,r,s){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,e,t,n,r,s):t.apply(n,r)}handleError(e,t){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,e,t)}scheduleTask(e,t){let n=t;if(this._scheduleTaskZS)this._hasTaskZS&&n._zoneDelegates.push(this._hasTaskDlgtOwner),n=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,e,t),n||(n=t);else if(t.scheduleFn)t.scheduleFn(t);else{if(t.type!=I)throw new Error("Task is missing scheduleFn.");g(t)}return n}invokeTask(e,t,n,r){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,e,t,n,r):t.callback.apply(n,r)}cancelTask(e,t){let n;if(this._cancelTaskZS)n=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,e,t);else{if(!t.cancelFn)throw Error("Task is not cancelable");n=t.cancelFn(t)}return n}hasTask(e,t){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,e,t)}catch(t){this.handleError(e,t)}}_updateTaskCount(e,t){const n=this._taskCounts,r=n[e],s=n[e]=r+t;if(s<0)throw new Error("More tasks executed then were scheduled.");if(0==r||0==s){const t={microTask:n.microTask>0,macroTask:n.macroTask>0,eventTask:n.eventTask>0,change:e};this.hasTask(this._zone,t)}}}class a{constructor(e,t,n,r,s,o){if(Mp(this,"type"),Mp(this,"source"),Mp(this,"invoke"),Mp(this,"callback"),Mp(this,"data"),Mp(this,"scheduleFn"),Mp(this,"cancelFn"),Mp(this,"_zone",null),Mp(this,"runCount",0),Mp(this,"_zoneDelegates",null),Mp(this,"_state","notScheduled"),this.type=e,this.source=t,this.data=r,this.scheduleFn=s,this.cancelFn=o,!n)throw new Error("callback is not defined");this.callback=n;const i=this;e===T&&r&&r.useG?this.invoke=a.invokeTask:this.invoke=function(){return a.invokeTask.call(Pp,i,this,arguments)}}static invokeTask(e,t,n){e||(e=this),x++;try{return e.runCount++,e.zone.runTask(e,t,n)}finally{1==x&&m(),x--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(v,b)}_transitionTo(e,t,n){if(this._state!==t&&this._state!==n)throw new Error(`${this.type} '${this.source}': can not transition to '${e}', expecting state '${t}'${n?" or '"+n+"'":""}, was '${this._state}'.`);this._state=e,e==v&&(this._zoneDelegates=null)}toString(){return this.data&&void 0!==this.data.handleId?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}const c=Dp("setTimeout"),l=Dp("Promise"),u=Dp("then");let h,d=[],p=!1;function f(e){if(h||Pp[l]&&(h=Pp[l].resolve(0)),h){let t=h[u];t||(t=h.then),t.call(h,e)}else Pp[c](e,0)}function g(e){0===x&&0===d.length&&f(m),e&&d.push(e)}function m(){if(!p){for(p=!0;d.length;){const e=d;d=[];for(let t=0;t<e.length;t++){const n=e[t];try{n.zone.runTask(n,null,null)}catch(e){k.onUnhandledError(e)}}}k.microtaskDrainDone(),p=!1}}const y={name:"NO ZONE"},v="notScheduled",b="scheduling",w="scheduled",C="running",S="canceling",_="unknown",I="microTask",E="macroTask",T="eventTask",A={},k={symbol:Dp,currentZoneFrame:()=>O,onUnhandledError:N,microtaskDrainDone:N,scheduleMicroTask:g,showUncaughtError:()=>!s[Dp("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:N,patchMethod:()=>N,bindArguments:()=>[],patchThen:()=>N,patchMacroTask:()=>N,patchEventPrototype:()=>N,getGlobalObjects:()=>{},ObjectDefineProperty:()=>N,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>N,wrapWithCurrentZone:()=>N,filterProperties:()=>[],attachOriginToPatched:()=>N,_redefineProperty:()=>N,patchCallbacks:()=>N,nativeScheduleMicroTask:f};let O={parent:null,zone:new s(null,null)},R=null,x=0;function N(){}return n("Zone","Zone"),s}()),e.Zone}();Mf(Df=Ff),function(e){e.__load_patch("toString",e=>{const t=Function.prototype.toString,n=$p("OriginalDelegate"),r=$p("Promise"),s=$p("Error"),o=function(){if("function"==typeof this){const o=this[n];if(o)return"function"==typeof o?t.call(o):Object.prototype.toString.call(o);if(this===Promise){const n=e[r];if(n)return t.call(n)}if(this===Error){const n=e[s];if(n)return t.call(n)}}return t.call(this)};o[n]=t,Function.prototype.toString=o;const i=Object.prototype.toString;Object.prototype.toString=function(){return"function"==typeof Promise&&this instanceof Promise?"[object Promise]":i.call(this)}})}(Df),function(e){e.__load_patch("util",(e,t,n)=>{const r=Lf(e);n.patchOnProperties=df,n.patchMethod=gf,n.bindArguments=tf,n.patchMacroTask=mf;const s=t.__symbol__("BLACK_LISTED_EVENTS"),o=t.__symbol__("UNPATCHED_EVENTS");e[o]&&(e[s]=e[o]),e[s]&&(t[s]=t[o]=e[s]),n.patchEventPrototype=kf,n.patchEventTarget=Tf,n.ObjectDefineProperty=Bp,n.ObjectGetOwnPropertyDescriptor=Fp,n.ObjectCreate=jp,n.ArraySlice=Zp,n.patchClass=ff,n.wrapWithCurrentZone=Jp,n.filterProperties=xf,n.attachOriginToPatched=yf,n._redefineProperty=Object.defineProperty,n.patchCallbacks=Pf,n.getGlobalObjects=()=>({globalSources:Sf,zoneSymbolEventNames:Cf,eventNames:r,isBrowser:of,isMix:af,isNode:sf,TRUE_STR:Wp,FALSE_STR:Yp,ZONE_SYMBOL_PREFIX:Kp,ADD_EVENT_LISTENER_STR:zp,REMOVE_EVENT_LISTENER_STR:Vp})})}(Df),function(e){e.__load_patch("timers",e=>{const t="set",n="clear";Rf(e,t,n,"Timeout"),Rf(e,t,n,"Interval"),Rf(e,t,n,"Immediate")}),e.__load_patch("requestAnimationFrame",e=>{Rf(e,"request","cancel","AnimationFrame"),Rf(e,"mozRequest","mozCancel","AnimationFrame"),Rf(e,"webkitRequest","webkitCancel","AnimationFrame")}),e.__load_patch("blocking",(e,t)=>{const n=["alert","prompt","confirm"];for(let r=0;r<n.length;r++){gf(e,n[r],(n,r,s)=>function(r,o){return t.current.run(n,e,o,s)})}}),e.__load_patch("EventTarget",(e,t,n)=>{!function(e,t){t.patchEventPrototype(e,t)}(e,n),function(e,t){if(Zone[t.symbol("patchEventTarget")])return;const{eventNames:n,zoneSymbolEventNames:r,TRUE_STR:s,FALSE_STR:o,ZONE_SYMBOL_PREFIX:i}=t.getGlobalObjects();for(let e=0;e<n.length;e++){const t=n[e],a=i+(t+o),c=i+(t+s);r[t]={},r[t][o]=a,r[t][s]=c}const a=e.EventTarget;a&&a.prototype&&t.patchEventTarget(e,t,[a&&a.prototype])}(e,n);const r=e.XMLHttpRequestEventTarget;r&&r.prototype&&n.patchEventTarget(e,n,[r.prototype])}),e.__load_patch("MutationObserver",(e,t,n)=>{ff("MutationObserver"),ff("WebKitMutationObserver")}),e.__load_patch("IntersectionObserver",(e,t,n)=>{ff("IntersectionObserver")}),e.__load_patch("FileReader",(e,t,n)=>{ff("FileReader")}),e.__load_patch("on_property",(e,t,n)=>{!function(e,t){if(sf&&!af)return;if(Zone[e.symbol("patchEvents")])return;const n=t.__Zone_ignore_on_properties;let r=[];if(of){const e=window;r=r.concat(["Document","SVGElement","Element","HTMLElement","HTMLBodyElement","HTMLMediaElement","HTMLFrameSetElement","HTMLFrameElement","HTMLIFrameElement","HTMLMarqueeElement","Worker"]),Nf(e,Lf(e),n,Up(e))}r=r.concat(["XMLHttpRequest","XMLHttpRequestEventTarget","IDBIndex","IDBRequest","IDBOpenDBRequest","IDBDatabase","IDBTransaction","IDBCursor","WebSocket"]);for(let e=0;e<r.length;e++){const s=t[r[e]];(null==s?void 0:s.prototype)&&Nf(s.prototype,Lf(s.prototype),n)}}(n,e)}),e.__load_patch("customElements",(e,t,n)=>{!function(e,t){const{isBrowser:n,isMix:r}=t.getGlobalObjects();if(!n&&!r||!e.customElements||!("customElements"in e))return;t.patchCallbacks(t,e.customElements,"customElements","define",["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","formAssociatedCallback","formDisabledCallback","formResetCallback","formStateRestoreCallback"])}(e,n)}),e.__load_patch("XHR",(e,t)=>{!function(e){const c=e.XMLHttpRequest;if(!c)return;const l=c.prototype;let u=l[Hp],h=l[Gp];if(!u){const t=e.XMLHttpRequestEventTarget;if(t){const e=t.prototype;u=e[Hp],h=e[Gp]}}const d="readystatechange",p="scheduled";function f(e){const r=e.data,i=r.target;i[o]=!1,i[a]=!1;const c=i[s];u||(u=i[Hp],h=i[Gp]),c&&h.call(i,d,c);const l=i[s]=()=>{if(i.readyState===i.DONE)if(!r.aborted&&i[o]&&e.state===p){const n=i[t.__symbol__("loadfalse")];if(0!==i.status&&n&&n.length>0){const s=e.invoke;e.invoke=function(){const n=i[t.__symbol__("loadfalse")];for(let t=0;t<n.length;t++)n[t]===e&&n.splice(t,1);r.aborted||e.state!==p||s.call(e)},n.push(e)}else e.invoke()}else r.aborted||!1!==i[o]||(i[a]=!0)};u.call(i,d,l);return i[n]||(i[n]=e),w.apply(i,r.args),i[o]=!0,e}function g(){}function m(e){const t=e.data;return t.aborted=!0,C.apply(t.target,t.args)}const y=gf(l,"open",()=>function(e,t){return e[r]=0==t[2],e[i]=t[1],y.apply(e,t)}),v=$p("fetchTaskAborting"),b=$p("fetchTaskScheduling"),w=gf(l,"send",()=>function(e,n){if(!0===t.current[b])return w.apply(e,n);if(e[r])return w.apply(e,n);{const t={target:e,url:e[i],isPeriodic:!1,args:n,aborted:!1},r=Xp("XMLHttpRequest.send",g,t,f,m);e&&!0===e[a]&&!t.aborted&&r.state===p&&r.invoke()}}),C=gf(l,"abort",()=>function(e,r){const s=e[n];if(s&&"string"==typeof s.type){if(null==s.cancelFn||s.data&&s.data.aborted)return;s.zone.cancelTask(s)}else if(!0===t.current[v])return C.apply(e,r)})}(e);const n=$p("xhrTask"),r=$p("xhrSync"),s=$p("xhrListener"),o=$p("xhrScheduled"),i=$p("xhrURL"),a=$p("xhrErrorBeforeScheduled")}),e.__load_patch("geolocation",e=>{e.navigator&&e.navigator.geolocation&&function(e,t){const n=e.constructor.name;for(let r=0;r<t.length;r++){const s=t[r],o=e[s];if(o){if(!nf(Fp(e,s)))continue;e[s]=(e=>{const t=function(){return e.apply(this,tf(arguments,n+"."+s))};return yf(t,e),t})(o)}}}(e.navigator.geolocation,["getCurrentPosition","watchPosition"])}),e.__load_patch("PromiseRejectionEvent",(e,t)=>{function n(t){return function(n){Af(e,t).forEach(r=>{const s=e.PromiseRejectionEvent;if(s){const e=new s(t,{promise:n.promise,reason:n.rejection});r.invoke(e)}})}}e.PromiseRejectionEvent&&(t[$p("unhandledPromiseRejectionHandler")]=n("unhandledrejection"),t[$p("rejectionHandledHandler")]=n("rejectionhandled"))}),e.__load_patch("queueMicrotask",(e,t,n)=>{!function(e,t){t.patchMethod(e,"queueMicrotask",e=>function(e,t){Zone.current.scheduleMicroTask("queueMicrotask",t[0])})}(e,n)})}(Ff);const Bf="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Uf=performance,jf=Math.pow(10,6),Zf=Math.pow(10,9);function zf(e){const t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*jf)]}function Vf(){let e=Uf.timeOrigin;if("number"!=typeof e){const t=Uf;e=t.timing&&t.timing.fetchStart}return e}function Hf(e){return function(e,t){const n=[e[0]+t[0],e[1]+t[1]];n[1]>=Zf&&(n[1]-=Zf,n[0]+=1);return n}(zf(Vf()),zf("number"==typeof e?e:Uf.now()))}function Gf(e){if(t=e,Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1])return e;if("number"==typeof e)return e<Vf()?Hf(e):zf(e);if(e instanceof Date)return zf(e.getTime());throw TypeError("Invalid input type");var t}function Wf(e){return e[0]*Zf+e[1]}var Yf,Kf;function Jf(e,t){return"string"==typeof t?e===t:!!e.match(t)}function Xf(e,t){if(!t)return!1;for(const n of t)if(Jf(e,n))return!0;return!1}!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"}(Yf||(Yf={})),function(e){e.CONNECT_END="connectEnd",e.CONNECT_START="connectStart",e.DECODED_BODY_SIZE="decodedBodySize",e.DOM_COMPLETE="domComplete",e.DOM_CONTENT_LOADED_EVENT_END="domContentLoadedEventEnd",e.DOM_CONTENT_LOADED_EVENT_START="domContentLoadedEventStart",e.DOM_INTERACTIVE="domInteractive",e.DOMAIN_LOOKUP_END="domainLookupEnd",e.DOMAIN_LOOKUP_START="domainLookupStart",e.ENCODED_BODY_SIZE="encodedBodySize",e.FETCH_START="fetchStart",e.LOAD_EVENT_END="loadEventEnd",e.LOAD_EVENT_START="loadEventStart",e.NAVIGATION_START="navigationStart",e.REDIRECT_END="redirectEnd",e.REDIRECT_START="redirectStart",e.REQUEST_START="requestStart",e.RESPONSE_END="responseEnd",e.RESPONSE_START="responseStart",e.SECURE_CONNECTION_START="secureConnectionStart",e.START_TIME="startTime",e.UNLOAD_EVENT_END="unloadEventEnd",e.UNLOAD_EVENT_START="unloadEventStart"}(Kf||(Kf={}));let $f;function qf(e,t,n,r=!0){if(!(s=n,o=t,!(o in s)||"number"!=typeof n[t]||r&&0===n[t]))return e.addEvent(t,n[t]);var s,o}function Qf(e,t,n=!1,r,s){if(void 0===r&&(r=0!==t[Kf.START_TIME]),n||(qf(e,Kf.FETCH_START,t,r),qf(e,Kf.DOMAIN_LOOKUP_START,t,r),qf(e,Kf.DOMAIN_LOOKUP_END,t,r),qf(e,Kf.CONNECT_START,t,r),qf(e,Kf.SECURE_CONNECTION_START,t,r),qf(e,Kf.CONNECT_END,t,r),qf(e,Kf.REQUEST_START,t,r),qf(e,Kf.RESPONSE_START,t,r),qf(e,Kf.RESPONSE_END,t,r)),!s){const n=t[Kf.ENCODED_BODY_SIZE];void 0!==n&&e.setAttribute("http.response_content_length",n);const r=t[Kf.DECODED_BODY_SIZE];void 0!==r&&n!==r&&e.setAttribute("http.response_content_length_uncompressed",r)}}function eg(){return"undefined"!=typeof location?location.origin:void 0}function tg(e,t,n,r,s=new WeakSet,o){const i=ng(e),a=function(e,t,n,r,s,o){const i=Wf(t),a=Wf(n);let c=r.filter(t=>{const n=Wf(Gf(t[Kf.FETCH_START])),r=Wf(Gf(t[Kf.RESPONSE_END]));return t.initiatorType.toLowerCase()===(o||"xmlhttprequest")&&t.name===e&&n>=i&&r<=a});c.length>0&&(c=c.filter(e=>!s.has(e)));return c}(e=i.toString(),t,n,r,s,o);if(0===a.length)return{mainRequest:void 0};if(1===a.length)return{mainRequest:a[0]};const c=function(e){return e.slice().sort((e,t)=>{const n=e[Kf.FETCH_START],r=t[Kf.FETCH_START];return n>r?1:n<r?-1:0})}(a);if(i.origin!==eg()&&c.length>1){let e=c[0],t=function(e,t,n){const r=Wf(n),s=Wf(Gf(t));let o,i=e[1];const a=e.length;for(let t=1;t<a;t++){const n=e[t],a=Wf(Gf(n[Kf.FETCH_START])),c=r-Wf(Gf(n[Kf.RESPONSE_END]));a>=s&&(!o||c<o)&&(o=c,i=n)}return i}(c,e[Kf.RESPONSE_END],n);const r=e[Kf.RESPONSE_END];return t[Kf.FETCH_START]<r&&(t=e,e=void 0),{corsPreFlightRequest:e,mainRequest:t}}return{mainRequest:a[0]}}function ng(e){if("function"==typeof URL)return new URL(e,"undefined"!=typeof document?document.baseURI:"undefined"!=typeof location?location.href:void 0);const t=($f||($f=document.createElement("a")),$f);return t.href=e,t}function rg(e,t){let n=t||[];("string"==typeof n||n instanceof RegExp)&&(n=[n]);return ng(e).origin===eg()||n.some(t=>Jf(e,t))}var sg;!function(e){e.METHOD_OPEN="open",e.METHOD_SEND="send",e.EVENT_ABORT="abort",e.EVENT_ERROR="error",e.EVENT_LOAD="loaded",e.EVENT_TIMEOUT="timeout"}(sg||(sg={}));const og=Uu.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-xml-http-request/utils"});function ig(e){return t=e,"undefined"!=typeof Document&&t instanceof Document?(new XMLSerializer).serializeToString(document).length:"string"==typeof e?cg(e):e instanceof Blob?e.size:e instanceof FormData?function(e){let t=0;for(const[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}(e):e instanceof URLSearchParams?cg(e.toString()):void 0!==e.byteLength?e.byteLength:void og.warn("unknown body type");var t}const ag=new TextEncoder;function cg(e){return ag.encode(e).byteLength}function lg(e){const t=function(){void 0===hg&&(hg=ug);return hg}(),n=e.toUpperCase();return n in t?n:"_OTHER"}const ug={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0};let hg;const dg={"https:":"443","http:":"80"};const pg="0.203.0";var fg;!function(e){e.HTTP_STATUS_TEXT="http.status_text"}(fg||(fg={}));class gg extends gp{component="xml-http-request";version=pg;moduleName=this.component;_tasksCount=0;_xhrMem=new WeakMap;_usedResources=new WeakSet;_semconvStability;constructor(e={}){super("@opentelemetry/instrumentation-xml-http-request",pg,e),this._semconvStability=wp("http",e?.semconvStabilityOptIn)}init(){}_addHeaders(e,t){if(!rg(ng(t).href,this.getConfig().propagateTraceHeaderCorsUrls)){const e={};return qu.inject(Bu.active(),e),void(Object.keys(e).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}const n={};qu.inject(Bu.active(),n),Object.keys(n).forEach(t=>{e.setRequestHeader(t,String(n[t]))})}_addChildSpan(e,t){Bu.with(th.setSpan(Bu.active(),e),()=>{const e=this.tracer.startSpan("CORS Preflight",{startTime:t[Kf.FETCH_START]}),n=!(this._semconvStability&vp.OLD);Qf(e,t,this.getConfig().ignoreNetworkEvents,void 0,n),e.end(t[Kf.RESPONSE_END])})}_addFinalSpanAttributes(e,t,n){if(this._semconvStability&vp.OLD){if(void 0!==t.status&&e.setAttribute("http.status_code",t.status),void 0!==t.statusText&&e.setAttribute(fg.HTTP_STATUS_TEXT,t.statusText),"string"==typeof n){const t=ng(n);e.setAttribute("http.host",t.host),e.setAttribute("http.scheme",t.protocol.replace(":",""))}e.setAttribute("http.user_agent",navigator.userAgent)}this._semconvStability&vp.STABLE&&t.status&&e.setAttribute(bh,t.status)}_applyAttributesAfterXHR(e,t){const n=this.getConfig().applyCustomAttributesOnSpan;"function"==typeof n&&mp(()=>n(e,t),e=>{e&&this._diag.error("applyCustomAttributesOnSpan",e)})}_addResourceObserver(e,t){const n=this._xhrMem.get(e);n&&"function"==typeof PerformanceObserver&&"function"==typeof PerformanceResourceTiming&&(n.createdResources={observer:new PerformanceObserver(e=>{const r=e.getEntries(),s=ng(t);r.forEach(e=>{"xmlhttprequest"===e.initiatorType&&e.name===s.href&&n.createdResources&&n.createdResources.entries.push(e)})}),entries:[]},n.createdResources.observer.observe({entryTypes:["resource"]}))}_clearResources(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(Uf.clearResourceTimings(),this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}_findResourceAndAddNetworkEvents(e,t,n,r,s){if(!(n&&r&&s&&e.createdResources))return;let o=e.createdResources.entries;o&&o.length||(o=Uf.getEntriesByType("resource"));const i=tg(ng(n).href,r,s,o,this._usedResources);if(i.mainRequest){const e=i.mainRequest;this._markResourceAsUsed(e);const n=i.corsPreFlightRequest;n&&(this._addChildSpan(t,n),this._markResourceAsUsed(n));const r=!(this._semconvStability&vp.OLD);Qf(t,e,this.getConfig().ignoreNetworkEvents,void 0,r)}}_cleanPreviousSpanInformation(e){const t=this._xhrMem.get(e);if(t){const n=t.callbackToRemoveEvents;n&&n(),this._xhrMem.delete(e)}}_createSpan(e,t,n){if(Xf(t,this.getConfig().ignoreUrls))return void this._diag.debug("ignoring span as url matches ignored url");let r="";const s=ng(t),o={};if(this._semconvStability&vp.OLD&&(r=n.toUpperCase(),o["http.method"]=n,o["http.url"]=s.toString()),this._semconvStability&vp.STABLE){const e=n,t=lg(n);r||(r=t),o[yh]=t,t!==e&&(o[vh]=e),o[Th]=s.toString(),o[wh]=s.hostname;const i=function(e){const t=Number(e.port||dg[e.protocol]);return t&&!isNaN(t)?t:void 0}(s);i&&(o[Ch]=i)}const i=this.tracer.startSpan(r,{kind:Du.CLIENT,attributes:o});return i.addEvent(sg.METHOD_OPEN),this._cleanPreviousSpanInformation(e),this._xhrMem.set(e,{span:i,spanUrl:t}),i}_markResourceAsUsed(e){this._usedResources.add(e)}_patchOpen(){return e=>{const t=this;return function(...n){const r=n[0],s=n[1];return t._createSpan(this,s,r),e.apply(this,n)}}}_patchSend(){const e=this;function t(t,n,r,s){const o=e._xhrMem.get(n);if(!o)return;if(o.status=n.status,o.statusText=n.statusText,e._xhrMem.delete(n),o.span){const t=o.span;e._applyAttributesAfterXHR(t,n),e._semconvStability&vp.STABLE&&(r?s&&(t.setStatus({code:Fu.ERROR,message:s}),t.setAttribute(fh,s)):o.status&&o.status>=400&&(t.setStatus({code:Fu.ERROR}),t.setAttribute(fh,String(o.status))))}const i=Hf(),a=Date.now();setTimeout(()=>{!function(t,n,r,s){const o=n.callbackToRemoveEvents;"function"==typeof o&&o();const{span:i,spanUrl:a,sendStartTime:c}=n;i&&(e._findResourceAndAddNetworkEvents(n,i,a,c,r),i.addEvent(t,s),e._addFinalSpanAttributes(i,n,a),i.end(s),e._tasksCount--),e._clearResources()}(t,o,i,a)},300)}function n(){t(sg.EVENT_ERROR,this,!0,"error")}function r(){t(sg.EVENT_ABORT,this,!1)}function s(){t(sg.EVENT_TIMEOUT,this,!0,"timeout")}function o(){this.status<299?t(sg.EVENT_LOAD,this,!1):t(sg.EVENT_ERROR,this,!1)}return t=>function(...i){const a=e._xhrMem.get(this);if(!a)return t.apply(this,i);const c=a.span,l=a.spanUrl;if(c&&l){if(e.getConfig().measureRequestSize&&i?.[0]){const t=ig(i[0]);void 0!==t&&(e._semconvStability&vp.OLD&&c.setAttribute("http.request_content_length_uncompressed",t),e._semconvStability&vp.STABLE&&c.setAttribute("http.request.body.size",t))}Bu.with(th.setSpan(Bu.active(),c),()=>{e._tasksCount++,a.sendStartTime=Hf(),c.addEvent(sg.METHOD_SEND),this.addEventListener("abort",r),this.addEventListener("error",n),this.addEventListener("load",o),this.addEventListener("timeout",s),a.callbackToRemoveEvents=()=>{!function(t){t.removeEventListener("abort",r),t.removeEventListener("error",n),t.removeEventListener("load",o),t.removeEventListener("timeout",s);const i=e._xhrMem.get(t);i&&(i.callbackToRemoveEvents=void 0)}(this),a.createdResources&&a.createdResources.observer.disconnect()},e._addHeaders(this,l),e._addResourceObserver(this,l)})}return t.apply(this,i)}}enable(){this._diag.debug("applying patch to",this.moduleName,this.version),yp(XMLHttpRequest.prototype.open)&&(this._unwrap(XMLHttpRequest.prototype,"open"),this._diag.debug("removing previous patch from method open")),yp(XMLHttpRequest.prototype.send)&&(this._unwrap(XMLHttpRequest.prototype,"send"),this._diag.debug("removing previous patch from method send")),this._wrap(XMLHttpRequest.prototype,"open",this._patchOpen()),this._wrap(XMLHttpRequest.prototype,"send",this._patchSend())}disable(){this._diag.debug("removing patch from",this.moduleName,this.version),this._unwrap(XMLHttpRequest.prototype,"open"),this._unwrap(XMLHttpRequest.prototype,"send"),this._tasksCount=0,this._xhrMem=new WeakMap,this._usedResources=new WeakSet}}var mg;!function(e){e.COMPONENT="component",e.HTTP_STATUS_TEXT="http.status_text"}(mg||(mg={}));var yg={};Object.defineProperty(yg,"__esModule",{value:!0});var vg=yg.ATTR_HTTP_USER_AGENT=yg.ATTR_HTTP_URL=yg.ATTR_HTTP_STATUS_CODE=yg.ATTR_HTTP_SCHEME=yg.ATTR_HTTP_RESPONSE_CONTENT_LENGTH=yg.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED=yg.ATTR_HTTP_REQUEST_BODY_SIZE=yg.ATTR_HTTP_METHOD=yg.ATTR_HTTP_HOST=void 0,bg=yg.ATTR_HTTP_HOST="http.host",wg=yg.ATTR_HTTP_METHOD="http.method",Cg=yg.ATTR_HTTP_REQUEST_BODY_SIZE="http.request.body.size",Sg=yg.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED="http.request_content_length_uncompressed";yg.ATTR_HTTP_RESPONSE_CONTENT_LENGTH="http.response_content_length";var _g=yg.ATTR_HTTP_SCHEME="http.scheme",Ig=yg.ATTR_HTTP_STATUS_CODE="http.status_code",Eg=yg.ATTR_HTTP_URL="http.url";vg=yg.ATTR_HTTP_USER_AGENT="http.user_agent";const Tg=Uu.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-fetch/utils"});function Ag(...e){if(e[0]instanceof URL||"string"==typeof e[0]){const t=e[1];if(!t?.body)return Promise.resolve();if(t.body instanceof ReadableStream){const{body:e,length:n}=function(e){if(!e.pipeThrough)return Tg.warn("Platform has ReadableStream but not pipeThrough!"),{body:e,length:Promise.resolve(void 0)};let t,n=0;const r=new Promise(e=>{t=e}),s=new TransformStream({start(){},async transform(e,t){const r=await e;n+=r.byteLength,t.enqueue(e)},flush(){t(n)}});return{body:e.pipeThrough(s),length:r}}(t.body);return t.body=e,n}return Promise.resolve(function(e){if(t=e,"undefined"!=typeof Document&&t instanceof Document)return(new XMLSerializer).serializeToString(document).length;var t;if("string"==typeof e)return Og(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return function(e){let t=0;for(const[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}(e);if(e instanceof URLSearchParams)return Og(e.toString());if(void 0!==e.byteLength)return e.byteLength;return void Tg.warn("unknown body type")}(t.body))}{const t=e[0];return t?.body?t.clone().text().then(e=>Og(e)):Promise.resolve()}}const kg=new TextEncoder;function Og(e){return kg.encode(e).byteLength}const Rg={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0};let xg;function Ng(){return void 0===xg&&(xg=Rg),xg}const Lg={"https:":"443","http:":"80"};const Mg="0.203.0",Pg="object"==typeof process&&"node"===process.release?.name;class Dg extends gp{component="fetch";version=Mg;moduleName=this.component;_usedResources=new WeakSet;_tasksCount=0;_semconvStability;constructor(e={}){super("@opentelemetry/instrumentation-fetch",Mg,e),this._semconvStability=wp("http",e?.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){const n=this.tracer.startSpan("CORS Preflight",{startTime:t[Kf.FETCH_START]},th.setSpan(Bu.active(),e)),r=!(this._semconvStability&vp.OLD);Qf(n,t,this.getConfig().ignoreNetworkEvents,void 0,r),n.end(t[Kf.RESPONSE_END])}_addFinalSpanAttributes(e,t){const n=ng(t.url);if(this._semconvStability&vp.OLD&&(e.setAttribute(Ig,t.status),null!=t.statusText&&e.setAttribute(mg.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(bg,n.host),e.setAttribute(_g,n.protocol.replace(":","")),"undefined"!=typeof navigator&&e.setAttribute(vg,navigator.userAgent)),this._semconvStability&vp.STABLE){e.setAttribute(bh,t.status),e.setAttribute(wh,n.hostname);const r=function(e){const t=Number(e.port||Lg[e.protocol]);return t&&!isNaN(t)?t:void 0}(n);r&&e.setAttribute(Ch,r)}}_addHeaders(e,t){if(!rg(t,this.getConfig().propagateTraceHeaderCorsUrls)){const e={};return qu.inject(Bu.active(),e),void(Object.keys(e).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}if(e instanceof Request)qu.inject(Bu.active(),e.headers,{set:(e,t,n)=>e.set(t,"string"==typeof n?n:String(n))});else if(e.headers instanceof Headers)qu.inject(Bu.active(),e.headers,{set:(e,t,n)=>e.set(t,"string"==typeof n?n:String(n))});else if(e.headers instanceof Map)qu.inject(Bu.active(),e.headers,{set:(e,t,n)=>e.set(t,"string"==typeof n?n:String(n))});else{const t={};qu.inject(Bu.active(),t),e.headers=Object.assign({},t,e.headers||{})}}_clearResources(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(e,t={}){if(Xf(e,this.getConfig().ignoreUrls))return void this._diag.debug("ignoring span as url matches ignored url");let n="";const r={};if(this._semconvStability&vp.OLD){const s=(t.method||"GET").toUpperCase();n=`HTTP ${s}`,r[mg.COMPONENT]=this.moduleName,r[wg]=s,r[Eg]=e}if(this._semconvStability&vp.STABLE){const s=t.method,o=function(e){const t=Ng(),n=e.toUpperCase();return n in t?n:"_OTHER"}(t.method||"GET");n||(n=o),r[yh]=o,o!==s&&(r[vh]=s),r[Th]=e}return this.tracer.startSpan(n,{kind:Du.CLIENT,attributes:r})}_findResourceAndAddNetworkEvents(e,t,n){let r=t.entries;if(!r.length){if(!performance.getEntriesByType)return;r=performance.getEntriesByType("resource")}const s=tg(t.spanUrl,t.startTime,n,r,this._usedResources,"fetch");if(s.mainRequest){const t=s.mainRequest;this._markResourceAsUsed(t);const n=s.corsPreFlightRequest;n&&(this._addChildSpan(e,n),this._markResourceAsUsed(n));const r=!(this._semconvStability&vp.OLD);Qf(e,t,this.getConfig().ignoreNetworkEvents,void 0,r)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,n){const r=zf(Date.now()),s=Hf();this._addFinalSpanAttributes(e,n),this._semconvStability&vp.STABLE&&n.status>=400&&(e.setStatus({code:Fu.ERROR}),e.setAttribute(fh,String(n.status))),setTimeout(()=>{t.observer?.disconnect(),this._findResourceAndAddNetworkEvents(e,t,s),this._tasksCount--,this._clearResources(),e.end(r)},300)}_patchConstructor(){return e=>{const t=this;return function(...n){const r=this,s=ng(n[0]instanceof Request?n[0].url:String(n[0])).href,o=n[0]instanceof Request?n[0]:n[1]||{},i=t._createSpan(s,o);if(!i)return e.apply(this,n);const a=t._prepareSpanData(s);function c(e,n){t._applyAttributesAfterFetch(e,o,n),t._endSpan(e,a,{status:n.status||0,statusText:n.message,url:s})}function l(e,n){t._applyAttributesAfterFetch(e,o,n),n.status>=200&&n.status<400?t._endSpan(e,a,n):t._endSpan(e,a,{status:n.status,statusText:n.statusText,url:s})}function u(e,t,n){try{const t=n.clone().body;if(t){const r=t.getReader(),s=()=>{r.read().then(({done:t})=>{t?l(e,n):s()},t=>{c(e,t)})};s()}else l(e,n)}finally{t(n)}}function h(e,t,n){try{c(e,n)}finally{t(n)}}return t.getConfig().measureRequestSize&&Ag(...n).then(e=>{e&&(t._semconvStability&vp.OLD&&i.setAttribute(Sg,e),t._semconvStability&vp.STABLE&&i.setAttribute(Cg,e))}).catch(e=>{t._diag.warn("getFetchBodyLength",e)}),new Promise((n,a)=>Bu.with(th.setSpan(Bu.active(),i),()=>(t._addHeaders(o,s),t._callRequestHook(i,o),t._tasksCount++,e.apply(r,o instanceof Request?[o]:[s,o]).then(u.bind(r,i,n),h.bind(r,i,a)))))}}}_applyAttributesAfterFetch(e,t,n){const r=this.getConfig().applyCustomAttributesOnSpan;r&&mp(()=>r(e,t,n),e=>{e&&this._diag.error("applyCustomAttributesOnSpan",e)})}_callRequestHook(e,t){const n=this.getConfig().requestHook;n&&mp(()=>n(e,t),e=>{e&&this._diag.error("requestHook",e)})}_prepareSpanData(e){const t=Hf(),n=[];if("function"!=typeof PerformanceObserver)return{entries:n,startTime:t,spanUrl:e};const r=new PerformanceObserver(t=>{t.getEntries().forEach(t=>{"fetch"===t.initiatorType&&t.name===e&&n.push(t)})});return r.observe({entryTypes:["resource"]}),{entries:n,observer:r,startTime:t,spanUrl:e}}enable(){Pg?this._diag.warn("this instrumentation is intended for web usage only, it does not instrument Node.js's fetch()"):(yp(fetch)&&(this._unwrap(Bf,"fetch"),this._diag.debug("removing previous patch for constructor")),this._wrap(Bf,"fetch",this._patchConstructor()))}disable(){Pg||(this._unwrap(Bf,"fetch"),this._usedResources=new WeakSet)}}class Fg{emit(e){}}const Bg=new Fg,Ug=Symbol.for("io.opentelemetry.js.api.logs"),jg=globalThis;const Zg=new class{getLogger(e,t,n){return new Fg}};class zg{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;const e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Bg}}class Vg{getLogger(e,t,n){var r;return null!==(r=this._getDelegateLogger(e,t,n))&&void 0!==r?r:new zg(this,e,t,n)}_getDelegate(){var e;return null!==(e=this._delegate)&&void 0!==e?e:Zg}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){var r;return null===(r=this._delegate)||void 0===r?void 0:r.getLogger(e,t,n)}}class Hg{constructor(){this._proxyLoggerProvider=new Vg}static getInstance(){return this._instance||(this._instance=new Hg),this._instance}setGlobalLoggerProvider(e){return jg[Ug]?this.getLoggerProvider():(jg[Ug]=(t=1,n=e,r=Zg,e=>e===t?n:r),this._proxyLoggerProvider._setDelegate(e),e);var t,n,r}getLoggerProvider(){var e,t;return null!==(t=null===(e=jg[Ug])||void 0===e?void 0:e.call(jg,1))&&void 0!==t?t:this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete jg[Ug],this._proxyLoggerProvider=new Vg}}const Gg=Hg.getInstance();let Wg=console.error.bind(console);function Yg(e,t,n){const r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}const Kg=(e,t,n)=>{if(!e||!e[t])return void Wg("no original function "+String(t)+" to wrap");if(!n)return Wg("no wrapper function"),void Wg((new Error).stack);const r=e[t];if("function"!=typeof r||"function"!=typeof n)return void Wg("original object and wrapper must be functions");const s=n(r,t);return Yg(s,"__original",r),Yg(s,"__unwrap",()=>{e[t]===s&&Yg(e,t,r)}),Yg(s,"__wrapped",!0),Yg(e,t,s),s},Jg=(e,t,n)=>{if(!e)return Wg("must provide one or more modules to patch"),void Wg((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{Kg(e,t,n)})}):Wg("must provide one or more functions to wrap on modules")},Xg=(e,t)=>{if(!e||!e[t])return Wg("no function to unwrap."),void Wg((new Error).stack);const n=e[t];n.__unwrap?n.__unwrap():Wg("no original to unwrap to -- has "+String(t)+" already been unwrapped?")},$g=(e,t)=>{if(!e)return Wg("must provide one or more modules to patch"),void Wg((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{Xg(e,t)})}):Wg("must provide one or more functions to unwrap on modules")};class qg{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(e,t,n){this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=Uu.createComponentLogger({namespace:e}),this._tracer=th.getTracer(e,t),this._meter=Vu.getMeter(e,t),this._logger=Gg.getLogger(e,t),this._updateMetricInstruments()}_wrap=Kg;_unwrap=Xg;_massWrap=Jg;_massUnwrap=$g;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){const e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:t},e)}}}class Qg extends qg{constructor(e,t,n){super(e,t,n),this._config.enabled&&this.enable()}}function em(e){return"function"==typeof e&&"function"==typeof e.__original&&"function"==typeof e.__unwrap&&!0===e.__wrapped}var tm;!function(e){e.EVENT_TYPE="event_type",e.TARGET_ELEMENT="target_element",e.TARGET_XPATH="target_xpath",e.HTTP_URL="http.url"}(tm||(tm={}));const nm="0.58.0",rm=["click"];function sm(){return!1}class om extends Qg{version=nm;moduleName="user-interaction";_spansData=new WeakMap;_wrappedListeners=new WeakMap;_eventsSpanMap=new WeakMap;_eventNames;_shouldPreventSpanCreation;constructor(e={}){super("@opentelemetry/instrumentation-user-interaction",nm,e),this._eventNames=new Set(e?.eventNames??rm),this._shouldPreventSpanCreation="function"==typeof e?.shouldPreventSpanCreation?e.shouldPreventSpanCreation:sm}init(){}_checkForTimeout(e,t){const n=this._spansData.get(t);n&&("setTimeout"===e.source?n.hrTimeLastTimeout=Lh():"Promise.then"!==e.source&&"setTimeout"!==e.source&&(n.hrTimeLastTimeout=void 0))}_allowEventName(e){return this._eventNames.has(e)}_createSpan(e,t,n){if(!(e instanceof HTMLElement))return;if(!e.getAttribute)return;if(e.hasAttribute("disabled"))return;if(!this._allowEventName(t))return;const r=qd(e);try{const s=this.tracer.startSpan(t,{attributes:{[tm.EVENT_TYPE]:t,[tm.TARGET_ELEMENT]:e.tagName,[tm.TARGET_XPATH]:r,[tm.HTTP_URL]:window.location.href}},n?th.setSpan(Bu.active(),n):void 0);if(!0===this._shouldPreventSpanCreation(t,e,s))return;return this._spansData.set(s,{taskCount:0}),s}catch(e){this._diag.error("failed to start create new user interaction span",e)}}_decrementTask(e){const t=this._spansData.get(e);t&&(t.taskCount--,0===t.taskCount&&this._tryToEndSpan(e,t.hrTimeLastTimeout))}_getCurrentSpan(e){const t=e.get("OT_ZONE_CONTEXT");return t?th.getSpan(t):t}_incrementTask(e){const t=this._spansData.get(e);t&&t.taskCount++}addPatchedListener(e,t,n,r){let s=this._wrappedListeners.get(n);s||(s=new Map,this._wrappedListeners.set(n,s));let o=s.get(t);return o||(o=new Map,s.set(t,o)),!o.has(e)&&(o.set(e,r),!0)}removePatchedListener(e,t,n){const r=this._wrappedListeners.get(n);if(!r)return;const s=r.get(t);if(!s)return;const o=s.get(e);return o&&(s.delete(e),0===s.size&&(r.delete(t),0===r.size&&this._wrappedListeners.delete(n))),o}_invokeListener(e,t,n){return"function"==typeof e?e.apply(t,n):e.handleEvent(n[0])}_patchAddEventListener(){const e=this;return t=>function(n,r,s){if(!r)return t.call(this,n,r,s);const o=s&&"object"==typeof s&&s.once,i=function(...t){let s;const i=t[0],a=i?.target;i&&(s=e._eventsSpanMap.get(i)),o&&e.removePatchedListener(this,n,r);const c=e._createSpan(a,n,s);return c?(i&&e._eventsSpanMap.set(i,c),Bu.with(th.setSpan(Bu.active(),c),()=>{const n=e._invokeListener(r,this,t);return c.end(),n})):e._invokeListener(r,this,t)};return e.addPatchedListener(this,n,r,i)?t.call(this,n,i,s):void 0}}_patchRemoveEventListener(){const e=this;return t=>function(n,r,s){const o=e.removePatchedListener(this,n,r);return o?t.call(this,n,o,s):t.call(this,n,r,s)}}_getPatchableEventTargets(){return window.EventTarget?[EventTarget.prototype]:[Node.prototype,Window.prototype]}_patchHistoryApi(){this._unpatchHistoryApi(),this._wrap(history,"replaceState",this._patchHistoryMethod()),this._wrap(history,"pushState",this._patchHistoryMethod()),this._wrap(history,"back",this._patchHistoryMethod()),this._wrap(history,"forward",this._patchHistoryMethod()),this._wrap(history,"go",this._patchHistoryMethod())}_patchHistoryMethod(){const e=this;return t=>function(...n){const r=`${location.pathname}${location.hash}${location.search}`,s=t.apply(this,n),o=`${location.pathname}${location.hash}${location.search}`;return r!==o&&e._updateInteractionName(o),s}}_unpatchHistoryApi(){em(history.replaceState)&&this._unwrap(history,"replaceState"),em(history.pushState)&&this._unwrap(history,"pushState"),em(history.back)&&this._unwrap(history,"back"),em(history.forward)&&this._unwrap(history,"forward"),em(history.go)&&this._unwrap(history,"go")}_updateInteractionName(e){const t=th.getSpan(Bu.active());t&&"function"==typeof t.updateName&&t.updateName(`Navigation: ${e}`)}_patchZoneCancelTask(){const e=this;return t=>function(n){const r=Zone.current,s=e._getCurrentSpan(r);return s&&e._shouldCountTask(n,r)&&e._decrementTask(s),t.call(this,n)}}_patchZoneScheduleTask(){const e=this;return t=>function(n){const r=Zone.current,s=e._getCurrentSpan(r);return s&&e._shouldCountTask(n,r)&&(e._incrementTask(s),e._checkForTimeout(n,s)),t.call(this,n)}}_patchZoneRunTask(){const e=this;return t=>function(n,r,s){const o=Array.isArray(s)&&s[0]instanceof Event?s[0]:void 0,i=o?.target;let a;const c=this;if(i){if(a=e._createSpan(i,n.eventName),a)return e._incrementTask(a),c.run(()=>{try{return Bu.with(th.setSpan(Bu.active(),a),()=>{const e=Zone.current;return n._zone=e,t.call(e,n,r,s)})}finally{e._decrementTask(a)}})}else a=e._getCurrentSpan(c);try{return t.call(c,n,r,s)}finally{a&&e._shouldCountTask(n,c)&&e._decrementTask(a)}}}_shouldCountTask(e,t){if(e._zone&&(t=e._zone),!t||!e.data||e.data.isPeriodic)return!1;const n=this._getCurrentSpan(t);return!!n&&(!!this._spansData.get(n)&&("macroTask"===e.type||"microTask"===e.type))}_tryToEndSpan(e,t){if(e){this._spansData.get(e)&&(e.end(t),this._spansData.delete(e))}}enable(){const e=this._getZoneWithPrototype();if(this._diag.debug("applying patch to",this.moduleName,this.version,"zone:",!!e),e)em(e.prototype.runTask)&&(this._unwrap(e.prototype,"runTask"),this._diag.debug("removing previous patch from method runTask")),em(e.prototype.scheduleTask)&&(this._unwrap(e.prototype,"scheduleTask"),this._diag.debug("removing previous patch from method scheduleTask")),em(e.prototype.cancelTask)&&(this._unwrap(e.prototype,"cancelTask"),this._diag.debug("removing previous patch from method cancelTask")),this._zonePatched=!0,this._wrap(e.prototype,"runTask",this._patchZoneRunTask()),this._wrap(e.prototype,"scheduleTask",this._patchZoneScheduleTask()),this._wrap(e.prototype,"cancelTask",this._patchZoneCancelTask());else{this._zonePatched=!1;this._getPatchableEventTargets().forEach(e=>{em(e.addEventListener)&&(this._unwrap(e,"addEventListener"),this._diag.debug("removing previous patch from method addEventListener")),em(e.removeEventListener)&&(this._unwrap(e,"removeEventListener"),this._diag.debug("removing previous patch from method removeEventListener")),this._wrap(e,"addEventListener",this._patchAddEventListener()),this._wrap(e,"removeEventListener",this._patchRemoveEventListener())})}this._patchHistoryApi()}disable(){const e=this._getZoneWithPrototype();if(this._diag.debug("removing patch from",this.moduleName,this.version,"zone:",!!e),e&&this._zonePatched)em(e.prototype.runTask)&&this._unwrap(e.prototype,"runTask"),em(e.prototype.scheduleTask)&&this._unwrap(e.prototype,"scheduleTask"),em(e.prototype.cancelTask)&&this._unwrap(e.prototype,"cancelTask");else{this._getPatchableEventTargets().forEach(e=>{em(e.addEventListener)&&this._unwrap(e,"addEventListener"),em(e.removeEventListener)&&this._unwrap(e,"removeEventListener")})}this._unpatchHistoryApi()}_getZoneWithPrototype(){return window.Zone}}class im{_delegate;constructor(e){this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}class am extends Error{code;name="OTLPExporterError";data;constructor(e,t,n){super(e),this.data=n,this.code=t}}function cm(e){if(Number.isFinite(e)&&e>0)return e;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function lm(e){if(null!=e)return()=>e}function um(e,t,n){return{timeoutMillis:cm(e.timeoutMillis??t.timeoutMillis??n.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??n.concurrencyLimit,compression:e.compression??t.compression??n.compression}}class hm{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(e);const t=()=>{const t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}function dm(e){return new hm(e.concurrencyLimit)}function pm(){return{handleResponse(e){null!=e&&function(e){return Object.prototype.hasOwnProperty.call(e,"partialSuccess")}(e)&&null!=e.partialSuccess&&0!==Object.keys(e.partialSuccess).length&&Uu.warn("Received Partial Success response:",JSON.stringify(e.partialSuccess))}}}class fm{_transport;_serializer;_responseHandler;_promiseQueue;_timeout;_diagLogger;constructor(e,t,n,r,s){this._transport=e,this._serializer=t,this._responseHandler=n,this._promiseQueue=r,this._timeout=s,this._diagLogger=Uu.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,t){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit())return void t({code:Yf.FAILED,error:new Error("Concurrent export limit reached")});const n=this._serializer.serializeRequest(e);null!=n?this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(e=>{if("success"!==e.status)"failure"===e.status&&e.error?t({code:Yf.FAILED,error:e.error}):"retryable"===e.status?t({code:Yf.FAILED,error:new am("Export failed with retryable status")}):t({code:Yf.FAILED,error:new am("Export failed with unknown error")});else{if(null!=e.data)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(t){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",t,e.data)}t({code:Yf.SUCCESS})}},e=>t({code:Yf.FAILED,error:e}))):t({code:Yf.FAILED,error:new Error("Nothing to send")})}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}function gm(e,t,n){return r={transport:n,serializer:t,promiseHandler:dm(e)},s={timeout:e.timeoutMillis},new fm(r.transport,r.serializer,pm(),r.promiseHandler,s.timeout);var r,s}function mm(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function ym(e){const t=new Uint8Array(e.length/2);let n=0;for(let r=0;r<e.length;r+=2){const s=mm(e.charCodeAt(r)),o=mm(e.charCodeAt(r+1));t[n++]=s<<4|o}return t}function vm(e){const t=BigInt(1e9);return BigInt(e[0])*t+BigInt(e[1])}const bm="undefined"!=typeof BigInt?function(e){return vm(e).toString()}:Wf;function wm(e){return e}const Cm={encodeHrTime:function(e){const t=vm(e);return n=t,{low:Number(BigInt.asUintN(32,n)),high:Number(BigInt.asUintN(32,n>>BigInt(32)))};var n},encodeSpanContext:ym,encodeOptionalSpanContext:function(e){if(void 0!==e)return ym(e)}};function Sm(e){return{attributes:Im(e.attributes),droppedAttributesCount:0}}function _m(e){return{name:e.name,version:e.version}}function Im(e){return Object.keys(e).map(t=>Em(t,e[t]))}function Em(e,t){return{key:e,value:Tm(t)}}function Tm(e){const t=typeof e;return"string"===t?{stringValue:e}:"number"===t?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:"boolean"===t?{boolValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{arrayValue:{values:e.map(Tm)}}:"object"===t&&null!=e?{kvlistValue:{values:Object.entries(e).map(([e,t])=>Em(e,t))}}:{}}function Am(e,t){const n=e.spanContext(),r=e.status,s=e.parentSpanContext?.spanId?t.encodeSpanContext(e.parentSpanContext?.spanId):void 0;return{traceId:t.encodeSpanContext(n.traceId),spanId:t.encodeSpanContext(n.spanId),parentSpanId:s,traceState:n.traceState?.serialize(),name:e.name,kind:null==e.kind?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:Im(e.attributes),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>function(e,t){return{attributes:e.attributes?Im(e.attributes):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:r.code,message:r.message},links:e.links.map(e=>function(e,t){return{attributes:e.attributes?Im(e.attributes):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0}}(e,t)),droppedLinksCount:e.droppedLinksCount}}function km(e,t){const n=function(e){return void 0===e?Cm:{encodeHrTime:bm,encodeSpanContext:wm,encodeOptionalSpanContext:wm}}(t);return{resourceSpans:Om(e,n)}}function Om(e,t){const n=function(e){const t=new Map;for(const n of e){let e=t.get(n.resource);e||(e=new Map,t.set(n.resource,e));const r=`${n.instrumentationScope.name}@${n.instrumentationScope.version||""}:${n.instrumentationScope.schemaUrl||""}`;let s=e.get(r);s||(s=[],e.set(r,s)),s.push(n)}return t}(e),r=[],s=n.entries();let o=s.next();for(;!o.done;){const[e,n]=o.value,i=[],a=n.values();let c=a.next();for(;!c.done;){const e=c.value;if(e.length>0){const n=e.map(e=>Am(e,t));i.push({scope:_m(e[0].instrumentationScope),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=a.next()}const l={resource:Sm(e),scopeSpans:i,schemaUrl:void 0};r.push(l),o=s.next()}return r}const Rm={serializeRequest:e=>{const t=km(e,{});return(new TextEncoder).encode(JSON.stringify(t))},deserializeResponse:e=>{if(0===e.length)return{};const t=new TextDecoder;return JSON.parse(t.decode(e))}};function xm(){return.4*Math.random()-.2}class Nm{_transport;constructor(e){this._transport=e}retry(e,t,n){return new Promise((r,s)=>{setTimeout(()=>{this._transport.send(e,t).then(r,s)},n)})}async send(e,t){const n=Date.now()+t;let r=await this._transport.send(e,t),s=5,o=1e3;for(;"retryable"===r.status&&s>0;){s--;const t=Math.max(Math.min(o,5e3)+xm(),0);o*=1.5;const i=r.retryInMillis??t,a=n-Date.now();if(i>a)return r;r=await this.retry(e,a,i)}return r}shutdown(){return this._transport.shutdown()}}function Lm(e){return new Nm(e.transport)}function Mm(e){if(null==e)return;const t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?1e3*t:-1;const n=new Date(e).getTime()-Date.now();return n>=0?n:0}class Pm{_parameters;constructor(e){this._parameters=e}send(e,t){return new Promise(n=>{const r=new XMLHttpRequest;r.timeout=t,r.open("POST",this._parameters.url);const s=this._parameters.headers();Object.entries(s).forEach(([e,t])=>{r.setRequestHeader(e,t)}),r.ontimeout=e=>{n({status:"failure",error:new Error("XHR request timed out")})},r.onreadystatechange=()=>{var e;r.status>=200&&r.status<=299?(Uu.debug("XHR success"),n({status:"success"})):r.status&&(e=r.status,[429,502,503,504].includes(e))?n({status:"retryable",retryInMillis:Mm(r.getResponseHeader("Retry-After"))}):0!==r.status&&n({status:"failure",error:new Error("XHR request failed with non-retryable status")})},r.onabort=()=>{n({status:"failure",error:new Error("XHR request aborted")})},r.onerror=()=>{n({status:"failure",error:new Error("XHR request errored")})},r.send(e)})}shutdown(){}}class Dm{_params;constructor(e){this._params=e}send(e){return new Promise(t=>{navigator.sendBeacon(this._params.url,new Blob([e],{type:this._params.blobType}))?(Uu.debug("SendBeacon success"),t({status:"success"})):t({status:"failure",error:new Error("SendBeacon failed")})})}shutdown(){}}function Fm(e,t,n){const r={...n()},s={};return()=>(null!=t&&Object.assign(s,t()),null!=e&&Object.assign(s,e()),Object.assign(s,r))}function Bm(e){if(null!=e)try{return new URL(e),e}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function Um(e,t,n){return r={url:e.url,timeoutMillis:e.timeoutMillis,headers:lm(e.headers),concurrencyLimit:e.concurrencyLimit},s={},o=function(e,t){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none",headers:()=>e,url:"http://localhost:4318/"+t,agentOptions:{keepAlive:!0}}}(n,t),{...um(r,s,o),headers:Fm((i=r.headers,()=>{const e={};return Object.entries(i?.()??{}).forEach(([t,n])=>{void 0!==n?e[t]=String(n):Uu.warn(`Header "${t}" has invalid value (${n}) and will be ignored`)}),e}),s.headers,o.headers),url:Bm(r.url)??s.url??o.url,agentOptions:r.agentOptions??s.agentOptions??o.agentOptions};var r,s,o,i}function jm(e,t,n,r){const s=!!e.headers||"function"!=typeof navigator.sendBeacon,o=Um(e,n,r);return s?function(e,t){return gm(e,t,Lm({transport:(n=e,new Pm(n))}));var n}(o,t):function(e,t){return gm(e,t,Lm({transport:(n={url:e.url,blobType:e.headers()["Content-Type"]},new Dm(n))}));var n}(o,t)}class Zm extends im{constructor(e={}){super(jm(e,Rm,"v1/traces",{"Content-Type":"application/json"}))}}const zm="monoscope";class Vm{constructor(e,t,n){this.processor=null,this.longTaskObserver=null,this.resourceObserver=null,this._enabled=!0,this._configured=!1,this._firstExportLogged=!1,this.pageSpan=null,this.pageContext=null,this.endPageSpanHandler=null,this.onExportStatus=null,this.config=e,this.sessionId=t,this.tabId=n,this.provider=this.createProvider()}createProvider(){const{serviceName:e,resourceAttributes:t={},exporterEndpoint:n}=this.config,r=this.config.apiKey||this.config.projectId||"",s=this,o=new Zm({url:n||"https://otelcol.monoscope.tech/v1/traces",headers:{"x-api-key":r}}),i=Object.create(o,{export:{value:(e,t)=>o.export(e,e=>{if(!s._firstExportLogged){s._firstExportLogged=!0;const t=0===e.code;if(s.config.debug&&(console.log(t?"%c[Monoscope] ✓ First trace sent successfully":"%c[Monoscope] ✗ First trace export failed",t?"color: #22c55e; font-weight: bold":"color: #ef4444; font-weight: bold",t?"":e.error||""),!t)){const t=String(e.error||"");t.includes("401")||t.includes("403")?console.warn("[Monoscope] Authentication failed. Your apiKey may be invalid."):console.warn("[Monoscope] Could not reach Monoscope endpoint. Check your apiKey and network.")}s.onExportStatus?.(t)}t(e)})}}),a=new xd(i);return this.processor=a,new Kd({resource:yd({[Sh]:e,"x-api-key":r,...t}),spanProcessors:[a]})}commonAttrs(){const e={"session.id":this.sessionId,"tab.id":this.tabId,"page.url":location.href,"page.title":document.title};return document.referrer&&(e["page.referrer"]=document.referrer),e}applyCommonAttrs(e){for(const[t,n]of Object.entries(this.commonAttrs()))e.setAttribute(t,n);if(this.config.user)for(const[t,n]of Object.entries(this.config.user))void 0!==n&&e.setAttribute(`user.${t}`,n)}configure(){if("undefined"==typeof window||this._configured)return;this._configured=!0;const e=Math.max(0,Math.min(1,this.config.sampleRate??1));if(Math.random()>=e)return this._enabled=!1,void(this.config.debug&&console.log("MonoscopeOTel: sampled out"));this.provider.register({contextManager:new Ep,propagator:new Yh});const t=this.config.propagateTraceHeaderCorsUrls||[new RegExp(`^${location.origin}`)],n=[/^https?:\/\/(?:[^\/]+\.)?apitoolkit\.io\//,/^https?:\/\/(?:[^\/]+\.)?monoscope\.tech\//],r=e=>this.applyCommonAttrs(e);!function(e){const t=e.tracerProvider||th.getTracerProvider(),n=e.meterProvider||Vu.getMeterProvider(),r=e.loggerProvider||ap.getLoggerProvider(),s=e.instrumentations?.flat()??[];(function(e,t,n,r){for(let s=0,o=e.length;s<o;s++){const o=e[s];t&&o.setTracerProvider(t),n&&o.setMeterProvider(n),r&&o.setLoggerProvider&&o.setLoggerProvider(r),o.getConfig().enabled||o.enable()}})(s,t,n,r)}({tracerProvider:this.provider,instrumentations:[...this.config.instrumentations||[],new _p({ignoreNetworkEvents:!this.config.enableNetworkEvents,applyCustomAttributesOnSpan:{documentLoad:r}}),new gg({propagateTraceHeaderCorsUrls:t,ignoreUrls:n,applyCustomAttributesOnSpan:r}),new Dg({propagateTraceHeaderCorsUrls:t,ignoreUrls:n,applyCustomAttributesOnSpan:r}),...this.config.enableUserInteraction?[new om]:[]]}),this.startPageSpan(),this.observeLongTasks(),this.observeResourceTiming()}startPageSpan(){const e=th.getTracer(zm);this.pageSpan=e.startSpan("browser.session",{attributes:this.commonAttrs()}),this.pageContext=th.setSpan(Bu.active(),this.pageSpan),this.endPageSpanHandler=()=>{this.pageSpan?.end(),this.pageSpan=null},window.addEventListener("pagehide",this.endPageSpanHandler),window.addEventListener("beforeunload",this.endPageSpanHandler)}getPageContext(){return this.pageContext}withPageContext(e){return this.pageContext?Bu.with(this.pageContext,e):e()}emitSpan(e,t,n){try{const r=th.getTracer(zm);this.withPageContext(()=>r.startActiveSpan(e,e=>{this.applyCommonAttrs(e);for(const[n,r]of Object.entries(t))e.setAttribute(n,r);n?.(e),e.end()}))}catch(t){this.config.debug&&console.warn("Monoscope: span emit failed for",e,t)}}observeLongTasks(){if("undefined"!=typeof PerformanceObserver)try{this.longTaskObserver=new PerformanceObserver(e=>{if(this._enabled)for(const t of e.getEntries())try{const e={"longtask.duration":t.duration,"longtask.name":t.name},n=t.attribution;n?.[0]?.containerSrc&&(e["longtask.script"]=n[0].containerSrc),n?.[0]?.containerName&&(e["longtask.container"]=n[0].containerName),this.emitSpan("longtask",e)}catch(e){this.config.debug&&console.warn("Monoscope: failed to process longtask entry",e)}}),this.longTaskObserver.observe({type:"longtask",buffered:!0})}catch(e){console.warn("Monoscope: longtask observation not supported",e)}}observeResourceTiming(){if("undefined"==typeof PerformanceObserver)return;const e=this.config.resourceTimingThresholdMs??200;try{this.resourceObserver=new PerformanceObserver(t=>{if(this._enabled)for(const n of t.getEntries())if(!(n.duration<e))try{const e=n;this.emitSpan("resource",{"resource.name":e.name,"resource.duration":e.duration,"resource.type":e.initiatorType,"resource.transferSize":e.transferSize,"resource.encodedBodySize":e.encodedBodySize})}catch(e){this.config.debug&&console.warn("Monoscope: failed to process resource entry",e)}}),this.resourceObserver.observe({type:"resource",buffered:!1})}catch(e){console.warn("Monoscope: resource timing not supported",e)}}startSpan(e,t){const n=th.getTracer(zm);return this.withPageContext(()=>n.startActiveSpan(e,e=>{this.applyCommonAttrs(e);try{const n=t(e);return n instanceof Promise?n.then(t=>(e.end(),t),t=>{throw e.setStatus({code:Fu.ERROR,message:String(t)}),e.end(),t}):(e.end(),n)}catch(t){throw e.setStatus({code:Fu.ERROR,message:String(t)}),e.end(),t}}))}recordEvent(e,t={}){this.emitSpan(e,t)}async forceFlush(){await(this.processor?.forceFlush())}updateSessionId(e){this.sessionId=e}setEnabled(e){this._enabled=e}async shutdown(){this.longTaskObserver?.disconnect(),this.resourceObserver?.disconnect(),this.endPageSpanHandler&&"undefined"!=typeof window&&(this.endPageSpanHandler(),window.removeEventListener("pagehide",this.endPageSpanHandler),window.removeEventListener("beforeunload",this.endPageSpanHandler),this.endPageSpanHandler=null),this.pageSpan=null,this.pageContext=null,this._configured=!1,await this.provider.shutdown()}setUser(e){this.config={...this.config,user:{...this.config.user,...e}}}}const Hm=[];function Gm(e){Hm.push({...e,timestamp:Date.now()}),Hm.length>20&&Hm.shift()}function Wm(e){try{return JSON.stringify(e)}catch{return`[unserializable: ${typeof e}]`}}class Ym{constructor(e){this.errorCount=0,this._active=!1,this.prevOnError=null,this.onUnhandledRejection=null,this.origConsoleError=null,this._processing=!1,this.emit=e}createErrorSpan(e,t,n){this.errorCount++;const r=Hm.slice();this.emit(e,{"error.type":t,"error.count":this.errorCount,...n},e=>{e.setStatus({code:Fu.ERROR}),r.length>0&&e.setAttribute("breadcrumbs",Wm(r))})}start(){"undefined"==typeof window||this._active||(this._active=!0,this.prevOnError=window.onerror,window.onerror=(e,t,n,r,s)=>{const o={"error.message":"string"==typeof e?e:e.type};if(t&&(o["error.source"]=t),void 0!==n&&(o["error.lineno"]=n),void 0!==r&&(o["error.colno"]=r),s?.stack&&(o["error.stack"]=s.stack),s?.name&&(o["error.name"]=s.name),this.createErrorSpan("exception","uncaught_exception",o),"function"==typeof this.prevOnError)return this.prevOnError.call(window,e,t,n,r,s)},this.onUnhandledRejection=e=>{const t=e.reason,n={};t instanceof Error?(n["error.message"]=t.message,n["error.name"]=t.name,t.stack&&(n["error.stack"]=t.stack)):n["error.message"]=String(t),this.createErrorSpan("unhandled_rejection","unhandled_rejection",n)},this.origConsoleError=console.error,console.error=(...e)=>{if(this.origConsoleError?.apply(console,e),!this._processing){this._processing=!0;try{const t=e.map(e=>e instanceof Error?e.message:"string"==typeof e?e:Wm(e)).join(" "),n={"error.message":t},r=e.find(e=>e instanceof Error);r&&(n["error.name"]=r.name,r.stack&&(n["error.stack"]=r.stack)),Gm({type:"console.error",message:t}),this.createErrorSpan("console.error","console_error",n)}finally{this._processing=!1}}},window.addEventListener("unhandledrejection",this.onUnhandledRejection))}stop(){"undefined"!=typeof window&&this._active&&(this._active=!1,window.onerror=this.prevOnError,this.prevOnError=null,this.onUnhandledRejection&&window.removeEventListener("unhandledrejection",this.onUnhandledRejection),this.origConsoleError&&(console.error=this.origConsoleError,this.origConsoleError=null))}getErrorCount(){return this.errorCount}}class Km{constructor(e){this._enabled=!0,this._active=!1,this.emit=e}async start(){if("undefined"!=typeof window&&!this._active){this._active=!0;try{const{onCLS:e,onINP:t,onLCP:n,onFCP:r,onTTFB:s}=await Promise.resolve().then(function(){return Xy}),o=e=>{this._enabled&&this.emit(`web-vital.${e.name}`,{"vital.name":e.name,"vital.value":e.value,"vital.rating":e.rating,"vital.id":e.id,"vital.navigationType":e.navigationType})};[e,t,n,r,s].forEach(e=>e(o))}catch(e){console.warn("Monoscope: web-vitals collection failed to initialize",e)}}}setEnabled(e){this._enabled=e}}class Jm{constructor(e){this.currentUrl="",this._active=!1,this.origPushState=null,this.origReplaceState=null,this.popstateHandler=null,this.emit=e}start(){if("undefined"==typeof window||this._active)return;this._active=!0,this.currentUrl=location.href,this.origPushState=history.pushState.bind(history),this.origReplaceState=history.replaceState.bind(history);const e=e=>{try{const t=this.currentUrl,n=location.href;if(t===n)return;this.currentUrl=n,Gm({type:"navigation",message:`${t} → ${n}`,data:{method:e}}),this.emit("navigation",{"navigation.from":t,"navigation.to":n,"navigation.method":e,"page.title":document.title})}catch(e){try{console.warn("Monoscope: error in navigation tracking",e)}catch{}}};history.pushState=(...t)=>{this.origPushState(...t),e("pushState")},history.replaceState=(...t)=>{this.origReplaceState(...t),e("replaceState")},this.popstateHandler=()=>e("popstate"),window.addEventListener("popstate",this.popstateHandler)}stop(){"undefined"!=typeof window&&this._active&&(this._active=!1,this.origPushState&&(history.pushState=this.origPushState),this.origReplaceState&&(history.replaceState=this.origReplaceState),this.popstateHandler&&window.removeEventListener("popstate",this.popstateHandler),this.origPushState=null,this.origReplaceState=null,this.popstateHandler=null)}}const Xm="monoscope-overlay-dismissed";class $m{constructor(){if(this.el=null,this.eventCount=0,this.statusDot=null,this.countEl=null,this.connEl=null,"undefined"!=typeof document){try{if(sessionStorage.getItem(Xm))return}catch{}this.mount()}}mount(){const e=document.createElement("div");Object.assign(e.style,{position:"fixed",bottom:"12px",right:"12px",zIndex:"2147483647",background:"#1a1a2e",color:"#e0e0e0",fontFamily:"system-ui, sans-serif",fontSize:"12px",padding:"6px 10px",borderRadius:"6px",boxShadow:"0 2px 8px rgba(0,0,0,0.3)",display:"flex",alignItems:"center",gap:"6px",cursor:"default",userSelect:"none"}),this.statusDot=document.createElement("span"),Object.assign(this.statusDot.style,{width:"7px",height:"7px",borderRadius:"50%",background:"#22c55e",display:"inline-block"}),this.countEl=document.createElement("span"),this.countEl.textContent="0",this.countEl.style.opacity="0.7",this.connEl=document.createElement("span"),this.connEl.style.opacity="0.7";const t=document.createElement("span");t.textContent="×",Object.assign(t.style,{cursor:"pointer",marginLeft:"4px",opacity:"0.6",fontSize:"14px"}),t.onclick=()=>this.dismiss(),e.append(this.statusDot," Monoscope ",this.countEl," ",this.connEl,t),this.el=e,(document.body||document.documentElement).appendChild(e)}incrementEvents(){this.eventCount++,this.countEl&&(this.countEl.textContent=String(this.eventCount))}setConnectionStatus(e){this.connEl&&(this.connEl.textContent=e?"Connected":"Connection failed"),this.statusDot&&(this.statusDot.style.background=e?"#22c55e":"#ef4444")}dismiss(){this.el?.remove(),this.el=null;try{sessionStorage.setItem(Xm,"1")}catch{}}}const qm=18e5,Qm="monoscope-last-activity",ey="undefined"!=typeof window;var ty,ny,ry,sy,oy,iy=-1,ay=function(e){addEventListener("pageshow",function(t){t.persisted&&(iy=t.timeStamp,e(t))},!0)},cy=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},ly=function(){var e=cy();return e&&e.activationStart||0},uy=function(e,t){var n=cy(),r="navigate";return iy>=0?r="back-forward-cache":n&&(document.prerendering||ly()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},hy=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver(function(e){Promise.resolve().then(function(){t(e.getEntries())})});return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},dy=function(e,t,n,r){var s,o;return function(i){t.value>=0&&(i||r)&&((o=t.value-(s||0))||void 0===s)&&(s=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},py=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},fy=function(e){document.addEventListener("visibilitychange",function(){"hidden"===document.visibilityState&&e()})},gy=function(e){var t=!1;return function(){t||(e(),t=!0)}},my=-1,yy=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},vy=function(e){"hidden"===document.visibilityState&&my>-1&&(my="visibilitychange"===e.type?e.timeStamp:0,wy())},by=function(){addEventListener("visibilitychange",vy,!0),addEventListener("prerenderingchange",vy,!0)},wy=function(){removeEventListener("visibilitychange",vy,!0),removeEventListener("prerenderingchange",vy,!0)},Cy=function(){return my<0&&(my=yy(),by(),ay(function(){setTimeout(function(){my=yy(),by()},0)})),{get firstHiddenTime(){return my}}},Sy=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},_y=[1800,3e3],Iy=function(e,t){t=t||{},Sy(function(){var n,r=Cy(),s=uy("FCP"),o=hy("paint",function(e){e.forEach(function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<r.firstHiddenTime&&(s.value=Math.max(e.startTime-ly(),0),s.entries.push(e),n(!0)))})});o&&(n=dy(e,s,_y,t.reportAllChanges),ay(function(r){s=uy("FCP"),n=dy(e,s,_y,t.reportAllChanges),py(function(){s.value=performance.now()-r.timeStamp,n(!0)})}))})},Ey=[.1,.25],Ty=0,Ay=1/0,ky=0,Oy=function(e){e.forEach(function(e){e.interactionId&&(Ay=Math.min(Ay,e.interactionId),ky=Math.max(ky,e.interactionId),Ty=ky?(ky-Ay)/7+1:0)})},Ry=function(){return ty?Ty:performance.interactionCount||0},xy=function(){"interactionCount"in performance||ty||(ty=hy("event",Oy,{type:"event",buffered:!0,durationThreshold:0}))},Ny=[],Ly=new Map,My=0,Py=[],Dy=function(e){if(Py.forEach(function(t){return t(e)}),e.interactionId||"first-input"===e.entryType){var t=Ny[Ny.length-1],n=Ly.get(e.interactionId);if(n||Ny.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};Ly.set(r.id,r),Ny.push(r)}Ny.sort(function(e,t){return t.latency-e.latency}),Ny.length>10&&Ny.splice(10).forEach(function(e){return Ly.delete(e.id)})}}},Fy=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=gy(e),"hidden"===document.visibilityState?e():(n=t(e),fy(e)),n},By=[200,500],Uy=[2500,4e3],jy={},Zy=[800,1800],zy=function e(t){document.prerendering?Sy(function(){return e(t)}):"complete"!==document.readyState?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},Vy={passive:!0,capture:!0},Hy=new Date,Gy=function(e,t){ny||(ny=t,ry=e,sy=new Date,Ky(removeEventListener),Wy())},Wy=function(){if(ry>=0&&ry<sy-Hy){var e={entryType:"first-input",name:ny.type,target:ny.target,cancelable:ny.cancelable,startTime:ny.timeStamp,processingStart:ny.timeStamp+ry};oy.forEach(function(t){t(e)}),oy=[]}},Yy=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){Gy(e,t),s()},r=function(){s()},s=function(){removeEventListener("pointerup",n,Vy),removeEventListener("pointercancel",r,Vy)};addEventListener("pointerup",n,Vy),addEventListener("pointercancel",r,Vy)}(t,e):Gy(t,e)}},Ky=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach(function(t){return e(t,Yy,Vy)})},Jy=[100,300],Xy=Object.freeze({__proto__:null,CLSThresholds:Ey,FCPThresholds:_y,FIDThresholds:Jy,INPThresholds:By,LCPThresholds:Uy,TTFBThresholds:Zy,onCLS:function(e,t){t=t||{},Iy(gy(function(){var n,r=uy("CLS",0),s=0,o=[],i=function(e){e.forEach(function(e){if(!e.hadRecentInput){var t=o[0],n=o[o.length-1];s&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(s+=e.value,o.push(e)):(s=e.value,o=[e])}}),s>r.value&&(r.value=s,r.entries=o,n())},a=hy("layout-shift",i);a&&(n=dy(e,r,Ey,t.reportAllChanges),fy(function(){i(a.takeRecords()),n(!0)}),ay(function(){s=0,r=uy("CLS",0),n=dy(e,r,Ey,t.reportAllChanges),py(function(){return n()})}),setTimeout(n,0))}))},onFCP:Iy,onFID:function(e,t){t=t||{},Sy(function(){var n,r=Cy(),s=uy("FID"),o=function(e){e.startTime<r.firstHiddenTime&&(s.value=e.processingStart-e.startTime,s.entries.push(e),n(!0))},i=function(e){e.forEach(o)},a=hy("first-input",i);n=dy(e,s,Jy,t.reportAllChanges),a&&(fy(gy(function(){i(a.takeRecords()),a.disconnect()})),ay(function(){var r;s=uy("FID"),n=dy(e,s,Jy,t.reportAllChanges),oy=[],ry=-1,ny=null,Ky(addEventListener),r=o,oy.push(r),Wy()}))})},onINP:function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},Sy(function(){var n;xy();var r,s=uy("INP"),o=function(e){Fy(function(){e.forEach(Dy);var t=function(){var e=Math.min(Ny.length-1,Math.floor((Ry()-My)/50));return Ny[e]}();t&&t.latency!==s.value&&(s.value=t.latency,s.entries=t.entries,r())})},i=hy("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});r=dy(e,s,By,t.reportAllChanges),i&&(i.observe({type:"first-input",buffered:!0}),fy(function(){o(i.takeRecords()),r(!0)}),ay(function(){My=Ry(),Ny.length=0,Ly.clear(),s=uy("INP"),r=dy(e,s,By,t.reportAllChanges)}))}))},onLCP:function(e,t){t=t||{},Sy(function(){var n,r=Cy(),s=uy("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach(function(e){e.startTime<r.firstHiddenTime&&(s.value=Math.max(e.startTime-ly(),0),s.entries=[e],n())})},i=hy("largest-contentful-paint",o);if(i){n=dy(e,s,Uy,t.reportAllChanges);var a=gy(function(){jy[s.id]||(o(i.takeRecords()),i.disconnect(),jy[s.id]=!0,n(!0))});["keydown","click"].forEach(function(e){addEventListener(e,function(){return Fy(a)},{once:!0,capture:!0})}),fy(a),ay(function(r){s=uy("LCP"),n=dy(e,s,Uy,t.reportAllChanges),py(function(){s.value=performance.now()-r.timeStamp,jy[s.id]=!0,n(!0)})})}})},onTTFB:function(e,t){t=t||{};var n=uy("TTFB"),r=dy(e,n,Zy,t.reportAllChanges);zy(function(){var s=cy();s&&(n.value=Math.max(s.responseStart-ly(),0),n.entries=[s],r(!0),ay(function(){n=uy("TTFB",0),(r=dy(e,n,Zy,t.reportAllChanges))(!0)}))})}});return class{constructor(e){this.overlay=null;const t=e.apiKey||e.projectId;if(!t)throw new Error("MonoscopeConfig must include apiKey (or projectId)");e.projectId&&!e.apiKey&&e.debug&&console.warn("[Monoscope] `projectId` is deprecated. Use `apiKey` instead."),e={...e,apiKey:t,projectId:t};const n=ey&&("localhost"===location.hostname||"127.0.0.1"===location.hostname);void 0===e.debug&&n&&(e={...e,debug:!0}),e.serviceName||(e={...e,serviceName:ey?location.hostname:"unknown"}),this.config=e,this._enabled=!1!==e.enabled,this.tabId=crypto.randomUUID(),this.sessionId=ey?this.resolveSessionId():crypto.randomUUID(),this.lastActivityTime=Date.now(),ey&&this.persistActivity(),this.replay=new Rl(e,this.sessionId,this.tabId),this.otel=new Vm(e,this.sessionId,this.tabId);const r=(...e)=>this.otel.emitSpan(...e);this.errors=new Ym(r),this.vitals=new Km(r),this.router=new Jm(r),this._enabled&&(this.otel.configure(),this.replay.configure(),this.errors.start(),this.vitals.start().catch(e=>{this.config.debug&&console.warn("Monoscope: web-vitals init failed",e)}),this.router.start()),this._enabled&&this.config.debug&&(this.logInitBanner(),ey&&(this.overlay=new $m,this.otel.onExportStatus=e=>this.overlay?.setConnectionStatus(e))),ey&&this.setupActivityTracking()}logInitBanner(){const e=this.config,t=e.exporterEndpoint||"https://otelcol.monoscope.tech/v1/traces",n=Math.round(100*(e.sampleRate??1)),r=Math.round(100*(e.replaySampleRate??1));console.groupCollapsed("%c[Monoscope] ✓ Initialized","color: #22c55e; font-weight: bold"),console.log(` API Key: ${e.apiKey}`),console.log(` Service: ${e.serviceName}`),console.log(` Session: ${this.sessionId}`),console.log(` Tracing: ✓ (sample rate: ${n}%)`),console.log(` Replay: ✓ (sample rate: ${r}%)`),console.log(" Errors: ✓"),console.log(` Endpoint: ${t}`),console.groupEnd()}resolveSessionId(){try{const e=sessionStorage.getItem("monoscope-session-id"),t=sessionStorage.getItem(Qm);if(e&&t){if(Date.now()-parseInt(t,10)<qm)return e}const n=crypto.randomUUID();return sessionStorage.setItem("monoscope-session-id",n),n}catch(e){return this.config.debug&&console.warn("Monoscope: sessionStorage unavailable, using ephemeral session",e),crypto.randomUUID()}}persistActivity(){try{sessionStorage.setItem(Qm,Date.now().toString())}catch(e){this.config.debug&&console.warn("Monoscope: failed to persist activity",e)}}rotateSession(){this.replay.save().catch(e=>{this.config.debug&&console.warn("Monoscope: failed to save replay on session rotation",e)}),Hm.length=0,this.sessionId=crypto.randomUUID();try{sessionStorage.setItem("monoscope-session-id",this.sessionId)}catch(e){this.config.debug&&console.warn("Monoscope: failed to persist session ID",e)}this.replay.updateSessionId(this.sessionId),this.otel.updateSessionId(this.sessionId),this.config.debug&&console.log("Monoscope: session rotated due to inactivity")}checkAndRefreshSession(){const e=Date.now();e-this.lastActivityTime>=qm&&this.rotateSession(),this.lastActivityTime=e,this.persistActivity()}setupActivityTracking(){document.addEventListener("visibilitychange",()=>{"visible"===document.visibilityState&&this.checkAndRefreshSession()});let e=Date.now();const t=()=>{const t=Date.now();t-e>5e3&&(e=t,this.lastActivityTime=t,this.persistActivity())};document.addEventListener("click",e=>{t();const n=e.target;if(!n)return;const r=n.tagName?.toLowerCase()||"",s=(n.textContent||"").trim().slice(0,50),o=n.getAttribute("class")||"";Gm({type:"click",message:`${r} "${s}"`,data:{selector:n.id?`#${n.id}`:o?`.${o.split(" ")[0]}`:r}})},{capture:!0,passive:!0}),document.addEventListener("keydown",t,{capture:!0,passive:!0})}getSessionId(){return this.sessionId}getTabId(){return this.tabId}setUser(e){if(this.config.debug){const t=new Set(["email","full_name","name","id","roles"]),n=Object.keys(e).filter(e=>!t.has(e));n.length&&console.warn(`Monoscope: unknown user attributes will be sent to collectors: ${n.join(", ")}`)}this.otel.setUser(e),this.replay.setUser(e)}startSpan(e,t){return this.overlay?.incrementEvents(),this.otel.startSpan(e,t)}recordEvent(e,t){this.otel.recordEvent(e,t),this.overlay?.incrementEvents()}async test(){try{this.otel.emitSpan("monoscope.test",{"test.timestamp":Date.now()}),await this.otel.forceFlush();const e="Test span sent successfully.";return this.config.debug&&console.log(`[Monoscope] ${e}`),{success:!0,message:e}}catch(e){const t=`Test failed: ${e}`;return this.config.debug&&console.error(`[Monoscope] ${t}`),{success:!1,message:t}}}disable(){this._enabled=!1,this.replay.setEnabled(!1),this.otel.setEnabled(!1),this.vitals.setEnabled(!1),this.errors.stop(),this.router.stop()}enable(){this._enabled=!0,this.otel.setEnabled(!0),this.otel.configure(),this.replay.setEnabled(!0),this.replay.configure(),this.vitals.setEnabled(!0),this.vitals.start().catch(()=>{}),this.errors.start(),this.router.start()}isEnabled(){return this._enabled}async destroy(){this.errors.stop(),this.router.stop(),this.replay.stop(),this.vitals.setEnabled(!1);try{await this.otel.shutdown()}catch(e){console.warn("Monoscope: provider shutdown failed, some trace data may be lost",e)}this._enabled=!1}}}();
20
+ */var Tp=Object.defineProperty,Ap=Object.defineProperties,kp=Object.getOwnPropertyDescriptors,Op=Object.getOwnPropertySymbols,Rp=Object.prototype.hasOwnProperty,xp=Object.prototype.propertyIsEnumerable,Np=(e,t,n)=>t in e?Tp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Lp=(e,t)=>{for(var n in t||(t={}))Rp.call(t,n)&&Np(e,n,t[n]);if(Op)for(var n of Op(t))xp.call(t,n)&&Np(e,n,t[n]);return e},Mp=(e,t,n)=>(Np(e,"symbol"!=typeof t?t+"":t,n),n),Pp=globalThis;function Dp(e){return(Pp.__Zone_symbol_prefix||"__zone_symbol__")+e}var Fp=Object.getOwnPropertyDescriptor,Bp=Object.defineProperty,Up=Object.getPrototypeOf,jp=Object.create,Zp=Array.prototype.slice,zp="addEventListener",Vp="removeEventListener",Hp=Dp(zp),Gp=Dp(Vp),Wp="true",Yp="false",Kp=Dp("");function $p(e,t){return Zone.current.wrap(e,t)}function Jp(e,t,n,r,s){return Zone.current.scheduleMacroTask(e,t,n,r,s)}var Xp=Dp,qp="undefined"!=typeof window,Qp=qp?window:void 0,ef=qp&&Qp||globalThis;function tf(e,t){for(let n=e.length-1;n>=0;n--)"function"==typeof e[n]&&(e[n]=$p(e[n],t+"_"+n));return e}function nf(e){return!e||!1!==e.writable&&!("function"==typeof e.get&&void 0===e.set)}var rf="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,sf=!("nw"in ef)&&void 0!==ef.process&&"[object process]"===ef.process.toString(),of=!sf&&!rf&&!(!qp||!Qp.HTMLElement),af=void 0!==ef.process&&"[object process]"===ef.process.toString()&&!rf&&!(!qp||!Qp.HTMLElement),cf={},lf=Xp("enable_beforeunload"),uf=function(e){if(!(e=e||ef.event))return;let t=cf[e.type];t||(t=cf[e.type]=Xp("ON_PROPERTY"+e.type));const n=this||e.target||ef,r=n[t];let s;if(of&&n===Qp&&"error"===e.type){const t=e;s=r&&r.call(this,t.message,t.filename,t.lineno,t.colno,t.error),!0===s&&e.preventDefault()}else s=r&&r.apply(this,arguments),"beforeunload"===e.type&&ef[lf]&&"string"==typeof s?e.returnValue=s:null==s||s||e.preventDefault();return s};function hf(e,t,n){let r=Fp(e,t);if(!r&&n){Fp(n,t)&&(r={enumerable:!0,configurable:!0})}if(!r||!r.configurable)return;const s=Xp("on"+t+"patched");if(e.hasOwnProperty(s)&&e[s])return;delete r.writable,delete r.value;const o=r.get,i=r.set,a=t.slice(2);let c=cf[a];c||(c=cf[a]=Xp("ON_PROPERTY"+a)),r.set=function(t){let n=this;if(n||e!==ef||(n=ef),!n)return;"function"==typeof n[c]&&n.removeEventListener(a,uf),null==i||i.call(n,null),n[c]=t,"function"==typeof t&&n.addEventListener(a,uf,!1)},r.get=function(){let n=this;if(n||e!==ef||(n=ef),!n)return null;const s=n[c];if(s)return s;if(o){let e=o.call(this);if(e)return r.set.call(this,e),"function"==typeof n.removeAttribute&&n.removeAttribute(t),e}return null},Bp(e,t,r),e[s]=!0}function df(e,t,n){if(t)for(let r=0;r<t.length;r++)hf(e,"on"+t[r],n);else{const t=[];for(const n in e)"on"==n.slice(0,2)&&t.push(n);for(let r=0;r<t.length;r++)hf(e,t[r],n)}}var pf=Xp("originalInstance");function ff(e){const t=ef[e];if(!t)return;ef[Xp(e)]=t,ef[e]=function(){const n=tf(arguments,e);switch(n.length){case 0:this[pf]=new t;break;case 1:this[pf]=new t(n[0]);break;case 2:this[pf]=new t(n[0],n[1]);break;case 3:this[pf]=new t(n[0],n[1],n[2]);break;case 4:this[pf]=new t(n[0],n[1],n[2],n[3]);break;default:throw new Error("Arg list too long.")}},yf(ef[e],t);const n=new t(function(){});let r;for(r in n)"XMLHttpRequest"===e&&"responseBlob"===r||function(t){"function"==typeof n[t]?ef[e].prototype[t]=function(){return this[pf][t].apply(this[pf],arguments)}:Bp(ef[e].prototype,t,{set:function(n){"function"==typeof n?(this[pf][t]=$p(n,e+"."+t),yf(this[pf][t],n)):this[pf][t]=n},get:function(){return this[pf][t]}})}(r);for(r in t)"prototype"!==r&&t.hasOwnProperty(r)&&(ef[e][r]=t[r])}function gf(e,t,n){let r=e;for(;r&&!r.hasOwnProperty(t);)r=Up(r);!r&&e[t]&&(r=e);const s=Xp(t);let o=null;if(r&&(!(o=r[s])||!r.hasOwnProperty(s))){o=r[s]=r[t];if(nf(r&&Fp(r,t))){const e=n(o,s,t);r[t]=function(){return e(this,arguments)},yf(r[t],o)}}return o}function mf(e,t,n){let r=null;function s(e){const t=e.data;return t.args[t.cbIdx]=function(){e.invoke.apply(this,arguments)},r.apply(t.target,t.args),e}r=gf(e,t,e=>function(t,r){const o=n(t,r);return o.cbIdx>=0&&"function"==typeof r[o.cbIdx]?Jp(o.name,r[o.cbIdx],o,s):e.apply(t,r)})}function yf(e,t){e[Xp("OriginalDelegate")]=t}function vf(e){return"function"==typeof e}function bf(e){return"number"==typeof e}var wf={useG:!0},Cf={},Sf={},_f=new RegExp("^"+Kp+"(\\w+)(true|false)$"),If=Xp("propagationStopped");function Ef(e,t){const n=(t?t(e):e)+Yp,r=(t?t(e):e)+Wp,s=Kp+n,o=Kp+r;Cf[e]={},Cf[e][Yp]=s,Cf[e][Wp]=o}function Tf(e,t,n,r){const s=r&&r.add||zp,o=r&&r.rm||Vp,i=r&&r.listeners||"eventListeners",a=r&&r.rmAll||"removeAllListeners",c=Xp(s),l="."+s+":",u="prependListener",h="."+u+":",d=function(e,t,n){if(e.isRemoved)return;const r=e.callback;let s;"object"==typeof r&&r.handleEvent&&(e.callback=e=>r.handleEvent(e),e.originalDelegate=r);try{e.invoke(e,t,[n])}catch(e){s=e}const i=e.options;if(i&&"object"==typeof i&&i.once){const r=e.originalDelegate?e.originalDelegate:e.callback;t[o].call(t,n.type,r,i)}return s};function p(n,r,s){if(!(r=r||e.event))return;const o=n||r.target||e,i=o[Cf[r.type][s?Wp:Yp]];if(i){const e=[];if(1===i.length){const t=d(i[0],o,r);t&&e.push(t)}else{const t=i.slice();for(let n=0;n<t.length&&(!r||!0!==r[If]);n++){const s=d(t[n],o,r);s&&e.push(s)}}if(1===e.length)throw e[0];for(let n=0;n<e.length;n++){const r=e[n];t.nativeScheduleMicroTask(()=>{throw r})}}}const f=function(e){return p(this,e,!1)},g=function(e){return p(this,e,!0)};function m(t,n){if(!t)return!1;let r=!0;n&&void 0!==n.useG&&(r=n.useG);const d=n&&n.vh;let p=!0;n&&void 0!==n.chkDup&&(p=n.chkDup);let m=!1;n&&void 0!==n.rt&&(m=n.rt);let y=t;for(;y&&!y.hasOwnProperty(s);)y=Up(y);if(!y&&t[s]&&(y=t),!y)return!1;if(y[c])return!1;const v=n&&n.eventNameToString,b={},w=y[c]=y[s],C=y[Xp(o)]=y[o],S=y[Xp(i)]=y[i],_=y[Xp(a)]=y[a];let I;function E(e,t){return t?"boolean"==typeof e?{capture:e,passive:!0}:e?"object"==typeof e&&!1!==e.passive?((e,t)=>Ap(e,kp(t)))(Lp({},e),{passive:!0}):e:{passive:!0}:e}n&&n.prepend&&(I=y[Xp(n.prepend)]=y[n.prepend]);const T=function(e){return I.call(b.target,b.eventName,e.invoke,b.options)},A=r?function(e){if(!b.isExisting)return w.call(b.target,b.eventName,b.capture?g:f,b.options)}:function(e){return w.call(b.target,b.eventName,e.invoke,b.options)},k=r?function(e){if(!e.isRemoved){const t=Cf[e.eventName];let n;t&&(n=t[e.capture?Wp:Yp]);const r=n&&e.target[n];if(r)for(let t=0;t<r.length;t++){if(r[t]===e){r.splice(t,1),e.isRemoved=!0,e.removeAbortListener&&(e.removeAbortListener(),e.removeAbortListener=null),0===r.length&&(e.allRemoved=!0,e.target[n]=null);break}}}if(e.allRemoved)return C.call(e.target,e.eventName,e.capture?g:f,e.options)}:function(e){return C.call(e.target,e.eventName,e.invoke,e.options)},O=(null==n?void 0:n.diff)||function(e,t){const n=typeof t;return"function"===n&&e.callback===t||"object"===n&&e.originalDelegate===t},R=Zone[Xp("UNPATCHED_EVENTS")],x=e[Xp("PASSIVE_EVENTS")];const N=function(t,s,o,i,a=!1,c=!1){return function(){const l=this||e;let u=arguments[0];n&&n.transferEventName&&(u=n.transferEventName(u));let h=arguments[1];if(!h)return t.apply(this,arguments);if(sf&&"uncaughtException"===u)return t.apply(this,arguments);let f=!1;if("function"!=typeof h){if(!h.handleEvent)return t.apply(this,arguments);f=!0}if(d&&!d(t,h,l,arguments))return;const g=!!x&&-1!==x.indexOf(u),m=function(e){if("object"==typeof e&&null!==e){const t=Lp({},e);return e.signal&&(t.signal=e.signal),t}return e}(E(arguments[2],g)),y=null==m?void 0:m.signal;if(null==y?void 0:y.aborted)return;if(R)for(let e=0;e<R.length;e++)if(u===R[e])return g?t.call(l,u,h,m):t.apply(this,arguments);const w=!!m&&("boolean"==typeof m||m.capture),C=!(!m||"object"!=typeof m)&&m.once,S=Zone.current;let _=Cf[u];_||(Ef(u,v),_=Cf[u]);const I=_[w?Wp:Yp];let T,A=l[I],k=!1;if(A){if(k=!0,p)for(let e=0;e<A.length;e++)if(O(A[e],h))return}else A=l[I]=[];const N=l.constructor.name,L=Sf[N];L&&(T=L[u]),T||(T=N+s+(v?v(u):u)),b.options=m,C&&(b.options.once=!1),b.target=l,b.capture=w,b.eventName=u,b.isExisting=k;const M=r?wf:void 0;M&&(M.taskData=b),y&&(b.options.signal=void 0);const P=S.scheduleEventTask(T,h,M,o,i);if(y){b.options.signal=y;const e=()=>P.zone.cancelTask(P);t.call(y,"abort",e,{once:!0}),P.removeAbortListener=()=>y.removeEventListener("abort",e)}return b.target=null,M&&(M.taskData=null),C&&(b.options.once=!0),"boolean"!=typeof P.options&&(P.options=m),P.target=l,P.capture=w,P.eventName=u,f&&(P.originalDelegate=h),c?A.unshift(P):A.push(P),a?l:void 0}};return y[s]=N(w,l,A,k,m),I&&(y[u]=N(I,h,T,k,m,!0)),y[o]=function(){const t=this||e;let r=arguments[0];n&&n.transferEventName&&(r=n.transferEventName(r));const s=arguments[2],o=!!s&&("boolean"==typeof s||s.capture),i=arguments[1];if(!i)return C.apply(this,arguments);if(d&&!d(C,i,t,arguments))return;const a=Cf[r];let c;a&&(c=a[o?Wp:Yp]);const l=c&&t[c];if(l)for(let e=0;e<l.length;e++){const n=l[e];if(O(n,i)){if(l.splice(e,1),n.isRemoved=!0,0===l.length&&(n.allRemoved=!0,t[c]=null,!o&&"string"==typeof r)){t[Kp+"ON_PROPERTY"+r]=null}return n.zone.cancelTask(n),m?t:void 0}}return C.apply(this,arguments)},y[i]=function(){const t=this||e;let r=arguments[0];n&&n.transferEventName&&(r=n.transferEventName(r));const s=[],o=Af(t,v?v(r):r);for(let e=0;e<o.length;e++){const t=o[e];let n=t.originalDelegate?t.originalDelegate:t.callback;s.push(n)}return s},y[a]=function(){const t=this||e;let r=arguments[0];if(r){n&&n.transferEventName&&(r=n.transferEventName(r));const e=Cf[r];if(e){const n=e[Yp],s=e[Wp],i=t[n],a=t[s];if(i){const e=i.slice();for(let t=0;t<e.length;t++){const n=e[t];let s=n.originalDelegate?n.originalDelegate:n.callback;this[o].call(this,r,s,n.options)}}if(a){const e=a.slice();for(let t=0;t<e.length;t++){const n=e[t];let s=n.originalDelegate?n.originalDelegate:n.callback;this[o].call(this,r,s,n.options)}}}}else{const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t],r=_f.exec(n);let s=r&&r[1];s&&"removeListener"!==s&&this[a].call(this,s)}this[a].call(this,"removeListener")}if(m)return this},yf(y[s],w),yf(y[o],C),_&&yf(y[a],_),S&&yf(y[i],S),!0}let y=[];for(let e=0;e<n.length;e++)y[e]=m(n[e],r);return y}function Af(e,t){if(!t){const n=[];for(let r in e){const s=_f.exec(r);let o=s&&s[1];if(o&&(!t||o===t)){const t=e[r];if(t)for(let e=0;e<t.length;e++)n.push(t[e])}}return n}let n=Cf[t];n||(Ef(t),n=Cf[t]);const r=e[n[Yp]],s=e[n[Wp]];return r?s?r.concat(s):r.slice():s?s.slice():[]}function kf(e,t){const n=e.Event;n&&n.prototype&&t.patchMethod(n.prototype,"stopImmediatePropagation",e=>function(t,n){t[If]=!0,e&&e.apply(t,n)})}var Of=Xp("zoneTask");function Rf(e,t,n,r){let s=null,o=null;n+=r;const i={};function a(t){const n=t.data;n.args[0]=function(){return t.invoke.apply(this,arguments)};const r=s.apply(e,n.args);return bf(r)?n.handleId=r:(n.handle=r,n.isRefreshable=vf(r.refresh)),t}function c(t){const{handle:n,handleId:r}=t.data;return o.call(e,null!=n?n:r)}s=gf(e,t+=r,n=>function(s,o){var l;if(vf(o[0])){const e={isRefreshable:!1,isPeriodic:"Interval"===r,delay:"Timeout"===r||"Interval"===r?o[1]||0:void 0,args:o},n=o[0];o[0]=function(){try{return n.apply(this,arguments)}finally{const{handle:t,handleId:n,isPeriodic:r,isRefreshable:s}=e;r||s||(n?delete i[n]:t&&(t[Of]=null))}};const s=Jp(t,o[0],e,a,c);if(!s)return s;const{handleId:u,handle:h,isRefreshable:d,isPeriodic:p}=s.data;if(u)i[u]=s;else if(h&&(h[Of]=s,d&&!p)){const e=h.refresh;h.refresh=function(){const{zone:t,state:n}=s;return"notScheduled"===n?(s._state="scheduled",t._updateTaskCount(s,1)):"running"===n&&(s._state="scheduling"),e.call(this)}}return null!=(l=null!=h?h:u)?l:s}return n.apply(e,o)}),o=gf(e,n,t=>function(n,r){const s=r[0];let o;bf(s)?(o=i[s],delete i[s]):(o=null==s?void 0:s[Of],o?s[Of]=null:o=s),(null==o?void 0:o.type)?o.cancelFn&&o.zone.cancelTask(o):t.apply(e,r)})}function xf(e,t,n){if(!n||0===n.length)return t;const r=n.filter(t=>t.target===e);if(0===r.length)return t;const s=r[0].ignoreProperties;return t.filter(e=>-1===s.indexOf(e))}function Nf(e,t,n,r){if(!e)return;df(e,xf(e,t,n),r)}function Lf(e){return Object.getOwnPropertyNames(e).filter(e=>e.startsWith("on")&&e.length>2).map(e=>e.substring(2))}function Mf(e){e.__load_patch("ZoneAwarePromise",(e,t,n)=>{const r=Object.getOwnPropertyDescriptor,s=Object.defineProperty;const o=n.symbol,i=[],a=!1!==e[o("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")],c=o("Promise"),l=o("then");n.onUnhandledError=e=>{if(n.showUncaughtError()){const t=e&&e.rejection;t?console.error("Unhandled Promise rejection:",t instanceof Error?t.message:t,"; Zone:",e.zone.name,"; Task:",e.task&&e.task.source,"; Value:",t,t instanceof Error?t.stack:void 0):console.error(e)}},n.microtaskDrainDone=()=>{for(;i.length;){const e=i.shift();try{e.zone.runGuarded(()=>{if(e.throwOriginal)throw e.rejection;throw e})}catch(e){h(e)}}};const u=o("unhandledPromiseRejectionHandler");function h(e){n.onUnhandledError(e);try{const n=t[u];"function"==typeof n&&n.call(this,e)}catch(e){}}function d(e){return e&&"function"==typeof e.then}function p(e){return e}function f(e){return L.reject(e)}const g=o("state"),m=o("value"),y=o("finally"),v=o("parentPromiseValue"),b=o("parentPromiseState"),w=null,C=!0,S=!1;function _(e,t){return n=>{try{A(e,t,n)}catch(t){A(e,!1,t)}}}const I=function(){let e=!1;return function(t){return function(){e||(e=!0,t.apply(null,arguments))}}},E="Promise resolved with itself",T=o("currentTaskTrace");function A(e,r,o){const c=I();if(e===o)throw new TypeError(E);if(e[g]===w){let l=null;try{"object"!=typeof o&&"function"!=typeof o||(l=o&&o.then)}catch(t){return c(()=>{A(e,!1,t)})(),e}if(r!==S&&o instanceof L&&o.hasOwnProperty(g)&&o.hasOwnProperty(m)&&o[g]!==w)O(o),A(e,o[g],o[m]);else if(r!==S&&"function"==typeof l)try{l.call(o,c(_(e,r)),c(_(e,!1)))}catch(t){c(()=>{A(e,!1,t)})()}else{e[g]=r;const c=e[m];if(e[m]=o,e[y]===y&&r===C&&(e[g]=e[b],e[m]=e[v]),r===S&&o instanceof Error){const e=t.currentTask&&t.currentTask.data&&t.currentTask.data.__creationTrace__;e&&s(o,T,{configurable:!0,enumerable:!1,writable:!0,value:e})}for(let t=0;t<c.length;)R(e,c[t++],c[t++],c[t++],c[t++]);if(0==c.length&&r==S){e[g]=0;let r=o;try{throw new Error("Uncaught (in promise): "+function(e){if(e&&e.toString===Object.prototype.toString){return(e.constructor&&e.constructor.name||"")+": "+JSON.stringify(e)}return e?e.toString():Object.prototype.toString.call(e)}(o)+(o&&o.stack?"\n"+o.stack:""))}catch(e){r=e}a&&(r.throwOriginal=!0),r.rejection=o,r.promise=e,r.zone=t.current,r.task=t.currentTask,i.push(r),n.scheduleMicroTask()}}}return e}const k=o("rejectionHandledHandler");function O(e){if(0===e[g]){try{const n=t[k];n&&"function"==typeof n&&n.call(this,{rejection:e[m],promise:e})}catch(e){}e[g]=S;for(let t=0;t<i.length;t++)e===i[t].promise&&i.splice(t,1)}}function R(e,t,n,r,s){O(e);const o=e[g],i=o?"function"==typeof r?r:p:"function"==typeof s?s:f;t.scheduleMicroTask("Promise.then",()=>{try{const r=e[m],s=!!n&&y===n[y];s&&(n[v]=r,n[b]=o);const a=t.run(i,void 0,s&&i!==f&&i!==p?[]:[r]);A(n,!0,a)}catch(e){A(n,!1,e)}},n)}const x=function(){},N=e.AggregateError;class L{static toString(){return"function ZoneAwarePromise() { [native code] }"}static resolve(e){return e instanceof L?e:A(new this(null),C,e)}static reject(e){return A(new this(null),S,e)}static withResolvers(){const e={};return e.promise=new L((t,n)=>{e.resolve=t,e.reject=n}),e}static any(e){if(!e||"function"!=typeof e[Symbol.iterator])return Promise.reject(new N([],"All promises were rejected"));const t=[];let n=0;try{for(let r of e)n++,t.push(L.resolve(r))}catch(e){return Promise.reject(new N([],"All promises were rejected"))}if(0===n)return Promise.reject(new N([],"All promises were rejected"));let r=!1;const s=[];return new L((e,o)=>{for(let i=0;i<t.length;i++)t[i].then(t=>{r||(r=!0,e(t))},e=>{s.push(e),n--,0===n&&(r=!0,o(new N(s,"All promises were rejected")))})})}static race(e){let t,n,r=new this((e,r)=>{t=e,n=r});function s(e){t(e)}function o(e){n(e)}for(let t of e)d(t)||(t=this.resolve(t)),t.then(s,o);return r}static all(e){return L.allWithCallback(e)}static allSettled(e){return(this&&this.prototype instanceof L?this:L).allWithCallback(e,{thenCallback:e=>({status:"fulfilled",value:e}),errorCallback:e=>({status:"rejected",reason:e})})}static allWithCallback(e,t){let n,r,s=new this((e,t)=>{n=e,r=t}),o=2,i=0;const a=[];for(let s of e){d(s)||(s=this.resolve(s));const e=i;try{s.then(r=>{a[e]=t?t.thenCallback(r):r,o--,0===o&&n(a)},s=>{t?(a[e]=t.errorCallback(s),o--,0===o&&n(a)):r(s)})}catch(e){r(e)}o++,i++}return o-=2,0===o&&n(a),s}constructor(e){const t=this;if(!(t instanceof L))throw new Error("Must be an instanceof Promise.");t[g]=w,t[m]=[];try{const n=I();e&&e(n(_(t,C)),n(_(t,S)))}catch(e){A(t,!1,e)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return L}then(e,n){var r;let s=null==(r=this.constructor)?void 0:r[Symbol.species];s&&"function"==typeof s||(s=this.constructor||L);const o=new s(x),i=t.current;return this[g]==w?this[m].push(i,o,e,n):R(this,i,o,e,n),o}catch(e){return this.then(null,e)}finally(e){var n;let r=null==(n=this.constructor)?void 0:n[Symbol.species];r&&"function"==typeof r||(r=L);const s=new r(x);s[y]=y;const o=t.current;return this[g]==w?this[m].push(o,s,e,e):R(this,o,s,e,e),s}}L.resolve=L.resolve,L.reject=L.reject,L.race=L.race,L.all=L.all;const M=e[c]=e.Promise;e.Promise=L;const P=o("thenPatched");function D(e){const t=e.prototype,n=r(t,"then");if(n&&(!1===n.writable||!n.configurable))return;const s=t.then;t[l]=s,e.prototype.then=function(e,t){const n=new L((e,t)=>{s.call(this,e,t)});return n.then(e,t)},e[P]=!0}if(n.patchThen=D,M){D(M);const t=M.try;t&&"function"==typeof t&&(L.try=t),gf(e,"fetch",e=>{return t=e,function(e,n){let r=t.apply(e,n);if(r instanceof L)return r;let s=r.constructor;return s[P]||D(s),r};var t})}return Promise[t.__symbol__("uncaughtPromiseErrors")]=i,L})}function Pf(e,t,n,r,s){const o=Zone.__symbol__(r);if(t[o])return;const i=t[o]=t[r];t[r]=function(o,a,c){return a&&a.prototype&&s.forEach(function(t){const s=`${n}.${r}::`+t,o=a.prototype;try{if(o.hasOwnProperty(t)){const n=e.ObjectGetOwnPropertyDescriptor(o,t);n&&n.value?(n.value=e.wrapWithCurrentZone(n.value,s),e._redefineProperty(a.prototype,t,n)):o[t]&&(o[t]=e.wrapWithCurrentZone(o[t],s))}else o[t]&&(o[t]=e.wrapWithCurrentZone(o[t],s))}catch(e){}}),i.call(t,o,a,c)},e.attachOriginToPatched(t[r],i)}var Df,Ff=function(){const e=globalThis,t=!0===e[Dp("forceDuplicateZoneCheck")];if(e.Zone&&(t||"function"!=typeof e.Zone.__symbol__))throw new Error("Zone already loaded.");return null!=e.Zone||(e.Zone=function(){const e=Pp.performance;function t(t){e&&e.mark&&e.mark(t)}function n(t,n){e&&e.measure&&e.measure(t,n)}t("Zone");const r=class e{constructor(e,t){Mp(this,"_parent"),Mp(this,"_name"),Mp(this,"_properties"),Mp(this,"_zoneDelegate"),this._parent=e,this._name=t?t.name||"unnamed":"<root>",this._properties=t&&t.properties||{},this._zoneDelegate=new i(this,this._parent&&this._parent._zoneDelegate,t)}static assertZonePatched(){if(Pp.Promise!==A.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let t=e.current;for(;t.parent;)t=t.parent;return t}static get current(){return O.zone}static get currentTask(){return R}static __load_patch(r,s,o=!1){if(A.hasOwnProperty(r)){const e=!0===Pp[Dp("forceDuplicateZoneCheck")];if(!o&&e)throw Error("Already loaded patch: "+r)}else if(!Pp["__Zone_disable_"+r]){const o="Zone:"+r;t(o),A[r]=s(Pp,e,k),n(o,o)}}get parent(){return this._parent}get name(){return this._name}get(e){const t=this.getZoneWith(e);if(t)return t._properties[e]}getZoneWith(e){let t=this;for(;t;){if(t._properties.hasOwnProperty(e))return t;t=t._parent}return null}fork(e){if(!e)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)}wrap(e,t){if("function"!=typeof e)throw new Error("Expecting function got: "+e);const n=this._zoneDelegate.intercept(this,e,t),r=this;return function(){return r.runGuarded(n,this,arguments,t)}}run(e,t,n,r){O={parent:O,zone:this};try{return this._zoneDelegate.invoke(this,e,t,n,r)}finally{O=O.parent}}runGuarded(e,t=null,n,r){O={parent:O,zone:this};try{try{return this._zoneDelegate.invoke(this,e,t,n,r)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{O=O.parent}}runTask(e,t,n){if(e.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(e.zone||y).name+"; Execution: "+this.name+")");const r=e,{type:s,data:{isPeriodic:o=!1,isRefreshable:i=!1}={}}=e;if(e.state===v&&(s===T||s===E))return;const a=e.state!=C;a&&r._transitionTo(C,w);const c=R;R=r,O={parent:O,zone:this};try{s!=E||!e.data||o||i||(e.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,r,t,n)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{const t=e.state;if(t!==v&&t!==_)if(s==T||o||i&&t===b)a&&r._transitionTo(w,C,b);else{const e=r._zoneDelegates;this._updateTaskCount(r,-1),a&&r._transitionTo(v,C,v),i&&(r._zoneDelegates=e)}O=O.parent,R=c}}scheduleTask(e){if(e.zone&&e.zone!==this){let t=this;for(;t;){if(t===e.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${e.zone.name}`);t=t.parent}}e._transitionTo(b,v);const t=[];e._zoneDelegates=t,e._zone=this;try{e=this._zoneDelegate.scheduleTask(this,e)}catch(t){throw e._transitionTo(_,b,v),this._zoneDelegate.handleError(this,t),t}return e._zoneDelegates===t&&this._updateTaskCount(e,1),e.state==b&&e._transitionTo(w,b),e}scheduleMicroTask(e,t,n,r){return this.scheduleTask(new a(I,e,t,n,r,void 0))}scheduleMacroTask(e,t,n,r,s){return this.scheduleTask(new a(E,e,t,n,r,s))}scheduleEventTask(e,t,n,r,s){return this.scheduleTask(new a(T,e,t,n,r,s))}cancelTask(e){if(e.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(e.zone||y).name+"; Execution: "+this.name+")");if(e.state===w||e.state===C){e._transitionTo(S,w,C);try{this._zoneDelegate.cancelTask(this,e)}catch(t){throw e._transitionTo(_,S),this._zoneDelegate.handleError(this,t),t}return this._updateTaskCount(e,-1),e._transitionTo(v,S),e.runCount=-1,e}}_updateTaskCount(e,t){const n=e._zoneDelegates;-1==t&&(e._zoneDelegates=null);for(let r=0;r<n.length;r++)n[r]._updateTaskCount(e.type,t)}};Mp(r,"__symbol__",Dp);let s=r;const o={name:"",onHasTask:(e,t,n,r)=>e.hasTask(n,r),onScheduleTask:(e,t,n,r)=>e.scheduleTask(n,r),onInvokeTask:(e,t,n,r,s,o)=>e.invokeTask(n,r,s,o),onCancelTask:(e,t,n,r)=>e.cancelTask(n,r)};class i{constructor(e,t,n){Mp(this,"_zone"),Mp(this,"_taskCounts",{microTask:0,macroTask:0,eventTask:0}),Mp(this,"_parentDelegate"),Mp(this,"_forkDlgt"),Mp(this,"_forkZS"),Mp(this,"_forkCurrZone"),Mp(this,"_interceptDlgt"),Mp(this,"_interceptZS"),Mp(this,"_interceptCurrZone"),Mp(this,"_invokeDlgt"),Mp(this,"_invokeZS"),Mp(this,"_invokeCurrZone"),Mp(this,"_handleErrorDlgt"),Mp(this,"_handleErrorZS"),Mp(this,"_handleErrorCurrZone"),Mp(this,"_scheduleTaskDlgt"),Mp(this,"_scheduleTaskZS"),Mp(this,"_scheduleTaskCurrZone"),Mp(this,"_invokeTaskDlgt"),Mp(this,"_invokeTaskZS"),Mp(this,"_invokeTaskCurrZone"),Mp(this,"_cancelTaskDlgt"),Mp(this,"_cancelTaskZS"),Mp(this,"_cancelTaskCurrZone"),Mp(this,"_hasTaskDlgt"),Mp(this,"_hasTaskDlgtOwner"),Mp(this,"_hasTaskZS"),Mp(this,"_hasTaskCurrZone"),this._zone=e,this._parentDelegate=t,this._forkZS=n&&(n&&n.onFork?n:t._forkZS),this._forkDlgt=n&&(n.onFork?t:t._forkDlgt),this._forkCurrZone=n&&(n.onFork?this._zone:t._forkCurrZone),this._interceptZS=n&&(n.onIntercept?n:t._interceptZS),this._interceptDlgt=n&&(n.onIntercept?t:t._interceptDlgt),this._interceptCurrZone=n&&(n.onIntercept?this._zone:t._interceptCurrZone),this._invokeZS=n&&(n.onInvoke?n:t._invokeZS),this._invokeDlgt=n&&(n.onInvoke?t:t._invokeDlgt),this._invokeCurrZone=n&&(n.onInvoke?this._zone:t._invokeCurrZone),this._handleErrorZS=n&&(n.onHandleError?n:t._handleErrorZS),this._handleErrorDlgt=n&&(n.onHandleError?t:t._handleErrorDlgt),this._handleErrorCurrZone=n&&(n.onHandleError?this._zone:t._handleErrorCurrZone),this._scheduleTaskZS=n&&(n.onScheduleTask?n:t._scheduleTaskZS),this._scheduleTaskDlgt=n&&(n.onScheduleTask?t:t._scheduleTaskDlgt),this._scheduleTaskCurrZone=n&&(n.onScheduleTask?this._zone:t._scheduleTaskCurrZone),this._invokeTaskZS=n&&(n.onInvokeTask?n:t._invokeTaskZS),this._invokeTaskDlgt=n&&(n.onInvokeTask?t:t._invokeTaskDlgt),this._invokeTaskCurrZone=n&&(n.onInvokeTask?this._zone:t._invokeTaskCurrZone),this._cancelTaskZS=n&&(n.onCancelTask?n:t._cancelTaskZS),this._cancelTaskDlgt=n&&(n.onCancelTask?t:t._cancelTaskDlgt),this._cancelTaskCurrZone=n&&(n.onCancelTask?this._zone:t._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;const r=n&&n.onHasTask,s=t&&t._hasTaskZS;(r||s)&&(this._hasTaskZS=r?n:o,this._hasTaskDlgt=t,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=this._zone,n.onScheduleTask||(this._scheduleTaskZS=o,this._scheduleTaskDlgt=t,this._scheduleTaskCurrZone=this._zone),n.onInvokeTask||(this._invokeTaskZS=o,this._invokeTaskDlgt=t,this._invokeTaskCurrZone=this._zone),n.onCancelTask||(this._cancelTaskZS=o,this._cancelTaskDlgt=t,this._cancelTaskCurrZone=this._zone))}get zone(){return this._zone}fork(e,t){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,e,t):new s(e,t)}intercept(e,t,n){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,e,t,n):t}invoke(e,t,n,r,s){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,e,t,n,r,s):t.apply(n,r)}handleError(e,t){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,e,t)}scheduleTask(e,t){let n=t;if(this._scheduleTaskZS)this._hasTaskZS&&n._zoneDelegates.push(this._hasTaskDlgtOwner),n=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,e,t),n||(n=t);else if(t.scheduleFn)t.scheduleFn(t);else{if(t.type!=I)throw new Error("Task is missing scheduleFn.");g(t)}return n}invokeTask(e,t,n,r){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,e,t,n,r):t.callback.apply(n,r)}cancelTask(e,t){let n;if(this._cancelTaskZS)n=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,e,t);else{if(!t.cancelFn)throw Error("Task is not cancelable");n=t.cancelFn(t)}return n}hasTask(e,t){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,e,t)}catch(t){this.handleError(e,t)}}_updateTaskCount(e,t){const n=this._taskCounts,r=n[e],s=n[e]=r+t;if(s<0)throw new Error("More tasks executed then were scheduled.");if(0==r||0==s){const t={microTask:n.microTask>0,macroTask:n.macroTask>0,eventTask:n.eventTask>0,change:e};this.hasTask(this._zone,t)}}}class a{constructor(e,t,n,r,s,o){if(Mp(this,"type"),Mp(this,"source"),Mp(this,"invoke"),Mp(this,"callback"),Mp(this,"data"),Mp(this,"scheduleFn"),Mp(this,"cancelFn"),Mp(this,"_zone",null),Mp(this,"runCount",0),Mp(this,"_zoneDelegates",null),Mp(this,"_state","notScheduled"),this.type=e,this.source=t,this.data=r,this.scheduleFn=s,this.cancelFn=o,!n)throw new Error("callback is not defined");this.callback=n;const i=this;e===T&&r&&r.useG?this.invoke=a.invokeTask:this.invoke=function(){return a.invokeTask.call(Pp,i,this,arguments)}}static invokeTask(e,t,n){e||(e=this),x++;try{return e.runCount++,e.zone.runTask(e,t,n)}finally{1==x&&m(),x--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(v,b)}_transitionTo(e,t,n){if(this._state!==t&&this._state!==n)throw new Error(`${this.type} '${this.source}': can not transition to '${e}', expecting state '${t}'${n?" or '"+n+"'":""}, was '${this._state}'.`);this._state=e,e==v&&(this._zoneDelegates=null)}toString(){return this.data&&void 0!==this.data.handleId?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}const c=Dp("setTimeout"),l=Dp("Promise"),u=Dp("then");let h,d=[],p=!1;function f(e){if(h||Pp[l]&&(h=Pp[l].resolve(0)),h){let t=h[u];t||(t=h.then),t.call(h,e)}else Pp[c](e,0)}function g(e){0===x&&0===d.length&&f(m),e&&d.push(e)}function m(){if(!p){for(p=!0;d.length;){const e=d;d=[];for(let t=0;t<e.length;t++){const n=e[t];try{n.zone.runTask(n,null,null)}catch(e){k.onUnhandledError(e)}}}k.microtaskDrainDone(),p=!1}}const y={name:"NO ZONE"},v="notScheduled",b="scheduling",w="scheduled",C="running",S="canceling",_="unknown",I="microTask",E="macroTask",T="eventTask",A={},k={symbol:Dp,currentZoneFrame:()=>O,onUnhandledError:N,microtaskDrainDone:N,scheduleMicroTask:g,showUncaughtError:()=>!s[Dp("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:N,patchMethod:()=>N,bindArguments:()=>[],patchThen:()=>N,patchMacroTask:()=>N,patchEventPrototype:()=>N,getGlobalObjects:()=>{},ObjectDefineProperty:()=>N,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>N,wrapWithCurrentZone:()=>N,filterProperties:()=>[],attachOriginToPatched:()=>N,_redefineProperty:()=>N,patchCallbacks:()=>N,nativeScheduleMicroTask:f};let O={parent:null,zone:new s(null,null)},R=null,x=0;function N(){}return n("Zone","Zone"),s}()),e.Zone}();Mf(Df=Ff),function(e){e.__load_patch("toString",e=>{const t=Function.prototype.toString,n=Xp("OriginalDelegate"),r=Xp("Promise"),s=Xp("Error"),o=function(){if("function"==typeof this){const o=this[n];if(o)return"function"==typeof o?t.call(o):Object.prototype.toString.call(o);if(this===Promise){const n=e[r];if(n)return t.call(n)}if(this===Error){const n=e[s];if(n)return t.call(n)}}return t.call(this)};o[n]=t,Function.prototype.toString=o;const i=Object.prototype.toString;Object.prototype.toString=function(){return"function"==typeof Promise&&this instanceof Promise?"[object Promise]":i.call(this)}})}(Df),function(e){e.__load_patch("util",(e,t,n)=>{const r=Lf(e);n.patchOnProperties=df,n.patchMethod=gf,n.bindArguments=tf,n.patchMacroTask=mf;const s=t.__symbol__("BLACK_LISTED_EVENTS"),o=t.__symbol__("UNPATCHED_EVENTS");e[o]&&(e[s]=e[o]),e[s]&&(t[s]=t[o]=e[s]),n.patchEventPrototype=kf,n.patchEventTarget=Tf,n.ObjectDefineProperty=Bp,n.ObjectGetOwnPropertyDescriptor=Fp,n.ObjectCreate=jp,n.ArraySlice=Zp,n.patchClass=ff,n.wrapWithCurrentZone=$p,n.filterProperties=xf,n.attachOriginToPatched=yf,n._redefineProperty=Object.defineProperty,n.patchCallbacks=Pf,n.getGlobalObjects=()=>({globalSources:Sf,zoneSymbolEventNames:Cf,eventNames:r,isBrowser:of,isMix:af,isNode:sf,TRUE_STR:Wp,FALSE_STR:Yp,ZONE_SYMBOL_PREFIX:Kp,ADD_EVENT_LISTENER_STR:zp,REMOVE_EVENT_LISTENER_STR:Vp})})}(Df),function(e){e.__load_patch("timers",e=>{const t="set",n="clear";Rf(e,t,n,"Timeout"),Rf(e,t,n,"Interval"),Rf(e,t,n,"Immediate")}),e.__load_patch("requestAnimationFrame",e=>{Rf(e,"request","cancel","AnimationFrame"),Rf(e,"mozRequest","mozCancel","AnimationFrame"),Rf(e,"webkitRequest","webkitCancel","AnimationFrame")}),e.__load_patch("blocking",(e,t)=>{const n=["alert","prompt","confirm"];for(let r=0;r<n.length;r++){gf(e,n[r],(n,r,s)=>function(r,o){return t.current.run(n,e,o,s)})}}),e.__load_patch("EventTarget",(e,t,n)=>{!function(e,t){t.patchEventPrototype(e,t)}(e,n),function(e,t){if(Zone[t.symbol("patchEventTarget")])return;const{eventNames:n,zoneSymbolEventNames:r,TRUE_STR:s,FALSE_STR:o,ZONE_SYMBOL_PREFIX:i}=t.getGlobalObjects();for(let e=0;e<n.length;e++){const t=n[e],a=i+(t+o),c=i+(t+s);r[t]={},r[t][o]=a,r[t][s]=c}const a=e.EventTarget;a&&a.prototype&&t.patchEventTarget(e,t,[a&&a.prototype])}(e,n);const r=e.XMLHttpRequestEventTarget;r&&r.prototype&&n.patchEventTarget(e,n,[r.prototype])}),e.__load_patch("MutationObserver",(e,t,n)=>{ff("MutationObserver"),ff("WebKitMutationObserver")}),e.__load_patch("IntersectionObserver",(e,t,n)=>{ff("IntersectionObserver")}),e.__load_patch("FileReader",(e,t,n)=>{ff("FileReader")}),e.__load_patch("on_property",(e,t,n)=>{!function(e,t){if(sf&&!af)return;if(Zone[e.symbol("patchEvents")])return;const n=t.__Zone_ignore_on_properties;let r=[];if(of){const e=window;r=r.concat(["Document","SVGElement","Element","HTMLElement","HTMLBodyElement","HTMLMediaElement","HTMLFrameSetElement","HTMLFrameElement","HTMLIFrameElement","HTMLMarqueeElement","Worker"]),Nf(e,Lf(e),n,Up(e))}r=r.concat(["XMLHttpRequest","XMLHttpRequestEventTarget","IDBIndex","IDBRequest","IDBOpenDBRequest","IDBDatabase","IDBTransaction","IDBCursor","WebSocket"]);for(let e=0;e<r.length;e++){const s=t[r[e]];(null==s?void 0:s.prototype)&&Nf(s.prototype,Lf(s.prototype),n)}}(n,e)}),e.__load_patch("customElements",(e,t,n)=>{!function(e,t){const{isBrowser:n,isMix:r}=t.getGlobalObjects();if(!n&&!r||!e.customElements||!("customElements"in e))return;t.patchCallbacks(t,e.customElements,"customElements","define",["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","formAssociatedCallback","formDisabledCallback","formResetCallback","formStateRestoreCallback"])}(e,n)}),e.__load_patch("XHR",(e,t)=>{!function(e){const c=e.XMLHttpRequest;if(!c)return;const l=c.prototype;let u=l[Hp],h=l[Gp];if(!u){const t=e.XMLHttpRequestEventTarget;if(t){const e=t.prototype;u=e[Hp],h=e[Gp]}}const d="readystatechange",p="scheduled";function f(e){const r=e.data,i=r.target;i[o]=!1,i[a]=!1;const c=i[s];u||(u=i[Hp],h=i[Gp]),c&&h.call(i,d,c);const l=i[s]=()=>{if(i.readyState===i.DONE)if(!r.aborted&&i[o]&&e.state===p){const n=i[t.__symbol__("loadfalse")];if(0!==i.status&&n&&n.length>0){const s=e.invoke;e.invoke=function(){const n=i[t.__symbol__("loadfalse")];for(let t=0;t<n.length;t++)n[t]===e&&n.splice(t,1);r.aborted||e.state!==p||s.call(e)},n.push(e)}else e.invoke()}else r.aborted||!1!==i[o]||(i[a]=!0)};u.call(i,d,l);return i[n]||(i[n]=e),w.apply(i,r.args),i[o]=!0,e}function g(){}function m(e){const t=e.data;return t.aborted=!0,C.apply(t.target,t.args)}const y=gf(l,"open",()=>function(e,t){return e[r]=0==t[2],e[i]=t[1],y.apply(e,t)}),v=Xp("fetchTaskAborting"),b=Xp("fetchTaskScheduling"),w=gf(l,"send",()=>function(e,n){if(!0===t.current[b])return w.apply(e,n);if(e[r])return w.apply(e,n);{const t={target:e,url:e[i],isPeriodic:!1,args:n,aborted:!1},r=Jp("XMLHttpRequest.send",g,t,f,m);e&&!0===e[a]&&!t.aborted&&r.state===p&&r.invoke()}}),C=gf(l,"abort",()=>function(e,r){const s=e[n];if(s&&"string"==typeof s.type){if(null==s.cancelFn||s.data&&s.data.aborted)return;s.zone.cancelTask(s)}else if(!0===t.current[v])return C.apply(e,r)})}(e);const n=Xp("xhrTask"),r=Xp("xhrSync"),s=Xp("xhrListener"),o=Xp("xhrScheduled"),i=Xp("xhrURL"),a=Xp("xhrErrorBeforeScheduled")}),e.__load_patch("geolocation",e=>{e.navigator&&e.navigator.geolocation&&function(e,t){const n=e.constructor.name;for(let r=0;r<t.length;r++){const s=t[r],o=e[s];if(o){if(!nf(Fp(e,s)))continue;e[s]=(e=>{const t=function(){return e.apply(this,tf(arguments,n+"."+s))};return yf(t,e),t})(o)}}}(e.navigator.geolocation,["getCurrentPosition","watchPosition"])}),e.__load_patch("PromiseRejectionEvent",(e,t)=>{function n(t){return function(n){Af(e,t).forEach(r=>{const s=e.PromiseRejectionEvent;if(s){const e=new s(t,{promise:n.promise,reason:n.rejection});r.invoke(e)}})}}e.PromiseRejectionEvent&&(t[Xp("unhandledPromiseRejectionHandler")]=n("unhandledrejection"),t[Xp("rejectionHandledHandler")]=n("rejectionhandled"))}),e.__load_patch("queueMicrotask",(e,t,n)=>{!function(e,t){t.patchMethod(e,"queueMicrotask",e=>function(e,t){Zone.current.scheduleMicroTask("queueMicrotask",t[0])})}(e,n)})}(Ff);const Bf="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:"object"==typeof global?global:{},Uf=performance,jf=Math.pow(10,6),Zf=Math.pow(10,9);function zf(e){const t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*jf)]}function Vf(){let e=Uf.timeOrigin;if("number"!=typeof e){const t=Uf;e=t.timing&&t.timing.fetchStart}return e}function Hf(e){return function(e,t){const n=[e[0]+t[0],e[1]+t[1]];n[1]>=Zf&&(n[1]-=Zf,n[0]+=1);return n}(zf(Vf()),zf("number"==typeof e?e:Uf.now()))}function Gf(e){if(t=e,Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1])return e;if("number"==typeof e)return e<Vf()?Hf(e):zf(e);if(e instanceof Date)return zf(e.getTime());throw TypeError("Invalid input type");var t}function Wf(e){return e[0]*Zf+e[1]}var Yf,Kf;function $f(e,t){return"string"==typeof t?e===t:!!e.match(t)}function Jf(e,t){if(!t)return!1;for(const n of t)if($f(e,n))return!0;return!1}!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"}(Yf||(Yf={})),function(e){e.CONNECT_END="connectEnd",e.CONNECT_START="connectStart",e.DECODED_BODY_SIZE="decodedBodySize",e.DOM_COMPLETE="domComplete",e.DOM_CONTENT_LOADED_EVENT_END="domContentLoadedEventEnd",e.DOM_CONTENT_LOADED_EVENT_START="domContentLoadedEventStart",e.DOM_INTERACTIVE="domInteractive",e.DOMAIN_LOOKUP_END="domainLookupEnd",e.DOMAIN_LOOKUP_START="domainLookupStart",e.ENCODED_BODY_SIZE="encodedBodySize",e.FETCH_START="fetchStart",e.LOAD_EVENT_END="loadEventEnd",e.LOAD_EVENT_START="loadEventStart",e.NAVIGATION_START="navigationStart",e.REDIRECT_END="redirectEnd",e.REDIRECT_START="redirectStart",e.REQUEST_START="requestStart",e.RESPONSE_END="responseEnd",e.RESPONSE_START="responseStart",e.SECURE_CONNECTION_START="secureConnectionStart",e.START_TIME="startTime",e.UNLOAD_EVENT_END="unloadEventEnd",e.UNLOAD_EVENT_START="unloadEventStart"}(Kf||(Kf={}));let Xf;function qf(e,t,n,r=!0){if(!(s=n,o=t,!(o in s)||"number"!=typeof n[t]||r&&0===n[t]))return e.addEvent(t,n[t]);var s,o}function Qf(e,t,n=!1,r,s){if(void 0===r&&(r=0!==t[Kf.START_TIME]),n||(qf(e,Kf.FETCH_START,t,r),qf(e,Kf.DOMAIN_LOOKUP_START,t,r),qf(e,Kf.DOMAIN_LOOKUP_END,t,r),qf(e,Kf.CONNECT_START,t,r),qf(e,Kf.SECURE_CONNECTION_START,t,r),qf(e,Kf.CONNECT_END,t,r),qf(e,Kf.REQUEST_START,t,r),qf(e,Kf.RESPONSE_START,t,r),qf(e,Kf.RESPONSE_END,t,r)),!s){const n=t[Kf.ENCODED_BODY_SIZE];void 0!==n&&e.setAttribute("http.response_content_length",n);const r=t[Kf.DECODED_BODY_SIZE];void 0!==r&&n!==r&&e.setAttribute("http.response_content_length_uncompressed",r)}}function eg(){return"undefined"!=typeof location?location.origin:void 0}function tg(e,t,n,r,s=new WeakSet,o){const i=ng(e),a=function(e,t,n,r,s,o){const i=Wf(t),a=Wf(n);let c=r.filter(t=>{const n=Wf(Gf(t[Kf.FETCH_START])),r=Wf(Gf(t[Kf.RESPONSE_END]));return t.initiatorType.toLowerCase()===(o||"xmlhttprequest")&&t.name===e&&n>=i&&r<=a});c.length>0&&(c=c.filter(e=>!s.has(e)));return c}(e=i.toString(),t,n,r,s,o);if(0===a.length)return{mainRequest:void 0};if(1===a.length)return{mainRequest:a[0]};const c=function(e){return e.slice().sort((e,t)=>{const n=e[Kf.FETCH_START],r=t[Kf.FETCH_START];return n>r?1:n<r?-1:0})}(a);if(i.origin!==eg()&&c.length>1){let e=c[0],t=function(e,t,n){const r=Wf(n),s=Wf(Gf(t));let o,i=e[1];const a=e.length;for(let t=1;t<a;t++){const n=e[t],a=Wf(Gf(n[Kf.FETCH_START])),c=r-Wf(Gf(n[Kf.RESPONSE_END]));a>=s&&(!o||c<o)&&(o=c,i=n)}return i}(c,e[Kf.RESPONSE_END],n);const r=e[Kf.RESPONSE_END];return t[Kf.FETCH_START]<r&&(t=e,e=void 0),{corsPreFlightRequest:e,mainRequest:t}}return{mainRequest:a[0]}}function ng(e){if("function"==typeof URL)return new URL(e,"undefined"!=typeof document?document.baseURI:"undefined"!=typeof location?location.href:void 0);const t=(Xf||(Xf=document.createElement("a")),Xf);return t.href=e,t}function rg(e,t){let n=t||[];("string"==typeof n||n instanceof RegExp)&&(n=[n]);return ng(e).origin===eg()||n.some(t=>$f(e,t))}var sg;!function(e){e.METHOD_OPEN="open",e.METHOD_SEND="send",e.EVENT_ABORT="abort",e.EVENT_ERROR="error",e.EVENT_LOAD="loaded",e.EVENT_TIMEOUT="timeout"}(sg||(sg={}));const og=Uu.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-xml-http-request/utils"});function ig(e){return t=e,"undefined"!=typeof Document&&t instanceof Document?(new XMLSerializer).serializeToString(document).length:"string"==typeof e?cg(e):e instanceof Blob?e.size:e instanceof FormData?function(e){let t=0;for(const[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}(e):e instanceof URLSearchParams?cg(e.toString()):void 0!==e.byteLength?e.byteLength:void og.warn("unknown body type");var t}const ag=new TextEncoder;function cg(e){return ag.encode(e).byteLength}function lg(e){const t=function(){void 0===hg&&(hg=ug);return hg}(),n=e.toUpperCase();return n in t?n:"_OTHER"}const ug={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0};let hg;const dg={"https:":"443","http:":"80"};const pg="0.203.0";var fg;!function(e){e.HTTP_STATUS_TEXT="http.status_text"}(fg||(fg={}));class gg extends gp{component="xml-http-request";version=pg;moduleName=this.component;_tasksCount=0;_xhrMem=new WeakMap;_usedResources=new WeakSet;_semconvStability;constructor(e={}){super("@opentelemetry/instrumentation-xml-http-request",pg,e),this._semconvStability=wp("http",e?.semconvStabilityOptIn)}init(){}_addHeaders(e,t){if(!rg(ng(t).href,this.getConfig().propagateTraceHeaderCorsUrls)){const e={};return qu.inject(Bu.active(),e),void(Object.keys(e).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}const n={};qu.inject(Bu.active(),n),Object.keys(n).forEach(t=>{e.setRequestHeader(t,String(n[t]))})}_addChildSpan(e,t){Bu.with(th.setSpan(Bu.active(),e),()=>{const e=this.tracer.startSpan("CORS Preflight",{startTime:t[Kf.FETCH_START]}),n=!(this._semconvStability&vp.OLD);Qf(e,t,this.getConfig().ignoreNetworkEvents,void 0,n),e.end(t[Kf.RESPONSE_END])})}_addFinalSpanAttributes(e,t,n){if(this._semconvStability&vp.OLD){if(void 0!==t.status&&e.setAttribute("http.status_code",t.status),void 0!==t.statusText&&e.setAttribute(fg.HTTP_STATUS_TEXT,t.statusText),"string"==typeof n){const t=ng(n);e.setAttribute("http.host",t.host),e.setAttribute("http.scheme",t.protocol.replace(":",""))}e.setAttribute("http.user_agent",navigator.userAgent)}this._semconvStability&vp.STABLE&&t.status&&e.setAttribute(bh,t.status)}_applyAttributesAfterXHR(e,t){const n=this.getConfig().applyCustomAttributesOnSpan;"function"==typeof n&&mp(()=>n(e,t),e=>{e&&this._diag.error("applyCustomAttributesOnSpan",e)})}_addResourceObserver(e,t){const n=this._xhrMem.get(e);n&&"function"==typeof PerformanceObserver&&"function"==typeof PerformanceResourceTiming&&(n.createdResources={observer:new PerformanceObserver(e=>{const r=e.getEntries(),s=ng(t);r.forEach(e=>{"xmlhttprequest"===e.initiatorType&&e.name===s.href&&n.createdResources&&n.createdResources.entries.push(e)})}),entries:[]},n.createdResources.observer.observe({entryTypes:["resource"]}))}_clearResources(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(Uf.clearResourceTimings(),this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}_findResourceAndAddNetworkEvents(e,t,n,r,s){if(!(n&&r&&s&&e.createdResources))return;let o=e.createdResources.entries;o&&o.length||(o=Uf.getEntriesByType("resource"));const i=tg(ng(n).href,r,s,o,this._usedResources);if(i.mainRequest){const e=i.mainRequest;this._markResourceAsUsed(e);const n=i.corsPreFlightRequest;n&&(this._addChildSpan(t,n),this._markResourceAsUsed(n));const r=!(this._semconvStability&vp.OLD);Qf(t,e,this.getConfig().ignoreNetworkEvents,void 0,r)}}_cleanPreviousSpanInformation(e){const t=this._xhrMem.get(e);if(t){const n=t.callbackToRemoveEvents;n&&n(),this._xhrMem.delete(e)}}_createSpan(e,t,n){if(Jf(t,this.getConfig().ignoreUrls))return void this._diag.debug("ignoring span as url matches ignored url");let r="";const s=ng(t),o={};if(this._semconvStability&vp.OLD&&(r=n.toUpperCase(),o["http.method"]=n,o["http.url"]=s.toString()),this._semconvStability&vp.STABLE){const e=n,t=lg(n);r||(r=t),o[yh]=t,t!==e&&(o[vh]=e),o[Th]=s.toString(),o[wh]=s.hostname;const i=function(e){const t=Number(e.port||dg[e.protocol]);return t&&!isNaN(t)?t:void 0}(s);i&&(o[Ch]=i)}const i=this.tracer.startSpan(r,{kind:Du.CLIENT,attributes:o});return i.addEvent(sg.METHOD_OPEN),this._cleanPreviousSpanInformation(e),this._xhrMem.set(e,{span:i,spanUrl:t}),i}_markResourceAsUsed(e){this._usedResources.add(e)}_patchOpen(){return e=>{const t=this;return function(...n){const r=n[0],s=n[1];return t._createSpan(this,s,r),e.apply(this,n)}}}_patchSend(){const e=this;function t(t,n,r,s){const o=e._xhrMem.get(n);if(!o)return;if(o.status=n.status,o.statusText=n.statusText,e._xhrMem.delete(n),o.span){const t=o.span;e._applyAttributesAfterXHR(t,n),e._semconvStability&vp.STABLE&&(r?s&&(t.setStatus({code:Fu.ERROR,message:s}),t.setAttribute(fh,s)):o.status&&o.status>=400&&(t.setStatus({code:Fu.ERROR}),t.setAttribute(fh,String(o.status))))}const i=Hf(),a=Date.now();setTimeout(()=>{!function(t,n,r,s){const o=n.callbackToRemoveEvents;"function"==typeof o&&o();const{span:i,spanUrl:a,sendStartTime:c}=n;i&&(e._findResourceAndAddNetworkEvents(n,i,a,c,r),i.addEvent(t,s),e._addFinalSpanAttributes(i,n,a),i.end(s),e._tasksCount--),e._clearResources()}(t,o,i,a)},300)}function n(){t(sg.EVENT_ERROR,this,!0,"error")}function r(){t(sg.EVENT_ABORT,this,!1)}function s(){t(sg.EVENT_TIMEOUT,this,!0,"timeout")}function o(){this.status<299?t(sg.EVENT_LOAD,this,!1):t(sg.EVENT_ERROR,this,!1)}return t=>function(...i){const a=e._xhrMem.get(this);if(!a)return t.apply(this,i);const c=a.span,l=a.spanUrl;if(c&&l){if(e.getConfig().measureRequestSize&&i?.[0]){const t=ig(i[0]);void 0!==t&&(e._semconvStability&vp.OLD&&c.setAttribute("http.request_content_length_uncompressed",t),e._semconvStability&vp.STABLE&&c.setAttribute("http.request.body.size",t))}Bu.with(th.setSpan(Bu.active(),c),()=>{e._tasksCount++,a.sendStartTime=Hf(),c.addEvent(sg.METHOD_SEND),this.addEventListener("abort",r),this.addEventListener("error",n),this.addEventListener("load",o),this.addEventListener("timeout",s),a.callbackToRemoveEvents=()=>{!function(t){t.removeEventListener("abort",r),t.removeEventListener("error",n),t.removeEventListener("load",o),t.removeEventListener("timeout",s);const i=e._xhrMem.get(t);i&&(i.callbackToRemoveEvents=void 0)}(this),a.createdResources&&a.createdResources.observer.disconnect()},e._addHeaders(this,l),e._addResourceObserver(this,l)})}return t.apply(this,i)}}enable(){this._diag.debug("applying patch to",this.moduleName,this.version),yp(XMLHttpRequest.prototype.open)&&(this._unwrap(XMLHttpRequest.prototype,"open"),this._diag.debug("removing previous patch from method open")),yp(XMLHttpRequest.prototype.send)&&(this._unwrap(XMLHttpRequest.prototype,"send"),this._diag.debug("removing previous patch from method send")),this._wrap(XMLHttpRequest.prototype,"open",this._patchOpen()),this._wrap(XMLHttpRequest.prototype,"send",this._patchSend())}disable(){this._diag.debug("removing patch from",this.moduleName,this.version),this._unwrap(XMLHttpRequest.prototype,"open"),this._unwrap(XMLHttpRequest.prototype,"send"),this._tasksCount=0,this._xhrMem=new WeakMap,this._usedResources=new WeakSet}}var mg;!function(e){e.COMPONENT="component",e.HTTP_STATUS_TEXT="http.status_text"}(mg||(mg={}));var yg={};Object.defineProperty(yg,"__esModule",{value:!0});var vg=yg.ATTR_HTTP_USER_AGENT=yg.ATTR_HTTP_URL=yg.ATTR_HTTP_STATUS_CODE=yg.ATTR_HTTP_SCHEME=yg.ATTR_HTTP_RESPONSE_CONTENT_LENGTH=yg.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED=yg.ATTR_HTTP_REQUEST_BODY_SIZE=yg.ATTR_HTTP_METHOD=yg.ATTR_HTTP_HOST=void 0,bg=yg.ATTR_HTTP_HOST="http.host",wg=yg.ATTR_HTTP_METHOD="http.method",Cg=yg.ATTR_HTTP_REQUEST_BODY_SIZE="http.request.body.size",Sg=yg.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED="http.request_content_length_uncompressed";yg.ATTR_HTTP_RESPONSE_CONTENT_LENGTH="http.response_content_length";var _g=yg.ATTR_HTTP_SCHEME="http.scheme",Ig=yg.ATTR_HTTP_STATUS_CODE="http.status_code",Eg=yg.ATTR_HTTP_URL="http.url";vg=yg.ATTR_HTTP_USER_AGENT="http.user_agent";const Tg=Uu.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-fetch/utils"});function Ag(...e){if(e[0]instanceof URL||"string"==typeof e[0]){const t=e[1];if(!t?.body)return Promise.resolve();if(t.body instanceof ReadableStream){const{body:e,length:n}=function(e){if(!e.pipeThrough)return Tg.warn("Platform has ReadableStream but not pipeThrough!"),{body:e,length:Promise.resolve(void 0)};let t,n=0;const r=new Promise(e=>{t=e}),s=new TransformStream({start(){},async transform(e,t){const r=await e;n+=r.byteLength,t.enqueue(e)},flush(){t(n)}});return{body:e.pipeThrough(s),length:r}}(t.body);return t.body=e,n}return Promise.resolve(function(e){if(t=e,"undefined"!=typeof Document&&t instanceof Document)return(new XMLSerializer).serializeToString(document).length;var t;if("string"==typeof e)return Og(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return function(e){let t=0;for(const[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}(e);if(e instanceof URLSearchParams)return Og(e.toString());if(void 0!==e.byteLength)return e.byteLength;return void Tg.warn("unknown body type")}(t.body))}{const t=e[0];return t?.body?t.clone().text().then(e=>Og(e)):Promise.resolve()}}const kg=new TextEncoder;function Og(e){return kg.encode(e).byteLength}const Rg={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0};let xg;function Ng(){return void 0===xg&&(xg=Rg),xg}const Lg={"https:":"443","http:":"80"};const Mg="0.203.0",Pg="object"==typeof process&&"node"===process.release?.name;class Dg extends gp{component="fetch";version=Mg;moduleName=this.component;_usedResources=new WeakSet;_tasksCount=0;_semconvStability;constructor(e={}){super("@opentelemetry/instrumentation-fetch",Mg,e),this._semconvStability=wp("http",e?.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){const n=this.tracer.startSpan("CORS Preflight",{startTime:t[Kf.FETCH_START]},th.setSpan(Bu.active(),e)),r=!(this._semconvStability&vp.OLD);Qf(n,t,this.getConfig().ignoreNetworkEvents,void 0,r),n.end(t[Kf.RESPONSE_END])}_addFinalSpanAttributes(e,t){const n=ng(t.url);if(this._semconvStability&vp.OLD&&(e.setAttribute(Ig,t.status),null!=t.statusText&&e.setAttribute(mg.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(bg,n.host),e.setAttribute(_g,n.protocol.replace(":","")),"undefined"!=typeof navigator&&e.setAttribute(vg,navigator.userAgent)),this._semconvStability&vp.STABLE){e.setAttribute(bh,t.status),e.setAttribute(wh,n.hostname);const r=function(e){const t=Number(e.port||Lg[e.protocol]);return t&&!isNaN(t)?t:void 0}(n);r&&e.setAttribute(Ch,r)}}_addHeaders(e,t){if(!rg(t,this.getConfig().propagateTraceHeaderCorsUrls)){const e={};return qu.inject(Bu.active(),e),void(Object.keys(e).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}if(e instanceof Request)qu.inject(Bu.active(),e.headers,{set:(e,t,n)=>e.set(t,"string"==typeof n?n:String(n))});else if(e.headers instanceof Headers)qu.inject(Bu.active(),e.headers,{set:(e,t,n)=>e.set(t,"string"==typeof n?n:String(n))});else if(e.headers instanceof Map)qu.inject(Bu.active(),e.headers,{set:(e,t,n)=>e.set(t,"string"==typeof n?n:String(n))});else{const t={};qu.inject(Bu.active(),t),e.headers=Object.assign({},t,e.headers||{})}}_clearResources(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(e,t={}){if(Jf(e,this.getConfig().ignoreUrls))return void this._diag.debug("ignoring span as url matches ignored url");let n="";const r={};if(this._semconvStability&vp.OLD){const s=(t.method||"GET").toUpperCase();n=`HTTP ${s}`,r[mg.COMPONENT]=this.moduleName,r[wg]=s,r[Eg]=e}if(this._semconvStability&vp.STABLE){const s=t.method,o=function(e){const t=Ng(),n=e.toUpperCase();return n in t?n:"_OTHER"}(t.method||"GET");n||(n=o),r[yh]=o,o!==s&&(r[vh]=s),r[Th]=e}return this.tracer.startSpan(n,{kind:Du.CLIENT,attributes:r})}_findResourceAndAddNetworkEvents(e,t,n){let r=t.entries;if(!r.length){if(!performance.getEntriesByType)return;r=performance.getEntriesByType("resource")}const s=tg(t.spanUrl,t.startTime,n,r,this._usedResources,"fetch");if(s.mainRequest){const t=s.mainRequest;this._markResourceAsUsed(t);const n=s.corsPreFlightRequest;n&&(this._addChildSpan(e,n),this._markResourceAsUsed(n));const r=!(this._semconvStability&vp.OLD);Qf(e,t,this.getConfig().ignoreNetworkEvents,void 0,r)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,n){const r=zf(Date.now()),s=Hf();this._addFinalSpanAttributes(e,n),this._semconvStability&vp.STABLE&&n.status>=400&&(e.setStatus({code:Fu.ERROR}),e.setAttribute(fh,String(n.status))),setTimeout(()=>{t.observer?.disconnect(),this._findResourceAndAddNetworkEvents(e,t,s),this._tasksCount--,this._clearResources(),e.end(r)},300)}_patchConstructor(){return e=>{const t=this;return function(...n){const r=this,s=ng(n[0]instanceof Request?n[0].url:String(n[0])).href,o=n[0]instanceof Request?n[0]:n[1]||{},i=t._createSpan(s,o);if(!i)return e.apply(this,n);const a=t._prepareSpanData(s);function c(e,n){t._applyAttributesAfterFetch(e,o,n),t._endSpan(e,a,{status:n.status||0,statusText:n.message,url:s})}function l(e,n){t._applyAttributesAfterFetch(e,o,n),n.status>=200&&n.status<400?t._endSpan(e,a,n):t._endSpan(e,a,{status:n.status,statusText:n.statusText,url:s})}function u(e,t,n){try{const t=n.clone().body;if(t){const r=t.getReader(),s=()=>{r.read().then(({done:t})=>{t?l(e,n):s()},t=>{c(e,t)})};s()}else l(e,n)}finally{t(n)}}function h(e,t,n){try{c(e,n)}finally{t(n)}}return t.getConfig().measureRequestSize&&Ag(...n).then(e=>{e&&(t._semconvStability&vp.OLD&&i.setAttribute(Sg,e),t._semconvStability&vp.STABLE&&i.setAttribute(Cg,e))}).catch(e=>{t._diag.warn("getFetchBodyLength",e)}),new Promise((n,a)=>Bu.with(th.setSpan(Bu.active(),i),()=>(t._addHeaders(o,s),t._callRequestHook(i,o),t._tasksCount++,e.apply(r,o instanceof Request?[o]:[s,o]).then(u.bind(r,i,n),h.bind(r,i,a)))))}}}_applyAttributesAfterFetch(e,t,n){const r=this.getConfig().applyCustomAttributesOnSpan;r&&mp(()=>r(e,t,n),e=>{e&&this._diag.error("applyCustomAttributesOnSpan",e)})}_callRequestHook(e,t){const n=this.getConfig().requestHook;n&&mp(()=>n(e,t),e=>{e&&this._diag.error("requestHook",e)})}_prepareSpanData(e){const t=Hf(),n=[];if("function"!=typeof PerformanceObserver)return{entries:n,startTime:t,spanUrl:e};const r=new PerformanceObserver(t=>{t.getEntries().forEach(t=>{"fetch"===t.initiatorType&&t.name===e&&n.push(t)})});return r.observe({entryTypes:["resource"]}),{entries:n,observer:r,startTime:t,spanUrl:e}}enable(){Pg?this._diag.warn("this instrumentation is intended for web usage only, it does not instrument Node.js's fetch()"):(yp(fetch)&&(this._unwrap(Bf,"fetch"),this._diag.debug("removing previous patch for constructor")),this._wrap(Bf,"fetch",this._patchConstructor()))}disable(){Pg||(this._unwrap(Bf,"fetch"),this._usedResources=new WeakSet)}}class Fg{emit(e){}}const Bg=new Fg,Ug=Symbol.for("io.opentelemetry.js.api.logs"),jg=globalThis;const Zg=new class{getLogger(e,t,n){return new Fg}};class zg{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;const e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Bg}}class Vg{getLogger(e,t,n){var r;return null!==(r=this._getDelegateLogger(e,t,n))&&void 0!==r?r:new zg(this,e,t,n)}_getDelegate(){var e;return null!==(e=this._delegate)&&void 0!==e?e:Zg}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){var r;return null===(r=this._delegate)||void 0===r?void 0:r.getLogger(e,t,n)}}class Hg{constructor(){this._proxyLoggerProvider=new Vg}static getInstance(){return this._instance||(this._instance=new Hg),this._instance}setGlobalLoggerProvider(e){return jg[Ug]?this.getLoggerProvider():(jg[Ug]=(t=1,n=e,r=Zg,e=>e===t?n:r),this._proxyLoggerProvider._setDelegate(e),e);var t,n,r}getLoggerProvider(){var e,t;return null!==(t=null===(e=jg[Ug])||void 0===e?void 0:e.call(jg,1))&&void 0!==t?t:this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete jg[Ug],this._proxyLoggerProvider=new Vg}}const Gg=Hg.getInstance();let Wg=console.error.bind(console);function Yg(e,t,n){const r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}const Kg=(e,t,n)=>{if(!e||!e[t])return void Wg("no original function "+String(t)+" to wrap");if(!n)return Wg("no wrapper function"),void Wg((new Error).stack);const r=e[t];if("function"!=typeof r||"function"!=typeof n)return void Wg("original object and wrapper must be functions");const s=n(r,t);return Yg(s,"__original",r),Yg(s,"__unwrap",()=>{e[t]===s&&Yg(e,t,r)}),Yg(s,"__wrapped",!0),Yg(e,t,s),s},$g=(e,t,n)=>{if(!e)return Wg("must provide one or more modules to patch"),void Wg((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{Kg(e,t,n)})}):Wg("must provide one or more functions to wrap on modules")},Jg=(e,t)=>{if(!e||!e[t])return Wg("no function to unwrap."),void Wg((new Error).stack);const n=e[t];n.__unwrap?n.__unwrap():Wg("no original to unwrap to -- has "+String(t)+" already been unwrapped?")},Xg=(e,t)=>{if(!e)return Wg("must provide one or more modules to patch"),void Wg((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{Jg(e,t)})}):Wg("must provide one or more functions to unwrap on modules")};class qg{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(e,t,n){this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=Uu.createComponentLogger({namespace:e}),this._tracer=th.getTracer(e,t),this._meter=Vu.getMeter(e,t),this._logger=Gg.getLogger(e,t),this._updateMetricInstruments()}_wrap=Kg;_unwrap=Jg;_massWrap=$g;_massUnwrap=Xg;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){const e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:t},e)}}}class Qg extends qg{constructor(e,t,n){super(e,t,n),this._config.enabled&&this.enable()}}function em(e){return"function"==typeof e&&"function"==typeof e.__original&&"function"==typeof e.__unwrap&&!0===e.__wrapped}var tm;!function(e){e.EVENT_TYPE="event_type",e.TARGET_ELEMENT="target_element",e.TARGET_XPATH="target_xpath",e.HTTP_URL="http.url"}(tm||(tm={}));const nm="0.58.0",rm=["click"];function sm(){return!1}class om extends Qg{version=nm;moduleName="user-interaction";_spansData=new WeakMap;_wrappedListeners=new WeakMap;_eventsSpanMap=new WeakMap;_eventNames;_shouldPreventSpanCreation;constructor(e={}){super("@opentelemetry/instrumentation-user-interaction",nm,e),this._eventNames=new Set(e?.eventNames??rm),this._shouldPreventSpanCreation="function"==typeof e?.shouldPreventSpanCreation?e.shouldPreventSpanCreation:sm}init(){}_checkForTimeout(e,t){const n=this._spansData.get(t);n&&("setTimeout"===e.source?n.hrTimeLastTimeout=Lh():"Promise.then"!==e.source&&"setTimeout"!==e.source&&(n.hrTimeLastTimeout=void 0))}_allowEventName(e){return this._eventNames.has(e)}_createSpan(e,t,n){if(!(e instanceof HTMLElement))return;if(!e.getAttribute)return;if(e.hasAttribute("disabled"))return;if(!this._allowEventName(t))return;const r=qd(e);try{const s=this.tracer.startSpan(t,{attributes:{[tm.EVENT_TYPE]:t,[tm.TARGET_ELEMENT]:e.tagName,[tm.TARGET_XPATH]:r,[tm.HTTP_URL]:window.location.href}},n?th.setSpan(Bu.active(),n):void 0);if(!0===this._shouldPreventSpanCreation(t,e,s))return;return this._spansData.set(s,{taskCount:0}),s}catch(e){this._diag.error("failed to start create new user interaction span",e)}}_decrementTask(e){const t=this._spansData.get(e);t&&(t.taskCount--,0===t.taskCount&&this._tryToEndSpan(e,t.hrTimeLastTimeout))}_getCurrentSpan(e){const t=e.get("OT_ZONE_CONTEXT");return t?th.getSpan(t):t}_incrementTask(e){const t=this._spansData.get(e);t&&t.taskCount++}addPatchedListener(e,t,n,r){let s=this._wrappedListeners.get(n);s||(s=new Map,this._wrappedListeners.set(n,s));let o=s.get(t);return o||(o=new Map,s.set(t,o)),!o.has(e)&&(o.set(e,r),!0)}removePatchedListener(e,t,n){const r=this._wrappedListeners.get(n);if(!r)return;const s=r.get(t);if(!s)return;const o=s.get(e);return o&&(s.delete(e),0===s.size&&(r.delete(t),0===r.size&&this._wrappedListeners.delete(n))),o}_invokeListener(e,t,n){return"function"==typeof e?e.apply(t,n):e.handleEvent(n[0])}_patchAddEventListener(){const e=this;return t=>function(n,r,s){if(!r)return t.call(this,n,r,s);const o=s&&"object"==typeof s&&s.once,i=function(...t){let s;const i=t[0],a=i?.target;i&&(s=e._eventsSpanMap.get(i)),o&&e.removePatchedListener(this,n,r);const c=e._createSpan(a,n,s);return c?(i&&e._eventsSpanMap.set(i,c),Bu.with(th.setSpan(Bu.active(),c),()=>{const n=e._invokeListener(r,this,t);return c.end(),n})):e._invokeListener(r,this,t)};return e.addPatchedListener(this,n,r,i)?t.call(this,n,i,s):void 0}}_patchRemoveEventListener(){const e=this;return t=>function(n,r,s){const o=e.removePatchedListener(this,n,r);return o?t.call(this,n,o,s):t.call(this,n,r,s)}}_getPatchableEventTargets(){return window.EventTarget?[EventTarget.prototype]:[Node.prototype,Window.prototype]}_patchHistoryApi(){this._unpatchHistoryApi(),this._wrap(history,"replaceState",this._patchHistoryMethod()),this._wrap(history,"pushState",this._patchHistoryMethod()),this._wrap(history,"back",this._patchHistoryMethod()),this._wrap(history,"forward",this._patchHistoryMethod()),this._wrap(history,"go",this._patchHistoryMethod())}_patchHistoryMethod(){const e=this;return t=>function(...n){const r=`${location.pathname}${location.hash}${location.search}`,s=t.apply(this,n),o=`${location.pathname}${location.hash}${location.search}`;return r!==o&&e._updateInteractionName(o),s}}_unpatchHistoryApi(){em(history.replaceState)&&this._unwrap(history,"replaceState"),em(history.pushState)&&this._unwrap(history,"pushState"),em(history.back)&&this._unwrap(history,"back"),em(history.forward)&&this._unwrap(history,"forward"),em(history.go)&&this._unwrap(history,"go")}_updateInteractionName(e){const t=th.getSpan(Bu.active());t&&"function"==typeof t.updateName&&t.updateName(`Navigation: ${e}`)}_patchZoneCancelTask(){const e=this;return t=>function(n){const r=Zone.current,s=e._getCurrentSpan(r);return s&&e._shouldCountTask(n,r)&&e._decrementTask(s),t.call(this,n)}}_patchZoneScheduleTask(){const e=this;return t=>function(n){const r=Zone.current,s=e._getCurrentSpan(r);return s&&e._shouldCountTask(n,r)&&(e._incrementTask(s),e._checkForTimeout(n,s)),t.call(this,n)}}_patchZoneRunTask(){const e=this;return t=>function(n,r,s){const o=Array.isArray(s)&&s[0]instanceof Event?s[0]:void 0,i=o?.target;let a;const c=this;if(i){if(a=e._createSpan(i,n.eventName),a)return e._incrementTask(a),c.run(()=>{try{return Bu.with(th.setSpan(Bu.active(),a),()=>{const e=Zone.current;return n._zone=e,t.call(e,n,r,s)})}finally{e._decrementTask(a)}})}else a=e._getCurrentSpan(c);try{return t.call(c,n,r,s)}finally{a&&e._shouldCountTask(n,c)&&e._decrementTask(a)}}}_shouldCountTask(e,t){if(e._zone&&(t=e._zone),!t||!e.data||e.data.isPeriodic)return!1;const n=this._getCurrentSpan(t);return!!n&&(!!this._spansData.get(n)&&("macroTask"===e.type||"microTask"===e.type))}_tryToEndSpan(e,t){if(e){this._spansData.get(e)&&(e.end(t),this._spansData.delete(e))}}enable(){const e=this._getZoneWithPrototype();if(this._diag.debug("applying patch to",this.moduleName,this.version,"zone:",!!e),e)em(e.prototype.runTask)&&(this._unwrap(e.prototype,"runTask"),this._diag.debug("removing previous patch from method runTask")),em(e.prototype.scheduleTask)&&(this._unwrap(e.prototype,"scheduleTask"),this._diag.debug("removing previous patch from method scheduleTask")),em(e.prototype.cancelTask)&&(this._unwrap(e.prototype,"cancelTask"),this._diag.debug("removing previous patch from method cancelTask")),this._zonePatched=!0,this._wrap(e.prototype,"runTask",this._patchZoneRunTask()),this._wrap(e.prototype,"scheduleTask",this._patchZoneScheduleTask()),this._wrap(e.prototype,"cancelTask",this._patchZoneCancelTask());else{this._zonePatched=!1;this._getPatchableEventTargets().forEach(e=>{em(e.addEventListener)&&(this._unwrap(e,"addEventListener"),this._diag.debug("removing previous patch from method addEventListener")),em(e.removeEventListener)&&(this._unwrap(e,"removeEventListener"),this._diag.debug("removing previous patch from method removeEventListener")),this._wrap(e,"addEventListener",this._patchAddEventListener()),this._wrap(e,"removeEventListener",this._patchRemoveEventListener())})}this._patchHistoryApi()}disable(){const e=this._getZoneWithPrototype();if(this._diag.debug("removing patch from",this.moduleName,this.version,"zone:",!!e),e&&this._zonePatched)em(e.prototype.runTask)&&this._unwrap(e.prototype,"runTask"),em(e.prototype.scheduleTask)&&this._unwrap(e.prototype,"scheduleTask"),em(e.prototype.cancelTask)&&this._unwrap(e.prototype,"cancelTask");else{this._getPatchableEventTargets().forEach(e=>{em(e.addEventListener)&&this._unwrap(e,"addEventListener"),em(e.removeEventListener)&&this._unwrap(e,"removeEventListener")})}this._unpatchHistoryApi()}_getZoneWithPrototype(){return window.Zone}}class im{_delegate;constructor(e){this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}class am extends Error{code;name="OTLPExporterError";data;constructor(e,t,n){super(e),this.data=n,this.code=t}}function cm(e){if(Number.isFinite(e)&&e>0)return e;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function lm(e){if(null!=e)return()=>e}function um(e,t,n){return{timeoutMillis:cm(e.timeoutMillis??t.timeoutMillis??n.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??n.concurrencyLimit,compression:e.compression??t.compression??n.compression}}class hm{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(e);const t=()=>{const t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}function dm(e){return new hm(e.concurrencyLimit)}function pm(){return{handleResponse(e){null!=e&&function(e){return Object.prototype.hasOwnProperty.call(e,"partialSuccess")}(e)&&null!=e.partialSuccess&&0!==Object.keys(e.partialSuccess).length&&Uu.warn("Received Partial Success response:",JSON.stringify(e.partialSuccess))}}}class fm{_transport;_serializer;_responseHandler;_promiseQueue;_timeout;_diagLogger;constructor(e,t,n,r,s){this._transport=e,this._serializer=t,this._responseHandler=n,this._promiseQueue=r,this._timeout=s,this._diagLogger=Uu.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,t){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit())return void t({code:Yf.FAILED,error:new Error("Concurrent export limit reached")});const n=this._serializer.serializeRequest(e);null!=n?this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(e=>{if("success"!==e.status)"failure"===e.status&&e.error?t({code:Yf.FAILED,error:e.error}):"retryable"===e.status?t({code:Yf.FAILED,error:new am("Export failed with retryable status")}):t({code:Yf.FAILED,error:new am("Export failed with unknown error")});else{if(null!=e.data)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(t){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",t,e.data)}t({code:Yf.SUCCESS})}},e=>t({code:Yf.FAILED,error:e}))):t({code:Yf.FAILED,error:new Error("Nothing to send")})}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}function gm(e,t,n){return r={transport:n,serializer:t,promiseHandler:dm(e)},s={timeout:e.timeoutMillis},new fm(r.transport,r.serializer,pm(),r.promiseHandler,s.timeout);var r,s}function mm(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function ym(e){const t=new Uint8Array(e.length/2);let n=0;for(let r=0;r<e.length;r+=2){const s=mm(e.charCodeAt(r)),o=mm(e.charCodeAt(r+1));t[n++]=s<<4|o}return t}function vm(e){const t=BigInt(1e9);return BigInt(e[0])*t+BigInt(e[1])}const bm="undefined"!=typeof BigInt?function(e){return vm(e).toString()}:Wf;function wm(e){return e}const Cm={encodeHrTime:function(e){const t=vm(e);return n=t,{low:Number(BigInt.asUintN(32,n)),high:Number(BigInt.asUintN(32,n>>BigInt(32)))};var n},encodeSpanContext:ym,encodeOptionalSpanContext:function(e){if(void 0!==e)return ym(e)}};function Sm(e){return{attributes:Im(e.attributes),droppedAttributesCount:0}}function _m(e){return{name:e.name,version:e.version}}function Im(e){return Object.keys(e).map(t=>Em(t,e[t]))}function Em(e,t){return{key:e,value:Tm(t)}}function Tm(e){const t=typeof e;return"string"===t?{stringValue:e}:"number"===t?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:"boolean"===t?{boolValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{arrayValue:{values:e.map(Tm)}}:"object"===t&&null!=e?{kvlistValue:{values:Object.entries(e).map(([e,t])=>Em(e,t))}}:{}}function Am(e,t){const n=e.spanContext(),r=e.status,s=e.parentSpanContext?.spanId?t.encodeSpanContext(e.parentSpanContext?.spanId):void 0;return{traceId:t.encodeSpanContext(n.traceId),spanId:t.encodeSpanContext(n.spanId),parentSpanId:s,traceState:n.traceState?.serialize(),name:e.name,kind:null==e.kind?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:Im(e.attributes),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>function(e,t){return{attributes:e.attributes?Im(e.attributes):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:r.code,message:r.message},links:e.links.map(e=>function(e,t){return{attributes:e.attributes?Im(e.attributes):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0}}(e,t)),droppedLinksCount:e.droppedLinksCount}}function km(e,t){const n=function(e){return void 0===e?Cm:{encodeHrTime:bm,encodeSpanContext:wm,encodeOptionalSpanContext:wm}}(t);return{resourceSpans:Om(e,n)}}function Om(e,t){const n=function(e){const t=new Map;for(const n of e){let e=t.get(n.resource);e||(e=new Map,t.set(n.resource,e));const r=`${n.instrumentationScope.name}@${n.instrumentationScope.version||""}:${n.instrumentationScope.schemaUrl||""}`;let s=e.get(r);s||(s=[],e.set(r,s)),s.push(n)}return t}(e),r=[],s=n.entries();let o=s.next();for(;!o.done;){const[e,n]=o.value,i=[],a=n.values();let c=a.next();for(;!c.done;){const e=c.value;if(e.length>0){const n=e.map(e=>Am(e,t));i.push({scope:_m(e[0].instrumentationScope),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=a.next()}const l={resource:Sm(e),scopeSpans:i,schemaUrl:void 0};r.push(l),o=s.next()}return r}const Rm={serializeRequest:e=>{const t=km(e,{});return(new TextEncoder).encode(JSON.stringify(t))},deserializeResponse:e=>{if(0===e.length)return{};const t=new TextDecoder;return JSON.parse(t.decode(e))}};function xm(){return.4*Math.random()-.2}class Nm{_transport;constructor(e){this._transport=e}retry(e,t,n){return new Promise((r,s)=>{setTimeout(()=>{this._transport.send(e,t).then(r,s)},n)})}async send(e,t){const n=Date.now()+t;let r=await this._transport.send(e,t),s=5,o=1e3;for(;"retryable"===r.status&&s>0;){s--;const t=Math.max(Math.min(o,5e3)+xm(),0);o*=1.5;const i=r.retryInMillis??t,a=n-Date.now();if(i>a)return r;r=await this.retry(e,a,i)}return r}shutdown(){return this._transport.shutdown()}}function Lm(e){return new Nm(e.transport)}function Mm(e){if(null==e)return;const t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?1e3*t:-1;const n=new Date(e).getTime()-Date.now();return n>=0?n:0}class Pm{_parameters;constructor(e){this._parameters=e}send(e,t){return new Promise(n=>{const r=new XMLHttpRequest;r.timeout=t,r.open("POST",this._parameters.url);const s=this._parameters.headers();Object.entries(s).forEach(([e,t])=>{r.setRequestHeader(e,t)}),r.ontimeout=e=>{n({status:"failure",error:new Error("XHR request timed out")})},r.onreadystatechange=()=>{var e;r.status>=200&&r.status<=299?(Uu.debug("XHR success"),n({status:"success"})):r.status&&(e=r.status,[429,502,503,504].includes(e))?n({status:"retryable",retryInMillis:Mm(r.getResponseHeader("Retry-After"))}):0!==r.status&&n({status:"failure",error:new Error("XHR request failed with non-retryable status")})},r.onabort=()=>{n({status:"failure",error:new Error("XHR request aborted")})},r.onerror=()=>{n({status:"failure",error:new Error("XHR request errored")})},r.send(e)})}shutdown(){}}class Dm{_params;constructor(e){this._params=e}send(e){return new Promise(t=>{navigator.sendBeacon(this._params.url,new Blob([e],{type:this._params.blobType}))?(Uu.debug("SendBeacon success"),t({status:"success"})):t({status:"failure",error:new Error("SendBeacon failed")})})}shutdown(){}}function Fm(e,t,n){const r={...n()},s={};return()=>(null!=t&&Object.assign(s,t()),null!=e&&Object.assign(s,e()),Object.assign(s,r))}function Bm(e){if(null!=e)try{return new URL(e),e}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function Um(e,t,n){return r={url:e.url,timeoutMillis:e.timeoutMillis,headers:lm(e.headers),concurrencyLimit:e.concurrencyLimit},s={},o=function(e,t){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none",headers:()=>e,url:"http://localhost:4318/"+t,agentOptions:{keepAlive:!0}}}(n,t),{...um(r,s,o),headers:Fm((i=r.headers,()=>{const e={};return Object.entries(i?.()??{}).forEach(([t,n])=>{void 0!==n?e[t]=String(n):Uu.warn(`Header "${t}" has invalid value (${n}) and will be ignored`)}),e}),s.headers,o.headers),url:Bm(r.url)??s.url??o.url,agentOptions:r.agentOptions??s.agentOptions??o.agentOptions};var r,s,o,i}function jm(e,t,n,r){const s=!!e.headers||"function"!=typeof navigator.sendBeacon,o=Um(e,n,r);return s?function(e,t){return gm(e,t,Lm({transport:(n=e,new Pm(n))}));var n}(o,t):function(e,t){return gm(e,t,Lm({transport:(n={url:e.url,blobType:e.headers()["Content-Type"]},new Dm(n))}));var n}(o,t)}class Zm extends im{constructor(e={}){super(jm(e,Rm,"v1/traces",{"Content-Type":"application/json"}))}}const zm="monoscope";function Vm(e){try{const t=new URL(e,"undefined"!=typeof location?location.href:"http://_");return t.pathname+(t.search?"?…":"")}catch{return e.slice(0,80)}}function Hm(){try{if("undefined"!=typeof crypto&&crypto.randomUUID)return crypto.randomUUID()}catch{}const e=new Uint8Array(16);try{crypto.getRandomValues(e)}catch{for(let t=0;t<16;t++)e[t]=256*Math.random()|0}e[6]=15&e[6]|64,e[8]=63&e[8]|128;const t=Array.from(e,e=>e.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}class Gm{constructor(e,t,n){this.pageviewId="",this.processor=null,this.longTaskObserver=null,this.resourceObserver=null,this._enabled=!0,this._configured=!1,this._firstExportLogged=!1,this.routeSpan=null,this.routeContext=null,this.routeIdleTimer=null,this.flushOnHideHandler=null,this.visibilityHandler=null,this.onExportStatus=null,this.onSpanStart=null,this.config=e,this.sessionId=t,this.tabId=n,this.provider=this.createProvider()}createProvider(){const{serviceName:e,resourceAttributes:t={},exporterEndpoint:n}=this.config,r=this.config.apiKey||this.config.projectId||"",s=this,o=new Zm({url:n||"https://otelcol.monoscope.tech/v1/traces",headers:{"x-api-key":r}}),i=Object.create(o,{export:{value:(e,t)=>o.export(e,e=>{if(!s._firstExportLogged){s._firstExportLogged=!0;const t=0===e.code;if(s.config.debug&&(console.log(t?"%c[Monoscope] ✓ First trace sent successfully":"%c[Monoscope] ✗ First trace export failed",t?"color: #22c55e; font-weight: bold":"color: #ef4444; font-weight: bold",t?"":e.error||""),!t)){const t=String(e.error||"");t.includes("401")||t.includes("403")?console.warn("[Monoscope] Authentication failed. Your apiKey may be invalid."):console.warn("[Monoscope] Could not reach Monoscope endpoint. Check your apiKey and network.")}s.onExportStatus?.(t)}t(e)})}}),a=new xd(i);this.processor=a;const c={onStart:()=>{try{s.onSpanStart?.()}catch{}},onEnd:()=>{},shutdown:()=>Promise.resolve(),forceFlush:()=>Promise.resolve()};return new Kd({resource:yd({[Sh]:e,"x-api-key":r,...t}),spanProcessors:[a,c]})}commonAttrs(){const e={"session.id":this.sessionId,"tab.id":this.tabId,"pageview.id":this.pageviewId,"page.url":location.href,"page.title":document.title};return document.referrer&&(e["page.referrer"]=document.referrer),e}applyCommonAttrs(e){for(const[t,n]of Object.entries(this.commonAttrs()))e.setAttribute(t,n);if(this.config.user)for(const[t,n]of Object.entries(this.config.user))void 0!==n&&e.setAttribute(`user.${t}`,n)}configure(){if("undefined"==typeof window||this._configured)return;this._configured=!0;const e=Math.max(0,Math.min(1,this.config.sampleRate??1));let t;try{const n=sessionStorage.getItem("monoscope-sampled");"1"===n||"0"===n?t="1"===n:(t=Math.random()<e,sessionStorage.setItem("monoscope-sampled",t?"1":"0"))}catch{t=Math.random()<e}if(!t)return this._enabled=!1,void(this.config.debug&&console.log("MonoscopeOTel: sampled out"));this.pageviewId=Hm(),this.provider.register({contextManager:new Ep,propagator:new Yh});const n=this.config.propagateTraceHeaderCorsUrls||[new RegExp(`^${location.origin}`)],r=[/^https?:\/\/(?:[^\/]+\.)?apitoolkit\.io\//,/^https?:\/\/(?:[^\/]+\.)?monoscope\.tech\//],s=(e,t,n)=>{this.applyCommonAttrs(e),e.setAttribute("monoscope.kind",t),n&&e.setAttribute("monoscope.display.label",n)},o=!1!==this.config.enableUserInteraction?[new om({eventNames:["click","submit"],shouldPreventSpanCreation:(e,t,n)=>(s(n,"interaction",`${e} · ${function(e){const t=e;if(!t||!t.tagName)return"?";const n=t.getAttribute?.("aria-label");if(n)return n;const r=(t.textContent||"").trim().replace(/\s+/g," ").slice(0,40);if(r)return r;const s=t.id?`#${t.id}`:"",o=(t.getAttribute?.("class")||"").split(" ").filter(Boolean)[0];return`${t.tagName.toLowerCase()}${s}${o?`.${o}`:""}`}(t)}`),!1)})]:[];!function(e){const t=e.tracerProvider||th.getTracerProvider(),n=e.meterProvider||Vu.getMeterProvider(),r=e.loggerProvider||ap.getLoggerProvider(),s=e.instrumentations?.flat()??[];(function(e,t,n,r){for(let s=0,o=e.length;s<o;s++){const o=e[s];t&&o.setTracerProvider(t),n&&o.setMeterProvider(n),r&&o.setLoggerProvider&&o.setLoggerProvider(r),o.getConfig().enabled||o.enable()}})(s,t,n,r)}({tracerProvider:this.provider,instrumentations:[...this.config.instrumentations||[],new _p({ignoreNetworkEvents:!this.config.enableNetworkEvents,applyCustomAttributesOnSpan:{documentLoad:e=>s(e,"page_load",`Page · ${Vm(location.href)}`),resourceFetch:e=>s(e,"resource")}}),new gg({propagateTraceHeaderCorsUrls:n,ignoreUrls:r,applyCustomAttributesOnSpan:(e,t)=>{const n=t.responseURL;s(e,"network",n?`XHR · ${Vm(n)}`:void 0)}}),new Dg({propagateTraceHeaderCorsUrls:n,ignoreUrls:r,applyCustomAttributesOnSpan:(e,t)=>{let n,r="GET";"string"==typeof t?n=t:t&&"string"==typeof t.url?(n=t.url,r=t.method||"GET"):t&&"string"==typeof t.method&&(r=t.method),s(e,"network",n?`${r} · ${Vm(n)}`:void 0)}}),...o]}),!1!==this.config.captureLongTasks&&this.observeLongTasks(),this.config.captureResourceTiming&&this.observeResourceTiming(),this.installFlushOnHide()}getPageviewId(){return this.pageviewId}rotatePageview(){return this.pageviewId=Hm(),this.pageviewId}startRouteChange(e,t,n){try{this.endRouteChange(),this.rotatePageview();const r=th.getTracer(zm).startSpan("route.change",{attributes:{"navigation.from":e,"navigation.to":t,"navigation.method":n,"monoscope.kind":"navigation","monoscope.display.label":`Nav · ${Vm(e)} → ${Vm(t)}`}});this.applyCommonAttrs(r),this.routeSpan=r,this.routeContext=th.setSpan(Bu.active(),r),this.routeIdleTimer=setTimeout(()=>{try{this.endRouteChange()}catch(e){this.config.debug&&console.warn("Monoscope: route idle close failed",e)}},3e3)}catch(e){this.config.debug&&console.warn("Monoscope: startRouteChange failed",e),this.routeSpan=null,this.routeContext=null,this.routeIdleTimer=null}}endRouteChange(){this.routeIdleTimer&&(clearTimeout(this.routeIdleTimer),this.routeIdleTimer=null),this.routeSpan?.end(),this.routeSpan=null,this.routeContext=null}installFlushOnHide(){const e=()=>{try{this.endRouteChange(),this.processor?.forceFlush().catch(()=>{})}catch(e){this.config.debug&&console.warn("Monoscope: flush on hide failed",e)}};this.flushOnHideHandler=e,this.visibilityHandler=()=>{"hidden"===document.visibilityState&&e()},window.addEventListener("pagehide",this.flushOnHideHandler),document.addEventListener("visibilitychange",this.visibilityHandler)}withActiveContext(e){return this.routeContext?Bu.with(this.routeContext,e):e()}emitSpan(e,t,n){try{const r=th.getTracer(zm);this.withActiveContext(()=>r.startActiveSpan(e,e=>{this.applyCommonAttrs(e);for(const[n,r]of Object.entries(t))e.setAttribute(n,r);n?.(e),e.end()}))}catch(t){this.config.debug&&console.warn("Monoscope: span emit failed for",e,t)}}observeLongTasks(){if("undefined"!=typeof PerformanceObserver)try{this.longTaskObserver=new PerformanceObserver(e=>{if(this._enabled)for(const t of e.getEntries())try{const e={"longtask.duration":t.duration,"longtask.name":t.name,"monoscope.kind":"long_task","monoscope.display.label":`Long task · ${Math.round(t.duration)}ms`},n=t.attribution;n?.[0]?.containerSrc&&(e["longtask.script"]=n[0].containerSrc),n?.[0]?.containerName&&(e["longtask.container"]=n[0].containerName),this.emitSpan("longtask",e)}catch(e){this.config.debug&&console.warn("Monoscope: failed to process longtask entry",e)}}),this.longTaskObserver.observe({type:"longtask",buffered:!0})}catch(e){console.warn("Monoscope: longtask observation not supported",e)}}observeResourceTiming(){if("undefined"==typeof PerformanceObserver)return;const e=this.config.resourceTimingThresholdMs??200;try{this.resourceObserver=new PerformanceObserver(t=>{if(this._enabled)for(const n of t.getEntries())if(!(n.duration<e))try{const e=n,t=e.name.split("?")[0].split("/").pop()||e.name;this.emitSpan("resource",{"resource.name":e.name,"resource.duration":e.duration,"resource.type":e.initiatorType,"resource.transferSize":e.transferSize,"resource.encodedBodySize":e.encodedBodySize,"monoscope.kind":"resource","monoscope.display.label":`${e.initiatorType} · ${t}`})}catch(e){this.config.debug&&console.warn("Monoscope: failed to process resource entry",e)}}),this.resourceObserver.observe({type:"resource",buffered:!1})}catch(e){console.warn("Monoscope: resource timing not supported",e)}}startSpan(e,t){const n=th.getTracer(zm);return this.withActiveContext(()=>n.startActiveSpan(e,e=>{this.applyCommonAttrs(e);try{const n=t(e);return n instanceof Promise?n.then(t=>(e.end(),t),t=>{throw e.setStatus({code:Fu.ERROR,message:String(t)}),e.end(),t}):(e.end(),n)}catch(t){throw e.setStatus({code:Fu.ERROR,message:String(t)}),e.end(),t}}))}recordEvent(e,t={}){this.emitSpan(e,t)}async forceFlush(){await(this.processor?.forceFlush())}updateSessionId(e){this.sessionId=e}setEnabled(e){this._enabled=e}async shutdown(){this.longTaskObserver?.disconnect(),this.resourceObserver?.disconnect(),this.endRouteChange(),this.flushOnHideHandler&&(window.removeEventListener("pagehide",this.flushOnHideHandler),this.flushOnHideHandler=null),this.visibilityHandler&&(document.removeEventListener("visibilitychange",this.visibilityHandler),this.visibilityHandler=null),this._configured=!1,await this.provider.shutdown()}setUser(e){this.config={...this.config,user:{...this.config.user,...e}}}}const Wm=[];function Ym(e){Wm.push({...e,timestamp:Date.now()}),Wm.length>20&&Wm.shift()}function Km(e){try{return JSON.stringify(e)}catch{return`[unserializable: ${typeof e}]`}}class $m{constructor(e){this.errorCount=0,this._active=!1,this.prevOnError=null,this.onUnhandledRejection=null,this.origConsoleError=null,this._processing=!1,this.emit=e}createErrorSpan(e,t,n){this.errorCount++;const r=Wm.slice(),s=String(n["error.name"]||t),o=String(n["error.message"]||"").replace(/\s+/g," ").slice(0,80);this.emit(e,{"error.type":t,"error.count":this.errorCount,"monoscope.kind":"error","monoscope.display.label":o?`${s} · ${o}`:s,...n},e=>{e.setStatus({code:Fu.ERROR}),r.length>0&&e.setAttribute("breadcrumbs",Km(r))})}start(){"undefined"==typeof window||this._active||(this._active=!0,this.prevOnError=window.onerror,window.onerror=(e,t,n,r,s)=>{const o={"error.message":"string"==typeof e?e:e.type};if(t&&(o["error.source"]=t),void 0!==n&&(o["error.lineno"]=n),void 0!==r&&(o["error.colno"]=r),s?.stack&&(o["error.stack"]=s.stack),s?.name&&(o["error.name"]=s.name),this.createErrorSpan("exception","uncaught_exception",o),"function"==typeof this.prevOnError)return this.prevOnError.call(window,e,t,n,r,s)},this.onUnhandledRejection=e=>{const t=e.reason,n={};t instanceof Error?(n["error.message"]=t.message,n["error.name"]=t.name,t.stack&&(n["error.stack"]=t.stack)):n["error.message"]=String(t),this.createErrorSpan("unhandled_rejection","unhandled_rejection",n)},this.origConsoleError=console.error,console.error=(...e)=>{if(this.origConsoleError?.apply(console,e),!this._processing){this._processing=!0;try{const t=e.map(e=>e instanceof Error?e.message:"string"==typeof e?e:Km(e)).join(" "),n={"error.message":t},r=e.find(e=>e instanceof Error);r&&(n["error.name"]=r.name,r.stack&&(n["error.stack"]=r.stack)),Ym({type:"console.error",message:t}),this.createErrorSpan("console.error","console_error",n)}finally{this._processing=!1}}},window.addEventListener("unhandledrejection",this.onUnhandledRejection))}stop(){"undefined"!=typeof window&&this._active&&(this._active=!1,window.onerror=this.prevOnError,this.prevOnError=null,this.onUnhandledRejection&&window.removeEventListener("unhandledrejection",this.onUnhandledRejection),this.origConsoleError&&(console.error=this.origConsoleError,this.origConsoleError=null))}getErrorCount(){return this.errorCount}}class Jm{constructor(e){this._enabled=!0,this._active=!1,this.emit=e}async start(){if("undefined"!=typeof window&&!this._active){this._active=!0;try{const{onCLS:e,onINP:t,onLCP:n,onFCP:r,onTTFB:s}=await Promise.resolve().then(function(){return qy}),o=e=>{if(!this._enabled)return;const t="CLS"===e.name?"":"ms",n="CLS"===e.name?e.value.toFixed(3):Math.round(e.value);this.emit(`web-vital.${e.name}`,{"vital.name":e.name,"vital.value":e.value,"vital.rating":e.rating,"vital.id":e.id,"vital.navigationType":e.navigationType,"monoscope.kind":"web_vital","monoscope.display.label":`${e.name} · ${n}${t} (${e.rating})`})};[e,t,n,r,s].forEach(e=>e(o))}catch(e){console.warn("Monoscope: web-vitals collection failed to initialize",e)}}}setEnabled(e){this._enabled=e}}class Xm{constructor(e){this.currentUrl="",this._active=!1,this.origPushState=null,this.origReplaceState=null,this.popstateHandler=null,this.onNavigation=e}start(){if("undefined"==typeof window||this._active)return;this._active=!0,this.currentUrl=location.href,this.origPushState=history.pushState.bind(history),this.origReplaceState=history.replaceState.bind(history);const e=e=>{try{const t=this.currentUrl,n=location.href;if(t===n)return;this.currentUrl=n,Ym({type:"navigation",message:`${t} → ${n}`,data:{method:e}}),this.onNavigation(t,n,e)}catch(e){try{console.warn("Monoscope: error in navigation tracking",e)}catch{}}};history.pushState=(...t)=>{this.origPushState(...t),e("pushState")},history.replaceState=(...t)=>{this.origReplaceState(...t),e("replaceState")},this.popstateHandler=()=>e("popstate"),window.addEventListener("popstate",this.popstateHandler)}stop(){"undefined"!=typeof window&&this._active&&(this._active=!1,this.origPushState&&(history.pushState=this.origPushState),this.origReplaceState&&(history.replaceState=this.origReplaceState),this.popstateHandler&&window.removeEventListener("popstate",this.popstateHandler),this.origPushState=null,this.origReplaceState=null,this.popstateHandler=null)}}const qm="monoscope-overlay-dismissed";class Qm{constructor(){if(this.el=null,this.eventCount=0,this.statusDot=null,this.countEl=null,this.connEl=null,"undefined"!=typeof document){try{if(sessionStorage.getItem(qm))return}catch{}this.mount()}}mount(){const e=document.createElement("div");Object.assign(e.style,{position:"fixed",bottom:"12px",right:"12px",zIndex:"2147483647",background:"#1a1a2e",color:"#e0e0e0",fontFamily:"system-ui, sans-serif",fontSize:"12px",padding:"6px 10px",borderRadius:"6px",boxShadow:"0 2px 8px rgba(0,0,0,0.3)",display:"flex",alignItems:"center",gap:"6px",cursor:"default",userSelect:"none"}),this.statusDot=document.createElement("span"),Object.assign(this.statusDot.style,{width:"7px",height:"7px",borderRadius:"50%",background:"#22c55e",display:"inline-block"}),this.countEl=document.createElement("span"),this.countEl.textContent="0",this.countEl.style.opacity="0.7",this.connEl=document.createElement("span"),this.connEl.style.opacity="0.7";const t=document.createElement("span");t.textContent="×",Object.assign(t.style,{cursor:"pointer",marginLeft:"4px",opacity:"0.6",fontSize:"14px"}),t.onclick=()=>this.dismiss(),e.append(this.statusDot," Monoscope ",this.countEl," ",this.connEl,t),this.el=e,(document.body||document.documentElement).appendChild(e)}incrementEvents(){this.eventCount++,this.countEl&&(this.countEl.textContent=String(this.eventCount))}setConnectionStatus(e){this.connEl&&(this.connEl.textContent=e?"Connected":"Connection failed"),this.statusDot&&(this.statusDot.style.background=e?"#22c55e":"#ef4444")}dismiss(){this.el?.remove(),this.el=null;try{sessionStorage.setItem(qm,"1")}catch{}}}const ey=18e5,ty="monoscope-last-activity",ny="undefined"!=typeof window;var ry,sy,oy,iy,ay,cy=-1,ly=function(e){addEventListener("pageshow",function(t){t.persisted&&(cy=t.timeStamp,e(t))},!0)},uy=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},hy=function(){var e=uy();return e&&e.activationStart||0},dy=function(e,t){var n=uy(),r="navigate";return cy>=0?r="back-forward-cache":n&&(document.prerendering||hy()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},py=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver(function(e){Promise.resolve().then(function(){t(e.getEntries())})});return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},fy=function(e,t,n,r){var s,o;return function(i){t.value>=0&&(i||r)&&((o=t.value-(s||0))||void 0===s)&&(s=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},gy=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},my=function(e){document.addEventListener("visibilitychange",function(){"hidden"===document.visibilityState&&e()})},yy=function(e){var t=!1;return function(){t||(e(),t=!0)}},vy=-1,by=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},wy=function(e){"hidden"===document.visibilityState&&vy>-1&&(vy="visibilitychange"===e.type?e.timeStamp:0,Sy())},Cy=function(){addEventListener("visibilitychange",wy,!0),addEventListener("prerenderingchange",wy,!0)},Sy=function(){removeEventListener("visibilitychange",wy,!0),removeEventListener("prerenderingchange",wy,!0)},_y=function(){return vy<0&&(vy=by(),Cy(),ly(function(){setTimeout(function(){vy=by(),Cy()},0)})),{get firstHiddenTime(){return vy}}},Iy=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},Ey=[1800,3e3],Ty=function(e,t){t=t||{},Iy(function(){var n,r=_y(),s=dy("FCP"),o=py("paint",function(e){e.forEach(function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<r.firstHiddenTime&&(s.value=Math.max(e.startTime-hy(),0),s.entries.push(e),n(!0)))})});o&&(n=fy(e,s,Ey,t.reportAllChanges),ly(function(r){s=dy("FCP"),n=fy(e,s,Ey,t.reportAllChanges),gy(function(){s.value=performance.now()-r.timeStamp,n(!0)})}))})},Ay=[.1,.25],ky=0,Oy=1/0,Ry=0,xy=function(e){e.forEach(function(e){e.interactionId&&(Oy=Math.min(Oy,e.interactionId),Ry=Math.max(Ry,e.interactionId),ky=Ry?(Ry-Oy)/7+1:0)})},Ny=function(){return ry?ky:performance.interactionCount||0},Ly=function(){"interactionCount"in performance||ry||(ry=py("event",xy,{type:"event",buffered:!0,durationThreshold:0}))},My=[],Py=new Map,Dy=0,Fy=[],By=function(e){if(Fy.forEach(function(t){return t(e)}),e.interactionId||"first-input"===e.entryType){var t=My[My.length-1],n=Py.get(e.interactionId);if(n||My.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};Py.set(r.id,r),My.push(r)}My.sort(function(e,t){return t.latency-e.latency}),My.length>10&&My.splice(10).forEach(function(e){return Py.delete(e.id)})}}},Uy=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=yy(e),"hidden"===document.visibilityState?e():(n=t(e),my(e)),n},jy=[200,500],Zy=[2500,4e3],zy={},Vy=[800,1800],Hy=function e(t){document.prerendering?Iy(function(){return e(t)}):"complete"!==document.readyState?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},Gy={passive:!0,capture:!0},Wy=new Date,Yy=function(e,t){sy||(sy=t,oy=e,iy=new Date,Jy(removeEventListener),Ky())},Ky=function(){if(oy>=0&&oy<iy-Wy){var e={entryType:"first-input",name:sy.type,target:sy.target,cancelable:sy.cancelable,startTime:sy.timeStamp,processingStart:sy.timeStamp+oy};ay.forEach(function(t){t(e)}),ay=[]}},$y=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){Yy(e,t),s()},r=function(){s()},s=function(){removeEventListener("pointerup",n,Gy),removeEventListener("pointercancel",r,Gy)};addEventListener("pointerup",n,Gy),addEventListener("pointercancel",r,Gy)}(t,e):Yy(t,e)}},Jy=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach(function(t){return e(t,$y,Gy)})},Xy=[100,300],qy=Object.freeze({__proto__:null,CLSThresholds:Ay,FCPThresholds:Ey,FIDThresholds:Xy,INPThresholds:jy,LCPThresholds:Zy,TTFBThresholds:Vy,onCLS:function(e,t){t=t||{},Ty(yy(function(){var n,r=dy("CLS",0),s=0,o=[],i=function(e){e.forEach(function(e){if(!e.hadRecentInput){var t=o[0],n=o[o.length-1];s&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(s+=e.value,o.push(e)):(s=e.value,o=[e])}}),s>r.value&&(r.value=s,r.entries=o,n())},a=py("layout-shift",i);a&&(n=fy(e,r,Ay,t.reportAllChanges),my(function(){i(a.takeRecords()),n(!0)}),ly(function(){s=0,r=dy("CLS",0),n=fy(e,r,Ay,t.reportAllChanges),gy(function(){return n()})}),setTimeout(n,0))}))},onFCP:Ty,onFID:function(e,t){t=t||{},Iy(function(){var n,r=_y(),s=dy("FID"),o=function(e){e.startTime<r.firstHiddenTime&&(s.value=e.processingStart-e.startTime,s.entries.push(e),n(!0))},i=function(e){e.forEach(o)},a=py("first-input",i);n=fy(e,s,Xy,t.reportAllChanges),a&&(my(yy(function(){i(a.takeRecords()),a.disconnect()})),ly(function(){var r;s=dy("FID"),n=fy(e,s,Xy,t.reportAllChanges),ay=[],oy=-1,sy=null,Jy(addEventListener),r=o,ay.push(r),Ky()}))})},onINP:function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},Iy(function(){var n;Ly();var r,s=dy("INP"),o=function(e){Uy(function(){e.forEach(By);var t=function(){var e=Math.min(My.length-1,Math.floor((Ny()-Dy)/50));return My[e]}();t&&t.latency!==s.value&&(s.value=t.latency,s.entries=t.entries,r())})},i=py("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});r=fy(e,s,jy,t.reportAllChanges),i&&(i.observe({type:"first-input",buffered:!0}),my(function(){o(i.takeRecords()),r(!0)}),ly(function(){Dy=Ny(),My.length=0,Py.clear(),s=dy("INP"),r=fy(e,s,jy,t.reportAllChanges)}))}))},onLCP:function(e,t){t=t||{},Iy(function(){var n,r=_y(),s=dy("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach(function(e){e.startTime<r.firstHiddenTime&&(s.value=Math.max(e.startTime-hy(),0),s.entries=[e],n())})},i=py("largest-contentful-paint",o);if(i){n=fy(e,s,Zy,t.reportAllChanges);var a=yy(function(){zy[s.id]||(o(i.takeRecords()),i.disconnect(),zy[s.id]=!0,n(!0))});["keydown","click"].forEach(function(e){addEventListener(e,function(){return Uy(a)},{once:!0,capture:!0})}),my(a),ly(function(r){s=dy("LCP"),n=fy(e,s,Zy,t.reportAllChanges),gy(function(){s.value=performance.now()-r.timeStamp,zy[s.id]=!0,n(!0)})})}})},onTTFB:function(e,t){t=t||{};var n=dy("TTFB"),r=fy(e,n,Vy,t.reportAllChanges);Hy(function(){var s=uy();s&&(n.value=Math.max(s.responseStart-hy(),0),n.entries=[s],r(!0),ly(function(){n=dy("TTFB",0),(r=fy(e,n,Vy,t.reportAllChanges))(!0)}))})}});return class{constructor(e){this.overlay=null;const t=e.apiKey||e.projectId;if(!t)throw new Error("MonoscopeConfig must include apiKey (or projectId)");e.projectId&&!e.apiKey&&e.debug&&console.warn("[Monoscope] `projectId` is deprecated. Use `apiKey` instead."),e={...e,apiKey:t,projectId:t};const n=ny&&("localhost"===location.hostname||"127.0.0.1"===location.hostname);void 0===e.debug&&n&&(e={...e,debug:!0}),e.serviceName||(e={...e,serviceName:ny?location.hostname:"unknown"}),this.config=e,this._enabled=!1!==e.enabled,this.tabId=ny?this.resolveTabId():Hm(),this.sessionId=ny?this.resolveSessionId():Hm(),this.lastActivityTime=Date.now(),ny&&this.persistActivity(),this.replay=new Rl(e,this.sessionId,this.tabId),this.otel=new Gm(e,this.sessionId,this.tabId);const r=(...e)=>this.otel.emitSpan(...e);this.errors=new $m(r),this.vitals=new Jm(r),this.router=new Xm((e,t,n)=>this.otel.startRouteChange(e,t,n)),this._enabled&&(this.otel.configure(),this.replay.configure(),this.errors.start(),this.vitals.start().catch(e=>{this.config.debug&&console.warn("Monoscope: web-vitals init failed",e)}),this.router.start()),this._enabled&&this.config.debug&&(this.logInitBanner(),ny&&(this.overlay=new Qm,this.otel.onExportStatus=e=>this.overlay?.setConnectionStatus(e),this.otel.onSpanStart=()=>this.overlay?.incrementEvents())),ny&&this.setupActivityTracking()}logInitBanner(){const e=this.config,t=e.exporterEndpoint||"https://otelcol.monoscope.tech/v1/traces",n=Math.round(100*(e.sampleRate??1)),r=Math.round(100*(e.replaySampleRate??1));console.groupCollapsed("%c[Monoscope] ✓ Initialized","color: #22c55e; font-weight: bold"),console.log(` API Key: ${e.apiKey}`),console.log(` Service: ${e.serviceName}`),console.log(` Session: ${this.sessionId}`),console.log(` Tracing: ✓ (sample rate: ${n}%)`),console.log(` Replay: ✓ (sample rate: ${r}%)`),console.log(" Errors: ✓"),console.log(` Endpoint: ${t}`),console.groupEnd()}resolveSessionId(){try{const e=sessionStorage.getItem("monoscope-session-id"),t=sessionStorage.getItem(ty);if(e&&t){if(Date.now()-parseInt(t,10)<ey)return e}const n=Hm();return sessionStorage.setItem("monoscope-session-id",n),n}catch(e){return this.config.debug&&console.warn("Monoscope: sessionStorage unavailable, using ephemeral session",e),Hm()}}resolveTabId(){try{const e=sessionStorage.getItem("monoscope-tab-id");if(e)return e;const t=Hm();return sessionStorage.setItem("monoscope-tab-id",t),t}catch{return Hm()}}persistActivity(){try{sessionStorage.setItem(ty,Date.now().toString())}catch(e){this.config.debug&&console.warn("Monoscope: failed to persist activity",e)}}rotateSession(){this.replay.save().catch(e=>{this.config.debug&&console.warn("Monoscope: failed to save replay on session rotation",e)}),Wm.length=0,this.sessionId=Hm();try{sessionStorage.setItem("monoscope-session-id",this.sessionId)}catch(e){this.config.debug&&console.warn("Monoscope: failed to persist session ID",e)}this.replay.updateSessionId(this.sessionId),this.otel.updateSessionId(this.sessionId),this.config.debug&&console.log("Monoscope: session rotated due to inactivity")}checkAndRefreshSession(){const e=Date.now();e-this.lastActivityTime>=ey&&this.rotateSession(),this.lastActivityTime=e,this.persistActivity()}setupActivityTracking(){document.addEventListener("visibilitychange",()=>{"visible"===document.visibilityState&&this.checkAndRefreshSession()});let e=Date.now();const t=()=>{const t=Date.now();t-e>5e3&&(e=t,this.lastActivityTime=t,this.persistActivity())};document.addEventListener("click",e=>{t();const n=e.target;if(!n)return;const r=n.tagName?.toLowerCase()||"",s=(n.textContent||"").trim().slice(0,50),o=n.getAttribute("class")||"";Ym({type:"click",message:`${r} "${s}"`,data:{selector:n.id?`#${n.id}`:o?`.${o.split(" ")[0]}`:r}})},{capture:!0,passive:!0}),document.addEventListener("keydown",t,{capture:!0,passive:!0})}getSessionId(){return this.sessionId}getTabId(){return this.tabId}setUser(e){if(this.config.debug){const t=new Set(["email","full_name","name","id","roles"]),n=Object.keys(e).filter(e=>!t.has(e));n.length&&console.warn(`Monoscope: unknown user attributes will be sent to collectors: ${n.join(", ")}`)}this.otel.setUser(e),this.replay.setUser(e)}startSpan(e,t){return this.otel.startSpan(e,t)}recordEvent(e,t){this.otel.recordEvent(e,t)}async test(){try{this.otel.emitSpan("monoscope.test",{"test.timestamp":Date.now()}),await this.otel.forceFlush();const e="Test span sent successfully.";return this.config.debug&&console.log(`[Monoscope] ${e}`),{success:!0,message:e}}catch(e){const t=`Test failed: ${e}`;return this.config.debug&&console.error(`[Monoscope] ${t}`),{success:!1,message:t}}}disable(){this._enabled=!1,this.replay.setEnabled(!1),this.otel.setEnabled(!1),this.vitals.setEnabled(!1),this.errors.stop(),this.router.stop()}enable(){this._enabled=!0,this.otel.setEnabled(!0),this.otel.configure(),this.replay.setEnabled(!0),this.replay.configure(),this.vitals.setEnabled(!0),this.vitals.start().catch(()=>{}),this.errors.start(),this.router.start()}isEnabled(){return this._enabled}async destroy(){this.errors.stop(),this.router.stop(),this.replay.stop(),this.vitals.setEnabled(!1);try{await this.otel.shutdown()}catch(e){console.warn("Monoscope: provider shutdown failed, some trace data may be lost",e)}this._enabled=!1}}}();
21
21
  //# sourceMappingURL=monoscope.min.js.map