@monoscopetech/browser 0.4.4 → 0.5.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.
- package/dist/monoscope.min.js +1 -1
- package/dist/monoscope.min.js.map +1 -1
- package/dist/monoscope.umd.js +1 -1
- package/dist/monoscope.umd.js.map +1 -1
- package/dist/tracing.js +1 -1
- package/package.json +7 -7
- package/dist/browser.js +0 -21
- package/dist/browser.js.map +0 -1
package/dist/browser.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
var Monoscope=function(e,t,n,r,o,s,i,a,l){"use strict";function c(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var u,h=c(t),p=Object.defineProperty,d=(e,t,n)=>((e,t,n)=>t in e?p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),f=Object.defineProperty,m=(e,t,n)=>((e,t,n)=>t in e?f(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),g=Object.defineProperty,y=(e,t,n)=>((e,t,n)=>t in e?g(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);const v={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},b={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},w={};function C(e){if(w[e])return w[e];const t=globalThis[e],n=t.prototype,r=e in v?v[e]:void 0,o=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]"))})),s=e in b?b[e]:void 0,i=Boolean(s&&s.every(e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))}));if(o&&i&&!globalThis.Zone)return w[e]=t.prototype,t.prototype;try{const r=document.createElement("iframe");document.body.appendChild(r);const o=r.contentWindow;if(!o)return t.prototype;const s=o[e].prototype;return document.body.removeChild(r),s?w[e]=s:n}catch{return n}}const _={};function S(e,t,n){var r;const o=`${e}.${String(n)}`;if(_[o])return _[o].call(t);const s=C(e),i=null==(r=Object.getOwnPropertyDescriptor(s,n))?void 0:r.get;return i?(_[o]=i,i.call(t)):t[n]}const I={};function E(e,t,n){const r=`${e}.${String(n)}`;if(I[r])return I[r].bind(t);const o=C(e)[n];return"function"!=typeof o?t[n]:(I[r]=o,o.bind(t))}const A={childNodes:function(e){return S("Node",e,"childNodes")},parentNode:function(e){return S("Node",e,"parentNode")},parentElement:function(e){return S("Node",e,"parentElement")},textContent:function(e){return S("Node",e,"textContent")},contains:function(e,t){return E("Node",e,"contains")(t)},getRootNode:function(e){return E("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?S("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?S("Element",e,"shadowRoot"):null},querySelector:function(e,t){return S("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return S("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return C("MutationObserver").constructor}};let T=class{constructor(){y(this,"idNodeMap",new Map),y(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 k(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&k(A.parentNode(e),t,n);for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!!n&&k(A.parentNode(e),t,n)}function O(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function x(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 R={exports:{}},N=String,M=function(){return{isColorSupported:!1,reset:N,bold:N,dim:N,italic:N,underline:N,inverse:N,hidden:N,strikethrough:N,black:N,red:N,green:N,yellow:N,blue:N,magenta:N,cyan:N,white:N,gray:N,bgBlack:N,bgRed:N,bgGreen:N,bgYellow:N,bgBlue:N,bgMagenta:N,bgCyan:N,bgWhite:N}};R.exports=M(),R.exports.createColors=M;var L=R.exports;const P=x(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let D=L,F=P,U=class e extends Error{constructor(t,n,r,o,s,i){super(t),this.name="CssSyntaxError",this.reason=t,s&&(this.file=s),o&&(this.source=o),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=D.isColorSupported),F&&e&&(t=F(t));let n,r,o=t.split(/\r?\n/),s=Math.max(this.line-3,0),i=Math.min(this.line+2,o.length),a=String(i).length;if(e){let{bold:e,gray:t,red:o}=D.createColors(!0);n=t=>e(o(t)),r=e=>t(e)}else n=r=e=>e;return o.slice(s,i).map((e,t)=>{let o=s+1+t,i=" "+(" "+o).slice(-a)+" | ";if(o===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 B=U;U.default=U;var j={};j.isClean=Symbol("isClean"),j.my=Symbol("my");const Z={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let z=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 o=(e.raws.between||"")+(t?";":"");this.builder(n+r+o,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,o=0;for(;r&&"root"!==r.type;)o+=1,r=r.parent;if(n.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<o;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 o=e.nodes[r],s=this.raw(o,"before");s&&this.builder(s),this.stringify(o,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 o=e.parent;if("before"===n){if(!o||"root"===o.type&&o.first===e)return"";if(o&&"document"===o.type)return""}if(!o)return Z[n];let s=e.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[n])return s.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);{let o="raw"+((i=n)[0].toUpperCase()+i.slice(1));this[o]?r=this[o](s,e):s.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var i;return void 0===r&&(r=Z[n]),s.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 V=z;z.default=z;let G=V;function W(e,t){new G(t).stringify(e)}var $=W;W.default=W;let{isClean:H,my:Y}=j,K=B,q=V,X=$;function J(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 o=e[r],s=typeof o;"parent"===r&&"object"===s?t&&(n[r]=t):"source"===r?n[r]=o:Array.isArray(o)?n[r]=o.map(e=>J(e,n)):("object"===s&&null!==o&&(o=J(o)),n[r]=o)}return n}let Q=class{constructor(e={}){this.raws={},this[H]=!1,this[Y]=!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=J(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 K(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[H]){this[H]=!1;let e=this;for(;e=e.parent;)e[H]=!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,o=this.source.start.line;for(let t=0;t<e;t++)"\n"===n[t]?(r=1,o+=1):r+=1;return{column:r,line:o}}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(),o=r.indexOf(e.word);-1!==o&&(t=this.positionInside(o,r),n=this.positionInside(o+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 q).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 o=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 s=t.get(r.input);null==s&&(s=o,t.set(r.input,o),o++),n[e]={end:r.end,inputId:s,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=X){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 ee=Q;Q.default=Q;let te=ee,ne=class extends te{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 re=ne;ne.default=ne;var oe={nanoid:(e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:se,SourceMapGenerator:ie}=P,{existsSync:ae,readFileSync:le}=P,{dirname:ce,join:ue}=P;let he=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=ce(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new se(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=ce(e),ae(e))return this.mapFile=e,le(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 se)return ie.fromSourceMap(t).toString();if(t instanceof ie)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=ue(ce(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 pe=he;he.default=he;let{SourceMapConsumer:de,SourceMapGenerator:fe}=P,{fileURLToPath:me,pathToFileURL:ge}=P,{isAbsolute:ye,resolve:ve}=P,{nanoid:be}=oe,we=P,Ce=B,_e=pe,Se=Symbol("fromOffsetCache"),Ie=Boolean(de&&fe),Ee=Boolean(ve&&ye),Ae=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&&(!Ee||/^\w+:\/\//.test(t.from)||ye(t.from)?this.file=t.from:this.file=ve(t.from)),Ee&&Ie){let e=new _e(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 "+be(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,r={}){let o,s,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);s=e.line,i=e.col}else s=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,s,i);return o=a?new Ce(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 Ce(e,void 0===s?t:{column:n,line:t},void 0===s?n:{column:i,line:s},this.css,this.file,r.plugin),o.input={column:n,endColumn:i,endLine:s,line:t,source:this.css},this.file&&(ge&&(o.input.url=ge(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,n;if(this[Se])n=this[Se];else{let e=this.css.split("\n");n=new Array(e.length);let t=0;for(let r=0,o=e.length;r<o;r++)n[r]=t,t+=e[r].length+1;this[Se]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t,o=n.length-2;for(;r<o;)if(t=r+(o-r>>1),e<n[t])o=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:ve(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,r){if(!this.map)return!1;let o,s,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof n&&(o=i.originalPositionFor({column:r,line:n})),s=ye(a.source)?ge(a.source):new URL(a.source,this.map.consumer().sourceRoot||ge(this.map.mapFile));let l={column:a.column,endColumn:o&&o.column,endLine:o&&o.line,line:a.line,url:s.toString()};if("file:"===s.protocol){if(!me)throw new Error("file: protocol is not available in this PostCSS build");l.file=me(s)}let c=i.sourceContentFor(a.source);return c&&(l.source=c),l}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 Te=Ae;Ae.default=Ae,we&&we.registerInput&&we.registerInput(Ae);let{SourceMapConsumer:ke,SourceMapGenerator:Oe}=P,{dirname:xe,relative:Re,resolve:Ne,sep:Me}=P,{pathToFileURL:Le}=P,Pe=Te,De=Boolean(ke&&Oe),Fe=Boolean(xe&&Ne&&Re&&Me);var Ue=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||xe(e.file);!1===this.mapOpts.sourcesContent?(t=new ke(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(),Fe&&De&&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=Oe.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Oe({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 Oe({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,n=1,r=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(s.generated.line=n,s.generated.column=r-1,a.source&&a.source.start?(s.source=this.sourcePath(a),s.original.line=a.source.start.line,s.original.column=a.source.start.column-1,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,this.map.addMapping(s))),e=i.match(/\n/g),e?(n+=e.length,t=i.lastIndexOf("\n"),r=i.length-t):r+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(s.source=this.sourcePath(a),s.original.line=a.source.end.line,s.original.column=a.source.end.column-1,s.generated.line=n,s.generated.column=r-2,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=n,s.generated.column=r-1,this.map.addMapping(s)))}})}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?xe(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=xe(Ne(n,this.mapOpts.annotation)));let r=Re(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 Pe(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(Le){let t=Le(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;"\\"===Me&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}};let Be=ee,je=class extends Be{constructor(e){super(e),this.type="comment"}};var Ze=je;je.default=je;let ze,Ve,Ge,We,{isClean:$e,my:He}=j,Ye=re,Ke=Ze,qe=ee;function Xe(e){return e.map(e=>(e.nodes&&(e.nodes=Xe(e.nodes)),delete e.source,e))}function Je(e){if(e[$e]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Je(t)}let Qe=class e extends qe{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),o=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let e of o)this.proxyOf.nodes.splice(r+1,0,e);for(let e in this.indexes)n=this.indexes[e],r<n&&(this.indexes[e]=n+o.length);return this.markDirty(),this}insertBefore(e,t){let n,r=this.index(e),o=0===r&&"prepend",s=this.normalize(t,this.proxyOf.nodes[r],o).reverse();r=this.index(e);for(let e of s)this.proxyOf.nodes.splice(r,0,e);for(let e in this.indexes)n=this.indexes[e],r<=n&&(this.indexes[e]=n+s.length);return this.markDirty(),this}normalize(t,n){if("string"==typeof t)t=Xe(ze(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 Ye(t)]}else if(t.selector)t=[new Ve(t)];else if(t.name)t=[new Ge(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Ke(t)]}return t.map(t=>(t[He]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[$e]&&Je(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]}};Qe.registerParse=e=>{ze=e},Qe.registerRule=e=>{Ve=e},Qe.registerAtRule=e=>{Ge=e},Qe.registerRoot=e=>{We=e};var et=Qe;Qe.default=Qe,Qe.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Ge.prototype):"rule"===e.type?Object.setPrototypeOf(e,Ve.prototype):"decl"===e.type?Object.setPrototypeOf(e,Ye.prototype):"comment"===e.type?Object.setPrototypeOf(e,Ke.prototype):"root"===e.type&&Object.setPrototypeOf(e,We.prototype),e[He]=!0,e.nodes&&e.nodes.forEach(e=>{Qe.rebuild(e)})};let tt,nt,rt=et,ot=class extends rt{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new tt(new nt,this,e).stringify()}};ot.registerLazyResult=e=>{tt=e},ot.registerProcessor=e=>{nt=e};var st=ot;ot.default=ot;let it={};var at=function(e){it[e]||(it[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let lt=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 ct=lt;lt.default=lt;let ut=ct,ht=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 ut(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var pt=ht;ht.default=ht;const dt="'".charCodeAt(0),ft='"'.charCodeAt(0),mt="\\".charCodeAt(0),gt="/".charCodeAt(0),yt="\n".charCodeAt(0),vt=" ".charCodeAt(0),bt="\f".charCodeAt(0),wt="\t".charCodeAt(0),Ct="\r".charCodeAt(0),_t="[".charCodeAt(0),St="]".charCodeAt(0),It="(".charCodeAt(0),Et=")".charCodeAt(0),At="{".charCodeAt(0),Tt="}".charCodeAt(0),kt=";".charCodeAt(0),Ot="*".charCodeAt(0),xt=":".charCodeAt(0),Rt="@".charCodeAt(0),Nt=/[\t\n\f\r "#'()/;[\\\]{}]/g,Mt=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Lt=/.[\r\n"'(/\\]/,Pt=/[\da-f]/i;let Dt=et,Ft=class extends Dt{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 Ut=Ft;Ft.default=Ft,Dt.registerAtRule(Ft);let Bt,jt,Zt=et,zt=class extends Zt{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 Bt(new jt,this,e).stringify()}};zt.registerLazyResult=e=>{Bt=e},zt.registerProcessor=e=>{jt=e};var Vt=zt;zt.default=zt,Zt.registerRoot(zt);let Gt={comma:e=>Gt.split(e,[","],!0),space:e=>Gt.split(e,[" ","\n","\t"]),split(e,t,n){let r=[],o="",s=!1,i=0,a=!1,l="",c=!1;for(let n of e)c?c=!1:"\\"===n?c=!0:a?n===l&&(a=!1):'"'===n||"'"===n?(a=!0,l=n):"("===n?i+=1:")"===n?i>0&&(i-=1):0===i&&t.includes(n)&&(s=!0),s?(""!==o&&r.push(o.trim()),o="",s=!1):o+=n;return(n||""!==o)&&r.push(o.trim()),r}};var Wt=Gt;Gt.default=Gt;let $t=et,Ht=Wt,Yt=class extends $t{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Ht.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 Kt=Yt;Yt.default=Yt,$t.registerRule(Yt);let qt=re,Xt=function(e,t={}){let n,r,o,s,i,a,l,c,u,h,p=e.css.valueOf(),d=t.ignoreErrors,f=p.length,m=0,g=[],y=[];function v(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(n=p.charCodeAt(m),n){case yt:case vt:case wt:case Ct:case bt:r=m;do{r+=1,n=p.charCodeAt(r)}while(n===vt||n===yt||n===wt||n===Ct||n===bt);h=["space",p.slice(m,r)],m=r-1;break;case _t:case St:case At:case Tt:case xt:case kt:case Et:{let e=String.fromCharCode(n);h=[e,e,m];break}case It:if(c=g.length?g.pop()[1]:"",u=p.charCodeAt(m+1),"url"===c&&u!==dt&&u!==ft&&u!==vt&&u!==yt&&u!==wt&&u!==bt&&u!==Ct){r=m;do{if(a=!1,r=p.indexOf(")",r+1),-1===r){if(d||t){r=m;break}v("bracket")}for(l=r;p.charCodeAt(l-1)===mt;)l-=1,a=!a}while(a);h=["brackets",p.slice(m,r+1),m,r],m=r}else r=p.indexOf(")",m+1),s=p.slice(m,r+1),-1===r||Lt.test(s)?h=["(","(",m]:(h=["brackets",s,m,r],m=r);break;case dt:case ft:o=n===dt?"'":'"',r=m;do{if(a=!1,r=p.indexOf(o,r+1),-1===r){if(d||t){r=m+1;break}v("string")}for(l=r;p.charCodeAt(l-1)===mt;)l-=1,a=!a}while(a);h=["string",p.slice(m,r+1),m,r],m=r;break;case Rt:Nt.lastIndex=m+1,Nt.test(p),r=0===Nt.lastIndex?p.length-1:Nt.lastIndex-2,h=["at-word",p.slice(m,r+1),m,r],m=r;break;case mt:for(r=m,i=!0;p.charCodeAt(r+1)===mt;)r+=1,i=!i;if(n=p.charCodeAt(r+1),i&&n!==gt&&n!==vt&&n!==yt&&n!==wt&&n!==Ct&&n!==bt&&(r+=1,Pt.test(p.charAt(r)))){for(;Pt.test(p.charAt(r+1));)r+=1;p.charCodeAt(r+1)===vt&&(r+=1)}h=["word",p.slice(m,r+1),m,r],m=r;break;default:n===gt&&p.charCodeAt(m+1)===Ot?(r=p.indexOf("*/",m+2)+1,0===r&&(d||t?r=p.length:v("comment")),h=["comment",p.slice(m,r+1),m,r],m=r):(Mt.lastIndex=m+1,Mt.test(p),r=0===Mt.lastIndex?p.length-1:Mt.lastIndex-2,h=["word",p.slice(m,r+1),m,r],g.push(h),m=r)}return m++,h},position:function(){return m}}},Jt=Ze,Qt=Ut,en=Vt,tn=Kt;const nn={empty:!0,space:!0};let rn=et,on=class{constructor(e){this.input=e,this.root=new en,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,o=new Qt;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let s=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.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&&(o.source.end=this.getPosition(n[3]||n[2]),o.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(o.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(o,"params",a),s&&(e=a[a.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),i&&(o.nodes=[],this.current=o)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let n,r=0;for(let o=t-1;o>=0&&(n=e[o],"space"===n[0]||(r+=1,2!==r));o--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}colon(e){let t,n,r,o=0;for(let[s,i]of e.entries()){if(t=i,n=t[0],"("===n&&(o+=1),")"===n&&(o-=1),0===o&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return s}this.doubleColon(t)}r=t}return!1}comment(e){let t=new Jt;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=Xt(this.input)}decl(e,t){let n=new qt;this.init(n,e[0][2]);let r,o=e[e.length-1];for(";"===o[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(o[3]||o[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 s,i=[];for(;e.length&&(s=e[0][0],"space"===s||"comment"===s);)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),o="";for(let e=t;e>0;e--){let t=r[e][0];if(0===o.trim().indexOf("!")&&"space"!==t)break;o=r.pop()[1]+o}0===o.trim().indexOf("!")&&(n.important=!0,n.raws.important=o,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 tn;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,o=null,s=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(n=l[0],a.push(l),"("===n||"["===n)o||(o=l),s.push("("===n?")":"]");else if(i&&r&&"{"===n)o||(o=l),s.push("}");else if(0===s.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===s[s.length-1]&&(s.pop(),0===s.length&&(o=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),s.length>0&&this.unclosedBracket(o),t&&r){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)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 o,s,i,a,l=n.length,c="",u=!0;for(let e=0;e<l;e+=1)o=n[e],s=o[0],"space"!==s||e!==l-1||r?"comment"===s?(a=n[e-1]?n[e-1][0]:"empty",i=n[e+1]?n[e+1][0]:"empty",nn[a]||nn[i]||","===c.slice(-1)?u=!1:c+=o[1]):c+=o[1]:u=!1;if(!u){let r=n.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:r,value:c}}e[t]=c}rule(e){e.pop();let t=new tn;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})}},sn=Te;function an(e,t){let n=new sn(e,t),r=new on(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 ln=an;an.default=an,rn.registerParse(an);let{isClean:cn,my:un}=j,hn=Ue,pn=$,dn=et,fn=st,mn=at,gn=pt,yn=ln,vn=Vt;const bn={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},wn={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},Cn={Once:!0,postcssPlugin:!0,prepare:!0};function _n(e){return"object"==typeof e&&"function"==typeof e.then}function Sn(e){let t=!1,n=bn[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 In(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Sn(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function En(e){return e[cn]=!1,e.nodes&&e.nodes.forEach(e=>En(e)),e}let An={},Tn=class e{constructor(t,n,r){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof n||null===n||"root"!==n.type&&"document"!==n.type)if(n instanceof e||n instanceof gn)o=En(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=yn;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{o=e(n,r)}catch(e){this.processed=!0,this.error=e}o&&!o[un]&&dn.rebuild(o)}else o=En(n);this.result=new gn(t,o,r),this.helpers={...An,postcss:An,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,o=t.split("."),s=r.split(".");(o[0]!==s[0]||parseInt(o[1])>parseInt(s[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(!wn[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Cn[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(_n(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[cn];){e[cn]=!0;let t=[In(e)];for(;t.length>0;){let e=this.visitTick(t);if(_n(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 _n(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=pn;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new hn(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(_n(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[cn];)e[cn]=!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||mn("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(_n(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,o]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return o(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){let r,o=t.iterator;for(;r=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!r[cn])return r[cn]=!0,void e.push(In(r));t.iterator=0,delete n.indexes[o]}let o=t.events;for(;t.eventIndex<o.length;){let e=o[t.eventIndex];if(t.eventIndex+=1,0===e)return void(n.nodes&&n.nodes.length&&(n[cn]=!0,t.iterator=n.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[cn]=!0;let t=Sn(e);for(let n of t)if(0===n)e.nodes&&e.each(e=>{e[cn]||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"}};Tn.registerPostcss=e=>{An=e};var kn=Tn;Tn.default=Tn,vn.registerLazyResult(Tn),fn.registerLazyResult(Tn);let On=Ue,xn=$,Rn=at,Nn=ln;const Mn=pt;let Ln=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 o=xn;this.result=new Mn(this._processor,r,this._opts),this.result.css=t;let s=this;Object.defineProperty(this.result,"root",{get:()=>s.root});let i=new On(o,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||Rn("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=Nn;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 Pn=Ln;Ln.default=Ln;let Dn=Pn,Fn=kn,Un=st,Bn=Vt,jn=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 Fn(this,e,t):new Dn(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Zn=jn;jn.default=jn,Bn.registerProcessor(jn),Un.registerProcessor(jn);let zn=re,Vn=pe,Gn=Ze,Wn=Ut,$n=Te,Hn=Vt,Yn=Kt;function Kn(e,t){if(Array.isArray(e))return e.map(e=>Kn(e));let{inputs:n,...r}=e;if(n){t=[];for(let e of n){let n={...e,__proto__:$n.prototype};n.map&&(n.map={...n.map,__proto__:Vn.prototype}),t.push(n)}}if(r.nodes&&(r.nodes=e.nodes.map(e=>Kn(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 Hn(r);if("decl"===r.type)return new zn(r);if("rule"===r.type)return new Yn(r);if("comment"===r.type)return new Gn(r);if("atrule"===r.type)return new Wn(r);throw new Error("Unknown node type: "+e.type)}var qn=Kn;Kn.default=Kn;let Xn=B,Jn=re,Qn=kn,er=et,tr=Zn,nr=$,rr=qn,or=st,sr=ct,ir=Ze,ar=Ut,lr=pt,cr=Te,ur=ln,hr=Wt,pr=Kt,dr=Vt,fr=ee;function mr(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new tr(e)}mr.plugin=function(e,t){let n,r=!1;function o(...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 o=t(...n);return o.postcssPlugin=e,o.postcssVersion=(new tr).version,o}return Object.defineProperty(o,"postcss",{get:()=>(n||(n=o()),n)}),o.process=function(e,t,n){return mr([o(n)]).process(e,t)},o},mr.stringify=nr,mr.parse=ur,mr.fromJSON=rr,mr.list=hr,mr.comment=e=>new ir(e),mr.atRule=e=>new ar(e),mr.decl=e=>new Jn(e),mr.rule=e=>new pr(e),mr.root=e=>new dr(e),mr.document=e=>new or(e),mr.CssSyntaxError=Xn,mr.Declaration=Jn,mr.Container=er,mr.Processor=tr,mr.Document=or,mr.Comment=ir,mr.Warning=sr,mr.AtRule=ar,mr.Result=lr,mr.Input=cr,mr.Rule=pr,mr.Root=dr,mr.Node=fr,Qn.registerPostcss(mr);var gr=mr;mr.default=mr;const yr=O(gr);yr.stringify,yr.fromJSON,yr.plugin,yr.parse,yr.list,yr.document,yr.comment,yr.atRule,yr.rule,yr.decl,yr.root,yr.CssSyntaxError,yr.Declaration,yr.Container,yr.Processor,yr.Document,yr.Comment,yr.Warning,yr.AtRule,yr.Result,yr.Input,yr.Rule,yr.Root,yr.Node;var vr=Object.defineProperty,br=(e,t,n)=>((e,t,n)=>t in e?vr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);function wr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Cr(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 _r={exports:{}},Sr=String,Ir=function(){return{isColorSupported:!1,reset:Sr,bold:Sr,dim:Sr,italic:Sr,underline:Sr,inverse:Sr,hidden:Sr,strikethrough:Sr,black:Sr,red:Sr,green:Sr,yellow:Sr,blue:Sr,magenta:Sr,cyan:Sr,white:Sr,gray:Sr,bgBlack:Sr,bgRed:Sr,bgGreen:Sr,bgYellow:Sr,bgBlue:Sr,bgMagenta:Sr,bgCyan:Sr,bgWhite:Sr}};_r.exports=Ir(),_r.exports.createColors=Ir;var Er=_r.exports;const Ar=Cr(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Tr=Er,kr=Ar,Or=class e extends Error{constructor(t,n,r,o,s,i){super(t),this.name="CssSyntaxError",this.reason=t,s&&(this.file=s),o&&(this.source=o),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=Tr.isColorSupported),kr&&e&&(t=kr(t));let n,r,o=t.split(/\r?\n/),s=Math.max(this.line-3,0),i=Math.min(this.line+2,o.length),a=String(i).length;if(e){let{bold:e,gray:t,red:o}=Tr.createColors(!0);n=t=>e(o(t)),r=e=>t(e)}else n=r=e=>e;return o.slice(s,i).map((e,t)=>{let o=s+1+t,i=" "+(" "+o).slice(-a)+" | ";if(o===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 xr=Or;Or.default=Or;var Rr={};Rr.isClean=Symbol("isClean"),Rr.my=Symbol("my");const Nr={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Mr=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 o=(e.raws.between||"")+(t?";":"");this.builder(n+r+o,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,o=0;for(;r&&"root"!==r.type;)o+=1,r=r.parent;if(n.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<o;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 o=e.nodes[r],s=this.raw(o,"before");s&&this.builder(s),this.stringify(o,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 o=e.parent;if("before"===n){if(!o||"root"===o.type&&o.first===e)return"";if(o&&"document"===o.type)return""}if(!o)return Nr[n];let s=e.root();if(s.rawCache||(s.rawCache={}),void 0!==s.rawCache[n])return s.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);{let o="raw"+((i=n)[0].toUpperCase()+i.slice(1));this[o]?r=this[o](s,e):s.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var i;return void 0===r&&(r=Nr[n]),s.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 Lr=Mr;Mr.default=Mr;let Pr=Lr;function Dr(e,t){new Pr(t).stringify(e)}var Fr=Dr;Dr.default=Dr;let{isClean:Ur,my:Br}=Rr,jr=xr,Zr=Lr,zr=Fr;function Vr(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 o=e[r],s=typeof o;"parent"===r&&"object"===s?t&&(n[r]=t):"source"===r?n[r]=o:Array.isArray(o)?n[r]=o.map(e=>Vr(e,n)):("object"===s&&null!==o&&(o=Vr(o)),n[r]=o)}return n}let Gr=class{constructor(e={}){this.raws={},this[Ur]=!1,this[Br]=!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=Vr(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 jr(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[Ur]){this[Ur]=!1;let e=this;for(;e=e.parent;)e[Ur]=!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,o=this.source.start.line;for(let t=0;t<e;t++)"\n"===n[t]?(r=1,o+=1):r+=1;return{column:r,line:o}}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(),o=r.indexOf(e.word);-1!==o&&(t=this.positionInside(o,r),n=this.positionInside(o+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 Zr).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 o=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 s=t.get(r.input);null==s&&(s=o,t.set(r.input,o),o++),n[e]={end:r.end,inputId:s,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=zr){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 Wr=Gr;Gr.default=Gr;let $r=Wr,Hr=class extends $r{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 Yr=Hr;Hr.default=Hr;var Kr={nanoid:(e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:qr,SourceMapGenerator:Xr}=Ar,{existsSync:Jr,readFileSync:Qr}=Ar,{dirname:eo,join:to}=Ar;let no=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=eo(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new qr(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=eo(e),Jr(e))return this.mapFile=e,Qr(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 qr)return Xr.fromSourceMap(t).toString();if(t instanceof Xr)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=to(eo(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 ro=no;no.default=no;let{SourceMapConsumer:oo,SourceMapGenerator:so}=Ar,{fileURLToPath:io,pathToFileURL:ao}=Ar,{isAbsolute:lo,resolve:co}=Ar,{nanoid:uo}=Kr,ho=Ar,po=xr,fo=ro,mo=Symbol("fromOffsetCache"),go=Boolean(oo&&so),yo=Boolean(co&&lo),vo=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&&(!yo||/^\w+:\/\//.test(t.from)||lo(t.from)?this.file=t.from:this.file=co(t.from)),yo&&go){let e=new fo(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 "+uo(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,r={}){let o,s,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);s=e.line,i=e.col}else s=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,s,i);return o=a?new po(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 po(e,void 0===s?t:{column:n,line:t},void 0===s?n:{column:i,line:s},this.css,this.file,r.plugin),o.input={column:n,endColumn:i,endLine:s,line:t,source:this.css},this.file&&(ao&&(o.input.url=ao(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,n;if(this[mo])n=this[mo];else{let e=this.css.split("\n");n=new Array(e.length);let t=0;for(let r=0,o=e.length;r<o;r++)n[r]=t,t+=e[r].length+1;this[mo]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t,o=n.length-2;for(;r<o;)if(t=r+(o-r>>1),e<n[t])o=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:co(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,r){if(!this.map)return!1;let o,s,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof n&&(o=i.originalPositionFor({column:r,line:n})),s=lo(a.source)?ao(a.source):new URL(a.source,this.map.consumer().sourceRoot||ao(this.map.mapFile));let l={column:a.column,endColumn:o&&o.column,endLine:o&&o.line,line:a.line,url:s.toString()};if("file:"===s.protocol){if(!io)throw new Error("file: protocol is not available in this PostCSS build");l.file=io(s)}let c=i.sourceContentFor(a.source);return c&&(l.source=c),l}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 bo=vo;vo.default=vo,ho&&ho.registerInput&&ho.registerInput(vo);let{SourceMapConsumer:wo,SourceMapGenerator:Co}=Ar,{dirname:_o,relative:So,resolve:Io,sep:Eo}=Ar,{pathToFileURL:Ao}=Ar,To=bo,ko=Boolean(wo&&Co),Oo=Boolean(_o&&Io&&So&&Eo);var xo=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||_o(e.file);!1===this.mapOpts.sourcesContent?(t=new wo(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(),Oo&&ko&&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=Co.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Co({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 Co({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,n=1,r=1,o="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(s.generated.line=n,s.generated.column=r-1,a.source&&a.source.start?(s.source=this.sourcePath(a),s.original.line=a.source.start.line,s.original.column=a.source.start.column-1,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,this.map.addMapping(s))),e=i.match(/\n/g),e?(n+=e.length,t=i.lastIndexOf("\n"),r=i.length-t):r+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(s.source=this.sourcePath(a),s.original.line=a.source.end.line,s.original.column=a.source.end.column-1,s.generated.line=n,s.generated.column=r-2,this.map.addMapping(s)):(s.source=o,s.original.line=1,s.original.column=0,s.generated.line=n,s.generated.column=r-1,this.map.addMapping(s)))}})}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?_o(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=_o(Io(n,this.mapOpts.annotation)));let r=So(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 To(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(Ao){let t=Ao(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;"\\"===Eo&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}};let Ro=Wr,No=class extends Ro{constructor(e){super(e),this.type="comment"}};var Mo=No;No.default=No;let Lo,Po,Do,Fo,{isClean:Uo,my:Bo}=Rr,jo=Yr,Zo=Mo,zo=Wr;function Vo(e){return e.map(e=>(e.nodes&&(e.nodes=Vo(e.nodes)),delete e.source,e))}function Go(e){if(e[Uo]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Go(t)}let Wo=class e extends zo{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),o=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let e of o)this.proxyOf.nodes.splice(r+1,0,e);for(let e in this.indexes)n=this.indexes[e],r<n&&(this.indexes[e]=n+o.length);return this.markDirty(),this}insertBefore(e,t){let n,r=this.index(e),o=0===r&&"prepend",s=this.normalize(t,this.proxyOf.nodes[r],o).reverse();r=this.index(e);for(let e of s)this.proxyOf.nodes.splice(r,0,e);for(let e in this.indexes)n=this.indexes[e],r<=n&&(this.indexes[e]=n+s.length);return this.markDirty(),this}normalize(t,n){if("string"==typeof t)t=Vo(Lo(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 jo(t)]}else if(t.selector)t=[new Po(t)];else if(t.name)t=[new Do(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Zo(t)]}return t.map(t=>(t[Bo]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Uo]&&Go(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]}};Wo.registerParse=e=>{Lo=e},Wo.registerRule=e=>{Po=e},Wo.registerAtRule=e=>{Do=e},Wo.registerRoot=e=>{Fo=e};var $o=Wo;Wo.default=Wo,Wo.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Do.prototype):"rule"===e.type?Object.setPrototypeOf(e,Po.prototype):"decl"===e.type?Object.setPrototypeOf(e,jo.prototype):"comment"===e.type?Object.setPrototypeOf(e,Zo.prototype):"root"===e.type&&Object.setPrototypeOf(e,Fo.prototype),e[Bo]=!0,e.nodes&&e.nodes.forEach(e=>{Wo.rebuild(e)})};let Ho,Yo,Ko=$o,qo=class extends Ko{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Ho(new Yo,this,e).stringify()}};qo.registerLazyResult=e=>{Ho=e},qo.registerProcessor=e=>{Yo=e};var Xo=qo;qo.default=qo;let Jo={};var Qo=function(e){Jo[e]||(Jo[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let es=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 ts=es;es.default=es;let ns=ts,rs=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 ns(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var os=rs;rs.default=rs;const ss="'".charCodeAt(0),is='"'.charCodeAt(0),as="\\".charCodeAt(0),ls="/".charCodeAt(0),cs="\n".charCodeAt(0),us=" ".charCodeAt(0),hs="\f".charCodeAt(0),ps="\t".charCodeAt(0),ds="\r".charCodeAt(0),fs="[".charCodeAt(0),ms="]".charCodeAt(0),gs="(".charCodeAt(0),ys=")".charCodeAt(0),vs="{".charCodeAt(0),bs="}".charCodeAt(0),ws=";".charCodeAt(0),Cs="*".charCodeAt(0),_s=":".charCodeAt(0),Ss="@".charCodeAt(0),Is=/[\t\n\f\r "#'()/;[\\\]{}]/g,Es=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,As=/.[\r\n"'(/\\]/,Ts=/[\da-f]/i;let ks=$o,Os=class extends ks{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 xs=Os;Os.default=Os,ks.registerAtRule(Os);let Rs,Ns,Ms=$o,Ls=class extends Ms{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 Rs(new Ns,this,e).stringify()}};Ls.registerLazyResult=e=>{Rs=e},Ls.registerProcessor=e=>{Ns=e};var Ps=Ls;Ls.default=Ls,Ms.registerRoot(Ls);let Ds={comma:e=>Ds.split(e,[","],!0),space:e=>Ds.split(e,[" ","\n","\t"]),split(e,t,n){let r=[],o="",s=!1,i=0,a=!1,l="",c=!1;for(let n of e)c?c=!1:"\\"===n?c=!0:a?n===l&&(a=!1):'"'===n||"'"===n?(a=!0,l=n):"("===n?i+=1:")"===n?i>0&&(i-=1):0===i&&t.includes(n)&&(s=!0),s?(""!==o&&r.push(o.trim()),o="",s=!1):o+=n;return(n||""!==o)&&r.push(o.trim()),r}};var Fs=Ds;Ds.default=Ds;let Us=$o,Bs=Fs,js=class extends Us{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Bs.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 Zs=js;js.default=js,Us.registerRule(js);let zs=Yr,Vs=function(e,t={}){let n,r,o,s,i,a,l,c,u,h,p=e.css.valueOf(),d=t.ignoreErrors,f=p.length,m=0,g=[],y=[];function v(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(n=p.charCodeAt(m),n){case cs:case us:case ps:case ds:case hs:r=m;do{r+=1,n=p.charCodeAt(r)}while(n===us||n===cs||n===ps||n===ds||n===hs);h=["space",p.slice(m,r)],m=r-1;break;case fs:case ms:case vs:case bs:case _s:case ws:case ys:{let e=String.fromCharCode(n);h=[e,e,m];break}case gs:if(c=g.length?g.pop()[1]:"",u=p.charCodeAt(m+1),"url"===c&&u!==ss&&u!==is&&u!==us&&u!==cs&&u!==ps&&u!==hs&&u!==ds){r=m;do{if(a=!1,r=p.indexOf(")",r+1),-1===r){if(d||t){r=m;break}v("bracket")}for(l=r;p.charCodeAt(l-1)===as;)l-=1,a=!a}while(a);h=["brackets",p.slice(m,r+1),m,r],m=r}else r=p.indexOf(")",m+1),s=p.slice(m,r+1),-1===r||As.test(s)?h=["(","(",m]:(h=["brackets",s,m,r],m=r);break;case ss:case is:o=n===ss?"'":'"',r=m;do{if(a=!1,r=p.indexOf(o,r+1),-1===r){if(d||t){r=m+1;break}v("string")}for(l=r;p.charCodeAt(l-1)===as;)l-=1,a=!a}while(a);h=["string",p.slice(m,r+1),m,r],m=r;break;case Ss:Is.lastIndex=m+1,Is.test(p),r=0===Is.lastIndex?p.length-1:Is.lastIndex-2,h=["at-word",p.slice(m,r+1),m,r],m=r;break;case as:for(r=m,i=!0;p.charCodeAt(r+1)===as;)r+=1,i=!i;if(n=p.charCodeAt(r+1),i&&n!==ls&&n!==us&&n!==cs&&n!==ps&&n!==ds&&n!==hs&&(r+=1,Ts.test(p.charAt(r)))){for(;Ts.test(p.charAt(r+1));)r+=1;p.charCodeAt(r+1)===us&&(r+=1)}h=["word",p.slice(m,r+1),m,r],m=r;break;default:n===ls&&p.charCodeAt(m+1)===Cs?(r=p.indexOf("*/",m+2)+1,0===r&&(d||t?r=p.length:v("comment")),h=["comment",p.slice(m,r+1),m,r],m=r):(Es.lastIndex=m+1,Es.test(p),r=0===Es.lastIndex?p.length-1:Es.lastIndex-2,h=["word",p.slice(m,r+1),m,r],g.push(h),m=r)}return m++,h},position:function(){return m}}},Gs=Mo,Ws=xs,$s=Ps,Hs=Zs;const Ys={empty:!0,space:!0};let Ks=$o,qs=class{constructor(e){this.input=e,this.root=new $s,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,o=new Ws;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let s=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.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&&(o.source.end=this.getPosition(n[3]||n[2]),o.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){s=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(o.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(o,"params",a),s&&(e=a[a.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),i&&(o.nodes=[],this.current=o)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let n,r=0;for(let o=t-1;o>=0&&(n=e[o],"space"===n[0]||(r+=1,2!==r));o--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}colon(e){let t,n,r,o=0;for(let[s,i]of e.entries()){if(t=i,n=t[0],"("===n&&(o+=1),")"===n&&(o-=1),0===o&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return s}this.doubleColon(t)}r=t}return!1}comment(e){let t=new Gs;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=Vs(this.input)}decl(e,t){let n=new zs;this.init(n,e[0][2]);let r,o=e[e.length-1];for(";"===o[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(o[3]||o[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 s,i=[];for(;e.length&&(s=e[0][0],"space"===s||"comment"===s);)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),o="";for(let e=t;e>0;e--){let t=r[e][0];if(0===o.trim().indexOf("!")&&"space"!==t)break;o=r.pop()[1]+o}0===o.trim().indexOf("!")&&(n.important=!0,n.raws.important=o,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 Hs;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,o=null,s=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(n=l[0],a.push(l),"("===n||"["===n)o||(o=l),s.push("("===n?")":"]");else if(i&&r&&"{"===n)o||(o=l),s.push("}");else if(0===s.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===s[s.length-1]&&(s.pop(),0===s.length&&(o=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),s.length>0&&this.unclosedBracket(o),t&&r){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)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 o,s,i,a,l=n.length,c="",u=!0;for(let e=0;e<l;e+=1)o=n[e],s=o[0],"space"!==s||e!==l-1||r?"comment"===s?(a=n[e-1]?n[e-1][0]:"empty",i=n[e+1]?n[e+1][0]:"empty",Ys[a]||Ys[i]||","===c.slice(-1)?u=!1:c+=o[1]):c+=o[1]:u=!1;if(!u){let r=n.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:r,value:c}}e[t]=c}rule(e){e.pop();let t=new Hs;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})}},Xs=bo;function Js(e,t){let n=new Xs(e,t),r=new qs(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 Qs=Js;Js.default=Js,Ks.registerParse(Js);let{isClean:ei,my:ti}=Rr,ni=xo,ri=Fr,oi=$o,si=Xo,ii=Qo,ai=os,li=Qs,ci=Ps;const ui={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},hi={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},pi={Once:!0,postcssPlugin:!0,prepare:!0};function di(e){return"object"==typeof e&&"function"==typeof e.then}function fi(e){let t=!1,n=ui[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 mi(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:fi(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function gi(e){return e[ei]=!1,e.nodes&&e.nodes.forEach(e=>gi(e)),e}let yi={},vi=class e{constructor(t,n,r){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof n||null===n||"root"!==n.type&&"document"!==n.type)if(n instanceof e||n instanceof ai)o=gi(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=li;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{o=e(n,r)}catch(e){this.processed=!0,this.error=e}o&&!o[ti]&&oi.rebuild(o)}else o=gi(n);this.result=new ai(t,o,r),this.helpers={...yi,postcss:yi,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,o=t.split("."),s=r.split(".");(o[0]!==s[0]||parseInt(o[1])>parseInt(s[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(!hi[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!pi[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(di(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ei];){e[ei]=!0;let t=[mi(e)];for(;t.length>0;){let e=this.visitTick(t);if(di(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 di(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=ri;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new ni(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(di(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ei];)e[ei]=!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||ii("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(di(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,o]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return o(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){let r,o=t.iterator;for(;r=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!r[ei])return r[ei]=!0,void e.push(mi(r));t.iterator=0,delete n.indexes[o]}let o=t.events;for(;t.eventIndex<o.length;){let e=o[t.eventIndex];if(t.eventIndex+=1,0===e)return void(n.nodes&&n.nodes.length&&(n[ei]=!0,t.iterator=n.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[ei]=!0;let t=fi(e);for(let n of t)if(0===n)e.nodes&&e.each(e=>{e[ei]||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"}};vi.registerPostcss=e=>{yi=e};var bi=vi;vi.default=vi,ci.registerLazyResult(vi),si.registerLazyResult(vi);let wi=xo,Ci=Fr,_i=Qo,Si=Qs;const Ii=os;let Ei=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 o=Ci;this.result=new Ii(this._processor,r,this._opts),this.result.css=t;let s=this;Object.defineProperty(this.result,"root",{get:()=>s.root});let i=new wi(o,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||_i("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=Si;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 Ai=Ei;Ei.default=Ei;let Ti=Ai,ki=bi,Oi=Xo,xi=Ps,Ri=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 ki(this,e,t):new Ti(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Ni=Ri;Ri.default=Ri,xi.registerProcessor(Ri),Oi.registerProcessor(Ri);let Mi=Yr,Li=ro,Pi=Mo,Di=xs,Fi=bo,Ui=Ps,Bi=Zs;function ji(e,t){if(Array.isArray(e))return e.map(e=>ji(e));let{inputs:n,...r}=e;if(n){t=[];for(let e of n){let n={...e,__proto__:Fi.prototype};n.map&&(n.map={...n.map,__proto__:Li.prototype}),t.push(n)}}if(r.nodes&&(r.nodes=e.nodes.map(e=>ji(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 Ui(r);if("decl"===r.type)return new Mi(r);if("rule"===r.type)return new Bi(r);if("comment"===r.type)return new Pi(r);if("atrule"===r.type)return new Di(r);throw new Error("Unknown node type: "+e.type)}var Zi=ji;ji.default=ji;let zi=xr,Vi=Yr,Gi=bi,Wi=$o,$i=Ni,Hi=Fr,Yi=Zi,Ki=Xo,qi=ts,Xi=Mo,Ji=xs,Qi=os,ea=bo,ta=Qs,na=Fs,ra=Zs,oa=Ps,sa=Wr;function ia(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new $i(e)}ia.plugin=function(e,t){let n,r=!1;function o(...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 o=t(...n);return o.postcssPlugin=e,o.postcssVersion=(new $i).version,o}return Object.defineProperty(o,"postcss",{get:()=>(n||(n=o()),n)}),o.process=function(e,t,n){return ia([o(n)]).process(e,t)},o},ia.stringify=Hi,ia.parse=ta,ia.fromJSON=Yi,ia.list=na,ia.comment=e=>new Xi(e),ia.atRule=e=>new Ji(e),ia.decl=e=>new Vi(e),ia.rule=e=>new ra(e),ia.root=e=>new oa(e),ia.document=e=>new Ki(e),ia.CssSyntaxError=zi,ia.Declaration=Vi,ia.Container=Wi,ia.Processor=$i,ia.Document=Ki,ia.Comment=Xi,ia.Warning=qi,ia.AtRule=Ji,ia.Result=Qi,ia.Input=ea,ia.Rule=ra,ia.Root=oa,ia.Node=sa,Gi.registerPostcss(ia);var aa=ia;ia.default=ia;const la=wr(aa);la.stringify,la.fromJSON,la.plugin,la.parse,la.list,la.document,la.comment,la.atRule,la.rule,la.decl,la.root,la.CssSyntaxError,la.Declaration,la.Container,la.Processor,la.Document,la.Comment,la.Warning,la.AtRule,la.Result,la.Input,la.Rule,la.Root,la.Node;class ca{constructor(...e){br(this,"parentElement",null),br(this,"parentNode",null),br(this,"ownerDocument"),br(this,"firstChild",null),br(this,"lastChild",null),br(this,"previousSibling",null),br(this,"nextSibling",null),br(this,"ELEMENT_NODE",1),br(this,"TEXT_NODE",3),br(this,"nodeType"),br(this,"nodeName"),br(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 ca))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 ua={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ha={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},pa={};function da(e){if(pa[e])return pa[e];const t=globalThis[e],n=t.prototype,r=e in ua?ua[e]:void 0,o=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]"))})),s=e in ha?ha[e]:void 0,i=Boolean(s&&s.every(e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))}));if(o&&i&&!globalThis.Zone)return pa[e]=t.prototype,t.prototype;try{const r=document.createElement("iframe");document.body.appendChild(r);const o=r.contentWindow;if(!o)return t.prototype;const s=o[e].prototype;return document.body.removeChild(r),s?pa[e]=s:n}catch{return n}}const fa={};function ma(e,t,n){var r;const o=`${e}.${String(n)}`;if(fa[o])return fa[o].call(t);const s=da(e),i=null==(r=Object.getOwnPropertyDescriptor(s,n))?void 0:r.get;return i?(fa[o]=i,i.call(t)):t[n]}const ga={};function ya(e,t,n){const r=`${e}.${String(n)}`;if(ga[r])return ga[r].bind(t);const o=da(e)[n];return"function"!=typeof o?t[n]:(ga[r]=o,o.bind(t))}const va={childNodes:function(e){return ma("Node",e,"childNodes")},parentNode:function(e){return ma("Node",e,"parentNode")},parentElement:function(e){return ma("Node",e,"parentElement")},textContent:function(e){return ma("Node",e,"textContent")},contains:function(e,t){return ya("Node",e,"contains")(t)},getRootNode:function(e){return ya("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?ma("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?ma("Element",e,"shadowRoot"):null},querySelector:function(e,t){return ma("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return ma("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return da("MutationObserver").constructor}};const ba="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 wa={map:{},getId:()=>(console.error(ba),-1),getNode:()=>(console.error(ba),null),removeNodeFromMap(){console.error(ba)},has:()=>(console.error(ba),!1),reset(){console.error(ba)}};"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(wa=new Proxy(wa,{get:(e,t,n)=>("map"===t&&console.error(ba),Reflect.get(e,t,n))}));let Ca=Date.now;function _a(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:va.parentElement(e)}/[1-9][0-9]{12}/.test(Date.now().toString())||(Ca=()=>(new Date).getTime());function Sa(e){var t;let n=null;return"getRootNode"in e&&(null==(t=va.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&va.host(va.getRootNode(e))&&(n=va.host(va.getRootNode(e))),n}function Ia(e){let t,n=e;for(;t=Sa(n);)n=t;return n}function Ea(e){const t=e.ownerDocument;if(!t)return!1;const n=Ia(e);return va.contains(t,n)}const Aa=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:class{constructor(){m(this,"id",1),m(this,"styleIDMap",new WeakMap),m(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 wa},closestElementOfNode:_a,getBaseDimension:function e(t,n){var r,o;const s=null==(o=null==(r=t.ownerDocument)?void 0:r.defaultView)?void 0:o.frameElement;if(!s||s===n)return{x:0,y:0,relativeScale:1,absoluteScale:1};const i=s.getBoundingClientRect(),a=e(s,n),l=i.height/s.clientHeight;return{x:i.x*a.relativeScale+a.x,y:i.y*a.relativeScale+a.y,relativeScale:l,absoluteScale:a.absoluteScale*l}},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:Ia,getShadowHost:Sa,getWindowHeight:function(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight},getWindowScroll:function(e){var t,n,r,o;const s=e.document;return{left:s.scrollingElement?s.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:s.documentElement.scrollLeft||(null==s?void 0:s.body)&&(null==(t=va.parentElement(s.body))?void 0:t.scrollLeft)||(null==(n=null==s?void 0:s.body)?void 0:n.scrollLeft)||0,top:s.scrollingElement?s.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==s?void 0:s.documentElement.scrollTop)||(null==s?void 0:s.body)&&(null==(r=va.parentElement(s.body))?void 0:r.scrollTop)||(null==(o=null==s?void 0:s.body)?void 0:o.scrollTop)||0}},getWindowWidth:function(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth},hasShadowRoot:function(e){return!!e&&(e instanceof ca&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(va.shadowRoot(e)))},hookSetter:function e(t,n,r,o,s=window){const i=s.Object.getOwnPropertyDescriptor(t,n);return s.Object.defineProperty(t,n,o?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&&(va.contains(t,e)||Ea(e))},isAncestorRemoved:function e(t,n){if(function(e){const t=e&&"host"in e&&"mode"in e&&A.host(e)||null;return Boolean(t&&"shadowRoot"in t&&A.shadowRoot(t)===e)}(t))return!1;const r=n.getId(t);if(!n.has(r))return!0;const o=va.parentNode(t);return(!o||o.nodeType!==t.DOCUMENT_NODE)&&(!o||e(o,n))},isBlocked:function(e,t,n,r){if(!e)return!1;const o=_a(e);if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(k(o,t,r))return!0}catch(e){}if(n){if(o.matches(n))return!0;if(r&&null!==o.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 Ca},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],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{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 o of e){const{nextId:e,parentId:s}=o;if(e&&e in t){const s=t[e];if(s.parent){const e=s.parent.children.indexOf(s);s.parent.children.splice(e,0,n(o,s.parent))}else{const e=r.indexOf(s);r.splice(e,0,n(o,null))}continue}if(s in t){const e=t[s];e.children.push(n(o,e));continue}r.push(n(o,null))}return r},shadowHostInDom:Ea,throttle:function(e,t,n={}){let r=null,o=0;return function(...s){const i=Date.now();o||!1!==n.leading||(o=i);const a=t-(i-o),l=this;a<=0||a>t?(r&&(clearTimeout(r),r=null),o=i,e.apply(l,s)):r||!1===n.trailing||(r=setTimeout(()=>{o=!1===n.leading?0:Date.now(),r=null,e.apply(l,s)},a))}},uniqueTextMutations:function(e){const t=new Set,n=[];for(let r=e.length;r--;){const o=e[r];t.has(o.id)||(n.push(o),t.add(o.id))}return n}},Symbol.toStringTag,{value:"Module"}));for(var Ta="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ka="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Oa=0;Oa<64;Oa++)ka[Ta.charCodeAt(Oa)]=Oa;var xa,Ra,Na;"undefined"!=typeof window&&window.Blob&&new Blob([(xa="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Uint8Array.from(atob(xa),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(u=e.contentWindow)?void 0:u.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}new T,(Na=Ra||(Ra={}))[Na.NotStarted=0]="NotStarted",Na[Na.Running=1]="Running",Na[Na.Stopped=2]="Stopped";class Ma{constructor(e){d(this,"fileName"),d(this,"functionName"),d(this,"lineNumber"),d(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 La=/(^|@)\S+:\d+/,Pa=/^\s*at .*(\S+:\d+|\(native\))/m,Da=/^(eval@)?(\[native code])?$/,Fa={parse:function(e){return e?void 0!==e.stacktrace||void 0!==e["opera#sourceloc"]?this.parseOpera(e):e.stack&&e.stack.match(Pa)?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(Pa)},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),o=this.extractLocation(n?n[1]:r.pop()),s=r.join(" ")||void 0,i=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new Ma({functionName:s,fileName:i,lineNumber:o[1],columnNumber:o[2]})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(Da)},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 Ma({functionName:e});{const t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,o=this.extractLocation(e.replace(t,""));return new Ma({functionName:r,fileName:o[0],lineNumber:o[1],columnNumber:o[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,o=n.length;e<o;e+=2){const o=t.exec(n[e]);o&&r.push(new Ma({fileName:o[2],lineNumber:parseFloat(o[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,o=n.length;e<o;e+=2){const o=t.exec(n[e]);o&&r.push(new Ma({functionName:o[3]||void 0,fileName:o[2],lineNumber:parseFloat(o[1])}))}return r},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(La)&&!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 Ma({functionName:r,fileName:n[0],lineNumber:n[1],columnNumber:n[2]})},this)}};function Ua(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,o=[];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&&o.push(t)}o.length>1&&(n+=`:eq(${o.indexOf(e)})`),t=n+(t?">"+t:""),e=r}return t}function Ba(e){return"[object Object]"===Object.prototype.toString.call(e)}function ja(e,t){if(0===t)return!0;const n=Object.keys(e);for(const r of n)if(Ba(e[r])&&ja(e[r],t-1))return!0;return!1}function Za(e,t){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);const r=[],o=[];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?o.splice(n,1/0,e):o.push(e),~r.indexOf(t)&&(t=r[0]===t?"[Circular ~]":"[Circular ~."+o.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(Ba(e)&&Object.keys(e).length>n.numOfKeysLimit)return!0;if("function"==typeof e)return!0;if(Ba(e)&&ja(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]=Ua(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 za={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 Va(e,t,n){const r=n?Object.assign({},za,n):za,o=r.logger;if(!o)return()=>{};let s;s="string"==typeof o?t[o]:o;let i=0,a=!1;const l=[];if(r.level.includes("error")){const n=t=>{const n=t.message,o=t.error,s=Fa.parse(o).map(e=>e.toString()),i=[Za(n,r.stringifyOptions)];e({level:"error",trace:s,payload:i})};t.addEventListener("error",n),l.push(()=>{t.removeEventListener("error",n)});const o=t=>{let n,o;t.reason instanceof Error?(n=t.reason,o=[Za(`Uncaught (in promise) ${n.name}: ${n.message}`,r.stringifyOptions)]):(n=new Error,o=[Za("Uncaught (in promise)",r.stringifyOptions),Za(t.reason,r.stringifyOptions)]);const s=Fa.parse(n).map(e=>e.toString());e({level:"error",trace:s,payload:o})};t.addEventListener("unhandledrejection",o),l.push(()=>{t.removeEventListener("unhandledrejection",o)})}for(const e of r.level)l.push(c(s,e));return()=>{l.forEach(e=>e())};function c(t,n){return t[n]?Aa.patch(t,n,t=>(...o)=>{if(t.apply(this,o),!("assert"===n&&o[0]||a)){a=!0;try{const t=Fa.parse(new Error).map(e=>e.toString()).splice(1),s=("assert"===n?o.slice(1):o).map(e=>Za(e,r.stringifyOptions));i++,i<r.lengthThreshold?e({level:n,trace:t,payload:s}):i===r.lengthThreshold&&e({level:"warn",trace:[],payload:[Za("The number of log records reached the threshold.")]})}catch(e){t("rrweb logger error:",e,...o)}finally{a=!1}}}):()=>{}}}var Ga;function Wa(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function $a(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Ha(e){try{var t=e.rules||e.cssRules;return t?((n=Array.from(t).map(Ya).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 Ya(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=Ha(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"}(Ga||(Ga={}));var Ka=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 qa(e){var t=e.maskInputOptions,n=e.tagName,r=e.type,o=e.value,s=e.maskInputFn,i=o||"";return(t[n.toLowerCase()]||t[r])&&(i=s?s(i):"*".repeat(i.length)),i}var Xa="__rrweb_original__";var Ja,Qa,el=1,tl=new RegExp("[^a-z0-9-_:]");function nl(){return el++}var rl=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ol=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,sl=/^(data:)([^,]*),(.*)/i;function il(e,t){return(e||"").replace(rl,function(e,n,r,o,s,i){var a=r||s||i,l=n||o||"";if(!a)return e;if(!ol.test(a))return"url(".concat(l).concat(a).concat(l,")");if(sl.test(a))return"url(".concat(l).concat(a).concat(l,")");if("/"===a[0])return"url(".concat(l).concat(function(e){return(e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}(t)+a).concat(l,")");var c=t.split("/"),u=a.split("/");c.pop();for(var h=0,p=u;h<p.length;h++){var d=p[h];"."!==d&&(".."===d?c.pop():c.push(d))}return"url(".concat(l).concat(c.join("/")).concat(l,")")})}var al=/^[^ \t\n\r\u000c]+/,ll=/^[, \t\n\r\u000c]+/;function cl(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function ul(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function hl(){var e=document.createElement("a");return e.href="",e.href}function pl(e,t,n,r){return"src"===n||"href"===n&&r&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&r&&"#"!==r[0]?cl(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,o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}for(var o=[];r(ll),!(n>=t.length);){var s=r(al);if(","===s.slice(-1))s=cl(e,s.substring(0,s.length-1)),o.push(s);else{var i="";s=cl(e,s);for(var a=!1;;){var l=t.charAt(n);if(""===l){o.push((s+i).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){n+=1,o.push((s+i).trim());break}"("===l&&(a=!0)}i+=l,n+=1}}}return o.join(", ")}(e,r):"style"===n&&r?il(r,hl()):"object"===t&&"data"===n&&r?cl(e,r):r:cl(e,r)}function dl(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&dl(e.parentNode,t,n);for(var r=e.classList.length;r--;){var o=e.classList[r];if(t.test(o))return!0}return!!n&&dl(e.parentNode,t,n)}function fl(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(dl(r,t,!0))return!0;if(n){if(r.matches(n))return!0;if(r.closest(n))return!0}return!1}function ml(e,t){var n=t.doc,r=t.mirror,o=t.blockClass,s=t.blockSelector,i=t.maskTextClass,a=t.maskTextSelector,l=t.inlineStylesheet,c=t.maskInputOptions,u=void 0===c?{}:c,h=t.maskTextFn,p=t.maskInputFn,d=t.dataURLOptions,f=void 0===d?{}:d,m=t.inlineImages,g=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:Ga.Document,childNodes:[],compatMode:e.compatMode}:{type:Ga.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Ga.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,o=t.blockSelector,s=t.inlineStylesheet,i=t.maskInputOptions,a=void 0===i?{}:i,l=t.maskInputFn,c=t.dataURLOptions,u=void 0===c?{}:c,h=t.inlineImages,p=t.recordCanvas,d=t.keepIframeSrcFn,f=t.newlyAddedElement,m=void 0!==f&&f,g=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 o=e.classList[r];if(t.test(o))return!0}return!!n&&e.matches(n)}(e,r,o),v=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return tl.test(t)?"div":t}(e),b={},w=e.attributes.length,C=0;C<w;C++){var _=e.attributes[C];b[_.name]=pl(n,v,_.name,_.value)}if("link"===v&&s){var S=Array.from(n.styleSheets).find(function(t){return t.href===e.href}),I=null;S&&(I=Ha(S)),I&&(delete b.rel,delete b.href,b._cssText=il(I,S.href))}if("style"===v&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){(I=Ha(e.sheet))&&(b._cssText=il(I,hl()))}if("input"===v||"textarea"===v||"select"===v){var E=e.value,A=e.checked;"radio"!==b.type&&"checkbox"!==b.type&&"submit"!==b.type&&"button"!==b.type&&E?b.value=qa({type:b.type,tagName:v,value:E,maskInputOptions:a,maskInputFn:l}):A&&(b.checked=A)}"option"===v&&(e.selected&&!a.select?b.selected=!0:delete b.selected);if("canvas"===v&&p)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 o=t.getImageData,s=Xa in o?o[Xa]:o;if(new Uint32Array(s.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 T=e.toDataURL(u.type,u.quality),k=document.createElement("canvas");k.width=e.width,k.height=e.height,T!==k.toDataURL(u.type,u.quality)&&(b.rr_dataURL=T)}if("img"===v&&h){Ja||(Ja=n.createElement("canvas"),Qa=Ja.getContext("2d"));var O=e,x=O.crossOrigin;O.crossOrigin="anonymous";var R=function(){try{Ja.width=O.naturalWidth,Ja.height=O.naturalHeight,Qa.drawImage(O,0,0),b.rr_dataURL=Ja.toDataURL(u.type,u.quality)}catch(e){console.warn("Cannot inline img src=".concat(O.currentSrc,"! Error: ").concat(e))}x?b.crossOrigin=x:O.removeAttribute("crossorigin")};O.complete&&0!==O.naturalWidth?R():O.onload=R}"audio"!==v&&"video"!==v||(b.rr_mediaState=e.paused?"paused":"played",b.rr_mediaCurrentTime=e.currentTime);m||(e.scrollLeft&&(b.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(b.rr_scrollTop=e.scrollTop));if(y){var N=e.getBoundingClientRect(),M=N.width,L=N.height;b={class:b.class,rr_width:"".concat(M,"px"),rr_height:"".concat(L,"px")}}"iframe"!==v||d(b.src)||(e.contentDocument||(b.rr_src=b.src),delete b.src);return{type:Ga.Element,tagName:v,attributes:b,childNodes:[],isSVG:ul(e)||void 0,needBlock:y,rootId:g}}(e,{doc:n,blockClass:o,blockSelector:s,inlineStylesheet:l,maskInputOptions:u,maskInputFn:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,keepIframeSrcFn:y,newlyAddedElement:b,rootId:w});case e.TEXT_NODE:return function(e,t){var n,r=t.maskTextClass,o=t.maskTextSelector,s=t.maskTextFn,i=t.rootId,a=e.parentNode&&e.parentNode.tagName,l=e.textContent,c="STYLE"===a||void 0,u="SCRIPT"===a||void 0;if(c&&l){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(l=(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)}l=il(l,hl())}var h;u&&(l="SCRIPT_PLACEHOLDER");!c&&!u&&l&&fl(e,r,o)&&(l=s?s(l):l.replace(/[\S]/g,"*"));return{type:Ga.Text,textContent:l||"",isStyle:c,rootId:i}}(e,{maskTextClass:i,maskTextSelector:a,maskTextFn:h,rootId:w});case e.CDATA_SECTION_NODE:return{type:Ga.CDATA,textContent:"",rootId:w};case e.COMMENT_NODE:return{type:Ga.Comment,textContent:e.textContent||"",rootId:w};default:return!1}}function gl(e){return void 0===e?"":e.toLowerCase()}function yl(e,t){var n,r=t.doc,o=t.mirror,s=t.blockClass,i=t.blockSelector,a=t.maskTextClass,l=t.maskTextSelector,c=t.skipChild,u=void 0!==c&&c,h=t.inlineStylesheet,p=void 0===h||h,d=t.maskInputOptions,f=void 0===d?{}:d,m=t.maskTextFn,g=t.maskInputFn,y=t.slimDOMOptions,v=t.dataURLOptions,b=void 0===v?{}:v,w=t.inlineImages,C=void 0!==w&&w,_=t.recordCanvas,S=void 0!==_&&_,I=t.onSerialize,E=t.onIframeLoad,A=t.iframeLoadTimeout,T=void 0===A?5e3:A,k=t.onStylesheetLoad,O=t.stylesheetLoadTimeout,x=void 0===O?5e3:O,R=t.keepIframeSrcFn,N=void 0===R?function(){return!1}:R,M=t.newlyAddedElement,L=void 0!==M&&M,P=t.preserveWhiteSpace,D=void 0===P||P,F=ml(e,{doc:r,mirror:o,blockClass:s,blockSelector:i,maskTextClass:a,maskTextSelector:l,inlineStylesheet:p,maskInputOptions:f,maskTextFn:m,maskInputFn:g,dataURLOptions:b,inlineImages:C,recordCanvas:S,keepIframeSrcFn:N,newlyAddedElement:L});if(!F)return console.warn(e,"not serialized"),null;n=o.hasNode(e)?o.getId(e):!function(e,t){if(t.comment&&e.type===Ga.Comment)return!0;if(e.type===Ga.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&&(gl(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===gl(e.attributes.name)||"icon"===gl(e.attributes.rel)||"apple-touch-icon"===gl(e.attributes.rel)||"shortcut icon"===gl(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&gl(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(gl(e.attributes.property).match(/^(og|twitter|fb):/)||gl(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===gl(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===gl(e.attributes.name)||"googlebot"===gl(e.attributes.name)||"bingbot"===gl(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===gl(e.attributes.name)||"generator"===gl(e.attributes.name)||"framework"===gl(e.attributes.name)||"publisher"===gl(e.attributes.name)||"progid"===gl(e.attributes.name)||gl(e.attributes.property).match(/^article:/)||gl(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===gl(e.attributes.name)||"yandex-verification"===gl(e.attributes.name)||"csrf-token"===gl(e.attributes.name)||"p:domain_verify"===gl(e.attributes.name)||"verify-v1"===gl(e.attributes.name)||"verification"===gl(e.attributes.name)||"shopify-checkout-api-token"===gl(e.attributes.name)))return!0}}return!1}(F,y)&&(D||F.type!==Ga.Text||F.isStyle||F.textContent.replace(/^\s+|\s+$/gm,"").length)?nl():-2;var U=Object.assign(F,{id:n});if(o.add(e,U),-2===n)return null;I&&I(e);var B=!u;if(U.type===Ga.Element){B=B&&!U.needBlock,delete U.needBlock;var j=e.shadowRoot;j&&$a(j)&&(U.isShadowHost=!0)}if((U.type===Ga.Document||U.type===Ga.Element)&&B){y.headWhitespace&&U.type===Ga.Element&&"head"===U.tagName&&(D=!1);for(var Z={doc:r,mirror:o,blockClass:s,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:u,inlineStylesheet:p,maskInputOptions:f,maskTextFn:m,maskInputFn:g,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:S,preserveWhiteSpace:D,onSerialize:I,onIframeLoad:E,iframeLoadTimeout:T,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:N},z=0,V=Array.from(e.childNodes);z<V.length;z++){($=yl(V[z],Z))&&U.childNodes.push($)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(var G=0,W=Array.from(e.shadowRoot.childNodes);G<W.length;G++){var $;($=yl(W[G],Z))&&($a(e.shadowRoot)&&($.isShadow=!0),U.childNodes.push($))}}return e.parentNode&&Wa(e.parentNode)&&$a(e.parentNode)&&(U.isShadow=!0),U.type===Ga.Element&&"iframe"===U.tagName&&function(e,t,n){var r=e.contentWindow;if(r){var o,s=!1;try{o=r.document.readyState}catch(e){return}if("complete"===o){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(){s||(t(),s=!0)},n);e.addEventListener("load",function(){clearTimeout(a),s=!0,t()})}}}(e,function(){var t=e.contentDocument;if(t&&E){var n=yl(t,{doc:t,mirror:o,blockClass:s,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:f,maskTextFn:m,maskInputFn:g,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:S,preserveWhiteSpace:D,onSerialize:I,onIframeLoad:E,iframeLoadTimeout:T,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:N});n&&E(e,n)}},T),U.type===Ga.Element&&"link"===U.tagName&&"stylesheet"===U.attributes.rel&&function(e,t,n){var r,o=!1;try{r=e.sheet}catch(e){return}if(!r){var s=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(s),o=!0,t()})}}(e,function(){if(k){var t=yl(e,{doc:r,mirror:o,blockClass:s,blockSelector:i,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:f,maskTextFn:m,maskInputFn:g,slimDOMOptions:y,dataURLOptions:b,inlineImages:C,recordCanvas:S,preserveWhiteSpace:D,onSerialize:I,onIframeLoad:E,iframeLoadTimeout:T,onStylesheetLoad:k,stylesheetLoadTimeout:x,keepIframeSrcFn:N});t&&k(e,t)}},x),U}function vl(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const bl="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 wl={map:{},getId:()=>(console.error(bl),-1),getNode:()=>(console.error(bl),null),removeNodeFromMap(){console.error(bl)},has:()=>(console.error(bl),!1),reset(){console.error(bl)}};function Cl(e,t,n={}){let r=null,o=0;return function(...s){const i=Date.now();o||!1!==n.leading||(o=i);const a=t-(i-o),l=this;a<=0||a>t?(r&&(clearTimeout(r),r=null),o=i,e.apply(l,s)):r||!1===n.trailing||(r=setTimeout(()=>{o=!1===n.leading?0:Date.now(),r=null,e.apply(l,s)},a))}}function _l(e,t,n,r,o=window){const s=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),s&&s.set&&s.set.call(this,e)}}),()=>_l(e,t,s||{},!0)}function Sl(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch(e){return()=>{}}}function Il(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function El(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Al(e,t,n,r){if(!e)return!1;const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!o)return!1;if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(dl(o,t,r))return!0;if(n){if(e.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1}function Tl(e,t){return-2===t.getId(e)}function kl(e,t){if(Wa(e))return!1;const n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||kl(e.parentNode,t))}function Ol(e){return Boolean(e.changedTouches)}function xl(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Rl(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Nl(e){return Boolean(null==e?void 0:e.shadowRoot)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(wl=new Proxy(wl,{get:(e,t,n)=>("map"===t&&console.error(bl),Reflect.get(e,t,n))}));class Ml{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 Ll=(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))(Ll||{}),Pl=(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))(Pl||{}),Dl=(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))(Dl||{}),Fl=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Fl||{});function Ul(e){return"__ln"in e}class Bl{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&&Ul(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&&Ul(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 jl=(e,t)=>`${e}@${t}`;class Zl{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 Bl,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 o,s,i,a;let l=null;(null===(s=null===(o=r.getRootNode)||void 0===o?void 0:o.call(r))||void 0===s?void 0:s.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&r.getRootNode().host&&(l=r.getRootNode().host);let c=l;for(;(null===(a=null===(i=null==c?void 0:c.getRootNode)||void 0===i?void 0:i.call(c))||void 0===a?void 0:a.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&c.getRootNode().host;)c=c.getRootNode().host;const u=!(this.doc.contains(r)||c&&this.doc.contains(c));if(!r.parentNode||u)return;const h=Wa(r.parentNode)?this.mirror.getId(l):this.mirror.getId(r.parentNode),p=n(r);if(-1===h||-1===p)return t.addNode(r);const d=yl(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=>{xl(e,this.mirror)&&this.iframeManager.addIframe(e),Rl(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Nl(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)}});d&&e.push({parentId:h,nextId:p,node:d})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of Array.from(this.movedSet.values()))Vl(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||r(e);for(const e of Array.from(this.addedSet.values()))Wl(this.droppedSet,e)||Vl(this.removes,e,this.mirror)?Wl(this.movedSet,e)?r(e):this.droppedSet.add(e):r(e);let o=null;for(;t.length;){let e=null;if(o){const t=this.mirror.getId(o.value.parentNode),r=n(o.value);-1!==t&&-1!==r&&(e=o)}if(!e)for(let r=t.length-1;r>=0;r--){const o=t.get(r);if(o){const t=this.mirror.getId(o.value.parentNode);if(-1===n(o.value))continue;if(-1!==t){e=o;break}{const t=o.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const n=t.parentNode.host;if(-1!==this.mirror.getId(n)){e=o;break}}}}}if(!e){for(;t.head;)t.removeNode(t.head.value);break}o=e.previous,t.removeNode(e.value),r(e.value)}const s={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};(s.texts.length||s.attributes.length||s.removes.length||s.adds.length)&&(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(s))},this.processMutation=e=>{if(!Tl(e.target,this.mirror))switch(e.type){case"characterData":{const t=e.target.textContent;Al(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:fl(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=qa({maskInputOptions:this.maskInputOptions,tagName:e.target.tagName,type:e.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),Al(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 o=r.attributes.style;for(const e of Array.from(t.style)){const r=t.style.getPropertyValue(e),s=t.style.getPropertyPriority(e);r===n.style.getPropertyValue(e)&&s===n.style.getPropertyPriority(e)||(o[e]=""===s?r:[r,s])}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(o[e]=!1)}else r.attributes[e.attributeName]=pl(this.doc,t.tagName,e.attributeName,n);break}case"childList":if(Al(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=Wa(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Al(e.target,this.blockClass,this.blockSelector,!1)||Tl(t,this.mirror)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(zl(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||kl(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[jl(n,r)]?zl(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!(!Wa(e.target)||!$a(e.target))||void 0})),this.mapRemoves.push(t))})}},this.genAdds=(e,t)=>{if(this.mirror.hasNode(e)){if(Tl(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[jl(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Al(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 zl(e,t){e.delete(t),t.childNodes.forEach(t=>zl(e,t))}function Vl(e,t,n){return 0!==e.length&&Gl(e,t,n)}function Gl(e,t,n){const{parentNode:r}=t;if(!r)return!1;const o=n.getId(r);return!!e.some(e=>e.id===o)||Gl(e,r,n)}function Wl(e,t){return 0!==e.size&&$l(e,t)}function $l(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||$l(e,n))}const Hl=[],Yl="undefined"!=typeof CSSGroupingRule,Kl="undefined"!=typeof CSSMediaRule,ql="undefined"!=typeof CSSSupportsRule,Xl="undefined"!=typeof CSSConditionRule;function Jl(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 Ql(e,t){var n,r;const o=new Zl;Hl.push(o),o.init(e);let s=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]&&(s=window[i]);const a=new s(o.processMutations.bind(o));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function ec({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:s}){if(!1===s.mouseInteraction)return()=>{};const i=!0===s.mouseInteraction||void 0===s.mouseInteraction?{}:s.mouseInteraction,a=[];return Object.keys(Dl).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e]).forEach(s=>{const i=s.toLowerCase(),l=(t=>s=>{const i=Jl(s);if(Al(i,r,o,!0))return;const a=Ol(s)?s.changedTouches[0]:s;if(!a)return;const l=n.getId(i),{clientX:c,clientY:u}=a;e({type:Dl[t],id:l,x:c,y:u})})(s);a.push(vl(i,l,t))}),()=>{a.forEach(e=>e())}}function tc({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:s}){return vl("scroll",Cl(s=>{const i=Jl(s);if(!i||Al(i,r,o,!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})},s.scroll||100),t)}function nc(e,t){const n=Object.assign({},e);return t||delete n.userTriggered,n}const rc=["INPUT","TEXTAREA","SELECT"],oc=new WeakMap;function sc(e){return function(e,t){if(Yl&&e.parentRule instanceof CSSGroupingRule||Kl&&e.parentRule instanceof CSSMediaRule||ql&&e.parentRule instanceof CSSSupportsRule||Xl&&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 ic(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function ac({mirror:e,stylesheetManager:t},n){var r,o,s;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===(s=null===(o=n.ownerDocument)||void 0===o?void 0:o.defaultView)||void 0===s?void 0:s.ShadowRoot,l=Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets");return null!==i&&-1!==i&&a&&l?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null===(e=l.get)||void 0===e?void 0:e.call(this)},set(e){var n;const r=null===(n=l.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:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}):()=>{}}function lc(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:s,viewportResizeCb:i,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:h,fontCb:p,selectionCb:d}=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),o(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),s(...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),l(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),c(...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),p(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),d(...e)}}(e,t);const r=Ql(e,e.doc),o=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(!1===t.mousemove)return()=>{};const o="number"==typeof t.mousemove?t.mousemove:50,s="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let i,a=[];const l=Cl(t=>{const n=Date.now()-i;e(a.map(e=>(e.timeOffset-=n,e)),t),a=[],i=null},s),c=Cl(e=>{const t=Jl(e),{clientX:n,clientY:o}=Ol(e)?e.changedTouches[0]:e;i||(i=Date.now()),a.push({x:n,y:o,id:r.getId(t),timeOffset:Date.now()-i}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?Pl.Drag:e instanceof MouseEvent?Pl.MouseMove:Pl.TouchMove)},o,{trailing:!1}),u=[vl("mousemove",c,n),vl("touchmove",c,n),vl("drag",c,n)];return()=>{u.forEach(e=>e())}}(e),s=ec(e),i=tc(e),a=function({viewportResizeCb:e}){let t=-1,n=-1;return vl("resize",Cl(()=>{const r=Il(),o=El();t===r&&n===o||(e({width:Number(o),height:Number(r)}),t=r,n=o)},200),window)}(e),l=function({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,ignoreClass:s,maskInputOptions:i,maskInputFn:a,sampling:l,userTriggeredOnInput:c}){function u(e){let n=Jl(e);const l=e.isTrusted;if(n&&"OPTION"===n.tagName&&(n=n.parentElement),!n||!n.tagName||rc.indexOf(n.tagName)<0||Al(n,r,o,!0))return;const u=n.type;if(n.classList.contains(s))return;let p=n.value,d=!1;"radio"===u||"checkbox"===u?d=n.checked:(i[n.tagName.toLowerCase()]||i[u])&&(p=qa({maskInputOptions:i,tagName:n.tagName,type:u,value:p,maskInputFn:a})),h(n,nc({text:p,isChecked:d,userTriggered:l},c));const f=n.name;"radio"===u&&f&&d&&t.querySelectorAll(`input[type="radio"][name="${f}"]`).forEach(e=>{e!==n&&h(e,nc({text:e.value,isChecked:!d,userTriggered:!1},c))})}function h(t,r){const o=oc.get(t);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){oc.set(t,r);const o=n.getId(t);e(Object.assign(Object.assign({},r),{id:o}))}}const p=("last"===l.input?["change"]:["input","change"]).map(e=>vl(e,u,t)),d=t.defaultView;if(!d)return()=>{p.forEach(e=>e())};const f=d.Object.getOwnPropertyDescriptor(d.HTMLInputElement.prototype,"value"),m=[[d.HTMLInputElement.prototype,"value"],[d.HTMLInputElement.prototype,"checked"],[d.HTMLSelectElement.prototype,"value"],[d.HTMLTextAreaElement.prototype,"value"],[d.HTMLSelectElement.prototype,"selectedIndex"],[d.HTMLOptionElement.prototype,"selected"]];return f&&f.set&&p.push(...m.map(e=>_l(e[0],e[1],{set(){u({target:this})}},!1,d))),()=>{p.forEach(e=>e())}}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:o}){const s=s=>Cl(o=>{const i=Jl(o);if(!i||Al(i,t,n,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:u}=i;e({type:s,id:r.getId(i),currentTime:a,volume:l,muted:c,playbackRate:u})},o.media||500),i=[vl("play",s(0)),vl("pause",s(1)),vl("seeked",s(2)),vl("volumechange",s(3)),vl("ratechange",s(4))];return()=>{i.forEach(e=>e())}}(e),u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){const o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=function(r,s){const{id:i,styleId:a}=ic(this,t,n.styleMirror);return(i&&-1!==i||a&&-1!==a)&&e({id:i,styleId:a,adds:[{rule:r,index:s}]}),o.apply(this,[r,s])};const s=r.CSSStyleSheet.prototype.deleteRule;let i,a;r.CSSStyleSheet.prototype.deleteRule=function(r){const{id:o,styleId:i}=ic(this,t,n.styleMirror);return(o&&-1!==o||i&&-1!==i)&&e({id:o,styleId:i,removes:[{index:r}]}),s.apply(this,[r])},r.CSSStyleSheet.prototype.replace&&(i=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=function(r){const{id:o,styleId:s}=ic(this,t,n.styleMirror);return(o&&-1!==o||s&&-1!==s)&&e({id:o,styleId:s,replace:r}),i.apply(this,[r])}),r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=function(r){const{id:o,styleId:s}=ic(this,t,n.styleMirror);return(o&&-1!==o||s&&-1!==s)&&e({id:o,styleId:s,replaceSync:r}),a.apply(this,[r])});const l={};Yl?l.CSSGroupingRule=r.CSSGroupingRule:(Kl&&(l.CSSMediaRule=r.CSSMediaRule),Xl&&(l.CSSConditionRule=r.CSSConditionRule),ql&&(l.CSSSupportsRule=r.CSSSupportsRule));const c={};return Object.entries(l).forEach(([r,o])=>{c[r]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=function(o,s){const{id:i,styleId:a}=ic(this.parentStyleSheet,t,n.styleMirror);return(i&&-1!==i||a&&-1!==a)&&e({id:i,styleId:a,adds:[{rule:o,index:[...sc(this),s||0]}]}),c[r].insertRule.apply(this,[o,s])},o.prototype.deleteRule=function(o){const{id:s,styleId:i}=ic(this.parentStyleSheet,t,n.styleMirror);return(s&&-1!==s||i&&-1!==i)&&e({id:s,styleId:i,removes:[{index:[...sc(this),o]}]}),c[r].deleteRule.apply(this,[o])}}),()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=s,i&&(r.CSSStyleSheet.prototype.replace=i),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([e,t])=>{t.prototype.insertRule=c[e].insertRule,t.prototype.deleteRule=c[e].deleteRule})}}(e,{win:n}),h=ac(e,e.doc),p=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){const s=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=function(o,i,a){var l;if(n.has(o))return s.apply(this,[o,i,a]);const{id:c,styleId:u}=ic(null===(l=this.parentRule)||void 0===l?void 0:l.parentStyleSheet,t,r.styleMirror);return(c&&-1!==c||u&&-1!==u)&&e({id:c,styleId:u,set:{property:o,value:i,priority:a},index:sc(this.parentRule)}),s.apply(this,[o,i,a])};const i=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=function(o){var s;if(n.has(o))return i.apply(this,[o]);const{id:a,styleId:l}=ic(null===(s=this.parentRule)||void 0===s?void 0:s.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,remove:{property:o},index:sc(this.parentRule)}),i.apply(this,[o])},()=>{o.CSSStyleDeclaration.prototype.setProperty=s,o.CSSStyleDeclaration.prototype.removeProperty=i}}(e,{win:n}),d=e.collectFonts?function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,s=n.FontFace;n.FontFace=function(e,t,n){const r=new s(e,t,n);return o.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=Sl(t.fonts,"add",function(t){return function(n){return setTimeout(()=>{const t=o.get(n);t&&(e(t),o.delete(n))},0),t.apply(this,[n])}});return r.push(()=>{n.FontFace=s}),r.push(i),()=>{r.forEach(e=>e())}}(e):()=>{},f=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:o,selectionCb:s}=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=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const s=e.getRangeAt(t),{startContainer:i,startOffset:l,endContainer:c,endOffset:u}=s;Al(i,r,o,!0)||Al(c,r,o,!0)||a.push({start:n.getId(i),startOffset:l,end:n.getId(c),endOffset:u})}s({ranges:a})};return a(),vl("selectionchange",a)}(e),m=[];for(const t of e.plugins)m.push(t.observer(t.callback,n,t.options));return()=>{Hl.forEach(e=>e.reset()),r.disconnect(),o(),s(),i(),a(),l(),c(),u(),h(),p(),d(),f(),m.forEach(e=>e())}}class cc{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,r){const o=n||this.getIdToRemoteIdMap(e),s=r||this.getRemoteIdToIdMap(e);let i=o.get(t);return i||(i=this.generateIdFn(),o.set(t,i),s.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 o=r.get(t);return o||-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 uc{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new cc(nl),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new cc(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 Ll.FullSnapshot:return this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e),{timestamp:t.timestamp,type:Ll.IncrementalSnapshot,data:{source:Pl.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Ll.Meta:case Ll.Load:case Ll.DomContentLoaded:return!1;case Ll.Plugin:return t;case Ll.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Ll.IncrementalSnapshot:switch(t.data.source){case Pl.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 Pl.Drag:case Pl.TouchMove:case Pl.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Pl.ViewportResize:return!1;case Pl.MediaInteraction:case Pl.MouseInteraction:case Pl.Scroll:case Pl.CanvasMutation:case Pl.Input:return this.replaceIds(t.data,e,["id"]),t;case Pl.StyleSheetRule:case Pl.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Pl.Font:return t;case Pl.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case Pl.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 o of r)(Array.isArray(t[o])||"number"==typeof t[o])&&(Array.isArray(t[o])?t[o]=e.getIds(n,t[o]):t[o]=e.getId(n,t[o]));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 hc{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(Sl(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){$a(e)&&(this.shadowDoms.has(e)||(this.shadowDoms.add(e),Ql(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),tc(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)),ac({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)},0)))}observeAttachShadow(e){if(e.contentWindow){const t=this;this.restorePatches.push(Sl(e.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(r){const o=n.call(this,r);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),o}}))}}reset(){this.restorePatches.forEach(e=>e()),this.shadowDoms=new WeakSet}}
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */function pc(e,t,n,r){return new(n||(n=Promise))(function(t,o){function s(e){try{a(r.next(e))}catch(e){o(e)}}function i(e){try{a(r.throw(e))}catch(e){o(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(s,i)}a((r=r.apply(e,[])).next())})}for(var dc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fc="undefined"==typeof Uint8Array?[]:new Uint8Array(256),mc=0;mc<64;mc++)fc[dc.charCodeAt(mc)]=mc;const gc=new Map;const yc=(e,t,n)=>{if(!e||!wc(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=gc.get(e);return n||(n=new Map,gc.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let o=r.indexOf(e);return-1===o&&(o=r.length,r.push(e)),o};function vc(e,t,n){if(e instanceof Array)return e.map(e=>vc(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,o="";for(t=0;t<r;t+=3)o+=dc[n[t]>>2],o+=dc[(3&n[t])<<4|n[t+1]>>4],o+=dc[(15&n[t+1])<<2|n[t+2]>>6],o+=dc[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e);return{rr_type:t,base64:n}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[vc(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:[vc(e.data,t,n),e.width,e.height]}}if(wc(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:yc(e,t,n)}}return e}const bc=(e,t,n)=>[...e].map(e=>vc(e,t,n)),wc=(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 Cc(e,t,n){const r=[];try{const o=Sl(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(r,...o){return Al(this,t,n,!0)||"__context"in this||(this.__context=r),e.apply(this,[r,...o])}});r.push(o)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(e=>e())}}function _c(e,t,n,r,o,s,i){const a=[],l=Object.getOwnPropertyNames(e);for(const s of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(s))try{if("function"!=typeof e[s])continue;const l=Sl(e,s,function(e){return function(...a){const l=e.apply(this,a);if(yc(l,i,this),!Al(this.canvas,r,o,!0)){const e=bc([...a],i,this),r={type:t,property:s,args:e};n(this.canvas,r)}return l}});a.push(l)}catch(r){const o=_l(e,s,{set(e){n(this.canvas,{type:t,property:s,args:[e],setter:!0})}});a.push(o)}return a}var Sc=null;try{var Ic="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");Sc=Ic.Worker}catch(e){}function Ec(e,t,n){var r=function(e){return Buffer.from(e,"base64").toString("utf8")}(e),o=r.indexOf("\n",10)+1,s=r.substring(o)+"";return function(e){return new Sc(s,Object.assign({},e,{eval:!0}))}}function Ac(e,t,n){var r=function(e){return atob(e)}(e),o=r.indexOf("\n",10)+1,s=r.substring(o)+"",i=new Blob([s],{type:"application/javascript"});return URL.createObjectURL(i)}var Tc="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);var kc=function(e){return Tc?Ec(e):function(e){var t;return function(n){return t=t||Ac(e),new Worker(t,n)}}(e)}("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=");class Oc{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:o,recordCanvas:s,dataURLOptions:i}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,s&&"all"===t&&this.initCanvasMutationObserver(n,r,o),s&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,o,{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,o){const s=Cc(t,n,r),i=new Map,a=new kc;a.onmessage=e=>{const{id:t}=e.data;if(i.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:o,height:s}=e.data;this.mutationCb({id:t,type:Fl["2D"],commands:[{property:"clearRect",args:[0,0,o,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const l=1e3/e;let c,u=0;const h=e=>{u&&e-u<l||(u=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{Al(t,n,r,!0)||e.push(t)}),e})().forEach(e=>pc(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:o.dataURLOptions},[r])}))),c=requestAnimationFrame(h)};c=requestAnimationFrame(h),this.resetObservers=()=>{s(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=Cc(e,t,n),o=function(e,t,n,r){const o=[],s=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const i of s)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])continue;const s=Sl(t.CanvasRenderingContext2D.prototype,i,function(o){return function(...s){return Al(this.canvas,n,r,!0)||setTimeout(()=>{const n=bc([...s],t,this);e(this.canvas,{type:Fl["2D"],property:i,args:n})},0),o.apply(this,s)}});o.push(s)}catch(n){const r=_l(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:Fl["2D"],property:i,args:[t],setter:!0})}});o.push(r)}return()=>{o.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n),s=function(e,t,n,r){const o=[];return o.push(..._c(t.WebGLRenderingContext.prototype,Fl.WebGL,e,n,r,0,t)),void 0!==t.WebGL2RenderingContext&&o.push(..._c(t.WebGL2RenderingContext.prototype,Fl.WebGL2,e,n,r,0,t)),()=>{o.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=()=>{r(),o(),s()}}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 o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["type"]);return t}),{type:o}=n[0];this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}class xc{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new Ml,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:Ya(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 Rc(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}let Nc,Mc,Lc,Pc=!1;const Dc=new Ka;function Fc(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:s=null,ignoreClass:i="rr-ignore",maskTextClass:a="rr-mask",maskTextSelector:l=null,inlineStylesheet:c=!0,maskAllInputs:u,maskInputOptions:h,slimDOMOptions:p,maskInputFn:d,maskTextFn:f,hooks:m,packFn:g,sampling:y={},dataURLOptions:v={},mousemoveWait:b,recordCanvas:w=!1,recordCrossOriginIframes:C=!1,userTriggeredOnInput:_=!1,collectFonts:S=!1,inlineImages:I=!1,plugins:E,keepIframeSrcFn:A=()=>!1,ignoreCSSAttributes:T=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),Dc.reset();const x=!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},R=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p}:p||{};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 M=0;const L=e=>{for(const t of E||[])t.eventProcessor&&(e=t.eventProcessor(e));return g&&(e=g(e)),e};Nc=(e,o)=>{var s;if(!(null===(s=Hl[0])||void 0===s?void 0:s.isFrozen())||e.type===Ll.FullSnapshot||e.type===Ll.IncrementalSnapshot&&e.data.source===Pl.Mutation||Hl.forEach(e=>e.unfreeze()),k)null==t||t(L(e),o);else if(O){const t={type:"rrweb",event:L(e),isCheckout:o};window.parent.postMessage(t,"*")}if(e.type===Ll.FullSnapshot)N=e,M=0;else if(e.type===Ll.IncrementalSnapshot){if(e.data.source===Pl.Mutation&&e.data.isAttachIframe)return;M++;const t=r&&M>=r,o=n&&e.timestamp-N.timestamp>n;(t||o)&&Mc(!0)}};const P=e=>{Nc(Rc({type:Ll.IncrementalSnapshot,data:Object.assign({source:Pl.Mutation},e)}))},D=e=>Nc(Rc({type:Ll.IncrementalSnapshot,data:Object.assign({source:Pl.Scroll},e)})),F=e=>Nc(Rc({type:Ll.IncrementalSnapshot,data:Object.assign({source:Pl.CanvasMutation},e)})),U=new xc({mutationCb:P,adoptedStyleSheetCb:e=>Nc(Rc({type:Ll.IncrementalSnapshot,data:Object.assign({source:Pl.AdoptedStyleSheet},e)}))}),B=new uc({mirror:Dc,mutationCb:P,stylesheetManager:U,recordCrossOriginIframes:C,wrappedEmit:Nc});for(const e of E||[])e.getMirror&&e.getMirror({nodeMirror:Dc,crossOriginIframeMirror:B.crossOriginIframeMirror,crossOriginIframeStyleMirror:B.crossOriginIframeStyleMirror});Lc=new Oc({recordCanvas:w,mutationCb:F,win:window,blockClass:o,blockSelector:s,mirror:Dc,sampling:y.canvas,dataURLOptions:v});const j=new hc({mutationCb:P,scrollCb:D,bypassOptions:{blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,inlineStylesheet:c,maskInputOptions:x,dataURLOptions:v,maskTextFn:f,maskInputFn:d,recordCanvas:w,inlineImages:I,sampling:y,slimDOMOptions:R,iframeManager:B,stylesheetManager:U,canvasManager:Lc,keepIframeSrcFn:A},mirror:Dc});Mc=(e=!1)=>{var t,n,r,i,u,h;Nc(Rc({type:Ll.Meta,data:{href:window.location.href,width:El(),height:Il()}}),e),U.reset(),Hl.forEach(e=>e.lock());const p=function(e,t){var n=t||{},r=n.mirror,o=void 0===r?new Ka:r,s=n.blockClass,i=void 0===s?"rr-block":s,a=n.blockSelector,l=void 0===a?null:a,c=n.maskTextClass,u=void 0===c?"rr-mask":c,h=n.maskTextSelector,p=void 0===h?null:h,d=n.inlineStylesheet,f=void 0===d||d,m=n.inlineImages,g=void 0!==m&&m,y=n.recordCanvas,v=void 0!==y&&y,b=n.maskAllInputs,w=void 0!==b&&b,C=n.maskTextFn,_=n.maskInputFn,S=n.slimDOM,I=void 0!==S&&S,E=n.dataURLOptions,A=n.preserveWhiteSpace,T=n.onSerialize,k=n.onIframeLoad,O=n.iframeLoadTimeout,x=n.onStylesheetLoad,R=n.stylesheetLoadTimeout,N=n.keepIframeSrcFn;return yl(e,{doc:e,mirror:o,blockClass:i,blockSelector:l,maskTextClass:u,maskTextSelector:p,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:_,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:g,recordCanvas:v,preserveWhiteSpace:A,onSerialize:T,onIframeLoad:k,iframeLoadTimeout:O,onStylesheetLoad:x,stylesheetLoadTimeout:R,keepIframeSrcFn:void 0===N?function(){return!1}:N,newlyAddedElement:!1})}(document,{mirror:Dc,blockClass:o,blockSelector:s,maskTextClass:a,maskTextSelector:l,inlineStylesheet:c,maskAllInputs:x,maskTextFn:f,slimDOM:R,dataURLOptions:v,recordCanvas:w,inlineImages:I,onSerialize:e=>{xl(e,Dc)&&B.addIframe(e),Rl(e,Dc)&&U.trackLinkElement(e),Nl(e)&&j.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{B.attachIframe(e,t),j.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{U.attachLinkElement(e,t)},keepIframeSrcFn:A});if(!p)return console.warn("Failed to snapshot the document");Nc(Rc({type:Ll.FullSnapshot,data:{node:p,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}}})),Hl.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&U.adoptStyleSheets(document.adoptedStyleSheets,Dc.getId(document))};try{const e=[];e.push(vl("DOMContentLoaded",()=>{Nc(Rc({type:Ll.DomContentLoaded,data:{}}))}));const t=e=>{var t;return lc({mutationCb:P,mousemoveCb:(e,t)=>Nc(Rc({type:Ll.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>Nc(Rc({type:Ll.IncrementalSnapshot,data:Object.assign({source:Pl.MouseInteraction},e)})),scrollCb:D,viewportResizeCb:e=>Nc(Rc({type:Ll.IncrementalSnapshot,data:Object.assign({source:Pl.ViewportResize},e)})),inputCb:e=>Nc(Rc({type:Ll.IncrementalSnapshot,data:Object.assign({source:Pl.Input},e)})),mediaInteractionCb:e=>Nc(Rc({type:Ll.IncrementalSnapshot,data:Object.assign({source:Pl.MediaInteraction},e)})),styleSheetRuleCb:e=>Nc(Rc({type:Ll.IncrementalSnapshot,data:Object.assign({source:Pl.StyleSheetRule},e)})),styleDeclarationCb:e=>Nc(Rc({type:Ll.IncrementalSnapshot,data:Object.assign({source:Pl.StyleDeclaration},e)})),canvasMutationCb:F,fontCb:e=>Nc(Rc({type:Ll.IncrementalSnapshot,data:Object.assign({source:Pl.Font},e)})),selectionCb:e=>{Nc(Rc({type:Ll.IncrementalSnapshot,data:Object.assign({source:Pl.Selection},e)}))},blockClass:o,ignoreClass:i,maskTextClass:a,maskTextSelector:l,maskInputOptions:x,inlineStylesheet:c,sampling:y,recordCanvas:w,inlineImages:I,userTriggeredOnInput:_,collectFonts:S,doc:e,maskInputFn:d,maskTextFn:f,keepIframeSrcFn:A,blockSelector:s,slimDOMOptions:R,dataURLOptions:v,mirror:Dc,iframeManager:B,stylesheetManager:U,shadowDomManager:j,canvasManager:Lc,ignoreCSSAttributes:T,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=>Nc(Rc({type:Ll.Plugin,data:{plugin:e.name,payload:t}}))})))||[]},m)};B.addLoadListener(n=>{e.push(t(n.contentDocument))});const n=()=>{Mc(),e.push(t(document)),Pc=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():e.push(vl("load",()=>{Nc(Rc({type:Ll.Load,data:{}})),n()},window)),()=>{e.forEach(e=>e()),Pc=!1}}catch(e){console.warn(e)}}Fc.addCustomEvent=(e,t)=>{if(!Pc)throw new Error("please add custom event after start recording");Nc(Rc({type:Ll.Custom,data:{tag:e,payload:t}}))},Fc.freezePage=()=>{Hl.forEach(e=>e.freeze())},Fc.takeFullSnapshot=e=>{if(!Pc)throw new Error("please take full snapshot after start recording");Mc(e)},Fc.mirror=Dc;class Uc{constructor(e,t){this.events=[],this.sessionId=t,this.config=e,this.save=this.save.bind(this),this.events=[],this.configure=this.configure.bind(this),window.addEventListener("unload",()=>this.save())}configure(){var e;Fc({emit:e=>{this.events.push(e)},plugins:[(e={level:["info","log","warn","error"],lengthThreshold:1e4,stringifyOptions:{stringLengthLimit:1e3,numOfKeysLimit:100,depthOfLimit:1}},{name:"rrweb/console@1",observer:Va,options:e})]}),setInterval(this.save,15e3)}save(){if(0===this.events.length)return;let{replayEventsBaseUrl:e,projectId:t}=this.config;e=e?`${e}/rrweb/${t}`:`https://app.apitoolkit.io/rrweb/${t}`;const n=this.events;this.events=[];const r=JSON.stringify({events:n,sessionId:this.sessionId,timestamp:(new Date).toISOString()});fetch(e,{mode:"no-cors",method:"POST",headers:{"Content-Type":"application/json"},body:r}).catch(e=>{console.error("Failed to save replay events:",e),this.events=[...n,...this.events]})}}var Bc="object"==typeof globalThis?globalThis:global,jc="1.9.0",Zc=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;var zc=function(e){var t=new Set([e]),n=new Set,r=e.match(Zc);if(!r)return function(){return!1};var o=+r[1],s=+r[2],i=+r[3];if(null!=r[4])return function(t){return t===e};function a(e){return n.add(e),!1}function l(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;var r=e.match(Zc);if(!r)return a(e);var c=+r[1],u=+r[2],h=+r[3];return null!=r[4]||o!==c?a(e):0===o?s===u&&i<=h?l(e):a(e):s<=u?l(e):a(e)}}(jc),Vc=jc.split(".")[0],Gc=Symbol.for("opentelemetry.js.api."+Vc),Wc=Bc;function $c(e,t,n,r){var o;void 0===r&&(r=!1);var s=Wc[Gc]=null!==(o=Wc[Gc])&&void 0!==o?o:{version:jc};if(!r&&s[e]){var i=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return n.error(i.stack||i.message),!1}if(s.version!==jc){i=new Error("@opentelemetry/api: Registration of version v"+s.version+" for "+e+" does not match previously registered API v"+jc);return n.error(i.stack||i.message),!1}return s[e]=t,n.debug("@opentelemetry/api: Registered a global for "+e+" v"+jc+"."),!0}function Hc(e){var t,n,r=null===(t=Wc[Gc])||void 0===t?void 0:t.version;if(r&&zc(r))return null===(n=Wc[Gc])||void 0===n?void 0:n[e]}function Yc(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+jc+".");var n=Wc[Gc];n&&delete n[e]}var Kc,qc=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,s=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return i},Xc=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,s=t.length;o<s;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},Jc=function(){function e(e){this._namespace=e.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Qc("debug",this._namespace,e)},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Qc("error",this._namespace,e)},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Qc("info",this._namespace,e)},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Qc("warn",this._namespace,e)},e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Qc("verbose",this._namespace,e)},e}();function Qc(e,t,n){var r=Hc("diag");if(r)return n.unshift(t),r[e].apply(r,Xc([],qc(n),!1))}!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"}(Kc||(Kc={}));var eu=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,s=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return i},tu=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,s=t.length;o<s;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},nu=function(){function e(){function e(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=Hc("diag");if(r)return r[e].apply(r,tu([],eu(t),!1))}}var t=this;t.setLogger=function(e,n){var r,o,s;if(void 0===n&&(n={logLevel:Kc.INFO}),e===t){var i=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=i.stack)&&void 0!==r?r:i.message),!1}"number"==typeof n&&(n={logLevel:n});var a=Hc("diag"),l=function(e,t){function n(n,r){var o=t[n];return"function"==typeof o&&e>=r?o.bind(t):function(){}}return e<Kc.NONE?e=Kc.NONE:e>Kc.ALL&&(e=Kc.ALL),t=t||{},{error:n("error",Kc.ERROR),warn:n("warn",Kc.WARN),info:n("info",Kc.INFO),debug:n("debug",Kc.DEBUG),verbose:n("verbose",Kc.VERBOSE)}}(null!==(o=n.logLevel)&&void 0!==o?o:Kc.INFO,e);if(a&&!n.suppressOverrideMessage){var c=null!==(s=(new Error).stack)&&void 0!==s?s:"<failed to generate stacktrace>";a.warn("Current logger will be overwritten from "+c),l.warn("Current logger will overwrite one already registered from "+c)}return $c("diag",l,t,!0)},t.disable=function(){Yc("diag",t)},t.createComponentLogger=function(e){return new Jc(e)},t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e}(),ru=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,s=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return i},ou=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},su=function(){function e(e){this._entries=e?new Map(e):new Map}return e.prototype.getEntry=function(e){var t=this._entries.get(e);if(t)return Object.assign({},t)},e.prototype.getAllEntries=function(){return Array.from(this._entries.entries()).map(function(e){var t=ru(e,2);return[t[0],t[1]]})},e.prototype.setEntry=function(t,n){var r=new e(this._entries);return r._entries.set(t,n),r},e.prototype.removeEntry=function(t){var n=new e(this._entries);return n._entries.delete(t),n},e.prototype.removeEntries=function(){for(var t,n,r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];var s=new e(this._entries);try{for(var i=ou(r),a=i.next();!a.done;a=i.next()){var l=a.value;s._entries.delete(l)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return s},e.prototype.clear=function(){return new e},e}(),iu=Symbol("BaggageEntryMetadata"),au=nu.instance();function lu(e){return void 0===e&&(e={}),new su(new Map(Object.entries(e)))}function cu(e){return Symbol.for(e)}var uu,hu,pu=function e(t){var n=this;n._currentContext=t?new Map(t):new Map,n.getValue=function(e){return n._currentContext.get(e)},n.setValue=function(t,r){var o=new e(n._currentContext);return o._currentContext.set(t,r),o},n.deleteValue=function(t){var r=new e(n._currentContext);return r._currentContext.delete(t),r}},du=new pu,fu=(uu=function(e,t){return uu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},uu(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}uu(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),mu=function(){function e(){}return e.prototype.createGauge=function(e,t){return Tu},e.prototype.createHistogram=function(e,t){return ku},e.prototype.createCounter=function(e,t){return Au},e.prototype.createUpDownCounter=function(e,t){return Ou},e.prototype.createObservableGauge=function(e,t){return Ru},e.prototype.createObservableCounter=function(e,t){return xu},e.prototype.createObservableUpDownCounter=function(e,t){return Nu},e.prototype.addBatchObservableCallback=function(e,t){},e.prototype.removeBatchObservableCallback=function(e){},e}(),gu=function(){},yu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return fu(t,e),t.prototype.add=function(e,t){},t}(gu),vu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return fu(t,e),t.prototype.add=function(e,t){},t}(gu),bu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return fu(t,e),t.prototype.record=function(e,t){},t}(gu),wu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return fu(t,e),t.prototype.record=function(e,t){},t}(gu),Cu=function(){function e(){}return e.prototype.addCallback=function(e){},e.prototype.removeCallback=function(e){},e}(),_u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return fu(t,e),t}(Cu),Su=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return fu(t,e),t}(Cu),Iu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return fu(t,e),t}(Cu),Eu=new mu,Au=new yu,Tu=new bu,ku=new wu,Ou=new vu,xu=new _u,Ru=new Su,Nu=new Iu,Mu={get:function(e,t){if(null!=e)return e[t]},keys:function(e){return null==e?[]:Object.keys(e)}},Lu={set:function(e,t,n){null!=e&&(e[t]=n)}},Pu=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,s=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return i},Du=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,s=t.length;o<s;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},Fu=function(){function e(){}return e.prototype.active=function(){return du},e.prototype.with=function(e,t,n){for(var r=[],o=3;o<arguments.length;o++)r[o-3]=arguments[o];return t.call.apply(t,Du([n],Pu(r),!1))},e.prototype.bind=function(e,t){return t},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e}(),Uu=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,s=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return i},Bu=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,s=t.length;o<s;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},ju="context",Zu=new Fu,zu=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(e){return $c(ju,e,nu.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(e,t,n){for(var r,o=[],s=3;s<arguments.length;s++)o[s-3]=arguments[s];return(r=this._getContextManager()).with.apply(r,Bu([e,t,n],Uu(o),!1))},e.prototype.bind=function(e,t){return this._getContextManager().bind(e,t)},e.prototype._getContextManager=function(){return Hc(ju)||Zu},e.prototype.disable=function(){this._getContextManager().disable(),Yc(ju,nu.instance())},e}();!function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"}(hu||(hu={}));var Vu="0000000000000000",Gu="00000000000000000000000000000000",Wu={traceId:Gu,spanId:Vu,traceFlags:hu.NONE},$u=function(){function e(e){void 0===e&&(e=Wu),this._spanContext=e}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(e,t){return this},e.prototype.setAttributes=function(e){return this},e.prototype.addEvent=function(e,t){return this},e.prototype.addLink=function(e){return this},e.prototype.addLinks=function(e){return this},e.prototype.setStatus=function(e){return this},e.prototype.updateName=function(e){return this},e.prototype.end=function(e){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(e,t){},e}(),Hu=cu("OpenTelemetry Context Key SPAN");function Yu(e){return e.getValue(Hu)||void 0}function Ku(){return Yu(zu.getInstance().active())}function qu(e,t){return e.setValue(Hu,t)}function Xu(e){return e.deleteValue(Hu)}function Ju(e,t){return qu(e,new $u(t))}function Qu(e){var t;return null===(t=Yu(e))||void 0===t?void 0:t.spanContext()}var eh=/^([0-9a-f]{32})$/i,th=/^[0-9a-f]{16}$/i;function nh(e){return eh.test(e)&&e!==Gu}function rh(e){return nh(e.traceId)&&(t=e.spanId,th.test(t)&&t!==Vu);var t}function oh(e){return new $u(e)}var sh=zu.getInstance(),ih=function(){function e(){}return e.prototype.startSpan=function(e,t,n){if(void 0===n&&(n=sh.active()),Boolean(null==t?void 0:t.root))return new $u;var r,o=n&&Qu(n);return"object"==typeof(r=o)&&"string"==typeof r.spanId&&"string"==typeof r.traceId&&"number"==typeof r.traceFlags&&rh(o)?new $u(o):new $u},e.prototype.startActiveSpan=function(e,t,n,r){var o,s,i;if(!(arguments.length<2)){2===arguments.length?i=t:3===arguments.length?(o=t,i=n):(o=t,s=n,i=r);var a=null!=s?s:sh.active(),l=this.startSpan(e,o,a),c=qu(a,l);return sh.with(c,i,void 0,l)}},e}();var ah,lh,ch,uh=new ih,hh=function(){function e(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}return e.prototype.startSpan=function(e,t,n){return this._getTracer().startSpan(e,t,n)},e.prototype.startActiveSpan=function(e,t,n,r){var o=this._getTracer();return Reflect.apply(o.startActiveSpan,o,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):uh},e}(),ph=new(function(){function e(){}return e.prototype.getTracer=function(e,t,n){return new ih},e}()),dh=function(){function e(){}return e.prototype.getTracer=function(e,t,n){var r;return null!==(r=this.getDelegateTracer(e,t,n))&&void 0!==r?r:new hh(this,e,t,n)},e.prototype.getDelegate=function(){var e;return null!==(e=this._delegate)&&void 0!==e?e:ph},e.prototype.setDelegate=function(e){this._delegate=e},e.prototype.getDelegateTracer=function(e,t,n){var r;return null===(r=this._delegate)||void 0===r?void 0:r.getTracer(e,t,n)},e}();!function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(ah||(ah={})),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"}(lh||(lh={})),function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"}(ch||(ch={}));var fh=zu.getInstance(),mh=nu.instance(),gh=new(function(){function e(){}return e.prototype.getMeter=function(e,t,n){return Eu},e}()),yh="metrics",vh=function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalMeterProvider=function(e){return $c(yh,e,nu.instance())},e.prototype.getMeterProvider=function(){return Hc(yh)||gh},e.prototype.getMeter=function(e,t,n){return this.getMeterProvider().getMeter(e,t,n)},e.prototype.disable=function(){Yc(yh,nu.instance())},e}().getInstance(),bh=function(){function e(){}return e.prototype.inject=function(e,t){},e.prototype.extract=function(e,t){return e},e.prototype.fields=function(){return[]},e}(),wh=cu("OpenTelemetry Baggage Key");function Ch(e){return e.getValue(wh)||void 0}function _h(){return Ch(zu.getInstance().active())}function Sh(e,t){return e.setValue(wh,t)}function Ih(e){return e.deleteValue(wh)}var Eh="propagation",Ah=new bh,Th=function(){function e(){this.createBaggage=lu,this.getBaggage=Ch,this.getActiveBaggage=_h,this.setBaggage=Sh,this.deleteBaggage=Ih}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalPropagator=function(e){return $c(Eh,e,nu.instance())},e.prototype.inject=function(e,t,n){return void 0===n&&(n=Lu),this._getGlobalPropagator().inject(e,t,n)},e.prototype.extract=function(e,t,n){return void 0===n&&(n=Mu),this._getGlobalPropagator().extract(e,t,n)},e.prototype.fields=function(){return this._getGlobalPropagator().fields()},e.prototype.disable=function(){Yc(Eh,nu.instance())},e.prototype._getGlobalPropagator=function(){return Hc(Eh)||Ah},e}(),kh=Th.getInstance(),Oh="trace",xh=function(){function e(){this._proxyTracerProvider=new dh,this.wrapSpanContext=oh,this.isSpanContextValid=rh,this.deleteSpan=Xu,this.getSpan=Yu,this.getActiveSpan=Ku,this.getSpanContext=Qu,this.setSpan=qu,this.setSpanContext=Ju}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(e){var t=$c(Oh,this._proxyTracerProvider,nu.instance());return t&&this._proxyTracerProvider.setDelegate(e),t},e.prototype.getTracerProvider=function(){return Hc(Oh)||this._proxyTracerProvider},e.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},e.prototype.disable=function(){Yc(Oh,nu.instance()),this._proxyTracerProvider=new dh},e}().getInstance();const Rh=cu("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Nh(e){return!0===e.getValue(Rh)}const Mh=",",Lh="baggage";function Ph(e){const t=e.split(";");if(t.length<=0)return;const n=t.shift();if(!n)return;const r=n.indexOf("=");if(r<=0)return;const o=decodeURIComponent(n.substring(0,r).trim()),s=decodeURIComponent(n.substring(r+1).trim());let i;var a;return t.length>0&&("string"!=typeof(a=t.join(";"))&&(au.error("Cannot create baggage metadata from unknown type: "+typeof a),a=""),i={__TYPE__:iu,toString:function(){return a}}),{key:o,value:s,metadata:i}}function Dh(e){const t={};return"string"==typeof e&&e.length>0&&e.split(Mh).forEach(e=>{const n=Ph(e);void 0!==n&&n.value.length>0&&(t[n.key]=n.value)}),t}class Fh{inject(e,t,n){const r=kh.getBaggage(e);if(!r||Nh(e))return;const o=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),s=function(e){return e.reduce((e,t)=>{const n=`${e}${""!==e?Mh:""}${t}`;return n.length>8192?e:n},"")}(o);s.length>0&&n.set(t,Lh,s)}extract(e,t,n){const r=n.get(t,Lh),o=Array.isArray(r)?r.join(Mh):r;if(!o)return e;const s={};if(0===o.length)return e;return o.split(Mh).forEach(e=>{const t=Ph(e);if(t){const e={value:t.value};t.metadata&&(e.metadata=t.metadata),s[t.key]=e}}),0===Object.entries(s).length?e:kh.setBaggage(e,kh.createBaggage(s))}fields(){return[Lh]}}function Uh(e){const t={};if("object"!=typeof e||null==e)return t;for(const[n,r]of Object.entries(e))Bh(n)?jh(r)?Array.isArray(r)?t[n]=r.slice():t[n]=r:mh.warn(`Invalid attribute value set for key: ${n}`):mh.warn(`Invalid attribute key: ${n}`);return t}function Bh(e){return"string"==typeof e&&e.length>0}function jh(e){return null==e||(Array.isArray(e)?function(e){let t;for(const n of e)if(null!=n){if(!t){if(Zh(n)){t=typeof n;continue}return!1}if(typeof n!==t)return!1}return!0}(e):Zh(e))}function Zh(e){switch(typeof e){case"number":case"boolean":case"string":return!0}return!1}let zh=e=>{mh.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 Vh(e){try{zh(e)}catch{}}function Gh(e){const t=process.env[e];if(null==t||""===t.trim())return;const r=Number(t);if(!isNaN(r))return r;mh.warn(`Unknown value ${n.inspect(t)} for ${e}, expected a number, using defaults`)}function Wh(e){const t=process.env[e];if(null!=t&&""!==t.trim())return t}function $h(e){return Wh(e)?.split(",").map(e=>e.trim()).filter(e=>""!==e)}const Hh="object"==typeof globalThis?globalThis:global,Yh=e.performance,Kh="http.url",qh="error.type",Xh="exception.message",Jh="exception.type",Qh="http.request.method",ep="http.request.method_original",tp="http.response.status_code",np="server.address",rp="server.port",op="service.name",sp="telemetry.sdk.language",ip="telemetry.sdk.name",ap="telemetry.sdk.version",lp="url.full",cp="process.runtime.name",up={[ip]:"opentelemetry",[cp]:"node",[sp]:"nodejs",[ap]:"2.0.1"};const hp=Math.pow(10,6),pp=Math.pow(10,9);function dp(e){const t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*hp)]}function fp(){let e=Yh.timeOrigin;if("number"!=typeof e){const t=Yh;e=t.timing&&t.timing.fetchStart}return e}function mp(e){return wp(dp(fp()),dp("number"==typeof e?e:Yh.now()))}function gp(e){if(vp(e))return e;if("number"==typeof e)return e<fp()?mp(e):dp(e);if(e instanceof Date)return dp(e.getTime());throw TypeError("Invalid input type")}function yp(e){return e[0]*pp+e[1]}function vp(e){return Array.isArray(e)&&2===e.length&&"number"==typeof e[0]&&"number"==typeof e[1]}function bp(e){return vp(e)||"number"==typeof e||e instanceof Date}function wp(e,t){const n=[e[0]+t[0],e[1]+t[1]];return n[1]>=pp&&(n[1]-=pp,n[0]+=1),n}var Cp;!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"}(Cp||(Cp={}));class _p{_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){mh.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){mh.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}}const Sp="[_0-9a-z-*/]",Ip=new RegExp(`^(?:${`[a-z]${Sp}{0,255}`}|${`[a-z0-9]${Sp}{0,240}@[a-z]${Sp}{0,13}`})$`),Ep=/^[ -~]{0,255}[!-~]$/,Ap=/,|=/;class Tp{_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 o=n.slice(0,r),s=n.slice(r+1,t.length);(function(e){return Ip.test(e)})(o)&&function(e){return Ep.test(e)&&!Ap.test(e)}(s)&&e.set(o,s)}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 Tp;return e._internalState=new Map(this._internalState),e}}const kp="traceparent",Op="tracestate",xp=new RegExp("^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$");class Rp{inject(e,t,n){const r=xh.getSpanContext(e);if(!r||Nh(e)||!rh(r))return;const o=`00-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||hu.NONE).toString(16)}`;n.set(t,kp,o),r.traceState&&n.set(t,Op,r.traceState.serialize())}extract(e,t,n){const r=n.get(t,kp);if(!r)return e;const o=Array.isArray(r)?r[0]:r;if("string"!=typeof o)return e;const s=function(e){const t=xp.exec(e);return t?"00"===t[1]&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}:null}(o);if(!s)return e;s.isRemote=!0;const i=n.get(t,Op);if(i){const e=Array.isArray(i)?i.join(","):i;s.traceState=new Tp("string"==typeof e?e:void 0)}return xh.setSpanContext(e,s)}fields(){return[kp,Op]}}const Np="[object Null]",Mp="[object Undefined]",Lp=Function.prototype.toString,Pp=Lp.call(Object),Dp=Object.getPrototypeOf,Fp=Object.prototype,Up=Fp.hasOwnProperty,Bp=Symbol?Symbol.toStringTag:void 0,jp=Fp.toString;function Zp(e){if(!function(e){return null!=e&&"object"==typeof e}(e)||"[object Object]"!==function(e){if(null==e)return void 0===e?Mp:Np;return Bp&&Bp in Object(e)?function(e){const t=Up.call(e,Bp),n=e[Bp];let r=!1;try{e[Bp]=void 0,r=!0}catch(e){}const o=jp.call(e);r&&(t?e[Bp]=n:delete e[Bp]);return o}(e):function(e){return jp.call(e)}(e)}(e))return!1;const t=Dp(e);if(null===t)return!0;const n=Up.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Lp.call(n)===Pp}function zp(e){return Wp(e)?e.slice():e}function Vp(e,t,n=0,r){let o;if(!(n>20)){if(n++,Yp(e)||Yp(t)||$p(t))o=zp(t);else if(Wp(e)){if(o=e.slice(),Wp(t))for(let e=0,n=t.length;e<n;e++)o.push(zp(t[e]));else if(Hp(t)){const e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){const r=e[n];o[r]=zp(t[r])}}}else if(Hp(e))if(Hp(t)){if(!function(e,t){if(!Zp(e)||!Zp(t))return!1;return!0}(e,t))return t;o=Object.assign({},e);const s=Object.keys(t);for(let i=0,a=s.length;i<a;i++){const a=s[i],l=t[a];if(Yp(l))void 0===l?delete o[a]:o[a]=l;else{const s=o[a],i=l;if(Gp(e,a,r)||Gp(t,a,r))delete o[a];else{if(Hp(s)&&Hp(i)){const n=r.get(s)||[],o=r.get(i)||[];n.push({obj:e,key:a}),o.push({obj:t,key:a}),r.set(s,n),r.set(i,o)}o[a]=Vp(o[a],l,n,r)}}}}else o=t;return o}}function Gp(e,t,n){const r=n.get(e[t])||[];for(let n=0,o=r.length;n<o;n++){const o=r[n];if(o.key===t&&o.obj===e)return!0}return!1}function Wp(e){return Array.isArray(e)}function $p(e){return"function"==typeof e}function Hp(e){return!Yp(e)&&!Wp(e)&&!$p(e)&&"object"==typeof e}function Yp(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||void 0===e||e instanceof Date||e instanceof RegExp||null===e}function Kp(e,t){return"string"==typeof t?e===t:!!e.match(t)}function qp(e,t){if(!t)return!1;for(const n of t)if(Kp(e,n))return!0;return!1}class Xp{_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 Jp{_callback;_that;_isCalled=!1;_deferred=new Xp;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}}const Qp=e=>null!==e&&"object"==typeof e&&"function"==typeof e.then;class ed{_rawAttributes;_asyncAttributesPending=!1;_memoizedAttributes;static FromAttributeList(e){const t=new ed({});return t._rawAttributes=nd(e),t._asyncAttributesPending=e.filter(([e,t])=>Qp(t)).length>0,t}constructor(e){const t=e.attributes??{};this._rawAttributes=Object.entries(t).map(([e,t])=>(Qp(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=nd(this._rawAttributes)}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,Qp(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&mh.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const e={};for(const[t,n]of this._rawAttributes)Qp(n)?mh.debug(`Unsettled resource attribute ${t} skipped`):null!=n&&(e[t]??=n);return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}merge(e){return null==e?this:ed.FromAttributeList([...e.getRawAttributes(),...this.getRawAttributes()])}}function td(e){return ed.FromAttributeList(Object.entries(e))}function nd(e){return e.map(([e,t])=>Qp(t)?[e,t.catch(t=>{mh.debug("promise rejection for resource attribute: %s - %s",e,t)})]:[e,t])}class rd{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;name;status={code:ch.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){const t=Date.now();this._spanContext=e.spanContext,this._performanceStartTime=Yh.now(),this._performanceOffset=t-(this._performanceStartTime+fp()),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,this.links=e.links||[],this.startTime=this._getTime(e.startTime??t),this.resource=e.resource,this.instrumentationScope=e.scope,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 mh.warn(`Invalid attribute key: ${e}`),this;if(!jh(t))return mh.warn(`Invalid attribute value set for key: ${e}`),this;const{attributeCountLimit:n}=this._spanLimits;return void 0!==n&&Object.keys(this.attributes).length>=n&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),this)}setAttributes(e){for(const[t,n]of Object.entries(e))this.setAttribute(t,n);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;const{eventCountLimit:r}=this._spanLimits;if(0===r)return mh.warn("No events allowed."),this._droppedEventsCount++,this;void 0!==r&&this.events.length>=r&&(0===this._droppedEventsCount&&mh.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),bp(t)&&(bp(n)||(n=t),t=void 0);const o=Uh(t);return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:0}),this}addLink(e){return this.links.push(e),this}addLinks(e){return this.links.push(...e),this}setStatus(e){return this._isSpanEnded()||(this.status={...e},null!=this.status.message&&"string"!=typeof e.message&&(mh.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`),delete this.status.message)),this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){this._isSpanEnded()?mh.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`):(this._ended=!0,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+=pp),[n,r]}(this.startTime,this.endTime),this._duration[0]<0&&(mh.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&&mh.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this))}_getTime(e){if("number"==typeof e&&e<=Yh.now())return mp(e+this._performanceOffset);if("number"==typeof e)return dp(e);if(e instanceof Date)return dp(e.getTime());if(vp(e))return e;if(this._startTimeProvided)return dp(Date.now());const t=Yh.now()-this._performanceStartTime;return wp(this.startTime,dp(t))}isRecording(){return!1===this._ended}recordException(e,t){const n={};"string"==typeof e?n[Xh]=e:e&&(e.code?n[Jh]=e.code.toString():e.name&&(n[Jh]=e.name),e.message&&(n[Xh]=e.message),e.stack&&(n["exception.stacktrace"]=e.stack)),n[Jh]||n[Xh]?this.addEvent("exception",n,t):mh.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}}`);mh.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?(mh.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 od;!function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"}(od||(od={}));class sd{shouldSample(){return{decision:od.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class id{shouldSample(){return{decision:od.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class ad{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||(Vh(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new id),this._remoteParentSampled=e.remoteParentSampled??new id,this._remoteParentNotSampled=e.remoteParentNotSampled??new sd,this._localParentSampled=e.localParentSampled??new id,this._localParentNotSampled=e.localParentNotSampled??new sd}shouldSample(e,t,n,r,o,s){const i=xh.getSpanContext(e);return i&&rh(i)?i.isRemote?i.traceFlags&hu.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,o,s):this._remoteParentNotSampled.shouldSample(e,t,n,r,o,s):i.traceFlags&hu.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,o,s):this._localParentNotSampled.shouldSample(e,t,n,r,o,s):this._root.shouldSample(e,t,n,r,o,s)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}class ld{_ratio;_upperBound;constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(4294967295*this._ratio)}shouldSample(e,t){return{decision:nh(t)&&this._accumulate(t)<this._upperBound?od.RECORD_AND_SAMPLED:od.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 cd(){return{sampler:ud(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:Gh("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:Gh("OTEL_ATTRIBUTE_COUNT_LIMIT")??128},spanLimits:{attributeValueLengthLimit:Gh("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:Gh("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??128,linkCountLimit:Gh("OTEL_SPAN_LINK_COUNT_LIMIT")??128,eventCountLimit:Gh("OTEL_SPAN_EVENT_COUNT_LIMIT")??128,attributePerEventCountLimit:Gh("OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT")??128,attributePerLinkCountLimit:Gh("OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT")??128}}}function ud(){const e=Wh("OTEL_TRACES_SAMPLER")??"parentbased_always_on";switch(e){case"always_on":return new id;case"always_off":return new sd;case"parentbased_always_on":return new ad({root:new id});case"parentbased_always_off":return new ad({root:new sd});case"traceidratio":return new ld(hd());case"parentbased_traceidratio":return new ad({root:new ld(hd())});default:return mh.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "parentbased_always_on".`),new ad({root:new id})}}function hd(){const e=Gh("OTEL_TRACES_SAMPLER_ARG");return null==e?(mh.error("OTEL_TRACES_SAMPLER_ARG is blank, defaulting to 1."),1):e<0||e>1?(mh.error(`OTEL_TRACES_SAMPLER_ARG=${e} was given, but it is out of range ([0..1]), defaulting to 1.`),1):e}const pd=1/0;class dd{_exporter;_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e,t){this._exporter=e,this._maxExportBatchSize="number"==typeof t?.maxExportBatchSize?t.maxExportBatchSize:Gh("OTEL_BSP_MAX_EXPORT_BATCH_SIZE")??512,this._maxQueueSize="number"==typeof t?.maxQueueSize?t.maxQueueSize:Gh("OTEL_BSP_MAX_QUEUE_SIZE")??2048,this._scheduledDelayMillis="number"==typeof t?.scheduledDelayMillis?t.scheduledDelayMillis:Gh("OTEL_BSP_SCHEDULE_DELAY")??5e3,this._exportTimeoutMillis="number"==typeof t?.exportTimeoutMillis?t.exportTimeoutMillis:Gh("OTEL_BSP_EXPORT_TIMEOUT")??3e4,this._shutdownOnce=new Jp(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(mh.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&hu.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&&mh.debug("maxQueueSize reached, dropping spans"),void this._droppedSpansCount++;this._droppedSpansCount>0&&(mh.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);fh.with(function(e){return e.setValue(Rh,!0)}(fh.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);const o=()=>this._exporter.export(r,r=>{clearTimeout(n),r.code===Cp.SUCCESS?e():t(r.error??new Error("BatchSpanProcessor: span export failed"))});let s=null;for(let e=0,t=r.length;e<t;e++){const t=r[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(s??=[],s.push(t.resource.waitForAsyncAttributes()))}null===s?o():Promise.all(s).then(o,e=>{Vh(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,Vh(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();void 0===this._timer&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),this._timer.unref())}_clearTimer(){void 0!==this._timer&&(clearTimeout(this._timer),this._timer=void 0)}}class fd extends dd{onShutdown(){}}class md{generateTraceId=yd(16);generateSpanId=yd(8)}const gd=Buffer.allocUnsafe(16);function yd(e){return function(){for(let t=0;t<e/4;t++)gd.writeUInt32BE(Math.random()*2**32>>>0,4*t);for(let t=0;t<e&&!(gd[t]>0);t++)t===e-1&&(gd[e-1]=1);return gd.toString("hex",0,e)}}class vd{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;constructor(e,t,n,r){const o=function(e){const t={sampler:ud()},n=cd(),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=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=t.idGenerator||new md,this._resource=n,this._spanProcessor=r,this.instrumentationScope=e}startSpan(e,t={},n=fh.active()){t.root&&(n=xh.deleteSpan(n));const r=xh.getSpan(n);if(Nh(n)){mh.debug("Instrumentation suppressed, returning Noop Span");return xh.wrapSpanContext(Wu)}const o=r?.spanContext(),s=this._idGenerator.generateSpanId();let i,a,l;o&&xh.isSpanContextValid(o)?(a=o.traceId,l=o.traceState,i=o):a=this._idGenerator.generateTraceId();const c=t.kind??lh.INTERNAL,u=(t.links??[]).map(e=>({context:e.context,attributes:Uh(e.attributes)})),h=Uh(t.attributes),p=this._sampler.shouldSample(n,a,e,c,h,u);l=p.traceState??l;const d={traceId:a,spanId:s,traceFlags:p.decision===ah.RECORD_AND_SAMPLED?hu.SAMPLED:hu.NONE,traceState:l};if(p.decision===ah.NOT_RECORD){mh.debug("Recording is off, propagating context in a non-recording span");return xh.wrapSpanContext(d)}const f=Uh(Object.assign(h,p.attributes));return new rd({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:d,name:e,kind:c,links:u,parentSpanContext:i,attributes:f,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits})}startActiveSpan(e,t,n,r){let o,s,i;if(arguments.length<2)return;2===arguments.length?i=t:3===arguments.length?(o=t,i=n):(o=t,s=n,i=r);const a=s??fh.active(),l=this.startSpan(e,o,a),c=xh.setSpan(a,l);return fh.with(c,i,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class bd{_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=>{Vh(e||new Error("MultiSpanProcessor: forceFlush failed")),t()})})}onStart(e,t){for(const n of this._spanProcessors)n.onStart(e,t)}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 wd,Cd;!function(e){e[e.resolved=0]="resolved",e[e.timeout=1]="timeout",e[e.error=2]="error",e[e.unresolved=3]="unresolved"}(wd||(wd={}));class _d{_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=Vp(t,e.shift(),0,n);return t}({},cd(),function(e){const t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??Gh("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??Gh("OTEL_ATTRIBUTE_COUNT_LIMIT")??128,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??Gh("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??Gh("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??pd,Object.assign({},e,{spanLimits:t})}(e));this._resource=t.resource??td({[op]:`unknown_service:${process.argv0}`,[sp]:up[sp],[ip]:up[ip],[ap]:up[ap]}),this._config=Object.assign({},t,{resource:this._resource});const n=[];e.spanProcessors?.length&&n.push(...e.spanProcessors),this._activeSpanProcessor=new bd(n)}getTracer(e,t,n){const r=`${e}@${t||""}:${n?.schemaUrl||""}`;return this._tracers.has(r)||this._tracers.set(r,new vd({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 o=setTimeout(()=>{n(new Error(`Span processor did not completed within timeout period of ${e} ms`)),r=wd.timeout},e);t.forceFlush().then(()=>{clearTimeout(o),r!==wd.timeout&&(r=wd.resolved,n(r))}).catch(e=>{clearTimeout(o),r=wd.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{const r=t.filter(e=>e!==wd.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}class Sd{_enabled=!1;_currentContext=du;_bindFunction(e=du,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=du,this._enabled=!1,this}enable(){return this._enabled||(this._enabled=!0,this._currentContext=du),this}with(e,t,n,...r){const o=this._currentContext;this._currentContext=e||du;try{return t.call(n,...r)}finally{this._currentContext=o}}}class Id extends _d{constructor(e={}){super(e)}register(e={}){var t;xh.setGlobalTracerProvider(this),null!==(t=e.propagator)&&(void 0!==t?kh.setGlobalPropagator(t):kh.setGlobalPropagator(new _p({propagators:[new Rp,new Fh]}))),function(e){if(null!==e){if(void 0===e){const e=new Sd;return e.enable(),void fh.setGlobalContextManager(e)}e.enable(),fh.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"}(Cd||(Cd={}));let Ed;function Ad(e,t){return t in e}function Td(e,t,n,r=!0){if(Ad(n,t)&&"number"==typeof n[t]&&(!r||0!==n[t]))return e.addEvent(t,n[t])}function kd(e,t,n=!1,r,o){if(void 0===r&&(r=0!==t[Cd.START_TIME]),n||(Td(e,Cd.FETCH_START,t,r),Td(e,Cd.DOMAIN_LOOKUP_START,t,r),Td(e,Cd.DOMAIN_LOOKUP_END,t,r),Td(e,Cd.CONNECT_START,t,r),Td(e,Cd.SECURE_CONNECTION_START,t,r),Td(e,Cd.CONNECT_END,t,r),Td(e,Cd.REQUEST_START,t,r),Td(e,Cd.RESPONSE_START,t,r),Td(e,Cd.RESPONSE_END,t,r)),!o){const n=t[Cd.ENCODED_BODY_SIZE];void 0!==n&&e.setAttribute("http.response_content_length",n);const r=t[Cd.DECODED_BODY_SIZE];void 0!==r&&n!==r&&e.setAttribute("http.response_content_length_uncompressed",r)}}function Od(){return"undefined"!=typeof location?location.origin:void 0}function xd(e,t,n,r,o=new WeakSet,s){const i=Rd(e),a=function(e,t,n,r,o,s){const i=yp(t),a=yp(n);let l=r.filter(t=>{const n=yp(gp(t[Cd.FETCH_START])),r=yp(gp(t[Cd.RESPONSE_END]));return t.initiatorType.toLowerCase()===(s||"xmlhttprequest")&&t.name===e&&n>=i&&r<=a});l.length>0&&(l=l.filter(e=>!o.has(e)));return l}(e=i.toString(),t,n,r,o,s);if(0===a.length)return{mainRequest:void 0};if(1===a.length)return{mainRequest:a[0]};const l=function(e){return e.slice().sort((e,t)=>{const n=e[Cd.FETCH_START],r=t[Cd.FETCH_START];return n>r?1:n<r?-1:0})}(a);if(i.origin!==Od()&&l.length>1){let e=l[0],t=function(e,t,n){const r=yp(n),o=yp(gp(t));let s,i=e[1];const a=e.length;for(let t=1;t<a;t++){const n=e[t],a=yp(gp(n[Cd.FETCH_START])),l=r-yp(gp(n[Cd.RESPONSE_END]));a>=o&&(!s||l<s)&&(s=l,i=n)}return i}(l,e[Cd.RESPONSE_END],n);const r=e[Cd.RESPONSE_END];return t[Cd.FETCH_START]<r&&(t=e,e=void 0),{corsPreFlightRequest:e,mainRequest:t}}return{mainRequest:a[0]}}function Rd(e){if("function"==typeof URL)return new URL(e,"undefined"!=typeof document?document.baseURI:"undefined"!=typeof location?location.href:void 0);const t=(Ed||(Ed=document.createElement("a")),Ed);return t.href=e,t}function Nd(e,t){let n=t||[];("string"==typeof n||n instanceof RegExp)&&(n=[n]);return Rd(e).origin===Od()||n.some(t=>Kp(e,t))}class Md{emit(e){}}const Ld=new Md;const Pd=new class{getLogger(e,t,n){return new Md}};class Dd{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):Ld}}class Fd{getLogger(e,t,n){var r;return null!==(r=this.getDelegateLogger(e,t,n))&&void 0!==r?r:new Dd(this,e,t,n)}getDelegate(){var e;return null!==(e=this._delegate)&&void 0!==e?e:Pd}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 Ud="object"==typeof globalThis?globalThis:global,Bd=Symbol.for("io.opentelemetry.js.api.logs"),jd=Ud;class Zd{constructor(){this._proxyLoggerProvider=new Fd}static getInstance(){return this._instance||(this._instance=new Zd),this._instance}setGlobalLoggerProvider(e){return jd[Bd]?this.getLoggerProvider():(jd[Bd]=(t=1,n=e,r=Pd,e=>e===t?n:r),this._proxyLoggerProvider.setDelegate(e),e);var t,n,r}getLoggerProvider(){var e,t;return null!==(t=null===(e=jd[Bd])||void 0===e?void 0:e.call(jd,1))&&void 0!==t?t:this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete jd[Bd],this._proxyLoggerProvider=new Fd}}const zd=Zd.getInstance();const Vd=/^(?:v)?(?<version>(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*))(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,Gd=/^(?<op><|>|=|==|<=|>=|~|\^|~>)?\s*(?:v)?(?<version>(?<major>x|X|\*|0|[1-9]\d*)(?:\.(?<minor>x|X|\*|0|[1-9]\d*))?(?:\.(?<patch>x|X|\*|0|[1-9]\d*))?)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,Wd={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function $d(e,t,n){if(!function(e){return"string"==typeof e&&Vd.test(e)}(e))return mh.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");const r=function(e){const t=e.match(Vd);if(!t)return void mh.error(`Invalid version: ${e}`);const n=t.groups.version,r=t.groups.prerelease,o=t.groups.build,s=n.split("."),i=r?.split(".");return{op:void 0,version:n,versionSegments:s,versionSegmentCount:s.length,prerelease:r,prereleaseSegments:i,prereleaseSegmentCount:i?i.length:0,build:o}}(e);if(!r)return!1;const o=[],s=Hd(r,t,o,n);return s&&!n?.includePrerelease?function(e,t){if(e.prerelease)return t.some(t=>t.prerelease&&t.version===e.version);return!0}(r,o):s}function Hd(e,t,n,r){if(t.includes("||")){const o=t.trim().split("||");for(const t of o)if(Yd(e,t,n,r))return!0;return!1}if(t.includes(" - "))t=function(e,t){const n=lf;return e.replace(n,(e,n,r,o,s,i,a,l,c,u,h,p)=>`${n=Kd(r)?"":Kd(o)?`>=${r}.0.0${t?.includePrerelease?"-0":""}`:Kd(s)?`>=${r}.${o}.0${t?.includePrerelease?"-0":""}`:i?`>=${n}`:`>=${n}${t?.includePrerelease?"-0":""}`} ${l=Kd(c)?"":Kd(u)?`<${+c+1}.0.0-0`:Kd(h)?`<${c}.${+u+1}.0-0`:p?`<=${c}.${u}.${h}-${p}`:t?.includePrerelease?`<${c}.${u}.${+h+1}-0`:`<=${l}`}`.trim())}(t,r);else if(t.includes(" ")){const o=t.trim().replace(/\s{2,}/g," ").split(" ");for(const t of o)if(!Yd(e,t,n,r))return!1;return!0}return Yd(e,t,n,r)}function Yd(e,t,n,r){if(t=function(e,t){return e=e.trim(),e=function(e,t){const n=uf,r=t?.includePrerelease?"-0":"";return e.replace(n,(e,t,n,o,s)=>{let i;return i=Kd(t)?"":Kd(n)?`>=${t}.0.0${r} <${+t+1}.0.0-0`:Kd(o)?"0"===t?`>=${t}.${n}.0${r} <${t}.${+n+1}.0-0`:`>=${t}.${n}.0${r} <${+t+1}.0.0-0`:s?"0"===t?"0"===n?`>=${t}.${n}.${o}-${s} <${t}.${n}.${+o+1}-0`:`>=${t}.${n}.${o}-${s} <${t}.${+n+1}.0-0`:`>=${t}.${n}.${o}-${s} <${+t+1}.0.0-0`:"0"===t?"0"===n?`>=${t}.${n}.${o}${r} <${t}.${n}.${+o+1}-0`:`>=${t}.${n}.${o}${r} <${t}.${+n+1}.0-0`:`>=${t}.${n}.${o} <${+t+1}.0.0-0`,i})}(e,t),e=function(e){const t=cf;return e.replace(t,(e,t,n,r,o)=>{let s;return s=Kd(t)?"":Kd(n)?`>=${t}.0.0 <${+t+1}.0.0-0`:Kd(r)?`>=${t}.${n}.0 <${t}.${+n+1}.0-0`:o?`>=${t}.${n}.${r}-${o} <${t}.${+n+1}.0-0`:`>=${t}.${n}.${r} <${t}.${+n+1}.0-0`,s})}(e),e=function(e,t){const n=af;return e.replace(n,(e,n,r,o,s,i)=>{const a=Kd(r),l=a||Kd(o),c=l||Kd(s),u=c;return"="===n&&u&&(n=""),i=t?.includePrerelease?"-0":"",a?e=">"===n||"<"===n?"<0.0.0-0":"*":n&&u?(l&&(o=0),s=0,">"===n?(n=">=",l?(r=+r+1,o=0,s=0):(o=+o+1,s=0)):"<="===n&&(n="<",l?r=+r+1:o=+o+1),"<"===n&&(i="-0"),e=`${n+r}.${o}.${s}${i}`):l?e=`>=${r}.0.0${i} <${+r+1}.0.0-0`:c&&(e=`>=${r}.${o}.0${i} <${r}.${+o+1}.0-0`),e})}(e,t),e=e.trim(),e}(t,r),t.includes(" "))return Hd(e,t,n,r);{const r=function(e){if(!e)return{};const t=e.match(Gd);if(!t)return mh.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op;const r=t.groups.version,o=t.groups.prerelease,s=t.groups.build,i=r.split("."),a=o?.split(".");"=="===n&&(n="=");return{op:n||"=",version:r,versionSegments:i,versionSegmentCount:i.length,prerelease:o,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:s}}(t);return n.push(r),function(e,t){if(t.invalid)return!1;if(!t.version||qd(t.version))return!0;let n=Qd(e.versionSegments||[],t.versionSegments||[]);if(0===n){const r=e.prereleaseSegments||[],o=t.prereleaseSegments||[];n=r.length||o.length?!r.length&&o.length?1:r.length&&!o.length?-1:Qd(r,o):0}return Wd[t.op]?.includes(n)}(e,r)}}function Kd(e){return!e||"x"===e.toLowerCase()||"*"===e}function qd(e){return"*"===e||"x"===e||"X"===e}function Xd(e){const t=parseInt(e,10);return isNaN(t)?e:t}function Jd(e,t){if(qd(e)||qd(t))return 0;const[n,r]=function(e,t){if(typeof e==typeof t){if("number"==typeof e)return[e,t];if("string"==typeof e)return[e,t];throw new Error("Version segments can only be strings or numbers")}return[String(e),String(t)]}(Xd(e),Xd(t));return n>r?1:n<r?-1:0}function Qd(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){const r=Jd(e[n]||"0",t[n]||"0");if(0!==r)return r}return 0}const ef="[a-zA-Z0-9-]",tf="0|[1-9]\\d*",nf=`(?:${tf}|${`\\d*[a-zA-Z-]${ef}*`})`,rf=`${ef}+`,of=`${tf}|x|X|\\*`,sf=`[v=\\s]*(${of})(?:\\.(${of})(?:\\.(${of})(?:${`(?:-(${nf}(?:\\.${nf})*))`})?${`(?:\\+(${rf}(?:\\.${rf})*))`}?)?)?`,af=new RegExp(`^((?:<|>)?=?)\\s*${sf}$`),lf=new RegExp(`^\\s*(${sf})\\s+-\\s+(${sf})\\s*$`),cf=new RegExp(`^(?:~>?)${sf}$`),uf=new RegExp(`^(?:\\^)${sf}$`);let hf=console.error.bind(console);function pf(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 df=(e,t,n)=>{if(!e||!e[t])return void hf("no original function "+String(t)+" to wrap");if(!n)return hf("no wrapper function"),void hf((new Error).stack);const r=e[t];if("function"!=typeof r||"function"!=typeof n)return void hf("original object and wrapper must be functions");const o=n(r,t);return pf(o,"__original",r),pf(o,"__unwrap",()=>{e[t]===o&&pf(e,t,r)}),pf(o,"__wrapped",!0),pf(e,t,o),o},ff=(e,t,n)=>{if(!e)return hf("must provide one or more modules to patch"),void hf((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{df(e,t,n)})}):hf("must provide one or more functions to wrap on modules")},mf=(e,t)=>{if(!e||!e[t])return hf("no function to unwrap."),void hf((new Error).stack);const n=e[t];n.__unwrap?n.__unwrap():hf("no original to unwrap to -- has "+String(t)+" already been unwrapped?")},gf=(e,t)=>{if(!e)return hf("must provide one or more modules to patch"),void hf((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{mf(e,t)})}):hf("must provide one or more functions to unwrap on modules")};class yf{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,t,n){this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=mh.createComponentLogger({namespace:e}),this._tracer=xh.getTracer(e,t),this._meter=vh.getMeter(e,t),this._logger=zd.getLogger(e,t),this._updateMetricInstruments()}_wrap=df;_unwrap=mf;_massWrap=ff;_massUnwrap=gf;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)}}}var vf,bf,wf,Cf,_f,Sf={exports:{}},If={exports:{}},Ef={exports:{}};function Af(){if(bf)return vf;bf=1;var e=1e3,t=60*e,n=60*t,r=24*n,o=7*r,s=365.25*r;function i(e,t,n,r){var o=t>=1.5*n;return Math.round(e/n)+" "+r+(o?"s":"")}return vf=function(a,l){l=l||{};var c=typeof a;if("string"===c&&a.length>0)return function(i){if((i=String(i)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!a)return;var l=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return l*s;case"weeks":case"week":case"w":return l*o;case"days":case"day":case"d":return l*r;case"hours":case"hour":case"hrs":case"hr":case"h":return l*n;case"minutes":case"minute":case"mins":case"min":case"m":return l*t;case"seconds":case"second":case"secs":case"sec":case"s":return l*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:return}}(a);if("number"===c&&isFinite(a))return l.long?function(o){var s=Math.abs(o);if(s>=r)return i(o,s,r,"day");if(s>=n)return i(o,s,n,"hour");if(s>=t)return i(o,s,t,"minute");if(s>=e)return i(o,s,e,"second");return o+" ms"}(a):function(o){var s=Math.abs(o);if(s>=r)return Math.round(o/r)+"d";if(s>=n)return Math.round(o/n)+"h";if(s>=t)return Math.round(o/t)+"m";if(s>=e)return Math.round(o/e)+"s";return o+"ms"}(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))},vf}function Tf(){if(Cf)return wf;return Cf=1,wf=function(e){function t(e){let r,o,s,i=null;function a(...e){if(!a.enabled)return;const n=a,o=Number(new Date),s=o-(r||o);n.diff=s,n.prev=r,n.curr=o,r=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,o)=>{if("%%"===r)return"%";i++;const s=t.formatters[o];if("function"==typeof s){const t=e[i];r=s.call(n,t),e.splice(i,1),i--}return r}),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(o!==t.namespaces&&(o=t.namespaces,s=t.enabled(e)),s),set:e=>{i=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e,t){let n=0,r=0,o=-1,s=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||"*"===t[r]))"*"===t[r]?(o=r,s=n,r++):(n++,r++);else{if(-1===o)return!1;r=o+1,s++,n=s}for(;r<t.length&&"*"===t[r];)r++;return r===t.length}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of n)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const n of t.skips)if(r(e,n))return!1;for(const n of t.names)if(r(e,n))return!0;return!1},t.humanize=Af(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},wf}var kf,Of={exports:{}};"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?If.exports=(_f||(_f=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(r++,"%c"===e&&(o=r))}),t.splice(o,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=Tf()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(Ef,Ef.exports)),Ef.exports):If.exports=(kf||(kf=1,function(e,t){const r=o,s=n;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(s.formatWithOptions(t.inspectOpts,...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:o}=this;if(o){const t=this.color,o="[3"+(t<8?t:"8;5;"+t),s=` ${o};1m${r} [0m`;n[0]=s+n[0].split("\n").join("\n"+s),n.push(o+"m+"+e.exports.humanize(this.diff)+"[0m")}else n[0]=(t.inspectOpts.hideDate?"":(new Date).toISOString()+" ")+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):r.isatty(process.stderr.fd)},t.destroy=s.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=require("supports-color");e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase());let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e},{}),e.exports=Tf()(t);const{formatters:i}=e.exports;i.o=function(e){return this.inspectOpts.colors=this.useColors,s.inspect(e,this.inspectOpts).split("\n").map(e=>e.trim()).join(" ")},i.O=function(e){return this.inspectOpts.colors=this.useColors,s.inspect(e,this.inspectOpts)}}(Of,Of.exports)),Of.exports);var xf,Rf,Nf,Mf,Lf=If.exports,Pf=t.sep,Df=function(e){var t=e.split(Pf),n=t.lastIndexOf("node_modules");if(-1!==n&&t[n+1]){for(var r="@"===t[n+1][0],o=r?t[n+1]+"/"+t[n+2]:t[n+1],s=r?3:2,i="",a=n+s-1,l=0;l<=a;l++)i+=l===a?t[l]:t[l]+Pf;for(var c="",u=t.length-1,h=n+s;h<=u;h++)c+=h===u?t[h]:t[h]+Pf;return{name:o,basedir:i,path:c}}};function Ff(){return Rf?xf:(Rf=1,xf=i.homedir||function(){var e=process.env.HOME,t=process.env.LOGNAME||process.env.USER||process.env.LNAME||process.env.USERNAME;return"win32"===process.platform?process.env.USERPROFILE||process.env.HOMEDRIVE+process.env.HOMEPATH||e||null:"darwin"===process.platform?e||(t?"/Users/"+t:null):"linux"===process.platform?e||(0===process.getuid()?"/root":t?"/home/"+t:null):e||null})}function Uf(){return Mf?Nf:(Mf=1,Nf=function(){var e=Error.prepareStackTrace;Error.prepareStackTrace=function(e,t){return t};var t=(new Error).stack;return Error.prepareStackTrace=e,t[2].getFileName()})}var Bf,jf,Zf,zf,Vf,Gf,Wf,$f,Hf,Yf,Kf,qf={exports:{}};function Xf(){if(Bf)return qf.exports;Bf=1;var e="win32"===process.platform,t=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,n={};n.parse=function(e){if("string"!=typeof e)throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var n,r=(n=e,t.exec(n).slice(1));if(!r||5!==r.length)throw new TypeError("Invalid path '"+e+"'");return{root:r[1],dir:r[0]===r[1]?r[0]:r[0].slice(0,-1),base:r[2],ext:r[4],name:r[3]}};var r=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,o={};return o.parse=function(e){if("string"!=typeof e)throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var t,n=(t=e,r.exec(t).slice(1));if(!n||5!==n.length)throw new TypeError("Invalid path '"+e+"'");return{root:n[1],dir:n[0].slice(0,-1),base:n[2],ext:n[4],name:n[3]}},qf.exports=e?n.parse:o.parse,qf.exports.posix=o.parse,qf.exports.win32=n.parse,qf.exports}function Jf(){if(Zf)return jf;Zf=1;var e=t,n=e.parse||Xf(),r=function(t,r){var o="/";/^([A-Za-z]:)/.test(t)?o="":/^\\\\/.test(t)&&(o="\\\\");for(var s=[t],i=n(t);i.dir!==s[s.length-1];)s.push(i.dir),i=n(i.dir);return s.reduce(function(t,n){return t.concat(r.map(function(t){return e.resolve(o,n,t)}))},[])};return jf=function(e,t,n){var o=t&&t.moduleDirectory?[].concat(t.moduleDirectory):["node_modules"];if(t&&"function"==typeof t.paths)return t.paths(n,e,function(){return r(e,o)},t);var s=r(e,o);return t&&t.paths?s.concat(t.paths):s}}function Qf(){return Vf?zf:(Vf=1,zf=function(e,t){return t||{}})}function em(){if(Wf)return Gf;Wf=1;var e=Object.prototype.toString,t=Math.max,n=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var o=0;o<t.length;o+=1)n[o+e.length]=t[o];return n};return Gf=function(r){var o=this;if("function"!=typeof o||"[object Function]"!==e.apply(o))throw new TypeError("Function.prototype.bind called on incompatible "+o);for(var s,i=function(e,t){for(var n=[],r=t,o=0;r<e.length;r+=1,o+=1)n[o]=e[r];return n}(arguments,1),a=t(0,o.length-i.length),l=[],c=0;c<a;c++)l[c]="$"+c;if(s=Function("binder","return function ("+function(e,t){for(var n="",r=0;r<e.length;r+=1)n+=e[r],r+1<e.length&&(n+=t);return n}(l,",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof s){var e=o.apply(this,n(i,arguments));return Object(e)===e?e:this}return o.apply(r,n(i,arguments))}),o.prototype){var u=function(){};u.prototype=o.prototype,s.prototype=new u,u.prototype=null}return s},Gf}function tm(){if(Kf)return Yf;Kf=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,n=function(){if(Hf)return $f;Hf=1;var e=em();return $f=Function.prototype.bind||e}();return Yf=n.call(e,t)}var nm,rm,om,sm,im={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":[">= 22.13 && < 23",">= 23.4"],_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]};function am(){if(rm)return nm;rm=1;var e=tm();function t(e,t){for(var n=e.split("."),r=t.split(" "),o=r.length>1?r[0]:"=",s=(r.length>1?r[1]:r[0]).split("."),i=0;i<3;++i){var a=parseInt(n[i]||0,10),l=parseInt(s[i]||0,10);if(a!==l)return"<"===o?a<l:">="===o&&a>=l}return">="===o}function n(e,n){var r=n.split(/ ?&& ?/);if(0===r.length)return!1;for(var o=0;o<r.length;++o)if(!t(e,r[o]))return!1;return!0}var r=im;return nm=function(t,o){return e(r,t)&&function(e,t){if("boolean"==typeof t)return t;var r=void 0===e?process.versions&&process.versions.node:e;if("string"!=typeof r)throw new TypeError(void 0===e?"Unable to determine current node version":"If provided, a valid node version is required");if(t&&"object"==typeof t){for(var o=0;o<t.length;++o)if(n(r,t[o]))return!0;return!1}return n(r,t)}(o,r[t])},nm}function lm(){if(sm)return om;sm=1;var e=s,n=Ff(),r=t,o=Uf(),i=Jf(),a=Qf(),l=am(),c="win32"!==process.platform&&e.realpath&&"function"==typeof e.realpath.native?e.realpath.native:e.realpath,u=n(),h=function(t,n){e.stat(t,function(e,t){return e?"ENOENT"===e.code||"ENOTDIR"===e.code?n(null,!1):n(e):n(null,t.isFile()||t.isFIFO())})},p=function(t,n){e.stat(t,function(e,t){return e?"ENOENT"===e.code||"ENOTDIR"===e.code?n(null,!1):n(e):n(null,t.isDirectory())})},d=function(e,t){c(e,function(n,r){n&&"ENOENT"!==n.code?t(n):t(null,n?e:r)})},f=function(e,t,n,r){n&&!1===n.preserveSymlinks?e(t,r):r(null,t)},m=function(e,t,n){e(t,function(e,t){if(e)n(e);else try{var r=JSON.parse(t);n(null,r)}catch(e){n(null)}})};return om=function(t,n,s){var c=s,g=n;if("function"==typeof n&&(c=g,g={}),"string"!=typeof t){var y=new TypeError("Path must be a string.");return process.nextTick(function(){c(y)})}var v=(g=a(t,g)).isFile||h,b=g.isDirectory||p,w=g.readFile||e.readFile,C=g.realpath||d,_=g.readPackage||m;if(g.readFile&&g.readPackage){var S=new TypeError("`readFile` and `readPackage` are mutually exclusive.");return process.nextTick(function(){c(S)})}var I=g.packageIterator,E=g.extensions||[".js"],A=!1!==g.includeCoreModules,T=g.basedir||r.dirname(o()),k=g.filename||T;g.paths=g.paths||[r.join(u,".node_modules"),r.join(u,".node_libraries")];var O,x=r.resolve(T);function R(e,n,r){e?c(e):n?c(null,n,r):L(O,function(e,n,r){if(e)c(e);else if(n)f(C,n,g,function(e,t){e?c(e):c(null,t,r)});else{var o=new Error("Cannot find module '"+t+"' from '"+k+"'");o.code="MODULE_NOT_FOUND",c(o)}})}function N(e,t,n){var o=t,s=n;"function"==typeof o&&(s=o,o=void 0),function e(t,n,o){if(0===t.length)return s(null,void 0,o);var i=n+t[0],a=o;a?l(null,a):M(r.dirname(i),l);function l(o,l,u){if(a=l,o)return s(o);if(u&&a&&g.pathFilter){var h=r.relative(u,i),p=h.slice(0,h.length-t[0].length),d=g.pathFilter(a,n,p);if(d)return e([""].concat(E.slice()),r.resolve(u,d),a)}v(i,c)}function c(r,o){return r?s(r):o?s(null,i,a):void e(t.slice(1),n,a)}}([""].concat(E),e,o)}function M(e,t){return""===e||"/"===e||"win32"===process.platform&&/^\w:[/\\]*$/.test(e)||/[/\\]node_modules[/\\]*$/.test(e)?t(null):void f(C,e,g,function(n,o){if(n)return M(r.dirname(e),t);var s=r.join(o,"package.json");v(s,function(n,o){if(!o)return M(r.dirname(e),t);_(w,s,function(n,r){n&&t(n);var o=r;o&&g.packageFilter&&(o=g.packageFilter(o,s)),t(null,o,e)})})})}function L(e,t,n){var o=n,s=t;"function"==typeof s&&(o=s,s=g.package),f(C,e,g,function(t,n){if(t)return o(t);var i=r.join(n,"package.json");v(i,function(t,n){return t?o(t):n?void _(w,i,function(t,n){if(t)return o(t);var s=n;if(s&&g.packageFilter&&(s=g.packageFilter(s,i)),s&&s.main){if("string"!=typeof s.main){var a=new TypeError("package “"+s.name+"” `main` must be a string");return a.code="INVALID_PACKAGE_MAIN",o(a)}return"."!==s.main&&"./"!==s.main||(s.main="index"),void N(r.resolve(e,s.main),s,function(t,n,s){return t?o(t):n?o(null,n,s):s?void L(r.resolve(e,s.main),s,function(t,n,s){return t?o(t):n?o(null,n,s):void N(r.join(e,"index"),s,o)}):N(r.join(e,"index"),s,o)})}N(r.join(e,"/index"),s,o)}):N(r.join(e,"index"),s,o)})})}function P(e,t){if(0===t.length)return e(null,void 0);var n=t[0];function o(t,r,o){return t?e(t):r?e(null,r,o):void L(n,g.package,s)}function s(n,r,o){return n?e(n):r?e(null,r,o):void P(e,t.slice(1))}b(r.dirname(n),function(r,s){if(r)return e(r);if(!s)return P(e,t.slice(1));N(n,g.package,o)})}f(C,x,g,function(e,n){e?c(e):function(e){if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t))O=r.resolve(e,t),"."!==t&&".."!==t&&"/"!==t.slice(-1)||(O+="/"),/\/$/.test(t)&&O===e?L(O,g.package,R):N(O,g.package,R);else{if(A&&l(t))return c(null,t);!function(e,t,n){var o=function(){return function(e,t,n){for(var o=i(t,n,e),s=0;s<o.length;s++)o[s]=r.join(o[s],e);return o}(e,t,g)};P(n,I?I(e,t,o,g):o())}(t,e,function(e,n,r){if(e)c(e);else{if(n)return f(C,n,g,function(e,t){e?c(e):c(null,t,r)});var o=new Error("Cannot find module '"+t+"' from '"+k+"'");o.code="MODULE_NOT_FOUND",c(o)}})}}(n)})},om}var cm,um,hm,pm,dm,fm,mm,gm,ym={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":">= 23.4",_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]};function vm(){if(fm)return dm;fm=1;var e=am(),n=s,r=t,o=Ff(),i=Uf(),a=Jf(),l=Qf(),c="win32"!==process.platform&&n.realpathSync&&"function"==typeof n.realpathSync.native?n.realpathSync.native:n.realpathSync,u=o(),h=function(e){try{var t=n.statSync(e,{throwIfNoEntry:!1})}catch(e){if(e&&("ENOENT"===e.code||"ENOTDIR"===e.code))return!1;throw e}return!!t&&(t.isFile()||t.isFIFO())},p=function(e){try{var t=n.statSync(e,{throwIfNoEntry:!1})}catch(e){if(e&&("ENOENT"===e.code||"ENOTDIR"===e.code))return!1;throw e}return!!t&&t.isDirectory()},d=function(e){try{return c(e)}catch(e){if("ENOENT"!==e.code)throw e}return e},f=function(e,t,n){return n&&!1===n.preserveSymlinks?e(t):t},m=function(e,t){var n=e(t);try{return JSON.parse(n)}catch(e){}};return dm=function(t,o){if("string"!=typeof t)throw new TypeError("Path must be a string.");var s=l(t,o),c=s.isFile||h,g=s.readFileSync||n.readFileSync,y=s.isDirectory||p,v=s.realpathSync||d,b=s.readPackageSync||m;if(s.readFileSync&&s.readPackageSync)throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");var w=s.packageIterator,C=s.extensions||[".js"],_=!1!==s.includeCoreModules,S=s.basedir||r.dirname(i()),I=s.filename||S;s.paths=s.paths||[r.join(u,".node_modules"),r.join(u,".node_libraries")];var E=f(v,r.resolve(S),s);if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t)){var A=r.resolve(E,t);"."!==t&&".."!==t&&"/"!==t.slice(-1)||(A+="/");var T=x(A)||N(A);if(T)return f(v,T,s)}else{if(_&&e(t))return t;var k=function(e,t){for(var n=function(){return function(e,t,n){for(var o=a(t,n,e),s=0;s<o.length;s++)o[s]=r.join(o[s],e);return o}(e,t,s)},o=w?w(e,t,n,s):n(),i=0;i<o.length;i++){var l=o[i];if(y(r.dirname(l))){var c=x(l);if(c)return c;var u=N(l);if(u)return u}}}(t,E);if(k)return f(v,k,s)}var O=new Error("Cannot find module '"+t+"' from '"+I+"'");throw O.code="MODULE_NOT_FOUND",O;function x(e){var t=R(r.dirname(e));if(t&&t.dir&&t.pkg&&s.pathFilter){var n=r.relative(t.dir,e),o=s.pathFilter(t.pkg,e,n);o&&(e=r.resolve(t.dir,o))}if(c(e))return e;for(var i=0;i<C.length;i++){var a=e+C[i];if(c(a))return a}}function R(e){if(""!==e&&"/"!==e&&!("win32"===process.platform&&/^\w:[/\\]*$/.test(e)||/[/\\]node_modules[/\\]*$/.test(e))){var t=r.join(f(v,e,s),"package.json");if(!c(t))return R(r.dirname(e));var n=b(g,t);return n&&s.packageFilter&&(n=s.packageFilter(n,e)),{pkg:n,dir:e}}}function N(e){var t=r.join(f(v,e,s),"/package.json");if(c(t)){try{var n=b(g,t)}catch(e){}if(n&&s.packageFilter&&(n=s.packageFilter(n,e)),n&&n.main){if("string"!=typeof n.main){var o=new TypeError("package “"+n.name+"” `main` must be a string");throw o.code="INVALID_PACKAGE_MAIN",o}"."!==n.main&&"./"!==n.main||(n.main="index");try{var i=x(r.resolve(e,n.main));if(i)return i;var a=N(r.resolve(e,n.main));if(a)return a}catch(e){}}}return x(r.join(e,"/index"))}},dm}function bm(){if(gm)return mm;gm=1;var e=lm();return e.core=function(){if(um)return cm;um=1;var e=am(),t=ym,n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=e(r));return cm=n}(),e.isCore=function(){if(pm)return hm;pm=1;var e=am();return hm=function(t){return e(t)},hm}(),e.sync=vm(),mm=e}var wm={url:"https://github.com/nodejs/require-in-the-middle/issues"};const Cm=t,_m=r,Sm=Lf("require-in-the-middle"),Im=Df;Sf.exports=Rm;var Em=Sf.exports.Hook=Rm;let Am,Tm,km;if(_m.isBuiltin)Tm=_m.isBuiltin;else if(_m.builtinModules)Tm=e=>!!e.startsWith("node:")||(void 0===Am&&(Am=new Set(_m.builtinModules)),Am.has(e));else{const e=bm(),[t,n]=process.versions.node.split(".").map(Number);Tm=8===t&&n<8?t=>"http2"===t||!!e.core[t]:t=>!!e.core[t]}const Om=/([/\\]index)?(\.js)?$/;class xm{constructor(){this._localCache=new Map,this._kRitmExports=Symbol("RitmExports")}has(e,t){if(this._localCache.has(e))return!0;if(t)return!1;{const t=require.cache[e];return!(!t||!(this._kRitmExports in t))}}get(e,t){const n=this._localCache.get(e);if(void 0!==n)return n;if(!t){const t=require.cache[e];return t&&t[this._kRitmExports]}}set(e,t,n){n?this._localCache.set(e,t):e in require.cache?require.cache[e][this._kRitmExports]=t:(Sm('non-core module is unexpectedly not in require.cache: "%s"',e),this._localCache.set(e,t))}}function Rm(e,t,n){if(this instanceof Rm==!1)return new Rm(e,t,n);if("function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),"function"!=typeof _m._resolveFilename)return console.error("Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!",typeof _m._resolveFilename),void console.error("Please report this error as an issue related to Node.js %s at %s",process.version,wm.url);this._cache=new xm,this._unhooked=!1,this._origRequire=_m.prototype.require;const r=this,o=new Set,s=!!t&&!0===t.internals,i=Array.isArray(e);function a(t,a){const l=t[0],c=Tm(l);let u,h,p;if(c){if(u=l,l.startsWith("node:")){const e=l.slice(5);Tm(e)&&(u=e)}}else{if(a)return Sm("call to process.getBuiltinModule with unknown built-in id"),r._origGetBuiltinModule.apply(this,t);try{u=_m._resolveFilename(l,this)}catch(e){return Sm('Module._resolveFilename("%s") threw %j, calling original Module.require',l,e.message),r._origRequire.apply(this,t)}}if(Sm("processing %s module require('%s'): %s",!0===c?"core":"non-core",l,u),!0===r._cache.has(u,c))return Sm("returning already patched cached module: %s",u),r._cache.get(u,c);const d=o.has(u);!1===d&&o.add(u);const f=a?r._origGetBuiltinModule.apply(this,t):r._origRequire.apply(this,t);if(!0===d)return Sm("module is in the process of being patched already - ignoring: %s",u),f;if(o.delete(u),!0===c){if(!0===i&&!1===e.includes(u))return Sm("ignoring core module not on whitelist: %s",u),f;h=u}else if(!0===i&&e.includes(u)){const e=Cm.parse(u);h=e.name,p=e.dir}else{const t=Im(u);if(void 0===t)return Sm("could not parse filename: %s",u),f;h=t.name,p=t.basedir;const n=function(e){const t="/"!==Cm.sep?e.path.split(Cm.sep).join("/"):e.path;return Cm.posix.join(e.name,t).replace(Om,"")}(t);Sm("resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)",h,l,n,p);let o=!1;if(i){if(!l.startsWith(".")&&e.includes(l)&&(h=l,o=!0),!e.includes(h)&&!e.includes(n))return f;e.includes(n)&&n!==h&&(h=n,o=!0)}if(!o){let e;try{e=function(e,t){if(!km)if(require.resolve&&require.resolve.paths)km=function(e,t){return require.resolve(e,{paths:[t]})};else{const e=bm();km=function(t,n){return e.sync(t,{basedir:n})}}return km(e,t)}(h,p)}catch(e){return Sm("could not resolve module: %s",h),r._cache.set(u,f,c),f}if(e!==u){if(!0!==s)return Sm("ignoring require of non-main module file: %s",e),r._cache.set(u,f,c),f;h=h+Cm.sep+Cm.relative(p,u),Sm("preparing to process require of internal file: %s",h)}}}r._cache.set(u,f,c),Sm("calling require hook: %s",h);const m=n(f,h,p);return r._cache.set(u,m,c),Sm("returning module: %s",h),m}Sm("registering require hook"),this._require=_m.prototype.require=function(e){return!0===r._unhooked?(Sm("ignoring require call - module is soft-unhooked"),r._origRequire.apply(this,arguments)):a.call(this,arguments,!1)},"function"==typeof process.getBuiltinModule&&(this._origGetBuiltinModule=process.getBuiltinModule,this._getBuiltinModule=process.getBuiltinModule=function(e){return!0===r._unhooked?(Sm("ignoring process.getBuiltinModule call - module is soft-unhooked"),r._origGetBuiltinModule.apply(this,arguments)):a.call(this,arguments,!0)})}Rm.prototype.unhook=function(){this._unhooked=!0,this._require===_m.prototype.require?(_m.prototype.require=this._origRequire,Sm("require unhook successful")):Sm("require unhook unsuccessful"),void 0!==process.getBuiltinModule&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,Sm("process.getBuiltinModule unhook successful")):Sm("process.getBuiltinModule unhook unsuccessful"))};const Nm="/";class Mm{hooks=[];children=new Map}class Lm{_trie=new Mm;_counter=0;insert(e){let t=this._trie;for(const n of e.moduleName.split(Nm)){let e=t.children.get(n);e||(e=new Mm,t.children.set(n,e)),t=e}t.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:t,fullOnly:n}={}){let r=this._trie;const o=[];let s=!0;for(const t of e.split(Nm)){const e=r.children.get(t);if(!e){s=!1;break}n||o.push(...e.hooks),r=e}return n&&s&&o.push(...r.hooks),0===o.length?[]:1===o.length?[o[0].hook]:(t&&o.sort((e,t)=>e.insertedId-t.insertedId),o.map(({hook:e})=>e))}}const Pm=["afterEach","after","beforeEach","before","describe","it"].every(e=>"function"==typeof global[e]);class Dm{_moduleNameTrie=new Lm;static _instance;constructor(){this._initialize()}_initialize(){new Em(null,{internals:!0},(e,t,n)=>{const r=(o=t,h.sep!==Nm?o.split(h.sep).join(Nm):o);var o;const s=this._moduleNameTrie.search(r,{maintainInsertionOrder:!0,fullOnly:void 0===n});for(const{onRequire:r}of s)e=r(e,t,n);return e})}register(e,t){const n={moduleName:e,onRequire:t};return this._moduleNameTrie.insert(n),n}static getInstance(){return Pm?new Dm:this._instance=this._instance??new Dm}}var Fm={exports:{}},Um={};const Bm=[],jm=new WeakMap,Zm=new WeakMap,zm=new Map,Vm=[],Gm={set:(e,t,n)=>jm.get(e)[t](n),get(e,t){if(t===Symbol.toStringTag)return"Module";const n=Zm.get(e)[t];return"function"==typeof n?n():void 0},defineProperty(e,t,n){if(!("value"in n))throw new Error("Getters/setters are not supported for exports property descriptors.");return jm.get(e)[t](n.value)}};let Wm=!1;Um.register=function(e,t,n,r,o){zm.set(e,o),jm.set(t,n),Zm.set(t,r);const s=new Proxy(t,Gm);Bm.forEach(t=>t(e,s)),Vm.push([e,s])},Um.importHooks=Bm,Um.specifiers=zm,Um.toHook=Vm,Um.getExperimentalPatchInternals=function(){return Wm},Um.setExperimentalPatchInternals=function(e){Wm=e};const $m=t,Hm=Df,{fileURLToPath:Ym}=a,{MessageChannel:Km}=l,{importHooks:qm,specifiers:Xm,toHook:Jm,getExperimentalPatchInternals:Qm}=Um;function eg(e){qm.push(e),Jm.forEach(([t,n])=>e(t,n))}function tg(e){const t=qm.indexOf(e);t>-1&&qm.splice(t,1)}function ng(e,t,n,r){const o=e(t,n,r);o&&o!==t&&(t.default=o)}let rg;function og(e,t,n){if(this instanceof og==!1)return new og(e,t,n);"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null);const r=!!t&&!0===t.internals;rg&&Array.isArray(e)&&rg(e),this._iitmHook=(t,o)=>{const s=t;let i;if(t.startsWith("node:"))t=t.replace(/^node:/,"");else{if(t.startsWith("file://"))try{t=Ym(t)}catch(e){}const e=Hm(t);e&&(t=e.name,i=e.basedir)}if(e){for(const a of e)if(a===t){if(i)if(r)t=t+$m.sep+$m.relative(i,Ym(s));else if(!Qm()&&!i.endsWith(Xm.get(s)))continue;ng(n,o,t,i)}}else ng(n,o,t,i)},eg(this._iitmHook)}og.prototype.unhook=function(){tg(this._iitmHook)},Fm.exports=og;var sg,ig,ag=Fm.exports.Hook=og;function lg(e,t,n){let r,o;try{o=e()}catch(e){r=e}finally{return t(r,o),o}}function cg(e){return"function"==typeof e&&"function"==typeof e.__original&&"function"==typeof e.__unwrap&&!0===e.__wrapped}Fm.exports.addHook=eg,Fm.exports.removeHook=tg,Fm.exports.createAddHookMessageChannel=function(){const{port1:e,port2:t}=new Km;let n,r=0;return rg=t=>{r++,e.postMessage(t)},e.on("message",()=>{r--,n&&r<=0&&n()}).unref(),{registerOptions:{data:{addHookMessagePort:t,include:[]},transferList:[t]},addHookMessagePort:t,waitForAllMessagesAcknowledged:function(){const e=setInterval(()=>{},1e3),t=new Promise(e=>{n=e}).then(()=>{clearInterval(e)});return 0===r&&n(),t}}};class ug extends yf{_modules;_hooks=[];_requireInTheMiddleSingleton=Dm.getInstance();_enabled=!1;constructor(e,t,n){super(e,t,n);let r=this.init();r&&!Array.isArray(r)&&(r=[r]),this._modules=r||[],this._config.enabled&&this.enable()}_wrap=(e,t,r)=>{if(cg(e[t])&&this._unwrap(e,t),n.types.isProxy(e)){const n=df(Object.assign({},e),t,r);return Object.defineProperty(e,t,{value:n}),n}return df(e,t,r)};_unwrap=(e,t)=>n.types.isProxy(e)?Object.defineProperty(e,t,{value:e[t]}):mf(e,t);_massWrap=(e,t,n)=>{e?(Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{this._wrap(e,t,n)})}):mh.error("must provide one or more functions to wrap on modules")):mh.error("must provide one or more modules to patch")};_massUnwrap=(e,t)=>{e?(Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach(e=>{t.forEach(t=>{this._unwrap(e,t)})}):mh.error("must provide one or more functions to wrap on modules")):mh.error("must provide one or more modules to patch")};_warnOnPreloadedModules(){this._modules.forEach(e=>{const{name:t}=e;try{const e=require.resolve(t);require.cache[e]&&this._diag.warn(`Module ${t} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${t}`)}catch{}})}_extractPackageVersion(e){try{const t=s.readFileSync(h.join(e,"package.json"),{encoding:"utf8"}),n=JSON.parse(t).version;return"string"==typeof n?n:void 0}catch{mh.warn("Failed extracting version",e)}}_onRequire(e,t,n,r){if(!r)return"function"==typeof e.patch&&(e.moduleExports=t,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:e.name}),e.patch(t)):t;const o=this._extractPackageVersion(r);if(e.moduleVersion=o,e.name===n)return hg(e.supportedVersions,o,e.includePrerelease)&&"function"==typeof e.patch&&(e.moduleExports=t,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:e.name,version:e.moduleVersion,baseDir:r}),e.patch(t,e.moduleVersion)):t;const s=e.files??[],i=h.normalize(n);return s.filter(e=>e.name===i).filter(t=>hg(t.supportedVersions,o,e.includePrerelease)).reduce((t,n)=>(n.moduleExports=t,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:e.name,version:e.moduleVersion,fileName:n.name,baseDir:r}),n.patch(t,e.moduleVersion)):t),t)}enable(){if(!this._enabled)if(this._enabled=!0,this._hooks.length>0)for(const e of this._modules){"function"==typeof e.patch&&e.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(const t of e.files)t.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:e.name,version:e.moduleVersion,fileName:t.name}),t.patch(t.moduleExports,e.moduleVersion))}else{this._warnOnPreloadedModules();for(const e of this._modules){const t=(t,n,r)=>{if(!r&&h.isAbsolute(n)){const e=h.parse(n);n=e.name,r=e.dir}return this._onRequire(e,t,n,r)},n=(t,n,r)=>this._onRequire(e,t,n,r),r=h.isAbsolute(e.name)?new Em([e.name],{internals:!0},n):this._requireInTheMiddleSingleton.register(e.name,n);this._hooks.push(r);const o=new ag([e.name],{internals:!1},t);this._hooks.push(o)}}}disable(){if(this._enabled){this._enabled=!1;for(const e of this._modules){"function"==typeof e.unpatch&&e.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(const t of e.files)t.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:e.name,version:e.moduleVersion,fileName:t.name}),t.unpatch(t.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}}function hg(e,t,n){return void 0===t?e.includes("*"):e.some(e=>$d(t,e,{includePrerelease:n}))}function pg(e,t){let n=sg.OLD;const r=t?.split(",").map(e=>e.trim()).filter(e=>""!==e);for(const t of r??[]){if(t.toLowerCase()===e+"/dup"){n=sg.DUPLICATE;break}t.toLowerCase()===e&&(n=sg.STABLE)}return n}!function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"}(sg||(sg={})),function(e){e.DOCUMENT_LOAD="documentLoad",e.DOCUMENT_FETCH="documentFetch",e.RESOURCE_FETCH="resourceFetch"}(ig||(ig={}));var dg;!function(e){e.FIRST_PAINT="firstPaint",e.FIRST_CONTENTFUL_PAINT="firstContentfulPaint"}(dg||(dg={}));const fg={"first-paint":dg.FIRST_PAINT,"first-contentful-paint":dg.FIRST_CONTENTFUL_PAINT};class mg extends ug{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=Yh.getEntriesByType?.("resource");t&&t.forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){const e=Array.from(document.getElementsByTagName("meta")).find(e=>e.getAttribute("name")===kp),t=(()=>{const e={},t=Yh.getEntriesByType?.("navigation")[0];if(t)Object.values(Cd).forEach(n=>{if(Ad(t,n)){const r=t[n];"number"==typeof r&&(e[n]=r)}});else{const t=Yh.timing;t&&Object.values(Cd).forEach(n=>{if(Ad(t,n)){const r=t[n];"number"==typeof r&&(e[n]=r)}})}return e})(),n=e&&e.content||"";fh.with(kh.extract(du,{traceparent:n}),()=>{const e=this._startSpan(ig.DOCUMENT_LOAD,Cd.FETCH_START,t);e&&(fh.with(xh.setSpan(fh.active(),e),()=>{const e=this._startSpan(ig.DOCUMENT_FETCH,Cd.FETCH_START,t);e&&(e.setAttribute(Kh,location.href),fh.with(xh.setSpan(fh.active(),e),()=>{kd(e,t,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentFetch),this._endSpan(e,Cd.RESPONSE_END,t)}))}),e.setAttribute(Kh,location.href),e.setAttribute("http.user_agent",navigator.userAgent),this._addResourcesSpans(e),this.getConfig().ignoreNetworkEvents||(Td(e,Cd.FETCH_START,t),Td(e,Cd.UNLOAD_EVENT_START,t),Td(e,Cd.UNLOAD_EVENT_END,t),Td(e,Cd.DOM_INTERACTIVE,t),Td(e,Cd.DOM_CONTENT_LOADED_EVENT_START,t),Td(e,Cd.DOM_CONTENT_LOADED_EVENT_END,t),Td(e,Cd.DOM_COMPLETE,t),Td(e,Cd.LOAD_EVENT_START,t),Td(e,Cd.LOAD_EVENT_END,t)),this.getConfig().ignorePerformancePaintEvents||(e=>{const t=Yh.getEntriesByType?.("paint");t&&t.forEach(({name:t,startTime:n})=>{Ad(fg,t)&&e.addEvent(fg[t],n)})})(e),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentLoad),this._endSpan(e,Cd.LOAD_EVENT_END,t))})}_endSpan(e,t,n){e&&(Ad(n,t)?e.end(n[t]):e.end())}_initResourceSpan(e,t){const n=this._startSpan(ig.RESOURCE_FETCH,Cd.FETCH_START,e,t);n&&(n.setAttribute(Kh,e.name),kd(n,e,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnResourceSpan(n,e,this.getConfig().applyCustomAttributesOnSpan?.resourceFetch),this._endSpan(n,Cd.RESPONSE_END,e))}_startSpan(e,t,n,r){if(Ad(n,t)&&"number"==typeof n[t]){return this.tracer.startSpan(e,{startTime:n[t]},r?xh.setSpan(fh.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&&lg(()=>t(e),e=>{e&&this._diag.error("addCustomAttributesOnSpan",e)})}_addCustomAttributesOnResourceSpan(e,t,n){n&&lg(()=>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 gg="OT_ZONE_CONTEXT";class yg{_enabled=!1;_zoneCounter=0;_activeContextFromZone(e){return e&&e.get(gg)||du}_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}_createZoneName(){this._zoneCounter++;const e=Math.random();return`${this._zoneCounter}-${e}`}_createZone(e,t){return Zone.current.fork({name:e,properties:{[gg]:t}})}_getActiveZone(){return Zone.current}_patchAddEventListener(e,t,n){const r=this;return function(o,s,i){void 0===e.__ot_listeners&&(e.__ot_listeners={});let a=e.__ot_listeners[o];void 0===a&&(a=new WeakMap,e.__ot_listeners[o]=a);const l=r.bind(n,s);return a.set(s,l),t.call(this,o,l,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 o=e.__ot_listeners[n],s=o.get(r);return o.delete(r),t.call(this,n,s||r)}}active(){if(!this._enabled)return du;const e=this._getActiveZone(),t=this._activeContextFromZone(e);return t||du}bind(e,t){return void 0===e&&(e=this.active()),"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){const o=this._createZoneName();return this._createZone(o,e).run(t,n,r)}}
|
|
16
|
-
/**
|
|
17
|
-
* @license Angular v<unknown>
|
|
18
|
-
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
19
|
-
* License: MIT
|
|
20
|
-
*/const vg=globalThis;function bg(e){return(vg.__Zone_symbol_prefix||"__zone_symbol__")+e}const wg=Object.getOwnPropertyDescriptor,Cg=Object.defineProperty,_g=Object.getPrototypeOf,Sg=Object.create,Ig=Array.prototype.slice,Eg="addEventListener",Ag="removeEventListener",Tg=bg(Eg),kg=bg(Ag),Og="true",xg="false",Rg=bg("");function Ng(e,t){return Zone.current.wrap(e,t)}function Mg(e,t,n,r,o){return Zone.current.scheduleMacroTask(e,t,n,r,o)}const Lg=bg,Pg="undefined"!=typeof window,Dg=Pg?window:void 0,Fg=Pg&&Dg||globalThis;function Ug(e,t){for(let n=e.length-1;n>=0;n--)"function"==typeof e[n]&&(e[n]=Ng(e[n],t+"_"+n));return e}function Bg(e){return!e||!1!==e.writable&&!("function"==typeof e.get&&void 0===e.set)}const jg="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,Zg=!("nw"in Fg)&&void 0!==Fg.process&&"[object process]"===Fg.process.toString(),zg=!Zg&&!jg&&!(!Pg||!Dg.HTMLElement),Vg=void 0!==Fg.process&&"[object process]"===Fg.process.toString()&&!jg&&!(!Pg||!Dg.HTMLElement),Gg={},Wg=Lg("enable_beforeunload"),$g=function(e){if(!(e=e||Fg.event))return;let t=Gg[e.type];t||(t=Gg[e.type]=Lg("ON_PROPERTY"+e.type));const n=this||e.target||Fg,r=n[t];let o;if(zg&&n===Dg&&"error"===e.type){const t=e;o=r&&r.call(this,t.message,t.filename,t.lineno,t.colno,t.error),!0===o&&e.preventDefault()}else o=r&&r.apply(this,arguments),"beforeunload"===e.type&&Fg[Wg]&&"string"==typeof o?e.returnValue=o:null==o||o||e.preventDefault();return o};function Hg(e,t,n){let r=wg(e,t);if(!r&&n){wg(n,t)&&(r={enumerable:!0,configurable:!0})}if(!r||!r.configurable)return;const o=Lg("on"+t+"patched");if(e.hasOwnProperty(o)&&e[o])return;delete r.writable,delete r.value;const s=r.get,i=r.set,a=t.slice(2);let l=Gg[a];l||(l=Gg[a]=Lg("ON_PROPERTY"+a)),r.set=function(t){let n=this;if(n||e!==Fg||(n=Fg),!n)return;"function"==typeof n[l]&&n.removeEventListener(a,$g),i?.call(n,null),n[l]=t,"function"==typeof t&&n.addEventListener(a,$g,!1)},r.get=function(){let n=this;if(n||e!==Fg||(n=Fg),!n)return null;const o=n[l];if(o)return o;if(s){let e=s.call(this);if(e)return r.set.call(this,e),"function"==typeof n.removeAttribute&&n.removeAttribute(t),e}return null},Cg(e,t,r),e[o]=!0}function Yg(e,t,n){if(t)for(let r=0;r<t.length;r++)Hg(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++)Hg(e,t[r],n)}}const Kg=Lg("originalInstance");function qg(e){const t=Fg[e];if(!t)return;Fg[Lg(e)]=t,Fg[e]=function(){const n=Ug(arguments,e);switch(n.length){case 0:this[Kg]=new t;break;case 1:this[Kg]=new t(n[0]);break;case 2:this[Kg]=new t(n[0],n[1]);break;case 3:this[Kg]=new t(n[0],n[1],n[2]);break;case 4:this[Kg]=new t(n[0],n[1],n[2],n[3]);break;default:throw new Error("Arg list too long.")}},Qg(Fg[e],t);const n=new t(function(){});let r;for(r in n)"XMLHttpRequest"===e&&"responseBlob"===r||function(t){"function"==typeof n[t]?Fg[e].prototype[t]=function(){return this[Kg][t].apply(this[Kg],arguments)}:Cg(Fg[e].prototype,t,{set:function(n){"function"==typeof n?(this[Kg][t]=Ng(n,e+"."+t),Qg(this[Kg][t],n)):this[Kg][t]=n},get:function(){return this[Kg][t]}})}(r);for(r in t)"prototype"!==r&&t.hasOwnProperty(r)&&(Fg[e][r]=t[r])}function Xg(e,t,n){let r=e;for(;r&&!r.hasOwnProperty(t);)r=_g(r);!r&&e[t]&&(r=e);const o=Lg(t);let s=null;if(r&&(!(s=r[o])||!r.hasOwnProperty(o))){s=r[o]=r[t];if(Bg(r&&wg(r,t))){const e=n(s,o,t);r[t]=function(){return e(this,arguments)},Qg(r[t],s)}}return s}function Jg(e,t,n){let r=null;function o(e){const t=e.data;return t.args[t.cbIdx]=function(){e.invoke.apply(this,arguments)},r.apply(t.target,t.args),e}r=Xg(e,t,e=>function(t,r){const s=n(t,r);return s.cbIdx>=0&&"function"==typeof r[s.cbIdx]?Mg(s.name,r[s.cbIdx],s,o):e.apply(t,r)})}function Qg(e,t){e[Lg("OriginalDelegate")]=t}let ey=!1,ty=!1;function ny(){if(ey)return ty;ey=!0;try{const e=Dg.navigator.userAgent;-1===e.indexOf("MSIE ")&&-1===e.indexOf("Trident/")&&-1===e.indexOf("Edge/")||(ty=!0)}catch(e){}return ty}function ry(e){return"function"==typeof e}function oy(e){return"number"==typeof e}const sy={useG:!0},iy={},ay={},ly=new RegExp("^"+Rg+"(\\w+)(true|false)$"),cy=Lg("propagationStopped");function uy(e,t){const n=(t?t(e):e)+xg,r=(t?t(e):e)+Og,o=Rg+n,s=Rg+r;iy[e]={},iy[e][xg]=o,iy[e][Og]=s}function hy(e,t,n,r){const o=r&&r.add||Eg,s=r&&r.rm||Ag,i=r&&r.listeners||"eventListeners",a=r&&r.rmAll||"removeAllListeners",l=Lg(o),c="."+o+":",u="prependListener",h="."+u+":",p=function(e,t,n){if(e.isRemoved)return;const r=e.callback;let o;"object"==typeof r&&r.handleEvent&&(e.callback=e=>r.handleEvent(e),e.originalDelegate=r);try{e.invoke(e,t,[n])}catch(e){o=e}const i=e.options;if(i&&"object"==typeof i&&i.once){const r=e.originalDelegate?e.originalDelegate:e.callback;t[s].call(t,n.type,r,i)}return o};function d(n,r,o){if(!(r=r||e.event))return;const s=n||r.target||e,i=s[iy[r.type][o?Og:xg]];if(i){const e=[];if(1===i.length){const t=p(i[0],s,r);t&&e.push(t)}else{const t=i.slice();for(let n=0;n<t.length&&(!r||!0!==r[cy]);n++){const o=p(t[n],s,r);o&&e.push(o)}}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 d(this,e,!1)},m=function(e){return d(this,e,!0)};function g(t,n){if(!t)return!1;let r=!0;n&&void 0!==n.useG&&(r=n.useG);const p=n&&n.vh;let d=!0;n&&void 0!==n.chkDup&&(d=n.chkDup);let g=!1;n&&void 0!==n.rt&&(g=n.rt);let y=t;for(;y&&!y.hasOwnProperty(o);)y=_g(y);if(!y&&t[o]&&(y=t),!y)return!1;if(y[l])return!1;const v=n&&n.eventNameToString,b={},w=y[l]=y[o],C=y[Lg(s)]=y[s],_=y[Lg(i)]=y[i],S=y[Lg(a)]=y[a];let I;n&&n.prepend&&(I=y[Lg(n.prepend)]=y[n.prepend]);const E=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?m:f,b.options)}:function(e){return w.call(b.target,b.eventName,e.invoke,b.options)},T=r?function(e){if(!e.isRemoved){const t=iy[e.eventName];let n;t&&(n=t[e.capture?Og:xg]);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?m:f,e.options)}:function(e){return C.call(e.target,e.eventName,e.invoke,e.options)},k=n?.diff||function(e,t){const n=typeof t;return"function"===n&&e.callback===t||"object"===n&&e.originalDelegate===t},O=Zone[Lg("UNPATCHED_EVENTS")],x=e[Lg("PASSIVE_EVENTS")];const R=function(t,o,s,i,a=!1,l=!1){return function(){const c=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(Zg&&"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(p&&!p(t,h,c,arguments))return;const m=!!x&&-1!==x.indexOf(u),g=function(e){if("object"==typeof e&&null!==e){const t={...e};return e.signal&&(t.signal=e.signal),t}return e}(function(e,t){return t?"boolean"==typeof e?{capture:e,passive:!0}:e?"object"==typeof e&&!1!==e.passive?{...e,passive:!0}:e:{passive:!0}:e}(arguments[2],m)),y=g?.signal;if(y?.aborted)return;if(O)for(let e=0;e<O.length;e++)if(u===O[e])return m?t.call(c,u,h,g):t.apply(this,arguments);const w=!!g&&("boolean"==typeof g||g.capture),C=!(!g||"object"!=typeof g)&&g.once,_=Zone.current;let S=iy[u];S||(uy(u,v),S=iy[u]);const I=S[w?Og:xg];let E,A=c[I],T=!1;if(A){if(T=!0,d)for(let e=0;e<A.length;e++)if(k(A[e],h))return}else A=c[I]=[];const R=c.constructor.name,N=ay[R];N&&(E=N[u]),E||(E=R+o+(v?v(u):u)),b.options=g,C&&(b.options.once=!1),b.target=c,b.capture=w,b.eventName=u,b.isExisting=T;const M=r?sy:void 0;M&&(M.taskData=b),y&&(b.options.signal=void 0);const L=_.scheduleEventTask(E,h,M,s,i);if(y){b.options.signal=y;const e=()=>L.zone.cancelTask(L);t.call(y,"abort",e,{once:!0}),L.removeAbortListener=()=>y.removeEventListener("abort",e)}return b.target=null,M&&(M.taskData=null),C&&(b.options.once=!0),"boolean"!=typeof L.options&&(L.options=g),L.target=c,L.capture=w,L.eventName=u,f&&(L.originalDelegate=h),l?A.unshift(L):A.push(L),a?c:void 0}};return y[o]=R(w,c,A,T,g),I&&(y[u]=R(I,h,E,T,g,!0)),y[s]=function(){const t=this||e;let r=arguments[0];n&&n.transferEventName&&(r=n.transferEventName(r));const o=arguments[2],s=!!o&&("boolean"==typeof o||o.capture),i=arguments[1];if(!i)return C.apply(this,arguments);if(p&&!p(C,i,t,arguments))return;const a=iy[r];let l;a&&(l=a[s?Og:xg]);const c=l&&t[l];if(c)for(let e=0;e<c.length;e++){const n=c[e];if(k(n,i)){if(c.splice(e,1),n.isRemoved=!0,0===c.length&&(n.allRemoved=!0,t[l]=null,!s&&"string"==typeof r)){t[Rg+"ON_PROPERTY"+r]=null}return n.zone.cancelTask(n),g?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 o=[],s=py(t,v?v(r):r);for(let e=0;e<s.length;e++){const t=s[e];let n=t.originalDelegate?t.originalDelegate:t.callback;o.push(n)}return o},y[a]=function(){const t=this||e;let r=arguments[0];if(r){n&&n.transferEventName&&(r=n.transferEventName(r));const e=iy[r];if(e){const n=e[xg],o=e[Og],i=t[n],a=t[o];if(i){const e=i.slice();for(let t=0;t<e.length;t++){const n=e[t];let o=n.originalDelegate?n.originalDelegate:n.callback;this[s].call(this,r,o,n.options)}}if(a){const e=a.slice();for(let t=0;t<e.length;t++){const n=e[t];let o=n.originalDelegate?n.originalDelegate:n.callback;this[s].call(this,r,o,n.options)}}}}else{const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t],r=ly.exec(n);let o=r&&r[1];o&&"removeListener"!==o&&this[a].call(this,o)}this[a].call(this,"removeListener")}if(g)return this},Qg(y[o],w),Qg(y[s],C),S&&Qg(y[a],S),_&&Qg(y[i],_),!0}let y=[];for(let e=0;e<n.length;e++)y[e]=g(n[e],r);return y}function py(e,t){if(!t){const n=[];for(let r in e){const o=ly.exec(r);let s=o&&o[1];if(s&&(!t||s===t)){const t=e[r];if(t)for(let e=0;e<t.length;e++)n.push(t[e])}}return n}let n=iy[t];n||(uy(t),n=iy[t]);const r=e[n[xg]],o=e[n[Og]];return r?o?r.concat(o):r.slice():o?o.slice():[]}function dy(e,t){const n=e.Event;n&&n.prototype&&t.patchMethod(n.prototype,"stopImmediatePropagation",e=>function(t,n){t[cy]=!0,e&&e.apply(t,n)})}function fy(e,t){t.patchMethod(e,"queueMicrotask",e=>function(e,t){Zone.current.scheduleMicroTask("queueMicrotask",t[0])})}const my=Lg("zoneTask");function gy(e,t,n,r){let o=null,s=null;n+=r;const i={};function a(t){const n=t.data;n.args[0]=function(){return t.invoke.apply(this,arguments)};const r=o.apply(e,n.args);return oy(r)?n.handleId=r:(n.handle=r,n.isRefreshable=ry(r.refresh)),t}function l(t){const{handle:n,handleId:r}=t.data;return s.call(e,n??r)}o=Xg(e,t+=r,n=>function(o,s){if(ry(s[0])){const e={isRefreshable:!1,isPeriodic:"Interval"===r,delay:"Timeout"===r||"Interval"===r?s[1]||0:void 0,args:s},n=s[0];s[0]=function(){try{return n.apply(this,arguments)}finally{const{handle:t,handleId:n,isPeriodic:r,isRefreshable:o}=e;r||o||(n?delete i[n]:t&&(t[my]=null))}};const o=Mg(t,s[0],e,a,l);if(!o)return o;const{handleId:c,handle:u,isRefreshable:h,isPeriodic:p}=o.data;if(c)i[c]=o;else if(u&&(u[my]=o,h&&!p)){const e=u.refresh;u.refresh=function(){const{zone:t,state:n}=o;return"notScheduled"===n?(o._state="scheduled",t._updateTaskCount(o,1)):"running"===n&&(o._state="scheduling"),e.call(this)}}return u??c??o}return n.apply(e,s)}),s=Xg(e,n,t=>function(n,r){const o=r[0];let s;oy(o)?(s=i[o],delete i[o]):(s=o?.[my],s?o[my]=null:s=o),s?.type?s.cancelFn&&s.zone.cancelTask(s):t.apply(e,r)})}function yy(e,t){if(Zone[t.symbol("patchEventTarget")])return;const{eventNames:n,zoneSymbolEventNames:r,TRUE_STR:o,FALSE_STR:s,ZONE_SYMBOL_PREFIX:i}=t.getGlobalObjects();for(let e=0;e<n.length;e++){const t=n[e],a=i+(t+s),l=i+(t+o);r[t]={},r[t][s]=a,r[t][o]=l}const a=e.EventTarget;return a&&a.prototype?(t.patchEventTarget(e,t,[a&&a.prototype]),!0):void 0}function vy(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 o=r[0].ignoreProperties;return t.filter(e=>-1===o.indexOf(e))}function by(e,t,n,r){if(!e)return;Yg(e,vy(e,t,n),r)}function wy(e){return Object.getOwnPropertyNames(e).filter(e=>e.startsWith("on")&&e.length>2).map(e=>e.substring(2))}function Cy(e,t){if(Zg&&!Vg)return;if(Zone[e.symbol("patchEvents")])return;const n=t.__Zone_ignore_on_properties;let r=[];if(zg){const e=window;r=r.concat(["Document","SVGElement","Element","HTMLElement","HTMLBodyElement","HTMLMediaElement","HTMLFrameSetElement","HTMLFrameElement","HTMLIFrameElement","HTMLMarqueeElement","Worker"]);const t=[];by(e,wy(e),n?n.concat(t):n,_g(e))}r=r.concat(["XMLHttpRequest","XMLHttpRequestEventTarget","IDBIndex","IDBRequest","IDBOpenDBRequest","IDBDatabase","IDBTransaction","IDBCursor","WebSocket"]);for(let e=0;e<r.length;e++){const o=t[r[e]];o?.prototype&&by(o.prototype,wy(o.prototype),n)}}function _y(e){e.__load_patch("ZoneAwarePromise",(e,t,n)=>{const r=Object.getOwnPropertyDescriptor,o=Object.defineProperty;const s=n.symbol,i=[],a=!1!==e[s("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")],l=s("Promise"),c=s("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=s("unhandledPromiseRejectionHandler");function h(e){n.onUnhandledError(e);try{const n=t[u];"function"==typeof n&&n.call(this,e)}catch(e){}}function p(e){return e&&"function"==typeof e.then}function d(e){return e}function f(e){return M.reject(e)}const m=s("state"),g=s("value"),y=s("finally"),v=s("parentPromiseValue"),b=s("parentPromiseState"),w=null,C=!0,_=!1;function S(e,t){return n=>{try{T(e,t,n)}catch(t){T(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",A=s("currentTaskTrace");function T(e,r,s){const l=I();if(e===s)throw new TypeError(E);if(e[m]===w){let c=null;try{"object"!=typeof s&&"function"!=typeof s||(c=s&&s.then)}catch(t){return l(()=>{T(e,!1,t)})(),e}if(r!==_&&s instanceof M&&s.hasOwnProperty(m)&&s.hasOwnProperty(g)&&s[m]!==w)O(s),T(e,s[m],s[g]);else if(r!==_&&"function"==typeof c)try{c.call(s,l(S(e,r)),l(S(e,!1)))}catch(t){l(()=>{T(e,!1,t)})()}else{e[m]=r;const l=e[g];if(e[g]=s,e[y]===y&&r===C&&(e[m]=e[b],e[g]=e[v]),r===_&&s instanceof Error){const e=t.currentTask&&t.currentTask.data&&t.currentTask.data.__creationTrace__;e&&o(s,A,{configurable:!0,enumerable:!1,writable:!0,value:e})}for(let t=0;t<l.length;)x(e,l[t++],l[t++],l[t++],l[t++]);if(0==l.length&&r==_){e[m]=0;let r=s;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)}(s)+(s&&s.stack?"\n"+s.stack:""))}catch(e){r=e}a&&(r.throwOriginal=!0),r.rejection=s,r.promise=e,r.zone=t.current,r.task=t.currentTask,i.push(r),n.scheduleMicroTask()}}}return e}const k=s("rejectionHandledHandler");function O(e){if(0===e[m]){try{const n=t[k];n&&"function"==typeof n&&n.call(this,{rejection:e[g],promise:e})}catch(e){}e[m]=_;for(let t=0;t<i.length;t++)e===i[t].promise&&i.splice(t,1)}}function x(e,t,n,r,o){O(e);const s=e[m],i=s?"function"==typeof r?r:d:"function"==typeof o?o:f;t.scheduleMicroTask("Promise.then",()=>{try{const r=e[g],o=!!n&&y===n[y];o&&(n[v]=r,n[b]=s);const a=t.run(i,void 0,o&&i!==f&&i!==d?[]:[r]);T(n,!0,a)}catch(e){T(n,!1,e)}},n)}const R=function(){},N=e.AggregateError;class M{static toString(){return"function ZoneAwarePromise() { [native code] }"}static resolve(e){return e instanceof M?e:T(new this(null),C,e)}static reject(e){return T(new this(null),_,e)}static withResolvers(){const e={};return e.promise=new M((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(M.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 o=[];return new M((e,s)=>{for(let i=0;i<t.length;i++)t[i].then(t=>{r||(r=!0,e(t))},e=>{o.push(e),n--,0===n&&(r=!0,s(new N(o,"All promises were rejected")))})})}static race(e){let t,n,r=new this((e,r)=>{t=e,n=r});function o(e){t(e)}function s(e){n(e)}for(let t of e)p(t)||(t=this.resolve(t)),t.then(o,s);return r}static all(e){return M.allWithCallback(e)}static allSettled(e){return(this&&this.prototype instanceof M?this:M).allWithCallback(e,{thenCallback:e=>({status:"fulfilled",value:e}),errorCallback:e=>({status:"rejected",reason:e})})}static allWithCallback(e,t){let n,r,o=new this((e,t)=>{n=e,r=t}),s=2,i=0;const a=[];for(let o of e){p(o)||(o=this.resolve(o));const e=i;try{o.then(r=>{a[e]=t?t.thenCallback(r):r,s--,0===s&&n(a)},o=>{t?(a[e]=t.errorCallback(o),s--,0===s&&n(a)):r(o)})}catch(e){r(e)}s++,i++}return s-=2,0===s&&n(a),o}constructor(e){const t=this;if(!(t instanceof M))throw new Error("Must be an instanceof Promise.");t[m]=w,t[g]=[];try{const n=I();e&&e(n(S(t,C)),n(S(t,_)))}catch(e){T(t,!1,e)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return M}then(e,n){let r=this.constructor?.[Symbol.species];r&&"function"==typeof r||(r=this.constructor||M);const o=new r(R),s=t.current;return this[m]==w?this[g].push(s,o,e,n):x(this,s,o,e,n),o}catch(e){return this.then(null,e)}finally(e){let n=this.constructor?.[Symbol.species];n&&"function"==typeof n||(n=M);const r=new n(R);r[y]=y;const o=t.current;return this[m]==w?this[g].push(o,r,e,e):x(this,o,r,e,e),r}}M.resolve=M.resolve,M.reject=M.reject,M.race=M.race,M.all=M.all;const L=e[l]=e.Promise;e.Promise=M;const P=s("thenPatched");function D(e){const t=e.prototype,n=r(t,"then");if(n&&(!1===n.writable||!n.configurable))return;const o=t.then;t[c]=o,e.prototype.then=function(e,t){const n=new M((e,t)=>{o.call(this,e,t)});return n.then(e,t)},e[P]=!0}return n.patchThen=D,L&&(D(L),Xg(e,"fetch",e=>{return t=e,function(e,n){let r=t.apply(e,n);if(r instanceof M)return r;let o=r.constructor;return o[P]||D(o),r};var t})),Promise[t.__symbol__("uncaughtPromiseErrors")]=i,M})}function Sy(e,t,n,r,o){const s=Zone.__symbol__(r);if(t[s])return;const i=t[s]=t[r];t[r]=function(s,a,l){return a&&a.prototype&&o.forEach(function(t){const o=`${n}.${r}::`+t,s=a.prototype;try{if(s.hasOwnProperty(t)){const n=e.ObjectGetOwnPropertyDescriptor(s,t);n&&n.value?(n.value=e.wrapWithCurrentZone(n.value,o),e._redefineProperty(a.prototype,t,n)):s[t]&&(s[t]=e.wrapWithCurrentZone(s[t],o))}else s[t]&&(s[t]=e.wrapWithCurrentZone(s[t],o))}catch{}}),i.call(t,s,a,l)},e.attachOriginToPatched(t[r],i)}const Iy=function(){const e=globalThis,t=!0===e[bg("forceDuplicateZoneCheck")];if(e.Zone&&(t||"function"!=typeof e.Zone.__symbol__))throw new Error("Zone already loaded.");return e.Zone??=function(){const e=vg.performance;function t(t){e&&e.mark&&e.mark(t)}function n(t,n){e&&e.measure&&e.measure(t,n)}t("Zone");class r{static __symbol__=bg;static assertZonePatched(){if(vg.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 e=r.current;for(;e.parent;)e=e.parent;return e}static get current(){return k.zone}static get currentTask(){return O}static __load_patch(e,o,s=!1){if(A.hasOwnProperty(e)){const t=!0===vg[bg("forceDuplicateZoneCheck")];if(!s&&t)throw Error("Already loaded patch: "+e)}else if(!vg["__Zone_disable_"+e]){const s="Zone:"+e;t(s),A[e]=o(vg,r,T),n(s,s)}}get parent(){return this._parent}get name(){return this._name}_parent;_name;_properties;_zoneDelegate;constructor(e,t){this._parent=e,this._name=t?t.name||"unnamed":"<root>",this._properties=t&&t.properties||{},this._zoneDelegate=new s(this,this._parent&&this._parent._zoneDelegate,t)}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){k={parent:k,zone:this};try{return this._zoneDelegate.invoke(this,e,t,n,r)}finally{k=k.parent}}runGuarded(e,t=null,n,r){k={parent:k,zone:this};try{try{return this._zoneDelegate.invoke(this,e,t,n,r)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{k=k.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||g).name+"; Execution: "+this.name+")");const r=e,{type:o,data:{isPeriodic:s=!1,isRefreshable:i=!1}={}}=e;if(e.state===y&&(o===E||o===I))return;const a=e.state!=w;a&&r._transitionTo(w,b);const l=O;O=r,k={parent:k,zone:this};try{o!=I||!e.data||s||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!==y&&t!==_)if(o==E||s||i&&t===v)a&&r._transitionTo(b,w,v);else{const e=r._zoneDelegates;this._updateTaskCount(r,-1),a&&r._transitionTo(y,w,y),i&&(r._zoneDelegates=e)}k=k.parent,O=l}}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(v,y);const t=[];e._zoneDelegates=t,e._zone=this;try{e=this._zoneDelegate.scheduleTask(this,e)}catch(t){throw e._transitionTo(_,v,y),this._zoneDelegate.handleError(this,t),t}return e._zoneDelegates===t&&this._updateTaskCount(e,1),e.state==v&&e._transitionTo(b,v),e}scheduleMicroTask(e,t,n,r){return this.scheduleTask(new i(S,e,t,n,r,void 0))}scheduleMacroTask(e,t,n,r,o){return this.scheduleTask(new i(I,e,t,n,r,o))}scheduleEventTask(e,t,n,r,o){return this.scheduleTask(new i(E,e,t,n,r,o))}cancelTask(e){if(e.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(e.zone||g).name+"; Execution: "+this.name+")");if(e.state===b||e.state===w){e._transitionTo(C,b,w);try{this._zoneDelegate.cancelTask(this,e)}catch(t){throw e._transitionTo(_,C),this._zoneDelegate.handleError(this,t),t}return this._updateTaskCount(e,-1),e._transitionTo(y,C),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)}}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,o,s)=>e.invokeTask(n,r,o,s),onCancelTask:(e,t,n,r)=>e.cancelTask(n,r)};class s{get zone(){return this._zone}_zone;_taskCounts={microTask:0,macroTask:0,eventTask:0};_parentDelegate;_forkDlgt;_forkZS;_forkCurrZone;_interceptDlgt;_interceptZS;_interceptCurrZone;_invokeDlgt;_invokeZS;_invokeCurrZone;_handleErrorDlgt;_handleErrorZS;_handleErrorCurrZone;_scheduleTaskDlgt;_scheduleTaskZS;_scheduleTaskCurrZone;_invokeTaskDlgt;_invokeTaskZS;_invokeTaskCurrZone;_cancelTaskDlgt;_cancelTaskZS;_cancelTaskCurrZone;_hasTaskDlgt;_hasTaskDlgtOwner;_hasTaskZS;_hasTaskCurrZone;constructor(e,t,n){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))}fork(e,t){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,e,t):new r(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,o){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,e,t,n,r,o):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!=S)throw new Error("Task is missing scheduleFn.");f(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],o=n[e]=r+t;if(o<0)throw new Error("More tasks executed then were scheduled.");if(0==r||0==o){const t={microTask:n.microTask>0,macroTask:n.macroTask>0,eventTask:n.eventTask>0,change:e};this.hasTask(this._zone,t)}}}class i{type;source;invoke;callback;data;scheduleFn;cancelFn;_zone=null;runCount=0;_zoneDelegates=null;_state="notScheduled";constructor(e,t,n,r,o,s){if(this.type=e,this.source=t,this.data=r,this.scheduleFn=o,this.cancelFn=s,!n)throw new Error("callback is not defined");this.callback=n;const a=this;e===E&&r&&r.useG?this.invoke=i.invokeTask:this.invoke=function(){return i.invokeTask.call(vg,a,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(y,v)}_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==y&&(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 a=bg("setTimeout"),l=bg("Promise"),c=bg("then");let u,h=[],p=!1;function d(e){if(u||vg[l]&&(u=vg[l].resolve(0)),u){let t=u[c];t||(t=u.then),t.call(u,e)}else vg[a](e,0)}function f(e){0===x&&0===h.length&&d(m),e&&h.push(e)}function m(){if(!p){for(p=!0;h.length;){const e=h;h=[];for(let t=0;t<e.length;t++){const n=e[t];try{n.zone.runTask(n,null,null)}catch(e){T.onUnhandledError(e)}}}T.microtaskDrainDone(),p=!1}}const g={name:"NO ZONE"},y="notScheduled",v="scheduling",b="scheduled",w="running",C="canceling",_="unknown",S="microTask",I="macroTask",E="eventTask",A={},T={symbol:bg,currentZoneFrame:()=>k,onUnhandledError:R,microtaskDrainDone:R,scheduleMicroTask:f,showUncaughtError:()=>!r[bg("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:R,patchMethod:()=>R,bindArguments:()=>[],patchThen:()=>R,patchMacroTask:()=>R,patchEventPrototype:()=>R,isIEOrEdge:()=>!1,getGlobalObjects:()=>{},ObjectDefineProperty:()=>R,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>R,wrapWithCurrentZone:()=>R,filterProperties:()=>[],attachOriginToPatched:()=>R,_redefineProperty:()=>R,patchCallbacks:()=>R,nativeScheduleMicroTask:d};let k={parent:null,zone:new r(null,null)},O=null,x=0;function R(){}return n("Zone","Zone"),r}(),e.Zone}();!function(e){_y(e),function(e){e.__load_patch("toString",e=>{const t=Function.prototype.toString,n=Lg("OriginalDelegate"),r=Lg("Promise"),o=Lg("Error"),s=function(){if("function"==typeof this){const s=this[n];if(s)return"function"==typeof s?t.call(s):Object.prototype.toString.call(s);if(this===Promise){const n=e[r];if(n)return t.call(n)}if(this===Error){const n=e[o];if(n)return t.call(n)}}return t.call(this)};s[n]=t,Function.prototype.toString=s;const i=Object.prototype.toString;Object.prototype.toString=function(){return"function"==typeof Promise&&this instanceof Promise?"[object Promise]":i.call(this)}})}(e),function(e){e.__load_patch("util",(e,t,n)=>{const r=wy(e);n.patchOnProperties=Yg,n.patchMethod=Xg,n.bindArguments=Ug,n.patchMacroTask=Jg;const o=t.__symbol__("BLACK_LISTED_EVENTS"),s=t.__symbol__("UNPATCHED_EVENTS");e[s]&&(e[o]=e[s]),e[o]&&(t[o]=t[s]=e[o]),n.patchEventPrototype=dy,n.patchEventTarget=hy,n.isIEOrEdge=ny,n.ObjectDefineProperty=Cg,n.ObjectGetOwnPropertyDescriptor=wg,n.ObjectCreate=Sg,n.ArraySlice=Ig,n.patchClass=qg,n.wrapWithCurrentZone=Ng,n.filterProperties=vy,n.attachOriginToPatched=Qg,n._redefineProperty=Object.defineProperty,n.patchCallbacks=Sy,n.getGlobalObjects=()=>({globalSources:ay,zoneSymbolEventNames:iy,eventNames:r,isBrowser:zg,isMix:Vg,isNode:Zg,TRUE_STR:Og,FALSE_STR:xg,ZONE_SYMBOL_PREFIX:Rg,ADD_EVENT_LISTENER_STR:Eg,REMOVE_EVENT_LISTENER_STR:Ag})})}(e)}(Iy),function(e){e.__load_patch("legacy",t=>{const n=t[e.__symbol__("legacyPatch")];n&&n()}),e.__load_patch("timers",e=>{const t="set",n="clear";gy(e,t,n,"Timeout"),gy(e,t,n,"Interval"),gy(e,t,n,"Immediate")}),e.__load_patch("requestAnimationFrame",e=>{gy(e,"request","cancel","AnimationFrame"),gy(e,"mozRequest","mozCancel","AnimationFrame"),gy(e,"webkitRequest","webkitCancel","AnimationFrame")}),e.__load_patch("blocking",(e,t)=>{const n=["alert","prompt","confirm"];for(let r=0;r<n.length;r++){Xg(e,n[r],(n,r,o)=>function(r,s){return t.current.run(n,e,s,o)})}}),e.__load_patch("EventTarget",(e,t,n)=>{!function(e,t){t.patchEventPrototype(e,t)}(e,n),yy(e,n);const r=e.XMLHttpRequestEventTarget;r&&r.prototype&&n.patchEventTarget(e,n,[r.prototype])}),e.__load_patch("MutationObserver",(e,t,n)=>{qg("MutationObserver"),qg("WebKitMutationObserver")}),e.__load_patch("IntersectionObserver",(e,t,n)=>{qg("IntersectionObserver")}),e.__load_patch("FileReader",(e,t,n)=>{qg("FileReader")}),e.__load_patch("on_property",(e,t,n)=>{Cy(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 l=e.XMLHttpRequest;if(!l)return;const c=l.prototype;let u=c[Tg],h=c[kg];if(!u){const t=e.XMLHttpRequestEventTarget;if(t){const e=t.prototype;u=e[Tg],h=e[kg]}}const p="readystatechange",d="scheduled";function f(e){const r=e.data,i=r.target;i[s]=!1,i[a]=!1;const l=i[o];u||(u=i[Tg],h=i[kg]),l&&h.call(i,p,l);const c=i[o]=()=>{if(i.readyState===i.DONE)if(!r.aborted&&i[s]&&e.state===d){const n=i[t.__symbol__("loadfalse")];if(0!==i.status&&n&&n.length>0){const o=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!==d||o.call(e)},n.push(e)}else e.invoke()}else r.aborted||!1!==i[s]||(i[a]=!0)};u.call(i,p,c);return i[n]||(i[n]=e),w.apply(i,r.args),i[s]=!0,e}function m(){}function g(e){const t=e.data;return t.aborted=!0,C.apply(t.target,t.args)}const y=Xg(c,"open",()=>function(e,t){return e[r]=0==t[2],e[i]=t[1],y.apply(e,t)}),v=Lg("fetchTaskAborting"),b=Lg("fetchTaskScheduling"),w=Xg(c,"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=Mg("XMLHttpRequest.send",m,t,f,g);e&&!0===e[a]&&!t.aborted&&r.state===d&&r.invoke()}}),C=Xg(c,"abort",()=>function(e,r){const o=e[n];if(o&&"string"==typeof o.type){if(null==o.cancelFn||o.data&&o.data.aborted)return;o.zone.cancelTask(o)}else if(!0===t.current[v])return C.apply(e,r)})}(e);const n=Lg("xhrTask"),r=Lg("xhrSync"),o=Lg("xhrListener"),s=Lg("xhrScheduled"),i=Lg("xhrURL"),a=Lg("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 o=t[r],s=e[o];if(s){if(!Bg(wg(e,o)))continue;e[o]=(e=>{const t=function(){return e.apply(this,Ug(arguments,n+"."+o))};return Qg(t,e),t})(s)}}}(e.navigator.geolocation,["getCurrentPosition","watchPosition"])}),e.__load_patch("PromiseRejectionEvent",(e,t)=>{function n(t){return function(n){py(e,t).forEach(r=>{const o=e.PromiseRejectionEvent;if(o){const e=new o(t,{promise:n.promise,reason:n.rejection});r.invoke(e)}})}}e.PromiseRejectionEvent&&(t[Lg("unhandledPromiseRejectionHandler")]=n("unhandledrejection"),t[Lg("rejectionHandledHandler")]=n("rejectionhandled"))}),e.__load_patch("queueMicrotask",(e,t,n)=>{fy(e,n)})}(Iy);var Ey;!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"}(Ey||(Ey={}));const Ay=mh.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-xml-http-request/utils"});function Ty(e){return t=e,"undefined"!=typeof Document&&t instanceof Document?(new XMLSerializer).serializeToString(document).length:"string"==typeof e?Oy(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?Oy(e.toString()):void 0!==e.byteLength?e.byteLength:void Ay.warn("unknown body type");var t}const ky=new TextEncoder;function Oy(e){return ky.encode(e).byteLength}function xy(e){const t=function(){if(void 0===Ny){const e=$h("OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS");e&&e.length>0?(Ny={},e.forEach(e=>{Ny[e]=!0})):Ny=Ry}return Ny}(),n=e.toUpperCase();return n in t?n:"_OTHER"}const Ry={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0};let Ny;const My={"https:":"443","http:":"80"};const Ly="0.203.0";var Py;!function(e){e.HTTP_STATUS_TEXT="http.status_text"}(Py||(Py={}));class Dy extends ug{component="xml-http-request";version=Ly;moduleName=this.component;_tasksCount=0;_xhrMem=new WeakMap;_usedResources=new WeakSet;_semconvStability;constructor(e={}){super("@opentelemetry/instrumentation-xml-http-request",Ly,e),this._semconvStability=pg("http",e?.semconvStabilityOptIn)}init(){}_addHeaders(e,t){if(!Nd(Rd(t).href,this.getConfig().propagateTraceHeaderCorsUrls)){const e={};return kh.inject(fh.active(),e),void(Object.keys(e).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}const n={};kh.inject(fh.active(),n),Object.keys(n).forEach(t=>{e.setRequestHeader(t,String(n[t]))})}_addChildSpan(e,t){fh.with(xh.setSpan(fh.active(),e),()=>{const e=this.tracer.startSpan("CORS Preflight",{startTime:t[Cd.FETCH_START]}),n=!(this._semconvStability&sg.OLD);kd(e,t,this.getConfig().ignoreNetworkEvents,void 0,n),e.end(t[Cd.RESPONSE_END])})}_addFinalSpanAttributes(e,t,n){if(this._semconvStability&sg.OLD){if(void 0!==t.status&&e.setAttribute("http.status_code",t.status),void 0!==t.statusText&&e.setAttribute(Py.HTTP_STATUS_TEXT,t.statusText),"string"==typeof n){const t=Rd(n);e.setAttribute("http.host",t.host),e.setAttribute("http.scheme",t.protocol.replace(":",""))}e.setAttribute("http.user_agent",navigator.userAgent)}this._semconvStability&sg.STABLE&&t.status&&e.setAttribute(tp,t.status)}_applyAttributesAfterXHR(e,t){const n=this.getConfig().applyCustomAttributesOnSpan;"function"==typeof n&&lg(()=>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(),o=Rd(t);r.forEach(e=>{"xmlhttprequest"===e.initiatorType&&e.name===o.href&&n.createdResources&&n.createdResources.entries.push(e)})}),entries:[]},n.createdResources.observer.observe({entryTypes:["resource"]}))}_clearResources(){0===this._tasksCount&&this.getConfig().clearTimingResources&&(Yh.clearResourceTimings(),this._xhrMem=new WeakMap,this._usedResources=new WeakSet)}_findResourceAndAddNetworkEvents(e,t,n,r,o){if(!(n&&r&&o&&e.createdResources))return;let s=e.createdResources.entries;s&&s.length||(s=Yh.getEntriesByType("resource"));const i=xd(Rd(n).href,r,o,s,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&sg.OLD);kd(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(qp(t,this.getConfig().ignoreUrls))return void this._diag.debug("ignoring span as url matches ignored url");let r="";const o=Rd(t),s={};if(this._semconvStability&sg.OLD&&(r=n.toUpperCase(),s["http.method"]=n,s["http.url"]=o.toString()),this._semconvStability&sg.STABLE){const e=n,t=xy(n);r||(r=t),s[Qh]=t,t!==e&&(s[ep]=e),s[lp]=o.toString(),s[np]=o.hostname;const i=function(e){const t=Number(e.port||My[e.protocol]);return t&&!isNaN(t)?t:void 0}(o);i&&(s[rp]=i)}const i=this.tracer.startSpan(r,{kind:lh.CLIENT,attributes:s});return i.addEvent(Ey.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],o=n[1];return t._createSpan(this,o,r),e.apply(this,n)}}}_patchSend(){const e=this;function t(t,n,r,o){const s=e._xhrMem.get(n);if(!s)return;if(s.status=n.status,s.statusText=n.statusText,e._xhrMem.delete(n),s.span){const t=s.span;e._applyAttributesAfterXHR(t,n),e._semconvStability&sg.STABLE&&(r?o&&(t.setStatus({code:ch.ERROR,message:o}),t.setAttribute(qh,o)):s.status&&s.status>=400&&(t.setStatus({code:ch.ERROR}),t.setAttribute(qh,String(s.status))))}const i=mp(),a=Date.now();setTimeout(()=>{!function(t,n,r,o){const s=n.callbackToRemoveEvents;"function"==typeof s&&s();const{span:i,spanUrl:a,sendStartTime:l}=n;i&&(e._findResourceAndAddNetworkEvents(n,i,a,l,r),i.addEvent(t,o),e._addFinalSpanAttributes(i,n,a),i.end(o),e._tasksCount--),e._clearResources()}(t,s,i,a)},300)}function n(){t(Ey.EVENT_ERROR,this,!0,"error")}function r(){t(Ey.EVENT_ABORT,this,!1)}function o(){t(Ey.EVENT_TIMEOUT,this,!0,"timeout")}function s(){this.status<299?t(Ey.EVENT_LOAD,this,!1):t(Ey.EVENT_ERROR,this,!1)}return t=>function(...i){const a=e._xhrMem.get(this);if(!a)return t.apply(this,i);const l=a.span,c=a.spanUrl;if(l&&c){if(e.getConfig().measureRequestSize&&i?.[0]){const t=Ty(i[0]);void 0!==t&&(e._semconvStability&sg.OLD&&l.setAttribute("http.request_content_length_uncompressed",t),e._semconvStability&sg.STABLE&&l.setAttribute("http.request.body.size",t))}fh.with(xh.setSpan(fh.active(),l),()=>{e._tasksCount++,a.sendStartTime=mp(),l.addEvent(Ey.METHOD_SEND),this.addEventListener("abort",r),this.addEventListener("error",n),this.addEventListener("load",s),this.addEventListener("timeout",o),a.callbackToRemoveEvents=()=>{!function(t){t.removeEventListener("abort",r),t.removeEventListener("error",n),t.removeEventListener("load",s),t.removeEventListener("timeout",o);const i=e._xhrMem.get(t);i&&(i.callbackToRemoveEvents=void 0)}(this),a.createdResources&&a.createdResources.observer.disconnect()},e._addHeaders(this,c),e._addResourceObserver(this,c)})}return t.apply(this,i)}}enable(){this._diag.debug("applying patch to",this.moduleName,this.version),cg(XMLHttpRequest.prototype.open)&&(this._unwrap(XMLHttpRequest.prototype,"open"),this._diag.debug("removing previous patch from method open")),cg(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 Fy;!function(e){e.COMPONENT="component",e.HTTP_STATUS_TEXT="http.status_text"}(Fy||(Fy={}));var Uy={};Object.defineProperty(Uy,"__esModule",{value:!0});var By=Uy.ATTR_HTTP_USER_AGENT=Uy.ATTR_HTTP_URL=Uy.ATTR_HTTP_STATUS_CODE=Uy.ATTR_HTTP_SCHEME=Uy.ATTR_HTTP_RESPONSE_CONTENT_LENGTH=Uy.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED=Uy.ATTR_HTTP_REQUEST_BODY_SIZE=Uy.ATTR_HTTP_METHOD=Uy.ATTR_HTTP_HOST=void 0,jy=Uy.ATTR_HTTP_HOST="http.host",Zy=Uy.ATTR_HTTP_METHOD="http.method",zy=Uy.ATTR_HTTP_REQUEST_BODY_SIZE="http.request.body.size",Vy=Uy.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED="http.request_content_length_uncompressed";Uy.ATTR_HTTP_RESPONSE_CONTENT_LENGTH="http.response_content_length";var Gy=Uy.ATTR_HTTP_SCHEME="http.scheme",Wy=Uy.ATTR_HTTP_STATUS_CODE="http.status_code",$y=Uy.ATTR_HTTP_URL="http.url";By=Uy.ATTR_HTTP_USER_AGENT="http.user_agent";const Hy=mh.createComponentLogger({namespace:"@opentelemetry/opentelemetry-instrumentation-fetch/utils"});function Yy(...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 Hy.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}),o=new TransformStream({start(){},async transform(e,t){const r=await e;n+=r.byteLength,t.enqueue(e)},flush(){t(n)}});return{body:e.pipeThrough(o),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 qy(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 qy(e.toString());if(void 0!==e.byteLength)return e.byteLength;return void Hy.warn("unknown body type")}(t.body))}{const t=e[0];return t?.body?t.clone().text().then(e=>qy(e)):Promise.resolve()}}const Ky=new TextEncoder;function qy(e){return Ky.encode(e).byteLength}const Xy={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0};let Jy;function Qy(){if(void 0===Jy){const e=$h("OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS");e&&e.length>0?(Jy={},e.forEach(e=>{Jy[e]=!0})):Jy=Xy}return Jy}const ev={"https:":"443","http:":"80"};const tv="0.203.0",nv="object"==typeof process&&"node"===process.release?.name;class rv extends ug{component="fetch";version=tv;moduleName=this.component;_usedResources=new WeakSet;_tasksCount=0;_semconvStability;constructor(e={}){super("@opentelemetry/instrumentation-fetch",tv,e),this._semconvStability=pg("http",e?.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){const n=this.tracer.startSpan("CORS Preflight",{startTime:t[Cd.FETCH_START]},xh.setSpan(fh.active(),e)),r=!(this._semconvStability&sg.OLD);kd(n,t,this.getConfig().ignoreNetworkEvents,void 0,r),n.end(t[Cd.RESPONSE_END])}_addFinalSpanAttributes(e,t){const n=Rd(t.url);if(this._semconvStability&sg.OLD&&(e.setAttribute(Wy,t.status),null!=t.statusText&&e.setAttribute(Fy.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(jy,n.host),e.setAttribute(Gy,n.protocol.replace(":","")),"undefined"!=typeof navigator&&e.setAttribute(By,navigator.userAgent)),this._semconvStability&sg.STABLE){e.setAttribute(tp,t.status),e.setAttribute(np,n.hostname);const r=function(e){const t=Number(e.port||ev[e.protocol]);return t&&!isNaN(t)?t:void 0}(n);r&&e.setAttribute(rp,r)}}_addHeaders(e,t){if(!Nd(t,this.getConfig().propagateTraceHeaderCorsUrls)){const e={};return kh.inject(fh.active(),e),void(Object.keys(e).length>0&&this._diag.debug("headers inject skipped due to CORS policy"))}if(e instanceof Request)kh.inject(fh.active(),e.headers,{set:(e,t,n)=>e.set(t,"string"==typeof n?n:String(n))});else if(e.headers instanceof Headers)kh.inject(fh.active(),e.headers,{set:(e,t,n)=>e.set(t,"string"==typeof n?n:String(n))});else if(e.headers instanceof Map)kh.inject(fh.active(),e.headers,{set:(e,t,n)=>e.set(t,"string"==typeof n?n:String(n))});else{const t={};kh.inject(fh.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(qp(e,this.getConfig().ignoreUrls))return void this._diag.debug("ignoring span as url matches ignored url");let n="";const r={};if(this._semconvStability&sg.OLD){const o=(t.method||"GET").toUpperCase();n=`HTTP ${o}`,r[Fy.COMPONENT]=this.moduleName,r[Zy]=o,r[$y]=e}if(this._semconvStability&sg.STABLE){const o=t.method,s=function(e){const t=Qy(),n=e.toUpperCase();return n in t?n:"_OTHER"}(t.method||"GET");n||(n=s),r[Qh]=s,s!==o&&(r[ep]=o),r[lp]=e}return this.tracer.startSpan(n,{kind:lh.CLIENT,attributes:r})}_findResourceAndAddNetworkEvents(e,t,n){let r=t.entries;if(!r.length){if(!performance.getEntriesByType)return;r=performance.getEntriesByType("resource")}const o=xd(t.spanUrl,t.startTime,n,r,this._usedResources,"fetch");if(o.mainRequest){const t=o.mainRequest;this._markResourceAsUsed(t);const n=o.corsPreFlightRequest;n&&(this._addChildSpan(e,n),this._markResourceAsUsed(n));const r=!(this._semconvStability&sg.OLD);kd(e,t,this.getConfig().ignoreNetworkEvents,void 0,r)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,n){const r=dp(Date.now()),o=mp();this._addFinalSpanAttributes(e,n),this._semconvStability&sg.STABLE&&n.status>=400&&(e.setStatus({code:ch.ERROR}),e.setAttribute(qh,String(n.status))),setTimeout(()=>{t.observer?.disconnect(),this._findResourceAndAddNetworkEvents(e,t,o),this._tasksCount--,this._clearResources(),e.end(r)},300)}_patchConstructor(){return e=>{const t=this;return function(...n){const r=this,o=Rd(n[0]instanceof Request?n[0].url:String(n[0])).href,s=n[0]instanceof Request?n[0]:n[1]||{},i=t._createSpan(o,s);if(!i)return e.apply(this,n);const a=t._prepareSpanData(o);function l(e,n){t._applyAttributesAfterFetch(e,s,n),t._endSpan(e,a,{status:n.status||0,statusText:n.message,url:o})}function c(e,n){t._applyAttributesAfterFetch(e,s,n),n.status>=200&&n.status<400?t._endSpan(e,a,n):t._endSpan(e,a,{status:n.status,statusText:n.statusText,url:o})}function u(e,t,n){try{const t=n.clone().body;if(t){const r=t.getReader(),o=()=>{r.read().then(({done:t})=>{t?c(e,n):o()},t=>{l(e,t)})};o()}else c(e,n)}finally{t(n)}}function h(e,t,n){try{l(e,n)}finally{t(n)}}return t.getConfig().measureRequestSize&&Yy(...n).then(e=>{e&&(t._semconvStability&sg.OLD&&i.setAttribute(Vy,e),t._semconvStability&sg.STABLE&&i.setAttribute(zy,e))}).catch(e=>{t._diag.warn("getFetchBodyLength",e)}),new Promise((n,a)=>fh.with(xh.setSpan(fh.active(),i),()=>(t._addHeaders(s,o),t._callRequestHook(i,s),t._tasksCount++,e.apply(r,s instanceof Request?[s]:[o,s]).then(u.bind(r,i,n),h.bind(r,i,a)))))}}}_applyAttributesAfterFetch(e,t,n){const r=this.getConfig().applyCustomAttributesOnSpan;r&&lg(()=>r(e,t,n),e=>{e&&this._diag.error("applyCustomAttributesOnSpan",e)})}_callRequestHook(e,t){const n=this.getConfig().requestHook;n&&lg(()=>n(e,t),e=>{e&&this._diag.error("requestHook",e)})}_prepareSpanData(e){const t=mp(),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(){nv?this._diag.warn("this instrumentation is intended for web usage only, it does not instrument Node.js's fetch()"):(cg(fetch)&&(this._unwrap(Hh,"fetch"),this._diag.debug("removing previous patch for constructor")),this._wrap(Hh,"fetch",this._patchConstructor()))}disable(){nv||(this._unwrap(Hh,"fetch"),this._usedResources=new WeakSet)}}class ov{_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 sv extends Error{code;name="OTLPExporterError";data;constructor(e,t,n){super(e),this.data=n,this.code=t}}function iv(e){if(Number.isFinite(e)&&e>0)return e;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function av(e){if(null!=e)return()=>e}function lv(e,t,n){return{timeoutMillis:iv(e.timeoutMillis??t.timeoutMillis??n.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??n.concurrencyLimit,compression:e.compression??t.compression??n.compression}}class cv{_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 uv(e){return new cv(e.concurrencyLimit)}function hv(){return{handleResponse(e){null!=e&&function(e){return Object.prototype.hasOwnProperty.call(e,"partialSuccess")}(e)&&null!=e.partialSuccess&&0!==Object.keys(e.partialSuccess).length&&mh.warn("Received Partial Success response:",JSON.stringify(e.partialSuccess))}}}class pv{_transport;_serializer;_responseHandler;_promiseQueue;_timeout;_diagLogger;constructor(e,t,n,r,o){this._transport=e,this._serializer=t,this._responseHandler=n,this._promiseQueue=r,this._timeout=o,this._diagLogger=mh.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,t){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit())return void t({code:Cp.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:Cp.FAILED,error:e.error}):"retryable"===e.status?t({code:Cp.FAILED,error:new sv("Export failed with retryable status")}):t({code:Cp.FAILED,error:new sv("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:Cp.SUCCESS})}},e=>t({code:Cp.FAILED,error:e}))):t({code:Cp.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 dv(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function fv(e){const t=new Uint8Array(e.length/2);let n=0;for(let r=0;r<e.length;r+=2){const o=dv(e.charCodeAt(r)),s=dv(e.charCodeAt(r+1));t[n++]=o<<4|s}return t}function mv(e){const t=BigInt(1e9);return BigInt(e[0])*t+BigInt(e[1])}const gv="undefined"!=typeof BigInt?function(e){return mv(e).toString()}:yp;function yv(e){return e}const vv={encodeHrTime:function(e){const t=mv(e);return n=t,{low:Number(BigInt.asUintN(32,n)),high:Number(BigInt.asUintN(32,n>>BigInt(32)))};var n},encodeSpanContext:fv,encodeOptionalSpanContext:function(e){if(void 0!==e)return fv(e)}};function bv(e){return{attributes:Cv(e.attributes),droppedAttributesCount:0}}function wv(e){return{name:e.name,version:e.version}}function Cv(e){return Object.keys(e).map(t=>_v(t,e[t]))}function _v(e,t){return{key:e,value:Sv(t)}}function Sv(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(Sv)}}:"object"===t&&null!=e?{kvlistValue:{values:Object.entries(e).map(([e,t])=>_v(e,t))}}:{}}function Iv(e,t){const n=e.spanContext(),r=e.status,o=e.parentSpanContext?.spanId?t.encodeSpanContext(e.parentSpanContext?.spanId):void 0;return{traceId:t.encodeSpanContext(n.traceId),spanId:t.encodeSpanContext(n.spanId),parentSpanId:o,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:Cv(e.attributes),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>function(e,t){return{attributes:e.attributes?Cv(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?Cv(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 Ev(e,t){const n=function(e){return void 0===e?vv:{encodeHrTime:gv,encodeSpanContext:yv,encodeOptionalSpanContext:yv}}(t);return{resourceSpans:Av(e,n)}}function Av(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 o=e.get(r);o||(o=[],e.set(r,o)),o.push(n)}return t}(e),r=[],o=n.entries();let s=o.next();for(;!s.done;){const[e,n]=s.value,i=[],a=n.values();let l=a.next();for(;!l.done;){const e=l.value;if(e.length>0){const n=e.map(e=>Iv(e,t));i.push({scope:wv(e[0].instrumentationScope),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}l=a.next()}const c={resource:bv(e),scopeSpans:i,schemaUrl:void 0};r.push(c),s=o.next()}return r}const Tv={serializeRequest:e=>{const t=Ev(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))}};class kv{_parameters;_utils=null;constructor(e){this._parameters=e}async send(e,t){const{agent:n,send:r}=this._loadUtils();return new Promise(o=>{r(this._parameters,n,e,e=>{o(e)},t)})}shutdown(){}_loadUtils(){let e=this._utils;if(null===e){const{sendWithHttp:t,createHttpAgent:n}=require("./http-transport-utils");e=this._utils={agent:n(this._parameters.url,this._parameters.agentOptions),send:t}}return e}}function Ov(){return.4*Math.random()-.2}class xv{_transport;constructor(e){this._transport=e}retry(e,t,n){return new Promise((r,o)=>{setTimeout(()=>{this._transport.send(e,t).then(r,o)},n)})}async send(e,t){const n=Date.now()+t;let r=await this._transport.send(e,t),o=5,s=1e3;for(;"retryable"===r.status&&o>0;){o--;const t=Math.max(Math.min(s,5e3)+Ov(),0);s*=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 Rv(e){return new xv(e.transport)}function Nv(e,t){return n={transport:Rv({transport:(o=e,new kv(o))}),serializer:t,promiseHandler:uv(e)},r={timeout:e.timeoutMillis},new pv(n.transport,n.serializer,hv(),n.promiseHandler,r.timeout);var n,r,o}function Mv(e){const t=process.env[e]?.trim();if(null!=t&&""!==t){const n=Number(t);if(Number.isFinite(n)&&n>0)return n;mh.warn(`Configuration: ${e} is invalid, expected number greater than 0 (actual: ${t})`)}}function Lv(e){const t=Mv(`OTEL_EXPORTER_OTLP_${e}_TIMEOUT`),n=Mv("OTEL_EXPORTER_OTLP_TIMEOUT");return t??n}function Pv(e){const t=process.env[e]?.trim();if(""!==t)return null==t||"none"===t||"gzip"===t?t:void mh.warn(`Configuration: ${e} is invalid, expected 'none' or 'gzip' (actual: '${t}')`)}function Dv(e){const t=Pv(`OTEL_EXPORTER_OTLP_${e}_COMPRESSION`),n=Pv("OTEL_EXPORTER_OTLP_COMPRESSION");return t??n}function Fv(e){return{timeoutMillis:Lv(e),compression:Dv(e)}}function Uv(e,t,n){const r={...n()},o={};return()=>(null!=t&&Object.assign(o,t()),null!=e&&Object.assign(o,e()),Object.assign(o,r))}function Bv(e){if(null!=e)try{return new URL(e),e}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function jv(e){const t=process.env[`OTEL_EXPORTER_OTLP_${e}_HEADERS`]?.trim(),n=process.env.OTEL_EXPORTER_OTLP_HEADERS?.trim(),r=Dh(t),o=Dh(n);if(0!==Object.keys(r).length||0!==Object.keys(o).length)return Object.assign({},Dh(n),Dh(t))}function Zv(e){const t=process.env.OTEL_EXPORTER_OTLP_ENDPOINT?.trim();if(null!=t&&""!==t)return function(e,t){try{new URL(e)}catch{return void mh.warn(`Configuration: Could not parse environment-provided export URL: '${e}', falling back to undefined`)}e.endsWith("/")||(e+="/"),e+=t;try{new URL(e)}catch{return void mh.warn(`Configuration: Provided URL appended with '${t}' is not a valid URL, using 'undefined' instead of '${e}'`)}return e}(t,e)}function zv(e){const t=process.env[`OTEL_EXPORTER_OTLP_${e}_ENDPOINT`]?.trim();if(null!=t&&""!==t)return function(e){try{return new URL(e).toString()}catch{return void mh.warn(`Configuration: Could not parse environment-provided export URL: '${e}', falling back to undefined`)}}(t)}function Vv(e){return null!=e?.keepAlive&&(null!=e.httpAgentOptions?null==e.httpAgentOptions.keepAlive&&(e.httpAgentOptions.keepAlive=e.keepAlive):e.httpAgentOptions={keepAlive:e.keepAlive}),e.httpAgentOptions}function Gv(e,t,n,r){return e.metadata&&mh.warn("Metadata cannot be set when using http"),o={url:e.url,headers:av(e.headers),concurrencyLimit:e.concurrencyLimit,timeoutMillis:e.timeoutMillis,compression:e.compression,agentOptions:Vv(e)},s=function(e,t){return{...Fv(e),url:zv(e)??Zv(t),headers:av(jv(e))}}(t,n),i=function(e,t){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none",headers:()=>e,url:"http://localhost:4318/"+t,agentOptions:{keepAlive:!0}}}(r,n),{...lv(o,s,i),headers:Uv((a=o.headers,()=>{const e={};return Object.entries(a?.()??{}).forEach(([t,n])=>{void 0!==n?e[t]=String(n):mh.warn(`Header "${t}" has invalid value (${n}) and will be ignored`)}),e}),s.headers,i.headers),url:Bv(o.url)??s.url??i.url,agentOptions:o.agentOptions??s.agentOptions??i.agentOptions};var o,s,i,a}class Wv extends ov{constructor(e={}){super(Nv(Gv(e,"TRACES","v1/traces",{"User-Agent":"OTel-OTLP-Exporter-JavaScript/0.203.0","Content-Type":"application/json"}),Tv))}}class $v{constructor(e,t){this.config=e,this.sessionId=t,this.provider=this.createProvider()}createProvider(){const{serviceName:e,resourceAttributes:t,exporterEndpoint:n,projectId:r}=this.config,o=td({[op]:e,"at-project-id":r,...t||{}}),s=new Wv({url:n||"http://otelcol.apitoolkit.io:4318/v1/traces",headers:{}});return new Id({resource:o,spanProcessors:[new fd(s)]})}configure(){this.provider.register({contextManager:new yg,propagator:new Rp});const e=this.config.propagateTraceHeaderCorsUrls||[/^https?:\/\/.*/],t=[/^https?:\/\/(?:[^\/]+\.)?apitoolkit\.io\//,/^https?:\/\/(?:[^\/]+\.)?monoscope\.tech\//];!function(e){const t=e.tracerProvider||xh.getTracerProvider(),n=e.meterProvider||vh.getMeterProvider(),r=e.loggerProvider||zd.getLoggerProvider(),o=e.instrumentations?.flat()??[];(function(e,t,n,r){for(let o=0,s=e.length;o<s;o++){const s=e[o];t&&s.setTracerProvider(t),n&&s.setMeterProvider(n),r&&s.setLoggerProvider&&s.setLoggerProvider(r),s.getConfig().enabled||s.enable()}})(o,t,n,r)}({tracerProvider:this.provider,instrumentations:[...this.config.instrumentations||[],new mg({applyCustomAttributesOnSpan:{documentLoad:e=>{e.setAttribute("session.id",this.sessionId),this.setUserAttributes(e)},documentFetch:e=>{e.setAttribute("session.id",this.sessionId),this.setUserAttributes(e)},resourceFetch:e=>{e.setAttribute("session.id",this.sessionId),this.setUserAttributes(e)}}}),new Dy({propagateTraceHeaderCorsUrls:e,ignoreUrls:t,applyCustomAttributesOnSpan:e=>{e.setAttribute("session.id",this.sessionId),this.setUserAttributes(e)}}),new rv({propagateTraceHeaderCorsUrls:e,ignoreUrls:t,applyCustomAttributesOnSpan:e=>{e.setAttribute("session.id",this.sessionId),this.setUserAttributes(e)}})]})}setUserAttributes(e){if(this.config.user)for(let t in this.config.user)e.setAttribute(`user.${t}`,this.config.user[t])}async shutdown(){await this.provider.shutdown()}setUser(e){this.config={...this.config,user:{...this.config.user,...e}}}}const Hv=[];for(let e=0;e<256;++e)Hv.push((e+256).toString(16).slice(1));let Yv;const Kv=new Uint8Array(16);var qv={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Xv(e,t,n){if(qv.randomUUID&&!e)return qv.randomUUID();const r=(e=e||{}).random??e.rng?.()??function(){if(!Yv){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Yv=crypto.getRandomValues.bind(crypto)}return Yv(Kv)}();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t=0){return(Hv[e[t+0]]+Hv[e[t+1]]+Hv[e[t+2]]+Hv[e[t+3]]+"-"+Hv[e[t+4]]+Hv[e[t+5]]+"-"+Hv[e[t+6]]+Hv[e[t+7]]+"-"+Hv[e[t+8]]+Hv[e[t+9]]+"-"+Hv[e[t+10]]+Hv[e[t+11]]+Hv[e[t+12]]+Hv[e[t+13]]+Hv[e[t+14]]+Hv[e[t+15]]).toLowerCase()}(r)}class Jv{constructor(e){if(!e.projectId)throw new Error("MonoscopeConfig must include projectId");const t=sessionStorage.getItem("monoscope-session-id");t?this.sessionId=t:(this.sessionId=Xv(),sessionStorage.setItem("monoscope-session-id",this.sessionId)),this.config=e,this.replay=new Uc(e,this.sessionId),this.otel=new $v(e,this.sessionId),this.otel.configure(),this.replay.configure(),"undefined"!=typeof window&&(window.monoscope=this)}getSessionId(){return this.sessionId}setUser(e){this.otel.setUser(e)}}return"undefined"!=typeof window&&(window.Monoscope=Jv),Jv}(perf_hooks$2,path$4,require$$1$2,require$$1$3,require$$0,require$$0$1,os$2,require$$2$2,require$$3);
|
|
21
|
-
//# sourceMappingURL=browser.js.map
|