@sailfish-ai/recorder 1.5.5 → 1.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- for(var e,i=[],a=0;a<256;++a)i.push((a+256).toString(16).slice(1));var u=new Uint8Array(16);function rng(){if(!e&&!(e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(u)}var b={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function v4(e,a,u){if(b.randomUUID&&!a&&!e)return b.randomUUID();var w=(e=e||{}).random||(e.rng||rng)();return w[6]=15&w[6]|64,w[8]=63&w[8]|128,function unsafeStringify(e,a=0){return(i[e[a+0]]+i[e[a+1]]+i[e[a+2]]+i[e[a+3]]+"-"+i[e[a+4]]+i[e[a+5]]+"-"+i[e[a+6]]+i[e[a+7]]+"-"+i[e[a+8]]+i[e[a+9]]+"-"+i[e[a+10]]+i[e[a+11]]+i[e[a+12]]+i[e[a+13]]+i[e[a+14]]+i[e[a+15]]).toLowerCase()}(w)}var extendStatics=function(e,i){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var a in i)i.hasOwnProperty(a)&&(e[a]=i[a])})(e,i)};function __extends(e,i){function __(){this.constructor=e}extendStatics(e,i),e.prototype=null===i?Object.create(i):(__.prototype=i.prototype,new __)}function __read(e,i){var a="function"==typeof Symbol&&e[Symbol.iterator];if(!a)return e;var u,b,w=a.call(e),S=[];try{for(;(void 0===i||i-- >0)&&!(u=w.next()).done;)S.push(u.value)}catch(e){b={error:e}}finally{try{u&&!u.done&&(a=w.return)&&a.call(w)}finally{if(b)throw b.error}}return S}var w=function(){return function Event2(e,i){this.target=i,this.type=e}}(),S=function(e){function ErrorEvent2(i,a){var u=e.call(this,"error",a)||this;return u.message=i.message,u.error=i,u}return __extends(ErrorEvent2,e),ErrorEvent2}(w),v=function(e){function CloseEvent2(i,a,u){void 0===i&&(i=1e3),void 0===a&&(a="");var b=e.call(this,"close",u)||this;return b.wasClean=!0,b.code=i,b.reason=a,b}return __extends(CloseEvent2,e),CloseEvent2}(w),k={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+4e3*Math.random(),minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1},C=function(){function ReconnectingWebSocket2(e,i,a){var u=this;void 0===a&&(a={}),this._listeners={error:[],message:[],open:[],close:[]},this._retryCount=-1,this._shouldReconnect=!0,this._connectLock=!1,this._binaryType="blob",this._closeCalled=!1,this._messageQueue=[],this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this._handleOpen=function(e){u._debug("open event");var i=u._options.minUptime,a=void 0===i?k.minUptime:i;clearTimeout(u._connectTimeout),u._uptimeTimeout=setTimeout((function(){return u._acceptOpen()}),a),u._ws.binaryType=u._binaryType,u._messageQueue.forEach((function(e){return u._ws.send(e)})),u._messageQueue=[],u.onopen&&u.onopen(e),u._listeners.open.forEach((function(i){return u._callEventListener(e,i)}))},this._handleMessage=function(e){u._debug("message event"),u.onmessage&&u.onmessage(e),u._listeners.message.forEach((function(i){return u._callEventListener(e,i)}))},this._handleError=function(e){u._debug("error event",e.message),u._disconnect(void 0,"TIMEOUT"===e.message?"timeout":void 0),u.onerror&&u.onerror(e),u._debug("exec error listeners"),u._listeners.error.forEach((function(i){return u._callEventListener(e,i)})),u._connect()},this._handleClose=function(e){u._debug("close event"),u._clearTimeouts(),u._shouldReconnect&&u._connect(),u.onclose&&u.onclose(e),u._listeners.close.forEach((function(i){return u._callEventListener(e,i)}))},this._url=e,this._protocols=i,this._options=a,this._options.startClosed&&(this._shouldReconnect=!1),this._connect()}return Object.defineProperty(ReconnectingWebSocket2,"CONNECTING",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(ReconnectingWebSocket2,"OPEN",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(ReconnectingWebSocket2,"CLOSING",{get:function(){return 2},enumerable:!0,configurable:!0}),Object.defineProperty(ReconnectingWebSocket2,"CLOSED",{get:function(){return 3},enumerable:!0,configurable:!0}),Object.defineProperty(ReconnectingWebSocket2.prototype,"CONNECTING",{get:function(){return ReconnectingWebSocket2.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(ReconnectingWebSocket2.prototype,"OPEN",{get:function(){return ReconnectingWebSocket2.OPEN},enumerable:!0,configurable:!0}),Object.defineProperty(ReconnectingWebSocket2.prototype,"CLOSING",{get:function(){return ReconnectingWebSocket2.CLOSING},enumerable:!0,configurable:!0}),Object.defineProperty(ReconnectingWebSocket2.prototype,"CLOSED",{get:function(){return ReconnectingWebSocket2.CLOSED},enumerable:!0,configurable:!0}),Object.defineProperty(ReconnectingWebSocket2.prototype,"binaryType",{get:function(){return this._ws?this._ws.binaryType:this._binaryType},set:function(e){this._binaryType=e,this._ws&&(this._ws.binaryType=e)},enumerable:!0,configurable:!0}),Object.defineProperty(ReconnectingWebSocket2.prototype,"retryCount",{get:function(){return Math.max(this._retryCount,0)},enumerable:!0,configurable:!0}),Object.defineProperty(ReconnectingWebSocket2.prototype,"bufferedAmount",{get:function(){return this._messageQueue.reduce((function(e,i){return"string"==typeof i?e+=i.length:i instanceof Blob?e+=i.size:e+=i.byteLength,e}),0)+(this._ws?this._ws.bufferedAmount:0)},enumerable:!0,configurable:!0}),Object.defineProperty(ReconnectingWebSocket2.prototype,"extensions",{get:function(){return this._ws?this._ws.extensions:""},enumerable:!0,configurable:!0}),Object.defineProperty(ReconnectingWebSocket2.prototype,"protocol",{get:function(){return this._ws?this._ws.protocol:""},enumerable:!0,configurable:!0}),Object.defineProperty(ReconnectingWebSocket2.prototype,"readyState",{get:function(){return this._ws?this._ws.readyState:this._options.startClosed?ReconnectingWebSocket2.CLOSED:ReconnectingWebSocket2.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(ReconnectingWebSocket2.prototype,"url",{get:function(){return this._ws?this._ws.url:""},enumerable:!0,configurable:!0}),ReconnectingWebSocket2.prototype.close=function(e,i){void 0===e&&(e=1e3),this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),this._ws?this._ws.readyState!==this.CLOSED?this._ws.close(e,i):this._debug("close: already closed"):this._debug("close enqueued: no ws instance")},ReconnectingWebSocket2.prototype.reconnect=function(e,i){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,this._ws&&this._ws.readyState!==this.CLOSED?(this._disconnect(e,i),this._connect()):this._connect()},ReconnectingWebSocket2.prototype.send=function(e){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",e),this._ws.send(e);else{var i=this._options.maxEnqueuedMessages,a=void 0===i?k.maxEnqueuedMessages:i;this._messageQueue.length<a&&(this._debug("enqueue",e),this._messageQueue.push(e))}},ReconnectingWebSocket2.prototype.addEventListener=function(e,i){this._listeners[e]&&this._listeners[e].push(i)},ReconnectingWebSocket2.prototype.dispatchEvent=function(e){var i,a,u=this._listeners[e.type];if(u)try{for(var b=function __values(e){var i="function"==typeof Symbol&&e[Symbol.iterator],a=0;return i?i.call(e):{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}}}(u),w=b.next();!w.done;w=b.next()){var S=w.value;this._callEventListener(e,S)}}catch(e){i={error:e}}finally{try{w&&!w.done&&(a=b.return)&&a.call(b)}finally{if(i)throw i.error}}return!0},ReconnectingWebSocket2.prototype.removeEventListener=function(e,i){this._listeners[e]&&(this._listeners[e]=this._listeners[e].filter((function(e){return e!==i})))},ReconnectingWebSocket2.prototype._debug=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];this._options.debug&&console.log.apply(console,function __spread(){for(var e=[],i=0;i<arguments.length;i++)e=e.concat(__read(arguments[i]));return e}(["RWS>"],e))},ReconnectingWebSocket2.prototype._getNextDelay=function(){var e=this._options,i=e.reconnectionDelayGrowFactor,a=void 0===i?k.reconnectionDelayGrowFactor:i,u=e.minReconnectionDelay,b=void 0===u?k.minReconnectionDelay:u,w=e.maxReconnectionDelay,S=void 0===w?k.maxReconnectionDelay:w,v=0;return this._retryCount>0&&(v=b*Math.pow(a,this._retryCount-1))>S&&(v=S),this._debug("next delay",v),v},ReconnectingWebSocket2.prototype._wait=function(){var e=this;return new Promise((function(i){setTimeout(i,e._getNextDelay())}))},ReconnectingWebSocket2.prototype._getNextUrl=function(e){if("string"==typeof e)return Promise.resolve(e);if("function"==typeof e){var i=e();if("string"==typeof i)return Promise.resolve(i);if(i.then)return i}throw Error("Invalid URL")},ReconnectingWebSocket2.prototype._connect=function(){var e=this;if(!this._connectLock&&this._shouldReconnect){this._connectLock=!0;var i=this._options,a=i.maxRetries,u=void 0===a?k.maxRetries:a,b=i.connectionTimeout,w=void 0===b?k.connectionTimeout:b,S=i.WebSocket,v=void 0===S?function(){if("undefined"!=typeof WebSocket)return WebSocket}():S;if(this._retryCount>=u)this._debug("max retries reached",this._retryCount,">=",u);else{if(this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),void 0===(C=v)||!C||2!==C.CLOSING)throw Error("No valid WebSocket class provided");var C;this._wait().then((function(){return e._getNextUrl(e._url)})).then((function(i){e._closeCalled||(e._debug("connect",{url:i,protocols:e._protocols}),e._ws=e._protocols?new v(i,e._protocols):new v(i),e._ws.binaryType=e._binaryType,e._connectLock=!1,e._addListeners(),e._connectTimeout=setTimeout((function(){return e._handleTimeout()}),w))}))}}},ReconnectingWebSocket2.prototype._handleTimeout=function(){this._debug("timeout event"),this._handleError(new S(Error("TIMEOUT"),this))},ReconnectingWebSocket2.prototype._disconnect=function(e,i){if(void 0===e&&(e=1e3),this._clearTimeouts(),this._ws){this._removeListeners();try{this._ws.close(e,i),this._handleClose(new v(e,i,this))}catch(e){}}},ReconnectingWebSocket2.prototype._acceptOpen=function(){this._debug("accept open"),this._retryCount=0},ReconnectingWebSocket2.prototype._callEventListener=function(e,i){"handleEvent"in i?i.handleEvent(e):i(e)},ReconnectingWebSocket2.prototype._removeListeners=function(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))},ReconnectingWebSocket2.prototype._addListeners=function(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))},ReconnectingWebSocket2.prototype._clearTimeouts=function(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)},ReconnectingWebSocket2}();let I=null;const O=[];function initializeWebSocket(e,i,a){const u=function getWebSocketHost(e){const i=document.createElement("a");return i.href=e,`${i.hostname}${i.port?`:${i.port}`:""}`}(e),b=new URL(e).protocol;return I=new C(`${"https:"===b?"wss":"ws"}://${u}/ws/notify/?apiKey=${i}&sessionId=${a}&sender=JS%2FTS&version=1.5.5`,[],{connectionTimeout:1e4}),I.addEventListener("open",(()=>{!function flushMessageQueue(){if(I&&I.readyState===WebSocket.OPEN)for(;O.length>0;){const e=O.shift();e&&I.send(e)}}()})),I.addEventListener("close",(()=>{I=null})),I}function sendMessage(e){const i=JSON.stringify(e);I&&I.readyState===WebSocket.OPEN?I.send(i):O.push(i)}let x=[];function cacheEvents(e){x.push(e)}function sendRecordingEvents(e){if(e&&e.readyState===WebSocket.OPEN){if(x.length>0){const i={type:"events",events:x};e.send(JSON.stringify(i)),x=[]}}else x.push(...x)}function sendGraphQLRequest(e,i,a,u=5,b=2e3,w=2){const S=`${a.backendApi}/graphql/?apiKey=${a.apiKey}`;return function exponentialBackoff(e,i,a=5,u=2e3,b=2){let w=0;const attemptRequest=async()=>{try{return await e()}catch(e){if(w++,w>a)throw e;const i=u*Math.pow(b,w-1);return await new Promise((e=>setTimeout(e,i))),attemptRequest()}};return attemptRequest()}((()=>fetch(S,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operationName:e,query:i,variables:a})}).then((e=>{if(!e.ok)throw new Error(`GraphQL request failed with status ${e.status}`);return e.json()}))),0,u,b,w)}function fetchCaptureSettings(e,i){return sendGraphQLRequest("GetCaptureSettingsFromApiKey","\n query GetCaptureSettingsFromApiKey($apiKey: String!) {\n captureSettingsFromApiKey(apiKey: $apiKey) {\n recordCanvas\n recordCrossOriginIframes\n collectFonts\n inlineImages\n recordPassword\n recordRealName\n recordCreditCardInfo\n recordSsn\n recordDob\n sampling\n }\n }\n ",{apiKey:e,backendApi:i})}function startRecordingSession(e,i,a){return sendGraphQLRequest("StartSession","mutation StartSession($apiKey: UUID!, $recordingSessionId: UUID!) {\n startRecordingSession(companyApiKey: $apiKey, sessionId: $recordingSessionId) {\n id\n }\n }",{apiKey:e,recordingSessionId:i,backendApi:a})}function sendDomainsToNotPropagateHeaderTo(e,i,a){return sendGraphQLRequest("DomainsToNotPassHeaderTo","mutation DomainsToNotPassHeaderTo($apiKey: String!, $domains: [String!]!) {\n domainsToNotPassHeaderTo(apiKey: $apiKey, domains: $domains)\n }",{apiKey:e,domains:i,backendApi:a})}var _=Object.defineProperty,y$1=(e,i,a)=>((e,i,a)=>i in e?_(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a)(e,"symbol"!=typeof i?i+"":i,a);class d{constructor(e){y$1(this,"fileName"),y$1(this,"functionName"),y$1(this,"lineNumber"),y$1(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){const e=this.lineNumber||"",i=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${e}:${i})`:`${this.fileName}:${e}:${i}`}}const N=/(^|@)\S+:\d+/,D=/^\s*at .*(\S+:\d+|\(native\))/m,A=/^(eval@)?(\[native code])?$/,F={parse:function(e){return e?typeof e.stacktrace<"u"||typeof e["opera#sourceloc"]<"u"?this.parseOpera(e):e.stack&&e.stack.match(D)?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 i=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!i)throw new Error(`Cannot parse given url: ${e}`);return[i[1],i[2]||void 0,i[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(D)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let i=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const a=i.match(/ (\((.+):(\d+):(\d+)\)$)/);i=a?i.replace(a[0],""):i;const u=i.split(/\s+/).slice(1),b=this.extractLocation(a?a[1]:u.pop()),w=u.join(" ")||void 0,S=["eval","<anonymous>"].indexOf(b[0])>-1?void 0:b[0];return new d({functionName:w,fileName:S,lineNumber:b[1],columnNumber:b[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(A)}),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 d({functionName:e});{const i=/((.*".+"[^@]*)?[^@]*)(?:@)/,a=e.match(i),u=a&&a[1]?a[1]:void 0,b=this.extractLocation(e.replace(i,""));return new d({functionName:u,fileName:b[0],lineNumber:b[1],columnNumber:b[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 i=/Line (\d+).*script (?:in )?(\S+)/i,a=e.message.split("\n"),u=[];for(let e=2,b=a.length;e<b;e+=2){const b=i.exec(a[e]);b&&u.push(new d({fileName:b[2],lineNumber:parseFloat(b[1])}))}return u},parseOpera10:function(e){const i=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,a=e.stacktrace.split("\n"),u=[];for(let e=0,b=a.length;e<b;e+=2){const b=i.exec(a[e]);b&&u.push(new d({functionName:b[3]||void 0,fileName:b[2],lineNumber:parseFloat(b[1])}))}return u},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(N)&&!e.match(/^Error created at/)}),this).map((function(e){const i=e.split("@"),a=this.extractLocation(i.pop()),u=(i.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new d({functionName:u,fileName:a[0],lineNumber:a[1],columnNumber:a[2]})}),this)}};function T(e){if(!e||!e.outerHTML)return"";let i="";for(;e.parentElement;){let a=e.localName;if(!a)break;a=a.toLowerCase();const u=e.parentElement,b=[];if(u.children&&u.children.length>0)for(let e=0;e<u.children.length;e++){const i=u.children[e];i.localName&&i.localName.toLowerCase&&i.localName.toLowerCase()===a&&b.push(i)}b.length>1&&(a+=`:eq(${b.indexOf(e)})`),i=a+(i?">"+i:""),e=u}return i}function L$1(e){return"[object Object]"===Object.prototype.toString.call(e)}function k$1(e,i){if(0===i)return!0;const a=Object.keys(e);for(const u of a)if(L$1(e[u])&&k$1(e[u],i-1))return!0;return!1}function g(e,i){const a={numOfKeysLimit:50,depthOfLimit:4};Object.assign(a,i);const u=[],b=[];return JSON.stringify(e,(function(e,i){if(u.length>0){const a=u.indexOf(this);~a?u.splice(a+1):u.push(this),~a?b.splice(a,1/0,e):b.push(e),~u.indexOf(i)&&(i=u[0]===i?"[Circular ~]":"[Circular ~."+b.slice(0,u.indexOf(i)).join(".")+"]")}else u.push(i);if(null===i)return i;if(void 0===i)return"undefined";if(function c(e){return!!(L$1(e)&&Object.keys(e).length>a.numOfKeysLimit||"function"==typeof e||L$1(e)&&k$1(e,a.depthOfLimit))}(i))return function o(e){let i=e.toString();return a.stringLengthLimit&&i.length>a.stringLengthLimit&&(i=`${i.slice(0,a.stringLengthLimit)}...`),i}(i);if("bigint"==typeof i)return i.toString()+"n";if(i instanceof Event){const e={};for(const a in i){const u=i[a];Array.isArray(u)?e[a]=T(u.length?u[0]:null):e[a]=u}return e}return i instanceof Node?i instanceof HTMLElement?i?i.outerHTML:"":i.nodeName:i instanceof Error?i.stack?i.stack+"\nEnd of stack for Error object":i.name+": "+i.message:i}))}const W={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 R$1(e,i,a){const u=a?Object.assign({},W,a):W,b=u.logger;if(!b)return()=>{};let w;w="string"==typeof b?i[b]:b;let S=0,v=!1;const k=[];if(u.level.includes("error")){const l=i=>{const a=i.message,b=i.error,w=F.parse(b).map((e=>e.toString())),S=[g(a,u.stringifyOptions)];e({level:"error",trace:w,payload:S})};i.addEventListener("error",l),k.push((()=>{i.removeEventListener("error",l)}));const f=i=>{let a,b;i.reason instanceof Error?(a=i.reason,b=[g(`Uncaught (in promise) ${a.name}: ${a.message}`,u.stringifyOptions)]):(a=new Error,b=[g("Uncaught (in promise)",u.stringifyOptions),g(i.reason,u.stringifyOptions)]);const w=F.parse(a).map((e=>e.toString()));e({level:"error",trace:w,payload:b})};i.addEventListener("unhandledrejection",f),k.push((()=>{i.removeEventListener("unhandledrejection",f)}))}for(const e of u.level)k.push(p(w,e));return()=>{k.forEach((e=>e()))};function p(i,a){return i[a]?function P(e,i,a){try{if(!(i in e))return()=>{};const u=e[i],b=a(u);return"function"==typeof b&&(b.prototype=b.prototype||{},Object.defineProperties(b,{__rrweb_original__:{enumerable:!1,value:u}})),e[i]=b,()=>{e[i]=u}}catch{return()=>{}}}(i,a,(i=>(...b)=>{if(i.apply(this,b),!("assert"===a&&b[0]||v)){v=!0;try{const i=F.parse(new Error).map((e=>e.toString())).splice(1),w=("assert"===a?b.slice(1):b).map((e=>g(e,u.stringifyOptions)));S++,S<u.lengthThreshold?e({level:a,trace:i,payload:w}):S===u.lengthThreshold&&e({level:"warn",trace:[],payload:[g("The number of log records reached the threshold.")]})}catch(e){i("@sailfish-rrweb/rrweb logger error:",e,...b)}finally{v=!1}}})):()=>{}}}const _$1=e=>({name:"@sailfish-rrweb/rrweb/console@1",observer:R$1,options:e});var j=Object.defineProperty,y=(e,i,a)=>((e,i,a)=>i in e?j(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a)(e,"symbol"!=typeof i?i+"":i,a),V=Object.defineProperty,lr=(e,i,a)=>((e,i,a)=>i in e?V(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a)(e,"symbol"!=typeof i?i+"":i,a),$=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))($||{});function Vr(e){return e.nodeType===e.ELEMENT_NODE}function Ie(e){const i=null==e?void 0:e.host;return(null==i?void 0:i.shadowRoot)===e}function ve(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Qe(e){try{const i=e.rules||e.cssRules;return i?function en(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}(Array.from(i,jr).join("")):null}catch{return null}}function jr(e){let i;if(function sn(e){return"styleSheet"in e}(e))try{i=Qe(e.styleSheet)||function tn(e){const{cssText:i}=e;if(i.split('"').length<3)return i;const a=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?a.push("layer"):e.layerName&&a.push(`layer(${e.layerName})`),e.supportsText&&a.push(`supports(${e.supportsText})`),e.media.length&&a.push(e.media.mediaText),a.join(" ")+";"}(e)}catch{}else if(function nn(e){return"selectorText"in e}(e)&&e.selectorText.includes(":"))return function rn(e){const i=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(i,"$1\\$2")}(e.cssText);return i||e.cssText}class Hr{constructor(){lr(this,"idNodeMap",new Map),lr(this,"nodeMetaMap",new WeakMap)}getId(e){var i;return e?(null==(i=this.getMeta(e))?void 0:i.id)??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const i=this.getId(e);this.idNodeMap.delete(i),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,i){const a=i.id;this.idNodeMap.set(a,e),this.nodeMetaMap.set(e,i)}replace(e,i){const a=this.getNode(e);if(a){const e=this.nodeMetaMap.get(a);e&&this.nodeMetaMap.set(i,e)}this.idNodeMap.set(e,i)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Zt({element:e,maskInputOptions:i,tagName:a,type:u,value:b,maskInputFn:w}){let S=b||"",v="";const k=u&&ae(u);let C=!1;return(i[a.toLowerCase()]||k&&i[k])&&(v=w?w(S,e):"*".repeat(S.length),C=S!==v),{value:v,masked:C}}function ae(e){return e.toLowerCase()}const G="__rrweb_original__";function Yt(e){const i=e.type;return e.hasAttribute("data-rr-is-password")?"password":i?ae(i):null}function Br(e,i){let a;try{a=new URL(e,i??window.location.href)}catch{return null}const u=a.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==u?void 0:u[1])??null}let H=1;const Z=new RegExp("[^a-z0-9-_:]");function Gr(){return H++}let B,Y;const K=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,J=/^(?:[a-z+]+:)?\/\//i,q=/^www\..*/i,Q=/^(data:)([^,]*),(.*)/i;function qe(e,i){return(e||"").replace(K,((e,a,u,b,w,S)=>{const v=u||w||S,k=a||b||"";if(!v)return e;if(J.test(v)||q.test(v))return`url(${k}${v}${k})`;if(Q.test(v))return`url(${k}${v}${k})`;if("/"===v[0])return`url(${k}${function hn(e){let i="";return i=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],i=i.split("?")[0],i}(i)+v}${k})`;const C=i.split("/"),I=v.split("/");C.pop();for(const e of I)"."!==e&&(".."===e?C.pop():C.push(e));return`url(${k}${C.join("/")}${k})`}))}const ee=/^[^ \t\n\r\u000c]+/,te=/^[, \t\n\r\u000c]+/;const re=new WeakMap;function et(e,i){return i&&""!==i.trim()?ct(e,i):i}function bn(e){return!("svg"!==e.tagName&&!e.ownerSVGElement)}function ct(e,i){let a=re.get(e);if(a||(a=e.createElement("a"),re.set(e,a)),i){if(i.startsWith("blob:")||i.startsWith("data:"))return i}else i="";return a.setAttribute("href",i),a.href}function Zr(e,i,a,u){return u&&("src"===a||"href"===a&&("use"!==i||"#"!==u[0])||"xlink:href"===a&&"#"!==u[0]||"background"===a&&("table"===i||"td"===i||"th"===i)?et(e,u):"srcset"===a?function Sn(e,i){if(""===i.trim())return i;let a=0;function s(e){let u;const b=e.exec(i.substring(a));return b?(u=b[0],a+=u.length,u):""}const u=[];for(;s(te),!(a>=i.length);){let b=s(ee);if(","===b.slice(-1))b=et(e,b.substring(0,b.length-1)),u.push(b);else{let w="";b=et(e,b);let S=!1;for(;;){const e=i.charAt(a);if(""===e){u.push((b+w).trim());break}if(S)")"===e&&(S=!1);else{if(","===e){a+=1,u.push((b+w).trim());break}"("===e&&(S=!0)}w+=e,a+=1}}}return u.join(", ")}(e,u):"style"===a?qe(u,ct(e)):"object"===i&&"data"===a?et(e,u):u)}function Yr(e,i,a){return("video"===e||"audio"===e)&&"autoplay"===i}function tt(e,i,a){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!a&&tt(e.parentNode,i,a);for(let a=e.classList.length;a--;){const u=e.classList[a];if(i.test(u))return!0}return!!a&&tt(e.parentNode,i,a)}function Xr(e,i,a,u){let b;if(Vr(e)){if(b=e,!b.childNodes.length)return!1}else{if(null===e.parentElement)return!1;b=e.parentElement}try{if("string"==typeof i){if(u){if(b.closest(`.${i}`))return!0}else if(b.classList.contains(i))return!0}else if(tt(b,i,u))return!0;if(a)if(u){if(b.closest(a))return!0}else if(b.matches(a))return!0}catch{}return!1}function vn(e,i){const{doc:a,mirror:u,blockClass:b,blockSelector:w,needsMask:S,inlineStylesheet:v,maskInputOptions:k={},maskTextFn:C,maskInputFn:I,dataURLOptions:O={},inlineImages:x,recordCanvas:_,keepIframeSrcFn:N,newlyAddedElement:D=!1}=i,A=function Mn(e,i){if(!i.hasNode(e))return;const a=i.getId(e);return 1===a?void 0:a}(a,u);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:$.Document,childNodes:[],compatMode:e.compatMode}:{type:$.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:$.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:A};case e.ELEMENT_NODE:return function xn(e,i){const{doc:a,blockClass:u,blockSelector:b,inlineStylesheet:w,maskInputOptions:S={},maskInputFn:v,dataURLOptions:k={},inlineImages:C,recordCanvas:I,keepIframeSrcFn:O,newlyAddedElement:x=!1,rootId:_}=i,N=function wn(e,i,a){try{if("string"==typeof i){if(e.classList.contains(i))return!0}else for(let a=e.classList.length;a--;){const u=e.classList[a];if(i.test(u))return!0}if(a)return e.matches(a)}catch{}return!1}(e,u,b),D=function un(e){if(e instanceof HTMLFormElement)return"form";const i=ae(e.tagName);return Z.test(i)?"div":i}(e);let A={};const F=e.attributes.length;for(let i=0;i<F;i++){const u=e.attributes[i];Yr(D,u.name,u.value)||(A[u.name]=Zr(a,D,ae(u.name),u.value))}if("link"===D&&w){const i=Array.from(a.styleSheets).find((i=>i.href===e.href));let u=null;i&&(u=Qe(i)),u&&(delete A.rel,delete A.href,A._cssText=qe(u,i.href))}if("style"===D&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const i=Qe(e.sheet);i&&(A._cssText=qe(i,ct(a)))}if("input"===D||"textarea"===D||"select"===D){const i=e.value,a=e.checked;if("radio"!==A.type&&"checkbox"!==A.type&&"submit"!==A.type&&"button"!==A.type&&i){const a=Zt({element:e,type:Yt(e),tagName:D,value:i,maskInputOptions:S,maskInputFn:v});A.value=a.value,a.masked&&(A.masked=!0)}else a&&(A.checked=a)}if("option"===D&&(e.selected&&!S.select?A.selected=!0:delete A.selected),"canvas"===D&&I)if("2d"===e.__context)(function an(e){const i=e.getContext("2d");if(!i)return!0;for(let a=0;a<e.width;a+=50)for(let u=0;u<e.height;u+=50){const b=i.getImageData,w=G in b?b[G]:b;if(new Uint32Array(w.call(i,a,u,Math.min(50,e.width-a),Math.min(50,e.height-u)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(A.rr_dataURL=e.toDataURL(k.type,k.quality));else if(!("__context"in e)){const i=e.toDataURL(k.type,k.quality),u=a.createElement("canvas");u.width=e.width,u.height=e.height;i!==u.toDataURL(k.type,k.quality)&&(A.rr_dataURL=i)}if("img"===D&&C){B||(B=a.createElement("canvas"),Y=B.getContext("2d"));const i=e,u=i.currentSrc||i.getAttribute("src")||"<unknown-src>",b=i.crossOrigin,P2=()=>{i.removeEventListener("load",P2);try{B.width=i.naturalWidth,B.height=i.naturalHeight,Y.drawImage(i,0,0),A.rr_dataURL=B.toDataURL(k.type,k.quality)}catch(e){if("anonymous"!==i.crossOrigin)return i.crossOrigin="anonymous",void(i.complete&&0!==i.naturalWidth?P2():i.addEventListener("load",P2));console.warn(`Cannot inline img src=${u}! Error: ${e}`)}"anonymous"===i.crossOrigin&&(b?A.crossOrigin=b:i.removeAttribute("crossorigin"))};i.complete&&0!==i.naturalWidth?P2():i.addEventListener("load",P2)}if("audio"===D||"video"===D){const i=A;i.rr_mediaState=e.paused?"paused":"played",i.rr_mediaCurrentTime=e.currentTime,i.rr_mediaPlaybackRate=e.playbackRate,i.rr_mediaMuted=e.muted,i.rr_mediaLoop=e.loop,i.rr_mediaVolume=e.volume}if(x||(e.scrollLeft&&(A.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(A.rr_scrollTop=e.scrollTop)),N){const{width:i,height:a}=e.getBoundingClientRect();A={class:A.class,rr_width:`${i}px`,rr_height:`${a}px`}}let W;"iframe"===D&&!O(A.src)&&(e.contentDocument||(A.rr_src=A.src),delete A.src);try{customElements.get(D)&&(W=!0)}catch{}return{type:$.Element,tagName:D,attributes:A,childNodes:[],isSVG:bn(e)||void 0,needBlock:N,rootId:_,isCustom:W}}(e,{doc:a,blockClass:b,blockSelector:w,inlineStylesheet:v,maskInputOptions:k,maskInputFn:I,dataURLOptions:O,inlineImages:x,recordCanvas:_,keepIframeSrcFn:N,newlyAddedElement:D,rootId:A});case e.TEXT_NODE:return function kn(e,i){var a;const{needsMask:u,maskTextFn:b,rootId:w}=i,S=e.parentNode&&e.parentNode.tagName;let v=e.textContent;const k="STYLE"===S||void 0,C="SCRIPT"===S||void 0;if(k&&v){try{e.nextSibling||e.previousSibling||null!=(a=e.parentNode.sheet)&&a.cssRules&&(v=Qe(e.parentNode.sheet))}catch(i){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${i}`,e)}v=qe(v,ct(i.doc))}return C&&(v="SCRIPT_PLACEHOLDER"),!k&&!C&&v&&u&&(v=b?b(v,e.parentElement):v.replace(/[\S]/g,"*")),{type:$.Text,textContent:v||"",isStyle:k,rootId:w}}(e,{doc:a,needsMask:S,maskTextFn:C,rootId:A});case e.CDATA_SECTION_NODE:return{type:$.CDATA,textContent:"",rootId:A};case e.COMMENT_NODE:return{type:$.Comment,textContent:e.textContent||"",rootId:A};default:return!1}}function L(e){return null==e?"":e.toLowerCase()}function pe(e,i){const{doc:a,mirror:u,blockClass:b,blockSelector:w,maskTextClass:S,maskTextSelector:v,skipChild:k=!1,inlineStylesheet:C=!0,maskInputOptions:I={},maskTextFn:O,maskInputFn:x,slimDOMOptions:_,dataURLOptions:N={},inlineImages:D=!1,recordCanvas:A=!1,onSerialize:F,onIframeLoad:W,iframeLoadTimeout:j=5e3,onStylesheetLoad:V,stylesheetLoadTimeout:G=5e3,keepIframeSrcFn:H=()=>!1,newlyAddedElement:Z=!1}=i;let{needsMask:B}=i,{preserveWhiteSpace:Y=!0}=i;B||(B=Xr(e,S,v,void 0===B));const K=vn(e,{doc:a,mirror:u,blockClass:b,blockSelector:w,needsMask:B,inlineStylesheet:C,maskInputOptions:I,maskTextFn:O,maskInputFn:x,dataURLOptions:N,inlineImages:D,recordCanvas:A,keepIframeSrcFn:H,newlyAddedElement:Z});if(!K)return console.warn(e,"not serialized"),null;let J;J=u.hasNode(e)?u.getId(e):function On(e,i){return!!(i.comment&&e.type===$.Comment||e.type===$.Element&&(i.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===Br(e.attributes.href))||i.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(L(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===L(e.attributes.name)||"icon"===L(e.attributes.rel)||"apple-touch-icon"===L(e.attributes.rel)||"shortcut icon"===L(e.attributes.rel)))||"meta"===e.tagName&&(i.headMetaDescKeywords&&L(e.attributes.name).match(/^description|keywords$/)||i.headMetaSocial&&(L(e.attributes.property).match(/^(og|twitter|fb):/)||L(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===L(e.attributes.name))||i.headMetaRobots&&("robots"===L(e.attributes.name)||"googlebot"===L(e.attributes.name)||"bingbot"===L(e.attributes.name))||i.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"]||i.headMetaAuthorship&&("author"===L(e.attributes.name)||"generator"===L(e.attributes.name)||"framework"===L(e.attributes.name)||"publisher"===L(e.attributes.name)||"progid"===L(e.attributes.name)||L(e.attributes.property).match(/^article:/)||L(e.attributes.property).match(/^product:/))||i.headMetaVerification&&("google-site-verification"===L(e.attributes.name)||"yandex-verification"===L(e.attributes.name)||"csrf-token"===L(e.attributes.name)||"p:domain_verify"===L(e.attributes.name)||"verify-v1"===L(e.attributes.name)||"verification"===L(e.attributes.name)||"shopify-checkout-api-token"===L(e.attributes.name)))))}(K,_)||!Y&&K.type===$.Text&&!K.isStyle&&!K.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Gr();const q=Object.assign(K,{id:J});if(u.add(e,q),-2===J)return null;F&&F(e);let Q=!k;if(q.type===$.Element){Q=Q&&!q.needBlock,delete q.needBlock;const i=e.shadowRoot;i&&ve(i)&&(q.isShadowHost=!0)}if((q.type===$.Document||q.type===$.Element)&&Q){_.headWhitespace&&q.type===$.Element&&"head"===q.tagName&&(Y=!1);const i={doc:a,mirror:u,blockClass:b,blockSelector:w,needsMask:B,maskTextClass:S,maskTextSelector:v,skipChild:k,inlineStylesheet:C,maskInputOptions:I,maskTextFn:O,maskInputFn:x,slimDOMOptions:_,dataURLOptions:N,inlineImages:D,recordCanvas:A,preserveWhiteSpace:Y,onSerialize:F,onIframeLoad:W,iframeLoadTimeout:j,onStylesheetLoad:V,stylesheetLoadTimeout:G,keepIframeSrcFn:H};if(q.type!==$.Element||"textarea"!==q.tagName||void 0===q.attributes.value)for(const a of Array.from(e.childNodes)){const e=pe(a,i);e&&q.childNodes.push(e)}if(Vr(e)&&e.shadowRoot)for(const a of Array.from(e.shadowRoot.childNodes)){const u=pe(a,i);u&&(ve(e.shadowRoot)&&(u.isShadow=!0),q.childNodes.push(u))}}return e.parentNode&&Ie(e.parentNode)&&ve(e.parentNode)&&(q.isShadow=!0),q.type===$.Element&&"iframe"===q.tagName&&function Cn(e,i,a){const u=e.contentWindow;if(!u)return;let b,w=!1;try{b=u.document.readyState}catch{return}if("complete"!==b){const u=setTimeout((()=>{w||(i(),w=!0)}),a);return void e.addEventListener("load",(()=>{clearTimeout(u),w=!0,i()}))}const S="about:blank";if(u.location.href!==S||e.src===S||""===e.src)return setTimeout(i,0),e.addEventListener("load",i);e.addEventListener("load",i)}(e,(()=>{const i=e.contentDocument;if(i&&W){const a=pe(i,{doc:i,mirror:u,blockClass:b,blockSelector:w,needsMask:B,maskTextClass:S,maskTextSelector:v,skipChild:!1,inlineStylesheet:C,maskInputOptions:I,maskTextFn:O,maskInputFn:x,slimDOMOptions:_,dataURLOptions:N,inlineImages:D,recordCanvas:A,preserveWhiteSpace:Y,onSerialize:F,onIframeLoad:W,iframeLoadTimeout:j,onStylesheetLoad:V,stylesheetLoadTimeout:G,keepIframeSrcFn:H});a&&W(e,a)}}),j),q.type===$.Element&&"link"===q.tagName&&"string"==typeof q.attributes.rel&&("stylesheet"===q.attributes.rel||"preload"===q.attributes.rel&&"string"==typeof q.attributes.href&&"css"===Br(q.attributes.href))&&function In(e,i,a){let u,b=!1;try{u=e.sheet}catch{return}if(u)return;const w=setTimeout((()=>{b||(i(),b=!0)}),a);e.addEventListener("load",(()=>{clearTimeout(w),b=!0,i()}))}(e,(()=>{if(V){const i=pe(e,{doc:a,mirror:u,blockClass:b,blockSelector:w,needsMask:B,maskTextClass:S,maskTextSelector:v,skipChild:!1,inlineStylesheet:C,maskInputOptions:I,maskTextFn:O,maskInputFn:x,slimDOMOptions:_,dataURLOptions:N,inlineImages:D,recordCanvas:A,preserveWhiteSpace:Y,onSerialize:F,onIframeLoad:W,iframeLoadTimeout:j,onStylesheetLoad:V,stylesheetLoadTimeout:G,keepIframeSrcFn:H});i&&V(e,i)}}),G),q}function En(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Tn(e){if(e.__esModule)return e;var i=e.default;if("function"==typeof i){var a=function s(){return this instanceof s?Reflect.construct(i,arguments,this.constructor):i.apply(this,arguments)};a.prototype=i.prototype}else a={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.keys(e).forEach((function(i){var u=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(a,i,u.get?u:{enumerable:!0,get:function(){return e[i]}})})),a}var ne={exports:{}},oe=String,$r=function(){return{isColorSupported:!1,reset:oe,bold:oe,dim:oe,italic:oe,underline:oe,inverse:oe,hidden:oe,strikethrough:oe,black:oe,red:oe,green:oe,yellow:oe,blue:oe,magenta:oe,cyan:oe,white:oe,gray:oe,bgBlack:oe,bgRed:oe,bgGreen:oe,bgYellow:oe,bgBlue:oe,bgMagenta:oe,bgCyan:oe,bgWhite:oe}};ne.exports=$r(),ne.exports.createColors=$r;var ie=ne.exports;const le=Tn(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let ce=ie,ue=le,he=class Jr extends Error{constructor(e,i,a,u,b,w){super(e),this.name="CssSyntaxError",this.reason=e,b&&(this.file=b),u&&(this.source=u),w&&(this.plugin=w),typeof i<"u"&&typeof a<"u"&&("number"==typeof i?(this.line=i,this.column=a):(this.line=i.line,this.column=i.column,this.endLine=a.line,this.endColumn=a.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Jr)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let i=this.source;null==e&&(e=ce.isColorSupported),ue&&e&&(i=ue(i));let a,u,b=i.split(/\r?\n/),w=Math.max(this.line-3,0),S=Math.min(this.line+2,b.length),v=String(S).length;if(e){let{bold:e,gray:i,red:b}=ce.createColors(!0);a=i=>e(b(i)),u=e=>i(e)}else a=u=e=>e;return b.slice(w,S).map(((e,i)=>{let b=w+1+i,S=" "+(" "+b).slice(-v)+" | ";if(b===this.line){let i=u(S.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+u(S)+e+"\n "+i+a("^")}return" "+u(S)+e})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var de=he;he.default=he;var fe={};fe.isClean=Symbol("isClean"),fe.my=Symbol("my");const me={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let ge=class{constructor(e){this.builder=e}atrule(e,i){let a="@"+e.name,u=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?a+=e.raws.afterName:u&&(a+=" "),e.nodes)this.block(e,a+u);else{let b=(e.raws.between||"")+(i?";":"");this.builder(a+u+b,e)}}beforeAfter(e,i){let a;a="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===i?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let u=e.parent,b=0;for(;u&&"root"!==u.type;)b+=1,u=u.parent;if(a.includes("\n")){let i=this.raw(e,null,"indent");if(i.length)for(let e=0;e<b;e++)a+=i}return a}block(e,i){let a,u=this.raw(e,"between","beforeOpen");this.builder(i+u+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),a=this.raw(e,"after")):a=this.raw(e,"after","emptyBody"),a&&this.builder(a),this.builder("}",e,"end")}body(e){let i=e.nodes.length-1;for(;i>0&&"comment"===e.nodes[i].type;)i-=1;let a=this.raw(e,"semicolon");for(let u=0;u<e.nodes.length;u++){let b=e.nodes[u],w=this.raw(b,"before");w&&this.builder(w),this.stringify(b,i!==u||a)}}comment(e){let i=this.raw(e,"left","commentLeft"),a=this.raw(e,"right","commentRight");this.builder("/*"+i+e.text+a+"*/",e)}decl(e,i){let a=this.raw(e,"between","colon"),u=e.prop+a+this.rawValue(e,"value");e.important&&(u+=e.raws.important||" !important"),i&&(u+=";"),this.builder(u,e)}document(e){this.body(e)}raw(e,i,a){let u;if(a||(a=i),i&&(u=e.raws[i],typeof u<"u"))return u;let b=e.parent;if("before"===a&&(!b||"root"===b.type&&b.first===e||b&&"document"===b.type))return"";if(!b)return me[a];let w=e.root();if(w.rawCache||(w.rawCache={}),typeof w.rawCache[a]<"u")return w.rawCache[a];if("before"===a||"after"===a)return this.beforeAfter(e,a);{let b="raw"+function Pn(e){return e[0].toUpperCase()+e.slice(1)}(a);this[b]?u=this[b](w,e):w.walk((e=>{if(u=e.raws[i],typeof u<"u")return!1}))}return typeof u>"u"&&(u=me[a]),w.rawCache[a]=u,u}rawBeforeClose(e){let i;return e.walk((e=>{if(e.nodes&&e.nodes.length>0&&typeof e.raws.after<"u")return i=e.raws.after,i.includes("\n")&&(i=i.replace(/[^\n]+$/,"")),!1})),i&&(i=i.replace(/\S/g,"")),i}rawBeforeComment(e,i){let a;return e.walkComments((e=>{if(typeof e.raws.before<"u")return a=e.raws.before,a.includes("\n")&&(a=a.replace(/[^\n]+$/,"")),!1})),typeof a>"u"?a=this.raw(i,null,"beforeDecl"):a&&(a=a.replace(/\S/g,"")),a}rawBeforeDecl(e,i){let a;return e.walkDecls((e=>{if(typeof e.raws.before<"u")return a=e.raws.before,a.includes("\n")&&(a=a.replace(/[^\n]+$/,"")),!1})),typeof a>"u"?a=this.raw(i,null,"beforeRule"):a&&(a=a.replace(/\S/g,"")),a}rawBeforeOpen(e){let i;return e.walk((e=>{if("decl"!==e.type&&(i=e.raws.between,typeof i<"u"))return!1})),i}rawBeforeRule(e){let i;return e.walk((a=>{if(a.nodes&&(a.parent!==e||e.first!==a)&&typeof a.raws.before<"u")return i=a.raws.before,i.includes("\n")&&(i=i.replace(/[^\n]+$/,"")),!1})),i&&(i=i.replace(/\S/g,"")),i}rawColon(e){let i;return e.walkDecls((e=>{if(typeof e.raws.between<"u")return i=e.raws.between.replace(/[^\s:]/g,""),!1})),i}rawEmptyBody(e){let i;return e.walk((e=>{if(e.nodes&&0===e.nodes.length&&(i=e.raws.after,typeof i<"u"))return!1})),i}rawIndent(e){if(e.raws.indent)return e.raws.indent;let i;return e.walk((a=>{let u=a.parent;if(u&&u!==e&&u.parent&&u.parent===e&&typeof a.raws.before<"u"){let e=a.raws.before.split("\n");return i=e[e.length-1],i=i.replace(/\S/g,""),!1}})),i}rawSemicolon(e){let i;return e.walk((e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(i=e.raws.semicolon,typeof i<"u"))return!1})),i}rawValue(e,i){let a=e[i],u=e.raws[i];return u&&u.value===a?u.raw:a}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,i){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,i)}};var ye=ge;ge.default=ge;let be=ye;function Tt(e,i){new be(i).stringify(e)}var we=Tt;Tt.default=Tt;let{isClean:ke,my:Me}=fe,Oe=de,xe=ye,Re=we;function Lt(e,i){let a=new e.constructor;for(let u in e){if(!Object.prototype.hasOwnProperty.call(e,u)||"proxyCache"===u)continue;let b=e[u],w=typeof b;"parent"===u&&"object"===w?i&&(a[u]=i):"source"===u?a[u]=b:Array.isArray(b)?a[u]=b.map((e=>Lt(e,a))):("object"===w&&null!==b&&(b=Lt(b)),a[u]=b)}return a}let Le=class{constructor(e={}){this.raws={},this[ke]=!1,this[Me]=!0;for(let i in e)if("nodes"===i){this.nodes=[];for(let a of e[i])"function"==typeof a.clone?this.append(a.clone()):this.append(a)}else this[i]=e[i]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let i=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${i.input.from}:${i.start.line}:${i.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let i in e)this[i]=e[i];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 i=Lt(this);for(let a in e)i[a]=e[a];return i}cloneAfter(e={}){let i=this.clone(e);return this.parent.insertAfter(this,i),i}cloneBefore(e={}){let i=this.clone(e);return this.parent.insertBefore(this,i),i}error(e,i={}){if(this.source){let{end:a,start:u}=this.rangeBy(i);return this.source.input.error(e,{column:u.column,line:u.line},{column:a.column,line:a.line},i)}return new Oe(e)}getProxyProcessor(){return{get:(e,i)=>"proxyOf"===i?e:"root"===i?()=>e.root().toProxy():e[i],set:(e,i,a)=>(e[i]===a||(e[i]=a,("prop"===i||"value"===i||"name"===i||"params"===i||"important"===i||"text"===i)&&e.markDirty()),!0)}}markDirty(){if(this[ke]){this[ke]=!1;let e=this;for(;e=e.parent;)e[ke]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,i){let a=this.source.start;if(e.index)a=this.positionInside(e.index,i);else if(e.word){let u=(i=this.toString()).indexOf(e.word);-1!==u&&(a=this.positionInside(u,i))}return a}positionInside(e,i){let a=i||this.toString(),u=this.source.start.column,b=this.source.start.line;for(let i=0;i<e;i++)"\n"===a[i]?(u=1,b+=1):u+=1;return{column:u,line:b}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let i={column:this.source.start.column,line:this.source.start.line},a=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:i.column+1,line:i.line};if(e.word){let u=this.toString(),b=u.indexOf(e.word);-1!==b&&(i=this.positionInside(b,u),a=this.positionInside(b+e.word.length,u))}else e.start?i={column:e.start.column,line:e.start.line}:e.index&&(i=this.positionInside(e.index)),e.end?a={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?a=this.positionInside(e.endIndex):e.index&&(a=this.positionInside(e.index+1));return(a.line<i.line||a.line===i.line&&a.column<=i.column)&&(a={column:i.column+1,line:i.line}),{end:a,start:i}}raw(e,i){return(new xe).raw(this,e,i)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let i=this,a=!1;for(let u of e)u===this?a=!0:a?(this.parent.insertAfter(i,u),i=u):this.parent.insertBefore(i,u);a||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,i){let a={},u=null==i;i=i||new Map;let b=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e)||"parent"===e||"proxyCache"===e)continue;let u=this[e];if(Array.isArray(u))a[e]=u.map((e=>"object"==typeof e&&e.toJSON?e.toJSON(null,i):e));else if("object"==typeof u&&u.toJSON)a[e]=u.toJSON(null,i);else if("source"===e){let w=i.get(u.input);null==w&&(w=b,i.set(u.input,b),b++),a[e]={end:u.end,inputId:w,start:u.start}}else a[e]=u}return u&&(a.inputs=[...i.keys()].map((e=>e.toJSON()))),a}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Re){e.stringify&&(e=e.stringify);let i="";return e(this,(e=>{i+=e})),i}warn(e,i,a){let u={node:this};for(let e in a)u[e]=a[e];return e.warn(i,u)}get proxyOf(){return this}};var _e=Le;Le.default=Le;let Ne=_e,Ae=class extends Ne{constructor(e){e&&typeof e.value<"u"&&"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 Fe=Ae;Ae.default=Ae;var We={nanoid:(e=21)=>{let i="",a=e;for(;a--;)i+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return i},customAlphabet:(e,i=21)=>(a=i)=>{let u="",b=a;for(;b--;)u+=e[Math.random()*e.length|0];return u}};let{SourceMapConsumer:Ue,SourceMapGenerator:ze}=le,{existsSync:je,readFileSync:Ve}=le,{dirname:$e,join:He}=le;let Be=class{constructor(e,i){if(!1===i.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let a=i.map?i.map.prev:void 0,u=this.loadMap(i.from,a);!this.mapFile&&i.from&&(this.mapFile=i.from),this.mapFile&&(this.root=$e(this.mapFile)),u&&(this.text=u)}consumer(){return this.consumerCache||(this.consumerCache=new Ue(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 function Xn(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}(e.substr(RegExp.lastMatch.length));let i=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+i)}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 i=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!i)return;let a=e.lastIndexOf(i.pop()),u=e.indexOf("*/",a);a>-1&&u>-1&&(this.annotation=this.getAnnotationURL(e.substring(a,u)))}loadFile(e){if(this.root=$e(e),je(e))return this.mapFile=e,Ve(e,"utf-8").toString().trim()}loadMap(e,i){if(!1===i)return!1;if(i){if("string"==typeof i)return i;if("function"!=typeof i){if(i instanceof Ue)return ze.fromSourceMap(i).toString();if(i instanceof ze)return i.toString();if(this.isMap(i))return JSON.stringify(i);throw new Error("Unsupported previous source map format: "+i.toString())}{let a=i(e);if(a){let e=this.loadFile(a);if(!e)throw new Error("Unable to load previous source map: "+a.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let i=this.annotation;return e&&(i=He($e(e),i)),this.loadFile(i)}}}startWith(e,i){return!!e&&e.substr(0,i.length)===i}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Xe=Be;Be.default=Be;let{SourceMapConsumer:Ye,SourceMapGenerator:Ke}=le,{fileURLToPath:rt,pathToFileURL:nt}=le,{isAbsolute:st,resolve:it}=le,{nanoid:lt}=We,ut=le,ht=de,pt=Xe,dt=Symbol("fromOffsetCache"),ft=!(!Ye||!Ke),gt=!(!it||!st),bt=class{constructor(e,i={}){if(null===e||typeof e>"u"||"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,i.from&&(!gt||/^\w+:\/\//.test(i.from)||st(i.from)?this.file=i.from:this.file=it(i.from)),gt&&ft){let e=new pt(this.css,i);if(e.text){this.map=e;let i=e.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+lt(6)+">"),this.map&&(this.map.file=this.from)}error(e,i,a,u={}){let b,w,S;if(i&&"object"==typeof i){let e=i,u=a;if("number"==typeof e.offset){let u=this.fromOffset(e.offset);i=u.line,a=u.col}else i=e.line,a=e.column;if("number"==typeof u.offset){let e=this.fromOffset(u.offset);w=e.line,S=e.col}else w=u.line,S=u.column}else if(!a){let e=this.fromOffset(i);i=e.line,a=e.col}let v=this.origin(i,a,w,S);return b=v?new ht(e,void 0===v.endLine?v.line:{column:v.column,line:v.line},void 0===v.endLine?v.column:{column:v.endColumn,line:v.endLine},v.source,v.file,u.plugin):new ht(e,void 0===w?i:{column:a,line:i},void 0===w?a:{column:S,line:w},this.css,this.file,u.plugin),b.input={column:a,endColumn:S,endLine:w,line:i,source:this.css},this.file&&(nt&&(b.input.url=nt(this.file).toString()),b.input.file=this.file),b}fromOffset(e){let i,a;if(this[dt])a=this[dt];else{let e=this.css.split("\n");a=new Array(e.length);let i=0;for(let u=0,b=e.length;u<b;u++)a[u]=i,i+=e[u].length+1;this[dt]=a}i=a[a.length-1];let u=0;if(e>=i)u=a.length-1;else{let i,b=a.length-2;for(;u<b;)if(i=u+(b-u>>1),e<a[i])b=i-1;else{if(!(e>=a[i+1])){u=i;break}u=i+1}}return{col:e-a[u]+1,line:u+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:it(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,i,a,u){if(!this.map)return!1;let b,w,S=this.map.consumer(),v=S.originalPositionFor({column:i,line:e});if(!v.source)return!1;"number"==typeof a&&(b=S.originalPositionFor({column:u,line:a})),w=st(v.source)?nt(v.source):new URL(v.source,this.map.consumer().sourceRoot||nt(this.map.mapFile));let k={column:v.column,endColumn:b&&b.column,endLine:b&&b.line,line:v.line,url:w.toString()};if("file:"===w.protocol){if(!rt)throw new Error("file: protocol is not available in this PostCSS build");k.file=rt(w)}let C=S.sourceContentFor(v.source);return C&&(k.source=C),k}toJSON(){let e={};for(let i of["hasBOM","css","file","id"])null!=this[i]&&(e[i]=this[i]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var wt=bt;bt.default=bt,ut&&ut.registerInput&&ut.registerInput(bt);let{SourceMapConsumer:St,SourceMapGenerator:vt}=le,{dirname:kt,relative:Ct,resolve:It,sep:Mt}=le,{pathToFileURL:Ot}=le,Rt=wt,Et=!(!St||!vt),_t=!!(kt&&It&&Ct&&Mt);var Nt=class{constructor(e,i,a,u){this.stringify=e,this.mapOpts=a.map||{},this.root=i,this.opts=a,this.css=u,this.originalCSS=u,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 i="\n";this.css.includes("\r\n")&&(i="\r\n"),this.css+=i+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let i,a=this.toUrl(this.path(e.file)),u=e.root||kt(e.file);!1===this.mapOpts.sourcesContent?(i=new St(e.text),i.sourcesContent&&(i.sourcesContent=null)):i=e.consumer(),this.map.applySourceMap(i,a,this.toUrl(this.path(u)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let i=this.root.nodes.length-1;i>=0;i--)e=this.root.nodes[i],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(i)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),_t&&Et&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,(i=>{e+=i})),[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=vt.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new vt({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 vt({file:this.outputFile(),ignoreInvalidMapping:!0});let e,i,a=1,u=1,b="<no source>",w={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,((S,v,k)=>{if(this.css+=S,v&&"end"!==k&&(w.generated.line=a,w.generated.column=u-1,v.source&&v.source.start?(w.source=this.sourcePath(v),w.original.line=v.source.start.line,w.original.column=v.source.start.column-1,this.map.addMapping(w)):(w.source=b,w.original.line=1,w.original.column=0,this.map.addMapping(w))),e=S.match(/\n/g),e?(a+=e.length,i=S.lastIndexOf("\n"),u=S.length-i):u+=S.length,v&&"start"!==k){let e=v.parent||{raws:{}};("decl"!==v.type&&("atrule"!==v.type||v.nodes)||v!==e.last||e.raws.semicolon)&&(v.source&&v.source.end?(w.source=this.sourcePath(v),w.original.line=v.source.end.line,w.original.column=v.source.end.column-1,w.generated.line=a,w.generated.column=u-2,this.map.addMapping(w)):(w.source=b,w.original.line=1,w.original.column=0,w.generated.line=a,w.generated.column=u-1,this.map.addMapping(w)))}}))}isAnnotation(){return!!this.isInline()||(typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:!this.previous().length||this.previous().some((e=>e.annotation)))}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return!(typeof e<"u"&&!0!==e)&&(!this.previous().length||this.previous().some((e=>e.inline)))}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?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||60===e.charCodeAt(0)||/^\w+:\/\//.test(e))return e;let i=this.memoizedPaths.get(e);if(i)return i;let a=this.opts.to?kt(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(a=kt(It(a,this.mapOpts.annotation)));let u=Ct(a,e);return this.memoizedPaths.set(e,u),u}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((e=>{if(e.source&&e.source.input.map){let i=e.source.input.map;this.previousMaps.includes(i)||this.previousMaps.push(i)}}));else{let e=new Rt(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk((i=>{if(i.source){let a=i.source.input.from;if(a&&!e[a]){e[a]=!0;let u=this.usesFileUrls?this.toFileUrl(a):this.toUrl(this.path(a));this.map.setSourceContent(u,i.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 i=this.memoizedFileURLs.get(e);if(i)return i;if(Ot){let i=Ot(e).toString();return this.memoizedFileURLs.set(e,i),i}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let i=this.memoizedURLs.get(e);if(i)return i;"\\"===Mt&&(e=e.replace(/\\/g,"/"));let a=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,a),a}};let Dt=_e,Pt=class extends Dt{constructor(e){super(e),this.type="comment"}};var At=Pt;Pt.default=Pt;let Ft,Wt,Ut,jt,{isClean:Vt,my:$t}=fe,Xt=Fe,Kt=At,Jt=_e;function us(e){return e.map((e=>(e.nodes&&(e.nodes=us(e.nodes)),delete e.source,e)))}function hs(e){if(e[Vt]=!1,e.proxyOf.nodes)for(let i of e.proxyOf.nodes)hs(i)}let qt=class ps extends Jt{append(...e){for(let i of e){let e=this.normalize(i,this.last);for(let i of e)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let i of this.nodes)i.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let i,a,u=this.getIterator();for(;this.indexes[u]<this.proxyOf.nodes.length&&(i=this.indexes[u],a=e(this.proxyOf.nodes[i],i),!1!==a);)this.indexes[u]+=1;return delete this.indexes[u],a}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,i)=>"proxyOf"===i?e:e[i]?"each"===i||"string"==typeof i&&i.startsWith("walk")?(...a)=>e[i](...a.map((e=>"function"==typeof e?(i,a)=>e(i.toProxy(),a):e))):"every"===i||"some"===i?a=>e[i](((e,...i)=>a(e.toProxy(),...i))):"root"===i?()=>e.root().toProxy():"nodes"===i?e.nodes.map((e=>e.toProxy())):"first"===i||"last"===i?e[i].toProxy():e[i]:e[i],set:(e,i,a)=>(e[i]===a||(e[i]=a,("name"===i||"params"===i||"selector"===i)&&e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,i){let a,u=this.index(e),b=this.normalize(i,this.proxyOf.nodes[u]).reverse();u=this.index(e);for(let e of b)this.proxyOf.nodes.splice(u+1,0,e);for(let e in this.indexes)a=this.indexes[e],u<a&&(this.indexes[e]=a+b.length);return this.markDirty(),this}insertBefore(e,i){let a,u=this.index(e),b=0===u&&"prepend",w=this.normalize(i,this.proxyOf.nodes[u],b).reverse();u=this.index(e);for(let e of w)this.proxyOf.nodes.splice(u,0,e);for(let e in this.indexes)a=this.indexes[e],u<=a&&(this.indexes[e]=a+w.length);return this.markDirty(),this}normalize(e,i){if("string"==typeof e)e=us(Ft(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if("root"===e.type&&"document"!==this.type){e=e.nodes.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new Xt(e)]}else if(e.selector)e=[new Wt(e)];else if(e.name)e=[new Ut(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new Kt(e)]}return e.map((e=>(e[$t]||ps.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[Vt]&&hs(e),typeof e.raws.before>"u"&&i&&typeof i.raws.before<"u"&&(e.raws.before=i.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e)))}prepend(...e){e=e.reverse();for(let i of e){let e=this.normalize(i,this.first,"prepend").reverse();for(let i of e)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+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 i;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let a in this.indexes)i=this.indexes[a],i>=e&&(this.indexes[a]=i-1);return this.markDirty(),this}replaceValues(e,i,a){return a||(a=i,i={}),this.walkDecls((u=>{i.props&&!i.props.includes(u.prop)||i.fast&&!u.value.includes(i.fast)||(u.value=u.value.replace(e,a))})),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each(((i,a)=>{let u;try{u=e(i,a)}catch(e){throw i.addToError(e)}return!1!==u&&i.walk&&(u=i.walk(e)),u}))}walkAtRules(e,i){return i?e instanceof RegExp?this.walk(((a,u)=>{if("atrule"===a.type&&e.test(a.name))return i(a,u)})):this.walk(((a,u)=>{if("atrule"===a.type&&a.name===e)return i(a,u)})):(i=e,this.walk(((e,a)=>{if("atrule"===e.type)return i(e,a)})))}walkComments(e){return this.walk(((i,a)=>{if("comment"===i.type)return e(i,a)}))}walkDecls(e,i){return i?e instanceof RegExp?this.walk(((a,u)=>{if("decl"===a.type&&e.test(a.prop))return i(a,u)})):this.walk(((a,u)=>{if("decl"===a.type&&a.prop===e)return i(a,u)})):(i=e,this.walk(((e,a)=>{if("decl"===e.type)return i(e,a)})))}walkRules(e,i){return i?e instanceof RegExp?this.walk(((a,u)=>{if("rule"===a.type&&e.test(a.selector))return i(a,u)})):this.walk(((a,u)=>{if("rule"===a.type&&a.selector===e)return i(a,u)})):(i=e,this.walk(((e,a)=>{if("rule"===e.type)return i(e,a)})))}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]}};qt.registerParse=e=>{Ft=e},qt.registerRule=e=>{Wt=e},qt.registerAtRule=e=>{Ut=e},qt.registerRoot=e=>{jt=e};var Qt=qt;qt.default=qt,qt.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Ut.prototype):"rule"===e.type?Object.setPrototypeOf(e,Wt.prototype):"decl"===e.type?Object.setPrototypeOf(e,Xt.prototype):"comment"===e.type?Object.setPrototypeOf(e,Kt.prototype):"root"===e.type&&Object.setPrototypeOf(e,jt.prototype),e[$t]=!0,e.nodes&&e.nodes.forEach((e=>{qt.rebuild(e)}))};let er,tr,rr=Qt,nr=class extends rr{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new er(new tr,this,e).stringify()}};nr.registerLazyResult=e=>{er=e},nr.registerProcessor=e=>{tr=e};var sr=nr;nr.default=nr;let cr={};var ms=function(e){cr[e]||(cr[e]=!0,typeof console<"u"&&console.warn&&console.warn(e))};let ur=class{constructor(e,i={}){if(this.type="warning",this.text=e,i.node&&i.node.source){let e=i.node.rangeBy(i);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in i)this[e]=i[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 hr=ur;ur.default=ur;let pr=hr,dr=class{constructor(e,i,a){this.processor=e,this.messages=[],this.root=i,this.opts=a,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,i={}){i.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(i.plugin=this.lastPlugin.postcssPlugin);let a=new pr(e,i);return this.messages.push(a),a}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}};var fr=dr;dr.default=dr;const mr=/[\t\n\f\r "#'()/;[\\\]{}]/g,gr=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,yr=/.[\r\n"'(/\\]/,br=/[\da-f]/i;let wr=Qt,Sr=class extends wr{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 vr=Sr;Sr.default=Sr,wr.registerAtRule(Sr);let kr,Cr,Ir=Qt,Mr=class extends Ir{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,i,a){let u=super.normalize(e);if(i)if("prepend"===a)this.nodes.length>1?i.raws.before=this.nodes[1].raws.before:delete i.raws.before;else if(this.first!==i)for(let e of u)e.raws.before=i.raws.before;return u}removeChild(e,i){let a=this.index(e);return!i&&0===a&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[a].raws.before),super.removeChild(e)}toResult(e={}){return new kr(new Cr,this,e).stringify()}};Mr.registerLazyResult=e=>{kr=e},Mr.registerProcessor=e=>{Cr=e};var Or=Mr;Mr.default=Mr,Ir.registerRoot(Mr);let xr={comma:e=>xr.split(e,[","],!0),space(e){let i=[" ","\n","\t"];return xr.split(e,i)},split(e,i,a){let u=[],b="",w=!1,S=0,v=!1,k="",C=!1;for(let a of e)C?C=!1:"\\"===a?C=!0:v?a===k&&(v=!1):'"'===a||"'"===a?(v=!0,k=a):"("===a?S+=1:")"===a?S>0&&(S-=1):0===S&&i.includes(a)&&(w=!0),w?(""!==b&&u.push(b.trim()),b="",w=!1):b+=a;return(a||""!==b)&&u.push(b.trim()),u}};var Er=xr;xr.default=xr;let Ar=Qt,Fr=Er,Wr=class extends Ar{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Fr.comma(this.selector)}set selectors(e){let i=this.selector?this.selector.match(/,\s*/):null,a=i?i[0]:","+this.raw("between","beforeOpen");this.selector=e.join(a)}};var zr=Wr;Wr.default=Wr,Ar.registerRule(Wr);let Kr=Fe,vo=function(e,i={}){let a,u,b,w,S,v,k,C,I,O,x=e.css.valueOf(),_=i.ignoreErrors,N=x.length,D=0,A=[],F=[];function m(i){throw e.error("Unclosed "+i,D)}return{back:function P2(e){F.push(e)},endOfFile:function C2(){return 0===F.length&&D>=N},nextToken:function E(e){if(F.length)return F.pop();if(D>=N)return;let i=!!e&&e.ignoreUnclosed;switch(a=x.charCodeAt(D),a){case 10:case 32:case 9:case 13:case 12:u=D;do{u+=1,a=x.charCodeAt(u)}while(32===a||10===a||9===a||13===a||12===a);O=["space",x.slice(D,u)],D=u-1;break;case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let e=String.fromCharCode(a);O=[e,e,D];break}case 40:if(C=A.length?A.pop()[1]:"",I=x.charCodeAt(D+1),"url"===C&&39!==I&&34!==I&&32!==I&&10!==I&&9!==I&&12!==I&&13!==I){u=D;do{if(v=!1,u=x.indexOf(")",u+1),-1===u){if(_||i){u=D;break}m("bracket")}for(k=u;92===x.charCodeAt(k-1);)k-=1,v=!v}while(v);O=["brackets",x.slice(D,u+1),D,u],D=u}else u=x.indexOf(")",D+1),w=x.slice(D,u+1),-1===u||yr.test(w)?O=["(","(",D]:(O=["brackets",w,D,u],D=u);break;case 39:case 34:b=39===a?"'":'"',u=D;do{if(v=!1,u=x.indexOf(b,u+1),-1===u){if(_||i){u=D+1;break}m("string")}for(k=u;92===x.charCodeAt(k-1);)k-=1,v=!v}while(v);O=["string",x.slice(D,u+1),D,u],D=u;break;case 64:mr.lastIndex=D+1,mr.test(x),u=0===mr.lastIndex?x.length-1:mr.lastIndex-2,O=["at-word",x.slice(D,u+1),D,u],D=u;break;case 92:for(u=D,S=!0;92===x.charCodeAt(u+1);)u+=1,S=!S;if(a=x.charCodeAt(u+1),S&&47!==a&&32!==a&&10!==a&&9!==a&&13!==a&&12!==a&&(u+=1,br.test(x.charAt(u)))){for(;br.test(x.charAt(u+1));)u+=1;32===x.charCodeAt(u+1)&&(u+=1)}O=["word",x.slice(D,u+1),D,u],D=u;break;default:47===a&&42===x.charCodeAt(D+1)?(u=x.indexOf("*/",D+2)+1,0===u&&(_||i?u=x.length:m("comment")),O=["comment",x.slice(D,u+1),D,u],D=u):(gr.lastIndex=D+1,gr.test(x),u=0===gr.lastIndex?x.length-1:gr.lastIndex-2,O=["word",x.slice(D,u+1),D,u],A.push(O),D=u)}return D++,O},position:function b2(){return D}}},qr=At,Qr=vr,ln=Or,cn=zr;const pn={empty:!0,space:!0};var dn=class{constructor(e){this.input=e,this.root=new ln,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 i=new Qr;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let a,u,b,w=!1,S=!1,v=[],k=[];for(;!this.tokenizer.endOfFile();){if(a=(e=this.tokenizer.nextToken())[0],"("===a||"["===a?k.push("("===a?")":"]"):"{"===a&&k.length>0?k.push("}"):a===k[k.length-1]&&k.pop(),0===k.length){if(";"===a){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===a){S=!0;break}if("}"===a){if(v.length>0){for(b=v.length-1,u=v[b];u&&"space"===u[0];)u=v[--b];u&&(i.source.end=this.getPosition(u[3]||u[2]),i.source.end.offset++)}this.end(e);break}v.push(e)}else v.push(e);if(this.tokenizer.endOfFile()){w=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(v),v.length?(i.raws.afterName=this.spacesAndCommentsFromStart(v),this.raw(i,"params",v),w&&(e=v[v.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),S&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let i=this.colon(e);if(!1===i)return;let a,u=0;for(let b=i-1;b>=0&&(a=e[b],"space"===a[0]||(u+=1,2!==u));b--);throw this.input.error("Missed semicolon","word"===a[0]?a[3]+1:a[2])}colon(e){let i,a,u,b=0;for(let[w,S]of e.entries()){if(i=S,a=i[0],"("===a&&(b+=1),")"===a&&(b-=1),0===b&&":"===a){if(u){if("word"===u[0]&&"progid"===u[1])continue;return w}this.doubleColon(i)}u=i}return!1}comment(e){let i=new qr;this.init(i,e[2]),i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++;let a=e[1].slice(2,-2);if(/^\s*$/.test(a))i.text="",i.raws.left=a,i.raws.right="";else{let e=a.match(/^(\s*)([^]*\S)(\s*)$/);i.text=e[2],i.raws.left=e[1],i.raws.right=e[3]}}createTokenizer(){this.tokenizer=vo(this.input)}decl(e,i){let a=new Kr;this.init(a,e[0][2]);let u,b=e[e.length-1];for(";"===b[0]&&(this.semicolon=!0,e.pop()),a.source.end=this.getPosition(b[3]||b[2]||function Oo(e){for(let i=e.length-1;i>=0;i--){let a=e[i],u=a[3]||a[2];if(u)return u}}(e)),a.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),a.raws.before+=e.shift()[1];for(a.source.start=this.getPosition(e[0][2]),a.prop="";e.length;){let i=e[0][0];if(":"===i||"space"===i||"comment"===i)break;a.prop+=e.shift()[1]}for(a.raws.between="";e.length;){if(u=e.shift(),":"===u[0]){a.raws.between+=u[1];break}"word"===u[0]&&/\w/.test(u[1])&&this.unknownWord([u]),a.raws.between+=u[1]}("_"===a.prop[0]||"*"===a.prop[0])&&(a.raws.before+=a.prop[0],a.prop=a.prop.slice(1));let w,S=[];for(;e.length&&(w=e[0][0],"space"===w||"comment"===w);)S.push(e.shift());this.precheckMissedSemicolon(e);for(let i=e.length-1;i>=0;i--){if(u=e[i],"!important"===u[1].toLowerCase()){a.important=!0;let u=this.stringFrom(e,i);u=this.spacesFromEnd(e)+u," !important"!==u&&(a.raws.important=u);break}if("important"===u[1].toLowerCase()){let u=e.slice(0),b="";for(let e=i;e>0;e--){let i=u[e][0];if(0===b.trim().indexOf("!")&&"space"!==i)break;b=u.pop()[1]+b}0===b.trim().indexOf("!")&&(a.important=!0,a.raws.important=b,e=u)}if("space"!==u[0]&&"comment"!==u[0])break}e.some((e=>"space"!==e[0]&&"comment"!==e[0]))&&(a.raws.between+=S.map((e=>e[1])).join(""),S=[]),this.raw(a,"value",S.concat(e),i),a.value.includes(":")&&!i&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let i=new cn;this.init(i,e[2]),i.selector="",i.raws.between="",this.current=i}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 i=this.input.fromOffset(e);return{column:i.col,line:i.line,offset:e}}init(e,i){this.current.push(e),e.source={input:this.input,start:this.getPosition(i)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let i=!1,a=null,u=!1,b=null,w=[],S=e[1].startsWith("--"),v=[],k=e;for(;k;){if(a=k[0],v.push(k),"("===a||"["===a)b||(b=k),w.push("("===a?")":"]");else if(S&&u&&"{"===a)b||(b=k),w.push("}");else if(0===w.length){if(";"===a){if(u)return void this.decl(v,S);break}if("{"===a)return void this.rule(v);if("}"===a){this.tokenizer.back(v.pop()),i=!0;break}":"===a&&(u=!0)}else a===w[w.length-1]&&(w.pop(),0===w.length&&(b=null));k=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(i=!0),w.length>0&&this.unclosedBracket(b),i&&u){if(!S)for(;v.length&&(k=v[v.length-1][0],"space"===k||"comment"===k);)this.tokenizer.back(v.pop());this.decl(v,S)}else this.unknownWord(v)}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,i,a,u){let b,w,S,v,k=a.length,C="",I=!0;for(let e=0;e<k;e+=1)b=a[e],w=b[0],"space"!==w||e!==k-1||u?"comment"===w?(v=a[e-1]?a[e-1][0]:"empty",S=a[e+1]?a[e+1][0]:"empty",pn[v]||pn[S]||","===C.slice(-1)?I=!1:C+=b[1]):C+=b[1]:I=!1;if(!I){let u=a.reduce(((e,i)=>e+i[1]),"");e.raws[i]={raw:u,value:C}}e[i]=C}rule(e){e.pop();let i=new cn;this.init(i,e[0][2]),i.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(i,"selector",e),this.current=i}spacesAndCommentsFromEnd(e){let i,a="";for(;e.length&&(i=e[e.length-1][0],"space"===i||"comment"===i);)a=e.pop()[1]+a;return a}spacesAndCommentsFromStart(e){let i,a="";for(;e.length&&(i=e[0][0],"space"===i||"comment"===i);)a+=e.shift()[1];return a}spacesFromEnd(e){let i,a="";for(;e.length&&(i=e[e.length-1][0],"space"===i);)a=e.pop()[1]+a;return a}stringFrom(e,i){let a="";for(let u=i;u<e.length;u++)a+=e[u][1];return e.splice(i,e.length-i),a}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,i){throw this.input.error("At-rule without name",{offset:i[2]},{offset:i[2]+i[1].length})}};let fn=Qt,mn=dn,gn=wt;function ot(e,i){let a=new gn(e,i),u=new mn(a);try{u.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&i&&i.from&&(/\.scss$/i.test(i.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(i.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(i.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return u.root}var yn=ot;ot.default=ot,fn.registerParse(ot);let{isClean:Ln,my:_n}=fe,Nn=Nt,Dn=we,An=Qt,Fn=sr,Wn=ms,Un=fr,zn=yn,jn=Or;const Vn={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},$n={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},Gn={Once:!0,postcssPlugin:!0,prepare:!0};function Ce(e){return"object"==typeof e&&"function"==typeof e.then}function vs(e){let i=!1,a=Vn[e.type];return"decl"===e.type?i=e.prop.toLowerCase():"atrule"===e.type&&(i=e.name.toLowerCase()),i&&e.append?[a,a+"-"+i,0,a+"Exit",a+"Exit-"+i]:i?[a,a+"-"+i,a+"Exit",a+"Exit-"+i]:e.append?[a,0,a+"Exit"]:[a,a+"Exit"]}function Rr(e){let i;return i="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:vs(e),{eventIndex:0,events:i,iterator:0,node:e,visitorIndex:0,visitors:[]}}function zt(e){return e[Ln]=!1,e.nodes&&e.nodes.forEach((e=>zt(e))),e}let Hn={},Zn=class Ms{constructor(e,i,a){let u;if(this.stringified=!1,this.processed=!1,"object"!=typeof i||null===i||"root"!==i.type&&"document"!==i.type)if(i instanceof Ms||i instanceof Un)u=zt(i.root),i.map&&(typeof a.map>"u"&&(a.map={}),a.map.inline||(a.map.inline=!1),a.map.prev=i.map);else{let e=zn;a.syntax&&(e=a.syntax.parse),a.parser&&(e=a.parser),e.parse&&(e=e.parse);try{u=e(i,a)}catch(e){this.processed=!0,this.error=e}u&&!u[_n]&&An.rebuild(u)}else u=zt(i);this.result=new Un(e,u,a),this.helpers={...Hn,postcss:Hn,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,i){let a=this.result.lastPlugin;try{if(i&&i.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(a.postcssVersion&&"production"!==process.env.NODE_ENV){let e=a.postcssPlugin,i=a.postcssVersion,u=this.result.processor.version,b=i.split("."),w=u.split(".");(b[0]!==w[0]||parseInt(b[1])>parseInt(w[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+u+", but "+e+" uses "+i+". Perhaps this is the source of the error below.")}}else e.plugin=a.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let t=(e,i,a)=>{this.listeners[i]||(this.listeners[i]=[]),this.listeners[i].push([e,a])};for(let e of this.plugins)if("object"==typeof e)for(let i in e){if(!$n[i]&&/^[A-Z]/.test(i))throw new Error(`Unknown event ${i} in ${e.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Gn[i])if("object"==typeof e[i])for(let a in e[i])t(e,"*"===a?i:i+"-"+a.toLowerCase(),e[i][a]);else"function"==typeof e[i]&&t(e,i,e[i])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let i=this.plugins[e],a=this.runOnRoot(i);if(Ce(a))try{await a}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ln];){e[Ln]=!0;let i=[Rr(e)];for(;i.length>0;){let e=this.visitTick(i);if(Ce(e))try{await e}catch(e){let a=i[i.length-1].node;throw this.handleError(e,a)}}}if(this.listeners.OnceExit)for(let[i,a]of this.listeners.OnceExit){this.result.lastPlugin=i;try{if("document"===e.type){let i=e.nodes.map((e=>a(e,this.helpers)));await Promise.all(i)}else await a(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 i=this.result.root.nodes.map((i=>e.Once(i,this.helpers)));return Ce(i[0])?Promise.all(i):i}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,i=Dn;e.syntax&&(i=e.syntax.stringify),e.stringifier&&(i=e.stringifier),i.stringify&&(i=i.stringify);let a=new Nn(i,this.result.root,this.result.opts).generate();return this.result.css=a[0],this.result.map=a[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(Ce(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ln];)e[Ln]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let i of e.nodes)this.visitSync(this.listeners.OnceExit,i);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,i){return"production"!==process.env.NODE_ENV&&("from"in this.opts||Wn("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,i)}toString(){return this.css}visitSync(e,i){for(let[a,u]of e){let e;this.result.lastPlugin=a;try{e=u(i,this.helpers)}catch(e){throw this.handleError(e,i.proxyOf)}if("root"!==i.type&&"document"!==i.type&&!i.parent)return!0;if(Ce(e))throw this.getAsyncError()}}visitTick(e){let i=e[e.length-1],{node:a,visitors:u}=i;if("root"!==a.type&&"document"!==a.type&&!a.parent)return void e.pop();if(u.length>0&&i.visitorIndex<u.length){let[e,b]=u[i.visitorIndex];i.visitorIndex+=1,i.visitorIndex===u.length&&(i.visitors=[],i.visitorIndex=0),this.result.lastPlugin=e;try{return b(a.toProxy(),this.helpers)}catch(e){throw this.handleError(e,a)}}if(0!==i.iterator){let u,b=i.iterator;for(;u=a.nodes[a.indexes[b]];)if(a.indexes[b]+=1,!u[Ln])return u[Ln]=!0,void e.push(Rr(u));i.iterator=0,delete a.indexes[b]}let b=i.events;for(;i.eventIndex<b.length;){let e=b[i.eventIndex];if(i.eventIndex+=1,0===e)return void(a.nodes&&a.nodes.length&&(a[Ln]=!0,i.iterator=a.getIterator()));if(this.listeners[e])return void(i.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Ln]=!0;let i=vs(e);for(let a of i)if(0===a)e.nodes&&e.each((e=>{e[Ln]||this.walkSync(e)}));else{let i=this.listeners[a];if(i&&this.visitSync(i,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"}};Zn.registerPostcss=e=>{Hn=e};var Bn=Zn;Zn.default=Zn,jn.registerLazyResult(Zn),Fn.registerLazyResult(Zn);let Yn=Nt,Kn=we,Jn=ms,qn=yn;const Qn=fr;let es=class{constructor(e,i,a){i=i.toString(),this.stringified=!1,this._processor=e,this._css=i,this._opts=a,this._map=void 0;let u,b=Kn;this.result=new Qn(this._processor,u,this._opts),this.result.css=i;let w=this;Object.defineProperty(this.result,"root",{get:()=>w.root});let S=new Yn(b,u,this._opts,i);if(S.isMap()){let[e,i]=S.generate();e&&(this.result.css=e),i&&(this.result.map=i)}else S.clearAnnotation(),this.result.css=S.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,i){return"production"!==process.env.NODE_ENV&&("from"in this._opts||Jn("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,i)}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,i=qn;try{e=i(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 ts=es;es.default=es;let rs=ts,ns=Bn,ss=sr,os=Or,is=class{constructor(e=[]){this.version="8.4.39",this.plugins=this.normalize(e)}normalize(e){let i=[];for(let a of e)if(!0===a.postcss?a=a():a.postcss&&(a=a.postcss),"object"==typeof a&&Array.isArray(a.plugins))i=i.concat(a.plugins);else if("object"==typeof a&&a.postcssPlugin)i.push(a);else if("function"==typeof a)i.push(a);else{if("object"!=typeof a||!a.parse&&!a.stringify)throw new Error(a+" 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 i}process(e,i={}){return this.plugins.length||i.parser||i.stringifier||i.syntax?new ns(this,e,i):new rs(this,e,i)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var as=is;is.default=is,os.registerProcessor(is),ss.registerProcessor(is);let ls=Fe,cs=Xe,ds=At,fs=vr,gs=wt,ys=Or,bs=zr;function Ee(e,i){if(Array.isArray(e))return e.map((e=>Ee(e)));let{inputs:a,...u}=e;if(a){i=[];for(let e of a){let a={...e,__proto__:gs.prototype};a.map&&(a.map={...a.map,__proto__:cs.prototype}),i.push(a)}}if(u.nodes&&(u.nodes=e.nodes.map((e=>Ee(e,i)))),u.source){let{inputId:e,...a}=u.source;u.source=a,null!=e&&(u.source.input=i[e])}if("root"===u.type)return new ys(u);if("decl"===u.type)return new ls(u);if("rule"===u.type)return new bs(u);if("comment"===u.type)return new ds(u);if("atrule"===u.type)return new fs(u);throw new Error("Unknown node type: "+e.type)}var ws=Ee;Ee.default=Ee;let Ss=de,ks=Fe,Cs=Bn,Is=Qt,Os=as,xs=we,Rs=ws,Es=sr,Ls=hr,Ts=At,$s=vr,Gs=fr,Ks=wt,Js=yn,qs=Er,Qs=zr,eo=Or,to=_e;function R(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Os(e)}R.plugin=function(e,i){let a,u=!1;function s(...a){console&&console.warn&&!u&&(u=!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 b=i(...a);return b.postcssPlugin=e,b.postcssVersion=(new Os).version,b}return Object.defineProperty(s,"postcss",{get:()=>(a||(a=s()),a)}),s.process=function(e,i,a){return R([s(a)]).process(e,i)},s},R.stringify=xs,R.parse=Js,R.fromJSON=Rs,R.list=qs,R.comment=e=>new Ts(e),R.atRule=e=>new $s(e),R.decl=e=>new ks(e),R.rule=e=>new Qs(e),R.root=e=>new eo(e),R.document=e=>new Es(e),R.CssSyntaxError=Ss,R.Declaration=ks,R.Container=Is,R.Processor=Os,R.Document=Es,R.Comment=Ts,R.Warning=Ls,R.AtRule=$s,R.Result=Gs,R.Input=Ks,R.Rule=Qs,R.Root=eo,R.Node=to,Cs.registerPostcss(R);var ro=R;R.default=R;const no=En(ro);no.stringify,no.fromJSON,no.plugin,no.parse,no.list,no.document,no.comment,no.atRule,no.rule,no.decl,no.root,no.CssSyntaxError,no.Declaration,no.Container,no.Processor,no.Document,no.Comment,no.Warning,no.AtRule,no.Result,no.Input,no.Rule,no.Root,no.Node;var so=(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))(so||{}),oo=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(oo||{}),io=(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))(io||{}),ao=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(ao||{}),lo=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(lo||{}),co=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(co||{});function U(e,i,a=document){const u={capture:!0,passive:!0};return a.addEventListener(e,i,u),()=>a.removeEventListener(e,i,u)}const uo="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 ho={map:{},getId:()=>(console.error(uo),-1),getNode:()=>(console.error(uo),null),removeNodeFromMap(){console.error(uo)},has:()=>(console.error(uo),!1),reset(){console.error(uo)}};function Te(e,i,a={}){let u=null,b=0;return function(...w){const S=Date.now();!b&&!1===a.leading&&(b=S);const v=i-(S-b),k=this;v<=0||v>i?(u&&(clearTimeout(u),u=null),b=S,e.apply(k,w)):!u&&!1!==a.trailing&&(u=setTimeout((()=>{b=!1===a.leading?0:Date.now(),u=null,e.apply(k,w)}),v))}}function mt(e,i,a,u,b=window){const w=b.Object.getOwnPropertyDescriptor(e,i);return b.Object.defineProperty(e,i,u?a:{set(e){setTimeout((()=>{a.set.call(this,e)}),0),w&&w.set&&w.set.call(this,e)}}),()=>mt(e,i,w||{},!0)}function Se(e,i,a){try{if(!(i in e))return()=>{};const u=e[i],b=a(u);return"function"==typeof b&&(b.prototype=b.prototype||{},Object.defineProperties(b,{__rrweb_original__:{enumerable:!1,value:u}})),e[i]=b,()=>{e[i]=u}}catch{return()=>{}}}typeof window<"u"&&window.Proxy&&window.Reflect&&(ho=new Proxy(ho,{get:(e,i,a)=>("map"===i&&console.error(uo),Reflect.get(e,i,a))}));let po,fo=Date.now;function Ns(e){var i,a,u,b,w,S;const v=e.document;return{left:v.scrollingElement?v.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==v?void 0:v.documentElement.scrollLeft)||(null==(a=null==(i=null==v?void 0:v.body)?void 0:i.parentElement)?void 0:a.scrollLeft)||(null==(u=null==v?void 0:v.body)?void 0:u.scrollLeft)||0,top:v.scrollingElement?v.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==v?void 0:v.documentElement.scrollTop)||(null==(w=null==(b=null==v?void 0:v.body)?void 0:b.parentElement)?void 0:w.scrollTop)||(null==(S=null==v?void 0:v.body)?void 0:S.scrollTop)||0}}function Ds(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ps(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function As(e){return e?e.nodeType===e.ELEMENT_NODE?e:e.parentElement:null}function z(e,i,a,u){if(!e)return!1;const b=As(e);if(!b)return!1;try{if("string"==typeof i){if(b.classList.contains(i)||u&&null!==b.closest("."+i))return!0}else if(tt(b,i,u))return!0}catch{}return!(!a||!(b.matches(a)||u&&null!==b.closest(a)))}function xt(e,i,a){return!("TITLE"!==e.tagName||!a.headTitleMutations)||-2===i.getId(e)}function Fs(e,i){if(Ie(e))return!1;const a=i.getId(e);return!i.has(a)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||Fs(e.parentNode,i))}function Ht(e){return!!e.changedTouches}function Ws(e,i){return!("IFRAME"!==e.nodeName||!i.getMeta(e))}function _s(e,i){return!("LINK"!==e.nodeName||e.nodeType!==e.ELEMENT_NODE||!e.getAttribute||"stylesheet"!==e.getAttribute("rel")||!i.getMeta(e))}function Bt(e){return!(null==e||!e.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(fo=()=>(new Date).getTime());class vi{constructor(){y(this,"id",1),y(this,"styleIDMap",new WeakMap),y(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,i){if(this.has(e))return this.getId(e);let a;return a=void 0===i?this.id++:i,this.styleIDMap.set(e,a),this.idStyleMap.set(a,e),a}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Us(e){var i,a;let u=null;return(null==(a=null==(i=e.getRootNode)?void 0:i.call(e))?void 0:a.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(u=e.getRootNode().host),u}function ki(e){const i=e.ownerDocument;if(!i)return!1;const a=function Mi(e){let i,a=e;for(;i=Us(a);)a=i;return a}(e);return i.contains(a)}function zs(e){const i=e.ownerDocument;return!!i&&(i.contains(e)||ki(e))}const M=e=>po?(...i)=>{try{return e(...i)}catch(e){if(po&&!0===po(e))return;throw e}}:e;class Tr{constructor(e){y(this,"iframeIdToRemoteIdMap",new WeakMap),y(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,i,a,u){const b=a||this.getIdToRemoteIdMap(e),w=u||this.getRemoteIdToIdMap(e);let S=b.get(i);return S||(S=this.generateIdFn(),b.set(i,S),w.set(S,i)),S}getIds(e,i){const a=this.getIdToRemoteIdMap(e),u=this.getRemoteIdToIdMap(e);return i.map((i=>this.getId(e,i,a,u)))}getRemoteId(e,i,a){const u=a||this.getRemoteIdToIdMap(e);if("number"!=typeof i)return i;return u.get(i)||-1}getRemoteIds(e,i){const a=this.getRemoteIdToIdMap(e);return i.map((i=>this.getRemoteId(e,i,a)))}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 i=this.iframeIdToRemoteIdMap.get(e);return i||(i=new Map,this.iframeIdToRemoteIdMap.set(e,i)),i}getRemoteIdToIdMap(e){let i=this.iframeRemoteIdToIdMap.get(e);return i||(i=new Map,this.iframeRemoteIdToIdMap.set(e,i)),i}}class Ri{constructor(e){y(this,"iframes",new WeakMap),y(this,"crossOriginIframeMap",new WeakMap),y(this,"crossOriginIframeMirror",new Tr(Gr)),y(this,"crossOriginIframeStyleMirror"),y(this,"crossOriginIframeRootIdMap",new WeakMap),y(this,"mirror"),y(this,"mutationCb"),y(this,"wrappedEmit"),y(this,"loadListener"),y(this,"stylesheetManager"),y(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Tr(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,i){var a,u;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:i}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(a=e.contentWindow)||a.addEventListener("message",this.handleMessage.bind(this))),null==(u=this.loadListener)||u.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){const i=e;"@sailfish-rrweb/rrweb"!==i.data.type||(i.origin,i.data.origin)}transformCrossOriginEvent(e,i){var a;switch(i.type){case so.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(i.data.node,e);const a=i.data.node.id;return this.crossOriginIframeRootIdMap.set(e,a),this.patchRootIdOnNode(i.data.node,a),{timestamp:i.timestamp,type:so.IncrementalSnapshot,data:{source:oo.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:i.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case so.Meta:case so.Load:case so.DomContentLoaded:return!1;case so.Plugin:return i;case so.Custom:return this.replaceIds(i.data.payload,e,["id","parentId","previousId","nextId"]),i;case so.IncrementalSnapshot:switch(i.data.source){case oo.Mutation:return i.data.adds.forEach((i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);const a=this.crossOriginIframeRootIdMap.get(e);a&&this.patchRootIdOnNode(i.node,a)})),i.data.removes.forEach((i=>{this.replaceIds(i,e,["parentId","id"])})),i.data.attributes.forEach((i=>{this.replaceIds(i,e,["id"])})),i.data.texts.forEach((i=>{this.replaceIds(i,e,["id"])})),i;case oo.Drag:case oo.TouchMove:case oo.MouseMove:return i.data.positions.forEach((i=>{this.replaceIds(i,e,["id"])})),i;case oo.ViewportResize:return!1;case oo.MediaInteraction:case oo.MouseInteraction:case oo.Scroll:case oo.CanvasMutation:case oo.Input:return this.replaceIds(i.data,e,["id"]),i;case oo.StyleSheetRule:case oo.StyleDeclaration:return this.replaceIds(i.data,e,["id"]),this.replaceStyleIds(i.data,e,["styleId"]),i;case oo.Font:return i;case oo.Selection:return i.data.ranges.forEach((i=>{this.replaceIds(i,e,["start","end"])})),i;case oo.AdoptedStyleSheet:return this.replaceIds(i.data,e,["id"]),this.replaceStyleIds(i.data,e,["styleIds"]),null==(a=i.data.styles)||a.forEach((i=>{this.replaceStyleIds(i,e,["styleId"])})),i}}return!1}replace(e,i,a,u){for(const b of u)!Array.isArray(i[b])&&"number"!=typeof i[b]||(Array.isArray(i[b])?i[b]=e.getIds(a,i[b]):i[b]=e.getId(a,i[b]));return i}replaceIds(e,i,a){return this.replace(this.crossOriginIframeMirror,e,i,a)}replaceStyleIds(e,i,a){return this.replace(this.crossOriginIframeStyleMirror,e,i,a)}replaceIdOnNode(e,i){this.replaceIds(e,i,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,i)}))}patchRootIdOnNode(e,i){e.type!==$.Document&&!e.rootId&&(e.rootId=i),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,i)}))}}function Lr(e){return"__ln"in e}class Ei{constructor(){y(this,"length",0),y(this,"head",null),y(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let i=this.head;for(let a=0;a<e;a++)i=(null==i?void 0:i.next)||null;return i}addNode(e){const i={value:e,previous:null,next:null};if(e.__ln=i,e.previousSibling&&Lr(e.previousSibling)){const a=e.previousSibling.__ln.next;i.next=a,i.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=i,a&&(a.previous=i)}else if(e.nextSibling&&Lr(e.nextSibling)&&e.nextSibling.__ln.previous){const a=e.nextSibling.__ln.previous;i.previous=a,i.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=i,a&&(a.next=i)}else this.head&&(this.head.previous=i),i.next=this.head,this.head=i;null===i.next&&(this.tail=i),this.length++}removeNode(e){const i=e.__ln;this.head&&(i.previous?(i.previous.next=i.next,i.next?i.next.previous=i.previous:this.tail=i.previous):(this.head=i.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const Nr=(e,i)=>`${e}@${i}`;class Ti{constructor(){y(this,"frozen",!1),y(this,"locked",!1),y(this,"texts",[]),y(this,"attributes",[]),y(this,"attributeMap",new WeakMap),y(this,"removes",[]),y(this,"mapRemoves",[]),y(this,"movedMap",{}),y(this,"addedSet",new Set),y(this,"movedSet",new Set),y(this,"droppedSet",new Set),y(this,"mutationCb"),y(this,"blockClass"),y(this,"blockSelector"),y(this,"maskTextClass"),y(this,"maskTextSelector"),y(this,"inlineStylesheet"),y(this,"maskInputOptions"),y(this,"maskTextFn"),y(this,"maskInputFn"),y(this,"keepIframeSrcFn"),y(this,"recordCanvas"),y(this,"inlineImages"),y(this,"slimDOMOptions"),y(this,"dataURLOptions"),y(this,"doc"),y(this,"mirror"),y(this,"iframeManager"),y(this,"stylesheetManager"),y(this,"shadowDomManager"),y(this,"canvasManager"),y(this,"processedNodeManager"),y(this,"unattachedDoc"),y(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),y(this,"emit",(()=>{if(this.frozen||this.locked)return;const e=[],i=new Set,a=new Ei,n=e=>{let i=e,a=-2;for(;-2===a;)i=i&&i.nextSibling,a=i&&this.mirror.getId(i);return a},o=u=>{if(!u.parentNode||!zs(u)||"TEXTAREA"===u.parentNode.tagName)return;const b=Ie(u.parentNode)?this.mirror.getId(Us(u)):this.mirror.getId(u.parentNode),w=n(u);if(-1===b||-1===w)return a.addNode(u);const S=pe(u,{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=>{Ws(e,this.mirror)&&this.iframeManager.addIframe(e),_s(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Bt(u)&&this.shadowDomManager.addShadowRoot(u.shadowRoot,this.doc)},onIframeLoad:(e,i)=>{this.iframeManager.attachIframe(e,i),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,i)=>{this.stylesheetManager.attachLinkElement(e,i)}});S&&(e.push({parentId:b,nextId:w,node:S}),i.add(S.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)Dr(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||o(e);for(const e of this.addedSet)!Pr(this.droppedSet,e)&&!Dr(this.removes,e,this.mirror)||Pr(this.movedSet,e)?o(e):this.droppedSet.add(e);let u=null;for(;a.length;){let e=null;if(u){const i=this.mirror.getId(u.value.parentNode),a=n(u.value);-1!==i&&-1!==a&&(e=u)}if(!e){let i=a.tail;for(;i;){const a=i;if(i=i.previous,a){const i=this.mirror.getId(a.value.parentNode);if(-1===n(a.value))continue;if(-1!==i){e=a;break}{const i=a.value;if(i.parentNode&&i.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const u=i.parentNode.host;if(-1!==this.mirror.getId(u)){e=a;break}}}}}}if(!e){for(;a.head;)a.removeNode(a.head.value);break}u=e.previous,a.removeNode(e.value),o(e.value)}const b={texts:this.texts.map((e=>{const i=e.node;return i.parentNode&&"TEXTAREA"===i.parentNode.tagName&&this.genTextAreaValueMutation(i.parentNode),{id:this.mirror.getId(i),value:e.value}})).filter((e=>!i.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{const{attributes:i}=e;if("string"==typeof i.style){const a=JSON.stringify(e.styleDiff),u=JSON.stringify(e._unchangedStyles);a.length<i.style.length&&(a+u).split("var(").length===i.style.split("var(").length&&(i.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:i}})).filter((e=>!i.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};!b.texts.length&&!b.attributes.length&&!b.removes.length&&!b.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(b))})),y(this,"genTextAreaValueMutation",(e=>{let i=this.attributeMap.get(e);i||(i={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e,i)),i.attributes.value=Array.from(e.childNodes,(e=>e.textContent||"")).join("")})),y(this,"processMutation",(e=>{if(!xt(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const i=e.target.textContent;!z(e.target,this.blockClass,this.blockSelector,!1)&&i!==e.oldValue&&this.texts.push({value:Xr(e.target,this.maskTextClass,this.maskTextSelector,!0)&&i?this.maskTextFn?this.maskTextFn(i,As(e.target)):i.replace(/[\S]/g,"*"):i,node:e.target});break}case"attributes":{const i=e.target;let a=e.attributeName,u=e.target.getAttribute(a);if("value"===a){const e=Yt(i);u=Zt({element:i,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:e,value:u,maskInputFn:this.maskInputFn}).value}if(z(e.target,this.blockClass,this.blockSelector,!1)||u===e.oldValue)return;let b=this.attributeMap.get(e.target);if("IFRAME"===i.tagName&&"src"===a&&!this.keepIframeSrcFn(u)){if(i.contentDocument)return;a="rr_src"}if(b||(b={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(b),this.attributeMap.set(e.target,b)),"type"===a&&"INPUT"===i.tagName&&"password"===(e.oldValue||"").toLowerCase()&&i.setAttribute("data-rr-is-password","true"),!Yr(i.tagName,a)&&(b.attributes[a]=Zr(this.doc,ae(i.tagName),ae(a),u),"style"===a)){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const a=this.unattachedDoc.createElement("span");e.oldValue&&a.setAttribute("style",e.oldValue);for(const e of Array.from(i.style)){const u=i.style.getPropertyValue(e),w=i.style.getPropertyPriority(e);u!==a.style.getPropertyValue(e)||w!==a.style.getPropertyPriority(e)?b.styleDiff[e]=""===w?u:[u,w]:b._unchangedStyles[e]=[u,w]}for(const e of Array.from(a.style))""===i.style.getPropertyValue(e)&&(b.styleDiff[e]=!1)}break}case"childList":if(z(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((i=>this.genAdds(i,e.target))),e.removedNodes.forEach((i=>{const a=this.mirror.getId(i),u=Ie(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);z(e.target,this.blockClass,this.blockSelector,!1)||xt(i,this.mirror,this.slimDOMOptions)||!function Ci(e,i){return-1!==i.getId(e)}(i,this.mirror)||(this.addedSet.has(i)?(Gt(this.addedSet,i),this.droppedSet.add(i)):this.addedSet.has(e.target)&&-1===a||Fs(e.target,this.mirror)||(this.movedSet.has(i)&&this.movedMap[Nr(a,u)]?Gt(this.movedSet,i):this.removes.push({parentId:u,id:a,isShadow:!(!Ie(e.target)||!ve(e.target))||void 0})),this.mapRemoves.push(i))}))}})),y(this,"genAdds",((e,i)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(xt(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let a=null;i&&this.mirror.hasNode(i)&&(a=this.mirror.getId(i)),a&&-1!==a&&(this.movedMap[Nr(this.mirror.getId(e),a)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);z(e,this.blockClass,this.blockSelector,!1)||(e.childNodes.forEach((e=>this.genAdds(e))),Bt(e)&&e.shadowRoot.childNodes.forEach((i=>{this.processedNodeManager.add(i,this),this.genAdds(i,e)})))}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((i=>{this[i]=e[i]}))}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 Gt(e,i){e.delete(i),i.childNodes.forEach((i=>Gt(e,i)))}function Dr(e,i,a){return 0!==e.length&&function Li(e,i,a){let u=i.parentNode;for(;u;){const i=a.getId(u);if(e.some((e=>e.id===i)))return!0;u=u.parentNode}return!1}(e,i,a)}function Pr(e,i){return 0!==e.size&&Vs(e,i)}function Vs(e,i){const{parentNode:a}=i;return!!a&&(!!e.has(a)||Vs(e,a))}const mo=[];function De(e){try{if("composedPath"in e){const i=e.composedPath();if(i.length)return i[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function js(e,i){var a,u;const b=new Ti;mo.push(b),b.init(e);let w=window.MutationObserver||window.__rrMutationObserver;const S=null==(u=null==(a=null==window?void 0:window.Zone)?void 0:a.__symbol__)?void 0:u.call(a,"MutationObserver");S&&window[S]&&(w=window[S]);const v=new w(M(b.processMutations.bind(b)));return v.observe(i,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),v}function Di({mouseInteractionCb:e,doc:i,mirror:a,blockClass:u,blockSelector:b,sampling:w}){if(!1===w.mouseInteraction)return()=>{};const S=!0===w.mouseInteraction||void 0===w.mouseInteraction?{}:w.mouseInteraction,v=[];let k=null;return Object.keys(io).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==S[e])).forEach((w=>{let S=ae(w);const C=(i=>w=>{const S=De(w);if(z(S,u,b,!0))return;let v=null,C=i;if("pointerType"in w){switch(w.pointerType){case"mouse":v=ao.Mouse;break;case"touch":v=ao.Touch;break;case"pen":v=ao.Pen}v===ao.Touch?io[i]===io.MouseDown?C="TouchStart":io[i]===io.MouseUp&&(C="TouchEnd"):ao.Pen}else Ht(w)&&(v=ao.Touch);null!==v?(k=v,(C.startsWith("Touch")&&v===ao.Touch||C.startsWith("Mouse")&&v===ao.Mouse)&&(v=null)):io[i]===io.Click&&(v=k,k=null);const I=Ht(w)?w.changedTouches[0]:w;if(!I)return;const O=a.getId(S),{clientX:x,clientY:_}=I;M(e)({type:io[C],id:O,x:x,y:_,...null!==v&&{pointerType:v}})})(w);if(window.PointerEvent)switch(io[w]){case io.MouseDown:case io.MouseUp:S=S.replace("mouse","pointer");break;case io.TouchStart:case io.TouchEnd:return}v.push(U(S,C,i))})),M((()=>{v.forEach((e=>e()))}))}function Hs({scrollCb:e,doc:i,mirror:a,blockClass:u,blockSelector:b,sampling:w}){const S=M(Te(M((w=>{const S=De(w);if(!S||z(S,u,b,!0))return;const v=a.getId(S);if(S===i&&i.defaultView){const a=Ns(i.defaultView);e({id:v,x:a.left,y:a.top})}else e({id:v,x:S.scrollLeft,y:S.scrollTop})})),w.scroll||100));return U("scroll",S,i)}const go=["INPUT","TEXTAREA","SELECT"],yo=new WeakMap;function at(e){return function r(e,i){if(Ge("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Ge("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Ge("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Ge("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const a=Array.from(e.parentRule.cssRules).indexOf(e);i.unshift(a)}else if(e.parentStyleSheet){const a=Array.from(e.parentStyleSheet.cssRules).indexOf(e);i.unshift(a)}return i}(e,[])}function se(e,i,a){let u,b;return e?(e.ownerNode?u=i.getId(e.ownerNode):b=a.getId(e),{styleId:b,id:u}):{}}function Bs({mirror:e,stylesheetManager:i},a){var u,b,w;let S=null;S="#document"===a.nodeName?e.getId(a):e.getId(a.host);const v="#document"===a.nodeName?null==(u=a.defaultView)?void 0:u.Document:null==(w=null==(b=a.ownerDocument)?void 0:b.defaultView)?void 0:w.ShadowRoot,k=null!=v&&v.prototype?Object.getOwnPropertyDescriptor(null==v?void 0:v.prototype,"adoptedStyleSheets"):void 0;return null!==S&&-1!==S&&v&&k?(Object.defineProperty(a,"adoptedStyleSheets",{configurable:k.configurable,enumerable:k.enumerable,get(){var e;return null==(e=k.get)?void 0:e.call(this)},set(e){var a;const u=null==(a=k.set)?void 0:a.call(this,e);if(null!==S&&-1!==S)try{i.adoptStyleSheets(e,S)}catch{}return u}}),M((()=>{Object.defineProperty(a,"adoptedStyleSheets",{configurable:k.configurable,enumerable:k.enumerable,get:k.get,set:k.set})}))):()=>{}}function Bi(e,i={}){const a=e.doc.defaultView;if(!a)return()=>{};let u;!function Hi(e,i){const{mutationCb:a,mousemoveCb:u,mouseInteractionCb:b,scrollCb:w,viewportResizeCb:S,inputCb:v,mediaInteractionCb:k,styleSheetRuleCb:C,styleDeclarationCb:I,canvasMutationCb:O,fontCb:x,selectionCb:_,customElementCb:N}=e;e.mutationCb=(...e)=>{i.mutation&&i.mutation(...e),a(...e)},e.mousemoveCb=(...e)=>{i.mousemove&&i.mousemove(...e),u(...e)},e.mouseInteractionCb=(...e)=>{i.mouseInteraction&&i.mouseInteraction(...e),b(...e)},e.scrollCb=(...e)=>{i.scroll&&i.scroll(...e),w(...e)},e.viewportResizeCb=(...e)=>{i.viewportResize&&i.viewportResize(...e),S(...e)},e.inputCb=(...e)=>{i.input&&i.input(...e),v(...e)},e.mediaInteractionCb=(...e)=>{i.mediaInteaction&&i.mediaInteaction(...e),k(...e)},e.styleSheetRuleCb=(...e)=>{i.styleSheetRule&&i.styleSheetRule(...e),C(...e)},e.styleDeclarationCb=(...e)=>{i.styleDeclaration&&i.styleDeclaration(...e),I(...e)},e.canvasMutationCb=(...e)=>{i.canvasMutation&&i.canvasMutation(...e),O(...e)},e.fontCb=(...e)=>{i.font&&i.font(...e),x(...e)},e.selectionCb=(...e)=>{i.selection&&i.selection(...e),_(...e)},e.customElementCb=(...e)=>{i.customElement&&i.customElement(...e),N(...e)}}(e,i),e.recordDOM&&(u=js(e,e.doc));const b=function Ni({mousemoveCb:e,sampling:i,doc:a,mirror:u}){if(!1===i.mousemove)return()=>{};const b="number"==typeof i.mousemove?i.mousemove:50,w="number"==typeof i.mousemoveCallback?i.mousemoveCallback:500;let S,v=[];const k=Te(M((i=>{const a=Date.now()-S;e(v.map((e=>(e.timeOffset-=a,e))),i),v=[],S=null})),w),C=M(Te(M((e=>{const i=De(e),{clientX:a,clientY:b}=Ht(e)?e.changedTouches[0]:e;S||(S=fo()),v.push({x:a,y:b,id:u.getId(i),timeOffset:fo()-S}),k(typeof DragEvent<"u"&&e instanceof DragEvent?oo.Drag:e instanceof MouseEvent?oo.MouseMove:oo.TouchMove)})),b,{trailing:!1})),I=[U("mousemove",C,a),U("touchmove",C,a),U("drag",C,a)];return M((()=>{I.forEach((e=>e()))}))}(e),w=Di(e),S=Hs(e),v=function Pi({viewportResizeCb:e},{win:i}){let a=-1,u=-1;return U("resize",M(Te(M((()=>{const i=Ds(),b=Ps();(a!==i||u!==b)&&(e({width:Number(b),height:Number(i)}),a=i,u=b)})),200)),i)}(e,{win:a}),k=function Fi({inputCb:e,doc:i,mirror:a,blockClass:u,blockSelector:b,ignoreClass:w,ignoreSelector:S,maskInputOptions:v,maskInputFn:k,sampling:C,userTriggeredOnInput:I}){function p(e){let a=De(e);const C=e.isTrusted,O=a&&a.tagName;if(a&&"OPTION"===O&&(a=a.parentElement),!a||!O||go.indexOf(O)<0||z(a,u,b,!0)||a.classList.contains(w)||S&&a.matches(S))return;let x=a.value,_=!1;const N=Yt(a)||"",{value:D,masked:A}=Zt({element:a,maskInputOptions:v,tagName:O,type:N,value:x,maskInputFn:k});x=D,("radio"===N||"checkbox"===N)&&(_=a.checked),f(a,I?{text:x,isChecked:_,masked:A,userTriggered:C}:{text:x,isChecked:_,masked:A});const F=a.name;"radio"===N&&F&&_&&i.querySelectorAll(`input[type="radio"][name="${F}"]`).forEach((e=>{if(e!==a){const i=e.value;f(e,I?{text:i,isChecked:!_,masked:A,userTriggered:!1}:{text:i,isChecked:!_,masked:A})}}))}function f(i,u){const b=yo.get(i);if(!b||b.text!==u.text||b.isChecked!==u.isChecked||b.masked!==u.masked){yo.set(i,u);const b=a.getId(i);M(e)({...u,id:b})}}const O=("last"===C.input?["change"]:["input","change"]).map((e=>U(e,M(p),i))),x=i.defaultView;if(!x)return()=>{O.forEach((e=>e()))};const _=x.Object.getOwnPropertyDescriptor(x.HTMLInputElement.prototype,"value"),N=[[x.HTMLInputElement.prototype,"value"],[x.HTMLInputElement.prototype,"checked"],[x.HTMLSelectElement.prototype,"value"],[x.HTMLTextAreaElement.prototype,"value"],[x.HTMLSelectElement.prototype,"selectedIndex"],[x.HTMLOptionElement.prototype,"selected"]];return _&&_.set&&O.push(...N.map((e=>mt(e[0],e[1],{set(){M(p)({target:this,isTrusted:!1})}},!1,x)))),M((()=>{O.forEach((e=>e()))}))}(e),C=function Ui({mediaInteractionCb:e,blockClass:i,blockSelector:a,mirror:u,sampling:b,doc:w}){const S=M((w=>Te(M((b=>{const S=De(b);if(!S||z(S,i,a,!0))return;const{currentTime:v,volume:k,muted:C,playbackRate:I,loop:O}=S;e({type:w,id:u.getId(S),currentTime:v,volume:k,muted:C,playbackRate:I,loop:O})})),b.media||500))),v=[U("play",S(co.Play),w),U("pause",S(co.Pause),w),U("seeked",S(co.Seeked),w),U("volumechange",S(co.VolumeChange),w),U("ratechange",S(co.RateChange),w)];return M((()=>{v.forEach((e=>e()))}))}(e);let h=()=>{},p=()=>{},f=()=>{},d2=()=>{};e.recordDOM&&(h=function Wi({styleSheetRuleCb:e,mirror:i,stylesheetManager:a},{win:u}){if(!u.CSSStyleSheet||!u.CSSStyleSheet.prototype)return()=>{};const b=u.CSSStyleSheet.prototype.insertRule;u.CSSStyleSheet.prototype.insertRule=new Proxy(b,{apply:M(((u,b,w)=>{const[S,v]=w,{id:k,styleId:C}=se(b,i,a.styleMirror);return(k&&-1!==k||C&&-1!==C)&&e({id:k,styleId:C,adds:[{rule:S,index:v}]}),u.apply(b,w)}))});const w=u.CSSStyleSheet.prototype.deleteRule;let S,v;u.CSSStyleSheet.prototype.deleteRule=new Proxy(w,{apply:M(((u,b,w)=>{const[S]=w,{id:v,styleId:k}=se(b,i,a.styleMirror);return(v&&-1!==v||k&&-1!==k)&&e({id:v,styleId:k,removes:[{index:S}]}),u.apply(b,w)}))}),u.CSSStyleSheet.prototype.replace&&(S=u.CSSStyleSheet.prototype.replace,u.CSSStyleSheet.prototype.replace=new Proxy(S,{apply:M(((u,b,w)=>{const[S]=w,{id:v,styleId:k}=se(b,i,a.styleMirror);return(v&&-1!==v||k&&-1!==k)&&e({id:v,styleId:k,replace:S}),u.apply(b,w)}))})),u.CSSStyleSheet.prototype.replaceSync&&(v=u.CSSStyleSheet.prototype.replaceSync,u.CSSStyleSheet.prototype.replaceSync=new Proxy(v,{apply:M(((u,b,w)=>{const[S]=w,{id:v,styleId:k}=se(b,i,a.styleMirror);return(v&&-1!==v||k&&-1!==k)&&e({id:v,styleId:k,replaceSync:S}),u.apply(b,w)}))}));const k={};Ze("CSSGroupingRule")?k.CSSGroupingRule=u.CSSGroupingRule:(Ze("CSSMediaRule")&&(k.CSSMediaRule=u.CSSMediaRule),Ze("CSSConditionRule")&&(k.CSSConditionRule=u.CSSConditionRule),Ze("CSSSupportsRule")&&(k.CSSSupportsRule=u.CSSSupportsRule));const C={};return Object.entries(k).forEach((([u,b])=>{C[u]={insertRule:b.prototype.insertRule,deleteRule:b.prototype.deleteRule},b.prototype.insertRule=new Proxy(C[u].insertRule,{apply:M(((u,b,w)=>{const[S,v]=w,{id:k,styleId:C}=se(b.parentStyleSheet,i,a.styleMirror);return(k&&-1!==k||C&&-1!==C)&&e({id:k,styleId:C,adds:[{rule:S,index:[...at(b),v||0]}]}),u.apply(b,w)}))}),b.prototype.deleteRule=new Proxy(C[u].deleteRule,{apply:M(((u,b,w)=>{const[S]=w,{id:v,styleId:k}=se(b.parentStyleSheet,i,a.styleMirror);return(v&&-1!==v||k&&-1!==k)&&e({id:v,styleId:k,removes:[{index:[...at(b),S]}]}),u.apply(b,w)}))})})),M((()=>{u.CSSStyleSheet.prototype.insertRule=b,u.CSSStyleSheet.prototype.deleteRule=w,S&&(u.CSSStyleSheet.prototype.replace=S),v&&(u.CSSStyleSheet.prototype.replaceSync=v),Object.entries(k).forEach((([e,i])=>{i.prototype.insertRule=C[e].insertRule,i.prototype.deleteRule=C[e].deleteRule}))}))}(e,{win:a}),p=Bs(e,e.doc),f=function _i({styleDeclarationCb:e,mirror:i,ignoreCSSAttributes:a,stylesheetManager:u},{win:b}){const w=b.CSSStyleDeclaration.prototype.setProperty;b.CSSStyleDeclaration.prototype.setProperty=new Proxy(w,{apply:M(((b,S,v)=>{var k;const[C,I,O]=v;if(a.has(C))return w.apply(S,[C,I,O]);const{id:x,styleId:_}=se(null==(k=S.parentRule)?void 0:k.parentStyleSheet,i,u.styleMirror);return(x&&-1!==x||_&&-1!==_)&&e({id:x,styleId:_,set:{property:C,value:I,priority:O},index:at(S.parentRule)}),b.apply(S,v)}))});const S=b.CSSStyleDeclaration.prototype.removeProperty;return b.CSSStyleDeclaration.prototype.removeProperty=new Proxy(S,{apply:M(((b,w,v)=>{var k;const[C]=v;if(a.has(C))return S.apply(w,[C]);const{id:I,styleId:O}=se(null==(k=w.parentRule)?void 0:k.parentStyleSheet,i,u.styleMirror);return(I&&-1!==I||O&&-1!==O)&&e({id:I,styleId:O,remove:{property:C},index:at(w.parentRule)}),b.apply(w,v)}))}),M((()=>{b.CSSStyleDeclaration.prototype.setProperty=w,b.CSSStyleDeclaration.prototype.removeProperty=S}))}(e,{win:a}),e.collectFonts&&(d2=function zi({fontCb:e,doc:i}){const a=i.defaultView;if(!a)return()=>{};const u=[],b=new WeakMap,w=a.FontFace;a.FontFace=function(e,i,a){const u=new w(e,i,a);return b.set(u,{family:e,buffer:"string"!=typeof i,descriptors:a,fontSource:"string"==typeof i?i:JSON.stringify(Array.from(new Uint8Array(i)))}),u};const S=Se(i.fonts,"add",(function(i){return function(a){return setTimeout(M((()=>{const i=b.get(a);i&&(e(i),b.delete(a))})),0),i.apply(this,[a])}}));return u.push((()=>{a.FontFace=w})),u.push(S),M((()=>{u.forEach((e=>e()))}))}(e)));const I=function Vi(e){const{doc:i,mirror:a,blockClass:u,blockSelector:b,selectionCb:w}=e;let S=!0;const v=M((()=>{const e=i.getSelection();if(!e||S&&null!=e&&e.isCollapsed)return;S=e.isCollapsed||!1;const v=[],k=e.rangeCount||0;for(let i=0;i<k;i++){const w=e.getRangeAt(i),{startContainer:S,startOffset:k,endContainer:C,endOffset:I}=w;z(S,u,b,!0)||z(C,u,b,!0)||v.push({start:a.getId(S),startOffset:k,end:a.getId(C),endOffset:I})}w({ranges:v})}));return v(),U("selectionchange",v)}(e),O=function ji({doc:e,customElementCb:i}){const a=e.defaultView;return a&&a.customElements?Se(a.customElements,"define",(function(e){return function(a,u,b){try{i({define:{name:a}})}catch{console.warn(`Custom element callback failed for ${a}`)}return e.apply(this,[a,u,b])}})):()=>{}}(e),x=[];for(const i of e.plugins)x.push(i.observer(i.callback,a,i.options));return M((()=>{mo.forEach((e=>e.reset())),null==u||u.disconnect(),b(),w(),S(),v(),k(),C(),h(),p(),f(),d2(),I(),O(),x.forEach((e=>e()))}))}function Ge(e){return typeof window[e]<"u"}function Ze(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}const bo="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Zvcih2YXIgcj0iQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyIsdz10eXBlb2YgVWludDhBcnJheT4idSI/W106bmV3IFVpbnQ4QXJyYXkoMjU2KSxpPTA7aTxyLmxlbmd0aDtpKyspd1tyLmNoYXJDb2RlQXQoaSldPWk7dmFyIHA9ZnVuY3Rpb24ocyl7dmFyIGU9bmV3IFVpbnQ4QXJyYXkocyksbixhPWUubGVuZ3RoLHQ9IiI7Zm9yKG49MDtuPGE7bis9Myl0Kz1yW2Vbbl0+PjJdLHQrPXJbKGVbbl0mMyk8PDR8ZVtuKzFdPj40XSx0Kz1yWyhlW24rMV0mMTUpPDwyfGVbbisyXT4+Nl0sdCs9cltlW24rMl0mNjNdO3JldHVybiBhJTM9PT0yP3Q9dC5zdWJzdHJpbmcoMCx0Lmxlbmd0aC0xKSsiPSI6YSUzPT09MSYmKHQ9dC5zdWJzdHJpbmcoMCx0Lmxlbmd0aC0yKSsiPT0iKSx0fTtjb25zdCBsPW5ldyBNYXAsYj1uZXcgTWFwO2FzeW5jIGZ1bmN0aW9uIHkocyxlLG4pe2NvbnN0IGE9YCR7c30tJHtlfWA7aWYoIk9mZnNjcmVlbkNhbnZhcyJpbiBnbG9iYWxUaGlzKXtpZihiLmhhcyhhKSlyZXR1cm4gYi5nZXQoYSk7Y29uc3QgdD1uZXcgT2Zmc2NyZWVuQ2FudmFzKHMsZSk7dC5nZXRDb250ZXh0KCIyZCIpO2NvbnN0IGc9YXdhaXQoYXdhaXQgdC5jb252ZXJ0VG9CbG9iKG4pKS5hcnJheUJ1ZmZlcigpLGM9cChnKTtyZXR1cm4gYi5zZXQoYSxjKSxjfWVsc2UgcmV0dXJuIiJ9Y29uc3Qgbz1zZWxmO28ub25tZXNzYWdlPWFzeW5jIGZ1bmN0aW9uKHMpe2lmKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcyl7Y29uc3R7aWQ6ZSxiaXRtYXA6bix3aWR0aDphLGhlaWdodDp0LGRhdGFVUkxPcHRpb25zOnV9PXMuZGF0YSxnPXkoYSx0LHUpLGM9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2MuZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCBkPWF3YWl0IGMuY29udmVydFRvQmxvYih1KSx2PWQudHlwZSxoPWF3YWl0IGQuYXJyYXlCdWZmZXIoKSxmPXAoaCk7aWYoIWwuaGFzKGUpJiZhd2FpdCBnPT09ZilyZXR1cm4gbC5zZXQoZSxmKSxvLnBvc3RNZXNzYWdlKHtpZDplfSk7aWYobC5nZXQoZSk9PT1mKXJldHVybiBvLnBvc3RNZXNzYWdlKHtpZDplfSk7by5wb3N0TWVzc2FnZSh7aWQ6ZSx0eXBlOnYsYmFzZTY0OmYsd2lkdGg6YSxoZWlnaHQ6dH0pLGwuc2V0KGUsZil9ZWxzZSByZXR1cm4gby5wb3N0TWVzc2FnZSh7aWQ6cy5kYXRhLmlkfSl9fSkoKTsKLy8jIHNvdXJjZU1hcHBpbmdVUkw9aW1hZ2UtYml0bWFwLWRhdGEtdXJsLXdvcmtlci1Cb1hHVm1Zby5qcy5tYXAK",wo=typeof self<"u"&&self.Blob&&new Blob([(So=bo,Uint8Array.from(atob(So),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});var So;function Zi(e){let i;try{if(i=wo&&(self.URL||self.webkitURL).createObjectURL(wo),!i)throw"";const a=new Worker(i,{name:null==e?void 0:e.name});return a.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(i)})),a}catch{return new Worker("data:text/javascript;base64,"+bo,{name:null==e?void 0:e.name})}finally{i&&(self.URL||self.webkitURL).revokeObjectURL(i)}}for(var ko="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Co=typeof Uint8Array>"u"?[]:new Uint8Array(256),Io=0;Io<64;Io++)Co[ko.charCodeAt(Io)]=Io;const Mo=new Map;const Zs=(e,i,a)=>{if(!e||!Xs(e,i)&&"object"!=typeof e)return;const u=function $i(e,i){let a=Mo.get(e);return a||(a=new Map,Mo.set(e,a)),a.has(i)||a.set(i,[]),a.get(i)}(a,e.constructor.name);let b=u.indexOf(e);return-1===b&&(b=u.length,u.push(e)),b};function Je(e,i,a){if(e instanceof Array)return e.map((e=>Je(e,i,a)));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 i=e.constructor.name,a=function(e){var i,a=new Uint8Array(e),u=a.length,b="";for(i=0;i<u;i+=3)b+=ko[a[i]>>2],b+=ko[(3&a[i])<<4|a[i+1]>>4],b+=ko[(15&a[i+1])<<2|a[i+2]>>6],b+=ko[63&a[i+2]];return u%3==2?b=b.substring(0,b.length-1)+"=":u%3==1&&(b=b.substring(0,b.length-2)+"=="),b}(e);return{rr_type:i,base64:a}}if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Je(e.buffer,i,a),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const i=e.constructor.name,{src:a}=e;return{rr_type:i,src:a}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Je(e.data,i,a),e.width,e.height]};if(Xs(e,i)||"object"==typeof e){return{rr_type:e.constructor.name,index:Zs(e,i,a)}}return e}const Ys=(e,i,a)=>e.map((e=>Je(e,i,a))),Xs=(e,i)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof i[e])).find((a=>e instanceof i[a]));function _r(e,i,a,u){const b=[];try{const w=Se(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(b,...w){if(!z(this,i,a,!0)){const e=function Ki(e){return"experimental-webgl"===e?"webgl":e}(b);if("__context"in this||(this.__context=e),u&&["webgl","webgl2"].includes(e))if(w[0]&&"object"==typeof w[0]){const e=w[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else w.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[b,...w])}}));b.push(w)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{b.forEach((e=>e()))}}function Ur(e,i,a,u,b,w){const S=[],v=Object.getOwnPropertyNames(e);for(const k of v)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(k))try{if("function"!=typeof e[k])continue;const v=Se(e,k,(function(e){return function(...S){const v=e.apply(this,S);if(Zs(v,w,this),"tagName"in this.canvas&&!z(this.canvas,u,b,!0)){const e=Ys(S,w,this),u={type:i,property:k,args:e};a(this.canvas,u)}return v}}));S.push(v)}catch{const u=mt(e,k,{set(e){a(this.canvas,{type:i,property:k,args:[e],setter:!0})}});S.push(u)}return S}class qi{constructor(e){y(this,"pendingCanvasMutations",new Map),y(this,"rafStamps",{latestId:0,invokeId:null}),y(this,"mirror"),y(this,"mutationCb"),y(this,"resetObservers"),y(this,"frozen",!1),y(this,"locked",!1),y(this,"processMutation",((e,i)=>{(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(i)}));const{sampling:i="all",win:a,blockClass:u,blockSelector:b,recordCanvas:w,dataURLOptions:S}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,w&&"all"===i&&this.initCanvasMutationObserver(a,u,b),w&&"number"==typeof i&&this.initCanvasFPSObserver(i,a,u,b,{dataURLOptions:S})}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,i,a,u,b){const w=_r(i,a,u,!0),S=new Map,v=new Zi;v.onmessage=e=>{const{id:i}=e.data;if(S.set(i,!1),!("base64"in e.data))return;const{base64:a,type:u,width:b,height:w}=e.data;this.mutationCb({id:i,type:lo["2D"],commands:[{property:"clearRect",args:[0,0,b,w]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:a}],type:u}]},0,0]}]})};const k=1e3/e;let C,I=0;const d2=e=>{I&&e-I<k||(I=e,(()=>{const e=[];return i.document.querySelectorAll("canvas").forEach((i=>{z(i,a,u,!0)||e.push(i)})),e})().forEach((async e=>{var i;const a=this.mirror.getId(e);if(S.get(a)||0===e.width||0===e.height)return;if(S.set(a,!0),["webgl","webgl2"].includes(e.__context)){const a=e.getContext(e.__context);!1===(null==(i=null==a?void 0:a.getContextAttributes())?void 0:i.preserveDrawingBuffer)&&a.clear(a.COLOR_BUFFER_BIT)}const u=await createImageBitmap(e);v.postMessage({id:a,bitmap:u,width:e.width,height:e.height,dataURLOptions:b.dataURLOptions},[u])}))),C=requestAnimationFrame(d2)};C=requestAnimationFrame(d2),this.resetObservers=()=>{w(),cancelAnimationFrame(C)}}initCanvasMutationObserver(e,i,a){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const u=_r(e,i,a,!1),b=function Ji(e,i,a,u){const b=[],w=Object.getOwnPropertyNames(i.CanvasRenderingContext2D.prototype);for(const S of w)try{if("function"!=typeof i.CanvasRenderingContext2D.prototype[S])continue;const w=Se(i.CanvasRenderingContext2D.prototype,S,(function(b){return function(...w){return z(this.canvas,a,u,!0)||setTimeout((()=>{const a=Ys(w,i,this);e(this.canvas,{type:lo["2D"],property:S,args:a})}),0),b.apply(this,w)}}));b.push(w)}catch{const a=mt(i.CanvasRenderingContext2D.prototype,S,{set(i){e(this.canvas,{type:lo["2D"],property:S,args:[i],setter:!0})}});b.push(a)}return()=>{b.forEach((e=>e()))}}(this.processMutation.bind(this),e,i,a),w=function Qi(e,i,a,u){const b=[];return b.push(...Ur(i.WebGLRenderingContext.prototype,lo.WebGL,e,a,u,i)),typeof i.WebGL2RenderingContext<"u"&&b.push(...Ur(i.WebGL2RenderingContext.prototype,lo.WebGL2,e,a,u,i)),()=>{b.forEach((e=>e()))}}(this.processMutation.bind(this),e,i,a);this.resetObservers=()=>{u(),b(),w()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const t=e=>{this.rafStamps.latestId=e,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,i)=>{const a=this.mirror.getId(i);this.flushPendingCanvasMutationFor(i,a)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,i){if(this.frozen||this.locked)return;const a=this.pendingCanvasMutations.get(e);if(!a||-1===i)return;const u=a.map((e=>{const{type:i,...a}=e;return a})),{type:b}=a[0];this.mutationCb({id:i,type:b,commands:u}),this.pendingCanvasMutations.delete(e)}}class ea{constructor(){y(this,"nodeMap",new WeakMap),y(this,"active",!1)}inOtherBuffer(e,i){const a=this.nodeMap.get(e);return a&&Array.from(a).some((e=>e!==i))}add(e,i){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(i))}destroy(){}}class ta{constructor(e){y(this,"shadowDoms",new WeakSet),y(this,"mutationCb"),y(this,"scrollCb"),y(this,"bypassOptions"),y(this,"mirror"),y(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,i){if(!ve(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const a=js({...this.bypassOptions,doc:i,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push((()=>a.disconnect())),this.restoreHandlers.push(Hs({...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)),this.restoreHandlers.push(Bs({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,i){const a=this;this.restoreHandlers.push(Se(e.prototype,"attachShadow",(function(e){return function(u){const b=e.call(this,u);return this.shadowRoot&&zs(this)&&a.addShadowRoot(this.shadowRoot,i),b}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch{}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}class ra{constructor(e){y(this,"trackedLinkElements",new WeakSet),y(this,"mutationCb"),y(this,"adoptedStyleSheetCb"),y(this,"styleMirror",new vi),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,i){"_cssText"in i.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:i.id,attributes:i.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,i){if(0===e.length)return;const a={id:i,styleIds:[]},u=[];for(const i of e){let e;this.styleMirror.has(i)?e=this.styleMirror.getId(i):(e=this.styleMirror.add(i),u.push({styleId:e,rules:Array.from(i.rules||CSSRule,((e,i)=>({rule:jr(e),index:i})))})),a.styleIds.push(e)}u.length>0&&(a.styles=u),this.adoptedStyleSheetCb(a)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}let xo,Ro,Eo,Lo=!1;var To;try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(To=e.contentWindow)?void 0:To.Array.from)||Array.from,document.body.removeChild(e)}}catch(So){console.debug("Unable to override Array.from",So)}const _o=function on(){return new Hr}();function yt(e={}){const{emit:i,checkoutEveryNms:a,checkoutEveryNth:u,blockClass:b="rr-block",blockSelector:w=null,ignoreClass:S="rr-ignore",ignoreSelector:v=null,maskTextClass:k="rr-mask",maskTextSelector:C=null,inlineStylesheet:I=!0,maskAllInputs:O,maskInputOptions:x,slimDOMOptions:_,maskInputFn:N,maskTextFn:D,hooks:A,packFn:F,sampling:W={},dataURLOptions:j={},mousemoveWait:V,recordDOM:$=!0,recordCanvas:G=!1,recordCrossOriginIframes:H=!1,recordAfter:Z=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:B=!1,collectFonts:Y=!1,inlineImages:K=!1,plugins:J,keepIframeSrcFn:q=()=>!1,ignoreCSSAttributes:Q=new Set([]),errorHandler:ee}=e;!function xi(e){po=e}(ee);const te=!H||window.parent===window;let re=!1;if(!te)try{window.parent.document&&(re=!1)}catch{re=!0}if(te&&!i)throw new Error("emit function is required");if(!te&&!re)return()=>{};void 0!==V&&void 0===W.mousemove&&(W.mousemove=V),_o.reset();const ne=!0===O?{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!==x?x:{password:!0},oe=!0===_||"all"===_?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===_,headMetaDescKeywords:"all"===_,headTitleMutations:"all"===_}:_||{};!function Ii(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 i=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===i)return!0}while(i=i&&i.parentNode);return!1})}();let ie,le=0;const or=e=>{for(const i of J||[])i.eventProcessor&&(e=i.eventProcessor(e));return F&&!re&&(e=F(e)),e};xo=(e,b)=>{var w;const S=e;if(S.timestamp=fo(),null!=(w=mo[0])&&w.isFrozen()&&S.type!==so.FullSnapshot&&!(S.type===so.IncrementalSnapshot&&S.data.source===oo.Mutation)&&mo.forEach((e=>e.unfreeze())),te)null==i||i(or(S),b);else if(re){const e={type:"@sailfish-rrweb/rrweb",event:or(S),origin:window.location.origin,isCheckout:b};window.parent.postMessage(e,"*")}if(S.type===so.FullSnapshot)ie=S,le=0;else if(S.type===so.IncrementalSnapshot){if(S.data.source===oo.Mutation&&S.data.isAttachIframe)return;le++;const e=u&&le>=u,i=a&&S.timestamp-ie.timestamp>a;(e||i)&&Ro(!0)}};const Pe=e=>{xo({type:so.IncrementalSnapshot,data:{source:oo.Mutation,...e}})},ir=e=>xo({type:so.IncrementalSnapshot,data:{source:oo.Scroll,...e}}),ar=e=>xo({type:so.IncrementalSnapshot,data:{source:oo.CanvasMutation,...e}}),ce=new ra({mutationCb:Pe,adoptedStyleSheetCb:e=>xo({type:so.IncrementalSnapshot,data:{source:oo.AdoptedStyleSheet,...e}})}),ue=new Ri({mirror:_o,mutationCb:Pe,stylesheetManager:ce,recordCrossOriginIframes:H,wrappedEmit:xo});for(const e of J||[])e.getMirror&&e.getMirror({nodeMirror:_o,crossOriginIframeMirror:ue.crossOriginIframeMirror,crossOriginIframeStyleMirror:ue.crossOriginIframeStyleMirror});const he=new ea;Eo=new qi({recordCanvas:G,mutationCb:ar,win:window,blockClass:b,blockSelector:w,mirror:_o,sampling:W.canvas,dataURLOptions:j});const de=new ta({mutationCb:Pe,scrollCb:ir,bypassOptions:{blockClass:b,blockSelector:w,maskTextClass:k,maskTextSelector:C,inlineStylesheet:I,maskInputOptions:ne,dataURLOptions:j,maskTextFn:D,maskInputFn:N,recordCanvas:G,inlineImages:K,sampling:W,slimDOMOptions:oe,iframeManager:ue,stylesheetManager:ce,canvasManager:Eo,keepIframeSrcFn:q,processedNodeManager:he},mirror:_o});Ro=(e=!1)=>{if(!$)return;xo({type:so.Meta,data:{href:window.location.href,width:Ps(),height:Ds()}},e),ce.reset(),de.init(),mo.forEach((e=>e.lock()));const i=function Rn(e,i){const{mirror:a=new Hr,blockClass:u="rr-block",blockSelector:b=null,maskTextClass:w="rr-mask",maskTextSelector:S=null,inlineStylesheet:v=!0,inlineImages:k=!1,recordCanvas:C=!1,maskAllInputs:I=!1,maskTextFn:O,maskInputFn:x,slimDOM:_=!1,dataURLOptions:N,preserveWhiteSpace:D,onSerialize:A,onIframeLoad:F,iframeLoadTimeout:W,onStylesheetLoad:j,stylesheetLoadTimeout:V,keepIframeSrcFn:$=()=>!1}=i||{};return pe(e,{doc:e,mirror:a,blockClass:u,blockSelector:b,maskTextClass:w,maskTextSelector:S,skipChild:!1,inlineStylesheet:v,maskInputOptions:!0===I?{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===I?{password:!0}:I,maskTextFn:O,maskInputFn:x,slimDOMOptions:!0===_||"all"===_?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===_,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===_?{}:_,dataURLOptions:N,inlineImages:k,recordCanvas:C,preserveWhiteSpace:D,onSerialize:A,onIframeLoad:F,iframeLoadTimeout:W,onStylesheetLoad:j,stylesheetLoadTimeout:V,keepIframeSrcFn:$,newlyAddedElement:!1})}(document,{mirror:_o,blockClass:b,blockSelector:w,maskTextClass:k,maskTextSelector:C,inlineStylesheet:I,maskAllInputs:ne,maskTextFn:D,maskInputFn:N,slimDOM:oe,dataURLOptions:j,recordCanvas:G,inlineImages:K,onSerialize:e=>{Ws(e,_o)&&ue.addIframe(e),_s(e,_o)&&ce.trackLinkElement(e),Bt(e)&&de.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,i)=>{ue.attachIframe(e,i),de.observeAttachShadow(e)},onStylesheetLoad:(e,i)=>{ce.attachLinkElement(e,i)},keepIframeSrcFn:q});if(!i)return console.warn("Failed to snapshot the document");xo({type:so.FullSnapshot,data:{node:i,initialOffset:Ns(window)}},e),mo.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ce.adoptStyleSheets(document.adoptedStyleSheets,_o.getId(document))};try{const e=[],X=e=>{var i;return M(Bi)({mutationCb:Pe,mousemoveCb:(e,i)=>xo({type:so.IncrementalSnapshot,data:{source:i,positions:e}}),mouseInteractionCb:e=>xo({type:so.IncrementalSnapshot,data:{source:oo.MouseInteraction,...e}}),scrollCb:ir,viewportResizeCb:e=>xo({type:so.IncrementalSnapshot,data:{source:oo.ViewportResize,...e}}),inputCb:e=>xo({type:so.IncrementalSnapshot,data:{source:oo.Input,...e}}),mediaInteractionCb:e=>xo({type:so.IncrementalSnapshot,data:{source:oo.MediaInteraction,...e}}),styleSheetRuleCb:e=>xo({type:so.IncrementalSnapshot,data:{source:oo.StyleSheetRule,...e}}),styleDeclarationCb:e=>xo({type:so.IncrementalSnapshot,data:{source:oo.StyleDeclaration,...e}}),canvasMutationCb:ar,fontCb:e=>xo({type:so.IncrementalSnapshot,data:{source:oo.Font,...e}}),selectionCb:e=>{xo({type:so.IncrementalSnapshot,data:{source:oo.Selection,...e}})},customElementCb:e=>{xo({type:so.IncrementalSnapshot,data:{source:oo.CustomElement,...e}})},blockClass:b,ignoreClass:S,ignoreSelector:v,maskTextClass:k,maskTextSelector:C,maskInputOptions:ne,inlineStylesheet:I,sampling:W,recordDOM:$,recordCanvas:G,inlineImages:K,userTriggeredOnInput:B,collectFonts:Y,doc:e,maskInputFn:N,maskTextFn:D,keepIframeSrcFn:q,blockSelector:w,slimDOMOptions:oe,dataURLOptions:j,mirror:_o,iframeManager:ue,stylesheetManager:ce,shadowDomManager:de,processedNodeManager:he,canvasManager:Eo,ignoreCSSAttributes:Q,plugins:(null==(i=null==J?void 0:J.filter((e=>e.observer)))?void 0:i.map((e=>({observer:e.observer,options:e.options,callback:i=>xo({type:so.Plugin,data:{plugin:e.name,payload:i}})}))))||[]},A)};ue.addLoadListener((i=>{try{e.push(X(i.contentDocument))}catch(e){console.warn(e)}}));const x2=()=>{Ro(),e.push(X(document)),Lo=!0};return"interactive"===document.readyState||"complete"===document.readyState?x2():(e.push(U("DOMContentLoaded",(()=>{xo({type:so.DomContentLoaded,data:{}}),"DOMContentLoaded"===Z&&x2()}))),e.push(U("load",(()=>{xo({type:so.Load,data:{}}),"load"===Z&&x2()}),window))),()=>{e.forEach((e=>e())),he.destroy(),Lo=!1,function Oi(){po=void 0}()}}catch(e){console.warn(e)}}yt.addCustomEvent=(e,i)=>{if(!Lo)throw new Error("please add custom event after start recording");xo({type:so.Custom,data:{tag:e,payload:i}})},yt.freezePage=()=>{mo.forEach((e=>e.freeze()))},yt.takeFullSnapshot=e=>{if(!Lo)throw new Error("please take full snapshot after start recording");Ro(e)},yt.mirror=_o;function maskInputFn(e,i){var a;if("hidden"===i.type)return"";const u={creditCard:/\b(?:\d[ -]*?){13,16}\b/,ssn:/\b\d{3}-\d{2}-\d{4}\b/};return i.closest(".mask")?"*".repeat(e.length):i.hasAttribute("data-cc")||(null==(a=i.getAttribute("autocomplete"))?void 0:a.startsWith("cc-"))||u.creditCard.test(e)?"**** **** **** "+e.slice(-4):i.hasAttribute("data-ssn")||u.ssn.test(e)?"***-**-"+e.slice(-4):i.hasAttribute("data-dob")?"**/**/"+e.slice(-4):e}async function initializeRecording(e,i,a,u,b){const w=initializeWebSocket(a,u,b);try{yt({emit(e){cacheEvents(e)},plugins:[_$1(i)],maskInputOptions:{text:!0},maskInputFn:maskInputFn,maskTextClass:"sailfishSanitize",...e}),setInterval((()=>sendRecordingEvents(w)),1e4)}catch(e){console.error("Error importing plugins!",e)}return w}let No=null,Do=null;function identify(e,i={},a=!1){const u={type:"identify",userId:e,traits:i};No&&No.userId===e&&JSON.stringify(No.traits)===JSON.stringify(i)||(No={userId:e,traits:i,overwrite:a},sendMessage(u))}function addOrUpdateMetadata(e){const i={type:"addOrUpdateMetadata",metadata:e};Do&&JSON.stringify(Do)===JSON.stringify(e)||(Do=e,sendMessage(i))}const Po=["t.co","*.twitter.com","*.gravatar.com","*.googleapis.com","*.amazonaws.com","*.smooch.io","*.zendesk.com"],Ao={recordCanvas:!1,recordCrossOriginIframes:!1,collectFonts:!1,inlineImages:!1,recordPassword:!1,recordRealName:!0,recordCreditCardInfo:!1,recordSsn:!1,recordDob:!1,sampling:{}},Fo={level:["info","log","warn","error"],lengthThreshold:1e4,stringifyOptions:{stringLengthLimit:1e3,numOfKeysLimit:20,depthOfLimit:1},logger:"console"};function trackDomainChanges(){let e=window.location.href;const checkDomainChange=(i=!1)=>{const a=window.location.href;if(i||a!==e){console.log(`Domain changed from ${e} to ${a}`),e=a;sendMessage({type:"routeChange",data:{url:a,timestamp:Date.now()}})}},i=function debounce(e,i){let a;return function(...u){clearTimeout(a),a=setTimeout((()=>e(...u)),i)}}((()=>checkDomainChange()),500);checkDomainChange(!0),setInterval(i,1e3)}function getOrSetSessionId(e=!1){let i=sessionStorage.getItem("sailfishSessionId");return i&&!e||(!function getTabKey(){let e=sessionStorage.getItem("sailfishTabKey");return e||(e=v4(),sessionStorage.setItem("sailfishTabKey",e)),e}(),i=v4(),sessionStorage.setItem("sailfishSessionId",i)),i}function matchUrlWithWildcard(e,i){if(!e||"string"!=typeof e)throw new Error("Invalid URL input");const a=(e.match(/^[a-zA-Z]+:\/\//)?e:`http://${e}`).replace(/^[a-zA-Z]+:\/\//,""),u=new URL("http://"+a),{hostname:b,pathname:w,port:S}=u,v=b.startsWith("www.")?b.slice(4).toLowerCase():b.toLowerCase();return i.some((e=>{const i=e.replace(/^[a-zA-Z]+:\/\//,"");let[a,u]=i.split("/",2),b="";a.includes(":")&&([a,b]=a.split(":"));const k=a.replace(/\./g,"\\.").replace(/\*/g,".*"),C=new RegExp(`^${k}$`,"i"),I=v.startsWith("www.")?v.slice(4):v;if(b&&S!==b)return!1;if(a.startsWith("*.")&&(v===a.slice(2)||I===a.slice(2))){if(u){const e=u.replace(/\*/g,".*").replace(/\/$/,"");return new RegExp(`^/${e}`,"i").test(w)}return!0}if(!C.test(I)&&!C.test(v))return!1;if(u){const e=u.replace(/\*/g,".*").replace(/\/$/,"");return new RegExp(`^/${e}`,"i").test(w)}return!0}))}async function startRecording({apiKey:e,backendApi:i="https://api-service.sailfishqa.com",domainsToPropagateHeaderTo:a=[],domainsToNotPropagateHeaderTo:u=[],serviceVersion:b=""}){var w,S;let v=getOrSetSessionId();!function storeCredentialsAndConnection({apiKey:e,backendApi:i}){sessionStorage.setItem("sailfishApiKey",e),sessionStorage.setItem("sailfishBackendApi",i)}({apiKey:e,backendApi:i}),trackDomainChanges(),u.length>0&&sendDomainsToNotPropagateHeaderTo(e,u,i).catch((e=>console.error("Failed to send domains to not propagate header to:",e))),function setupXMLHttpRequestInterceptor(e,i=[]){const a=XMLHttpRequest.prototype.open,u=XMLHttpRequest.prototype.send,b=getOrSetSessionId(),w=[...Po,...e];XMLHttpRequest.prototype.open=function(e,i,...u){return this._requestUrl="string"==typeof i&&i.length>0?i:null,a.apply(this,[e,i,...u])},XMLHttpRequest.prototype.send=function(...e){const a=this._requestUrl;if(!a)return u.apply(this,e);if(matchUrlWithWildcard(a,w))return u.apply(this,e);const S=0===i.length||matchUrlWithWildcard(a,i);if(b&&S)try{this.setRequestHeader("X-Sf3-Rid",b)}catch(e){console.warn(`Could not set X-Sf3-Rid header for ${a}`,e)}return u.apply(this,e)}}(u,a),function setupFetchInterceptor(e,i=[]){const a=window.fetch,u=getOrSetSessionId(),b=[...Po,...e],w=new Map;function injectHeader(e,i,a,u,b,w){if(w){if(u instanceof Request){const a=u.clone(),S=new Headers(a.headers);S.set("X-Sf3-Rid",w);const v=new Request(a,{headers:S});return e.call(i,v,b)}{const a={...b},S=new Headers(b.headers||{});return S.set("X-Sf3-Rid",w),a.headers=S,e.call(i,u,a)}}return e.apply(i,a)}window.fetch=new Proxy(a,{apply:(e,a,S)=>{let v,k=S[0],C=S[1]||{};if("string"==typeof k)v=k;else if(k instanceof Request)v=k.url;else{if(!(k instanceof URL))return e.apply(a,S);v=k.href}if(w.has(v)){const i=w.get(v);if("ignore"===i)return e.apply(a,S);if("propagate"===i)return injectHeader(e,a,S,k,C,u)}return matchUrlWithWildcard(v,b)?(w.set(v,"ignore"),e.apply(a,S)):0===i.length||matchUrlWithWildcard(v,i)?(w.set(v,"propagate"),injectHeader(e,a,S,k,C,u)):(w.set(v,"ignore"),e.apply(a,S))}})}(u,a),async function gatherAndCacheDeviceInfo(){sendMessage({type:"deviceInfo",data:{deviceInfo:{language:navigator.language,userAgent:navigator.userAgent}}})}();try{const a=(null==(w=(await fetchCaptureSettings(e,i)).data)?void 0:w.captureSettingsFromApiKey)||Ao,u=await startRecordingSession(e,v,i);if(null==(S=u.data)?void 0:S.startRecordingSession){const u=await initializeRecording(a,Fo,i,e,v);!function sendMapUuidIfAvailable(e){window.sfMapUuid&&sendMessage({type:"mapUuid",data:{mapUuid:window.sfMapUuid,serviceVersion:e}})}(b),setInterval((()=>{u&&u.readyState===WebSocket.OPEN&&sendRecordingEvents(u)}),1e4)}else console.error("Failed to start recording session:",u.errors||u)}catch(e){console.error("Error starting recording:",e)}}!function sendUserDeviceUuid(){sendMessage({type:"userDeviceUuid",userDeviceUuid:function getOrSetUserDeviceUuid(){let e=localStorage.getItem("sailfishUserDeviceUuid");e||(e=v4(),localStorage.setItem("sailfishUserDeviceUuid",e));return e}()})}(),function sendTimeZone(){sendMessage({type:"timeZone",timezone:Intl.DateTimeFormat().resolvedOptions().timeZone})}(),document.addEventListener("visibilitychange",(function handleVisibilityChange(){"visible"===document.visibilityState&&getOrSetSessionId()})),window.addEventListener("beforeunload",(function storeSessionId(){}));export{Ao as DEFAULT_CAPTURE_SETTINGS,Fo as DEFAULT_CONSOLE_RECORDING_SETTINGS,addOrUpdateMetadata,cacheEvents,fetchCaptureSettings,identify,initializeRecording,initializeWebSocket,matchUrlWithWildcard,sendDomainsToNotPropagateHeaderTo,sendGraphQLRequest,sendMessage,sendRecordingEvents,startRecording,startRecordingSession};
1
+ for(var e,i=[],a=0;a<256;++a)i.push((a+256).toString(16).slice(1));var u=new Uint8Array(16);function rng(){if(!e&&!(e="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return e(u)}var b={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function v4(e,a,u){if(b.randomUUID&&!e)return b.randomUUID();var w=(e=e||{}).random||(e.rng||rng)();return w[6]=15&w[6]|64,w[8]=63&w[8]|128,function unsafeStringify(e,a=0){return(i[e[a+0]]+i[e[a+1]]+i[e[a+2]]+i[e[a+3]]+"-"+i[e[a+4]]+i[e[a+5]]+"-"+i[e[a+6]]+i[e[a+7]]+"-"+i[e[a+8]]+i[e[a+9]]+"-"+i[e[a+10]]+i[e[a+11]]+i[e[a+12]]+i[e[a+13]]+i[e[a+14]]+i[e[a+15]]).toLowerCase()}(w)}var extendStatics=function(e,i){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var a in i)i.hasOwnProperty(a)&&(e[a]=i[a])})(e,i)};function __extends(e,i){function __(){this.constructor=e}extendStatics(e,i),e.prototype=null===i?Object.create(i):(__.prototype=i.prototype,new __)}function __read(e,i){var a="function"==typeof Symbol&&e[Symbol.iterator];if(!a)return e;var u,b,w=a.call(e),S=[];try{for(;(void 0===i||i-- >0)&&!(u=w.next()).done;)S.push(u.value)}catch(e){b={error:e}}finally{try{u&&!u.done&&(a=w.return)&&a.call(w)}finally{if(b)throw b.error}}return S}var w=function(){return function Event2(e,i){this.target=i,this.type=e}}(),S=function(e){function ErrorEvent2(i,a){var u=e.call(this,"error",a)||this;return u.message=i.message,u.error=i,u}return __extends(ErrorEvent2,e),ErrorEvent2}(w),v=function(e){function CloseEvent2(i,a,u){void 0===i&&(i=1e3),void 0===a&&(a="");var b=e.call(this,"close",u)||this;return b.wasClean=!0,b.code=i,b.reason=a,b}return __extends(CloseEvent2,e),CloseEvent2}(w),k={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+4e3*Math.random(),minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1},C=function(){function ReconnectingWebSocket2(e,i,a){var u=this;void 0===a&&(a={}),this._listeners={error:[],message:[],open:[],close:[]},this._retryCount=-1,this._shouldReconnect=!0,this._connectLock=!1,this._binaryType="blob",this._closeCalled=!1,this._messageQueue=[],this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this._handleOpen=function(e){u._debug("open event");var i=u._options.minUptime,a=void 0===i?k.minUptime:i;clearTimeout(u._connectTimeout),u._uptimeTimeout=setTimeout((function(){return u._acceptOpen()}),a),u._ws.binaryType=u._binaryType,u._messageQueue.forEach((function(e){return u._ws.send(e)})),u._messageQueue=[],u.onopen&&u.onopen(e),u._listeners.open.forEach((function(i){return u._callEventListener(e,i)}))},this._handleMessage=function(e){u._debug("message event"),u.onmessage&&u.onmessage(e),u._listeners.message.forEach((function(i){return u._callEventListener(e,i)}))},this._handleError=function(e){u._debug("error event",e.message),u._disconnect(void 0,"TIMEOUT"===e.message?"timeout":void 0),u.onerror&&u.onerror(e),u._debug("exec error listeners"),u._listeners.error.forEach((function(i){return u._callEventListener(e,i)})),u._connect()},this._handleClose=function(e){u._debug("close event"),u._clearTimeouts(),u._shouldReconnect&&u._connect(),u.onclose&&u.onclose(e),u._listeners.close.forEach((function(i){return u._callEventListener(e,i)}))},this._url=e,this._protocols=i,this._options=a,this._options.startClosed&&(this._shouldReconnect=!1),this._connect()}return Object.defineProperty(ReconnectingWebSocket2,"CONNECTING",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(ReconnectingWebSocket2,"OPEN",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(ReconnectingWebSocket2,"CLOSING",{get:function(){return 2},enumerable:!0,configurable:!0}),Object.defineProperty(ReconnectingWebSocket2,"CLOSED",{get:function(){return 3},enumerable:!0,configurable:!0}),Object.defineProperty(ReconnectingWebSocket2.prototype,"CONNECTING",{get:function(){return ReconnectingWebSocket2.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(ReconnectingWebSocket2.prototype,"OPEN",{get:function(){return ReconnectingWebSocket2.OPEN},enumerable:!0,configurable:!0}),Object.defineProperty(ReconnectingWebSocket2.prototype,"CLOSING",{get:function(){return ReconnectingWebSocket2.CLOSING},enumerable:!0,configurable:!0}),Object.defineProperty(ReconnectingWebSocket2.prototype,"CLOSED",{get:function(){return ReconnectingWebSocket2.CLOSED},enumerable:!0,configurable:!0}),Object.defineProperty(ReconnectingWebSocket2.prototype,"binaryType",{get:function(){return this._ws?this._ws.binaryType:this._binaryType},set:function(e){this._binaryType=e,this._ws&&(this._ws.binaryType=e)},enumerable:!0,configurable:!0}),Object.defineProperty(ReconnectingWebSocket2.prototype,"retryCount",{get:function(){return Math.max(this._retryCount,0)},enumerable:!0,configurable:!0}),Object.defineProperty(ReconnectingWebSocket2.prototype,"bufferedAmount",{get:function(){return this._messageQueue.reduce((function(e,i){return"string"==typeof i?e+=i.length:i instanceof Blob?e+=i.size:e+=i.byteLength,e}),0)+(this._ws?this._ws.bufferedAmount:0)},enumerable:!0,configurable:!0}),Object.defineProperty(ReconnectingWebSocket2.prototype,"extensions",{get:function(){return this._ws?this._ws.extensions:""},enumerable:!0,configurable:!0}),Object.defineProperty(ReconnectingWebSocket2.prototype,"protocol",{get:function(){return this._ws?this._ws.protocol:""},enumerable:!0,configurable:!0}),Object.defineProperty(ReconnectingWebSocket2.prototype,"readyState",{get:function(){return this._ws?this._ws.readyState:this._options.startClosed?ReconnectingWebSocket2.CLOSED:ReconnectingWebSocket2.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(ReconnectingWebSocket2.prototype,"url",{get:function(){return this._ws?this._ws.url:""},enumerable:!0,configurable:!0}),ReconnectingWebSocket2.prototype.close=function(e,i){void 0===e&&(e=1e3),this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),this._ws?this._ws.readyState!==this.CLOSED?this._ws.close(e,i):this._debug("close: already closed"):this._debug("close enqueued: no ws instance")},ReconnectingWebSocket2.prototype.reconnect=function(e,i){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,this._ws&&this._ws.readyState!==this.CLOSED?(this._disconnect(e,i),this._connect()):this._connect()},ReconnectingWebSocket2.prototype.send=function(e){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",e),this._ws.send(e);else{var i=this._options.maxEnqueuedMessages,a=void 0===i?k.maxEnqueuedMessages:i;this._messageQueue.length<a&&(this._debug("enqueue",e),this._messageQueue.push(e))}},ReconnectingWebSocket2.prototype.addEventListener=function(e,i){this._listeners[e]&&this._listeners[e].push(i)},ReconnectingWebSocket2.prototype.dispatchEvent=function(e){var i,a,u=this._listeners[e.type];if(u)try{for(var b=function __values(e){var i="function"==typeof Symbol&&e[Symbol.iterator],a=0;return i?i.call(e):{next:function(){return e&&a>=e.length&&(e=void 0),{value:e&&e[a++],done:!e}}}}(u),w=b.next();!w.done;w=b.next()){var S=w.value;this._callEventListener(e,S)}}catch(e){i={error:e}}finally{try{w&&!w.done&&(a=b.return)&&a.call(b)}finally{if(i)throw i.error}}return!0},ReconnectingWebSocket2.prototype.removeEventListener=function(e,i){this._listeners[e]&&(this._listeners[e]=this._listeners[e].filter((function(e){return e!==i})))},ReconnectingWebSocket2.prototype._debug=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];this._options.debug&&console.log.apply(console,function __spread(){for(var e=[],i=0;i<arguments.length;i++)e=e.concat(__read(arguments[i]));return e}(["RWS>"],e))},ReconnectingWebSocket2.prototype._getNextDelay=function(){var e=this._options,i=e.reconnectionDelayGrowFactor,a=void 0===i?k.reconnectionDelayGrowFactor:i,u=e.minReconnectionDelay,b=void 0===u?k.minReconnectionDelay:u,w=e.maxReconnectionDelay,S=void 0===w?k.maxReconnectionDelay:w,v=0;return this._retryCount>0&&(v=b*Math.pow(a,this._retryCount-1))>S&&(v=S),this._debug("next delay",v),v},ReconnectingWebSocket2.prototype._wait=function(){var e=this;return new Promise((function(i){setTimeout(i,e._getNextDelay())}))},ReconnectingWebSocket2.prototype._getNextUrl=function(e){if("string"==typeof e)return Promise.resolve(e);if("function"==typeof e){var i=e();if("string"==typeof i)return Promise.resolve(i);if(i.then)return i}throw Error("Invalid URL")},ReconnectingWebSocket2.prototype._connect=function(){var e=this;if(!this._connectLock&&this._shouldReconnect){this._connectLock=!0;var i=this._options,a=i.maxRetries,u=void 0===a?k.maxRetries:a,b=i.connectionTimeout,w=void 0===b?k.connectionTimeout:b,S=i.WebSocket,v=void 0===S?function(){if("undefined"!=typeof WebSocket)return WebSocket}():S;if(this._retryCount>=u)this._debug("max retries reached",this._retryCount,">=",u);else{if(this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),void 0===(C=v)||!C||2!==C.CLOSING)throw Error("No valid WebSocket class provided");var C;this._wait().then((function(){return e._getNextUrl(e._url)})).then((function(i){e._closeCalled||(e._debug("connect",{url:i,protocols:e._protocols}),e._ws=e._protocols?new v(i,e._protocols):new v(i),e._ws.binaryType=e._binaryType,e._connectLock=!1,e._addListeners(),e._connectTimeout=setTimeout((function(){return e._handleTimeout()}),w))}))}}},ReconnectingWebSocket2.prototype._handleTimeout=function(){this._debug("timeout event"),this._handleError(new S(Error("TIMEOUT"),this))},ReconnectingWebSocket2.prototype._disconnect=function(e,i){if(void 0===e&&(e=1e3),this._clearTimeouts(),this._ws){this._removeListeners();try{this._ws.close(e,i),this._handleClose(new v(e,i,this))}catch(e){}}},ReconnectingWebSocket2.prototype._acceptOpen=function(){this._debug("accept open"),this._retryCount=0},ReconnectingWebSocket2.prototype._callEventListener=function(e,i){"handleEvent"in i?i.handleEvent(e):i(e)},ReconnectingWebSocket2.prototype._removeListeners=function(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))},ReconnectingWebSocket2.prototype._addListeners=function(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))},ReconnectingWebSocket2.prototype._clearTimeouts=function(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)},ReconnectingWebSocket2}();let I=null;const O=[];function initializeWebSocket(e,i,a){const u=function getWebSocketHost(e){const i=document.createElement("a");return i.href=e,`${i.hostname}${i.port?`:${i.port}`:""}`}(e),b=new URL(e).protocol;return I=new C(`${"https:"===b?"wss":"ws"}://${u}/ws/notify/?apiKey=${i}&sessionId=${a}&sender=JS%2FTS&version=1.5.7`,[],{connectionTimeout:3e4}),I.addEventListener("open",(()=>{!function flushMessageQueue(){if(I&&I.readyState===WebSocket.OPEN)for(;O.length>0;){const e=O.shift();e&&I.send(e)}}()})),I.addEventListener("close",(()=>{I=null})),I}function sendMessage(e){const i=JSON.stringify(e);I&&I.readyState===WebSocket.OPEN?I.send(i):O.push(i)}let x=[];function cacheEvents(e){x.push(e)}function sendRecordingEvents(e){if(e&&e.readyState===WebSocket.OPEN){if(x.length>0){const i={type:"events",events:x};e.send(JSON.stringify(i)),x=[]}}else x.push(...x)}function sendGraphQLRequest(e,i,a,u=5,b=2e3,w=2){const S=`${a.backendApi}/graphql/?apiKey=${a.apiKey}`;return function exponentialBackoff(e,i,a=5,u=2e3,b=2){let w=0;const attemptRequest=async()=>{try{return await e()}catch(e){if(w++,w>a)throw e;const i=u*Math.pow(b,w-1);return await new Promise((e=>setTimeout(e,i))),attemptRequest()}};return attemptRequest()}((()=>fetch(S,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operationName:e,query:i,variables:a})}).then((e=>{if(!e.ok)throw new Error(`GraphQL request failed with status ${e.status}`);return e.json()}))),0,u,b,w)}function fetchCaptureSettings(e,i){return sendGraphQLRequest("GetCaptureSettingsFromApiKey","\n query GetCaptureSettingsFromApiKey($apiKey: String!) {\n captureSettingsFromApiKey(apiKey: $apiKey) {\n recordCanvas\n recordCrossOriginIframes\n collectFonts\n inlineImages\n recordPassword\n recordRealName\n recordCreditCardInfo\n recordSsn\n recordDob\n sampling\n }\n }\n ",{apiKey:e,backendApi:i})}function startRecordingSession(e,i,a){return sendGraphQLRequest("StartSession","mutation StartSession($apiKey: UUID!, $recordingSessionId: UUID!) {\n startRecordingSession(companyApiKey: $apiKey, sessionId: $recordingSessionId) {\n id\n }\n }",{apiKey:e,recordingSessionId:i,backendApi:a})}function sendDomainsToNotPropagateHeaderTo(e,i,a){return sendGraphQLRequest("DomainsToNotPassHeaderTo","mutation DomainsToNotPassHeaderTo($apiKey: String!, $domains: [String!]!) {\n domainsToNotPassHeaderTo(apiKey: $apiKey, domains: $domains)\n }",{apiKey:e,domains:i,backendApi:a})}var _=Object.defineProperty,y$1=(e,i,a)=>((e,i,a)=>i in e?_(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a)(e,"symbol"!=typeof i?i+"":i,a);class d{constructor(e){y$1(this,"fileName"),y$1(this,"functionName"),y$1(this,"lineNumber"),y$1(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){const e=this.lineNumber||"",i=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${e}:${i})`:`${this.fileName}:${e}:${i}`}}const N=/(^|@)\S+:\d+/,D=/^\s*at .*(\S+:\d+|\(native\))/m,A=/^(eval@)?(\[native code])?$/,F={parse:function(e){return e?typeof e.stacktrace<"u"||typeof e["opera#sourceloc"]<"u"?this.parseOpera(e):e.stack&&e.stack.match(D)?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 i=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!i)throw new Error(`Cannot parse given url: ${e}`);return[i[1],i[2]||void 0,i[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(D)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let i=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const a=i.match(/ (\((.+):(\d+):(\d+)\)$)/);i=a?i.replace(a[0],""):i;const u=i.split(/\s+/).slice(1),b=this.extractLocation(a?a[1]:u.pop()),w=u.join(" ")||void 0,S=["eval","<anonymous>"].indexOf(b[0])>-1?void 0:b[0];return new d({functionName:w,fileName:S,lineNumber:b[1],columnNumber:b[2]})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(e){return!e.match(A)}),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 d({functionName:e});{const i=/((.*".+"[^@]*)?[^@]*)(?:@)/,a=e.match(i),u=a&&a[1]?a[1]:void 0,b=this.extractLocation(e.replace(i,""));return new d({functionName:u,fileName:b[0],lineNumber:b[1],columnNumber:b[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 i=/Line (\d+).*script (?:in )?(\S+)/i,a=e.message.split("\n"),u=[];for(let e=2,b=a.length;e<b;e+=2){const b=i.exec(a[e]);b&&u.push(new d({fileName:b[2],lineNumber:parseFloat(b[1])}))}return u},parseOpera10:function(e){const i=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,a=e.stacktrace.split("\n"),u=[];for(let e=0,b=a.length;e<b;e+=2){const b=i.exec(a[e]);b&&u.push(new d({functionName:b[3]||void 0,fileName:b[2],lineNumber:parseFloat(b[1])}))}return u},parseOpera11:function(e){return e.stack.split("\n").filter((function(e){return!!e.match(N)&&!e.match(/^Error created at/)}),this).map((function(e){const i=e.split("@"),a=this.extractLocation(i.pop()),u=(i.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new d({functionName:u,fileName:a[0],lineNumber:a[1],columnNumber:a[2]})}),this)}};function T(e){if(!e||!e.outerHTML)return"";let i="";for(;e.parentElement;){let a=e.localName;if(!a)break;a=a.toLowerCase();const u=e.parentElement,b=[];if(u.children&&u.children.length>0)for(let e=0;e<u.children.length;e++){const i=u.children[e];i.localName&&i.localName.toLowerCase&&i.localName.toLowerCase()===a&&b.push(i)}b.length>1&&(a+=`:eq(${b.indexOf(e)})`),i=a+(i?">"+i:""),e=u}return i}function L$1(e){return"[object Object]"===Object.prototype.toString.call(e)}function k$1(e,i){if(0===i)return!0;const a=Object.keys(e);for(const u of a)if(L$1(e[u])&&k$1(e[u],i-1))return!0;return!1}function g(e,i){const a={numOfKeysLimit:50,depthOfLimit:4};Object.assign(a,i);const u=[],b=[];return JSON.stringify(e,(function(e,i){if(u.length>0){const a=u.indexOf(this);~a?u.splice(a+1):u.push(this),~a?b.splice(a,1/0,e):b.push(e),~u.indexOf(i)&&(i=u[0]===i?"[Circular ~]":"[Circular ~."+b.slice(0,u.indexOf(i)).join(".")+"]")}else u.push(i);if(null===i)return i;if(void 0===i)return"undefined";if(function c(e){return!!(L$1(e)&&Object.keys(e).length>a.numOfKeysLimit||"function"==typeof e||L$1(e)&&k$1(e,a.depthOfLimit))}(i))return function o(e){let i=e.toString();return a.stringLengthLimit&&i.length>a.stringLengthLimit&&(i=`${i.slice(0,a.stringLengthLimit)}...`),i}(i);if("bigint"==typeof i)return i.toString()+"n";if(i instanceof Event){const e={};for(const a in i){const u=i[a];Array.isArray(u)?e[a]=T(u.length?u[0]:null):e[a]=u}return e}return i instanceof Node?i instanceof HTMLElement?i?i.outerHTML:"":i.nodeName:i instanceof Error?i.stack?i.stack+"\nEnd of stack for Error object":i.name+": "+i.message:i}))}const W={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 R$1(e,i,a){const u=a?Object.assign({},W,a):W,b=u.logger;if(!b)return()=>{};let w;w="string"==typeof b?i[b]:b;let S=0,v=!1;const k=[];if(u.level.includes("error")){const l=i=>{const a=i.message,b=i.error,w=F.parse(b).map((e=>e.toString())),S=[g(a,u.stringifyOptions)];e({level:"error",trace:w,payload:S})};i.addEventListener("error",l),k.push((()=>{i.removeEventListener("error",l)}));const f=i=>{let a,b;i.reason instanceof Error?(a=i.reason,b=[g(`Uncaught (in promise) ${a.name}: ${a.message}`,u.stringifyOptions)]):(a=new Error,b=[g("Uncaught (in promise)",u.stringifyOptions),g(i.reason,u.stringifyOptions)]);const w=F.parse(a).map((e=>e.toString()));e({level:"error",trace:w,payload:b})};i.addEventListener("unhandledrejection",f),k.push((()=>{i.removeEventListener("unhandledrejection",f)}))}for(const e of u.level)k.push(p(w,e));return()=>{k.forEach((e=>e()))};function p(i,a){return i[a]?function P(e,i,a){try{if(!(i in e))return()=>{};const u=e[i],b=a(u);return"function"==typeof b&&(b.prototype=b.prototype||{},Object.defineProperties(b,{__rrweb_original__:{enumerable:!1,value:u}})),e[i]=b,()=>{e[i]=u}}catch{return()=>{}}}(i,a,(i=>(...b)=>{if(i.apply(this,b),!("assert"===a&&b[0]||v)){v=!0;try{const i=F.parse(new Error).map((e=>e.toString())).splice(1),w=("assert"===a?b.slice(1):b).map((e=>g(e,u.stringifyOptions)));S++,S<u.lengthThreshold?e({level:a,trace:i,payload:w}):S===u.lengthThreshold&&e({level:"warn",trace:[],payload:[g("The number of log records reached the threshold.")]})}catch(e){i("@sailfish-rrweb/rrweb logger error:",e,...b)}finally{v=!1}}})):()=>{}}}const _$1=e=>({name:"@sailfish-rrweb/rrweb/console@1",observer:R$1,options:e});var j=Object.defineProperty,y=(e,i,a)=>((e,i,a)=>i in e?j(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a)(e,"symbol"!=typeof i?i+"":i,a),V=Object.defineProperty,lr=(e,i,a)=>((e,i,a)=>i in e?V(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a)(e,"symbol"!=typeof i?i+"":i,a),$=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))($||{});function Vr(e){return e.nodeType===e.ELEMENT_NODE}function Ie(e){const i=null==e?void 0:e.host;return(null==i?void 0:i.shadowRoot)===e}function ve(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Qe(e){try{const i=e.rules||e.cssRules;return i?function en(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}(Array.from(i,jr).join("")):null}catch{return null}}function jr(e){let i;if(function sn(e){return"styleSheet"in e}(e))try{i=Qe(e.styleSheet)||function tn(e){const{cssText:i}=e;if(i.split('"').length<3)return i;const a=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?a.push("layer"):e.layerName&&a.push(`layer(${e.layerName})`),e.supportsText&&a.push(`supports(${e.supportsText})`),e.media.length&&a.push(e.media.mediaText),a.join(" ")+";"}(e)}catch{}else if(function nn(e){return"selectorText"in e}(e)&&e.selectorText.includes(":"))return function rn(e){const i=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(i,"$1\\$2")}(e.cssText);return i||e.cssText}class Hr{constructor(){lr(this,"idNodeMap",new Map),lr(this,"nodeMetaMap",new WeakMap)}getId(e){var i;return e?(null==(i=this.getMeta(e))?void 0:i.id)??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const i=this.getId(e);this.idNodeMap.delete(i),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,i){const a=i.id;this.idNodeMap.set(a,e),this.nodeMetaMap.set(e,i)}replace(e,i){const a=this.getNode(e);if(a){const e=this.nodeMetaMap.get(a);e&&this.nodeMetaMap.set(i,e)}this.idNodeMap.set(e,i)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Zt({element:e,maskInputOptions:i,tagName:a,type:u,value:b,maskInputFn:w}){let S=b||"",v="";const k=u&&ae(u);let C=!1;return(i[a.toLowerCase()]||k&&i[k])&&(v=w?w(S,e):"*".repeat(S.length),C=S!==v),{value:v,masked:C}}function ae(e){return e.toLowerCase()}const G="__rrweb_original__";function Yt(e){const i=e.type;return e.hasAttribute("data-rr-is-password")?"password":i?ae(i):null}function Br(e,i){let a;try{a=new URL(e,i??window.location.href)}catch{return null}const u=a.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==u?void 0:u[1])??null}let H=1;const Z=new RegExp("[^a-z0-9-_:]");function Gr(){return H++}let B,Y;const K=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,J=/^(?:[a-z+]+:)?\/\//i,q=/^www\..*/i,Q=/^(data:)([^,]*),(.*)/i;function qe(e,i){return(e||"").replace(K,((e,a,u,b,w,S)=>{const v=u||w||S,k=a||b||"";if(!v)return e;if(J.test(v)||q.test(v))return`url(${k}${v}${k})`;if(Q.test(v))return`url(${k}${v}${k})`;if("/"===v[0])return`url(${k}${function hn(e){let i="";return i=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],i=i.split("?")[0],i}(i)+v}${k})`;const C=i.split("/"),I=v.split("/");C.pop();for(const e of I)"."!==e&&(".."===e?C.pop():C.push(e));return`url(${k}${C.join("/")}${k})`}))}const ee=/^[^ \t\n\r\u000c]+/,te=/^[, \t\n\r\u000c]+/;const re=new WeakMap;function et(e,i){return i&&""!==i.trim()?ct(e,i):i}function bn(e){return!("svg"!==e.tagName&&!e.ownerSVGElement)}function ct(e,i){let a=re.get(e);if(a||(a=e.createElement("a"),re.set(e,a)),i){if(i.startsWith("blob:")||i.startsWith("data:"))return i}else i="";return a.setAttribute("href",i),a.href}function Zr(e,i,a,u){return u&&("src"===a||"href"===a&&("use"!==i||"#"!==u[0])||"xlink:href"===a&&"#"!==u[0]||"background"===a&&("table"===i||"td"===i||"th"===i)?et(e,u):"srcset"===a?function Sn(e,i){if(""===i.trim())return i;let a=0;function s(e){let u;const b=e.exec(i.substring(a));return b?(u=b[0],a+=u.length,u):""}const u=[];for(;s(te),!(a>=i.length);){let b=s(ee);if(","===b.slice(-1))b=et(e,b.substring(0,b.length-1)),u.push(b);else{let w="";b=et(e,b);let S=!1;for(;;){const e=i.charAt(a);if(""===e){u.push((b+w).trim());break}if(S)")"===e&&(S=!1);else{if(","===e){a+=1,u.push((b+w).trim());break}"("===e&&(S=!0)}w+=e,a+=1}}}return u.join(", ")}(e,u):"style"===a?qe(u,ct(e)):"object"===i&&"data"===a?et(e,u):u)}function Yr(e,i,a){return("video"===e||"audio"===e)&&"autoplay"===i}function tt(e,i,a){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!a&&tt(e.parentNode,i,a);for(let a=e.classList.length;a--;){const u=e.classList[a];if(i.test(u))return!0}return!!a&&tt(e.parentNode,i,a)}function Xr(e,i,a,u){let b;if(Vr(e)){if(b=e,!b.childNodes.length)return!1}else{if(null===e.parentElement)return!1;b=e.parentElement}try{if("string"==typeof i){if(u){if(b.closest(`.${i}`))return!0}else if(b.classList.contains(i))return!0}else if(tt(b,i,u))return!0;if(a)if(u){if(b.closest(a))return!0}else if(b.matches(a))return!0}catch{}return!1}function vn(e,i){const{doc:a,mirror:u,blockClass:b,blockSelector:w,needsMask:S,inlineStylesheet:v,maskInputOptions:k={},maskTextFn:C,maskInputFn:I,dataURLOptions:O={},inlineImages:x,recordCanvas:_,keepIframeSrcFn:N,newlyAddedElement:D=!1}=i,A=function Mn(e,i){if(!i.hasNode(e))return;const a=i.getId(e);return 1===a?void 0:a}(a,u);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:$.Document,childNodes:[],compatMode:e.compatMode}:{type:$.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:$.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:A};case e.ELEMENT_NODE:return function xn(e,i){const{doc:a,blockClass:u,blockSelector:b,inlineStylesheet:w,maskInputOptions:S={},maskInputFn:v,dataURLOptions:k={},inlineImages:C,recordCanvas:I,keepIframeSrcFn:O,newlyAddedElement:x=!1,rootId:_}=i,N=function wn(e,i,a){try{if("string"==typeof i){if(e.classList.contains(i))return!0}else for(let a=e.classList.length;a--;){const u=e.classList[a];if(i.test(u))return!0}if(a)return e.matches(a)}catch{}return!1}(e,u,b),D=function un(e){if(e instanceof HTMLFormElement)return"form";const i=ae(e.tagName);return Z.test(i)?"div":i}(e);let A={};const F=e.attributes.length;for(let i=0;i<F;i++){const u=e.attributes[i];Yr(D,u.name,u.value)||(A[u.name]=Zr(a,D,ae(u.name),u.value))}if("link"===D&&w){const i=Array.from(a.styleSheets).find((i=>i.href===e.href));let u=null;i&&(u=Qe(i)),u&&(delete A.rel,delete A.href,A._cssText=qe(u,i.href))}if("style"===D&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const i=Qe(e.sheet);i&&(A._cssText=qe(i,ct(a)))}if("input"===D||"textarea"===D||"select"===D){const i=e.value,a=e.checked;if("radio"!==A.type&&"checkbox"!==A.type&&"submit"!==A.type&&"button"!==A.type&&i){const a=Zt({element:e,type:Yt(e),tagName:D,value:i,maskInputOptions:S,maskInputFn:v});A.value=a.value,a.masked&&(A.masked=!0)}else a&&(A.checked=a)}if("option"===D&&(e.selected&&!S.select?A.selected=!0:delete A.selected),"canvas"===D&&I)if("2d"===e.__context)(function an(e){const i=e.getContext("2d");if(!i)return!0;for(let a=0;a<e.width;a+=50)for(let u=0;u<e.height;u+=50){const b=i.getImageData,w=G in b?b[G]:b;if(new Uint32Array(w.call(i,a,u,Math.min(50,e.width-a),Math.min(50,e.height-u)).data.buffer).some((e=>0!==e)))return!1}return!0})(e)||(A.rr_dataURL=e.toDataURL(k.type,k.quality));else if(!("__context"in e)){const i=e.toDataURL(k.type,k.quality),u=a.createElement("canvas");u.width=e.width,u.height=e.height;i!==u.toDataURL(k.type,k.quality)&&(A.rr_dataURL=i)}if("img"===D&&C){B||(B=a.createElement("canvas"),Y=B.getContext("2d"));const i=e,u=i.currentSrc||i.getAttribute("src")||"<unknown-src>",b=i.crossOrigin,P2=()=>{i.removeEventListener("load",P2);try{B.width=i.naturalWidth,B.height=i.naturalHeight,Y.drawImage(i,0,0),A.rr_dataURL=B.toDataURL(k.type,k.quality)}catch(e){if("anonymous"!==i.crossOrigin)return i.crossOrigin="anonymous",void(i.complete&&0!==i.naturalWidth?P2():i.addEventListener("load",P2));console.warn(`Cannot inline img src=${u}! Error: ${e}`)}"anonymous"===i.crossOrigin&&(b?A.crossOrigin=b:i.removeAttribute("crossorigin"))};i.complete&&0!==i.naturalWidth?P2():i.addEventListener("load",P2)}if("audio"===D||"video"===D){const i=A;i.rr_mediaState=e.paused?"paused":"played",i.rr_mediaCurrentTime=e.currentTime,i.rr_mediaPlaybackRate=e.playbackRate,i.rr_mediaMuted=e.muted,i.rr_mediaLoop=e.loop,i.rr_mediaVolume=e.volume}if(x||(e.scrollLeft&&(A.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(A.rr_scrollTop=e.scrollTop)),N){const{width:i,height:a}=e.getBoundingClientRect();A={class:A.class,rr_width:`${i}px`,rr_height:`${a}px`}}let W;"iframe"===D&&!O(A.src)&&(e.contentDocument||(A.rr_src=A.src),delete A.src);try{customElements.get(D)&&(W=!0)}catch{}return{type:$.Element,tagName:D,attributes:A,childNodes:[],isSVG:bn(e)||void 0,needBlock:N,rootId:_,isCustom:W}}(e,{doc:a,blockClass:b,blockSelector:w,inlineStylesheet:v,maskInputOptions:k,maskInputFn:I,dataURLOptions:O,inlineImages:x,recordCanvas:_,keepIframeSrcFn:N,newlyAddedElement:D,rootId:A});case e.TEXT_NODE:return function kn(e,i){var a;const{needsMask:u,maskTextFn:b,rootId:w}=i,S=e.parentNode&&e.parentNode.tagName;let v=e.textContent;const k="STYLE"===S||void 0,C="SCRIPT"===S||void 0;if(k&&v){try{e.nextSibling||e.previousSibling||null!=(a=e.parentNode.sheet)&&a.cssRules&&(v=Qe(e.parentNode.sheet))}catch(i){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${i}`,e)}v=qe(v,ct(i.doc))}return C&&(v="SCRIPT_PLACEHOLDER"),!k&&!C&&v&&u&&(v=b?b(v,e.parentElement):v.replace(/[\S]/g,"*")),{type:$.Text,textContent:v||"",isStyle:k,rootId:w}}(e,{doc:a,needsMask:S,maskTextFn:C,rootId:A});case e.CDATA_SECTION_NODE:return{type:$.CDATA,textContent:"",rootId:A};case e.COMMENT_NODE:return{type:$.Comment,textContent:e.textContent||"",rootId:A};default:return!1}}function L(e){return null==e?"":e.toLowerCase()}function pe(e,i){const{doc:a,mirror:u,blockClass:b,blockSelector:w,maskTextClass:S,maskTextSelector:v,skipChild:k=!1,inlineStylesheet:C=!0,maskInputOptions:I={},maskTextFn:O,maskInputFn:x,slimDOMOptions:_,dataURLOptions:N={},inlineImages:D=!1,recordCanvas:A=!1,onSerialize:F,onIframeLoad:W,iframeLoadTimeout:j=5e3,onStylesheetLoad:V,stylesheetLoadTimeout:G=5e3,keepIframeSrcFn:H=()=>!1,newlyAddedElement:Z=!1}=i;let{needsMask:B}=i,{preserveWhiteSpace:Y=!0}=i;B||(B=Xr(e,S,v,void 0===B));const K=vn(e,{doc:a,mirror:u,blockClass:b,blockSelector:w,needsMask:B,inlineStylesheet:C,maskInputOptions:I,maskTextFn:O,maskInputFn:x,dataURLOptions:N,inlineImages:D,recordCanvas:A,keepIframeSrcFn:H,newlyAddedElement:Z});if(!K)return console.warn(e,"not serialized"),null;let J;J=u.hasNode(e)?u.getId(e):function On(e,i){return!!(i.comment&&e.type===$.Comment||e.type===$.Element&&(i.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===Br(e.attributes.href))||i.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(L(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===L(e.attributes.name)||"icon"===L(e.attributes.rel)||"apple-touch-icon"===L(e.attributes.rel)||"shortcut icon"===L(e.attributes.rel)))||"meta"===e.tagName&&(i.headMetaDescKeywords&&L(e.attributes.name).match(/^description|keywords$/)||i.headMetaSocial&&(L(e.attributes.property).match(/^(og|twitter|fb):/)||L(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===L(e.attributes.name))||i.headMetaRobots&&("robots"===L(e.attributes.name)||"googlebot"===L(e.attributes.name)||"bingbot"===L(e.attributes.name))||i.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"]||i.headMetaAuthorship&&("author"===L(e.attributes.name)||"generator"===L(e.attributes.name)||"framework"===L(e.attributes.name)||"publisher"===L(e.attributes.name)||"progid"===L(e.attributes.name)||L(e.attributes.property).match(/^article:/)||L(e.attributes.property).match(/^product:/))||i.headMetaVerification&&("google-site-verification"===L(e.attributes.name)||"yandex-verification"===L(e.attributes.name)||"csrf-token"===L(e.attributes.name)||"p:domain_verify"===L(e.attributes.name)||"verify-v1"===L(e.attributes.name)||"verification"===L(e.attributes.name)||"shopify-checkout-api-token"===L(e.attributes.name)))))}(K,_)||!Y&&K.type===$.Text&&!K.isStyle&&!K.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Gr();const q=Object.assign(K,{id:J});if(u.add(e,q),-2===J)return null;F&&F(e);let Q=!k;if(q.type===$.Element){Q=Q&&!q.needBlock,delete q.needBlock;const i=e.shadowRoot;i&&ve(i)&&(q.isShadowHost=!0)}if((q.type===$.Document||q.type===$.Element)&&Q){_.headWhitespace&&q.type===$.Element&&"head"===q.tagName&&(Y=!1);const i={doc:a,mirror:u,blockClass:b,blockSelector:w,needsMask:B,maskTextClass:S,maskTextSelector:v,skipChild:k,inlineStylesheet:C,maskInputOptions:I,maskTextFn:O,maskInputFn:x,slimDOMOptions:_,dataURLOptions:N,inlineImages:D,recordCanvas:A,preserveWhiteSpace:Y,onSerialize:F,onIframeLoad:W,iframeLoadTimeout:j,onStylesheetLoad:V,stylesheetLoadTimeout:G,keepIframeSrcFn:H};if(q.type!==$.Element||"textarea"!==q.tagName||void 0===q.attributes.value)for(const a of Array.from(e.childNodes)){const e=pe(a,i);e&&q.childNodes.push(e)}if(Vr(e)&&e.shadowRoot)for(const a of Array.from(e.shadowRoot.childNodes)){const u=pe(a,i);u&&(ve(e.shadowRoot)&&(u.isShadow=!0),q.childNodes.push(u))}}return e.parentNode&&Ie(e.parentNode)&&ve(e.parentNode)&&(q.isShadow=!0),q.type===$.Element&&"iframe"===q.tagName&&function Cn(e,i,a){const u=e.contentWindow;if(!u)return;let b,w=!1;try{b=u.document.readyState}catch{return}if("complete"!==b){const u=setTimeout((()=>{w||(i(),w=!0)}),a);return void e.addEventListener("load",(()=>{clearTimeout(u),w=!0,i()}))}const S="about:blank";if(u.location.href!==S||e.src===S||""===e.src)return setTimeout(i,0),e.addEventListener("load",i);e.addEventListener("load",i)}(e,(()=>{const i=e.contentDocument;if(i&&W){const a=pe(i,{doc:i,mirror:u,blockClass:b,blockSelector:w,needsMask:B,maskTextClass:S,maskTextSelector:v,skipChild:!1,inlineStylesheet:C,maskInputOptions:I,maskTextFn:O,maskInputFn:x,slimDOMOptions:_,dataURLOptions:N,inlineImages:D,recordCanvas:A,preserveWhiteSpace:Y,onSerialize:F,onIframeLoad:W,iframeLoadTimeout:j,onStylesheetLoad:V,stylesheetLoadTimeout:G,keepIframeSrcFn:H});a&&W(e,a)}}),j),q.type===$.Element&&"link"===q.tagName&&"string"==typeof q.attributes.rel&&("stylesheet"===q.attributes.rel||"preload"===q.attributes.rel&&"string"==typeof q.attributes.href&&"css"===Br(q.attributes.href))&&function In(e,i,a){let u,b=!1;try{u=e.sheet}catch{return}if(u)return;const w=setTimeout((()=>{b||(i(),b=!0)}),a);e.addEventListener("load",(()=>{clearTimeout(w),b=!0,i()}))}(e,(()=>{if(V){const i=pe(e,{doc:a,mirror:u,blockClass:b,blockSelector:w,needsMask:B,maskTextClass:S,maskTextSelector:v,skipChild:!1,inlineStylesheet:C,maskInputOptions:I,maskTextFn:O,maskInputFn:x,slimDOMOptions:_,dataURLOptions:N,inlineImages:D,recordCanvas:A,preserveWhiteSpace:Y,onSerialize:F,onIframeLoad:W,iframeLoadTimeout:j,onStylesheetLoad:V,stylesheetLoadTimeout:G,keepIframeSrcFn:H});i&&V(e,i)}}),G),q}function En(e){return e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Tn(e){if(e.__esModule)return e;var i=e.default;if("function"==typeof i){var a=function s(){return this instanceof s?Reflect.construct(i,arguments,this.constructor):i.apply(this,arguments)};a.prototype=i.prototype}else a={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.keys(e).forEach((function(i){var u=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(a,i,u.get?u:{enumerable:!0,get:function(){return e[i]}})})),a}var ne={exports:{}},oe=String,$r=function(){return{isColorSupported:!1,reset:oe,bold:oe,dim:oe,italic:oe,underline:oe,inverse:oe,hidden:oe,strikethrough:oe,black:oe,red:oe,green:oe,yellow:oe,blue:oe,magenta:oe,cyan:oe,white:oe,gray:oe,bgBlack:oe,bgRed:oe,bgGreen:oe,bgYellow:oe,bgBlue:oe,bgMagenta:oe,bgCyan:oe,bgWhite:oe}};ne.exports=$r(),ne.exports.createColors=$r;var ie=ne.exports;const le=Tn(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let ce=ie,ue=le,he=class Jr extends Error{constructor(e,i,a,u,b,w){super(e),this.name="CssSyntaxError",this.reason=e,b&&(this.file=b),u&&(this.source=u),w&&(this.plugin=w),typeof i<"u"&&typeof a<"u"&&("number"==typeof i?(this.line=i,this.column=a):(this.line=i.line,this.column=i.column,this.endLine=a.line,this.endColumn=a.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Jr)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let i=this.source;null==e&&(e=ce.isColorSupported),ue&&e&&(i=ue(i));let a,u,b=i.split(/\r?\n/),w=Math.max(this.line-3,0),S=Math.min(this.line+2,b.length),v=String(S).length;if(e){let{bold:e,gray:i,red:b}=ce.createColors(!0);a=i=>e(b(i)),u=e=>i(e)}else a=u=e=>e;return b.slice(w,S).map(((e,i)=>{let b=w+1+i,S=" "+(" "+b).slice(-v)+" | ";if(b===this.line){let i=u(S.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+u(S)+e+"\n "+i+a("^")}return" "+u(S)+e})).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var de=he;he.default=he;var fe={};fe.isClean=Symbol("isClean"),fe.my=Symbol("my");const me={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let ge=class{constructor(e){this.builder=e}atrule(e,i){let a="@"+e.name,u=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?a+=e.raws.afterName:u&&(a+=" "),e.nodes)this.block(e,a+u);else{let b=(e.raws.between||"")+(i?";":"");this.builder(a+u+b,e)}}beforeAfter(e,i){let a;a="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===i?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let u=e.parent,b=0;for(;u&&"root"!==u.type;)b+=1,u=u.parent;if(a.includes("\n")){let i=this.raw(e,null,"indent");if(i.length)for(let e=0;e<b;e++)a+=i}return a}block(e,i){let a,u=this.raw(e,"between","beforeOpen");this.builder(i+u+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),a=this.raw(e,"after")):a=this.raw(e,"after","emptyBody"),a&&this.builder(a),this.builder("}",e,"end")}body(e){let i=e.nodes.length-1;for(;i>0&&"comment"===e.nodes[i].type;)i-=1;let a=this.raw(e,"semicolon");for(let u=0;u<e.nodes.length;u++){let b=e.nodes[u],w=this.raw(b,"before");w&&this.builder(w),this.stringify(b,i!==u||a)}}comment(e){let i=this.raw(e,"left","commentLeft"),a=this.raw(e,"right","commentRight");this.builder("/*"+i+e.text+a+"*/",e)}decl(e,i){let a=this.raw(e,"between","colon"),u=e.prop+a+this.rawValue(e,"value");e.important&&(u+=e.raws.important||" !important"),i&&(u+=";"),this.builder(u,e)}document(e){this.body(e)}raw(e,i,a){let u;if(a||(a=i),i&&(u=e.raws[i],typeof u<"u"))return u;let b=e.parent;if("before"===a&&(!b||"root"===b.type&&b.first===e||b&&"document"===b.type))return"";if(!b)return me[a];let w=e.root();if(w.rawCache||(w.rawCache={}),typeof w.rawCache[a]<"u")return w.rawCache[a];if("before"===a||"after"===a)return this.beforeAfter(e,a);{let b="raw"+function Pn(e){return e[0].toUpperCase()+e.slice(1)}(a);this[b]?u=this[b](w,e):w.walk((e=>{if(u=e.raws[i],typeof u<"u")return!1}))}return typeof u>"u"&&(u=me[a]),w.rawCache[a]=u,u}rawBeforeClose(e){let i;return e.walk((e=>{if(e.nodes&&e.nodes.length>0&&typeof e.raws.after<"u")return i=e.raws.after,i.includes("\n")&&(i=i.replace(/[^\n]+$/,"")),!1})),i&&(i=i.replace(/\S/g,"")),i}rawBeforeComment(e,i){let a;return e.walkComments((e=>{if(typeof e.raws.before<"u")return a=e.raws.before,a.includes("\n")&&(a=a.replace(/[^\n]+$/,"")),!1})),typeof a>"u"?a=this.raw(i,null,"beforeDecl"):a&&(a=a.replace(/\S/g,"")),a}rawBeforeDecl(e,i){let a;return e.walkDecls((e=>{if(typeof e.raws.before<"u")return a=e.raws.before,a.includes("\n")&&(a=a.replace(/[^\n]+$/,"")),!1})),typeof a>"u"?a=this.raw(i,null,"beforeRule"):a&&(a=a.replace(/\S/g,"")),a}rawBeforeOpen(e){let i;return e.walk((e=>{if("decl"!==e.type&&(i=e.raws.between,typeof i<"u"))return!1})),i}rawBeforeRule(e){let i;return e.walk((a=>{if(a.nodes&&(a.parent!==e||e.first!==a)&&typeof a.raws.before<"u")return i=a.raws.before,i.includes("\n")&&(i=i.replace(/[^\n]+$/,"")),!1})),i&&(i=i.replace(/\S/g,"")),i}rawColon(e){let i;return e.walkDecls((e=>{if(typeof e.raws.between<"u")return i=e.raws.between.replace(/[^\s:]/g,""),!1})),i}rawEmptyBody(e){let i;return e.walk((e=>{if(e.nodes&&0===e.nodes.length&&(i=e.raws.after,typeof i<"u"))return!1})),i}rawIndent(e){if(e.raws.indent)return e.raws.indent;let i;return e.walk((a=>{let u=a.parent;if(u&&u!==e&&u.parent&&u.parent===e&&typeof a.raws.before<"u"){let e=a.raws.before.split("\n");return i=e[e.length-1],i=i.replace(/\S/g,""),!1}})),i}rawSemicolon(e){let i;return e.walk((e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(i=e.raws.semicolon,typeof i<"u"))return!1})),i}rawValue(e,i){let a=e[i],u=e.raws[i];return u&&u.value===a?u.raw:a}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,i){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,i)}};var ye=ge;ge.default=ge;let be=ye;function Tt(e,i){new be(i).stringify(e)}var we=Tt;Tt.default=Tt;let{isClean:ke,my:Me}=fe,Oe=de,xe=ye,Re=we;function Lt(e,i){let a=new e.constructor;for(let u in e){if(!Object.prototype.hasOwnProperty.call(e,u)||"proxyCache"===u)continue;let b=e[u],w=typeof b;"parent"===u&&"object"===w?i&&(a[u]=i):"source"===u?a[u]=b:Array.isArray(b)?a[u]=b.map((e=>Lt(e,a))):("object"===w&&null!==b&&(b=Lt(b)),a[u]=b)}return a}let Le=class{constructor(e={}){this.raws={},this[ke]=!1,this[Me]=!0;for(let i in e)if("nodes"===i){this.nodes=[];for(let a of e[i])"function"==typeof a.clone?this.append(a.clone()):this.append(a)}else this[i]=e[i]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let i=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${i.input.from}:${i.start.line}:${i.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let i in e)this[i]=e[i];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 i=Lt(this);for(let a in e)i[a]=e[a];return i}cloneAfter(e={}){let i=this.clone(e);return this.parent.insertAfter(this,i),i}cloneBefore(e={}){let i=this.clone(e);return this.parent.insertBefore(this,i),i}error(e,i={}){if(this.source){let{end:a,start:u}=this.rangeBy(i);return this.source.input.error(e,{column:u.column,line:u.line},{column:a.column,line:a.line},i)}return new Oe(e)}getProxyProcessor(){return{get:(e,i)=>"proxyOf"===i?e:"root"===i?()=>e.root().toProxy():e[i],set:(e,i,a)=>(e[i]===a||(e[i]=a,("prop"===i||"value"===i||"name"===i||"params"===i||"important"===i||"text"===i)&&e.markDirty()),!0)}}markDirty(){if(this[ke]){this[ke]=!1;let e=this;for(;e=e.parent;)e[ke]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,i){let a=this.source.start;if(e.index)a=this.positionInside(e.index,i);else if(e.word){let u=(i=this.toString()).indexOf(e.word);-1!==u&&(a=this.positionInside(u,i))}return a}positionInside(e,i){let a=i||this.toString(),u=this.source.start.column,b=this.source.start.line;for(let i=0;i<e;i++)"\n"===a[i]?(u=1,b+=1):u+=1;return{column:u,line:b}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let i={column:this.source.start.column,line:this.source.start.line},a=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:i.column+1,line:i.line};if(e.word){let u=this.toString(),b=u.indexOf(e.word);-1!==b&&(i=this.positionInside(b,u),a=this.positionInside(b+e.word.length,u))}else e.start?i={column:e.start.column,line:e.start.line}:e.index&&(i=this.positionInside(e.index)),e.end?a={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?a=this.positionInside(e.endIndex):e.index&&(a=this.positionInside(e.index+1));return(a.line<i.line||a.line===i.line&&a.column<=i.column)&&(a={column:i.column+1,line:i.line}),{end:a,start:i}}raw(e,i){return(new xe).raw(this,e,i)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let i=this,a=!1;for(let u of e)u===this?a=!0:a?(this.parent.insertAfter(i,u),i=u):this.parent.insertBefore(i,u);a||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,i){let a={},u=null==i;i=i||new Map;let b=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e)||"parent"===e||"proxyCache"===e)continue;let u=this[e];if(Array.isArray(u))a[e]=u.map((e=>"object"==typeof e&&e.toJSON?e.toJSON(null,i):e));else if("object"==typeof u&&u.toJSON)a[e]=u.toJSON(null,i);else if("source"===e){let w=i.get(u.input);null==w&&(w=b,i.set(u.input,b),b++),a[e]={end:u.end,inputId:w,start:u.start}}else a[e]=u}return u&&(a.inputs=[...i.keys()].map((e=>e.toJSON()))),a}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Re){e.stringify&&(e=e.stringify);let i="";return e(this,(e=>{i+=e})),i}warn(e,i,a){let u={node:this};for(let e in a)u[e]=a[e];return e.warn(i,u)}get proxyOf(){return this}};var _e=Le;Le.default=Le;let Ne=_e,Ae=class extends Ne{constructor(e){e&&typeof e.value<"u"&&"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 Fe=Ae;Ae.default=Ae;var We={nanoid:(e=21)=>{let i="",a=e;for(;a--;)i+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return i},customAlphabet:(e,i=21)=>(a=i)=>{let u="",b=a;for(;b--;)u+=e[Math.random()*e.length|0];return u}};let{SourceMapConsumer:Ue,SourceMapGenerator:ze}=le,{existsSync:je,readFileSync:Ve}=le,{dirname:$e,join:He}=le;let Be=class{constructor(e,i){if(!1===i.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let a=i.map?i.map.prev:void 0,u=this.loadMap(i.from,a);!this.mapFile&&i.from&&(this.mapFile=i.from),this.mapFile&&(this.root=$e(this.mapFile)),u&&(this.text=u)}consumer(){return this.consumerCache||(this.consumerCache=new Ue(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 function Xn(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}(e.substr(RegExp.lastMatch.length));let i=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+i)}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 i=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!i)return;let a=e.lastIndexOf(i.pop()),u=e.indexOf("*/",a);a>-1&&u>-1&&(this.annotation=this.getAnnotationURL(e.substring(a,u)))}loadFile(e){if(this.root=$e(e),je(e))return this.mapFile=e,Ve(e,"utf-8").toString().trim()}loadMap(e,i){if(!1===i)return!1;if(i){if("string"==typeof i)return i;if("function"!=typeof i){if(i instanceof Ue)return ze.fromSourceMap(i).toString();if(i instanceof ze)return i.toString();if(this.isMap(i))return JSON.stringify(i);throw new Error("Unsupported previous source map format: "+i.toString())}{let a=i(e);if(a){let e=this.loadFile(a);if(!e)throw new Error("Unable to load previous source map: "+a.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let i=this.annotation;return e&&(i=He($e(e),i)),this.loadFile(i)}}}startWith(e,i){return!!e&&e.substr(0,i.length)===i}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Xe=Be;Be.default=Be;let{SourceMapConsumer:Ye,SourceMapGenerator:Ke}=le,{fileURLToPath:rt,pathToFileURL:nt}=le,{isAbsolute:st,resolve:it}=le,{nanoid:lt}=We,ut=le,ht=de,pt=Xe,dt=Symbol("fromOffsetCache"),ft=!(!Ye||!Ke),gt=!(!it||!st),bt=class{constructor(e,i={}){if(null===e||typeof e>"u"||"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,i.from&&(!gt||/^\w+:\/\//.test(i.from)||st(i.from)?this.file=i.from:this.file=it(i.from)),gt&&ft){let e=new pt(this.css,i);if(e.text){this.map=e;let i=e.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+lt(6)+">"),this.map&&(this.map.file=this.from)}error(e,i,a,u={}){let b,w,S;if(i&&"object"==typeof i){let e=i,u=a;if("number"==typeof e.offset){let u=this.fromOffset(e.offset);i=u.line,a=u.col}else i=e.line,a=e.column;if("number"==typeof u.offset){let e=this.fromOffset(u.offset);w=e.line,S=e.col}else w=u.line,S=u.column}else if(!a){let e=this.fromOffset(i);i=e.line,a=e.col}let v=this.origin(i,a,w,S);return b=v?new ht(e,void 0===v.endLine?v.line:{column:v.column,line:v.line},void 0===v.endLine?v.column:{column:v.endColumn,line:v.endLine},v.source,v.file,u.plugin):new ht(e,void 0===w?i:{column:a,line:i},void 0===w?a:{column:S,line:w},this.css,this.file,u.plugin),b.input={column:a,endColumn:S,endLine:w,line:i,source:this.css},this.file&&(nt&&(b.input.url=nt(this.file).toString()),b.input.file=this.file),b}fromOffset(e){let i,a;if(this[dt])a=this[dt];else{let e=this.css.split("\n");a=new Array(e.length);let i=0;for(let u=0,b=e.length;u<b;u++)a[u]=i,i+=e[u].length+1;this[dt]=a}i=a[a.length-1];let u=0;if(e>=i)u=a.length-1;else{let i,b=a.length-2;for(;u<b;)if(i=u+(b-u>>1),e<a[i])b=i-1;else{if(!(e>=a[i+1])){u=i;break}u=i+1}}return{col:e-a[u]+1,line:u+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:it(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,i,a,u){if(!this.map)return!1;let b,w,S=this.map.consumer(),v=S.originalPositionFor({column:i,line:e});if(!v.source)return!1;"number"==typeof a&&(b=S.originalPositionFor({column:u,line:a})),w=st(v.source)?nt(v.source):new URL(v.source,this.map.consumer().sourceRoot||nt(this.map.mapFile));let k={column:v.column,endColumn:b&&b.column,endLine:b&&b.line,line:v.line,url:w.toString()};if("file:"===w.protocol){if(!rt)throw new Error("file: protocol is not available in this PostCSS build");k.file=rt(w)}let C=S.sourceContentFor(v.source);return C&&(k.source=C),k}toJSON(){let e={};for(let i of["hasBOM","css","file","id"])null!=this[i]&&(e[i]=this[i]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var wt=bt;bt.default=bt,ut&&ut.registerInput&&ut.registerInput(bt);let{SourceMapConsumer:St,SourceMapGenerator:vt}=le,{dirname:kt,relative:Ct,resolve:It,sep:Mt}=le,{pathToFileURL:Ot}=le,Rt=wt,Et=!(!St||!vt),_t=!!(kt&&It&&Ct&&Mt);var Nt=class{constructor(e,i,a,u){this.stringify=e,this.mapOpts=a.map||{},this.root=i,this.opts=a,this.css=u,this.originalCSS=u,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 i="\n";this.css.includes("\r\n")&&(i="\r\n"),this.css+=i+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let i,a=this.toUrl(this.path(e.file)),u=e.root||kt(e.file);!1===this.mapOpts.sourcesContent?(i=new St(e.text),i.sourcesContent&&(i.sourcesContent=null)):i=e.consumer(),this.map.applySourceMap(i,a,this.toUrl(this.path(u)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let i=this.root.nodes.length-1;i>=0;i--)e=this.root.nodes[i],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(i)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),_t&&Et&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,(i=>{e+=i})),[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=vt.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new vt({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 vt({file:this.outputFile(),ignoreInvalidMapping:!0});let e,i,a=1,u=1,b="<no source>",w={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,((S,v,k)=>{if(this.css+=S,v&&"end"!==k&&(w.generated.line=a,w.generated.column=u-1,v.source&&v.source.start?(w.source=this.sourcePath(v),w.original.line=v.source.start.line,w.original.column=v.source.start.column-1,this.map.addMapping(w)):(w.source=b,w.original.line=1,w.original.column=0,this.map.addMapping(w))),e=S.match(/\n/g),e?(a+=e.length,i=S.lastIndexOf("\n"),u=S.length-i):u+=S.length,v&&"start"!==k){let e=v.parent||{raws:{}};("decl"!==v.type&&("atrule"!==v.type||v.nodes)||v!==e.last||e.raws.semicolon)&&(v.source&&v.source.end?(w.source=this.sourcePath(v),w.original.line=v.source.end.line,w.original.column=v.source.end.column-1,w.generated.line=a,w.generated.column=u-2,this.map.addMapping(w)):(w.source=b,w.original.line=1,w.original.column=0,w.generated.line=a,w.generated.column=u-1,this.map.addMapping(w)))}}))}isAnnotation(){return!!this.isInline()||(typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:!this.previous().length||this.previous().some((e=>e.annotation)))}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return!(typeof e<"u"&&!0!==e)&&(!this.previous().length||this.previous().some((e=>e.inline)))}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?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||60===e.charCodeAt(0)||/^\w+:\/\//.test(e))return e;let i=this.memoizedPaths.get(e);if(i)return i;let a=this.opts.to?kt(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(a=kt(It(a,this.mapOpts.annotation)));let u=Ct(a,e);return this.memoizedPaths.set(e,u),u}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((e=>{if(e.source&&e.source.input.map){let i=e.source.input.map;this.previousMaps.includes(i)||this.previousMaps.push(i)}}));else{let e=new Rt(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk((i=>{if(i.source){let a=i.source.input.from;if(a&&!e[a]){e[a]=!0;let u=this.usesFileUrls?this.toFileUrl(a):this.toUrl(this.path(a));this.map.setSourceContent(u,i.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 i=this.memoizedFileURLs.get(e);if(i)return i;if(Ot){let i=Ot(e).toString();return this.memoizedFileURLs.set(e,i),i}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let i=this.memoizedURLs.get(e);if(i)return i;"\\"===Mt&&(e=e.replace(/\\/g,"/"));let a=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,a),a}};let Dt=_e,Pt=class extends Dt{constructor(e){super(e),this.type="comment"}};var At=Pt;Pt.default=Pt;let Ft,Wt,Ut,jt,{isClean:Vt,my:$t}=fe,Xt=Fe,Kt=At,Jt=_e;function us(e){return e.map((e=>(e.nodes&&(e.nodes=us(e.nodes)),delete e.source,e)))}function hs(e){if(e[Vt]=!1,e.proxyOf.nodes)for(let i of e.proxyOf.nodes)hs(i)}let qt=class ps extends Jt{append(...e){for(let i of e){let e=this.normalize(i,this.last);for(let i of e)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let i of this.nodes)i.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let i,a,u=this.getIterator();for(;this.indexes[u]<this.proxyOf.nodes.length&&(i=this.indexes[u],a=e(this.proxyOf.nodes[i],i),!1!==a);)this.indexes[u]+=1;return delete this.indexes[u],a}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,i)=>"proxyOf"===i?e:e[i]?"each"===i||"string"==typeof i&&i.startsWith("walk")?(...a)=>e[i](...a.map((e=>"function"==typeof e?(i,a)=>e(i.toProxy(),a):e))):"every"===i||"some"===i?a=>e[i](((e,...i)=>a(e.toProxy(),...i))):"root"===i?()=>e.root().toProxy():"nodes"===i?e.nodes.map((e=>e.toProxy())):"first"===i||"last"===i?e[i].toProxy():e[i]:e[i],set:(e,i,a)=>(e[i]===a||(e[i]=a,("name"===i||"params"===i||"selector"===i)&&e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,i){let a,u=this.index(e),b=this.normalize(i,this.proxyOf.nodes[u]).reverse();u=this.index(e);for(let e of b)this.proxyOf.nodes.splice(u+1,0,e);for(let e in this.indexes)a=this.indexes[e],u<a&&(this.indexes[e]=a+b.length);return this.markDirty(),this}insertBefore(e,i){let a,u=this.index(e),b=0===u&&"prepend",w=this.normalize(i,this.proxyOf.nodes[u],b).reverse();u=this.index(e);for(let e of w)this.proxyOf.nodes.splice(u,0,e);for(let e in this.indexes)a=this.indexes[e],u<=a&&(this.indexes[e]=a+w.length);return this.markDirty(),this}normalize(e,i){if("string"==typeof e)e=us(Ft(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if("root"===e.type&&"document"!==this.type){e=e.nodes.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new Xt(e)]}else if(e.selector)e=[new Wt(e)];else if(e.name)e=[new Ut(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new Kt(e)]}return e.map((e=>(e[$t]||ps.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[Vt]&&hs(e),typeof e.raws.before>"u"&&i&&typeof i.raws.before<"u"&&(e.raws.before=i.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e)))}prepend(...e){e=e.reverse();for(let i of e){let e=this.normalize(i,this.first,"prepend").reverse();for(let i of e)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+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 i;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let a in this.indexes)i=this.indexes[a],i>=e&&(this.indexes[a]=i-1);return this.markDirty(),this}replaceValues(e,i,a){return a||(a=i,i={}),this.walkDecls((u=>{i.props&&!i.props.includes(u.prop)||i.fast&&!u.value.includes(i.fast)||(u.value=u.value.replace(e,a))})),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each(((i,a)=>{let u;try{u=e(i,a)}catch(e){throw i.addToError(e)}return!1!==u&&i.walk&&(u=i.walk(e)),u}))}walkAtRules(e,i){return i?e instanceof RegExp?this.walk(((a,u)=>{if("atrule"===a.type&&e.test(a.name))return i(a,u)})):this.walk(((a,u)=>{if("atrule"===a.type&&a.name===e)return i(a,u)})):(i=e,this.walk(((e,a)=>{if("atrule"===e.type)return i(e,a)})))}walkComments(e){return this.walk(((i,a)=>{if("comment"===i.type)return e(i,a)}))}walkDecls(e,i){return i?e instanceof RegExp?this.walk(((a,u)=>{if("decl"===a.type&&e.test(a.prop))return i(a,u)})):this.walk(((a,u)=>{if("decl"===a.type&&a.prop===e)return i(a,u)})):(i=e,this.walk(((e,a)=>{if("decl"===e.type)return i(e,a)})))}walkRules(e,i){return i?e instanceof RegExp?this.walk(((a,u)=>{if("rule"===a.type&&e.test(a.selector))return i(a,u)})):this.walk(((a,u)=>{if("rule"===a.type&&a.selector===e)return i(a,u)})):(i=e,this.walk(((e,a)=>{if("rule"===e.type)return i(e,a)})))}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]}};qt.registerParse=e=>{Ft=e},qt.registerRule=e=>{Wt=e},qt.registerAtRule=e=>{Ut=e},qt.registerRoot=e=>{jt=e};var Qt=qt;qt.default=qt,qt.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Ut.prototype):"rule"===e.type?Object.setPrototypeOf(e,Wt.prototype):"decl"===e.type?Object.setPrototypeOf(e,Xt.prototype):"comment"===e.type?Object.setPrototypeOf(e,Kt.prototype):"root"===e.type&&Object.setPrototypeOf(e,jt.prototype),e[$t]=!0,e.nodes&&e.nodes.forEach((e=>{qt.rebuild(e)}))};let er,tr,rr=Qt,nr=class extends rr{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new er(new tr,this,e).stringify()}};nr.registerLazyResult=e=>{er=e},nr.registerProcessor=e=>{tr=e};var sr=nr;nr.default=nr;let cr={};var ms=function(e){cr[e]||(cr[e]=!0,typeof console<"u"&&console.warn&&console.warn(e))};let ur=class{constructor(e,i={}){if(this.type="warning",this.text=e,i.node&&i.node.source){let e=i.node.rangeBy(i);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in i)this[e]=i[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 hr=ur;ur.default=ur;let pr=hr,dr=class{constructor(e,i,a){this.processor=e,this.messages=[],this.root=i,this.opts=a,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,i={}){i.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(i.plugin=this.lastPlugin.postcssPlugin);let a=new pr(e,i);return this.messages.push(a),a}warnings(){return this.messages.filter((e=>"warning"===e.type))}get content(){return this.css}};var fr=dr;dr.default=dr;const mr=/[\t\n\f\r "#'()/;[\\\]{}]/g,gr=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,yr=/.[\r\n"'(/\\]/,br=/[\da-f]/i;let wr=Qt,Sr=class extends wr{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 vr=Sr;Sr.default=Sr,wr.registerAtRule(Sr);let kr,Cr,Ir=Qt,Mr=class extends Ir{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,i,a){let u=super.normalize(e);if(i)if("prepend"===a)this.nodes.length>1?i.raws.before=this.nodes[1].raws.before:delete i.raws.before;else if(this.first!==i)for(let e of u)e.raws.before=i.raws.before;return u}removeChild(e,i){let a=this.index(e);return!i&&0===a&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[a].raws.before),super.removeChild(e)}toResult(e={}){return new kr(new Cr,this,e).stringify()}};Mr.registerLazyResult=e=>{kr=e},Mr.registerProcessor=e=>{Cr=e};var Or=Mr;Mr.default=Mr,Ir.registerRoot(Mr);let xr={comma:e=>xr.split(e,[","],!0),space(e){let i=[" ","\n","\t"];return xr.split(e,i)},split(e,i,a){let u=[],b="",w=!1,S=0,v=!1,k="",C=!1;for(let a of e)C?C=!1:"\\"===a?C=!0:v?a===k&&(v=!1):'"'===a||"'"===a?(v=!0,k=a):"("===a?S+=1:")"===a?S>0&&(S-=1):0===S&&i.includes(a)&&(w=!0),w?(""!==b&&u.push(b.trim()),b="",w=!1):b+=a;return(a||""!==b)&&u.push(b.trim()),u}};var Er=xr;xr.default=xr;let Ar=Qt,Fr=Er,Wr=class extends Ar{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Fr.comma(this.selector)}set selectors(e){let i=this.selector?this.selector.match(/,\s*/):null,a=i?i[0]:","+this.raw("between","beforeOpen");this.selector=e.join(a)}};var zr=Wr;Wr.default=Wr,Ar.registerRule(Wr);let Kr=Fe,vo=function(e,i={}){let a,u,b,w,S,v,k,C,I,O,x=e.css.valueOf(),_=i.ignoreErrors,N=x.length,D=0,A=[],F=[];function m(i){throw e.error("Unclosed "+i,D)}return{back:function P2(e){F.push(e)},endOfFile:function C2(){return 0===F.length&&D>=N},nextToken:function E(e){if(F.length)return F.pop();if(D>=N)return;let i=!!e&&e.ignoreUnclosed;switch(a=x.charCodeAt(D),a){case 10:case 32:case 9:case 13:case 12:u=D;do{u+=1,a=x.charCodeAt(u)}while(32===a||10===a||9===a||13===a||12===a);O=["space",x.slice(D,u)],D=u-1;break;case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let e=String.fromCharCode(a);O=[e,e,D];break}case 40:if(C=A.length?A.pop()[1]:"",I=x.charCodeAt(D+1),"url"===C&&39!==I&&34!==I&&32!==I&&10!==I&&9!==I&&12!==I&&13!==I){u=D;do{if(v=!1,u=x.indexOf(")",u+1),-1===u){if(_||i){u=D;break}m("bracket")}for(k=u;92===x.charCodeAt(k-1);)k-=1,v=!v}while(v);O=["brackets",x.slice(D,u+1),D,u],D=u}else u=x.indexOf(")",D+1),w=x.slice(D,u+1),-1===u||yr.test(w)?O=["(","(",D]:(O=["brackets",w,D,u],D=u);break;case 39:case 34:b=39===a?"'":'"',u=D;do{if(v=!1,u=x.indexOf(b,u+1),-1===u){if(_||i){u=D+1;break}m("string")}for(k=u;92===x.charCodeAt(k-1);)k-=1,v=!v}while(v);O=["string",x.slice(D,u+1),D,u],D=u;break;case 64:mr.lastIndex=D+1,mr.test(x),u=0===mr.lastIndex?x.length-1:mr.lastIndex-2,O=["at-word",x.slice(D,u+1),D,u],D=u;break;case 92:for(u=D,S=!0;92===x.charCodeAt(u+1);)u+=1,S=!S;if(a=x.charCodeAt(u+1),S&&47!==a&&32!==a&&10!==a&&9!==a&&13!==a&&12!==a&&(u+=1,br.test(x.charAt(u)))){for(;br.test(x.charAt(u+1));)u+=1;32===x.charCodeAt(u+1)&&(u+=1)}O=["word",x.slice(D,u+1),D,u],D=u;break;default:47===a&&42===x.charCodeAt(D+1)?(u=x.indexOf("*/",D+2)+1,0===u&&(_||i?u=x.length:m("comment")),O=["comment",x.slice(D,u+1),D,u],D=u):(gr.lastIndex=D+1,gr.test(x),u=0===gr.lastIndex?x.length-1:gr.lastIndex-2,O=["word",x.slice(D,u+1),D,u],A.push(O),D=u)}return D++,O},position:function b2(){return D}}},qr=At,Qr=vr,ln=Or,cn=zr;const pn={empty:!0,space:!0};var dn=class{constructor(e){this.input=e,this.root=new ln,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 i=new Qr;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);let a,u,b,w=!1,S=!1,v=[],k=[];for(;!this.tokenizer.endOfFile();){if(a=(e=this.tokenizer.nextToken())[0],"("===a||"["===a?k.push("("===a?")":"]"):"{"===a&&k.length>0?k.push("}"):a===k[k.length-1]&&k.pop(),0===k.length){if(";"===a){i.source.end=this.getPosition(e[2]),i.source.end.offset++,this.semicolon=!0;break}if("{"===a){S=!0;break}if("}"===a){if(v.length>0){for(b=v.length-1,u=v[b];u&&"space"===u[0];)u=v[--b];u&&(i.source.end=this.getPosition(u[3]||u[2]),i.source.end.offset++)}this.end(e);break}v.push(e)}else v.push(e);if(this.tokenizer.endOfFile()){w=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(v),v.length?(i.raws.afterName=this.spacesAndCommentsFromStart(v),this.raw(i,"params",v),w&&(e=v[v.length-1],i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),S&&(i.nodes=[],this.current=i)}checkMissedSemicolon(e){let i=this.colon(e);if(!1===i)return;let a,u=0;for(let b=i-1;b>=0&&(a=e[b],"space"===a[0]||(u+=1,2!==u));b--);throw this.input.error("Missed semicolon","word"===a[0]?a[3]+1:a[2])}colon(e){let i,a,u,b=0;for(let[w,S]of e.entries()){if(i=S,a=i[0],"("===a&&(b+=1),")"===a&&(b-=1),0===b&&":"===a){if(u){if("word"===u[0]&&"progid"===u[1])continue;return w}this.doubleColon(i)}u=i}return!1}comment(e){let i=new qr;this.init(i,e[2]),i.source.end=this.getPosition(e[3]||e[2]),i.source.end.offset++;let a=e[1].slice(2,-2);if(/^\s*$/.test(a))i.text="",i.raws.left=a,i.raws.right="";else{let e=a.match(/^(\s*)([^]*\S)(\s*)$/);i.text=e[2],i.raws.left=e[1],i.raws.right=e[3]}}createTokenizer(){this.tokenizer=vo(this.input)}decl(e,i){let a=new Kr;this.init(a,e[0][2]);let u,b=e[e.length-1];for(";"===b[0]&&(this.semicolon=!0,e.pop()),a.source.end=this.getPosition(b[3]||b[2]||function Oo(e){for(let i=e.length-1;i>=0;i--){let a=e[i],u=a[3]||a[2];if(u)return u}}(e)),a.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),a.raws.before+=e.shift()[1];for(a.source.start=this.getPosition(e[0][2]),a.prop="";e.length;){let i=e[0][0];if(":"===i||"space"===i||"comment"===i)break;a.prop+=e.shift()[1]}for(a.raws.between="";e.length;){if(u=e.shift(),":"===u[0]){a.raws.between+=u[1];break}"word"===u[0]&&/\w/.test(u[1])&&this.unknownWord([u]),a.raws.between+=u[1]}("_"===a.prop[0]||"*"===a.prop[0])&&(a.raws.before+=a.prop[0],a.prop=a.prop.slice(1));let w,S=[];for(;e.length&&(w=e[0][0],"space"===w||"comment"===w);)S.push(e.shift());this.precheckMissedSemicolon(e);for(let i=e.length-1;i>=0;i--){if(u=e[i],"!important"===u[1].toLowerCase()){a.important=!0;let u=this.stringFrom(e,i);u=this.spacesFromEnd(e)+u," !important"!==u&&(a.raws.important=u);break}if("important"===u[1].toLowerCase()){let u=e.slice(0),b="";for(let e=i;e>0;e--){let i=u[e][0];if(0===b.trim().indexOf("!")&&"space"!==i)break;b=u.pop()[1]+b}0===b.trim().indexOf("!")&&(a.important=!0,a.raws.important=b,e=u)}if("space"!==u[0]&&"comment"!==u[0])break}e.some((e=>"space"!==e[0]&&"comment"!==e[0]))&&(a.raws.between+=S.map((e=>e[1])).join(""),S=[]),this.raw(a,"value",S.concat(e),i),a.value.includes(":")&&!i&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let i=new cn;this.init(i,e[2]),i.selector="",i.raws.between="",this.current=i}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 i=this.input.fromOffset(e);return{column:i.col,line:i.line,offset:e}}init(e,i){this.current.push(e),e.source={input:this.input,start:this.getPosition(i)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let i=!1,a=null,u=!1,b=null,w=[],S=e[1].startsWith("--"),v=[],k=e;for(;k;){if(a=k[0],v.push(k),"("===a||"["===a)b||(b=k),w.push("("===a?")":"]");else if(S&&u&&"{"===a)b||(b=k),w.push("}");else if(0===w.length){if(";"===a){if(u)return void this.decl(v,S);break}if("{"===a)return void this.rule(v);if("}"===a){this.tokenizer.back(v.pop()),i=!0;break}":"===a&&(u=!0)}else a===w[w.length-1]&&(w.pop(),0===w.length&&(b=null));k=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(i=!0),w.length>0&&this.unclosedBracket(b),i&&u){if(!S)for(;v.length&&(k=v[v.length-1][0],"space"===k||"comment"===k);)this.tokenizer.back(v.pop());this.decl(v,S)}else this.unknownWord(v)}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,i,a,u){let b,w,S,v,k=a.length,C="",I=!0;for(let e=0;e<k;e+=1)b=a[e],w=b[0],"space"!==w||e!==k-1||u?"comment"===w?(v=a[e-1]?a[e-1][0]:"empty",S=a[e+1]?a[e+1][0]:"empty",pn[v]||pn[S]||","===C.slice(-1)?I=!1:C+=b[1]):C+=b[1]:I=!1;if(!I){let u=a.reduce(((e,i)=>e+i[1]),"");e.raws[i]={raw:u,value:C}}e[i]=C}rule(e){e.pop();let i=new cn;this.init(i,e[0][2]),i.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(i,"selector",e),this.current=i}spacesAndCommentsFromEnd(e){let i,a="";for(;e.length&&(i=e[e.length-1][0],"space"===i||"comment"===i);)a=e.pop()[1]+a;return a}spacesAndCommentsFromStart(e){let i,a="";for(;e.length&&(i=e[0][0],"space"===i||"comment"===i);)a+=e.shift()[1];return a}spacesFromEnd(e){let i,a="";for(;e.length&&(i=e[e.length-1][0],"space"===i);)a=e.pop()[1]+a;return a}stringFrom(e,i){let a="";for(let u=i;u<e.length;u++)a+=e[u][1];return e.splice(i,e.length-i),a}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,i){throw this.input.error("At-rule without name",{offset:i[2]},{offset:i[2]+i[1].length})}};let fn=Qt,mn=dn,gn=wt;function ot(e,i){let a=new gn(e,i),u=new mn(a);try{u.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&i&&i.from&&(/\.scss$/i.test(i.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(i.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(i.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return u.root}var yn=ot;ot.default=ot,fn.registerParse(ot);let{isClean:Ln,my:_n}=fe,Nn=Nt,Dn=we,An=Qt,Fn=sr,Wn=ms,Un=fr,zn=yn,jn=Or;const Vn={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},$n={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},Gn={Once:!0,postcssPlugin:!0,prepare:!0};function Ce(e){return"object"==typeof e&&"function"==typeof e.then}function vs(e){let i=!1,a=Vn[e.type];return"decl"===e.type?i=e.prop.toLowerCase():"atrule"===e.type&&(i=e.name.toLowerCase()),i&&e.append?[a,a+"-"+i,0,a+"Exit",a+"Exit-"+i]:i?[a,a+"-"+i,a+"Exit",a+"Exit-"+i]:e.append?[a,0,a+"Exit"]:[a,a+"Exit"]}function Rr(e){let i;return i="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:vs(e),{eventIndex:0,events:i,iterator:0,node:e,visitorIndex:0,visitors:[]}}function zt(e){return e[Ln]=!1,e.nodes&&e.nodes.forEach((e=>zt(e))),e}let Hn={},Zn=class Ms{constructor(e,i,a){let u;if(this.stringified=!1,this.processed=!1,"object"!=typeof i||null===i||"root"!==i.type&&"document"!==i.type)if(i instanceof Ms||i instanceof Un)u=zt(i.root),i.map&&(typeof a.map>"u"&&(a.map={}),a.map.inline||(a.map.inline=!1),a.map.prev=i.map);else{let e=zn;a.syntax&&(e=a.syntax.parse),a.parser&&(e=a.parser),e.parse&&(e=e.parse);try{u=e(i,a)}catch(e){this.processed=!0,this.error=e}u&&!u[_n]&&An.rebuild(u)}else u=zt(i);this.result=new Un(e,u,a),this.helpers={...Hn,postcss:Hn,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,i){let a=this.result.lastPlugin;try{if(i&&i.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(a.postcssVersion&&"production"!==process.env.NODE_ENV){let e=a.postcssPlugin,i=a.postcssVersion,u=this.result.processor.version,b=i.split("."),w=u.split(".");(b[0]!==w[0]||parseInt(b[1])>parseInt(w[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+u+", but "+e+" uses "+i+". Perhaps this is the source of the error below.")}}else e.plugin=a.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let t=(e,i,a)=>{this.listeners[i]||(this.listeners[i]=[]),this.listeners[i].push([e,a])};for(let e of this.plugins)if("object"==typeof e)for(let i in e){if(!$n[i]&&/^[A-Z]/.test(i))throw new Error(`Unknown event ${i} in ${e.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Gn[i])if("object"==typeof e[i])for(let a in e[i])t(e,"*"===a?i:i+"-"+a.toLowerCase(),e[i][a]);else"function"==typeof e[i]&&t(e,i,e[i])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let i=this.plugins[e],a=this.runOnRoot(i);if(Ce(a))try{await a}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ln];){e[Ln]=!0;let i=[Rr(e)];for(;i.length>0;){let e=this.visitTick(i);if(Ce(e))try{await e}catch(e){let a=i[i.length-1].node;throw this.handleError(e,a)}}}if(this.listeners.OnceExit)for(let[i,a]of this.listeners.OnceExit){this.result.lastPlugin=i;try{if("document"===e.type){let i=e.nodes.map((e=>a(e,this.helpers)));await Promise.all(i)}else await a(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 i=this.result.root.nodes.map((i=>e.Once(i,this.helpers)));return Ce(i[0])?Promise.all(i):i}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,i=Dn;e.syntax&&(i=e.syntax.stringify),e.stringifier&&(i=e.stringifier),i.stringify&&(i=i.stringify);let a=new Nn(i,this.result.root,this.result.opts).generate();return this.result.css=a[0],this.result.map=a[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(Ce(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ln];)e[Ln]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let i of e.nodes)this.visitSync(this.listeners.OnceExit,i);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,i){return"production"!==process.env.NODE_ENV&&("from"in this.opts||Wn("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,i)}toString(){return this.css}visitSync(e,i){for(let[a,u]of e){let e;this.result.lastPlugin=a;try{e=u(i,this.helpers)}catch(e){throw this.handleError(e,i.proxyOf)}if("root"!==i.type&&"document"!==i.type&&!i.parent)return!0;if(Ce(e))throw this.getAsyncError()}}visitTick(e){let i=e[e.length-1],{node:a,visitors:u}=i;if("root"!==a.type&&"document"!==a.type&&!a.parent)return void e.pop();if(u.length>0&&i.visitorIndex<u.length){let[e,b]=u[i.visitorIndex];i.visitorIndex+=1,i.visitorIndex===u.length&&(i.visitors=[],i.visitorIndex=0),this.result.lastPlugin=e;try{return b(a.toProxy(),this.helpers)}catch(e){throw this.handleError(e,a)}}if(0!==i.iterator){let u,b=i.iterator;for(;u=a.nodes[a.indexes[b]];)if(a.indexes[b]+=1,!u[Ln])return u[Ln]=!0,void e.push(Rr(u));i.iterator=0,delete a.indexes[b]}let b=i.events;for(;i.eventIndex<b.length;){let e=b[i.eventIndex];if(i.eventIndex+=1,0===e)return void(a.nodes&&a.nodes.length&&(a[Ln]=!0,i.iterator=a.getIterator()));if(this.listeners[e])return void(i.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Ln]=!0;let i=vs(e);for(let a of i)if(0===a)e.nodes&&e.each((e=>{e[Ln]||this.walkSync(e)}));else{let i=this.listeners[a];if(i&&this.visitSync(i,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"}};Zn.registerPostcss=e=>{Hn=e};var Bn=Zn;Zn.default=Zn,jn.registerLazyResult(Zn),Fn.registerLazyResult(Zn);let Yn=Nt,Kn=we,Jn=ms,qn=yn;const Qn=fr;let es=class{constructor(e,i,a){i=i.toString(),this.stringified=!1,this._processor=e,this._css=i,this._opts=a,this._map=void 0;let u,b=Kn;this.result=new Qn(this._processor,u,this._opts),this.result.css=i;let w=this;Object.defineProperty(this.result,"root",{get:()=>w.root});let S=new Yn(b,u,this._opts,i);if(S.isMap()){let[e,i]=S.generate();e&&(this.result.css=e),i&&(this.result.map=i)}else S.clearAnnotation(),this.result.css=S.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,i){return"production"!==process.env.NODE_ENV&&("from"in this._opts||Jn("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,i)}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,i=qn;try{e=i(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 ts=es;es.default=es;let rs=ts,ns=Bn,ss=sr,os=Or,is=class{constructor(e=[]){this.version="8.4.39",this.plugins=this.normalize(e)}normalize(e){let i=[];for(let a of e)if(!0===a.postcss?a=a():a.postcss&&(a=a.postcss),"object"==typeof a&&Array.isArray(a.plugins))i=i.concat(a.plugins);else if("object"==typeof a&&a.postcssPlugin)i.push(a);else if("function"==typeof a)i.push(a);else{if("object"!=typeof a||!a.parse&&!a.stringify)throw new Error(a+" 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 i}process(e,i={}){return this.plugins.length||i.parser||i.stringifier||i.syntax?new ns(this,e,i):new rs(this,e,i)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var as=is;is.default=is,os.registerProcessor(is),ss.registerProcessor(is);let ls=Fe,cs=Xe,ds=At,fs=vr,gs=wt,ys=Or,bs=zr;function Ee(e,i){if(Array.isArray(e))return e.map((e=>Ee(e)));let{inputs:a,...u}=e;if(a){i=[];for(let e of a){let a={...e,__proto__:gs.prototype};a.map&&(a.map={...a.map,__proto__:cs.prototype}),i.push(a)}}if(u.nodes&&(u.nodes=e.nodes.map((e=>Ee(e,i)))),u.source){let{inputId:e,...a}=u.source;u.source=a,null!=e&&(u.source.input=i[e])}if("root"===u.type)return new ys(u);if("decl"===u.type)return new ls(u);if("rule"===u.type)return new bs(u);if("comment"===u.type)return new ds(u);if("atrule"===u.type)return new fs(u);throw new Error("Unknown node type: "+e.type)}var ws=Ee;Ee.default=Ee;let Ss=de,ks=Fe,Cs=Bn,Is=Qt,Os=as,xs=we,Rs=ws,Es=sr,Ls=hr,Ts=At,$s=vr,Gs=fr,Ks=wt,Js=yn,qs=Er,Qs=zr,eo=Or,to=_e;function R(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Os(e)}R.plugin=function(e,i){let a,u=!1;function s(...a){console&&console.warn&&!u&&(u=!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 b=i(...a);return b.postcssPlugin=e,b.postcssVersion=(new Os).version,b}return Object.defineProperty(s,"postcss",{get:()=>(a||(a=s()),a)}),s.process=function(e,i,a){return R([s(a)]).process(e,i)},s},R.stringify=xs,R.parse=Js,R.fromJSON=Rs,R.list=qs,R.comment=e=>new Ts(e),R.atRule=e=>new $s(e),R.decl=e=>new ks(e),R.rule=e=>new Qs(e),R.root=e=>new eo(e),R.document=e=>new Es(e),R.CssSyntaxError=Ss,R.Declaration=ks,R.Container=Is,R.Processor=Os,R.Document=Es,R.Comment=Ts,R.Warning=Ls,R.AtRule=$s,R.Result=Gs,R.Input=Ks,R.Rule=Qs,R.Root=eo,R.Node=to,Cs.registerPostcss(R);var ro=R;R.default=R;const no=En(ro);no.stringify,no.fromJSON,no.plugin,no.parse,no.list,no.document,no.comment,no.atRule,no.rule,no.decl,no.root,no.CssSyntaxError,no.Declaration,no.Container,no.Processor,no.Document,no.Comment,no.Warning,no.AtRule,no.Result,no.Input,no.Rule,no.Root,no.Node;var so=(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))(so||{}),oo=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(oo||{}),io=(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))(io||{}),ao=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(ao||{}),lo=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(lo||{}),co=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(co||{});function U(e,i,a=document){const u={capture:!0,passive:!0};return a.addEventListener(e,i,u),()=>a.removeEventListener(e,i,u)}const uo="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 ho={map:{},getId:()=>(console.error(uo),-1),getNode:()=>(console.error(uo),null),removeNodeFromMap(){console.error(uo)},has:()=>(console.error(uo),!1),reset(){console.error(uo)}};function Te(e,i,a={}){let u=null,b=0;return function(...w){const S=Date.now();!b&&!1===a.leading&&(b=S);const v=i-(S-b),k=this;v<=0||v>i?(u&&(clearTimeout(u),u=null),b=S,e.apply(k,w)):!u&&!1!==a.trailing&&(u=setTimeout((()=>{b=!1===a.leading?0:Date.now(),u=null,e.apply(k,w)}),v))}}function mt(e,i,a,u,b=window){const w=b.Object.getOwnPropertyDescriptor(e,i);return b.Object.defineProperty(e,i,u?a:{set(e){setTimeout((()=>{a.set.call(this,e)}),0),w&&w.set&&w.set.call(this,e)}}),()=>mt(e,i,w||{},!0)}function Se(e,i,a){try{if(!(i in e))return()=>{};const u=e[i],b=a(u);return"function"==typeof b&&(b.prototype=b.prototype||{},Object.defineProperties(b,{__rrweb_original__:{enumerable:!1,value:u}})),e[i]=b,()=>{e[i]=u}}catch{return()=>{}}}typeof window<"u"&&window.Proxy&&window.Reflect&&(ho=new Proxy(ho,{get:(e,i,a)=>("map"===i&&console.error(uo),Reflect.get(e,i,a))}));let po,fo=Date.now;function Ns(e){var i,a,u,b,w,S;const v=e.document;return{left:v.scrollingElement?v.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==v?void 0:v.documentElement.scrollLeft)||(null==(a=null==(i=null==v?void 0:v.body)?void 0:i.parentElement)?void 0:a.scrollLeft)||(null==(u=null==v?void 0:v.body)?void 0:u.scrollLeft)||0,top:v.scrollingElement?v.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==v?void 0:v.documentElement.scrollTop)||(null==(w=null==(b=null==v?void 0:v.body)?void 0:b.parentElement)?void 0:w.scrollTop)||(null==(S=null==v?void 0:v.body)?void 0:S.scrollTop)||0}}function Ds(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ps(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function As(e){return e?e.nodeType===e.ELEMENT_NODE?e:e.parentElement:null}function z(e,i,a,u){if(!e)return!1;const b=As(e);if(!b)return!1;try{if("string"==typeof i){if(b.classList.contains(i)||u&&null!==b.closest("."+i))return!0}else if(tt(b,i,u))return!0}catch{}return!(!a||!(b.matches(a)||u&&null!==b.closest(a)))}function xt(e,i,a){return!("TITLE"!==e.tagName||!a.headTitleMutations)||-2===i.getId(e)}function Fs(e,i){if(Ie(e))return!1;const a=i.getId(e);return!i.has(a)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||Fs(e.parentNode,i))}function Ht(e){return!!e.changedTouches}function Ws(e,i){return!("IFRAME"!==e.nodeName||!i.getMeta(e))}function _s(e,i){return!("LINK"!==e.nodeName||e.nodeType!==e.ELEMENT_NODE||!e.getAttribute||"stylesheet"!==e.getAttribute("rel")||!i.getMeta(e))}function Bt(e){return!(null==e||!e.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(fo=()=>(new Date).getTime());class vi{constructor(){y(this,"id",1),y(this,"styleIDMap",new WeakMap),y(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,i){if(this.has(e))return this.getId(e);let a;return a=void 0===i?this.id++:i,this.styleIDMap.set(e,a),this.idStyleMap.set(a,e),a}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Us(e){var i,a;let u=null;return(null==(a=null==(i=e.getRootNode)?void 0:i.call(e))?void 0:a.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(u=e.getRootNode().host),u}function ki(e){const i=e.ownerDocument;if(!i)return!1;const a=function Mi(e){let i,a=e;for(;i=Us(a);)a=i;return a}(e);return i.contains(a)}function zs(e){const i=e.ownerDocument;return!!i&&(i.contains(e)||ki(e))}const M=e=>po?(...i)=>{try{return e(...i)}catch(e){if(po&&!0===po(e))return;throw e}}:e;class Tr{constructor(e){y(this,"iframeIdToRemoteIdMap",new WeakMap),y(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,i,a,u){const b=a||this.getIdToRemoteIdMap(e),w=u||this.getRemoteIdToIdMap(e);let S=b.get(i);return S||(S=this.generateIdFn(),b.set(i,S),w.set(S,i)),S}getIds(e,i){const a=this.getIdToRemoteIdMap(e),u=this.getRemoteIdToIdMap(e);return i.map((i=>this.getId(e,i,a,u)))}getRemoteId(e,i,a){const u=a||this.getRemoteIdToIdMap(e);if("number"!=typeof i)return i;return u.get(i)||-1}getRemoteIds(e,i){const a=this.getRemoteIdToIdMap(e);return i.map((i=>this.getRemoteId(e,i,a)))}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 i=this.iframeIdToRemoteIdMap.get(e);return i||(i=new Map,this.iframeIdToRemoteIdMap.set(e,i)),i}getRemoteIdToIdMap(e){let i=this.iframeRemoteIdToIdMap.get(e);return i||(i=new Map,this.iframeRemoteIdToIdMap.set(e,i)),i}}class Ri{constructor(e){y(this,"iframes",new WeakMap),y(this,"crossOriginIframeMap",new WeakMap),y(this,"crossOriginIframeMirror",new Tr(Gr)),y(this,"crossOriginIframeStyleMirror"),y(this,"crossOriginIframeRootIdMap",new WeakMap),y(this,"mirror"),y(this,"mutationCb"),y(this,"wrappedEmit"),y(this,"loadListener"),y(this,"stylesheetManager"),y(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Tr(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,i){var a,u;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:i}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(a=e.contentWindow)||a.addEventListener("message",this.handleMessage.bind(this))),null==(u=this.loadListener)||u.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){const i=e;"@sailfish-rrweb/rrweb"!==i.data.type||(i.origin,i.data.origin)}transformCrossOriginEvent(e,i){var a;switch(i.type){case so.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(i.data.node,e);const a=i.data.node.id;return this.crossOriginIframeRootIdMap.set(e,a),this.patchRootIdOnNode(i.data.node,a),{timestamp:i.timestamp,type:so.IncrementalSnapshot,data:{source:oo.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:i.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case so.Meta:case so.Load:case so.DomContentLoaded:return!1;case so.Plugin:return i;case so.Custom:return this.replaceIds(i.data.payload,e,["id","parentId","previousId","nextId"]),i;case so.IncrementalSnapshot:switch(i.data.source){case oo.Mutation:return i.data.adds.forEach((i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);const a=this.crossOriginIframeRootIdMap.get(e);a&&this.patchRootIdOnNode(i.node,a)})),i.data.removes.forEach((i=>{this.replaceIds(i,e,["parentId","id"])})),i.data.attributes.forEach((i=>{this.replaceIds(i,e,["id"])})),i.data.texts.forEach((i=>{this.replaceIds(i,e,["id"])})),i;case oo.Drag:case oo.TouchMove:case oo.MouseMove:return i.data.positions.forEach((i=>{this.replaceIds(i,e,["id"])})),i;case oo.ViewportResize:return!1;case oo.MediaInteraction:case oo.MouseInteraction:case oo.Scroll:case oo.CanvasMutation:case oo.Input:return this.replaceIds(i.data,e,["id"]),i;case oo.StyleSheetRule:case oo.StyleDeclaration:return this.replaceIds(i.data,e,["id"]),this.replaceStyleIds(i.data,e,["styleId"]),i;case oo.Font:return i;case oo.Selection:return i.data.ranges.forEach((i=>{this.replaceIds(i,e,["start","end"])})),i;case oo.AdoptedStyleSheet:return this.replaceIds(i.data,e,["id"]),this.replaceStyleIds(i.data,e,["styleIds"]),null==(a=i.data.styles)||a.forEach((i=>{this.replaceStyleIds(i,e,["styleId"])})),i}}return!1}replace(e,i,a,u){for(const b of u)!Array.isArray(i[b])&&"number"!=typeof i[b]||(Array.isArray(i[b])?i[b]=e.getIds(a,i[b]):i[b]=e.getId(a,i[b]));return i}replaceIds(e,i,a){return this.replace(this.crossOriginIframeMirror,e,i,a)}replaceStyleIds(e,i,a){return this.replace(this.crossOriginIframeStyleMirror,e,i,a)}replaceIdOnNode(e,i){this.replaceIds(e,i,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach((e=>{this.replaceIdOnNode(e,i)}))}patchRootIdOnNode(e,i){e.type!==$.Document&&!e.rootId&&(e.rootId=i),"childNodes"in e&&e.childNodes.forEach((e=>{this.patchRootIdOnNode(e,i)}))}}function Lr(e){return"__ln"in e}class Ei{constructor(){y(this,"length",0),y(this,"head",null),y(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let i=this.head;for(let a=0;a<e;a++)i=(null==i?void 0:i.next)||null;return i}addNode(e){const i={value:e,previous:null,next:null};if(e.__ln=i,e.previousSibling&&Lr(e.previousSibling)){const a=e.previousSibling.__ln.next;i.next=a,i.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=i,a&&(a.previous=i)}else if(e.nextSibling&&Lr(e.nextSibling)&&e.nextSibling.__ln.previous){const a=e.nextSibling.__ln.previous;i.previous=a,i.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=i,a&&(a.next=i)}else this.head&&(this.head.previous=i),i.next=this.head,this.head=i;null===i.next&&(this.tail=i),this.length++}removeNode(e){const i=e.__ln;this.head&&(i.previous?(i.previous.next=i.next,i.next?i.next.previous=i.previous:this.tail=i.previous):(this.head=i.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const Nr=(e,i)=>`${e}@${i}`;class Ti{constructor(){y(this,"frozen",!1),y(this,"locked",!1),y(this,"texts",[]),y(this,"attributes",[]),y(this,"attributeMap",new WeakMap),y(this,"removes",[]),y(this,"mapRemoves",[]),y(this,"movedMap",{}),y(this,"addedSet",new Set),y(this,"movedSet",new Set),y(this,"droppedSet",new Set),y(this,"mutationCb"),y(this,"blockClass"),y(this,"blockSelector"),y(this,"maskTextClass"),y(this,"maskTextSelector"),y(this,"inlineStylesheet"),y(this,"maskInputOptions"),y(this,"maskTextFn"),y(this,"maskInputFn"),y(this,"keepIframeSrcFn"),y(this,"recordCanvas"),y(this,"inlineImages"),y(this,"slimDOMOptions"),y(this,"dataURLOptions"),y(this,"doc"),y(this,"mirror"),y(this,"iframeManager"),y(this,"stylesheetManager"),y(this,"shadowDomManager"),y(this,"canvasManager"),y(this,"processedNodeManager"),y(this,"unattachedDoc"),y(this,"processMutations",(e=>{e.forEach(this.processMutation),this.emit()})),y(this,"emit",(()=>{if(this.frozen||this.locked)return;const e=[],i=new Set,a=new Ei,n=e=>{let i=e,a=-2;for(;-2===a;)i=i&&i.nextSibling,a=i&&this.mirror.getId(i);return a},o=u=>{if(!u.parentNode||!zs(u)||"TEXTAREA"===u.parentNode.tagName)return;const b=Ie(u.parentNode)?this.mirror.getId(Us(u)):this.mirror.getId(u.parentNode),w=n(u);if(-1===b||-1===w)return a.addNode(u);const S=pe(u,{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=>{Ws(e,this.mirror)&&this.iframeManager.addIframe(e),_s(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Bt(u)&&this.shadowDomManager.addShadowRoot(u.shadowRoot,this.doc)},onIframeLoad:(e,i)=>{this.iframeManager.attachIframe(e,i),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,i)=>{this.stylesheetManager.attachLinkElement(e,i)}});S&&(e.push({parentId:b,nextId:w,node:S}),i.add(S.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)Dr(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||o(e);for(const e of this.addedSet)!Pr(this.droppedSet,e)&&!Dr(this.removes,e,this.mirror)||Pr(this.movedSet,e)?o(e):this.droppedSet.add(e);let u=null;for(;a.length;){let e=null;if(u){const i=this.mirror.getId(u.value.parentNode),a=n(u.value);-1!==i&&-1!==a&&(e=u)}if(!e){let i=a.tail;for(;i;){const a=i;if(i=i.previous,a){const i=this.mirror.getId(a.value.parentNode);if(-1===n(a.value))continue;if(-1!==i){e=a;break}{const i=a.value;if(i.parentNode&&i.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const u=i.parentNode.host;if(-1!==this.mirror.getId(u)){e=a;break}}}}}}if(!e){for(;a.head;)a.removeNode(a.head.value);break}u=e.previous,a.removeNode(e.value),o(e.value)}const b={texts:this.texts.map((e=>{const i=e.node;return i.parentNode&&"TEXTAREA"===i.parentNode.tagName&&this.genTextAreaValueMutation(i.parentNode),{id:this.mirror.getId(i),value:e.value}})).filter((e=>!i.has(e.id))).filter((e=>this.mirror.has(e.id))),attributes:this.attributes.map((e=>{const{attributes:i}=e;if("string"==typeof i.style){const a=JSON.stringify(e.styleDiff),u=JSON.stringify(e._unchangedStyles);a.length<i.style.length&&(a+u).split("var(").length===i.style.split("var(").length&&(i.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:i}})).filter((e=>!i.has(e.id))).filter((e=>this.mirror.has(e.id))),removes:this.removes,adds:e};!b.texts.length&&!b.attributes.length&&!b.removes.length&&!b.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(b))})),y(this,"genTextAreaValueMutation",(e=>{let i=this.attributeMap.get(e);i||(i={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e,i)),i.attributes.value=Array.from(e.childNodes,(e=>e.textContent||"")).join("")})),y(this,"processMutation",(e=>{if(!xt(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const i=e.target.textContent;!z(e.target,this.blockClass,this.blockSelector,!1)&&i!==e.oldValue&&this.texts.push({value:Xr(e.target,this.maskTextClass,this.maskTextSelector,!0)&&i?this.maskTextFn?this.maskTextFn(i,As(e.target)):i.replace(/[\S]/g,"*"):i,node:e.target});break}case"attributes":{const i=e.target;let a=e.attributeName,u=e.target.getAttribute(a);if("value"===a){const e=Yt(i);u=Zt({element:i,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:e,value:u,maskInputFn:this.maskInputFn}).value}if(z(e.target,this.blockClass,this.blockSelector,!1)||u===e.oldValue)return;let b=this.attributeMap.get(e.target);if("IFRAME"===i.tagName&&"src"===a&&!this.keepIframeSrcFn(u)){if(i.contentDocument)return;a="rr_src"}if(b||(b={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(b),this.attributeMap.set(e.target,b)),"type"===a&&"INPUT"===i.tagName&&"password"===(e.oldValue||"").toLowerCase()&&i.setAttribute("data-rr-is-password","true"),!Yr(i.tagName,a)&&(b.attributes[a]=Zr(this.doc,ae(i.tagName),ae(a),u),"style"===a)){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const a=this.unattachedDoc.createElement("span");e.oldValue&&a.setAttribute("style",e.oldValue);for(const e of Array.from(i.style)){const u=i.style.getPropertyValue(e),w=i.style.getPropertyPriority(e);u!==a.style.getPropertyValue(e)||w!==a.style.getPropertyPriority(e)?b.styleDiff[e]=""===w?u:[u,w]:b._unchangedStyles[e]=[u,w]}for(const e of Array.from(a.style))""===i.style.getPropertyValue(e)&&(b.styleDiff[e]=!1)}break}case"childList":if(z(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach((i=>this.genAdds(i,e.target))),e.removedNodes.forEach((i=>{const a=this.mirror.getId(i),u=Ie(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);z(e.target,this.blockClass,this.blockSelector,!1)||xt(i,this.mirror,this.slimDOMOptions)||!function Ci(e,i){return-1!==i.getId(e)}(i,this.mirror)||(this.addedSet.has(i)?(Gt(this.addedSet,i),this.droppedSet.add(i)):this.addedSet.has(e.target)&&-1===a||Fs(e.target,this.mirror)||(this.movedSet.has(i)&&this.movedMap[Nr(a,u)]?Gt(this.movedSet,i):this.removes.push({parentId:u,id:a,isShadow:!(!Ie(e.target)||!ve(e.target))||void 0})),this.mapRemoves.push(i))}))}})),y(this,"genAdds",((e,i)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(xt(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let a=null;i&&this.mirror.hasNode(i)&&(a=this.mirror.getId(i)),a&&-1!==a&&(this.movedMap[Nr(this.mirror.getId(e),a)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);z(e,this.blockClass,this.blockSelector,!1)||(e.childNodes.forEach((e=>this.genAdds(e))),Bt(e)&&e.shadowRoot.childNodes.forEach((i=>{this.processedNodeManager.add(i,this),this.genAdds(i,e)})))}}))}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((i=>{this[i]=e[i]}))}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 Gt(e,i){e.delete(i),i.childNodes.forEach((i=>Gt(e,i)))}function Dr(e,i,a){return 0!==e.length&&function Li(e,i,a){let u=i.parentNode;for(;u;){const i=a.getId(u);if(e.some((e=>e.id===i)))return!0;u=u.parentNode}return!1}(e,i,a)}function Pr(e,i){return 0!==e.size&&Vs(e,i)}function Vs(e,i){const{parentNode:a}=i;return!!a&&(!!e.has(a)||Vs(e,a))}const mo=[];function De(e){try{if("composedPath"in e){const i=e.composedPath();if(i.length)return i[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function js(e,i){var a,u;const b=new Ti;mo.push(b),b.init(e);let w=window.MutationObserver||window.__rrMutationObserver;const S=null==(u=null==(a=null==window?void 0:window.Zone)?void 0:a.__symbol__)?void 0:u.call(a,"MutationObserver");S&&window[S]&&(w=window[S]);const v=new w(M(b.processMutations.bind(b)));return v.observe(i,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),v}function Di({mouseInteractionCb:e,doc:i,mirror:a,blockClass:u,blockSelector:b,sampling:w}){if(!1===w.mouseInteraction)return()=>{};const S=!0===w.mouseInteraction||void 0===w.mouseInteraction?{}:w.mouseInteraction,v=[];let k=null;return Object.keys(io).filter((e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==S[e])).forEach((w=>{let S=ae(w);const C=(i=>w=>{const S=De(w);if(z(S,u,b,!0))return;let v=null,C=i;if("pointerType"in w){switch(w.pointerType){case"mouse":v=ao.Mouse;break;case"touch":v=ao.Touch;break;case"pen":v=ao.Pen}v===ao.Touch?io[i]===io.MouseDown?C="TouchStart":io[i]===io.MouseUp&&(C="TouchEnd"):ao.Pen}else Ht(w)&&(v=ao.Touch);null!==v?(k=v,(C.startsWith("Touch")&&v===ao.Touch||C.startsWith("Mouse")&&v===ao.Mouse)&&(v=null)):io[i]===io.Click&&(v=k,k=null);const I=Ht(w)?w.changedTouches[0]:w;if(!I)return;const O=a.getId(S),{clientX:x,clientY:_}=I;M(e)({type:io[C],id:O,x:x,y:_,...null!==v&&{pointerType:v}})})(w);if(window.PointerEvent)switch(io[w]){case io.MouseDown:case io.MouseUp:S=S.replace("mouse","pointer");break;case io.TouchStart:case io.TouchEnd:return}v.push(U(S,C,i))})),M((()=>{v.forEach((e=>e()))}))}function Hs({scrollCb:e,doc:i,mirror:a,blockClass:u,blockSelector:b,sampling:w}){const S=M(Te(M((w=>{const S=De(w);if(!S||z(S,u,b,!0))return;const v=a.getId(S);if(S===i&&i.defaultView){const a=Ns(i.defaultView);e({id:v,x:a.left,y:a.top})}else e({id:v,x:S.scrollLeft,y:S.scrollTop})})),w.scroll||100));return U("scroll",S,i)}const go=["INPUT","TEXTAREA","SELECT"],yo=new WeakMap;function at(e){return function r(e,i){if(Ge("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Ge("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Ge("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Ge("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const a=Array.from(e.parentRule.cssRules).indexOf(e);i.unshift(a)}else if(e.parentStyleSheet){const a=Array.from(e.parentStyleSheet.cssRules).indexOf(e);i.unshift(a)}return i}(e,[])}function se(e,i,a){let u,b;return e?(e.ownerNode?u=i.getId(e.ownerNode):b=a.getId(e),{styleId:b,id:u}):{}}function Bs({mirror:e,stylesheetManager:i},a){var u,b,w;let S=null;S="#document"===a.nodeName?e.getId(a):e.getId(a.host);const v="#document"===a.nodeName?null==(u=a.defaultView)?void 0:u.Document:null==(w=null==(b=a.ownerDocument)?void 0:b.defaultView)?void 0:w.ShadowRoot,k=null!=v&&v.prototype?Object.getOwnPropertyDescriptor(null==v?void 0:v.prototype,"adoptedStyleSheets"):void 0;return null!==S&&-1!==S&&v&&k?(Object.defineProperty(a,"adoptedStyleSheets",{configurable:k.configurable,enumerable:k.enumerable,get(){var e;return null==(e=k.get)?void 0:e.call(this)},set(e){var a;const u=null==(a=k.set)?void 0:a.call(this,e);if(null!==S&&-1!==S)try{i.adoptStyleSheets(e,S)}catch{}return u}}),M((()=>{Object.defineProperty(a,"adoptedStyleSheets",{configurable:k.configurable,enumerable:k.enumerable,get:k.get,set:k.set})}))):()=>{}}function Bi(e,i={}){const a=e.doc.defaultView;if(!a)return()=>{};let u;!function Hi(e,i){const{mutationCb:a,mousemoveCb:u,mouseInteractionCb:b,scrollCb:w,viewportResizeCb:S,inputCb:v,mediaInteractionCb:k,styleSheetRuleCb:C,styleDeclarationCb:I,canvasMutationCb:O,fontCb:x,selectionCb:_,customElementCb:N}=e;e.mutationCb=(...e)=>{i.mutation&&i.mutation(...e),a(...e)},e.mousemoveCb=(...e)=>{i.mousemove&&i.mousemove(...e),u(...e)},e.mouseInteractionCb=(...e)=>{i.mouseInteraction&&i.mouseInteraction(...e),b(...e)},e.scrollCb=(...e)=>{i.scroll&&i.scroll(...e),w(...e)},e.viewportResizeCb=(...e)=>{i.viewportResize&&i.viewportResize(...e),S(...e)},e.inputCb=(...e)=>{i.input&&i.input(...e),v(...e)},e.mediaInteractionCb=(...e)=>{i.mediaInteaction&&i.mediaInteaction(...e),k(...e)},e.styleSheetRuleCb=(...e)=>{i.styleSheetRule&&i.styleSheetRule(...e),C(...e)},e.styleDeclarationCb=(...e)=>{i.styleDeclaration&&i.styleDeclaration(...e),I(...e)},e.canvasMutationCb=(...e)=>{i.canvasMutation&&i.canvasMutation(...e),O(...e)},e.fontCb=(...e)=>{i.font&&i.font(...e),x(...e)},e.selectionCb=(...e)=>{i.selection&&i.selection(...e),_(...e)},e.customElementCb=(...e)=>{i.customElement&&i.customElement(...e),N(...e)}}(e,i),e.recordDOM&&(u=js(e,e.doc));const b=function Ni({mousemoveCb:e,sampling:i,doc:a,mirror:u}){if(!1===i.mousemove)return()=>{};const b="number"==typeof i.mousemove?i.mousemove:50,w="number"==typeof i.mousemoveCallback?i.mousemoveCallback:500;let S,v=[];const k=Te(M((i=>{const a=Date.now()-S;e(v.map((e=>(e.timeOffset-=a,e))),i),v=[],S=null})),w),C=M(Te(M((e=>{const i=De(e),{clientX:a,clientY:b}=Ht(e)?e.changedTouches[0]:e;S||(S=fo()),v.push({x:a,y:b,id:u.getId(i),timeOffset:fo()-S}),k(typeof DragEvent<"u"&&e instanceof DragEvent?oo.Drag:e instanceof MouseEvent?oo.MouseMove:oo.TouchMove)})),b,{trailing:!1})),I=[U("mousemove",C,a),U("touchmove",C,a),U("drag",C,a)];return M((()=>{I.forEach((e=>e()))}))}(e),w=Di(e),S=Hs(e),v=function Pi({viewportResizeCb:e},{win:i}){let a=-1,u=-1;return U("resize",M(Te(M((()=>{const i=Ds(),b=Ps();(a!==i||u!==b)&&(e({width:Number(b),height:Number(i)}),a=i,u=b)})),200)),i)}(e,{win:a}),k=function Fi({inputCb:e,doc:i,mirror:a,blockClass:u,blockSelector:b,ignoreClass:w,ignoreSelector:S,maskInputOptions:v,maskInputFn:k,sampling:C,userTriggeredOnInput:I}){function p(e){let a=De(e);const C=e.isTrusted,O=a&&a.tagName;if(a&&"OPTION"===O&&(a=a.parentElement),!a||!O||go.indexOf(O)<0||z(a,u,b,!0)||a.classList.contains(w)||S&&a.matches(S))return;let x=a.value,_=!1;const N=Yt(a)||"",{value:D,masked:A}=Zt({element:a,maskInputOptions:v,tagName:O,type:N,value:x,maskInputFn:k});x=D,("radio"===N||"checkbox"===N)&&(_=a.checked),f(a,I?{text:x,isChecked:_,masked:A,userTriggered:C}:{text:x,isChecked:_,masked:A});const F=a.name;"radio"===N&&F&&_&&i.querySelectorAll(`input[type="radio"][name="${F}"]`).forEach((e=>{if(e!==a){const i=e.value;f(e,I?{text:i,isChecked:!_,masked:A,userTriggered:!1}:{text:i,isChecked:!_,masked:A})}}))}function f(i,u){const b=yo.get(i);if(!b||b.text!==u.text||b.isChecked!==u.isChecked||b.masked!==u.masked){yo.set(i,u);const b=a.getId(i);M(e)({...u,id:b})}}const O=("last"===C.input?["change"]:["input","change"]).map((e=>U(e,M(p),i))),x=i.defaultView;if(!x)return()=>{O.forEach((e=>e()))};const _=x.Object.getOwnPropertyDescriptor(x.HTMLInputElement.prototype,"value"),N=[[x.HTMLInputElement.prototype,"value"],[x.HTMLInputElement.prototype,"checked"],[x.HTMLSelectElement.prototype,"value"],[x.HTMLTextAreaElement.prototype,"value"],[x.HTMLSelectElement.prototype,"selectedIndex"],[x.HTMLOptionElement.prototype,"selected"]];return _&&_.set&&O.push(...N.map((e=>mt(e[0],e[1],{set(){M(p)({target:this,isTrusted:!1})}},!1,x)))),M((()=>{O.forEach((e=>e()))}))}(e),C=function Ui({mediaInteractionCb:e,blockClass:i,blockSelector:a,mirror:u,sampling:b,doc:w}){const S=M((w=>Te(M((b=>{const S=De(b);if(!S||z(S,i,a,!0))return;const{currentTime:v,volume:k,muted:C,playbackRate:I,loop:O}=S;e({type:w,id:u.getId(S),currentTime:v,volume:k,muted:C,playbackRate:I,loop:O})})),b.media||500))),v=[U("play",S(co.Play),w),U("pause",S(co.Pause),w),U("seeked",S(co.Seeked),w),U("volumechange",S(co.VolumeChange),w),U("ratechange",S(co.RateChange),w)];return M((()=>{v.forEach((e=>e()))}))}(e);let h=()=>{},p=()=>{},f=()=>{},d2=()=>{};e.recordDOM&&(h=function Wi({styleSheetRuleCb:e,mirror:i,stylesheetManager:a},{win:u}){if(!u.CSSStyleSheet||!u.CSSStyleSheet.prototype)return()=>{};const b=u.CSSStyleSheet.prototype.insertRule;u.CSSStyleSheet.prototype.insertRule=new Proxy(b,{apply:M(((u,b,w)=>{const[S,v]=w,{id:k,styleId:C}=se(b,i,a.styleMirror);return(k&&-1!==k||C&&-1!==C)&&e({id:k,styleId:C,adds:[{rule:S,index:v}]}),u.apply(b,w)}))});const w=u.CSSStyleSheet.prototype.deleteRule;let S,v;u.CSSStyleSheet.prototype.deleteRule=new Proxy(w,{apply:M(((u,b,w)=>{const[S]=w,{id:v,styleId:k}=se(b,i,a.styleMirror);return(v&&-1!==v||k&&-1!==k)&&e({id:v,styleId:k,removes:[{index:S}]}),u.apply(b,w)}))}),u.CSSStyleSheet.prototype.replace&&(S=u.CSSStyleSheet.prototype.replace,u.CSSStyleSheet.prototype.replace=new Proxy(S,{apply:M(((u,b,w)=>{const[S]=w,{id:v,styleId:k}=se(b,i,a.styleMirror);return(v&&-1!==v||k&&-1!==k)&&e({id:v,styleId:k,replace:S}),u.apply(b,w)}))})),u.CSSStyleSheet.prototype.replaceSync&&(v=u.CSSStyleSheet.prototype.replaceSync,u.CSSStyleSheet.prototype.replaceSync=new Proxy(v,{apply:M(((u,b,w)=>{const[S]=w,{id:v,styleId:k}=se(b,i,a.styleMirror);return(v&&-1!==v||k&&-1!==k)&&e({id:v,styleId:k,replaceSync:S}),u.apply(b,w)}))}));const k={};Ze("CSSGroupingRule")?k.CSSGroupingRule=u.CSSGroupingRule:(Ze("CSSMediaRule")&&(k.CSSMediaRule=u.CSSMediaRule),Ze("CSSConditionRule")&&(k.CSSConditionRule=u.CSSConditionRule),Ze("CSSSupportsRule")&&(k.CSSSupportsRule=u.CSSSupportsRule));const C={};return Object.entries(k).forEach((([u,b])=>{C[u]={insertRule:b.prototype.insertRule,deleteRule:b.prototype.deleteRule},b.prototype.insertRule=new Proxy(C[u].insertRule,{apply:M(((u,b,w)=>{const[S,v]=w,{id:k,styleId:C}=se(b.parentStyleSheet,i,a.styleMirror);return(k&&-1!==k||C&&-1!==C)&&e({id:k,styleId:C,adds:[{rule:S,index:[...at(b),v||0]}]}),u.apply(b,w)}))}),b.prototype.deleteRule=new Proxy(C[u].deleteRule,{apply:M(((u,b,w)=>{const[S]=w,{id:v,styleId:k}=se(b.parentStyleSheet,i,a.styleMirror);return(v&&-1!==v||k&&-1!==k)&&e({id:v,styleId:k,removes:[{index:[...at(b),S]}]}),u.apply(b,w)}))})})),M((()=>{u.CSSStyleSheet.prototype.insertRule=b,u.CSSStyleSheet.prototype.deleteRule=w,S&&(u.CSSStyleSheet.prototype.replace=S),v&&(u.CSSStyleSheet.prototype.replaceSync=v),Object.entries(k).forEach((([e,i])=>{i.prototype.insertRule=C[e].insertRule,i.prototype.deleteRule=C[e].deleteRule}))}))}(e,{win:a}),p=Bs(e,e.doc),f=function _i({styleDeclarationCb:e,mirror:i,ignoreCSSAttributes:a,stylesheetManager:u},{win:b}){const w=b.CSSStyleDeclaration.prototype.setProperty;b.CSSStyleDeclaration.prototype.setProperty=new Proxy(w,{apply:M(((b,S,v)=>{var k;const[C,I,O]=v;if(a.has(C))return w.apply(S,[C,I,O]);const{id:x,styleId:_}=se(null==(k=S.parentRule)?void 0:k.parentStyleSheet,i,u.styleMirror);return(x&&-1!==x||_&&-1!==_)&&e({id:x,styleId:_,set:{property:C,value:I,priority:O},index:at(S.parentRule)}),b.apply(S,v)}))});const S=b.CSSStyleDeclaration.prototype.removeProperty;return b.CSSStyleDeclaration.prototype.removeProperty=new Proxy(S,{apply:M(((b,w,v)=>{var k;const[C]=v;if(a.has(C))return S.apply(w,[C]);const{id:I,styleId:O}=se(null==(k=w.parentRule)?void 0:k.parentStyleSheet,i,u.styleMirror);return(I&&-1!==I||O&&-1!==O)&&e({id:I,styleId:O,remove:{property:C},index:at(w.parentRule)}),b.apply(w,v)}))}),M((()=>{b.CSSStyleDeclaration.prototype.setProperty=w,b.CSSStyleDeclaration.prototype.removeProperty=S}))}(e,{win:a}),e.collectFonts&&(d2=function zi({fontCb:e,doc:i}){const a=i.defaultView;if(!a)return()=>{};const u=[],b=new WeakMap,w=a.FontFace;a.FontFace=function(e,i,a){const u=new w(e,i,a);return b.set(u,{family:e,buffer:"string"!=typeof i,descriptors:a,fontSource:"string"==typeof i?i:JSON.stringify(Array.from(new Uint8Array(i)))}),u};const S=Se(i.fonts,"add",(function(i){return function(a){return setTimeout(M((()=>{const i=b.get(a);i&&(e(i),b.delete(a))})),0),i.apply(this,[a])}}));return u.push((()=>{a.FontFace=w})),u.push(S),M((()=>{u.forEach((e=>e()))}))}(e)));const I=function Vi(e){const{doc:i,mirror:a,blockClass:u,blockSelector:b,selectionCb:w}=e;let S=!0;const v=M((()=>{const e=i.getSelection();if(!e||S&&null!=e&&e.isCollapsed)return;S=e.isCollapsed||!1;const v=[],k=e.rangeCount||0;for(let i=0;i<k;i++){const w=e.getRangeAt(i),{startContainer:S,startOffset:k,endContainer:C,endOffset:I}=w;z(S,u,b,!0)||z(C,u,b,!0)||v.push({start:a.getId(S),startOffset:k,end:a.getId(C),endOffset:I})}w({ranges:v})}));return v(),U("selectionchange",v)}(e),O=function ji({doc:e,customElementCb:i}){const a=e.defaultView;return a&&a.customElements?Se(a.customElements,"define",(function(e){return function(a,u,b){try{i({define:{name:a}})}catch{console.warn(`Custom element callback failed for ${a}`)}return e.apply(this,[a,u,b])}})):()=>{}}(e),x=[];for(const i of e.plugins)x.push(i.observer(i.callback,a,i.options));return M((()=>{mo.forEach((e=>e.reset())),null==u||u.disconnect(),b(),w(),S(),v(),k(),C(),h(),p(),f(),d2(),I(),O(),x.forEach((e=>e()))}))}function Ge(e){return typeof window[e]<"u"}function Ze(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}const bo="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Zvcih2YXIgcj0iQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyIsdz10eXBlb2YgVWludDhBcnJheT4idSI/W106bmV3IFVpbnQ4QXJyYXkoMjU2KSxpPTA7aTxyLmxlbmd0aDtpKyspd1tyLmNoYXJDb2RlQXQoaSldPWk7dmFyIHA9ZnVuY3Rpb24ocyl7dmFyIGU9bmV3IFVpbnQ4QXJyYXkocyksbixhPWUubGVuZ3RoLHQ9IiI7Zm9yKG49MDtuPGE7bis9Myl0Kz1yW2Vbbl0+PjJdLHQrPXJbKGVbbl0mMyk8PDR8ZVtuKzFdPj40XSx0Kz1yWyhlW24rMV0mMTUpPDwyfGVbbisyXT4+Nl0sdCs9cltlW24rMl0mNjNdO3JldHVybiBhJTM9PT0yP3Q9dC5zdWJzdHJpbmcoMCx0Lmxlbmd0aC0xKSsiPSI6YSUzPT09MSYmKHQ9dC5zdWJzdHJpbmcoMCx0Lmxlbmd0aC0yKSsiPT0iKSx0fTtjb25zdCBsPW5ldyBNYXAsYj1uZXcgTWFwO2FzeW5jIGZ1bmN0aW9uIHkocyxlLG4pe2NvbnN0IGE9YCR7c30tJHtlfWA7aWYoIk9mZnNjcmVlbkNhbnZhcyJpbiBnbG9iYWxUaGlzKXtpZihiLmhhcyhhKSlyZXR1cm4gYi5nZXQoYSk7Y29uc3QgdD1uZXcgT2Zmc2NyZWVuQ2FudmFzKHMsZSk7dC5nZXRDb250ZXh0KCIyZCIpO2NvbnN0IGc9YXdhaXQoYXdhaXQgdC5jb252ZXJ0VG9CbG9iKG4pKS5hcnJheUJ1ZmZlcigpLGM9cChnKTtyZXR1cm4gYi5zZXQoYSxjKSxjfWVsc2UgcmV0dXJuIiJ9Y29uc3Qgbz1zZWxmO28ub25tZXNzYWdlPWFzeW5jIGZ1bmN0aW9uKHMpe2lmKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcyl7Y29uc3R7aWQ6ZSxiaXRtYXA6bix3aWR0aDphLGhlaWdodDp0LGRhdGFVUkxPcHRpb25zOnV9PXMuZGF0YSxnPXkoYSx0LHUpLGM9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2MuZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCBkPWF3YWl0IGMuY29udmVydFRvQmxvYih1KSx2PWQudHlwZSxoPWF3YWl0IGQuYXJyYXlCdWZmZXIoKSxmPXAoaCk7aWYoIWwuaGFzKGUpJiZhd2FpdCBnPT09ZilyZXR1cm4gbC5zZXQoZSxmKSxvLnBvc3RNZXNzYWdlKHtpZDplfSk7aWYobC5nZXQoZSk9PT1mKXJldHVybiBvLnBvc3RNZXNzYWdlKHtpZDplfSk7by5wb3N0TWVzc2FnZSh7aWQ6ZSx0eXBlOnYsYmFzZTY0OmYsd2lkdGg6YSxoZWlnaHQ6dH0pLGwuc2V0KGUsZil9ZWxzZSByZXR1cm4gby5wb3N0TWVzc2FnZSh7aWQ6cy5kYXRhLmlkfSl9fSkoKTsKLy8jIHNvdXJjZU1hcHBpbmdVUkw9aW1hZ2UtYml0bWFwLWRhdGEtdXJsLXdvcmtlci1Cb1hHVm1Zby5qcy5tYXAK",wo=typeof self<"u"&&self.Blob&&new Blob([(So=bo,Uint8Array.from(atob(So),(e=>e.charCodeAt(0))))],{type:"text/javascript;charset=utf-8"});var So;function Zi(e){let i;try{if(i=wo&&(self.URL||self.webkitURL).createObjectURL(wo),!i)throw"";const a=new Worker(i,{name:null==e?void 0:e.name});return a.addEventListener("error",(()=>{(self.URL||self.webkitURL).revokeObjectURL(i)})),a}catch{return new Worker("data:text/javascript;base64,"+bo,{name:null==e?void 0:e.name})}finally{i&&(self.URL||self.webkitURL).revokeObjectURL(i)}}for(var ko="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Co=typeof Uint8Array>"u"?[]:new Uint8Array(256),Io=0;Io<64;Io++)Co[ko.charCodeAt(Io)]=Io;const Mo=new Map;const Zs=(e,i,a)=>{if(!e||!Xs(e,i)&&"object"!=typeof e)return;const u=function $i(e,i){let a=Mo.get(e);return a||(a=new Map,Mo.set(e,a)),a.has(i)||a.set(i,[]),a.get(i)}(a,e.constructor.name);let b=u.indexOf(e);return-1===b&&(b=u.length,u.push(e)),b};function Je(e,i,a){if(e instanceof Array)return e.map((e=>Je(e,i,a)));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 i=e.constructor.name,a=function(e){var i,a=new Uint8Array(e),u=a.length,b="";for(i=0;i<u;i+=3)b+=ko[a[i]>>2],b+=ko[(3&a[i])<<4|a[i+1]>>4],b+=ko[(15&a[i+1])<<2|a[i+2]>>6],b+=ko[63&a[i+2]];return u%3==2?b=b.substring(0,b.length-1)+"=":u%3==1&&(b=b.substring(0,b.length-2)+"=="),b}(e);return{rr_type:i,base64:a}}if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Je(e.buffer,i,a),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const i=e.constructor.name,{src:a}=e;return{rr_type:i,src:a}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Je(e.data,i,a),e.width,e.height]};if(Xs(e,i)||"object"==typeof e){return{rr_type:e.constructor.name,index:Zs(e,i,a)}}return e}const Ys=(e,i,a)=>e.map((e=>Je(e,i,a))),Xs=(e,i)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((e=>"function"==typeof i[e])).find((a=>e instanceof i[a]));function _r(e,i,a,u){const b=[];try{const w=Se(e.HTMLCanvasElement.prototype,"getContext",(function(e){return function(b,...w){if(!z(this,i,a,!0)){const e=function Ki(e){return"experimental-webgl"===e?"webgl":e}(b);if("__context"in this||(this.__context=e),u&&["webgl","webgl2"].includes(e))if(w[0]&&"object"==typeof w[0]){const e=w[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else w.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[b,...w])}}));b.push(w)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{b.forEach((e=>e()))}}function Ur(e,i,a,u,b,w){const S=[],v=Object.getOwnPropertyNames(e);for(const k of v)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(k))try{if("function"!=typeof e[k])continue;const v=Se(e,k,(function(e){return function(...S){const v=e.apply(this,S);if(Zs(v,w,this),"tagName"in this.canvas&&!z(this.canvas,u,b,!0)){const e=Ys(S,w,this),u={type:i,property:k,args:e};a(this.canvas,u)}return v}}));S.push(v)}catch{const u=mt(e,k,{set(e){a(this.canvas,{type:i,property:k,args:[e],setter:!0})}});S.push(u)}return S}class qi{constructor(e){y(this,"pendingCanvasMutations",new Map),y(this,"rafStamps",{latestId:0,invokeId:null}),y(this,"mirror"),y(this,"mutationCb"),y(this,"resetObservers"),y(this,"frozen",!1),y(this,"locked",!1),y(this,"processMutation",((e,i)=>{(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(i)}));const{sampling:i="all",win:a,blockClass:u,blockSelector:b,recordCanvas:w,dataURLOptions:S}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,w&&"all"===i&&this.initCanvasMutationObserver(a,u,b),w&&"number"==typeof i&&this.initCanvasFPSObserver(i,a,u,b,{dataURLOptions:S})}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,i,a,u,b){const w=_r(i,a,u,!0),S=new Map,v=new Zi;v.onmessage=e=>{const{id:i}=e.data;if(S.set(i,!1),!("base64"in e.data))return;const{base64:a,type:u,width:b,height:w}=e.data;this.mutationCb({id:i,type:lo["2D"],commands:[{property:"clearRect",args:[0,0,b,w]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:a}],type:u}]},0,0]}]})};const k=1e3/e;let C,I=0;const d2=e=>{I&&e-I<k||(I=e,(()=>{const e=[];return i.document.querySelectorAll("canvas").forEach((i=>{z(i,a,u,!0)||e.push(i)})),e})().forEach((async e=>{var i;const a=this.mirror.getId(e);if(S.get(a)||0===e.width||0===e.height)return;if(S.set(a,!0),["webgl","webgl2"].includes(e.__context)){const a=e.getContext(e.__context);!1===(null==(i=null==a?void 0:a.getContextAttributes())?void 0:i.preserveDrawingBuffer)&&a.clear(a.COLOR_BUFFER_BIT)}const u=await createImageBitmap(e);v.postMessage({id:a,bitmap:u,width:e.width,height:e.height,dataURLOptions:b.dataURLOptions},[u])}))),C=requestAnimationFrame(d2)};C=requestAnimationFrame(d2),this.resetObservers=()=>{w(),cancelAnimationFrame(C)}}initCanvasMutationObserver(e,i,a){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const u=_r(e,i,a,!1),b=function Ji(e,i,a,u){const b=[],w=Object.getOwnPropertyNames(i.CanvasRenderingContext2D.prototype);for(const S of w)try{if("function"!=typeof i.CanvasRenderingContext2D.prototype[S])continue;const w=Se(i.CanvasRenderingContext2D.prototype,S,(function(b){return function(...w){return z(this.canvas,a,u,!0)||setTimeout((()=>{const a=Ys(w,i,this);e(this.canvas,{type:lo["2D"],property:S,args:a})}),0),b.apply(this,w)}}));b.push(w)}catch{const a=mt(i.CanvasRenderingContext2D.prototype,S,{set(i){e(this.canvas,{type:lo["2D"],property:S,args:[i],setter:!0})}});b.push(a)}return()=>{b.forEach((e=>e()))}}(this.processMutation.bind(this),e,i,a),w=function Qi(e,i,a,u){const b=[];return b.push(...Ur(i.WebGLRenderingContext.prototype,lo.WebGL,e,a,u,i)),typeof i.WebGL2RenderingContext<"u"&&b.push(...Ur(i.WebGL2RenderingContext.prototype,lo.WebGL2,e,a,u,i)),()=>{b.forEach((e=>e()))}}(this.processMutation.bind(this),e,i,a);this.resetObservers=()=>{u(),b(),w()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const t=e=>{this.rafStamps.latestId=e,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,i)=>{const a=this.mirror.getId(i);this.flushPendingCanvasMutationFor(i,a)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,i){if(this.frozen||this.locked)return;const a=this.pendingCanvasMutations.get(e);if(!a||-1===i)return;const u=a.map((e=>{const{type:i,...a}=e;return a})),{type:b}=a[0];this.mutationCb({id:i,type:b,commands:u}),this.pendingCanvasMutations.delete(e)}}class ea{constructor(){y(this,"nodeMap",new WeakMap),y(this,"active",!1)}inOtherBuffer(e,i){const a=this.nodeMap.get(e);return a&&Array.from(a).some((e=>e!==i))}add(e,i){this.active||(this.active=!0,requestAnimationFrame((()=>{this.nodeMap=new WeakMap,this.active=!1}))),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(i))}destroy(){}}class ta{constructor(e){y(this,"shadowDoms",new WeakSet),y(this,"mutationCb"),y(this,"scrollCb"),y(this,"bypassOptions"),y(this,"mirror"),y(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,i){if(!ve(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const a=js({...this.bypassOptions,doc:i,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push((()=>a.disconnect())),this.restoreHandlers.push(Hs({...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)),this.restoreHandlers.push(Bs({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))}),0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,i){const a=this;this.restoreHandlers.push(Se(e.prototype,"attachShadow",(function(e){return function(u){const b=e.call(this,u);return this.shadowRoot&&zs(this)&&a.addShadowRoot(this.shadowRoot,i),b}})))}reset(){this.restoreHandlers.forEach((e=>{try{e()}catch{}})),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}class ra{constructor(e){y(this,"trackedLinkElements",new WeakSet),y(this,"mutationCb"),y(this,"adoptedStyleSheetCb"),y(this,"styleMirror",new vi),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,i){"_cssText"in i.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:i.id,attributes:i.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,i){if(0===e.length)return;const a={id:i,styleIds:[]},u=[];for(const i of e){let e;this.styleMirror.has(i)?e=this.styleMirror.getId(i):(e=this.styleMirror.add(i),u.push({styleId:e,rules:Array.from(i.rules||CSSRule,((e,i)=>({rule:jr(e),index:i})))})),a.styleIds.push(e)}u.length>0&&(a.styles=u),this.adoptedStyleSheetCb(a)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}let xo,Ro,Eo,Lo=!1;var To;try{if(2!==Array.from([1],(e=>2*e))[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(To=e.contentWindow)?void 0:To.Array.from)||Array.from,document.body.removeChild(e)}}catch(So){console.debug("Unable to override Array.from",So)}const _o=function on(){return new Hr}();function yt(e={}){const{emit:i,checkoutEveryNms:a,checkoutEveryNth:u,blockClass:b="rr-block",blockSelector:w=null,ignoreClass:S="rr-ignore",ignoreSelector:v=null,maskTextClass:k="rr-mask",maskTextSelector:C=null,inlineStylesheet:I=!0,maskAllInputs:O,maskInputOptions:x,slimDOMOptions:_,maskInputFn:N,maskTextFn:D,hooks:A,packFn:F,sampling:W={},dataURLOptions:j={},mousemoveWait:V,recordDOM:$=!0,recordCanvas:G=!1,recordCrossOriginIframes:H=!1,recordAfter:Z=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:B=!1,collectFonts:Y=!1,inlineImages:K=!1,plugins:J,keepIframeSrcFn:q=()=>!1,ignoreCSSAttributes:Q=new Set([]),errorHandler:ee}=e;!function xi(e){po=e}(ee);const te=!H||window.parent===window;let re=!1;if(!te)try{window.parent.document&&(re=!1)}catch{re=!0}if(te&&!i)throw new Error("emit function is required");if(!te&&!re)return()=>{};void 0!==V&&void 0===W.mousemove&&(W.mousemove=V),_o.reset();const ne=!0===O?{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!==x?x:{password:!0},oe=!0===_||"all"===_?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===_,headMetaDescKeywords:"all"===_,headTitleMutations:"all"===_}:_||{};!function Ii(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 i=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===i)return!0}while(i=i&&i.parentNode);return!1})}();let ie,le=0;const or=e=>{for(const i of J||[])i.eventProcessor&&(e=i.eventProcessor(e));return F&&!re&&(e=F(e)),e};xo=(e,b)=>{var w;const S=e;if(S.timestamp=fo(),null!=(w=mo[0])&&w.isFrozen()&&S.type!==so.FullSnapshot&&!(S.type===so.IncrementalSnapshot&&S.data.source===oo.Mutation)&&mo.forEach((e=>e.unfreeze())),te)null==i||i(or(S),b);else if(re){const e={type:"@sailfish-rrweb/rrweb",event:or(S),origin:window.location.origin,isCheckout:b};window.parent.postMessage(e,"*")}if(S.type===so.FullSnapshot)ie=S,le=0;else if(S.type===so.IncrementalSnapshot){if(S.data.source===oo.Mutation&&S.data.isAttachIframe)return;le++;const e=u&&le>=u,i=a&&S.timestamp-ie.timestamp>a;(e||i)&&Ro(!0)}};const Pe=e=>{xo({type:so.IncrementalSnapshot,data:{source:oo.Mutation,...e}})},ir=e=>xo({type:so.IncrementalSnapshot,data:{source:oo.Scroll,...e}}),ar=e=>xo({type:so.IncrementalSnapshot,data:{source:oo.CanvasMutation,...e}}),ce=new ra({mutationCb:Pe,adoptedStyleSheetCb:e=>xo({type:so.IncrementalSnapshot,data:{source:oo.AdoptedStyleSheet,...e}})}),ue=new Ri({mirror:_o,mutationCb:Pe,stylesheetManager:ce,recordCrossOriginIframes:H,wrappedEmit:xo});for(const e of J||[])e.getMirror&&e.getMirror({nodeMirror:_o,crossOriginIframeMirror:ue.crossOriginIframeMirror,crossOriginIframeStyleMirror:ue.crossOriginIframeStyleMirror});const he=new ea;Eo=new qi({recordCanvas:G,mutationCb:ar,win:window,blockClass:b,blockSelector:w,mirror:_o,sampling:W.canvas,dataURLOptions:j});const de=new ta({mutationCb:Pe,scrollCb:ir,bypassOptions:{blockClass:b,blockSelector:w,maskTextClass:k,maskTextSelector:C,inlineStylesheet:I,maskInputOptions:ne,dataURLOptions:j,maskTextFn:D,maskInputFn:N,recordCanvas:G,inlineImages:K,sampling:W,slimDOMOptions:oe,iframeManager:ue,stylesheetManager:ce,canvasManager:Eo,keepIframeSrcFn:q,processedNodeManager:he},mirror:_o});Ro=(e=!1)=>{if(!$)return;xo({type:so.Meta,data:{href:window.location.href,width:Ps(),height:Ds()}},e),ce.reset(),de.init(),mo.forEach((e=>e.lock()));const i=function Rn(e,i){const{mirror:a=new Hr,blockClass:u="rr-block",blockSelector:b=null,maskTextClass:w="rr-mask",maskTextSelector:S=null,inlineStylesheet:v=!0,inlineImages:k=!1,recordCanvas:C=!1,maskAllInputs:I=!1,maskTextFn:O,maskInputFn:x,slimDOM:_=!1,dataURLOptions:N,preserveWhiteSpace:D,onSerialize:A,onIframeLoad:F,iframeLoadTimeout:W,onStylesheetLoad:j,stylesheetLoadTimeout:V,keepIframeSrcFn:$=()=>!1}=i;return pe(e,{doc:e,mirror:a,blockClass:u,blockSelector:b,maskTextClass:w,maskTextSelector:S,skipChild:!1,inlineStylesheet:v,maskInputOptions:!0===I?{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===I?{password:!0}:I,maskTextFn:O,maskInputFn:x,slimDOMOptions:!0===_||"all"===_?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===_,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===_?{}:_,dataURLOptions:N,inlineImages:k,recordCanvas:C,preserveWhiteSpace:D,onSerialize:A,onIframeLoad:F,iframeLoadTimeout:W,onStylesheetLoad:j,stylesheetLoadTimeout:V,keepIframeSrcFn:$,newlyAddedElement:!1})}(document,{mirror:_o,blockClass:b,blockSelector:w,maskTextClass:k,maskTextSelector:C,inlineStylesheet:I,maskAllInputs:ne,maskTextFn:D,maskInputFn:N,slimDOM:oe,dataURLOptions:j,recordCanvas:G,inlineImages:K,onSerialize:e=>{Ws(e,_o)&&ue.addIframe(e),_s(e,_o)&&ce.trackLinkElement(e),Bt(e)&&de.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,i)=>{ue.attachIframe(e,i),de.observeAttachShadow(e)},onStylesheetLoad:(e,i)=>{ce.attachLinkElement(e,i)},keepIframeSrcFn:q});if(!i)return console.warn("Failed to snapshot the document");xo({type:so.FullSnapshot,data:{node:i,initialOffset:Ns(window)}},e),mo.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ce.adoptStyleSheets(document.adoptedStyleSheets,_o.getId(document))};try{const e=[],X=e=>{var i;return M(Bi)({mutationCb:Pe,mousemoveCb:(e,i)=>xo({type:so.IncrementalSnapshot,data:{source:i,positions:e}}),mouseInteractionCb:e=>xo({type:so.IncrementalSnapshot,data:{source:oo.MouseInteraction,...e}}),scrollCb:ir,viewportResizeCb:e=>xo({type:so.IncrementalSnapshot,data:{source:oo.ViewportResize,...e}}),inputCb:e=>xo({type:so.IncrementalSnapshot,data:{source:oo.Input,...e}}),mediaInteractionCb:e=>xo({type:so.IncrementalSnapshot,data:{source:oo.MediaInteraction,...e}}),styleSheetRuleCb:e=>xo({type:so.IncrementalSnapshot,data:{source:oo.StyleSheetRule,...e}}),styleDeclarationCb:e=>xo({type:so.IncrementalSnapshot,data:{source:oo.StyleDeclaration,...e}}),canvasMutationCb:ar,fontCb:e=>xo({type:so.IncrementalSnapshot,data:{source:oo.Font,...e}}),selectionCb:e=>{xo({type:so.IncrementalSnapshot,data:{source:oo.Selection,...e}})},customElementCb:e=>{xo({type:so.IncrementalSnapshot,data:{source:oo.CustomElement,...e}})},blockClass:b,ignoreClass:S,ignoreSelector:v,maskTextClass:k,maskTextSelector:C,maskInputOptions:ne,inlineStylesheet:I,sampling:W,recordDOM:$,recordCanvas:G,inlineImages:K,userTriggeredOnInput:B,collectFonts:Y,doc:e,maskInputFn:N,maskTextFn:D,keepIframeSrcFn:q,blockSelector:w,slimDOMOptions:oe,dataURLOptions:j,mirror:_o,iframeManager:ue,stylesheetManager:ce,shadowDomManager:de,processedNodeManager:he,canvasManager:Eo,ignoreCSSAttributes:Q,plugins:(null==(i=null==J?void 0:J.filter((e=>e.observer)))?void 0:i.map((e=>({observer:e.observer,options:e.options,callback:i=>xo({type:so.Plugin,data:{plugin:e.name,payload:i}})}))))||[]},A)};ue.addLoadListener((i=>{try{e.push(X(i.contentDocument))}catch(e){console.warn(e)}}));const x2=()=>{Ro(),e.push(X(document)),Lo=!0};return"interactive"===document.readyState||"complete"===document.readyState?x2():(e.push(U("DOMContentLoaded",(()=>{xo({type:so.DomContentLoaded,data:{}}),"DOMContentLoaded"===Z&&x2()}))),e.push(U("load",(()=>{xo({type:so.Load,data:{}}),"load"===Z&&x2()}),window))),()=>{e.forEach((e=>e())),he.destroy(),Lo=!1,function Oi(){po=void 0}()}}catch(e){console.warn(e)}}yt.addCustomEvent=(e,i)=>{if(!Lo)throw new Error("please add custom event after start recording");xo({type:so.Custom,data:{tag:e,payload:i}})},yt.freezePage=()=>{mo.forEach((e=>e.freeze()))},yt.takeFullSnapshot=e=>{if(!Lo)throw new Error("please take full snapshot after start recording");Ro(e)},yt.mirror=_o;function maskInputFn(e,i){var a;if("hidden"===i.type)return"";const u={creditCard:/\b(?:\d[ -]*?){13,16}\b/,ssn:/\b\d{3}-\d{2}-\d{4}\b/};return i.closest(".mask")?"*".repeat(e.length):i.hasAttribute("data-cc")||(null==(a=i.getAttribute("autocomplete"))?void 0:a.startsWith("cc-"))||u.creditCard.test(e)?"**** **** **** "+e.slice(-4):i.hasAttribute("data-ssn")||u.ssn.test(e)?"***-**-"+e.slice(-4):i.hasAttribute("data-dob")?"**/**/"+e.slice(-4):e}async function initializeRecording(e,i,a,u,b){const w=initializeWebSocket(a,u,b);try{yt({emit(e){cacheEvents(e)},plugins:[_$1(i)],maskInputOptions:{text:!0},maskInputFn:maskInputFn,maskTextClass:"sailfishSanitize",...e}),setInterval((()=>sendRecordingEvents(w)),1e4)}catch(e){console.error("Error importing plugins!",e)}return w}let No=null,Do=null;function identify(e,i={},a=!1){const u={type:"identify",userId:e,traits:i};No&&No.userId===e&&JSON.stringify(No.traits)===JSON.stringify(i)||(No={userId:e,traits:i,overwrite:a},sendMessage(u))}function addOrUpdateMetadata(e){const i={type:"addOrUpdateMetadata",metadata:e};Do&&JSON.stringify(Do)===JSON.stringify(e)||(Do=e,sendMessage(i))}const Po=["t.co","*.twitter.com","*.gravatar.com","*.googleapis.com","*.amazonaws.com","*.smooch.io","*.zendesk.com"],Ao={recordCanvas:!1,recordCrossOriginIframes:!1,collectFonts:!1,inlineImages:!1,recordPassword:!1,recordRealName:!0,recordCreditCardInfo:!1,recordSsn:!1,recordDob:!1,sampling:{}},Fo={level:["info","log","warn","error"],lengthThreshold:1e4,stringifyOptions:{stringLengthLimit:1e3,numOfKeysLimit:20,depthOfLimit:1},logger:"console"};function trackDomainChanges(){let e=window.location.href;const checkDomainChange=(i=!1)=>{const a=window.location.href;if(i||a!==e){e=a;sendMessage({type:"routeChange",data:{url:a,timestamp:Date.now()}})}},i=function debounce(e,i){let a;return function(...u){clearTimeout(a),a=setTimeout((()=>e(...u)),i)}}((()=>checkDomainChange()),500);checkDomainChange(!0),setInterval(i,1e3)}function getOrSetSessionId(e=!1){let i=sessionStorage.getItem("sailfishSessionId");return i&&!e||(!function getTabKey(){let e=sessionStorage.getItem("sailfishTabKey");return e||(e=v4(),sessionStorage.setItem("sailfishTabKey",e)),e}(),i=v4(),sessionStorage.setItem("sailfishSessionId",i)),i}function matchUrlWithWildcard(e,i){if(!e||"string"!=typeof e)throw new Error("Invalid URL input");const a=(e.match(/^[a-zA-Z]+:\/\//)?e:`http://${e}`).replace(/^[a-zA-Z]+:\/\//,""),u=new URL("http://"+a),{hostname:b,pathname:w,port:S}=u,v=b.startsWith("www.")?b.slice(4).toLowerCase():b.toLowerCase();return i.some((e=>{const i=e.replace(/^[a-zA-Z]+:\/\//,"");let[a,u]=i.split("/",2),b="";a.includes(":")&&([a,b]=a.split(":"));const k=a.replace(/\./g,"\\.").replace(/\*/g,".*"),C=new RegExp(`^${k}$`,"i"),I=v.startsWith("www.")?v.slice(4):v;if(b&&S!==b)return!1;if(a.startsWith("*.")&&(v===a.slice(2)||I===a.slice(2))){if(u){const e=u.replace(/\*/g,".*").replace(/\/$/,"");return new RegExp(`^/${e}`,"i").test(w)}return!0}if(!C.test(I)&&!C.test(v))return!1;if(u){const e=u.replace(/\*/g,".*").replace(/\/$/,"");return new RegExp(`^/${e}`,"i").test(w)}return!0}))}async function startRecording({apiKey:e,backendApi:i="https://api-service.sailfishqa.com",domainsToPropagateHeaderTo:a=[],domainsToNotPropagateHeaderTo:u=[],serviceVersion:b=""}){var w,S;let v=getOrSetSessionId();!function storeCredentialsAndConnection({apiKey:e,backendApi:i}){sessionStorage.setItem("sailfishApiKey",e),sessionStorage.setItem("sailfishBackendApi",i)}({apiKey:e,backendApi:i}),trackDomainChanges(),u.length>0&&sendDomainsToNotPropagateHeaderTo(e,u,i).catch((e=>console.error("Failed to send domains to not propagate header to:",e))),function setupXMLHttpRequestInterceptor(e,i=[]){const a=XMLHttpRequest.prototype.open,u=XMLHttpRequest.prototype.send,b=getOrSetSessionId(),w=[...Po,...e];XMLHttpRequest.prototype.open=function(e,i,...u){return this._requestUrl="string"==typeof i&&i.length>0?i:null,a.apply(this,[e,i,...u])},XMLHttpRequest.prototype.send=function(...e){const a=this._requestUrl;if(!a)return u.apply(this,e);if(matchUrlWithWildcard(a,w))return u.apply(this,e);const S=0===i.length||matchUrlWithWildcard(a,i);if(b&&S)try{this.setRequestHeader("X-Sf3-Rid",b)}catch(e){console.warn(`Could not set X-Sf3-Rid header for ${a}`,e)}return u.apply(this,e)}}(u,a),function setupFetchInterceptor(e,i=[]){const a=window.fetch,u=getOrSetSessionId(),b=[...Po,...e],w=new Map;function injectHeader(e,i,a,u,b,w){if(w){if(u instanceof Request){const a=u.clone(),S=new Headers(a.headers);S.set("X-Sf3-Rid",w);const v=new Request(a,{headers:S});return e.call(i,v,b)}{const a={...b},S=new Headers(b.headers||{});return S.set("X-Sf3-Rid",w),a.headers=S,e.call(i,u,a)}}return e.apply(i,a)}window.fetch=new Proxy(a,{apply:(e,a,S)=>{let v,k=S[0],C=S[1]||{};if("string"==typeof k)v=k;else if(k instanceof Request)v=k.url;else{if(!(k instanceof URL))return e.apply(a,S);v=k.href}if(w.has(v)){const i=w.get(v);if("ignore"===i)return e.apply(a,S);if("propagate"===i)return injectHeader(e,a,S,k,C,u)}return matchUrlWithWildcard(v,b)?(w.set(v,"ignore"),e.apply(a,S)):0===i.length||matchUrlWithWildcard(v,i)?(w.set(v,"propagate"),injectHeader(e,a,S,k,C,u)):(w.set(v,"ignore"),e.apply(a,S))}})}(u,a),async function gatherAndCacheDeviceInfo(){sendMessage({type:"deviceInfo",data:{deviceInfo:{language:navigator.language,userAgent:navigator.userAgent}}})}();try{const a=(null==(w=(await fetchCaptureSettings(e,i)).data)?void 0:w.captureSettingsFromApiKey)||Ao,u=await startRecordingSession(e,v,i);if(null==(S=u.data)?void 0:S.startRecordingSession){const u=await initializeRecording(a,Fo,i,e,v);!function sendMapUuidIfAvailable(e){window.sfMapUuid&&sendMessage({type:"mapUuid",data:{mapUuid:window.sfMapUuid,serviceVersion:e}})}(b),setInterval((()=>{u&&u.readyState===WebSocket.OPEN&&sendRecordingEvents(u)}),1e4)}else console.error("Failed to start recording session:",u.errors||u)}catch(e){console.error("Error starting recording:",e)}}!function sendUserDeviceUuid(){sendMessage({type:"userDeviceUuid",userDeviceUuid:function getOrSetUserDeviceUuid(){let e=localStorage.getItem("sailfishUserDeviceUuid");e||(e=v4(),localStorage.setItem("sailfishUserDeviceUuid",e));return e}()})}(),function sendTimeZone(){sendMessage({type:"timeZone",timezone:Intl.DateTimeFormat().resolvedOptions().timeZone})}(),document.addEventListener("visibilitychange",(function handleVisibilityChange(){"visible"===document.visibilityState&&getOrSetSessionId()})),window.addEventListener("beforeunload",(function storeSessionId(){}));export{Ao as DEFAULT_CAPTURE_SETTINGS,Fo as DEFAULT_CONSOLE_RECORDING_SETTINGS,addOrUpdateMetadata,cacheEvents,fetchCaptureSettings,identify,initializeRecording,initializeWebSocket,matchUrlWithWildcard,sendDomainsToNotPropagateHeaderTo,sendGraphQLRequest,sendMessage,sendRecordingEvents,startRecording,startRecordingSession};