@sailfish-ai/recorder 1.8.1 → 1.8.2

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 +0,0 @@
1
- function readDebugFlag(){var e;try{const e=globalThis;if("boolean"==typeof e.__SAILFISH_DEBUG__)return e.__SAILFISH_DEBUG__}catch{}try{const a="undefined"!=typeof process?process:void 0;if(null!=(null==(e=null==a?void 0:a.env)?void 0:e.SAILFISH_DEBUG)){const e=String(a.env.SAILFISH_DEBUG).toLowerCase();return"1"===e||"true"===e||"yes"===e}}catch{}try{const e=globalThis.__SAILFISH_DEBUG_DEFINE__;if("boolean"==typeof e)return e}catch{}return!1}for(var e,a=[],u=0;u<256;++u)a.push((u+256).toString(16).slice(1));var m=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(m)}var w={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function v4(e,u,m){if(w.randomUUID&&!e)return w.randomUUID();var b=(e=e||{}).random||(e.rng||rng)();return b[6]=15&b[6]|64,b[8]=63&b[8]|128,function unsafeStringify(e,u=0){return(a[e[u+0]]+a[e[u+1]]+a[e[u+2]]+a[e[u+3]]+"-"+a[e[u+4]]+a[e[u+5]]+"-"+a[e[u+6]]+a[e[u+7]]+"-"+a[e[u+8]]+a[e[u+9]]+"-"+a[e[u+10]]+a[e[u+11]]+a[e[u+12]]+a[e[u+13]]+a[e[u+14]]+a[e[u+15]]).toLowerCase()}(b)}const b="X-Sf3-Rid",S=0,C=1,x=2,I=3,_=4,O=[".js",".mjs",".cjs",".ts",".css",".scss",".sass",".less",".styl",".stylus",".png",".jpg",".jpeg",".gif",".svg",".webp",".avif",".bmp",".ico",".tiff",".tif",".heic",".woff",".woff2",".ttf",".otf",".eot",".mp4",".webm",".ogv",".mp3",".wav",".flac",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".csv",".json",".xml",".txt",".zip",".rar",".gz",".tar",".7z",".map",".webmanifest"];var extendStatics=function(e,a){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,a){e.__proto__=a}||function(e,a){for(var u in a)a.hasOwnProperty(u)&&(e[u]=a[u])})(e,a)};function __extends(e,a){function __(){this.constructor=e}extendStatics(e,a),e.prototype=null===a?Object.create(a):(__.prototype=a.prototype,new __)}function __read(e,a){var u="function"==typeof Symbol&&e[Symbol.iterator];if(!u)return e;var m,w,b=u.call(e),S=[];try{for(;(void 0===a||a-- >0)&&!(m=b.next()).done;)S.push(m.value)}catch(e){w={error:e}}finally{try{m&&!m.done&&(u=b.return)&&u.call(b)}finally{if(w)throw w.error}}return S}var E=function(){return function Event2(e,a){this.target=a,this.type=e}}(),D=function(e){function ErrorEvent2(a,u){var m=e.call(this,"error",u)||this;return m.message=a.message,m.error=a,m}return __extends(ErrorEvent2,e),ErrorEvent2}(E),F=function(e){function CloseEvent2(a,u,m){void 0===a&&(a=1e3),void 0===u&&(u="");var w=e.call(this,"close",m)||this;return w.wasClean=!0,w.code=a,w.reason=u,w}return __extends(CloseEvent2,e),CloseEvent2}(E),U={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+4e3*Math.random(),minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0},$=function(){function ReconnectingWebSocket2(e,a,u){var m=this;void 0===u&&(u={}),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){m._debug("open event");var a=m._options.minUptime,u=void 0===a?U.minUptime:a;clearTimeout(m._connectTimeout),m._uptimeTimeout=setTimeout(function(){return m._acceptOpen()},u),m._ws.binaryType=m._binaryType,m._messageQueue.forEach(function(e){return m._ws.send(e)}),m._messageQueue=[],m.onopen&&m.onopen(e),m._listeners.open.forEach(function(a){return m._callEventListener(e,a)})},this._handleMessage=function(e){m._debug("message event"),m.onmessage&&m.onmessage(e),m._listeners.message.forEach(function(a){return m._callEventListener(e,a)})},this._handleError=function(e){m._debug("error event",e.message),m._disconnect(void 0,"TIMEOUT"===e.message?"timeout":void 0),m.onerror&&m.onerror(e),m._debug("exec error listeners"),m._listeners.error.forEach(function(a){return m._callEventListener(e,a)}),m._connect()},this._handleClose=function(e){m._debug("close event"),m._clearTimeouts(),m._shouldReconnect&&m._connect(),m.onclose&&m.onclose(e),m._listeners.close.forEach(function(a){return m._callEventListener(e,a)})},this._url=e,this._protocols=a,this._options=u,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,a){return"string"==typeof a?e+=a.length:a instanceof Blob?e+=a.size:e+=a.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,a){void 0===e&&(e=1e3),this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),this._ws?this._ws.readyState!==this.CLOSED?this._ws.close(e,a):this._debug("close: already closed"):this._debug("close enqueued: no ws instance")},ReconnectingWebSocket2.prototype.reconnect=function(e,a){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,this._ws&&this._ws.readyState!==this.CLOSED?(this._disconnect(e,a),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 a=this._options.maxEnqueuedMessages,u=void 0===a?U.maxEnqueuedMessages:a;this._messageQueue.length<u&&(this._debug("enqueue",e),this._messageQueue.push(e))}},ReconnectingWebSocket2.prototype.addEventListener=function(e,a){this._listeners[e]&&this._listeners[e].push(a)},ReconnectingWebSocket2.prototype.dispatchEvent=function(e){var a,u,m=this._listeners[e.type];if(m)try{for(var w=function __values(e){var a="function"==typeof Symbol&&e[Symbol.iterator],u=0;return a?a.call(e):{next:function(){return e&&u>=e.length&&(e=void 0),{value:e&&e[u++],done:!e}}}}(m),b=w.next();!b.done;b=w.next()){var S=b.value;this._callEventListener(e,S)}}catch(e){a={error:e}}finally{try{b&&!b.done&&(u=w.return)&&u.call(w)}finally{if(a)throw a.error}}return!0},ReconnectingWebSocket2.prototype.removeEventListener=function(e,a){this._listeners[e]&&(this._listeners[e]=this._listeners[e].filter(function(e){return e!==a}))},ReconnectingWebSocket2.prototype._debug=function(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a];this._options.debug&&console.log.apply(console,function __spread(){for(var e=[],a=0;a<arguments.length;a++)e=e.concat(__read(arguments[a]));return e}(["RWS>"],e))},ReconnectingWebSocket2.prototype._getNextDelay=function(){var e=this._options,a=e.reconnectionDelayGrowFactor,u=void 0===a?U.reconnectionDelayGrowFactor:a,m=e.minReconnectionDelay,w=void 0===m?U.minReconnectionDelay:m,b=e.maxReconnectionDelay,S=void 0===b?U.maxReconnectionDelay:b,C=0;return this._retryCount>0&&(C=w*Math.pow(u,this._retryCount-1))>S&&(C=S),this._debug("next delay",C),C},ReconnectingWebSocket2.prototype._wait=function(){var e=this;return new Promise(function(a){setTimeout(a,e._getNextDelay())})},ReconnectingWebSocket2.prototype._getNextUrl=function(e){if("string"==typeof e)return Promise.resolve(e);if("function"==typeof e){var a=e();if("string"==typeof a)return Promise.resolve(a);if(a.then)return a}throw Error("Invalid URL")},ReconnectingWebSocket2.prototype._connect=function(){var e=this;if(!this._connectLock&&this._shouldReconnect){this._connectLock=!0;var a=this._options,u=a.maxRetries,m=void 0===u?U.maxRetries:u,w=a.connectionTimeout,b=void 0===w?U.connectionTimeout:w,S=a.WebSocket,C=void 0===S?function(){if("undefined"!=typeof WebSocket)return WebSocket}():S;if(this._retryCount>=m)this._debug("max retries reached",this._retryCount,">=",m);else{if(this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),void 0===(x=C)||!x||2!==x.CLOSING)throw Error("No valid WebSocket class provided");var x;this._wait().then(function(){return e._getNextUrl(e._url)}).then(function(a){e._closeCalled||(e._debug("connect",{url:a,protocols:e._protocols}),e._ws=e._protocols?new C(a,e._protocols):new C(a),e._ws.binaryType=e._binaryType,e._connectLock=!1,e._addListeners(),e._connectTimeout=setTimeout(function(){return e._handleTimeout()},b))})}}},ReconnectingWebSocket2.prototype._handleTimeout=function(){this._debug("timeout event"),this._handleError(new D(Error("TIMEOUT"),this))},ReconnectingWebSocket2.prototype._disconnect=function(e,a){if(void 0===e&&(e=1e3),this._clearTimeouts(),this._ws){this._removeListeners();try{this._ws.close(e,a),this._handleClose(new F(e,a,this))}catch(e){}}},ReconnectingWebSocket2.prototype._acceptOpen=function(){this._debug("accept open"),this._retryCount=0},ReconnectingWebSocket2.prototype._callEventListener=function(e,a){"handleEvent"in a?a.handleEvent(e):a(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}();const B="recordingEvents";let z=null;function openDb$1(){return function hasIndexedDB$1(){return"undefined"!=typeof globalThis&&!!globalThis.indexedDB}()?z||(z=new Promise(e=>{try{const a=globalThis.indexedDB.open("leapsEventDB",1);a.onupgradeneeded=()=>{const e=a.result;e.objectStoreNames.contains(B)||e.createObjectStore(B,{keyPath:"id",autoIncrement:!0})},a.onsuccess=()=>e(a.result),a.onerror=()=>e(null),a.onblocked=()=>{e(null)}}catch{e(null)}}),z):Promise.resolve(null)}function withStore$1(e,a){return openDb$1().then(u=>u?new Promise(m=>{try{const w=u.transaction(B,e),b=w.objectStore(B);Promise.resolve(a(b)).then(e=>{w.oncomplete=()=>m(e),w.onerror=()=>m(null)}).catch(()=>m(null))}catch{m(null)}}):null)}async function saveEventToIDB(e){await withStore$1("readwrite",a=>{a.add({timestamp:Date.now(),data:e})})}async function deleteEventsByIds(e){await withStore$1("readwrite",async a=>{for(const u of e)a.delete(u)})}const j="notifyMessages";let V=null;function openDb(){return function hasIndexedDB(){return"undefined"!=typeof globalThis&&!!globalThis.indexedDB}()?V||(V=new Promise(e=>{try{const a=globalThis.indexedDB.open("leapsNotifyDB",1);a.onupgradeneeded=()=>{const e=a.result;e.objectStoreNames.contains(j)||e.createObjectStore(j,{keyPath:"id",autoIncrement:!0})},a.onsuccess=()=>e(a.result),a.onerror=()=>e(null),a.onblocked=()=>e(null)}catch{e(null)}}),V):Promise.resolve(null)}async function withStore(e,a){const u=await openDb();return u?new Promise(m=>{try{const w=u.transaction(j,e),b=w.objectStore(j);Promise.resolve(a(b)).then(e=>{w.oncomplete=()=>m(e),w.onerror=()=>m(null)}).catch(()=>m(null))}catch{m(null)}}):null}async function saveNotifyMessageToIDB(e){await withStore("readwrite",a=>{a.add({value:e})})}async function deleteNotifyMessageById(e){await withStore("readwrite",a=>{a.delete(e)})}const q="undefined"!=typeof globalThis&&void 0!==globalThis.window,H="undefined"!=typeof globalThis&&void 0!==globalThis.document,Y="undefined"!=typeof globalThis&&"localStorage"in globalThis,J="undefined"!=typeof globalThis&&"sessionStorage"in globalThis;function getOrSetSessionId(){return q?(window.name||(window.name=v4()),window.name):v4()}function buildBatches(e,a,u){const m={};for(const a of e){const e=a.data.sessionId||"unknown";m[e]||(m[e]=[]),m[e].push(a)}const w=[];for(const e in m){const b=m[e];let S=[],C=0;for(const e of b){const m=a(e);C+m>u&&(S.length>0&&(w.push(S),S=[],C=0),m>u)||(S.push(e),C+=m)}S.length>0&&w.push(S)}return w}function eventSize(e){return new Blob([JSON.stringify(e)]).size}let X=Date.now;function withAppUrlMetadata(e){var a;return{...e??{},appUrl:(null==e?void 0:e.appUrl)??(null==(a=null==window?void 0:window.location)?void 0:a.href)}}/[1-9][0-9]{12}/.test(Date.now().toString())||(X=()=>(new Date).getTime());const Q=readDebugFlag();let ee=null,te=!1,ne=null,re=null;function isWebSocketOpen(e){return(null==e?void 0:e.readyState)===WebSocket.OPEN}async function flushNotifyQueue(){const e=await async function getAllNotifyMessages(){return await withStore("readonly",e=>new Promise(a=>{const u=e.getAll();u.onsuccess=()=>a(u.result),u.onerror=()=>a([])}))??[]}();if(isWebSocketOpen(ee))try{for(const a of e)ee.send(a.value),await deleteNotifyMessageById(a.id)}catch(e){}}async function flushBufferedEvents(){if(isWebSocketOpen(ee))if(ne)await ne;else{ne=(async()=>{var e,a;const u=await async function getAllIndexedEvents(){return await withStore$1("readonly",e=>new Promise(a=>{const u=e.getAll();u.onsuccess=()=>a(u.result),u.onerror=()=>a([])}))??[]}(),m={};for(const w of u){const u=(null==(a=null==(e=null==w?void 0:w.data)?void 0:e.data)?void 0:a.sessionId)??"unknown-session";m[u]||(m[u]=[]),m[u].push(w)}for(const e of Object.values(m)){const a=buildBatches(e,e=>eventSize(e.data),52428800);for(const e of a){if(!isWebSocketOpen(ee))break;const a=e.map(e=>{var a,u;return{...e.data,appUrl:(null==(a=e.data)?void 0:a.appUrl)??(null==(u=null==window?void 0:window.location)?void 0:u.href)}}),u=e.map(e=>e.id).filter(e=>null!=e);try{const e=JSON.stringify({type:"events",events:a,mapUuid:window.sfMapUuid});ee.send(e),await deleteEventsByIds(u)}catch(e){}}}})();try{await ne}finally{ne=null}}}function sendEvent(e){var a;const u={...e,app_url:(null==e?void 0:e.app_url)??(null==(a=null==window?void 0:window.location)?void 0:a.href)};if(te||!isWebSocketOpen(ee))return void saveEventToIDB(u);const m=JSON.stringify({type:"event",event:u,mapUuid:window.sfMapUuid});try{ee.send(m)}catch(e){saveEventToIDB(u)}}function initializeWebSocket(e,a,u){const m=function getWebSocketHost(e){const a=document.createElement("a");return a.href=e,`${a.hostname}${a.port?`:${a.port}`:""}`}(e),w=new URL(e).protocol;return ee=new $(`${"https:"===w?"wss":"ws"}://${m}/ws/notify/?apiKey=${a}&sessionId=${u}&sender=JS%2FTS&version=1.8.1`,[],{connectionTimeout:3e4}),ee.addEventListener("open",()=>{Q&&console.log("WebSocket opened."),(async()=>{try{te=!0,await flushNotifyQueue(),await flushBufferedEvents()}finally{te=!1}null!=re&&clearInterval(re),re=window.setInterval(()=>{flushBufferedEvents()},2e3)})()}),ee.addEventListener("close",()=>{console.log("WebSocket closed.")}),ee}function sendMessage(e){var a;"sessionId"in e||(e.sessionId=getOrSetSessionId());const u=JSON.stringify({...e,app_url:(null==e?void 0:e.app_url)??(null==(a=null==window?void 0:window.location)?void 0:a.href)});if(isWebSocketOpen(ee))try{ee.send(u)}catch(e){saveNotifyMessageToIDB(u)}else saveNotifyMessageToIDB(u)}var oe,se,ie={},le={},ce={},pe={};function requireBase64Vlq(){if(se)return ce;se=1;var e=function requireBase64(){if(oe)return pe;oe=1;var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");return pe.encode=function(a){if(0<=a&&a<e.length)return e[a];throw new TypeError("Must be between 0 and 63: "+a)},pe.decode=function(e){return 65<=e&&e<=90?e-65:97<=e&&e<=122?e-97+26:48<=e&&e<=57?e-48+52:43==e?62:47==e?63:-1},pe}();return ce.encode=function base64VLQ_encode(a){var u,m="",w=function toVLQSigned(e){return e<0?1+(-e<<1):0+(e<<1)}(a);do{u=31&w,(w>>>=5)>0&&(u|=32),m+=e.encode(u)}while(w>0);return m},ce.decode=function base64VLQ_decode(a,u,m){var w,b,S=a.length,C=0,x=0;do{if(u>=S)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(b=e.decode(a.charCodeAt(u++))))throw new Error("Invalid base64 digit: "+a.charAt(u-1));w=!!(32&b),C+=(b&=31)<<x,x+=5}while(w);m.value=function fromVLQSigned(e){var a=e>>1;return 1&~e?a:-a}(C),m.rest=u},ce}var de,he={};function requireUtil(){return de||(de=1,function(e){e.getArg=function getArg(e,a,u){if(a in e)return e[a];if(3===arguments.length)return u;throw new Error('"'+a+'" is a required argument.')};var a=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,u=/^data:.+\,.+$/;function urlParse(e){var u=e.match(a);return u?{scheme:u[1],auth:u[2],host:u[3],port:u[4],path:u[5]}:null}function urlGenerate(e){var a="";return e.scheme&&(a+=e.scheme+":"),a+="//",e.auth&&(a+=e.auth+"@"),e.host&&(a+=e.host),e.port&&(a+=":"+e.port),e.path&&(a+=e.path),a}e.urlParse=urlParse,e.urlGenerate=urlGenerate;var m=function lruMemoize(e){var a=[];return function(u){for(var m=0;m<a.length;m++)if(a[m].input===u){var w=a[0];return a[0]=a[m],a[m]=w,a[0].result}var b=e(u);return a.unshift({input:u,result:b}),a.length>32&&a.pop(),b}}(function normalize2(a){var u=a,m=urlParse(a);if(m){if(!m.path)return a;u=m.path}for(var w=e.isAbsolute(u),b=[],S=0,C=0;;){if(S=C,-1===(C=u.indexOf("/",S))){b.push(u.slice(S));break}for(b.push(u.slice(S,C));C<u.length&&"/"===u[C];)C++}var x,I=0;for(C=b.length-1;C>=0;C--)"."===(x=b[C])?b.splice(C,1):".."===x?I++:I>0&&(""===x?(b.splice(C+1,I),I=0):(b.splice(C,2),I--));return""===(u=b.join("/"))&&(u=w?"/":"."),m?(m.path=u,urlGenerate(m)):u});function join(e,a){""===e&&(e="."),""===a&&(a=".");var w=urlParse(a),b=urlParse(e);if(b&&(e=b.path||"/"),w&&!w.scheme)return b&&(w.scheme=b.scheme),urlGenerate(w);if(w||a.match(u))return a;if(b&&!b.host&&!b.path)return b.host=a,urlGenerate(b);var S="/"===a.charAt(0)?a:m(e.replace(/\/+$/,"")+"/"+a);return b?(b.path=S,urlGenerate(b)):S}e.normalize=m,e.join=join,e.isAbsolute=function(e){return"/"===e.charAt(0)||a.test(e)},e.relative=function relative(e,a){""===e&&(e="."),e=e.replace(/\/$/,"");for(var u=0;0!==a.indexOf(e+"/");){var m=e.lastIndexOf("/");if(m<0)return a;if((e=e.slice(0,m)).match(/^([^\/]+:\/)?\/*$/))return a;++u}return Array(u+1).join("../")+a.substr(e.length+1)};var w=!("__proto__"in Object.create(null));function identity(e){return e}function isProtoString(e){if(!e)return!1;var a=e.length;if(a<9)return!1;if(95!==e.charCodeAt(a-1)||95!==e.charCodeAt(a-2)||111!==e.charCodeAt(a-3)||116!==e.charCodeAt(a-4)||111!==e.charCodeAt(a-5)||114!==e.charCodeAt(a-6)||112!==e.charCodeAt(a-7)||95!==e.charCodeAt(a-8)||95!==e.charCodeAt(a-9))return!1;for(var u=a-10;u>=0;u--)if(36!==e.charCodeAt(u))return!1;return!0}function strcmp(e,a){return e===a?0:null===e?1:null===a?-1:e>a?1:-1}e.toSetString=w?identity:function toSetString(e){return isProtoString(e)?"$"+e:e},e.fromSetString=w?identity:function fromSetString(e){return isProtoString(e)?e.slice(1):e},e.compareByOriginalPositions=function compareByOriginalPositions(e,a,u){var m=strcmp(e.source,a.source);return 0!==m||0!==(m=e.originalLine-a.originalLine)||0!==(m=e.originalColumn-a.originalColumn)||u||0!==(m=e.generatedColumn-a.generatedColumn)||0!==(m=e.generatedLine-a.generatedLine)?m:strcmp(e.name,a.name)},e.compareByOriginalPositionsNoSource=function compareByOriginalPositionsNoSource(e,a,u){var m;return 0!==(m=e.originalLine-a.originalLine)||0!==(m=e.originalColumn-a.originalColumn)||u||0!==(m=e.generatedColumn-a.generatedColumn)||0!==(m=e.generatedLine-a.generatedLine)?m:strcmp(e.name,a.name)},e.compareByGeneratedPositionsDeflated=function compareByGeneratedPositionsDeflated(e,a,u){var m=e.generatedLine-a.generatedLine;return 0!==m||0!==(m=e.generatedColumn-a.generatedColumn)||u||0!==(m=strcmp(e.source,a.source))||0!==(m=e.originalLine-a.originalLine)||0!==(m=e.originalColumn-a.originalColumn)?m:strcmp(e.name,a.name)},e.compareByGeneratedPositionsDeflatedNoLine=function compareByGeneratedPositionsDeflatedNoLine(e,a,u){var m=e.generatedColumn-a.generatedColumn;return 0!==m||u||0!==(m=strcmp(e.source,a.source))||0!==(m=e.originalLine-a.originalLine)||0!==(m=e.originalColumn-a.originalColumn)?m:strcmp(e.name,a.name)},e.compareByGeneratedPositionsInflated=function compareByGeneratedPositionsInflated(e,a){var u=e.generatedLine-a.generatedLine;return 0!==u||0!==(u=e.generatedColumn-a.generatedColumn)||0!==(u=strcmp(e.source,a.source))||0!==(u=e.originalLine-a.originalLine)||0!==(u=e.originalColumn-a.originalColumn)?u:strcmp(e.name,a.name)},e.parseSourceMapInput=function parseSourceMapInput(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},e.computeSourceURL=function computeSourceURL(e,a,u){if(a=a||"",e&&("/"!==e[e.length-1]&&"/"!==a[0]&&(e+="/"),a=e+a),u){var w=urlParse(u);if(!w)throw new Error("sourceMapURL could not be parsed");if(w.path){var b=w.path.lastIndexOf("/");b>=0&&(w.path=w.path.substring(0,b+1))}a=join(urlGenerate(w),a)}return m(a)}}(he)),he}var me,ge={};function requireArraySet(){if(me)return ge;me=1;var e=requireUtil(),a=Object.prototype.hasOwnProperty,u="undefined"!=typeof Map;function ArraySet(){this._array=[],this._set=u?new Map:Object.create(null)}return ArraySet.fromArray=function ArraySet_fromArray(e,a){for(var u=new ArraySet,m=0,w=e.length;m<w;m++)u.add(e[m],a);return u},ArraySet.prototype.size=function ArraySet_size(){return u?this._set.size:Object.getOwnPropertyNames(this._set).length},ArraySet.prototype.add=function ArraySet_add(m,w){var b=u?m:e.toSetString(m),S=u?this.has(m):a.call(this._set,b),C=this._array.length;S&&!w||this._array.push(m),S||(u?this._set.set(m,C):this._set[b]=C)},ArraySet.prototype.has=function ArraySet_has(m){if(u)return this._set.has(m);var w=e.toSetString(m);return a.call(this._set,w)},ArraySet.prototype.indexOf=function ArraySet_indexOf(m){if(u){var w=this._set.get(m);if(w>=0)return w}else{var b=e.toSetString(m);if(a.call(this._set,b))return this._set[b]}throw new Error('"'+m+'" is not in the set.')},ArraySet.prototype.at=function ArraySet_at(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},ArraySet.prototype.toArray=function ArraySet_toArray(){return this._array.slice()},ge.ArraySet=ArraySet,ge}var ye,we,be={};function requireMappingList(){if(ye)return be;ye=1;var e=requireUtil();function MappingList(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}return MappingList.prototype.unsortedForEach=function MappingList_forEach(e,a){this._array.forEach(e,a)},MappingList.prototype.add=function MappingList_add(a){!function generatedPositionAfter(a,u){var m=a.generatedLine,w=u.generatedLine,b=a.generatedColumn,S=u.generatedColumn;return w>m||w==m&&S>=b||e.compareByGeneratedPositionsInflated(a,u)<=0}(this._last,a)?(this._sorted=!1,this._array.push(a)):(this._last=a,this._array.push(a))},MappingList.prototype.toArray=function MappingList_toArray(){return this._sorted||(this._array.sort(e.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},be.MappingList=MappingList,be}function requireSourceMapGenerator(){if(we)return le;we=1;var e=requireBase64Vlq(),a=requireUtil(),u=requireArraySet().ArraySet,m=requireMappingList().MappingList;function SourceMapGenerator(e){e||(e={}),this._file=a.getArg(e,"file",null),this._sourceRoot=a.getArg(e,"sourceRoot",null),this._skipValidation=a.getArg(e,"skipValidation",!1),this._ignoreInvalidMapping=a.getArg(e,"ignoreInvalidMapping",!1),this._sources=new u,this._names=new u,this._mappings=new m,this._sourcesContents=null}return SourceMapGenerator.prototype._version=3,SourceMapGenerator.fromSourceMap=function SourceMapGenerator_fromSourceMap(e,u){var m=e.sourceRoot,w=new SourceMapGenerator(Object.assign(u||{},{file:e.file,sourceRoot:m}));return e.eachMapping(function(e){var u={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(u.source=e.source,null!=m&&(u.source=a.relative(m,u.source)),u.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(u.name=e.name)),w.addMapping(u)}),e.sources.forEach(function(u){var b=u;null!==m&&(b=a.relative(m,u)),w._sources.has(b)||w._sources.add(b);var S=e.sourceContentFor(u);null!=S&&w.setSourceContent(u,S)}),w},SourceMapGenerator.prototype.addMapping=function SourceMapGenerator_addMapping(e){var u=a.getArg(e,"generated"),m=a.getArg(e,"original",null),w=a.getArg(e,"source",null),b=a.getArg(e,"name",null);(this._skipValidation||!1!==this._validateMapping(u,m,w,b))&&(null!=w&&(w=String(w),this._sources.has(w)||this._sources.add(w)),null!=b&&(b=String(b),this._names.has(b)||this._names.add(b)),this._mappings.add({generatedLine:u.line,generatedColumn:u.column,originalLine:null!=m&&m.line,originalColumn:null!=m&&m.column,source:w,name:b}))},SourceMapGenerator.prototype.setSourceContent=function SourceMapGenerator_setSourceContent(e,u){var m=e;null!=this._sourceRoot&&(m=a.relative(this._sourceRoot,m)),null!=u?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[a.toSetString(m)]=u):this._sourcesContents&&(delete this._sourcesContents[a.toSetString(m)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},SourceMapGenerator.prototype.applySourceMap=function SourceMapGenerator_applySourceMap(e,m,w){var b=m;if(null==m){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');b=e.file}var S=this._sourceRoot;null!=S&&(b=a.relative(S,b));var C=new u,x=new u;this._mappings.unsortedForEach(function(u){if(u.source===b&&null!=u.originalLine){var m=e.originalPositionFor({line:u.originalLine,column:u.originalColumn});null!=m.source&&(u.source=m.source,null!=w&&(u.source=a.join(w,u.source)),null!=S&&(u.source=a.relative(S,u.source)),u.originalLine=m.line,u.originalColumn=m.column,null!=m.name&&(u.name=m.name))}var I=u.source;null==I||C.has(I)||C.add(I);var _=u.name;null==_||x.has(_)||x.add(_)},this),this._sources=C,this._names=x,e.sources.forEach(function(u){var m=e.sourceContentFor(u);null!=m&&(null!=w&&(u=a.join(w,u)),null!=S&&(u=a.relative(S,u)),this.setSourceContent(u,m))},this)},SourceMapGenerator.prototype._validateMapping=function SourceMapGenerator_validateMapping(e,a,u,m){if(a&&"number"!=typeof a.line&&"number"!=typeof a.column){var w="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return"undefined"!=typeof console&&console.warn&&console.warn(w),!1;throw new Error(w)}if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||a||u||m)&&!(e&&"line"in e&&"column"in e&&a&&"line"in a&&"column"in a&&e.line>0&&e.column>=0&&a.line>0&&a.column>=0&&u)){w="Invalid mapping: "+JSON.stringify({generated:e,source:u,original:a,name:m});if(this._ignoreInvalidMapping)return"undefined"!=typeof console&&console.warn&&console.warn(w),!1;throw new Error(w)}},SourceMapGenerator.prototype._serializeMappings=function SourceMapGenerator_serializeMappings(){for(var u,m,w,b,S=0,C=1,x=0,I=0,_=0,O=0,E="",D=this._mappings.toArray(),F=0,U=D.length;F<U;F++){if(u="",(m=D[F]).generatedLine!==C)for(S=0;m.generatedLine!==C;)u+=";",C++;else if(F>0){if(!a.compareByGeneratedPositionsInflated(m,D[F-1]))continue;u+=","}u+=e.encode(m.generatedColumn-S),S=m.generatedColumn,null!=m.source&&(b=this._sources.indexOf(m.source),u+=e.encode(b-O),O=b,u+=e.encode(m.originalLine-1-I),I=m.originalLine-1,u+=e.encode(m.originalColumn-x),x=m.originalColumn,null!=m.name&&(w=this._names.indexOf(m.name),u+=e.encode(w-_),_=w)),E+=u}return E},SourceMapGenerator.prototype._generateSourcesContent=function SourceMapGenerator_generateSourcesContent(e,u){return e.map(function(e){if(!this._sourcesContents)return null;null!=u&&(e=a.relative(u,e));var m=a.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,m)?this._sourcesContents[m]:null},this)},SourceMapGenerator.prototype.toJSON=function SourceMapGenerator_toJSON(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},SourceMapGenerator.prototype.toString=function SourceMapGenerator_toString(){return JSON.stringify(this.toJSON())},le.SourceMapGenerator=SourceMapGenerator,le}var ve,Ce={},ke={};function requireBinarySearch(){return ve||(ve=1,function(e){function recursiveSearch(a,u,m,w,b,S){var C=Math.floor((u-a)/2)+a,x=b(m,w[C],!0);return 0===x?C:x>0?u-C>1?recursiveSearch(C,u,m,w,b,S):S==e.LEAST_UPPER_BOUND?u<w.length?u:-1:C:C-a>1?recursiveSearch(a,C,m,w,b,S):S==e.LEAST_UPPER_BOUND?C:a<0?-1:a}e.GREATEST_LOWER_BOUND=1,e.LEAST_UPPER_BOUND=2,e.search=function search(a,u,m,w){if(0===u.length)return-1;var b=recursiveSearch(-1,u.length,a,u,m,w||e.GREATEST_LOWER_BOUND);if(b<0)return-1;for(;b-1>=0&&0===m(u[b],u[b-1],!0);)--b;return b}}(ke)),ke}var xe,Me,Ie={};function requireQuickSort(){if(xe)return Ie;function SortTemplate(e){function swap(e,a,u){var m=e[a];e[a]=e[u],e[u]=m}return function doQuickSort(e,a,u,m){if(u<m){var w=u-1;swap(e,function randomIntInRange(e,a){return Math.round(e+Math.random()*(a-e))}(u,m),m);for(var b=e[m],S=u;S<m;S++)a(e[S],b,!1)<=0&&swap(e,w+=1,S);swap(e,w+1,S);var C=w+1;doQuickSort(e,a,u,C-1),doQuickSort(e,a,C+1,m)}}}xe=1;let e=new WeakMap;return Ie.quickSort=function(a,u,m=0){let w=e.get(u);void 0===w&&(w=function cloneSort(e){let a=SortTemplate.toString();return new Function(`return ${a}`)()(e)}(u),e.set(u,w)),w(a,u,m,a.length-1)},Ie}var Oe,Ee,Le={};var Ae=function requireSourceMap(){return Ee||(Ee=1,ie.SourceMapGenerator=requireSourceMapGenerator().SourceMapGenerator,ie.SourceMapConsumer=function requireSourceMapConsumer(){if(Me)return Ce;Me=1;var e=requireUtil(),a=requireBinarySearch(),u=requireArraySet().ArraySet,m=requireBase64Vlq(),w=requireQuickSort().quickSort;function SourceMapConsumer(a,u){var m=a;return"string"==typeof a&&(m=e.parseSourceMapInput(a)),null!=m.sections?new IndexedSourceMapConsumer(m,u):new BasicSourceMapConsumer(m,u)}function BasicSourceMapConsumer(a,m){var w=a;"string"==typeof a&&(w=e.parseSourceMapInput(a));var b=e.getArg(w,"version"),S=e.getArg(w,"sources"),C=e.getArg(w,"names",[]),x=e.getArg(w,"sourceRoot",null),I=e.getArg(w,"sourcesContent",null),_=e.getArg(w,"mappings"),O=e.getArg(w,"file",null);if(b!=this._version)throw new Error("Unsupported version: "+b);x&&(x=e.normalize(x)),S=S.map(String).map(e.normalize).map(function(a){return x&&e.isAbsolute(x)&&e.isAbsolute(a)?e.relative(x,a):a}),this._names=u.fromArray(C.map(String),!0),this._sources=u.fromArray(S,!0),this._absoluteSources=this._sources.toArray().map(function(a){return e.computeSourceURL(x,a,m)}),this.sourceRoot=x,this.sourcesContent=I,this._mappings=_,this._sourceMapURL=m,this.file=O}function Mapping(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}SourceMapConsumer.fromSourceMap=function(e,a){return BasicSourceMapConsumer.fromSourceMap(e,a)},SourceMapConsumer.prototype._version=3,SourceMapConsumer.prototype.__generatedMappings=null,Object.defineProperty(SourceMapConsumer.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),SourceMapConsumer.prototype.__originalMappings=null,Object.defineProperty(SourceMapConsumer.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),SourceMapConsumer.prototype._charIsMappingSeparator=function SourceMapConsumer_charIsMappingSeparator(e,a){var u=e.charAt(a);return";"===u||","===u},SourceMapConsumer.prototype._parseMappings=function SourceMapConsumer_parseMappings(e,a){throw new Error("Subclasses must implement _parseMappings")},SourceMapConsumer.GENERATED_ORDER=1,SourceMapConsumer.ORIGINAL_ORDER=2,SourceMapConsumer.GREATEST_LOWER_BOUND=1,SourceMapConsumer.LEAST_UPPER_BOUND=2,SourceMapConsumer.prototype.eachMapping=function SourceMapConsumer_eachMapping(a,u,m){var w,b=u||null;switch(m||SourceMapConsumer.GENERATED_ORDER){case SourceMapConsumer.GENERATED_ORDER:w=this._generatedMappings;break;case SourceMapConsumer.ORIGINAL_ORDER:w=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var S=this.sourceRoot,C=a.bind(b),x=this._names,I=this._sources,_=this._sourceMapURL,O=0,E=w.length;O<E;O++){var D=w[O],F=null===D.source?null:I.at(D.source);null!==F&&(F=e.computeSourceURL(S,F,_)),C({source:F,generatedLine:D.generatedLine,generatedColumn:D.generatedColumn,originalLine:D.originalLine,originalColumn:D.originalColumn,name:null===D.name?null:x.at(D.name)})}},SourceMapConsumer.prototype.allGeneratedPositionsFor=function SourceMapConsumer_allGeneratedPositionsFor(u){var m=e.getArg(u,"line"),w={source:e.getArg(u,"source"),originalLine:m,originalColumn:e.getArg(u,"column",0)};if(w.source=this._findSourceIndex(w.source),w.source<0)return[];var b=[],S=this._findMapping(w,this._originalMappings,"originalLine","originalColumn",e.compareByOriginalPositions,a.LEAST_UPPER_BOUND);if(S>=0){var C=this._originalMappings[S];if(void 0===u.column)for(var x=C.originalLine;C&&C.originalLine===x;)b.push({line:e.getArg(C,"generatedLine",null),column:e.getArg(C,"generatedColumn",null),lastColumn:e.getArg(C,"lastGeneratedColumn",null)}),C=this._originalMappings[++S];else for(var I=C.originalColumn;C&&C.originalLine===m&&C.originalColumn==I;)b.push({line:e.getArg(C,"generatedLine",null),column:e.getArg(C,"generatedColumn",null),lastColumn:e.getArg(C,"lastGeneratedColumn",null)}),C=this._originalMappings[++S]}return b},Ce.SourceMapConsumer=SourceMapConsumer,BasicSourceMapConsumer.prototype=Object.create(SourceMapConsumer.prototype),BasicSourceMapConsumer.prototype.consumer=SourceMapConsumer,BasicSourceMapConsumer.prototype._findSourceIndex=function(a){var u,m=a;if(null!=this.sourceRoot&&(m=e.relative(this.sourceRoot,m)),this._sources.has(m))return this._sources.indexOf(m);for(u=0;u<this._absoluteSources.length;++u)if(this._absoluteSources[u]==a)return u;return-1},BasicSourceMapConsumer.fromSourceMap=function SourceMapConsumer_fromSourceMap(a,m){var b=Object.create(BasicSourceMapConsumer.prototype),S=b._names=u.fromArray(a._names.toArray(),!0),C=b._sources=u.fromArray(a._sources.toArray(),!0);b.sourceRoot=a._sourceRoot,b.sourcesContent=a._generateSourcesContent(b._sources.toArray(),b.sourceRoot),b.file=a._file,b._sourceMapURL=m,b._absoluteSources=b._sources.toArray().map(function(a){return e.computeSourceURL(b.sourceRoot,a,m)});for(var x=a._mappings.toArray().slice(),I=b.__generatedMappings=[],_=b.__originalMappings=[],O=0,E=x.length;O<E;O++){var D=x[O],F=new Mapping;F.generatedLine=D.generatedLine,F.generatedColumn=D.generatedColumn,D.source&&(F.source=C.indexOf(D.source),F.originalLine=D.originalLine,F.originalColumn=D.originalColumn,D.name&&(F.name=S.indexOf(D.name)),_.push(F)),I.push(F)}return w(b.__originalMappings,e.compareByOriginalPositions),b},BasicSourceMapConsumer.prototype._version=3,Object.defineProperty(BasicSourceMapConsumer.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});const b=e.compareByGeneratedPositionsDeflatedNoLine;function sortGenerated(e,a){let u=e.length,m=e.length-a;if(!(m<=1))if(2==m){let u=e[a],m=e[a+1];b(u,m)>0&&(e[a]=m,e[a+1]=u)}else if(m<20)for(let m=a;m<u;m++)for(let u=m;u>a;u--){let a=e[u-1],m=e[u];if(b(a,m)<=0)break;e[u-1]=m,e[u]=a}else w(e,b,a)}function IndexedSourceMapConsumer(a,m){var w=a;"string"==typeof a&&(w=e.parseSourceMapInput(a));var b=e.getArg(w,"version"),S=e.getArg(w,"sections");if(b!=this._version)throw new Error("Unsupported version: "+b);this._sources=new u,this._names=new u;var C={line:-1,column:0};this._sections=S.map(function(a){if(a.url)throw new Error("Support for url field in sections not implemented.");var u=e.getArg(a,"offset"),w=e.getArg(u,"line"),b=e.getArg(u,"column");if(w<C.line||w===C.line&&b<C.column)throw new Error("Section offsets must be ordered and non-overlapping.");return C=u,{generatedOffset:{generatedLine:w+1,generatedColumn:b+1},consumer:new SourceMapConsumer(e.getArg(a,"map"),m)}})}return BasicSourceMapConsumer.prototype._parseMappings=function SourceMapConsumer_parseMappings(a,u){var b,S,C,x,I=1,_=0,O=0,E=0,D=0,F=0,U=a.length,$=0,B={},z=[],j=[];let V=0;for(;$<U;)if(";"===a.charAt($))I++,$++,_=0,sortGenerated(j,V),V=j.length;else if(","===a.charAt($))$++;else{for((b=new Mapping).generatedLine=I,C=$;C<U&&!this._charIsMappingSeparator(a,C);C++);for(a.slice($,C),S=[];$<C;)m.decode(a,$,B),x=B.value,$=B.rest,S.push(x);if(2===S.length)throw new Error("Found a source, but no line and column");if(3===S.length)throw new Error("Found a source and line, but no column");if(b.generatedColumn=_+S[0],_=b.generatedColumn,S.length>1&&(b.source=D+S[1],D+=S[1],b.originalLine=O+S[2],O=b.originalLine,b.originalLine+=1,b.originalColumn=E+S[3],E=b.originalColumn,S.length>4&&(b.name=F+S[4],F+=S[4])),j.push(b),"number"==typeof b.originalLine){let e=b.source;for(;z.length<=e;)z.push(null);null===z[e]&&(z[e]=[]),z[e].push(b)}}sortGenerated(j,V),this.__generatedMappings=j;for(var q=0;q<z.length;q++)null!=z[q]&&w(z[q],e.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...z)},BasicSourceMapConsumer.prototype._findMapping=function SourceMapConsumer_findMapping(e,u,m,w,b,S){if(e[m]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[m]);if(e[w]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[w]);return a.search(e,u,b,S)},BasicSourceMapConsumer.prototype.computeColumnSpans=function SourceMapConsumer_computeColumnSpans(){for(var e=0;e<this._generatedMappings.length;++e){var a=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var u=this._generatedMappings[e+1];if(a.generatedLine===u.generatedLine){a.lastGeneratedColumn=u.generatedColumn-1;continue}}a.lastGeneratedColumn=1/0}},BasicSourceMapConsumer.prototype.originalPositionFor=function SourceMapConsumer_originalPositionFor(a){var u={generatedLine:e.getArg(a,"line"),generatedColumn:e.getArg(a,"column")},m=this._findMapping(u,this._generatedMappings,"generatedLine","generatedColumn",e.compareByGeneratedPositionsDeflated,e.getArg(a,"bias",SourceMapConsumer.GREATEST_LOWER_BOUND));if(m>=0){var w=this._generatedMappings[m];if(w.generatedLine===u.generatedLine){var b=e.getArg(w,"source",null);null!==b&&(b=this._sources.at(b),b=e.computeSourceURL(this.sourceRoot,b,this._sourceMapURL));var S=e.getArg(w,"name",null);return null!==S&&(S=this._names.at(S)),{source:b,line:e.getArg(w,"originalLine",null),column:e.getArg(w,"originalColumn",null),name:S}}}return{source:null,line:null,column:null,name:null}},BasicSourceMapConsumer.prototype.hasContentsOfAllSources=function BasicSourceMapConsumer_hasContentsOfAllSources(){return!!this.sourcesContent&&this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e})},BasicSourceMapConsumer.prototype.sourceContentFor=function SourceMapConsumer_sourceContentFor(a,u){if(!this.sourcesContent)return null;var m=this._findSourceIndex(a);if(m>=0)return this.sourcesContent[m];var w,b=a;if(null!=this.sourceRoot&&(b=e.relative(this.sourceRoot,b)),null!=this.sourceRoot&&(w=e.urlParse(this.sourceRoot))){var S=b.replace(/^file:\/\//,"");if("file"==w.scheme&&this._sources.has(S))return this.sourcesContent[this._sources.indexOf(S)];if((!w.path||"/"==w.path)&&this._sources.has("/"+b))return this.sourcesContent[this._sources.indexOf("/"+b)]}if(u)return null;throw new Error('"'+b+'" is not in the SourceMap.')},BasicSourceMapConsumer.prototype.generatedPositionFor=function SourceMapConsumer_generatedPositionFor(a){var u=e.getArg(a,"source");if((u=this._findSourceIndex(u))<0)return{line:null,column:null,lastColumn:null};var m={source:u,originalLine:e.getArg(a,"line"),originalColumn:e.getArg(a,"column")},w=this._findMapping(m,this._originalMappings,"originalLine","originalColumn",e.compareByOriginalPositions,e.getArg(a,"bias",SourceMapConsumer.GREATEST_LOWER_BOUND));if(w>=0){var b=this._originalMappings[w];if(b.source===m.source)return{line:e.getArg(b,"generatedLine",null),column:e.getArg(b,"generatedColumn",null),lastColumn:e.getArg(b,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},Ce.BasicSourceMapConsumer=BasicSourceMapConsumer,IndexedSourceMapConsumer.prototype=Object.create(SourceMapConsumer.prototype),IndexedSourceMapConsumer.prototype.constructor=SourceMapConsumer,IndexedSourceMapConsumer.prototype._version=3,Object.defineProperty(IndexedSourceMapConsumer.prototype,"sources",{get:function(){for(var e=[],a=0;a<this._sections.length;a++)for(var u=0;u<this._sections[a].consumer.sources.length;u++)e.push(this._sections[a].consumer.sources[u]);return e}}),IndexedSourceMapConsumer.prototype.originalPositionFor=function IndexedSourceMapConsumer_originalPositionFor(u){var m={generatedLine:e.getArg(u,"line"),generatedColumn:e.getArg(u,"column")},w=a.search(m,this._sections,function(e,a){return e.generatedLine-a.generatedOffset.generatedLine||e.generatedColumn-a.generatedOffset.generatedColumn}),b=this._sections[w];return b?b.consumer.originalPositionFor({line:m.generatedLine-(b.generatedOffset.generatedLine-1),column:m.generatedColumn-(b.generatedOffset.generatedLine===m.generatedLine?b.generatedOffset.generatedColumn-1:0),bias:u.bias}):{source:null,line:null,column:null,name:null}},IndexedSourceMapConsumer.prototype.hasContentsOfAllSources=function IndexedSourceMapConsumer_hasContentsOfAllSources(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})},IndexedSourceMapConsumer.prototype.sourceContentFor=function IndexedSourceMapConsumer_sourceContentFor(e,a){for(var u=0;u<this._sections.length;u++){var m=this._sections[u].consumer.sourceContentFor(e,!0);if(m||""===m)return m}if(a)return null;throw new Error('"'+e+'" is not in the SourceMap.')},IndexedSourceMapConsumer.prototype.generatedPositionFor=function IndexedSourceMapConsumer_generatedPositionFor(a){for(var u=0;u<this._sections.length;u++){var m=this._sections[u];if(-1!==m.consumer._findSourceIndex(e.getArg(a,"source"))){var w=m.consumer.generatedPositionFor(a);if(w)return{line:w.line+(m.generatedOffset.generatedLine-1),column:w.column+(m.generatedOffset.generatedLine===w.line?m.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},IndexedSourceMapConsumer.prototype._parseMappings=function IndexedSourceMapConsumer_parseMappings(a,u){this.__generatedMappings=[],this.__originalMappings=[];for(var m=0;m<this._sections.length;m++)for(var b=this._sections[m],S=b.consumer._generatedMappings,C=0;C<S.length;C++){var x=S[C],I=b.consumer._sources.at(x.source);null!==I&&(I=e.computeSourceURL(b.consumer.sourceRoot,I,this._sourceMapURL)),this._sources.add(I),I=this._sources.indexOf(I);var _=null;x.name&&(_=b.consumer._names.at(x.name),this._names.add(_),_=this._names.indexOf(_));var O={source:I,generatedLine:x.generatedLine+(b.generatedOffset.generatedLine-1),generatedColumn:x.generatedColumn+(b.generatedOffset.generatedLine===x.generatedLine?b.generatedOffset.generatedColumn-1:0),originalLine:x.originalLine,originalColumn:x.originalColumn,name:_};this.__generatedMappings.push(O),"number"==typeof O.originalLine&&this.__originalMappings.push(O)}w(this.__generatedMappings,e.compareByGeneratedPositionsDeflated),w(this.__originalMappings,e.compareByOriginalPositions)},Ce.IndexedSourceMapConsumer=IndexedSourceMapConsumer,Ce}().SourceMapConsumer,ie.SourceNode=function requireSourceNode(){if(Oe)return Le;Oe=1;var e=requireSourceMapGenerator().SourceMapGenerator,a=requireUtil(),u=/(\r?\n)/,m="$$$isSourceNode$$$";function SourceNode(e,a,u,w,b){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==a?null:a,this.source=null==u?null:u,this.name=null==b?null:b,this[m]=!0,null!=w&&this.add(w)}return SourceNode.fromStringWithSourceMap=function SourceNode_fromStringWithSourceMap(e,m,w){var b=new SourceNode,S=e.split(u),C=0,shiftNextLine=function(){return getNextLine()+(getNextLine()||"");function getNextLine(){return C<S.length?S[C++]:void 0}},x=1,I=0,_=null;return m.eachMapping(function(e){if(null!==_){if(!(x<e.generatedLine)){var a=(u=S[C]||"").substr(0,e.generatedColumn-I);return S[C]=u.substr(e.generatedColumn-I),I=e.generatedColumn,addMappingWithCode(_,a),void(_=e)}addMappingWithCode(_,shiftNextLine()),x++,I=0}for(;x<e.generatedLine;)b.add(shiftNextLine()),x++;if(I<e.generatedColumn){var u=S[C]||"";b.add(u.substr(0,e.generatedColumn)),S[C]=u.substr(e.generatedColumn),I=e.generatedColumn}_=e},this),C<S.length&&(_&&addMappingWithCode(_,shiftNextLine()),b.add(S.splice(C).join(""))),m.sources.forEach(function(e){var u=m.sourceContentFor(e);null!=u&&(null!=w&&(e=a.join(w,e)),b.setSourceContent(e,u))}),b;function addMappingWithCode(e,u){if(null===e||void 0===e.source)b.add(u);else{var m=w?a.join(w,e.source):e.source;b.add(new SourceNode(e.originalLine,e.originalColumn,m,u,e.name))}}},SourceNode.prototype.add=function SourceNode_add(e){if(Array.isArray(e))e.forEach(function(e){this.add(e)},this);else{if(!e[m]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},SourceNode.prototype.prepend=function SourceNode_prepend(e){if(Array.isArray(e))for(var a=e.length-1;a>=0;a--)this.prepend(e[a]);else{if(!e[m]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},SourceNode.prototype.walk=function SourceNode_walk(e){for(var a,u=0,w=this.children.length;u<w;u++)(a=this.children[u])[m]?a.walk(e):""!==a&&e(a,{source:this.source,line:this.line,column:this.column,name:this.name})},SourceNode.prototype.join=function SourceNode_join(e){var a,u,m=this.children.length;if(m>0){for(a=[],u=0;u<m-1;u++)a.push(this.children[u]),a.push(e);a.push(this.children[u]),this.children=a}return this},SourceNode.prototype.replaceRight=function SourceNode_replaceRight(e,a){var u=this.children[this.children.length-1];return u[m]?u.replaceRight(e,a):"string"==typeof u?this.children[this.children.length-1]=u.replace(e,a):this.children.push("".replace(e,a)),this},SourceNode.prototype.setSourceContent=function SourceNode_setSourceContent(e,u){this.sourceContents[a.toSetString(e)]=u},SourceNode.prototype.walkSourceContents=function SourceNode_walkSourceContents(e){for(var u=0,w=this.children.length;u<w;u++)this.children[u][m]&&this.children[u].walkSourceContents(e);var b=Object.keys(this.sourceContents);for(u=0,w=b.length;u<w;u++)e(a.fromSetString(b[u]),this.sourceContents[b[u]])},SourceNode.prototype.toString=function SourceNode_toString(){var e="";return this.walk(function(a){e+=a}),e},SourceNode.prototype.toStringWithSourceMap=function SourceNode_toStringWithSourceMap(a){var u={code:"",line:1,column:0},m=new e(a),w=!1,b=null,S=null,C=null,x=null;return this.walk(function(e,a){u.code+=e,null!==a.source&&null!==a.line&&null!==a.column?(b===a.source&&S===a.line&&C===a.column&&x===a.name||m.addMapping({source:a.source,original:{line:a.line,column:a.column},generated:{line:u.line,column:u.column},name:a.name}),b=a.source,S=a.line,C=a.column,x=a.name,w=!0):w&&(m.addMapping({generated:{line:u.line,column:u.column}}),b=null,w=!1);for(var I=0,_=e.length;I<_;I++)10===e.charCodeAt(I)?(u.line++,u.column=0,I+1===_?(b=null,w=!1):w&&m.addMapping({source:a.source,original:{line:a.line,column:a.column},generated:{line:u.line,column:u.column},name:a.name})):u.column++}),this.walkSourceContents(function(e,a){m.setSourceContent(e,a)}),{code:u.code,map:m}},Le.SourceNode=SourceNode,Le}().SourceNode),ie}();async function captureError(e,a=!1){let u,m;e instanceof Error?(u=e.message,m=e.stack||"No stack trace"):"string"==typeof e?(u=e,m="No stack trace available"):(u="Unknown error occurred",m="No stack trace available");const w=await async function resolveStackTrace(e){if(!e)return["No stack trace available"];const a=Array.isArray(e)?e:e.split("\n"),u=[];for(const e of a){const a=e.match(/\/assets\/([^\/]+\.js):(\d+):(\d+)/);if(!a){u.push(e);continue}const[,m,w,b]=a,S=`/assets/${m.split("/").pop()}.map`;try{const a=await fetch(S);if(!a.ok)break;const m=await a.json();if(!m.sources||!Array.isArray(m.sources)){u.push(e);continue}const C=(await new Ae.SourceMapConsumer(m)).originalPositionFor({line:parseInt(w,10)-1,column:parseInt(b,10)});if(C.source&&C.line){const e=m.sources.indexOf(C.source);let a=[];if(-1!==e&&m.sourcesContent&&m.sourcesContent[e]){const u=m.sourcesContent[e].split("\n"),w=C.line||1,b=Math.max(w-6,0),S=Math.min(w+4,u.length);a=u.slice(b,S).map((e,a)=>{const u=b+a+1;return`${u===w?"👉":" "} ${u.toString().padStart(4)} | ${e.trim()}`})}u.push(`${C.source}:${C.line}:${C.column} (${C.name||"anonymous"})`)}else u.push(e)}catch(a){u.push(e)}}return u}(m);sendMessage({type:"event",event:{type:6,data:{payload:{message:u,stack:m,filteredStack:w.filter(e=>!e.includes("chunk-")&&!e.includes("react-dom")),userAgent:navigator.userAgent,url:window.location.href,timestamp:Date.now(),level:"error"}}}})}const Te=readDebugFlag();const De=readDebugFlag();function sendGraphQLRequest(e,a,u,m=5,w=2e3,b=2){const S=`${u.backendApi}/graphql/?apiKey=${u.apiKey}`;return De&&console.log(`Initial GraphQL request for ${e} at ${S}`),function exponentialBackoff(e,a,u=5,m=2e3,w=2){let b=0;const attemptRequest=async()=>{try{return await e()}catch(e){if(b++,b>u)throw e;const S=m*Math.pow(w,b-1);return Te&&console.log(`Attempt ${b} failed: ${a}; Retrying in ${S}ms...`),await new Promise(e=>setTimeout(e,S)),attemptRequest()}};return attemptRequest()}(()=>fetch(S,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operationName:e,query:a,variables:u})}).then(e=>{if(De&&console.log(`Received response with status: ${e.status}`),!e.ok)throw new Error(`GraphQL request failed with status ${e.status}`);return e.json()}),"Sending GraphQL request to Sailfish AI",m,w,b)}function fetchCaptureSettings(e,a){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:a})}function startRecordingSession(e,a,u,m,w,b,S,C,x){return sendGraphQLRequest("StartSession","mutation StartSession(\n $apiKey: UUID!,\n $recordingSessionId: UUID!,\n $serviceIdentifier: String!,\n $serviceVersion: String,\n $mapUuid: String,\n $gitSha: String,\n $library: String,\n $serviceAdditionalMetadata: JSON,\n $startRecordingFilePath: String,\n $startRecordingLineNumber: Int\n ) {\n startRecordingSession(\n companyApiKey: $apiKey,\n sessionId: $recordingSessionId,\n serviceIdentifier: $serviceIdentifier,\n serviceVersion: $serviceVersion,\n mapUuid: $mapUuid,\n gitSha: $gitSha,\n library: $library,\n serviceAdditionalMetadata: $serviceAdditionalMetadata,\n startRecordingFilePath: $startRecordingFilePath,\n startRecordingLineNumber: $startRecordingLineNumber\n ) {\n id\n }\n }",{apiKey:e,recordingSessionId:a,backendApi:u,serviceIdentifier:m,serviceVersion:w,mapUuid:b,gitSha:S,library:C,serviceAdditionalMetadata:x,startRecordingFilePath:null,startRecordingLineNumber:null})}function sendDomainsToNotPropagateHeaderTo(e,a,u){return sendGraphQLRequest("DomainsToNotPassHeaderTo","mutation DomainsToNotPassHeaderTo($apiKey: String!, $domains: [String!]!) {\n domainsToNotPassHeaderTo(apiKey: $apiKey, domains: $domains)\n }",{apiKey:e,domains:a,backendApi:u})}function createTriageFromRecorder(e,a,u,m,w,b){return sendGraphQLRequest("CreateTriageFromRecorder","mutation CreateTriageFromRecorder(\n $apiKey: String!,\n $recordingSessionId: String!,\n $timestampStart: String!,\n $timestampEnd: String!,\n $description: String\n ) {\n createTriageFromRecorder(\n apiKey: $apiKey,\n recordingSessionId: $recordingSessionId,\n timestampStart: $timestampStart,\n timestampEnd: $timestampEnd,\n description: $description\n ) {\n id\n }\n }\n ",{apiKey:e,recordingSessionId:u,timestampStart:m,timestampEnd:w,description:b,backendApi:a})}const Ue={enabled:!1,openModalExistingMode:{key:"e",requireCmdCtrl:!1},openModalCaptureNewMode:{key:"n",requireCmdCtrl:!1},closeModal:{key:"escape",requireCmdCtrl:!1},submitReport:{key:"enter",requireCmdCtrl:!0},startRecording:{key:"r",requireCmdCtrl:!1},stopRecording:{key:"escape",requireCmdCtrl:!0}},Be={shortcuts:{...Ue},resolveSessionId:null,apiKey:null,backendApi:null,triageBaseUrl:"https://app.sailfishqa.com",deactivateIsolation:()=>{}};let je=null,Ge={mode:"lookback",description:""},Ve=null,qe=null,He=null,Ye=!1;function getShortcutKeyCmdCtrlLabel(){return function isMacPlatform(){const e=navigator.userAgentData;return(null==e?void 0:e.platform)?e.platform.toLowerCase().includes("mac"):/mac/i.test(navigator.userAgent)}()?"⌘":"Ctrl"}function getShortcutLabelFromContext(e){return function getShortcutLabel(e){const a=[];return e.requireCmdCtrl&&a.push(getShortcutKeyCmdCtrlLabel()),a.push(function formatShortcutKeyLabel(e){return({escape:"esc"}[e.toLowerCase()]||e).toUpperCase()}(e.key)),a.map(e=>`<span style="background: #F1F5F9; border:1px solid #cbd5e1; border-radius: 4px; padding: 0 4px; font-weight: 500; font-size: 12px; color: #94A3B8; line-height: 16px;">${e}</span>`).join(e.requireCmdCtrl?" + ":"")}(Be.shortcuts[e])}function setupIssueReporting(e){Be.apiKey=e.apiKey,Be.backendApi=e.backendApi,Be.resolveSessionId=e.getSessionId,e.customBaseUrl&&(Be.triageBaseUrl=e.customBaseUrl),Be.shortcuts=function mergeShortcutsConfig(e){const a={...Ue};if(!e)return a;"boolean"==typeof e.enabled&&(a.enabled=e.enabled);const u=["openModalExistingMode","openModalCaptureNewMode","closeModal","submitReport","startRecording","stopRecording"];for(const m of u){const u=e[m];u&&"object"==typeof u&&(a[m]={...a[m],...u},a[m].key=a[m].key.toLowerCase())}return a}(e.shortcuts);const{shortcuts:a}=Be;window.addEventListener("keydown",e=>{const u=function isTypingInInput(){const e=document.activeElement;return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}(),m=e.key.toLowerCase(),w=e.metaKey||e.ctrlKey,b=!!document.getElementById("sf-report-issue-modal"),S=!u&&(a.enabled||b),shortcutUsed=e=>m===a[e].key&&w===a[e].requireCmdCtrl,C=b?e=>{setActiveTab(e),updateModeSpecificUI(e)}:injectModalHTML;if(S&&shortcutUsed("openModalExistingMode"))return e.preventDefault(),void C("lookback");if(S&&shortcutUsed("openModalCaptureNewMode"))return e.preventDefault(),void C("startnow");if(b&&!Ye&&shortcutUsed("closeModal"))return e.preventDefault(),void closeModal();if(b&&shortcutUsed("submitReport")){const a=document.getElementById("sf-issue-submit-btn");return void(a&&!a.disabled&&(e.preventDefault(),a.click()))}if(Ye&&m===a.stopRecording.key&&w===a.stopRecording.requireCmdCtrl)return e.preventDefault(),void stopRecording();if(b&&"startnow"===Ge.mode&&m===a.startRecording.key&&w===a.startRecording.requireCmdCtrl&&!u){const a=document.getElementById("sf-start-recording-btn");return void(a&&(e.preventDefault(),a.click()))}})}function openReportIssueModal(){Ye?stopRecording():(injectModalHTML(),je&&document.body.appendChild(je))}function closeModal(){Be.deactivateIsolation(),document.activeElement instanceof HTMLElement&&document.activeElement.blur(),(null==je?void 0:je.parentNode)&&je.parentNode.removeChild(je),je=null,Ye||(Ge={mode:"lookback",description:"",occurredInThisTab:!0},Ve=null,qe=null),He&&clearInterval(He)}function activateModalIsolation(e){e.setAttribute("role","dialog"),e.setAttribute("aria-modal","true"),e.hasAttribute("tabindex")||e.setAttribute("tabindex","-1");const a=e.querySelector("#sf-issue-description")||e.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])")||e,u=document.createElement("div"),m=document.createElement("div");u.tabIndex=0,m.tabIndex=0,u.style.position=m.style.position="fixed",u.style.width=m.style.width="1px",u.style.height=m.style.height="1px",u.style.outline=m.style.outline="none",e.prepend(u),e.append(m);const cycleFocus=a=>{const u=Array.from(e.querySelectorAll("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])")).filter(e=>!e.hasAttribute("disabled")&&null!==e.offsetParent);if(0===u.length)return;(a?u[0]:u[u.length-1]).focus({preventScroll:!0})};u.addEventListener("focus",()=>cycleFocus(!1)),m.addEventListener("focus",()=>cycleFocus(!0));const quarantine=a=>{const u=a.target;u&&(e.contains(u)||(a.stopImmediatePropagation(),a.preventDefault(),refocus()))},w=["mousedown","mouseup","click","pointerdown","pointerup","touchstart","touchend","wheel","keydown","keyup","focus","focusin","focusout","blur"];w.forEach(e=>document.addEventListener(e,quarantine,!0));let b=0,S=null;const C=a instanceof HTMLTextAreaElement?a:null,refocus=()=>{if((e.querySelector(":focus")||C||a||e).focus({preventScroll:!0}),C&&document.activeElement===C&&S)try{C.setSelectionRange(S.start,S.end,"none")}catch{}},selectionInsideModal=()=>{const a="function"==typeof document.getSelection?document.getSelection():null;if(!a)return!1;if([a.anchorNode,a.focusNode].filter(Boolean).some(a=>e.contains(a)))return!0;if(a.rangeCount>0){const u=a.getRangeAt(0).commonAncestorContainer;if(u&&e.contains(3===u.nodeType?u.parentNode:u))return!0}return!1};let x=0;const watchdog=()=>{const a=document.activeElement,u=a===document.body||null==a||!e.contains(a),m=selectionInsideModal();u&&!m?(x+=1,x>=2&&(refocus(),x=0)):(x=0,(()=>{if(C&&document.activeElement===C)try{S={start:C.selectionStart??C.value.length,end:C.selectionEnd??C.value.length}}catch{}})()),b=window.requestAnimationFrame(watchdog)};b=window.requestAnimationFrame(watchdog);const onBlurLike=()=>{setTimeout(()=>{const a=document.activeElement;(a===document.body||null==a||!e.contains(a))&&!selectionInsideModal()&&refocus()},0)};return window.addEventListener("blur",onBlurLike,!0),document.addEventListener("focusout",onBlurLike,!0),setTimeout(()=>a.focus({preventScroll:!0}),0),()=>{try{u.remove(),m.remove()}catch{}w.forEach(e=>document.removeEventListener(e,quarantine,!0)),window.removeEventListener("blur",onBlurLike,!0),document.removeEventListener("focusout",onBlurLike,!0),b&&cancelAnimationFrame(b)}}function injectModalHTML(e="lookback"){je&&(je.remove(),je=null),je=document.createElement("div"),je.id="sf-report-issue-modal";const a="startnow"===e;je.innerHTML=`\n <div style="position:fixed; inset:0; background:rgba(0,0,0,0.4); z-index:9998;"></div>\n <div style="position:fixed; top:50%; left:50%; transform:translate(-50%, -50%);\n background:#fff; padding:24px; border-radius:12px;\n width:476px; max-width:90%; z-index:9999;\n box-shadow:0 4px 20px rgba(0,0,0,0.15); font-family:sans-serif;">\n\n <button id="sf-modal-close-btn"\n style="position:absolute; top:24px; right:24px;">\n <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M18 6L6 18" stroke="#71717A" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M6 6L18 18" stroke="#71717A" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>\n </button>\n\n <h2 style="font-size:18px; font-weight:600; margin-bottom:16px;">Report Issue</h2>\n\n <div id="sf-issue-tabs" style="display:flex; gap:4px; margin-bottom:16px; background:#f1f5f9; padding:6px; border-radius:6px; width: fit-content;">\n <button id="sf-tab-lookback" data-mode="lookback" class="sf-issue-tab ${a?"":"active"}"\n style="padding:6px 12px; border:none; background:${a?"transparent":"white"}; color: ${a?"#64748B":"#0F172A"}; border-radius:4px; font-size:14px; cursor:pointer; font-weight:500; height:32px; display: flex; align-items: center; gap: 8px;">\n Existing ${getShortcutLabelFromContext("openModalExistingMode")}\n </button>\n <button id="sf-tab-startnow" data-mode="startnow" class="sf-issue-tab ${a?"active":""}"\n style="padding:6px 12px; border:none; background:${a?"white":"transparent"}; color: ${a?"#0F172A":"#64748B"}; border-radius:4px; font-size:14px; cursor:pointer; font-weight:500; height:32px; display: flex; align-items: center; gap: 8px;">\n Capture new ${getShortcutLabelFromContext("openModalCaptureNewMode")}\n </button>\n </div>\n\n <div id="sf-issue-mode-info" style="display:flex; align-items:flex-start; gap:8px; margin-bottom:24px;">\n <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg" style="margin-top:4px;">\n <g clip-path="url(#clip0_2477_11797)">\n <path d="M6.99935 12.8333C10.221 12.8333 12.8327 10.2216 12.8327 6.99996C12.8327 3.7783 10.221 1.16663 6.99935 1.16663C3.77769 1.16663 1.16602 3.7783 1.16602 6.99996C1.16602 10.2216 3.77769 12.8333 6.99935 12.8333Z" stroke="#A1A1AA" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M7 9.33333V7" stroke="#A1A1AA" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M7 4.66663H7.00583" stroke="#A1A1AA" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>\n </g>\n <defs><clipPath id="clip0_2477_11797"><rect width="14" height="14" fill="white"/></clipPath></defs>\n </svg>\n <div style="font-size:14px;">\n ${a?"I want to reproduce the issue right now.":"Something already happened. Capture the past few minutes."}\n </div>\n </div>\n\n <label for="sf-issue-description" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">\n What happened? (optional)\n </label>\n <textarea id="sf-issue-description" placeholder="Add description here"\n style="width:100%; height:80px; padding:8px 12px; font-size:14px;\n border:1px solid #cbd5e1; border-radius:6px; margin-bottom:20px;\n resize:none; outline:none;">${Ge.description}</textarea>\n\n <div id="sf-lookback-container" style="display:${a?"none":"block"}; margin-bottom:20px;">\n <label for="sf-lookback-minutes" style="display:block; font-size:14px; font-weight:500; margin-bottom:6px;">\n When did this happen?\n </label>\n <div style="display:flex; align-items:center; justify-content:space-between; gap:12px;">\n <div style="position:relative; display:flex; align-items:center; gap:6px;">\n <select id="sf-lookback-minutes"\n style="\n background: white;\n padding: 4px 8px;\n font-size: 14px;\n border: 1px solid #cbd5e1;\n border-radius: 6px;\n color: #64748B;\n font-family: sans-serif;\n outline: none;\n box-shadow: none;\n appearance: none;\n -webkit-appearance: none;\n -moz-appearance: none;\n padding-right: 28px;\n cursor: pointer;\n font-size: 14px;\n line-height: 20px;\n ">\n ${Array.from({length:15},(e,a)=>{const u=a+1;return`<option value="${u}" ${2===u?"selected":""}>${u}</option>`}).join("")}\n </select>\n <div style="position:absolute; left:32px; top:50%; transform:translateY(-50%); pointer-events:none;">\n <svg width="16" height="16" viewBox="0 0 16 16" fill="none"\n xmlns="http://www.w3.org/2000/svg">\n <path d="M4 6L8 10L12 6" stroke="#52525B" stroke-width="1.33333"\n stroke-linecap="round" stroke-linejoin="round"/>\n </svg>\n </div>\n <span style="font-size:14px; color: #64748B;">minutes ago</span>\n </div>\n <div>\n <label for="sf-occurred-in-tab"\n style="display:flex; align-items:center; gap:6px; font-size:14px; color:#0F172A; cursor:pointer; white-space:nowrap;">\n <input\n type="checkbox"\n id="sf-occurred-in-tab"\n checked\n disabled\n style="width:16px; height:16px; accent-color:#295DBF; cursor:pointer;"\n />\n The issue occurred in this tab?\n </label>\n </div>\n </div>\n </div>\n\n <div id="sf-modal-footer" style="display:flex; justify-content:${a?"space-between":"flex-end"}; align-items:flex-end;">\n\n <div id="sf-record-button-container" style="display:${a?"block":"none"};">\n <div id="sf-recording-timer-label" style="display:none; font-size:14px; margin-bottom:20px;">\n Recording: <span id="sf-recording-timer-display">00:00</span>\n </div>\n <button id="sf-start-recording-btn"\n style="display:flex; align-items:center; gap:8px; border:1px solid #fc5555;\n background:transparent; padding:6px 12px; font-size:14px;\n color: #fc5555; border-radius:6px; cursor:pointer; font-weight:500;">\n <div id="sf-record-icon" style="padding: 6px; border-radius: 6px; border: 1px solid #fc5555; cursor: pointer;">\n <div style="width: 14px; height: 14px; background: #fc5555; border-radius: 50%; border: 1px solid #991b1b;"></div>\n </div>\n <span>Start Recording</span>\n ${getShortcutLabelFromContext("startRecording")}\n </button>\n </div>\n\n <button id="sf-issue-submit-btn"\n style="background: #295DBF; color:white; border:none; padding:8px 16px;\n border-radius:6px; font-size:14px; line-height: 24px; font-weight:500;\n cursor:${a?"not-allowed":"pointer"}; opacity:${a?"0.4":"1"}; margin-bottom:1px" ${a?"disabled":""}>\n Report <span style="margin-left: 8px; display: inline-flex; align-items: center; gap: 4px; color: #94A3B8; font-size: 12px; line-height:16px;">\n ${getShortcutLabelFromContext("submitReport")}\n </span>\n </button>\n </div>\n <div style="display:flex; justify-content:center; font-size: 12px; margin-top: 12px; color: #295dbf;">\n <a href="mailto:info@sailfishqa.com?subject=I'd%20love%20to%20learn%20more&body=Hey%2C%20Sailfish%20AI%20team%20-%20I'd%20love%20to%20learn%20more%20about%20Sailfish%20AI!">Powered by Sailfish AI</a>\n </div>\n </div>\n `,Ge.mode=e,document.body.appendChild(je),function bindListeners(){const e=null==je?void 0:je.querySelectorAll(".sf-issue-tab"),a=document.getElementById("sf-start-recording-btn"),u=document.getElementById("sf-modal-close-btn"),m=document.getElementById("sf-issue-submit-btn"),w=document.getElementById("sf-lookback-minutes");null==e||e.forEach(e=>{e.addEventListener("click",e=>{const a=e.currentTarget.dataset.mode;setActiveTab(a),updateModeSpecificUI(a)})}),u&&(u.onclick=closeModal);w&&w.addEventListener("change",()=>{"lookback"===Ge.mode&&(m.disabled=!1,m.style.opacity="1",m.style.cursor="pointer")});a&&(a.onclick=()=>{const e=document.getElementById("sf-issue-description");e&&(Ge.description=e.value),function startCountdownThenRecord(){if(document.getElementById("sf-countdown-overlay"))return;const e=document.createElement("div");e.id="sf-countdown-overlay",e.style.cssText="\n position: fixed;\n inset: 0;\n background: rgba(0,0,0,0.6);\n z-index: 10001;\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: 80px;\n font-weight: bold;\n color: white;\n font-family: sans-serif;\n ";let a=3;e.textContent=a.toString(),document.body.appendChild(e);const u=setInterval(()=>{a--,a>0?e.textContent=a.toString():(clearInterval(u),document.body.removeChild(e),Ve=Date.now(),Ye=!0,closeModal(),function showFloatingTimer(){const e=document.createElement("div");e.id="sf-recording-indicator",e.style.cssText="\n position: fixed;\n bottom: 20px;\n right: 20px;\n background: white;\n border-radius: 8px;\n box-shadow: 0 4px 20px rgba(0,0,0,0.15);\n padding: 8px 12px;\n font-family: sans-serif;\n font-size: 14px;\n display: flex;\n align-items: start;\n gap: 24px;\n z-index: 10000;\n cursor: pointer;\n ",e.innerHTML=`\n <div style="display:flex; align-items:center; gap:8px;">\n <div style="width:32px; height:32px; background:#FC5555; border-radius:6px; border:1px solid #991b1b; display:flex; align-items:center; justify-content:center;">\n <div style="width:10px; height:10px; background:white; border-radius:2px;"></div>\n </div>\n <div style="display:flex; flex-direction:column; font-size:14px; line-height:20px;">\n <span id="sf-recording-timer" style="font-weight:600; color: #171717;">00:00</span>\n <span style="font-size:12px; line-height:12px; color: #71717A;">Max time 15 mins</span>\n </div>\n </div>\n <div style="display:flex; align-items:center; gap:4px; margin-left:auto; font-size:14px; color:#0F172A;">\n <span style="color: #71717A;">stop</span>\n <span style="display: inline-flex; align-items: center; gap: 4px; color: #94A3B8; font-size: 12px; line-height:16px;">\n ${getShortcutLabelFromContext("stopRecording")}\n </span>\n </div>\n `,e.addEventListener("click",()=>stopRecording()),document.body.appendChild(e);const a=e.querySelector("#sf-recording-timer");if(!a)return;He=setInterval(()=>{const e=Date.now()-(Ve??Date.now()),u=Math.floor(e/6e4).toString().padStart(2,"0"),m=Math.floor(e%6e4/1e3).toString().padStart(2,"0");a.textContent=`${u}:${m}`},1e3)}())},1e3)}()});null==je||je.addEventListener("click",e=>{var a;if(e.target.closest("#sf-issue-submit-btn")){const e=(null==(a=document.getElementById("sf-issue-description"))?void 0:a.value)||"",u=Ge.mode;let m,b;if(Ge.description=e,"startnow"===u)m=Ve??Date.now()-3e5,b=qe??Date.now();else{const e=60*Number((null==w?void 0:w.value)||"2")*1e3;b=Date.now(),m=b-e}closeModal(),async function createTriage(e,a,u){var m,w;try{showTriageStatusModal(!0);const b=await createTriageFromRecorder(Be.apiKey,Be.backendApi,function getSessionIdSafely(){if(!Be.resolveSessionId)throw new Error("getSessionId not defined");return Be.resolveSessionId()}(),e,a,u),S=null==(w=null==(m=null==b?void 0:b.data)?void 0:m.createTriageFromRecorder)?void 0:w.id;S?showTriageStatusModal(!1,S):(console.error("No Triage ID returned from backend."),showTriageStatusModal(!1,null))}catch(e){console.error("Error creating triage:",e),showTriageStatusModal(!1,null)}}(`${m}`,`${b}`,e)}})}(),Be.deactivateIsolation=activateModalIsolation(je)}function setActiveTab(e){Ge.mode=e;const a=null==je?void 0:je.querySelector("#sf-tab-lookback"),u=null==je?void 0:je.querySelector("#sf-tab-startnow");"lookback"===e?(a.style.background="white",a.style.color="#0F172A",u.style.background="transparent",u.style.color="#64748B"):(u.style.background="white",u.style.color="#0F172A",a.style.background="transparent",a.style.color="#64748B")}function updateModeSpecificUI(e){const a=document.querySelector("#sf-issue-mode-info div"),u=document.getElementById("sf-issue-submit-btn"),m=document.getElementById("sf-record-button-container"),w=document.getElementById("sf-recording-timer-label"),b=document.getElementById("sf-recording-timer-display"),S=document.getElementById("sf-modal-footer"),C=document.getElementById("sf-lookback-container");if(a&&u&&m&&w&&b&&S&&C)if("startnow"===e){m.style.display="block",C.style.display="none",S.style.justifyContent="space-between",a.textContent="I want to reproduce the issue right now.";const e=null!==Ve&&null!==qe;if(u.disabled=!e,u.style.opacity=e?"1":"0.4",u.style.cursor=e?"pointer":"not-allowed",Ve&&qe){const e=Math.floor((qe-Ve)/1e3),a=String(Math.floor(e/60)).padStart(2,"0"),u=String(e%60).padStart(2,"0");w.style.display="block",b.textContent=`${a}:${u}`}else w.style.display="none"}else m.style.display="none",w.style.display="none",C.style.display="block",S.style.justifyContent="flex-end",a.textContent="Something already happened. Capture the past few minutes.",u.disabled=!1,u.style.opacity="1",u.style.cursor="pointer"}function stopRecording(){var e;qe=Date.now(),Ye=!1,He&&clearInterval(He),null==(e=document.getElementById("sf-recording-indicator"))||e.remove(),function reopenModalAfterStop(){injectModalHTML("startnow");const e=document.getElementById("sf-start-recording-btn");if(e){const a=e.querySelector("span");a&&(a.textContent="Re-record")}const a=document.getElementById("sf-recording-timer-label"),u=document.getElementById("sf-recording-timer-display");if(a&&u&&Ve&&qe){const e=Math.floor((qe-Ve)/1e3),m=Math.floor(e/60).toString().padStart(2,"0"),w=(e%60).toString().padStart(2,"0");u.textContent=`${m}:${w}`,a.style.display="block"}const m=document.getElementById("sf-issue-description");m&&(m.value=Ge.description);const w=document.querySelector('input[value="startnow"]');w&&(w.checked=!0);const b=document.getElementById("sf-inline-record-chip"),S=document.getElementById("sf-inline-record-timer");if(b&&S){const e=Math.floor(((qe??0)-(Ve??0))/1e3),a=Math.floor(e/60).toString().padStart(2,"0"),u=Math.floor(e%60).toString().padStart(2,"0");S.textContent=`${a}:${u}`,S.style.color="black",b.style.display="flex"}const C=document.getElementById("sf-issue-submit-btn");C.disabled=!1,C.style.opacity="1",C.style.cursor="pointer"}()}function showTriageStatusModal(e,a){var u;!function removeExistingModals(){var e,a;null==(e=document.getElementById("sf-report-issue-modal"))||e.remove(),null==(a=document.getElementById("sf-triage-status-modal"))||a.remove()}();const m=a?`${Be.triageBaseUrl}/triage/${a}?from=inAppReportIssue`:"",w=document.createElement("div");w.id="sf-triage-status-modal",Object.assign(w.style,{position:"fixed",inset:"0",zIndex:"9998",display:"flex",alignItems:"center",justifyContent:"center"});const b=e?"Reporting Issue...":"Issue reported!",S=e?'<p style="font-size:14px; color:#64748b; line-height:20px;">This may take ~10 seconds</p>':"",C=e?'<div style="display:flex; justify-content:center; align-items:center; padding: 40px 0;">\n <div style="width:24px; height:24px; border:2px solid #295dbf; border-top:2px solid white; border-radius:50%; animation:spin 1s linear infinite;"></div>\n </div>':"",x=e?"":'<div id="sf-copied-status" style="display:none; font-size:12px; font-weight:500; color:white;\n background-color:#22c55e; padding:4px 8px; border-radius:6px; white-space:nowrap; align-items:center; gap:6px;">\n <svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M21 7.5L9 19.5L3 13.5L5.25 11.25L9 15L18.75 5.25L21 7.5Z" fill="white"/>\n </svg>\n Copied\n </div>';w.innerHTML=`\n <div style="position:fixed; inset:0; background:rgba(0,0,0,0.4); z-index:9998;"></div>\n <div id="sf-triage-card"\n style="position:relative; background:#fff; padding:24px; border-radius:12px; width:300px; max-width:90%;\n font-family:sans-serif; box-shadow:0 4px 20px rgba(0,0,0,0.15);\n z-index:9999; opacity:1; transition:opacity 300ms ease;">\n <div style="position:absolute; top:24px; right:48px;">${x}</div>\n\n <button id="sf-triage-modal-close"\n style="position:absolute; top:24px; right:16px; background:none; border:none; cursor:pointer;">\n <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M18 6L6 18" stroke="#71717A" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M6 6L18 18" stroke="#71717A" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>\n </button>\n\n <h2 style="font-size:18px; font-weight:600; margin-bottom:${e?8:40}px; line-height:28px;">${b}</h2>\n ${S}\n ${C}\n\n <div style="display:flex; justify-content:flex-end; align-items:center; gap:8px;">\n <button id="sf-copy-triage-link"\n style="background:white; border:1px solid #e2e8f0; padding:8px 16px; border-radius:6px;\n font-size:14px; color: #0f172a; cursor:pointer;">\n Share\n </button>\n <button id="sf-view-triage-btn"\n style="display:flex; align-items:center; gap:8px; background:#295dbf; border:none;\n padding:8px 16px; border-radius:6px; font-size:14px; color:white; cursor:pointer;">\n View\n <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 8.66667V12.6667C12 13.0203 11.8595 13.3594 11.6095 13.6095C11.3594 13.8595 11.0203 14 10.6667 14H3.33333C2.97971 14 2.64057 13.8595 2.39052 13.6095C2.14048 13.3594 2 13.0203 2 12.6667V5.33333C2 4.97971 2.14048 4.64057 2.39052 4.39052C2.64057 4.14048 2.97971 4 3.33333 4H7.33333" stroke="white" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M10 2H14V6" stroke="white" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M6.66602 9.33333L13.9993 2" stroke="white" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>\n </button>\n </div>\n </div>\n <style>\n @keyframes spin { to { transform: rotate(360deg); } }\n </style>\n `,document.body.appendChild(w);const I=w.querySelector("#sf-triage-card");null==(u=document.getElementById("sf-triage-modal-close"))||u.addEventListener("click",()=>{fadeCardAndRemove(w,I,300)});const _=document.getElementById("sf-copy-triage-link"),O=document.getElementById("sf-view-triage-btn");e?(_.disabled=!0,_.style.opacity="0.4",_.style.cursor="not-allowed",O.disabled=!0,O.style.opacity="0.4",O.style.cursor="not-allowed"):(_.disabled=!1,_.addEventListener("click",()=>{navigator.clipboard.writeText(m).then(()=>{const e=document.getElementById("sf-copied-status");e&&(e.style.display="flex")})}),O.disabled=!1,O.addEventListener("click",()=>{a&&window.open(m,"_blank")}),setTimeout(()=>fadeCardAndRemove(w,I,300),1e4))}function fadeCardAndRemove(e,a,u=300){a.style.opacity="0",a.addEventListener("transitionend",()=>e.remove(),{once:!0}),setTimeout(()=>e.remove(),u+100)}var Je=Object.defineProperty,b$1=(e,a,u)=>((e,a,u)=>a in e?Je(e,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):e[a]=u)(e,"symbol"!=typeof a?a+"":a,u),Xe=Object.defineProperty,xn=(e,a,u)=>((e,a,u)=>a in e?Xe(e,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):e[a]=u)(e,"symbol"!=typeof a?a+"":a,u),Qe=(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))(Qe||{});function vr(e){return e.nodeType===e.ELEMENT_NODE}function We(e){const a=null==e?void 0:e.host;return(null==a?void 0:a.shadowRoot)===e}function ze(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Tt(e){try{const a=e.rules||e.cssRules;return a?function wi(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(a,kr).join("")):null}catch{return null}}function kr(e){let a;if(function vi(e){return"styleSheet"in e}(e))try{a=Tt(e.styleSheet)||function bi(e){const{cssText:a}=e;if(a.split('"').length<3)return a;const u=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?u.push("layer"):e.layerName&&u.push(`layer(${e.layerName})`),e.supportsText&&u.push(`supports(${e.supportsText})`),e.media.length&&u.push(e.media.mediaText),u.join(" ")+";"}(e)}catch{}else if(function ki(e){return"selectorText"in e}(e)&&e.selectorText.includes(":"))return function Si(e){const a=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(a,"$1\\$2")}(e.cssText);return a||e.cssText}let et=class{constructor(){xn(this,"idNodeMap",new Map),xn(this,"nodeMetaMap",new WeakMap)}getId(e){var a;return e?(null==(a=this.getMeta(e))?void 0:a.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 a=this.getId(e);this.idNodeMap.delete(a),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,a){const u=a.id;this.idNodeMap.set(u,e),this.nodeMetaMap.set(e,a)}replace(e,a){const u=this.getNode(e);if(u){const e=this.nodeMetaMap.get(u);e&&this.nodeMetaMap.set(a,e)}this.idNodeMap.set(e,a)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Zt({element:e,maskInputOptions:a,tagName:u,type:m,value:w,maskInputFn:b}){let S=w||"",C="";const x=m&&fe(m);let I=!1;return(a[u.toLowerCase()]||x&&a[x])&&(C=b?b(S,e):"*".repeat(S.length),I=S!==C),{value:C,masked:I}}function fe(e){return e.toLowerCase()}const nt="__rrweb_original__";function Yt(e){const a=e.type;return e.hasAttribute("data-rr-is-password")?"password":a?fe(a):null}function xr(e,a){let u;try{u=new URL(e,a??window.location.href)}catch{return null}const m=u.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==m?void 0:m[1])??null}let ot=1;const st=new RegExp("[^a-z0-9-_:]");function Ir(){return ot++}let it,at;const lt=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ct=/^(?:[a-z+]+:)?\/\//i,ut=/^www\..*/i,pt=/^(data:)([^,]*),(.*)/i;function Pt(e,a){return(e||"").replace(lt,(e,u,m,w,b,S)=>{const C=m||b||S,x=u||w||"";if(!C)return e;if(ct.test(C)||ut.test(C))return`url(${x}${C}${x})`;if(pt.test(C))return`url(${x}${C}${x})`;if("/"===C[0])return`url(${x}${function Ei(e){let a="";return a=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],a=a.split("?")[0],a}(a)+C}${x})`;const I=a.split("/"),_=C.split("/");I.pop();for(const e of _)"."!==e&&(".."===e?I.pop():I.push(e));return`url(${x}${I.join("/")}${x})`})}const dt=/^[^ \t\n\r\u000c]+/,ht=/^[, \t\n\r\u000c]+/;const gt=new WeakMap;function At(e,a){return a&&""!==a.trim()?$t(e,a):a}function Fi(e){return!("svg"!==e.tagName&&!e.ownerSVGElement)}function $t(e,a){let u=gt.get(e);if(u||(u=e.createElement("a"),gt.set(e,u)),a){if(a.startsWith("blob:")||a.startsWith("data:"))return a}else a="";return u.setAttribute("href",a),u.href}function Mr(e,a,u,m){return m&&("src"===u||"href"===u&&("use"!==a||"#"!==m[0])||"xlink:href"===u&&"#"!==m[0]||"background"===u&&("table"===a||"td"===a||"th"===a)?At(e,m):"srcset"===u?function Di(e,a){if(""===a.trim())return a;let u=0;function n(e){let m;const w=e.exec(a.substring(u));return w?(m=w[0],u+=m.length,m):""}const m=[];for(;n(ht),!(u>=a.length);){let w=n(dt);if(","===w.slice(-1))w=At(e,w.substring(0,w.length-1)),m.push(w);else{let b="";w=At(e,w);let S=!1;for(;;){const e=a.charAt(u);if(""===e){m.push((w+b).trim());break}if(S)")"===e&&(S=!1);else{if(","===e){u+=1,m.push((w+b).trim());break}"("===e&&(S=!0)}b+=e,u+=1}}}return m.join(", ")}(e,m):"style"===u?Pt(m,$t(e)):"object"===a&&"data"===u?At(e,m):m)}function Or(e,a,u){return("video"===e||"audio"===e)&&"autoplay"===a}function Nt(e,a,u){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!u&&Nt(e.parentNode,a,u);for(let u=e.classList.length;u--;){const m=e.classList[u];if(a.test(m))return!0}return!!u&&Nt(e.parentNode,a,u)}function Er(e,a,u,m){let w;if(vr(e)){if(w=e,!w.childNodes.length)return!1}else{if(null===e.parentElement)return!1;w=e.parentElement}try{if("string"==typeof a){if(m){if(w.closest(`.${a}`))return!0}else if(w.classList.contains(a))return!0}else if(Nt(w,a,m))return!0;if(u)if(m){if(w.closest(u))return!0}else if(w.matches(u))return!0}catch{}return!1}function zi(e,a){const{doc:u,mirror:m,blockClass:w,blockSelector:b,needsMask:S,inlineStylesheet:C,maskInputOptions:x={},maskTextFn:I,maskInputFn:_,dataURLOptions:O={},inlineImages:E,recordCanvas:D,keepIframeSrcFn:F,newlyAddedElement:U=!1}=a,$=function Bi(e,a){if(!a.hasNode(e))return;const u=a.getId(e);return 1===u?void 0:u}(u,m);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:Qe.Document,childNodes:[],compatMode:e.compatMode}:{type:Qe.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Qe.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:$};case e.ELEMENT_NODE:return function Vi(e,a){const{doc:u,blockClass:m,blockSelector:w,inlineStylesheet:b,maskInputOptions:S={},maskInputFn:C,dataURLOptions:x={},inlineImages:I,recordCanvas:_,keepIframeSrcFn:O,newlyAddedElement:E=!1,rootId:D}=a,F=function Ui(e,a,u){try{if("string"==typeof a){if(e.classList.contains(a))return!0}else for(let u=e.classList.length;u--;){const m=e.classList[u];if(a.test(m))return!0}if(u)return e.matches(u)}catch{}return!1}(e,m,w),U=function Oi(e){if(e instanceof HTMLFormElement)return"form";const a=fe(e.tagName);return st.test(a)?"div":a}(e);let $={};const B=e.attributes.length;for(let a=0;a<B;a++){const m=e.attributes[a];Or(U,m.name,m.value)||($[m.name]=Mr(u,U,fe(m.name),m.value))}if("link"===U&&b){const a=Array.from(u.styleSheets).find(a=>a.href===e.href);let m=null;a&&(m=Tt(a)),m&&(delete $.rel,delete $.href,$._cssText=Pt(m,a.href))}if("style"===U&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const a=Tt(e.sheet);a&&($._cssText=Pt(a,$t(u)))}if("input"===U||"textarea"===U||"select"===U){const a=e.value,u=e.checked;if("radio"!==$.type&&"checkbox"!==$.type&&"submit"!==$.type&&"button"!==$.type&&a){const u=Zt({element:e,type:Yt(e),tagName:U,value:a,maskInputOptions:S,maskInputFn:C});$.value=u.value,u.masked&&($.masked=!0)}else u&&($.checked=u)}if("option"===U&&(e.selected&&!S.select?$.selected=!0:delete $.selected),"canvas"===U&&_)if("2d"===e.__context)(function xi(e){const a=e.getContext("2d");if(!a)return!0;for(let u=0;u<e.width;u+=50)for(let m=0;m<e.height;m+=50){const w=a.getImageData,b=nt in w?w[nt]:w;if(new Uint32Array(b.call(a,u,m,Math.min(50,e.width-u),Math.min(50,e.height-m)).data.buffer).some(e=>0!==e))return!1}return!0})(e)||($.rr_dataURL=e.toDataURL(x.type,x.quality));else if(!("__context"in e)){const a=e.toDataURL(x.type,x.quality),m=u.createElement("canvas");m.width=e.width,m.height=e.height;a!==m.toDataURL(x.type,x.quality)&&($.rr_dataURL=a)}if("img"===U&&I){it||(it=u.createElement("canvas"),at=it.getContext("2d"));const a=e,m=a.currentSrc||a.getAttribute("src")||"<unknown-src>",w=a.crossOrigin,A=()=>{a.removeEventListener("load",A);try{it.width=a.naturalWidth,it.height=a.naturalHeight,at.drawImage(a,0,0),$.rr_dataURL=it.toDataURL(x.type,x.quality)}catch(e){if("anonymous"!==a.crossOrigin)return a.crossOrigin="anonymous",void(a.complete&&0!==a.naturalWidth?A():a.addEventListener("load",A));console.warn(`Cannot inline img src=${m}! Error: ${e}`)}"anonymous"===a.crossOrigin&&(w?$.crossOrigin=w:a.removeAttribute("crossorigin"))};a.complete&&0!==a.naturalWidth?A():a.addEventListener("load",A)}if("audio"===U||"video"===U){const a=$;a.rr_mediaState=e.paused?"paused":"played",a.rr_mediaCurrentTime=e.currentTime,a.rr_mediaPlaybackRate=e.playbackRate,a.rr_mediaMuted=e.muted,a.rr_mediaLoop=e.loop,a.rr_mediaVolume=e.volume}if(E||(e.scrollLeft&&($.rr_scrollLeft=e.scrollLeft),e.scrollTop&&($.rr_scrollTop=e.scrollTop)),F){const{width:a,height:u}=e.getBoundingClientRect();$={class:$.class,rr_width:`${a}px`,rr_height:`${u}px`}}let z;"iframe"===U&&!O($.src)&&(e.contentDocument||($.rr_src=$.src),delete $.src);try{customElements.get(U)&&(z=!0)}catch{}return{type:Qe.Element,tagName:U,attributes:$,childNodes:[],isSVG:Fi(e)||void 0,needBlock:F,rootId:D,isCustom:z}}(e,{doc:u,blockClass:w,blockSelector:b,inlineStylesheet:C,maskInputOptions:x,maskInputFn:_,dataURLOptions:O,inlineImages:E,recordCanvas:D,keepIframeSrcFn:F,newlyAddedElement:U,rootId:$});case e.TEXT_NODE:return function ji(e,a){var u;const{needsMask:m,maskTextFn:w,rootId:b}=a,S=e.parentNode&&e.parentNode.tagName;let C=e.textContent;const x="STYLE"===S||void 0,I="SCRIPT"===S||void 0;if(x&&C){try{e.nextSibling||e.previousSibling||null!=(u=e.parentNode.sheet)&&u.cssRules&&(C=Tt(e.parentNode.sheet))}catch(a){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${a}`,e)}C=Pt(C,$t(a.doc))}return I&&(C="SCRIPT_PLACEHOLDER"),!x&&!I&&C&&m&&(C=w?w(C,e.parentElement):C.replace(/[\S]/g,"*")),{type:Qe.Text,textContent:C||"",isStyle:x,rootId:b}}(e,{doc:u,needsMask:S,maskTextFn:I,rootId:$});case e.CDATA_SECTION_NODE:return{type:Qe.CDATA,textContent:"",rootId:$};case e.COMMENT_NODE:return{type:Qe.Comment,textContent:e.textContent||"",rootId:$};default:return!1}}function N(e){return null==e?"":e.toLowerCase()}function Se(e,a){const{doc:u,mirror:m,blockClass:w,blockSelector:b,maskTextClass:S,maskTextSelector:C,skipChild:x=!1,inlineStylesheet:I=!0,maskInputOptions:_={},maskTextFn:O,maskInputFn:E,slimDOMOptions:D,dataURLOptions:F={},inlineImages:U=!1,recordCanvas:$=!1,onSerialize:B,onIframeLoad:z,iframeLoadTimeout:j=5e3,onStylesheetLoad:V,stylesheetLoadTimeout:q=5e3,keepIframeSrcFn:H=()=>!1,newlyAddedElement:Y=!1}=a;let{needsMask:J}=a,{preserveWhiteSpace:X=!0}=a;J||(J=Er(e,S,C,void 0===J));const Q=zi(e,{doc:u,mirror:m,blockClass:w,blockSelector:b,needsMask:J,inlineStylesheet:I,maskInputOptions:_,maskTextFn:O,maskInputFn:E,dataURLOptions:F,inlineImages:U,recordCanvas:$,keepIframeSrcFn:H,newlyAddedElement:Y});if(!Q)return console.warn(e,"not serialized"),null;let ee;ee=m.hasNode(e)?m.getId(e):function Gi(e,a){return!!(a.comment&&e.type===Qe.Comment||e.type===Qe.Element&&(a.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"===xr(e.attributes.href))||a.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(N(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===N(e.attributes.name)||"icon"===N(e.attributes.rel)||"apple-touch-icon"===N(e.attributes.rel)||"shortcut icon"===N(e.attributes.rel)))||"meta"===e.tagName&&(a.headMetaDescKeywords&&N(e.attributes.name).match(/^description|keywords$/)||a.headMetaSocial&&(N(e.attributes.property).match(/^(og|twitter|fb):/)||N(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===N(e.attributes.name))||a.headMetaRobots&&("robots"===N(e.attributes.name)||"googlebot"===N(e.attributes.name)||"bingbot"===N(e.attributes.name))||a.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"]||a.headMetaAuthorship&&("author"===N(e.attributes.name)||"generator"===N(e.attributes.name)||"framework"===N(e.attributes.name)||"publisher"===N(e.attributes.name)||"progid"===N(e.attributes.name)||N(e.attributes.property).match(/^article:/)||N(e.attributes.property).match(/^product:/))||a.headMetaVerification&&("google-site-verification"===N(e.attributes.name)||"yandex-verification"===N(e.attributes.name)||"csrf-token"===N(e.attributes.name)||"p:domain_verify"===N(e.attributes.name)||"verify-v1"===N(e.attributes.name)||"verification"===N(e.attributes.name)||"shopify-checkout-api-token"===N(e.attributes.name)))))}(Q,D)||!X&&Q.type===Qe.Text&&!Q.isStyle&&!Q.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Ir();const te=Object.assign(Q,{id:ee});if(m.add(e,te),-2===ee)return null;B&&B(e);let ne=!x;if(te.type===Qe.Element){ne=ne&&!te.needBlock,delete te.needBlock;const a=e.shadowRoot;a&&ze(a)&&(te.isShadowHost=!0)}if((te.type===Qe.Document||te.type===Qe.Element)&&ne){D.headWhitespace&&te.type===Qe.Element&&"head"===te.tagName&&(X=!1);const a={doc:u,mirror:m,blockClass:w,blockSelector:b,needsMask:J,maskTextClass:S,maskTextSelector:C,skipChild:x,inlineStylesheet:I,maskInputOptions:_,maskTextFn:O,maskInputFn:E,slimDOMOptions:D,dataURLOptions:F,inlineImages:U,recordCanvas:$,preserveWhiteSpace:X,onSerialize:B,onIframeLoad:z,iframeLoadTimeout:j,onStylesheetLoad:V,stylesheetLoadTimeout:q,keepIframeSrcFn:H};if(te.type!==Qe.Element||"textarea"!==te.tagName||void 0===te.attributes.value)for(const u of Array.from(e.childNodes)){const e=Se(u,a);e&&te.childNodes.push(e)}if(vr(e)&&e.shadowRoot)for(const u of Array.from(e.shadowRoot.childNodes)){const m=Se(u,a);m&&(ze(e.shadowRoot)&&(m.isShadow=!0),te.childNodes.push(m))}}return e.parentNode&&We(e.parentNode)&&ze(e.parentNode)&&(te.isShadow=!0),te.type===Qe.Element&&"iframe"===te.tagName&&function _i(e,a,u){const m=e.contentWindow;if(!m)return;let w,b=!1;try{w=m.document.readyState}catch{return}if("complete"!==w){const m=setTimeout(()=>{b||(a(),b=!0)},u);return void e.addEventListener("load",()=>{clearTimeout(m),b=!0,a()})}const S="about:blank";if(m.location.href!==S||e.src===S||""===e.src)return setTimeout(a,0),e.addEventListener("load",a);e.addEventListener("load",a)}(e,()=>{const a=e.contentDocument;if(a&&z){const u=Se(a,{doc:a,mirror:m,blockClass:w,blockSelector:b,needsMask:J,maskTextClass:S,maskTextSelector:C,skipChild:!1,inlineStylesheet:I,maskInputOptions:_,maskTextFn:O,maskInputFn:E,slimDOMOptions:D,dataURLOptions:F,inlineImages:U,recordCanvas:$,preserveWhiteSpace:X,onSerialize:B,onIframeLoad:z,iframeLoadTimeout:j,onStylesheetLoad:V,stylesheetLoadTimeout:q,keepIframeSrcFn:H});u&&z(e,u)}},j),te.type===Qe.Element&&"link"===te.tagName&&"string"==typeof te.attributes.rel&&("stylesheet"===te.attributes.rel||"preload"===te.attributes.rel&&"string"==typeof te.attributes.href&&"css"===xr(te.attributes.href))&&function Wi(e,a,u){let m,w=!1;try{m=e.sheet}catch{return}if(m)return;const b=setTimeout(()=>{w||(a(),w=!0)},u);e.addEventListener("load",()=>{clearTimeout(b),w=!0,a()})}(e,()=>{if(V){const a=Se(e,{doc:u,mirror:m,blockClass:w,blockSelector:b,needsMask:J,maskTextClass:S,maskTextSelector:C,skipChild:!1,inlineStylesheet:I,maskInputOptions:_,maskTextFn:O,maskInputFn:E,slimDOMOptions:D,dataURLOptions:F,inlineImages:U,recordCanvas:$,preserveWhiteSpace:X,onSerialize:B,onIframeLoad:z,iframeLoadTimeout:j,onStylesheetLoad:V,stylesheetLoadTimeout:q,keepIframeSrcFn:H});a&&V(e,a)}},q),te}function Yi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function $i(e){if(e.__esModule)return e;var a=e.default;if("function"==typeof a){var u=function n(){return this instanceof n?Reflect.construct(a,arguments,this.constructor):a.apply(this,arguments)};u.prototype=a.prototype}else u={};return Object.defineProperty(u,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var m=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(u,a,m.get?m:{enumerable:!0,get:function(){return e[a]}})}),u}var yt={exports:{}},wt=String,Rr=function(){return{isColorSupported:!1,reset:wt,bold:wt,dim:wt,italic:wt,underline:wt,inverse:wt,hidden:wt,strikethrough:wt,black:wt,red:wt,green:wt,yellow:wt,blue:wt,magenta:wt,cyan:wt,white:wt,gray:wt,bgBlack:wt,bgRed:wt,bgGreen:wt,bgYellow:wt,bgBlue:wt,bgMagenta:wt,bgCyan:wt,bgWhite:wt,blackBright:wt,redBright:wt,greenBright:wt,yellowBright:wt,blueBright:wt,magentaBright:wt,cyanBright:wt,whiteBright:wt,bgBlackBright:wt,bgRedBright:wt,bgGreenBright:wt,bgYellowBright:wt,bgBlueBright:wt,bgMagentaBright:wt,bgCyanBright:wt,bgWhiteBright:wt}};yt.exports=Rr(),yt.exports.createColors=Rr;var bt=yt.exports;const vt=$i(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let St=bt,Ct=vt,kt=class Lr extends Error{constructor(e,a,u,m,w,b){super(e),this.name="CssSyntaxError",this.reason=e,w&&(this.file=w),m&&(this.source=m),b&&(this.plugin=b),typeof a<"u"&&typeof u<"u"&&("number"==typeof a?(this.line=a,this.column=u):(this.line=a.line,this.column=a.column,this.endLine=u.line,this.endColumn=u.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Lr)}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 a=this.source;null==e&&(e=St.isColorSupported);let n=e=>e,r=e=>e,i=e=>e;if(e){let{bold:e,gray:a,red:u}=St.createColors(!0);r=a=>e(u(a)),n=e=>a(e),Ct&&(i=e=>Ct(e))}let u=a.split(/\r?\n/),m=Math.max(this.line-3,0),w=Math.min(this.line+2,u.length),b=String(w).length;return u.slice(m,w).map((e,a)=>{let u=m+1+a,w=" "+(" "+u).slice(-b)+" | ";if(u===this.line){if(e.length>160){let a=20,u=Math.max(0,this.column-a),m=Math.max(this.column+a,this.endColumn+a),b=e.slice(u,m),S=n(w.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,a-1)).replace(/[^\t]/g," ");return r(">")+n(w)+i(b)+"\n "+S+r("^")}let a=n(w.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(w)+i(e)+"\n "+a+r("^")}return" "+n(w)+i(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var xt=kt;kt.default=kt;const Mt={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let It=class{constructor(e){this.builder=e}atrule(e,a){let u="@"+e.name,m=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?u+=e.raws.afterName:m&&(u+=" "),e.nodes)this.block(e,u+m);else{let w=(e.raws.between||"")+(a?";":"");this.builder(u+m+w,e)}}beforeAfter(e,a){let u;u="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===a?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let m=e.parent,w=0;for(;m&&"root"!==m.type;)w+=1,m=m.parent;if(u.includes("\n")){let a=this.raw(e,null,"indent");if(a.length)for(let e=0;e<w;e++)u+=a}return u}block(e,a){let u,m=this.raw(e,"between","beforeOpen");this.builder(a+m+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),u=this.raw(e,"after")):u=this.raw(e,"after","emptyBody"),u&&this.builder(u),this.builder("}",e,"end")}body(e){let a=e.nodes.length-1;for(;a>0&&"comment"===e.nodes[a].type;)a-=1;let u=this.raw(e,"semicolon");for(let m=0;m<e.nodes.length;m++){let w=e.nodes[m],b=this.raw(w,"before");b&&this.builder(b),this.stringify(w,a!==m||u)}}comment(e){let a=this.raw(e,"left","commentLeft"),u=this.raw(e,"right","commentRight");this.builder("/*"+a+e.text+u+"*/",e)}decl(e,a){let u=this.raw(e,"between","colon"),m=e.prop+u+this.rawValue(e,"value");e.important&&(m+=e.raws.important||" !important"),a&&(m+=";"),this.builder(m,e)}document(e){this.body(e)}raw(e,a,u){let m;if(u||(u=a),a&&(m=e.raws[a],typeof m<"u"))return m;let w=e.parent;if("before"===u&&(!w||"root"===w.type&&w.first===e||w&&"document"===w.type))return"";if(!w)return Mt[u];let b=e.root();if(b.rawCache||(b.rawCache={}),typeof b.rawCache[u]<"u")return b.rawCache[u];if("before"===u||"after"===u)return this.beforeAfter(e,u);{let w="raw"+function Ki(e){return e[0].toUpperCase()+e.slice(1)}(u);this[w]?m=this[w](b,e):b.walk(e=>{if(m=e.raws[a],typeof m<"u")return!1})}return typeof m>"u"&&(m=Mt[u]),b.rawCache[u]=m,m}rawBeforeClose(e){let a;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&typeof e.raws.after<"u")return a=e.raws.after,a.includes("\n")&&(a=a.replace(/[^\n]+$/,"")),!1}),a&&(a=a.replace(/\S/g,"")),a}rawBeforeComment(e,a){let u;return e.walkComments(e=>{if(typeof e.raws.before<"u")return u=e.raws.before,u.includes("\n")&&(u=u.replace(/[^\n]+$/,"")),!1}),typeof u>"u"?u=this.raw(a,null,"beforeDecl"):u&&(u=u.replace(/\S/g,"")),u}rawBeforeDecl(e,a){let u;return e.walkDecls(e=>{if(typeof e.raws.before<"u")return u=e.raws.before,u.includes("\n")&&(u=u.replace(/[^\n]+$/,"")),!1}),typeof u>"u"?u=this.raw(a,null,"beforeRule"):u&&(u=u.replace(/\S/g,"")),u}rawBeforeOpen(e){let a;return e.walk(e=>{if("decl"!==e.type&&(a=e.raws.between,typeof a<"u"))return!1}),a}rawBeforeRule(e){let a;return e.walk(u=>{if(u.nodes&&(u.parent!==e||e.first!==u)&&typeof u.raws.before<"u")return a=u.raws.before,a.includes("\n")&&(a=a.replace(/[^\n]+$/,"")),!1}),a&&(a=a.replace(/\S/g,"")),a}rawColon(e){let a;return e.walkDecls(e=>{if(typeof e.raws.between<"u")return a=e.raws.between.replace(/[^\s:]/g,""),!1}),a}rawEmptyBody(e){let a;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(a=e.raws.after,typeof a<"u"))return!1}),a}rawIndent(e){if(e.raws.indent)return e.raws.indent;let a;return e.walk(u=>{let m=u.parent;if(m&&m!==e&&m.parent&&m.parent===e&&typeof u.raws.before<"u"){let e=u.raws.before.split("\n");return a=e[e.length-1],a=a.replace(/\S/g,""),!1}}),a}rawSemicolon(e){let a;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(a=e.raws.semicolon,typeof a<"u"))return!1}),a}rawValue(e,a){let u=e[a],m=e.raws[a];return m&&m.value===u?m.raw:u}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,a){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,a)}};var Et=It;It.default=It;let Lt=Et;function ks(e,a){new Lt(a).stringify(e)}var Rt=ks;ks.default=ks;var Dt={};Dt.isClean=Symbol("isClean"),Dt.my=Symbol("my");let Ft=xt,Ut=Et,Bt=Rt,{isClean:Wt,my:jt}=Dt;function Cs(e,a){let u=new e.constructor;for(let m in e){if(!Object.prototype.hasOwnProperty.call(e,m)||"proxyCache"===m)continue;let w=e[m],b=typeof w;"parent"===m&&"object"===b?a&&(u[m]=a):"source"===m?u[m]=w:Array.isArray(w)?u[m]=w.map(e=>Cs(e,u)):("object"===b&&null!==w&&(w=Cs(w)),u[m]=w)}return u}function Pe(e,a){if(a&&typeof a.offset<"u")return a.offset;let u=1,m=1,w=0;for(let b=0;b<e.length;b++){if(m===a.line&&u===a.column){w=b;break}"\n"===e[b]?(u=1,m+=1):u+=1}return w}let Vt=class{get proxyOf(){return this}constructor(e={}){this.raws={},this[Wt]=!1,this[jt]=!0;for(let a in e)if("nodes"===a){this.nodes=[];for(let u of e[a])"function"==typeof u.clone?this.append(u.clone()):this.append(u)}else this[a]=e[a]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let a=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${a.input.from}:${a.start.line}:${a.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let a in e)this[a]=e[a];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 a=Cs(this);for(let u in e)a[u]=e[u];return a}cloneAfter(e={}){let a=this.clone(e);return this.parent.insertAfter(this,a),a}cloneBefore(e={}){let a=this.clone(e);return this.parent.insertBefore(this,a),a}error(e,a={}){if(this.source){let{end:u,start:m}=this.rangeBy(a);return this.source.input.error(e,{column:m.column,line:m.line},{column:u.column,line:u.line},a)}return new Ft(e)}getProxyProcessor(){return{get:(e,a)=>"proxyOf"===a?e:"root"===a?()=>e.root().toProxy():e[a],set:(e,a,u)=>(e[a]===u||(e[a]=u,("prop"===a||"value"===a||"name"===a||"params"===a||"important"===a||"text"===a)&&e.markDirty()),!0)}}markClean(){this[Wt]=!0}markDirty(){if(this[Wt]){this[Wt]=!1;let e=this;for(;e=e.parent;)e[Wt]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e){let a=this.source.start;if(e.index)a=this.positionInside(e.index);else if(e.word){let u="document"in this.source.input?this.source.input.document:this.source.input.css,m=u.slice(Pe(u,this.source.start),Pe(u,this.source.end)).indexOf(e.word);-1!==m&&(a=this.positionInside(m))}return a}positionInside(e){let a=this.source.start.column,u=this.source.start.line,m="document"in this.source.input?this.source.input.document:this.source.input.css,w=Pe(m,this.source.start),b=w+e;for(let e=w;e<b;e++)"\n"===m[e]?(a=1,u+=1):a+=1;return{column:a,line:u}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let a={column:this.source.start.column,line:this.source.start.line},u=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:a.column+1,line:a.line};if(e.word){let m="document"in this.source.input?this.source.input.document:this.source.input.css,w=m.slice(Pe(m,this.source.start),Pe(m,this.source.end)).indexOf(e.word);-1!==w&&(a=this.positionInside(w),u=this.positionInside(w+e.word.length))}else e.start?a={column:e.start.column,line:e.start.line}:e.index&&(a=this.positionInside(e.index)),e.end?u={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?u=this.positionInside(e.endIndex):e.index&&(u=this.positionInside(e.index+1));return(u.line<a.line||u.line===a.line&&u.column<=a.column)&&(u={column:a.column+1,line:a.line}),{end:u,start:a}}raw(e,a){return(new Ut).raw(this,e,a)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let a=this,u=!1;for(let m of e)m===this?u=!0:u?(this.parent.insertAfter(a,m),a=m):this.parent.insertBefore(a,m);u||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,a){let u={},m=null==a;a=a||new Map;let w=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e)||"parent"===e||"proxyCache"===e)continue;let m=this[e];if(Array.isArray(m))u[e]=m.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,a):e);else if("object"==typeof m&&m.toJSON)u[e]=m.toJSON(null,a);else if("source"===e){let b=a.get(m.input);null==b&&(b=w,a.set(m.input,w),w++),u[e]={end:m.end,inputId:b,start:m.start}}else u[e]=m}return m&&(u.inputs=[...a.keys()].map(e=>e.toJSON())),u}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Bt){e.stringify&&(e=e.stringify);let a="";return e(this,e=>{a+=e}),a}warn(e,a,u){let m={node:this};for(let e in u)m[e]=u[e];return e.warn(a,m)}};var Ht=Vt;Vt.default=Vt;let Kt=Ht,Jt=class extends Kt{constructor(e){super(e),this.type="comment"}};var Xt=Jt;Jt.default=Jt;let Qt=Ht,en=class extends Qt{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&typeof e.value<"u"&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}};var tn=en;en.default=en;let nn,rn,on,sn,an=Xt,ln=tn,cn=Ht,{isClean:un,my:pn}=Dt;function _r(e){return e.map(e=>(e.nodes&&(e.nodes=_r(e.nodes)),delete e.source,e))}function Wr(e){if(e[un]=!1,e.proxyOf.nodes)for(let a of e.proxyOf.nodes)Wr(a)}let dn=class zr extends cn{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]}append(...e){for(let a of e){let e=this.normalize(a,this.last);for(let a of e)this.proxyOf.nodes.push(a)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let a of this.nodes)a.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let a,u,m=this.getIterator();for(;this.indexes[m]<this.proxyOf.nodes.length&&(a=this.indexes[m],u=e(this.proxyOf.nodes[a],a),!1!==u);)this.indexes[m]+=1;return delete this.indexes[m],u}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,a)=>"proxyOf"===a?e:e[a]?"each"===a||"string"==typeof a&&a.startsWith("walk")?(...u)=>e[a](...u.map(e=>"function"==typeof e?(a,u)=>e(a.toProxy(),u):e)):"every"===a||"some"===a?u=>e[a]((e,...a)=>u(e.toProxy(),...a)):"root"===a?()=>e.root().toProxy():"nodes"===a?e.nodes.map(e=>e.toProxy()):"first"===a||"last"===a?e[a].toProxy():e[a]:e[a],set:(e,a,u)=>(e[a]===u||(e[a]=u,("name"===a||"params"===a||"selector"===a)&&e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,a){let u,m=this.index(e),w=this.normalize(a,this.proxyOf.nodes[m]).reverse();m=this.index(e);for(let e of w)this.proxyOf.nodes.splice(m+1,0,e);for(let e in this.indexes)u=this.indexes[e],m<u&&(this.indexes[e]=u+w.length);return this.markDirty(),this}insertBefore(e,a){let u,m=this.index(e),w=0===m&&"prepend",b=this.normalize(a,this.proxyOf.nodes[m],w).reverse();m=this.index(e);for(let e of b)this.proxyOf.nodes.splice(m,0,e);for(let e in this.indexes)u=this.indexes[e],m<=u&&(this.indexes[e]=u+b.length);return this.markDirty(),this}normalize(e,a){if("string"==typeof e)e=_r(rn(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let a of e)a.parent&&a.parent.removeChild(a,"ignore")}else if("root"===e.type&&"document"!==this.type){e=e.nodes.slice(0);for(let a of e)a.parent&&a.parent.removeChild(a,"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 ln(e)]}else if(e.selector||e.selectors)e=[new sn(e)];else if(e.name)e=[new nn(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new an(e)]}return e.map(e=>(e[pn]||zr.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[un]&&Wr(e),e.raws||(e.raws={}),typeof e.raws.before>"u"&&a&&typeof a.raws.before<"u"&&(e.raws.before=a.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){e=e.reverse();for(let a of e){let e=this.normalize(a,this.first,"prepend").reverse();for(let a of e)this.proxyOf.nodes.unshift(a);for(let a in this.indexes)this.indexes[a]=this.indexes[a]+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 a;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let u in this.indexes)a=this.indexes[u],a>=e&&(this.indexes[u]=a-1);return this.markDirty(),this}replaceValues(e,a,u){return u||(u=a,a={}),this.walkDecls(m=>{a.props&&!a.props.includes(m.prop)||a.fast&&!m.value.includes(a.fast)||(m.value=m.value.replace(e,u))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((a,u)=>{let m;try{m=e(a,u)}catch(e){throw a.addToError(e)}return!1!==m&&a.walk&&(m=a.walk(e)),m})}walkAtRules(e,a){return a?e instanceof RegExp?this.walk((u,m)=>{if("atrule"===u.type&&e.test(u.name))return a(u,m)}):this.walk((u,m)=>{if("atrule"===u.type&&u.name===e)return a(u,m)}):(a=e,this.walk((e,u)=>{if("atrule"===e.type)return a(e,u)}))}walkComments(e){return this.walk((a,u)=>{if("comment"===a.type)return e(a,u)})}walkDecls(e,a){return a?e instanceof RegExp?this.walk((u,m)=>{if("decl"===u.type&&e.test(u.prop))return a(u,m)}):this.walk((u,m)=>{if("decl"===u.type&&u.prop===e)return a(u,m)}):(a=e,this.walk((e,u)=>{if("decl"===e.type)return a(e,u)}))}walkRules(e,a){return a?e instanceof RegExp?this.walk((u,m)=>{if("rule"===u.type&&e.test(u.selector))return a(u,m)}):this.walk((u,m)=>{if("rule"===u.type&&u.selector===e)return a(u,m)}):(a=e,this.walk((e,u)=>{if("rule"===e.type)return a(e,u)}))}};dn.registerParse=e=>{rn=e},dn.registerRule=e=>{sn=e},dn.registerAtRule=e=>{nn=e},dn.registerRoot=e=>{on=e};var hn=dn;dn.default=dn,dn.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,nn.prototype):"rule"===e.type?Object.setPrototypeOf(e,sn.prototype):"decl"===e.type?Object.setPrototypeOf(e,ln.prototype):"comment"===e.type?Object.setPrototypeOf(e,an.prototype):"root"===e.type&&Object.setPrototypeOf(e,on.prototype),e[pn]=!0,e.nodes&&e.nodes.forEach(e=>{dn.rebuild(e)})};let fn=hn,mn=class extends fn{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 gn=mn;mn.default=mn,fn.registerAtRule(mn);let yn,wn,bn=hn,Sn=class extends bn{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new yn(new wn,this,e).stringify()}};Sn.registerLazyResult=e=>{yn=e},Sn.registerProcessor=e=>{wn=e};var Mn=Sn;Sn.default=Sn;var In={nanoid:(e=21)=>{let a="",u=0|e;for(;u--;)a+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return a}};let{existsSync:_n,readFileSync:On}=vt,{dirname:En,join:Ln}=vt,{SourceMapConsumer:Rn,SourceMapGenerator:An}=vt;let Tn=class{constructor(e,a){if(!1===a.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let u=a.map?a.map.prev:void 0,m=this.loadMap(a.from,u);!this.mapFile&&a.from&&(this.mapFile=a.from),this.mapFile&&(this.root=En(this.mapFile)),m&&(this.text=m)}consumer(){return this.consumerCache||(this.consumerCache=new Rn(this.text)),this.consumerCache}decodeInline(e){let a=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(a)return decodeURIComponent(e.substr(a[0].length));let u=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(u)return function da(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}(e.substr(u[0].length));let m=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+m)}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 a=e.match(/\/\*\s*# sourceMappingURL=/g);if(!a)return;let u=e.lastIndexOf(a.pop()),m=e.indexOf("*/",u);u>-1&&m>-1&&(this.annotation=this.getAnnotationURL(e.substring(u,m)))}loadFile(e){if(this.root=En(e),_n(e))return this.mapFile=e,On(e,"utf-8").toString().trim()}loadMap(e,a){if(!1===a)return!1;if(a){if("string"==typeof a)return a;if("function"!=typeof a){if(a instanceof Rn)return An.fromSourceMap(a).toString();if(a instanceof An)return a.toString();if(this.isMap(a))return JSON.stringify(a);throw new Error("Unsupported previous source map format: "+a.toString())}{let u=a(e);if(u){let e=this.loadFile(u);if(!e)throw new Error("Unable to load previous source map: "+u.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let a=this.annotation;return e&&(a=Ln(En(e),a)),this.loadFile(a)}}}startWith(e,a){return!!e&&e.substr(0,a.length)===a}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Nn=Tn;Tn.default=Tn;let{nanoid:Pn}=In,{isAbsolute:Dn,resolve:Fn}=vt,{SourceMapConsumer:Un,SourceMapGenerator:Bn}=vt,{fileURLToPath:Wn,pathToFileURL:zn}=vt,jn=xt,Vn=Nn,qn=vt,Zn=Symbol("fromOffsetCache"),Kn=!(!Un||!Bn),Qn=!(!Fn||!Dn),nr=class{get from(){return this.file||this.id}constructor(e,a={}){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,this.document=this.css,a.document&&(this.document=a.document.toString()),a.from&&(!Qn||/^\w+:\/\//.test(a.from)||Dn(a.from)?this.file=a.from:this.file=Fn(a.from)),Qn&&Kn){let e=new Vn(this.css,a);if(e.text){this.map=e;let a=e.consumer().file;!this.file&&a&&(this.file=this.mapResolve(a))}}this.file||(this.id="<input css "+Pn(6)+">"),this.map&&(this.map.file=this.from)}error(e,a,u,m={}){let w,b,S;if(a&&"object"==typeof a){let e=a,m=u;if("number"==typeof e.offset){let m=this.fromOffset(e.offset);a=m.line,u=m.col}else a=e.line,u=e.column;if("number"==typeof m.offset){let e=this.fromOffset(m.offset);b=e.line,w=e.col}else b=m.line,w=m.column}else if(!u){let e=this.fromOffset(a);a=e.line,u=e.col}let C=this.origin(a,u,b,w);return S=C?new jn(e,void 0===C.endLine?C.line:{column:C.column,line:C.line},void 0===C.endLine?C.column:{column:C.endColumn,line:C.endLine},C.source,C.file,m.plugin):new jn(e,void 0===b?a:{column:u,line:a},void 0===b?u:{column:w,line:b},this.css,this.file,m.plugin),S.input={column:u,endColumn:w,endLine:b,line:a,source:this.css},this.file&&(zn&&(S.input.url=zn(this.file).toString()),S.input.file=this.file),S}fromOffset(e){let a,u;if(this[Zn])u=this[Zn];else{let e=this.css.split("\n");u=new Array(e.length);let a=0;for(let m=0,w=e.length;m<w;m++)u[m]=a,a+=e[m].length+1;this[Zn]=u}a=u[u.length-1];let m=0;if(e>=a)m=u.length-1;else{let a,w=u.length-2;for(;m<w;)if(a=m+(w-m>>1),e<u[a])w=a-1;else{if(!(e>=u[a+1])){m=a;break}m=a+1}}return{col:e-u[m]+1,line:m+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Fn(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,a,u,m){if(!this.map)return!1;let w,b,S=this.map.consumer(),C=S.originalPositionFor({column:a,line:e});if(!C.source)return!1;"number"==typeof u&&(w=S.originalPositionFor({column:m,line:u})),b=Dn(C.source)?zn(C.source):new URL(C.source,this.map.consumer().sourceRoot||zn(this.map.mapFile));let x={column:C.column,endColumn:w&&w.column,endLine:w&&w.line,line:C.line,url:b.toString()};if("file:"===b.protocol){if(!Wn)throw new Error("file: protocol is not available in this PostCSS build");x.file=Wn(b)}let I=S.sourceContentFor(C.source);return I&&(x.source=I),x}toJSON(){let e={};for(let a of["hasBOM","css","file","id"])null!=this[a]&&(e[a]=this[a]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}};var rr=nr;nr.default=nr,qn&&qn.registerInput&&qn.registerInput(nr);let or,sr,ir=hn,ar=class extends ir{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,a,u){let m=super.normalize(e);if(a)if("prepend"===u)this.nodes.length>1?a.raws.before=this.nodes[1].raws.before:delete a.raws.before;else if(this.first!==a)for(let e of m)e.raws.before=a.raws.before;return m}removeChild(e,a){let u=this.index(e);return!a&&0===u&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[u].raws.before),super.removeChild(e)}toResult(e={}){return new or(new sr,this,e).stringify()}};ar.registerLazyResult=e=>{or=e},ar.registerProcessor=e=>{sr=e};var lr=ar;ar.default=ar,ir.registerRoot(ar);let cr={comma:e=>cr.split(e,[","],!0),space(e){let a=[" ","\n","\t"];return cr.split(e,a)},split(e,a,u){let m=[],w="",b=!1,S=0,C=!1,x="",I=!1;for(let u of e)I?I=!1:"\\"===u?I=!0:C?u===x&&(C=!1):'"'===u||"'"===u?(C=!0,x=u):"("===u?S+=1:")"===u?S>0&&(S-=1):0===S&&a.includes(u)&&(b=!0),b?(""!==w&&m.push(w.trim()),w="",b=!1):w+=u;return(u||""!==w)&&m.push(w.trim()),m}};var ur=cr;cr.default=cr;let pr=hn,dr=ur,hr=class extends pr{get selectors(){return dr.comma(this.selector)}set selectors(e){let a=this.selector?this.selector.match(/,\s*/):null,u=a?a[0]:","+this.raw("between","beforeOpen");this.selector=e.join(u)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}};var fr=hr;hr.default=hr,pr.registerRule(hr);let mr=gn,gr=Xt,yr=tn,wr=rr,Sr=Nn,Cr=lr,Ar=fr;function Ze(e,a){if(Array.isArray(e))return e.map(e=>Ze(e));let{inputs:u,...m}=e;if(u){a=[];for(let e of u){let u={...e,__proto__:wr.prototype};u.map&&(u.map={...u.map,__proto__:Sr.prototype}),a.push(u)}}if(m.nodes&&(m.nodes=e.nodes.map(e=>Ze(e,a))),m.source){let{inputId:e,...u}=m.source;m.source=u,null!=e&&(m.source.input=a[e])}if("root"===m.type)return new Cr(m);if("decl"===m.type)return new yr(m);if("rule"===m.type)return new Ar(m);if("comment"===m.type)return new gr(m);if("atrule"===m.type)return new mr(m);throw new Error("Unknown node type: "+e.type)}var Tr=Ze;Ze.default=Ze;let{dirname:Nr,relative:Pr,resolve:Dr,sep:Fr}=vt,{SourceMapConsumer:Ur,SourceMapGenerator:$r}=vt,{pathToFileURL:Br}=vt,jr=rr,Gr=!(!Ur||!$r),Vr=!!(Nr&&Dr&&Pr&&Fr);var qr=class{constructor(e,a,u,m){this.stringify=e,this.mapOpts=u.map||{},this.root=a,this.opts=u,this.css=m,this.originalCSS=m,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 a="\n";this.css.includes("\r\n")&&(a="\r\n"),this.css+=a+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let a,u=this.toUrl(this.path(e.file)),m=e.root||Nr(e.file);!1===this.mapOpts.sourcesContent?(a=new Ur(e.text),a.sourcesContent&&(a.sourcesContent=null)):a=e.consumer(),this.map.applySourceMap(a,u,this.toUrl(this.path(m)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let a=this.root.nodes.length-1;a>=0;a--)e=this.root.nodes[a],"comment"===e.type&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(a)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Vr&&Gr&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,a=>{e+=a}),[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=$r.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new $r({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 $r({file:this.outputFile(),ignoreInvalidMapping:!0});let e,a,u=1,m=1,w="<no source>",b={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(S,C,x)=>{if(this.css+=S,C&&"end"!==x&&(b.generated.line=u,b.generated.column=m-1,C.source&&C.source.start?(b.source=this.sourcePath(C),b.original.line=C.source.start.line,b.original.column=C.source.start.column-1,this.map.addMapping(b)):(b.source=w,b.original.line=1,b.original.column=0,this.map.addMapping(b))),a=S.match(/\n/g),a?(u+=a.length,e=S.lastIndexOf("\n"),m=S.length-e):m+=S.length,C&&"start"!==x){let e=C.parent||{raws:{}};("decl"!==C.type&&("atrule"!==C.type||C.nodes)||C!==e.last||e.raws.semicolon)&&(C.source&&C.source.end?(b.source=this.sourcePath(C),b.original.line=C.source.end.line,b.original.column=C.source.end.column-1,b.generated.line=u,b.generated.column=m-2,this.map.addMapping(b)):(b.source=w,b.original.line=1,b.original.column=0,b.generated.line=u,b.generated.column=m-1,this.map.addMapping(b)))}})}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 a=this.memoizedPaths.get(e);if(a)return a;let u=this.opts.to?Nr(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(u=Nr(Dr(u,this.mapOpts.annotation)));let m=Pr(u,e);return this.memoizedPaths.set(e,m),m}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let a=e.source.input.map;this.previousMaps.includes(a)||this.previousMaps.push(a)}});else{let e=new jr(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(a=>{if(a.source){let u=a.source.input.from;if(u&&!e[u]){e[u]=!0;let m=this.usesFileUrls?this.toFileUrl(u):this.toUrl(this.path(u));this.map.setSourceContent(m,a.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 a=this.memoizedFileURLs.get(e);if(a)return a;if(Br){let a=Br(e).toString();return this.memoizedFileURLs.set(e,a),a}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let a=this.memoizedURLs.get(e);if(a)return a;"\\"===Fr&&(e=e.replace(/\\/g,"/"));let u=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,u),u}};const Hr=/[\t\n\f\r "#'()/;[\\\]{}]/g,Zr=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Kr=/.[\r\n"'(/\\]/,Yr=/[\da-f]/i;let Jr=gn,Xr=Xt,Qr=tn,eo=lr,to=fr,Xa=function(e,a={}){let u,m,w,b,S,C,x,I,_,O,E=e.css.valueOf(),D=a.ignoreErrors,F=E.length,U=0,$=[],B=[];function y2(a){throw e.error("Unclosed "+a,U)}return{back:function A(e){B.push(e)},endOfFile:function v(){return 0===B.length&&U>=F},nextToken:function P2(e){if(B.length)return B.pop();if(U>=F)return;let a=!!e&&e.ignoreUnclosed;switch(u=E.charCodeAt(U),u){case 10:case 32:case 9:case 13:case 12:b=U;do{b+=1,u=E.charCodeAt(b)}while(32===u||10===u||9===u||13===u||12===u);C=["space",E.slice(U,b)],U=b-1;break;case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let e=String.fromCharCode(u);C=[e,e,U];break}case 40:if(O=$.length?$.pop()[1]:"",_=E.charCodeAt(U+1),"url"===O&&39!==_&&34!==_&&32!==_&&10!==_&&9!==_&&12!==_&&13!==_){b=U;do{if(x=!1,b=E.indexOf(")",b+1),-1===b){if(D||a){b=U;break}y2("bracket")}for(I=b;92===E.charCodeAt(I-1);)I-=1,x=!x}while(x);C=["brackets",E.slice(U,b+1),U,b],U=b}else b=E.indexOf(")",U+1),m=E.slice(U,b+1),-1===b||Kr.test(m)?C=["(","(",U]:(C=["brackets",m,U,b],U=b);break;case 39:case 34:S=39===u?"'":'"',b=U;do{if(x=!1,b=E.indexOf(S,b+1),-1===b){if(D||a){b=U+1;break}y2("string")}for(I=b;92===E.charCodeAt(I-1);)I-=1,x=!x}while(x);C=["string",E.slice(U,b+1),U,b],U=b;break;case 64:Hr.lastIndex=U+1,Hr.test(E),b=0===Hr.lastIndex?E.length-1:Hr.lastIndex-2,C=["at-word",E.slice(U,b+1),U,b],U=b;break;case 92:for(b=U,w=!0;92===E.charCodeAt(b+1);)b+=1,w=!w;if(u=E.charCodeAt(b+1),w&&47!==u&&32!==u&&10!==u&&9!==u&&13!==u&&12!==u&&(b+=1,Yr.test(E.charAt(b)))){for(;Yr.test(E.charAt(b+1));)b+=1;32===E.charCodeAt(b+1)&&(b+=1)}C=["word",E.slice(U,b+1),U,b],U=b;break;default:47===u&&42===E.charCodeAt(U+1)?(b=E.indexOf("*/",U+2)+1,0===b&&(D||a?b=E.length:y2("comment")),C=["comment",E.slice(U,b+1),U,b],U=b):(Zr.lastIndex=U+1,Zr.test(E),b=0===Zr.lastIndex?E.length-1:Zr.lastIndex-2,C=["word",E.slice(U,b+1),U,b],$.push(C),U=b)}return U++,C},position:function S2(){return U}}};const oo={empty:!0,space:!0};var io=class{constructor(e){this.input=e,this.root=new eo,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 a=new Jr;a.name=e[1].slice(1),""===a.name&&this.unnamedAtrule(a,e),this.init(a,e[2]);let u,m,w,b=!1,S=!1,C=[],x=[];for(;!this.tokenizer.endOfFile();){if(u=(e=this.tokenizer.nextToken())[0],"("===u||"["===u?x.push("("===u?")":"]"):"{"===u&&x.length>0?x.push("}"):u===x[x.length-1]&&x.pop(),0===x.length){if(";"===u){a.source.end=this.getPosition(e[2]),a.source.end.offset++,this.semicolon=!0;break}if("{"===u){S=!0;break}if("}"===u){if(C.length>0){for(w=C.length-1,m=C[w];m&&"space"===m[0];)m=C[--w];m&&(a.source.end=this.getPosition(m[3]||m[2]),a.source.end.offset++)}this.end(e);break}C.push(e)}else C.push(e);if(this.tokenizer.endOfFile()){b=!0;break}}a.raws.between=this.spacesAndCommentsFromEnd(C),C.length?(a.raws.afterName=this.spacesAndCommentsFromStart(C),this.raw(a,"params",C),b&&(e=C[C.length-1],a.source.end=this.getPosition(e[3]||e[2]),a.source.end.offset++,this.spaces=a.raws.between,a.raws.between="")):(a.raws.afterName="",a.params=""),S&&(a.nodes=[],this.current=a)}checkMissedSemicolon(e){let a=this.colon(e);if(!1===a)return;let u,m=0;for(let w=a-1;w>=0&&(u=e[w],"space"===u[0]||(m+=1,2!==m));w--);throw this.input.error("Missed semicolon","word"===u[0]?u[3]+1:u[2])}colon(e){let a,u,m,w=0;for(let[b,S]of e.entries()){if(u=S,m=u[0],"("===m&&(w+=1),")"===m&&(w-=1),0===w&&":"===m){if(a){if("word"===a[0]&&"progid"===a[1])continue;return b}this.doubleColon(u)}a=u}return!1}comment(e){let a=new Xr;this.init(a,e[2]),a.source.end=this.getPosition(e[3]||e[2]),a.source.end.offset++;let u=e[1].slice(2,-2);if(/^\s*$/.test(u))a.text="",a.raws.left=u,a.raws.right="";else{let e=u.match(/^(\s*)([^]*\S)(\s*)$/);a.text=e[2],a.raws.left=e[1],a.raws.right=e[3]}}createTokenizer(){this.tokenizer=Xa(this.input)}decl(e,a){let u=new Qr;this.init(u,e[0][2]);let m,w=e[e.length-1];for(";"===w[0]&&(this.semicolon=!0,e.pop()),u.source.end=this.getPosition(w[3]||w[2]||function Ha(e){for(let a=e.length-1;a>=0;a--){let u=e[a],m=u[3]||u[2];if(m)return m}}(e)),u.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),u.raws.before+=e.shift()[1];for(u.source.start=this.getPosition(e[0][2]),u.prop="";e.length;){let a=e[0][0];if(":"===a||"space"===a||"comment"===a)break;u.prop+=e.shift()[1]}for(u.raws.between="";e.length;){if(m=e.shift(),":"===m[0]){u.raws.between+=m[1];break}"word"===m[0]&&/\w/.test(m[1])&&this.unknownWord([m]),u.raws.between+=m[1]}("_"===u.prop[0]||"*"===u.prop[0])&&(u.raws.before+=u.prop[0],u.prop=u.prop.slice(1));let b,S=[];for(;e.length&&(b=e[0][0],"space"===b||"comment"===b);)S.push(e.shift());this.precheckMissedSemicolon(e);for(let a=e.length-1;a>=0;a--){if(m=e[a],"!important"===m[1].toLowerCase()){u.important=!0;let m=this.stringFrom(e,a);m=this.spacesFromEnd(e)+m," !important"!==m&&(u.raws.important=m);break}if("important"===m[1].toLowerCase()){let m=e.slice(0),w="";for(let e=a;e>0;e--){let a=m[e][0];if(w.trim().startsWith("!")&&"space"!==a)break;w=m.pop()[1]+w}w.trim().startsWith("!")&&(u.important=!0,u.raws.important=w,e=m)}if("space"!==m[0]&&"comment"!==m[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(u.raws.between+=S.map(e=>e[1]).join(""),S=[]),this.raw(u,"value",S.concat(e),a),u.value.includes(":")&&!a&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let a=new to;this.init(a,e[2]),a.selector="",a.raws.between="",this.current=a}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 a=this.current.nodes[this.current.nodes.length-1];a&&"rule"===a.type&&!a.raws.ownSemicolon&&(a.raws.ownSemicolon=this.spaces,this.spaces="",a.source.end=this.getPosition(e[2]),a.source.end.offset+=a.raws.ownSemicolon.length)}}getPosition(e){let a=this.input.fromOffset(e);return{column:a.col,line:a.line,offset:e}}init(e,a){this.current.push(e),e.source={input:this.input,start:this.getPosition(a)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let a=!1,u=null,m=!1,w=null,b=[],S=e[1].startsWith("--"),C=[],x=e;for(;x;){if(u=x[0],C.push(x),"("===u||"["===u)w||(w=x),b.push("("===u?")":"]");else if(S&&m&&"{"===u)w||(w=x),b.push("}");else if(0===b.length){if(";"===u){if(m)return void this.decl(C,S);break}if("{"===u)return void this.rule(C);if("}"===u){this.tokenizer.back(C.pop()),a=!0;break}":"===u&&(m=!0)}else u===b[b.length-1]&&(b.pop(),0===b.length&&(w=null));x=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(a=!0),b.length>0&&this.unclosedBracket(w),a&&m){if(!S)for(;C.length&&(x=C[C.length-1][0],"space"===x||"comment"===x);)this.tokenizer.back(C.pop());this.decl(C,S)}else this.unknownWord(C)}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,a,u,m){let w,b,S,C,x=u.length,I="",_=!0;for(let e=0;e<x;e+=1)w=u[e],b=w[0],"space"!==b||e!==x-1||m?"comment"===b?(C=u[e-1]?u[e-1][0]:"empty",S=u[e+1]?u[e+1][0]:"empty",oo[C]||oo[S]||","===I.slice(-1)?_=!1:I+=w[1]):I+=w[1]:_=!1;if(!_){let m=u.reduce((e,a)=>e+a[1],"");e.raws[a]={raw:m,value:I}}e[a]=I}rule(e){e.pop();let a=new to;this.init(a,e[0][2]),a.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(a,"selector",e),this.current=a}spacesAndCommentsFromEnd(e){let a,u="";for(;e.length&&(a=e[e.length-1][0],"space"===a||"comment"===a);)u=e.pop()[1]+u;return u}spacesAndCommentsFromStart(e){let a,u="";for(;e.length&&(a=e[0][0],"space"===a||"comment"===a);)u+=e.shift()[1];return u}spacesFromEnd(e){let a,u="";for(;e.length&&(a=e[e.length-1][0],"space"===a);)u=e.pop()[1]+u;return u}stringFrom(e,a){let u="";for(let m=a;m<e.length;m++)u+=e[m][1];return e.splice(a,e.length-a),u}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 "+e[0][1],{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,a){throw this.input.error("At-rule without name",{offset:a[2]},{offset:a[2]+a[1].length})}};let ao=hn,lo=rr,co=io;function _t(e,a){let u=new lo(e,a),m=new co(u);try{m.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&a&&a.from&&(/\.scss$/i.test(a.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(a.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(a.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return m.root}var uo=_t;_t.default=_t,ao.registerParse(_t);let ho=class{constructor(e,a={}){if(this.type="warning",this.text=e,a.node&&a.node.source){let e=a.node.rangeBy(a);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in a)this[e]=a[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 Mo=ho;ho.default=ho;let _o=Mo,Ao=class{get content(){return this.css}constructor(e,a,u){this.processor=e,this.messages=[],this.root=a,this.opts=u,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,a={}){a.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(a.plugin=this.lastPlugin.postcssPlugin);let u=new _o(e,a);return this.messages.push(u),u}warnings(){return this.messages.filter(e=>"warning"===e.type)}};var No=Ao;Ao.default=Ao;let Po={};var so=function(e){Po[e]||(Po[e]=!0,typeof console<"u"&&console.warn&&console.warn(e))};let Do=hn,Fo=Mn,Uo=qr,$o=uo,jo=No,Go=lr,Vo=Rt,{isClean:qo,my:Ho}=Dt,Zo=so;const Ko={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Yo={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},Jo={Once:!0,postcssPlugin:!0,prepare:!0};function Ne(e){return"object"==typeof e&&"function"==typeof e.then}function no(e){let a=!1,u=Ko[e.type];return"decl"===e.type?a=e.prop.toLowerCase():"atrule"===e.type&&(a=e.name.toLowerCase()),a&&e.append?[u,u+"-"+a,0,u+"Exit",u+"Exit-"+a]:a?[u,u+"-"+a,u+"Exit",u+"Exit-"+a]:e.append?[u,0,u+"Exit"]:[u,u+"Exit"]}function Gn(e){let a;return a="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:no(e),{eventIndex:0,events:a,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Ps(e){return e[qo]=!1,e.nodes&&e.nodes.forEach(e=>Ps(e)),e}let Xo={},Qo=class ro{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"}constructor(e,a,u){let m;if(this.stringified=!1,this.processed=!1,"object"!=typeof a||null===a||"root"!==a.type&&"document"!==a.type)if(a instanceof ro||a instanceof jo)m=Ps(a.root),a.map&&(typeof u.map>"u"&&(u.map={}),u.map.inline||(u.map.inline=!1),u.map.prev=a.map);else{let e=$o;u.syntax&&(e=u.syntax.parse),u.parser&&(e=u.parser),e.parse&&(e=e.parse);try{m=e(a,u)}catch(e){this.processed=!0,this.error=e}m&&!m[Ho]&&Do.rebuild(m)}else m=Ps(a);this.result=new jo(e,m,u),this.helpers={...Xo,postcss:Xo,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,a){let u=this.result.lastPlugin;try{if(a&&a.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(u.postcssVersion&&"production"!==process.env.NODE_ENV){let e=u.postcssPlugin,a=u.postcssVersion,m=this.result.processor.version,w=a.split("."),b=m.split(".");(w[0]!==b[0]||parseInt(w[1])>parseInt(b[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+m+", but "+e+" uses "+a+". Perhaps this is the source of the error below.")}}else e.plugin=u.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let t=(e,a,u)=>{this.listeners[a]||(this.listeners[a]=[]),this.listeners[a].push([e,u])};for(let e of this.plugins)if("object"==typeof e)for(let a in e){if(!Yo[a]&&/^[A-Z]/.test(a))throw new Error(`Unknown event ${a} in ${e.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Jo[a])if("object"==typeof e[a])for(let u in e[a])t(e,"*"===u?a:a+"-"+u.toLowerCase(),e[a][u]);else"function"==typeof e[a]&&t(e,a,e[a])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let a=this.plugins[e],u=this.runOnRoot(a);if(Ne(u))try{await u}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[qo];){e[qo]=!0;let a=[Gn(e)];for(;a.length>0;){let e=this.visitTick(a);if(Ne(e))try{await e}catch(e){let u=a[a.length-1].node;throw this.handleError(e,u)}}}if(this.listeners.OnceExit)for(let[a,u]of this.listeners.OnceExit){this.result.lastPlugin=a;try{if("document"===e.type){let a=e.nodes.map(e=>u(e,this.helpers));await Promise.all(a)}else await u(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 a=this.result.root.nodes.map(a=>e.Once(a,this.helpers));return Ne(a[0])?Promise.all(a):a}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,a=Vo;e.syntax&&(a=e.syntax.stringify),e.stringifier&&(a=e.stringifier),a.stringify&&(a=a.stringify);let u=new Uo(a,this.result.root,this.result.opts).generate();return this.result.css=u[0],this.result.map=u[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(Ne(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[qo];)e[qo]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let a of e.nodes)this.visitSync(this.listeners.OnceExit,a);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,a){return"production"!==process.env.NODE_ENV&&("from"in this.opts||Zo("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,a)}toString(){return this.css}visitSync(e,a){for(let[u,m]of e){let e;this.result.lastPlugin=u;try{e=m(a,this.helpers)}catch(e){throw this.handleError(e,a.proxyOf)}if("root"!==a.type&&"document"!==a.type&&!a.parent)return!0;if(Ne(e))throw this.getAsyncError()}}visitTick(e){let a=e[e.length-1],{node:u,visitors:m}=a;if("root"!==u.type&&"document"!==u.type&&!u.parent)return void e.pop();if(m.length>0&&a.visitorIndex<m.length){let[e,w]=m[a.visitorIndex];a.visitorIndex+=1,a.visitorIndex===m.length&&(a.visitors=[],a.visitorIndex=0),this.result.lastPlugin=e;try{return w(u.toProxy(),this.helpers)}catch(e){throw this.handleError(e,u)}}if(0!==a.iterator){let m,w=a.iterator;for(;m=u.nodes[u.indexes[w]];)if(u.indexes[w]+=1,!m[qo])return m[qo]=!0,void e.push(Gn(m));a.iterator=0,delete u.indexes[w]}let w=a.events;for(;a.eventIndex<w.length;){let e=w[a.eventIndex];if(a.eventIndex+=1,0===e)return void(u.nodes&&u.nodes.length&&(u[qo]=!0,a.iterator=u.getIterator()));if(this.listeners[e])return void(a.visitors=this.listeners[e])}e.pop()}walkSync(e){e[qo]=!0;let a=no(e);for(let u of a)if(0===u)e.nodes&&e.each(e=>{e[qo]||this.walkSync(e)});else{let a=this.listeners[u];if(a&&this.visitSync(a,e.toProxy()))return}}warnings(){return this.sync().warnings()}};Qo.registerPostcss=e=>{Xo=e};var es=Qo;Qo.default=Qo,Go.registerLazyResult(Qo),Fo.registerLazyResult(Qo);let ts=qr,ns=uo;const rs=No;let os=Rt,ss=so,is=class{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,a=ns;try{e=a(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"}constructor(e,a,u){a=a.toString(),this.stringified=!1,this._processor=e,this._css=a,this._opts=u,this._map=void 0;let m,w=os;this.result=new rs(this._processor,m,this._opts),this.result.css=a;let b=this;Object.defineProperty(this.result,"root",{get:()=>b.root});let S=new ts(w,m,this._opts,a);if(S.isMap()){let[e,a]=S.generate();e&&(this.result.css=e),a&&(this.result.map=a)}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,a){return"production"!==process.env.NODE_ENV&&("from"in this._opts||ss("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,a)}toString(){return this._css}warnings(){return[]}};var as=is;is.default=is;let ls=Mn,cs=es,us=as,ps=lr,ds=class{constructor(e=[]){this.version="8.5.3",this.plugins=this.normalize(e)}normalize(e){let a=[];for(let u of e)if(!0===u.postcss?u=u():u.postcss&&(u=u.postcss),"object"==typeof u&&Array.isArray(u.plugins))a=a.concat(u.plugins);else if("object"==typeof u&&u.postcssPlugin)a.push(u);else if("function"==typeof u)a.push(u);else{if("object"!=typeof u||!u.parse&&!u.stringify)throw new Error(u+" 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 a}process(e,a={}){return this.plugins.length||a.parser||a.stringifier||a.syntax?new cs(this,e,a):new us(this,e,a)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var hs=ds;ds.default=ds,ps.registerProcessor(ds),ls.registerProcessor(ds);let ms=gn,gs=Xt,ys=hn,ws=xt,bs=tn,vs=Mn,Ss=Tr,xs=rr,Ms=es,Is=ur,_s=Ht,Os=uo,Es=hs,Ls=No,Rs=lr,As=fr,Ts=Rt,Ns=Mo;function L$1(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Es(e)}L$1.plugin=function(e,a){let u,m=!1;function n(...u){console&&console.warn&&!m&&(m=!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 w=a(...u);return w.postcssPlugin=e,w.postcssVersion=(new Es).version,w}return Object.defineProperty(n,"postcss",{get:()=>(u||(u=n()),u)}),n.process=function(e,a,u){return L$1([n(u)]).process(e,a)},n},L$1.stringify=Ts,L$1.parse=Os,L$1.fromJSON=Ss,L$1.list=Is,L$1.comment=e=>new gs(e),L$1.atRule=e=>new ms(e),L$1.decl=e=>new bs(e),L$1.rule=e=>new As(e),L$1.root=e=>new Rs(e),L$1.document=e=>new vs(e),L$1.CssSyntaxError=ws,L$1.Declaration=bs,L$1.Container=ys,L$1.Processor=Es,L$1.Document=vs,L$1.Comment=gs,L$1.Warning=Ns,L$1.AtRule=ms,L$1.Result=Ls,L$1.Input=xs,L$1.Rule=As,L$1.Root=Rs,L$1.Node=_s,Ms.registerPostcss(L$1);var $s=L$1;L$1.default=L$1;const Ws=Yi($s);Ws.stringify,Ws.fromJSON,Ws.plugin,Ws.parse,Ws.list,Ws.document,Ws.comment,Ws.atRule,Ws.rule,Ws.decl,Ws.root,Ws.CssSyntaxError,Ws.Declaration,Ws.Container,Ws.Processor,Ws.Document,Ws.Comment,Ws.Warning,Ws.AtRule,Ws.Result,Ws.Input,Ws.Rule,Ws.Root,Ws.Node;var js=(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[e.Device=24]="Device",e[e.SailfishCustom=25]="SailfishCustom",e))(js||{}),Gs=(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[e.Typing=17]="Typing",e))(Gs||{}),Vs=(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))(Vs||{}),qs=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(qs||{}),Hs=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Hs||{}),Zs=(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))(Zs||{});function G(e,a,u=document){const m={capture:!0,passive:!0};return u.addEventListener(e,a,m),()=>u.removeEventListener(e,a,m)}const Ks="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 Ys={map:{},getId:()=>(console.error(Ks),-1),getNode:()=>(console.error(Ks),null),removeNodeFromMap(){console.error(Ks)},has:()=>(console.error(Ks),!1),reset(){console.error(Ks)}};function $e(e,a,u={}){let m=null,w=0;return function(...b){const S=Date.now();!w&&!1===u.leading&&(w=S);const C=a-(S-w),x=this;C<=0||C>a?(m&&(clearTimeout(m),m=null),w=S,e.apply(x,b)):!m&&!1!==u.trailing&&(m=setTimeout(()=>{w=!1===u.leading?0:Date.now(),m=null,e.apply(x,b)},C))}}function qt(e,a,u,m,w=window){const b=w.Object.getOwnPropertyDescriptor(e,a);return w.Object.defineProperty(e,a,m?u:{set(e){setTimeout(()=>{u.set.call(this,e)},0),b&&b.set&&b.set.call(this,e)}}),()=>qt(e,a,b||{},!0)}function Re(e,a,u){try{if(!(a in e))return()=>{};const m=e[a],w=u(m);return"function"==typeof w&&(w.prototype=w.prototype||{},Object.defineProperties(w,{__rrweb_original__:{enumerable:!1,value:m}})),e[a]=w,()=>{e[a]=m}}catch{return()=>{}}}typeof window<"u"&&window.Proxy&&window.Reflect&&(Ys=new Proxy(Ys,{get:(e,a,u)=>("map"===a&&console.error(Ks),Reflect.get(e,a,u))}));let Xs,Qs=Date.now;function po(e){var a,u,m,w,b,S;const C=e.document;return{left:C.scrollingElement?C.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:(null==C?void 0:C.documentElement.scrollLeft)||(null==(u=null==(a=null==C?void 0:C.body)?void 0:a.parentElement)?void 0:u.scrollLeft)||(null==(m=null==C?void 0:C.body)?void 0:m.scrollLeft)||0,top:C.scrollingElement?C.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==C?void 0:C.documentElement.scrollTop)||(null==(b=null==(w=null==C?void 0:C.body)?void 0:w.parentElement)?void 0:b.scrollTop)||(null==(S=null==C?void 0:C.body)?void 0:S.scrollTop)||0}}function fo(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function mo(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function go(e){return e?e.nodeType===e.ELEMENT_NODE?e:e.parentElement:null}function Z(e,a,u,m){if(!e)return!1;const w=go(e);if(!w)return!1;try{if("string"==typeof a){if(w.classList.contains(a)||m&&null!==w.closest("."+a))return!0}else if(Nt(w,a,m))return!0}catch{}return!(!u||!(w.matches(u)||m&&null!==w.closest(u)))}function fs(e,a,u){return!("TITLE"!==e.tagName||!u.headTitleMutations)||-2===a.getId(e)}function yo(e,a){if(We(e))return!1;const u=a.getId(e);return!a.has(u)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||yo(e.parentNode,a))}function Ds(e){return!!e.changedTouches}function wo(e,a){return!("IFRAME"!==e.nodeName||!a.getMeta(e))}function bo(e,a){return!("LINK"!==e.nodeName||e.nodeType!==e.ELEMENT_NODE||!e.getAttribute||"stylesheet"!==e.getAttribute("rel")||!a.getMeta(e))}function Fs(e){return!(null==e||!e.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(Qs=()=>(new Date).getTime());class _l{constructor(){b$1(this,"id",1),b$1(this,"styleIDMap",new WeakMap),b$1(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,a){if(this.has(e))return this.getId(e);let u;return u=void 0===a?this.id++:a,this.styleIDMap.set(e,u),this.idStyleMap.set(u,e),u}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 So(e){var a,u;let m=null;return(null==(u=null==(a=e.getRootNode)?void 0:a.call(e))?void 0:u.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(m=e.getRootNode().host),m}function zl(e){const a=e.ownerDocument;if(!a)return!1;const u=function Wl(e){let a,u=e;for(;a=So(u);)u=a;return u}(e);return a.contains(u)}function vo(e){const a=e.ownerDocument;return!!a&&(a.contains(e)||zl(e))}const M=e=>Xs?(...a)=>{try{return e(...a)}catch(e){if(Xs&&!0===Xs(e))return;throw e}}:e;class Yn{constructor(e){b$1(this,"iframeIdToRemoteIdMap",new WeakMap),b$1(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,a,u,m){const w=u||this.getIdToRemoteIdMap(e),b=m||this.getRemoteIdToIdMap(e);let S=w.get(a);return S||(S=this.generateIdFn(),w.set(a,S),b.set(S,a)),S}getIds(e,a){const u=this.getIdToRemoteIdMap(e),m=this.getRemoteIdToIdMap(e);return a.map(a=>this.getId(e,a,u,m))}getRemoteId(e,a,u){const m=u||this.getRemoteIdToIdMap(e);return"number"!=typeof a?a:m.get(a)||-1}getRemoteIds(e,a){const u=this.getRemoteIdToIdMap(e);return a.map(a=>this.getRemoteId(e,a,u))}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 a=this.iframeIdToRemoteIdMap.get(e);return a||(a=new Map,this.iframeIdToRemoteIdMap.set(e,a)),a}getRemoteIdToIdMap(e){let a=this.iframeRemoteIdToIdMap.get(e);return a||(a=new Map,this.iframeRemoteIdToIdMap.set(e,a)),a}}class Vl{constructor(e){b$1(this,"iframes",new WeakMap),b$1(this,"crossOriginIframeMap",new WeakMap),b$1(this,"crossOriginIframeMirror",new Yn(Ir)),b$1(this,"crossOriginIframeStyleMirror"),b$1(this,"crossOriginIframeRootIdMap",new WeakMap),b$1(this,"mirror"),b$1(this,"mutationCb"),b$1(this,"wrappedEmit"),b$1(this,"loadListener"),b$1(this,"stylesheetManager"),b$1(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Yn(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,a){var u,m;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:a}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(u=e.contentWindow)||u.addEventListener("message",this.handleMessage.bind(this))),null==(m=this.loadListener)||m.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 a=e;"@sailfish-rrweb/rrweb"!==a.data.type||(a.origin,a.data.origin)}transformCrossOriginEvent(e,a){var u;switch(a.type){case js.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(a.data.node,e);const u=a.data.node.id;return this.crossOriginIframeRootIdMap.set(e,u),this.patchRootIdOnNode(a.data.node,u),{timestamp:a.timestamp,type:js.IncrementalSnapshot,data:{source:Gs.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:a.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case js.Meta:case js.Load:case js.DomContentLoaded:return!1;case js.Plugin:return a;case js.Custom:return this.replaceIds(a.data.payload,e,["id","parentId","previousId","nextId"]),a;case js.IncrementalSnapshot:switch(a.data.source){case Gs.Mutation:return a.data.adds.forEach(a=>{this.replaceIds(a,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(a.node,e);const u=this.crossOriginIframeRootIdMap.get(e);u&&this.patchRootIdOnNode(a.node,u)}),a.data.removes.forEach(a=>{this.replaceIds(a,e,["parentId","id"])}),a.data.attributes.forEach(a=>{this.replaceIds(a,e,["id"])}),a.data.texts.forEach(a=>{this.replaceIds(a,e,["id"])}),a;case Gs.Drag:case Gs.TouchMove:case Gs.MouseMove:return a.data.positions.forEach(a=>{this.replaceIds(a,e,["id"])}),a;case Gs.ViewportResize:return!1;case Gs.MediaInteraction:case Gs.MouseInteraction:case Gs.Scroll:case Gs.CanvasMutation:case Gs.Input:return this.replaceIds(a.data,e,["id"]),a;case Gs.StyleSheetRule:case Gs.StyleDeclaration:return this.replaceIds(a.data,e,["id"]),this.replaceStyleIds(a.data,e,["styleId"]),a;case Gs.Font:return a;case Gs.Selection:return a.data.ranges.forEach(a=>{this.replaceIds(a,e,["start","end"])}),a;case Gs.AdoptedStyleSheet:return this.replaceIds(a.data,e,["id"]),this.replaceStyleIds(a.data,e,["styleIds"]),null==(u=a.data.styles)||u.forEach(a=>{this.replaceStyleIds(a,e,["styleId"])}),a}}return!1}replace(e,a,u,m){for(const w of m)!Array.isArray(a[w])&&"number"!=typeof a[w]||(Array.isArray(a[w])?a[w]=e.getIds(u,a[w]):a[w]=e.getId(u,a[w]));return a}replaceIds(e,a,u){return this.replace(this.crossOriginIframeMirror,e,a,u)}replaceStyleIds(e,a,u){return this.replace(this.crossOriginIframeStyleMirror,e,a,u)}replaceIdOnNode(e,a){this.replaceIds(e,a,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,a)})}patchRootIdOnNode(e,a){e.type!==Qe.Document&&!e.rootId&&(e.rootId=a),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,a)})}}function $n(e){return"__ln"in e}class Gl{constructor(){b$1(this,"length",0),b$1(this,"head",null),b$1(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let a=this.head;for(let u=0;u<e;u++)a=(null==a?void 0:a.next)||null;return a}addNode(e){const a={value:e,previous:null,next:null};if(e.__ln=a,e.previousSibling&&$n(e.previousSibling)){const u=e.previousSibling.__ln.next;a.next=u,a.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=a,u&&(u.previous=a)}else if(e.nextSibling&&$n(e.nextSibling)&&e.nextSibling.__ln.previous){const u=e.nextSibling.__ln.previous;a.previous=u,a.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=a,u&&(u.next=a)}else this.head&&(this.head.previous=a),a.next=this.head,this.head=a;null===a.next&&(this.tail=a),this.length++}removeNode(e){const a=e.__ln;this.head&&(a.previous?(a.previous.next=a.next,a.next?a.next.previous=a.previous:this.tail=a.previous):(this.head=a.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const Xn=(e,a)=>`${e}@${a}`;class Zl{constructor(){b$1(this,"frozen",!1),b$1(this,"locked",!1),b$1(this,"texts",[]),b$1(this,"attributes",[]),b$1(this,"attributeMap",new WeakMap),b$1(this,"removes",[]),b$1(this,"mapRemoves",[]),b$1(this,"movedMap",{}),b$1(this,"addedSet",new Set),b$1(this,"movedSet",new Set),b$1(this,"droppedSet",new Set),b$1(this,"mutationCb"),b$1(this,"blockClass"),b$1(this,"blockSelector"),b$1(this,"maskTextClass"),b$1(this,"maskTextSelector"),b$1(this,"inlineStylesheet"),b$1(this,"maskInputOptions"),b$1(this,"maskTextFn"),b$1(this,"maskInputFn"),b$1(this,"keepIframeSrcFn"),b$1(this,"recordCanvas"),b$1(this,"inlineImages"),b$1(this,"slimDOMOptions"),b$1(this,"dataURLOptions"),b$1(this,"doc"),b$1(this,"mirror"),b$1(this,"iframeManager"),b$1(this,"stylesheetManager"),b$1(this,"shadowDomManager"),b$1(this,"canvasManager"),b$1(this,"processedNodeManager"),b$1(this,"unattachedDoc"),b$1(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),b$1(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],a=new Set,u=new Gl,r=e=>{let a=e,u=-2;for(;-2===u;)a=a&&a.nextSibling,u=a&&this.mirror.getId(a);return u},i=m=>{if(!m.parentNode||!vo(m)||"TEXTAREA"===m.parentNode.tagName)return;const w=We(m.parentNode)?this.mirror.getId(So(m)):this.mirror.getId(m.parentNode),b=r(m);if(-1===w||-1===b)return u.addNode(m);const S=Se(m,{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=>{wo(e,this.mirror)&&this.iframeManager.addIframe(e),bo(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Fs(m)&&this.shadowDomManager.addShadowRoot(m.shadowRoot,this.doc)},onIframeLoad:(e,a)=>{this.iframeManager.attachIframe(e,a),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,a)=>{this.stylesheetManager.attachLinkElement(e,a)}});S&&(e.push({parentId:w,nextId:b,node:S}),a.add(S.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)Hn(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||i(e);for(const e of this.addedSet)!Jn(this.droppedSet,e)&&!Hn(this.removes,e,this.mirror)||Jn(this.movedSet,e)?i(e):this.droppedSet.add(e);let m=null;for(;u.length;){let e=null;if(m){const a=this.mirror.getId(m.value.parentNode),u=r(m.value);-1!==a&&-1!==u&&(e=m)}if(!e){let a=u.tail;for(;a;){const u=a;if(a=a.previous,u){const a=this.mirror.getId(u.value.parentNode);if(-1===r(u.value))continue;if(-1!==a){e=u;break}{const a=u.value;if(a.parentNode&&a.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const m=a.parentNode.host;if(-1!==this.mirror.getId(m)){e=u;break}}}}}}if(!e){for(;u.head;)u.removeNode(u.head.value);break}m=e.previous,u.removeNode(e.value),i(e.value)}const w={texts:this.texts.map(e=>{const a=e.node;return a.parentNode&&"TEXTAREA"===a.parentNode.tagName&&this.genTextAreaValueMutation(a.parentNode),{id:this.mirror.getId(a),value:e.value}}).filter(e=>!a.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{const{attributes:a}=e;if("string"==typeof a.style){const u=JSON.stringify(e.styleDiff),m=JSON.stringify(e._unchangedStyles);u.length<a.style.length&&(u+m).split("var(").length===a.style.split("var(").length&&(a.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:a}}).filter(e=>!a.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};!w.texts.length&&!w.attributes.length&&!w.removes.length&&!w.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(w))}),b$1(this,"genTextAreaValueMutation",e=>{let a=this.attributeMap.get(e);a||(a={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(a),this.attributeMap.set(e,a)),a.attributes.value=Array.from(e.childNodes,e=>e.textContent||"").join("")}),b$1(this,"processMutation",e=>{if(!fs(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const a=e.target.textContent;!Z(e.target,this.blockClass,this.blockSelector,!1)&&a!==e.oldValue&&this.texts.push({value:Er(e.target,this.maskTextClass,this.maskTextSelector,!0)&&a?this.maskTextFn?this.maskTextFn(a,go(e.target)):a.replace(/[\S]/g,"*"):a,node:e.target});break}case"attributes":{const a=e.target;let u=e.attributeName,m=e.target.getAttribute(u);if("value"===u){const e=Yt(a);m=Zt({element:a,maskInputOptions:this.maskInputOptions,tagName:a.tagName,type:e,value:m,maskInputFn:this.maskInputFn}).value}if(Z(e.target,this.blockClass,this.blockSelector,!1)||m===e.oldValue)return;let w=this.attributeMap.get(e.target);if("IFRAME"===a.tagName&&"src"===u&&!this.keepIframeSrcFn(m)){if(a.contentDocument)return;u="rr_src"}if(w||(w={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(w),this.attributeMap.set(e.target,w)),"type"===u&&"INPUT"===a.tagName&&"password"===(e.oldValue||"").toLowerCase()&&a.setAttribute("data-rr-is-password","true"),!Or(a.tagName,u)&&(w.attributes[u]=Mr(this.doc,fe(a.tagName),fe(u),m),"style"===u)){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const u=this.unattachedDoc.createElement("span");e.oldValue&&u.setAttribute("style",e.oldValue);for(const e of Array.from(a.style)){const m=a.style.getPropertyValue(e),b=a.style.getPropertyPriority(e);m!==u.style.getPropertyValue(e)||b!==u.style.getPropertyPriority(e)?w.styleDiff[e]=""===b?m:[m,b]:w._unchangedStyles[e]=[m,b]}for(const e of Array.from(u.style))""===a.style.getPropertyValue(e)&&(w.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(a=>this.genAdds(a,e.target)),e.removedNodes.forEach(a=>{const u=this.mirror.getId(a),m=We(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Z(e.target,this.blockClass,this.blockSelector,!1)||fs(a,this.mirror,this.slimDOMOptions)||!function Fl(e,a){return-1!==a.getId(e)}(a,this.mirror)||(this.addedSet.has(a)?(Us(this.addedSet,a),this.droppedSet.add(a)):this.addedSet.has(e.target)&&-1===u||yo(e.target,this.mirror)||(this.movedSet.has(a)&&this.movedMap[Xn(u,m)]?Us(this.movedSet,a):this.removes.push({parentId:m,id:u,isShadow:!(!We(e.target)||!ze(e.target))||void 0})),this.mapRemoves.push(a))})}}),b$1(this,"genAdds",(e,a)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(fs(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let u=null;a&&this.mirror.hasNode(a)&&(u=this.mirror.getId(a)),u&&-1!==u&&(this.movedMap[Xn(this.mirror.getId(e),u)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Z(e,this.blockClass,this.blockSelector,!1)||(e.childNodes.forEach(e=>this.genAdds(e)),Fs(e)&&e.shadowRoot.childNodes.forEach(a=>{this.processedNodeManager.add(a,this),this.genAdds(a,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(a=>{this[a]=e[a]})}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 Us(e,a){e.delete(a),a.childNodes.forEach(a=>Us(e,a))}function Hn(e,a,u){return 0!==e.length&&function Yl(e,a,u){let m=a.parentNode;for(;m;){const a=u.getId(m);if(e.some(e=>e.id===a))return!0;m=m.parentNode}return!1}(e,a,u)}function Jn(e,a){return 0!==e.size&&ko(e,a)}function ko(e,a){const{parentNode:u}=a;return!!u&&(!!e.has(u)||ko(e,u))}const ei=[];function tt(e){try{if("composedPath"in e){const a=e.composedPath();if(a.length)return a[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Co(e,a){var u,m;const w=new Zl;ei.push(w),w.init(e);let b=window.MutationObserver||window.__rrMutationObserver;const S=null==(m=null==(u=null==window?void 0:window.Zone)?void 0:u.__symbol__)?void 0:m.call(u,"MutationObserver");S&&window[S]&&(b=window[S]);const C=new b(M(w.processMutations.bind(w)));return C.observe(a,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),C}function Xl({mouseInteractionCb:e,doc:a,mirror:u,blockClass:m,blockSelector:w,sampling:b}){if(!1===b.mouseInteraction)return()=>{};const S=!0===b.mouseInteraction||void 0===b.mouseInteraction?{}:b.mouseInteraction,C=[];let x=null;return Object.keys(Vs).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==S[e]).forEach(b=>{let S=fe(b);const I=(a=>b=>{const S=tt(b);if(Z(S,m,w,!0))return;let C=null,I=a;if("pointerType"in b){switch(b.pointerType){case"mouse":C=qs.Mouse;break;case"touch":C=qs.Touch;break;case"pen":C=qs.Pen}C===qs.Touch?Vs[a]===Vs.MouseDown?I="TouchStart":Vs[a]===Vs.MouseUp&&(I="TouchEnd"):qs.Pen}else Ds(b)&&(C=qs.Touch);null!==C?(x=C,(I.startsWith("Touch")&&C===qs.Touch||I.startsWith("Mouse")&&C===qs.Mouse)&&(C=null)):Vs[a]===Vs.Click&&(C=x,x=null);const _=Ds(b)?b.changedTouches[0]:b;if(!_)return;const O=u.getId(S),{clientX:E,clientY:D}=_;M(e)({type:Vs[I],id:O,x:E,y:D,...null!==C&&{pointerType:C}})})(b);if(window.PointerEvent)switch(Vs[b]){case Vs.MouseDown:case Vs.MouseUp:S=S.replace("mouse","pointer");break;case Vs.TouchStart:case Vs.TouchEnd:return}C.push(G(S,I,a))}),M(()=>{C.forEach(e=>e())})}function xo({scrollCb:e,doc:a,mirror:u,blockClass:m,blockSelector:w,sampling:b}){return G("scroll",M($e(M(b=>{const S=tt(b);if(!S||Z(S,m,w,!0))return;const C=u.getId(S);if(S===a&&a.defaultView){const u=po(a.defaultView);e({id:C,x:u.left,y:u.top})}else e({id:C,x:S.scrollLeft,y:S.scrollTop})}),b.scroll||100)),a)}const ti=["INPUT","TEXTAREA","SELECT"],si=new WeakMap;function ql({deviceChangeCb:e}){const t=(a,u)=>{const m=a.device.productName?[a.device.productName]:["Unknown USB Device"];e({type:"USB",action:u,devices:m,timestamp:Date.now()})},s=(a,u)=>{const m=a.device.productName?[a.device.productName]:["Unknown HID Device"];e({type:"HID",action:u,devices:m,timestamp:Date.now()})},r=()=>{navigator.mediaDevices.enumerateDevices().then(a=>{const u=a.map(e=>`${e.kind}: ${e.label}`);e({type:"MediaDevices",action:"change",devices:u,timestamp:Date.now()})}).catch(e=>{console.error("[Media Device Enumeration Error]",e)})},i=()=>{const a=navigator.onLine?"online":"offline";e({type:"Network",action:"status",status:a,timestamp:Date.now()})},a=[G("online",()=>{i()},window),G("offline",()=>{i()},window)];"usb"in navigator&&(navigator.usb.addEventListener("connect",e=>t(e,"connect")),navigator.usb.addEventListener("disconnect",e=>t(e,"disconnect"))),"hid"in navigator&&(navigator.hid.addEventListener("connect",e=>s(e,"connect")),navigator.hid.addEventListener("disconnect",e=>s(e,"disconnect"))),navigator.mediaDevices.addEventListener("devicechange",r);const u=setInterval(()=>{(()=>{const a=navigator.getGamepads(),u=Array.from(a).filter(e=>e).map(e=>(null==e?void 0:e.id)||"Unknown Gamepad");0!==u.length&&e({type:"Gamepad",action:"change",devices:u,timestamp:Date.now()})})()},1e4);return()=>{navigator.usb.removeEventListener("connect",t),navigator.usb.removeEventListener("disconnect",t),navigator.hid.removeEventListener("connect",s),navigator.hid.removeEventListener("disconnect",s),a.forEach(e=>e()),navigator.mediaDevices.removeEventListener("devicechange",r),clearInterval(u)}}function zt(e){return function s(e,a){if(ft("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||ft("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||ft("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||ft("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const u=Array.from(e.parentRule.cssRules).indexOf(e);a.unshift(u)}else if(e.parentStyleSheet){const u=Array.from(e.parentStyleSheet.cssRules).indexOf(e);a.unshift(u)}return a}(e,[])}function ue(e,a,u){let m,w;return e?(e.ownerNode?m=a.getId(e.ownerNode):w=u.getId(e),{styleId:w,id:m}):{}}function Io({mirror:e,stylesheetManager:a},u){var m,w,b;let S=null;S="#document"===u.nodeName?e.getId(u):e.getId(u.host);const C="#document"===u.nodeName?null==(m=u.defaultView)?void 0:m.Document:null==(b=null==(w=u.ownerDocument)?void 0:w.defaultView)?void 0:b.ShadowRoot,x=null!=C&&C.prototype?Object.getOwnPropertyDescriptor(null==C?void 0:C.prototype,"adoptedStyleSheets"):void 0;return null!==S&&-1!==S&&C&&x?(Object.defineProperty(u,"adoptedStyleSheets",{configurable:x.configurable,enumerable:x.enumerable,get(){var e;return null==(e=x.get)?void 0:e.call(this)},set(e){var u;const m=null==(u=x.set)?void 0:u.call(this,e);if(null!==S&&-1!==S)try{a.adoptStyleSheets(e,S)}catch{}return m}}),M(()=>{Object.defineProperty(u,"adoptedStyleSheets",{configurable:x.configurable,enumerable:x.enumerable,get:x.get,set:x.set})})):()=>{}}function au(e,a={}){const u=e.doc.defaultView;if(!u)return()=>{};let m;!function iu(e,a){const{mutationCb:u,mousemoveCb:m,mouseInteractionCb:w,scrollCb:b,viewportResizeCb:S,inputCb:C,typingCb:x,deviceChangeCb:I,mediaInteractionCb:_,styleSheetRuleCb:O,styleDeclarationCb:E,canvasMutationCb:D,fontCb:F,selectionCb:U,customElementCb:$}=e;e.mutationCb=(...e)=>{a.mutation&&a.mutation(...e),u(...e)},e.mousemoveCb=(...e)=>{a.mousemove&&a.mousemove(...e),m(...e)},e.mouseInteractionCb=(...e)=>{a.mouseInteraction&&a.mouseInteraction(...e),w(...e)},e.scrollCb=(...e)=>{a.scroll&&a.scroll(...e),b(...e)},e.viewportResizeCb=(...e)=>{a.viewportResize&&a.viewportResize(...e),S(...e)},e.inputCb=(...e)=>{a.input&&a.input(...e),C(...e)},e.typingCb=(...e)=>{a.typing&&a.typing(...e),x(...e)},e.deviceChangeCb=(...e)=>{a.device&&a.device(...e),I(...e)},e.mediaInteractionCb=(...e)=>{a.mediaInteaction&&a.mediaInteaction(...e),_(...e)},e.styleSheetRuleCb=(...e)=>{a.styleSheetRule&&a.styleSheetRule(...e),O(...e)},e.styleDeclarationCb=(...e)=>{a.styleDeclaration&&a.styleDeclaration(...e),E(...e)},e.canvasMutationCb=(...e)=>{a.canvasMutation&&a.canvasMutation(...e),D(...e)},e.fontCb=(...e)=>{a.font&&a.font(...e),F(...e)},e.selectionCb=(...e)=>{a.selection&&a.selection(...e),U(...e)},e.customElementCb=(...e)=>{a.customElement&&a.customElement(...e),$(...e)}}(e,a),e.recordDOM&&(m=Co(e,e.doc));const w=function $l({mousemoveCb:e,sampling:a,doc:u,mirror:m}){if(!1===a.mousemove)return()=>{};const w="number"==typeof a.mousemove?a.mousemove:50,b="number"==typeof a.mousemoveCallback?a.mousemoveCallback:500;let S,C=[];const x=$e(M(a=>{const u=Date.now()-S;e(C.map(e=>(e.timeOffset-=u,e)),a),C=[],S=null}),b),I=M($e(M(e=>{const a=tt(e),{clientX:u,clientY:w}=Ds(e)?e.changedTouches[0]:e;S||(S=Qs()),C.push({x:u,y:w,id:m.getId(a),timeOffset:Qs()-S}),x(typeof DragEvent<"u"&&e instanceof DragEvent?Gs.Drag:e instanceof MouseEvent?Gs.MouseMove:Gs.TouchMove)}),w,{trailing:!1})),_=[G("mousemove",I,u),G("touchmove",I,u),G("drag",I,u)];return M(()=>{_.forEach(e=>e())})}(e),b=Xl(e),S=xo(e),C=function Hl({viewportResizeCb:e},{win:a}){let u=-1,m=-1;const w=M($e(M(()=>{const a=fo(),w=mo();(u!==a||m!==w)&&(e({width:Number(w),height:Number(a)}),u=a,m=w)}),200));return G("resize",w,a)}(e,{win:u}),x=function Kl({inputCb:e,doc:a,mirror:u,blockClass:m,blockSelector:w,ignoreClass:b,ignoreSelector:S,maskInputOptions:C,maskInputFn:x,sampling:I,userTriggeredOnInput:_}){function p(e){let u=tt(e);const I=e.isTrusted,O=u&&u.tagName;if(u&&"OPTION"===O&&(u=u.parentElement),!u||!O||ti.indexOf(O)<0||Z(u,m,w,!0)||u.classList.contains(b)||S&&u.matches(S))return;let E=u.value,D=!1;const F=Yt(u)||"",{value:U,masked:$}=Zt({element:u,maskInputOptions:C,tagName:O,type:F,value:E,maskInputFn:x});E=U,("radio"===F||"checkbox"===F)&&(D=u.checked),f(u,_?{text:E,isChecked:D,masked:$,userTriggered:I}:{text:E,isChecked:D,masked:$});const B=u.name;"radio"===F&&B&&D&&a.querySelectorAll(`input[type='radio'][name='${B}']`).forEach(e=>{if(e!==u){const a=e.value;f(e,_?{text:a,isChecked:!D,masked:$,userTriggered:!1}:{text:a,isChecked:!D,masked:$})}})}function f(a,m){const w=si.get(a);if(!w||w.text!==m.text||w.isChecked!==m.isChecked||w.masked!==m.masked){si.set(a,m);const w=u.getId(a);M(e)({...m,id:w})}}const O=("last"===I.input?["change"]:["input","change"]).map(e=>G(e,M(p),a)),E=a.defaultView;if(!E)return()=>{O.forEach(e=>e())};const D=E.Object.getOwnPropertyDescriptor(E.HTMLInputElement.prototype,"value"),F=[[E.HTMLInputElement.prototype,"value"],[E.HTMLInputElement.prototype,"checked"],[E.HTMLSelectElement.prototype,"value"],[E.HTMLTextAreaElement.prototype,"value"],[E.HTMLSelectElement.prototype,"selectedIndex"],[E.HTMLOptionElement.prototype,"selected"]];return D&&D.set&&O.push(...F.map(e=>qt(e[0],e[1],{set(){M(p)({target:this,isTrusted:!1})}},!1,E))),M(()=>{O.forEach(e=>e())})}(e),I=function Ql({typingCb:e,doc:a,maskInputOptions:u,maskInputFn:m}){const w=G("keydown",a=>{const w=a.target;let b=!1;const S={key:a.key,code:a.code,altKey:a.altKey,ctrlKey:a.ctrlKey,shiftKey:a.shiftKey,metaKey:a.metaKey},C=w&&w.tagName,x=Yt(w)||"";let I=w.value;if(w&&("INPUT"==w.tagName||"TEXTAREA"==w.tagName)){const{value:e,masked:a}=Zt({element:w,maskInputOptions:u,tagName:C,type:x,value:I,maskInputFn:m});I=e,b=a}e({source:Gs.Typing,id:null==w?void 0:w.id,text:I,isMasked:b,target:(e=>{var a;const u=[];for(;e;){let m=e.tagName.toLowerCase();if(e.id){m+=`#${e.id}`,u.unshift(m);break}if(e.className){const a=e.className.split(/\s+/).filter(Boolean);a.length&&(m+=`.${a.join(".")}`)}const w=Array.from((null==(a=e.parentNode)?void 0:a.children)||[]);w.length>1&&(m+=`:nth-child(${w.indexOf(e)+1})`),u.unshift(m),e=e.parentElement}return u.join(" > ")})(w),keyInfo:S})},a);return()=>{w()}}(e),_=ql(e),O=function su({mediaInteractionCb:e,blockClass:a,blockSelector:u,mirror:m,sampling:w,doc:b}){const S=M(b=>$e(M(w=>{const S=tt(w);if(!S||Z(S,a,u,!0))return;const{currentTime:C,volume:x,muted:I,playbackRate:_,loop:O}=S;e({type:b,id:m.getId(S),currentTime:C,volume:x,muted:I,playbackRate:_,loop:O})}),w.media||500)),C=[G("play",S(Zs.Play),b),G("pause",S(Zs.Pause),b),G("seeked",S(Zs.Seeked),b),G("volumechange",S(Zs.VolumeChange),b),G("ratechange",S(Zs.RateChange),b)];return M(()=>{C.forEach(e=>e())})}(e);let f=()=>{},d3=()=>{},g2=()=>{},h=()=>{};e.recordDOM&&(f=function eu({styleSheetRuleCb:e,mirror:a,stylesheetManager:u},{win:m}){if(!m.CSSStyleSheet||!m.CSSStyleSheet.prototype)return()=>{};const w=m.CSSStyleSheet.prototype.insertRule;m.CSSStyleSheet.prototype.insertRule=new Proxy(w,{apply:M((m,w,b)=>{const[S,C]=b,{id:x,styleId:I}=ue(w,a,u.styleMirror);return(x&&-1!==x||I&&-1!==I)&&e({id:x,styleId:I,adds:[{rule:S,index:C}]}),m.apply(w,b)})});const b=m.CSSStyleSheet.prototype.deleteRule;let S,C;m.CSSStyleSheet.prototype.deleteRule=new Proxy(b,{apply:M((m,w,b)=>{const[S]=b,{id:C,styleId:x}=ue(w,a,u.styleMirror);return(C&&-1!==C||x&&-1!==x)&&e({id:C,styleId:x,removes:[{index:S}]}),m.apply(w,b)})}),m.CSSStyleSheet.prototype.replace&&(S=m.CSSStyleSheet.prototype.replace,m.CSSStyleSheet.prototype.replace=new Proxy(S,{apply:M((m,w,b)=>{const[S]=b,{id:C,styleId:x}=ue(w,a,u.styleMirror);return(C&&-1!==C||x&&-1!==x)&&e({id:C,styleId:x,replace:S}),m.apply(w,b)})})),m.CSSStyleSheet.prototype.replaceSync&&(C=m.CSSStyleSheet.prototype.replaceSync,m.CSSStyleSheet.prototype.replaceSync=new Proxy(C,{apply:M((m,w,b)=>{const[S]=b,{id:C,styleId:x}=ue(w,a,u.styleMirror);return(C&&-1!==C||x&&-1!==x)&&e({id:C,styleId:x,replaceSync:S}),m.apply(w,b)})}));const x={};mt("CSSGroupingRule")?x.CSSGroupingRule=m.CSSGroupingRule:(mt("CSSMediaRule")&&(x.CSSMediaRule=m.CSSMediaRule),mt("CSSConditionRule")&&(x.CSSConditionRule=m.CSSConditionRule),mt("CSSSupportsRule")&&(x.CSSSupportsRule=m.CSSSupportsRule));const I={};return Object.entries(x).forEach(([m,w])=>{I[m]={insertRule:w.prototype.insertRule,deleteRule:w.prototype.deleteRule},w.prototype.insertRule=new Proxy(I[m].insertRule,{apply:M((m,w,b)=>{const[S,C]=b,{id:x,styleId:I}=ue(w.parentStyleSheet,a,u.styleMirror);return(x&&-1!==x||I&&-1!==I)&&e({id:x,styleId:I,adds:[{rule:S,index:[...zt(w),C||0]}]}),m.apply(w,b)})}),w.prototype.deleteRule=new Proxy(I[m].deleteRule,{apply:M((m,w,b)=>{const[S]=b,{id:C,styleId:x}=ue(w.parentStyleSheet,a,u.styleMirror);return(C&&-1!==C||x&&-1!==x)&&e({id:C,styleId:x,removes:[{index:[...zt(w),S]}]}),m.apply(w,b)})})}),M(()=>{m.CSSStyleSheet.prototype.insertRule=w,m.CSSStyleSheet.prototype.deleteRule=b,S&&(m.CSSStyleSheet.prototype.replace=S),C&&(m.CSSStyleSheet.prototype.replaceSync=C),Object.entries(x).forEach(([e,a])=>{a.prototype.insertRule=I[e].insertRule,a.prototype.deleteRule=I[e].deleteRule})})}(e,{win:u}),d3=Io(e,e.doc),g2=function tu({styleDeclarationCb:e,mirror:a,ignoreCSSAttributes:u,stylesheetManager:m},{win:w}){const b=w.CSSStyleDeclaration.prototype.setProperty;w.CSSStyleDeclaration.prototype.setProperty=new Proxy(b,{apply:M((w,S,C)=>{var x;const[I,_,O]=C;if(u.has(I))return b.apply(S,[I,_,O]);const{id:E,styleId:D}=ue(null==(x=S.parentRule)?void 0:x.parentStyleSheet,a,m.styleMirror);return(E&&-1!==E||D&&-1!==D)&&e({id:E,styleId:D,set:{property:I,value:_,priority:O},index:zt(S.parentRule)}),w.apply(S,C)})});const S=w.CSSStyleDeclaration.prototype.removeProperty;return w.CSSStyleDeclaration.prototype.removeProperty=new Proxy(S,{apply:M((w,b,C)=>{var x;const[I]=C;if(u.has(I))return S.apply(b,[I]);const{id:_,styleId:O}=ue(null==(x=b.parentRule)?void 0:x.parentStyleSheet,a,m.styleMirror);return(_&&-1!==_||O&&-1!==O)&&e({id:_,styleId:O,remove:{property:I},index:zt(b.parentRule)}),w.apply(b,C)})}),M(()=>{w.CSSStyleDeclaration.prototype.setProperty=b,w.CSSStyleDeclaration.prototype.removeProperty=S})}(e,{win:u}),e.collectFonts&&(h=function nu({fontCb:e,doc:a}){const u=a.defaultView;if(!u)return()=>{};const m=[],w=new WeakMap,b=u.FontFace;u.FontFace=function(e,a,u){const m="string"==typeof a?a:a instanceof SharedArrayBuffer?new ArrayBuffer(a.byteLength):a;"string"!=typeof a&&a instanceof SharedArrayBuffer&&new Uint8Array(m).set(new Uint8Array(a));const S=new b(e,m,u);return w.set(S,{family:e,buffer:"string"!=typeof a,descriptors:u,fontSource:"string"==typeof a?a:JSON.stringify(Array.from(new Uint8Array(m)))}),S};const S=Re(a.fonts,"add",function(a){return function(u){return setTimeout(M(()=>{const a=w.get(u);a&&(e(a),w.delete(u))}),0),a.apply(this,[u])}});return m.push(()=>{u.FontFace=b}),m.push(S),M(()=>{m.forEach(e=>e())})}(e)));const E=function ru(e){const{doc:a,mirror:u,blockClass:m,blockSelector:w,selectionCb:b}=e;let S=!0;const C=M(()=>{const e=a.getSelection();if(!e||S&&null!=e&&e.isCollapsed)return;S=e.isCollapsed||!1;const C=[],x=e.rangeCount||0;for(let a=0;a<x;a++){const b=e.getRangeAt(a),{startContainer:S,startOffset:x,endContainer:I,endOffset:_}=b;Z(S,m,w,!0)||Z(I,m,w,!0)||C.push({start:u.getId(S),startOffset:x,end:u.getId(I),endOffset:_})}b({ranges:C})});return C(),G("selectionchange",C)}(e),D=function ou({doc:e,customElementCb:a}){const u=e.defaultView;return u&&u.customElements?Re(u.customElements,"define",function(e){return function(u,m,w){try{a({define:{name:u}})}catch{console.warn(`Custom element callback failed for ${u}`)}return e.apply(this,[u,m,w])}}):()=>{}}(e),F=[];for(const a of e.plugins)F.push(a.observer(a.callback,u,a.options));return M(()=>{ei.forEach(e=>e.reset()),null==m||m.disconnect(),w(),b(),S(),C(),x(),I(),O(),f(),d3(),g2(),h(),E(),D(),_(),F.forEach(e=>e())})}function ft(e){return typeof window[e]<"u"}function mt(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}const ii="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Zvcih2YXIgcj0iQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyIsdz10eXBlb2YgVWludDhBcnJheT4idSI/W106bmV3IFVpbnQ4QXJyYXkoMjU2KSxpPTA7aTxyLmxlbmd0aDtpKyspd1tyLmNoYXJDb2RlQXQoaSldPWk7dmFyIHA9ZnVuY3Rpb24ocyl7dmFyIGU9bmV3IFVpbnQ4QXJyYXkocyksbixhPWUubGVuZ3RoLHQ9IiI7Zm9yKG49MDtuPGE7bis9Myl0Kz1yW2Vbbl0+PjJdLHQrPXJbKGVbbl0mMyk8PDR8ZVtuKzFdPj40XSx0Kz1yWyhlW24rMV0mMTUpPDwyfGVbbisyXT4+Nl0sdCs9cltlW24rMl0mNjNdO3JldHVybiBhJTM9PT0yP3Q9dC5zdWJzdHJpbmcoMCx0Lmxlbmd0aC0xKSsiPSI6YSUzPT09MSYmKHQ9dC5zdWJzdHJpbmcoMCx0Lmxlbmd0aC0yKSsiPT0iKSx0fTtjb25zdCBsPW5ldyBNYXAsYj1uZXcgTWFwO2FzeW5jIGZ1bmN0aW9uIHkocyxlLG4pe2NvbnN0IGE9YCR7c30tJHtlfWA7aWYoIk9mZnNjcmVlbkNhbnZhcyJpbiBnbG9iYWxUaGlzKXtpZihiLmhhcyhhKSlyZXR1cm4gYi5nZXQoYSk7Y29uc3QgdD1uZXcgT2Zmc2NyZWVuQ2FudmFzKHMsZSk7dC5nZXRDb250ZXh0KCIyZCIpO2NvbnN0IGc9YXdhaXQoYXdhaXQgdC5jb252ZXJ0VG9CbG9iKG4pKS5hcnJheUJ1ZmZlcigpLGM9cChnKTtyZXR1cm4gYi5zZXQoYSxjKSxjfWVsc2UgcmV0dXJuIiJ9Y29uc3Qgbz1zZWxmO28ub25tZXNzYWdlPWFzeW5jIGZ1bmN0aW9uKHMpe2lmKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcyl7Y29uc3R7aWQ6ZSxiaXRtYXA6bix3aWR0aDphLGhlaWdodDp0LGRhdGFVUkxPcHRpb25zOnV9PXMuZGF0YSxnPXkoYSx0LHUpLGM9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2MuZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCBkPWF3YWl0IGMuY29udmVydFRvQmxvYih1KSx2PWQudHlwZSxoPWF3YWl0IGQuYXJyYXlCdWZmZXIoKSxmPXAoaCk7aWYoIWwuaGFzKGUpJiZhd2FpdCBnPT09ZilyZXR1cm4gbC5zZXQoZSxmKSxvLnBvc3RNZXNzYWdlKHtpZDplfSk7aWYobC5nZXQoZSk9PT1mKXJldHVybiBvLnBvc3RNZXNzYWdlKHtpZDplfSk7by5wb3N0TWVzc2FnZSh7aWQ6ZSx0eXBlOnYsYmFzZTY0OmYsd2lkdGg6YSxoZWlnaHQ6dH0pLGwuc2V0KGUsZil9ZWxzZSByZXR1cm4gby5wb3N0TWVzc2FnZSh7aWQ6cy5kYXRhLmlkfSl9fSkoKTsKLy8jIHNvdXJjZU1hcHBpbmdVUkw9aW1hZ2UtYml0bWFwLWRhdGEtdXJsLXdvcmtlci1Cb1hHVm1Zby5qcy5tYXAK",ai=typeof self<"u"&&self.Blob&&new Blob([(li=ii,Uint8Array.from(atob(li),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});var li;function uu(e){let a;try{if(a=ai&&(self.URL||self.webkitURL).createObjectURL(ai),!a)throw"";const u=new Worker(a,{name:null==e?void 0:e.name});return u.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(a)}),u}catch{return new Worker("data:text/javascript;base64,"+ii,{name:null==e?void 0:e.name})}finally{a&&(self.URL||self.webkitURL).revokeObjectURL(a)}}for(var ci="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ui=typeof Uint8Array>"u"?[]:new Uint8Array(256),pi=0;pi<64;pi++)ui[ci.charCodeAt(pi)]=pi;const di=new Map;const Oo=(e,a,u)=>{if(!e||!Ro(e,a)&&"object"!=typeof e)return;const m=function pu(e,a){let u=di.get(e);return u||(u=new Map,di.set(e,u)),u.has(a)||u.set(a,[]),u.get(a)}(u,e.constructor.name);let w=m.indexOf(e);return-1===w&&(w=m.length,m.push(e)),w};function Ot(e,a,u){if(e instanceof Array)return e.map(e=>Ot(e,a,u));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 a=e.constructor.name,u=function(e){var a,u=new Uint8Array(e),m=u.length,w="";for(a=0;a<m;a+=3)w+=ci[u[a]>>2],w+=ci[(3&u[a])<<4|u[a+1]>>4],w+=ci[(15&u[a+1])<<2|u[a+2]>>6],w+=ci[63&u[a+2]];return m%3==2?w=w.substring(0,w.length-1)+"=":m%3==1&&(w=w.substring(0,w.length-2)+"=="),w}(e);return{rr_type:a,base64:u}}if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Ot(e.buffer,a,u),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const a=e.constructor.name,{src:u}=e;return{rr_type:a,src:u}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Ot(e.data,a,u),e.width,e.height]};if(Ro(e,a)||"object"==typeof e){return{rr_type:e.constructor.name,index:Oo(e,a,u)}}return e}const Eo=(e,a,u)=>e.map(e=>Ot(e,a,u)),Ro=(e,a)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof a[e]).find(u=>e instanceof a[u]);function er(e,a,u,m){const w=[];try{const b=Re(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(w,...b){if(!Z(this,a,u,!0)){const e=function fu(e){return"experimental-webgl"===e?"webgl":e}(w);if("__context"in this||(this.__context=e),m&&["webgl","webgl2"].includes(e))if(b[0]&&"object"==typeof b[0]){const e=b[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else b.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[w,...b])}});w.push(b)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{w.forEach(e=>e())}}function tr(e,a,u,m,w,b){const S=[],C=Object.getOwnPropertyNames(e);for(const x of C)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(x))try{if("function"!=typeof e[x])continue;const C=Re(e,x,function(e){return function(...S){const C=e.apply(this,S);if(Oo(C,b,this),"tagName"in this.canvas&&!Z(this.canvas,m,w,!0)){const e=Eo(S,b,this),m={type:a,property:x,args:e};u(this.canvas,m)}return C}});S.push(C)}catch{const m=qt(e,x,{set(e){u(this.canvas,{type:a,property:x,args:[e],setter:!0})}});S.push(m)}return S}class gu{constructor(e){b$1(this,"pendingCanvasMutations",new Map),b$1(this,"rafStamps",{latestId:0,invokeId:null}),b$1(this,"mirror"),b$1(this,"mutationCb"),b$1(this,"resetObservers"),b$1(this,"frozen",!1),b$1(this,"locked",!1),b$1(this,"processMutation",(e,a)=>{(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(a)});const{sampling:a="all",win:u,blockClass:m,blockSelector:w,recordCanvas:b,dataURLOptions:S}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,b&&"all"===a&&this.initCanvasMutationObserver(u,m,w),b&&"number"==typeof a&&this.initCanvasFPSObserver(a,u,m,w,{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,a,u,m,w){const b=er(a,u,m,!0),S=new Map,C=new uu;C.onmessage=e=>{const{id:a}=e.data;if(S.set(a,!1),!("base64"in e.data))return;const{base64:u,type:m,width:w,height:b}=e.data;this.mutationCb({id:a,type:Hs["2D"],commands:[{property:"clearRect",args:[0,0,w,b]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:u}],type:m}]},0,0]}]})};const x=1e3/e;let I,_=0;const d3=e=>{_&&e-_<x||(_=e,(()=>{const e=[];return a.document.querySelectorAll("canvas").forEach(a=>{Z(a,u,m,!0)||e.push(a)}),e})().forEach(async e=>{var a;const u=this.mirror.getId(e);if(S.get(u)||0===e.width||0===e.height)return;if(S.set(u,!0),["webgl","webgl2"].includes(e.__context)){const u=e.getContext(e.__context);!1===(null==(a=null==u?void 0:u.getContextAttributes())?void 0:a.preserveDrawingBuffer)&&u.clear(u.COLOR_BUFFER_BIT)}const m=await createImageBitmap(e);C.postMessage({id:u,bitmap:m,width:e.width,height:e.height,dataURLOptions:w.dataURLOptions},[m])})),I=requestAnimationFrame(d3)};I=requestAnimationFrame(d3),this.resetObservers=()=>{b(),cancelAnimationFrame(I)}}initCanvasMutationObserver(e,a,u){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const m=er(e,a,u,!1),w=function du(e,a,u,m){const w=[],b=Object.getOwnPropertyNames(a.CanvasRenderingContext2D.prototype);for(const S of b)try{if("function"!=typeof a.CanvasRenderingContext2D.prototype[S])continue;const b=Re(a.CanvasRenderingContext2D.prototype,S,function(w){return function(...b){return Z(this.canvas,u,m,!0)||setTimeout(()=>{const u=Eo(b,a,this);e(this.canvas,{type:Hs["2D"],property:S,args:u})},0),w.apply(this,b)}});w.push(b)}catch{const u=qt(a.CanvasRenderingContext2D.prototype,S,{set(a){e(this.canvas,{type:Hs["2D"],property:S,args:[a],setter:!0})}});w.push(u)}return()=>{w.forEach(e=>e())}}(this.processMutation.bind(this),e,a,u),b=function mu(e,a,u,m){const w=[];return w.push(...tr(a.WebGLRenderingContext.prototype,Hs.WebGL,e,u,m,a)),typeof a.WebGL2RenderingContext<"u"&&w.push(...tr(a.WebGL2RenderingContext.prototype,Hs.WebGL2,e,u,m,a)),()=>{w.forEach(e=>e())}}(this.processMutation.bind(this),e,a,u);this.resetObservers=()=>{m(),w(),b()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=e=>{this.rafStamps.latestId=e,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,a)=>{const u=this.mirror.getId(a);this.flushPendingCanvasMutationFor(a,u)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,a){if(this.frozen||this.locked)return;const u=this.pendingCanvasMutations.get(e);if(!u||-1===a)return;const m=u.map(e=>{const{type:a,...u}=e;return u}),{type:w}=u[0];this.mutationCb({id:a,type:w,commands:m}),this.pendingCanvasMutations.delete(e)}}class yu{constructor(){b$1(this,"nodeMap",new WeakMap),b$1(this,"active",!1)}inOtherBuffer(e,a){const u=this.nodeMap.get(e);return u&&Array.from(u).some(e=>e!==a)}add(e,a){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(a))}destroy(){}}class wu{constructor(e){b$1(this,"shadowDoms",new WeakSet),b$1(this,"mutationCb"),b$1(this,"scrollCb"),b$1(this,"bypassOptions"),b$1(this,"mirror"),b$1(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,a){if(!ze(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const u=Co({...this.bypassOptions,doc:a,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>u.disconnect()),this.restoreHandlers.push(xo({...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(Io({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,a){const u=this;this.restoreHandlers.push(Re(e.prototype,"attachShadow",function(e){return function(m){const w=e.call(this,m);return this.shadowRoot&&vo(this)&&u.addShadowRoot(this.shadowRoot,a),w}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}class bu{constructor(e){b$1(this,"trackedLinkElements",new WeakSet),b$1(this,"mutationCb"),b$1(this,"adoptedStyleSheetCb"),b$1(this,"styleMirror",new _l),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,a){"_cssText"in a.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:a.id,attributes:a.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,a){if(0===e.length)return;const u={id:a,styleIds:[]},m=[];for(const a of e){let e;this.styleMirror.has(a)?e=this.styleMirror.getId(a):(e=this.styleMirror.add(a),m.push({styleId:e,rules:Array.from(a.rules||CSSRule,(e,a)=>({rule:kr(e),index:a}))})),u.styleIds.push(e)}m.length>0&&(u.styles=m),this.adoptedStyleSheetCb(u)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}let hi,fi,mi,gi=!1;var yi;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(yi=e.contentWindow)?void 0:yi.Array.from)||Array.from,document.body.removeChild(e)}}catch(li){console.debug("Unable to override Array.from",li)}const Mi=function Ci(){return new et}();function ae(e={}){const{emit:a,checkoutEveryNms:u,checkoutEveryNth:m,blockClass:w="rr-block",blockSelector:b=null,ignoreClass:S="rr-ignore",ignoreSelector:C=null,maskTextClass:x="rr-mask",maskTextSelector:I=null,inlineStylesheet:_=!0,maskAllInputs:O,maskInputOptions:E,slimDOMOptions:D,maskInputFn:F,maskTextFn:U,hooks:$,packFn:B,sampling:z={},dataURLOptions:j={},mousemoveWait:V,recordDOM:q=!0,recordCanvas:H=!1,recordCrossOriginIframes:Y=!1,recordAfter:J=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:X=!1,collectFonts:Q=!1,inlineImages:ee=!1,plugins:te,keepIframeSrcFn:ne=()=>!1,ignoreCSSAttributes:re=new Set([]),errorHandler:oe}=e;!function Bl(e){Xs=e}(oe);const se=!Y||window.parent===window;let ie=!1;if(!se)try{window.parent.document&&(ie=!1)}catch{ie=!0}if(se&&!a)throw new Error("emit function is required");if(!se&&!ie)return()=>{};void 0!==V&&void 0===z.mousemove&&(z.mousemove=V),Mi.reset();const le=!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!==E?E:{password:!0},ce=!0===D||"all"===D?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===D,headMetaDescKeywords:"all"===D,headTitleMutations:"all"===D}:D||{};!function Ul(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 a=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===a)return!0}while(a=a&&a.parentNode);return!1})}();let pe,de=0;const vn=e=>{for(const a of te||[])a.eventProcessor&&(e=a.eventProcessor(e));return B&&!ie&&(e=B(e)),e};hi=(e,w)=>{var b;const S=e;if(S.timestamp=Qs(),null!=(b=ei[0])&&b.isFrozen()&&S.type!==js.FullSnapshot&&!(S.type===js.IncrementalSnapshot&&S.data.source===Gs.Mutation)&&ei.forEach(e=>e.unfreeze()),se)null==a||a(vn(S),w);else if(ie){const e={type:"@sailfish-rrweb/rrweb",event:vn(S),origin:window.location.origin,isCheckout:w};window.parent.postMessage(e,"*")}if(S.type===js.FullSnapshot)pe=S,de=0;else if(S.type===js.IncrementalSnapshot){if(S.data.source===Gs.Mutation&&S.data.isAttachIframe)return;de++;const e=m&&de>=m,a=u&&S.timestamp-pe.timestamp>u;(e||a)&&fi(!0)}};const rt=e=>{hi({type:js.IncrementalSnapshot,data:{source:Gs.Mutation,...e}})},kn=e=>hi({type:js.IncrementalSnapshot,data:{source:Gs.Scroll,...e}}),Cn=e=>hi({type:js.IncrementalSnapshot,data:{source:Gs.CanvasMutation,...e}}),he=new bu({mutationCb:rt,adoptedStyleSheetCb:e=>hi({type:js.IncrementalSnapshot,data:{source:Gs.AdoptedStyleSheet,...e}})}),me=new Vl({mirror:Mi,mutationCb:rt,stylesheetManager:he,recordCrossOriginIframes:Y,wrappedEmit:hi});for(const e of te||[])e.getMirror&&e.getMirror({nodeMirror:Mi,crossOriginIframeMirror:me.crossOriginIframeMirror,crossOriginIframeStyleMirror:me.crossOriginIframeStyleMirror});const ge=new yu;mi=new gu({recordCanvas:H,mutationCb:Cn,win:window,blockClass:w,blockSelector:b,mirror:Mi,sampling:z.canvas,dataURLOptions:j});const ye=new wu({mutationCb:rt,scrollCb:kn,bypassOptions:{blockClass:w,blockSelector:b,maskTextClass:x,maskTextSelector:I,inlineStylesheet:_,maskInputOptions:le,dataURLOptions:j,maskTextFn:U,maskInputFn:F,recordCanvas:H,inlineImages:ee,sampling:z,slimDOMOptions:ce,iframeManager:me,stylesheetManager:he,canvasManager:mi,keepIframeSrcFn:ne,processedNodeManager:ge},mirror:Mi});fi=(e=!1)=>{if(!q)return;hi({type:js.Meta,data:{href:window.location.href,width:mo(),height:fo()}},e),he.reset(),ye.init(),ei.forEach(e=>e.lock());const a=function Zi(e,a){const{mirror:u=new et,blockClass:m="rr-block",blockSelector:w=null,maskTextClass:b="rr-mask",maskTextSelector:S=null,inlineStylesheet:C=!0,inlineImages:x=!1,recordCanvas:I=!1,maskAllInputs:_=!1,maskTextFn:O,maskInputFn:E,slimDOM:D=!1,dataURLOptions:F,preserveWhiteSpace:U,onSerialize:$,onIframeLoad:B,iframeLoadTimeout:z,onStylesheetLoad:j,stylesheetLoadTimeout:V,keepIframeSrcFn:q=()=>!1}=a||{};return Se(e,{doc:e,mirror:u,blockClass:m,blockSelector:w,maskTextClass:b,maskTextSelector:S,skipChild:!1,inlineStylesheet:C,maskInputOptions:!0===_?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===_?{password:!0}:_,maskTextFn:O,maskInputFn:E,slimDOMOptions:!0===D||"all"===D?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===D,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===D?{}:D,dataURLOptions:F,inlineImages:x,recordCanvas:I,preserveWhiteSpace:U,onSerialize:$,onIframeLoad:B,iframeLoadTimeout:z,onStylesheetLoad:j,stylesheetLoadTimeout:V,keepIframeSrcFn:q,newlyAddedElement:!1})}(document,{mirror:Mi,blockClass:w,blockSelector:b,maskTextClass:x,maskTextSelector:I,inlineStylesheet:_,maskAllInputs:le,maskTextFn:U,maskInputFn:F,slimDOM:ce,dataURLOptions:j,recordCanvas:H,inlineImages:ee,onSerialize:e=>{wo(e,Mi)&&me.addIframe(e),bo(e,Mi)&&he.trackLinkElement(e),Fs(e)&&ye.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,a)=>{me.attachIframe(e,a),ye.observeAttachShadow(e)},onStylesheetLoad:(e,a)=>{he.attachLinkElement(e,a)},keepIframeSrcFn:ne});if(!a)return console.warn("Failed to snapshot the document");hi({type:js.FullSnapshot,data:{node:a,initialOffset:po(window)}},e),ei.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&he.adoptStyleSheets(document.adoptedStyleSheets,Mi.getId(document))};try{const e=[],K=e=>{var a;return M(au)({mutationCb:rt,mousemoveCb:(e,a)=>hi({type:js.IncrementalSnapshot,data:{source:a,positions:e}}),mouseInteractionCb:e=>hi({type:js.IncrementalSnapshot,data:{source:Gs.MouseInteraction,...e}}),scrollCb:kn,viewportResizeCb:e=>hi({type:js.IncrementalSnapshot,data:{source:Gs.ViewportResize,...e}}),inputCb:e=>hi({type:js.IncrementalSnapshot,data:{source:Gs.Input,...e}}),mediaInteractionCb:e=>hi({type:js.IncrementalSnapshot,data:{source:Gs.MediaInteraction,...e}}),styleSheetRuleCb:e=>hi({type:js.IncrementalSnapshot,data:{source:Gs.StyleSheetRule,...e}}),styleDeclarationCb:e=>hi({type:js.IncrementalSnapshot,data:{source:Gs.StyleDeclaration,...e}}),canvasMutationCb:Cn,fontCb:e=>hi({type:js.IncrementalSnapshot,data:{source:Gs.Font,...e}}),selectionCb:e=>{hi({type:js.IncrementalSnapshot,data:{source:Gs.Selection,...e}})},customElementCb:e=>{hi({type:js.IncrementalSnapshot,data:{source:Gs.CustomElement,...e}})},typingCb:e=>{hi({type:js.IncrementalSnapshot,data:{...e}})},deviceChangeCb:e=>{hi({type:js.Device,data:{...e}})},blockClass:w,ignoreClass:S,ignoreSelector:C,maskTextClass:x,maskTextSelector:I,maskInputOptions:le,inlineStylesheet:_,sampling:z,recordDOM:q,recordCanvas:H,inlineImages:ee,userTriggeredOnInput:X,collectFonts:Q,doc:e,maskInputFn:F,maskTextFn:U,keepIframeSrcFn:ne,blockSelector:b,slimDOMOptions:ce,dataURLOptions:j,mirror:Mi,iframeManager:me,stylesheetManager:he,shadowDomManager:ye,processedNodeManager:ge,canvasManager:mi,ignoreCSSAttributes:re,plugins:(null==(a=null==te?void 0:te.filter(e=>e.observer))?void 0:a.map(e=>({observer:e.observer,options:e.options,callback:a=>hi({type:js.Plugin,data:{plugin:e.name,payload:a}})})))||[]},$)};me.addLoadListener(a=>{try{e.push(K(a.contentDocument))}catch(e){console.warn(e)}});const W=()=>{fi(),e.push(K(document)),gi=!0};return"interactive"===document.readyState||"complete"===document.readyState?W():(e.push(G("DOMContentLoaded",()=>{hi({type:js.DomContentLoaded,data:{}}),"DOMContentLoaded"===J&&W()})),e.push(G("load",()=>{hi({type:js.Load,data:{}}),"load"===J&&W()},window))),()=>{e.forEach(e=>e()),ge.destroy(),gi=!1,function jl(){Xs=void 0}()}}catch(e){console.warn(e)}}function Su(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function vu(e){if(e.__esModule)return e;var a=e.default;if("function"==typeof a){var u=function n(){return this instanceof n?Reflect.construct(a,arguments,this.constructor):a.apply(this,arguments)};u.prototype=a.prototype}else u={};return Object.defineProperty(u,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var m=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(u,a,m.get?m:{enumerable:!0,get:function(){return e[a]}})}),u}ae.addCustomEvent=(e,a)=>{if(!gi)throw new Error("please add custom event after start recording");hi({type:js.Custom,data:{tag:e,payload:a}})},ae.addSailfishEvent=(e,a)=>{if(!gi)throw new Error("please add Sailfish event after start recording");hi({type:e,data:{tag:"sailfish-zendesk-test-tag",payload:a}})},ae.freezePage=()=>{ei.forEach(e=>e.freeze())},ae.takeFullSnapshot=e=>{if(!gi)throw new Error("please take full snapshot after start recording");fi(e)},ae.mirror=Mi;var Ii={exports:{}},Li=String,Lo=function(){return{isColorSupported:!1,reset:Li,bold:Li,dim:Li,italic:Li,underline:Li,inverse:Li,hidden:Li,strikethrough:Li,black:Li,red:Li,green:Li,yellow:Li,blue:Li,magenta:Li,cyan:Li,white:Li,gray:Li,bgBlack:Li,bgRed:Li,bgGreen:Li,bgYellow:Li,bgBlue:Li,bgMagenta:Li,bgCyan:Li,bgWhite:Li,blackBright:Li,redBright:Li,greenBright:Li,yellowBright:Li,blueBright:Li,magentaBright:Li,cyanBright:Li,whiteBright:Li,bgBlackBright:Li,bgRedBright:Li,bgGreenBright:Li,bgYellowBright:Li,bgBlueBright:Li,bgMagentaBright:Li,bgCyanBright:Li,bgWhiteBright:Li}};Ii.exports=Lo(),Ii.exports.createColors=Lo;var Ri=Ii.exports;const Ai=vu(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Ti=Ri,Ni=Ai,Pi=class To extends Error{constructor(e,a,u,m,w,b){super(e),this.name="CssSyntaxError",this.reason=e,w&&(this.file=w),m&&(this.source=m),b&&(this.plugin=b),typeof a<"u"&&typeof u<"u"&&("number"==typeof a?(this.line=a,this.column=u):(this.line=a.line,this.column=a.column,this.endLine=u.line,this.endColumn=u.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,To)}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 a=this.source;null==e&&(e=Ti.isColorSupported);let n=e=>e,r=e=>e,i=e=>e;if(e){let{bold:e,gray:a,red:u}=Ti.createColors(!0);r=a=>e(u(a)),n=e=>a(e),Ni&&(i=e=>Ni(e))}let u=a.split(/\r?\n/),m=Math.max(this.line-3,0),w=Math.min(this.line+2,u.length),b=String(w).length;return u.slice(m,w).map((e,a)=>{let u=m+1+a,w=" "+(" "+u).slice(-b)+" | ";if(u===this.line){if(e.length>160){let a=20,u=Math.max(0,this.column-a),m=Math.max(this.column+a,this.endColumn+a),b=e.slice(u,m),S=n(w.replace(/\d/g," "))+e.slice(0,Math.min(this.column-1,a-1)).replace(/[^\t]/g," ");return r(">")+n(w)+i(b)+"\n "+S+r("^")}let a=n(w.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+n(w)+i(e)+"\n "+a+r("^")}return" "+n(w)+i(e)}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var qi=Pi;Pi.default=Pi;const Hi={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Ji=class{constructor(e){this.builder=e}atrule(e,a){let u="@"+e.name,m=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?u+=e.raws.afterName:m&&(u+=" "),e.nodes)this.block(e,u+m);else{let w=(e.raws.between||"")+(a?";":"");this.builder(u+m+w,e)}}beforeAfter(e,a){let u;u="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===a?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let m=e.parent,w=0;for(;m&&"root"!==m.type;)w+=1,m=m.parent;if(u.includes("\n")){let a=this.raw(e,null,"indent");if(a.length)for(let e=0;e<w;e++)u+=a}return u}block(e,a){let u,m=this.raw(e,"between","beforeOpen");this.builder(a+m+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),u=this.raw(e,"after")):u=this.raw(e,"after","emptyBody"),u&&this.builder(u),this.builder("}",e,"end")}body(e){let a=e.nodes.length-1;for(;a>0&&"comment"===e.nodes[a].type;)a-=1;let u=this.raw(e,"semicolon");for(let m=0;m<e.nodes.length;m++){let w=e.nodes[m],b=this.raw(w,"before");b&&this.builder(b),this.stringify(w,a!==m||u)}}comment(e){let a=this.raw(e,"left","commentLeft"),u=this.raw(e,"right","commentRight");this.builder("/*"+a+e.text+u+"*/",e)}decl(e,a){let u=this.raw(e,"between","colon"),m=e.prop+u+this.rawValue(e,"value");e.important&&(m+=e.raws.important||" !important"),a&&(m+=";"),this.builder(m,e)}document(e){this.body(e)}raw(e,a,u){let m;if(u||(u=a),a&&(m=e.raws[a],typeof m<"u"))return m;let w=e.parent;if("before"===u&&(!w||"root"===w.type&&w.first===e||w&&"document"===w.type))return"";if(!w)return Hi[u];let b=e.root();if(b.rawCache||(b.rawCache={}),typeof b.rawCache[u]<"u")return b.rawCache[u];if("before"===u||"after"===u)return this.beforeAfter(e,u);{let w="raw"+function Iu(e){return e[0].toUpperCase()+e.slice(1)}(u);this[w]?m=this[w](b,e):b.walk(e=>{if(m=e.raws[a],typeof m<"u")return!1})}return typeof m>"u"&&(m=Hi[u]),b.rawCache[u]=m,m}rawBeforeClose(e){let a;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&typeof e.raws.after<"u")return a=e.raws.after,a.includes("\n")&&(a=a.replace(/[^\n]+$/,"")),!1}),a&&(a=a.replace(/\S/g,"")),a}rawBeforeComment(e,a){let u;return e.walkComments(e=>{if(typeof e.raws.before<"u")return u=e.raws.before,u.includes("\n")&&(u=u.replace(/[^\n]+$/,"")),!1}),typeof u>"u"?u=this.raw(a,null,"beforeDecl"):u&&(u=u.replace(/\S/g,"")),u}rawBeforeDecl(e,a){let u;return e.walkDecls(e=>{if(typeof e.raws.before<"u")return u=e.raws.before,u.includes("\n")&&(u=u.replace(/[^\n]+$/,"")),!1}),typeof u>"u"?u=this.raw(a,null,"beforeRule"):u&&(u=u.replace(/\S/g,"")),u}rawBeforeOpen(e){let a;return e.walk(e=>{if("decl"!==e.type&&(a=e.raws.between,typeof a<"u"))return!1}),a}rawBeforeRule(e){let a;return e.walk(u=>{if(u.nodes&&(u.parent!==e||e.first!==u)&&typeof u.raws.before<"u")return a=u.raws.before,a.includes("\n")&&(a=a.replace(/[^\n]+$/,"")),!1}),a&&(a=a.replace(/\S/g,"")),a}rawColon(e){let a;return e.walkDecls(e=>{if(typeof e.raws.between<"u")return a=e.raws.between.replace(/[^\s:]/g,""),!1}),a}rawEmptyBody(e){let a;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(a=e.raws.after,typeof a<"u"))return!1}),a}rawIndent(e){if(e.raws.indent)return e.raws.indent;let a;return e.walk(u=>{let m=u.parent;if(m&&m!==e&&m.parent&&m.parent===e&&typeof u.raws.before<"u"){let e=u.raws.before.split("\n");return a=e[e.length-1],a=a.replace(/\S/g,""),!1}}),a}rawSemicolon(e){let a;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(a=e.raws.semicolon,typeof a<"u"))return!1}),a}rawValue(e,a){let u=e[a],m=e.raws[a];return m&&m.value===u?m.raw:u}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,a){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,a)}};var Xi=Ji;Ji.default=Ji;let Qi=Xi;function zs(e,a){new Qi(a).stringify(e)}var ea=zs;zs.default=zs;var ta={};ta.isClean=Symbol("isClean"),ta.my=Symbol("my");let na=qi,ra=Xi,oa=ea,{isClean:sa,my:ia}=ta;function Bs(e,a){let u=new e.constructor;for(let m in e){if(!Object.prototype.hasOwnProperty.call(e,m)||"proxyCache"===m)continue;let w=e[m],b=typeof w;"parent"===m&&"object"===b?a&&(u[m]=a):"source"===m?u[m]=w:Array.isArray(w)?u[m]=w.map(e=>Bs(e,u)):("object"===b&&null!==w&&(w=Bs(w)),u[m]=w)}return u}function Fe(e,a){if(a&&typeof a.offset<"u")return a.offset;let u=1,m=1,w=0;for(let b=0;b<e.length;b++){if(m===a.line&&u===a.column){w=b;break}"\n"===e[b]?(u=1,m+=1):u+=1}return w}let aa=class{get proxyOf(){return this}constructor(e={}){this.raws={},this[sa]=!1,this[ia]=!0;for(let a in e)if("nodes"===a){this.nodes=[];for(let u of e[a])"function"==typeof u.clone?this.append(u.clone()):this.append(u)}else this[a]=e[a]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let a=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${a.input.from}:${a.start.line}:${a.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let a in e)this[a]=e[a];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 a=Bs(this);for(let u in e)a[u]=e[u];return a}cloneAfter(e={}){let a=this.clone(e);return this.parent.insertAfter(this,a),a}cloneBefore(e={}){let a=this.clone(e);return this.parent.insertBefore(this,a),a}error(e,a={}){if(this.source){let{end:u,start:m}=this.rangeBy(a);return this.source.input.error(e,{column:m.column,line:m.line},{column:u.column,line:u.line},a)}return new na(e)}getProxyProcessor(){return{get:(e,a)=>"proxyOf"===a?e:"root"===a?()=>e.root().toProxy():e[a],set:(e,a,u)=>(e[a]===u||(e[a]=u,("prop"===a||"value"===a||"name"===a||"params"===a||"important"===a||"text"===a)&&e.markDirty()),!0)}}markClean(){this[sa]=!0}markDirty(){if(this[sa]){this[sa]=!1;let e=this;for(;e=e.parent;)e[sa]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e){let a=this.source.start;if(e.index)a=this.positionInside(e.index);else if(e.word){let u="document"in this.source.input?this.source.input.document:this.source.input.css,m=u.slice(Fe(u,this.source.start),Fe(u,this.source.end)).indexOf(e.word);-1!==m&&(a=this.positionInside(m))}return a}positionInside(e){let a=this.source.start.column,u=this.source.start.line,m="document"in this.source.input?this.source.input.document:this.source.input.css,w=Fe(m,this.source.start),b=w+e;for(let e=w;e<b;e++)"\n"===m[e]?(a=1,u+=1):a+=1;return{column:a,line:u}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let a={column:this.source.start.column,line:this.source.start.line},u=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:a.column+1,line:a.line};if(e.word){let m="document"in this.source.input?this.source.input.document:this.source.input.css,w=m.slice(Fe(m,this.source.start),Fe(m,this.source.end)).indexOf(e.word);-1!==w&&(a=this.positionInside(w),u=this.positionInside(w+e.word.length))}else e.start?a={column:e.start.column,line:e.start.line}:e.index&&(a=this.positionInside(e.index)),e.end?u={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?u=this.positionInside(e.endIndex):e.index&&(u=this.positionInside(e.index+1));return(u.line<a.line||u.line===a.line&&u.column<=a.column)&&(u={column:a.column+1,line:a.line}),{end:u,start:a}}raw(e,a){return(new ra).raw(this,e,a)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let a=this,u=!1;for(let m of e)m===this?u=!0:u?(this.parent.insertAfter(a,m),a=m):this.parent.insertBefore(a,m);u||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,a){let u={},m=null==a;a=a||new Map;let w=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e)||"parent"===e||"proxyCache"===e)continue;let m=this[e];if(Array.isArray(m))u[e]=m.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,a):e);else if("object"==typeof m&&m.toJSON)u[e]=m.toJSON(null,a);else if("source"===e){let b=a.get(m.input);null==b&&(b=w,a.set(m.input,w),w++),u[e]={end:m.end,inputId:b,start:m.start}}else u[e]=m}return m&&(u.inputs=[...a.keys()].map(e=>e.toJSON())),u}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=oa){e.stringify&&(e=e.stringify);let a="";return e(this,e=>{a+=e}),a}warn(e,a,u){let m={node:this};for(let e in u)m[e]=u[e];return e.warn(a,m)}};var la=aa;aa.default=aa;let ca=la,ua=class extends ca{constructor(e){super(e),this.type="comment"}};var pa=ua;ua.default=ua;let ha=la,fa=class extends ha{get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}constructor(e){e&&typeof e.value<"u"&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}};var ma=fa;fa.default=fa;let ga,ya,wa,ba,va=pa,Sa=ma,Ca=la,{isClean:ka,my:xa}=ta;function Wo(e){return e.map(e=>(e.nodes&&(e.nodes=Wo(e.nodes)),delete e.source,e))}function zo(e){if(e[ka]=!1,e.proxyOf.nodes)for(let a of e.proxyOf.nodes)zo(a)}let Ma=class Bo extends Ca{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]}append(...e){for(let a of e){let e=this.normalize(a,this.last);for(let a of e)this.proxyOf.nodes.push(a)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let a of this.nodes)a.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let a,u,m=this.getIterator();for(;this.indexes[m]<this.proxyOf.nodes.length&&(a=this.indexes[m],u=e(this.proxyOf.nodes[a],a),!1!==u);)this.indexes[m]+=1;return delete this.indexes[m],u}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,a)=>"proxyOf"===a?e:e[a]?"each"===a||"string"==typeof a&&a.startsWith("walk")?(...u)=>e[a](...u.map(e=>"function"==typeof e?(a,u)=>e(a.toProxy(),u):e)):"every"===a||"some"===a?u=>e[a]((e,...a)=>u(e.toProxy(),...a)):"root"===a?()=>e.root().toProxy():"nodes"===a?e.nodes.map(e=>e.toProxy()):"first"===a||"last"===a?e[a].toProxy():e[a]:e[a],set:(e,a,u)=>(e[a]===u||(e[a]=u,("name"===a||"params"===a||"selector"===a)&&e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,a){let u,m=this.index(e),w=this.normalize(a,this.proxyOf.nodes[m]).reverse();m=this.index(e);for(let e of w)this.proxyOf.nodes.splice(m+1,0,e);for(let e in this.indexes)u=this.indexes[e],m<u&&(this.indexes[e]=u+w.length);return this.markDirty(),this}insertBefore(e,a){let u,m=this.index(e),w=0===m&&"prepend",b=this.normalize(a,this.proxyOf.nodes[m],w).reverse();m=this.index(e);for(let e of b)this.proxyOf.nodes.splice(m,0,e);for(let e in this.indexes)u=this.indexes[e],m<=u&&(this.indexes[e]=u+b.length);return this.markDirty(),this}normalize(e,a){if("string"==typeof e)e=Wo(ya(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let a of e)a.parent&&a.parent.removeChild(a,"ignore")}else if("root"===e.type&&"document"!==this.type){e=e.nodes.slice(0);for(let a of e)a.parent&&a.parent.removeChild(a,"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 Sa(e)]}else if(e.selector||e.selectors)e=[new ba(e)];else if(e.name)e=[new ga(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new va(e)]}return e.map(e=>(e[xa]||Bo.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[ka]&&zo(e),e.raws||(e.raws={}),typeof e.raws.before>"u"&&a&&typeof a.raws.before<"u"&&(e.raws.before=a.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){e=e.reverse();for(let a of e){let e=this.normalize(a,this.first,"prepend").reverse();for(let a of e)this.proxyOf.nodes.unshift(a);for(let a in this.indexes)this.indexes[a]=this.indexes[a]+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 a;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let u in this.indexes)a=this.indexes[u],a>=e&&(this.indexes[u]=a-1);return this.markDirty(),this}replaceValues(e,a,u){return u||(u=a,a={}),this.walkDecls(m=>{a.props&&!a.props.includes(m.prop)||a.fast&&!m.value.includes(a.fast)||(m.value=m.value.replace(e,u))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((a,u)=>{let m;try{m=e(a,u)}catch(e){throw a.addToError(e)}return!1!==m&&a.walk&&(m=a.walk(e)),m})}walkAtRules(e,a){return a?e instanceof RegExp?this.walk((u,m)=>{if("atrule"===u.type&&e.test(u.name))return a(u,m)}):this.walk((u,m)=>{if("atrule"===u.type&&u.name===e)return a(u,m)}):(a=e,this.walk((e,u)=>{if("atrule"===e.type)return a(e,u)}))}walkComments(e){return this.walk((a,u)=>{if("comment"===a.type)return e(a,u)})}walkDecls(e,a){return a?e instanceof RegExp?this.walk((u,m)=>{if("decl"===u.type&&e.test(u.prop))return a(u,m)}):this.walk((u,m)=>{if("decl"===u.type&&u.prop===e)return a(u,m)}):(a=e,this.walk((e,u)=>{if("decl"===e.type)return a(e,u)}))}walkRules(e,a){return a?e instanceof RegExp?this.walk((u,m)=>{if("rule"===u.type&&e.test(u.selector))return a(u,m)}):this.walk((u,m)=>{if("rule"===u.type&&u.selector===e)return a(u,m)}):(a=e,this.walk((e,u)=>{if("rule"===e.type)return a(e,u)}))}};Ma.registerParse=e=>{ya=e},Ma.registerRule=e=>{ba=e},Ma.registerAtRule=e=>{ga=e},Ma.registerRoot=e=>{wa=e};var Ia=Ma;Ma.default=Ma,Ma.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,ga.prototype):"rule"===e.type?Object.setPrototypeOf(e,ba.prototype):"decl"===e.type?Object.setPrototypeOf(e,Sa.prototype):"comment"===e.type?Object.setPrototypeOf(e,va.prototype):"root"===e.type&&Object.setPrototypeOf(e,wa.prototype),e[xa]=!0,e.nodes&&e.nodes.forEach(e=>{Ma.rebuild(e)})};let _a=Ia,Oa=class extends _a{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 Ea=Oa;Oa.default=Oa,_a.registerAtRule(Oa);let La,Ra,Aa=Ia,Ta=class extends Aa{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new La(new Ra,this,e).stringify()}};Ta.registerLazyResult=e=>{La=e},Ta.registerProcessor=e=>{Ra=e};var Na=Ta;Ta.default=Ta;var Pa={nanoid:(e=21)=>{let a="",u=0|e;for(;u--;)a+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return a}};let{existsSync:Da,readFileSync:Fa}=Ai,{dirname:Ua,join:$a}=Ai,{SourceMapConsumer:Ba,SourceMapGenerator:Wa}=Ai;let za=class{constructor(e,a){if(!1===a.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let u=a.map?a.map.prev:void 0,m=this.loadMap(a.from,u);!this.mapFile&&a.from&&(this.mapFile=a.from),this.mapFile&&(this.root=Ua(this.mapFile)),m&&(this.text=m)}consumer(){return this.consumerCache||(this.consumerCache=new Ba(this.text)),this.consumerCache}decodeInline(e){let a=e.match(/^data:application\/json;charset=utf-?8,/)||e.match(/^data:application\/json,/);if(a)return decodeURIComponent(e.substr(a[0].length));let u=e.match(/^data:application\/json;charset=utf-?8;base64,/)||e.match(/^data:application\/json;base64,/);if(u)return function Bu(e){return Buffer?Buffer.from(e,"base64").toString():window.atob(e)}(e.substr(u[0].length));let m=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+m)}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 a=e.match(/\/\*\s*# sourceMappingURL=/g);if(!a)return;let u=e.lastIndexOf(a.pop()),m=e.indexOf("*/",u);u>-1&&m>-1&&(this.annotation=this.getAnnotationURL(e.substring(u,m)))}loadFile(e){if(this.root=Ua(e),Da(e))return this.mapFile=e,Fa(e,"utf-8").toString().trim()}loadMap(e,a){if(!1===a)return!1;if(a){if("string"==typeof a)return a;if("function"!=typeof a){if(a instanceof Ba)return Wa.fromSourceMap(a).toString();if(a instanceof Wa)return a.toString();if(this.isMap(a))return JSON.stringify(a);throw new Error("Unsupported previous source map format: "+a.toString())}{let u=a(e);if(u){let e=this.loadFile(u);if(!e)throw new Error("Unable to load previous source map: "+u.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let a=this.annotation;return e&&(a=$a(Ua(e),a)),this.loadFile(a)}}}startWith(e,a){return!!e&&e.substr(0,a.length)===a}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var ja=za;za.default=za;let{nanoid:Ga}=Pa,{isAbsolute:Va,resolve:qa}=Ai,{SourceMapConsumer:Za,SourceMapGenerator:Ka}=Ai,{fileURLToPath:Ya,pathToFileURL:Ja}=Ai,Qa=qi,el=ja,tl=Ai,nl=Symbol("fromOffsetCache"),rl=!(!Za||!Ka),ol=!(!qa||!Va),sl=class{get from(){return this.file||this.id}constructor(e,a={}){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,this.document=this.css,a.document&&(this.document=a.document.toString()),a.from&&(!ol||/^\w+:\/\//.test(a.from)||Va(a.from)?this.file=a.from:this.file=qa(a.from)),ol&&rl){let e=new el(this.css,a);if(e.text){this.map=e;let a=e.consumer().file;!this.file&&a&&(this.file=this.mapResolve(a))}}this.file||(this.id="<input css "+Ga(6)+">"),this.map&&(this.map.file=this.from)}error(e,a,u,m={}){let w,b,S;if(a&&"object"==typeof a){let e=a,m=u;if("number"==typeof e.offset){let m=this.fromOffset(e.offset);a=m.line,u=m.col}else a=e.line,u=e.column;if("number"==typeof m.offset){let e=this.fromOffset(m.offset);b=e.line,w=e.col}else b=m.line,w=m.column}else if(!u){let e=this.fromOffset(a);a=e.line,u=e.col}let C=this.origin(a,u,b,w);return S=C?new Qa(e,void 0===C.endLine?C.line:{column:C.column,line:C.line},void 0===C.endLine?C.column:{column:C.endColumn,line:C.endLine},C.source,C.file,m.plugin):new Qa(e,void 0===b?a:{column:u,line:a},void 0===b?u:{column:w,line:b},this.css,this.file,m.plugin),S.input={column:u,endColumn:w,endLine:b,line:a,source:this.css},this.file&&(Ja&&(S.input.url=Ja(this.file).toString()),S.input.file=this.file),S}fromOffset(e){let a,u;if(this[nl])u=this[nl];else{let e=this.css.split("\n");u=new Array(e.length);let a=0;for(let m=0,w=e.length;m<w;m++)u[m]=a,a+=e[m].length+1;this[nl]=u}a=u[u.length-1];let m=0;if(e>=a)m=u.length-1;else{let a,w=u.length-2;for(;m<w;)if(a=m+(w-m>>1),e<u[a])w=a-1;else{if(!(e>=u[a+1])){m=a;break}m=a+1}}return{col:e-u[m]+1,line:m+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:qa(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,a,u,m){if(!this.map)return!1;let w,b,S=this.map.consumer(),C=S.originalPositionFor({column:a,line:e});if(!C.source)return!1;"number"==typeof u&&(w=S.originalPositionFor({column:m,line:u})),b=Va(C.source)?Ja(C.source):new URL(C.source,this.map.consumer().sourceRoot||Ja(this.map.mapFile));let x={column:C.column,endColumn:w&&w.column,endLine:w&&w.line,line:C.line,url:b.toString()};if("file:"===b.protocol){if(!Ya)throw new Error("file: protocol is not available in this PostCSS build");x.file=Ya(b)}let I=S.sourceContentFor(C.source);return I&&(x.source=I),x}toJSON(){let e={};for(let a of["hasBOM","css","file","id"])null!=this[a]&&(e[a]=this[a]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}};var il=sl;sl.default=sl,tl&&tl.registerInput&&tl.registerInput(sl);let al,ll,cl=Ia,ul=class extends cl{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,a,u){let m=super.normalize(e);if(a)if("prepend"===u)this.nodes.length>1?a.raws.before=this.nodes[1].raws.before:delete a.raws.before;else if(this.first!==a)for(let e of m)e.raws.before=a.raws.before;return m}removeChild(e,a){let u=this.index(e);return!a&&0===u&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[u].raws.before),super.removeChild(e)}toResult(e={}){return new al(new ll,this,e).stringify()}};ul.registerLazyResult=e=>{al=e},ul.registerProcessor=e=>{ll=e};var pl=ul;ul.default=ul,cl.registerRoot(ul);let dl={comma:e=>dl.split(e,[","],!0),space(e){let a=[" ","\n","\t"];return dl.split(e,a)},split(e,a,u){let m=[],w="",b=!1,S=0,C=!1,x="",I=!1;for(let u of e)I?I=!1:"\\"===u?I=!0:C?u===x&&(C=!1):'"'===u||"'"===u?(C=!0,x=u):"("===u?S+=1:")"===u?S>0&&(S-=1):0===S&&a.includes(u)&&(b=!0),b?(""!==w&&m.push(w.trim()),w="",b=!1):w+=u;return(u||""!==w)&&m.push(w.trim()),m}};var hl=dl;dl.default=dl;let fl=Ia,ml=hl,gl=class extends fl{get selectors(){return ml.comma(this.selector)}set selectors(e){let a=this.selector?this.selector.match(/,\s*/):null,u=a?a[0]:","+this.raw("between","beforeOpen");this.selector=e.join(u)}constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}};var yl=gl;gl.default=gl,fl.registerRule(gl);let wl=Ea,bl=pa,vl=ma,Sl=il,Cl=ja,kl=pl,xl=yl;function Ke(e,a){if(Array.isArray(e))return e.map(e=>Ke(e));let{inputs:u,...m}=e;if(u){a=[];for(let e of u){let u={...e,__proto__:Sl.prototype};u.map&&(u.map={...u.map,__proto__:Cl.prototype}),a.push(u)}}if(m.nodes&&(m.nodes=e.nodes.map(e=>Ke(e,a))),m.source){let{inputId:e,...u}=m.source;m.source=u,null!=e&&(m.source.input=a[e])}if("root"===m.type)return new kl(m);if("decl"===m.type)return new vl(m);if("rule"===m.type)return new xl(m);if("comment"===m.type)return new bl(m);if("atrule"===m.type)return new wl(m);throw new Error("Unknown node type: "+e.type)}var Ml=Ke;Ke.default=Ke;let{dirname:Il,relative:Ol,resolve:El,sep:Ll}=Ai,{SourceMapConsumer:Rl,SourceMapGenerator:Al}=Ai,{pathToFileURL:Tl}=Ai,Nl=il,Pl=!(!Rl||!Al),Dl=!!(Il&&El&&Ol&&Ll);var Jl=class{constructor(e,a,u,m){this.stringify=e,this.mapOpts=u.map||{},this.root=a,this.opts=u,this.css=m,this.originalCSS=m,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 a="\n";this.css.includes("\r\n")&&(a="\r\n"),this.css+=a+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let a,u=this.toUrl(this.path(e.file)),m=e.root||Il(e.file);!1===this.mapOpts.sourcesContent?(a=new Rl(e.text),a.sourcesContent&&(a.sourcesContent=null)):a=e.consumer(),this.map.applySourceMap(a,u,this.toUrl(this.path(m)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let a=this.root.nodes.length-1;a>=0;a--)e=this.root.nodes[a],"comment"===e.type&&e.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(a)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Dl&&Pl&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,a=>{e+=a}),[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=Al.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Al({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 Al({file:this.outputFile(),ignoreInvalidMapping:!0});let e,a,u=1,m=1,w="<no source>",b={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(S,C,x)=>{if(this.css+=S,C&&"end"!==x&&(b.generated.line=u,b.generated.column=m-1,C.source&&C.source.start?(b.source=this.sourcePath(C),b.original.line=C.source.start.line,b.original.column=C.source.start.column-1,this.map.addMapping(b)):(b.source=w,b.original.line=1,b.original.column=0,this.map.addMapping(b))),a=S.match(/\n/g),a?(u+=a.length,e=S.lastIndexOf("\n"),m=S.length-e):m+=S.length,C&&"start"!==x){let e=C.parent||{raws:{}};("decl"!==C.type&&("atrule"!==C.type||C.nodes)||C!==e.last||e.raws.semicolon)&&(C.source&&C.source.end?(b.source=this.sourcePath(C),b.original.line=C.source.end.line,b.original.column=C.source.end.column-1,b.generated.line=u,b.generated.column=m-2,this.map.addMapping(b)):(b.source=w,b.original.line=1,b.original.column=0,b.generated.line=u,b.generated.column=m-1,this.map.addMapping(b)))}})}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 a=this.memoizedPaths.get(e);if(a)return a;let u=this.opts.to?Il(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(u=Il(El(u,this.mapOpts.annotation)));let m=Ol(u,e);return this.memoizedPaths.set(e,m),m}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let a=e.source.input.map;this.previousMaps.includes(a)||this.previousMaps.push(a)}});else{let e=new Nl(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(a=>{if(a.source){let u=a.source.input.from;if(u&&!e[u]){e[u]=!0;let m=this.usesFileUrls?this.toFileUrl(u):this.toUrl(this.path(u));this.map.setSourceContent(m,a.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 a=this.memoizedFileURLs.get(e);if(a)return a;if(Tl){let a=Tl(e).toString();return this.memoizedFileURLs.set(e,a),a}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let a=this.memoizedURLs.get(e);if(a)return a;"\\"===Ll&&(e=e.replace(/\\/g,"/"));let u=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,u),u}};const ec=/[\t\n\f\r "#'()/;[\\\]{}]/g,tc=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,nc=/.[\r\n"'(/\\]/,rc=/[\da-f]/i;let oc=Ea,sc=pa,ic=ma,ac=pl,lc=yl,kc=function(e,a={}){let u,m,w,b,S,C,x,I,_,O,E=e.css.valueOf(),D=a.ignoreErrors,F=E.length,U=0,$=[],B=[];function y2(a){throw e.error("Unclosed "+a,U)}return{back:function A(e){B.push(e)},endOfFile:function v(){return 0===B.length&&U>=F},nextToken:function P2(e){if(B.length)return B.pop();if(U>=F)return;let a=!!e&&e.ignoreUnclosed;switch(u=E.charCodeAt(U),u){case 10:case 32:case 9:case 13:case 12:b=U;do{b+=1,u=E.charCodeAt(b)}while(32===u||10===u||9===u||13===u||12===u);C=["space",E.slice(U,b)],U=b-1;break;case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let e=String.fromCharCode(u);C=[e,e,U];break}case 40:if(O=$.length?$.pop()[1]:"",_=E.charCodeAt(U+1),"url"===O&&39!==_&&34!==_&&32!==_&&10!==_&&9!==_&&12!==_&&13!==_){b=U;do{if(x=!1,b=E.indexOf(")",b+1),-1===b){if(D||a){b=U;break}y2("bracket")}for(I=b;92===E.charCodeAt(I-1);)I-=1,x=!x}while(x);C=["brackets",E.slice(U,b+1),U,b],U=b}else b=E.indexOf(")",U+1),m=E.slice(U,b+1),-1===b||nc.test(m)?C=["(","(",U]:(C=["brackets",m,U,b],U=b);break;case 39:case 34:S=39===u?"'":'"',b=U;do{if(x=!1,b=E.indexOf(S,b+1),-1===b){if(D||a){b=U+1;break}y2("string")}for(I=b;92===E.charCodeAt(I-1);)I-=1,x=!x}while(x);C=["string",E.slice(U,b+1),U,b],U=b;break;case 64:ec.lastIndex=U+1,ec.test(E),b=0===ec.lastIndex?E.length-1:ec.lastIndex-2,C=["at-word",E.slice(U,b+1),U,b],U=b;break;case 92:for(b=U,w=!0;92===E.charCodeAt(b+1);)b+=1,w=!w;if(u=E.charCodeAt(b+1),w&&47!==u&&32!==u&&10!==u&&9!==u&&13!==u&&12!==u&&(b+=1,rc.test(E.charAt(b)))){for(;rc.test(E.charAt(b+1));)b+=1;32===E.charCodeAt(b+1)&&(b+=1)}C=["word",E.slice(U,b+1),U,b],U=b;break;default:47===u&&42===E.charCodeAt(U+1)?(b=E.indexOf("*/",U+2)+1,0===b&&(D||a?b=E.length:y2("comment")),C=["comment",E.slice(U,b+1),U,b],U=b):(tc.lastIndex=U+1,tc.test(E),b=0===tc.lastIndex?E.length-1:tc.lastIndex-2,C=["word",E.slice(U,b+1),U,b],$.push(C),U=b)}return U++,C},position:function S2(){return U}}};const cc={empty:!0,space:!0};var uc=class{constructor(e){this.input=e,this.root=new ac,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 a=new oc;a.name=e[1].slice(1),""===a.name&&this.unnamedAtrule(a,e),this.init(a,e[2]);let u,m,w,b=!1,S=!1,C=[],x=[];for(;!this.tokenizer.endOfFile();){if(u=(e=this.tokenizer.nextToken())[0],"("===u||"["===u?x.push("("===u?")":"]"):"{"===u&&x.length>0?x.push("}"):u===x[x.length-1]&&x.pop(),0===x.length){if(";"===u){a.source.end=this.getPosition(e[2]),a.source.end.offset++,this.semicolon=!0;break}if("{"===u){S=!0;break}if("}"===u){if(C.length>0){for(w=C.length-1,m=C[w];m&&"space"===m[0];)m=C[--w];m&&(a.source.end=this.getPosition(m[3]||m[2]),a.source.end.offset++)}this.end(e);break}C.push(e)}else C.push(e);if(this.tokenizer.endOfFile()){b=!0;break}}a.raws.between=this.spacesAndCommentsFromEnd(C),C.length?(a.raws.afterName=this.spacesAndCommentsFromStart(C),this.raw(a,"params",C),b&&(e=C[C.length-1],a.source.end=this.getPosition(e[3]||e[2]),a.source.end.offset++,this.spaces=a.raws.between,a.raws.between="")):(a.raws.afterName="",a.params=""),S&&(a.nodes=[],this.current=a)}checkMissedSemicolon(e){let a=this.colon(e);if(!1===a)return;let u,m=0;for(let w=a-1;w>=0&&(u=e[w],"space"===u[0]||(m+=1,2!==m));w--);throw this.input.error("Missed semicolon","word"===u[0]?u[3]+1:u[2])}colon(e){let a,u,m,w=0;for(let[b,S]of e.entries()){if(u=S,m=u[0],"("===m&&(w+=1),")"===m&&(w-=1),0===w&&":"===m){if(a){if("word"===a[0]&&"progid"===a[1])continue;return b}this.doubleColon(u)}a=u}return!1}comment(e){let a=new sc;this.init(a,e[2]),a.source.end=this.getPosition(e[3]||e[2]),a.source.end.offset++;let u=e[1].slice(2,-2);if(/^\s*$/.test(u))a.text="",a.raws.left=u,a.raws.right="";else{let e=u.match(/^(\s*)([^]*\S)(\s*)$/);a.text=e[2],a.raws.left=e[1],a.raws.right=e[3]}}createTokenizer(){this.tokenizer=kc(this.input)}decl(e,a){let u=new ic;this.init(u,e[0][2]);let m,w=e[e.length-1];for(";"===w[0]&&(this.semicolon=!0,e.pop()),u.source.end=this.getPosition(w[3]||w[2]||function Cc(e){for(let a=e.length-1;a>=0;a--){let u=e[a],m=u[3]||u[2];if(m)return m}}(e)),u.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),u.raws.before+=e.shift()[1];for(u.source.start=this.getPosition(e[0][2]),u.prop="";e.length;){let a=e[0][0];if(":"===a||"space"===a||"comment"===a)break;u.prop+=e.shift()[1]}for(u.raws.between="";e.length;){if(m=e.shift(),":"===m[0]){u.raws.between+=m[1];break}"word"===m[0]&&/\w/.test(m[1])&&this.unknownWord([m]),u.raws.between+=m[1]}("_"===u.prop[0]||"*"===u.prop[0])&&(u.raws.before+=u.prop[0],u.prop=u.prop.slice(1));let b,S=[];for(;e.length&&(b=e[0][0],"space"===b||"comment"===b);)S.push(e.shift());this.precheckMissedSemicolon(e);for(let a=e.length-1;a>=0;a--){if(m=e[a],"!important"===m[1].toLowerCase()){u.important=!0;let m=this.stringFrom(e,a);m=this.spacesFromEnd(e)+m," !important"!==m&&(u.raws.important=m);break}if("important"===m[1].toLowerCase()){let m=e.slice(0),w="";for(let e=a;e>0;e--){let a=m[e][0];if(w.trim().startsWith("!")&&"space"!==a)break;w=m.pop()[1]+w}w.trim().startsWith("!")&&(u.important=!0,u.raws.important=w,e=m)}if("space"!==m[0]&&"comment"!==m[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(u.raws.between+=S.map(e=>e[1]).join(""),S=[]),this.raw(u,"value",S.concat(e),a),u.value.includes(":")&&!a&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let a=new lc;this.init(a,e[2]),a.selector="",a.raws.between="",this.current=a}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 a=this.current.nodes[this.current.nodes.length-1];a&&"rule"===a.type&&!a.raws.ownSemicolon&&(a.raws.ownSemicolon=this.spaces,this.spaces="",a.source.end=this.getPosition(e[2]),a.source.end.offset+=a.raws.ownSemicolon.length)}}getPosition(e){let a=this.input.fromOffset(e);return{column:a.col,line:a.line,offset:e}}init(e,a){this.current.push(e),e.source={input:this.input,start:this.getPosition(a)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let a=!1,u=null,m=!1,w=null,b=[],S=e[1].startsWith("--"),C=[],x=e;for(;x;){if(u=x[0],C.push(x),"("===u||"["===u)w||(w=x),b.push("("===u?")":"]");else if(S&&m&&"{"===u)w||(w=x),b.push("}");else if(0===b.length){if(";"===u){if(m)return void this.decl(C,S);break}if("{"===u)return void this.rule(C);if("}"===u){this.tokenizer.back(C.pop()),a=!0;break}":"===u&&(m=!0)}else u===b[b.length-1]&&(b.pop(),0===b.length&&(w=null));x=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(a=!0),b.length>0&&this.unclosedBracket(w),a&&m){if(!S)for(;C.length&&(x=C[C.length-1][0],"space"===x||"comment"===x);)this.tokenizer.back(C.pop());this.decl(C,S)}else this.unknownWord(C)}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,a,u,m){let w,b,S,C,x=u.length,I="",_=!0;for(let e=0;e<x;e+=1)w=u[e],b=w[0],"space"!==b||e!==x-1||m?"comment"===b?(C=u[e-1]?u[e-1][0]:"empty",S=u[e+1]?u[e+1][0]:"empty",cc[C]||cc[S]||","===I.slice(-1)?_=!1:I+=w[1]):I+=w[1]:_=!1;if(!_){let m=u.reduce((e,a)=>e+a[1],"");e.raws[a]={raw:m,value:I}}e[a]=I}rule(e){e.pop();let a=new lc;this.init(a,e[0][2]),a.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(a,"selector",e),this.current=a}spacesAndCommentsFromEnd(e){let a,u="";for(;e.length&&(a=e[e.length-1][0],"space"===a||"comment"===a);)u=e.pop()[1]+u;return u}spacesAndCommentsFromStart(e){let a,u="";for(;e.length&&(a=e[0][0],"space"===a||"comment"===a);)u+=e.shift()[1];return u}spacesFromEnd(e){let a,u="";for(;e.length&&(a=e[e.length-1][0],"space"===a);)u=e.pop()[1]+u;return u}stringFrom(e,a){let u="";for(let m=a;m<e.length;m++)u+=e[m][1];return e.splice(a,e.length-a),u}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 "+e[0][1],{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,a){throw this.input.error("At-rule without name",{offset:a[2]},{offset:a[2]+a[1].length})}};let pc=Ia,dc=il,hc=uc;function Gt(e,a){let u=new dc(e,a),m=new hc(u);try{m.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&a&&a.from&&(/\.scss$/i.test(a.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(a.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(a.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return m.root}var fc=Gt;Gt.default=Gt,pc.registerParse(Gt);let mc=class{constructor(e,a={}){if(this.type="warning",this.text=e,a.node&&a.node.source){let e=a.node.rangeBy(a);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in a)this[e]=a[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 gc=mc;mc.default=mc;let yc=gc,wc=class{get content(){return this.css}constructor(e,a,u){this.processor=e,this.messages=[],this.root=a,this.opts=u,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,a={}){a.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(a.plugin=this.lastPlugin.postcssPlugin);let u=new yc(e,a);return this.messages.push(u),u}warnings(){return this.messages.filter(e=>"warning"===e.type)}};var bc=wc;wc.default=wc;let vc={};var ni=function(e){vc[e]||(vc[e]=!0,typeof console<"u"&&console.warn&&console.warn(e))};let Sc=Ia,xc=Na,Mc=Jl,Ic=fc,_c=bc,Oc=pl,Ec=ea,{isClean:Lc,my:Rc}=ta,Ac=ni;const Tc={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Nc={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},Pc={Once:!0,postcssPlugin:!0,prepare:!0};function _e(e){return"object"==typeof e&&"function"==typeof e.then}function ri(e){let a=!1,u=Tc[e.type];return"decl"===e.type?a=e.prop.toLowerCase():"atrule"===e.type&&(a=e.name.toLowerCase()),a&&e.append?[u,u+"-"+a,0,u+"Exit",u+"Exit-"+a]:a?[u,u+"-"+a,u+"Exit",u+"Exit-"+a]:e.append?[u,0,u+"Exit"]:[u,u+"Exit"]}function br(e){let a;return a="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:ri(e),{eventIndex:0,events:a,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Js(e){return e[Lc]=!1,e.nodes&&e.nodes.forEach(e=>Js(e)),e}let Dc={},Fc=class oi{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"}constructor(e,a,u){let m;if(this.stringified=!1,this.processed=!1,"object"!=typeof a||null===a||"root"!==a.type&&"document"!==a.type)if(a instanceof oi||a instanceof _c)m=Js(a.root),a.map&&(typeof u.map>"u"&&(u.map={}),u.map.inline||(u.map.inline=!1),u.map.prev=a.map);else{let e=Ic;u.syntax&&(e=u.syntax.parse),u.parser&&(e=u.parser),e.parse&&(e=e.parse);try{m=e(a,u)}catch(e){this.processed=!0,this.error=e}m&&!m[Rc]&&Sc.rebuild(m)}else m=Js(a);this.result=new _c(e,m,u),this.helpers={...Dc,postcss:Dc,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,a){let u=this.result.lastPlugin;try{if(a&&a.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(u.postcssVersion&&"production"!==process.env.NODE_ENV){let e=u.postcssPlugin,a=u.postcssVersion,m=this.result.processor.version,w=a.split("."),b=m.split(".");(w[0]!==b[0]||parseInt(w[1])>parseInt(b[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+m+", but "+e+" uses "+a+". Perhaps this is the source of the error below.")}}else e.plugin=u.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let t=(e,a,u)=>{this.listeners[a]||(this.listeners[a]=[]),this.listeners[a].push([e,u])};for(let e of this.plugins)if("object"==typeof e)for(let a in e){if(!Nc[a]&&/^[A-Z]/.test(a))throw new Error(`Unknown event ${a} in ${e.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Pc[a])if("object"==typeof e[a])for(let u in e[a])t(e,"*"===u?a:a+"-"+u.toLowerCase(),e[a][u]);else"function"==typeof e[a]&&t(e,a,e[a])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let a=this.plugins[e],u=this.runOnRoot(a);if(_e(u))try{await u}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Lc];){e[Lc]=!0;let a=[br(e)];for(;a.length>0;){let e=this.visitTick(a);if(_e(e))try{await e}catch(e){let u=a[a.length-1].node;throw this.handleError(e,u)}}}if(this.listeners.OnceExit)for(let[a,u]of this.listeners.OnceExit){this.result.lastPlugin=a;try{if("document"===e.type){let a=e.nodes.map(e=>u(e,this.helpers));await Promise.all(a)}else await u(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 a=this.result.root.nodes.map(a=>e.Once(a,this.helpers));return _e(a[0])?Promise.all(a):a}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,a=Ec;e.syntax&&(a=e.syntax.stringify),e.stringifier&&(a=e.stringifier),a.stringify&&(a=a.stringify);let u=new Mc(a,this.result.root,this.result.opts).generate();return this.result.css=u[0],this.result.map=u[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(_e(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Lc];)e[Lc]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let a of e.nodes)this.visitSync(this.listeners.OnceExit,a);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,a){return"production"!==process.env.NODE_ENV&&("from"in this.opts||Ac("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,a)}toString(){return this.css}visitSync(e,a){for(let[u,m]of e){let e;this.result.lastPlugin=u;try{e=m(a,this.helpers)}catch(e){throw this.handleError(e,a.proxyOf)}if("root"!==a.type&&"document"!==a.type&&!a.parent)return!0;if(_e(e))throw this.getAsyncError()}}visitTick(e){let a=e[e.length-1],{node:u,visitors:m}=a;if("root"!==u.type&&"document"!==u.type&&!u.parent)return void e.pop();if(m.length>0&&a.visitorIndex<m.length){let[e,w]=m[a.visitorIndex];a.visitorIndex+=1,a.visitorIndex===m.length&&(a.visitors=[],a.visitorIndex=0),this.result.lastPlugin=e;try{return w(u.toProxy(),this.helpers)}catch(e){throw this.handleError(e,u)}}if(0!==a.iterator){let m,w=a.iterator;for(;m=u.nodes[u.indexes[w]];)if(u.indexes[w]+=1,!m[Lc])return m[Lc]=!0,void e.push(br(m));a.iterator=0,delete u.indexes[w]}let w=a.events;for(;a.eventIndex<w.length;){let e=w[a.eventIndex];if(a.eventIndex+=1,0===e)return void(u.nodes&&u.nodes.length&&(u[Lc]=!0,a.iterator=u.getIterator()));if(this.listeners[e])return void(a.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Lc]=!0;let a=ri(e);for(let u of a)if(0===u)e.nodes&&e.each(e=>{e[Lc]||this.walkSync(e)});else{let a=this.listeners[u];if(a&&this.visitSync(a,e.toProxy()))return}}warnings(){return this.sync().warnings()}};Fc.registerPostcss=e=>{Dc=e};var Uc=Fc;Fc.default=Fc,Oc.registerLazyResult(Fc),xc.registerLazyResult(Fc);let $c=Jl,Bc=fc;const Wc=bc;let zc=ea,jc=ni,Gc=class{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,a=Bc;try{e=a(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"}constructor(e,a,u){a=a.toString(),this.stringified=!1,this._processor=e,this._css=a,this._opts=u,this._map=void 0;let m,w=zc;this.result=new Wc(this._processor,m,this._opts),this.result.css=a;let b=this;Object.defineProperty(this.result,"root",{get:()=>b.root});let S=new $c(w,m,this._opts,a);if(S.isMap()){let[e,a]=S.generate();e&&(this.result.css=e),a&&(this.result.map=a)}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,a){return"production"!==process.env.NODE_ENV&&("from"in this._opts||jc("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,a)}toString(){return this._css}warnings(){return[]}};var Vc=Gc;Gc.default=Gc;let qc=Na,Hc=Uc,Zc=Vc,Kc=pl,Yc=class{constructor(e=[]){this.version="8.5.3",this.plugins=this.normalize(e)}normalize(e){let a=[];for(let u of e)if(!0===u.postcss?u=u():u.postcss&&(u=u.postcss),"object"==typeof u&&Array.isArray(u.plugins))a=a.concat(u.plugins);else if("object"==typeof u&&u.postcssPlugin)a.push(u);else if("function"==typeof u)a.push(u);else{if("object"!=typeof u||!u.parse&&!u.stringify)throw new Error(u+" 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 a}process(e,a={}){return this.plugins.length||a.parser||a.stringifier||a.syntax?new Hc(this,e,a):new Zc(this,e,a)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Jc=Yc;Yc.default=Yc,Kc.registerProcessor(Yc),qc.registerProcessor(Yc);let Xc=Ea,Qc=pa,lu=Ia,cu=qi,hu=ma,Cu=Na,ku=Ml,xu=il,Mu=Uc,_u=hl,Ou=la,Eu=fc,Lu=Jc,Ru=bc,Au=pl,Tu=yl,Nu=ea,Pu=gc;function T$1(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Lu(e)}T$1.plugin=function(e,a){let u,m=!1;function n(...u){console&&console.warn&&!m&&(m=!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 w=a(...u);return w.postcssPlugin=e,w.postcssVersion=(new Lu).version,w}return Object.defineProperty(n,"postcss",{get:()=>(u||(u=n()),u)}),n.process=function(e,a,u){return T$1([n(u)]).process(e,a)},n},T$1.stringify=Nu,T$1.parse=Eu,T$1.fromJSON=ku,T$1.list=_u,T$1.comment=e=>new Qc(e),T$1.atRule=e=>new Xc(e),T$1.decl=e=>new hu(e),T$1.rule=e=>new Tu(e),T$1.root=e=>new Au(e),T$1.document=e=>new Cu(e),T$1.CssSyntaxError=cu,T$1.Declaration=hu,T$1.Container=lu,T$1.Processor=Lu,T$1.Document=Cu,T$1.Comment=Qc,T$1.Warning=Pu,T$1.AtRule=Xc,T$1.Result=Ru,T$1.Input=xu,T$1.Rule=Tu,T$1.Root=Au,T$1.Node=Ou,Mu.registerPostcss(T$1);var Du=T$1;T$1.default=T$1;const Fu=Su(Du);var Uu;Fu.stringify,Fu.fromJSON,Fu.plugin,Fu.parse,Fu.list,Fu.document,Fu.comment,Fu.atRule,Fu.rule,Fu.decl,Fu.root,Fu.CssSyntaxError,Fu.Declaration,Fu.Container,Fu.Processor,Fu.Document,Fu.Comment,Fu.Warning,Fu.AtRule,Fu.Result,Fu.Input,Fu.Rule,Fu.Root,Fu.Node,function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(Uu||(Uu={}));const{addCustomEvent:$u}=ae,{addSailfishEvent:Wu}=ae,{freezePage:zu}=ae,{takeFullSnapshot:ju}=ae;var Gu=Object.defineProperty,y=(e,a,u)=>((e,a,u)=>a in e?Gu(e,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):e[a]=u)(e,"symbol"!=typeof a?a+"":a,u);let Vu=class d{constructor(e){y(this,"fileName"),y(this,"functionName"),y(this,"lineNumber"),y(this,"columnNumber"),this.fileName=e.fileName||"",this.functionName=e.functionName||"",this.lineNumber=e.lineNumber,this.columnNumber=e.columnNumber}toString(){const e=this.lineNumber||"",a=this.columnNumber||"";return this.functionName?`${this.functionName} (${this.fileName}:${e}:${a})`:`${this.fileName}:${e}:${a}`}};const qu=/(^|@)\S+:\d+/,Hu=/^\s*at .*(\S+:\d+|\(native\))/m,Zu=/^(eval@)?(\[native code])?$/,Ku={parse:function(e){return e?typeof e.stacktrace<"u"||typeof e["opera#sourceloc"]<"u"?this.parseOpera(e):e.stack&&e.stack.match(Hu)?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 a=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));if(!a)throw new Error(`Cannot parse given url: ${e}`);return[a[1],a[2]||void 0,a[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(Hu)},this).map(function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));let a=e.replace(/^\s+/,"").replace(/\(eval code/g,"(");const u=a.match(/ (\((.+):(\d+):(\d+)\)$)/);a=u?a.replace(u[0],""):a;const m=a.split(/\s+/).slice(1),w=this.extractLocation(u?u[1]:m.pop()),b=m.join(" ")||void 0,S=["eval","<anonymous>"].indexOf(w[0])>-1?void 0:w[0];return new Vu({functionName:b,fileName:S,lineNumber:w[1],columnNumber:w[2]})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(Zu)},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 Vu({functionName:e});{const a=/((.*".+"[^@]*)?[^@]*)(?:@)/,u=e.match(a),m=u&&u[1]?u[1]:void 0,w=this.extractLocation(e.replace(a,""));return new Vu({functionName:m,fileName:w[0],lineNumber:w[1],columnNumber:w[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 a=/Line (\d+).*script (?:in )?(\S+)/i,u=e.message.split("\n"),m=[];for(let e=2,w=u.length;e<w;e+=2){const w=a.exec(u[e]);w&&m.push(new Vu({fileName:w[2],lineNumber:parseFloat(w[1])}))}return m},parseOpera10:function(e){const a=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,u=e.stacktrace.split("\n"),m=[];for(let e=0,w=u.length;e<w;e+=2){const w=a.exec(u[e]);w&&m.push(new Vu({functionName:w[3]||void 0,fileName:w[2],lineNumber:parseFloat(w[1])}))}return m},parseOpera11:function(e){return e.stack.split("\n").filter(function(e){return!!e.match(qu)&&!e.match(/^Error created at/)},this).map(function(e){const a=e.split("@"),u=this.extractLocation(a.pop()),m=(a.shift()||"").replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return new Vu({functionName:m,fileName:u[0],lineNumber:u[1],columnNumber:u[2]})},this)}};function T(e){if(!e||!e.outerHTML)return"";let a="";for(;e.parentElement;){let u=e.localName;if(!u)break;u=u.toLowerCase();const m=e.parentElement,w=[];if(m.children&&m.children.length>0)for(let e=0;e<m.children.length;e++){const a=m.children[e];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===u&&w.push(a)}w.length>1&&(u+=`:eq(${w.indexOf(e)})`),a=u+(a?">"+a:""),e=m}return a}function L(e){return"[object Object]"===Object.prototype.toString.call(e)}function k(e,a){if(0===a)return!0;const u=Object.keys(e);for(const m of u)if(L(e[m])&&k(e[m],a-1))return!0;return!1}function g(e,a){const u={numOfKeysLimit:50,depthOfLimit:4};Object.assign(u,a);const m=[],w=[];return JSON.stringify(e,function(e,a){if(m.length>0){const u=m.indexOf(this);~u?m.splice(u+1):m.push(this),~u?w.splice(u,1/0,e):w.push(e),~m.indexOf(a)&&(a=m[0]===a?"[Circular ~]":"[Circular ~."+w.slice(0,m.indexOf(a)).join(".")+"]")}else m.push(a);if(null===a)return a;if(void 0===a)return"undefined";if(function c(e){return!!(L(e)&&Object.keys(e).length>u.numOfKeysLimit||"function"==typeof e||L(e)&&k(e,u.depthOfLimit))}(a))return function o(e){let a=e.toString();return u.stringLengthLimit&&a.length>u.stringLengthLimit&&(a=`${a.slice(0,u.stringLengthLimit)}...`),a}(a);if("bigint"==typeof a)return a.toString()+"n";if(a instanceof Event){const e={};for(const u in a){const m=a[u];Array.isArray(m)?e[u]=T(m.length?m[0]:null):e[u]=m}return e}return a instanceof Node?a instanceof HTMLElement?a?a.outerHTML:"":a.nodeName:a instanceof Error?a.stack?a.stack+"\nEnd of stack for Error object":a.name+": "+a.message:a})}const Yu={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(e,a,u){const m=u?Object.assign({},Yu,u):Yu,w=m.logger;if(!w)return()=>{};let b;b="string"==typeof w?a[w]:w;let S=0,C=!1;const x=[];if(m.level.includes("error")){const l=a=>{const u=a.message,w=a.error,b=Ku.parse(w).map(e=>e.toString()),S=[g(u,m.stringifyOptions)];e({level:"error",trace:b,payload:S})};a.addEventListener("error",l),x.push(()=>{a.removeEventListener("error",l)});const f=a=>{let u,w;a.reason instanceof Error?(u=a.reason,w=[g(`Uncaught (in promise) ${u.name}: ${u.message}`,m.stringifyOptions)]):(u=new Error,w=[g("Uncaught (in promise)",m.stringifyOptions),g(a.reason,m.stringifyOptions)]);const b=Ku.parse(u).map(e=>e.toString());e({level:"error",trace:b,payload:w})};a.addEventListener("unhandledrejection",f),x.push(()=>{a.removeEventListener("unhandledrejection",f)})}for(const e of m.level)x.push(p(b,e));return()=>{x.forEach(e=>e())};function p(a,u){return a[u]?function P(e,a,u){try{if(!(a in e))return()=>{};const m=e[a],w=u(m);return"function"==typeof w&&(w.prototype=w.prototype||{},Object.defineProperties(w,{__rrweb_original__:{enumerable:!1,value:m}})),e[a]=w,()=>{e[a]=m}}catch{return()=>{}}}(a,u,a=>(...w)=>{if(a.apply(this,w),!("assert"===u&&w[0]||C)){C=!0;try{const a=Ku.parse(new Error).map(e=>e.toString()).splice(1),b=("assert"===u?w.slice(1):w).map(e=>g(e,m.stringifyOptions));S++,S<m.lengthThreshold?e({level:u,trace:a,payload:b}):S===m.lengthThreshold&&e({level:"warn",trace:[],payload:[g("The number of log records reached the threshold.")]})}catch(e){a("@sailfish-rrweb/rrweb logger error:",e,...w)}finally{C=!1}}}):()=>{}}}var Ju=(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[e.Device=24]="Device",e[e.SailfishCustom=25]="SailfishCustom",e))(Ju||{});function suppressConsoleLogsDuringCall(e){const a=console.log,u=console.warn,m=console.error;console.log=()=>{},console.warn=()=>{},console.error=()=>{};try{e()}finally{console.log=a,console.warn=u,console.error=m}}const Xu="zendesk_chat",Qu="Zendesk";function zE_safe(...e){try{if(function hasZendesk(){return"undefined"!=typeof window&&"function"==typeof window.zE}())return window.zE(...e),!0}catch{}return!1}function maskInputFn(e,a){var u;if("hidden"===a.type)return"";const m={creditCard:/\b(?:\d[ -]*?){13,16}\b/,ssn:/\b\d{3}-\d{2}-\d{4}\b/};return a.closest(".mask")?"*".repeat(e.length):a.hasAttribute("data-cc")||(null==(u=a.getAttribute("autocomplete"))?void 0:u.startsWith("cc-"))||m.creditCard.test(e)?"**** **** **** "+e.slice(-4):a.hasAttribute("data-ssn")||m.ssn.test(e)?"***-**-"+e.slice(-4):a.hasAttribute("data-dob")?"**/**/"+e.slice(-4):e}const getUrlAndStoredUuids=()=>({page_visit_uuid:sessionStorage.getItem("pageVisitUUID"),prev_page_visit_uuid:sessionStorage.getItem("prevPageVisitUUID"),href:location.origin+location.pathname});function initializeDomContentEvents(e){document.addEventListener("readystatechange",()=>{const a={type:24,data:{source:0,info:""},timestamp:Date.now(),sessionId:e,...getUrlAndStoredUuids()};switch(document.readyState){case"loading":a.data.source=S;break;case"complete":a.data.source=x}a.data.info&&sendEvent(a)}),document.addEventListener("DOMContentLoaded",()=>{sendEvent({type:24,data:{source:C},timestamp:Date.now(),sessionId:e,...getUrlAndStoredUuids()})}),window.addEventListener("beforeunload",()=>{sendEvent({type:24,data:{source:I},timestamp:Date.now(),sessionId:e,...getUrlAndStoredUuids()})}),window.addEventListener("unload",()=>{sendEvent({type:24,data:{source:_},timestamp:Date.now(),sessionId:e,...getUrlAndStoredUuids()})})}function initializeConsolePlugin(e,a){const{name:u,observer:m}=(e=>({name:"@sailfish-rrweb/rrweb/console@1",observer:R,options:e}))(e);m(e=>{sendEvent({type:Ju.Plugin,timestamp:Date.now(),data:{plugin:u,payload:e},sessionId:a,...getUrlAndStoredUuids()})},window,e)}async function initializeRecording(e,a,u,m){const w=initializeWebSocket(a,u,m);try{ae({emit(e){Object.assign(e,getUrlAndStoredUuids()),e.sessionId=m,sendEvent(e)},maskInputOptions:{text:!0},maskInputFn:maskInputFn,maskTextClass:"sailfishSanitize",...e}),function whenZendeskReady(e){if("undefined"==typeof window)return;const a=window.zE;if("function"==typeof a)try{a(e)}catch{}}(()=>{suppressConsoleLogsDuringCall(()=>{zE_safe("messenger:set","conversationTags",[`sailfish-session-${m}`])});const handleWidgetOpen=()=>{ae.addSailfishEvent(Ju.SailfishCustom,{action:"customer support chat opened",element_id:Xu,provider:Qu})},handleWidgetClose=()=>{ae.addSailfishEvent(Ju.SailfishCustom,{action:"customer support chat closed",element_id:Xu,provider:Qu})},handleUnreadMessages=e=>{ae.addSailfishEvent(Ju.SailfishCustom,{action:"zendesk unreadmessages",element_id:Xu,provider:Qu})};suppressConsoleLogsDuringCall(()=>{zE_safe("messenger:on","open",handleWidgetOpen),zE_safe("messenger:on","close",handleWidgetClose),zE_safe("messenger:on","unreadMessages",handleUnreadMessages)})})}catch(e){console.error("Error importing plugins!",e)}return w}let ep=null,tp=null;function identify(e,a={},u=!1){const m={type:"identify",userId:e,traits:a};ep&&ep.userId===e&&JSON.stringify(ep.traits)===JSON.stringify(a)||(ep={userId:e,traits:a,overwrite:u},sendMessage(m))}function addOrUpdateMetadata(e){const a={type:"addOrUpdateMetadata",metadata:e};tp&&JSON.stringify(tp)===JSON.stringify(e)||(tp=e,sendMessage(a))}function trackingEvent(e){sendMessage({type:"trackingEvent",trackingData:e,timestamp:X()})}const np=readDebugFlag(),rp=["t.co","*.twitter.com","*.gravatar.com","*.googleapis.com","*.amazonaws.com","*.smooch.io","*.zendesk.com","*.zdassets.com"],op=[400,403],sp="CORS",ip=1,ap={recordCanvas:!1,recordCrossOriginIframes:!1,collectFonts:!1,inlineImages:!1,recordPassword:!1,recordRealName:!0,recordCreditCardInfo:!1,recordSsn:!1,recordDob:!1,sampling:{}},lp={level:["info","log","warn","error"],lengthThreshold:1e4,stringifyOptions:{stringLengthLimit:1e3,numOfKeysLimit:20,depthOfLimit:4},logger:"console"};function trackDomainChangesOnce(){const e=window.__sailfish_recorder||(window.__sailfish_recorder={});if(e.routeWatcherIntervalId)return;let a=window.location.href.split("?")[0];const checkDomainChange=(e=!1)=>{const u=window.location.href.split("?")[0];if(e||u!==a){a=u;const e=v4(),m=sessionStorage.getItem("pageVisitUUID");sessionStorage.setItem("pageVisitUUID",e),sessionStorage.setItem("prevPageVisitUUID",m);sendMessage({type:"routeChange",data:{url:u,timestamp:Date.now(),page_visit_uuid:e,prev_page_visit_uuid:m}})}},u=function debounce(e,a){let u;return function(...m){clearTimeout(u),u=setTimeout(()=>e(...m),a)}}(()=>checkDomainChange(),500);checkDomainChange(!0),e.routeWatcherIntervalId=window.setInterval(u,1e3)}function matchUrlWithWildcard(e,a){let u,m;if("string"==typeof e?u=e:"undefined"!=typeof URL&&e instanceof URL?u=e.href:"undefined"!=typeof Request&&e instanceof Request?u=e.url:null!=e&&"function"==typeof e.toString&&(u=e.toString()),!u)return!1;try{const e="undefined"!=typeof window?window.location.href:"http://localhost/";m=new URL(u,e)}catch{return!1}const{hostname:w,pathname:b,port:S,protocol:C}=m;if(!/^https?:$/.test(C))return!1;const x=w.startsWith("www.")?w.slice(4).toLowerCase():w.toLowerCase();return a.some(e=>{const a=String(e||"").replace(/^[a-zA-Z]+:\/\//,"");let[u,m]=a.split("/",2),w="";u.includes(":")&&([u,w]=u.split(":"));const C=u.replace(/\./g,"\\.").replace(/\*/g,".*"),I=new RegExp(`^${C}$`,"i"),_=x.startsWith("www.")?x.slice(4):x;if(w&&S!==w)return!1;if(u.startsWith("*.")){const e=u.slice(2).toLowerCase();if(!(x===e||_===e||x.endsWith("."+e)))return!1;if(m){const e=m.replace(/\*/g,".*").replace(/\/$/,"");return new RegExp(`^/${e}`,"i").test(b)}return!0}if(!I.test(_)&&!I.test(x))return!1;if(m){const e=m.replace(/\*/g,".*").replace(/\/$/,"");return new RegExp(`^/${e}`,"i").test(b)}return!0})}function shouldSkipHeadersPropagation(e,a=[]){let u;try{u=new URL("string"==typeof e?e:String((null==e?void 0:e.url)??e),window.location.href)}catch{return!0}for(const e of O)if(u.pathname.toLowerCase().endsWith(e))return!0;return!!matchUrlWithWildcard(e,[...rp,...a])}function setupFetchInterceptor(e=[]){const a=window.fetch,u=getOrSetSessionId();window.fetch=new Proxy(a,{apply:async(a,m,w)=>{let S,C=w[0],x=w[1]||{};if("string"==typeof C)S=C;else if(C instanceof Request)S=C.url;else{if(!(C instanceof URL))return a.apply(m,w);S=C.href}return shouldSkipHeadersPropagation(S,e)?a.apply(m,w):async function injectHeaderWrapper(e,a,u,m,w,S,C){var x,I;if(!S)return e.apply(a,u);const _=v4(),O=getUrlAndStoredUuids(),E=w.method||"GET",D=Date.now();try{let x=await async function injectHeader(e,a,u,m,w,S,C){if(u instanceof Request){const x=u.clone(),I=new Headers(x.headers);I.set(b,`${w}/${S}/${C}`);const _=new Request(x,{headers:I});return await e.call(a,_,m)}{const x={...m},I=new Headers(m.headers||{});return I.set(b,`${w}/${S}/${C}`),x.headers=I,await e.call(a,u,x)}}(e,a,m,w,S,O.page_visit_uuid,_),I=!1;op.includes(x.status)&&(np&&console.log("Perform retry as status was fail:",x),x=await async function retryWithoutPropagateHeaders(e,a,u,m){try{let m=u[0],w=u[1]||{};if("string"==typeof m||m instanceof URL){const u={...w},S=new Headers(w.headers||{});S.delete(b),u.headers=S;return await e.call(a,m,u)}if(m instanceof Request){const u=m.clone(),S=new Headers(u.headers);S.delete(b);const C=new Request(u,{headers:S});return await e.call(a,C,w)}return e.apply(a,u)}catch(e){throw np&&console.log(`Retry without ${b} for ${m} also failed:`,e),e}}(e,a,u,C),I=!0);const F=Date.now(),U=x.status,$=x.ok,B=$?"":`Request Error: ${x.statusText}`;return sendEvent({type:27,timestamp:F,sessionId:S,data:{request_id:_,session_id:S,timestamp_start:D,timestamp_end:F,response_code:U,success:$,error:B,method:E,url:C,retry_without_trace_id:I},...O}),x}catch(m){const w=Date.now(),b=!1,F=(null==(x=m.response)?void 0:x.status)||500,U=m.message||"Fetch request failed";if(m instanceof TypeError&&(null==(I=null==m?void 0:m.message)?void 0:I.toLowerCase().includes(sp.toLowerCase())))return e.apply(a,u);throw sendEvent({type:27,timestamp:w,sessionId:S,data:{request_id:_,session_id:S,timestamp_start:D,timestamp_end:w,response_code:F,success:b,error:U,method:E,url:C},...O}),m}}(a,m,w,C,x,u,S)}})}async function startRecording({apiKey:e,backendApi:a="https://api-service.sailfishqa.com",domainsToPropagateHeaderTo:u=[],domainsToNotPropagateHeaderTo:m=[],serviceVersion:w,serviceIdentifier:S,gitSha:C,serviceAdditionalMetadata:x}){var I,_;const O=C??function readGitSha(){var e;try{const e=globalThis;if("string"==typeof e.__GIT_SHA__&&e.__GIT_SHA__)return e.__GIT_SHA__}catch{}try{const a="undefined"!=typeof process?process:void 0;if(null==(e=null==a?void 0:a.env)?void 0:e.GIT_SHA)return String(a.env.GIT_SHA)}catch{}try{const e=globalThis.__GIT_SHA_DEFINE__;if("string"==typeof e&&e)return e}catch{}}(),E=S??"",D=w??"",F=function getMapUuidFromWindow(){try{const e=window;if(e&&"string"==typeof e.sfMapUuid&&e.sfMapUuid)return e.sfMapUuid}catch{}}(),U=getOrSetSessionId(),$=window.__sailfish_recorder||(window.__sailfish_recorder={});if($.sessionId=U,$.apiKey=e,$.backendApi=a,$.initialized&&$.sessionId===U&&$.ws&&1===$.ws.readyState)trackDomainChangesOnce();else{$.domEventsInit||(initializeDomContentEvents(U),$.domEventsInit=!0),$.consoleInit||(initializeConsolePlugin(lp,U),$.consoleInit=!0),$.errorInit||(!function initializeErrorInterceptor(){window.addEventListener("error",e=>{captureError(e.error||e.message)}),window.addEventListener("unhandledrejection",e=>{captureError(e.reason,!0)})}(),$.errorInit=!0),function storeCredentialsAndConnection({apiKey:e,backendApi:a}){J&&(sessionStorage.setItem("sailfishApiKey",e),sessionStorage.setItem("sailfishBackendApi",a))}({apiKey:e,backendApi:a}),trackDomainChangesOnce(),sessionStorage.setItem("sailfishApiKey",e),sessionStorage.setItem("sailfishBackendApi",a),$.sentDoNotPropagateOnce||(sendDomainsToNotPropagateHeaderTo(e,[...m,...rp],a).catch(e=>console.error("Failed to send domains to not propagate header to:",e)),$.sentDoNotPropagateOnce=!0),$.xhrPatched||(!function setupXMLHttpRequestInterceptor(e=[]){const a=XMLHttpRequest.prototype.open,u=XMLHttpRequest.prototype.send,m=XMLHttpRequest.prototype.setRequestHeader,w=getOrSetSessionId();XMLHttpRequest.prototype.setRequestHeader=function(e,a){return this._capturedRequestHeaders||(this._capturedRequestHeaders={}),this._capturedRequestHeaders[e]=a,m.call(this,e,a)},XMLHttpRequest.prototype.open=function(e,u,...m){return this._requestUrl="string"==typeof u&&u.length>0?u:null,this._requestMethod=e,this._capturedRequestHeaders={},a.apply(this,[e,u,...m])},XMLHttpRequest.prototype.send=function(...a){const m=this._requestUrl;if(!m)return u.apply(this,a);if(shouldSkipHeadersPropagation(m,e))return u.apply(this,a);const S=sessionStorage.getItem("pageVisitUUID"),C=v4(),x=`${w}/${S}/${C}`;try{this.setRequestHeader(b,x)}catch(e){console.warn(`Could not set X-Sf3-Rid for ${m}`,e)}const I=Date.now();let _=!1;const emitFinished=(e,a,u)=>{if(_)return;_=!0;const b=Date.now();sendEvent({type:27,timestamp:b,sessionId:w,data:{request_id:C,session_id:w,timestamp_start:I,timestamp_end:b,response_code:a,success:e,error:u,method:this._requestMethod,url:m},...getUrlAndStoredUuids()})};return this.addEventListener("load",()=>{const e=this.status||0;if(e>=200&&e<300)emitFinished(!0,e,"");else{const a=this.statusText||`HTTP ${e}`;emitFinished(!1,e,a)}},{once:!0}),this.addEventListener("error",()=>{const e=this.status||0,a=0===e?"Network or CORS failure":this.statusText||`Error ${e}`;emitFinished(!1,e,a)},{once:!0}),u.apply(this,a)}}(m),$.xhrPatched=!0),$.fetchPatched||(setupFetchInterceptor(m),$.fetchPatched=!0),async function gatherAndCacheDeviceInfo(){sendMessage({type:"deviceInfo",data:{deviceInfo:{language:navigator.language,userAgent:navigator.userAgent}}})}();try{const u=(null==(I=(await fetchCaptureSettings(e,a)).data)?void 0:I.captureSettingsFromApiKey)||ap;if($.ws&&1===$.ws.readyState)return;const m=withAppUrlMetadata(x),b=await startRecordingSession(e,U,a,E,D,F,O,"JS/TS",m);if(null==(_=b.data)?void 0:_.startRecordingSession){const m=await initializeRecording(u,a,e,U);$.ws=m,$.initialized=!0,$.sentMapUuidOnce||(!function sendMapUuidIfAvailable(e="",a=""){window.sfMapUuid&&sendMessage({type:"mapUuid",data:{mapUuid:window.sfMapUuid,serviceIdentifier:e,serviceVersion:a}})}(S,w),$.sentMapUuidOnce=!0)}else console.error("Failed to start recording session:",b.errors||b)}catch(e){console.error("Error starting recording:",e)}}}q&&(!function sendUserDeviceUuid(){sendMessage({type:"userDeviceUuid",userDeviceUuid:function getOrSetUserDeviceUuid(){let e=null;if(Y)try{e=localStorage.getItem("sailfishUserDeviceUuid")}catch{}if(!e){e=v4();try{Y&&localStorage.setItem("sailfishUserDeviceUuid",e)}catch{}}return e}()})}(),function sendTimeZone(){sendMessage({type:"timeZone",timezone:Intl.DateTimeFormat().resolvedOptions().timeZone})}()),H&&document.addEventListener("visibilitychange",function handleVisibilityChange(){"visible"===document.visibilityState&&getOrSetSessionId()}),q&&window.addEventListener("beforeunload",()=>{window.name="",function clearPageVisitUuid(){J&&(sessionStorage.removeItem("pageVisitUUID"),sessionStorage.removeItem("prevPageVisitUUID"))}()});const initRecorder=async e=>{if("undefined"==typeof window)return;const a=window.__sailfish_recorder||(window.__sailfish_recorder={}),u=getOrSetSessionId();return a.initialized&&a.sessionId===u&&a.ws&&1===a.ws.readyState?void 0:(a.initPromise||(a.initPromise=(async()=>{a.hasLoggedInitOnce||(console.log("Initializing Sailfish Recorder (first run) …"),a.hasLoggedInitOnce=!0),await startRecording(e),a.issueReportingInit||(setupIssueReporting({apiKey:e.apiKey,backendApi:e.backendApi??"https://api-service.sailfishqa.com",getSessionId:()=>getOrSetSessionId(),shortcuts:e.reportIssueShortcuts,customBaseUrl:e.customBaseUrl}),a.issueReportingInit=!0)})().finally(()=>{delete a.initPromise})),a.initPromise)};export{ap as DEFAULT_CAPTURE_SETTINGS,lp as DEFAULT_CONSOLE_RECORDING_SETTINGS,ip as STORAGE_VERSION,addOrUpdateMetadata,buildBatches,createTriageFromRecorder,eventSize,fetchCaptureSettings,flushBufferedEvents,getUrlAndStoredUuids,identify,initRecorder,initializeConsolePlugin,initializeDomContentEvents,initializeRecording,initializeWebSocket,matchUrlWithWildcard,X as nowTimestamp,openReportIssueModal,sendDomainsToNotPropagateHeaderTo,sendEvent,sendGraphQLRequest,sendMessage,startRecording,startRecordingSession,trackingEvent,withAppUrlMetadata};