UNPKG

@amplitude/rrweb

Version:
37 lines (36 loc) 263 kB
(function (g, f) { if ("object" == typeof exports && "object" == typeof module) { module.exports = f(); } else if ("function" == typeof define && define.amd) { define("rrweb", [], f); } else if ("object" == typeof exports) { exports["rrweb"] = f(); } else { g["rrweb"] = f(); } }(this, () => { var exports = {}; var module = { exports }; "use strict";var qa=Object.defineProperty,el=Object.defineProperties;var tl=Object.getOwnPropertyDescriptors;var Dt=Object.getOwnPropertySymbols;var ki=Object.prototype.hasOwnProperty,$i=Object.prototype.propertyIsEnumerable;var _i=(s,e,t)=>e in s?qa(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,M=(s,e)=>{for(var t in e||(e={}))ki.call(e,t)&&_i(s,t,e[t]);if(Dt)for(var t of Dt(e))$i.call(e,t)&&_i(s,t,e[t]);return s},K=(s,e)=>el(s,tl(e));var Be=(s,e)=>{var t={};for(var r in s)ki.call(s,r)&&e.indexOf(r)<0&&(t[r]=s[r]);if(s!=null&&Dt)for(var r of Dt(s))e.indexOf(r)<0&&$i.call(s,r)&&(t[r]=s[r]);return t};var rl=Object.defineProperty,sl=(s,e,t)=>e in s?rl(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,w=(s,e,t)=>sl(s,typeof e!="symbol"?e+"":e,t),Pi;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var il=Object.defineProperty,nl=(s,e,t)=>e in s?il(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,Li=(s,e,t)=>nl(s,typeof e!="symbol"?e+"":e,t),R=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(R||{});const Fi={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Bi={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Tt={};function ol(s){var e,t;const r=(t=(e=globalThis==null?void 0:globalThis.Zone)==null?void 0:e.__symbol__)==null?void 0:t.call(e,s);if(r&&globalThis[r])return globalThis[r]}function Vs(s){if(Tt[s])return Tt[s];const e=ol(s)||globalThis[s],t=e.prototype,r=s in Fi?Fi[s]:void 0,i=!!(r&&r.every(a=>{var l,u;return!!((u=(l=Object.getOwnPropertyDescriptor(t,a))==null?void 0:l.get)!=null&&u.toString().includes("[native code]"))})),o=s in Bi?Bi[s]:void 0,n=!!(o&&o.every(a=>{var l;return typeof t[a]=="function"&&((l=t[a])==null?void 0:l.toString().includes("[native code]"))}));if(i&&n)return Tt[s]=e.prototype,e.prototype;try{const a=document.createElement("iframe");document.body.appendChild(a);const l=a.contentWindow;if(!l)return e.prototype;const u=l[s].prototype;return document.body.removeChild(a),u?Tt[s]=u:t}catch(a){return t}}const jr={};function Ae(s,e,t){var r;const i=`${s}.${String(t)}`;if(jr[i])return jr[i].call(e);const o=Vs(s),n=(r=Object.getOwnPropertyDescriptor(o,t))==null?void 0:r.get;return n?(jr[i]=n,n.call(e)):e[t]}const Yr={};function Jn(s,e,t){const r=`${s}.${String(t)}`;if(Yr[r])return Yr[r].bind(e);const o=Vs(s)[t];return typeof o!="function"?e[t]:(Yr[r]=o,o.bind(e))}function al(s){return Ae("Node",s,"childNodes")}function ll(s){return Ae("Node",s,"parentNode")}function ul(s){return Ae("Node",s,"parentElement")}function cl(s){return Ae("Node",s,"textContent")}function hl(s,e){return Jn("Node",s,"contains")(e)}function fl(s){return Jn("Node",s,"getRootNode")()}function dl(s){return!s||!("host"in s)?null:Ae("ShadowRoot",s,"host")}function pl(s){return s.styleSheets}function ml(s){return!s||!("shadowRoot"in s)?null:Ae("Element",s,"shadowRoot")}function gl(s,e){return Ae("Element",s,"querySelector")(e)}function yl(s,e){return Ae("Element",s,"querySelectorAll")(e)}function wl(){return Vs("MutationObserver").constructor}const ee={childNodes:al,parentNode:ll,parentElement:ul,textContent:cl,contains:hl,getRootNode:fl,host:dl,styleSheets:pl,shadowRoot:ml,querySelector:gl,querySelectorAll:yl,mutationObserver:wl};function Gs(s){return s.nodeType===s.ELEMENT_NODE}function ut(s){const e=s&&"host"in s&&"mode"in s&&ee.host(s)||null;return!!(e&&"shadowRoot"in e&&ee.shadowRoot(e)===s)}function ct(s){return Object.prototype.toString.call(s)==="[object ShadowRoot]"}function bl(s){return s.includes(" background-clip: text;")&&!s.includes(" -webkit-background-clip: text;")&&(s=s.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),s}function Sl(s){const{cssText:e}=s;if(e.split('"').length<3)return e;const t=["@import",`url(${JSON.stringify(s.href)})`];return s.layerName===""?t.push("layer"):s.layerName&&t.push(`layer(${s.layerName})`),s.supportsText&&t.push(`supports(${s.supportsText})`),s.media.length&&t.push(s.media.mediaText),t.join(" ")+";"}function os(s){try{const e=s.rules||s.cssRules;if(!e)return null;let t=s.href;!t&&s.ownerNode&&s.ownerNode.ownerDocument&&(t=s.ownerNode.ownerDocument.location.href);const r=Array.from(e,i=>Kn(i,t)).join("");return bl(r)}catch(e){return null}}function Kn(s,e){if(Cl(s)){let t;try{t=os(s.styleSheet)||Sl(s)}catch(r){t=s.cssText}return s.styleSheet.href?dr(t,s.styleSheet.href):t}else{let t=s.cssText;return El(s)&&s.selectorText.includes(":")&&(t=vl(t)),e?dr(t,e):t}}function vl(s){const e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return s.replace(e,"$1\\$2")}function Cl(s){return"styleSheet"in s}function El(s){return"selectorText"in s}class js{constructor(){Li(this,"idNodeMap",new Map),Li(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;const r=(t=this.getMeta(e))==null?void 0:t.id;return r!=null?r:-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(r=>this.removeNodeFromMap(r))}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 i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Qn(){return new js}function hr({element:s,maskInputOptions:e,tagName:t,type:r,value:i,maskInputFn:o}){let n=i||"";const a=r&&Ne(r);return(e[t.toLowerCase()]||a&&e[a])&&(o?n=o(n,s):n="*".repeat(n.length)),n}function Ne(s){return s.toLowerCase()}const Ui="__rrweb_original__";function Il(s){const e=s.getContext("2d");if(!e)return!0;const t=50;for(let r=0;r<s.width;r+=t)for(let i=0;i<s.height;i+=t){const o=e.getImageData,n=Ui in o?o[Ui]:o;if(new Uint32Array(n.call(e,r,i,Math.min(t,s.width-r),Math.min(t,s.height-i)).data.buffer).some(l=>l!==0))return!1}return!0}function xl(s,e){return!s||!e||s.type!==e.type?!1:s.type===R.Document?s.compatMode===e.compatMode:s.type===R.DocumentType?s.name===e.name&&s.publicId===e.publicId&&s.systemId===e.systemId:s.type===R.Comment||s.type===R.Text||s.type===R.CDATA?s.textContent===e.textContent:s.type===R.Element?s.tagName===e.tagName&&JSON.stringify(s.attributes)===JSON.stringify(e.attributes)&&s.isSVG===e.isSVG&&s.needBlock===e.needBlock:!1}function fr(s){const e=s.type;return s.hasAttribute("data-rr-is-password")?"password":e?Ne(e):null}function qn(s,e){var o;let t;try{t=new URL(s,e!=null?e:window.location.href)}catch(n){return null}const r=/\.([0-9a-z]+)(?:$)/i,i=t.pathname.match(r);return(o=i==null?void 0:i[1])!=null?o:null}function Ml(s){let e="";return s.indexOf("//")>-1?e=s.split("/").slice(0,3).join("/"):e=s.split("/")[0],e=e.split("?")[0],e}const Rl=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Nl=/^(?:[a-z+]+:)?\/\//i,Al=/^www\..*/i,Ol=/^(data:)([^,]*),(.*)/i;function dr(s,e){return(s||"").replace(Rl,(t,r,i,o,n,a)=>{const l=i||n||a,u=r||o||"";if(!l)return t;if(Nl.test(l)||Al.test(l))return`url(${u}${l}${u})`;if(Ol.test(l))return`url(${u}${l}${u})`;if(l[0]==="/")return`url(${u}${Ml(e)+l}${u})`;const c=e.split("/"),h=l.split("/");c.pop();for(const f of h)f!=="."&&(f===".."?c.pop():c.push(f));return`url(${u}${c.join("/")}${u})`})}function _t(s,e=!1){return e?s.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):s.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function Dl(s,e,t=!1){const r=Array.from(e.childNodes),i=[];let o=0;if(r.length>1&&s&&typeof s=="string"){let n=_t(s,t);const a=n.length/s.length;for(let l=1;l<r.length;l++)if(r[l].textContent&&typeof r[l].textContent=="string"){const u=_t(r[l].textContent,t),c=100;let h=3;for(;h<u.length&&(u[h].match(/[a-zA-Z0-9]/)||u.indexOf(u.substring(0,h),1)!==-1);h++);for(;h<u.length;h++){let f=u.substring(0,h),p=n.split(f),m=-1;if(p.length===2)m=p[0].length;else if(p.length>2&&p[0]===""&&r[l-1].textContent!=="")m=n.indexOf(f,1);else if(p.length===1){if(f=f.substring(0,f.length-1),p=n.split(f),p.length<=1)return i.push(s),i;h=c+1}else h===u.length-1&&(m=n.indexOf(f));if(p.length>=2&&h>c){const y=r[l-1].textContent;if(y&&typeof y=="string"){const d=_t(y).length;m=n.indexOf(f,d)}m===-1&&(m=p[0].length)}if(m!==-1){let y=Math.floor(m/a);for(;y>0&&y<s.length;){if(o+=1,o>50*r.length)return i.push(s),i;const d=_t(s.substring(0,y),t);if(d.length===m){i.push(s.substring(0,y)),s=s.substring(y),n=n.substring(m);break}else d.length<m?y+=Math.max(1,Math.floor((m-d.length)/a)):y-=Math.max(1,Math.floor((d.length-m)*a))}break}}}}return i.push(s),i}function Tl(s,e){return Dl(s,e).join("/* rr_split */")}const _l="lightgrey";let kl=1;const $l=new RegExp("[^a-z0-9-_:]"),dt=-2;function eo(){return kl++}function Pl(s){if(s instanceof HTMLFormElement)return"form";const e=Ne(s.tagName);return $l.test(e)?"div":e}let Ue,Wi;const Ll=/^[^ \t\n\r\u000c]+/,Fl=/^[, \t\n\r\u000c]+/;function Bl(s,e){if(e.trim()==="")return e;let t=0;function r(o){let n;const a=o.exec(e.substring(t));return a?(n=a[0],t+=n.length,n):""}const i=[];for(;r(Fl),!(t>=e.length);){let o=r(Ll);if(o.slice(-1)===",")o=Ge(s,o.substring(0,o.length-1)),i.push(o);else{let n="";o=Ge(s,o);let a=!1;for(;;){const l=e.charAt(t);if(l===""){i.push((o+n).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){t+=1,i.push((o+n).trim());break}else l==="("&&(a=!0);n+=l,t+=1}}}return i.join(", ")}const zi=new WeakMap;function Ge(s,e){return!e||e.trim()===""?e:Ys(s,e)}function Ul(s){return!!(s.tagName==="svg"||s.ownerSVGElement)}function Ys(s,e){let t=zi.get(s);if(t||(t=s.createElement("a"),zi.set(s,t)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return t.setAttribute("href",e),t.href}function to(s,e,t,r){return r&&(t==="src"||t==="href"&&!(e==="use"&&r[0]==="#")||t==="xlink:href"&&r[0]!=="#"||t==="background"&&(e==="table"||e==="td"||e==="th")?Ge(s,r):t==="srcset"?Bl(s,r):t==="style"?dr(r,Ys(s)):e==="object"&&t==="data"?Ge(s,r):r)}function ro(s,e,t){return(s==="video"||s==="audio")&&e==="autoplay"}function Wl(s,e,t){try{if(typeof e=="string"){if(s.classList.contains(e))return!0}else for(let r=s.classList.length;r--;){const i=s.classList[r];if(e.test(i))return!0}if(t)return s.matches(t)}catch(r){}return!1}function pr(s,e,t){if(!s)return!1;if(s.nodeType!==s.ELEMENT_NODE)return t?pr(ee.parentNode(s),e,t):!1;for(let r=s.classList.length;r--;){const i=s.classList[r];if(e.test(i))return!0}return t?pr(ee.parentNode(s),e,t):!1}function so(s,e,t,r){let i;if(Gs(s)){if(i=s,!ee.childNodes(i).length)return!1}else{if(ee.parentElement(s)===null)return!1;i=ee.parentElement(s)}try{if(typeof e=="string"){if(r){if(i.closest(`.${e}`))return!0}else if(i.classList.contains(e))return!0}else if(pr(i,e,r))return!0;if(t){if(r){if(i.closest(t))return!0}else if(i.matches(t))return!0}}catch(o){}return!1}function zl(s,e,t){const r=s.contentWindow;if(!r)return;let i=!1,o;try{o=r.document.readyState}catch(a){return}if(o!=="complete"){const a=setTimeout(()=>{i||(e(),i=!0)},t);s.addEventListener("load",()=>{clearTimeout(a),i=!0,e()});return}const n="about:blank";if(r.location.href!==n||s.src===n||s.src==="")return setTimeout(e,0),s.addEventListener("load",e);s.addEventListener("load",e)}function Vl(s,e,t){let r=!1,i;try{i=s.sheet}catch(n){return}if(i)return;const o=setTimeout(()=>{r||(e(),r=!0)},t);s.addEventListener("load",()=>{clearTimeout(o),r=!0,e()})}function Gl(s,e){const{doc:t,mirror:r,blockClass:i,blockSelector:o,needsMask:n,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,dataURLOptions:h={},inlineImages:f,recordCanvas:p,keepIframeSrcFn:m,newlyAddedElement:y=!1,cssCaptured:d=!1,applyBackgroundColorToBlockedElements:g=!1}=e,b=jl(t,r);switch(s.nodeType){case s.DOCUMENT_NODE:return s.compatMode!=="CSS1Compat"?{type:R.Document,childNodes:[],compatMode:s.compatMode}:{type:R.Document,childNodes:[]};case s.DOCUMENT_TYPE_NODE:return{type:R.DocumentType,name:s.name,publicId:s.publicId,systemId:s.systemId,rootId:b};case s.ELEMENT_NODE:return Hl(s,{doc:t,blockClass:i,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,dataURLOptions:h,inlineImages:f,recordCanvas:p,keepIframeSrcFn:m,newlyAddedElement:y,rootId:b,applyBackgroundColorToBlockedElements:g});case s.TEXT_NODE:return Yl(s,{doc:t,needsMask:n,maskTextFn:u,rootId:b,cssCaptured:d});case s.CDATA_SECTION_NODE:return{type:R.CDATA,textContent:"",rootId:b};case s.COMMENT_NODE:return{type:R.Comment,textContent:ee.textContent(s)||"",rootId:b};default:return!1}}function jl(s,e){if(!e.hasNode(s))return;const t=e.getId(s);return t===1?void 0:t}function Yl(s,e){const{needsMask:t,maskTextFn:r,rootId:i,cssCaptured:o}=e,n=ee.parentNode(s),a=n&&n.tagName;let l="";const u=a==="STYLE"?!0:void 0,c=a==="SCRIPT"?!0:void 0;return c?l="SCRIPT_PLACEHOLDER":o||(l=ee.textContent(s),u&&l&&(l=dr(l,Ys(e.doc)))),!u&&!c&&l&&t&&(l=r?r(l,ee.parentElement(s)):l.replace(/[\S]/g,"*")),{type:R.Text,textContent:l||"",rootId:i}}function Hl(s,e){const{doc:t,blockClass:r,blockSelector:i,inlineStylesheet:o,maskInputOptions:n={},maskInputFn:a,dataURLOptions:l={},inlineImages:u,recordCanvas:c,keepIframeSrcFn:h,newlyAddedElement:f=!1,rootId:p,applyBackgroundColorToBlockedElements:m=!1}=e,y=Wl(s,r,i),d=Pl(s);let g={};const b=s.attributes.length;for(let S=0;S<b;S++){const I=s.attributes[S];ro(d,I.name,I.value)||(g[I.name]=to(t,d,Ne(I.name),I.value))}if(d==="link"&&o){const S=Array.from(t.styleSheets).find(N=>N.href===s.href);let I=null;S&&(I=os(S)),I&&(delete g.rel,delete g.href,g._cssText=I)}if(d==="style"&&s.sheet){let S=os(s.sheet);S&&(s.childNodes.length>1&&(S=Tl(S,s)),g._cssText=S)}if(d==="input"||d==="textarea"||d==="select"){const S=s.value,I=s.checked;g.type!=="radio"&&g.type!=="checkbox"&&g.type!=="submit"&&g.type!=="button"&&S?g.value=hr({element:s,type:fr(s),tagName:d,value:S,maskInputOptions:n,maskInputFn:a}):I&&(g.checked=I)}if(d==="option"&&(s.selected&&!n.select?g.selected=!0:delete g.selected),d==="dialog"&&s.open&&(g.rr_open_mode=s.matches("dialog:modal")?"modal":"non-modal"),d==="canvas"&&c){if(s.__context==="2d")Il(s)||(g.rr_dataURL=s.toDataURL(l.type,l.quality));else if(!("__context"in s)){const S=s.toDataURL(l.type,l.quality),I=t.createElement("canvas");I.width=s.width,I.height=s.height;const N=I.toDataURL(l.type,l.quality);S!==N&&(g.rr_dataURL=S)}}if(d==="img"&&u){Ue||(Ue=t.createElement("canvas"),Wi=Ue.getContext("2d"));const S=s,I=S.currentSrc||S.getAttribute("src")||"<unknown-src>",N=S.crossOrigin,F=()=>{S.removeEventListener("load",F);try{Ue.width=S.naturalWidth,Ue.height=S.naturalHeight,Wi.drawImage(S,0,0),g.rr_dataURL=Ue.toDataURL(l.type,l.quality)}catch(P){if(S.crossOrigin!=="anonymous"){S.crossOrigin="anonymous",S.complete&&S.naturalWidth!==0?F():S.addEventListener("load",F);return}else console.warn(`Cannot inline img src=${I}! Error: ${P}`)}S.crossOrigin==="anonymous"&&(N?g.crossOrigin=N:S.removeAttribute("crossorigin"))};S.complete&&S.naturalWidth!==0?F():S.addEventListener("load",F)}if(d==="audio"||d==="video"){const S=g;S.rr_mediaState=s.paused?"paused":"played",S.rr_mediaCurrentTime=s.currentTime,S.rr_mediaPlaybackRate=s.playbackRate,S.rr_mediaMuted=s.muted,S.rr_mediaLoop=s.loop,S.rr_mediaVolume=s.volume}if(f||(s.scrollLeft&&(g.rr_scrollLeft=s.scrollLeft),s.scrollTop&&(g.rr_scrollTop=s.scrollTop)),y){const{width:S,height:I}=s.getBoundingClientRect();g=M({class:g.class,rr_width:`${S}px`,rr_height:`${I}px`},m?{rr_background_color:_l}:{})}d==="iframe"&&!h(g.src)&&(s.contentDocument||(g.rr_src=g.src),delete g.src);let v;try{customElements.get(d)&&(v=!0)}catch(S){}return{type:R.Element,tagName:d,attributes:g,childNodes:[],isSVG:Ul(s)||void 0,needBlock:y,rootId:p,isCustom:v}}function z(s){return s==null?"":s.toLowerCase()}function Zl(s,e){if(e.comment&&s.type===R.Comment)return!0;if(s.type===R.Element){if(e.script&&(s.tagName==="script"||s.tagName==="link"&&(s.attributes.rel==="preload"||s.attributes.rel==="modulepreload")&&s.attributes.as==="script"||s.tagName==="link"&&s.attributes.rel==="prefetch"&&typeof s.attributes.href=="string"&&qn(s.attributes.href)==="js"))return!0;if(e.headFavicon&&(s.tagName==="link"&&s.attributes.rel==="shortcut icon"||s.tagName==="meta"&&(z(s.attributes.name).match(/^msapplication-tile(image|color)$/)||z(s.attributes.name)==="application-name"||z(s.attributes.rel)==="icon"||z(s.attributes.rel)==="apple-touch-icon"||z(s.attributes.rel)==="shortcut icon")))return!0;if(s.tagName==="meta"){if(e.headMetaDescKeywords&&z(s.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(z(s.attributes.property).match(/^(og|twitter|fb):/)||z(s.attributes.name).match(/^(og|twitter):/)||z(s.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(z(s.attributes.name)==="robots"||z(s.attributes.name)==="googlebot"||z(s.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&s.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(z(s.attributes.name)==="author"||z(s.attributes.name)==="generator"||z(s.attributes.name)==="framework"||z(s.attributes.name)==="publisher"||z(s.attributes.name)==="progid"||z(s.attributes.property).match(/^article:/)||z(s.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(z(s.attributes.name)==="google-site-verification"||z(s.attributes.name)==="yandex-verification"||z(s.attributes.name)==="csrf-token"||z(s.attributes.name)==="p:domain_verify"||z(s.attributes.name)==="verify-v1"||z(s.attributes.name)==="verification"||z(s.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function je(s,e){const{doc:t,mirror:r,blockClass:i,blockSelector:o,maskTextClass:n,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:h,maskInputFn:f,slimDOMOptions:p,dataURLOptions:m={},inlineImages:y=!1,recordCanvas:d=!1,onSerialize:g,onIframeLoad:b,iframeLoadTimeout:v=5e3,onStylesheetLoad:S,stylesheetLoadTimeout:I=5e3,keepIframeSrcFn:N=()=>!1,newlyAddedElement:F=!1,cssCaptured:P=!1,applyBackgroundColorToBlockedElements:Q=!1}=e;let{needsMask:J}=e,{preserveWhiteSpace:se=!0}=e;J||(J=so(s,n,a,J===void 0));const ie=Gl(s,{doc:t,mirror:r,blockClass:i,blockSelector:o,needsMask:J,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:f,dataURLOptions:m,inlineImages:y,recordCanvas:d,keepIframeSrcFn:N,newlyAddedElement:F,cssCaptured:P,applyBackgroundColorToBlockedElements:Q});if(!ie)return console.warn(s,"not serialized"),null;let ae;r.hasNode(s)?ae=r.getId(s):Zl(ie,p)||!se&&ie.type===R.Text&&!ie.textContent.replace(/^\s+|\s+$/gm,"").length?ae=dt:ae=eo();const k=Object.assign(ie,{id:ae});if(r.add(s,k),ae===dt)return null;g&&g(s);let Te=!l;if(k.type===R.Element){Te=Te&&!k.needBlock,delete k.needBlock;const A=ee.shadowRoot(s);A&&ct(A)&&(k.isShadowHost=!0)}if((k.type===R.Document||k.type===R.Element)&&Te){p.headWhitespace&&k.type===R.Element&&k.tagName==="head"&&(se=!1);const A={doc:t,mirror:r,blockClass:i,blockSelector:o,needsMask:J,maskTextClass:n,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:f,slimDOMOptions:p,dataURLOptions:m,inlineImages:y,recordCanvas:d,preserveWhiteSpace:se,onSerialize:g,onIframeLoad:b,iframeLoadTimeout:v,onStylesheetLoad:S,stylesheetLoadTimeout:I,keepIframeSrcFn:N,cssCaptured:!1,applyBackgroundColorToBlockedElements:Q};if(!(k.type===R.Element&&k.tagName==="textarea"&&k.attributes.value!==void 0)){k.type===R.Element&&k.attributes._cssText!==void 0&&typeof k.attributes._cssText=="string"&&(A.cssCaptured=!0);for(const de of Array.from(ee.childNodes(s))){const ne=je(de,A);ne&&k.childNodes.push(ne)}}let q=null;if(Gs(s)&&(q=ee.shadowRoot(s)))for(const de of Array.from(ee.childNodes(q))){const ne=je(de,A);ne&&(ct(q)&&(ne.isShadow=!0),k.childNodes.push(ne))}}const Ee=ee.parentNode(s);return Ee&&ut(Ee)&&ct(Ee)&&(k.isShadow=!0),k.type===R.Element&&k.tagName==="iframe"&&zl(s,()=>{const A=s.contentDocument;if(A&&b){const q=je(A,{doc:A,mirror:r,blockClass:i,blockSelector:o,needsMask:J,maskTextClass:n,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:f,slimDOMOptions:p,dataURLOptions:m,inlineImages:y,recordCanvas:d,preserveWhiteSpace:se,onSerialize:g,onIframeLoad:b,iframeLoadTimeout:v,onStylesheetLoad:S,stylesheetLoadTimeout:I,keepIframeSrcFn:N});q&&b(s,q)}},v),k.type===R.Element&&k.tagName==="link"&&typeof k.attributes.rel=="string"&&(k.attributes.rel==="stylesheet"||k.attributes.rel==="preload"&&typeof k.attributes.href=="string"&&qn(k.attributes.href)==="css")&&Vl(s,()=>{if(S){const A=je(s,{doc:t,mirror:r,blockClass:i,blockSelector:o,needsMask:J,maskTextClass:n,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:f,slimDOMOptions:p,dataURLOptions:m,inlineImages:y,recordCanvas:d,preserveWhiteSpace:se,onSerialize:g,onIframeLoad:b,iframeLoadTimeout:v,onStylesheetLoad:S,stylesheetLoadTimeout:I,keepIframeSrcFn:N});A&&S(s,A)}},I),k}function Xl(s,e){const{mirror:t=new js,blockClass:r="rr-block",blockSelector:i=null,maskTextClass:o="rr-mask",maskTextSelector:n=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:h,maskInputFn:f,slimDOM:p=!1,dataURLOptions:m,preserveWhiteSpace:y,onSerialize:d,onIframeLoad:g,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:S,keepIframeSrcFn:I=()=>!1,applyBackgroundColorToBlockedElements:N=!1}=e||{};return je(s,{doc:s,mirror:t,blockClass:r,blockSelector:i,maskTextClass:o,maskTextSelector:n,skipChild:!1,inlineStylesheet:a,maskInputOptions:c===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:c===!1?{password:!0}:c,maskTextFn:h,maskInputFn:f,slimDOMOptions:p===!0||p==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:p==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:p===!1?{}:p,dataURLOptions:m,inlineImages:l,recordCanvas:u,preserveWhiteSpace:y,onSerialize:d,onIframeLoad:g,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:S,keepIframeSrcFn:I,newlyAddedElement:!1,applyBackgroundColorToBlockedElements:N})}const Jl=/(max|min)-device-(width|height)/,Vi=new RegExp(Jl.source,"g"),Kl={postcssPlugin:"postcss-custom-selectors",prepare(){return{postcssPlugin:"postcss-custom-selectors",AtRule:function(s){s.params.match(Vi)&&(s.params=s.params.replace(Vi,"$1-$2"))}}}},Ql={postcssPlugin:"postcss-hover-classes",prepare:function(){const s=[];return{Rule:function(e){s.indexOf(e)===-1&&(s.push(e),e.selectors.forEach(function(t){t.includes(":hover")&&(e.selector+=`, `+t.replace(/:hover/g,".\\:hover"))}))}}}};function ql(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function eu(s){if(s.__esModule)return s;var e=s.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(r){var i=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return s[r]}})}),t}var Hs={exports:{}},V=String,io=function(){return{isColorSupported:!1,reset:V,bold:V,dim:V,italic:V,underline:V,inverse:V,hidden:V,strikethrough:V,black:V,red:V,green:V,yellow:V,blue:V,magenta:V,cyan:V,white:V,gray:V,bgBlack:V,bgRed:V,bgGreen:V,bgYellow:V,bgBlue:V,bgMagenta:V,bgCyan:V,bgWhite:V}};Hs.exports=io();Hs.exports.createColors=io;var tu=Hs.exports;const ru={},su=Object.freeze(Object.defineProperty({__proto__:null,default:ru},Symbol.toStringTag,{value:"Module"})),ce=eu(su);let Gi=tu,ji=ce,as=class no extends Error{constructor(e,t,r,i,o,n){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),i&&(this.source=i),n&&(this.plugin=n),typeof t!="undefined"&&typeof r!="undefined"&&(typeof t=="number"?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,no)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line!="undefined"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;e==null&&(e=Gi.isColorSupported),ji&&e&&(t=ji(t));let r=t.split(/\r?\n/),i=Math.max(this.line-3,0),o=Math.min(this.line+2,r.length),n=String(o).length,a,l;if(e){let{bold:u,gray:c,red:h}=Gi.createColors(!0);a=f=>u(h(f)),l=f=>c(f)}else a=l=u=>u;return r.slice(i,o).map((u,c)=>{let h=i+1+c,f=" "+(" "+h).slice(-n)+" | ";if(h===this.line){let p=l(f.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(f)+u+` `+p+a("^")}return" "+l(f)+u}).join(` `)}toString(){let e=this.showSourceCode();return e&&(e=` `+e+` `),this.name+": "+this.message+e}};var Zs=as;as.default=as;var Et={};Et.isClean=Symbol("isClean");Et.my=Symbol("my");const Yi={after:` `,beforeClose:` `,beforeComment:` `,beforeDecl:` `,beforeOpen:" ",beforeRule:` `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function iu(s){return s[0].toUpperCase()+s.slice(1)}let ls=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,i=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName!="undefined"?r+=e.raws.afterName:i&&(r+=" "),e.nodes)this.block(e,r+i);else{let o=(e.raws.between||"")+(t?";":"");this.builder(r+i+o,e)}}beforeAfter(e,t){let r;e.type==="decl"?r=this.raw(e,null,"beforeDecl"):e.type==="comment"?r=this.raw(e,null,"beforeComment"):t==="before"?r=this.raw(e,null,"beforeRule"):r=this.raw(e,null,"beforeClose");let i=e.parent,o=0;for(;i&&i.type!=="root";)o+=1,i=i.parent;if(r.includes(` `)){let n=this.raw(e,null,"indent");if(n.length)for(let a=0;a<o;a++)r+=n}return r}block(e,t){let r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start");let i;e.nodes&&e.nodes.length?(this.body(e),i=this.raw(e,"after")):i=this.raw(e,"after","emptyBody"),i&&this.builder(i),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let r=this.raw(e,"semicolon");for(let i=0;i<e.nodes.length;i++){let o=e.nodes[i],n=this.raw(o,"before");n&&this.builder(n),this.stringify(o,t!==i||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"),i=e.prop+r+this.rawValue(e,"value");e.important&&(i+=e.raws.important||" !important"),t&&(i+=";"),this.builder(i,e)}document(e){this.body(e)}raw(e,t,r){let i;if(r||(r=t),t&&(i=e.raws[t],typeof i!="undefined"))return i;let o=e.parent;if(r==="before"&&(!o||o.type==="root"&&o.first===e||o&&o.type==="document"))return"";if(!o)return Yi[r];let n=e.root();if(n.rawCache||(n.rawCache={}),typeof n.rawCache[r]!="undefined")return n.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(e,r);{let a="raw"+iu(r);this[a]?i=this[a](n,e):n.walk(l=>{if(i=l.raws[t],typeof i!="undefined")return!1})}return typeof i=="undefined"&&(i=Yi[r]),n.rawCache[r]=i,i}rawBeforeClose(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after!="undefined")return t=r.raws.after,t.includes(` `)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(i=>{if(typeof i.raws.before!="undefined")return r=i.raws.before,r.includes(` `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r=="undefined"?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(i=>{if(typeof i.raws.before!="undefined")return r=i.raws.before,r.includes(` `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r=="undefined"?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(r=>{if(r.type!=="decl"&&(t=r.raws.between,typeof t!="undefined"))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&typeof r.raws.before!="undefined")return t=r.raws.before,t.includes(` `)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(r=>{if(typeof r.raws.between!="undefined")return t=r.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length===0&&(t=r.raws.after,typeof t!="undefined"))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let i=r.parent;if(i&&i!==e&&i.parent&&i.parent===e&&typeof r.raws.before!="undefined"){let o=r.raws.before.split(` `);return t=o[o.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(t=r.raws.semicolon,typeof t!="undefined"))return!1}),t}rawValue(e,t){let r=e[t],i=e.raws[t];return i&&i.value===r?i.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 oo=ls;ls.default=ls;let nu=oo;function us(s,e){new nu(e).stringify(s)}var Ar=us;us.default=us;let{isClean:kt,my:ou}=Et,au=Zs,lu=oo,uu=Ar;function cs(s,e){let t=new s.constructor;for(let r in s){if(!Object.prototype.hasOwnProperty.call(s,r)||r==="proxyCache")continue;let i=s[r],o=typeof i;r==="parent"&&o==="object"?e&&(t[r]=e):r==="source"?t[r]=i:Array.isArray(i)?t[r]=i.map(n=>cs(n,t)):(o==="object"&&i!==null&&(i=cs(i)),t[r]=i)}return t}let hs=class{constructor(e={}){this.raws={},this[kt]=!1,this[ou]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let r of e[t])typeof r.clone=="function"?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=cs(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:i}=this.rangeBy(t);return this.source.input.error(e,{column:i.column,line:i.line},{column:r.column,line:r.line},t)}return new au(e)}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="prop"||t==="value"||t==="name"||t==="params"||t==="important"||t==="text")&&e.markDirty()),!0}}}markDirty(){if(this[kt]){this[kt]=!1;let e=this;for(;e=e.parent;)e[kt]=!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){t=this.toString();let i=t.indexOf(e.word);i!==-1&&(r=this.positionInside(i,t))}return r}positionInside(e,t){let r=t||this.toString(),i=this.source.start.column,o=this.source.start.line;for(let n=0;n<e;n++)r[n]===` `?(i=1,o+=1):i+=1;return{column:i,line:o}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},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 i=this.toString(),o=i.indexOf(e.word);o!==-1&&(t=this.positionInside(o,i),r=this.positionInside(o+e.word.length,i))}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}:typeof e.endIndex=="number"?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 lu().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 i of e)i===this?r=!0:r?(this.parent.insertAfter(t,i),t=i):this.parent.insertBefore(t,i);r||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,t){let r={},i=t==null;t=t||new Map;let o=0;for(let n in this){if(!Object.prototype.hasOwnProperty.call(this,n)||n==="parent"||n==="proxyCache")continue;let a=this[n];if(Array.isArray(a))r[n]=a.map(l=>typeof l=="object"&&l.toJSON?l.toJSON(null,t):l);else if(typeof a=="object"&&a.toJSON)r[n]=a.toJSON(null,t);else if(n==="source"){let l=t.get(a.input);l==null&&(l=o,t.set(a.input,o),o++),r[n]={end:a.end,inputId:l,start:a.start}}else r[n]=a}return i&&(r.inputs=[...t.keys()].map(n=>n.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=uu){e.stringify&&(e=e.stringify);let t="";return e(this,r=>{t+=r}),t}warn(e,t,r){let i={node:this};for(let o in r)i[o]=r[o];return e.warn(t,i)}get proxyOf(){return this}};var Or=hs;hs.default=hs;let cu=Or,fs=class extends cu{constructor(e){e&&typeof e.value!="undefined"&&typeof e.value!="string"&&(e=K(M({},e),{value:String(e.value)})),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}};var Dr=fs;fs.default=fs;let hu="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",fu=(s,e=21)=>(t=e)=>{let r="",i=t;for(;i--;)r+=s[Math.random()*s.length|0];return r},du=(s=21)=>{let e="",t=s;for(;t--;)e+=hu[Math.random()*64|0];return e};var pu={nanoid:du,customAlphabet:fu};let{SourceMapConsumer:Hi,SourceMapGenerator:Zi}=ce,{existsSync:mu,readFileSync:gu}=ce,{dirname:Hr,join:yu}=ce;function wu(s){return Buffer?Buffer.from(s,"base64").toString():window.atob(s)}let ds=class{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,i=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Hr(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new Hi(this.text)),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,o=/^data:application\/json,/;if(i.test(e)||o.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||r.test(e))return wu(e.substr(RegExp.lastMatch.length));let n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e!="object"?!1:typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections)}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),i=e.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,i)))}loadFile(e){if(this.root=Hr(e),mu(e))return this.mapFile=e,gu(e,"utf-8").toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t=="string")return t;if(typeof t=="function"){let r=t(e);if(r){let i=this.loadFile(r);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(t instanceof Hi)return Zi.fromSourceMap(t).toString();if(t instanceof Zi)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return e&&(r=yu(Hr(e),r)),this.loadFile(r)}}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var ao=ds;ds.default=ds;let{SourceMapConsumer:bu,SourceMapGenerator:Su}=ce,{fileURLToPath:Xi,pathToFileURL:$t}=ce,{isAbsolute:ps,resolve:ms}=ce,{nanoid:vu}=pu,Zr=ce,Ji=Zs,Cu=ao,Xr=Symbol("fromOffsetCache"),Eu=!!(bu&&Su),Ki=!!(ms&&ps),mr=class{constructor(e,t={}){if(e===null||typeof e=="undefined"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Ki||/^\w+:\/\//.test(t.from)||ps(t.from)?this.file=t.from:this.file=ms(t.from)),Ki&&Eu){let r=new Cu(this.css,t);if(r.text){this.map=r;let i=r.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+vu(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,i={}){let o,n,a;if(t&&typeof t=="object"){let u=t,c=r;if(typeof u.offset=="number"){let h=this.fromOffset(u.offset);t=h.line,r=h.col}else t=u.line,r=u.column;if(typeof c.offset=="number"){let h=this.fromOffset(c.offset);n=h.line,a=h.col}else n=c.line,a=c.column}else if(!r){let u=this.fromOffset(t);t=u.line,r=u.col}let l=this.origin(t,r,n,a);return l?o=new Ji(e,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,i.plugin):o=new Ji(e,n===void 0?t:{column:r,line:t},n===void 0?r:{column:a,line:n},this.css,this.file,i.plugin),o.input={column:r,endColumn:a,endLine:n,line:t,source:this.css},this.file&&($t&&(o.input.url=$t(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,r;if(this[Xr])r=this[Xr];else{let o=this.css.split(` `);r=new Array(o.length);let n=0;for(let a=0,l=o.length;a<l;a++)r[a]=n,n+=o[a].length+1;this[Xr]=r}t=r[r.length-1];let i=0;if(e>=t)i=r.length-1;else{let o=r.length-2,n;for(;i<o;)if(n=i+(o-i>>1),e<r[n])o=n-1;else if(e>=r[n+1])i=n+1;else{i=n;break}}return{col:e-r[i]+1,line:i+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:ms(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,i){if(!this.map)return!1;let o=this.map.consumer(),n=o.originalPositionFor({column:t,line:e});if(!n.source)return!1;let a;typeof r=="number"&&(a=o.originalPositionFor({column:i,line:r}));let l;ps(n.source)?l=$t(n.source):l=new URL(n.source,this.map.consumer().sourceRoot||$t(this.map.mapFile));let u={column:n.column,endColumn:a&&a.column,endLine:a&&a.line,line:n.line,url:l.toString()};if(l.protocol==="file:")if(Xi)u.file=Xi(l);else throw new Error("file: protocol is not available in this PostCSS build");let c=o.sourceContentFor(n.source);return c&&(u.source=c),u}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map=M({},this.map),e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var Tr=mr;mr.default=mr;Zr&&Zr.registerInput&&Zr.registerInput(mr);let{SourceMapConsumer:lo,SourceMapGenerator:ir}=ce,{dirname:nr,relative:uo,resolve:co,sep:ho}=ce,{pathToFileURL:Qi}=ce,Iu=Tr,xu=!!(lo&&ir),Mu=!!(nr&&co&&uo&&ho),Ru=class{constructor(e,t,r,i){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";let t=` `;this.css.includes(`\r `)&&(t=`\r `),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),r=e.root||nr(e.file),i;this.mapOpts.sourcesContent===!1?(i=new lo(e.text),i.sourcesContent&&(i.sourcesContent=null)):i=e.consumer(),this.map.applySourceMap(i,t,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type==="comment"&&e.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Mu&&xu&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=ir.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new ir({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 ir({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,t=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},o,n;this.stringify(this.root,(a,l,u)=>{if(this.css+=a,l&&u!=="end"&&(i.generated.line=e,i.generated.column=t-1,l.source&&l.source.start?(i.source=this.sourcePath(l),i.original.line=l.source.start.line,i.original.column=l.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),o=a.match(/\n/g),o?(e+=o.length,n=a.lastIndexOf(` `),t=a.length-n):t+=a.length,l&&u!=="start"){let c=l.parent||{raws:{}};(!(l.type==="decl"||l.type==="atrule"&&!l.nodes)||l!==c.last||c.raws.semicolon)&&(l.source&&l.source.end?(i.source=this.sourcePath(l),i.original.line=l.source.end.line,i.original.column=l.source.end.column-1,i.generated.line=e,i.generated.column=t-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=e,i.generated.column=t-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation!="undefined"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline!="undefined")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e!="undefined"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.inline):!0}isMap(){return typeof this.opts.map!="undefined"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent!="undefined"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(e=>e.withContent()):!0}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||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?nr(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=nr(co(r,this.mapOpts.annotation)));let i=uo(r,e);return this.memoizedPaths.set(e,i),i}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 Iu(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 i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,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(Qi){let r=Qi(e).toString();return this.memoizedFileURLs.set(e,r),r}else 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;ho==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};var fo=Ru;let Nu=Or,gs=class extends Nu{constructor(e){super(e),this.type="comment"}};var _r=gs;gs.default=gs;let{isClean:po,my:mo}=Et,go=Dr,yo=_r,Au=Or,wo,Xs,Js,bo;function So(s){return s.map(e=>(e.nodes&&(e.nodes=So(e.nodes)),delete e.source,e))}function vo(s){if(s[po]=!1,s.proxyOf.nodes)for(let e of s.proxyOf.nodes)vo(e)}let Se=class Co extends Au{append(...e){for(let t of e){let r=this.normalize(t,this.last);for(let i of r)this.proxyOf.nodes.push(i)}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=this.getIterator(),r,i;for(;this.indexes[t]<this.proxyOf.nodes.length&&(r=this.indexes[t],i=e(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[t]+=1;return delete this.indexes[t],i}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){return t==="proxyOf"?e:e[t]?t==="each"||typeof t=="string"&&t.startsWith("walk")?(...r)=>e[t](...r.map(i=>typeof i=="function"?(o,n)=>i(o.toProxy(),n):i)):t==="every"||t==="some"?r=>e[t]((i,...o)=>r(i.toProxy(),...o)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(r=>r.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="name"||t==="params"||t==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let n of i)this.proxyOf.nodes.splice(r+1,0,n);let o;for(let n in this.indexes)o=this.indexes[n],r<o&&(this.indexes[n]=o+i.length);return this.markDirty(),this}insertBefore(e,t){let r=this.index(e),i=r===0?"prepend":!1,o=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let a of o)this.proxyOf.nodes.splice(r,0,a);let n;for(let a in this.indexes)n=this.indexes[a],r<=n&&(this.indexes[a]=n+o.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=So(wo(e).nodes);else if(typeof e=="undefined")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value=="undefined")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new go(e)]}else if(e.selector)e=[new Xs(e)];else if(e.name)e=[new Js(e)];else if(e.text)e=[new yo(e)];else throw new Error("Unknown node type in node creation");return e.map(i=>(i[mo]||Co.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[po]&&vo(i),typeof i.raws.before=="undefined"&&t&&typeof t.raws.before!="undefined"&&(i.raws.before=t.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...e){e=e.reverse();for(let t of e){let r=this.normalize(t,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.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){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;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(i=>{t.props&&!t.props.includes(i.prop)||t.fast&&!i.value.includes(t.fast)||(i.value=i.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let i;try{i=e(t,r)}catch(o){throw t.addToError(o)}return i!==!1&&t.walk&&(i=t.walk(e)),i})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&e.test(r.name))return t(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="atrule")return t(r,i)}))}walkComments(e){return this.walk((t,r)=>{if(t.type==="comment")return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&e.test(r.prop))return t(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===e)return t(r,i)}):(t=e,this.walk((