crexperium-sdk 1.2.5 → 1.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Crexperium={})}(this,function(e){"use strict";class t{constructor(e){if(e.apiToken)this.apiToken=e.apiToken;else{const e="undefined"!=typeof process&&process.env?process.env.CRX_API_TOKEN:void 0;if(!e)throw new Error("API token is required. Provide it via config.apiToken or CRX_API_TOKEN environment variable.");this.apiToken=e}this.baseUrl=e.baseUrl||"https://crxperium.applikuapp.com",this.timeout=e.timeout??3e4,this.maxRetries=e.maxRetries??3,this.retryDelay=e.retryDelay??1e3,this.autoPageView=e.autoPageView??!0,this.autoDeviceInfo=e.autoDeviceInfo??!0,this.persistVisitorId=e.persistVisitorId??!0,this.visitorIdKey=e.visitorIdKey||"crx_visitor_id",this.sessionReplay=e.sessionReplay,this.validate()}validate(){if(this.timeout<0)throw new Error("Timeout must be a positive number");if(this.maxRetries<0)throw new Error("Max retries must be a positive number");if(this.retryDelay<0)throw new Error("Retry delay must be a positive number");this.baseUrl.endsWith("/")&&(this.baseUrl=this.baseUrl.slice(0,-1))}}class r extends Error{constructor(e,t,s){super(e),this.response=t,this.statusCode=s,this.name="CRMError",Object.setPrototypeOf(this,r.prototype)}}class s extends r{constructor(e="Authentication failed",t){super(e,t,401),this.name="AuthenticationError",Object.setPrototypeOf(this,s.prototype)}}class n extends r{constructor(e="Resource not found",t){super(e,t,404),this.name="ResourceNotFoundError",Object.setPrototypeOf(this,n.prototype)}}class o extends r{constructor(e="Validation failed",t,r){super(e,r,400),this.errors=t,this.name="ValidationError",Object.setPrototypeOf(this,o.prototype)}}class i extends r{constructor(e="Rate limit exceeded",t,r){super(e,r,429),this.retryAfter=t,this.name="RateLimitError",Object.setPrototypeOf(this,i.prototype)}}class a extends r{constructor(e="Server error",t=500,r){super(e,r,t),this.name="ServerError",Object.setPrototypeOf(this,a.prototype)}}class l extends r{constructor(e="Network error",t){super(e),this.originalError=t,this.name="NetworkError",Object.setPrototypeOf(this,l.prototype)}}const c="undefined"!=typeof window;class h{constructor(e){this.config=e,this.headers={Authorization:`Bearer ${e.apiToken}`,"Content-Type":"application/json","User-Agent":"crexperium-ts-sdk/1.0.0"}}async request(e,t,r,i){const a=this.buildUrl(t,i);let c;for(let t=0;t<=this.config.maxRetries;t++)try{const t=await this.makeRequest(a,e,r);return await this.handleResponse(t)}catch(e){if(c=e,e instanceof s||e instanceof n||e instanceof o)throw e;if(t<this.config.maxRetries){const e=this.calculateRetryDelay(t);await this.sleep(e);continue}}throw c||new l("Request failed after retries")}async get(e,t){return this.request("GET",e,void 0,t)}async post(e,t){return this.request("POST",e,t)}async patch(e,t){return this.request("PATCH",e,t)}async put(e,t){return this.request("PUT",e,t)}async delete(e){return this.request("DELETE",e)}buildUrl(e,t){const r=e.startsWith("/")?e:`/${e}`;let s=`${this.config.baseUrl}${r}`;if(t){const e=new URLSearchParams;Object.entries(t).forEach(([t,r])=>{null!=r&&(Array.isArray(r)?r.forEach(r=>e.append(t,String(r))):e.append(t,String(r)))});const r=e.toString();r&&(s+=`?${r}`)}return s}async makeRequest(e,t,r){const s={method:t,headers:this.headers};r&&"GET"!==t&&(s.body=JSON.stringify(r));const n=new AbortController,o=setTimeout(()=>n.abort(),this.config.timeout);try{const t=function(){if(c&&void 0!==window.fetch)return window.fetch.bind(window);if(void 0!==globalThis.fetch)return globalThis.fetch.bind(globalThis);throw new Error("Fetch is not available. Please upgrade to Node.js 18+ which includes native fetch support. Alternatively, install and configure a polyfill.")}(),r=await t(e,{...s,signal:n.signal});return clearTimeout(o),r}catch(e){if(clearTimeout(o),"AbortError"===e.name)throw new l("Request timeout",e);throw new l("Network request failed",e)}}async handleResponse(e){if(e.ok){if(204===e.status)return{};try{return await e.json()}catch(t){throw new r("Invalid JSON response",e,e.status)}}let t;try{t=await e.json()}catch{t={detail:e.statusText}}const l=t.detail||t.message||"Request failed";switch(e.status){case 400:throw new o(l,t.errors||t,e);case 401:throw new s(l,e);case 404:throw new n(l,e);case 429:{const t=e.headers.get("Retry-After")||void 0;throw new i(l,t,e)}case 500:case 502:case 503:case 504:throw new a(l,e.status,e);default:throw e.status>=400&&e.status<500?new r(l,e,e.status):new a(l,e.status,e)}}calculateRetryDelay(e){return this.config.retryDelay*Math.pow(2,e)}sleep(e){return new Promise(t=>setTimeout(t,e))}}class u{constructor(e){this.http=e}cleanObject(e){const t={};return Object.entries(e).forEach(([e,r])=>{null!=r&&(r instanceof Date?t[e]=r.toISOString():t[e]=r)}),t}toSnakeCase(e){const t={};return Object.entries(e).forEach(([e,r])=>{const s=e.replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`);t[s]=r}),t}toCamelCase(e){const t={};return Object.entries(e).forEach(([e,r])=>{const s=e.replace(/_([a-z])/g,(e,t)=>t.toUpperCase());t[s]=r}),t}}class p extends u{async track(e){const t=this.cleanObject(this.toSnakeCase(e));if(!t.event_key)throw new Error("eventKey is required");return this.http.post("/api/v1/events/track/",t)}async trackBatch(e){if(!e||0===e.length)throw new Error("Events array cannot be empty");if(e.length>100)throw new Error("Cannot track more than 100 events in a single batch");const t=e.map(e=>this.cleanObject(this.toSnakeCase(e)));return this.http.post("/api/v1/events/batch/",{events:t})}async get(e){if(!e)throw new Error("Event ID is required");return this.http.get(`/api/v1/events/${e}/`)}async list(e){const t=e?this.cleanObject(this.toSnakeCase(e)):void 0;return this.http.get("/api/v1/events/",t)}async stats(e=30){if(e<1)throw new Error("Days must be at least 1");return this.http.get("/api/v1/events/stats/",{days:e})}}class d extends u{async identify(e){if(!(e.externalId||e.visitorId||e.email||e.phone))throw new Error("At least one identifier is required: externalId, visitorId, email, or phone");const t=this.cleanObject(this.toSnakeCase(e));return this.http.post("/api/v1/contacts/identify/",t)}async create(e){if(!e.email&&!e.external_id)throw new Error("Either email or external_id is required");const t=this.cleanObject(this.toSnakeCase(e));return this.http.post("/api/v1/contacts/",t)}async get(e){if(!e)throw new Error("Contact ID is required");return this.http.get(`/api/v1/contacts/${e}/`)}async update(e,t){if(!e)throw new Error("Contact ID is required");const r=this.cleanObject(this.toSnakeCase(t));return this.http.patch(`/api/v1/contacts/${e}/`,r)}async list(e){const t=e?this.cleanObject(this.toSnakeCase(e)):void 0;return this.http.get("/api/v1/contacts/",t)}async delete(e){if(!e)throw new Error("Contact ID is required");return this.http.delete(`/api/v1/contacts/${e}/`)}}class f extends u{async create(e){if(!e.name)throw new Error("Deal name is required");const t=this.cleanObject(this.toSnakeCase(e));return this.http.post("/api/v1/deals/",t)}async get(e){if(!e)throw new Error("Deal ID is required");return this.http.get(`/api/v1/deals/${e}/`)}async update(e,t){if(!e)throw new Error("Deal ID is required");const r=this.cleanObject(this.toSnakeCase(t));return this.http.patch(`/api/v1/deals/${e}/`,r)}async moveStage(e,t){if(!e)throw new Error("Deal ID is required");if(!t)throw new Error("Stage ID is required");return this.http.post(`/api/v1/deals/${e}/move-stage/`,{pipeline_stage:t})}async list(e){const t=e?this.cleanObject(this.toSnakeCase(e)):void 0;return this.http.get("/api/v1/deals/",t)}async delete(e){if(!e)throw new Error("Deal ID is required");return this.http.delete(`/api/v1/deals/${e}/`)}}class m extends u{async get(e){return this.http.get(`/api/v1/experiments/${e}/`)}async assign(e,t){return this.http.post(`/api/v1/experiments/${e}/assign/`,t)}async trackConversion(e,t){await this.http.post(`/api/v1/experiments/${e}/convert/`,t)}async getVariant(e,t){return await this.assign(e,t)}}function g(){if("undefined"==typeof window||void 0===window.localStorage)return!1;try{const e="__crx_test__";return window.localStorage.setItem(e,"test"),window.localStorage.removeItem(e),!0}catch{return!1}}function y(e){if(!g())return null;try{return window.localStorage.getItem(e)}catch{return null}}function w(e,t){if(!g())return!1;try{return window.localStorage.setItem(e,t),!0}catch{return!1}}function v(){return"undefined"!=typeof crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}class b{constructor(e){this.config=e,this.visitorId=this.getOrCreateVisitorId()}getOrCreateVisitorId(){const e=y(this.config.visitorIdKey);if(e)return e;const t=v();return w(this.config.visitorIdKey,t),t}getVisitorId(){return this.visitorId}setVisitorId(e){this.visitorId=e,w(this.config.visitorIdKey,e)}resetVisitorId(){const e=v();return this.setVisitorId(e),e}destroy(){}}function S(e){const t=e.toLowerCase();return/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(t)?"tablet":/Mobile|Android|iP(hone|od)|IEMobile|BlackBerry|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(t)?"mobile":"desktop"}function C(e){const t=e;return t.indexOf("Edge")>-1||t.indexOf("Edg")>-1?"Edge":t.indexOf("Chrome")>-1?"Chrome":t.indexOf("Safari")>-1?"Safari":t.indexOf("Firefox")>-1?"Firefox":t.indexOf("MSIE")>-1||t.indexOf("Trident/")>-1?"IE":t.indexOf("Opera")>-1||t.indexOf("OPR")>-1?"Opera":"Unknown"}function I(e){const t=e;if(t.indexOf("Windows NT 10.0")>-1)return"Windows 10";if(t.indexOf("Windows NT 6.3")>-1)return"Windows 8.1";if(t.indexOf("Windows NT 6.2")>-1)return"Windows 8";if(t.indexOf("Windows NT 6.1")>-1)return"Windows 7";if(t.indexOf("Windows NT 6.0")>-1)return"Windows Vista";if(t.indexOf("Windows NT 5.1")>-1)return"Windows XP";if(t.indexOf("Win")>-1)return"Windows";if(t.indexOf("Mac OS X 10_15")>-1)return"macOS Catalina";if(t.indexOf("Mac OS X 10_14")>-1)return"macOS Mojave";if(t.indexOf("Mac OS X 10_13")>-1)return"macOS High Sierra";if(t.indexOf("Mac")>-1)return"macOS";if(t.indexOf("Android")>-1){const e=t.match(/Android (\d+(\.\d+)?)/);return e?`Android ${e[1]}`:"Android"}if(t.indexOf("like Mac OS X")>-1){const e=t.match(/OS (\d+)_(\d+)/);return e?`iOS ${e[1]}.${e[2]}`:"iOS"}return t.indexOf("Linux")>-1?"Linux":t.indexOf("Ubuntu")>-1?"Ubuntu":t.indexOf("CrOS")>-1?"Chrome OS":"Unknown"}function k(){if("undefined"==typeof navigator)return{userAgent:"",deviceType:"desktop",browser:"Unknown",os:"Unknown"};const e=navigator.userAgent;return{userAgent:e,deviceType:S(e),browser:C(e),os:I(e)}}class x{constructor(){this.deviceInfo=k()}getDeviceInfo(){return this.deviceInfo}getDeviceType(){return this.deviceInfo.deviceType}getBrowser(){return this.deviceInfo.browser}getOS(){return this.deviceInfo.os}getUserAgent(){return this.deviceInfo.userAgent}destroy(){}}class O{constructor(e){this.client=e,this.previousUrl="undefined"!=typeof window?window.location.href:"",this.trackPageView(),this.initHistoryTracking()}trackPageView(){if("undefined"==typeof window||!this.client.events)return;const e=window.location.href;if(e===this.previousUrl)return;this.previousUrl=e;const t=this.client.visitorId?.getVisitorId?.()||void 0,r=this.client.deviceInfo?.getDeviceInfo?.();this.client.events.track({eventKey:"page_view",visitorId:t,pageUrl:window.location.href,pageTitle:document.title,referrer:document.referrer||void 0,userAgent:r?.userAgent,deviceType:r?.deviceType,browser:r?.browser,os:r?.os}).catch(e=>{console.error("[AutoPageView] Failed to track page view:",e)})}initHistoryTracking(){"undefined"!=typeof window&&"undefined"!=typeof history&&(this.originalPushState=history.pushState,this.originalReplaceState=history.replaceState,history.pushState=(...e)=>{this.originalPushState.apply(history,e),this.trackPageView()},history.replaceState=(...e)=>{this.originalReplaceState.apply(history,e),this.trackPageView()},this.popStateHandler=()=>{this.trackPageView()},window.addEventListener("popstate",this.popStateHandler))}destroy(){"undefined"!=typeof window&&"undefined"!=typeof history&&(this.originalPushState&&(history.pushState=this.originalPushState),this.originalReplaceState&&(history.replaceState=this.originalReplaceState),this.popStateHandler&&window.removeEventListener("popstate",this.popStateHandler))}}var E,R=Object.defineProperty,M=(e,t,r)=>((e,t,r)=>t in e?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),A=Object.defineProperty,T=(e,t,r)=>((e,t,r)=>t in e?A(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),N=(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))(N||{});const P={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},D={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},L={};function F(e){if(L[e])return L[e];const t=globalThis[e],r=t.prototype,s=e in P?P[e]:void 0,n=Boolean(s&&s.every(e=>{var t,s;return Boolean(null==(s=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:s.toString().includes("[native code]"))})),o=e in D?D[e]:void 0,i=Boolean(o&&o.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(n&&i&&!globalThis.Zone)return L[e]=t.prototype,t.prototype;try{const s=document.createElement("iframe");document.body.appendChild(s);const n=s.contentWindow;if(!n)return t.prototype;const o=n[e].prototype;return document.body.removeChild(s),o?L[e]=o:r}catch{return r}}const _={};function U(e,t,r){var s;const n=`${e}.${String(r)}`;if(_[n])return _[n].call(t);const o=F(e),i=null==(s=Object.getOwnPropertyDescriptor(o,r))?void 0:s.get;return i?(_[n]=i,i.call(t)):t[r]}const B={};function j(e,t,r){const s=`${e}.${String(r)}`;if(B[s])return B[s].bind(t);const n=F(e)[r];return"function"!=typeof n?t[r]:(B[s]=n,n.bind(t))}const W={childNodes:function(e){return U("Node",e,"childNodes")},parentNode:function(e){return U("Node",e,"parentNode")},parentElement:function(e){return U("Node",e,"parentElement")},textContent:function(e){return U("Node",e,"textContent")},contains:function(e,t){return j("Node",e,"contains")(t)},getRootNode:function(e){return j("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?U("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?U("Element",e,"shadowRoot"):null},querySelector:function(e,t){return U("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return U("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return F("MutationObserver").constructor}};function z(e){return e.nodeType===e.ELEMENT_NODE}function V(e){const t=e&&"host"in e&&"mode"in e&&W.host(e)||null;return Boolean(t&&"shadowRoot"in t&&W.shadowRoot(t)===e)}function G(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Z(e){try{const r=e.rules||e.cssRules;if(!r)return null;let s=e.href;!s&&e.ownerNode&&e.ownerNode.ownerDocument&&(s=e.ownerNode.ownerDocument.location.href);const n=Array.from(r,e=>Y(e,s)).join("");return(t=n).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}catch(e){return null}var t}function Y(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=Z(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const r=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(r){t=e.cssText}return e.styleSheet.href?se(t,e.styleSheet.href):t}{let r=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(r=function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(r)),t?se(r,t):r}}class X{constructor(){T(this,"idNodeMap",new Map),T(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){const r=this.getNode(e);if(r){const e=this.nodeMetaMap.get(r);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function H({element:e,maskInputOptions:t,tagName:r,type:s,value:n,maskInputFn:o}){let i=n||"";const a=s&&J(s);return(t[r.toLowerCase()]||a&&t[a])&&(i=o?o(i,e):"*".repeat(i.length)),i}function J(e){return e.toLowerCase()}const $="__rrweb_original__";function K(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?J(t):null}function q(e,t){let r;try{r=new URL(e,t??window.location.href)}catch(e){return null}const s=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==s?void 0:s[1])??null}const Q=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ee=/^(?:[a-z+]+:)?\/\//i,te=/^www\..*/i,re=/^(data:)([^,]*),(.*)/i;function se(e,t){return(e||"").replace(Q,(e,r,s,n,o,i)=>{const a=s||o||i,l=r||n||"";if(!a)return e;if(ee.test(a)||te.test(a))return`url(${l}${a}${l})`;if(re.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${l})`;const c=t.split("/"),h=a.split("/");c.pop();for(const e of h)"."!==e&&(".."===e?c.pop():c.push(e));return`url(${l}${c.join("/")}${l})`})}function ne(e){return e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function oe(e,t){return function(e,t){const r=Array.from(t.childNodes),s=[];if(r.length>1&&e&&"string"==typeof e){const t=ne(e);for(let n=1;n<r.length;n++)if(r[n].textContent&&"string"==typeof r[n].textContent){const o=ne(r[n].textContent);for(let r=3;r<o.length;r++){const n=o.substring(0,r);if(2===t.split(n).length){const r=t.indexOf(n);for(let t=r;t<e.length;t++)if(ne(e.substring(0,t)).length===r){s.push(e.substring(0,t)),e=e.substring(t);break}break}}}}return s.push(e),s}(e,t).join("/* rr_split */")}let ie=1;const ae=new RegExp("[^a-z0-9-_:]");function le(){return ie++}let ce,he;const ue=/^[^ \t\n\r\u000c]+/,pe=/^[, \t\n\r\u000c]+/;const de=new WeakMap;function fe(e,t){return t&&""!==t.trim()?ge(e,t):t}function me(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function ge(e,t){let r=de.get(e);if(r||(r=e.createElement("a"),de.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function ye(e,t,r,s){return s?"src"===r||"href"===r&&("use"!==t||"#"!==s[0])||"xlink:href"===r&&"#"!==s[0]?fe(e,s):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;let r=0;function s(e){let s;const n=e.exec(t.substring(r));return n?(s=n[0],r+=s.length,s):""}const n=[];for(;s(pe),!(r>=t.length);){let o=s(ue);if(","===o.slice(-1))o=fe(e,o.substring(0,o.length-1)),n.push(o);else{let s="";o=fe(e,o);let i=!1;for(;;){const e=t.charAt(r);if(""===e){n.push((o+s).trim());break}if(i)")"===e&&(i=!1);else{if(","===e){r+=1,n.push((o+s).trim());break}"("===e&&(i=!0)}s+=e,r+=1}}}return n.join(", ")}(e,s):"style"===r?se(s,ge(e)):"object"===t&&"data"===r?fe(e,s):s:fe(e,s):s}function we(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function ve(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&ve(W.parentNode(e),t,r);for(let r=e.classList.length;r--;){const s=e.classList[r];if(t.test(s))return!0}return!!r&&ve(W.parentNode(e),t,r)}function be(e,t,r,s){let n;if(z(e)){if(n=e,!W.childNodes(n).length)return!1}else{if(null===W.parentElement(e))return!1;n=W.parentElement(e)}try{if("string"==typeof t){if(s){if(n.closest(`.${t}`))return!0}else if(n.classList.contains(t))return!0}else if(ve(n,t,s))return!0;if(r)if(s){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(e){}return!1}function Se(e,t){const{doc:r,mirror:s,blockClass:n,blockSelector:o,needsMask:i,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:h,dataURLOptions:u={},inlineImages:p,recordCanvas:d,keepIframeSrcFn:f,newlyAddedElement:m=!1,cssCaptured:g=!1}=t,y=function(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return 1===r?void 0:r}(r,s);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:N.Document,childNodes:[],compatMode:e.compatMode}:{type:N.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:N.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return function(e,t){const{doc:r,blockClass:s,blockSelector:n,inlineStylesheet:o,maskInputOptions:i={},maskInputFn:a,dataURLOptions:l={},inlineImages:c,recordCanvas:h,keepIframeSrcFn:u,newlyAddedElement:p=!1,rootId:d}=t,f=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let r=e.classList.length;r--;){const s=e.classList[r];if(t.test(s))return!0}if(r)return e.matches(r)}catch(e){}return!1}(e,s,n),m=function(e){if(e instanceof HTMLFormElement)return"form";const t=J(e.tagName);return ae.test(t)?"div":t}(e);let g={};const y=e.attributes.length;for(let t=0;t<y;t++){const s=e.attributes[t];we(m,s.name,s.value)||(g[s.name]=ye(r,m,J(s.name),s.value))}if("link"===m&&o){const t=Array.from(r.styleSheets).find(t=>t.href===e.href);let s=null;t&&(s=Z(t)),s&&(delete g.rel,delete g.href,g._cssText=s)}if("style"===m&&e.sheet){let t=Z(e.sheet);t&&(e.childNodes.length>1&&(t=oe(t,e)),g._cssText=t)}if("input"===m||"textarea"===m||"select"===m){const t=e.value,r=e.checked;"radio"!==g.type&&"checkbox"!==g.type&&"submit"!==g.type&&"button"!==g.type&&t?g.value=H({element:e,type:K(e),tagName:m,value:t,maskInputOptions:i,maskInputFn:a}):r&&(g.checked=r)}"option"===m&&(e.selected&&!i.select?g.selected=!0:delete g.selected);"dialog"===m&&e.open&&(g.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===m&&h)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let r=0;r<e.width;r+=50)for(let s=0;s<e.height;s+=50){const n=t.getImageData,o=$ in n?n[$]:n;if(new Uint32Array(o.call(t,r,s,Math.min(50,e.width-r),Math.min(50,e.height-s)).data.buffer).some(e=>0!==e))return!1}return!0})(e)||(g.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){const t=e.toDataURL(l.type,l.quality),s=r.createElement("canvas");s.width=e.width,s.height=e.height;t!==s.toDataURL(l.type,l.quality)&&(g.rr_dataURL=t)}if("img"===m&&c){ce||(ce=r.createElement("canvas"),he=ce.getContext("2d"));const t=e,s=t.currentSrc||t.getAttribute("src")||"<unknown-src>",n=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{ce.width=t.naturalWidth,ce.height=t.naturalHeight,he.drawImage(t,0,0),g.rr_dataURL=ce.toDataURL(l.type,l.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o));console.warn(`Cannot inline img src=${s}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(n?g.crossOrigin=n:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}if("audio"===m||"video"===m){const t=g;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}p||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop));if(f){const{width:t,height:r}=e.getBoundingClientRect();g={class:g.class,rr_width:`${t}px`,rr_height:`${r}px`}}"iframe"!==m||u(g.src)||(e.contentDocument||(g.rr_src=g.src),delete g.src);let w;try{customElements.get(m)&&(w=!0)}catch(e){}return{type:N.Element,tagName:m,attributes:g,childNodes:[],isSVG:me(e)||void 0,needBlock:f,rootId:d,isCustom:w}}(e,{doc:r,blockClass:n,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:h,dataURLOptions:u,inlineImages:p,recordCanvas:d,keepIframeSrcFn:f,newlyAddedElement:m,rootId:y});case e.TEXT_NODE:return function(e,t){const{needsMask:r,maskTextFn:s,rootId:n,cssCaptured:o}=t,i=W.parentNode(e),a=i&&i.tagName;let l="";const c="STYLE"===a||void 0,h="SCRIPT"===a||void 0;h?l="SCRIPT_PLACEHOLDER":o||(l=W.textContent(e),c&&l&&(l=se(l,ge(t.doc))));!c&&!h&&l&&r&&(l=s?s(l,W.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:N.Text,textContent:l||"",rootId:n}}(e,{doc:r,needsMask:i,maskTextFn:c,rootId:y,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:N.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:N.Comment,textContent:W.textContent(e)||"",rootId:y};default:return!1}}function Ce(e){return null==e?"":e.toLowerCase()}function Ie(e,t){const{doc:r,mirror:s,blockClass:n,blockSelector:o,maskTextClass:i,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:h={},maskTextFn:u,maskInputFn:p,slimDOMOptions:d,dataURLOptions:f={},inlineImages:m=!1,recordCanvas:g=!1,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:v=5e3,onStylesheetLoad:b,stylesheetLoadTimeout:S=5e3,keepIframeSrcFn:C=()=>!1,newlyAddedElement:I=!1,cssCaptured:k=!1}=t;let{needsMask:x}=t,{preserveWhiteSpace:O=!0}=t;if(!x){x=be(e,i,a,void 0===x)}const E=Se(e,{doc:r,mirror:s,blockClass:n,blockSelector:o,needsMask:x,inlineStylesheet:c,maskInputOptions:h,maskTextFn:u,maskInputFn:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,keepIframeSrcFn:C,newlyAddedElement:I,cssCaptured:k});if(!E)return console.warn(e,"not serialized"),null;let R;R=s.hasNode(e)?s.getId(e):function(e,t){if(t.comment&&e.type===N.Comment)return!0;if(e.type===N.Element){if(t.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"===q(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Ce(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Ce(e.attributes.name)||"icon"===Ce(e.attributes.rel)||"apple-touch-icon"===Ce(e.attributes.rel)||"shortcut icon"===Ce(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Ce(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Ce(e.attributes.property).match(/^(og|twitter|fb):/)||Ce(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Ce(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Ce(e.attributes.name)||"googlebot"===Ce(e.attributes.name)||"bingbot"===Ce(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Ce(e.attributes.name)||"generator"===Ce(e.attributes.name)||"framework"===Ce(e.attributes.name)||"publisher"===Ce(e.attributes.name)||"progid"===Ce(e.attributes.name)||Ce(e.attributes.property).match(/^article:/)||Ce(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Ce(e.attributes.name)||"yandex-verification"===Ce(e.attributes.name)||"csrf-token"===Ce(e.attributes.name)||"p:domain_verify"===Ce(e.attributes.name)||"verify-v1"===Ce(e.attributes.name)||"verification"===Ce(e.attributes.name)||"shopify-checkout-api-token"===Ce(e.attributes.name)))return!0}}return!1}(E,d)||!O&&E.type===N.Text&&!E.textContent.replace(/^\s+|\s+$/gm,"").length?-2:le();const M=Object.assign(E,{id:R});if(s.add(e,M),-2===R)return null;y&&y(e);let A=!l;if(M.type===N.Element){A=A&&!M.needBlock,delete M.needBlock;const t=W.shadowRoot(e);t&&G(t)&&(M.isShadowHost=!0)}if((M.type===N.Document||M.type===N.Element)&&A){d.headWhitespace&&M.type===N.Element&&"head"===M.tagName&&(O=!1);const t={doc:r,mirror:s,blockClass:n,blockSelector:o,needsMask:x,maskTextClass:i,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:h,maskTextFn:u,maskInputFn:p,slimDOMOptions:d,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:O,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:v,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C,cssCaptured:!1};if(M.type===N.Element&&"textarea"===M.tagName&&void 0!==M.attributes.value);else{M.type===N.Element&&void 0!==M.attributes._cssText&&"string"==typeof M.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(W.childNodes(e))){const e=Ie(r,t);e&&M.childNodes.push(e)}}let I=null;if(z(e)&&(I=W.shadowRoot(e)))for(const e of Array.from(W.childNodes(I))){const r=Ie(e,t);r&&(G(I)&&(r.isShadow=!0),M.childNodes.push(r))}}const T=W.parentNode(e);return T&&V(T)&&G(T)&&(M.isShadow=!0),M.type===N.Element&&"iframe"===M.tagName&&function(e,t,r){const s=e.contentWindow;if(!s)return;let n,o=!1;try{n=s.document.readyState}catch(e){return}if("complete"!==n){const s=setTimeout(()=>{o||(t(),o=!0)},r);return void e.addEventListener("load",()=>{clearTimeout(s),o=!0,t()})}const i="about:blank";if(s.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{const t=e.contentDocument;if(t&&w){const r=Ie(t,{doc:t,mirror:s,blockClass:n,blockSelector:o,needsMask:x,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:h,maskTextFn:u,maskInputFn:p,slimDOMOptions:d,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:O,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:v,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C});r&&w(e,r)}},v),M.type===N.Element&&"link"===M.tagName&&"string"==typeof M.attributes.rel&&("stylesheet"===M.attributes.rel||"preload"===M.attributes.rel&&"string"==typeof M.attributes.href&&"css"===q(M.attributes.href))&&function(e,t,r){let s,n=!1;try{s=e.sheet}catch(e){return}if(s)return;const o=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(o),n=!0,t()})}(e,()=>{if(b){const t=Ie(e,{doc:r,mirror:s,blockClass:n,blockSelector:o,needsMask:x,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:h,maskTextFn:u,maskInputFn:p,slimDOMOptions:d,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:O,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:v,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C});t&&b(e,t)}},S),M}function ke(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function xe(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,s.get?s:{enumerable:!0,get:function(){return e[t]}})}),r}var Oe={exports:{}},Ee=String,Re=function(){return{isColorSupported:!1,reset:Ee,bold:Ee,dim:Ee,italic:Ee,underline:Ee,inverse:Ee,hidden:Ee,strikethrough:Ee,black:Ee,red:Ee,green:Ee,yellow:Ee,blue:Ee,magenta:Ee,cyan:Ee,white:Ee,gray:Ee,bgBlack:Ee,bgRed:Ee,bgGreen:Ee,bgYellow:Ee,bgBlue:Ee,bgMagenta:Ee,bgCyan:Ee,bgWhite:Ee}};Oe.exports=Re(),Oe.exports.createColors=Re;var Me=Oe.exports;const Ae=xe(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Te=Me,Ne=Ae,Pe=class e extends Error{constructor(t,r,s,n,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),n&&(this.source=n),i&&(this.plugin=i),void 0!==r&&void 0!==s&&("number"==typeof r?(this.line=r,this.column=s):(this.line=r.line,this.column=r.column,this.endLine=s.line,this.endColumn=s.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=Te.isColorSupported),Ne&&e&&(t=Ne(t));let r,s,n=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,n.length),a=String(i).length;if(e){let{bold:e,gray:t,red:n}=Te.createColors(!0);r=t=>e(n(t)),s=e=>t(e)}else r=s=e=>e;return n.slice(o,i).map((e,t)=>{let n=o+1+t,i=" "+(" "+n).slice(-a)+" | ";if(n===this.line){let t=s(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+s(i)+e+"\n "+t+r("^")}return" "+s(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var De=Pe;Pe.default=Pe;var Le={};Le.isClean=Symbol("isClean"),Le.my=Symbol("my");const Fe={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let _e=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,s=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:s&&(r+=" "),e.nodes)this.block(e,r+s);else{let n=(e.raws.between||"")+(t?";":"");this.builder(r+s+n,e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let s=e.parent,n=0;for(;s&&"root"!==s.type;)n+=1,s=s.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<n;e++)r+=t}return r}block(e,t){let r,s=this.raw(e,"between","beforeOpen");this.builder(t+s+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let s=0;s<e.nodes.length;s++){let n=e.nodes[s],o=this.raw(n,"before");o&&this.builder(o),this.stringify(n,t!==s||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),s=e.prop+r+this.rawValue(e,"value");e.important&&(s+=e.raws.important||" !important"),t&&(s+=";"),this.builder(s,e)}document(e){this.body(e)}raw(e,t,r){let s;if(r||(r=t),t&&(s=e.raws[t],void 0!==s))return s;let n=e.parent;if("before"===r){if(!n||"root"===n.type&&n.first===e)return"";if(n&&"document"===n.type)return""}if(!n)return Fe[r];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[r])return o.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let n="raw"+((i=r)[0].toUpperCase()+i.slice(1));this[n]?s=this[n](o,e):o.walk(e=>{if(s=e.raws[t],void 0!==s)return!1})}var i;return void 0===s&&(s=Fe[r]),o.rawCache[r]=s,s}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let s=r.parent;if(s&&s!==e&&s.parent&&s.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let r=e[t],s=e.raws[t];return s&&s.value===r?s.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var Ue=_e;_e.default=_e;let Be=Ue;function je(e,t){new Be(t).stringify(e)}var We=je;je.default=je;let{isClean:ze,my:Ve}=Le,Ge=De,Ze=Ue,Ye=We;function Xe(e,t){let r=new e.constructor;for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;if("proxyCache"===s)continue;let n=e[s],o=typeof n;"parent"===s&&"object"===o?t&&(r[s]=t):"source"===s?r[s]=n:Array.isArray(n)?r[s]=n.map(e=>Xe(e,r)):("object"===o&&null!==n&&(n=Xe(n)),r[s]=n)}return r}let He=class{constructor(e={}){this.raws={},this[ze]=!1,this[Ve]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=Xe(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:s}=this.rangeBy(t);return this.source.input.error(e,{column:s.column,line:s.line},{column:r.column,line:r.line},t)}return new Ge(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[ze]){this[ze]=!1;let e=this;for(;e=e.parent;)e[ze]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let s=(t=this.toString()).indexOf(e.word);-1!==s&&(r=this.positionInside(s,t))}return r}positionInside(e,t){let r=t||this.toString(),s=this.source.start.column,n=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(s=1,n+=1):s+=1;return{column:s,line:n}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let s=this.toString(),n=s.indexOf(e.word);-1!==n&&(t=this.positionInside(n,s),r=this.positionInside(n+e.word.length,s))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new Ze).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let s of e)s===this?r=!0:r?(this.parent.insertAfter(t,s),t=s):this.parent.insertBefore(t,s);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},s=null==t;t=t||new Map;let n=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let s=this[e];if(Array.isArray(s))r[e]=s.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof s&&s.toJSON)r[e]=s.toJSON(null,t);else if("source"===e){let o=t.get(s.input);null==o&&(o=n,t.set(s.input,n),n++),r[e]={end:s.end,inputId:o,start:s.start}}else r[e]=s}return s&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Ye){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let s={node:this};for(let e in r)s[e]=r[e];return e.warn(t,s)}get proxyOf(){return this}};var Je=He;He.default=He;let $e=Je,Ke=class extends $e{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var qe=Ke;Ke.default=Ke;var Qe={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:et,SourceMapGenerator:tt}=Ae,{existsSync:rt,readFileSync:st}=Ae,{dirname:nt,join:ot}=Ae;let it=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,s=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=nt(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new et(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),s=e.indexOf("*/",r);r>-1&&s>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,s)))}loadFile(e){if(this.root=nt(e),rt(e))return this.mapFile=e,st(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof et)return tt.fromSourceMap(t).toString();if(t instanceof tt)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=ot(nt(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var at=it;it.default=it;let{SourceMapConsumer:lt,SourceMapGenerator:ct}=Ae,{fileURLToPath:ht,pathToFileURL:ut}=Ae,{isAbsolute:pt,resolve:dt}=Ae,{nanoid:ft}=Qe,mt=Ae,gt=De,yt=at,wt=Symbol("fromOffsetCache"),vt=Boolean(lt&&ct),bt=Boolean(dt&&pt),St=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!bt||/^\w+:\/\//.test(t.from)||pt(t.from)?this.file=t.from:this.file=dt(t.from)),bt&&vt){let e=new yt(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+ft(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let n,o,i;if(t&&"object"==typeof t){let e=t,s=r;if("number"==typeof e.offset){let s=this.fromOffset(e.offset);t=s.line,r=s.col}else t=e.line,r=e.column;if("number"==typeof s.offset){let e=this.fromOffset(s.offset);o=e.line,i=e.col}else o=s.line,i=s.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,i);return n=a?new gt(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,s.plugin):new gt(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:i,line:o},this.css,this.file,s.plugin),n.input={column:r,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(ut&&(n.input.url=ut(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,r;if(this[wt])r=this[wt];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let s=0,n=e.length;s<n;s++)r[s]=t,t+=e[s].length+1;this[wt]=r}t=r[r.length-1];let s=0;if(e>=t)s=r.length-1;else{let t,n=r.length-2;for(;s<n;)if(t=s+(n-s>>1),e<r[t])n=t-1;else{if(!(e>=r[t+1])){s=t;break}s=t+1}}return{col:e-r[s]+1,line:s+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:dt(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,s){if(!this.map)return!1;let n,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(n=i.originalPositionFor({column:s,line:r})),o=pt(a.source)?ut(a.source):new URL(a.source,this.map.consumer().sourceRoot||ut(this.map.mapFile));let l={column:a.column,endColumn:n&&n.column,endLine:n&&n.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!ht)throw new Error("file: protocol is not available in this PostCSS build");l.file=ht(o)}let c=i.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var Ct=St;St.default=St,mt&&mt.registerInput&&mt.registerInput(St);let{SourceMapConsumer:It,SourceMapGenerator:kt}=Ae,{dirname:xt,relative:Ot,resolve:Et,sep:Rt}=Ae,{pathToFileURL:Mt}=Ae,At=Ct,Tt=Boolean(It&&kt),Nt=Boolean(xt&&Et&&Ot&&Rt);var Pt=class{constructor(e,t,r,s){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=s,this.originalCSS=s,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),s=e.root||xt(e.file);!1===this.mapOpts.sourcesContent?(t=new It(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(s)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Nt&&Tt&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=kt.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new kt({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 kt({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,s=1,n="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=r,o.generated.column=s-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=i.match(/\n/g),e?(r+=e.length,t=i.lastIndexOf("\n"),s=i.length-t):s+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=s-2,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=s-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?xt(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=xt(Et(r,this.mapOpts.annotation)));let s=Ot(r,e);return this.memoizedPaths.set(e,s),s}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new At(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let s=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(s,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Mt){let t=Mt(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===Rt&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Dt=Je,Lt=class extends Dt{constructor(e){super(e),this.type="comment"}};var Ft=Lt;Lt.default=Lt;let _t,Ut,Bt,jt,{isClean:Wt,my:zt}=Le,Vt=qe,Gt=Ft,Zt=Je;function Yt(e){return e.map(e=>(e.nodes&&(e.nodes=Yt(e.nodes)),delete e.source,e))}function Xt(e){if(e[Wt]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Xt(t)}let Ht=class e extends Zt{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,s=this.getIterator();for(;this.indexes[s]<this.proxyOf.nodes.length&&(t=this.indexes[s],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[s]+=1;return delete this.indexes[s],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,s=this.index(e),n=this.normalize(t,this.proxyOf.nodes[s]).reverse();s=this.index(e);for(let e of n)this.proxyOf.nodes.splice(s+1,0,e);for(let e in this.indexes)r=this.indexes[e],s<r&&(this.indexes[e]=r+n.length);return this.markDirty(),this}insertBefore(e,t){let r,s=this.index(e),n=0===s&&"prepend",o=this.normalize(t,this.proxyOf.nodes[s],n).reverse();s=this.index(e);for(let e of o)this.proxyOf.nodes.splice(s,0,e);for(let e in this.indexes)r=this.indexes[e],s<=r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=Yt(_t(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new Vt(t)]}else if(t.selector)t=[new Ut(t)];else if(t.name)t=[new Bt(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Gt(t)]}return t.map(t=>(t[zt]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Wt]&&Xt(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(s=>{t.props&&!t.props.includes(s.prop)||t.fast&&!s.value.includes(t.fast)||(s.value=s.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let s;try{s=e(t,r)}catch(e){throw t.addToError(e)}return!1!==s&&t.walk&&(s=t.walk(e)),s})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if("atrule"===r.type&&e.test(r.name))return t(r,s)}):this.walk((r,s)=>{if("atrule"===r.type&&r.name===e)return t(r,s)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if("decl"===r.type&&e.test(r.prop))return t(r,s)}):this.walk((r,s)=>{if("decl"===r.type&&r.prop===e)return t(r,s)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if("rule"===r.type&&e.test(r.selector))return t(r,s)}):this.walk((r,s)=>{if("rule"===r.type&&r.selector===e)return t(r,s)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}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]}};Ht.registerParse=e=>{_t=e},Ht.registerRule=e=>{Ut=e},Ht.registerAtRule=e=>{Bt=e},Ht.registerRoot=e=>{jt=e};var Jt=Ht;Ht.default=Ht,Ht.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Bt.prototype):"rule"===e.type?Object.setPrototypeOf(e,Ut.prototype):"decl"===e.type?Object.setPrototypeOf(e,Vt.prototype):"comment"===e.type?Object.setPrototypeOf(e,Gt.prototype):"root"===e.type&&Object.setPrototypeOf(e,jt.prototype),e[zt]=!0,e.nodes&&e.nodes.forEach(e=>{Ht.rebuild(e)})};let $t,Kt,qt=Jt,Qt=class extends qt{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new $t(new Kt,this,e).stringify()}};Qt.registerLazyResult=e=>{$t=e},Qt.registerProcessor=e=>{Kt=e};var er=Qt;Qt.default=Qt;let tr={};var rr=function(e){tr[e]||(tr[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let sr=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var nr=sr;sr.default=sr;let or=nr,ir=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new or(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var ar=ir;ir.default=ir;const lr="'".charCodeAt(0),cr='"'.charCodeAt(0),hr="\\".charCodeAt(0),ur="/".charCodeAt(0),pr="\n".charCodeAt(0),dr=" ".charCodeAt(0),fr="\f".charCodeAt(0),mr="\t".charCodeAt(0),gr="\r".charCodeAt(0),yr="[".charCodeAt(0),wr="]".charCodeAt(0),vr="(".charCodeAt(0),br=")".charCodeAt(0),Sr="{".charCodeAt(0),Cr="}".charCodeAt(0),Ir=";".charCodeAt(0),kr="*".charCodeAt(0),xr=":".charCodeAt(0),Or="@".charCodeAt(0),Er=/[\t\n\f\r "#'()/;[\\\]{}]/g,Rr=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Mr=/.[\r\n"'(/\\]/,Ar=/[\da-f]/i;let Tr=Jt,Nr=class extends Tr{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 Pr=Nr;Nr.default=Nr,Tr.registerAtRule(Nr);let Dr,Lr,Fr=Jt,_r=class extends Fr{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let s=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of s)e.raws.before=t.raws.before;return s}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new Dr(new Lr,this,e).stringify()}};_r.registerLazyResult=e=>{Dr=e},_r.registerProcessor=e=>{Lr=e};var Ur=_r;_r.default=_r,Fr.registerRoot(_r);let Br={comma:e=>Br.split(e,[","],!0),space:e=>Br.split(e,[" ","\n","\t"]),split(e,t,r){let s=[],n="",o=!1,i=0,a=!1,l="",c=!1;for(let r of e)c?c=!1:"\\"===r?c=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?i+=1:")"===r?i>0&&(i-=1):0===i&&t.includes(r)&&(o=!0),o?(""!==n&&s.push(n.trim()),n="",o=!1):n+=r;return(r||""!==n)&&s.push(n.trim()),s}};var jr=Br;Br.default=Br;let Wr=Jt,zr=jr,Vr=class extends Wr{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return zr.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var Gr=Vr;Vr.default=Vr,Wr.registerRule(Vr);let Zr=qe,Yr=function(e,t={}){let r,s,n,o,i,a,l,c,h,u,p=e.css.valueOf(),d=t.ignoreErrors,f=p.length,m=0,g=[],y=[];function w(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=p.charCodeAt(m),r){case pr:case dr:case mr:case gr:case fr:s=m;do{s+=1,r=p.charCodeAt(s)}while(r===dr||r===pr||r===mr||r===gr||r===fr);u=["space",p.slice(m,s)],m=s-1;break;case yr:case wr:case Sr:case Cr:case xr:case Ir:case br:{let e=String.fromCharCode(r);u=[e,e,m];break}case vr:if(c=g.length?g.pop()[1]:"",h=p.charCodeAt(m+1),"url"===c&&h!==lr&&h!==cr&&h!==dr&&h!==pr&&h!==mr&&h!==fr&&h!==gr){s=m;do{if(a=!1,s=p.indexOf(")",s+1),-1===s){if(d||t){s=m;break}w("bracket")}for(l=s;p.charCodeAt(l-1)===hr;)l-=1,a=!a}while(a);u=["brackets",p.slice(m,s+1),m,s],m=s}else s=p.indexOf(")",m+1),o=p.slice(m,s+1),-1===s||Mr.test(o)?u=["(","(",m]:(u=["brackets",o,m,s],m=s);break;case lr:case cr:n=r===lr?"'":'"',s=m;do{if(a=!1,s=p.indexOf(n,s+1),-1===s){if(d||t){s=m+1;break}w("string")}for(l=s;p.charCodeAt(l-1)===hr;)l-=1,a=!a}while(a);u=["string",p.slice(m,s+1),m,s],m=s;break;case Or:Er.lastIndex=m+1,Er.test(p),s=0===Er.lastIndex?p.length-1:Er.lastIndex-2,u=["at-word",p.slice(m,s+1),m,s],m=s;break;case hr:for(s=m,i=!0;p.charCodeAt(s+1)===hr;)s+=1,i=!i;if(r=p.charCodeAt(s+1),i&&r!==ur&&r!==dr&&r!==pr&&r!==mr&&r!==gr&&r!==fr&&(s+=1,Ar.test(p.charAt(s)))){for(;Ar.test(p.charAt(s+1));)s+=1;p.charCodeAt(s+1)===dr&&(s+=1)}u=["word",p.slice(m,s+1),m,s],m=s;break;default:r===ur&&p.charCodeAt(m+1)===kr?(s=p.indexOf("*/",m+2)+1,0===s&&(d||t?s=p.length:w("comment")),u=["comment",p.slice(m,s+1),m,s],m=s):(Rr.lastIndex=m+1,Rr.test(p),s=0===Rr.lastIndex?p.length-1:Rr.lastIndex-2,u=["word",p.slice(m,s+1),m,s],g.push(u),m=s)}return m++,u},position:function(){return m}}},Xr=Ft,Hr=Pr,Jr=Ur,$r=Gr;const Kr={empty:!0,space:!0};let qr=Jt,Qr=class{constructor(e){this.input=e,this.root=new Jr,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,s,n=new Hr;n.name=e[1].slice(1),""===n.name&&this.unnamedAtrule(n,e),this.init(n,e[2]);let o=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){n.source.end=this.getPosition(e[2]),n.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(s=a.length-1,r=a[s];r&&"space"===r[0];)r=a[--s];r&&(n.source.end=this.getPosition(r[3]||r[2]),n.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(n.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(n,"params",a),o&&(e=a[a.length-1],n.source.end=this.getPosition(e[3]||e[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),i&&(n.nodes=[],this.current=n)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,s=0;for(let n=t-1;n>=0&&(r=e[n],"space"===r[0]||(s+=1,2!==s));n--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,s,n=0;for(let[o,i]of e.entries()){if(t=i,r=t[0],"("===r&&(n+=1),")"===r&&(n-=1),0===n&&":"===r){if(s){if("word"===s[0]&&"progid"===s[1])continue;return o}this.doubleColon(t)}s=t}return!1}comment(e){let t=new Xr;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=Yr(this.input)}decl(e,t){let r=new Zr;this.init(r,e[0][2]);let s,n=e[e.length-1];for(";"===n[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(n[3]||n[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],s=r[3]||r[2];if(s)return s}}(e)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(s=e.shift(),":"===s[0]){r.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),r.raws.between+=s[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(s=e[t],"!important"===s[1].toLowerCase()){r.important=!0;let s=this.stringFrom(e,t);s=this.spacesFromEnd(e)+s," !important"!==s&&(r.raws.important=s);break}if("important"===s[1].toLowerCase()){let s=e.slice(0),n="";for(let e=t;e>0;e--){let t=s[e][0];if(0===n.trim().indexOf("!")&&"space"!==t)break;n=s.pop()[1]+n}0===n.trim().indexOf("!")&&(r.important=!0,r.raws.important=n,e=s)}if("space"!==s[0]&&"comment"!==s[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(r,"value",i.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new $r;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,s=!1,n=null,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)n||(n=l),o.push("("===r?")":"]");else if(i&&s&&"{"===r)n||(n=l),o.push("}");else if(0===o.length){if(";"===r){if(s)return void this.decl(a,i);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(s=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(n=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&s){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,s){let n,o,i,a,l=r.length,c="",h=!0;for(let e=0;e<l;e+=1)n=r[e],o=n[0],"space"!==o||e!==l-1||s?"comment"===o?(a=r[e-1]?r[e-1][0]:"empty",i=r[e+1]?r[e+1][0]:"empty",Kr[a]||Kr[i]||","===c.slice(-1)?h=!1:c+=n[1]):c+=n[1]:h=!1;if(!h){let s=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:s,value:c}}e[t]=c}rule(e){e.pop();let t=new $r;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let s=t;s<e.length;s++)r+=e[s][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},es=Ct;function ts(e,t){let r=new es(e,t),s=new Qr(r);try{s.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return s.root}var rs=ts;ts.default=ts,qr.registerParse(ts);let{isClean:ss,my:ns}=Le,os=Pt,is=We,as=Jt,ls=er,cs=rr,hs=ar,us=rs,ps=Ur;const ds={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},fs={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},ms={Once:!0,postcssPlugin:!0,prepare:!0};function gs(e){return"object"==typeof e&&"function"==typeof e.then}function ys(e){let t=!1,r=ds[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function ws(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:ys(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function vs(e){return e[ss]=!1,e.nodes&&e.nodes.forEach(e=>vs(e)),e}let bs={},Ss=class e{constructor(t,r,s){let n;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof hs)n=vs(r.root),r.map&&(void 0===s.map&&(s.map={}),s.map.inline||(s.map.inline=!1),s.map.prev=r.map);else{let e=us;s.syntax&&(e=s.syntax.parse),s.parser&&(e=s.parser),e.parse&&(e=e.parse);try{n=e(r,s)}catch(e){this.processed=!0,this.error=e}n&&!n[ns]&&as.rebuild(n)}else n=vs(r);this.result=new hs(t,n,s),this.helpers={...bs,postcss:bs,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,s=this.result.processor.version,n=t.split("."),o=s.split(".");(n[0]!==o[0]||parseInt(n[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+s+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!fs[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!ms[r])if("object"==typeof t[r])for(let s in t[r])e(t,"*"===s?r:r+"-"+s.toLowerCase(),t[r][s]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(gs(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ss];){e[ss]=!0;let t=[ws(e)];for(;t.length>0;){let e=this.visitTick(t);if(gs(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return gs(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=is;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new os(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[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(gs(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ss];)e[ss]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||cs("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,s]of e){let e;this.result.lastPlugin=r;try{e=s(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(gs(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:s}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(s.length>0&&t.visitorIndex<s.length){let[e,n]=s[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===s.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return n(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let s,n=t.iterator;for(;s=r.nodes[r.indexes[n]];)if(r.indexes[n]+=1,!s[ss])return s[ss]=!0,void e.push(ws(s));t.iterator=0,delete r.indexes[n]}let n=t.events;for(;t.eventIndex<n.length;){let e=n[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[ss]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[ss]=!0;let t=ys(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[ss]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Ss.registerPostcss=e=>{bs=e};var Cs=Ss;Ss.default=Ss,ps.registerLazyResult(Ss),ls.registerLazyResult(Ss);let Is=Pt,ks=We,xs=rr,Os=rs;const Es=ar;let Rs=class{constructor(e,t,r){let s;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let n=ks;this.result=new Es(this._processor,s,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new Is(n,s,this._opts,t);if(i.isMap()){let[e,t]=i.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else i.clearAnnotation(),this.result.css=i.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||xs("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=Os;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Ms=Rs;Rs.default=Rs;let As=Ms,Ts=Cs,Ns=er,Ps=Ur,Ds=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new Ts(this,e,t):new As(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Ls=Ds;Ds.default=Ds,Ps.registerProcessor(Ds),Ns.registerProcessor(Ds);let Fs=qe,_s=at,Us=Ft,Bs=Pr,js=Ct,Ws=Ur,zs=Gr;function Vs(e,t){if(Array.isArray(e))return e.map(e=>Vs(e));let{inputs:r,...s}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:js.prototype};r.map&&(r.map={...r.map,__proto__:_s.prototype}),t.push(r)}}if(s.nodes&&(s.nodes=e.nodes.map(e=>Vs(e,t))),s.source){let{inputId:e,...r}=s.source;s.source=r,null!=e&&(s.source.input=t[e])}if("root"===s.type)return new Ws(s);if("decl"===s.type)return new Fs(s);if("rule"===s.type)return new zs(s);if("comment"===s.type)return new Us(s);if("atrule"===s.type)return new Bs(s);throw new Error("Unknown node type: "+e.type)}var Gs=Vs;Vs.default=Vs;let Zs=De,Ys=qe,Xs=Cs,Hs=Jt,Js=Ls,$s=We,Ks=Gs,qs=er,Qs=nr,en=Ft,tn=Pr,rn=ar,sn=Ct,nn=rs,on=jr,an=Gr,ln=Ur,cn=Je;function hn(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Js(e)}hn.plugin=function(e,t){let r,s=!1;function n(...r){console&&console.warn&&!s&&(s=!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 n=t(...r);return n.postcssPlugin=e,n.postcssVersion=(new Js).version,n}return Object.defineProperty(n,"postcss",{get:()=>(r||(r=n()),r)}),n.process=function(e,t,r){return hn([n(r)]).process(e,t)},n},hn.stringify=$s,hn.parse=nn,hn.fromJSON=Ks,hn.list=on,hn.comment=e=>new en(e),hn.atRule=e=>new tn(e),hn.decl=e=>new Ys(e),hn.rule=e=>new an(e),hn.root=e=>new ln(e),hn.document=e=>new qs(e),hn.CssSyntaxError=Zs,hn.Declaration=Ys,hn.Container=Hs,hn.Processor=Js,hn.Document=qs,hn.Comment=en,hn.Warning=Qs,hn.AtRule=tn,hn.Result=rn,hn.Input=sn,hn.Rule=an,hn.Root=ln,hn.Node=cn,Xs.registerPostcss(hn);var un=hn;hn.default=hn;const pn=ke(un);pn.stringify,pn.fromJSON,pn.plugin,pn.parse,pn.list,pn.document,pn.comment,pn.atRule,pn.rule,pn.decl,pn.root,pn.CssSyntaxError,pn.Declaration,pn.Container,pn.Processor,pn.Document,pn.Comment,pn.Warning,pn.AtRule,pn.Result,pn.Input,pn.Rule,pn.Root,pn.Node;var dn=Object.defineProperty,fn=(e,t,r)=>((e,t,r)=>t in e?dn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function mn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function gn(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,s.get?s:{enumerable:!0,get:function(){return e[t]}})}),r}var yn={exports:{}},wn=String,vn=function(){return{isColorSupported:!1,reset:wn,bold:wn,dim:wn,italic:wn,underline:wn,inverse:wn,hidden:wn,strikethrough:wn,black:wn,red:wn,green:wn,yellow:wn,blue:wn,magenta:wn,cyan:wn,white:wn,gray:wn,bgBlack:wn,bgRed:wn,bgGreen:wn,bgYellow:wn,bgBlue:wn,bgMagenta:wn,bgCyan:wn,bgWhite:wn}};yn.exports=vn(),yn.exports.createColors=vn;var bn=yn.exports;const Sn=gn(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Cn=bn,In=Sn,kn=class e extends Error{constructor(t,r,s,n,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),n&&(this.source=n),i&&(this.plugin=i),void 0!==r&&void 0!==s&&("number"==typeof r?(this.line=r,this.column=s):(this.line=r.line,this.column=r.column,this.endLine=s.line,this.endColumn=s.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=Cn.isColorSupported),In&&e&&(t=In(t));let r,s,n=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,n.length),a=String(i).length;if(e){let{bold:e,gray:t,red:n}=Cn.createColors(!0);r=t=>e(n(t)),s=e=>t(e)}else r=s=e=>e;return n.slice(o,i).map((e,t)=>{let n=o+1+t,i=" "+(" "+n).slice(-a)+" | ";if(n===this.line){let t=s(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+s(i)+e+"\n "+t+r("^")}return" "+s(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var xn=kn;kn.default=kn;var On={};On.isClean=Symbol("isClean"),On.my=Symbol("my");const En={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Rn=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,s=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:s&&(r+=" "),e.nodes)this.block(e,r+s);else{let n=(e.raws.between||"")+(t?";":"");this.builder(r+s+n,e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let s=e.parent,n=0;for(;s&&"root"!==s.type;)n+=1,s=s.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<n;e++)r+=t}return r}block(e,t){let r,s=this.raw(e,"between","beforeOpen");this.builder(t+s+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let s=0;s<e.nodes.length;s++){let n=e.nodes[s],o=this.raw(n,"before");o&&this.builder(o),this.stringify(n,t!==s||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),s=e.prop+r+this.rawValue(e,"value");e.important&&(s+=e.raws.important||" !important"),t&&(s+=";"),this.builder(s,e)}document(e){this.body(e)}raw(e,t,r){let s;if(r||(r=t),t&&(s=e.raws[t],void 0!==s))return s;let n=e.parent;if("before"===r){if(!n||"root"===n.type&&n.first===e)return"";if(n&&"document"===n.type)return""}if(!n)return En[r];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[r])return o.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let n="raw"+((i=r)[0].toUpperCase()+i.slice(1));this[n]?s=this[n](o,e):o.walk(e=>{if(s=e.raws[t],void 0!==s)return!1})}var i;return void 0===s&&(s=En[r]),o.rawCache[r]=s,s}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let s=r.parent;if(s&&s!==e&&s.parent&&s.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let r=e[t],s=e.raws[t];return s&&s.value===r?s.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var Mn=Rn;Rn.default=Rn;let An=Mn;function Tn(e,t){new An(t).stringify(e)}var Nn=Tn;Tn.default=Tn;let{isClean:Pn,my:Dn}=On,Ln=xn,Fn=Mn,_n=Nn;function Un(e,t){let r=new e.constructor;for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;if("proxyCache"===s)continue;let n=e[s],o=typeof n;"parent"===s&&"object"===o?t&&(r[s]=t):"source"===s?r[s]=n:Array.isArray(n)?r[s]=n.map(e=>Un(e,r)):("object"===o&&null!==n&&(n=Un(n)),r[s]=n)}return r}let Bn=class{constructor(e={}){this.raws={},this[Pn]=!1,this[Dn]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=Un(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:s}=this.rangeBy(t);return this.source.input.error(e,{column:s.column,line:s.line},{column:r.column,line:r.line},t)}return new Ln(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[Pn]){this[Pn]=!1;let e=this;for(;e=e.parent;)e[Pn]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let s=(t=this.toString()).indexOf(e.word);-1!==s&&(r=this.positionInside(s,t))}return r}positionInside(e,t){let r=t||this.toString(),s=this.source.start.column,n=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(s=1,n+=1):s+=1;return{column:s,line:n}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let s=this.toString(),n=s.indexOf(e.word);-1!==n&&(t=this.positionInside(n,s),r=this.positionInside(n+e.word.length,s))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new Fn).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let s of e)s===this?r=!0:r?(this.parent.insertAfter(t,s),t=s):this.parent.insertBefore(t,s);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},s=null==t;t=t||new Map;let n=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let s=this[e];if(Array.isArray(s))r[e]=s.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof s&&s.toJSON)r[e]=s.toJSON(null,t);else if("source"===e){let o=t.get(s.input);null==o&&(o=n,t.set(s.input,n),n++),r[e]={end:s.end,inputId:o,start:s.start}}else r[e]=s}return s&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=_n){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let s={node:this};for(let e in r)s[e]=r[e];return e.warn(t,s)}get proxyOf(){return this}};var jn=Bn;Bn.default=Bn;let Wn=jn,zn=class extends Wn{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var Vn=zn;zn.default=zn;var Gn={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:Zn,SourceMapGenerator:Yn}=Sn,{existsSync:Xn,readFileSync:Hn}=Sn,{dirname:Jn,join:$n}=Sn;let Kn=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,s=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Jn(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new Zn(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),s=e.indexOf("*/",r);r>-1&&s>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,s)))}loadFile(e){if(this.root=Jn(e),Xn(e))return this.mapFile=e,Hn(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof Zn)return Yn.fromSourceMap(t).toString();if(t instanceof Yn)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=$n(Jn(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var qn=Kn;Kn.default=Kn;let{SourceMapConsumer:Qn,SourceMapGenerator:eo}=Sn,{fileURLToPath:to,pathToFileURL:ro}=Sn,{isAbsolute:so,resolve:no}=Sn,{nanoid:oo}=Gn,io=Sn,ao=xn,lo=qn,co=Symbol("fromOffsetCache"),ho=Boolean(Qn&&eo),uo=Boolean(no&&so),po=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!uo||/^\w+:\/\//.test(t.from)||so(t.from)?this.file=t.from:this.file=no(t.from)),uo&&ho){let e=new lo(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+oo(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let n,o,i;if(t&&"object"==typeof t){let e=t,s=r;if("number"==typeof e.offset){let s=this.fromOffset(e.offset);t=s.line,r=s.col}else t=e.line,r=e.column;if("number"==typeof s.offset){let e=this.fromOffset(s.offset);o=e.line,i=e.col}else o=s.line,i=s.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,i);return n=a?new ao(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,s.plugin):new ao(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:i,line:o},this.css,this.file,s.plugin),n.input={column:r,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(ro&&(n.input.url=ro(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,r;if(this[co])r=this[co];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let s=0,n=e.length;s<n;s++)r[s]=t,t+=e[s].length+1;this[co]=r}t=r[r.length-1];let s=0;if(e>=t)s=r.length-1;else{let t,n=r.length-2;for(;s<n;)if(t=s+(n-s>>1),e<r[t])n=t-1;else{if(!(e>=r[t+1])){s=t;break}s=t+1}}return{col:e-r[s]+1,line:s+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:no(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,s){if(!this.map)return!1;let n,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(n=i.originalPositionFor({column:s,line:r})),o=so(a.source)?ro(a.source):new URL(a.source,this.map.consumer().sourceRoot||ro(this.map.mapFile));let l={column:a.column,endColumn:n&&n.column,endLine:n&&n.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!to)throw new Error("file: protocol is not available in this PostCSS build");l.file=to(o)}let c=i.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var fo=po;po.default=po,io&&io.registerInput&&io.registerInput(po);let{SourceMapConsumer:mo,SourceMapGenerator:go}=Sn,{dirname:yo,relative:wo,resolve:vo,sep:bo}=Sn,{pathToFileURL:So}=Sn,Co=fo,Io=Boolean(mo&&go),ko=Boolean(yo&&vo&&wo&&bo);var xo=class{constructor(e,t,r,s){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=s,this.originalCSS=s,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),s=e.root||yo(e.file);!1===this.mapOpts.sourcesContent?(t=new mo(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(s)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),ko&&Io&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=go.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new go({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 go({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,s=1,n="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=r,o.generated.column=s-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=i.match(/\n/g),e?(r+=e.length,t=i.lastIndexOf("\n"),s=i.length-t):s+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=s-2,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=s-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?yo(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=yo(vo(r,this.mapOpts.annotation)));let s=wo(r,e);return this.memoizedPaths.set(e,s),s}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Co(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let s=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(s,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(So){let t=So(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===bo&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Oo=jn,Eo=class extends Oo{constructor(e){super(e),this.type="comment"}};var Ro=Eo;Eo.default=Eo;let Mo,Ao,To,No,{isClean:Po,my:Do}=On,Lo=Vn,Fo=Ro,_o=jn;function Uo(e){return e.map(e=>(e.nodes&&(e.nodes=Uo(e.nodes)),delete e.source,e))}function Bo(e){if(e[Po]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Bo(t)}let jo=class e extends _o{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,s=this.getIterator();for(;this.indexes[s]<this.proxyOf.nodes.length&&(t=this.indexes[s],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[s]+=1;return delete this.indexes[s],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,s=this.index(e),n=this.normalize(t,this.proxyOf.nodes[s]).reverse();s=this.index(e);for(let e of n)this.proxyOf.nodes.splice(s+1,0,e);for(let e in this.indexes)r=this.indexes[e],s<r&&(this.indexes[e]=r+n.length);return this.markDirty(),this}insertBefore(e,t){let r,s=this.index(e),n=0===s&&"prepend",o=this.normalize(t,this.proxyOf.nodes[s],n).reverse();s=this.index(e);for(let e of o)this.proxyOf.nodes.splice(s,0,e);for(let e in this.indexes)r=this.indexes[e],s<=r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=Uo(Mo(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new Lo(t)]}else if(t.selector)t=[new Ao(t)];else if(t.name)t=[new To(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Fo(t)]}return t.map(t=>(t[Do]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Po]&&Bo(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(s=>{t.props&&!t.props.includes(s.prop)||t.fast&&!s.value.includes(t.fast)||(s.value=s.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let s;try{s=e(t,r)}catch(e){throw t.addToError(e)}return!1!==s&&t.walk&&(s=t.walk(e)),s})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if("atrule"===r.type&&e.test(r.name))return t(r,s)}):this.walk((r,s)=>{if("atrule"===r.type&&r.name===e)return t(r,s)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if("decl"===r.type&&e.test(r.prop))return t(r,s)}):this.walk((r,s)=>{if("decl"===r.type&&r.prop===e)return t(r,s)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if("rule"===r.type&&e.test(r.selector))return t(r,s)}):this.walk((r,s)=>{if("rule"===r.type&&r.selector===e)return t(r,s)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}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]}};jo.registerParse=e=>{Mo=e},jo.registerRule=e=>{Ao=e},jo.registerAtRule=e=>{To=e},jo.registerRoot=e=>{No=e};var Wo=jo;jo.default=jo,jo.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,To.prototype):"rule"===e.type?Object.setPrototypeOf(e,Ao.prototype):"decl"===e.type?Object.setPrototypeOf(e,Lo.prototype):"comment"===e.type?Object.setPrototypeOf(e,Fo.prototype):"root"===e.type&&Object.setPrototypeOf(e,No.prototype),e[Do]=!0,e.nodes&&e.nodes.forEach(e=>{jo.rebuild(e)})};let zo,Vo,Go=Wo,Zo=class extends Go{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new zo(new Vo,this,e).stringify()}};Zo.registerLazyResult=e=>{zo=e},Zo.registerProcessor=e=>{Vo=e};var Yo=Zo;Zo.default=Zo;let Xo={};var Ho=function(e){Xo[e]||(Xo[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Jo=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var $o=Jo;Jo.default=Jo;let Ko=$o,qo=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new Ko(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Qo=qo;qo.default=qo;const ei="'".charCodeAt(0),ti='"'.charCodeAt(0),ri="\\".charCodeAt(0),si="/".charCodeAt(0),ni="\n".charCodeAt(0),oi=" ".charCodeAt(0),ii="\f".charCodeAt(0),ai="\t".charCodeAt(0),li="\r".charCodeAt(0),ci="[".charCodeAt(0),hi="]".charCodeAt(0),ui="(".charCodeAt(0),pi=")".charCodeAt(0),di="{".charCodeAt(0),fi="}".charCodeAt(0),mi=";".charCodeAt(0),gi="*".charCodeAt(0),yi=":".charCodeAt(0),wi="@".charCodeAt(0),vi=/[\t\n\f\r "#'()/;[\\\]{}]/g,bi=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Si=/.[\r\n"'(/\\]/,Ci=/[\da-f]/i;let Ii=Wo,ki=class extends Ii{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 xi=ki;ki.default=ki,Ii.registerAtRule(ki);let Oi,Ei,Ri=Wo,Mi=class extends Ri{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let s=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of s)e.raws.before=t.raws.before;return s}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new Oi(new Ei,this,e).stringify()}};Mi.registerLazyResult=e=>{Oi=e},Mi.registerProcessor=e=>{Ei=e};var Ai=Mi;Mi.default=Mi,Ri.registerRoot(Mi);let Ti={comma:e=>Ti.split(e,[","],!0),space:e=>Ti.split(e,[" ","\n","\t"]),split(e,t,r){let s=[],n="",o=!1,i=0,a=!1,l="",c=!1;for(let r of e)c?c=!1:"\\"===r?c=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?i+=1:")"===r?i>0&&(i-=1):0===i&&t.includes(r)&&(o=!0),o?(""!==n&&s.push(n.trim()),n="",o=!1):n+=r;return(r||""!==n)&&s.push(n.trim()),s}};var Ni=Ti;Ti.default=Ti;let Pi=Wo,Di=Ni,Li=class extends Pi{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Di.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var Fi=Li;Li.default=Li,Pi.registerRule(Li);let _i=Vn,Ui=function(e,t={}){let r,s,n,o,i,a,l,c,h,u,p=e.css.valueOf(),d=t.ignoreErrors,f=p.length,m=0,g=[],y=[];function w(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=p.charCodeAt(m),r){case ni:case oi:case ai:case li:case ii:s=m;do{s+=1,r=p.charCodeAt(s)}while(r===oi||r===ni||r===ai||r===li||r===ii);u=["space",p.slice(m,s)],m=s-1;break;case ci:case hi:case di:case fi:case yi:case mi:case pi:{let e=String.fromCharCode(r);u=[e,e,m];break}case ui:if(c=g.length?g.pop()[1]:"",h=p.charCodeAt(m+1),"url"===c&&h!==ei&&h!==ti&&h!==oi&&h!==ni&&h!==ai&&h!==ii&&h!==li){s=m;do{if(a=!1,s=p.indexOf(")",s+1),-1===s){if(d||t){s=m;break}w("bracket")}for(l=s;p.charCodeAt(l-1)===ri;)l-=1,a=!a}while(a);u=["brackets",p.slice(m,s+1),m,s],m=s}else s=p.indexOf(")",m+1),o=p.slice(m,s+1),-1===s||Si.test(o)?u=["(","(",m]:(u=["brackets",o,m,s],m=s);break;case ei:case ti:n=r===ei?"'":'"',s=m;do{if(a=!1,s=p.indexOf(n,s+1),-1===s){if(d||t){s=m+1;break}w("string")}for(l=s;p.charCodeAt(l-1)===ri;)l-=1,a=!a}while(a);u=["string",p.slice(m,s+1),m,s],m=s;break;case wi:vi.lastIndex=m+1,vi.test(p),s=0===vi.lastIndex?p.length-1:vi.lastIndex-2,u=["at-word",p.slice(m,s+1),m,s],m=s;break;case ri:for(s=m,i=!0;p.charCodeAt(s+1)===ri;)s+=1,i=!i;if(r=p.charCodeAt(s+1),i&&r!==si&&r!==oi&&r!==ni&&r!==ai&&r!==li&&r!==ii&&(s+=1,Ci.test(p.charAt(s)))){for(;Ci.test(p.charAt(s+1));)s+=1;p.charCodeAt(s+1)===oi&&(s+=1)}u=["word",p.slice(m,s+1),m,s],m=s;break;default:r===si&&p.charCodeAt(m+1)===gi?(s=p.indexOf("*/",m+2)+1,0===s&&(d||t?s=p.length:w("comment")),u=["comment",p.slice(m,s+1),m,s],m=s):(bi.lastIndex=m+1,bi.test(p),s=0===bi.lastIndex?p.length-1:bi.lastIndex-2,u=["word",p.slice(m,s+1),m,s],g.push(u),m=s)}return m++,u},position:function(){return m}}},Bi=Ro,ji=xi,Wi=Ai,zi=Fi;const Vi={empty:!0,space:!0};let Gi=Wo,Zi=class{constructor(e){this.input=e,this.root=new Wi,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,s,n=new ji;n.name=e[1].slice(1),""===n.name&&this.unnamedAtrule(n,e),this.init(n,e[2]);let o=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){n.source.end=this.getPosition(e[2]),n.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(s=a.length-1,r=a[s];r&&"space"===r[0];)r=a[--s];r&&(n.source.end=this.getPosition(r[3]||r[2]),n.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(n.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(n,"params",a),o&&(e=a[a.length-1],n.source.end=this.getPosition(e[3]||e[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),i&&(n.nodes=[],this.current=n)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,s=0;for(let n=t-1;n>=0&&(r=e[n],"space"===r[0]||(s+=1,2!==s));n--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,s,n=0;for(let[o,i]of e.entries()){if(t=i,r=t[0],"("===r&&(n+=1),")"===r&&(n-=1),0===n&&":"===r){if(s){if("word"===s[0]&&"progid"===s[1])continue;return o}this.doubleColon(t)}s=t}return!1}comment(e){let t=new Bi;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=Ui(this.input)}decl(e,t){let r=new _i;this.init(r,e[0][2]);let s,n=e[e.length-1];for(";"===n[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(n[3]||n[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],s=r[3]||r[2];if(s)return s}}(e)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(s=e.shift(),":"===s[0]){r.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),r.raws.between+=s[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(s=e[t],"!important"===s[1].toLowerCase()){r.important=!0;let s=this.stringFrom(e,t);s=this.spacesFromEnd(e)+s," !important"!==s&&(r.raws.important=s);break}if("important"===s[1].toLowerCase()){let s=e.slice(0),n="";for(let e=t;e>0;e--){let t=s[e][0];if(0===n.trim().indexOf("!")&&"space"!==t)break;n=s.pop()[1]+n}0===n.trim().indexOf("!")&&(r.important=!0,r.raws.important=n,e=s)}if("space"!==s[0]&&"comment"!==s[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(r,"value",i.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new zi;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,s=!1,n=null,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)n||(n=l),o.push("("===r?")":"]");else if(i&&s&&"{"===r)n||(n=l),o.push("}");else if(0===o.length){if(";"===r){if(s)return void this.decl(a,i);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(s=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(n=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&s){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,s){let n,o,i,a,l=r.length,c="",h=!0;for(let e=0;e<l;e+=1)n=r[e],o=n[0],"space"!==o||e!==l-1||s?"comment"===o?(a=r[e-1]?r[e-1][0]:"empty",i=r[e+1]?r[e+1][0]:"empty",Vi[a]||Vi[i]||","===c.slice(-1)?h=!1:c+=n[1]):c+=n[1]:h=!1;if(!h){let s=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:s,value:c}}e[t]=c}rule(e){e.pop();let t=new zi;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let s=t;s<e.length;s++)r+=e[s][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},Yi=fo;function Xi(e,t){let r=new Yi(e,t),s=new Zi(r);try{s.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return s.root}var Hi=Xi;Xi.default=Xi,Gi.registerParse(Xi);let{isClean:Ji,my:$i}=On,Ki=xo,qi=Nn,Qi=Wo,ea=Yo,ta=Ho,ra=Qo,sa=Hi,na=Ai;const oa={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},ia={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},aa={Once:!0,postcssPlugin:!0,prepare:!0};function la(e){return"object"==typeof e&&"function"==typeof e.then}function ca(e){let t=!1,r=oa[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function ha(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:ca(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function ua(e){return e[Ji]=!1,e.nodes&&e.nodes.forEach(e=>ua(e)),e}let pa={},da=class e{constructor(t,r,s){let n;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof ra)n=ua(r.root),r.map&&(void 0===s.map&&(s.map={}),s.map.inline||(s.map.inline=!1),s.map.prev=r.map);else{let e=sa;s.syntax&&(e=s.syntax.parse),s.parser&&(e=s.parser),e.parse&&(e=e.parse);try{n=e(r,s)}catch(e){this.processed=!0,this.error=e}n&&!n[$i]&&Qi.rebuild(n)}else n=ua(r);this.result=new ra(t,n,s),this.helpers={...pa,postcss:pa,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,s=this.result.processor.version,n=t.split("."),o=s.split(".");(n[0]!==o[0]||parseInt(n[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+s+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!ia[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!aa[r])if("object"==typeof t[r])for(let s in t[r])e(t,"*"===s?r:r+"-"+s.toLowerCase(),t[r][s]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(la(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ji];){e[Ji]=!0;let t=[ha(e)];for(;t.length>0;){let e=this.visitTick(t);if(la(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return la(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=qi;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Ki(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[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(la(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ji];)e[Ji]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||ta("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,s]of e){let e;this.result.lastPlugin=r;try{e=s(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(la(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:s}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(s.length>0&&t.visitorIndex<s.length){let[e,n]=s[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===s.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return n(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let s,n=t.iterator;for(;s=r.nodes[r.indexes[n]];)if(r.indexes[n]+=1,!s[Ji])return s[Ji]=!0,void e.push(ha(s));t.iterator=0,delete r.indexes[n]}let n=t.events;for(;t.eventIndex<n.length;){let e=n[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[Ji]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Ji]=!0;let t=ca(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[Ji]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};da.registerPostcss=e=>{pa=e};var fa=da;da.default=da,na.registerLazyResult(da),ea.registerLazyResult(da);let ma=xo,ga=Nn,ya=Ho,wa=Hi;const va=Qo;let ba=class{constructor(e,t,r){let s;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let n=ga;this.result=new va(this._processor,s,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new ma(n,s,this._opts,t);if(i.isMap()){let[e,t]=i.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else i.clearAnnotation(),this.result.css=i.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||ya("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=wa;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Sa=ba;ba.default=ba;let Ca=Sa,Ia=fa,ka=Yo,xa=Ai,Oa=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new Ia(this,e,t):new Ca(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Ea=Oa;Oa.default=Oa,xa.registerProcessor(Oa),ka.registerProcessor(Oa);let Ra=Vn,Ma=qn,Aa=Ro,Ta=xi,Na=fo,Pa=Ai,Da=Fi;function La(e,t){if(Array.isArray(e))return e.map(e=>La(e));let{inputs:r,...s}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Na.prototype};r.map&&(r.map={...r.map,__proto__:Ma.prototype}),t.push(r)}}if(s.nodes&&(s.nodes=e.nodes.map(e=>La(e,t))),s.source){let{inputId:e,...r}=s.source;s.source=r,null!=e&&(s.source.input=t[e])}if("root"===s.type)return new Pa(s);if("decl"===s.type)return new Ra(s);if("rule"===s.type)return new Da(s);if("comment"===s.type)return new Aa(s);if("atrule"===s.type)return new Ta(s);throw new Error("Unknown node type: "+e.type)}var Fa=La;La.default=La;let _a=xn,Ua=Vn,Ba=fa,ja=Wo,Wa=Ea,za=Nn,Va=Fa,Ga=Yo,Za=$o,Ya=Ro,Xa=xi,Ha=Qo,Ja=fo,$a=Hi,Ka=Ni,qa=Fi,Qa=Ai,el=jn;function tl(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Wa(e)}tl.plugin=function(e,t){let r,s=!1;function n(...r){console&&console.warn&&!s&&(s=!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 n=t(...r);return n.postcssPlugin=e,n.postcssVersion=(new Wa).version,n}return Object.defineProperty(n,"postcss",{get:()=>(r||(r=n()),r)}),n.process=function(e,t,r){return tl([n(r)]).process(e,t)},n},tl.stringify=za,tl.parse=$a,tl.fromJSON=Va,tl.list=Ka,tl.comment=e=>new Ya(e),tl.atRule=e=>new Xa(e),tl.decl=e=>new Ua(e),tl.rule=e=>new qa(e),tl.root=e=>new Qa(e),tl.document=e=>new Ga(e),tl.CssSyntaxError=_a,tl.Declaration=Ua,tl.Container=ja,tl.Processor=Wa,tl.Document=Ga,tl.Comment=Ya,tl.Warning=Za,tl.AtRule=Xa,tl.Result=Ha,tl.Input=Ja,tl.Rule=qa,tl.Root=Qa,tl.Node=el,Ba.registerPostcss(tl);var rl=tl;tl.default=tl;const sl=mn(rl);sl.stringify,sl.fromJSON,sl.plugin,sl.parse,sl.list,sl.document,sl.comment,sl.atRule,sl.rule,sl.decl,sl.root,sl.CssSyntaxError,sl.Declaration,sl.Container,sl.Processor,sl.Document,sl.Comment,sl.Warning,sl.AtRule,sl.Result,sl.Input,sl.Rule,sl.Root,sl.Node;class nl{constructor(...e){fn(this,"parentElement",null),fn(this,"parentNode",null),fn(this,"ownerDocument"),fn(this,"firstChild",null),fn(this,"lastChild",null),fn(this,"previousSibling",null),fn(this,"nextSibling",null),fn(this,"ELEMENT_NODE",1),fn(this,"TEXT_NODE",3),fn(this,"nodeType"),fn(this,"nodeName"),fn(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof nl))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const ol={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},il={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},al={};function ll(e){if(al[e])return al[e];const t=globalThis[e],r=t.prototype,s=e in ol?ol[e]:void 0,n=Boolean(s&&s.every(e=>{var t,s;return Boolean(null==(s=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:s.toString().includes("[native code]"))})),o=e in il?il[e]:void 0,i=Boolean(o&&o.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(n&&i&&!globalThis.Zone)return al[e]=t.prototype,t.prototype;try{const s=document.createElement("iframe");document.body.appendChild(s);const n=s.contentWindow;if(!n)return t.prototype;const o=n[e].prototype;return document.body.removeChild(s),o?al[e]=o:r}catch{return r}}const cl={};function hl(e,t,r){var s;const n=`${e}.${String(r)}`;if(cl[n])return cl[n].call(t);const o=ll(e),i=null==(s=Object.getOwnPropertyDescriptor(o,r))?void 0:s.get;return i?(cl[n]=i,i.call(t)):t[r]}const ul={};function pl(e,t,r){const s=`${e}.${String(r)}`;if(ul[s])return ul[s].bind(t);const n=ll(e)[r];return"function"!=typeof n?t[r]:(ul[s]=n,n.bind(t))}function dl(){return ll("MutationObserver").constructor}const fl={childNodes:function(e){return hl("Node",e,"childNodes")},parentNode:function(e){return hl("Node",e,"parentNode")},parentElement:function(e){return hl("Node",e,"parentElement")},textContent:function(e){return hl("Node",e,"textContent")},contains:function(e,t){return pl("Node",e,"contains")(t)},getRootNode:function(e){return pl("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?hl("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?hl("Element",e,"shadowRoot"):null},querySelector:function(e,t){return hl("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return hl("Element",e,"querySelectorAll")(t)},mutationObserver:dl};function ml(e,t,r=document){const s={capture:!0,passive:!0};return r.addEventListener(e,t,s),()=>r.removeEventListener(e,t,s)}const gl="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 yl={map:{},getId:()=>(console.error(gl),-1),getNode:()=>(console.error(gl),null),removeNodeFromMap(){console.error(gl)},has:()=>(console.error(gl),!1),reset(){console.error(gl)}};function wl(e,t,r={}){let s=null,n=0;return function(...o){const i=Date.now();n||!1!==r.leading||(n=i);const a=t-(i-n),l=this;a<=0||a>t?(s&&(clearTimeout(s),s=null),n=i,e.apply(l,o)):s||!1===r.trailing||(s=setTimeout(()=>{n=!1===r.leading?0:Date.now(),s=null,e.apply(l,o)},a))}}function vl(e,t,r,s,n=window){const o=n.Object.getOwnPropertyDescriptor(e,t);return n.Object.defineProperty(e,t,s?r:{set(e){setTimeout(()=>{r.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>vl(e,t,o||{},!0)}function bl(e,t,r){try{if(!(t in e))return()=>{};const s=e[t],n=r(s);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:s}})),e[t]=n,()=>{e[t]=s}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(yl=new Proxy(yl,{get:(e,t,r)=>("map"===t&&console.error(gl),Reflect.get(e,t,r))}));let Sl=Date.now;function Cl(e){var t,r,s,n;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=fl.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(s=fl.parentElement(o.body))?void 0:s.scrollTop)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollTop)||0}}function Il(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function kl(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function xl(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:fl.parentElement(e)}function Ol(e,t,r,s){if(!e)return!1;const n=xl(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t))return!0;if(s&&null!==n.closest("."+t))return!0}else if(ve(n,t,s))return!0}catch(e){}if(r){if(n.matches(r))return!0;if(s&&null!==n.closest(r))return!0}return!1}function El(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function Rl(e,t){if(V(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const s=fl.parentNode(e);return(!s||s.nodeType!==e.DOCUMENT_NODE)&&(!s||Rl(s,t))}function Ml(e){return Boolean(e.changedTouches)}function Al(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Tl(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Nl(e){return!!e&&(e instanceof nl&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(fl.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Sl=()=>(new Date).getTime());class Pl{constructor(){M(this,"id",1),M(this,"styleIDMap",new WeakMap),M(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}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 Dl(e){var t;let r=null;return"getRootNode"in e&&(null==(t=fl.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&fl.host(fl.getRootNode(e))&&(r=fl.host(fl.getRootNode(e))),r}function Ll(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=Dl(r);)r=t;return r}(e);return fl.contains(t,r)}function Fl(e){const t=e.ownerDocument;return!!t&&(fl.contains(t,e)||Ll(e))}var _l=(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))(_l||{}),Ul=(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))(Ul||{}),Bl=(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))(Bl||{}),jl=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(jl||{}),Wl=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Wl||{}),zl=(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))(zl||{}),Vl=(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))(Vl||{});function Gl(e){return"__ln"in e}class Zl{constructor(){M(this,"length",0),M(this,"head",null),M(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Gl(e.previousSibling)){const r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&Gl(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const Yl=(e,t)=>`${e}@${t}`;class Xl{constructor(){M(this,"frozen",!1),M(this,"locked",!1),M(this,"texts",[]),M(this,"attributes",[]),M(this,"attributeMap",new WeakMap),M(this,"removes",[]),M(this,"mapRemoves",[]),M(this,"movedMap",{}),M(this,"addedSet",new Set),M(this,"movedSet",new Set),M(this,"droppedSet",new Set),M(this,"removesSubTreeCache",new Set),M(this,"mutationCb"),M(this,"blockClass"),M(this,"blockSelector"),M(this,"maskTextClass"),M(this,"maskTextSelector"),M(this,"inlineStylesheet"),M(this,"maskInputOptions"),M(this,"maskTextFn"),M(this,"maskInputFn"),M(this,"keepIframeSrcFn"),M(this,"recordCanvas"),M(this,"inlineImages"),M(this,"slimDOMOptions"),M(this,"dataURLOptions"),M(this,"doc"),M(this,"mirror"),M(this,"iframeManager"),M(this,"stylesheetManager"),M(this,"shadowDomManager"),M(this,"canvasManager"),M(this,"processedNodeManager"),M(this,"unattachedDoc"),M(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),M(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new Zl,s=e=>{let t=e,r=-2;for(;-2===r;)t=t&&t.nextSibling,r=t&&this.mirror.getId(t);return r},n=n=>{const o=fl.parentNode(n);if(!o||!Fl(n))return;let i=!1;if(n.nodeType===Node.TEXT_NODE){const e=o.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(o)&&(i=!0)}const a=V(o)?this.mirror.getId(Dl(n)):this.mirror.getId(o),l=s(n);if(-1===a||-1===l)return r.addNode(n);const c=Ie(n,{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=>{Al(e,this.mirror)&&this.iframeManager.addIframe(e),Tl(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Nl(n)&&this.shadowDomManager.addShadowRoot(fl.shadowRoot(n),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:i});c&&(e.push({parentId:a,nextId:l,node:c}),t.add(c.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)Jl(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(fl.parentNode(e))||n(e);for(const e of this.addedSet)$l(this.droppedSet,e)||Jl(this.removesSubTreeCache,e,this.mirror)?$l(this.movedSet,e)?n(e):this.droppedSet.add(e):n(e);let o=null;for(;r.length;){let e=null;if(o){const t=this.mirror.getId(fl.parentNode(o.value)),r=s(o.value);-1!==t&&-1!==r&&(e=o)}if(!e){let t=r.tail;for(;t;){const r=t;if(t=t.previous,r){const t=this.mirror.getId(fl.parentNode(r.value));if(-1===s(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,s=fl.parentNode(t);if(s&&s.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=fl.host(s);if(-1!==this.mirror.getId(t)){e=r;break}}}}}}if(!e){for(;r.head;)r.removeNode(r.head.value);break}o=e.previous,r.removeNode(e.value),n(e.value)}const i={texts:this.texts.map(e=>{const t=e.node,r=fl.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{const{attributes:t}=e;if("string"==typeof t.style){const r=JSON.stringify(e.styleDiff),s=JSON.stringify(e._unchangedStyles);r.length<t.style.length&&(r+s).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(i.texts.length||i.attributes.length||i.removes.length||i.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(i))}),M(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(fl.childNodes(e),e=>fl.textContent(e)||"").join("")}),M(this,"processMutation",e=>{if(!El(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=fl.textContent(e.target);Ol(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:be(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,xl(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let r=e.attributeName,s=e.target.getAttribute(r);if("value"===r){const e=K(t);s=H({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:s,maskInputFn:this.maskInputFn})}if(Ol(e.target,this.blockClass,this.blockSelector,!1)||s===e.oldValue)return;let n=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===r&&!this.keepIframeSrcFn(s)){if(t.contentDocument)return;r="rr_src"}if(n||(n={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e.target,n)),"type"===r&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!we(t.tagName,r))if(n.attributes[r]=ye(this.doc,J(t.tagName),J(r),s),"style"===r){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const r=this.unattachedDoc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const s=t.style.getPropertyValue(e),o=t.style.getPropertyPriority(e);s!==r.style.getPropertyValue(e)||o!==r.style.getPropertyPriority(e)?n.styleDiff[e]=""===o?s:[s,o]:n._unchangedStyles[e]=[s,o]}for(const e of Array.from(r.style))""===t.style.getPropertyValue(e)&&(n.styleDiff[e]=!1)}else"open"===r&&"DIALOG"===t.tagName&&(t.matches("dialog:modal")?n.attributes.rr_open_mode="modal":n.attributes.rr_open_mode="non-modal");break}case"childList":if(Ol(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const r=this.mirror.getId(t),s=V(e.target)?this.mirror.getId(fl.host(e.target)):this.mirror.getId(e.target);Ol(e.target,this.blockClass,this.blockSelector,!1)||El(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Hl(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||Rl(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Yl(r,s)]?Hl(this.movedSet,t):(this.removes.push({parentId:s,id:r,isShadow:!(!V(e.target)||!G(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),fl.childNodes(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),M(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(El(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[Yl(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Ol(e,this.blockClass,this.blockSelector,!1)||(fl.childNodes(e).forEach(e=>this.genAdds(e)),Nl(e)&&fl.childNodes(fl.shadowRoot(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,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(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Hl(e,t){e.delete(t),fl.childNodes(t).forEach(t=>Hl(e,t))}function Jl(e,t,r){return 0!==e.size&&function(e,t){const r=fl.parentNode(t);return!!r&&e.has(r)}(e,t)}function $l(e,t){return 0!==e.size&&Kl(e,t)}function Kl(e,t){const r=fl.parentNode(t);return!!r&&(!!e.has(r)||Kl(e,r))}let ql;const Ql=e=>{if(!ql)return e;return(...t)=>{try{return e(...t)}catch(e){if(ql&&!0===ql(e))return;throw e}}},ec=[];function tc(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function rc(e,t){const r=new Xl;ec.push(r),r.init(e);const s=new(dl())(Ql(r.processMutations.bind(r)));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function sc({mouseInteractionCb:e,doc:t,mirror:r,blockClass:s,blockSelector:n,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const i=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,a=[];let l=null;return Object.keys(Bl).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e]).forEach(o=>{let i=J(o);const c=(t=>o=>{const i=tc(o);if(Ol(i,s,n,!0))return;let a=null,c=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=jl.Mouse;break;case"touch":a=jl.Touch;break;case"pen":a=jl.Pen}a===jl.Touch?Bl[t]===Bl.MouseDown?c="TouchStart":Bl[t]===Bl.MouseUp&&(c="TouchEnd"):jl.Pen}else Ml(o)&&(a=jl.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===jl.Touch||c.startsWith("Mouse")&&a===jl.Mouse)&&(a=null)):Bl[t]===Bl.Click&&(a=l,l=null);const h=Ml(o)?o.changedTouches[0]:o;if(!h)return;const u=r.getId(i),{clientX:p,clientY:d}=h;Ql(e)({type:Bl[c],id:u,x:p,y:d,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(Bl[o]){case Bl.MouseDown:case Bl.MouseUp:i=i.replace("mouse","pointer");break;case Bl.TouchStart:case Bl.TouchEnd:return}a.push(ml(i,c,t))}),Ql(()=>{a.forEach(e=>e())})}function nc({scrollCb:e,doc:t,mirror:r,blockClass:s,blockSelector:n,sampling:o}){return ml("scroll",Ql(wl(Ql(o=>{const i=tc(o);if(!i||Ol(i,s,n,!0))return;const a=r.getId(i);if(i===t&&t.defaultView){const r=Cl(t.defaultView);e({id:a,x:r.left,y:r.top})}else e({id:a,x:i.scrollLeft,y:i.scrollTop})}),o.scroll||100)),t)}const oc=["INPUT","TEXTAREA","SELECT"],ic=new WeakMap;function ac(e){return function(e,t){if(uc("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||uc("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||uc("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||uc("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){const r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function lc(e,t,r){let s,n;return e?(e.ownerNode?s=t.getId(e.ownerNode):n=r.getId(e),{styleId:n,id:s}):{}}function cc({mirror:e,stylesheetManager:t},r){var s,n,o;let i=null;i="#document"===r.nodeName?e.getId(r):e.getId(fl.host(r));const a="#document"===r.nodeName?null==(s=r.defaultView)?void 0:s.Document:null==(o=null==(n=r.ownerDocument)?void 0:n.defaultView)?void 0:o.ShadowRoot,l=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==i&&-1!==i&&a&&l?(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var r;const s=null==(r=l.set)?void 0:r.call(this,e);if(null!==i&&-1!==i)try{t.adoptStyleSheets(e,i)}catch(e){}return s}}),Ql(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function hc(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};let s;!function(e,t){const{mutationCb:r,mousemoveCb:s,mouseInteractionCb:n,scrollCb:o,viewportResizeCb:i,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:h,canvasMutationCb:u,fontCb:p,selectionCb:d,customElementCb:f}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),r(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),s(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),n(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),o(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),i(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),l(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),c(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),h(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),u(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),p(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),d(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),f(...e)}}(e,t),e.recordDOM&&(s=rc(e,e.doc));const n=function({mousemoveCb:e,sampling:t,doc:r,mirror:s}){if(!1===t.mousemove)return()=>{};const n="number"==typeof t.mousemove?t.mousemove:50,o="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let i,a=[];const l=wl(Ql(t=>{const r=Date.now()-i;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],i=null}),o),c=Ql(wl(Ql(e=>{const t=tc(e),{clientX:r,clientY:n}=Ml(e)?e.changedTouches[0]:e;i||(i=Sl()),a.push({x:r,y:n,id:s.getId(t),timeOffset:Sl()-i}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?Ul.Drag:e instanceof MouseEvent?Ul.MouseMove:Ul.TouchMove)}),n,{trailing:!1})),h=[ml("mousemove",c,r),ml("touchmove",c,r),ml("drag",c,r)];return Ql(()=>{h.forEach(e=>e())})}(e),o=sc(e),i=nc(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,s=-1;return ml("resize",Ql(wl(Ql(()=>{const t=Il(),n=kl();r===t&&s===n||(e({width:Number(n),height:Number(t)}),r=t,s=n)}),200)),t)}(e,{win:r}),l=function({inputCb:e,doc:t,mirror:r,blockClass:s,blockSelector:n,ignoreClass:o,ignoreSelector:i,maskInputOptions:a,maskInputFn:l,sampling:c,userTriggeredOnInput:h}){function u(e){let r=tc(e);const c=e.isTrusted,u=r&&r.tagName;if(r&&"OPTION"===u&&(r=fl.parentElement(r)),!r||!u||oc.indexOf(u)<0||Ol(r,s,n,!0))return;if(r.classList.contains(o)||i&&r.matches(i))return;let d=r.value,f=!1;const m=K(r)||"";"radio"===m||"checkbox"===m?f=r.checked:(a[u.toLowerCase()]||a[m])&&(d=H({element:r,maskInputOptions:a,tagName:u,type:m,value:d,maskInputFn:l})),p(r,h?{text:d,isChecked:f,userTriggered:c}:{text:d,isChecked:f});const g=r.name;"radio"===m&&g&&f&&t.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(e=>{if(e!==r){const t=e.value;p(e,h?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}})}function p(t,s){const n=ic.get(t);if(!n||n.text!==s.text||n.isChecked!==s.isChecked){ic.set(t,s);const n=r.getId(t);Ql(e)({...s,id:n})}}const d=("last"===c.input?["change"]:["input","change"]).map(e=>ml(e,Ql(u),t)),f=t.defaultView;if(!f)return()=>{d.forEach(e=>e())};const m=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),g=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&d.push(...g.map(e=>vl(e[0],e[1],{set(){Ql(u)({target:this,isTrusted:!1})}},!1,f))),Ql(()=>{d.forEach(e=>e())})}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:s,sampling:n,doc:o}){const i=Ql(o=>wl(Ql(n=>{const i=tc(n);if(!i||Ol(i,t,r,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:h,loop:u}=i;e({type:o,id:s.getId(i),currentTime:a,volume:l,muted:c,playbackRate:h,loop:u})}),n.media||500)),a=[ml("play",i(zl.Play),o),ml("pause",i(zl.Pause),o),ml("seeked",i(zl.Seeked),o),ml("volumechange",i(zl.VolumeChange),o),ml("ratechange",i(zl.RateChange),o)];return Ql(()=>{a.forEach(e=>e())})}(e);let h=()=>{},u=()=>{},p=()=>{},d=()=>{};e.recordDOM&&(h=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:s}){if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};const n=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(n,{apply:Ql((s,n,o)=>{const[i,a]=o,{id:l,styleId:c}=lc(n,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:a}]}),s.apply(n,o)})}),s.CSSStyleSheet.prototype.addRule=function(e,t,r=this.cssRules.length){const n=`${e} { ${t} }`;return s.CSSStyleSheet.prototype.insertRule.apply(this,[n,r])};const o=s.CSSStyleSheet.prototype.deleteRule;let i,a;s.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:Ql((s,n,o)=>{const[i]=o,{id:a,styleId:l}=lc(n,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:i}]}),s.apply(n,o)})}),s.CSSStyleSheet.prototype.removeRule=function(e){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},s.CSSStyleSheet.prototype.replace&&(i=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(i,{apply:Ql((s,n,o)=>{const[i]=o,{id:a,styleId:l}=lc(n,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replace:i}),s.apply(n,o)})})),s.CSSStyleSheet.prototype.replaceSync&&(a=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Ql((s,n,o)=>{const[i]=o,{id:a,styleId:l}=lc(n,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:i}),s.apply(n,o)})}));const l={};pc("CSSGroupingRule")?l.CSSGroupingRule=s.CSSGroupingRule:(pc("CSSMediaRule")&&(l.CSSMediaRule=s.CSSMediaRule),pc("CSSConditionRule")&&(l.CSSConditionRule=s.CSSConditionRule),pc("CSSSupportsRule")&&(l.CSSSupportsRule=s.CSSSupportsRule));const c={};return Object.entries(l).forEach(([s,n])=>{c[s]={insertRule:n.prototype.insertRule,deleteRule:n.prototype.deleteRule},n.prototype.insertRule=new Proxy(c[s].insertRule,{apply:Ql((s,n,o)=>{const[i,a]=o,{id:l,styleId:c}=lc(n.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:[...ac(n),a||0]}]}),s.apply(n,o)})}),n.prototype.deleteRule=new Proxy(c[s].deleteRule,{apply:Ql((s,n,o)=>{const[i]=o,{id:a,styleId:l}=lc(n.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...ac(n),i]}]}),s.apply(n,o)})})}),Ql(()=>{s.CSSStyleSheet.prototype.insertRule=n,s.CSSStyleSheet.prototype.deleteRule=o,i&&(s.CSSStyleSheet.prototype.replace=i),a&&(s.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([e,t])=>{t.prototype.insertRule=c[e].insertRule,t.prototype.deleteRule=c[e].deleteRule})})}(e,{win:r}),u=cc(e,e.doc),p=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:s},{win:n}){const o=n.CSSStyleDeclaration.prototype.setProperty;n.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Ql((n,i,a)=>{var l;const[c,h,u]=a;if(r.has(c))return o.apply(i,[c,h,u]);const{id:p,styleId:d}=lc(null==(l=i.parentRule)?void 0:l.parentStyleSheet,t,s.styleMirror);return(p&&-1!==p||d&&-1!==d)&&e({id:p,styleId:d,set:{property:c,value:h,priority:u},index:ac(i.parentRule)}),n.apply(i,a)})});const i=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:Ql((n,o,a)=>{var l;const[c]=a;if(r.has(c))return i.apply(o,[c]);const{id:h,styleId:u}=lc(null==(l=o.parentRule)?void 0:l.parentStyleSheet,t,s.styleMirror);return(h&&-1!==h||u&&-1!==u)&&e({id:h,styleId:u,remove:{property:c},index:ac(o.parentRule)}),n.apply(o,a)})}),Ql(()=>{n.CSSStyleDeclaration.prototype.setProperty=o,n.CSSStyleDeclaration.prototype.removeProperty=i})}(e,{win:r}),e.collectFonts&&(d=function({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const s=[],n=new WeakMap,o=r.FontFace;r.FontFace=function(e,t,r){const s=new o(e,t,r);return n.set(s,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),s};const i=bl(t.fonts,"add",function(t){return function(r){return setTimeout(Ql(()=>{const t=n.get(r);t&&(e(t),n.delete(r))}),0),t.apply(this,[r])}});return s.push(()=>{r.FontFace=o}),s.push(i),Ql(()=>{s.forEach(e=>e())})}(e)));const f=function(e){const{doc:t,mirror:r,blockClass:s,blockSelector:n,selectionCb:o}=e;let i=!0;const a=Ql(()=>{const e=t.getSelection();if(!e||i&&(null==e?void 0:e.isCollapsed))return;i=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const o=e.getRangeAt(t),{startContainer:i,startOffset:l,endContainer:c,endOffset:h}=o;Ol(i,s,n,!0)||Ol(c,s,n,!0)||a.push({start:r.getId(i),startOffset:l,end:r.getId(c),endOffset:h})}o({ranges:a})});return a(),ml("selectionchange",a)}(e),m=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?bl(r.customElements,"define",function(e){return function(r,s,n){try{t({define:{name:r}})}catch(e){console.warn(`Custom element callback failed for ${r}`)}return e.apply(this,[r,s,n])}}):()=>{}}(e),g=[];for(const t of e.plugins)g.push(t.observer(t.callback,r,t.options));return Ql(()=>{ec.forEach(e=>e.reset()),null==s||s.disconnect(),n(),o(),i(),a(),l(),c(),h(),u(),p(),d(),f(),m(),g.forEach(e=>e())})}function uc(e){return void 0!==window[e]}function pc(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class dc{constructor(e){M(this,"iframeIdToRemoteIdMap",new WeakMap),M(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,s){const n=r||this.getIdToRemoteIdMap(e),o=s||this.getRemoteIdToIdMap(e);let i=n.get(t);return i||(i=this.generateIdFn(),n.set(t,i),o.set(i,t)),i}getIds(e,t){const r=this.getIdToRemoteIdMap(e),s=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,r,s))}getRemoteId(e,t,r){const s=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const n=s.get(t);return n||-1}getRemoteIds(e,t){const r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,r))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class fc{constructor(e){M(this,"iframes",new WeakMap),M(this,"crossOriginIframeMap",new WeakMap),M(this,"crossOriginIframeMirror",new dc(le)),M(this,"crossOriginIframeStyleMirror"),M(this,"crossOriginIframeRootIdMap",new WeakMap),M(this,"mirror"),M(this,"mutationCb"),M(this,"wrappedEmit"),M(this,"loadListener"),M(this,"stylesheetManager"),M(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new dc(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,s;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=e.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(s=this.loadListener)||s.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 t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const r=this.crossOriginIframeMap.get(e.source);if(!r)return;const s=this.transformCrossOriginEvent(r,t.data.event);s&&this.wrappedEmit(s,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case _l.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const r=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(t.data.node,r),{timestamp:t.timestamp,type:_l.IncrementalSnapshot,data:{source:Ul.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case _l.Meta:case _l.Load:case _l.DomContentLoaded:return!1;case _l.Plugin:return t;case _l.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case _l.IncrementalSnapshot:switch(t.data.source){case Ul.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Ul.Drag:case Ul.TouchMove:case Ul.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Ul.ViewportResize:return!1;case Ul.MediaInteraction:case Ul.MouseInteraction:case Ul.Scroll:case Ul.CanvasMutation:case Ul.Input:return this.replaceIds(t.data,e,["id"]),t;case Ul.StyleSheetRule:case Ul.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Ul.Font:return t;case Ul.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case Ul.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}return!1}replace(e,t,r,s){for(const n of s)(Array.isArray(t[n])||"number"==typeof t[n])&&(Array.isArray(t[n])?t[n]=e.getIds(r,t[n]):t[n]=e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type===Vl.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class mc{constructor(e){M(this,"shadowDoms",new WeakSet),M(this,"mutationCb"),M(this,"scrollCb"),M(this,"bypassOptions"),M(this,"mirror"),M(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!G(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=rc({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(nc({...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(fl.host(e))),this.restoreHandlers.push(cc({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const r=this;this.restoreHandlers.push(bl(e.prototype,"attachShadow",function(e){return function(s){const n=e.call(this,s),o=fl.shadowRoot(this);return o&&Fl(this)&&r.addShadowRoot(o,t),n}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var gc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",yc="undefined"==typeof Uint8Array?[]:new Uint8Array(256),wc=0;wc<64;wc++)yc[gc.charCodeAt(wc)]=wc;const vc=new Map;const bc=(e,t,r)=>{if(!e||!Ic(e,t)&&"object"!=typeof e)return;const s=function(e,t){let r=vc.get(e);return r||(r=new Map,vc.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name);let n=s.indexOf(e);return-1===n&&(n=s.length,s.push(e)),n};function Sc(e,t,r){if(e instanceof Array)return e.map(e=>Sc(e,t,r));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){return{rr_type:e.constructor.name,base64:function(e){var t,r=new Uint8Array(e),s=r.length,n="";for(t=0;t<s;t+=3)n+=gc[r[t]>>2],n+=gc[(3&r[t])<<4|r[t+1]>>4],n+=gc[(15&r[t+1])<<2|r[t+2]>>6],n+=gc[63&r[t+2]];return s%3==2?n=n.substring(0,n.length-1)+"=":s%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Sc(e.buffer,t,r),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:r}=e;return{rr_type:t,src:r}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[Sc(e.data,t,r),e.width,e.height]}}if(Ic(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:bc(e,t,r)}}return e}const Cc=(e,t,r)=>e.map(e=>Sc(e,t,r)),Ic=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(r.find(r=>e instanceof t[r]))};function kc(e,t,r,s){const n=[];try{const o=bl(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(n,...o){if(!Ol(this,t,r,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(n);if("__context"in this||(this.__context=e),s&&["webgl","webgl2"].includes(e))if(o[0]&&"object"==typeof o[0]){const e=o[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[n,...o])}});n.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(e=>e())}}function xc(e,t,r,s,n,o){const i=[],a=Object.getOwnPropertyNames(e);for(const l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if("function"!=typeof e[l])continue;const a=bl(e,l,function(e){return function(...i){const a=e.apply(this,i);if(bc(a,o,this),"tagName"in this.canvas&&!Ol(this.canvas,s,n,!0)){const e=Cc(i,o,this),s={type:t,property:l,args:e};r(this.canvas,s)}return a}});i.push(a)}catch{const s=vl(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});i.push(s)}return i}const Oc="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Ec="undefined"!=typeof window&&window.Blob&&new Blob([(Rc=Oc,Uint8Array.from(atob(Rc),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});var Rc;function Mc(e){let t;try{if(t=Ec&&(window.URL||window.webkitURL).createObjectURL(Ec),!t)throw"";const r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),r}catch(t){return new Worker("data:text/javascript;base64,"+Oc,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Ac{constructor(e){M(this,"pendingCanvasMutations",new Map),M(this,"rafStamps",{latestId:0,invokeId:null}),M(this,"mirror"),M(this,"mutationCb"),M(this,"resetObservers"),M(this,"frozen",!1),M(this,"locked",!1),M(this,"processMutation",(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)});const{sampling:t="all",win:r,blockClass:s,blockSelector:n,recordCanvas:o,dataURLOptions:i}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(r,s,n),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,s,n,{dataURLOptions:i})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,s,n){const o=kc(t,r,s,!0),i=new Map,a=new Mc;a.onmessage=e=>{const{id:t}=e.data;if(i.set(t,!1),!("base64"in e.data))return;const{base64:r,type:s,width:n,height:o}=e.data;this.mutationCb({id:t,type:Wl["2D"],commands:[{property:"clearRect",args:[0,0,n,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:s}]},0,0]}]})};const l=1e3/e;let c,h=0;const u=e=>{h&&e-h<l||(h=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{Ol(t,r,s,!0)||e.push(t)}),e})().forEach(async e=>{var t;const r=this.mirror.getId(e);if(i.get(r))return;if(0===e.width||0===e.height)return;if(i.set(r,!0),["webgl","webgl2"].includes(e.__context)){const r=e.getContext(e.__context);!1===(null==(t=null==r?void 0:r.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&r.clear(r.COLOR_BUFFER_BIT)}const s=await createImageBitmap(e);a.postMessage({id:r,bitmap:s,width:e.width,height:e.height,dataURLOptions:n.dataURLOptions},[s])})),c=requestAnimationFrame(u)};c=requestAnimationFrame(u),this.resetObservers=()=>{o(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const s=kc(e,t,r,!1),n=function(e,t,r,s){const n=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const i of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])continue;const o=bl(t.CanvasRenderingContext2D.prototype,i,function(n){return function(...o){return Ol(this.canvas,r,s,!0)||setTimeout(()=>{const r=Cc(o,t,this);e(this.canvas,{type:Wl["2D"],property:i,args:r})},0),n.apply(this,o)}});n.push(o)}catch{const r=vl(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:Wl["2D"],property:i,args:[t],setter:!0})}});n.push(r)}return()=>{n.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r),o=function(e,t,r,s){const n=[];return n.push(...xc(t.WebGLRenderingContext.prototype,Wl.WebGL,e,r,s,t)),void 0!==t.WebGL2RenderingContext&&n.push(...xc(t.WebGL2RenderingContext.prototype,Wl.WebGL2,e,r,s,t)),()=>{n.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{s(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||-1===t)return;const s=r.map(e=>{const{type:t,...r}=e;return r}),{type:n}=r[0];this.mutationCb({id:t,type:n,commands:s}),this.pendingCanvasMutations.delete(e)}}class Tc{constructor(e){M(this,"trackedLinkElements",new WeakSet),M(this,"mutationCb"),M(this,"adoptedStyleSheetCb"),M(this,"styleMirror",new Pl),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const r={id:t,styleIds:[]},s=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),s.push({styleId:e,rules:Array.from(t.rules||CSSRule,(e,r)=>({rule:Y(e,t.href),index:r}))})),r.styleIds.push(e)}s.length>0&&(r.styles=s),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Nc{constructor(){M(this,"nodeMap",new WeakMap),M(this,"active",!1)}inOtherBuffer(e,t){const r=this.nodeMap.get(e);return r&&Array.from(r).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}let Pc,Dc,Lc,Fc=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(E=e.contentWindow)?void 0:E.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const _c=new X;function Uc(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:s,blockClass:n="rr-block",blockSelector:o=null,ignoreClass:i="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:h=!0,maskAllInputs:u,maskInputOptions:p,slimDOMOptions:d,maskInputFn:f,maskTextFn:m,hooks:g,packFn:y,sampling:w={},dataURLOptions:v={},mousemoveWait:b,recordDOM:S=!0,recordCanvas:C=!1,recordCrossOriginIframes:I=!1,recordAfter:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:x=!1,collectFonts:O=!1,inlineImages:E=!1,plugins:R,keepIframeSrcFn:M=()=>!1,ignoreCSSAttributes:A=new Set([]),errorHandler:T}=e;ql=T;const N=!I||window.parent===window;let P=!1;if(!N)try{window.parent.document&&(P=!1)}catch(e){P=!0}if(N&&!t)throw new Error("emit function is required");if(!N&&!P)return()=>{};void 0!==b&&void 0===w.mousemove&&(w.mousemove=b),_c.reset();const D=!0===u?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==p?p:{password:!0},L=!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||{};let F;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let _=0;const U=e=>{for(const t of R||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!P&&(e=y(e)),e};Pc=(e,n)=>{var o;const i=e;if(i.timestamp=Sl(),!(null==(o=ec[0])?void 0:o.isFrozen())||i.type===_l.FullSnapshot||i.type===_l.IncrementalSnapshot&&i.data.source===Ul.Mutation||ec.forEach(e=>e.unfreeze()),N)null==t||t(U(i),n);else if(P){const e={type:"rrweb",event:U(i),origin:window.location.origin,isCheckout:n};window.parent.postMessage(e,"*")}if(i.type===_l.FullSnapshot)F=i,_=0;else if(i.type===_l.IncrementalSnapshot){if(i.data.source===Ul.Mutation&&i.data.isAttachIframe)return;_++;const e=s&&_>=s,t=r&&i.timestamp-F.timestamp>r;(e||t)&&Dc(!0)}};const B=e=>{Pc({type:_l.IncrementalSnapshot,data:{source:Ul.Mutation,...e}})},j=e=>Pc({type:_l.IncrementalSnapshot,data:{source:Ul.Scroll,...e}}),W=e=>Pc({type:_l.IncrementalSnapshot,data:{source:Ul.CanvasMutation,...e}}),z=new Tc({mutationCb:B,adoptedStyleSheetCb:e=>Pc({type:_l.IncrementalSnapshot,data:{source:Ul.AdoptedStyleSheet,...e}})}),V=new fc({mirror:_c,mutationCb:B,stylesheetManager:z,recordCrossOriginIframes:I,wrappedEmit:Pc});for(const e of R||[])e.getMirror&&e.getMirror({nodeMirror:_c,crossOriginIframeMirror:V.crossOriginIframeMirror,crossOriginIframeStyleMirror:V.crossOriginIframeStyleMirror});const G=new Nc;Lc=new Ac({recordCanvas:C,mutationCb:W,win:window,blockClass:n,blockSelector:o,mirror:_c,sampling:w.canvas,dataURLOptions:v});const Z=new mc({mutationCb:B,scrollCb:j,bypassOptions:{blockClass:n,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:h,maskInputOptions:D,dataURLOptions:v,maskTextFn:m,maskInputFn:f,recordCanvas:C,inlineImages:E,sampling:w,slimDOMOptions:L,iframeManager:V,stylesheetManager:z,canvasManager:Lc,keepIframeSrcFn:M,processedNodeManager:G},mirror:_c});Dc=(e=!1)=>{if(!S)return;Pc({type:_l.Meta,data:{href:window.location.href,width:kl(),height:Il()}},e),z.reset(),Z.init(),ec.forEach(e=>e.lock());const t=function(e,t){const{mirror:r=new X,blockClass:s="rr-block",blockSelector:n=null,maskTextClass:o="rr-mask",maskTextSelector:i=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:h=!1,maskTextFn:u,maskInputFn:p,slimDOM:d=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:v,stylesheetLoadTimeout:b,keepIframeSrcFn:S=()=>!1}=t||{};return Ie(e,{doc:e,mirror:r,blockClass:s,blockSelector:n,maskTextClass:o,maskTextSelector:i,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===h?{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===h?{password:!0}:h,maskTextFn:u,maskInputFn:p,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:l,recordCanvas:c,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:v,stylesheetLoadTimeout:b,keepIframeSrcFn:S,newlyAddedElement:!1})}(document,{mirror:_c,blockClass:n,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:h,maskAllInputs:D,maskTextFn:m,maskInputFn:f,slimDOM:L,dataURLOptions:v,recordCanvas:C,inlineImages:E,onSerialize:e=>{Al(e,_c)&&V.addIframe(e),Tl(e,_c)&&z.trackLinkElement(e),Nl(e)&&Z.addShadowRoot(fl.shadowRoot(e),document)},onIframeLoad:(e,t)=>{V.attachIframe(e,t),Z.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{z.attachLinkElement(e,t)},keepIframeSrcFn:M});if(!t)return console.warn("Failed to snapshot the document");Pc({type:_l.FullSnapshot,data:{node:t,initialOffset:Cl(window)}},e),ec.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,_c.getId(document))};try{const e=[],t=e=>{var t;return Ql(hc)({mutationCb:B,mousemoveCb:(e,t)=>Pc({type:_l.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Pc({type:_l.IncrementalSnapshot,data:{source:Ul.MouseInteraction,...e}}),scrollCb:j,viewportResizeCb:e=>Pc({type:_l.IncrementalSnapshot,data:{source:Ul.ViewportResize,...e}}),inputCb:e=>Pc({type:_l.IncrementalSnapshot,data:{source:Ul.Input,...e}}),mediaInteractionCb:e=>Pc({type:_l.IncrementalSnapshot,data:{source:Ul.MediaInteraction,...e}}),styleSheetRuleCb:e=>Pc({type:_l.IncrementalSnapshot,data:{source:Ul.StyleSheetRule,...e}}),styleDeclarationCb:e=>Pc({type:_l.IncrementalSnapshot,data:{source:Ul.StyleDeclaration,...e}}),canvasMutationCb:W,fontCb:e=>Pc({type:_l.IncrementalSnapshot,data:{source:Ul.Font,...e}}),selectionCb:e=>{Pc({type:_l.IncrementalSnapshot,data:{source:Ul.Selection,...e}})},customElementCb:e=>{Pc({type:_l.IncrementalSnapshot,data:{source:Ul.CustomElement,...e}})},blockClass:n,ignoreClass:i,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:D,inlineStylesheet:h,sampling:w,recordDOM:S,recordCanvas:C,inlineImages:E,userTriggeredOnInput:x,collectFonts:O,doc:e,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:M,blockSelector:o,slimDOMOptions:L,dataURLOptions:v,mirror:_c,iframeManager:V,stylesheetManager:z,shadowDomManager:Z,processedNodeManager:G,canvasManager:Lc,ignoreCSSAttributes:A,plugins:(null==(t=null==R?void 0:R.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>Pc({type:_l.Plugin,data:{plugin:e.name,payload:t}})})))||[]},g)};V.addLoadListener(r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}});const r=()=>{Dc(),e.push(t(document)),Fc=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(ml("DOMContentLoaded",()=>{Pc({type:_l.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&r()})),e.push(ml("load",()=>{Pc({type:_l.Load,data:{}}),"load"===k&&r()},window))),()=>{e.forEach(e=>e()),G.destroy(),Fc=!1,ql=void 0}}catch(e){console.warn(e)}}var Bc,jc,Wc,zc;Uc.addCustomEvent=(e,t)=>{if(!Fc)throw new Error("please add custom event after start recording");Pc({type:_l.Custom,data:{tag:e,payload:t}})},Uc.freezePage=()=>{ec.forEach(e=>e.freeze())},Uc.takeFullSnapshot=e=>{if(!Fc)throw new Error("please take full snapshot after start recording");Dc(e)},Uc.mirror=_c,(jc=Bc||(Bc={}))[jc.NotStarted=0]="NotStarted",jc[jc.Running=1]="Running",jc[jc.Stopped=2]="Stopped",e.SessionEventType=void 0,(Wc=e.SessionEventType||(e.SessionEventType={})).CONSOLE="CONSOLE",Wc.ERROR="ERROR",Wc.NETWORK="NETWORK",Wc.CUSTOM="CUSTOM",Wc.PERFORMANCE="PERFORMANCE",Wc.PAGE_VIEW="PAGE_VIEW",e.ConsoleLevel=void 0,(zc=e.ConsoleLevel||(e.ConsoleLevel={})).LOG="log",zc.INFO="info",zc.WARN="warn",zc.ERROR="error",zc.DEBUG="debug";class Vc{constructor(e,t){this.session=null,this.eventBuffer=[],this.telemetryBuffer=[],this.originalConsoleMethods=new Map,this.isRecording=!1,this.client=e,this.config=this.applyDefaults(t||{}),this.shouldRecordSession()&&this.init()}applyDefaults(e){return{enabled:e.enabled??!0,sampleRate:e.sampleRate??1,recording:{maskAllInputs:e.recording?.maskAllInputs??!0,maskTextSelector:e.recording?.maskTextSelector??"[data-mask]",blockSelector:e.recording?.blockSelector??"[data-block]",recordCanvas:e.recording?.recordCanvas??!1,collectFonts:e.recording?.collectFonts??!1,inlineStylesheet:e.recording?.inlineStylesheet??!0,inlineImages:e.recording?.inlineImages??!1},buffering:{flushInterval:e.buffering?.flushInterval??5e3,maxBufferSize:e.buffering?.maxBufferSize??100,maxSessionDuration:e.buffering?.maxSessionDuration??36e5},telemetry:{captureConsole:e.telemetry?.captureConsole??!0,captureNetwork:e.telemetry?.captureNetwork??!0,captureErrors:e.telemetry?.captureErrors??!0,capturePerformance:e.telemetry?.capturePerformance??!0},privacy:{maskEmails:e.privacy?.maskEmails??!0,maskPhones:e.privacy?.maskPhones??!0,maskCreditCards:e.privacy?.maskCreditCards??!0,customMaskPatterns:e.privacy?.customMaskPatterns??[]}}}shouldRecordSession(){return!!this.config.enabled&&(void 0===this.config.sampleRate||this.config.sampleRate>=1||Math.random()<this.config.sampleRate)}async init(){try{await this.startSession(),this.startRrwebRecording(),setTimeout(()=>{this.flush()},100),this.config.telemetry?.captureConsole&&this.interceptConsole(),this.config.telemetry?.captureNetwork&&this.interceptNetwork(),this.config.telemetry?.captureErrors&&this.captureErrors(),this.config.telemetry?.capturePerformance&&this.capturePerformance(),this.startFlushInterval(),this.setupUnloadHandler(),this.isRecording=!0}catch(e){console.error("[SessionReplay] Failed to initialize:",e)}}async startSession(){const e=this.client.visitorId?.getVisitorId(),t=this.client.deviceInfo?.getDeviceInfo();this.sessionStartTime=Date.now();const r={visitorId:e,initialUrl:window.location.href,referrer:document.referrer||void 0,deviceType:t?.deviceType,browser:t?.browser,os:t?.os,viewport:{width:window.innerWidth,height:window.innerHeight}};try{const e=await this.client.http.post("/api/v1/session-replays/start/",r);this.session={sessionId:e.sessionId,startTime:new Date(this.sessionStartTime),initialUrl:r.initialUrl,referrer:r.referrer,visitorId:r.visitorId,deviceType:r.deviceType,browser:r.browser,os:r.os,viewport:r.viewport,status:"ACTIVE"}}catch(e){throw console.error("[SessionReplay] Failed to start session:",e),e}}startRrwebRecording(){this.stopRecording=Uc({emit:e=>{this.eventBuffer.push(e),this.eventBuffer.length>=(this.config.buffering?.maxBufferSize||100)&&this.flush()},maskAllInputs:this.config.recording?.maskAllInputs,maskTextSelector:this.config.recording?.maskTextSelector,blockSelector:this.config.recording?.blockSelector,recordCanvas:this.config.recording?.recordCanvas,collectFonts:this.config.recording?.collectFonts,inlineStylesheet:this.config.recording?.inlineStylesheet,inlineImages:this.config.recording?.inlineImages,maskTextFn:e=>this.maskPII(e)})}interceptConsole(){[e.ConsoleLevel.LOG,e.ConsoleLevel.INFO,e.ConsoleLevel.WARN,e.ConsoleLevel.ERROR,e.ConsoleLevel.DEBUG].forEach(t=>{const r=console[t];this.originalConsoleMethods.set(t,r),console[t]=(...s)=>{r.apply(console,s),this.addTelemetryEvent({type:e.SessionEventType.CONSOLE,timestamp:new Date,offsetMs:this.getOffsetMs(),console:{level:t,message:s.map(e=>String(e)).join(" "),args:s.map(e=>this.serializeValue(e))}})}})}interceptNetwork(){this.originalFetch=window.fetch,window.fetch=async(...t)=>{const r=Date.now(),s="string"==typeof t[0]?t[0]:t[0].url,n=(t[1]?.method||"GET").toUpperCase();try{const o=await this.originalFetch.apply(window,t),i=Date.now()-r;return this.addTelemetryEvent({type:e.SessionEventType.NETWORK,timestamp:new Date,offsetMs:this.getOffsetMs(),network:{method:n,url:s,statusCode:o.status,duration:i}}),o}catch(t){const o=Date.now()-r;throw this.addTelemetryEvent({type:e.SessionEventType.NETWORK,timestamp:new Date,offsetMs:this.getOffsetMs(),network:{method:n,url:s,duration:o,statusCode:0}}),t}},this.originalXHROpen=XMLHttpRequest.prototype.open,this.originalXHRSend=XMLHttpRequest.prototype.send;const t=this;XMLHttpRequest.prototype.open=function(e,r,s=!0,n,o){return this._crx_method=e,this._crx_url=r.toString(),this._crx_startTime=Date.now(),t.originalXHROpen.call(this,e,r,s,n,o)},XMLHttpRequest.prototype.send=function(r){return this.addEventListener("load",function(){const r=Date.now()-this._crx_startTime;t.addTelemetryEvent({type:e.SessionEventType.NETWORK,timestamp:new Date,offsetMs:t.getOffsetMs(),network:{method:this._crx_method,url:this._crx_url,statusCode:this.status,duration:r}})}),this.addEventListener("error",function(){const r=Date.now()-this._crx_startTime;t.addTelemetryEvent({type:e.SessionEventType.NETWORK,timestamp:new Date,offsetMs:t.getOffsetMs(),network:{method:this._crx_method,url:this._crx_url,statusCode:0,duration:r}})}),t.originalXHRSend.call(this,r)}}captureErrors(){window.addEventListener("error",t=>{this.addTelemetryEvent({type:e.SessionEventType.ERROR,timestamp:new Date,offsetMs:this.getOffsetMs(),error:{message:t.message,stack:t.error?.stack,filename:t.filename,lineno:t.lineno,colno:t.colno}})}),window.addEventListener("unhandledrejection",t=>{this.addTelemetryEvent({type:e.SessionEventType.ERROR,timestamp:new Date,offsetMs:this.getOffsetMs(),error:{message:`Unhandled Promise Rejection: ${t.reason}`,stack:t.reason?.stack}})})}capturePerformance(){if(window.performance&&window.performance.timing&&window.addEventListener("load",()=>{setTimeout(()=>{const t=window.performance.timing,r=t.navigationStart;this.addTelemetryEvent({type:e.SessionEventType.PERFORMANCE,timestamp:new Date,offsetMs:this.getOffsetMs(),performance:{metric:"dom_content_loaded",value:t.domContentLoadedEventEnd-r}}),this.addTelemetryEvent({type:e.SessionEventType.PERFORMANCE,timestamp:new Date,offsetMs:this.getOffsetMs(),performance:{metric:"page_load",value:t.loadEventEnd-r}})},0)}),"PerformanceObserver"in window)try{const t=new PerformanceObserver(t=>{const r=t.getEntries(),s=r[r.length-1];s&&this.addTelemetryEvent({type:e.SessionEventType.PERFORMANCE,timestamp:new Date,offsetMs:this.getOffsetMs(),performance:{metric:"lcp",value:s.renderTime||s.loadTime,rating:this.getRating(s.renderTime||s.loadTime,2500,4e3)}})});t.observe({entryTypes:["largest-contentful-paint"]});const r=new PerformanceObserver(t=>{t.getEntries().forEach(t=>{this.addTelemetryEvent({type:e.SessionEventType.PERFORMANCE,timestamp:new Date,offsetMs:this.getOffsetMs(),performance:{metric:"fid",value:t.processingStart-t.startTime,rating:this.getRating(t.processingStart-t.startTime,100,300)}})})});r.observe({entryTypes:["first-input"]});let s=0;const n=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{e.hadRecentInput||(s+=e.value)})});n.observe({entryTypes:["layout-shift"]}),window.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&this.addTelemetryEvent({type:e.SessionEventType.PERFORMANCE,timestamp:new Date,offsetMs:this.getOffsetMs(),performance:{metric:"cls",value:s,rating:this.getRating(s,.1,.25)}})})}catch(e){console.warn("[SessionReplay] PerformanceObserver not fully supported")}}getRating(e,t,r){return e<=t?"good":e<=r?"needs-improvement":"poor"}addTelemetryEvent(e){this.telemetryBuffer.push(e)}getOffsetMs(){return this.sessionStartTime?Date.now()-this.sessionStartTime:0}serializeValue(e){try{return null==e?e:"function"==typeof e?"[Function]":e instanceof Error?{message:e.message,stack:e.stack}:"object"==typeof e?JSON.parse(JSON.stringify(e,null,2)):e}catch{return"[Unserializable]"}}maskPII(e){let t=e;return this.config.privacy?.maskEmails&&(t=t.replace(/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g,"***@***.***")),this.config.privacy?.maskPhones&&(t=t.replace(/(\+?\d{1,3}[-.\s]?)?(\(?\d{3}\)?[-.\s]?)?\d{3}[-.\s]?\d{4}/g,"***-***-****")),this.config.privacy?.maskCreditCards&&(t=t.replace(/\b\d{4}[\s-]?\d{4}[\s-]?\d{4}[\s-]?\d{4}\b/g,"****-****-****-****")),this.config.privacy?.customMaskPatterns?.forEach(({pattern:e,replacement:r})=>{t=t.replace(e,r)}),t}startFlushInterval(){const e=this.config.buffering?.flushInterval||5e3;this.flushIntervalId=window.setInterval(()=>{this.flush()},e)}async flush(){if(!this.session)return;if(0===this.eventBuffer.length&&0===this.telemetryBuffer.length)return;const e=[...this.eventBuffer],t=[...this.telemetryBuffer];this.eventBuffer=[],this.telemetryBuffer=[];try{const r={sessionId:this.session.sessionId,events:e,telemetryEvents:t};await this.client.http.post("/api/v1/session-replays/ingest/",r)}catch(r){console.error("[SessionReplay] Failed to flush events:",r),this.eventBuffer=[...e,...this.eventBuffer],this.telemetryBuffer=[...t,...this.telemetryBuffer]}}setupUnloadHandler(){window.addEventListener("beforeunload",()=>{this.stop()}),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&this.flush()})}async stop(){if(this.isRecording&&this.session)try{this.stopRecording&&this.stopRecording(),this.flushIntervalId&&clearInterval(this.flushIntervalId),await this.flush(),await this.client.http.post("/api/v1/session-replays/end/",{sessionId:this.session.sessionId}),this.isRecording=!1}catch(e){console.error("[SessionReplay] Failed to stop session:",e)}}logCustomEvent(t){this.isRecording&&this.addTelemetryEvent({type:e.SessionEventType.CUSTOM,timestamp:new Date,offsetMs:this.getOffsetMs(),custom:{name:t.name,data:t.data}})}getSession(){return this.session}destroy(){this.stop(),this.originalConsoleMethods.forEach((e,t)=>{console[t]=e}),this.originalFetch&&(window.fetch=this.originalFetch),this.originalXHROpen&&(XMLHttpRequest.prototype.open=this.originalXHROpen),this.originalXHRSend&&(XMLHttpRequest.prototype.send=this.originalXHRSend)}}const Gc="undefined"!=typeof window;e.AuthenticationError=s,e.AutoPageViewPlugin=O,e.CRMClient=class{constructor(e){this.plugins=[],this.config=new t(e),this.http=new h(this.config),this._events=new p(this.http),this._contacts=new d(this.http),this._deals=new f(this.http),this._experiments=new m(this.http),Gc&&this.initBrowserPlugins()}get events(){return this._events}get contacts(){return this._contacts}get deals(){return this._deals}get experiments(){return this._experiments}get visitorId(){return this._visitorId}get deviceInfo(){return this._deviceInfo}get sessionReplay(){return this._sessionReplay}initBrowserPlugins(){this.config.persistVisitorId&&(this._visitorId=new b(this.config),this.plugins.push(this._visitorId)),this.config.autoDeviceInfo&&(this._deviceInfo=new x,this.plugins.push(this._deviceInfo)),this.config.autoPageView&&(this._autoPageView=new O(this),this.plugins.push(this._autoPageView)),!1!==this.config.sessionReplay?.enabled&&(this._sessionReplay=new Vc(this,this.config.sessionReplay),this.plugins.push(this._sessionReplay))}destroy(){this.plugins.forEach(e=>{e.destroy&&e.destroy()}),this.plugins=[]}},e.CRMError=r,e.Config=t,e.ContactsResource=d,e.DealsResource=f,e.DeviceInfoPlugin=x,e.EventsResource=p,e.ExperimentsResource=m,e.NetworkError=l,e.RateLimitError=i,e.ResourceNotFoundError=n,e.ServerError=a,e.SessionReplayPlugin=Vc,e.VERSION="1.2.5",e.ValidationError=o,e.VisitorIdPlugin=b,e.detectBrowser=C,e.detectDeviceType=S,e.detectOS=I,e.generateUUID=v,e.getDeviceInfo=k,e.getLocalStorageItem=y,e.isLocalStorageAvailable=g,e.removeLocalStorageItem=function(e){if(!g())return!1;try{return window.localStorage.removeItem(e),!0}catch{return!1}},e.setLocalStorageItem=w});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Crexperium={})}(this,function(e){"use strict";class t{constructor(e){if(e.apiToken)this.apiToken=e.apiToken;else{const e="undefined"!=typeof process&&process.env?process.env.CRX_API_TOKEN:void 0;if(!e)throw new Error("API token is required. Provide it via config.apiToken or CRX_API_TOKEN environment variable.");this.apiToken=e}this.baseUrl=e.baseUrl||"https://budget-api-s366in24na-uc.a.run.app",this.timeout=e.timeout??3e4,this.maxRetries=e.maxRetries??3,this.retryDelay=e.retryDelay??1e3,this.autoPageView=e.autoPageView??!0,this.autoDeviceInfo=e.autoDeviceInfo??!0,this.persistVisitorId=e.persistVisitorId??!0,this.visitorIdKey=e.visitorIdKey||"crx_visitor_id",this.sessionReplay=e.sessionReplay,this.validate()}validate(){if(this.timeout<0)throw new Error("Timeout must be a positive number");if(this.maxRetries<0)throw new Error("Max retries must be a positive number");if(this.retryDelay<0)throw new Error("Retry delay must be a positive number");this.baseUrl.endsWith("/")&&(this.baseUrl=this.baseUrl.slice(0,-1))}}class s extends Error{constructor(e,t,r){super(e),this.response=t,this.statusCode=r,this.name="CRMError",Object.setPrototypeOf(this,s.prototype)}}class r extends s{constructor(e="Authentication failed",t){super(e,t,401),this.name="AuthenticationError",Object.setPrototypeOf(this,r.prototype)}}class n extends s{constructor(e="Resource not found",t){super(e,t,404),this.name="ResourceNotFoundError",Object.setPrototypeOf(this,n.prototype)}}class o extends s{constructor(e="Validation failed",t,s){super(e,s,400),this.errors=t,this.name="ValidationError",Object.setPrototypeOf(this,o.prototype)}}class i extends s{constructor(e="Rate limit exceeded",t,s){super(e,s,429),this.retryAfter=t,this.name="RateLimitError",Object.setPrototypeOf(this,i.prototype)}}class a extends s{constructor(e="Server error",t=500,s){super(e,s,t),this.name="ServerError",Object.setPrototypeOf(this,a.prototype)}}class l extends s{constructor(e="Network error",t){super(e),this.originalError=t,this.name="NetworkError",Object.setPrototypeOf(this,l.prototype)}}const c="undefined"!=typeof window;class h{constructor(e){this.config=e,this.headers={Authorization:`Bearer ${e.apiToken}`,"Content-Type":"application/json","User-Agent":"crexperium-ts-sdk/1.0.0"}}async request(e,t,s,i){const a=this.buildUrl(t,i);let c;for(let t=0;t<=this.config.maxRetries;t++)try{const t=await this.makeRequest(a,e,s);return await this.handleResponse(t)}catch(e){if(c=e,e instanceof r||e instanceof n||e instanceof o)throw e;if(t<this.config.maxRetries){const e=this.calculateRetryDelay(t);await this.sleep(e);continue}}throw c||new l("Request failed after retries")}async get(e,t){return this.request("GET",e,void 0,t)}async post(e,t){return this.request("POST",e,t)}async patch(e,t){return this.request("PATCH",e,t)}async put(e,t){return this.request("PUT",e,t)}async delete(e){return this.request("DELETE",e)}buildUrl(e,t){const s=e.startsWith("/")?e:`/${e}`;let r=`${this.config.baseUrl}${s}`;if(t){const e=new URLSearchParams;Object.entries(t).forEach(([t,s])=>{null!=s&&(Array.isArray(s)?s.forEach(s=>e.append(t,String(s))):e.append(t,String(s)))});const s=e.toString();s&&(r+=`?${s}`)}return r}async makeRequest(e,t,s){const r={method:t,headers:this.headers};s&&"GET"!==t&&(r.body=JSON.stringify(s));const n=new AbortController,o=setTimeout(()=>n.abort(),this.config.timeout);try{const t=function(){if(c&&void 0!==window.fetch)return window.fetch.bind(window);if(void 0!==globalThis.fetch)return globalThis.fetch.bind(globalThis);throw new Error("Fetch is not available. Please upgrade to Node.js 18+ which includes native fetch support. Alternatively, install and configure a polyfill.")}(),s=await t(e,{...r,signal:n.signal});return clearTimeout(o),s}catch(e){if(clearTimeout(o),"AbortError"===e.name)throw new l("Request timeout",e);throw new l("Network request failed",e)}}async handleResponse(e){if(e.ok){if(204===e.status)return{};try{return await e.json()}catch(t){throw new s("Invalid JSON response",e,e.status)}}let t;try{t=await e.json()}catch{t={detail:e.statusText}}const l=t.detail||t.message||"Request failed";switch(e.status){case 400:throw new o(l,t.errors||t,e);case 401:throw new r(l,e);case 404:throw new n(l,e);case 429:{const t=e.headers.get("Retry-After")||void 0;throw new i(l,t,e)}case 500:case 502:case 503:case 504:throw new a(l,e.status,e);default:throw e.status>=400&&e.status<500?new s(l,e,e.status):new a(l,e.status,e)}}calculateRetryDelay(e){return this.config.retryDelay*Math.pow(2,e)}sleep(e){return new Promise(t=>setTimeout(t,e))}}class u{constructor(e){this.http=e}cleanObject(e){const t={};return Object.entries(e).forEach(([e,s])=>{null!=s&&(s instanceof Date?t[e]=s.toISOString():t[e]=s)}),t}toSnakeCase(e){const t={};return Object.entries(e).forEach(([e,s])=>{const r=e.replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`);t[r]=s}),t}toCamelCase(e){const t={};return Object.entries(e).forEach(([e,s])=>{const r=e.replace(/_([a-z])/g,(e,t)=>t.toUpperCase());t[r]=s}),t}}class p extends u{async track(e){const t=this.cleanObject(this.toSnakeCase(e));if(!t.event_key)throw new Error("eventKey is required");return this.http.post("/api/v1/events/track/",t)}async trackBatch(e){if(!e||0===e.length)throw new Error("Events array cannot be empty");if(e.length>100)throw new Error("Cannot track more than 100 events in a single batch");const t=e.map(e=>this.cleanObject(this.toSnakeCase(e)));return this.http.post("/api/v1/events/batch/",{events:t})}async get(e){if(!e)throw new Error("Event ID is required");return this.http.get(`/api/v1/events/${e}/`)}async list(e){const t=e?this.cleanObject(this.toSnakeCase(e)):void 0;return this.http.get("/api/v1/events/",t)}async stats(e=30){if(e<1)throw new Error("Days must be at least 1");return this.http.get("/api/v1/events/stats/",{days:e})}}class d extends u{async identify(e){if(!!!(e.externalId||e.visitorId||e.email||e.phone||e.emailAddresses&&e.emailAddresses.length>0||e.phoneNumbers&&e.phoneNumbers.length>0))throw new Error("At least one identifier is required: externalId, visitorId, email, phone, emailAddresses, or phoneNumbers");const t=[...e.emailAddresses||[]];e.email&&!t.includes(e.email)&&t.unshift(e.email);const s=[...e.phoneNumbers||[]];e.phone&&!s.includes(e.phone)&&s.unshift(e.phone);const r={...this.toSnakeCase(e),email_addresses:t.length>0?t:void 0,phone_numbers:s.length>0?s:void 0};t.length>0&&delete r.email,s.length>0&&delete r.phone;const n=this.cleanObject(r);return this.http.post("/api/v1/contacts/identify/",n)}async create(e){const t=[...e.emailAddresses||[]];e.email&&!t.includes(e.email)&&t.unshift(e.email);const s=[...e.phoneNumbers||[]];if(e.phone&&!s.includes(e.phone)&&s.unshift(e.phone),0===t.length&&0===s.length)throw new Error("At least one contact method is required: provide either email/emailAddresses or phone/phoneNumbers");const r={...this.toSnakeCase(e),email_addresses:t.length>0?t:void 0,phone_numbers:s.length>0?s:void 0};t.length>0&&delete r.email,s.length>0&&delete r.phone;const n=this.cleanObject(r);return this.http.post("/api/v1/contacts/",n)}async get(e){if(!e)throw new Error("Contact ID is required");return this.http.get(`/api/v1/contacts/${e}/`)}async update(e,t){if(!e)throw new Error("Contact ID is required");const s=this.cleanObject(this.toSnakeCase(t));return this.http.patch(`/api/v1/contacts/${e}/`,s)}async list(e){const t=e?this.cleanObject(this.toSnakeCase(e)):void 0;return this.http.get("/api/v1/contacts/",t)}async delete(e){if(!e)throw new Error("Contact ID is required");return this.http.delete(`/api/v1/contacts/${e}/`)}}class f extends u{async create(e){if(!e.name)throw new Error("Deal name is required");const t=this.cleanObject(this.toSnakeCase(e));return this.http.post("/api/v1/deals/",t)}async get(e){if(!e)throw new Error("Deal ID is required");return this.http.get(`/api/v1/deals/${e}/`)}async update(e,t){if(!e)throw new Error("Deal ID is required");const s=this.cleanObject(this.toSnakeCase(t));return this.http.patch(`/api/v1/deals/${e}/`,s)}async moveStage(e,t){if(!e)throw new Error("Deal ID is required");if(!t)throw new Error("Stage ID is required");return this.http.post(`/api/v1/deals/${e}/move-stage/`,{pipeline_stage:t})}async list(e){const t=e?this.cleanObject(this.toSnakeCase(e)):void 0;return this.http.get("/api/v1/deals/",t)}async delete(e){if(!e)throw new Error("Deal ID is required");return this.http.delete(`/api/v1/deals/${e}/`)}}class m extends u{async get(e){return this.http.get(`/api/v1/experiments/${e}/`)}async assign(e,t){return this.http.post(`/api/v1/experiments/${e}/assign/`,t)}async trackConversion(e,t){await this.http.post(`/api/v1/experiments/${e}/convert/`,t)}async getVariant(e,t){return await this.assign(e,t)}}function g(){if("undefined"==typeof window||void 0===window.localStorage)return!1;try{const e="__crx_test__";return window.localStorage.setItem(e,"test"),window.localStorage.removeItem(e),!0}catch{return!1}}function y(e){if(!g())return null;try{return window.localStorage.getItem(e)}catch{return null}}function w(e,t){if(!g())return!1;try{return window.localStorage.setItem(e,t),!0}catch{return!1}}function v(){return"undefined"!=typeof crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}class b{constructor(e){this.config=e,this.visitorId=this.getOrCreateVisitorId()}getOrCreateVisitorId(){const e=y(this.config.visitorIdKey);if(e)return e;const t=v();return w(this.config.visitorIdKey,t),t}getVisitorId(){return this.visitorId}setVisitorId(e){this.visitorId=e,w(this.config.visitorIdKey,e)}resetVisitorId(){const e=v();return this.setVisitorId(e),e}destroy(){}}function S(e){const t=e.toLowerCase();return/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(t)?"tablet":/Mobile|Android|iP(hone|od)|IEMobile|BlackBerry|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(t)?"mobile":"desktop"}function C(e){const t=e;return t.indexOf("Edge")>-1||t.indexOf("Edg")>-1?"Edge":t.indexOf("Chrome")>-1?"Chrome":t.indexOf("Safari")>-1?"Safari":t.indexOf("Firefox")>-1?"Firefox":t.indexOf("MSIE")>-1||t.indexOf("Trident/")>-1?"IE":t.indexOf("Opera")>-1||t.indexOf("OPR")>-1?"Opera":"Unknown"}function I(e){const t=e;if(t.indexOf("Windows NT 10.0")>-1)return"Windows 10";if(t.indexOf("Windows NT 6.3")>-1)return"Windows 8.1";if(t.indexOf("Windows NT 6.2")>-1)return"Windows 8";if(t.indexOf("Windows NT 6.1")>-1)return"Windows 7";if(t.indexOf("Windows NT 6.0")>-1)return"Windows Vista";if(t.indexOf("Windows NT 5.1")>-1)return"Windows XP";if(t.indexOf("Win")>-1)return"Windows";if(t.indexOf("Mac OS X 10_15")>-1)return"macOS Catalina";if(t.indexOf("Mac OS X 10_14")>-1)return"macOS Mojave";if(t.indexOf("Mac OS X 10_13")>-1)return"macOS High Sierra";if(t.indexOf("Mac")>-1)return"macOS";if(t.indexOf("Android")>-1){const e=t.match(/Android (\d+(\.\d+)?)/);return e?`Android ${e[1]}`:"Android"}if(t.indexOf("like Mac OS X")>-1){const e=t.match(/OS (\d+)_(\d+)/);return e?`iOS ${e[1]}.${e[2]}`:"iOS"}return t.indexOf("Linux")>-1?"Linux":t.indexOf("Ubuntu")>-1?"Ubuntu":t.indexOf("CrOS")>-1?"Chrome OS":"Unknown"}function k(){if("undefined"==typeof navigator)return{userAgent:"",deviceType:"desktop",browser:"Unknown",os:"Unknown"};const e=navigator.userAgent;return{userAgent:e,deviceType:S(e),browser:C(e),os:I(e)}}class x{constructor(){this.deviceInfo=k()}getDeviceInfo(){return this.deviceInfo}getDeviceType(){return this.deviceInfo.deviceType}getBrowser(){return this.deviceInfo.browser}getOS(){return this.deviceInfo.os}getUserAgent(){return this.deviceInfo.userAgent}destroy(){}}class O{constructor(e){this.client=e,this.previousUrl="undefined"!=typeof window?window.location.href:"",this.trackPageView(),this.initHistoryTracking()}trackPageView(){if("undefined"==typeof window||!this.client.events)return;const e=window.location.href;if(e===this.previousUrl)return;this.previousUrl=e;const t=this.client.visitorId?.getVisitorId?.()||void 0,s=this.client.deviceInfo?.getDeviceInfo?.();this.client.events.track({eventKey:"page_view",visitorId:t,pageUrl:window.location.href,pageTitle:document.title,referrer:document.referrer||void 0,userAgent:s?.userAgent,deviceType:s?.deviceType,browser:s?.browser,os:s?.os}).catch(e=>{console.error("[AutoPageView] Failed to track page view:",e)})}initHistoryTracking(){"undefined"!=typeof window&&"undefined"!=typeof history&&(this.originalPushState=history.pushState,this.originalReplaceState=history.replaceState,history.pushState=(...e)=>{this.originalPushState.apply(history,e),this.trackPageView()},history.replaceState=(...e)=>{this.originalReplaceState.apply(history,e),this.trackPageView()},this.popStateHandler=()=>{this.trackPageView()},window.addEventListener("popstate",this.popStateHandler))}destroy(){"undefined"!=typeof window&&"undefined"!=typeof history&&(this.originalPushState&&(history.pushState=this.originalPushState),this.originalReplaceState&&(history.replaceState=this.originalReplaceState),this.popStateHandler&&window.removeEventListener("popstate",this.popStateHandler))}}var E,R=Object.defineProperty,M=(e,t,s)=>((e,t,s)=>t in e?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s),A=Object.defineProperty,T=(e,t,s)=>((e,t,s)=>t in e?A(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s),N=(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))(N||{});const P={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},D={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},L={};function F(e){if(L[e])return L[e];const t=globalThis[e],s=t.prototype,r=e in P?P[e]:void 0,n=Boolean(r&&r.every(e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(s,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))})),o=e in D?D[e]:void 0,i=Boolean(o&&o.every(e=>{var t;return"function"==typeof s[e]&&(null==(t=s[e])?void 0:t.toString().includes("[native code]"))}));if(n&&i&&!globalThis.Zone)return L[e]=t.prototype,t.prototype;try{const r=document.createElement("iframe");document.body.appendChild(r);const n=r.contentWindow;if(!n)return t.prototype;const o=n[e].prototype;return document.body.removeChild(r),o?L[e]=o:s}catch{return s}}const _={};function U(e,t,s){var r;const n=`${e}.${String(s)}`;if(_[n])return _[n].call(t);const o=F(e),i=null==(r=Object.getOwnPropertyDescriptor(o,s))?void 0:r.get;return i?(_[n]=i,i.call(t)):t[s]}const B={};function j(e,t,s){const r=`${e}.${String(s)}`;if(B[r])return B[r].bind(t);const n=F(e)[s];return"function"!=typeof n?t[s]:(B[r]=n,n.bind(t))}const W={childNodes:function(e){return U("Node",e,"childNodes")},parentNode:function(e){return U("Node",e,"parentNode")},parentElement:function(e){return U("Node",e,"parentElement")},textContent:function(e){return U("Node",e,"textContent")},contains:function(e,t){return j("Node",e,"contains")(t)},getRootNode:function(e){return j("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?U("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?U("Element",e,"shadowRoot"):null},querySelector:function(e,t){return U("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return U("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return F("MutationObserver").constructor}};function z(e){return e.nodeType===e.ELEMENT_NODE}function V(e){const t=e&&"host"in e&&"mode"in e&&W.host(e)||null;return Boolean(t&&"shadowRoot"in t&&W.shadowRoot(t)===e)}function G(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Z(e){try{const s=e.rules||e.cssRules;if(!s)return null;let r=e.href;!r&&e.ownerNode&&e.ownerNode.ownerDocument&&(r=e.ownerNode.ownerDocument.location.href);const n=Array.from(s,e=>Y(e,r)).join("");return(t=n).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}catch(e){return null}var t}function Y(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=Z(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const s=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?s.push("layer"):e.layerName&&s.push(`layer(${e.layerName})`),e.supportsText&&s.push(`supports(${e.supportsText})`),e.media.length&&s.push(e.media.mediaText),s.join(" ")+";"}(e)}catch(s){t=e.cssText}return e.styleSheet.href?re(t,e.styleSheet.href):t}{let s=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(s=function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(s)),t?re(s,t):s}}class X{constructor(){T(this,"idNodeMap",new Map),T(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const s=t.id;this.idNodeMap.set(s,e),this.nodeMetaMap.set(e,t)}replace(e,t){const s=this.getNode(e);if(s){const e=this.nodeMetaMap.get(s);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function H({element:e,maskInputOptions:t,tagName:s,type:r,value:n,maskInputFn:o}){let i=n||"";const a=r&&J(r);return(t[s.toLowerCase()]||a&&t[a])&&(i=o?o(i,e):"*".repeat(i.length)),i}function J(e){return e.toLowerCase()}const $="__rrweb_original__";function K(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?J(t):null}function q(e,t){let s;try{s=new URL(e,t??window.location.href)}catch(e){return null}const r=s.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==r?void 0:r[1])??null}const Q=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ee=/^(?:[a-z+]+:)?\/\//i,te=/^www\..*/i,se=/^(data:)([^,]*),(.*)/i;function re(e,t){return(e||"").replace(Q,(e,s,r,n,o,i)=>{const a=r||o||i,l=s||n||"";if(!a)return e;if(ee.test(a)||te.test(a))return`url(${l}${a}${l})`;if(se.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${l})`;const c=t.split("/"),h=a.split("/");c.pop();for(const e of h)"."!==e&&(".."===e?c.pop():c.push(e));return`url(${l}${c.join("/")}${l})`})}function ne(e){return e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function oe(e,t){return function(e,t){const s=Array.from(t.childNodes),r=[];if(s.length>1&&e&&"string"==typeof e){const t=ne(e);for(let n=1;n<s.length;n++)if(s[n].textContent&&"string"==typeof s[n].textContent){const o=ne(s[n].textContent);for(let s=3;s<o.length;s++){const n=o.substring(0,s);if(2===t.split(n).length){const s=t.indexOf(n);for(let t=s;t<e.length;t++)if(ne(e.substring(0,t)).length===s){r.push(e.substring(0,t)),e=e.substring(t);break}break}}}}return r.push(e),r}(e,t).join("/* rr_split */")}let ie=1;const ae=new RegExp("[^a-z0-9-_:]");function le(){return ie++}let ce,he;const ue=/^[^ \t\n\r\u000c]+/,pe=/^[, \t\n\r\u000c]+/;const de=new WeakMap;function fe(e,t){return t&&""!==t.trim()?ge(e,t):t}function me(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function ge(e,t){let s=de.get(e);if(s||(s=e.createElement("a"),de.set(e,s)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return s.setAttribute("href",t),s.href}function ye(e,t,s,r){return r?"src"===s||"href"===s&&("use"!==t||"#"!==r[0])||"xlink:href"===s&&"#"!==r[0]?fe(e,r):"background"!==s||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===s?function(e,t){if(""===t.trim())return t;let s=0;function r(e){let r;const n=e.exec(t.substring(s));return n?(r=n[0],s+=r.length,r):""}const n=[];for(;r(pe),!(s>=t.length);){let o=r(ue);if(","===o.slice(-1))o=fe(e,o.substring(0,o.length-1)),n.push(o);else{let r="";o=fe(e,o);let i=!1;for(;;){const e=t.charAt(s);if(""===e){n.push((o+r).trim());break}if(i)")"===e&&(i=!1);else{if(","===e){s+=1,n.push((o+r).trim());break}"("===e&&(i=!0)}r+=e,s+=1}}}return n.join(", ")}(e,r):"style"===s?re(r,ge(e)):"object"===t&&"data"===s?fe(e,r):r:fe(e,r):r}function we(e,t,s){return("video"===e||"audio"===e)&&"autoplay"===t}function ve(e,t,s){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!s&&ve(W.parentNode(e),t,s);for(let s=e.classList.length;s--;){const r=e.classList[s];if(t.test(r))return!0}return!!s&&ve(W.parentNode(e),t,s)}function be(e,t,s,r){let n;if(z(e)){if(n=e,!W.childNodes(n).length)return!1}else{if(null===W.parentElement(e))return!1;n=W.parentElement(e)}try{if("string"==typeof t){if(r){if(n.closest(`.${t}`))return!0}else if(n.classList.contains(t))return!0}else if(ve(n,t,r))return!0;if(s)if(r){if(n.closest(s))return!0}else if(n.matches(s))return!0}catch(e){}return!1}function Se(e,t){const{doc:s,mirror:r,blockClass:n,blockSelector:o,needsMask:i,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:h,dataURLOptions:u={},inlineImages:p,recordCanvas:d,keepIframeSrcFn:f,newlyAddedElement:m=!1,cssCaptured:g=!1}=t,y=function(e,t){if(!t.hasNode(e))return;const s=t.getId(e);return 1===s?void 0:s}(s,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:N.Document,childNodes:[],compatMode:e.compatMode}:{type:N.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:N.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return function(e,t){const{doc:s,blockClass:r,blockSelector:n,inlineStylesheet:o,maskInputOptions:i={},maskInputFn:a,dataURLOptions:l={},inlineImages:c,recordCanvas:h,keepIframeSrcFn:u,newlyAddedElement:p=!1,rootId:d}=t,f=function(e,t,s){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let s=e.classList.length;s--;){const r=e.classList[s];if(t.test(r))return!0}if(s)return e.matches(s)}catch(e){}return!1}(e,r,n),m=function(e){if(e instanceof HTMLFormElement)return"form";const t=J(e.tagName);return ae.test(t)?"div":t}(e);let g={};const y=e.attributes.length;for(let t=0;t<y;t++){const r=e.attributes[t];we(m,r.name,r.value)||(g[r.name]=ye(s,m,J(r.name),r.value))}if("link"===m&&o){const t=Array.from(s.styleSheets).find(t=>t.href===e.href);let r=null;t&&(r=Z(t)),r&&(delete g.rel,delete g.href,g._cssText=r)}if("style"===m&&e.sheet){let t=Z(e.sheet);t&&(e.childNodes.length>1&&(t=oe(t,e)),g._cssText=t)}if("input"===m||"textarea"===m||"select"===m){const t=e.value,s=e.checked;"radio"!==g.type&&"checkbox"!==g.type&&"submit"!==g.type&&"button"!==g.type&&t?g.value=H({element:e,type:K(e),tagName:m,value:t,maskInputOptions:i,maskInputFn:a}):s&&(g.checked=s)}"option"===m&&(e.selected&&!i.select?g.selected=!0:delete g.selected);"dialog"===m&&e.open&&(g.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===m&&h)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let s=0;s<e.width;s+=50)for(let r=0;r<e.height;r+=50){const n=t.getImageData,o=$ in n?n[$]:n;if(new Uint32Array(o.call(t,s,r,Math.min(50,e.width-s),Math.min(50,e.height-r)).data.buffer).some(e=>0!==e))return!1}return!0})(e)||(g.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){const t=e.toDataURL(l.type,l.quality),r=s.createElement("canvas");r.width=e.width,r.height=e.height;t!==r.toDataURL(l.type,l.quality)&&(g.rr_dataURL=t)}if("img"===m&&c){ce||(ce=s.createElement("canvas"),he=ce.getContext("2d"));const t=e,r=t.currentSrc||t.getAttribute("src")||"<unknown-src>",n=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{ce.width=t.naturalWidth,ce.height=t.naturalHeight,he.drawImage(t,0,0),g.rr_dataURL=ce.toDataURL(l.type,l.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o));console.warn(`Cannot inline img src=${r}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(n?g.crossOrigin=n:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}if("audio"===m||"video"===m){const t=g;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}p||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop));if(f){const{width:t,height:s}=e.getBoundingClientRect();g={class:g.class,rr_width:`${t}px`,rr_height:`${s}px`}}"iframe"!==m||u(g.src)||(e.contentDocument||(g.rr_src=g.src),delete g.src);let w;try{customElements.get(m)&&(w=!0)}catch(e){}return{type:N.Element,tagName:m,attributes:g,childNodes:[],isSVG:me(e)||void 0,needBlock:f,rootId:d,isCustom:w}}(e,{doc:s,blockClass:n,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:h,dataURLOptions:u,inlineImages:p,recordCanvas:d,keepIframeSrcFn:f,newlyAddedElement:m,rootId:y});case e.TEXT_NODE:return function(e,t){const{needsMask:s,maskTextFn:r,rootId:n,cssCaptured:o}=t,i=W.parentNode(e),a=i&&i.tagName;let l="";const c="STYLE"===a||void 0,h="SCRIPT"===a||void 0;h?l="SCRIPT_PLACEHOLDER":o||(l=W.textContent(e),c&&l&&(l=re(l,ge(t.doc))));!c&&!h&&l&&s&&(l=r?r(l,W.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:N.Text,textContent:l||"",rootId:n}}(e,{doc:s,needsMask:i,maskTextFn:c,rootId:y,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:N.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:N.Comment,textContent:W.textContent(e)||"",rootId:y};default:return!1}}function Ce(e){return null==e?"":e.toLowerCase()}function Ie(e,t){const{doc:s,mirror:r,blockClass:n,blockSelector:o,maskTextClass:i,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:h={},maskTextFn:u,maskInputFn:p,slimDOMOptions:d,dataURLOptions:f={},inlineImages:m=!1,recordCanvas:g=!1,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:v=5e3,onStylesheetLoad:b,stylesheetLoadTimeout:S=5e3,keepIframeSrcFn:C=()=>!1,newlyAddedElement:I=!1,cssCaptured:k=!1}=t;let{needsMask:x}=t,{preserveWhiteSpace:O=!0}=t;if(!x){x=be(e,i,a,void 0===x)}const E=Se(e,{doc:s,mirror:r,blockClass:n,blockSelector:o,needsMask:x,inlineStylesheet:c,maskInputOptions:h,maskTextFn:u,maskInputFn:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,keepIframeSrcFn:C,newlyAddedElement:I,cssCaptured:k});if(!E)return console.warn(e,"not serialized"),null;let R;R=r.hasNode(e)?r.getId(e):function(e,t){if(t.comment&&e.type===N.Comment)return!0;if(e.type===N.Element){if(t.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"===q(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Ce(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Ce(e.attributes.name)||"icon"===Ce(e.attributes.rel)||"apple-touch-icon"===Ce(e.attributes.rel)||"shortcut icon"===Ce(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Ce(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Ce(e.attributes.property).match(/^(og|twitter|fb):/)||Ce(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Ce(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Ce(e.attributes.name)||"googlebot"===Ce(e.attributes.name)||"bingbot"===Ce(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Ce(e.attributes.name)||"generator"===Ce(e.attributes.name)||"framework"===Ce(e.attributes.name)||"publisher"===Ce(e.attributes.name)||"progid"===Ce(e.attributes.name)||Ce(e.attributes.property).match(/^article:/)||Ce(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Ce(e.attributes.name)||"yandex-verification"===Ce(e.attributes.name)||"csrf-token"===Ce(e.attributes.name)||"p:domain_verify"===Ce(e.attributes.name)||"verify-v1"===Ce(e.attributes.name)||"verification"===Ce(e.attributes.name)||"shopify-checkout-api-token"===Ce(e.attributes.name)))return!0}}return!1}(E,d)||!O&&E.type===N.Text&&!E.textContent.replace(/^\s+|\s+$/gm,"").length?-2:le();const M=Object.assign(E,{id:R});if(r.add(e,M),-2===R)return null;y&&y(e);let A=!l;if(M.type===N.Element){A=A&&!M.needBlock,delete M.needBlock;const t=W.shadowRoot(e);t&&G(t)&&(M.isShadowHost=!0)}if((M.type===N.Document||M.type===N.Element)&&A){d.headWhitespace&&M.type===N.Element&&"head"===M.tagName&&(O=!1);const t={doc:s,mirror:r,blockClass:n,blockSelector:o,needsMask:x,maskTextClass:i,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:h,maskTextFn:u,maskInputFn:p,slimDOMOptions:d,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:O,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:v,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C,cssCaptured:!1};if(M.type===N.Element&&"textarea"===M.tagName&&void 0!==M.attributes.value);else{M.type===N.Element&&void 0!==M.attributes._cssText&&"string"==typeof M.attributes._cssText&&(t.cssCaptured=!0);for(const s of Array.from(W.childNodes(e))){const e=Ie(s,t);e&&M.childNodes.push(e)}}let I=null;if(z(e)&&(I=W.shadowRoot(e)))for(const e of Array.from(W.childNodes(I))){const s=Ie(e,t);s&&(G(I)&&(s.isShadow=!0),M.childNodes.push(s))}}const T=W.parentNode(e);return T&&V(T)&&G(T)&&(M.isShadow=!0),M.type===N.Element&&"iframe"===M.tagName&&function(e,t,s){const r=e.contentWindow;if(!r)return;let n,o=!1;try{n=r.document.readyState}catch(e){return}if("complete"!==n){const r=setTimeout(()=>{o||(t(),o=!0)},s);return void e.addEventListener("load",()=>{clearTimeout(r),o=!0,t()})}const i="about:blank";if(r.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{const t=e.contentDocument;if(t&&w){const s=Ie(t,{doc:t,mirror:r,blockClass:n,blockSelector:o,needsMask:x,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:h,maskTextFn:u,maskInputFn:p,slimDOMOptions:d,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:O,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:v,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C});s&&w(e,s)}},v),M.type===N.Element&&"link"===M.tagName&&"string"==typeof M.attributes.rel&&("stylesheet"===M.attributes.rel||"preload"===M.attributes.rel&&"string"==typeof M.attributes.href&&"css"===q(M.attributes.href))&&function(e,t,s){let r,n=!1;try{r=e.sheet}catch(e){return}if(r)return;const o=setTimeout(()=>{n||(t(),n=!0)},s);e.addEventListener("load",()=>{clearTimeout(o),n=!0,t()})}(e,()=>{if(b){const t=Ie(e,{doc:s,mirror:r,blockClass:n,blockSelector:o,needsMask:x,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:h,maskTextFn:u,maskInputFn:p,slimDOMOptions:d,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:O,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:v,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C});t&&b(e,t)}},S),M}function ke(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function xe(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var s=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(s,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),s}var Oe={exports:{}},Ee=String,Re=function(){return{isColorSupported:!1,reset:Ee,bold:Ee,dim:Ee,italic:Ee,underline:Ee,inverse:Ee,hidden:Ee,strikethrough:Ee,black:Ee,red:Ee,green:Ee,yellow:Ee,blue:Ee,magenta:Ee,cyan:Ee,white:Ee,gray:Ee,bgBlack:Ee,bgRed:Ee,bgGreen:Ee,bgYellow:Ee,bgBlue:Ee,bgMagenta:Ee,bgCyan:Ee,bgWhite:Ee}};Oe.exports=Re(),Oe.exports.createColors=Re;var Me=Oe.exports;const Ae=xe(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Te=Me,Ne=Ae,Pe=class e extends Error{constructor(t,s,r,n,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),n&&(this.source=n),i&&(this.plugin=i),void 0!==s&&void 0!==r&&("number"==typeof s?(this.line=s,this.column=r):(this.line=s.line,this.column=s.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=Te.isColorSupported),Ne&&e&&(t=Ne(t));let s,r,n=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,n.length),a=String(i).length;if(e){let{bold:e,gray:t,red:n}=Te.createColors(!0);s=t=>e(n(t)),r=e=>t(e)}else s=r=e=>e;return n.slice(o,i).map((e,t)=>{let n=o+1+t,i=" "+(" "+n).slice(-a)+" | ";if(n===this.line){let t=r(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+r(i)+e+"\n "+t+s("^")}return" "+r(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var De=Pe;Pe.default=Pe;var Le={};Le.isClean=Symbol("isClean"),Le.my=Symbol("my");const Fe={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let _e=class{constructor(e){this.builder=e}atrule(e,t){let s="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?s+=e.raws.afterName:r&&(s+=" "),e.nodes)this.block(e,s+r);else{let n=(e.raws.between||"")+(t?";":"");this.builder(s+r+n,e)}}beforeAfter(e,t){let s;s="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let r=e.parent,n=0;for(;r&&"root"!==r.type;)n+=1,r=r.parent;if(s.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<n;e++)s+=t}return s}block(e,t){let s,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),s=this.raw(e,"after")):s=this.raw(e,"after","emptyBody"),s&&this.builder(s),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let s=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let n=e.nodes[r],o=this.raw(n,"before");o&&this.builder(o),this.stringify(n,t!==r||s)}}comment(e){let t=this.raw(e,"left","commentLeft"),s=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+s+"*/",e)}decl(e,t){let s=this.raw(e,"between","colon"),r=e.prop+s+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)}document(e){this.body(e)}raw(e,t,s){let r;if(s||(s=t),t&&(r=e.raws[t],void 0!==r))return r;let n=e.parent;if("before"===s){if(!n||"root"===n.type&&n.first===e)return"";if(n&&"document"===n.type)return""}if(!n)return Fe[s];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[s])return o.rawCache[s];if("before"===s||"after"===s)return this.beforeAfter(e,s);{let n="raw"+((i=s)[0].toUpperCase()+i.slice(1));this[n]?r=this[n](o,e):o.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var i;return void 0===r&&(r=Fe[s]),o.rawCache[s]=r,r}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let s;return e.walkComments(e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(t,null,"beforeDecl"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeDecl(e,t){let s;return e.walkDecls(e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(t,null,"beforeRule"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(s=>{if(s.nodes&&(s.parent!==e||e.first!==s)&&void 0!==s.raws.before)return t=s.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(s=>{let r=s.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==s.raws.before){let e=s.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let s=e[t],r=e.raws[t];return r&&r.value===s?r.raw:s}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var Ue=_e;_e.default=_e;let Be=Ue;function je(e,t){new Be(t).stringify(e)}var We=je;je.default=je;let{isClean:ze,my:Ve}=Le,Ge=De,Ze=Ue,Ye=We;function Xe(e,t){let s=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if("proxyCache"===r)continue;let n=e[r],o=typeof n;"parent"===r&&"object"===o?t&&(s[r]=t):"source"===r?s[r]=n:Array.isArray(n)?s[r]=n.map(e=>Xe(e,s)):("object"===o&&null!==n&&(n=Xe(n)),s[r]=n)}return s}let He=class{constructor(e={}){this.raws={},this[ze]=!1,this[Ve]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let s of e[t])"function"==typeof s.clone?this.append(s.clone()):this.append(s)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=Xe(this);for(let s in e)t[s]=e[s];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:s,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:s.column,line:s.line},t)}return new Ge(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,s)=>(e[t]===s||(e[t]=s,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[ze]){this[ze]=!1;let e=this;for(;e=e.parent;)e[ze]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let s=this.source.start;if(e.index)s=this.positionInside(e.index,t);else if(e.word){let r=(t=this.toString()).indexOf(e.word);-1!==r&&(s=this.positionInside(r,t))}return s}positionInside(e,t){let s=t||this.toString(),r=this.source.start.column,n=this.source.start.line;for(let t=0;t<e;t++)"\n"===s[t]?(r=1,n+=1):r+=1;return{column:r,line:n}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},s=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let r=this.toString(),n=r.indexOf(e.word);-1!==n&&(t=this.positionInside(n,r),s=this.positionInside(n+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?s={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?s=this.positionInside(e.endIndex):e.index&&(s=this.positionInside(e.index+1));return(s.line<t.line||s.line===t.line&&s.column<=t.column)&&(s={column:t.column+1,line:t.line}),{end:s,start:t}}raw(e,t){return(new Ze).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,s=!1;for(let r of e)r===this?s=!0:s?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);s||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let s={},r=null==t;t=t||new Map;let n=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let r=this[e];if(Array.isArray(r))s[e]=r.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof r&&r.toJSON)s[e]=r.toJSON(null,t);else if("source"===e){let o=t.get(r.input);null==o&&(o=n,t.set(r.input,n),n++),s[e]={end:r.end,inputId:o,start:r.start}}else s[e]=r}return r&&(s.inputs=[...t.keys()].map(e=>e.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Ye){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,s){let r={node:this};for(let e in s)r[e]=s[e];return e.warn(t,r)}get proxyOf(){return this}};var Je=He;He.default=He;let $e=Je,Ke=class extends $e{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var qe=Ke;Ke.default=Ke;var Qe={nanoid:(e=21)=>{let t="",s=e;for(;s--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:et,SourceMapGenerator:tt}=Ae,{existsSync:st,readFileSync:rt}=Ae,{dirname:nt,join:ot}=Ae;let it=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let s=t.map?t.map.prev:void 0,r=this.loadMap(t.from,s);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=nt(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new et(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let s=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let s=e.lastIndexOf(t.pop()),r=e.indexOf("*/",s);s>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(s,r)))}loadFile(e){if(this.root=nt(e),st(e))return this.mapFile=e,rt(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof et)return tt.fromSourceMap(t).toString();if(t instanceof tt)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let s=t(e);if(s){let e=this.loadFile(s);if(!e)throw new Error("Unable to load previous source map: "+s.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=ot(nt(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var at=it;it.default=it;let{SourceMapConsumer:lt,SourceMapGenerator:ct}=Ae,{fileURLToPath:ht,pathToFileURL:ut}=Ae,{isAbsolute:pt,resolve:dt}=Ae,{nanoid:ft}=Qe,mt=Ae,gt=De,yt=at,wt=Symbol("fromOffsetCache"),vt=Boolean(lt&&ct),bt=Boolean(dt&&pt),St=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!bt||/^\w+:\/\//.test(t.from)||pt(t.from)?this.file=t.from:this.file=dt(t.from)),bt&&vt){let e=new yt(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+ft(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,s,r={}){let n,o,i;if(t&&"object"==typeof t){let e=t,r=s;if("number"==typeof e.offset){let r=this.fromOffset(e.offset);t=r.line,s=r.col}else t=e.line,s=e.column;if("number"==typeof r.offset){let e=this.fromOffset(r.offset);o=e.line,i=e.col}else o=r.line,i=r.column}else if(!s){let e=this.fromOffset(t);t=e.line,s=e.col}let a=this.origin(t,s,o,i);return n=a?new gt(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,r.plugin):new gt(e,void 0===o?t:{column:s,line:t},void 0===o?s:{column:i,line:o},this.css,this.file,r.plugin),n.input={column:s,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(ut&&(n.input.url=ut(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,s;if(this[wt])s=this[wt];else{let e=this.css.split("\n");s=new Array(e.length);let t=0;for(let r=0,n=e.length;r<n;r++)s[r]=t,t+=e[r].length+1;this[wt]=s}t=s[s.length-1];let r=0;if(e>=t)r=s.length-1;else{let t,n=s.length-2;for(;r<n;)if(t=r+(n-r>>1),e<s[t])n=t-1;else{if(!(e>=s[t+1])){r=t;break}r=t+1}}return{col:e-s[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:dt(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,s,r){if(!this.map)return!1;let n,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof s&&(n=i.originalPositionFor({column:r,line:s})),o=pt(a.source)?ut(a.source):new URL(a.source,this.map.consumer().sourceRoot||ut(this.map.mapFile));let l={column:a.column,endColumn:n&&n.column,endLine:n&&n.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!ht)throw new Error("file: protocol is not available in this PostCSS build");l.file=ht(o)}let c=i.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var Ct=St;St.default=St,mt&&mt.registerInput&&mt.registerInput(St);let{SourceMapConsumer:It,SourceMapGenerator:kt}=Ae,{dirname:xt,relative:Ot,resolve:Et,sep:Rt}=Ae,{pathToFileURL:Mt}=Ae,At=Ct,Tt=Boolean(It&&kt),Nt=Boolean(xt&&Et&&Ot&&Rt);var Pt=class{constructor(e,t,s,r){this.stringify=e,this.mapOpts=s.map||{},this.root=t,this.opts=s,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,s=this.toUrl(this.path(e.file)),r=e.root||xt(e.file);!1===this.mapOpts.sourcesContent?(t=new It(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,s,this.toUrl(this.path(r)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Nt&&Tt&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=kt.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new kt({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 kt({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,s=1,r=1,n="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=s,o.generated.column=r-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=i.match(/\n/g),e?(s+=e.length,t=i.lastIndexOf("\n"),r=i.length-t):r+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=s,o.generated.column=r-2,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,o.generated.line=s,o.generated.column=r-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let s=this.opts.to?xt(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(s=xt(Et(s,this.mapOpts.annotation)));let r=Ot(s,e);return this.memoizedPaths.set(e,r),r}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new At(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let s=t.source.input.from;if(s&&!e[s]){e[s]=!0;let r=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Mt){let t=Mt(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===Rt&&(e=e.replace(/\\/g,"/"));let s=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,s),s}};let Dt=Je,Lt=class extends Dt{constructor(e){super(e),this.type="comment"}};var Ft=Lt;Lt.default=Lt;let _t,Ut,Bt,jt,{isClean:Wt,my:zt}=Le,Vt=qe,Gt=Ft,Zt=Je;function Yt(e){return e.map(e=>(e.nodes&&(e.nodes=Yt(e.nodes)),delete e.source,e))}function Xt(e){if(e[Wt]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Xt(t)}let Ht=class e extends Zt{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,s,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],s=e(this.proxyOf.nodes[t],t),!1!==s);)this.indexes[r]+=1;return delete this.indexes[r],s}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...s)=>e[t](...s.map(e=>"function"==typeof e?(t,s)=>e(t.toProxy(),s):e)):"every"===t||"some"===t?s=>e[t]((e,...t)=>s(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,s)=>(e[t]===s||(e[t]=s,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let s,r=this.index(e),n=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let e of n)this.proxyOf.nodes.splice(r+1,0,e);for(let e in this.indexes)s=this.indexes[e],r<s&&(this.indexes[e]=s+n.length);return this.markDirty(),this}insertBefore(e,t){let s,r=this.index(e),n=0===r&&"prepend",o=this.normalize(t,this.proxyOf.nodes[r],n).reverse();r=this.index(e);for(let e of o)this.proxyOf.nodes.splice(r,0,e);for(let e in this.indexes)s=this.indexes[e],r<=s&&(this.indexes[e]=s+o.length);return this.markDirty(),this}normalize(t,s){if("string"==typeof t)t=Yt(_t(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new Vt(t)]}else if(t.selector)t=[new Ut(t)];else if(t.name)t=[new Bt(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Gt(t)]}return t.map(t=>(t[zt]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Wt]&&Xt(t),void 0===t.raws.before&&s&&void 0!==s.raws.before&&(t.raws.before=s.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let s in this.indexes)t=this.indexes[s],t>=e&&(this.indexes[s]=t-1);return this.markDirty(),this}replaceValues(e,t,s){return s||(s=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,s))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,s)=>{let r;try{r=e(t,s)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("atrule"===s.type&&e.test(s.name))return t(s,r)}):this.walk((s,r)=>{if("atrule"===s.type&&s.name===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("atrule"===e.type)return t(e,s)}))}walkComments(e){return this.walk((t,s)=>{if("comment"===t.type)return e(t,s)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("decl"===s.type&&e.test(s.prop))return t(s,r)}):this.walk((s,r)=>{if("decl"===s.type&&s.prop===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("decl"===e.type)return t(e,s)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("rule"===s.type&&e.test(s.selector))return t(s,r)}):this.walk((s,r)=>{if("rule"===s.type&&s.selector===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("rule"===e.type)return t(e,s)}))}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]}};Ht.registerParse=e=>{_t=e},Ht.registerRule=e=>{Ut=e},Ht.registerAtRule=e=>{Bt=e},Ht.registerRoot=e=>{jt=e};var Jt=Ht;Ht.default=Ht,Ht.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Bt.prototype):"rule"===e.type?Object.setPrototypeOf(e,Ut.prototype):"decl"===e.type?Object.setPrototypeOf(e,Vt.prototype):"comment"===e.type?Object.setPrototypeOf(e,Gt.prototype):"root"===e.type&&Object.setPrototypeOf(e,jt.prototype),e[zt]=!0,e.nodes&&e.nodes.forEach(e=>{Ht.rebuild(e)})};let $t,Kt,qt=Jt,Qt=class extends qt{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new $t(new Kt,this,e).stringify()}};Qt.registerLazyResult=e=>{$t=e},Qt.registerProcessor=e=>{Kt=e};var es=Qt;Qt.default=Qt;let ts={};var ss=function(e){ts[e]||(ts[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let rs=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var ns=rs;rs.default=rs;let os=ns,is=class{constructor(e,t,s){this.processor=e,this.messages=[],this.root=t,this.opts=s,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let s=new os(e,t);return this.messages.push(s),s}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var as=is;is.default=is;const ls="'".charCodeAt(0),cs='"'.charCodeAt(0),hs="\\".charCodeAt(0),us="/".charCodeAt(0),ps="\n".charCodeAt(0),ds=" ".charCodeAt(0),fs="\f".charCodeAt(0),ms="\t".charCodeAt(0),gs="\r".charCodeAt(0),ys="[".charCodeAt(0),ws="]".charCodeAt(0),vs="(".charCodeAt(0),bs=")".charCodeAt(0),Ss="{".charCodeAt(0),Cs="}".charCodeAt(0),Is=";".charCodeAt(0),ks="*".charCodeAt(0),xs=":".charCodeAt(0),Os="@".charCodeAt(0),Es=/[\t\n\f\r "#'()/;[\\\]{}]/g,Rs=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Ms=/.[\r\n"'(/\\]/,As=/[\da-f]/i;let Ts=Jt,Ns=class extends Ts{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 Ps=Ns;Ns.default=Ns,Ts.registerAtRule(Ns);let Ds,Ls,Fs=Jt,_s=class extends Fs{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,s){let r=super.normalize(e);if(t)if("prepend"===s)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of r)e.raws.before=t.raws.before;return r}removeChild(e,t){let s=this.index(e);return!t&&0===s&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[s].raws.before),super.removeChild(e)}toResult(e={}){return new Ds(new Ls,this,e).stringify()}};_s.registerLazyResult=e=>{Ds=e},_s.registerProcessor=e=>{Ls=e};var Us=_s;_s.default=_s,Fs.registerRoot(_s);let Bs={comma:e=>Bs.split(e,[","],!0),space:e=>Bs.split(e,[" ","\n","\t"]),split(e,t,s){let r=[],n="",o=!1,i=0,a=!1,l="",c=!1;for(let s of e)c?c=!1:"\\"===s?c=!0:a?s===l&&(a=!1):'"'===s||"'"===s?(a=!0,l=s):"("===s?i+=1:")"===s?i>0&&(i-=1):0===i&&t.includes(s)&&(o=!0),o?(""!==n&&r.push(n.trim()),n="",o=!1):n+=s;return(s||""!==n)&&r.push(n.trim()),r}};var js=Bs;Bs.default=Bs;let Ws=Jt,zs=js,Vs=class extends Ws{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return zs.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,s=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(s)}};var Gs=Vs;Vs.default=Vs,Ws.registerRule(Vs);let Zs=qe,Ys=function(e,t={}){let s,r,n,o,i,a,l,c,h,u,p=e.css.valueOf(),d=t.ignoreErrors,f=p.length,m=0,g=[],y=[];function w(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(s=p.charCodeAt(m),s){case ps:case ds:case ms:case gs:case fs:r=m;do{r+=1,s=p.charCodeAt(r)}while(s===ds||s===ps||s===ms||s===gs||s===fs);u=["space",p.slice(m,r)],m=r-1;break;case ys:case ws:case Ss:case Cs:case xs:case Is:case bs:{let e=String.fromCharCode(s);u=[e,e,m];break}case vs:if(c=g.length?g.pop()[1]:"",h=p.charCodeAt(m+1),"url"===c&&h!==ls&&h!==cs&&h!==ds&&h!==ps&&h!==ms&&h!==fs&&h!==gs){r=m;do{if(a=!1,r=p.indexOf(")",r+1),-1===r){if(d||t){r=m;break}w("bracket")}for(l=r;p.charCodeAt(l-1)===hs;)l-=1,a=!a}while(a);u=["brackets",p.slice(m,r+1),m,r],m=r}else r=p.indexOf(")",m+1),o=p.slice(m,r+1),-1===r||Ms.test(o)?u=["(","(",m]:(u=["brackets",o,m,r],m=r);break;case ls:case cs:n=s===ls?"'":'"',r=m;do{if(a=!1,r=p.indexOf(n,r+1),-1===r){if(d||t){r=m+1;break}w("string")}for(l=r;p.charCodeAt(l-1)===hs;)l-=1,a=!a}while(a);u=["string",p.slice(m,r+1),m,r],m=r;break;case Os:Es.lastIndex=m+1,Es.test(p),r=0===Es.lastIndex?p.length-1:Es.lastIndex-2,u=["at-word",p.slice(m,r+1),m,r],m=r;break;case hs:for(r=m,i=!0;p.charCodeAt(r+1)===hs;)r+=1,i=!i;if(s=p.charCodeAt(r+1),i&&s!==us&&s!==ds&&s!==ps&&s!==ms&&s!==gs&&s!==fs&&(r+=1,As.test(p.charAt(r)))){for(;As.test(p.charAt(r+1));)r+=1;p.charCodeAt(r+1)===ds&&(r+=1)}u=["word",p.slice(m,r+1),m,r],m=r;break;default:s===us&&p.charCodeAt(m+1)===ks?(r=p.indexOf("*/",m+2)+1,0===r&&(d||t?r=p.length:w("comment")),u=["comment",p.slice(m,r+1),m,r],m=r):(Rs.lastIndex=m+1,Rs.test(p),r=0===Rs.lastIndex?p.length-1:Rs.lastIndex-2,u=["word",p.slice(m,r+1),m,r],g.push(u),m=r)}return m++,u},position:function(){return m}}},Xs=Ft,Hs=Ps,Js=Us,$s=Gs;const Ks={empty:!0,space:!0};let qs=Jt,Qs=class{constructor(e){this.input=e,this.root=new Js,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,s,r,n=new Hs;n.name=e[1].slice(1),""===n.name&&this.unnamedAtrule(n,e),this.init(n,e[2]);let o=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){n.source.end=this.getPosition(e[2]),n.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(r=a.length-1,s=a[r];s&&"space"===s[0];)s=a[--r];s&&(n.source.end=this.getPosition(s[3]||s[2]),n.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(n.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(n,"params",a),o&&(e=a[a.length-1],n.source.end=this.getPosition(e[3]||e[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),i&&(n.nodes=[],this.current=n)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let s,r=0;for(let n=t-1;n>=0&&(s=e[n],"space"===s[0]||(r+=1,2!==r));n--);throw this.input.error("Missed semicolon","word"===s[0]?s[3]+1:s[2])}colon(e){let t,s,r,n=0;for(let[o,i]of e.entries()){if(t=i,s=t[0],"("===s&&(n+=1),")"===s&&(n-=1),0===n&&":"===s){if(r){if("word"===r[0]&&"progid"===r[1])continue;return o}this.doubleColon(t)}r=t}return!1}comment(e){let t=new Xs;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let s=e[1].slice(2,-2);if(/^\s*$/.test(s))t.text="",t.raws.left=s,t.raws.right="";else{let e=s.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=Ys(this.input)}decl(e,t){let s=new Zs;this.init(s,e[0][2]);let r,n=e[e.length-1];for(";"===n[0]&&(this.semicolon=!0,e.pop()),s.source.end=this.getPosition(n[3]||n[2]||function(e){for(let t=e.length-1;t>=0;t--){let s=e[t],r=s[3]||s[2];if(r)return r}}(e)),s.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),s.raws.before+=e.shift()[1];for(s.source.start=this.getPosition(e[0][2]),s.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;s.prop+=e.shift()[1]}for(s.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){s.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),s.raws.between+=r[1]}"_"!==s.prop[0]&&"*"!==s.prop[0]||(s.raws.before+=s.prop[0],s.prop=s.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(r=e[t],"!important"===r[1].toLowerCase()){s.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(s.raws.important=r);break}if("important"===r[1].toLowerCase()){let r=e.slice(0),n="";for(let e=t;e>0;e--){let t=r[e][0];if(0===n.trim().indexOf("!")&&"space"!==t)break;n=r.pop()[1]+n}0===n.trim().indexOf("!")&&(s.important=!0,s.raws.important=n,e=r)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(s.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(s,"value",i.concat(e),t),s.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new $s;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,s=null,r=!1,n=null,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(s=l[0],a.push(l),"("===s||"["===s)n||(n=l),o.push("("===s?")":"]");else if(i&&r&&"{"===s)n||(n=l),o.push("}");else if(0===o.length){if(";"===s){if(r)return void this.decl(a,i);break}if("{"===s)return void this.rule(a);if("}"===s){this.tokenizer.back(a.pop()),t=!0;break}":"===s&&(r=!0)}else s===o[o.length-1]&&(o.pop(),0===o.length&&(n=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&r){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,s,r){let n,o,i,a,l=s.length,c="",h=!0;for(let e=0;e<l;e+=1)n=s[e],o=n[0],"space"!==o||e!==l-1||r?"comment"===o?(a=s[e-1]?s[e-1][0]:"empty",i=s[e+1]?s[e+1][0]:"empty",Ks[a]||Ks[i]||","===c.slice(-1)?h=!1:c+=n[1]):c+=n[1]:h=!1;if(!h){let r=s.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:r,value:c}}e[t]=c}rule(e){e.pop();let t=new $s;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)s=e.pop()[1]+s;return s}spacesAndCommentsFromStart(e){let t,s="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)s+=e.shift()[1];return s}spacesFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)s=e.pop()[1]+s;return s}stringFrom(e,t){let s="";for(let r=t;r<e.length;r++)s+=e[r][1];return e.splice(t,e.length-t),s}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},er=Ct;function tr(e,t){let s=new er(e,t),r=new Qs(s);try{r.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return r.root}var sr=tr;tr.default=tr,qs.registerParse(tr);let{isClean:rr,my:nr}=Le,or=Pt,ir=We,ar=Jt,lr=es,cr=ss,hr=as,ur=sr,pr=Us;const dr={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},fr={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},mr={Once:!0,postcssPlugin:!0,prepare:!0};function gr(e){return"object"==typeof e&&"function"==typeof e.then}function yr(e){let t=!1,s=dr[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[s,s+"-"+t,0,s+"Exit",s+"Exit-"+t]:t?[s,s+"-"+t,s+"Exit",s+"Exit-"+t]:e.append?[s,0,s+"Exit"]:[s,s+"Exit"]}function wr(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:yr(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function vr(e){return e[rr]=!1,e.nodes&&e.nodes.forEach(e=>vr(e)),e}let br={},Sr=class e{constructor(t,s,r){let n;if(this.stringified=!1,this.processed=!1,"object"!=typeof s||null===s||"root"!==s.type&&"document"!==s.type)if(s instanceof e||s instanceof hr)n=vr(s.root),s.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=s.map);else{let e=ur;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{n=e(s,r)}catch(e){this.processed=!0,this.error=e}n&&!n[nr]&&ar.rebuild(n)}else n=vr(s);this.result=new hr(t,n,r),this.helpers={...br,postcss:br,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let s=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(s.postcssVersion&&"production"!==process.env.NODE_ENV){let e=s.postcssPlugin,t=s.postcssVersion,r=this.result.processor.version,n=t.split("."),o=r.split(".");(n[0]!==o[0]||parseInt(n[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+r+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=s.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,s)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,s])};for(let t of this.plugins)if("object"==typeof t)for(let s in t){if(!fr[s]&&/^[A-Z]/.test(s))throw new Error(`Unknown event ${s} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!mr[s])if("object"==typeof t[s])for(let r in t[s])e(t,"*"===r?s:s+"-"+r.toLowerCase(),t[s][r]);else"function"==typeof t[s]&&e(t,s,t[s])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],s=this.runOnRoot(t);if(gr(s))try{await s}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[rr];){e[rr]=!0;let t=[wr(e)];for(;t.length>0;){let e=this.visitTick(t);if(gr(e))try{await e}catch(e){let s=t[t.length-1].node;throw this.handleError(e,s)}}}if(this.listeners.OnceExit)for(let[t,s]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>s(e,this.helpers));await Promise.all(t)}else await s(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return gr(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=ir;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new or(t,this.result.root,this.result.opts).generate();return this.result.css=s[0],this.result.map=s[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(gr(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[rr];)e[rr]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||cr("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[s,r]of e){let e;this.result.lastPlugin=s;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(gr(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:s,visitors:r}=t;if("root"!==s.type&&"document"!==s.type&&!s.parent)return void e.pop();if(r.length>0&&t.visitorIndex<r.length){let[e,n]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return n(s.toProxy(),this.helpers)}catch(e){throw this.handleError(e,s)}}if(0!==t.iterator){let r,n=t.iterator;for(;r=s.nodes[s.indexes[n]];)if(s.indexes[n]+=1,!r[rr])return r[rr]=!0,void e.push(wr(r));t.iterator=0,delete s.indexes[n]}let n=t.events;for(;t.eventIndex<n.length;){let e=n[t.eventIndex];if(t.eventIndex+=1,0===e)return void(s.nodes&&s.nodes.length&&(s[rr]=!0,t.iterator=s.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[rr]=!0;let t=yr(e);for(let s of t)if(0===s)e.nodes&&e.each(e=>{e[rr]||this.walkSync(e)});else{let t=this.listeners[s];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Sr.registerPostcss=e=>{br=e};var Cr=Sr;Sr.default=Sr,pr.registerLazyResult(Sr),lr.registerLazyResult(Sr);let Ir=Pt,kr=We,xr=ss,Or=sr;const Er=as;let Rr=class{constructor(e,t,s){let r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=s,this._map=void 0;let n=kr;this.result=new Er(this._processor,r,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new Ir(n,r,this._opts,t);if(i.isMap()){let[e,t]=i.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else i.clearAnnotation(),this.result.css=i.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||xr("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=Or;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Mr=Rr;Rr.default=Rr;let Ar=Mr,Tr=Cr,Nr=es,Pr=Us,Dr=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let s of e)if(!0===s.postcss?s=s():s.postcss&&(s=s.postcss),"object"==typeof s&&Array.isArray(s.plugins))t=t.concat(s.plugins);else if("object"==typeof s&&s.postcssPlugin)t.push(s);else if("function"==typeof s)t.push(s);else{if("object"!=typeof s||!s.parse&&!s.stringify)throw new Error(s+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new Tr(this,e,t):new Ar(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Lr=Dr;Dr.default=Dr,Pr.registerProcessor(Dr),Nr.registerProcessor(Dr);let Fr=qe,_r=at,Ur=Ft,Br=Ps,jr=Ct,Wr=Us,zr=Gs;function Vr(e,t){if(Array.isArray(e))return e.map(e=>Vr(e));let{inputs:s,...r}=e;if(s){t=[];for(let e of s){let s={...e,__proto__:jr.prototype};s.map&&(s.map={...s.map,__proto__:_r.prototype}),t.push(s)}}if(r.nodes&&(r.nodes=e.nodes.map(e=>Vr(e,t))),r.source){let{inputId:e,...s}=r.source;r.source=s,null!=e&&(r.source.input=t[e])}if("root"===r.type)return new Wr(r);if("decl"===r.type)return new Fr(r);if("rule"===r.type)return new zr(r);if("comment"===r.type)return new Ur(r);if("atrule"===r.type)return new Br(r);throw new Error("Unknown node type: "+e.type)}var Gr=Vr;Vr.default=Vr;let Zr=De,Yr=qe,Xr=Cr,Hr=Jt,Jr=Lr,$r=We,Kr=Gr,qr=es,Qr=ns,en=Ft,tn=Ps,sn=as,rn=Ct,nn=sr,on=js,an=Gs,ln=Us,cn=Je;function hn(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Jr(e)}hn.plugin=function(e,t){let s,r=!1;function n(...s){console&&console.warn&&!r&&(r=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let n=t(...s);return n.postcssPlugin=e,n.postcssVersion=(new Jr).version,n}return Object.defineProperty(n,"postcss",{get:()=>(s||(s=n()),s)}),n.process=function(e,t,s){return hn([n(s)]).process(e,t)},n},hn.stringify=$r,hn.parse=nn,hn.fromJSON=Kr,hn.list=on,hn.comment=e=>new en(e),hn.atRule=e=>new tn(e),hn.decl=e=>new Yr(e),hn.rule=e=>new an(e),hn.root=e=>new ln(e),hn.document=e=>new qr(e),hn.CssSyntaxError=Zr,hn.Declaration=Yr,hn.Container=Hr,hn.Processor=Jr,hn.Document=qr,hn.Comment=en,hn.Warning=Qr,hn.AtRule=tn,hn.Result=sn,hn.Input=rn,hn.Rule=an,hn.Root=ln,hn.Node=cn,Xr.registerPostcss(hn);var un=hn;hn.default=hn;const pn=ke(un);pn.stringify,pn.fromJSON,pn.plugin,pn.parse,pn.list,pn.document,pn.comment,pn.atRule,pn.rule,pn.decl,pn.root,pn.CssSyntaxError,pn.Declaration,pn.Container,pn.Processor,pn.Document,pn.Comment,pn.Warning,pn.AtRule,pn.Result,pn.Input,pn.Rule,pn.Root,pn.Node;var dn=Object.defineProperty,fn=(e,t,s)=>((e,t,s)=>t in e?dn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);function mn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function gn(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var s=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(s,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),s}var yn={exports:{}},wn=String,vn=function(){return{isColorSupported:!1,reset:wn,bold:wn,dim:wn,italic:wn,underline:wn,inverse:wn,hidden:wn,strikethrough:wn,black:wn,red:wn,green:wn,yellow:wn,blue:wn,magenta:wn,cyan:wn,white:wn,gray:wn,bgBlack:wn,bgRed:wn,bgGreen:wn,bgYellow:wn,bgBlue:wn,bgMagenta:wn,bgCyan:wn,bgWhite:wn}};yn.exports=vn(),yn.exports.createColors=vn;var bn=yn.exports;const Sn=gn(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Cn=bn,In=Sn,kn=class e extends Error{constructor(t,s,r,n,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),n&&(this.source=n),i&&(this.plugin=i),void 0!==s&&void 0!==r&&("number"==typeof s?(this.line=s,this.column=r):(this.line=s.line,this.column=s.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=Cn.isColorSupported),In&&e&&(t=In(t));let s,r,n=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,n.length),a=String(i).length;if(e){let{bold:e,gray:t,red:n}=Cn.createColors(!0);s=t=>e(n(t)),r=e=>t(e)}else s=r=e=>e;return n.slice(o,i).map((e,t)=>{let n=o+1+t,i=" "+(" "+n).slice(-a)+" | ";if(n===this.line){let t=r(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+r(i)+e+"\n "+t+s("^")}return" "+r(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var xn=kn;kn.default=kn;var On={};On.isClean=Symbol("isClean"),On.my=Symbol("my");const En={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Rn=class{constructor(e){this.builder=e}atrule(e,t){let s="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?s+=e.raws.afterName:r&&(s+=" "),e.nodes)this.block(e,s+r);else{let n=(e.raws.between||"")+(t?";":"");this.builder(s+r+n,e)}}beforeAfter(e,t){let s;s="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let r=e.parent,n=0;for(;r&&"root"!==r.type;)n+=1,r=r.parent;if(s.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<n;e++)s+=t}return s}block(e,t){let s,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),s=this.raw(e,"after")):s=this.raw(e,"after","emptyBody"),s&&this.builder(s),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let s=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let n=e.nodes[r],o=this.raw(n,"before");o&&this.builder(o),this.stringify(n,t!==r||s)}}comment(e){let t=this.raw(e,"left","commentLeft"),s=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+s+"*/",e)}decl(e,t){let s=this.raw(e,"between","colon"),r=e.prop+s+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)}document(e){this.body(e)}raw(e,t,s){let r;if(s||(s=t),t&&(r=e.raws[t],void 0!==r))return r;let n=e.parent;if("before"===s){if(!n||"root"===n.type&&n.first===e)return"";if(n&&"document"===n.type)return""}if(!n)return En[s];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[s])return o.rawCache[s];if("before"===s||"after"===s)return this.beforeAfter(e,s);{let n="raw"+((i=s)[0].toUpperCase()+i.slice(1));this[n]?r=this[n](o,e):o.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var i;return void 0===r&&(r=En[s]),o.rawCache[s]=r,r}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let s;return e.walkComments(e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(t,null,"beforeDecl"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeDecl(e,t){let s;return e.walkDecls(e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(t,null,"beforeRule"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(s=>{if(s.nodes&&(s.parent!==e||e.first!==s)&&void 0!==s.raws.before)return t=s.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(s=>{let r=s.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==s.raws.before){let e=s.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let s=e[t],r=e.raws[t];return r&&r.value===s?r.raw:s}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var Mn=Rn;Rn.default=Rn;let An=Mn;function Tn(e,t){new An(t).stringify(e)}var Nn=Tn;Tn.default=Tn;let{isClean:Pn,my:Dn}=On,Ln=xn,Fn=Mn,_n=Nn;function Un(e,t){let s=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if("proxyCache"===r)continue;let n=e[r],o=typeof n;"parent"===r&&"object"===o?t&&(s[r]=t):"source"===r?s[r]=n:Array.isArray(n)?s[r]=n.map(e=>Un(e,s)):("object"===o&&null!==n&&(n=Un(n)),s[r]=n)}return s}let Bn=class{constructor(e={}){this.raws={},this[Pn]=!1,this[Dn]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let s of e[t])"function"==typeof s.clone?this.append(s.clone()):this.append(s)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=Un(this);for(let s in e)t[s]=e[s];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:s,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:s.column,line:s.line},t)}return new Ln(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,s)=>(e[t]===s||(e[t]=s,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[Pn]){this[Pn]=!1;let e=this;for(;e=e.parent;)e[Pn]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let s=this.source.start;if(e.index)s=this.positionInside(e.index,t);else if(e.word){let r=(t=this.toString()).indexOf(e.word);-1!==r&&(s=this.positionInside(r,t))}return s}positionInside(e,t){let s=t||this.toString(),r=this.source.start.column,n=this.source.start.line;for(let t=0;t<e;t++)"\n"===s[t]?(r=1,n+=1):r+=1;return{column:r,line:n}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},s=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let r=this.toString(),n=r.indexOf(e.word);-1!==n&&(t=this.positionInside(n,r),s=this.positionInside(n+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?s={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?s=this.positionInside(e.endIndex):e.index&&(s=this.positionInside(e.index+1));return(s.line<t.line||s.line===t.line&&s.column<=t.column)&&(s={column:t.column+1,line:t.line}),{end:s,start:t}}raw(e,t){return(new Fn).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,s=!1;for(let r of e)r===this?s=!0:s?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);s||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let s={},r=null==t;t=t||new Map;let n=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let r=this[e];if(Array.isArray(r))s[e]=r.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof r&&r.toJSON)s[e]=r.toJSON(null,t);else if("source"===e){let o=t.get(r.input);null==o&&(o=n,t.set(r.input,n),n++),s[e]={end:r.end,inputId:o,start:r.start}}else s[e]=r}return r&&(s.inputs=[...t.keys()].map(e=>e.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=_n){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,s){let r={node:this};for(let e in s)r[e]=s[e];return e.warn(t,r)}get proxyOf(){return this}};var jn=Bn;Bn.default=Bn;let Wn=jn,zn=class extends Wn{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var Vn=zn;zn.default=zn;var Gn={nanoid:(e=21)=>{let t="",s=e;for(;s--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:Zn,SourceMapGenerator:Yn}=Sn,{existsSync:Xn,readFileSync:Hn}=Sn,{dirname:Jn,join:$n}=Sn;let Kn=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let s=t.map?t.map.prev:void 0,r=this.loadMap(t.from,s);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Jn(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new Zn(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let s=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let s=e.lastIndexOf(t.pop()),r=e.indexOf("*/",s);s>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(s,r)))}loadFile(e){if(this.root=Jn(e),Xn(e))return this.mapFile=e,Hn(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof Zn)return Yn.fromSourceMap(t).toString();if(t instanceof Yn)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let s=t(e);if(s){let e=this.loadFile(s);if(!e)throw new Error("Unable to load previous source map: "+s.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=$n(Jn(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var qn=Kn;Kn.default=Kn;let{SourceMapConsumer:Qn,SourceMapGenerator:eo}=Sn,{fileURLToPath:to,pathToFileURL:so}=Sn,{isAbsolute:ro,resolve:no}=Sn,{nanoid:oo}=Gn,io=Sn,ao=xn,lo=qn,co=Symbol("fromOffsetCache"),ho=Boolean(Qn&&eo),uo=Boolean(no&&ro),po=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!uo||/^\w+:\/\//.test(t.from)||ro(t.from)?this.file=t.from:this.file=no(t.from)),uo&&ho){let e=new lo(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+oo(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,s,r={}){let n,o,i;if(t&&"object"==typeof t){let e=t,r=s;if("number"==typeof e.offset){let r=this.fromOffset(e.offset);t=r.line,s=r.col}else t=e.line,s=e.column;if("number"==typeof r.offset){let e=this.fromOffset(r.offset);o=e.line,i=e.col}else o=r.line,i=r.column}else if(!s){let e=this.fromOffset(t);t=e.line,s=e.col}let a=this.origin(t,s,o,i);return n=a?new ao(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,r.plugin):new ao(e,void 0===o?t:{column:s,line:t},void 0===o?s:{column:i,line:o},this.css,this.file,r.plugin),n.input={column:s,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(so&&(n.input.url=so(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,s;if(this[co])s=this[co];else{let e=this.css.split("\n");s=new Array(e.length);let t=0;for(let r=0,n=e.length;r<n;r++)s[r]=t,t+=e[r].length+1;this[co]=s}t=s[s.length-1];let r=0;if(e>=t)r=s.length-1;else{let t,n=s.length-2;for(;r<n;)if(t=r+(n-r>>1),e<s[t])n=t-1;else{if(!(e>=s[t+1])){r=t;break}r=t+1}}return{col:e-s[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:no(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,s,r){if(!this.map)return!1;let n,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof s&&(n=i.originalPositionFor({column:r,line:s})),o=ro(a.source)?so(a.source):new URL(a.source,this.map.consumer().sourceRoot||so(this.map.mapFile));let l={column:a.column,endColumn:n&&n.column,endLine:n&&n.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!to)throw new Error("file: protocol is not available in this PostCSS build");l.file=to(o)}let c=i.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var fo=po;po.default=po,io&&io.registerInput&&io.registerInput(po);let{SourceMapConsumer:mo,SourceMapGenerator:go}=Sn,{dirname:yo,relative:wo,resolve:vo,sep:bo}=Sn,{pathToFileURL:So}=Sn,Co=fo,Io=Boolean(mo&&go),ko=Boolean(yo&&vo&&wo&&bo);var xo=class{constructor(e,t,s,r){this.stringify=e,this.mapOpts=s.map||{},this.root=t,this.opts=s,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,s=this.toUrl(this.path(e.file)),r=e.root||yo(e.file);!1===this.mapOpts.sourcesContent?(t=new mo(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,s,this.toUrl(this.path(r)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),ko&&Io&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=go.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new go({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 go({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,s=1,r=1,n="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=s,o.generated.column=r-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=i.match(/\n/g),e?(s+=e.length,t=i.lastIndexOf("\n"),r=i.length-t):r+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=s,o.generated.column=r-2,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,o.generated.line=s,o.generated.column=r-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let s=this.opts.to?yo(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(s=yo(vo(s,this.mapOpts.annotation)));let r=wo(s,e);return this.memoizedPaths.set(e,r),r}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Co(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let s=t.source.input.from;if(s&&!e[s]){e[s]=!0;let r=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(So){let t=So(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===bo&&(e=e.replace(/\\/g,"/"));let s=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,s),s}};let Oo=jn,Eo=class extends Oo{constructor(e){super(e),this.type="comment"}};var Ro=Eo;Eo.default=Eo;let Mo,Ao,To,No,{isClean:Po,my:Do}=On,Lo=Vn,Fo=Ro,_o=jn;function Uo(e){return e.map(e=>(e.nodes&&(e.nodes=Uo(e.nodes)),delete e.source,e))}function Bo(e){if(e[Po]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Bo(t)}let jo=class e extends _o{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,s,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],s=e(this.proxyOf.nodes[t],t),!1!==s);)this.indexes[r]+=1;return delete this.indexes[r],s}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...s)=>e[t](...s.map(e=>"function"==typeof e?(t,s)=>e(t.toProxy(),s):e)):"every"===t||"some"===t?s=>e[t]((e,...t)=>s(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,s)=>(e[t]===s||(e[t]=s,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let s,r=this.index(e),n=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let e of n)this.proxyOf.nodes.splice(r+1,0,e);for(let e in this.indexes)s=this.indexes[e],r<s&&(this.indexes[e]=s+n.length);return this.markDirty(),this}insertBefore(e,t){let s,r=this.index(e),n=0===r&&"prepend",o=this.normalize(t,this.proxyOf.nodes[r],n).reverse();r=this.index(e);for(let e of o)this.proxyOf.nodes.splice(r,0,e);for(let e in this.indexes)s=this.indexes[e],r<=s&&(this.indexes[e]=s+o.length);return this.markDirty(),this}normalize(t,s){if("string"==typeof t)t=Uo(Mo(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new Lo(t)]}else if(t.selector)t=[new Ao(t)];else if(t.name)t=[new To(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Fo(t)]}return t.map(t=>(t[Do]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Po]&&Bo(t),void 0===t.raws.before&&s&&void 0!==s.raws.before&&(t.raws.before=s.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let s in this.indexes)t=this.indexes[s],t>=e&&(this.indexes[s]=t-1);return this.markDirty(),this}replaceValues(e,t,s){return s||(s=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,s))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,s)=>{let r;try{r=e(t,s)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("atrule"===s.type&&e.test(s.name))return t(s,r)}):this.walk((s,r)=>{if("atrule"===s.type&&s.name===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("atrule"===e.type)return t(e,s)}))}walkComments(e){return this.walk((t,s)=>{if("comment"===t.type)return e(t,s)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("decl"===s.type&&e.test(s.prop))return t(s,r)}):this.walk((s,r)=>{if("decl"===s.type&&s.prop===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("decl"===e.type)return t(e,s)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("rule"===s.type&&e.test(s.selector))return t(s,r)}):this.walk((s,r)=>{if("rule"===s.type&&s.selector===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("rule"===e.type)return t(e,s)}))}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]}};jo.registerParse=e=>{Mo=e},jo.registerRule=e=>{Ao=e},jo.registerAtRule=e=>{To=e},jo.registerRoot=e=>{No=e};var Wo=jo;jo.default=jo,jo.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,To.prototype):"rule"===e.type?Object.setPrototypeOf(e,Ao.prototype):"decl"===e.type?Object.setPrototypeOf(e,Lo.prototype):"comment"===e.type?Object.setPrototypeOf(e,Fo.prototype):"root"===e.type&&Object.setPrototypeOf(e,No.prototype),e[Do]=!0,e.nodes&&e.nodes.forEach(e=>{jo.rebuild(e)})};let zo,Vo,Go=Wo,Zo=class extends Go{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new zo(new Vo,this,e).stringify()}};Zo.registerLazyResult=e=>{zo=e},Zo.registerProcessor=e=>{Vo=e};var Yo=Zo;Zo.default=Zo;let Xo={};var Ho=function(e){Xo[e]||(Xo[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Jo=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var $o=Jo;Jo.default=Jo;let Ko=$o,qo=class{constructor(e,t,s){this.processor=e,this.messages=[],this.root=t,this.opts=s,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let s=new Ko(e,t);return this.messages.push(s),s}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Qo=qo;qo.default=qo;const ei="'".charCodeAt(0),ti='"'.charCodeAt(0),si="\\".charCodeAt(0),ri="/".charCodeAt(0),ni="\n".charCodeAt(0),oi=" ".charCodeAt(0),ii="\f".charCodeAt(0),ai="\t".charCodeAt(0),li="\r".charCodeAt(0),ci="[".charCodeAt(0),hi="]".charCodeAt(0),ui="(".charCodeAt(0),pi=")".charCodeAt(0),di="{".charCodeAt(0),fi="}".charCodeAt(0),mi=";".charCodeAt(0),gi="*".charCodeAt(0),yi=":".charCodeAt(0),wi="@".charCodeAt(0),vi=/[\t\n\f\r "#'()/;[\\\]{}]/g,bi=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Si=/.[\r\n"'(/\\]/,Ci=/[\da-f]/i;let Ii=Wo,ki=class extends Ii{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 xi=ki;ki.default=ki,Ii.registerAtRule(ki);let Oi,Ei,Ri=Wo,Mi=class extends Ri{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,s){let r=super.normalize(e);if(t)if("prepend"===s)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of r)e.raws.before=t.raws.before;return r}removeChild(e,t){let s=this.index(e);return!t&&0===s&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[s].raws.before),super.removeChild(e)}toResult(e={}){return new Oi(new Ei,this,e).stringify()}};Mi.registerLazyResult=e=>{Oi=e},Mi.registerProcessor=e=>{Ei=e};var Ai=Mi;Mi.default=Mi,Ri.registerRoot(Mi);let Ti={comma:e=>Ti.split(e,[","],!0),space:e=>Ti.split(e,[" ","\n","\t"]),split(e,t,s){let r=[],n="",o=!1,i=0,a=!1,l="",c=!1;for(let s of e)c?c=!1:"\\"===s?c=!0:a?s===l&&(a=!1):'"'===s||"'"===s?(a=!0,l=s):"("===s?i+=1:")"===s?i>0&&(i-=1):0===i&&t.includes(s)&&(o=!0),o?(""!==n&&r.push(n.trim()),n="",o=!1):n+=s;return(s||""!==n)&&r.push(n.trim()),r}};var Ni=Ti;Ti.default=Ti;let Pi=Wo,Di=Ni,Li=class extends Pi{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Di.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,s=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(s)}};var Fi=Li;Li.default=Li,Pi.registerRule(Li);let _i=Vn,Ui=function(e,t={}){let s,r,n,o,i,a,l,c,h,u,p=e.css.valueOf(),d=t.ignoreErrors,f=p.length,m=0,g=[],y=[];function w(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(s=p.charCodeAt(m),s){case ni:case oi:case ai:case li:case ii:r=m;do{r+=1,s=p.charCodeAt(r)}while(s===oi||s===ni||s===ai||s===li||s===ii);u=["space",p.slice(m,r)],m=r-1;break;case ci:case hi:case di:case fi:case yi:case mi:case pi:{let e=String.fromCharCode(s);u=[e,e,m];break}case ui:if(c=g.length?g.pop()[1]:"",h=p.charCodeAt(m+1),"url"===c&&h!==ei&&h!==ti&&h!==oi&&h!==ni&&h!==ai&&h!==ii&&h!==li){r=m;do{if(a=!1,r=p.indexOf(")",r+1),-1===r){if(d||t){r=m;break}w("bracket")}for(l=r;p.charCodeAt(l-1)===si;)l-=1,a=!a}while(a);u=["brackets",p.slice(m,r+1),m,r],m=r}else r=p.indexOf(")",m+1),o=p.slice(m,r+1),-1===r||Si.test(o)?u=["(","(",m]:(u=["brackets",o,m,r],m=r);break;case ei:case ti:n=s===ei?"'":'"',r=m;do{if(a=!1,r=p.indexOf(n,r+1),-1===r){if(d||t){r=m+1;break}w("string")}for(l=r;p.charCodeAt(l-1)===si;)l-=1,a=!a}while(a);u=["string",p.slice(m,r+1),m,r],m=r;break;case wi:vi.lastIndex=m+1,vi.test(p),r=0===vi.lastIndex?p.length-1:vi.lastIndex-2,u=["at-word",p.slice(m,r+1),m,r],m=r;break;case si:for(r=m,i=!0;p.charCodeAt(r+1)===si;)r+=1,i=!i;if(s=p.charCodeAt(r+1),i&&s!==ri&&s!==oi&&s!==ni&&s!==ai&&s!==li&&s!==ii&&(r+=1,Ci.test(p.charAt(r)))){for(;Ci.test(p.charAt(r+1));)r+=1;p.charCodeAt(r+1)===oi&&(r+=1)}u=["word",p.slice(m,r+1),m,r],m=r;break;default:s===ri&&p.charCodeAt(m+1)===gi?(r=p.indexOf("*/",m+2)+1,0===r&&(d||t?r=p.length:w("comment")),u=["comment",p.slice(m,r+1),m,r],m=r):(bi.lastIndex=m+1,bi.test(p),r=0===bi.lastIndex?p.length-1:bi.lastIndex-2,u=["word",p.slice(m,r+1),m,r],g.push(u),m=r)}return m++,u},position:function(){return m}}},Bi=Ro,ji=xi,Wi=Ai,zi=Fi;const Vi={empty:!0,space:!0};let Gi=Wo,Zi=class{constructor(e){this.input=e,this.root=new Wi,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,s,r,n=new ji;n.name=e[1].slice(1),""===n.name&&this.unnamedAtrule(n,e),this.init(n,e[2]);let o=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){n.source.end=this.getPosition(e[2]),n.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(r=a.length-1,s=a[r];s&&"space"===s[0];)s=a[--r];s&&(n.source.end=this.getPosition(s[3]||s[2]),n.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(n.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(n,"params",a),o&&(e=a[a.length-1],n.source.end=this.getPosition(e[3]||e[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),i&&(n.nodes=[],this.current=n)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let s,r=0;for(let n=t-1;n>=0&&(s=e[n],"space"===s[0]||(r+=1,2!==r));n--);throw this.input.error("Missed semicolon","word"===s[0]?s[3]+1:s[2])}colon(e){let t,s,r,n=0;for(let[o,i]of e.entries()){if(t=i,s=t[0],"("===s&&(n+=1),")"===s&&(n-=1),0===n&&":"===s){if(r){if("word"===r[0]&&"progid"===r[1])continue;return o}this.doubleColon(t)}r=t}return!1}comment(e){let t=new Bi;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let s=e[1].slice(2,-2);if(/^\s*$/.test(s))t.text="",t.raws.left=s,t.raws.right="";else{let e=s.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=Ui(this.input)}decl(e,t){let s=new _i;this.init(s,e[0][2]);let r,n=e[e.length-1];for(";"===n[0]&&(this.semicolon=!0,e.pop()),s.source.end=this.getPosition(n[3]||n[2]||function(e){for(let t=e.length-1;t>=0;t--){let s=e[t],r=s[3]||s[2];if(r)return r}}(e)),s.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),s.raws.before+=e.shift()[1];for(s.source.start=this.getPosition(e[0][2]),s.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;s.prop+=e.shift()[1]}for(s.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){s.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),s.raws.between+=r[1]}"_"!==s.prop[0]&&"*"!==s.prop[0]||(s.raws.before+=s.prop[0],s.prop=s.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(r=e[t],"!important"===r[1].toLowerCase()){s.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(s.raws.important=r);break}if("important"===r[1].toLowerCase()){let r=e.slice(0),n="";for(let e=t;e>0;e--){let t=r[e][0];if(0===n.trim().indexOf("!")&&"space"!==t)break;n=r.pop()[1]+n}0===n.trim().indexOf("!")&&(s.important=!0,s.raws.important=n,e=r)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(s.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(s,"value",i.concat(e),t),s.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new zi;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,s=null,r=!1,n=null,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(s=l[0],a.push(l),"("===s||"["===s)n||(n=l),o.push("("===s?")":"]");else if(i&&r&&"{"===s)n||(n=l),o.push("}");else if(0===o.length){if(";"===s){if(r)return void this.decl(a,i);break}if("{"===s)return void this.rule(a);if("}"===s){this.tokenizer.back(a.pop()),t=!0;break}":"===s&&(r=!0)}else s===o[o.length-1]&&(o.pop(),0===o.length&&(n=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&r){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,s,r){let n,o,i,a,l=s.length,c="",h=!0;for(let e=0;e<l;e+=1)n=s[e],o=n[0],"space"!==o||e!==l-1||r?"comment"===o?(a=s[e-1]?s[e-1][0]:"empty",i=s[e+1]?s[e+1][0]:"empty",Vi[a]||Vi[i]||","===c.slice(-1)?h=!1:c+=n[1]):c+=n[1]:h=!1;if(!h){let r=s.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:r,value:c}}e[t]=c}rule(e){e.pop();let t=new zi;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)s=e.pop()[1]+s;return s}spacesAndCommentsFromStart(e){let t,s="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)s+=e.shift()[1];return s}spacesFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)s=e.pop()[1]+s;return s}stringFrom(e,t){let s="";for(let r=t;r<e.length;r++)s+=e[r][1];return e.splice(t,e.length-t),s}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},Yi=fo;function Xi(e,t){let s=new Yi(e,t),r=new Zi(s);try{r.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return r.root}var Hi=Xi;Xi.default=Xi,Gi.registerParse(Xi);let{isClean:Ji,my:$i}=On,Ki=xo,qi=Nn,Qi=Wo,ea=Yo,ta=Ho,sa=Qo,ra=Hi,na=Ai;const oa={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},ia={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},aa={Once:!0,postcssPlugin:!0,prepare:!0};function la(e){return"object"==typeof e&&"function"==typeof e.then}function ca(e){let t=!1,s=oa[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[s,s+"-"+t,0,s+"Exit",s+"Exit-"+t]:t?[s,s+"-"+t,s+"Exit",s+"Exit-"+t]:e.append?[s,0,s+"Exit"]:[s,s+"Exit"]}function ha(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:ca(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function ua(e){return e[Ji]=!1,e.nodes&&e.nodes.forEach(e=>ua(e)),e}let pa={},da=class e{constructor(t,s,r){let n;if(this.stringified=!1,this.processed=!1,"object"!=typeof s||null===s||"root"!==s.type&&"document"!==s.type)if(s instanceof e||s instanceof sa)n=ua(s.root),s.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=s.map);else{let e=ra;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{n=e(s,r)}catch(e){this.processed=!0,this.error=e}n&&!n[$i]&&Qi.rebuild(n)}else n=ua(s);this.result=new sa(t,n,r),this.helpers={...pa,postcss:pa,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let s=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(s.postcssVersion&&"production"!==process.env.NODE_ENV){let e=s.postcssPlugin,t=s.postcssVersion,r=this.result.processor.version,n=t.split("."),o=r.split(".");(n[0]!==o[0]||parseInt(n[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+r+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=s.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,s)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,s])};for(let t of this.plugins)if("object"==typeof t)for(let s in t){if(!ia[s]&&/^[A-Z]/.test(s))throw new Error(`Unknown event ${s} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!aa[s])if("object"==typeof t[s])for(let r in t[s])e(t,"*"===r?s:s+"-"+r.toLowerCase(),t[s][r]);else"function"==typeof t[s]&&e(t,s,t[s])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],s=this.runOnRoot(t);if(la(s))try{await s}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ji];){e[Ji]=!0;let t=[ha(e)];for(;t.length>0;){let e=this.visitTick(t);if(la(e))try{await e}catch(e){let s=t[t.length-1].node;throw this.handleError(e,s)}}}if(this.listeners.OnceExit)for(let[t,s]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>s(e,this.helpers));await Promise.all(t)}else await s(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return la(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=qi;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new Ki(t,this.result.root,this.result.opts).generate();return this.result.css=s[0],this.result.map=s[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(la(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ji];)e[Ji]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||ta("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[s,r]of e){let e;this.result.lastPlugin=s;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(la(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:s,visitors:r}=t;if("root"!==s.type&&"document"!==s.type&&!s.parent)return void e.pop();if(r.length>0&&t.visitorIndex<r.length){let[e,n]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return n(s.toProxy(),this.helpers)}catch(e){throw this.handleError(e,s)}}if(0!==t.iterator){let r,n=t.iterator;for(;r=s.nodes[s.indexes[n]];)if(s.indexes[n]+=1,!r[Ji])return r[Ji]=!0,void e.push(ha(r));t.iterator=0,delete s.indexes[n]}let n=t.events;for(;t.eventIndex<n.length;){let e=n[t.eventIndex];if(t.eventIndex+=1,0===e)return void(s.nodes&&s.nodes.length&&(s[Ji]=!0,t.iterator=s.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Ji]=!0;let t=ca(e);for(let s of t)if(0===s)e.nodes&&e.each(e=>{e[Ji]||this.walkSync(e)});else{let t=this.listeners[s];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};da.registerPostcss=e=>{pa=e};var fa=da;da.default=da,na.registerLazyResult(da),ea.registerLazyResult(da);let ma=xo,ga=Nn,ya=Ho,wa=Hi;const va=Qo;let ba=class{constructor(e,t,s){let r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=s,this._map=void 0;let n=ga;this.result=new va(this._processor,r,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new ma(n,r,this._opts,t);if(i.isMap()){let[e,t]=i.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else i.clearAnnotation(),this.result.css=i.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||ya("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=wa;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Sa=ba;ba.default=ba;let Ca=Sa,Ia=fa,ka=Yo,xa=Ai,Oa=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let s of e)if(!0===s.postcss?s=s():s.postcss&&(s=s.postcss),"object"==typeof s&&Array.isArray(s.plugins))t=t.concat(s.plugins);else if("object"==typeof s&&s.postcssPlugin)t.push(s);else if("function"==typeof s)t.push(s);else{if("object"!=typeof s||!s.parse&&!s.stringify)throw new Error(s+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new Ia(this,e,t):new Ca(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Ea=Oa;Oa.default=Oa,xa.registerProcessor(Oa),ka.registerProcessor(Oa);let Ra=Vn,Ma=qn,Aa=Ro,Ta=xi,Na=fo,Pa=Ai,Da=Fi;function La(e,t){if(Array.isArray(e))return e.map(e=>La(e));let{inputs:s,...r}=e;if(s){t=[];for(let e of s){let s={...e,__proto__:Na.prototype};s.map&&(s.map={...s.map,__proto__:Ma.prototype}),t.push(s)}}if(r.nodes&&(r.nodes=e.nodes.map(e=>La(e,t))),r.source){let{inputId:e,...s}=r.source;r.source=s,null!=e&&(r.source.input=t[e])}if("root"===r.type)return new Pa(r);if("decl"===r.type)return new Ra(r);if("rule"===r.type)return new Da(r);if("comment"===r.type)return new Aa(r);if("atrule"===r.type)return new Ta(r);throw new Error("Unknown node type: "+e.type)}var Fa=La;La.default=La;let _a=xn,Ua=Vn,Ba=fa,ja=Wo,Wa=Ea,za=Nn,Va=Fa,Ga=Yo,Za=$o,Ya=Ro,Xa=xi,Ha=Qo,Ja=fo,$a=Hi,Ka=Ni,qa=Fi,Qa=Ai,el=jn;function tl(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Wa(e)}tl.plugin=function(e,t){let s,r=!1;function n(...s){console&&console.warn&&!r&&(r=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let n=t(...s);return n.postcssPlugin=e,n.postcssVersion=(new Wa).version,n}return Object.defineProperty(n,"postcss",{get:()=>(s||(s=n()),s)}),n.process=function(e,t,s){return tl([n(s)]).process(e,t)},n},tl.stringify=za,tl.parse=$a,tl.fromJSON=Va,tl.list=Ka,tl.comment=e=>new Ya(e),tl.atRule=e=>new Xa(e),tl.decl=e=>new Ua(e),tl.rule=e=>new qa(e),tl.root=e=>new Qa(e),tl.document=e=>new Ga(e),tl.CssSyntaxError=_a,tl.Declaration=Ua,tl.Container=ja,tl.Processor=Wa,tl.Document=Ga,tl.Comment=Ya,tl.Warning=Za,tl.AtRule=Xa,tl.Result=Ha,tl.Input=Ja,tl.Rule=qa,tl.Root=Qa,tl.Node=el,Ba.registerPostcss(tl);var sl=tl;tl.default=tl;const rl=mn(sl);rl.stringify,rl.fromJSON,rl.plugin,rl.parse,rl.list,rl.document,rl.comment,rl.atRule,rl.rule,rl.decl,rl.root,rl.CssSyntaxError,rl.Declaration,rl.Container,rl.Processor,rl.Document,rl.Comment,rl.Warning,rl.AtRule,rl.Result,rl.Input,rl.Rule,rl.Root,rl.Node;class nl{constructor(...e){fn(this,"parentElement",null),fn(this,"parentNode",null),fn(this,"ownerDocument"),fn(this,"firstChild",null),fn(this,"lastChild",null),fn(this,"previousSibling",null),fn(this,"nextSibling",null),fn(this,"ELEMENT_NODE",1),fn(this,"TEXT_NODE",3),fn(this,"nodeType"),fn(this,"nodeName"),fn(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof nl))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const ol={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},il={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},al={};function ll(e){if(al[e])return al[e];const t=globalThis[e],s=t.prototype,r=e in ol?ol[e]:void 0,n=Boolean(r&&r.every(e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(s,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))})),o=e in il?il[e]:void 0,i=Boolean(o&&o.every(e=>{var t;return"function"==typeof s[e]&&(null==(t=s[e])?void 0:t.toString().includes("[native code]"))}));if(n&&i&&!globalThis.Zone)return al[e]=t.prototype,t.prototype;try{const r=document.createElement("iframe");document.body.appendChild(r);const n=r.contentWindow;if(!n)return t.prototype;const o=n[e].prototype;return document.body.removeChild(r),o?al[e]=o:s}catch{return s}}const cl={};function hl(e,t,s){var r;const n=`${e}.${String(s)}`;if(cl[n])return cl[n].call(t);const o=ll(e),i=null==(r=Object.getOwnPropertyDescriptor(o,s))?void 0:r.get;return i?(cl[n]=i,i.call(t)):t[s]}const ul={};function pl(e,t,s){const r=`${e}.${String(s)}`;if(ul[r])return ul[r].bind(t);const n=ll(e)[s];return"function"!=typeof n?t[s]:(ul[r]=n,n.bind(t))}function dl(){return ll("MutationObserver").constructor}const fl={childNodes:function(e){return hl("Node",e,"childNodes")},parentNode:function(e){return hl("Node",e,"parentNode")},parentElement:function(e){return hl("Node",e,"parentElement")},textContent:function(e){return hl("Node",e,"textContent")},contains:function(e,t){return pl("Node",e,"contains")(t)},getRootNode:function(e){return pl("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?hl("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?hl("Element",e,"shadowRoot"):null},querySelector:function(e,t){return hl("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return hl("Element",e,"querySelectorAll")(t)},mutationObserver:dl};function ml(e,t,s=document){const r={capture:!0,passive:!0};return s.addEventListener(e,t,r),()=>s.removeEventListener(e,t,r)}const gl="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 yl={map:{},getId:()=>(console.error(gl),-1),getNode:()=>(console.error(gl),null),removeNodeFromMap(){console.error(gl)},has:()=>(console.error(gl),!1),reset(){console.error(gl)}};function wl(e,t,s={}){let r=null,n=0;return function(...o){const i=Date.now();n||!1!==s.leading||(n=i);const a=t-(i-n),l=this;a<=0||a>t?(r&&(clearTimeout(r),r=null),n=i,e.apply(l,o)):r||!1===s.trailing||(r=setTimeout(()=>{n=!1===s.leading?0:Date.now(),r=null,e.apply(l,o)},a))}}function vl(e,t,s,r,n=window){const o=n.Object.getOwnPropertyDescriptor(e,t);return n.Object.defineProperty(e,t,r?s:{set(e){setTimeout(()=>{s.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>vl(e,t,o||{},!0)}function bl(e,t,s){try{if(!(t in e))return()=>{};const r=e[t],n=s(r);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=n,()=>{e[t]=r}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(yl=new Proxy(yl,{get:(e,t,s)=>("map"===t&&console.error(gl),Reflect.get(e,t,s))}));let Sl=Date.now;function Cl(e){var t,s,r,n;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=fl.parentElement(o.body))?void 0:t.scrollLeft)||(null==(s=null==o?void 0:o.body)?void 0:s.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(r=fl.parentElement(o.body))?void 0:r.scrollTop)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollTop)||0}}function Il(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function kl(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function xl(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:fl.parentElement(e)}function Ol(e,t,s,r){if(!e)return!1;const n=xl(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t))return!0;if(r&&null!==n.closest("."+t))return!0}else if(ve(n,t,r))return!0}catch(e){}if(s){if(n.matches(s))return!0;if(r&&null!==n.closest(s))return!0}return!1}function El(e,t,s){return!("TITLE"!==e.tagName||!s.headTitleMutations)||-2===t.getId(e)}function Rl(e,t){if(V(e))return!1;const s=t.getId(e);if(!t.has(s))return!0;const r=fl.parentNode(e);return(!r||r.nodeType!==e.DOCUMENT_NODE)&&(!r||Rl(r,t))}function Ml(e){return Boolean(e.changedTouches)}function Al(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Tl(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Nl(e){return!!e&&(e instanceof nl&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(fl.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Sl=()=>(new Date).getTime());class Pl{constructor(){M(this,"id",1),M(this,"styleIDMap",new WeakMap),M(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let s;return s=void 0===t?this.id++:t,this.styleIDMap.set(e,s),this.idStyleMap.set(s,e),s}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 Dl(e){var t;let s=null;return"getRootNode"in e&&(null==(t=fl.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&fl.host(fl.getRootNode(e))&&(s=fl.host(fl.getRootNode(e))),s}function Ll(e){const t=e.ownerDocument;if(!t)return!1;const s=function(e){let t,s=e;for(;t=Dl(s);)s=t;return s}(e);return fl.contains(t,s)}function Fl(e){const t=e.ownerDocument;return!!t&&(fl.contains(t,e)||Ll(e))}var _l=(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))(_l||{}),Ul=(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))(Ul||{}),Bl=(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))(Bl||{}),jl=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(jl||{}),Wl=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Wl||{}),zl=(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))(zl||{}),Vl=(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))(Vl||{});function Gl(e){return"__ln"in e}class Zl{constructor(){M(this,"length",0),M(this,"head",null),M(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let s=0;s<e;s++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Gl(e.previousSibling)){const s=e.previousSibling.__ln.next;t.next=s,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,s&&(s.previous=t)}else if(e.nextSibling&&Gl(e.nextSibling)&&e.nextSibling.__ln.previous){const s=e.nextSibling.__ln.previous;t.previous=s,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,s&&(s.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const Yl=(e,t)=>`${e}@${t}`;class Xl{constructor(){M(this,"frozen",!1),M(this,"locked",!1),M(this,"texts",[]),M(this,"attributes",[]),M(this,"attributeMap",new WeakMap),M(this,"removes",[]),M(this,"mapRemoves",[]),M(this,"movedMap",{}),M(this,"addedSet",new Set),M(this,"movedSet",new Set),M(this,"droppedSet",new Set),M(this,"removesSubTreeCache",new Set),M(this,"mutationCb"),M(this,"blockClass"),M(this,"blockSelector"),M(this,"maskTextClass"),M(this,"maskTextSelector"),M(this,"inlineStylesheet"),M(this,"maskInputOptions"),M(this,"maskTextFn"),M(this,"maskInputFn"),M(this,"keepIframeSrcFn"),M(this,"recordCanvas"),M(this,"inlineImages"),M(this,"slimDOMOptions"),M(this,"dataURLOptions"),M(this,"doc"),M(this,"mirror"),M(this,"iframeManager"),M(this,"stylesheetManager"),M(this,"shadowDomManager"),M(this,"canvasManager"),M(this,"processedNodeManager"),M(this,"unattachedDoc"),M(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),M(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,s=new Zl,r=e=>{let t=e,s=-2;for(;-2===s;)t=t&&t.nextSibling,s=t&&this.mirror.getId(t);return s},n=n=>{const o=fl.parentNode(n);if(!o||!Fl(n))return;let i=!1;if(n.nodeType===Node.TEXT_NODE){const e=o.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(o)&&(i=!0)}const a=V(o)?this.mirror.getId(Dl(n)):this.mirror.getId(o),l=r(n);if(-1===a||-1===l)return s.addNode(n);const c=Ie(n,{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=>{Al(e,this.mirror)&&this.iframeManager.addIframe(e),Tl(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Nl(n)&&this.shadowDomManager.addShadowRoot(fl.shadowRoot(n),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:i});c&&(e.push({parentId:a,nextId:l,node:c}),t.add(c.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)Jl(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(fl.parentNode(e))||n(e);for(const e of this.addedSet)$l(this.droppedSet,e)||Jl(this.removesSubTreeCache,e,this.mirror)?$l(this.movedSet,e)?n(e):this.droppedSet.add(e):n(e);let o=null;for(;s.length;){let e=null;if(o){const t=this.mirror.getId(fl.parentNode(o.value)),s=r(o.value);-1!==t&&-1!==s&&(e=o)}if(!e){let t=s.tail;for(;t;){const s=t;if(t=t.previous,s){const t=this.mirror.getId(fl.parentNode(s.value));if(-1===r(s.value))continue;if(-1!==t){e=s;break}{const t=s.value,r=fl.parentNode(t);if(r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=fl.host(r);if(-1!==this.mirror.getId(t)){e=s;break}}}}}}if(!e){for(;s.head;)s.removeNode(s.head.value);break}o=e.previous,s.removeNode(e.value),n(e.value)}const i={texts:this.texts.map(e=>{const t=e.node,s=fl.parentNode(t);return s&&"TEXTAREA"===s.tagName&&this.genTextAreaValueMutation(s),{id:this.mirror.getId(t),value:e.value}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{const{attributes:t}=e;if("string"==typeof t.style){const s=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);s.length<t.style.length&&(s+r).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(i.texts.length||i.attributes.length||i.removes.length||i.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(i))}),M(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(fl.childNodes(e),e=>fl.textContent(e)||"").join("")}),M(this,"processMutation",e=>{if(!El(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=fl.textContent(e.target);Ol(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:be(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,xl(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let s=e.attributeName,r=e.target.getAttribute(s);if("value"===s){const e=K(t);r=H({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:r,maskInputFn:this.maskInputFn})}if(Ol(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue)return;let n=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===s&&!this.keepIframeSrcFn(r)){if(t.contentDocument)return;s="rr_src"}if(n||(n={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e.target,n)),"type"===s&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!we(t.tagName,s))if(n.attributes[s]=ye(this.doc,J(t.tagName),J(s),r),"style"===s){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const s=this.unattachedDoc.createElement("span");e.oldValue&&s.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const r=t.style.getPropertyValue(e),o=t.style.getPropertyPriority(e);r!==s.style.getPropertyValue(e)||o!==s.style.getPropertyPriority(e)?n.styleDiff[e]=""===o?r:[r,o]:n._unchangedStyles[e]=[r,o]}for(const e of Array.from(s.style))""===t.style.getPropertyValue(e)&&(n.styleDiff[e]=!1)}else"open"===s&&"DIALOG"===t.tagName&&(t.matches("dialog:modal")?n.attributes.rr_open_mode="modal":n.attributes.rr_open_mode="non-modal");break}case"childList":if(Ol(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const s=this.mirror.getId(t),r=V(e.target)?this.mirror.getId(fl.host(e.target)):this.mirror.getId(e.target);Ol(e.target,this.blockClass,this.blockSelector,!1)||El(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Hl(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===s||Rl(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Yl(s,r)]?Hl(this.movedSet,t):(this.removes.push({parentId:r,id:s,isShadow:!(!V(e.target)||!G(e.target))||void 0}),function(e,t){const s=[e];for(;s.length;){const e=s.pop();t.has(e)||(t.add(e),fl.childNodes(e).forEach(e=>s.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),M(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(El(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let s=null;t&&this.mirror.hasNode(t)&&(s=this.mirror.getId(t)),s&&-1!==s&&(this.movedMap[Yl(this.mirror.getId(e),s)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Ol(e,this.blockClass,this.blockSelector,!1)||(fl.childNodes(e).forEach(e=>this.genAdds(e)),Nl(e)&&fl.childNodes(fl.shadowRoot(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,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(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Hl(e,t){e.delete(t),fl.childNodes(t).forEach(t=>Hl(e,t))}function Jl(e,t,s){return 0!==e.size&&function(e,t){const s=fl.parentNode(t);return!!s&&e.has(s)}(e,t)}function $l(e,t){return 0!==e.size&&Kl(e,t)}function Kl(e,t){const s=fl.parentNode(t);return!!s&&(!!e.has(s)||Kl(e,s))}let ql;const Ql=e=>{if(!ql)return e;return(...t)=>{try{return e(...t)}catch(e){if(ql&&!0===ql(e))return;throw e}}},ec=[];function tc(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function sc(e,t){const s=new Xl;ec.push(s),s.init(e);const r=new(dl())(Ql(s.processMutations.bind(s)));return r.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function rc({mouseInteractionCb:e,doc:t,mirror:s,blockClass:r,blockSelector:n,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const i=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,a=[];let l=null;return Object.keys(Bl).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e]).forEach(o=>{let i=J(o);const c=(t=>o=>{const i=tc(o);if(Ol(i,r,n,!0))return;let a=null,c=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=jl.Mouse;break;case"touch":a=jl.Touch;break;case"pen":a=jl.Pen}a===jl.Touch?Bl[t]===Bl.MouseDown?c="TouchStart":Bl[t]===Bl.MouseUp&&(c="TouchEnd"):jl.Pen}else Ml(o)&&(a=jl.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===jl.Touch||c.startsWith("Mouse")&&a===jl.Mouse)&&(a=null)):Bl[t]===Bl.Click&&(a=l,l=null);const h=Ml(o)?o.changedTouches[0]:o;if(!h)return;const u=s.getId(i),{clientX:p,clientY:d}=h;Ql(e)({type:Bl[c],id:u,x:p,y:d,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(Bl[o]){case Bl.MouseDown:case Bl.MouseUp:i=i.replace("mouse","pointer");break;case Bl.TouchStart:case Bl.TouchEnd:return}a.push(ml(i,c,t))}),Ql(()=>{a.forEach(e=>e())})}function nc({scrollCb:e,doc:t,mirror:s,blockClass:r,blockSelector:n,sampling:o}){return ml("scroll",Ql(wl(Ql(o=>{const i=tc(o);if(!i||Ol(i,r,n,!0))return;const a=s.getId(i);if(i===t&&t.defaultView){const s=Cl(t.defaultView);e({id:a,x:s.left,y:s.top})}else e({id:a,x:i.scrollLeft,y:i.scrollTop})}),o.scroll||100)),t)}const oc=["INPUT","TEXTAREA","SELECT"],ic=new WeakMap;function ac(e){return function(e,t){if(uc("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||uc("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||uc("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||uc("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const s=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(s)}else if(e.parentStyleSheet){const s=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(s)}return t}(e,[])}function lc(e,t,s){let r,n;return e?(e.ownerNode?r=t.getId(e.ownerNode):n=s.getId(e),{styleId:n,id:r}):{}}function cc({mirror:e,stylesheetManager:t},s){var r,n,o;let i=null;i="#document"===s.nodeName?e.getId(s):e.getId(fl.host(s));const a="#document"===s.nodeName?null==(r=s.defaultView)?void 0:r.Document:null==(o=null==(n=s.ownerDocument)?void 0:n.defaultView)?void 0:o.ShadowRoot,l=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==i&&-1!==i&&a&&l?(Object.defineProperty(s,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var s;const r=null==(s=l.set)?void 0:s.call(this,e);if(null!==i&&-1!==i)try{t.adoptStyleSheets(e,i)}catch(e){}return r}}),Ql(()=>{Object.defineProperty(s,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function hc(e,t={}){const s=e.doc.defaultView;if(!s)return()=>{};let r;!function(e,t){const{mutationCb:s,mousemoveCb:r,mouseInteractionCb:n,scrollCb:o,viewportResizeCb:i,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:h,canvasMutationCb:u,fontCb:p,selectionCb:d,customElementCb:f}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),s(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),n(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),o(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),i(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),l(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),c(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),h(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),u(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),p(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),d(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),f(...e)}}(e,t),e.recordDOM&&(r=sc(e,e.doc));const n=function({mousemoveCb:e,sampling:t,doc:s,mirror:r}){if(!1===t.mousemove)return()=>{};const n="number"==typeof t.mousemove?t.mousemove:50,o="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let i,a=[];const l=wl(Ql(t=>{const s=Date.now()-i;e(a.map(e=>(e.timeOffset-=s,e)),t),a=[],i=null}),o),c=Ql(wl(Ql(e=>{const t=tc(e),{clientX:s,clientY:n}=Ml(e)?e.changedTouches[0]:e;i||(i=Sl()),a.push({x:s,y:n,id:r.getId(t),timeOffset:Sl()-i}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?Ul.Drag:e instanceof MouseEvent?Ul.MouseMove:Ul.TouchMove)}),n,{trailing:!1})),h=[ml("mousemove",c,s),ml("touchmove",c,s),ml("drag",c,s)];return Ql(()=>{h.forEach(e=>e())})}(e),o=rc(e),i=nc(e),a=function({viewportResizeCb:e},{win:t}){let s=-1,r=-1;return ml("resize",Ql(wl(Ql(()=>{const t=Il(),n=kl();s===t&&r===n||(e({width:Number(n),height:Number(t)}),s=t,r=n)}),200)),t)}(e,{win:s}),l=function({inputCb:e,doc:t,mirror:s,blockClass:r,blockSelector:n,ignoreClass:o,ignoreSelector:i,maskInputOptions:a,maskInputFn:l,sampling:c,userTriggeredOnInput:h}){function u(e){let s=tc(e);const c=e.isTrusted,u=s&&s.tagName;if(s&&"OPTION"===u&&(s=fl.parentElement(s)),!s||!u||oc.indexOf(u)<0||Ol(s,r,n,!0))return;if(s.classList.contains(o)||i&&s.matches(i))return;let d=s.value,f=!1;const m=K(s)||"";"radio"===m||"checkbox"===m?f=s.checked:(a[u.toLowerCase()]||a[m])&&(d=H({element:s,maskInputOptions:a,tagName:u,type:m,value:d,maskInputFn:l})),p(s,h?{text:d,isChecked:f,userTriggered:c}:{text:d,isChecked:f});const g=s.name;"radio"===m&&g&&f&&t.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(e=>{if(e!==s){const t=e.value;p(e,h?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}})}function p(t,r){const n=ic.get(t);if(!n||n.text!==r.text||n.isChecked!==r.isChecked){ic.set(t,r);const n=s.getId(t);Ql(e)({...r,id:n})}}const d=("last"===c.input?["change"]:["input","change"]).map(e=>ml(e,Ql(u),t)),f=t.defaultView;if(!f)return()=>{d.forEach(e=>e())};const m=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),g=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&d.push(...g.map(e=>vl(e[0],e[1],{set(){Ql(u)({target:this,isTrusted:!1})}},!1,f))),Ql(()=>{d.forEach(e=>e())})}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:s,mirror:r,sampling:n,doc:o}){const i=Ql(o=>wl(Ql(n=>{const i=tc(n);if(!i||Ol(i,t,s,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:h,loop:u}=i;e({type:o,id:r.getId(i),currentTime:a,volume:l,muted:c,playbackRate:h,loop:u})}),n.media||500)),a=[ml("play",i(zl.Play),o),ml("pause",i(zl.Pause),o),ml("seeked",i(zl.Seeked),o),ml("volumechange",i(zl.VolumeChange),o),ml("ratechange",i(zl.RateChange),o)];return Ql(()=>{a.forEach(e=>e())})}(e);let h=()=>{},u=()=>{},p=()=>{},d=()=>{};e.recordDOM&&(h=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:s},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const n=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(n,{apply:Ql((r,n,o)=>{const[i,a]=o,{id:l,styleId:c}=lc(n,t,s.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:a}]}),r.apply(n,o)})}),r.CSSStyleSheet.prototype.addRule=function(e,t,s=this.cssRules.length){const n=`${e} { ${t} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[n,s])};const o=r.CSSStyleSheet.prototype.deleteRule;let i,a;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:Ql((r,n,o)=>{const[i]=o,{id:a,styleId:l}=lc(n,t,s.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:i}]}),r.apply(n,o)})}),r.CSSStyleSheet.prototype.removeRule=function(e){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},r.CSSStyleSheet.prototype.replace&&(i=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(i,{apply:Ql((r,n,o)=>{const[i]=o,{id:a,styleId:l}=lc(n,t,s.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replace:i}),r.apply(n,o)})})),r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Ql((r,n,o)=>{const[i]=o,{id:a,styleId:l}=lc(n,t,s.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:i}),r.apply(n,o)})}));const l={};pc("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(pc("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),pc("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),pc("CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));const c={};return Object.entries(l).forEach(([r,n])=>{c[r]={insertRule:n.prototype.insertRule,deleteRule:n.prototype.deleteRule},n.prototype.insertRule=new Proxy(c[r].insertRule,{apply:Ql((r,n,o)=>{const[i,a]=o,{id:l,styleId:c}=lc(n.parentStyleSheet,t,s.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:[...ac(n),a||0]}]}),r.apply(n,o)})}),n.prototype.deleteRule=new Proxy(c[r].deleteRule,{apply:Ql((r,n,o)=>{const[i]=o,{id:a,styleId:l}=lc(n.parentStyleSheet,t,s.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...ac(n),i]}]}),r.apply(n,o)})})}),Ql(()=>{r.CSSStyleSheet.prototype.insertRule=n,r.CSSStyleSheet.prototype.deleteRule=o,i&&(r.CSSStyleSheet.prototype.replace=i),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([e,t])=>{t.prototype.insertRule=c[e].insertRule,t.prototype.deleteRule=c[e].deleteRule})})}(e,{win:s}),u=cc(e,e.doc),p=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:s,stylesheetManager:r},{win:n}){const o=n.CSSStyleDeclaration.prototype.setProperty;n.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Ql((n,i,a)=>{var l;const[c,h,u]=a;if(s.has(c))return o.apply(i,[c,h,u]);const{id:p,styleId:d}=lc(null==(l=i.parentRule)?void 0:l.parentStyleSheet,t,r.styleMirror);return(p&&-1!==p||d&&-1!==d)&&e({id:p,styleId:d,set:{property:c,value:h,priority:u},index:ac(i.parentRule)}),n.apply(i,a)})});const i=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:Ql((n,o,a)=>{var l;const[c]=a;if(s.has(c))return i.apply(o,[c]);const{id:h,styleId:u}=lc(null==(l=o.parentRule)?void 0:l.parentStyleSheet,t,r.styleMirror);return(h&&-1!==h||u&&-1!==u)&&e({id:h,styleId:u,remove:{property:c},index:ac(o.parentRule)}),n.apply(o,a)})}),Ql(()=>{n.CSSStyleDeclaration.prototype.setProperty=o,n.CSSStyleDeclaration.prototype.removeProperty=i})}(e,{win:s}),e.collectFonts&&(d=function({fontCb:e,doc:t}){const s=t.defaultView;if(!s)return()=>{};const r=[],n=new WeakMap,o=s.FontFace;s.FontFace=function(e,t,s){const r=new o(e,t,s);return n.set(r,{family:e,buffer:"string"!=typeof t,descriptors:s,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const i=bl(t.fonts,"add",function(t){return function(s){return setTimeout(Ql(()=>{const t=n.get(s);t&&(e(t),n.delete(s))}),0),t.apply(this,[s])}});return r.push(()=>{s.FontFace=o}),r.push(i),Ql(()=>{r.forEach(e=>e())})}(e)));const f=function(e){const{doc:t,mirror:s,blockClass:r,blockSelector:n,selectionCb:o}=e;let i=!0;const a=Ql(()=>{const e=t.getSelection();if(!e||i&&(null==e?void 0:e.isCollapsed))return;i=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const o=e.getRangeAt(t),{startContainer:i,startOffset:l,endContainer:c,endOffset:h}=o;Ol(i,r,n,!0)||Ol(c,r,n,!0)||a.push({start:s.getId(i),startOffset:l,end:s.getId(c),endOffset:h})}o({ranges:a})});return a(),ml("selectionchange",a)}(e),m=function({doc:e,customElementCb:t}){const s=e.defaultView;return s&&s.customElements?bl(s.customElements,"define",function(e){return function(s,r,n){try{t({define:{name:s}})}catch(e){console.warn(`Custom element callback failed for ${s}`)}return e.apply(this,[s,r,n])}}):()=>{}}(e),g=[];for(const t of e.plugins)g.push(t.observer(t.callback,s,t.options));return Ql(()=>{ec.forEach(e=>e.reset()),null==r||r.disconnect(),n(),o(),i(),a(),l(),c(),h(),u(),p(),d(),f(),m(),g.forEach(e=>e())})}function uc(e){return void 0!==window[e]}function pc(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class dc{constructor(e){M(this,"iframeIdToRemoteIdMap",new WeakMap),M(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,s,r){const n=s||this.getIdToRemoteIdMap(e),o=r||this.getRemoteIdToIdMap(e);let i=n.get(t);return i||(i=this.generateIdFn(),n.set(t,i),o.set(i,t)),i}getIds(e,t){const s=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,s,r))}getRemoteId(e,t,s){const r=s||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const n=r.get(t);return n||-1}getRemoteIds(e,t){const s=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,s))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class fc{constructor(e){M(this,"iframes",new WeakMap),M(this,"crossOriginIframeMap",new WeakMap),M(this,"crossOriginIframeMirror",new dc(le)),M(this,"crossOriginIframeStyleMirror"),M(this,"crossOriginIframeRootIdMap",new WeakMap),M(this,"mirror"),M(this,"mutationCb"),M(this,"wrappedEmit"),M(this,"loadListener"),M(this,"stylesheetManager"),M(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new dc(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var s,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(s=e.contentWindow)||s.addEventListener("message",this.handleMessage.bind(this))),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const s=this.crossOriginIframeMap.get(e.source);if(!s)return;const r=this.transformCrossOriginEvent(s,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var s;switch(t.type){case _l.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const s=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,s),this.patchRootIdOnNode(t.data.node,s),{timestamp:t.timestamp,type:_l.IncrementalSnapshot,data:{source:Ul.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case _l.Meta:case _l.Load:case _l.DomContentLoaded:return!1;case _l.Plugin:return t;case _l.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case _l.IncrementalSnapshot:switch(t.data.source){case Ul.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const s=this.crossOriginIframeRootIdMap.get(e);s&&this.patchRootIdOnNode(t.node,s)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Ul.Drag:case Ul.TouchMove:case Ul.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Ul.ViewportResize:return!1;case Ul.MediaInteraction:case Ul.MouseInteraction:case Ul.Scroll:case Ul.CanvasMutation:case Ul.Input:return this.replaceIds(t.data,e,["id"]),t;case Ul.StyleSheetRule:case Ul.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Ul.Font:return t;case Ul.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case Ul.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(s=t.data.styles)||s.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}return!1}replace(e,t,s,r){for(const n of r)(Array.isArray(t[n])||"number"==typeof t[n])&&(Array.isArray(t[n])?t[n]=e.getIds(s,t[n]):t[n]=e.getId(s,t[n]));return t}replaceIds(e,t,s){return this.replace(this.crossOriginIframeMirror,e,t,s)}replaceStyleIds(e,t,s){return this.replace(this.crossOriginIframeStyleMirror,e,t,s)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type===Vl.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class mc{constructor(e){M(this,"shadowDoms",new WeakSet),M(this,"mutationCb"),M(this,"scrollCb"),M(this,"bypassOptions"),M(this,"mirror"),M(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!G(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const s=sc({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>s.disconnect()),this.restoreHandlers.push(nc({...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(fl.host(e))),this.restoreHandlers.push(cc({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const s=this;this.restoreHandlers.push(bl(e.prototype,"attachShadow",function(e){return function(r){const n=e.call(this,r),o=fl.shadowRoot(this);return o&&Fl(this)&&s.addShadowRoot(o,t),n}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var gc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",yc="undefined"==typeof Uint8Array?[]:new Uint8Array(256),wc=0;wc<64;wc++)yc[gc.charCodeAt(wc)]=wc;const vc=new Map;const bc=(e,t,s)=>{if(!e||!Ic(e,t)&&"object"!=typeof e)return;const r=function(e,t){let s=vc.get(e);return s||(s=new Map,vc.set(e,s)),s.has(t)||s.set(t,[]),s.get(t)}(s,e.constructor.name);let n=r.indexOf(e);return-1===n&&(n=r.length,r.push(e)),n};function Sc(e,t,s){if(e instanceof Array)return e.map(e=>Sc(e,t,s));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){return{rr_type:e.constructor.name,base64:function(e){var t,s=new Uint8Array(e),r=s.length,n="";for(t=0;t<r;t+=3)n+=gc[s[t]>>2],n+=gc[(3&s[t])<<4|s[t+1]>>4],n+=gc[(15&s[t+1])<<2|s[t+2]>>6],n+=gc[63&s[t+2]];return r%3==2?n=n.substring(0,n.length-1)+"=":r%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Sc(e.buffer,t,s),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:s}=e;return{rr_type:t,src:s}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[Sc(e.data,t,s),e.width,e.height]}}if(Ic(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:bc(e,t,s)}}return e}const Cc=(e,t,s)=>e.map(e=>Sc(e,t,s)),Ic=(e,t)=>{const s=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(s.find(s=>e instanceof t[s]))};function kc(e,t,s,r){const n=[];try{const o=bl(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(n,...o){if(!Ol(this,t,s,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(n);if("__context"in this||(this.__context=e),r&&["webgl","webgl2"].includes(e))if(o[0]&&"object"==typeof o[0]){const e=o[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[n,...o])}});n.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(e=>e())}}function xc(e,t,s,r,n,o){const i=[],a=Object.getOwnPropertyNames(e);for(const l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if("function"!=typeof e[l])continue;const a=bl(e,l,function(e){return function(...i){const a=e.apply(this,i);if(bc(a,o,this),"tagName"in this.canvas&&!Ol(this.canvas,r,n,!0)){const e=Cc(i,o,this),r={type:t,property:l,args:e};s(this.canvas,r)}return a}});i.push(a)}catch{const r=vl(e,l,{set(e){s(this.canvas,{type:t,property:l,args:[e],setter:!0})}});i.push(r)}return i}const Oc="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Ec="undefined"!=typeof window&&window.Blob&&new Blob([(Rc=Oc,Uint8Array.from(atob(Rc),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});var Rc;function Mc(e){let t;try{if(t=Ec&&(window.URL||window.webkitURL).createObjectURL(Ec),!t)throw"";const s=new Worker(t,{name:null==e?void 0:e.name});return s.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),s}catch(t){return new Worker("data:text/javascript;base64,"+Oc,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Ac{constructor(e){M(this,"pendingCanvasMutations",new Map),M(this,"rafStamps",{latestId:0,invokeId:null}),M(this,"mirror"),M(this,"mutationCb"),M(this,"resetObservers"),M(this,"frozen",!1),M(this,"locked",!1),M(this,"processMutation",(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)});const{sampling:t="all",win:s,blockClass:r,blockSelector:n,recordCanvas:o,dataURLOptions:i}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(s,r,n),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,s,r,n,{dataURLOptions:i})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,s,r,n){const o=kc(t,s,r,!0),i=new Map,a=new Mc;a.onmessage=e=>{const{id:t}=e.data;if(i.set(t,!1),!("base64"in e.data))return;const{base64:s,type:r,width:n,height:o}=e.data;this.mutationCb({id:t,type:Wl["2D"],commands:[{property:"clearRect",args:[0,0,n,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:s}],type:r}]},0,0]}]})};const l=1e3/e;let c,h=0;const u=e=>{h&&e-h<l||(h=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{Ol(t,s,r,!0)||e.push(t)}),e})().forEach(async e=>{var t;const s=this.mirror.getId(e);if(i.get(s))return;if(0===e.width||0===e.height)return;if(i.set(s,!0),["webgl","webgl2"].includes(e.__context)){const s=e.getContext(e.__context);!1===(null==(t=null==s?void 0:s.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&s.clear(s.COLOR_BUFFER_BIT)}const r=await createImageBitmap(e);a.postMessage({id:s,bitmap:r,width:e.width,height:e.height,dataURLOptions:n.dataURLOptions},[r])})),c=requestAnimationFrame(u)};c=requestAnimationFrame(u),this.resetObservers=()=>{o(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,s){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=kc(e,t,s,!1),n=function(e,t,s,r){const n=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const i of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])continue;const o=bl(t.CanvasRenderingContext2D.prototype,i,function(n){return function(...o){return Ol(this.canvas,s,r,!0)||setTimeout(()=>{const s=Cc(o,t,this);e(this.canvas,{type:Wl["2D"],property:i,args:s})},0),n.apply(this,o)}});n.push(o)}catch{const s=vl(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:Wl["2D"],property:i,args:[t],setter:!0})}});n.push(s)}return()=>{n.forEach(e=>e())}}(this.processMutation.bind(this),e,t,s),o=function(e,t,s,r){const n=[];return n.push(...xc(t.WebGLRenderingContext.prototype,Wl.WebGL,e,s,r,t)),void 0!==t.WebGL2RenderingContext&&n.push(...xc(t.WebGL2RenderingContext.prototype,Wl.WebGL2,e,s,r,t)),()=>{n.forEach(e=>e())}}(this.processMutation.bind(this),e,t,s);this.resetObservers=()=>{r(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const s=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,s)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const s=this.pendingCanvasMutations.get(e);if(!s||-1===t)return;const r=s.map(e=>{const{type:t,...s}=e;return s}),{type:n}=s[0];this.mutationCb({id:t,type:n,commands:r}),this.pendingCanvasMutations.delete(e)}}class Tc{constructor(e){M(this,"trackedLinkElements",new WeakSet),M(this,"mutationCb"),M(this,"adoptedStyleSheetCb"),M(this,"styleMirror",new Pl),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const s={id:t,styleIds:[]},r=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),r.push({styleId:e,rules:Array.from(t.rules||CSSRule,(e,s)=>({rule:Y(e,t.href),index:s}))})),s.styleIds.push(e)}r.length>0&&(s.styles=r),this.adoptedStyleSheetCb(s)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Nc{constructor(){M(this,"nodeMap",new WeakMap),M(this,"active",!1)}inOtherBuffer(e,t){const s=this.nodeMap.get(e);return s&&Array.from(s).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}let Pc,Dc,Lc,Fc=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(E=e.contentWindow)?void 0:E.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const _c=new X;function Uc(e={}){const{emit:t,checkoutEveryNms:s,checkoutEveryNth:r,blockClass:n="rr-block",blockSelector:o=null,ignoreClass:i="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:h=!0,maskAllInputs:u,maskInputOptions:p,slimDOMOptions:d,maskInputFn:f,maskTextFn:m,hooks:g,packFn:y,sampling:w={},dataURLOptions:v={},mousemoveWait:b,recordDOM:S=!0,recordCanvas:C=!1,recordCrossOriginIframes:I=!1,recordAfter:k=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:x=!1,collectFonts:O=!1,inlineImages:E=!1,plugins:R,keepIframeSrcFn:M=()=>!1,ignoreCSSAttributes:A=new Set([]),errorHandler:T}=e;ql=T;const N=!I||window.parent===window;let P=!1;if(!N)try{window.parent.document&&(P=!1)}catch(e){P=!0}if(N&&!t)throw new Error("emit function is required");if(!N&&!P)return()=>{};void 0!==b&&void 0===w.mousemove&&(w.mousemove=b),_c.reset();const D=!0===u?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==p?p:{password:!0},L=!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||{};let F;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let _=0;const U=e=>{for(const t of R||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!P&&(e=y(e)),e};Pc=(e,n)=>{var o;const i=e;if(i.timestamp=Sl(),!(null==(o=ec[0])?void 0:o.isFrozen())||i.type===_l.FullSnapshot||i.type===_l.IncrementalSnapshot&&i.data.source===Ul.Mutation||ec.forEach(e=>e.unfreeze()),N)null==t||t(U(i),n);else if(P){const e={type:"rrweb",event:U(i),origin:window.location.origin,isCheckout:n};window.parent.postMessage(e,"*")}if(i.type===_l.FullSnapshot)F=i,_=0;else if(i.type===_l.IncrementalSnapshot){if(i.data.source===Ul.Mutation&&i.data.isAttachIframe)return;_++;const e=r&&_>=r,t=s&&i.timestamp-F.timestamp>s;(e||t)&&Dc(!0)}};const B=e=>{Pc({type:_l.IncrementalSnapshot,data:{source:Ul.Mutation,...e}})},j=e=>Pc({type:_l.IncrementalSnapshot,data:{source:Ul.Scroll,...e}}),W=e=>Pc({type:_l.IncrementalSnapshot,data:{source:Ul.CanvasMutation,...e}}),z=new Tc({mutationCb:B,adoptedStyleSheetCb:e=>Pc({type:_l.IncrementalSnapshot,data:{source:Ul.AdoptedStyleSheet,...e}})}),V=new fc({mirror:_c,mutationCb:B,stylesheetManager:z,recordCrossOriginIframes:I,wrappedEmit:Pc});for(const e of R||[])e.getMirror&&e.getMirror({nodeMirror:_c,crossOriginIframeMirror:V.crossOriginIframeMirror,crossOriginIframeStyleMirror:V.crossOriginIframeStyleMirror});const G=new Nc;Lc=new Ac({recordCanvas:C,mutationCb:W,win:window,blockClass:n,blockSelector:o,mirror:_c,sampling:w.canvas,dataURLOptions:v});const Z=new mc({mutationCb:B,scrollCb:j,bypassOptions:{blockClass:n,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:h,maskInputOptions:D,dataURLOptions:v,maskTextFn:m,maskInputFn:f,recordCanvas:C,inlineImages:E,sampling:w,slimDOMOptions:L,iframeManager:V,stylesheetManager:z,canvasManager:Lc,keepIframeSrcFn:M,processedNodeManager:G},mirror:_c});Dc=(e=!1)=>{if(!S)return;Pc({type:_l.Meta,data:{href:window.location.href,width:kl(),height:Il()}},e),z.reset(),Z.init(),ec.forEach(e=>e.lock());const t=function(e,t){const{mirror:s=new X,blockClass:r="rr-block",blockSelector:n=null,maskTextClass:o="rr-mask",maskTextSelector:i=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:h=!1,maskTextFn:u,maskInputFn:p,slimDOM:d=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:v,stylesheetLoadTimeout:b,keepIframeSrcFn:S=()=>!1}=t||{};return Ie(e,{doc:e,mirror:s,blockClass:r,blockSelector:n,maskTextClass:o,maskTextSelector:i,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===h?{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===h?{password:!0}:h,maskTextFn:u,maskInputFn:p,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:l,recordCanvas:c,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:v,stylesheetLoadTimeout:b,keepIframeSrcFn:S,newlyAddedElement:!1})}(document,{mirror:_c,blockClass:n,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:h,maskAllInputs:D,maskTextFn:m,maskInputFn:f,slimDOM:L,dataURLOptions:v,recordCanvas:C,inlineImages:E,onSerialize:e=>{Al(e,_c)&&V.addIframe(e),Tl(e,_c)&&z.trackLinkElement(e),Nl(e)&&Z.addShadowRoot(fl.shadowRoot(e),document)},onIframeLoad:(e,t)=>{V.attachIframe(e,t),Z.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{z.attachLinkElement(e,t)},keepIframeSrcFn:M});if(!t)return console.warn("Failed to snapshot the document");Pc({type:_l.FullSnapshot,data:{node:t,initialOffset:Cl(window)}},e),ec.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,_c.getId(document))};try{const e=[],t=e=>{var t;return Ql(hc)({mutationCb:B,mousemoveCb:(e,t)=>Pc({type:_l.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Pc({type:_l.IncrementalSnapshot,data:{source:Ul.MouseInteraction,...e}}),scrollCb:j,viewportResizeCb:e=>Pc({type:_l.IncrementalSnapshot,data:{source:Ul.ViewportResize,...e}}),inputCb:e=>Pc({type:_l.IncrementalSnapshot,data:{source:Ul.Input,...e}}),mediaInteractionCb:e=>Pc({type:_l.IncrementalSnapshot,data:{source:Ul.MediaInteraction,...e}}),styleSheetRuleCb:e=>Pc({type:_l.IncrementalSnapshot,data:{source:Ul.StyleSheetRule,...e}}),styleDeclarationCb:e=>Pc({type:_l.IncrementalSnapshot,data:{source:Ul.StyleDeclaration,...e}}),canvasMutationCb:W,fontCb:e=>Pc({type:_l.IncrementalSnapshot,data:{source:Ul.Font,...e}}),selectionCb:e=>{Pc({type:_l.IncrementalSnapshot,data:{source:Ul.Selection,...e}})},customElementCb:e=>{Pc({type:_l.IncrementalSnapshot,data:{source:Ul.CustomElement,...e}})},blockClass:n,ignoreClass:i,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:D,inlineStylesheet:h,sampling:w,recordDOM:S,recordCanvas:C,inlineImages:E,userTriggeredOnInput:x,collectFonts:O,doc:e,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:M,blockSelector:o,slimDOMOptions:L,dataURLOptions:v,mirror:_c,iframeManager:V,stylesheetManager:z,shadowDomManager:Z,processedNodeManager:G,canvasManager:Lc,ignoreCSSAttributes:A,plugins:(null==(t=null==R?void 0:R.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>Pc({type:_l.Plugin,data:{plugin:e.name,payload:t}})})))||[]},g)};V.addLoadListener(s=>{try{e.push(t(s.contentDocument))}catch(e){console.warn(e)}});const s=()=>{Dc(),e.push(t(document)),Fc=!0};return"interactive"===document.readyState||"complete"===document.readyState?s():(e.push(ml("DOMContentLoaded",()=>{Pc({type:_l.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&s()})),e.push(ml("load",()=>{Pc({type:_l.Load,data:{}}),"load"===k&&s()},window))),()=>{e.forEach(e=>e()),G.destroy(),Fc=!1,ql=void 0}}catch(e){console.warn(e)}}var Bc,jc,Wc,zc;Uc.addCustomEvent=(e,t)=>{if(!Fc)throw new Error("please add custom event after start recording");Pc({type:_l.Custom,data:{tag:e,payload:t}})},Uc.freezePage=()=>{ec.forEach(e=>e.freeze())},Uc.takeFullSnapshot=e=>{if(!Fc)throw new Error("please take full snapshot after start recording");Dc(e)},Uc.mirror=_c,(jc=Bc||(Bc={}))[jc.NotStarted=0]="NotStarted",jc[jc.Running=1]="Running",jc[jc.Stopped=2]="Stopped",e.SessionEventType=void 0,(Wc=e.SessionEventType||(e.SessionEventType={})).CONSOLE="CONSOLE",Wc.ERROR="ERROR",Wc.NETWORK="NETWORK",Wc.CUSTOM="CUSTOM",Wc.PERFORMANCE="PERFORMANCE",Wc.PAGE_VIEW="PAGE_VIEW",e.ConsoleLevel=void 0,(zc=e.ConsoleLevel||(e.ConsoleLevel={})).LOG="log",zc.INFO="info",zc.WARN="warn",zc.ERROR="error",zc.DEBUG="debug";class Vc{constructor(e,t){this.session=null,this.eventBuffer=[],this.telemetryBuffer=[],this.originalConsoleMethods=new Map,this.isRecording=!1,this.client=e,this.config=this.applyDefaults(t||{}),this.shouldRecordSession()&&this.init()}applyDefaults(e){return{enabled:e.enabled??!0,sampleRate:e.sampleRate??1,recording:{maskAllInputs:e.recording?.maskAllInputs??!0,maskTextSelector:e.recording?.maskTextSelector??"[data-mask]",blockSelector:e.recording?.blockSelector??"[data-block]",recordCanvas:e.recording?.recordCanvas??!1,collectFonts:e.recording?.collectFonts??!1,inlineStylesheet:e.recording?.inlineStylesheet??!0,inlineImages:e.recording?.inlineImages??!1},buffering:{flushInterval:e.buffering?.flushInterval??5e3,maxBufferSize:e.buffering?.maxBufferSize??100,maxSessionDuration:e.buffering?.maxSessionDuration??36e5},telemetry:{captureConsole:e.telemetry?.captureConsole??!0,captureNetwork:e.telemetry?.captureNetwork??!0,captureErrors:e.telemetry?.captureErrors??!0,capturePerformance:e.telemetry?.capturePerformance??!0},privacy:{maskEmails:e.privacy?.maskEmails??!0,maskPhones:e.privacy?.maskPhones??!0,maskCreditCards:e.privacy?.maskCreditCards??!0,customMaskPatterns:e.privacy?.customMaskPatterns??[]}}}shouldRecordSession(){return!!this.config.enabled&&(void 0===this.config.sampleRate||this.config.sampleRate>=1||Math.random()<this.config.sampleRate)}async init(){try{await this.startSession(),this.startRrwebRecording(),setTimeout(()=>{this.flush()},100),this.config.telemetry?.captureConsole&&this.interceptConsole(),this.config.telemetry?.captureNetwork&&this.interceptNetwork(),this.config.telemetry?.captureErrors&&this.captureErrors(),this.config.telemetry?.capturePerformance&&this.capturePerformance(),this.startFlushInterval(),this.setupUnloadHandler(),this.isRecording=!0}catch(e){console.error("[SessionReplay] Failed to initialize:",e)}}async startSession(){const e=this.client.visitorId?.getVisitorId(),t=this.client.deviceInfo?.getDeviceInfo();this.sessionStartTime=Date.now();const s={visitorId:e,initialUrl:window.location.href,referrer:document.referrer||void 0,deviceType:t?.deviceType,browser:t?.browser,os:t?.os,viewport:{width:window.innerWidth,height:window.innerHeight}};try{const e=await this.client.http.post("/api/v1/session-replays/start/",s);this.session={sessionId:e.sessionId,startTime:new Date(this.sessionStartTime),initialUrl:s.initialUrl,referrer:s.referrer,visitorId:s.visitorId,deviceType:s.deviceType,browser:s.browser,os:s.os,viewport:s.viewport,status:"ACTIVE"}}catch(e){throw console.error("[SessionReplay] Failed to start session:",e),e}}startRrwebRecording(){this.stopRecording=Uc({emit:e=>{this.eventBuffer.push(e),this.eventBuffer.length>=(this.config.buffering?.maxBufferSize||100)&&this.flush()},maskAllInputs:this.config.recording?.maskAllInputs,maskTextSelector:this.config.recording?.maskTextSelector,blockSelector:this.config.recording?.blockSelector,recordCanvas:this.config.recording?.recordCanvas,collectFonts:this.config.recording?.collectFonts,inlineStylesheet:this.config.recording?.inlineStylesheet,inlineImages:this.config.recording?.inlineImages,maskTextFn:e=>this.maskPII(e)})}interceptConsole(){[e.ConsoleLevel.LOG,e.ConsoleLevel.INFO,e.ConsoleLevel.WARN,e.ConsoleLevel.ERROR,e.ConsoleLevel.DEBUG].forEach(t=>{const s=console[t];this.originalConsoleMethods.set(t,s),console[t]=(...r)=>{s.apply(console,r),this.addTelemetryEvent({type:e.SessionEventType.CONSOLE,timestamp:new Date,offsetMs:this.getOffsetMs(),console:{level:t,message:r.map(e=>String(e)).join(" "),args:r.map(e=>this.serializeValue(e))}})}})}interceptNetwork(){this.originalFetch=window.fetch,window.fetch=async(...t)=>{const s=Date.now(),r="string"==typeof t[0]?t[0]:t[0].url,n=(t[1]?.method||"GET").toUpperCase();try{const o=await this.originalFetch.apply(window,t),i=Date.now()-s;return this.addTelemetryEvent({type:e.SessionEventType.NETWORK,timestamp:new Date,offsetMs:this.getOffsetMs(),network:{method:n,url:r,statusCode:o.status,duration:i}}),o}catch(t){const o=Date.now()-s;throw this.addTelemetryEvent({type:e.SessionEventType.NETWORK,timestamp:new Date,offsetMs:this.getOffsetMs(),network:{method:n,url:r,duration:o,statusCode:0}}),t}},this.originalXHROpen=XMLHttpRequest.prototype.open,this.originalXHRSend=XMLHttpRequest.prototype.send;const t=this;XMLHttpRequest.prototype.open=function(e,s,r=!0,n,o){return this._crx_method=e,this._crx_url=s.toString(),this._crx_startTime=Date.now(),t.originalXHROpen.call(this,e,s,r,n,o)},XMLHttpRequest.prototype.send=function(s){return this.addEventListener("load",function(){const s=Date.now()-this._crx_startTime;t.addTelemetryEvent({type:e.SessionEventType.NETWORK,timestamp:new Date,offsetMs:t.getOffsetMs(),network:{method:this._crx_method,url:this._crx_url,statusCode:this.status,duration:s}})}),this.addEventListener("error",function(){const s=Date.now()-this._crx_startTime;t.addTelemetryEvent({type:e.SessionEventType.NETWORK,timestamp:new Date,offsetMs:t.getOffsetMs(),network:{method:this._crx_method,url:this._crx_url,statusCode:0,duration:s}})}),t.originalXHRSend.call(this,s)}}captureErrors(){window.addEventListener("error",t=>{this.addTelemetryEvent({type:e.SessionEventType.ERROR,timestamp:new Date,offsetMs:this.getOffsetMs(),error:{message:t.message,stack:t.error?.stack,filename:t.filename,lineno:t.lineno,colno:t.colno}})}),window.addEventListener("unhandledrejection",t=>{this.addTelemetryEvent({type:e.SessionEventType.ERROR,timestamp:new Date,offsetMs:this.getOffsetMs(),error:{message:`Unhandled Promise Rejection: ${t.reason}`,stack:t.reason?.stack}})})}capturePerformance(){if(window.performance&&window.performance.timing&&window.addEventListener("load",()=>{setTimeout(()=>{const t=window.performance.timing,s=t.navigationStart;this.addTelemetryEvent({type:e.SessionEventType.PERFORMANCE,timestamp:new Date,offsetMs:this.getOffsetMs(),performance:{metric:"dom_content_loaded",value:t.domContentLoadedEventEnd-s}}),this.addTelemetryEvent({type:e.SessionEventType.PERFORMANCE,timestamp:new Date,offsetMs:this.getOffsetMs(),performance:{metric:"page_load",value:t.loadEventEnd-s}})},0)}),"PerformanceObserver"in window)try{const t=new PerformanceObserver(t=>{const s=t.getEntries(),r=s[s.length-1];r&&this.addTelemetryEvent({type:e.SessionEventType.PERFORMANCE,timestamp:new Date,offsetMs:this.getOffsetMs(),performance:{metric:"lcp",value:r.renderTime||r.loadTime,rating:this.getRating(r.renderTime||r.loadTime,2500,4e3)}})});t.observe({entryTypes:["largest-contentful-paint"]});const s=new PerformanceObserver(t=>{t.getEntries().forEach(t=>{this.addTelemetryEvent({type:e.SessionEventType.PERFORMANCE,timestamp:new Date,offsetMs:this.getOffsetMs(),performance:{metric:"fid",value:t.processingStart-t.startTime,rating:this.getRating(t.processingStart-t.startTime,100,300)}})})});s.observe({entryTypes:["first-input"]});let r=0;const n=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{e.hadRecentInput||(r+=e.value)})});n.observe({entryTypes:["layout-shift"]}),window.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&this.addTelemetryEvent({type:e.SessionEventType.PERFORMANCE,timestamp:new Date,offsetMs:this.getOffsetMs(),performance:{metric:"cls",value:r,rating:this.getRating(r,.1,.25)}})})}catch(e){console.warn("[SessionReplay] PerformanceObserver not fully supported")}}getRating(e,t,s){return e<=t?"good":e<=s?"needs-improvement":"poor"}addTelemetryEvent(e){this.telemetryBuffer.push(e)}getOffsetMs(){return this.sessionStartTime?Date.now()-this.sessionStartTime:0}serializeValue(e){try{return null==e?e:"function"==typeof e?"[Function]":e instanceof Error?{message:e.message,stack:e.stack}:"object"==typeof e?JSON.parse(JSON.stringify(e,null,2)):e}catch{return"[Unserializable]"}}maskPII(e){let t=e;return this.config.privacy?.maskEmails&&(t=t.replace(/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g,"***@***.***")),this.config.privacy?.maskPhones&&(t=t.replace(/(\+?\d{1,3}[-.\s]?)?(\(?\d{3}\)?[-.\s]?)?\d{3}[-.\s]?\d{4}/g,"***-***-****")),this.config.privacy?.maskCreditCards&&(t=t.replace(/\b\d{4}[\s-]?\d{4}[\s-]?\d{4}[\s-]?\d{4}\b/g,"****-****-****-****")),this.config.privacy?.customMaskPatterns?.forEach(({pattern:e,replacement:s})=>{t=t.replace(e,s)}),t}startFlushInterval(){const e=this.config.buffering?.flushInterval||5e3;this.flushIntervalId=window.setInterval(()=>{this.flush()},e)}async flush(){if(!this.session)return;if(0===this.eventBuffer.length&&0===this.telemetryBuffer.length)return;const e=[...this.eventBuffer],t=[...this.telemetryBuffer];this.eventBuffer=[],this.telemetryBuffer=[];try{const s={sessionId:this.session.sessionId,events:e,telemetryEvents:t};await this.client.http.post("/api/v1/session-replays/ingest/",s)}catch(s){console.error("[SessionReplay] Failed to flush events:",s),this.eventBuffer=[...e,...this.eventBuffer],this.telemetryBuffer=[...t,...this.telemetryBuffer]}}setupUnloadHandler(){window.addEventListener("beforeunload",()=>{this.stop()}),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&this.flush()})}async stop(){if(this.isRecording&&this.session)try{this.stopRecording&&this.stopRecording(),this.flushIntervalId&&clearInterval(this.flushIntervalId),await this.flush(),await this.client.http.post("/api/v1/session-replays/end/",{sessionId:this.session.sessionId}),this.isRecording=!1}catch(e){console.error("[SessionReplay] Failed to stop session:",e)}}logCustomEvent(t){this.isRecording&&this.addTelemetryEvent({type:e.SessionEventType.CUSTOM,timestamp:new Date,offsetMs:this.getOffsetMs(),custom:{name:t.name,data:t.data}})}getSession(){return this.session}destroy(){this.stop(),this.originalConsoleMethods.forEach((e,t)=>{console[t]=e}),this.originalFetch&&(window.fetch=this.originalFetch),this.originalXHROpen&&(XMLHttpRequest.prototype.open=this.originalXHROpen),this.originalXHRSend&&(XMLHttpRequest.prototype.send=this.originalXHRSend)}}const Gc="undefined"!=typeof window;e.AuthenticationError=r,e.AutoPageViewPlugin=O,e.CRMClient=class{constructor(e){this.plugins=[],this.config=new t(e),this.http=new h(this.config),this._events=new p(this.http),this._contacts=new d(this.http),this._deals=new f(this.http),this._experiments=new m(this.http),Gc&&this.initBrowserPlugins()}get events(){return this._events}get contacts(){return this._contacts}get deals(){return this._deals}get experiments(){return this._experiments}get visitorId(){return this._visitorId}get deviceInfo(){return this._deviceInfo}get sessionReplay(){return this._sessionReplay}initBrowserPlugins(){this.config.persistVisitorId&&(this._visitorId=new b(this.config),this.plugins.push(this._visitorId)),this.config.autoDeviceInfo&&(this._deviceInfo=new x,this.plugins.push(this._deviceInfo)),this.config.autoPageView&&(this._autoPageView=new O(this),this.plugins.push(this._autoPageView)),!1!==this.config.sessionReplay?.enabled&&(this._sessionReplay=new Vc(this,this.config.sessionReplay),this.plugins.push(this._sessionReplay))}destroy(){this.plugins.forEach(e=>{e.destroy&&e.destroy()}),this.plugins=[]}},e.CRMError=s,e.Config=t,e.ContactsResource=d,e.DealsResource=f,e.DeviceInfoPlugin=x,e.EventsResource=p,e.ExperimentsResource=m,e.NetworkError=l,e.RateLimitError=i,e.ResourceNotFoundError=n,e.ServerError=a,e.SessionReplayPlugin=Vc,e.VERSION="1.2.5",e.ValidationError=o,e.VisitorIdPlugin=b,e.detectBrowser=C,e.detectDeviceType=S,e.detectOS=I,e.generateUUID=v,e.getDeviceInfo=k,e.getLocalStorageItem=y,e.isLocalStorageAvailable=g,e.removeLocalStorageItem=function(e){if(!g())return!1;try{return window.localStorage.removeItem(e),!0}catch{return!1}},e.setLocalStorageItem=w});
2
2
  //# sourceMappingURL=browser.js.map