crexperium-sdk 1.2.2 → 1.2.4

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 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)throw new Error("externalId is required");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 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}/`)}}function m(){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 g(e){if(!m())return null;try{return window.localStorage.getItem(e)}catch{return null}}function y(e,t){if(!m())return!1;try{return window.localStorage.setItem(e,t),!0}catch{return!1}}function w(){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 v{constructor(e){this.config=e,this.visitorId=this.getOrCreateVisitorId()}getOrCreateVisitorId(){const e=g(this.config.visitorIdKey);if(e)return e;const t=w();return y(this.config.visitorIdKey,t),t}getVisitorId(){return this.visitorId}setVisitorId(e){this.visitorId=e,y(this.config.visitorIdKey,e)}resetVisitorId(){const e=w();return this.setVisitorId(e),e}destroy(){}}function b(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 S(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 C(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 I(){if("undefined"==typeof navigator)return{userAgent:"",deviceType:"desktop",browser:"Unknown",os:"Unknown"};const e=navigator.userAgent;return{userAgent:e,deviceType:b(e),browser:S(e),os:C(e)}}class k{constructor(){this.deviceInfo=I()}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 x{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 O,E=Object.defineProperty,R=(e,t,s)=>((e,t,s)=>t in e?E(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s),M=Object.defineProperty,A=(e,t,s)=>((e,t,s)=>t in e?M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s),T=(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))(T||{});const N={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},P={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},D={};function L(e){if(D[e])return D[e];const t=globalThis[e],s=t.prototype,r=e in N?N[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 P?P[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 D[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?D[e]=o:s}catch{return s}}const F={};function _(e,t,s){var r;const n=`${e}.${String(s)}`;if(F[n])return F[n].call(t);const o=L(e),i=null==(r=Object.getOwnPropertyDescriptor(o,s))?void 0:r.get;return i?(F[n]=i,i.call(t)):t[s]}const B={};function U(e,t,s){const r=`${e}.${String(s)}`;if(B[r])return B[r].bind(t);const n=L(e)[s];return"function"!=typeof n?t[s]:(B[r]=n,n.bind(t))}const j={childNodes:function(e){return _("Node",e,"childNodes")},parentNode:function(e){return _("Node",e,"parentNode")},parentElement:function(e){return _("Node",e,"parentElement")},textContent:function(e){return _("Node",e,"textContent")},contains:function(e,t){return U("Node",e,"contains")(t)},getRootNode:function(e){return U("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?_("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?_("Element",e,"shadowRoot"):null},querySelector:function(e,t){return _("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return _("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return L("MutationObserver").constructor}};function W(e){return e.nodeType===e.ELEMENT_NODE}function z(e){const t=e&&"host"in e&&"mode"in e&&j.host(e)||null;return Boolean(t&&"shadowRoot"in t&&j.shadowRoot(t)===e)}function V(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function G(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=>Z(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 Z(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=G(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?se(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?se(s,t):s}}class Y{constructor(){A(this,"idNodeMap",new Map),A(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 X({element:e,maskInputOptions:t,tagName:s,type:r,value:n,maskInputFn:o}){let i=n||"";const a=r&&H(r);return(t[s.toLowerCase()]||a&&t[a])&&(i=o?o(i,e):"*".repeat(i.length)),i}function H(e){return e.toLowerCase()}const $="__rrweb_original__";function J(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?H(t):null}function K(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,Q=/^(?:[a-z+]+:)?\/\//i,ee=/^www\..*/i,te=/^(data:)([^,]*),(.*)/i;function se(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(Q.test(a)||ee.test(a))return`url(${l}${a}${l})`;if(te.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 re(e){return e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function ne(e,t){return function(e,t){const s=Array.from(t.childNodes),r=[];if(s.length>1&&e&&"string"==typeof e){const t=re(e);for(let n=1;n<s.length;n++)if(s[n].textContent&&"string"==typeof s[n].textContent){const o=re(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(re(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 oe=1;const ie=new RegExp("[^a-z0-9-_:]");function ae(){return oe++}let le,ce;const he=/^[^ \t\n\r\u000c]+/,ue=/^[, \t\n\r\u000c]+/;const pe=new WeakMap;function de(e,t){return t&&""!==t.trim()?me(e,t):t}function fe(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function me(e,t){let s=pe.get(e);if(s||(s=e.createElement("a"),pe.set(e,s)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return s.setAttribute("href",t),s.href}function ge(e,t,s,r){return r?"src"===s||"href"===s&&("use"!==t||"#"!==r[0])||"xlink:href"===s&&"#"!==r[0]?de(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(ue),!(s>=t.length);){let o=r(he);if(","===o.slice(-1))o=de(e,o.substring(0,o.length-1)),n.push(o);else{let r="";o=de(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?se(r,me(e)):"object"===t&&"data"===s?de(e,r):r:de(e,r):r}function ye(e,t,s){return("video"===e||"audio"===e)&&"autoplay"===t}function we(e,t,s){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!s&&we(j.parentNode(e),t,s);for(let s=e.classList.length;s--;){const r=e.classList[s];if(t.test(r))return!0}return!!s&&we(j.parentNode(e),t,s)}function ve(e,t,s,r){let n;if(W(e)){if(n=e,!j.childNodes(n).length)return!1}else{if(null===j.parentElement(e))return!1;n=j.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(we(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 be(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:T.Document,childNodes:[],compatMode:e.compatMode}:{type:T.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:T.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=H(e.tagName);return ie.test(t)?"div":t}(e);let g={};const y=e.attributes.length;for(let t=0;t<y;t++){const r=e.attributes[t];ye(m,r.name,r.value)||(g[r.name]=ge(s,m,H(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=G(t)),r&&(delete g.rel,delete g.href,g._cssText=r)}if("style"===m&&e.sheet){let t=G(e.sheet);t&&(e.childNodes.length>1&&(t=ne(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=X({element:e,type:J(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){le||(le=s.createElement("canvas"),ce=le.getContext("2d"));const t=e,r=t.currentSrc||t.getAttribute("src")||"<unknown-src>",n=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{le.width=t.naturalWidth,le.height=t.naturalHeight,ce.drawImage(t,0,0),g.rr_dataURL=le.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:T.Element,tagName:m,attributes:g,childNodes:[],isSVG:fe(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=j.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=j.textContent(e),c&&l&&(l=se(l,me(t.doc))));!c&&!h&&l&&s&&(l=r?r(l,j.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:T.Text,textContent:l||"",rootId:n}}(e,{doc:s,needsMask:i,maskTextFn:c,rootId:y,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:T.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:T.Comment,textContent:j.textContent(e)||"",rootId:y};default:return!1}}function Se(e){return null==e?"":e.toLowerCase()}function Ce(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=ve(e,i,a,void 0===x)}const E=be(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===T.Comment)return!0;if(e.type===T.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"===K(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Se(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Se(e.attributes.name)||"icon"===Se(e.attributes.rel)||"apple-touch-icon"===Se(e.attributes.rel)||"shortcut icon"===Se(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Se(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Se(e.attributes.property).match(/^(og|twitter|fb):/)||Se(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Se(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Se(e.attributes.name)||"googlebot"===Se(e.attributes.name)||"bingbot"===Se(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Se(e.attributes.name)||"generator"===Se(e.attributes.name)||"framework"===Se(e.attributes.name)||"publisher"===Se(e.attributes.name)||"progid"===Se(e.attributes.name)||Se(e.attributes.property).match(/^article:/)||Se(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Se(e.attributes.name)||"yandex-verification"===Se(e.attributes.name)||"csrf-token"===Se(e.attributes.name)||"p:domain_verify"===Se(e.attributes.name)||"verify-v1"===Se(e.attributes.name)||"verification"===Se(e.attributes.name)||"shopify-checkout-api-token"===Se(e.attributes.name)))return!0}}return!1}(E,d)||!O&&E.type===T.Text&&!E.textContent.replace(/^\s+|\s+$/gm,"").length?-2:ae();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===T.Element){A=A&&!M.needBlock,delete M.needBlock;const t=j.shadowRoot(e);t&&V(t)&&(M.isShadowHost=!0)}if((M.type===T.Document||M.type===T.Element)&&A){d.headWhitespace&&M.type===T.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===T.Element&&"textarea"===M.tagName&&void 0!==M.attributes.value);else{M.type===T.Element&&void 0!==M.attributes._cssText&&"string"==typeof M.attributes._cssText&&(t.cssCaptured=!0);for(const s of Array.from(j.childNodes(e))){const e=Ce(s,t);e&&M.childNodes.push(e)}}let I=null;if(W(e)&&(I=j.shadowRoot(e)))for(const e of Array.from(j.childNodes(I))){const s=Ce(e,t);s&&(V(I)&&(s.isShadow=!0),M.childNodes.push(s))}}const N=j.parentNode(e);return N&&z(N)&&V(N)&&(M.isShadow=!0),M.type===T.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=Ce(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===T.Element&&"link"===M.tagName&&"string"==typeof M.attributes.rel&&("stylesheet"===M.attributes.rel||"preload"===M.attributes.rel&&"string"==typeof M.attributes.href&&"css"===K(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=Ce(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 Ie(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ke(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 xe={exports:{}},Oe=String,Ee=function(){return{isColorSupported:!1,reset:Oe,bold:Oe,dim:Oe,italic:Oe,underline:Oe,inverse:Oe,hidden:Oe,strikethrough:Oe,black:Oe,red:Oe,green:Oe,yellow:Oe,blue:Oe,magenta:Oe,cyan:Oe,white:Oe,gray:Oe,bgBlack:Oe,bgRed:Oe,bgGreen:Oe,bgYellow:Oe,bgBlue:Oe,bgMagenta:Oe,bgCyan:Oe,bgWhite:Oe}};xe.exports=Ee(),xe.exports.createColors=Ee;var Re=xe.exports;const Me=ke(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Ae=Re,Te=Me,Ne=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=Ae.isColorSupported),Te&&e&&(t=Te(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}=Ae.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 Pe=Ne;Ne.default=Ne;var De={};De.isClean=Symbol("isClean"),De.my=Symbol("my");const Le={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Fe=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 Le[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=Le[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 _e=Fe;Fe.default=Fe;let Be=_e;function Ue(e,t){new Be(t).stringify(e)}var je=Ue;Ue.default=Ue;let{isClean:We,my:ze}=De,Ve=Pe,Ge=_e,Ze=je;function Ye(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=>Ye(e,s)):("object"===o&&null!==n&&(n=Ye(n)),s[r]=n)}return s}let Xe=class{constructor(e={}){this.raws={},this[We]=!1,this[ze]=!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=Ye(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 Ve(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[We]){this[We]=!1;let e=this;for(;e=e.parent;)e[We]=!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 Ge).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=Ze){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 He=Xe;Xe.default=Xe;let $e=He,Je=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 Ke=Je;Je.default=Je;var qe={nanoid:(e=21)=>{let t="",s=e;for(;s--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:Qe,SourceMapGenerator:et}=Me,{existsSync:tt,readFileSync:st}=Me,{dirname:rt,join:nt}=Me;let ot=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=rt(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new Qe(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=rt(e),tt(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 Qe)return et.fromSourceMap(t).toString();if(t instanceof et)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=nt(rt(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 it=ot;ot.default=ot;let{SourceMapConsumer:at,SourceMapGenerator:lt}=Me,{fileURLToPath:ct,pathToFileURL:ht}=Me,{isAbsolute:ut,resolve:pt}=Me,{nanoid:dt}=qe,ft=Me,mt=Pe,gt=it,yt=Symbol("fromOffsetCache"),wt=Boolean(at&&lt),vt=Boolean(pt&&ut),bt=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&&(!vt||/^\w+:\/\//.test(t.from)||ut(t.from)?this.file=t.from:this.file=pt(t.from)),vt&&wt){let e=new gt(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 "+dt(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 mt(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 mt(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&&(ht&&(n.input.url=ht(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,s;if(this[yt])s=this[yt];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[yt]=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:pt(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=ut(a.source)?ht(a.source):new URL(a.source,this.map.consumer().sourceRoot||ht(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(!ct)throw new Error("file: protocol is not available in this PostCSS build");l.file=ct(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 St=bt;bt.default=bt,ft&&ft.registerInput&&ft.registerInput(bt);let{SourceMapConsumer:Ct,SourceMapGenerator:It}=Me,{dirname:kt,relative:xt,resolve:Ot,sep:Et}=Me,{pathToFileURL:Rt}=Me,Mt=St,At=Boolean(Ct&&It),Tt=Boolean(kt&&Ot&&xt&&Et);var Nt=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||kt(e.file);!1===this.mapOpts.sourcesContent?(t=new Ct(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(),Tt&&At&&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=It.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new It({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 It({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?kt(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(s=kt(Ot(s,this.mapOpts.annotation)));let r=xt(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 Mt(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(Rt){let t=Rt(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;"\\"===Et&&(e=e.replace(/\\/g,"/"));let s=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,s),s}};let Pt=He,Dt=class extends Pt{constructor(e){super(e),this.type="comment"}};var Lt=Dt;Dt.default=Dt;let Ft,_t,Bt,Ut,{isClean:jt,my:Wt}=De,zt=Ke,Vt=Lt,Gt=He;function Zt(e){return e.map(e=>(e.nodes&&(e.nodes=Zt(e.nodes)),delete e.source,e))}function Yt(e){if(e[jt]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Yt(t)}let Xt=class e extends Gt{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=Zt(Ft(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 zt(t)]}else if(t.selector)t=[new _t(t)];else if(t.name)t=[new Bt(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Vt(t)]}return t.map(t=>(t[Wt]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[jt]&&Yt(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]}};Xt.registerParse=e=>{Ft=e},Xt.registerRule=e=>{_t=e},Xt.registerAtRule=e=>{Bt=e},Xt.registerRoot=e=>{Ut=e};var Ht=Xt;Xt.default=Xt,Xt.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Bt.prototype):"rule"===e.type?Object.setPrototypeOf(e,_t.prototype):"decl"===e.type?Object.setPrototypeOf(e,zt.prototype):"comment"===e.type?Object.setPrototypeOf(e,Vt.prototype):"root"===e.type&&Object.setPrototypeOf(e,Ut.prototype),e[Wt]=!0,e.nodes&&e.nodes.forEach(e=>{Xt.rebuild(e)})};let $t,Jt,Kt=Ht,qt=class extends Kt{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new $t(new Jt,this,e).stringify()}};qt.registerLazyResult=e=>{$t=e},qt.registerProcessor=e=>{Jt=e};var Qt=qt;qt.default=qt;let es={};var ts=function(e){es[e]||(es[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let ss=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 rs=ss;ss.default=ss;let ns=rs,os=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 ns(e,t);return this.messages.push(s),s}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var is=os;os.default=os;const as="'".charCodeAt(0),ls='"'.charCodeAt(0),cs="\\".charCodeAt(0),hs="/".charCodeAt(0),us="\n".charCodeAt(0),ps=" ".charCodeAt(0),ds="\f".charCodeAt(0),fs="\t".charCodeAt(0),ms="\r".charCodeAt(0),gs="[".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=/[\t\n\f\r "#'()/;[\\\]{}]/g,Es=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Rs=/.[\r\n"'(/\\]/,Ms=/[\da-f]/i;let As=Ht,Ts=class extends As{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 Ns=Ts;Ts.default=Ts,As.registerAtRule(Ts);let Ps,Ds,Ls=Ht,Fs=class extends Ls{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 Ps(new Ds,this,e).stringify()}};Fs.registerLazyResult=e=>{Ps=e},Fs.registerProcessor=e=>{Ds=e};var _s=Fs;Fs.default=Fs,Ls.registerRoot(Fs);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 Us=Bs;Bs.default=Bs;let js=Ht,Ws=Us,zs=class extends js{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Ws.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 Vs=zs;zs.default=zs,js.registerRule(zs);let Gs=Ke,Zs=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 us:case ps:case fs:case ms:case ds:r=m;do{r+=1,s=p.charCodeAt(r)}while(s===ps||s===us||s===fs||s===ms||s===ds);u=["space",p.slice(m,r)],m=r-1;break;case gs:case ys:case bs:case Ss:case ks:case Cs:case vs:{let e=String.fromCharCode(s);u=[e,e,m];break}case ws:if(c=g.length?g.pop()[1]:"",h=p.charCodeAt(m+1),"url"===c&&h!==as&&h!==ls&&h!==ps&&h!==us&&h!==fs&&h!==ds&&h!==ms){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)===cs;)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||Rs.test(o)?u=["(","(",m]:(u=["brackets",o,m,r],m=r);break;case as:case ls:n=s===as?"'":'"',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)===cs;)l-=1,a=!a}while(a);u=["string",p.slice(m,r+1),m,r],m=r;break;case xs:Os.lastIndex=m+1,Os.test(p),r=0===Os.lastIndex?p.length-1:Os.lastIndex-2,u=["at-word",p.slice(m,r+1),m,r],m=r;break;case cs:for(r=m,i=!0;p.charCodeAt(r+1)===cs;)r+=1,i=!i;if(s=p.charCodeAt(r+1),i&&s!==hs&&s!==ps&&s!==us&&s!==fs&&s!==ms&&s!==ds&&(r+=1,Ms.test(p.charAt(r)))){for(;Ms.test(p.charAt(r+1));)r+=1;p.charCodeAt(r+1)===ps&&(r+=1)}u=["word",p.slice(m,r+1),m,r],m=r;break;default:s===hs&&p.charCodeAt(m+1)===Is?(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):(Es.lastIndex=m+1,Es.test(p),r=0===Es.lastIndex?p.length-1:Es.lastIndex-2,u=["word",p.slice(m,r+1),m,r],g.push(u),m=r)}return m++,u},position:function(){return m}}},Ys=Lt,Xs=Ns,Hs=_s,$s=Vs;const Js={empty:!0,space:!0};let Ks=Ht,qs=class{constructor(e){this.input=e,this.root=new Hs,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 Xs;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 Ys;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=Zs(this.input)}decl(e,t){let s=new Gs;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",Js[a]||Js[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})}},Qs=St;function er(e,t){let s=new Qs(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 tr=er;er.default=er,Ks.registerParse(er);let{isClean:sr,my:rr}=De,nr=Nt,or=je,ir=Ht,ar=Qt,lr=ts,cr=is,hr=tr,ur=_s;const pr={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},dr={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},fr={Once:!0,postcssPlugin:!0,prepare:!0};function mr(e){return"object"==typeof e&&"function"==typeof e.then}function gr(e){let t=!1,s=pr[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 yr(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:gr(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function wr(e){return e[sr]=!1,e.nodes&&e.nodes.forEach(e=>wr(e)),e}let vr={},br=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 cr)n=wr(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=hr;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[rr]&&ir.rebuild(n)}else n=wr(s);this.result=new cr(t,n,r),this.helpers={...vr,postcss:vr,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(!dr[s]&&/^[A-Z]/.test(s))throw new Error(`Unknown event ${s} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!fr[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(mr(s))try{await s}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[sr];){e[sr]=!0;let t=[yr(e)];for(;t.length>0;){let e=this.visitTick(t);if(mr(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 mr(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=or;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new nr(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(mr(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[sr];)e[sr]=!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||lr("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(mr(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[sr])return r[sr]=!0,void e.push(yr(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[sr]=!0,t.iterator=s.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[sr]=!0;let t=gr(e);for(let s of t)if(0===s)e.nodes&&e.each(e=>{e[sr]||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"}};br.registerPostcss=e=>{vr=e};var Sr=br;br.default=br,ur.registerLazyResult(br),ar.registerLazyResult(br);let Cr=Nt,Ir=je,kr=ts,xr=tr;const Or=is;let Er=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=Ir;this.result=new Or(this._processor,r,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new Cr(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||kr("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=xr;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 Rr=Er;Er.default=Er;let Mr=Rr,Ar=Sr,Tr=Qt,Nr=_s,Pr=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 Ar(this,e,t):new Mr(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Dr=Pr;Pr.default=Pr,Nr.registerProcessor(Pr),Tr.registerProcessor(Pr);let Lr=Ke,Fr=it,_r=Lt,Br=Ns,Ur=St,jr=_s,Wr=Vs;function zr(e,t){if(Array.isArray(e))return e.map(e=>zr(e));let{inputs:s,...r}=e;if(s){t=[];for(let e of s){let s={...e,__proto__:Ur.prototype};s.map&&(s.map={...s.map,__proto__:Fr.prototype}),t.push(s)}}if(r.nodes&&(r.nodes=e.nodes.map(e=>zr(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 jr(r);if("decl"===r.type)return new Lr(r);if("rule"===r.type)return new Wr(r);if("comment"===r.type)return new _r(r);if("atrule"===r.type)return new Br(r);throw new Error("Unknown node type: "+e.type)}var Vr=zr;zr.default=zr;let Gr=Pe,Zr=Ke,Yr=Sr,Xr=Ht,Hr=Dr,$r=je,Jr=Vr,Kr=Qt,qr=rs,Qr=Lt,en=Ns,tn=is,sn=St,rn=tr,nn=Us,on=Vs,an=_s,ln=He;function cn(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Hr(e)}cn.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 Hr).version,n}return Object.defineProperty(n,"postcss",{get:()=>(s||(s=n()),s)}),n.process=function(e,t,s){return cn([n(s)]).process(e,t)},n},cn.stringify=$r,cn.parse=rn,cn.fromJSON=Jr,cn.list=nn,cn.comment=e=>new Qr(e),cn.atRule=e=>new en(e),cn.decl=e=>new Zr(e),cn.rule=e=>new on(e),cn.root=e=>new an(e),cn.document=e=>new Kr(e),cn.CssSyntaxError=Gr,cn.Declaration=Zr,cn.Container=Xr,cn.Processor=Hr,cn.Document=Kr,cn.Comment=Qr,cn.Warning=qr,cn.AtRule=en,cn.Result=tn,cn.Input=sn,cn.Rule=on,cn.Root=an,cn.Node=ln,Yr.registerPostcss(cn);var hn=cn;cn.default=cn;const un=Ie(hn);un.stringify,un.fromJSON,un.plugin,un.parse,un.list,un.document,un.comment,un.atRule,un.rule,un.decl,un.root,un.CssSyntaxError,un.Declaration,un.Container,un.Processor,un.Document,un.Comment,un.Warning,un.AtRule,un.Result,un.Input,un.Rule,un.Root,un.Node;var pn=Object.defineProperty,dn=(e,t,s)=>((e,t,s)=>t in e?pn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);function fn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function mn(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 gn={exports:{}},yn=String,wn=function(){return{isColorSupported:!1,reset:yn,bold:yn,dim:yn,italic:yn,underline:yn,inverse:yn,hidden:yn,strikethrough:yn,black:yn,red:yn,green:yn,yellow:yn,blue:yn,magenta:yn,cyan:yn,white:yn,gray:yn,bgBlack:yn,bgRed:yn,bgGreen:yn,bgYellow:yn,bgBlue:yn,bgMagenta:yn,bgCyan:yn,bgWhite:yn}};gn.exports=wn(),gn.exports.createColors=wn;var vn=gn.exports;const bn=mn(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Sn=vn,Cn=bn,In=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=Sn.isColorSupported),Cn&&e&&(t=Cn(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}=Sn.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 kn=In;In.default=In;var xn={};xn.isClean=Symbol("isClean"),xn.my=Symbol("my");const On={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let En=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 On[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=On[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 Rn=En;En.default=En;let Mn=Rn;function An(e,t){new Mn(t).stringify(e)}var Tn=An;An.default=An;let{isClean:Nn,my:Pn}=xn,Dn=kn,Ln=Rn,Fn=Tn;function _n(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=>_n(e,s)):("object"===o&&null!==n&&(n=_n(n)),s[r]=n)}return s}let Bn=class{constructor(e={}){this.raws={},this[Nn]=!1,this[Pn]=!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=_n(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 Dn(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[Nn]){this[Nn]=!1;let e=this;for(;e=e.parent;)e[Nn]=!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 Ln).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=Fn){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 Un=Bn;Bn.default=Bn;let jn=Un,Wn=class extends jn{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 zn=Wn;Wn.default=Wn;var Vn={nanoid:(e=21)=>{let t="",s=e;for(;s--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:Gn,SourceMapGenerator:Zn}=bn,{existsSync:Yn,readFileSync:Xn}=bn,{dirname:Hn,join:$n}=bn;let Jn=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=Hn(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new Gn(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=Hn(e),Yn(e))return this.mapFile=e,Xn(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 Gn)return Zn.fromSourceMap(t).toString();if(t instanceof Zn)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(Hn(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 Kn=Jn;Jn.default=Jn;let{SourceMapConsumer:qn,SourceMapGenerator:Qn}=bn,{fileURLToPath:eo,pathToFileURL:to}=bn,{isAbsolute:so,resolve:ro}=bn,{nanoid:no}=Vn,oo=bn,io=kn,ao=Kn,lo=Symbol("fromOffsetCache"),co=Boolean(qn&&Qn),ho=Boolean(ro&&so),uo=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&&(!ho||/^\w+:\/\//.test(t.from)||so(t.from)?this.file=t.from:this.file=ro(t.from)),ho&&co){let e=new ao(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 "+no(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 io(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 io(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&&(to&&(n.input.url=to(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,s;if(this[lo])s=this[lo];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[lo]=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:ro(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=so(a.source)?to(a.source):new URL(a.source,this.map.consumer().sourceRoot||to(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(!eo)throw new Error("file: protocol is not available in this PostCSS build");l.file=eo(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 po=uo;uo.default=uo,oo&&oo.registerInput&&oo.registerInput(uo);let{SourceMapConsumer:fo,SourceMapGenerator:mo}=bn,{dirname:go,relative:yo,resolve:wo,sep:vo}=bn,{pathToFileURL:bo}=bn,So=po,Co=Boolean(fo&&mo),Io=Boolean(go&&wo&&yo&&vo);var ko=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||go(e.file);!1===this.mapOpts.sourcesContent?(t=new fo(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(),Io&&Co&&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=mo.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new mo({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 mo({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?go(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(s=go(wo(s,this.mapOpts.annotation)));let r=yo(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 So(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(bo){let t=bo(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;"\\"===vo&&(e=e.replace(/\\/g,"/"));let s=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,s),s}};let xo=Un,Oo=class extends xo{constructor(e){super(e),this.type="comment"}};var Eo=Oo;Oo.default=Oo;let Ro,Mo,Ao,To,{isClean:No,my:Po}=xn,Do=zn,Lo=Eo,Fo=Un;function _o(e){return e.map(e=>(e.nodes&&(e.nodes=_o(e.nodes)),delete e.source,e))}function Bo(e){if(e[No]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Bo(t)}let Uo=class e extends Fo{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=_o(Ro(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 Do(t)]}else if(t.selector)t=[new Mo(t)];else if(t.name)t=[new Ao(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Lo(t)]}return t.map(t=>(t[Po]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[No]&&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]}};Uo.registerParse=e=>{Ro=e},Uo.registerRule=e=>{Mo=e},Uo.registerAtRule=e=>{Ao=e},Uo.registerRoot=e=>{To=e};var jo=Uo;Uo.default=Uo,Uo.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Ao.prototype):"rule"===e.type?Object.setPrototypeOf(e,Mo.prototype):"decl"===e.type?Object.setPrototypeOf(e,Do.prototype):"comment"===e.type?Object.setPrototypeOf(e,Lo.prototype):"root"===e.type&&Object.setPrototypeOf(e,To.prototype),e[Po]=!0,e.nodes&&e.nodes.forEach(e=>{Uo.rebuild(e)})};let Wo,zo,Vo=jo,Go=class extends Vo{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Wo(new zo,this,e).stringify()}};Go.registerLazyResult=e=>{Wo=e},Go.registerProcessor=e=>{zo=e};var Zo=Go;Go.default=Go;let Yo={};var Xo=function(e){Yo[e]||(Yo[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Ho=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=Ho;Ho.default=Ho;let Jo=$o,Ko=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 Jo(e,t);return this.messages.push(s),s}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var qo=Ko;Ko.default=Ko;const Qo="'".charCodeAt(0),ei='"'.charCodeAt(0),ti="\\".charCodeAt(0),si="/".charCodeAt(0),ri="\n".charCodeAt(0),ni=" ".charCodeAt(0),oi="\f".charCodeAt(0),ii="\t".charCodeAt(0),ai="\r".charCodeAt(0),li="[".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=/[\t\n\f\r "#'()/;[\\\]{}]/g,vi=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,bi=/.[\r\n"'(/\\]/,Si=/[\da-f]/i;let Ci=jo,Ii=class extends Ci{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 ki=Ii;Ii.default=Ii,Ci.registerAtRule(Ii);let xi,Oi,Ei=jo,Ri=class extends Ei{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 xi(new Oi,this,e).stringify()}};Ri.registerLazyResult=e=>{xi=e},Ri.registerProcessor=e=>{Oi=e};var Mi=Ri;Ri.default=Ri,Ei.registerRoot(Ri);let Ai={comma:e=>Ai.split(e,[","],!0),space:e=>Ai.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 Ti=Ai;Ai.default=Ai;let Ni=jo,Pi=Ti,Di=class extends Ni{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Pi.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 Li=Di;Di.default=Di,Ni.registerRule(Di);let Fi=zn,_i=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 ri:case ni:case ii:case ai:case oi:r=m;do{r+=1,s=p.charCodeAt(r)}while(s===ni||s===ri||s===ii||s===ai||s===oi);u=["space",p.slice(m,r)],m=r-1;break;case li:case ci:case pi:case di:case gi:case fi:case ui:{let e=String.fromCharCode(s);u=[e,e,m];break}case hi:if(c=g.length?g.pop()[1]:"",h=p.charCodeAt(m+1),"url"===c&&h!==Qo&&h!==ei&&h!==ni&&h!==ri&&h!==ii&&h!==oi&&h!==ai){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)===ti;)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||bi.test(o)?u=["(","(",m]:(u=["brackets",o,m,r],m=r);break;case Qo:case ei:n=s===Qo?"'":'"',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)===ti;)l-=1,a=!a}while(a);u=["string",p.slice(m,r+1),m,r],m=r;break;case yi:wi.lastIndex=m+1,wi.test(p),r=0===wi.lastIndex?p.length-1:wi.lastIndex-2,u=["at-word",p.slice(m,r+1),m,r],m=r;break;case ti:for(r=m,i=!0;p.charCodeAt(r+1)===ti;)r+=1,i=!i;if(s=p.charCodeAt(r+1),i&&s!==si&&s!==ni&&s!==ri&&s!==ii&&s!==ai&&s!==oi&&(r+=1,Si.test(p.charAt(r)))){for(;Si.test(p.charAt(r+1));)r+=1;p.charCodeAt(r+1)===ni&&(r+=1)}u=["word",p.slice(m,r+1),m,r],m=r;break;default:s===si&&p.charCodeAt(m+1)===mi?(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):(vi.lastIndex=m+1,vi.test(p),r=0===vi.lastIndex?p.length-1:vi.lastIndex-2,u=["word",p.slice(m,r+1),m,r],g.push(u),m=r)}return m++,u},position:function(){return m}}},Bi=Eo,Ui=ki,ji=Mi,Wi=Li;const zi={empty:!0,space:!0};let Vi=jo,Gi=class{constructor(e){this.input=e,this.root=new ji,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 Ui;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=_i(this.input)}decl(e,t){let s=new Fi;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 Wi;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",zi[a]||zi[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 Wi;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})}},Zi=po;function Yi(e,t){let s=new Zi(e,t),r=new Gi(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 Xi=Yi;Yi.default=Yi,Vi.registerParse(Yi);let{isClean:Hi,my:$i}=xn,Ji=ko,Ki=Tn,qi=jo,Qi=Zo,ea=Xo,ta=qo,sa=Xi,ra=Mi;const na={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},oa={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},ia={Once:!0,postcssPlugin:!0,prepare:!0};function aa(e){return"object"==typeof e&&"function"==typeof e.then}function la(e){let t=!1,s=na[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 ca(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:la(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function ha(e){return e[Hi]=!1,e.nodes&&e.nodes.forEach(e=>ha(e)),e}let ua={},pa=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 ta)n=ha(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=sa;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=ha(s);this.result=new ta(t,n,r),this.helpers={...ua,postcss:ua,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(!oa[s]&&/^[A-Z]/.test(s))throw new Error(`Unknown event ${s} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!ia[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(aa(s))try{await s}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Hi];){e[Hi]=!0;let t=[ca(e)];for(;t.length>0;){let e=this.visitTick(t);if(aa(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 aa(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=Ki;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new Ji(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(aa(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Hi];)e[Hi]=!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||ea("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(aa(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[Hi])return r[Hi]=!0,void e.push(ca(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[Hi]=!0,t.iterator=s.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Hi]=!0;let t=la(e);for(let s of t)if(0===s)e.nodes&&e.each(e=>{e[Hi]||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"}};pa.registerPostcss=e=>{ua=e};var da=pa;pa.default=pa,ra.registerLazyResult(pa),Qi.registerLazyResult(pa);let fa=ko,ma=Tn,ga=Xo,ya=Xi;const wa=qo;let va=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=ma;this.result=new wa(this._processor,r,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new fa(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||ga("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=ya;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 ba=va;va.default=va;let Sa=ba,Ca=da,Ia=Zo,ka=Mi,xa=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 Ca(this,e,t):new Sa(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Oa=xa;xa.default=xa,ka.registerProcessor(xa),Ia.registerProcessor(xa);let Ea=zn,Ra=Kn,Ma=Eo,Aa=ki,Ta=po,Na=Mi,Pa=Li;function Da(e,t){if(Array.isArray(e))return e.map(e=>Da(e));let{inputs:s,...r}=e;if(s){t=[];for(let e of s){let s={...e,__proto__:Ta.prototype};s.map&&(s.map={...s.map,__proto__:Ra.prototype}),t.push(s)}}if(r.nodes&&(r.nodes=e.nodes.map(e=>Da(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 Na(r);if("decl"===r.type)return new Ea(r);if("rule"===r.type)return new Pa(r);if("comment"===r.type)return new Ma(r);if("atrule"===r.type)return new Aa(r);throw new Error("Unknown node type: "+e.type)}var La=Da;Da.default=Da;let Fa=kn,_a=zn,Ba=da,Ua=jo,ja=Oa,Wa=Tn,za=La,Va=Zo,Ga=$o,Za=Eo,Ya=ki,Xa=qo,Ha=po,$a=Xi,Ja=Ti,Ka=Li,qa=Mi,Qa=Un;function el(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new ja(e)}el.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 ja).version,n}return Object.defineProperty(n,"postcss",{get:()=>(s||(s=n()),s)}),n.process=function(e,t,s){return el([n(s)]).process(e,t)},n},el.stringify=Wa,el.parse=$a,el.fromJSON=za,el.list=Ja,el.comment=e=>new Za(e),el.atRule=e=>new Ya(e),el.decl=e=>new _a(e),el.rule=e=>new Ka(e),el.root=e=>new qa(e),el.document=e=>new Va(e),el.CssSyntaxError=Fa,el.Declaration=_a,el.Container=Ua,el.Processor=ja,el.Document=Va,el.Comment=Za,el.Warning=Ga,el.AtRule=Ya,el.Result=Xa,el.Input=Ha,el.Rule=Ka,el.Root=qa,el.Node=Qa,Ba.registerPostcss(el);var tl=el;el.default=el;const sl=fn(tl);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 rl{constructor(...e){dn(this,"parentElement",null),dn(this,"parentNode",null),dn(this,"ownerDocument"),dn(this,"firstChild",null),dn(this,"lastChild",null),dn(this,"previousSibling",null),dn(this,"nextSibling",null),dn(this,"ELEMENT_NODE",1),dn(this,"TEXT_NODE",3),dn(this,"nodeType"),dn(this,"nodeName"),dn(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 rl))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 nl={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ol={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},il={};function al(e){if(il[e])return il[e];const t=globalThis[e],s=t.prototype,r=e in nl?nl[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 ol?ol[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 il[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?il[e]=o:s}catch{return s}}const ll={};function cl(e,t,s){var r;const n=`${e}.${String(s)}`;if(ll[n])return ll[n].call(t);const o=al(e),i=null==(r=Object.getOwnPropertyDescriptor(o,s))?void 0:r.get;return i?(ll[n]=i,i.call(t)):t[s]}const hl={};function ul(e,t,s){const r=`${e}.${String(s)}`;if(hl[r])return hl[r].bind(t);const n=al(e)[s];return"function"!=typeof n?t[s]:(hl[r]=n,n.bind(t))}function pl(){return al("MutationObserver").constructor}const dl={childNodes:function(e){return cl("Node",e,"childNodes")},parentNode:function(e){return cl("Node",e,"parentNode")},parentElement:function(e){return cl("Node",e,"parentElement")},textContent:function(e){return cl("Node",e,"textContent")},contains:function(e,t){return ul("Node",e,"contains")(t)},getRootNode:function(e){return ul("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?cl("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?cl("Element",e,"shadowRoot"):null},querySelector:function(e,t){return cl("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return cl("Element",e,"querySelectorAll")(t)},mutationObserver:pl};function fl(e,t,s=document){const r={capture:!0,passive:!0};return s.addEventListener(e,t,r),()=>s.removeEventListener(e,t,r)}const ml="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 gl={map:{},getId:()=>(console.error(ml),-1),getNode:()=>(console.error(ml),null),removeNodeFromMap(){console.error(ml)},has:()=>(console.error(ml),!1),reset(){console.error(ml)}};function yl(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 wl(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)}}),()=>wl(e,t,o||{},!0)}function vl(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&&(gl=new Proxy(gl,{get:(e,t,s)=>("map"===t&&console.error(ml),Reflect.get(e,t,s))}));let bl=Date.now;function Sl(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=dl.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=dl.parentElement(o.body))?void 0:r.scrollTop)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollTop)||0}}function Cl(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Il(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function kl(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:dl.parentElement(e)}function xl(e,t,s,r){if(!e)return!1;const n=kl(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(we(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 Ol(e,t,s){return!("TITLE"!==e.tagName||!s.headTitleMutations)||-2===t.getId(e)}function El(e,t){if(z(e))return!1;const s=t.getId(e);if(!t.has(s))return!0;const r=dl.parentNode(e);return(!r||r.nodeType!==e.DOCUMENT_NODE)&&(!r||El(r,t))}function Rl(e){return Boolean(e.changedTouches)}function Ml(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Al(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Tl(e){return!!e&&(e instanceof rl&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(dl.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(bl=()=>(new Date).getTime());class Nl{constructor(){R(this,"id",1),R(this,"styleIDMap",new WeakMap),R(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 Pl(e){var t;let s=null;return"getRootNode"in e&&(null==(t=dl.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&dl.host(dl.getRootNode(e))&&(s=dl.host(dl.getRootNode(e))),s}function Dl(e){const t=e.ownerDocument;if(!t)return!1;const s=function(e){let t,s=e;for(;t=Pl(s);)s=t;return s}(e);return dl.contains(t,s)}function Ll(e){const t=e.ownerDocument;return!!t&&(dl.contains(t,e)||Dl(e))}var Fl=(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))(Fl||{}),_l=(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))(_l||{}),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||{}),Ul=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Ul||{}),jl=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(jl||{}),Wl=(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))(Wl||{}),zl=(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))(zl||{});function Vl(e){return"__ln"in e}class Gl{constructor(){R(this,"length",0),R(this,"head",null),R(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&&Vl(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&&Vl(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 Zl=(e,t)=>`${e}@${t}`;class Yl{constructor(){R(this,"frozen",!1),R(this,"locked",!1),R(this,"texts",[]),R(this,"attributes",[]),R(this,"attributeMap",new WeakMap),R(this,"removes",[]),R(this,"mapRemoves",[]),R(this,"movedMap",{}),R(this,"addedSet",new Set),R(this,"movedSet",new Set),R(this,"droppedSet",new Set),R(this,"removesSubTreeCache",new Set),R(this,"mutationCb"),R(this,"blockClass"),R(this,"blockSelector"),R(this,"maskTextClass"),R(this,"maskTextSelector"),R(this,"inlineStylesheet"),R(this,"maskInputOptions"),R(this,"maskTextFn"),R(this,"maskInputFn"),R(this,"keepIframeSrcFn"),R(this,"recordCanvas"),R(this,"inlineImages"),R(this,"slimDOMOptions"),R(this,"dataURLOptions"),R(this,"doc"),R(this,"mirror"),R(this,"iframeManager"),R(this,"stylesheetManager"),R(this,"shadowDomManager"),R(this,"canvasManager"),R(this,"processedNodeManager"),R(this,"unattachedDoc"),R(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),R(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,s=new Gl,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=dl.parentNode(n);if(!o||!Ll(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=z(o)?this.mirror.getId(Pl(n)):this.mirror.getId(o),l=r(n);if(-1===a||-1===l)return s.addNode(n);const c=Ce(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=>{Ml(e,this.mirror)&&this.iframeManager.addIframe(e),Al(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Tl(n)&&this.shadowDomManager.addShadowRoot(dl.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)Hl(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(dl.parentNode(e))||n(e);for(const e of this.addedSet)$l(this.droppedSet,e)||Hl(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(dl.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(dl.parentNode(s.value));if(-1===r(s.value))continue;if(-1!==t){e=s;break}{const t=s.value,r=dl.parentNode(t);if(r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=dl.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=dl.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))}),R(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(dl.childNodes(e),e=>dl.textContent(e)||"").join("")}),R(this,"processMutation",e=>{if(!Ol(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=dl.textContent(e.target);xl(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:ve(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,kl(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=J(t);r=X({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:r,maskInputFn:this.maskInputFn})}if(xl(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"),!ye(t.tagName,s))if(n.attributes[s]=ge(this.doc,H(t.tagName),H(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(xl(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=z(e.target)?this.mirror.getId(dl.host(e.target)):this.mirror.getId(e.target);xl(e.target,this.blockClass,this.blockSelector,!1)||Ol(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Xl(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===s||El(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Zl(s,r)]?Xl(this.movedSet,t):(this.removes.push({parentId:r,id:s,isShadow:!(!z(e.target)||!V(e.target))||void 0}),function(e,t){const s=[e];for(;s.length;){const e=s.pop();t.has(e)||(t.add(e),dl.childNodes(e).forEach(e=>s.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),R(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Ol(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[Zl(this.mirror.getId(e),s)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);xl(e,this.blockClass,this.blockSelector,!1)||(dl.childNodes(e).forEach(e=>this.genAdds(e)),Tl(e)&&dl.childNodes(dl.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 Xl(e,t){e.delete(t),dl.childNodes(t).forEach(t=>Xl(e,t))}function Hl(e,t,s){return 0!==e.size&&function(e,t){const s=dl.parentNode(t);return!!s&&e.has(s)}(e,t)}function $l(e,t){return 0!==e.size&&Jl(e,t)}function Jl(e,t){const s=dl.parentNode(t);return!!s&&(!!e.has(s)||Jl(e,s))}let Kl;const ql=e=>{if(!Kl)return e;return(...t)=>{try{return e(...t)}catch(e){if(Kl&&!0===Kl(e))return;throw e}}},Ql=[];function ec(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 tc(e,t){const s=new Yl;Ql.push(s),s.init(e);const r=new(pl())(ql(s.processMutations.bind(s)));return r.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function sc({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=H(o);const c=(t=>o=>{const i=ec(o);if(xl(i,r,n,!0))return;let a=null,c=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=Ul.Mouse;break;case"touch":a=Ul.Touch;break;case"pen":a=Ul.Pen}a===Ul.Touch?Bl[t]===Bl.MouseDown?c="TouchStart":Bl[t]===Bl.MouseUp&&(c="TouchEnd"):Ul.Pen}else Rl(o)&&(a=Ul.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===Ul.Touch||c.startsWith("Mouse")&&a===Ul.Mouse)&&(a=null)):Bl[t]===Bl.Click&&(a=l,l=null);const h=Rl(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(fl(i,c,t))}),ql(()=>{a.forEach(e=>e())})}function rc({scrollCb:e,doc:t,mirror:s,blockClass:r,blockSelector:n,sampling:o}){return fl("scroll",ql(yl(ql(o=>{const i=ec(o);if(!i||xl(i,r,n,!0))return;const a=s.getId(i);if(i===t&&t.defaultView){const s=Sl(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 nc=["INPUT","TEXTAREA","SELECT"],oc=new WeakMap;function ic(e){return function(e,t){if(hc("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||hc("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||hc("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||hc("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 ac(e,t,s){let r,n;return e?(e.ownerNode?r=t.getId(e.ownerNode):n=s.getId(e),{styleId:n,id:r}):{}}function lc({mirror:e,stylesheetManager:t},s){var r,n,o;let i=null;i="#document"===s.nodeName?e.getId(s):e.getId(dl.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 cc(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=tc(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=yl(ql(t=>{const s=Date.now()-i;e(a.map(e=>(e.timeOffset-=s,e)),t),a=[],i=null}),o),c=ql(yl(ql(e=>{const t=ec(e),{clientX:s,clientY:n}=Rl(e)?e.changedTouches[0]:e;i||(i=bl()),a.push({x:s,y:n,id:r.getId(t),timeOffset:bl()-i}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?_l.Drag:e instanceof MouseEvent?_l.MouseMove:_l.TouchMove)}),n,{trailing:!1})),h=[fl("mousemove",c,s),fl("touchmove",c,s),fl("drag",c,s)];return ql(()=>{h.forEach(e=>e())})}(e),o=sc(e),i=rc(e),a=function({viewportResizeCb:e},{win:t}){let s=-1,r=-1;return fl("resize",ql(yl(ql(()=>{const t=Cl(),n=Il();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=ec(e);const c=e.isTrusted,u=s&&s.tagName;if(s&&"OPTION"===u&&(s=dl.parentElement(s)),!s||!u||nc.indexOf(u)<0||xl(s,r,n,!0))return;if(s.classList.contains(o)||i&&s.matches(i))return;let d=s.value,f=!1;const m=J(s)||"";"radio"===m||"checkbox"===m?f=s.checked:(a[u.toLowerCase()]||a[m])&&(d=X({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=oc.get(t);if(!n||n.text!==r.text||n.isChecked!==r.isChecked){oc.set(t,r);const n=s.getId(t);ql(e)({...r,id:n})}}const d=("last"===c.input?["change"]:["input","change"]).map(e=>fl(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=>wl(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=>yl(ql(n=>{const i=ec(n);if(!i||xl(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=[fl("play",i(Wl.Play),o),fl("pause",i(Wl.Pause),o),fl("seeked",i(Wl.Seeked),o),fl("volumechange",i(Wl.VolumeChange),o),fl("ratechange",i(Wl.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}=ac(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}=ac(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}=ac(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}=ac(n,t,s.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:i}),r.apply(n,o)})}));const l={};uc("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(uc("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),uc("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),uc("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}=ac(n.parentStyleSheet,t,s.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:[...ic(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}=ac(n.parentStyleSheet,t,s.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...ic(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=lc(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}=ac(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:ic(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}=ac(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:ic(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=vl(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;xl(i,r,n,!0)||xl(c,r,n,!0)||a.push({start:s.getId(i),startOffset:l,end:s.getId(c),endOffset:h})}o({ranges:a})});return a(),fl("selectionchange",a)}(e),m=function({doc:e,customElementCb:t}){const s=e.defaultView;return s&&s.customElements?vl(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(()=>{Ql.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 hc(e){return void 0!==window[e]}function uc(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class pc{constructor(e){R(this,"iframeIdToRemoteIdMap",new WeakMap),R(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 dc{constructor(e){R(this,"iframes",new WeakMap),R(this,"crossOriginIframeMap",new WeakMap),R(this,"crossOriginIframeMirror",new pc(ae)),R(this,"crossOriginIframeStyleMirror"),R(this,"crossOriginIframeRootIdMap",new WeakMap),R(this,"mirror"),R(this,"mutationCb"),R(this,"wrappedEmit"),R(this,"loadListener"),R(this,"stylesheetManager"),R(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new pc(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 Fl.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:Fl.IncrementalSnapshot,data:{source:_l.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Fl.Meta:case Fl.Load:case Fl.DomContentLoaded:return!1;case Fl.Plugin:return t;case Fl.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Fl.IncrementalSnapshot:switch(t.data.source){case _l.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 _l.Drag:case _l.TouchMove:case _l.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case _l.ViewportResize:return!1;case _l.MediaInteraction:case _l.MouseInteraction:case _l.Scroll:case _l.CanvasMutation:case _l.Input:return this.replaceIds(t.data,e,["id"]),t;case _l.StyleSheetRule:case _l.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case _l.Font:return t;case _l.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case _l.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===zl.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class fc{constructor(e){R(this,"shadowDoms",new WeakSet),R(this,"mutationCb"),R(this,"scrollCb"),R(this,"bypassOptions"),R(this,"mirror"),R(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(!V(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const s=tc({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>s.disconnect()),this.restoreHandlers.push(rc({...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(dl.host(e))),this.restoreHandlers.push(lc({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(vl(e.prototype,"attachShadow",function(e){return function(r){const n=e.call(this,r),o=dl.shadowRoot(this);return o&&Ll(this)&&s.addShadowRoot(o,t),n}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var mc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gc="undefined"==typeof Uint8Array?[]:new Uint8Array(256),yc=0;yc<64;yc++)gc[mc.charCodeAt(yc)]=yc;const wc=new Map;const vc=(e,t,s)=>{if(!e||!Cc(e,t)&&"object"!=typeof e)return;const r=function(e,t){let s=wc.get(e);return s||(s=new Map,wc.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 bc(e,t,s){if(e instanceof Array)return e.map(e=>bc(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+=mc[s[t]>>2],n+=mc[(3&s[t])<<4|s[t+1]>>4],n+=mc[(15&s[t+1])<<2|s[t+2]>>6],n+=mc[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:[bc(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:[bc(e.data,t,s),e.width,e.height]}}if(Cc(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:vc(e,t,s)}}return e}const Sc=(e,t,s)=>e.map(e=>bc(e,t,s)),Cc=(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 Ic(e,t,s,r){const n=[];try{const o=vl(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(n,...o){if(!xl(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 kc(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=vl(e,l,function(e){return function(...i){const a=e.apply(this,i);if(vc(a,o,this),"tagName"in this.canvas&&!xl(this.canvas,r,n,!0)){const e=Sc(i,o,this),r={type:t,property:l,args:e};s(this.canvas,r)}return a}});i.push(a)}catch{const r=wl(e,l,{set(e){s(this.canvas,{type:t,property:l,args:[e],setter:!0})}});i.push(r)}return i}const xc="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Oc="undefined"!=typeof window&&window.Blob&&new Blob([(Ec=xc,Uint8Array.from(atob(Ec),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});var Ec;function Rc(e){let t;try{if(t=Oc&&(window.URL||window.webkitURL).createObjectURL(Oc),!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,"+xc,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Mc{constructor(e){R(this,"pendingCanvasMutations",new Map),R(this,"rafStamps",{latestId:0,invokeId:null}),R(this,"mirror"),R(this,"mutationCb"),R(this,"resetObservers"),R(this,"frozen",!1),R(this,"locked",!1),R(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=Ic(t,s,r,!0),i=new Map,a=new Rc;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:jl["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=>{xl(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=Ic(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=vl(t.CanvasRenderingContext2D.prototype,i,function(n){return function(...o){return xl(this.canvas,s,r,!0)||setTimeout(()=>{const s=Sc(o,t,this);e(this.canvas,{type:jl["2D"],property:i,args:s})},0),n.apply(this,o)}});n.push(o)}catch{const s=wl(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:jl["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(...kc(t.WebGLRenderingContext.prototype,jl.WebGL,e,s,r,t)),void 0!==t.WebGL2RenderingContext&&n.push(...kc(t.WebGL2RenderingContext.prototype,jl.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 Ac{constructor(e){R(this,"trackedLinkElements",new WeakSet),R(this,"mutationCb"),R(this,"adoptedStyleSheetCb"),R(this,"styleMirror",new Nl),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:Z(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 Tc{constructor(){R(this,"nodeMap",new WeakMap),R(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 Nc,Pc,Dc,Lc=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(O=e.contentWindow)?void 0:O.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const Fc=new Y;function _c(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;Kl=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),Fc.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 B=e=>{for(const t of R||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!P&&(e=y(e)),e};Nc=(e,n)=>{var o;const i=e;if(i.timestamp=bl(),!(null==(o=Ql[0])?void 0:o.isFrozen())||i.type===Fl.FullSnapshot||i.type===Fl.IncrementalSnapshot&&i.data.source===_l.Mutation||Ql.forEach(e=>e.unfreeze()),N)null==t||t(B(i),n);else if(P){const e={type:"rrweb",event:B(i),origin:window.location.origin,isCheckout:n};window.parent.postMessage(e,"*")}if(i.type===Fl.FullSnapshot)F=i,_=0;else if(i.type===Fl.IncrementalSnapshot){if(i.data.source===_l.Mutation&&i.data.isAttachIframe)return;_++;const e=r&&_>=r,t=s&&i.timestamp-F.timestamp>s;(e||t)&&Pc(!0)}};const U=e=>{Nc({type:Fl.IncrementalSnapshot,data:{source:_l.Mutation,...e}})},j=e=>Nc({type:Fl.IncrementalSnapshot,data:{source:_l.Scroll,...e}}),W=e=>Nc({type:Fl.IncrementalSnapshot,data:{source:_l.CanvasMutation,...e}}),z=new Ac({mutationCb:U,adoptedStyleSheetCb:e=>Nc({type:Fl.IncrementalSnapshot,data:{source:_l.AdoptedStyleSheet,...e}})}),V=new dc({mirror:Fc,mutationCb:U,stylesheetManager:z,recordCrossOriginIframes:I,wrappedEmit:Nc});for(const e of R||[])e.getMirror&&e.getMirror({nodeMirror:Fc,crossOriginIframeMirror:V.crossOriginIframeMirror,crossOriginIframeStyleMirror:V.crossOriginIframeStyleMirror});const G=new Tc;Dc=new Mc({recordCanvas:C,mutationCb:W,win:window,blockClass:n,blockSelector:o,mirror:Fc,sampling:w.canvas,dataURLOptions:v});const Z=new fc({mutationCb:U,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:Dc,keepIframeSrcFn:M,processedNodeManager:G},mirror:Fc});Pc=(e=!1)=>{if(!S)return;Nc({type:Fl.Meta,data:{href:window.location.href,width:Il(),height:Cl()}},e),z.reset(),Z.init(),Ql.forEach(e=>e.lock());const t=function(e,t){const{mirror:s=new Y,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 Ce(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:Fc,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=>{Ml(e,Fc)&&V.addIframe(e),Al(e,Fc)&&z.trackLinkElement(e),Tl(e)&&Z.addShadowRoot(dl.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");Nc({type:Fl.FullSnapshot,data:{node:t,initialOffset:Sl(window)}},e),Ql.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,Fc.getId(document))};try{const e=[],t=e=>{var t;return ql(cc)({mutationCb:U,mousemoveCb:(e,t)=>Nc({type:Fl.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Nc({type:Fl.IncrementalSnapshot,data:{source:_l.MouseInteraction,...e}}),scrollCb:j,viewportResizeCb:e=>Nc({type:Fl.IncrementalSnapshot,data:{source:_l.ViewportResize,...e}}),inputCb:e=>Nc({type:Fl.IncrementalSnapshot,data:{source:_l.Input,...e}}),mediaInteractionCb:e=>Nc({type:Fl.IncrementalSnapshot,data:{source:_l.MediaInteraction,...e}}),styleSheetRuleCb:e=>Nc({type:Fl.IncrementalSnapshot,data:{source:_l.StyleSheetRule,...e}}),styleDeclarationCb:e=>Nc({type:Fl.IncrementalSnapshot,data:{source:_l.StyleDeclaration,...e}}),canvasMutationCb:W,fontCb:e=>Nc({type:Fl.IncrementalSnapshot,data:{source:_l.Font,...e}}),selectionCb:e=>{Nc({type:Fl.IncrementalSnapshot,data:{source:_l.Selection,...e}})},customElementCb:e=>{Nc({type:Fl.IncrementalSnapshot,data:{source:_l.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:Fc,iframeManager:V,stylesheetManager:z,shadowDomManager:Z,processedNodeManager:G,canvasManager:Dc,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=>Nc({type:Fl.Plugin,data:{plugin:e.name,payload:t}})})))||[]},g)};V.addLoadListener(s=>{try{e.push(t(s.contentDocument))}catch(e){console.warn(e)}});const s=()=>{Pc(),e.push(t(document)),Lc=!0};return"interactive"===document.readyState||"complete"===document.readyState?s():(e.push(fl("DOMContentLoaded",()=>{Nc({type:Fl.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&s()})),e.push(fl("load",()=>{Nc({type:Fl.Load,data:{}}),"load"===k&&s()},window))),()=>{e.forEach(e=>e()),G.destroy(),Lc=!1,Kl=void 0}}catch(e){console.warn(e)}}var Bc,Uc,jc,Wc;_c.addCustomEvent=(e,t)=>{if(!Lc)throw new Error("please add custom event after start recording");Nc({type:Fl.Custom,data:{tag:e,payload:t}})},_c.freezePage=()=>{Ql.forEach(e=>e.freeze())},_c.takeFullSnapshot=e=>{if(!Lc)throw new Error("please take full snapshot after start recording");Pc(e)},_c.mirror=Fc,(Uc=Bc||(Bc={}))[Uc.NotStarted=0]="NotStarted",Uc[Uc.Running=1]="Running",Uc[Uc.Stopped=2]="Stopped",e.SessionEventType=void 0,(jc=e.SessionEventType||(e.SessionEventType={})).CONSOLE="CONSOLE",jc.ERROR="ERROR",jc.NETWORK="NETWORK",jc.CUSTOM="CUSTOM",jc.PERFORMANCE="PERFORMANCE",jc.PAGE_VIEW="PAGE_VIEW",e.ConsoleLevel=void 0,(Wc=e.ConsoleLevel||(e.ConsoleLevel={})).LOG="log",Wc.INFO="info",Wc.WARN="warn",Wc.ERROR="error",Wc.DEBUG="debug";class zc{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{console.log("[SessionReplay] Initializing session replay..."),await this.startSession(),console.log("[SessionReplay] Session started on backend, sessionId:",this.session?.sessionId),console.log("[SessionReplay] Starting rrweb recording..."),this.startRrwebRecording(),console.log("[SessionReplay] rrweb recording started"),setTimeout(()=>{console.log("[SessionReplay] Performing initial flush of critical events..."),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=_c({emit:e=>{4===e.type?console.log("[SessionReplay] Captured Meta event (type 4)"):2===e.type&&console.log("[SessionReplay] Captured Full Snapshot event (type 2)"),this.eventBuffer.push(e),console.log(`[SessionReplay] Event buffered. Type: ${e.type}, Buffer size: ${this.eventBuffer.length}`),this.eventBuffer.length>=(this.config.buffering?.maxBufferSize||100)&&(console.log("[SessionReplay] Buffer full, flushing..."),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(console.log(`[SessionReplay] flush() called. Session: ${!!this.session}, Event buffer: ${this.eventBuffer.length}, Telemetry buffer: ${this.telemetryBuffer.length}`),!this.session)return void console.warn("[SessionReplay] flush() skipped - no session yet!");if(0===this.eventBuffer.length&&0===this.telemetryBuffer.length)return void console.log("[SessionReplay] flush() skipped - buffers empty");console.log(`[SessionReplay] Flushing ${this.eventBuffer.length} events to backend...`);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 Vc="undefined"!=typeof window;e.AuthenticationError=r,e.AutoPageViewPlugin=x,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),Vc&&this.initBrowserPlugins()}get events(){return this._events}get contacts(){return this._contacts}get deals(){return this._deals}get visitorId(){return this._visitorId}get deviceInfo(){return this._deviceInfo}get sessionReplay(){return this._sessionReplay}initBrowserPlugins(){this.config.persistVisitorId&&(this._visitorId=new v(this.config),this.plugins.push(this._visitorId)),this.config.autoDeviceInfo&&(this._deviceInfo=new k,this.plugins.push(this._deviceInfo)),this.config.autoPageView&&(this._autoPageView=new x(this),this.plugins.push(this._autoPageView)),!1!==this.config.sessionReplay?.enabled&&(this._sessionReplay=new zc(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=k,e.EventsResource=p,e.NetworkError=l,e.RateLimitError=i,e.ResourceNotFoundError=n,e.ServerError=a,e.SessionReplayPlugin=zc,e.VERSION="1.1.0",e.ValidationError=o,e.VisitorIdPlugin=v,e.detectBrowser=S,e.detectDeviceType=b,e.detectOS=C,e.generateUUID=w,e.getDeviceInfo=I,e.getLocalStorageItem=g,e.isLocalStorageAvailable=m,e.removeLocalStorageItem=function(e){if(!m())return!1;try{return window.localStorage.removeItem(e),!0}catch{return!1}},e.setLocalStorageItem=y});
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}/`)}}function m(){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 g(e){if(!m())return null;try{return window.localStorage.getItem(e)}catch{return null}}function y(e,t){if(!m())return!1;try{return window.localStorage.setItem(e,t),!0}catch{return!1}}function w(){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 v{constructor(e){this.config=e,this.visitorId=this.getOrCreateVisitorId()}getOrCreateVisitorId(){const e=g(this.config.visitorIdKey);if(e)return e;const t=w();return y(this.config.visitorIdKey,t),t}getVisitorId(){return this.visitorId}setVisitorId(e){this.visitorId=e,y(this.config.visitorIdKey,e)}resetVisitorId(){const e=w();return this.setVisitorId(e),e}destroy(){}}function b(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 S(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 C(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 I(){if("undefined"==typeof navigator)return{userAgent:"",deviceType:"desktop",browser:"Unknown",os:"Unknown"};const e=navigator.userAgent;return{userAgent:e,deviceType:b(e),browser:S(e),os:C(e)}}class k{constructor(){this.deviceInfo=I()}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 x{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 O,E=Object.defineProperty,R=(e,t,r)=>((e,t,r)=>t in e?E(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),M=Object.defineProperty,A=(e,t,r)=>((e,t,r)=>t in e?M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),T=(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))(T||{});const N={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},P={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},D={};function L(e){if(D[e])return D[e];const t=globalThis[e],r=t.prototype,s=e in N?N[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 P?P[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 D[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?D[e]=o:r}catch{return r}}const F={};function _(e,t,r){var s;const n=`${e}.${String(r)}`;if(F[n])return F[n].call(t);const o=L(e),i=null==(s=Object.getOwnPropertyDescriptor(o,r))?void 0:s.get;return i?(F[n]=i,i.call(t)):t[r]}const U={};function B(e,t,r){const s=`${e}.${String(r)}`;if(U[s])return U[s].bind(t);const n=L(e)[r];return"function"!=typeof n?t[r]:(U[s]=n,n.bind(t))}const j={childNodes:function(e){return _("Node",e,"childNodes")},parentNode:function(e){return _("Node",e,"parentNode")},parentElement:function(e){return _("Node",e,"parentElement")},textContent:function(e){return _("Node",e,"textContent")},contains:function(e,t){return B("Node",e,"contains")(t)},getRootNode:function(e){return B("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?_("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?_("Element",e,"shadowRoot"):null},querySelector:function(e,t){return _("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return _("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return L("MutationObserver").constructor}};function W(e){return e.nodeType===e.ELEMENT_NODE}function z(e){const t=e&&"host"in e&&"mode"in e&&j.host(e)||null;return Boolean(t&&"shadowRoot"in t&&j.shadowRoot(t)===e)}function V(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function G(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=>Z(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 Z(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=G(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?re(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?re(r,t):r}}class Y{constructor(){A(this,"idNodeMap",new Map),A(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 X({element:e,maskInputOptions:t,tagName:r,type:s,value:n,maskInputFn:o}){let i=n||"";const a=s&&H(s);return(t[r.toLowerCase()]||a&&t[a])&&(i=o?o(i,e):"*".repeat(i.length)),i}function H(e){return e.toLowerCase()}const J="__rrweb_original__";function $(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?H(t):null}function K(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,Q=/^(?:[a-z+]+:)?\/\//i,ee=/^www\..*/i,te=/^(data:)([^,]*),(.*)/i;function re(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(Q.test(a)||ee.test(a))return`url(${l}${a}${l})`;if(te.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 se(e){return e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function ne(e,t){return function(e,t){const r=Array.from(t.childNodes),s=[];if(r.length>1&&e&&"string"==typeof e){const t=se(e);for(let n=1;n<r.length;n++)if(r[n].textContent&&"string"==typeof r[n].textContent){const o=se(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(se(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 oe=1;const ie=new RegExp("[^a-z0-9-_:]");function ae(){return oe++}let le,ce;const he=/^[^ \t\n\r\u000c]+/,ue=/^[, \t\n\r\u000c]+/;const pe=new WeakMap;function de(e,t){return t&&""!==t.trim()?me(e,t):t}function fe(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function me(e,t){let r=pe.get(e);if(r||(r=e.createElement("a"),pe.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function ge(e,t,r,s){return s?"src"===r||"href"===r&&("use"!==t||"#"!==s[0])||"xlink:href"===r&&"#"!==s[0]?de(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(ue),!(r>=t.length);){let o=s(he);if(","===o.slice(-1))o=de(e,o.substring(0,o.length-1)),n.push(o);else{let s="";o=de(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?re(s,me(e)):"object"===t&&"data"===r?de(e,s):s:de(e,s):s}function ye(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function we(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&we(j.parentNode(e),t,r);for(let r=e.classList.length;r--;){const s=e.classList[r];if(t.test(s))return!0}return!!r&&we(j.parentNode(e),t,r)}function ve(e,t,r,s){let n;if(W(e)){if(n=e,!j.childNodes(n).length)return!1}else{if(null===j.parentElement(e))return!1;n=j.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(we(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 be(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:T.Document,childNodes:[],compatMode:e.compatMode}:{type:T.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:T.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=H(e.tagName);return ie.test(t)?"div":t}(e);let g={};const y=e.attributes.length;for(let t=0;t<y;t++){const s=e.attributes[t];ye(m,s.name,s.value)||(g[s.name]=ge(r,m,H(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=G(t)),s&&(delete g.rel,delete g.href,g._cssText=s)}if("style"===m&&e.sheet){let t=G(e.sheet);t&&(e.childNodes.length>1&&(t=ne(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=X({element:e,type:$(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=J in n?n[J]: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){le||(le=r.createElement("canvas"),ce=le.getContext("2d"));const t=e,s=t.currentSrc||t.getAttribute("src")||"<unknown-src>",n=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{le.width=t.naturalWidth,le.height=t.naturalHeight,ce.drawImage(t,0,0),g.rr_dataURL=le.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:T.Element,tagName:m,attributes:g,childNodes:[],isSVG:fe(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=j.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=j.textContent(e),c&&l&&(l=re(l,me(t.doc))));!c&&!h&&l&&r&&(l=s?s(l,j.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:T.Text,textContent:l||"",rootId:n}}(e,{doc:r,needsMask:i,maskTextFn:c,rootId:y,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:T.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:T.Comment,textContent:j.textContent(e)||"",rootId:y};default:return!1}}function Se(e){return null==e?"":e.toLowerCase()}function Ce(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=ve(e,i,a,void 0===x)}const E=be(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===T.Comment)return!0;if(e.type===T.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"===K(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Se(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Se(e.attributes.name)||"icon"===Se(e.attributes.rel)||"apple-touch-icon"===Se(e.attributes.rel)||"shortcut icon"===Se(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Se(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Se(e.attributes.property).match(/^(og|twitter|fb):/)||Se(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Se(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Se(e.attributes.name)||"googlebot"===Se(e.attributes.name)||"bingbot"===Se(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Se(e.attributes.name)||"generator"===Se(e.attributes.name)||"framework"===Se(e.attributes.name)||"publisher"===Se(e.attributes.name)||"progid"===Se(e.attributes.name)||Se(e.attributes.property).match(/^article:/)||Se(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Se(e.attributes.name)||"yandex-verification"===Se(e.attributes.name)||"csrf-token"===Se(e.attributes.name)||"p:domain_verify"===Se(e.attributes.name)||"verify-v1"===Se(e.attributes.name)||"verification"===Se(e.attributes.name)||"shopify-checkout-api-token"===Se(e.attributes.name)))return!0}}return!1}(E,d)||!O&&E.type===T.Text&&!E.textContent.replace(/^\s+|\s+$/gm,"").length?-2:ae();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===T.Element){A=A&&!M.needBlock,delete M.needBlock;const t=j.shadowRoot(e);t&&V(t)&&(M.isShadowHost=!0)}if((M.type===T.Document||M.type===T.Element)&&A){d.headWhitespace&&M.type===T.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===T.Element&&"textarea"===M.tagName&&void 0!==M.attributes.value);else{M.type===T.Element&&void 0!==M.attributes._cssText&&"string"==typeof M.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(j.childNodes(e))){const e=Ce(r,t);e&&M.childNodes.push(e)}}let I=null;if(W(e)&&(I=j.shadowRoot(e)))for(const e of Array.from(j.childNodes(I))){const r=Ce(e,t);r&&(V(I)&&(r.isShadow=!0),M.childNodes.push(r))}}const N=j.parentNode(e);return N&&z(N)&&V(N)&&(M.isShadow=!0),M.type===T.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=Ce(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===T.Element&&"link"===M.tagName&&"string"==typeof M.attributes.rel&&("stylesheet"===M.attributes.rel||"preload"===M.attributes.rel&&"string"==typeof M.attributes.href&&"css"===K(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=Ce(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 Ie(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ke(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 xe={exports:{}},Oe=String,Ee=function(){return{isColorSupported:!1,reset:Oe,bold:Oe,dim:Oe,italic:Oe,underline:Oe,inverse:Oe,hidden:Oe,strikethrough:Oe,black:Oe,red:Oe,green:Oe,yellow:Oe,blue:Oe,magenta:Oe,cyan:Oe,white:Oe,gray:Oe,bgBlack:Oe,bgRed:Oe,bgGreen:Oe,bgYellow:Oe,bgBlue:Oe,bgMagenta:Oe,bgCyan:Oe,bgWhite:Oe}};xe.exports=Ee(),xe.exports.createColors=Ee;var Re=xe.exports;const Me=ke(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Ae=Re,Te=Me,Ne=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=Ae.isColorSupported),Te&&e&&(t=Te(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}=Ae.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 Pe=Ne;Ne.default=Ne;var De={};De.isClean=Symbol("isClean"),De.my=Symbol("my");const Le={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Fe=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 Le[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=Le[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 _e=Fe;Fe.default=Fe;let Ue=_e;function Be(e,t){new Ue(t).stringify(e)}var je=Be;Be.default=Be;let{isClean:We,my:ze}=De,Ve=Pe,Ge=_e,Ze=je;function Ye(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=>Ye(e,r)):("object"===o&&null!==n&&(n=Ye(n)),r[s]=n)}return r}let Xe=class{constructor(e={}){this.raws={},this[We]=!1,this[ze]=!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=Ye(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 Ve(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[We]){this[We]=!1;let e=this;for(;e=e.parent;)e[We]=!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 Ge).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=Ze){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 He=Xe;Xe.default=Xe;let Je=He,$e=class extends Je{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 Ke=$e;$e.default=$e;var qe={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:Qe,SourceMapGenerator:et}=Me,{existsSync:tt,readFileSync:rt}=Me,{dirname:st,join:nt}=Me;let ot=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=st(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new Qe(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=st(e),tt(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 Qe)return et.fromSourceMap(t).toString();if(t instanceof et)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=nt(st(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 it=ot;ot.default=ot;let{SourceMapConsumer:at,SourceMapGenerator:lt}=Me,{fileURLToPath:ct,pathToFileURL:ht}=Me,{isAbsolute:ut,resolve:pt}=Me,{nanoid:dt}=qe,ft=Me,mt=Pe,gt=it,yt=Symbol("fromOffsetCache"),wt=Boolean(at&&lt),vt=Boolean(pt&&ut),bt=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&&(!vt||/^\w+:\/\//.test(t.from)||ut(t.from)?this.file=t.from:this.file=pt(t.from)),vt&&wt){let e=new gt(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 "+dt(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 mt(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 mt(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&&(ht&&(n.input.url=ht(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,r;if(this[yt])r=this[yt];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[yt]=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:pt(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=ut(a.source)?ht(a.source):new URL(a.source,this.map.consumer().sourceRoot||ht(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(!ct)throw new Error("file: protocol is not available in this PostCSS build");l.file=ct(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 St=bt;bt.default=bt,ft&&ft.registerInput&&ft.registerInput(bt);let{SourceMapConsumer:Ct,SourceMapGenerator:It}=Me,{dirname:kt,relative:xt,resolve:Ot,sep:Et}=Me,{pathToFileURL:Rt}=Me,Mt=St,At=Boolean(Ct&&It),Tt=Boolean(kt&&Ot&&xt&&Et);var Nt=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||kt(e.file);!1===this.mapOpts.sourcesContent?(t=new Ct(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(),Tt&&At&&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=It.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new It({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 It({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?kt(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=kt(Ot(r,this.mapOpts.annotation)));let s=xt(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 Mt(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(Rt){let t=Rt(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;"\\"===Et&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Pt=He,Dt=class extends Pt{constructor(e){super(e),this.type="comment"}};var Lt=Dt;Dt.default=Dt;let Ft,_t,Ut,Bt,{isClean:jt,my:Wt}=De,zt=Ke,Vt=Lt,Gt=He;function Zt(e){return e.map(e=>(e.nodes&&(e.nodes=Zt(e.nodes)),delete e.source,e))}function Yt(e){if(e[jt]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Yt(t)}let Xt=class e extends Gt{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=Zt(Ft(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 zt(t)]}else if(t.selector)t=[new _t(t)];else if(t.name)t=[new Ut(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Vt(t)]}return t.map(t=>(t[Wt]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[jt]&&Yt(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]}};Xt.registerParse=e=>{Ft=e},Xt.registerRule=e=>{_t=e},Xt.registerAtRule=e=>{Ut=e},Xt.registerRoot=e=>{Bt=e};var Ht=Xt;Xt.default=Xt,Xt.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Ut.prototype):"rule"===e.type?Object.setPrototypeOf(e,_t.prototype):"decl"===e.type?Object.setPrototypeOf(e,zt.prototype):"comment"===e.type?Object.setPrototypeOf(e,Vt.prototype):"root"===e.type&&Object.setPrototypeOf(e,Bt.prototype),e[Wt]=!0,e.nodes&&e.nodes.forEach(e=>{Xt.rebuild(e)})};let Jt,$t,Kt=Ht,qt=class extends Kt{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Jt(new $t,this,e).stringify()}};qt.registerLazyResult=e=>{Jt=e},qt.registerProcessor=e=>{$t=e};var Qt=qt;qt.default=qt;let er={};var tr=function(e){er[e]||(er[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let rr=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 sr=rr;rr.default=rr;let nr=sr,or=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 nr(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var ir=or;or.default=or;const ar="'".charCodeAt(0),lr='"'.charCodeAt(0),cr="\\".charCodeAt(0),hr="/".charCodeAt(0),ur="\n".charCodeAt(0),pr=" ".charCodeAt(0),dr="\f".charCodeAt(0),fr="\t".charCodeAt(0),mr="\r".charCodeAt(0),gr="[".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=/[\t\n\f\r "#'()/;[\\\]{}]/g,Er=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Rr=/.[\r\n"'(/\\]/,Mr=/[\da-f]/i;let Ar=Ht,Tr=class extends Ar{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 Nr=Tr;Tr.default=Tr,Ar.registerAtRule(Tr);let Pr,Dr,Lr=Ht,Fr=class extends Lr{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 Pr(new Dr,this,e).stringify()}};Fr.registerLazyResult=e=>{Pr=e},Fr.registerProcessor=e=>{Dr=e};var _r=Fr;Fr.default=Fr,Lr.registerRoot(Fr);let Ur={comma:e=>Ur.split(e,[","],!0),space:e=>Ur.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 Br=Ur;Ur.default=Ur;let jr=Ht,Wr=Br,zr=class extends jr{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Wr.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 Vr=zr;zr.default=zr,jr.registerRule(zr);let Gr=Ke,Zr=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 ur:case pr:case fr:case mr:case dr:s=m;do{s+=1,r=p.charCodeAt(s)}while(r===pr||r===ur||r===fr||r===mr||r===dr);u=["space",p.slice(m,s)],m=s-1;break;case gr:case yr:case br:case Sr:case kr:case Cr:case vr:{let e=String.fromCharCode(r);u=[e,e,m];break}case wr:if(c=g.length?g.pop()[1]:"",h=p.charCodeAt(m+1),"url"===c&&h!==ar&&h!==lr&&h!==pr&&h!==ur&&h!==fr&&h!==dr&&h!==mr){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)===cr;)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||Rr.test(o)?u=["(","(",m]:(u=["brackets",o,m,s],m=s);break;case ar:case lr:n=r===ar?"'":'"',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)===cr;)l-=1,a=!a}while(a);u=["string",p.slice(m,s+1),m,s],m=s;break;case xr:Or.lastIndex=m+1,Or.test(p),s=0===Or.lastIndex?p.length-1:Or.lastIndex-2,u=["at-word",p.slice(m,s+1),m,s],m=s;break;case cr:for(s=m,i=!0;p.charCodeAt(s+1)===cr;)s+=1,i=!i;if(r=p.charCodeAt(s+1),i&&r!==hr&&r!==pr&&r!==ur&&r!==fr&&r!==mr&&r!==dr&&(s+=1,Mr.test(p.charAt(s)))){for(;Mr.test(p.charAt(s+1));)s+=1;p.charCodeAt(s+1)===pr&&(s+=1)}u=["word",p.slice(m,s+1),m,s],m=s;break;default:r===hr&&p.charCodeAt(m+1)===Ir?(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):(Er.lastIndex=m+1,Er.test(p),s=0===Er.lastIndex?p.length-1:Er.lastIndex-2,u=["word",p.slice(m,s+1),m,s],g.push(u),m=s)}return m++,u},position:function(){return m}}},Yr=Lt,Xr=Nr,Hr=_r,Jr=Vr;const $r={empty:!0,space:!0};let Kr=Ht,qr=class{constructor(e){this.input=e,this.root=new Hr,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 Xr;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 Yr;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=Zr(this.input)}decl(e,t){let r=new Gr;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 Jr;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",$r[a]||$r[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 Jr;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})}},Qr=St;function es(e,t){let r=new Qr(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 ts=es;es.default=es,Kr.registerParse(es);let{isClean:rs,my:ss}=De,ns=Nt,os=je,is=Ht,as=Qt,ls=tr,cs=ir,hs=ts,us=_r;const ps={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},ds={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},fs={Once:!0,postcssPlugin:!0,prepare:!0};function ms(e){return"object"==typeof e&&"function"==typeof e.then}function gs(e){let t=!1,r=ps[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 ys(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:gs(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function ws(e){return e[rs]=!1,e.nodes&&e.nodes.forEach(e=>ws(e)),e}let vs={},bs=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 cs)n=ws(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=hs;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[ss]&&is.rebuild(n)}else n=ws(r);this.result=new cs(t,n,s),this.helpers={...vs,postcss:vs,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(!ds[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!fs[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(ms(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[rs];){e[rs]=!0;let t=[ys(e)];for(;t.length>0;){let e=this.visitTick(t);if(ms(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 ms(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=os;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new ns(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(ms(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[rs];)e[rs]=!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||ls("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(ms(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[rs])return s[rs]=!0,void e.push(ys(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[rs]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[rs]=!0;let t=gs(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[rs]||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"}};bs.registerPostcss=e=>{vs=e};var Ss=bs;bs.default=bs,us.registerLazyResult(bs),as.registerLazyResult(bs);let Cs=Nt,Is=je,ks=tr,xs=ts;const Os=ir;let Es=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=Is;this.result=new Os(this._processor,s,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new Cs(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||ks("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=xs;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 Rs=Es;Es.default=Es;let Ms=Rs,As=Ss,Ts=Qt,Ns=_r,Ps=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 As(this,e,t):new Ms(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Ds=Ps;Ps.default=Ps,Ns.registerProcessor(Ps),Ts.registerProcessor(Ps);let Ls=Ke,Fs=it,_s=Lt,Us=Nr,Bs=St,js=_r,Ws=Vr;function zs(e,t){if(Array.isArray(e))return e.map(e=>zs(e));let{inputs:r,...s}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Bs.prototype};r.map&&(r.map={...r.map,__proto__:Fs.prototype}),t.push(r)}}if(s.nodes&&(s.nodes=e.nodes.map(e=>zs(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 js(s);if("decl"===s.type)return new Ls(s);if("rule"===s.type)return new Ws(s);if("comment"===s.type)return new _s(s);if("atrule"===s.type)return new Us(s);throw new Error("Unknown node type: "+e.type)}var Vs=zs;zs.default=zs;let Gs=Pe,Zs=Ke,Ys=Ss,Xs=Ht,Hs=Ds,Js=je,$s=Vs,Ks=Qt,qs=sr,Qs=Lt,en=Nr,tn=ir,rn=St,sn=ts,nn=Br,on=Vr,an=_r,ln=He;function cn(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Hs(e)}cn.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 Hs).version,n}return Object.defineProperty(n,"postcss",{get:()=>(r||(r=n()),r)}),n.process=function(e,t,r){return cn([n(r)]).process(e,t)},n},cn.stringify=Js,cn.parse=sn,cn.fromJSON=$s,cn.list=nn,cn.comment=e=>new Qs(e),cn.atRule=e=>new en(e),cn.decl=e=>new Zs(e),cn.rule=e=>new on(e),cn.root=e=>new an(e),cn.document=e=>new Ks(e),cn.CssSyntaxError=Gs,cn.Declaration=Zs,cn.Container=Xs,cn.Processor=Hs,cn.Document=Ks,cn.Comment=Qs,cn.Warning=qs,cn.AtRule=en,cn.Result=tn,cn.Input=rn,cn.Rule=on,cn.Root=an,cn.Node=ln,Ys.registerPostcss(cn);var hn=cn;cn.default=cn;const un=Ie(hn);un.stringify,un.fromJSON,un.plugin,un.parse,un.list,un.document,un.comment,un.atRule,un.rule,un.decl,un.root,un.CssSyntaxError,un.Declaration,un.Container,un.Processor,un.Document,un.Comment,un.Warning,un.AtRule,un.Result,un.Input,un.Rule,un.Root,un.Node;var pn=Object.defineProperty,dn=(e,t,r)=>((e,t,r)=>t in e?pn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function fn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function mn(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 gn={exports:{}},yn=String,wn=function(){return{isColorSupported:!1,reset:yn,bold:yn,dim:yn,italic:yn,underline:yn,inverse:yn,hidden:yn,strikethrough:yn,black:yn,red:yn,green:yn,yellow:yn,blue:yn,magenta:yn,cyan:yn,white:yn,gray:yn,bgBlack:yn,bgRed:yn,bgGreen:yn,bgYellow:yn,bgBlue:yn,bgMagenta:yn,bgCyan:yn,bgWhite:yn}};gn.exports=wn(),gn.exports.createColors=wn;var vn=gn.exports;const bn=mn(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Sn=vn,Cn=bn,In=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=Sn.isColorSupported),Cn&&e&&(t=Cn(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}=Sn.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 kn=In;In.default=In;var xn={};xn.isClean=Symbol("isClean"),xn.my=Symbol("my");const On={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let En=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 On[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=On[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 Rn=En;En.default=En;let Mn=Rn;function An(e,t){new Mn(t).stringify(e)}var Tn=An;An.default=An;let{isClean:Nn,my:Pn}=xn,Dn=kn,Ln=Rn,Fn=Tn;function _n(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=>_n(e,r)):("object"===o&&null!==n&&(n=_n(n)),r[s]=n)}return r}let Un=class{constructor(e={}){this.raws={},this[Nn]=!1,this[Pn]=!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=_n(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 Dn(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[Nn]){this[Nn]=!1;let e=this;for(;e=e.parent;)e[Nn]=!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 Ln).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=Fn){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 Bn=Un;Un.default=Un;let jn=Bn,Wn=class extends jn{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 zn=Wn;Wn.default=Wn;var Vn={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:Gn,SourceMapGenerator:Zn}=bn,{existsSync:Yn,readFileSync:Xn}=bn,{dirname:Hn,join:Jn}=bn;let $n=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=Hn(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new Gn(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=Hn(e),Yn(e))return this.mapFile=e,Xn(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 Gn)return Zn.fromSourceMap(t).toString();if(t instanceof Zn)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=Jn(Hn(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 Kn=$n;$n.default=$n;let{SourceMapConsumer:qn,SourceMapGenerator:Qn}=bn,{fileURLToPath:eo,pathToFileURL:to}=bn,{isAbsolute:ro,resolve:so}=bn,{nanoid:no}=Vn,oo=bn,io=kn,ao=Kn,lo=Symbol("fromOffsetCache"),co=Boolean(qn&&Qn),ho=Boolean(so&&ro),uo=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&&(!ho||/^\w+:\/\//.test(t.from)||ro(t.from)?this.file=t.from:this.file=so(t.from)),ho&&co){let e=new ao(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 "+no(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 io(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 io(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&&(to&&(n.input.url=to(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,r;if(this[lo])r=this[lo];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[lo]=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:so(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=ro(a.source)?to(a.source):new URL(a.source,this.map.consumer().sourceRoot||to(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(!eo)throw new Error("file: protocol is not available in this PostCSS build");l.file=eo(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 po=uo;uo.default=uo,oo&&oo.registerInput&&oo.registerInput(uo);let{SourceMapConsumer:fo,SourceMapGenerator:mo}=bn,{dirname:go,relative:yo,resolve:wo,sep:vo}=bn,{pathToFileURL:bo}=bn,So=po,Co=Boolean(fo&&mo),Io=Boolean(go&&wo&&yo&&vo);var ko=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||go(e.file);!1===this.mapOpts.sourcesContent?(t=new fo(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(),Io&&Co&&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=mo.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new mo({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 mo({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?go(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=go(wo(r,this.mapOpts.annotation)));let s=yo(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 So(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(bo){let t=bo(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;"\\"===vo&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let xo=Bn,Oo=class extends xo{constructor(e){super(e),this.type="comment"}};var Eo=Oo;Oo.default=Oo;let Ro,Mo,Ao,To,{isClean:No,my:Po}=xn,Do=zn,Lo=Eo,Fo=Bn;function _o(e){return e.map(e=>(e.nodes&&(e.nodes=_o(e.nodes)),delete e.source,e))}function Uo(e){if(e[No]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Uo(t)}let Bo=class e extends Fo{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=_o(Ro(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 Do(t)]}else if(t.selector)t=[new Mo(t)];else if(t.name)t=[new Ao(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Lo(t)]}return t.map(t=>(t[Po]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[No]&&Uo(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]}};Bo.registerParse=e=>{Ro=e},Bo.registerRule=e=>{Mo=e},Bo.registerAtRule=e=>{Ao=e},Bo.registerRoot=e=>{To=e};var jo=Bo;Bo.default=Bo,Bo.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Ao.prototype):"rule"===e.type?Object.setPrototypeOf(e,Mo.prototype):"decl"===e.type?Object.setPrototypeOf(e,Do.prototype):"comment"===e.type?Object.setPrototypeOf(e,Lo.prototype):"root"===e.type&&Object.setPrototypeOf(e,To.prototype),e[Po]=!0,e.nodes&&e.nodes.forEach(e=>{Bo.rebuild(e)})};let Wo,zo,Vo=jo,Go=class extends Vo{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Wo(new zo,this,e).stringify()}};Go.registerLazyResult=e=>{Wo=e},Go.registerProcessor=e=>{zo=e};var Zo=Go;Go.default=Go;let Yo={};var Xo=function(e){Yo[e]||(Yo[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Ho=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 Jo=Ho;Ho.default=Ho;let $o=Jo,Ko=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 $o(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var qo=Ko;Ko.default=Ko;const Qo="'".charCodeAt(0),ei='"'.charCodeAt(0),ti="\\".charCodeAt(0),ri="/".charCodeAt(0),si="\n".charCodeAt(0),ni=" ".charCodeAt(0),oi="\f".charCodeAt(0),ii="\t".charCodeAt(0),ai="\r".charCodeAt(0),li="[".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=/[\t\n\f\r "#'()/;[\\\]{}]/g,vi=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,bi=/.[\r\n"'(/\\]/,Si=/[\da-f]/i;let Ci=jo,Ii=class extends Ci{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 ki=Ii;Ii.default=Ii,Ci.registerAtRule(Ii);let xi,Oi,Ei=jo,Ri=class extends Ei{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 xi(new Oi,this,e).stringify()}};Ri.registerLazyResult=e=>{xi=e},Ri.registerProcessor=e=>{Oi=e};var Mi=Ri;Ri.default=Ri,Ei.registerRoot(Ri);let Ai={comma:e=>Ai.split(e,[","],!0),space:e=>Ai.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 Ti=Ai;Ai.default=Ai;let Ni=jo,Pi=Ti,Di=class extends Ni{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Pi.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 Li=Di;Di.default=Di,Ni.registerRule(Di);let Fi=zn,_i=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 si:case ni:case ii:case ai:case oi:s=m;do{s+=1,r=p.charCodeAt(s)}while(r===ni||r===si||r===ii||r===ai||r===oi);u=["space",p.slice(m,s)],m=s-1;break;case li:case ci:case pi:case di:case gi:case fi:case ui:{let e=String.fromCharCode(r);u=[e,e,m];break}case hi:if(c=g.length?g.pop()[1]:"",h=p.charCodeAt(m+1),"url"===c&&h!==Qo&&h!==ei&&h!==ni&&h!==si&&h!==ii&&h!==oi&&h!==ai){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)===ti;)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||bi.test(o)?u=["(","(",m]:(u=["brackets",o,m,s],m=s);break;case Qo:case ei:n=r===Qo?"'":'"',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)===ti;)l-=1,a=!a}while(a);u=["string",p.slice(m,s+1),m,s],m=s;break;case yi:wi.lastIndex=m+1,wi.test(p),s=0===wi.lastIndex?p.length-1:wi.lastIndex-2,u=["at-word",p.slice(m,s+1),m,s],m=s;break;case ti:for(s=m,i=!0;p.charCodeAt(s+1)===ti;)s+=1,i=!i;if(r=p.charCodeAt(s+1),i&&r!==ri&&r!==ni&&r!==si&&r!==ii&&r!==ai&&r!==oi&&(s+=1,Si.test(p.charAt(s)))){for(;Si.test(p.charAt(s+1));)s+=1;p.charCodeAt(s+1)===ni&&(s+=1)}u=["word",p.slice(m,s+1),m,s],m=s;break;default:r===ri&&p.charCodeAt(m+1)===mi?(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):(vi.lastIndex=m+1,vi.test(p),s=0===vi.lastIndex?p.length-1:vi.lastIndex-2,u=["word",p.slice(m,s+1),m,s],g.push(u),m=s)}return m++,u},position:function(){return m}}},Ui=Eo,Bi=ki,ji=Mi,Wi=Li;const zi={empty:!0,space:!0};let Vi=jo,Gi=class{constructor(e){this.input=e,this.root=new ji,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 Bi;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 Ui;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=_i(this.input)}decl(e,t){let r=new Fi;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 Wi;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",zi[a]||zi[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 Wi;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})}},Zi=po;function Yi(e,t){let r=new Zi(e,t),s=new Gi(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 Xi=Yi;Yi.default=Yi,Vi.registerParse(Yi);let{isClean:Hi,my:Ji}=xn,$i=ko,Ki=Tn,qi=jo,Qi=Zo,ea=Xo,ta=qo,ra=Xi,sa=Mi;const na={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},oa={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},ia={Once:!0,postcssPlugin:!0,prepare:!0};function aa(e){return"object"==typeof e&&"function"==typeof e.then}function la(e){let t=!1,r=na[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 ca(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:la(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function ha(e){return e[Hi]=!1,e.nodes&&e.nodes.forEach(e=>ha(e)),e}let ua={},pa=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 ta)n=ha(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=ra;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[Ji]&&qi.rebuild(n)}else n=ha(r);this.result=new ta(t,n,s),this.helpers={...ua,postcss:ua,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(!oa[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!ia[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(aa(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Hi];){e[Hi]=!0;let t=[ca(e)];for(;t.length>0;){let e=this.visitTick(t);if(aa(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 aa(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=Ki;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new $i(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(aa(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Hi];)e[Hi]=!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||ea("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(aa(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[Hi])return s[Hi]=!0,void e.push(ca(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[Hi]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Hi]=!0;let t=la(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[Hi]||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"}};pa.registerPostcss=e=>{ua=e};var da=pa;pa.default=pa,sa.registerLazyResult(pa),Qi.registerLazyResult(pa);let fa=ko,ma=Tn,ga=Xo,ya=Xi;const wa=qo;let va=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=ma;this.result=new wa(this._processor,s,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new fa(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||ga("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=ya;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 ba=va;va.default=va;let Sa=ba,Ca=da,Ia=Zo,ka=Mi,xa=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 Ca(this,e,t):new Sa(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Oa=xa;xa.default=xa,ka.registerProcessor(xa),Ia.registerProcessor(xa);let Ea=zn,Ra=Kn,Ma=Eo,Aa=ki,Ta=po,Na=Mi,Pa=Li;function Da(e,t){if(Array.isArray(e))return e.map(e=>Da(e));let{inputs:r,...s}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Ta.prototype};r.map&&(r.map={...r.map,__proto__:Ra.prototype}),t.push(r)}}if(s.nodes&&(s.nodes=e.nodes.map(e=>Da(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 Na(s);if("decl"===s.type)return new Ea(s);if("rule"===s.type)return new Pa(s);if("comment"===s.type)return new Ma(s);if("atrule"===s.type)return new Aa(s);throw new Error("Unknown node type: "+e.type)}var La=Da;Da.default=Da;let Fa=kn,_a=zn,Ua=da,Ba=jo,ja=Oa,Wa=Tn,za=La,Va=Zo,Ga=Jo,Za=Eo,Ya=ki,Xa=qo,Ha=po,Ja=Xi,$a=Ti,Ka=Li,qa=Mi,Qa=Bn;function el(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new ja(e)}el.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 ja).version,n}return Object.defineProperty(n,"postcss",{get:()=>(r||(r=n()),r)}),n.process=function(e,t,r){return el([n(r)]).process(e,t)},n},el.stringify=Wa,el.parse=Ja,el.fromJSON=za,el.list=$a,el.comment=e=>new Za(e),el.atRule=e=>new Ya(e),el.decl=e=>new _a(e),el.rule=e=>new Ka(e),el.root=e=>new qa(e),el.document=e=>new Va(e),el.CssSyntaxError=Fa,el.Declaration=_a,el.Container=Ba,el.Processor=ja,el.Document=Va,el.Comment=Za,el.Warning=Ga,el.AtRule=Ya,el.Result=Xa,el.Input=Ha,el.Rule=Ka,el.Root=qa,el.Node=Qa,Ua.registerPostcss(el);var tl=el;el.default=el;const rl=fn(tl);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 sl{constructor(...e){dn(this,"parentElement",null),dn(this,"parentNode",null),dn(this,"ownerDocument"),dn(this,"firstChild",null),dn(this,"lastChild",null),dn(this,"previousSibling",null),dn(this,"nextSibling",null),dn(this,"ELEMENT_NODE",1),dn(this,"TEXT_NODE",3),dn(this,"nodeType"),dn(this,"nodeName"),dn(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 sl))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 nl={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ol={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},il={};function al(e){if(il[e])return il[e];const t=globalThis[e],r=t.prototype,s=e in nl?nl[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 ol?ol[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 il[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?il[e]=o:r}catch{return r}}const ll={};function cl(e,t,r){var s;const n=`${e}.${String(r)}`;if(ll[n])return ll[n].call(t);const o=al(e),i=null==(s=Object.getOwnPropertyDescriptor(o,r))?void 0:s.get;return i?(ll[n]=i,i.call(t)):t[r]}const hl={};function ul(e,t,r){const s=`${e}.${String(r)}`;if(hl[s])return hl[s].bind(t);const n=al(e)[r];return"function"!=typeof n?t[r]:(hl[s]=n,n.bind(t))}function pl(){return al("MutationObserver").constructor}const dl={childNodes:function(e){return cl("Node",e,"childNodes")},parentNode:function(e){return cl("Node",e,"parentNode")},parentElement:function(e){return cl("Node",e,"parentElement")},textContent:function(e){return cl("Node",e,"textContent")},contains:function(e,t){return ul("Node",e,"contains")(t)},getRootNode:function(e){return ul("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?cl("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?cl("Element",e,"shadowRoot"):null},querySelector:function(e,t){return cl("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return cl("Element",e,"querySelectorAll")(t)},mutationObserver:pl};function fl(e,t,r=document){const s={capture:!0,passive:!0};return r.addEventListener(e,t,s),()=>r.removeEventListener(e,t,s)}const ml="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 gl={map:{},getId:()=>(console.error(ml),-1),getNode:()=>(console.error(ml),null),removeNodeFromMap(){console.error(ml)},has:()=>(console.error(ml),!1),reset(){console.error(ml)}};function yl(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 wl(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)}}),()=>wl(e,t,o||{},!0)}function vl(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&&(gl=new Proxy(gl,{get:(e,t,r)=>("map"===t&&console.error(ml),Reflect.get(e,t,r))}));let bl=Date.now;function Sl(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=dl.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=dl.parentElement(o.body))?void 0:s.scrollTop)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollTop)||0}}function Cl(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Il(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function kl(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:dl.parentElement(e)}function xl(e,t,r,s){if(!e)return!1;const n=kl(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(we(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 Ol(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function El(e,t){if(z(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const s=dl.parentNode(e);return(!s||s.nodeType!==e.DOCUMENT_NODE)&&(!s||El(s,t))}function Rl(e){return Boolean(e.changedTouches)}function Ml(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Al(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Tl(e){return!!e&&(e instanceof sl&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(dl.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(bl=()=>(new Date).getTime());class Nl{constructor(){R(this,"id",1),R(this,"styleIDMap",new WeakMap),R(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 Pl(e){var t;let r=null;return"getRootNode"in e&&(null==(t=dl.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&dl.host(dl.getRootNode(e))&&(r=dl.host(dl.getRootNode(e))),r}function Dl(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=Pl(r);)r=t;return r}(e);return dl.contains(t,r)}function Ll(e){const t=e.ownerDocument;return!!t&&(dl.contains(t,e)||Dl(e))}var Fl=(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))(Fl||{}),_l=(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))(_l||{}),Ul=(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))(Ul||{}),Bl=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Bl||{}),jl=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(jl||{}),Wl=(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))(Wl||{}),zl=(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))(zl||{});function Vl(e){return"__ln"in e}class Gl{constructor(){R(this,"length",0),R(this,"head",null),R(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&&Vl(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&&Vl(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 Zl=(e,t)=>`${e}@${t}`;class Yl{constructor(){R(this,"frozen",!1),R(this,"locked",!1),R(this,"texts",[]),R(this,"attributes",[]),R(this,"attributeMap",new WeakMap),R(this,"removes",[]),R(this,"mapRemoves",[]),R(this,"movedMap",{}),R(this,"addedSet",new Set),R(this,"movedSet",new Set),R(this,"droppedSet",new Set),R(this,"removesSubTreeCache",new Set),R(this,"mutationCb"),R(this,"blockClass"),R(this,"blockSelector"),R(this,"maskTextClass"),R(this,"maskTextSelector"),R(this,"inlineStylesheet"),R(this,"maskInputOptions"),R(this,"maskTextFn"),R(this,"maskInputFn"),R(this,"keepIframeSrcFn"),R(this,"recordCanvas"),R(this,"inlineImages"),R(this,"slimDOMOptions"),R(this,"dataURLOptions"),R(this,"doc"),R(this,"mirror"),R(this,"iframeManager"),R(this,"stylesheetManager"),R(this,"shadowDomManager"),R(this,"canvasManager"),R(this,"processedNodeManager"),R(this,"unattachedDoc"),R(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),R(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new Gl,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=dl.parentNode(n);if(!o||!Ll(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=z(o)?this.mirror.getId(Pl(n)):this.mirror.getId(o),l=s(n);if(-1===a||-1===l)return r.addNode(n);const c=Ce(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=>{Ml(e,this.mirror)&&this.iframeManager.addIframe(e),Al(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Tl(n)&&this.shadowDomManager.addShadowRoot(dl.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)Hl(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(dl.parentNode(e))||n(e);for(const e of this.addedSet)Jl(this.droppedSet,e)||Hl(this.removesSubTreeCache,e,this.mirror)?Jl(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(dl.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(dl.parentNode(r.value));if(-1===s(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,s=dl.parentNode(t);if(s&&s.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=dl.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=dl.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))}),R(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(dl.childNodes(e),e=>dl.textContent(e)||"").join("")}),R(this,"processMutation",e=>{if(!Ol(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=dl.textContent(e.target);xl(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:ve(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,kl(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=$(t);s=X({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:s,maskInputFn:this.maskInputFn})}if(xl(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"),!ye(t.tagName,r))if(n.attributes[r]=ge(this.doc,H(t.tagName),H(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(xl(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=z(e.target)?this.mirror.getId(dl.host(e.target)):this.mirror.getId(e.target);xl(e.target,this.blockClass,this.blockSelector,!1)||Ol(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Xl(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||El(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Zl(r,s)]?Xl(this.movedSet,t):(this.removes.push({parentId:s,id:r,isShadow:!(!z(e.target)||!V(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),dl.childNodes(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),R(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Ol(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[Zl(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);xl(e,this.blockClass,this.blockSelector,!1)||(dl.childNodes(e).forEach(e=>this.genAdds(e)),Tl(e)&&dl.childNodes(dl.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 Xl(e,t){e.delete(t),dl.childNodes(t).forEach(t=>Xl(e,t))}function Hl(e,t,r){return 0!==e.size&&function(e,t){const r=dl.parentNode(t);return!!r&&e.has(r)}(e,t)}function Jl(e,t){return 0!==e.size&&$l(e,t)}function $l(e,t){const r=dl.parentNode(t);return!!r&&(!!e.has(r)||$l(e,r))}let Kl;const ql=e=>{if(!Kl)return e;return(...t)=>{try{return e(...t)}catch(e){if(Kl&&!0===Kl(e))return;throw e}}},Ql=[];function ec(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 tc(e,t){const r=new Yl;Ql.push(r),r.init(e);const s=new(pl())(ql(r.processMutations.bind(r)));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function rc({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(Ul).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e]).forEach(o=>{let i=H(o);const c=(t=>o=>{const i=ec(o);if(xl(i,s,n,!0))return;let a=null,c=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=Bl.Mouse;break;case"touch":a=Bl.Touch;break;case"pen":a=Bl.Pen}a===Bl.Touch?Ul[t]===Ul.MouseDown?c="TouchStart":Ul[t]===Ul.MouseUp&&(c="TouchEnd"):Bl.Pen}else Rl(o)&&(a=Bl.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===Bl.Touch||c.startsWith("Mouse")&&a===Bl.Mouse)&&(a=null)):Ul[t]===Ul.Click&&(a=l,l=null);const h=Rl(o)?o.changedTouches[0]:o;if(!h)return;const u=r.getId(i),{clientX:p,clientY:d}=h;ql(e)({type:Ul[c],id:u,x:p,y:d,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(Ul[o]){case Ul.MouseDown:case Ul.MouseUp:i=i.replace("mouse","pointer");break;case Ul.TouchStart:case Ul.TouchEnd:return}a.push(fl(i,c,t))}),ql(()=>{a.forEach(e=>e())})}function sc({scrollCb:e,doc:t,mirror:r,blockClass:s,blockSelector:n,sampling:o}){return fl("scroll",ql(yl(ql(o=>{const i=ec(o);if(!i||xl(i,s,n,!0))return;const a=r.getId(i);if(i===t&&t.defaultView){const r=Sl(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 nc=["INPUT","TEXTAREA","SELECT"],oc=new WeakMap;function ic(e){return function(e,t){if(hc("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||hc("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||hc("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||hc("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 ac(e,t,r){let s,n;return e?(e.ownerNode?s=t.getId(e.ownerNode):n=r.getId(e),{styleId:n,id:s}):{}}function lc({mirror:e,stylesheetManager:t},r){var s,n,o;let i=null;i="#document"===r.nodeName?e.getId(r):e.getId(dl.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 cc(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=tc(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=yl(ql(t=>{const r=Date.now()-i;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],i=null}),o),c=ql(yl(ql(e=>{const t=ec(e),{clientX:r,clientY:n}=Rl(e)?e.changedTouches[0]:e;i||(i=bl()),a.push({x:r,y:n,id:s.getId(t),timeOffset:bl()-i}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?_l.Drag:e instanceof MouseEvent?_l.MouseMove:_l.TouchMove)}),n,{trailing:!1})),h=[fl("mousemove",c,r),fl("touchmove",c,r),fl("drag",c,r)];return ql(()=>{h.forEach(e=>e())})}(e),o=rc(e),i=sc(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,s=-1;return fl("resize",ql(yl(ql(()=>{const t=Cl(),n=Il();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=ec(e);const c=e.isTrusted,u=r&&r.tagName;if(r&&"OPTION"===u&&(r=dl.parentElement(r)),!r||!u||nc.indexOf(u)<0||xl(r,s,n,!0))return;if(r.classList.contains(o)||i&&r.matches(i))return;let d=r.value,f=!1;const m=$(r)||"";"radio"===m||"checkbox"===m?f=r.checked:(a[u.toLowerCase()]||a[m])&&(d=X({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=oc.get(t);if(!n||n.text!==s.text||n.isChecked!==s.isChecked){oc.set(t,s);const n=r.getId(t);ql(e)({...s,id:n})}}const d=("last"===c.input?["change"]:["input","change"]).map(e=>fl(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=>wl(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=>yl(ql(n=>{const i=ec(n);if(!i||xl(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=[fl("play",i(Wl.Play),o),fl("pause",i(Wl.Pause),o),fl("seeked",i(Wl.Seeked),o),fl("volumechange",i(Wl.VolumeChange),o),fl("ratechange",i(Wl.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}=ac(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}=ac(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}=ac(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}=ac(n,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:i}),s.apply(n,o)})}));const l={};uc("CSSGroupingRule")?l.CSSGroupingRule=s.CSSGroupingRule:(uc("CSSMediaRule")&&(l.CSSMediaRule=s.CSSMediaRule),uc("CSSConditionRule")&&(l.CSSConditionRule=s.CSSConditionRule),uc("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}=ac(n.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:[...ic(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}=ac(n.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...ic(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=lc(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}=ac(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:ic(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}=ac(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:ic(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=vl(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;xl(i,s,n,!0)||xl(c,s,n,!0)||a.push({start:r.getId(i),startOffset:l,end:r.getId(c),endOffset:h})}o({ranges:a})});return a(),fl("selectionchange",a)}(e),m=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?vl(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(()=>{Ql.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 hc(e){return void 0!==window[e]}function uc(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class pc{constructor(e){R(this,"iframeIdToRemoteIdMap",new WeakMap),R(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 dc{constructor(e){R(this,"iframes",new WeakMap),R(this,"crossOriginIframeMap",new WeakMap),R(this,"crossOriginIframeMirror",new pc(ae)),R(this,"crossOriginIframeStyleMirror"),R(this,"crossOriginIframeRootIdMap",new WeakMap),R(this,"mirror"),R(this,"mutationCb"),R(this,"wrappedEmit"),R(this,"loadListener"),R(this,"stylesheetManager"),R(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new pc(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 Fl.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:Fl.IncrementalSnapshot,data:{source:_l.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Fl.Meta:case Fl.Load:case Fl.DomContentLoaded:return!1;case Fl.Plugin:return t;case Fl.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Fl.IncrementalSnapshot:switch(t.data.source){case _l.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 _l.Drag:case _l.TouchMove:case _l.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case _l.ViewportResize:return!1;case _l.MediaInteraction:case _l.MouseInteraction:case _l.Scroll:case _l.CanvasMutation:case _l.Input:return this.replaceIds(t.data,e,["id"]),t;case _l.StyleSheetRule:case _l.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case _l.Font:return t;case _l.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case _l.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===zl.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class fc{constructor(e){R(this,"shadowDoms",new WeakSet),R(this,"mutationCb"),R(this,"scrollCb"),R(this,"bypassOptions"),R(this,"mirror"),R(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(!V(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=tc({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(sc({...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(dl.host(e))),this.restoreHandlers.push(lc({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(vl(e.prototype,"attachShadow",function(e){return function(s){const n=e.call(this,s),o=dl.shadowRoot(this);return o&&Ll(this)&&r.addShadowRoot(o,t),n}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var mc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gc="undefined"==typeof Uint8Array?[]:new Uint8Array(256),yc=0;yc<64;yc++)gc[mc.charCodeAt(yc)]=yc;const wc=new Map;const vc=(e,t,r)=>{if(!e||!Cc(e,t)&&"object"!=typeof e)return;const s=function(e,t){let r=wc.get(e);return r||(r=new Map,wc.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 bc(e,t,r){if(e instanceof Array)return e.map(e=>bc(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+=mc[r[t]>>2],n+=mc[(3&r[t])<<4|r[t+1]>>4],n+=mc[(15&r[t+1])<<2|r[t+2]>>6],n+=mc[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:[bc(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:[bc(e.data,t,r),e.width,e.height]}}if(Cc(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:vc(e,t,r)}}return e}const Sc=(e,t,r)=>e.map(e=>bc(e,t,r)),Cc=(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 Ic(e,t,r,s){const n=[];try{const o=vl(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(n,...o){if(!xl(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 kc(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=vl(e,l,function(e){return function(...i){const a=e.apply(this,i);if(vc(a,o,this),"tagName"in this.canvas&&!xl(this.canvas,s,n,!0)){const e=Sc(i,o,this),s={type:t,property:l,args:e};r(this.canvas,s)}return a}});i.push(a)}catch{const s=wl(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});i.push(s)}return i}const xc="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Oc="undefined"!=typeof window&&window.Blob&&new Blob([(Ec=xc,Uint8Array.from(atob(Ec),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});var Ec;function Rc(e){let t;try{if(t=Oc&&(window.URL||window.webkitURL).createObjectURL(Oc),!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,"+xc,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Mc{constructor(e){R(this,"pendingCanvasMutations",new Map),R(this,"rafStamps",{latestId:0,invokeId:null}),R(this,"mirror"),R(this,"mutationCb"),R(this,"resetObservers"),R(this,"frozen",!1),R(this,"locked",!1),R(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=Ic(t,r,s,!0),i=new Map,a=new Rc;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:jl["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=>{xl(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=Ic(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=vl(t.CanvasRenderingContext2D.prototype,i,function(n){return function(...o){return xl(this.canvas,r,s,!0)||setTimeout(()=>{const r=Sc(o,t,this);e(this.canvas,{type:jl["2D"],property:i,args:r})},0),n.apply(this,o)}});n.push(o)}catch{const r=wl(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:jl["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(...kc(t.WebGLRenderingContext.prototype,jl.WebGL,e,r,s,t)),void 0!==t.WebGL2RenderingContext&&n.push(...kc(t.WebGL2RenderingContext.prototype,jl.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 Ac{constructor(e){R(this,"trackedLinkElements",new WeakSet),R(this,"mutationCb"),R(this,"adoptedStyleSheetCb"),R(this,"styleMirror",new Nl),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:Z(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 Tc{constructor(){R(this,"nodeMap",new WeakMap),R(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 Nc,Pc,Dc,Lc=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(O=e.contentWindow)?void 0:O.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const Fc=new Y;function _c(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;Kl=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),Fc.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};Nc=(e,n)=>{var o;const i=e;if(i.timestamp=bl(),!(null==(o=Ql[0])?void 0:o.isFrozen())||i.type===Fl.FullSnapshot||i.type===Fl.IncrementalSnapshot&&i.data.source===_l.Mutation||Ql.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===Fl.FullSnapshot)F=i,_=0;else if(i.type===Fl.IncrementalSnapshot){if(i.data.source===_l.Mutation&&i.data.isAttachIframe)return;_++;const e=s&&_>=s,t=r&&i.timestamp-F.timestamp>r;(e||t)&&Pc(!0)}};const B=e=>{Nc({type:Fl.IncrementalSnapshot,data:{source:_l.Mutation,...e}})},j=e=>Nc({type:Fl.IncrementalSnapshot,data:{source:_l.Scroll,...e}}),W=e=>Nc({type:Fl.IncrementalSnapshot,data:{source:_l.CanvasMutation,...e}}),z=new Ac({mutationCb:B,adoptedStyleSheetCb:e=>Nc({type:Fl.IncrementalSnapshot,data:{source:_l.AdoptedStyleSheet,...e}})}),V=new dc({mirror:Fc,mutationCb:B,stylesheetManager:z,recordCrossOriginIframes:I,wrappedEmit:Nc});for(const e of R||[])e.getMirror&&e.getMirror({nodeMirror:Fc,crossOriginIframeMirror:V.crossOriginIframeMirror,crossOriginIframeStyleMirror:V.crossOriginIframeStyleMirror});const G=new Tc;Dc=new Mc({recordCanvas:C,mutationCb:W,win:window,blockClass:n,blockSelector:o,mirror:Fc,sampling:w.canvas,dataURLOptions:v});const Z=new fc({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:Dc,keepIframeSrcFn:M,processedNodeManager:G},mirror:Fc});Pc=(e=!1)=>{if(!S)return;Nc({type:Fl.Meta,data:{href:window.location.href,width:Il(),height:Cl()}},e),z.reset(),Z.init(),Ql.forEach(e=>e.lock());const t=function(e,t){const{mirror:r=new Y,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 Ce(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:Fc,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=>{Ml(e,Fc)&&V.addIframe(e),Al(e,Fc)&&z.trackLinkElement(e),Tl(e)&&Z.addShadowRoot(dl.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");Nc({type:Fl.FullSnapshot,data:{node:t,initialOffset:Sl(window)}},e),Ql.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,Fc.getId(document))};try{const e=[],t=e=>{var t;return ql(cc)({mutationCb:B,mousemoveCb:(e,t)=>Nc({type:Fl.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Nc({type:Fl.IncrementalSnapshot,data:{source:_l.MouseInteraction,...e}}),scrollCb:j,viewportResizeCb:e=>Nc({type:Fl.IncrementalSnapshot,data:{source:_l.ViewportResize,...e}}),inputCb:e=>Nc({type:Fl.IncrementalSnapshot,data:{source:_l.Input,...e}}),mediaInteractionCb:e=>Nc({type:Fl.IncrementalSnapshot,data:{source:_l.MediaInteraction,...e}}),styleSheetRuleCb:e=>Nc({type:Fl.IncrementalSnapshot,data:{source:_l.StyleSheetRule,...e}}),styleDeclarationCb:e=>Nc({type:Fl.IncrementalSnapshot,data:{source:_l.StyleDeclaration,...e}}),canvasMutationCb:W,fontCb:e=>Nc({type:Fl.IncrementalSnapshot,data:{source:_l.Font,...e}}),selectionCb:e=>{Nc({type:Fl.IncrementalSnapshot,data:{source:_l.Selection,...e}})},customElementCb:e=>{Nc({type:Fl.IncrementalSnapshot,data:{source:_l.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:Fc,iframeManager:V,stylesheetManager:z,shadowDomManager:Z,processedNodeManager:G,canvasManager:Dc,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=>Nc({type:Fl.Plugin,data:{plugin:e.name,payload:t}})})))||[]},g)};V.addLoadListener(r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}});const r=()=>{Pc(),e.push(t(document)),Lc=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(fl("DOMContentLoaded",()=>{Nc({type:Fl.DomContentLoaded,data:{}}),"DOMContentLoaded"===k&&r()})),e.push(fl("load",()=>{Nc({type:Fl.Load,data:{}}),"load"===k&&r()},window))),()=>{e.forEach(e=>e()),G.destroy(),Lc=!1,Kl=void 0}}catch(e){console.warn(e)}}var Uc,Bc,jc,Wc;_c.addCustomEvent=(e,t)=>{if(!Lc)throw new Error("please add custom event after start recording");Nc({type:Fl.Custom,data:{tag:e,payload:t}})},_c.freezePage=()=>{Ql.forEach(e=>e.freeze())},_c.takeFullSnapshot=e=>{if(!Lc)throw new Error("please take full snapshot after start recording");Pc(e)},_c.mirror=Fc,(Bc=Uc||(Uc={}))[Bc.NotStarted=0]="NotStarted",Bc[Bc.Running=1]="Running",Bc[Bc.Stopped=2]="Stopped",e.SessionEventType=void 0,(jc=e.SessionEventType||(e.SessionEventType={})).CONSOLE="CONSOLE",jc.ERROR="ERROR",jc.NETWORK="NETWORK",jc.CUSTOM="CUSTOM",jc.PERFORMANCE="PERFORMANCE",jc.PAGE_VIEW="PAGE_VIEW",e.ConsoleLevel=void 0,(Wc=e.ConsoleLevel||(e.ConsoleLevel={})).LOG="log",Wc.INFO="info",Wc.WARN="warn",Wc.ERROR="error",Wc.DEBUG="debug";class zc{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=_c({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 Vc="undefined"!=typeof window;e.AuthenticationError=s,e.AutoPageViewPlugin=x,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),Vc&&this.initBrowserPlugins()}get events(){return this._events}get contacts(){return this._contacts}get deals(){return this._deals}get visitorId(){return this._visitorId}get deviceInfo(){return this._deviceInfo}get sessionReplay(){return this._sessionReplay}initBrowserPlugins(){this.config.persistVisitorId&&(this._visitorId=new v(this.config),this.plugins.push(this._visitorId)),this.config.autoDeviceInfo&&(this._deviceInfo=new k,this.plugins.push(this._deviceInfo)),this.config.autoPageView&&(this._autoPageView=new x(this),this.plugins.push(this._autoPageView)),!1!==this.config.sessionReplay?.enabled&&(this._sessionReplay=new zc(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=k,e.EventsResource=p,e.NetworkError=l,e.RateLimitError=i,e.ResourceNotFoundError=n,e.ServerError=a,e.SessionReplayPlugin=zc,e.VERSION="1.1.0",e.ValidationError=o,e.VisitorIdPlugin=v,e.detectBrowser=S,e.detectDeviceType=b,e.detectOS=C,e.generateUUID=w,e.getDeviceInfo=I,e.getLocalStorageItem=g,e.isLocalStorageAvailable=m,e.removeLocalStorageItem=function(e){if(!m())return!1;try{return window.localStorage.removeItem(e),!0}catch{return!1}},e.setLocalStorageItem=y});
2
2
  //# sourceMappingURL=browser.js.map