@zaplier/sdk 1.9.1 → 1.9.3
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/v2/chunks/core-C742iEqG.min.js +6 -0
- package/dist/v2/chunks/core-DHYEYU6M.min.js +6 -0
- package/dist/v2/chunks/rrweb-CUXM0llf.min.js +6 -0
- package/dist/v2/chunks/session-replay-CpkSOKDd.min.js +6 -0
- package/dist/v2/chunks/session-replay-NyWElyXm.min.js +6 -0
- package/dist/v2/chunks/visitor-persistence-Wdujedxu.min.js +6 -0
- package/dist/v2/chunks/visitor-persistence-v1nysEVe.min.js +6 -0
- package/dist/v2/core.min.js +1 -1
- package/dist/v2/modules/replay.js +1 -1
- package/dist/v2/modules/rrweb-CZOCorIZ.js +6 -0
- package/package.json +1 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Zaplier SDK v3.0.0 - Unified SDK
|
|
3
|
+
* Advanced privacy-first tracking with code splitting
|
|
4
|
+
* (c) 2026 Zaplier Team
|
|
5
|
+
*/
|
|
6
|
+
var t,e=Object.defineProperty,i=(t,i,s)=>((t,i,s)=>i in t?e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[i]=s)(t,"symbol"!=typeof i?i+"":i,s),s=Object.defineProperty,r=(t,e,i)=>((t,e,i)=>e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i),n=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(n||{});const o={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},h={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},l={};const a={};function c(t,e,i){var s;const r=`${t}.${String(i)}`;if(a[r])return a[r].call(e);const n=function(t){if(l[t])return l[t];const e=globalThis[t],i=e.prototype,s=t in o?o[t]:void 0,r=Boolean(s&&s.every(t=>{var e,s;return Boolean(null==(s=null==(e=Object.getOwnPropertyDescriptor(i,t))?void 0:e.get)?void 0:s.toString().includes("[native code]"))})),n=t in h?h[t]:void 0,a=Boolean(n&&n.every(t=>{var e;return"function"==typeof i[t]&&(null==(e=i[t])?void 0:e.toString().includes("[native code]"))}));if(r&&a&&!globalThis.Zone)return l[t]=e.prototype,e.prototype;try{const s=document.createElement("iframe");document.body.appendChild(s);const r=s.contentWindow;if(!r)return e.prototype;const n=r[t].prototype;return document.body.removeChild(s),n?l[t]=n:i}catch{return i}}(t),c=null==(s=Object.getOwnPropertyDescriptor(n,i))?void 0:s.get;return c?(a[r]=c,c.call(e)):e[i]}const u=function(t){return c("Node",t,"childNodes")},f=function(t){return c("Node",t,"parentNode")},d=function(t){return c("Node",t,"parentElement")},p=function(t){return c("Node",t,"textContent")},m=function(t){return t&&"shadowRoot"in t?c("Element",t,"shadowRoot"):null};function g(t){return t.nodeType===t.ELEMENT_NODE}function w(t){const e=t&&"host"in t&&"mode"in t&&function(t){return t&&"host"in t?c("ShadowRoot",t,"host"):null}(t)||null;return Boolean(e&&"shadowRoot"in e&&m(e)===t)}function y(t){return"[object ShadowRoot]"===Object.prototype.toString.call(t)}function b(t){try{const i=t.rules||t.cssRules;if(!i)return null;let s=t.href;return!s&&t.ownerNode&&t.ownerNode.ownerDocument&&(s=t.ownerNode.ownerDocument.location.href),(e=Array.from(i,t=>v(t,s)).join("")).includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}catch(t){return null}var e}function v(t,e){if(function(t){return"styleSheet"in t}(t)){let e;try{e=b(t.styleSheet)||function(t){const{cssText:e}=t;if(e.split('"').length<3)return e;const i=["@import",`url(${JSON.stringify(t.href)})`];return""===t.layerName?i.push("layer"):t.layerName&&i.push(`layer(${t.layerName})`),t.supportsText&&i.push(`supports(${t.supportsText})`),t.media.length&&i.push(t.media.mediaText),i.join(" ")+";"}(t)}catch(i){e=t.cssText}return t.styleSheet.href?E(e,t.styleSheet.href):e}{let i=t.cssText;return function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")&&(i=i.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),e?E(i,e):i}}class C{constructor(){r(this,"idNodeMap",new Map),r(this,"nodeMetaMap",new WeakMap)}getId(t){var e;return t?(null==(e=this.getMeta(t))?void 0:e.id)??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach(t=>this.removeNodeFromMap(t))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){const i=e.id;this.idNodeMap.set(i,t),this.nodeMetaMap.set(t,e)}replace(t,e){const i=this.getNode(t);if(i){const t=this.nodeMetaMap.get(i);t&&this.nodeMetaMap.set(e,t)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function I({element:t,maskInputOptions:e,tagName:i,type:s,value:r,maskInputFn:n}){let o=r||"";const h=s&&S(s);return(e[i.toLowerCase()]||h&&e[h])&&(o=n?n(o,t):"*".repeat(o.length)),o}function S(t){return t.toLowerCase()}const k="__rrweb_original__";function A(t){const e=t.type;return t.hasAttribute("data-rr-is-password")?"password":e?S(e):null}function x(t,e){let i;try{i=new URL(t,e??window.location.href)}catch(t){return null}const s=i.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==s?void 0:s[1])??null}const R=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,M=/^(?:[a-z+]+:)?\/\//i,O=/^www\..*/i,T=/^(data:)([^,]*),(.*)/i;function E(t,e){return(t||"").replace(R,(t,i,s,r,n,o)=>{const h=s||n||o,l=i||r||"";if(!h)return t;if(M.test(h)||O.test(h))return`url(${l}${h}${l})`;if(T.test(h))return`url(${l}${h}${l})`;if("/"===h[0])return`url(${l}${function(t){let e="";return e=t.indexOf("//")>-1?t.split("/").slice(0,3).join("/"):t.split("/")[0],e=e.split("?")[0],e}(e)+h}${l})`;const a=e.split("/"),c=h.split("/");a.pop();for(const t of c)"."!==t&&(".."===t?a.pop():a.push(t));return`url(${l}${a.join("/")}${l})`})}function B(t){return t.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}let F=1;const N=new RegExp("[^a-z0-9-_:]");function L(){return F++}let j,D;const U=/^[^ \t\n\r\u000c]+/,W=/^[, \t\n\r\u000c]+/,Y=new WeakMap;function Z(t,e){return e&&""!==e.trim()?P(t,e):e}function P(t,e){let i=Y.get(t);if(i||(i=t.createElement("a"),Y.set(t,i)),e){if(e.startsWith("blob:")||e.startsWith("data:"))return e}else e="";return i.setAttribute("href",e),i.href}function G(t,e,i,s){return s?"src"===i||"href"===i&&("use"!==e||"#"!==s[0])||"xlink:href"===i&&"#"!==s[0]?Z(t,s):"background"!==i||"table"!==e&&"td"!==e&&"th"!==e?"srcset"===i?function(t,e){if(""===e.trim())return e;let i=0;function s(t){let s;const r=t.exec(e.substring(i));return r?(s=r[0],i+=s.length,s):""}const r=[];for(;s(W),!(i>=e.length);){let n=s(U);if(","===n.slice(-1))n=Z(t,n.substring(0,n.length-1)),r.push(n);else{let s="";n=Z(t,n);let o=!1;for(;;){const t=e.charAt(i);if(""===t){r.push((n+s).trim());break}if(o)")"===t&&(o=!1);else{if(","===t){i+=1,r.push((n+s).trim());break}"("===t&&(o=!0)}s+=t,i+=1}}}return r.join(", ")}(t,s):"style"===i?E(s,P(t)):"object"===e&&"data"===i?Z(t,s):s:Z(t,s):s}function V(t,e,i){return("video"===t||"audio"===t)&&"autoplay"===e}function z(t,e,i){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!i&&z(f(t),e,i);for(let i=t.classList.length;i--;){const s=t.classList[i];if(e.test(s))return!0}return!!i&&z(f(t),e,i)}function X(t,e,i,s){let r;if(g(t)){if(r=t,!u(r).length)return!1}else{if(null===d(t))return!1;r=d(t)}try{if("string"==typeof e){if(s){if(r.closest(`.${e}`))return!0}else if(r.classList.contains(e))return!0}else if(z(r,e,s))return!0;if(i)if(s){if(r.closest(i))return!0}else if(r.matches(i))return!0}catch(t){}return!1}function J(t){return null==t?"":t.toLowerCase()}function $(t,e){const{doc:i,mirror:s,blockClass:r,blockSelector:o,maskTextClass:h,maskTextSelector:l,skipChild:a=!1,inlineStylesheet:c=!0,maskInputOptions:v={},maskTextFn:C,maskInputFn:R,slimDOMOptions:M,dataURLOptions:O={},inlineImages:T=!1,recordCanvas:F=!1,onSerialize:U,onIframeLoad:W,iframeLoadTimeout:Y=5e3,onStylesheetLoad:Z,stylesheetLoadTimeout:z=5e3,keepIframeSrcFn:K=()=>!1,newlyAddedElement:_=!1,cssCaptured:H=!1}=e;let{needsMask:Q}=e,{preserveWhiteSpace:q=!0}=e;Q||(Q=X(t,h,l,void 0===Q));const tt=function(t,e){const{doc:i,mirror:s,blockClass:r,blockSelector:o,needsMask:h,inlineStylesheet:l,maskInputOptions:a={},maskTextFn:c,maskInputFn:u,dataURLOptions:m={},inlineImages:g,recordCanvas:w,keepIframeSrcFn:y,newlyAddedElement:v=!1,cssCaptured:C=!1}=e,x=function(t,e){if(!e.hasNode(t))return;const i=e.getId(t);return 1===i?void 0:i}(i,s);switch(t.nodeType){case t.DOCUMENT_NODE:return"CSS1Compat"!==t.compatMode?{type:n.Document,childNodes:[],compatMode:t.compatMode}:{type:n.Document,childNodes:[]};case t.DOCUMENT_TYPE_NODE:return{type:n.DocumentType,name:t.name,publicId:t.publicId,systemId:t.systemId,rootId:x};case t.ELEMENT_NODE:return function(t,e){const{doc:i,blockClass:s,blockSelector:r,inlineStylesheet:o,maskInputOptions:h={},maskInputFn:l,dataURLOptions:a={},inlineImages:c,recordCanvas:u,keepIframeSrcFn:f,newlyAddedElement:d=!1,rootId:p}=e,m=function(t,e,i){try{if("string"==typeof e){if(t.classList.contains(e))return!0}else for(let i=t.classList.length;i--;){const s=t.classList[i];if(e.test(s))return!0}if(i)return t.matches(i)}catch(t){}return!1}(t,s,r),g=function(t){if(t instanceof HTMLFormElement)return"form";const e=S(t.tagName);return N.test(e)?"div":e}(t);let w={};const y=t.attributes.length;for(let e=0;e<y;e++){const s=t.attributes[e];V(g,s.name,s.value)||(w[s.name]=G(i,g,S(s.name),s.value))}if("link"===g&&o){const e=Array.from(i.styleSheets).find(e=>e.href===t.href);let s=null;e&&(s=b(e)),s&&(delete w.rel,delete w.href,w.t=s)}if("style"===g&&t.sheet){let e=b(t.sheet);e&&(t.childNodes.length>1&&(e=function(t,e){return function(t,e){const i=Array.from(e.childNodes),s=[];if(i.length>1&&t&&"string"==typeof t){const e=B(t);for(let r=1;r<i.length;r++)if(i[r].textContent&&"string"==typeof i[r].textContent){const n=B(i[r].textContent);for(let i=3;i<n.length;i++){const r=n.substring(0,i);if(2===e.split(r).length){const i=e.indexOf(r);for(let e=i;e<t.length;e++)if(B(t.substring(0,e)).length===i){s.push(t.substring(0,e)),t=t.substring(e);break}break}}}}return s.push(t),s}(t,e).join("/* rr_split */")}(e,t)),w.t=e)}if("input"===g||"textarea"===g||"select"===g){const e=t.value,i=t.checked;"radio"!==w.type&&"checkbox"!==w.type&&"submit"!==w.type&&"button"!==w.type&&e?w.value=I({element:t,type:A(t),tagName:g,value:e,maskInputOptions:h,maskInputFn:l}):i&&(w.checked=i)}if("option"===g&&(t.selected&&!h.select?w.selected=!0:delete w.selected),"dialog"===g&&t.open&&(w.rr_open_mode=t.matches("dialog:modal")?"modal":"non-modal"),"canvas"===g&&u)if("2d"===t.i)(function(t){const e=t.getContext("2d");if(!e)return!0;for(let i=0;i<t.width;i+=50)for(let s=0;s<t.height;s+=50){const r=e.getImageData,n=k in r?r[k]:r;if(new Uint32Array(n.call(e,i,s,Math.min(50,t.width-i),Math.min(50,t.height-s)).data.buffer).some(t=>0!==t))return!1}return!0})(t)||(w.rr_dataURL=t.toDataURL(a.type,a.quality));else if(!("i"in t)){const e=t.toDataURL(a.type,a.quality),s=i.createElement("canvas");s.width=t.width,s.height=t.height,e!==s.toDataURL(a.type,a.quality)&&(w.rr_dataURL=e)}if("img"===g&&c){j||(j=i.createElement("canvas"),D=j.getContext("2d"));const e=t,s=e.currentSrc||e.getAttribute("src")||"<unknown-src>",r=e.crossOrigin,n=()=>{e.removeEventListener("load",n);try{j.width=e.naturalWidth,j.height=e.naturalHeight,D.drawImage(e,0,0),w.rr_dataURL=j.toDataURL(a.type,a.quality)}catch(t){if("anonymous"!==e.crossOrigin)return e.crossOrigin="anonymous",void(e.complete&&0!==e.naturalWidth?n():e.addEventListener("load",n));console.warn(`Cannot inline img src=${s}! Error: ${t}`)}"anonymous"===e.crossOrigin&&(r?w.crossOrigin=r:e.removeAttribute("crossorigin"))};e.complete&&0!==e.naturalWidth?n():e.addEventListener("load",n)}if("audio"===g||"video"===g){const e=w;e.rr_mediaState=t.paused?"paused":"played",e.rr_mediaCurrentTime=t.currentTime,e.rr_mediaPlaybackRate=t.playbackRate,e.rr_mediaMuted=t.muted,e.rr_mediaLoop=t.loop,e.rr_mediaVolume=t.volume}if(d||(t.scrollLeft&&(w.rr_scrollLeft=t.scrollLeft),t.scrollTop&&(w.rr_scrollTop=t.scrollTop)),m){const{width:e,height:i}=t.getBoundingClientRect();w={class:w.class,rr_width:`${e}px`,rr_height:`${i}px`}}let v;"iframe"!==g||f(w.src)||(t.contentDocument||(w.rr_src=w.src),delete w.src);try{customElements.get(g)&&(v=!0)}catch(t){}return{type:n.Element,tagName:g,attributes:w,childNodes:[],isSVG:(C=t,Boolean("svg"===C.tagName||C.ownerSVGElement)||void 0),needBlock:m,rootId:p,isCustom:v};var C}(t,{doc:i,blockClass:r,blockSelector:o,inlineStylesheet:l,maskInputOptions:a,maskInputFn:u,dataURLOptions:m,inlineImages:g,recordCanvas:w,keepIframeSrcFn:y,newlyAddedElement:v,rootId:x});case t.TEXT_NODE:return function(t,e){const{needsMask:i,maskTextFn:s,rootId:r,cssCaptured:o}=e,h=f(t),l=h&&h.tagName;let a="";const c="STYLE"===l||void 0,u="SCRIPT"===l||void 0;return u?a="SCRIPT_PLACEHOLDER":o||(a=p(t),c&&a&&(a=E(a,P(e.doc)))),!c&&!u&&a&&i&&(a=s?s(a,d(t)):a.replace(/[\S]/g,"*")),{type:n.Text,textContent:a||"",rootId:r}}(t,{doc:i,needsMask:h,maskTextFn:c,rootId:x,cssCaptured:C});case t.CDATA_SECTION_NODE:return{type:n.CDATA,textContent:"",rootId:x};case t.COMMENT_NODE:return{type:n.Comment,textContent:p(t)||"",rootId:x};default:return!1}}(t,{doc:i,mirror:s,blockClass:r,blockSelector:o,needsMask:Q,inlineStylesheet:c,maskInputOptions:v,maskTextFn:C,maskInputFn:R,dataURLOptions:O,inlineImages:T,recordCanvas:F,keepIframeSrcFn:K,newlyAddedElement:_,cssCaptured:H});if(!tt)return console.warn(t,"not serialized"),null;let et;et=s.hasNode(t)?s.getId(t):function(t,e){if(e.comment&&t.type===n.Comment)return!0;if(t.type===n.Element){if(e.script&&("script"===t.tagName||"link"===t.tagName&&("preload"===t.attributes.rel||"modulepreload"===t.attributes.rel)&&"script"===t.attributes.as||"link"===t.tagName&&"prefetch"===t.attributes.rel&&"string"==typeof t.attributes.href&&"js"===x(t.attributes.href)))return!0;if(e.headFavicon&&("link"===t.tagName&&"shortcut icon"===t.attributes.rel||"meta"===t.tagName&&(J(t.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===J(t.attributes.name)||"icon"===J(t.attributes.rel)||"apple-touch-icon"===J(t.attributes.rel)||"shortcut icon"===J(t.attributes.rel))))return!0;if("meta"===t.tagName){if(e.headMetaDescKeywords&&J(t.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(J(t.attributes.property).match(/^(og|twitter|fb):/)||J(t.attributes.name).match(/^(og|twitter):/)||"pinterest"===J(t.attributes.name)))return!0;if(e.headMetaRobots&&("robots"===J(t.attributes.name)||"googlebot"===J(t.attributes.name)||"bingbot"===J(t.attributes.name)))return!0;if(e.headMetaHttpEquiv&&void 0!==t.attributes["http-equiv"])return!0;if(e.headMetaAuthorship&&("author"===J(t.attributes.name)||"generator"===J(t.attributes.name)||"framework"===J(t.attributes.name)||"publisher"===J(t.attributes.name)||"progid"===J(t.attributes.name)||J(t.attributes.property).match(/^article:/)||J(t.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&("google-site-verification"===J(t.attributes.name)||"yandex-verification"===J(t.attributes.name)||"csrf-token"===J(t.attributes.name)||"p:domain_verify"===J(t.attributes.name)||"verify-v1"===J(t.attributes.name)||"verification"===J(t.attributes.name)||"shopify-checkout-api-token"===J(t.attributes.name)))return!0}}return!1}(tt,M)||!q&&tt.type===n.Text&&!tt.textContent.replace(/^\s+|\s+$/gm,"").length?-2:L();const it=Object.assign(tt,{id:et});if(s.add(t,it),-2===et)return null;U&&U(t);let st=!a;if(it.type===n.Element){st=st&&!it.needBlock,delete it.needBlock;const e=m(t);e&&y(e)&&(it.isShadowHost=!0)}if((it.type===n.Document||it.type===n.Element)&&st){M.headWhitespace&&it.type===n.Element&&"head"===it.tagName&&(q=!1);const e={doc:i,mirror:s,blockClass:r,blockSelector:o,needsMask:Q,maskTextClass:h,maskTextSelector:l,skipChild:a,inlineStylesheet:c,maskInputOptions:v,maskTextFn:C,maskInputFn:R,slimDOMOptions:M,dataURLOptions:O,inlineImages:T,recordCanvas:F,preserveWhiteSpace:q,onSerialize:U,onIframeLoad:W,iframeLoadTimeout:Y,onStylesheetLoad:Z,stylesheetLoadTimeout:z,keepIframeSrcFn:K,cssCaptured:!1};if(it.type===n.Element&&"textarea"===it.tagName&&void 0!==it.attributes.value);else{it.type===n.Element&&void 0!==it.attributes.t&&"string"==typeof it.attributes.t&&(e.cssCaptured=!0);for(const i of Array.from(u(t))){const t=$(i,e);t&&it.childNodes.push(t)}}let f=null;if(g(t)&&(f=m(t)))for(const t of Array.from(u(f))){const i=$(t,e);i&&(y(f)&&(i.isShadow=!0),it.childNodes.push(i))}}const rt=f(t);return rt&&w(rt)&&y(rt)&&(it.isShadow=!0),it.type===n.Element&&"iframe"===it.tagName&&function(t,e,i){const s=t.contentWindow;if(!s)return;let r,n=!1;try{r=s.document.readyState}catch(t){return}if("complete"!==r){const s=setTimeout(()=>{n||(e(),n=!0)},i);return void t.addEventListener("load",()=>{clearTimeout(s),n=!0,e()})}const o="about:blank";if(s.location.href!==o||t.src===o||""===t.src)return setTimeout(e,0),t.addEventListener("load",e);t.addEventListener("load",e)}(t,()=>{const e=t.contentDocument;if(e&&W){const i=$(e,{doc:e,mirror:s,blockClass:r,blockSelector:o,needsMask:Q,maskTextClass:h,maskTextSelector:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:v,maskTextFn:C,maskInputFn:R,slimDOMOptions:M,dataURLOptions:O,inlineImages:T,recordCanvas:F,preserveWhiteSpace:q,onSerialize:U,onIframeLoad:W,iframeLoadTimeout:Y,onStylesheetLoad:Z,stylesheetLoadTimeout:z,keepIframeSrcFn:K});i&&W(t,i)}},Y),it.type===n.Element&&"link"===it.tagName&&"string"==typeof it.attributes.rel&&("stylesheet"===it.attributes.rel||"preload"===it.attributes.rel&&"string"==typeof it.attributes.href&&"css"===x(it.attributes.href))&&function(t,e,i){let s,r=!1;try{s=t.sheet}catch(t){return}if(s)return;const n=setTimeout(()=>{r||(e(),r=!0)},i);t.addEventListener("load",()=>{clearTimeout(n),r=!0,e()})}(t,()=>{if(Z){const e=$(t,{doc:i,mirror:s,blockClass:r,blockSelector:o,needsMask:Q,maskTextClass:h,maskTextSelector:l,skipChild:!1,inlineStylesheet:c,maskInputOptions:v,maskTextFn:C,maskInputFn:R,slimDOMOptions:M,dataURLOptions:O,inlineImages:T,recordCanvas:F,preserveWhiteSpace:q,onSerialize:U,onIframeLoad:W,iframeLoadTimeout:Y,onStylesheetLoad:Z,stylesheetLoadTimeout:z,keepIframeSrcFn:K});e&&Z(t,e)}},z),it}function K(t){return t&&t.o&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function _(t){if(t.o)return t;var e=t.default;if("function"==typeof e){var i=function t(){return this instanceof t?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};i.prototype=e.prototype}else i={};return Object.defineProperty(i,"o",{value:!0}),Object.keys(t).forEach(function(e){var s=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(i,e,s.get?s:{enumerable:!0,get:function(){return t[e]}})}),i}var H={exports:{}},Q=String,q=function(){return{isColorSupported:!1,reset:Q,bold:Q,dim:Q,italic:Q,underline:Q,inverse:Q,hidden:Q,strikethrough:Q,black:Q,red:Q,green:Q,yellow:Q,blue:Q,magenta:Q,cyan:Q,white:Q,gray:Q,bgBlack:Q,bgRed:Q,bgGreen:Q,bgYellow:Q,bgBlue:Q,bgMagenta:Q,bgCyan:Q,bgWhite:Q}};H.exports=q(),H.exports.createColors=q;var tt=H.exports;const et=_(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let it=tt,st=et,rt=class t extends Error{constructor(e,i,s,r,n,o){super(e),this.name="CssSyntaxError",this.reason=e,n&&(this.file=n),r&&(this.source=r),o&&(this.plugin=o),void 0!==i&&void 0!==s&&("number"==typeof i?(this.line=i,this.column=s):(this.line=i.line,this.column=i.column,this.endLine=s.line,this.endColumn=s.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,t)}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(t){if(!this.source)return"";let e=this.source;null==t&&(t=it.isColorSupported),st&&t&&(e=st(e));let i,s,r=e.split(/\r?\n/),n=Math.max(this.line-3,0),o=Math.min(this.line+2,r.length),h=String(o).length;if(t){let{bold:t,gray:e,red:r}=it.createColors(!0);i=e=>t(r(e)),s=t=>e(t)}else i=s=t=>t;return r.slice(n,o).map((t,e)=>{let r=n+1+e,o=" "+(" "+r).slice(-h)+" | ";if(r===this.line){let e=s(o.replace(/\d/g," "))+t.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+s(o)+t+"\n "+e+i("^")}return" "+s(o)+t}).join("\n")}toString(){let t=this.showSourceCode();return t&&(t="\n\n"+t+"\n"),this.name+": "+this.message+t}};var nt=rt;rt.default=rt;var ot={};ot.isClean=Symbol("isClean"),ot.my=Symbol("my");const ht={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let lt=class{constructor(t){this.builder=t}atrule(t,e){let i="@"+t.name,s=t.params?this.rawValue(t,"params"):"";if(void 0!==t.raws.afterName?i+=t.raws.afterName:s&&(i+=" "),t.nodes)this.block(t,i+s);else{let r=(t.raws.between||"")+(e?";":"");this.builder(i+s+r,t)}}beforeAfter(t,e){let i;i="decl"===t.type?this.raw(t,null,"beforeDecl"):"comment"===t.type?this.raw(t,null,"beforeComment"):"before"===e?this.raw(t,null,"beforeRule"):this.raw(t,null,"beforeClose");let s=t.parent,r=0;for(;s&&"root"!==s.type;)r+=1,s=s.parent;if(i.includes("\n")){let e=this.raw(t,null,"indent");if(e.length)for(let t=0;t<r;t++)i+=e}return i}block(t,e){let i,s=this.raw(t,"between","beforeOpen");this.builder(e+s+"{",t,"start"),t.nodes&&t.nodes.length?(this.body(t),i=this.raw(t,"after")):i=this.raw(t,"after","emptyBody"),i&&this.builder(i),this.builder("}",t,"end")}body(t){let e=t.nodes.length-1;for(;e>0&&"comment"===t.nodes[e].type;)e-=1;let i=this.raw(t,"semicolon");for(let s=0;s<t.nodes.length;s++){let r=t.nodes[s],n=this.raw(r,"before");n&&this.builder(n),this.stringify(r,e!==s||i)}}comment(t){let e=this.raw(t,"left","commentLeft"),i=this.raw(t,"right","commentRight");this.builder("/*"+e+t.text+i+"*/",t)}decl(t,e){let i=this.raw(t,"between","colon"),s=t.prop+i+this.rawValue(t,"value");t.important&&(s+=t.raws.important||" !important"),e&&(s+=";"),this.builder(s,t)}document(t){this.body(t)}raw(t,e,i){let s;if(i||(i=e),e&&(s=t.raws[e],void 0!==s))return s;let r=t.parent;if("before"===i){if(!r||"root"===r.type&&r.first===t)return"";if(r&&"document"===r.type)return""}if(!r)return ht[i];let n=t.root();if(n.rawCache||(n.rawCache={}),void 0!==n.rawCache[i])return n.rawCache[i];if("before"===i||"after"===i)return this.beforeAfter(t,i);{let r="raw"+((o=i)[0].toUpperCase()+o.slice(1));this[r]?s=this[r](n,t):n.walk(t=>{if(s=t.raws[e],void 0!==s)return!1})}var o;return void 0===s&&(s=ht[i]),n.rawCache[i]=s,s}rawBeforeClose(t){let e;return t.walk(t=>{if(t.nodes&&t.nodes.length>0&&void 0!==t.raws.after)return e=t.raws.after,e.includes("\n")&&(e=e.replace(/[^\n]+$/,"")),!1}),e&&(e=e.replace(/\S/g,"")),e}rawBeforeComment(t,e){let i;return t.walkComments(t=>{if(void 0!==t.raws.before)return i=t.raws.before,i.includes("\n")&&(i=i.replace(/[^\n]+$/,"")),!1}),void 0===i?i=this.raw(e,null,"beforeDecl"):i&&(i=i.replace(/\S/g,"")),i}rawBeforeDecl(t,e){let i;return t.walkDecls(t=>{if(void 0!==t.raws.before)return i=t.raws.before,i.includes("\n")&&(i=i.replace(/[^\n]+$/,"")),!1}),void 0===i?i=this.raw(e,null,"beforeRule"):i&&(i=i.replace(/\S/g,"")),i}rawBeforeOpen(t){let e;return t.walk(t=>{if("decl"!==t.type&&(e=t.raws.between,void 0!==e))return!1}),e}rawBeforeRule(t){let e;return t.walk(i=>{if(i.nodes&&(i.parent!==t||t.first!==i)&&void 0!==i.raws.before)return e=i.raws.before,e.includes("\n")&&(e=e.replace(/[^\n]+$/,"")),!1}),e&&(e=e.replace(/\S/g,"")),e}rawColon(t){let e;return t.walkDecls(t=>{if(void 0!==t.raws.between)return e=t.raws.between.replace(/[^\s:]/g,""),!1}),e}rawEmptyBody(t){let e;return t.walk(t=>{if(t.nodes&&0===t.nodes.length&&(e=t.raws.after,void 0!==e))return!1}),e}rawIndent(t){if(t.raws.indent)return t.raws.indent;let e;return t.walk(i=>{let s=i.parent;if(s&&s!==t&&s.parent&&s.parent===t&&void 0!==i.raws.before){let t=i.raws.before.split("\n");return e=t[t.length-1],e=e.replace(/\S/g,""),!1}}),e}rawSemicolon(t){let e;return t.walk(t=>{if(t.nodes&&t.nodes.length&&"decl"===t.last.type&&(e=t.raws.semicolon,void 0!==e))return!1}),e}rawValue(t,e){let i=t[e],s=t.raws[e];return s&&s.value===i?s.raw:i}root(t){this.body(t),t.raws.after&&this.builder(t.raws.after)}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(t.raws.ownSemicolon,t,"end")}stringify(t,e){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,e)}};var at=lt;lt.default=lt;let ct=at;function ut(t,e){new ct(e).stringify(t)}var ft=ut;ut.default=ut;let{isClean:dt,my:pt}=ot,mt=nt,gt=at,wt=ft;function yt(t,e){let i=new t.constructor;for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s))continue;if("proxyCache"===s)continue;let r=t[s],n=typeof r;"parent"===s&&"object"===n?e&&(i[s]=e):"source"===s?i[s]=r:Array.isArray(r)?i[s]=r.map(t=>yt(t,i)):("object"===n&&null!==r&&(r=yt(r)),i[s]=r)}return i}let bt=class{constructor(t={}){this.raws={},this[dt]=!1,this[pt]=!0;for(let e in t)if("nodes"===e){this.nodes=[];for(let i of t[e])"function"==typeof i.clone?this.append(i.clone()):this.append(i)}else this[e]=t[e]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let e=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${e.input.from}:${e.start.line}:${e.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let e in t)this[e]=t[e];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let e=yt(this);for(let i in t)e[i]=t[i];return e}cloneAfter(t={}){let e=this.clone(t);return this.parent.insertAfter(this,e),e}cloneBefore(t={}){let e=this.clone(t);return this.parent.insertBefore(this,e),e}error(t,e={}){if(this.source){let{end:i,start:s}=this.rangeBy(e);return this.source.input.error(t,{column:s.column,line:s.line},{column:i.column,line:i.line},e)}return new mt(t)}getProxyProcessor(){return{get:(t,e)=>"proxyOf"===e?t:"root"===e?()=>t.root().toProxy():t[e],set:(t,e,i)=>(t[e]===i||(t[e]=i,"prop"!==e&&"value"!==e&&"name"!==e&&"params"!==e&&"important"!==e&&"text"!==e||t.markDirty()),!0)}}markDirty(){if(this[dt]){this[dt]=!1;let t=this;for(;t=t.parent;)t[dt]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t,e){let i=this.source.start;if(t.index)i=this.positionInside(t.index,e);else if(t.word){let s=(e=this.toString()).indexOf(t.word);-1!==s&&(i=this.positionInside(s,e))}return i}positionInside(t,e){let i=e||this.toString(),s=this.source.start.column,r=this.source.start.line;for(let e=0;e<t;e++)"\n"===i[e]?(s=1,r+=1):s+=1;return{column:s,line:r}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t){let e={column:this.source.start.column,line:this.source.start.line},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:e.column+1,line:e.line};if(t.word){let s=this.toString(),r=s.indexOf(t.word);-1!==r&&(e=this.positionInside(r,s),i=this.positionInside(r+t.word.length,s))}else t.start?e={column:t.start.column,line:t.start.line}:t.index&&(e=this.positionInside(t.index)),t.end?i={column:t.end.column,line:t.end.line}:"number"==typeof t.endIndex?i=this.positionInside(t.endIndex):t.index&&(i=this.positionInside(t.index+1));return(i.line<e.line||i.line===e.line&&i.column<=e.column)&&(i={column:e.column+1,line:e.line}),{end:i,start:e}}raw(t,e){return(new gt).raw(this,t,e)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let e=this,i=!1;for(let s of t)s===this?i=!0:i?(this.parent.insertAfter(e,s),e=s):this.parent.insertBefore(e,s);i||this.remove()}return this}root(){let t=this;for(;t.parent&&"document"!==t.parent.type;)t=t.parent;return t}toJSON(t,e){let i={},s=null==e;e=e||new Map;let r=0;for(let t in this){if(!Object.prototype.hasOwnProperty.call(this,t))continue;if("parent"===t||"proxyCache"===t)continue;let s=this[t];if(Array.isArray(s))i[t]=s.map(t=>"object"==typeof t&&t.toJSON?t.toJSON(null,e):t);else if("object"==typeof s&&s.toJSON)i[t]=s.toJSON(null,e);else if("source"===t){let n=e.get(s.input);null==n&&(n=r,e.set(s.input,r),r++),i[t]={end:s.end,inputId:n,start:s.start}}else i[t]=s}return s&&(i.inputs=[...e.keys()].map(t=>t.toJSON())),i}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=wt){t.stringify&&(t=t.stringify);let e="";return t(this,t=>{e+=t}),e}warn(t,e,i){let s={node:this};for(let t in i)s[t]=i[t];return t.warn(e,s)}get proxyOf(){return this}};var vt=bt;bt.default=bt;let Ct=vt,It=class extends Ct{constructor(t){t&&void 0!==t.value&&"string"!=typeof t.value&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var St=It;It.default=It;var kt={nanoid:(t=21)=>{let e="",i=t;for(;i--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return e}};let{SourceMapConsumer:At,SourceMapGenerator:xt}=et,{existsSync:Rt,readFileSync:Mt}=et,{dirname:Ot,join:Tt}=et,Et=class{constructor(t,e){if(!1===e.map)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let i=e.map?e.map.prev:void 0,s=this.loadMap(e.from,i);!this.mapFile&&e.from&&(this.mapFile=e.from),this.mapFile&&(this.root=Ot(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new At(this.text)),this.consumerCache}decodeInline(t){if(/^data:application\/json;charset=utf-?8,/.test(t)||/^data:application\/json,/.test(t))return decodeURIComponent(t.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(t)||/^data:application\/json;base64,/.test(t))return e=t.substr(RegExp.lastMatch.length),Buffer?Buffer.from(e,"base64").toString():window.atob(e);var e;let i=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+i)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return"object"==typeof t&&("string"==typeof t.mappings||"string"==typeof t.h||Array.isArray(t.sections))}loadAnnotation(t){let e=t.match(/\/\*\s*# sourceMappingURL=/gm);if(!e)return;let i=t.lastIndexOf(e.pop()),s=t.indexOf("*/",i);i>-1&&s>-1&&(this.annotation=this.getAnnotationURL(t.substring(i,s)))}loadFile(t){if(this.root=Ot(t),Rt(t))return this.mapFile=t,Mt(t,"utf-8").toString().trim()}loadMap(t,e){if(!1===e)return!1;if(e){if("string"==typeof e)return e;if("function"!=typeof e){if(e instanceof At)return xt.fromSourceMap(e).toString();if(e instanceof xt)return e.toString();if(this.isMap(e))return JSON.stringify(e);throw new Error("Unsupported previous source map format: "+e.toString())}{let i=e(t);if(i){let t=this.loadFile(i);if(!t)throw new Error("Unable to load previous source map: "+i.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return t&&(e=Tt(Ot(t),e)),this.loadFile(e)}}}startWith(t,e){return!!t&&t.substr(0,e.length)===e}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Bt=Et;Et.default=Et;let{SourceMapConsumer:Ft,SourceMapGenerator:Nt}=et,{fileURLToPath:Lt,pathToFileURL:jt}=et,{isAbsolute:Dt,resolve:Ut}=et,{nanoid:Wt}=kt,Yt=et,Zt=nt,Pt=Bt,Gt=Symbol("fromOffsetCache"),Vt=Boolean(Ft&&Nt),zt=Boolean(Ut&&Dt),Xt=class{constructor(t,e={}){if(null==t||"object"==typeof t&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,e.from&&(!zt||/^\w+:\/\//.test(e.from)||Dt(e.from)?this.file=e.from:this.file=Ut(e.from)),zt&&Vt){let t=new Pt(this.css,e);if(t.text){this.map=t;let e=t.consumer().file;!this.file&&e&&(this.file=this.mapResolve(e))}}this.file||(this.id="<input css "+Wt(6)+">"),this.map&&(this.map.file=this.from)}error(t,e,i,s={}){let r,n,o;if(e&&"object"==typeof e){let t=e,s=i;if("number"==typeof t.offset){let s=this.fromOffset(t.offset);e=s.line,i=s.col}else e=t.line,i=t.column;if("number"==typeof s.offset){let t=this.fromOffset(s.offset);n=t.line,o=t.col}else n=s.line,o=s.column}else if(!i){let t=this.fromOffset(e);e=t.line,i=t.col}let h=this.origin(e,i,n,o);return r=h?new Zt(t,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,s.plugin):new Zt(t,void 0===n?e:{column:i,line:e},void 0===n?i:{column:o,line:n},this.css,this.file,s.plugin),r.input={column:i,endColumn:o,endLine:n,line:e,source:this.css},this.file&&(jt&&(r.input.url=jt(this.file).toString()),r.input.file=this.file),r}fromOffset(t){let e,i;if(this[Gt])i=this[Gt];else{let t=this.css.split("\n");i=new Array(t.length);let e=0;for(let s=0,r=t.length;s<r;s++)i[s]=e,e+=t[s].length+1;this[Gt]=i}e=i[i.length-1];let s=0;if(t>=e)s=i.length-1;else{let e,r=i.length-2;for(;s<r;)if(e=s+(r-s>>1),t<i[e])r=e-1;else{if(!(t>=i[e+1])){s=e;break}s=e+1}}return{col:t-i[s]+1,line:s+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:Ut(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,e,i,s){if(!this.map)return!1;let r,n,o=this.map.consumer(),h=o.originalPositionFor({column:e,line:t});if(!h.source)return!1;"number"==typeof i&&(r=o.originalPositionFor({column:s,line:i})),n=Dt(h.source)?jt(h.source):new URL(h.source,this.map.consumer().sourceRoot||jt(this.map.mapFile));let l={column:h.column,endColumn:r&&r.column,endLine:r&&r.line,line:h.line,url:n.toString()};if("file:"===n.protocol){if(!Lt)throw new Error("file: protocol is not available in this PostCSS build");l.file=Lt(n)}let a=o.sourceContentFor(h.source);return a&&(l.source=a),l}toJSON(){let t={};for(let e of["hasBOM","css","file","id"])null!=this[e]&&(t[e]=this[e]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}get from(){return this.file||this.id}};var Jt=Xt;Xt.default=Xt,Yt&&Yt.registerInput&&Yt.registerInput(Xt);let{SourceMapConsumer:$t,SourceMapGenerator:Kt}=et,{dirname:_t,relative:Ht,resolve:Qt,sep:qt}=et,{pathToFileURL:te}=et,ee=Jt,ie=Boolean($t&&Kt),se=Boolean(_t&&Qt&&Ht&&qt);var re=class{constructor(t,e,i,s){this.stringify=t,this.mapOpts=i.map||{},this.root=e,this.opts=i,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 t;t=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 e="\n";this.css.includes("\r\n")&&(e="\r\n"),this.css+=e+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let e,i=this.toUrl(this.path(t.file)),s=t.root||_t(t.file);!1===this.mapOpts.sourcesContent?(e=new $t(t.text),e.sourcesContent&&(e.sourcesContent=null)):e=t.consumer(),this.map.applySourceMap(e,i,this.toUrl(this.path(s)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let t;for(let e=this.root.nodes.length-1;e>=0;e--)t=this.root.nodes[e],"comment"===t.type&&0===t.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(e)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),se&&ie&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=Kt.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new Kt({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new Kt({file:this.outputFile(),ignoreInvalidMapping:!0});let t,e,i=1,s=1,r="<no source>",n={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(o,h,l)=>{if(this.css+=o,h&&"end"!==l&&(n.generated.line=i,n.generated.column=s-1,h.source&&h.source.start?(n.source=this.sourcePath(h),n.original.line=h.source.start.line,n.original.column=h.source.start.column-1,this.map.addMapping(n)):(n.source=r,n.original.line=1,n.original.column=0,this.map.addMapping(n))),t=o.match(/\n/g),t?(i+=t.length,e=o.lastIndexOf("\n"),s=o.length-e):s+=o.length,h&&"start"!==l){let t=h.parent||{raws:{}};("decl"===h.type||"atrule"===h.type&&!h.nodes)&&h===t.last&&!t.raws.semicolon||(h.source&&h.source.end?(n.source=this.sourcePath(h),n.original.line=h.source.end.line,n.original.column=h.source.end.column-1,n.generated.line=i,n.generated.column=s-2,this.map.addMapping(n)):(n.source=r,n.original.line=1,n.original.column=0,n.generated.line=i,n.generated.column=s-1,this.map.addMapping(n)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(t=>t.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let t=this.mapOpts.annotation;return(void 0===t||!0===t)&&(!this.previous().length||this.previous().some(t=>t.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(t=>t.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute)return t;if(60===t.charCodeAt(0))return t;if(/^\w+:\/\//.test(t))return t;let e=this.memoizedPaths.get(t);if(e)return e;let i=this.opts.to?_t(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(i=_t(Qt(i,this.mapOpts.annotation)));let s=Ht(i,t);return this.memoizedPaths.set(t,s),s}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let e=t.source.input.map;this.previousMaps.includes(e)||this.previousMaps.push(e)}});else{let t=new ee(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(e=>{if(e.source){let i=e.source.input.from;if(i&&!t[i]){t[i]=!0;let s=this.usesFileUrls?this.toFileUrl(i):this.toUrl(this.path(i));this.map.setSourceContent(s,e.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(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let e=this.memoizedFileURLs.get(t);if(e)return e;if(te){let e=te(t).toString();return this.memoizedFileURLs.set(t,e),e}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let e=this.memoizedURLs.get(t);if(e)return e;"\\"===qt&&(t=t.replace(/\\/g,"/"));let i=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,i),i}};let ne=vt,oe=class extends ne{constructor(t){super(t),this.type="comment"}};var he=oe;oe.default=oe;let le,ae,ce,ue,{isClean:fe,my:de}=ot,pe=St,me=he,ge=vt;function we(t){return t.map(t=>(t.nodes&&(t.nodes=we(t.nodes)),delete t.source,t))}function ye(t){if(t[fe]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)ye(e)}let be=class t extends ge{append(...t){for(let e of t){let t=this.normalize(e,this.last);for(let e of t)this.proxyOf.nodes.push(e)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let e of this.nodes)e.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let e,i,s=this.getIterator();for(;this.indexes[s]<this.proxyOf.nodes.length&&(e=this.indexes[s],i=t(this.proxyOf.nodes[e],e),!1!==i);)this.indexes[s]+=1;return delete this.indexes[s],i}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get:(t,e)=>"proxyOf"===e?t:t[e]?"each"===e||"string"==typeof e&&e.startsWith("walk")?(...i)=>t[e](...i.map(t=>"function"==typeof t?(e,i)=>t(e.toProxy(),i):t)):"every"===e||"some"===e?i=>t[e]((t,...e)=>i(t.toProxy(),...e)):"root"===e?()=>t.root().toProxy():"nodes"===e?t.nodes.map(t=>t.toProxy()):"first"===e||"last"===e?t[e].toProxy():t[e]:t[e],set:(t,e,i)=>(t[e]===i||(t[e]=i,"name"!==e&&"params"!==e&&"selector"!==e||t.markDirty()),!0)}}index(t){return"number"==typeof t?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,e){let i,s=this.index(t),r=this.normalize(e,this.proxyOf.nodes[s]).reverse();s=this.index(t);for(let t of r)this.proxyOf.nodes.splice(s+1,0,t);for(let t in this.indexes)i=this.indexes[t],s<i&&(this.indexes[t]=i+r.length);return this.markDirty(),this}insertBefore(t,e){let i,s=this.index(t),r=0===s&&"prepend",n=this.normalize(e,this.proxyOf.nodes[s],r).reverse();s=this.index(t);for(let t of n)this.proxyOf.nodes.splice(s,0,t);for(let t in this.indexes)i=this.indexes[t],s<=i&&(this.indexes[t]=i+n.length);return this.markDirty(),this}normalize(e,i){if("string"==typeof e)e=we(le(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e)){e=e.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if("root"===e.type&&"document"!==this.type){e=e.nodes.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new pe(e)]}else if(e.selector)e=[new ae(e)];else if(e.name)e=[new ce(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new me(e)]}return e.map(e=>(e[de]||t.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[fe]&&ye(e),void 0===e.raws.before&&i&&void 0!==i.raws.before&&(e.raws.before=i.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...t){t=t.reverse();for(let e of t){let t=this.normalize(e,this.first,"prepend").reverse();for(let e of t)this.proxyOf.nodes.unshift(e);for(let e in this.indexes)this.indexes[e]=this.indexes[e]+t.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){let e;t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);for(let i in this.indexes)e=this.indexes[i],e>=t&&(this.indexes[i]=e-1);return this.markDirty(),this}replaceValues(t,e,i){return i||(i=e,e={}),this.walkDecls(s=>{e.props&&!e.props.includes(s.prop)||e.fast&&!s.value.includes(e.fast)||(s.value=s.value.replace(t,i))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((e,i)=>{let s;try{s=t(e,i)}catch(t){throw e.addToError(t)}return!1!==s&&e.walk&&(s=e.walk(t)),s})}walkAtRules(t,e){return e?t instanceof RegExp?this.walk((i,s)=>{if("atrule"===i.type&&t.test(i.name))return e(i,s)}):this.walk((i,s)=>{if("atrule"===i.type&&i.name===t)return e(i,s)}):(e=t,this.walk((t,i)=>{if("atrule"===t.type)return e(t,i)}))}walkComments(t){return this.walk((e,i)=>{if("comment"===e.type)return t(e,i)})}walkDecls(t,e){return e?t instanceof RegExp?this.walk((i,s)=>{if("decl"===i.type&&t.test(i.prop))return e(i,s)}):this.walk((i,s)=>{if("decl"===i.type&&i.prop===t)return e(i,s)}):(e=t,this.walk((t,i)=>{if("decl"===t.type)return e(t,i)}))}walkRules(t,e){return e?t instanceof RegExp?this.walk((i,s)=>{if("rule"===i.type&&t.test(i.selector))return e(i,s)}):this.walk((i,s)=>{if("rule"===i.type&&i.selector===t)return e(i,s)}):(e=t,this.walk((t,i)=>{if("rule"===t.type)return e(t,i)}))}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]}};be.registerParse=t=>{le=t},be.registerRule=t=>{ae=t},be.registerAtRule=t=>{ce=t},be.registerRoot=t=>{ue=t};var ve=be;be.default=be,be.rebuild=t=>{"atrule"===t.type?Object.setPrototypeOf(t,ce.prototype):"rule"===t.type?Object.setPrototypeOf(t,ae.prototype):"decl"===t.type?Object.setPrototypeOf(t,pe.prototype):"comment"===t.type?Object.setPrototypeOf(t,me.prototype):"root"===t.type&&Object.setPrototypeOf(t,ue.prototype),t[de]=!0,t.nodes&&t.nodes.forEach(t=>{be.rebuild(t)})};let Ce,Ie,Se=ve,ke=class extends Se{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new Ce(new Ie,this,t).stringify()}};ke.registerLazyResult=t=>{Ce=t},ke.registerProcessor=t=>{Ie=t};var Ae=ke;ke.default=ke;let xe={};var Re=function(t){xe[t]||(xe[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))};let Me=class{constructor(t,e={}){if(this.type="warning",this.text=t,e.node&&e.node.source){let t=e.node.rangeBy(e);this.line=t.start.line,this.column=t.start.column,this.endLine=t.end.line,this.endColumn=t.end.column}for(let t in e)this[t]=e[t]}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 Oe=Me;Me.default=Me;let Te=Oe,Ee=class{constructor(t,e,i){this.processor=t,this.messages=[],this.root=e,this.opts=i,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,e={}){e.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(e.plugin=this.lastPlugin.postcssPlugin);let i=new Te(t,e);return this.messages.push(i),i}warnings(){return this.messages.filter(t=>"warning"===t.type)}get content(){return this.css}};var Be=Ee;Ee.default=Ee;const Fe="'".charCodeAt(0),Ne='"'.charCodeAt(0),Le="\\".charCodeAt(0),je="/".charCodeAt(0),De="\n".charCodeAt(0),Ue=" ".charCodeAt(0),We="\f".charCodeAt(0),Ye="\t".charCodeAt(0),Ze="\r".charCodeAt(0),Pe="[".charCodeAt(0),Ge="]".charCodeAt(0),Ve="(".charCodeAt(0),ze=")".charCodeAt(0),Xe="{".charCodeAt(0),Je="}".charCodeAt(0),$e=";".charCodeAt(0),Ke="*".charCodeAt(0),_e=":".charCodeAt(0),He="@".charCodeAt(0),Qe=/[\t\n\f\r "#'()/;[\\\]{}]/g,qe=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,ti=/.[\r\n"'(/\\]/,ei=/[\da-f]/i;let ii=ve,si=class extends ii{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}};var ri=si;si.default=si,ii.registerAtRule(si);let ni,oi,hi=ve,li=class extends hi{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,e,i){let s=super.normalize(t);if(e)if("prepend"===i)this.nodes.length>1?e.raws.before=this.nodes[1].raws.before:delete e.raws.before;else if(this.first!==e)for(let t of s)t.raws.before=e.raws.before;return s}removeChild(t,e){let i=this.index(t);return!e&&0===i&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[i].raws.before),super.removeChild(t)}toResult(t={}){return new ni(new oi,this,t).stringify()}};li.registerLazyResult=t=>{ni=t},li.registerProcessor=t=>{oi=t};var ai=li;li.default=li,hi.registerRoot(li);let ci={comma:t=>ci.split(t,[","],!0),space:t=>ci.split(t,[" ","\n","\t"]),split(t,e,i){let s=[],r="",n=!1,o=0,h=!1,l="",a=!1;for(let i of t)a?a=!1:"\\"===i?a=!0:h?i===l&&(h=!1):'"'===i||"'"===i?(h=!0,l=i):"("===i?o+=1:")"===i?o>0&&(o-=1):0===o&&e.includes(i)&&(n=!0),n?(""!==r&&s.push(r.trim()),r="",n=!1):r+=i;return(i||""!==r)&&s.push(r.trim()),s}};var ui=ci;ci.default=ci;let fi=ve,di=ui,pi=class extends fi{constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return di.comma(this.selector)}set selectors(t){let e=this.selector?this.selector.match(/,\s*/):null,i=e?e[0]:","+this.raw("between","beforeOpen");this.selector=t.join(i)}};var mi=pi;pi.default=pi,fi.registerRule(pi);let gi=St,wi=he,yi=ri,bi=ai,vi=mi;const Ci={empty:!0,space:!0};let Ii=ve,Si=class{constructor(t){this.input=t,this.root=new bi,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let e,i,s,r=new yi;r.name=t[1].slice(1),""===r.name&&this.unnamedAtrule(r,t),this.init(r,t[2]);let n=!1,o=!1,h=[],l=[];for(;!this.tokenizer.endOfFile();){if(e=(t=this.tokenizer.nextToken())[0],"("===e||"["===e?l.push("("===e?")":"]"):"{"===e&&l.length>0?l.push("}"):e===l[l.length-1]&&l.pop(),0===l.length){if(";"===e){r.source.end=this.getPosition(t[2]),r.source.end.offset++,this.semicolon=!0;break}if("{"===e){o=!0;break}if("}"===e){if(h.length>0){for(s=h.length-1,i=h[s];i&&"space"===i[0];)i=h[--s];i&&(r.source.end=this.getPosition(i[3]||i[2]),r.source.end.offset++)}this.end(t);break}h.push(t)}else h.push(t);if(this.tokenizer.endOfFile()){n=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(h),h.length?(r.raws.afterName=this.spacesAndCommentsFromStart(h),this.raw(r,"params",h),n&&(t=h[h.length-1],r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++,this.spaces=r.raws.between,r.raws.between="")):(r.raws.afterName="",r.params=""),o&&(r.nodes=[],this.current=r)}checkMissedSemicolon(t){let e=this.colon(t);if(!1===e)return;let i,s=0;for(let r=e-1;r>=0&&(i=t[r],"space"===i[0]||(s+=1,2!==s));r--);throw this.input.error("Missed semicolon","word"===i[0]?i[3]+1:i[2])}colon(t){let e,i,s,r=0;for(let[n,o]of t.entries()){if(e=o,i=e[0],"("===i&&(r+=1),")"===i&&(r-=1),0===r&&":"===i){if(s){if("word"===s[0]&&"progid"===s[1])continue;return n}this.doubleColon(e)}s=e}return!1}comment(t){let e=new wi;this.init(e,t[2]),e.source.end=this.getPosition(t[3]||t[2]),e.source.end.offset++;let i=t[1].slice(2,-2);if(/^\s*$/.test(i))e.text="",e.raws.left=i,e.raws.right="";else{let t=i.match(/^(\s*)([^]*\S)(\s*)$/);e.text=t[2],e.raws.left=t[1],e.raws.right=t[3]}}createTokenizer(){this.tokenizer=function(t,e={}){let i,s,r,n,o,h,l,a,c,u,f=t.css.valueOf(),d=e.ignoreErrors,p=f.length,m=0,g=[],w=[];function y(e){throw t.error("Unclosed "+e,m)}return{back:function(t){w.push(t)},endOfFile:function(){return 0===w.length&&m>=p},nextToken:function(t){if(w.length)return w.pop();if(m>=p)return;let e=!!t&&t.ignoreUnclosed;switch(i=f.charCodeAt(m),i){case De:case Ue:case Ye:case Ze:case We:s=m;do{s+=1,i=f.charCodeAt(s)}while(i===Ue||i===De||i===Ye||i===Ze||i===We);u=["space",f.slice(m,s)],m=s-1;break;case Pe:case Ge:case Xe:case Je:case _e:case $e:case ze:{let t=String.fromCharCode(i);u=[t,t,m];break}case Ve:if(a=g.length?g.pop()[1]:"",c=f.charCodeAt(m+1),"url"===a&&c!==Fe&&c!==Ne&&c!==Ue&&c!==De&&c!==Ye&&c!==We&&c!==Ze){s=m;do{if(h=!1,s=f.indexOf(")",s+1),-1===s){if(d||e){s=m;break}y("bracket")}for(l=s;f.charCodeAt(l-1)===Le;)l-=1,h=!h}while(h);u=["brackets",f.slice(m,s+1),m,s],m=s}else s=f.indexOf(")",m+1),n=f.slice(m,s+1),-1===s||ti.test(n)?u=["(","(",m]:(u=["brackets",n,m,s],m=s);break;case Fe:case Ne:r=i===Fe?"'":'"',s=m;do{if(h=!1,s=f.indexOf(r,s+1),-1===s){if(d||e){s=m+1;break}y("string")}for(l=s;f.charCodeAt(l-1)===Le;)l-=1,h=!h}while(h);u=["string",f.slice(m,s+1),m,s],m=s;break;case He:Qe.lastIndex=m+1,Qe.test(f),s=0===Qe.lastIndex?f.length-1:Qe.lastIndex-2,u=["at-word",f.slice(m,s+1),m,s],m=s;break;case Le:for(s=m,o=!0;f.charCodeAt(s+1)===Le;)s+=1,o=!o;if(i=f.charCodeAt(s+1),o&&i!==je&&i!==Ue&&i!==De&&i!==Ye&&i!==Ze&&i!==We&&(s+=1,ei.test(f.charAt(s)))){for(;ei.test(f.charAt(s+1));)s+=1;f.charCodeAt(s+1)===Ue&&(s+=1)}u=["word",f.slice(m,s+1),m,s],m=s;break;default:i===je&&f.charCodeAt(m+1)===Ke?(s=f.indexOf("*/",m+2)+1,0===s&&(d||e?s=f.length:y("comment")),u=["comment",f.slice(m,s+1),m,s],m=s):(qe.lastIndex=m+1,qe.test(f),s=0===qe.lastIndex?f.length-1:qe.lastIndex-2,u=["word",f.slice(m,s+1),m,s],g.push(u),m=s)}return m++,u},position:function(){return m}}}(this.input)}decl(t,e){let i=new gi;this.init(i,t[0][2]);let s,r=t[t.length-1];for(";"===r[0]&&(this.semicolon=!0,t.pop()),i.source.end=this.getPosition(r[3]||r[2]||function(t){for(let e=t.length-1;e>=0;e--){let i=t[e],s=i[3]||i[2];if(s)return s}}(t)),i.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),i.raws.before+=t.shift()[1];for(i.source.start=this.getPosition(t[0][2]),i.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;i.prop+=t.shift()[1]}for(i.raws.between="";t.length;){if(s=t.shift(),":"===s[0]){i.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),i.raws.between+=s[1]}"_"!==i.prop[0]&&"*"!==i.prop[0]||(i.raws.before+=i.prop[0],i.prop=i.prop.slice(1));let n,o=[];for(;t.length&&(n=t[0][0],"space"===n||"comment"===n);)o.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(s=t[e],"!important"===s[1].toLowerCase()){i.important=!0;let s=this.stringFrom(t,e);s=this.spacesFromEnd(t)+s," !important"!==s&&(i.raws.important=s);break}if("important"===s[1].toLowerCase()){let s=t.slice(0),r="";for(let t=e;t>0;t--){let e=s[t][0];if(0===r.trim().indexOf("!")&&"space"!==e)break;r=s.pop()[1]+r}0===r.trim().indexOf("!")&&(i.important=!0,i.raws.important=r,t=s)}if("space"!==s[0]&&"comment"!==s[0])break}t.some(t=>"space"!==t[0]&&"comment"!==t[0])&&(i.raws.between+=o.map(t=>t[1]).join(""),o=[]),this.raw(i,"value",o.concat(t),e),i.value.includes(":")&&!e&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let e=new vi;this.init(e,t[2]),e.selector="",e.raws.between="",this.current=e}end(t){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(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}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(t){if(this.spaces+=t[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(t){let e=this.input.fromOffset(t);return{column:e.col,line:e.line,offset:t}}init(t,e){this.current.push(t),t.source={input:this.input,start:this.getPosition(e)},t.raws.before=this.spaces,this.spaces="","comment"!==t.type&&(this.semicolon=!1)}other(t){let e=!1,i=null,s=!1,r=null,n=[],o=t[1].startsWith("--"),h=[],l=t;for(;l;){if(i=l[0],h.push(l),"("===i||"["===i)r||(r=l),n.push("("===i?")":"]");else if(o&&s&&"{"===i)r||(r=l),n.push("}");else if(0===n.length){if(";"===i){if(s)return void this.decl(h,o);break}if("{"===i)return void this.rule(h);if("}"===i){this.tokenizer.back(h.pop()),e=!0;break}":"===i&&(s=!0)}else i===n[n.length-1]&&(n.pop(),0===n.length&&(r=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(e=!0),n.length>0&&this.unclosedBracket(r),e&&s){if(!o)for(;h.length&&(l=h[h.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(h.pop());this.decl(h,o)}else this.unknownWord(h)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t)}this.endFile()}precheckMissedSemicolon(){}raw(t,e,i,s){let r,n,o,h,l=i.length,a="",c=!0;for(let t=0;t<l;t+=1)r=i[t],n=r[0],"space"!==n||t!==l-1||s?"comment"===n?(h=i[t-1]?i[t-1][0]:"empty",o=i[t+1]?i[t+1][0]:"empty",Ci[h]||Ci[o]||","===a.slice(-1)?c=!1:a+=r[1]):a+=r[1]:c=!1;if(!c){let s=i.reduce((t,e)=>t+e[1],"");t.raws[e]={raw:s,value:a}}t[e]=a}rule(t){t.pop();let e=new vi;this.init(e,t[0][2]),e.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(e,"selector",t),this.current=e}spacesAndCommentsFromEnd(t){let e,i="";for(;t.length&&(e=t[t.length-1][0],"space"===e||"comment"===e);)i=t.pop()[1]+i;return i}spacesAndCommentsFromStart(t){let e,i="";for(;t.length&&(e=t[0][0],"space"===e||"comment"===e);)i+=t.shift()[1];return i}spacesFromEnd(t){let e,i="";for(;t.length&&(e=t[t.length-1][0],"space"===e);)i=t.pop()[1]+i;return i}stringFrom(t,e){let i="";for(let s=e;s<t.length;s++)i+=t[s][1];return t.splice(e,t.length-e),i}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word",{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,e){throw this.input.error("At-rule without name",{offset:e[2]},{offset:e[2]+e[1].length})}},ki=Jt;function Ai(t,e){let i=new ki(t,e),s=new Si(i);try{s.parse()}catch(t){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===t.name&&e&&e.from&&(/\.scss$/i.test(e.from)?t.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(e.from)?t.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(e.from)&&(t.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),t}return s.root}var xi=Ai;Ai.default=Ai,Ii.registerParse(Ai);let{isClean:Ri,my:Mi}=ot,Oi=re,Ti=ft,Ei=ve,Bi=Ae,Fi=Re,Ni=Be,Li=xi,ji=ai;const Di={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Ui={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},Wi={Once:!0,postcssPlugin:!0,prepare:!0};function Yi(t){return"object"==typeof t&&"function"==typeof t.then}function Zi(t){let e=!1,i=Di[t.type];return"decl"===t.type?e=t.prop.toLowerCase():"atrule"===t.type&&(e=t.name.toLowerCase()),e&&t.append?[i,i+"-"+e,0,i+"Exit",i+"Exit-"+e]:e?[i,i+"-"+e,i+"Exit",i+"Exit-"+e]:t.append?[i,0,i+"Exit"]:[i,i+"Exit"]}function Pi(t){let e;return e="document"===t.type?["Document",0,"DocumentExit"]:"root"===t.type?["Root",0,"RootExit"]:Zi(t),{eventIndex:0,events:e,iterator:0,node:t,visitorIndex:0,visitors:[]}}function Gi(t){return t[Ri]=!1,t.nodes&&t.nodes.forEach(t=>Gi(t)),t}let Vi={},zi=class t{constructor(e,i,s){let r;if(this.stringified=!1,this.processed=!1,"object"!=typeof i||null===i||"root"!==i.type&&"document"!==i.type)if(i instanceof t||i instanceof Ni)r=Gi(i.root),i.map&&(void 0===s.map&&(s.map={}),s.map.inline||(s.map.inline=!1),s.map.prev=i.map);else{let t=Li;s.syntax&&(t=s.syntax.parse),s.parser&&(t=s.parser),t.parse&&(t=t.parse);try{r=t(i,s)}catch(t){this.processed=!0,this.error=t}r&&!r[Mi]&&Ei.rebuild(r)}else r=Gi(i);this.result=new Ni(e,r,s),this.helpers={...Vi,postcss:Vi,result:this.result},this.plugins=this.processor.plugins.map(t=>"object"==typeof t&&t.prepare?{...t,...t.prepare(this.result)}:t)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,e){let i=this.result.lastPlugin;try{if(e&&e.addToError(t),this.error=t,"CssSyntaxError"!==t.name||t.plugin){if(i.postcssVersion&&"production"!==process.env.NODE_ENV){let t=i.postcssPlugin,e=i.postcssVersion,s=this.result.processor.version,r=e.split("."),n=s.split(".");(r[0]!==n[0]||parseInt(r[1])>parseInt(n[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+s+", but "+t+" uses "+e+". Perhaps this is the source of the error below.")}}else t.plugin=i.postcssPlugin,t.setMessage()}catch(t){console&&console.error&&console.error(t)}return t}prepareVisitors(){this.listeners={};let t=(t,e,i)=>{this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push([t,i])};for(let e of this.plugins)if("object"==typeof e)for(let i in e){if(!Ui[i]&&/^[A-Z]/.test(i))throw new Error(`Unknown event ${i} in ${e.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Wi[i])if("object"==typeof e[i])for(let s in e[i])t(e,"*"===s?i:i+"-"+s.toLowerCase(),e[i][s]);else"function"==typeof e[i]&&t(e,i,e[i])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let e=this.plugins[t],i=this.runOnRoot(e);if(Yi(i))try{await i}catch(t){throw this.handleError(t)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ri];){t[Ri]=!0;let e=[Pi(t)];for(;e.length>0;){let t=this.visitTick(e);if(Yi(t))try{await t}catch(t){let i=e[e.length-1].node;throw this.handleError(t,i)}}}if(this.listeners.OnceExit)for(let[e,i]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(t=>i(t,this.helpers));await Promise.all(e)}else await i(t,this.helpers)}catch(t){throw this.handleError(t)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if("object"==typeof t&&t.Once){if("document"===this.result.root.type){let e=this.result.root.nodes.map(e=>t.Once(e,this.helpers));return Yi(e[0])?Promise.all(e):e}return t.Once(this.result.root,this.helpers)}if("function"==typeof t)return t(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,e=Ti;t.syntax&&(e=t.syntax.stringify),t.stringifier&&(e=t.stringifier),e.stringify&&(e=e.stringify);let i=new Oi(e,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[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 t of this.plugins)if(Yi(this.runOnRoot(t)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[Ri];)t[Ri]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,e){return"production"!==process.env.NODE_ENV&&("from"in this.opts||Fi("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(t,e)}toString(){return this.css}visitSync(t,e){for(let[i,s]of t){let t;this.result.lastPlugin=i;try{t=s(e,this.helpers)}catch(t){throw this.handleError(t,e.proxyOf)}if("root"!==e.type&&"document"!==e.type&&!e.parent)return!0;if(Yi(t))throw this.getAsyncError()}}visitTick(t){let e=t[t.length-1],{node:i,visitors:s}=e;if("root"!==i.type&&"document"!==i.type&&!i.parent)return void t.pop();if(s.length>0&&e.visitorIndex<s.length){let[t,r]=s[e.visitorIndex];e.visitorIndex+=1,e.visitorIndex===s.length&&(e.visitors=[],e.visitorIndex=0),this.result.lastPlugin=t;try{return r(i.toProxy(),this.helpers)}catch(t){throw this.handleError(t,i)}}if(0!==e.iterator){let s,r=e.iterator;for(;s=i.nodes[i.indexes[r]];)if(i.indexes[r]+=1,!s[Ri])return s[Ri]=!0,void t.push(Pi(s));e.iterator=0,delete i.indexes[r]}let r=e.events;for(;e.eventIndex<r.length;){let t=r[e.eventIndex];if(e.eventIndex+=1,0===t)return void(i.nodes&&i.nodes.length&&(i[Ri]=!0,e.iterator=i.getIterator()));if(this.listeners[t])return void(e.visitors=this.listeners[t])}t.pop()}walkSync(t){t[Ri]=!0;let e=Zi(t);for(let i of e)if(0===i)t.nodes&&t.each(t=>{t[Ri]||this.walkSync(t)});else{let e=this.listeners[i];if(e&&this.visitSync(e,t.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"}};zi.registerPostcss=t=>{Vi=t};var Xi=zi;zi.default=zi,ji.registerLazyResult(zi),Bi.registerLazyResult(zi);let Ji=re,$i=ft,Ki=Re,_i=xi;const Hi=Be;let Qi=class{constructor(t,e,i){let s;e=e.toString(),this.stringified=!1,this.l=t,this.u=e,this.p=i,this.m=void 0;let r=$i;this.result=new Hi(this.l,s,this.p),this.result.css=e;let n=this;Object.defineProperty(this.result,"root",{get:()=>n.root});let o=new Ji(r,s,this.p,e);if(o.isMap()){let[t,e]=o.generate();t&&(this.result.css=t),e&&(this.result.map=e)}else o.clearAnnotation(),this.result.css=o.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,e){return"production"!==process.env.NODE_ENV&&("from"in this.p||Ki("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(t,e)}toString(){return this.u}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.v)return this.v;let t,e=_i;try{t=e(this.u,this.p)}catch(t){this.error=t}if(this.error)throw this.error;return this.v=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}};var qi=Qi;Qi.default=Qi;let ts=qi,es=Xi,is=Ae,ss=ai,rs=class{constructor(t=[]){this.version="8.4.38",this.plugins=this.normalize(t)}normalize(t){let e=[];for(let i of t)if(!0===i.postcss?i=i():i.postcss&&(i=i.postcss),"object"==typeof i&&Array.isArray(i.plugins))e=e.concat(i.plugins);else if("object"==typeof i&&i.postcssPlugin)e.push(i);else if("function"==typeof i)e.push(i);else{if("object"!=typeof i||!i.parse&&!i.stringify)throw new Error(i+" 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 e}process(t,e={}){return this.plugins.length||e.parser||e.stringifier||e.syntax?new es(this,t,e):new ts(this,t,e)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};var ns=rs;rs.default=rs,ss.registerProcessor(rs),is.registerProcessor(rs);let os=St,hs=Bt,ls=he,as=ri,cs=Jt,us=ai,fs=mi;function ds(t,e){if(Array.isArray(t))return t.map(t=>ds(t));let{inputs:i,...s}=t;if(i){e=[];for(let t of i){let i={...t,__proto__:cs.prototype};i.map&&(i.map={...i.map,__proto__:hs.prototype}),e.push(i)}}if(s.nodes&&(s.nodes=t.nodes.map(t=>ds(t,e))),s.source){let{inputId:t,...i}=s.source;s.source=i,null!=t&&(s.source.input=e[t])}if("root"===s.type)return new us(s);if("decl"===s.type)return new os(s);if("rule"===s.type)return new fs(s);if("comment"===s.type)return new ls(s);if("atrule"===s.type)return new as(s);throw new Error("Unknown node type: "+t.type)}var ps=ds;ds.default=ds;let ms=nt,gs=St,ws=Xi,ys=ve,bs=ns,vs=ft,Cs=ps,Is=Ae,Ss=Oe,ks=he,As=ri,xs=Be,Rs=Jt,Ms=xi,Os=ui,Ts=mi,Es=ai,Bs=vt;function Fs(...t){return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),new bs(t)}Fs.plugin=function(t,e){let i,s=!1;function r(...i){console&&console.warn&&!s&&(s=!0,console.warn(t+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(t+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let r=e(...i);return r.postcssPlugin=t,r.postcssVersion=(new bs).version,r}return Object.defineProperty(r,"postcss",{get:()=>(i||(i=r()),i)}),r.process=function(t,e,i){return Fs([r(i)]).process(t,e)},r},Fs.stringify=vs,Fs.parse=Ms,Fs.fromJSON=Cs,Fs.list=Os,Fs.comment=t=>new ks(t),Fs.atRule=t=>new As(t),Fs.decl=t=>new gs(t),Fs.rule=t=>new Ts(t),Fs.root=t=>new Es(t),Fs.document=t=>new Is(t),Fs.CssSyntaxError=ms,Fs.Declaration=gs,Fs.Container=ys,Fs.Processor=bs,Fs.Document=Is,Fs.Comment=ks,Fs.Warning=Ss,Fs.AtRule=As,Fs.Result=xs,Fs.Input=Rs,Fs.Rule=Ts,Fs.Root=Es,Fs.Node=Bs,ws.registerPostcss(Fs);var Ns=Fs;Fs.default=Fs;const Ls=K(Ns);Ls.stringify,Ls.fromJSON,Ls.plugin,Ls.parse,Ls.list,Ls.document,Ls.comment,Ls.atRule,Ls.rule,Ls.decl,Ls.root,Ls.CssSyntaxError,Ls.Declaration,Ls.Container,Ls.Processor,Ls.Document,Ls.Comment,Ls.Warning,Ls.AtRule,Ls.Result,Ls.Input,Ls.Rule,Ls.Root,Ls.Node;var js=Object.defineProperty,Ds=(t,e,i)=>((t,e,i)=>e in t?js(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);function Us(t){return t&&t.o&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ws(t){if(t.o)return t;var e=t.default;if("function"==typeof e){var i=function t(){return this instanceof t?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};i.prototype=e.prototype}else i={};return Object.defineProperty(i,"o",{value:!0}),Object.keys(t).forEach(function(e){var s=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(i,e,s.get?s:{enumerable:!0,get:function(){return t[e]}})}),i}var Ys={exports:{}},Zs=String,Ps=function(){return{isColorSupported:!1,reset:Zs,bold:Zs,dim:Zs,italic:Zs,underline:Zs,inverse:Zs,hidden:Zs,strikethrough:Zs,black:Zs,red:Zs,green:Zs,yellow:Zs,blue:Zs,magenta:Zs,cyan:Zs,white:Zs,gray:Zs,bgBlack:Zs,bgRed:Zs,bgGreen:Zs,bgYellow:Zs,bgBlue:Zs,bgMagenta:Zs,bgCyan:Zs,bgWhite:Zs}};Ys.exports=Ps(),Ys.exports.createColors=Ps;var Gs=Ys.exports;const Vs=Ws(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let zs=Gs,Xs=Vs,Js=class t extends Error{constructor(e,i,s,r,n,o){super(e),this.name="CssSyntaxError",this.reason=e,n&&(this.file=n),r&&(this.source=r),o&&(this.plugin=o),void 0!==i&&void 0!==s&&("number"==typeof i?(this.line=i,this.column=s):(this.line=i.line,this.column=i.column,this.endLine=s.line,this.endColumn=s.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,t)}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(t){if(!this.source)return"";let e=this.source;null==t&&(t=zs.isColorSupported),Xs&&t&&(e=Xs(e));let i,s,r=e.split(/\r?\n/),n=Math.max(this.line-3,0),o=Math.min(this.line+2,r.length),h=String(o).length;if(t){let{bold:t,gray:e,red:r}=zs.createColors(!0);i=e=>t(r(e)),s=t=>e(t)}else i=s=t=>t;return r.slice(n,o).map((t,e)=>{let r=n+1+e,o=" "+(" "+r).slice(-h)+" | ";if(r===this.line){let e=s(o.replace(/\d/g," "))+t.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+s(o)+t+"\n "+e+i("^")}return" "+s(o)+t}).join("\n")}toString(){let t=this.showSourceCode();return t&&(t="\n\n"+t+"\n"),this.name+": "+this.message+t}};var $s=Js;Js.default=Js;var Ks={};Ks.isClean=Symbol("isClean"),Ks.my=Symbol("my");const _s={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Hs=class{constructor(t){this.builder=t}atrule(t,e){let i="@"+t.name,s=t.params?this.rawValue(t,"params"):"";if(void 0!==t.raws.afterName?i+=t.raws.afterName:s&&(i+=" "),t.nodes)this.block(t,i+s);else{let r=(t.raws.between||"")+(e?";":"");this.builder(i+s+r,t)}}beforeAfter(t,e){let i;i="decl"===t.type?this.raw(t,null,"beforeDecl"):"comment"===t.type?this.raw(t,null,"beforeComment"):"before"===e?this.raw(t,null,"beforeRule"):this.raw(t,null,"beforeClose");let s=t.parent,r=0;for(;s&&"root"!==s.type;)r+=1,s=s.parent;if(i.includes("\n")){let e=this.raw(t,null,"indent");if(e.length)for(let t=0;t<r;t++)i+=e}return i}block(t,e){let i,s=this.raw(t,"between","beforeOpen");this.builder(e+s+"{",t,"start"),t.nodes&&t.nodes.length?(this.body(t),i=this.raw(t,"after")):i=this.raw(t,"after","emptyBody"),i&&this.builder(i),this.builder("}",t,"end")}body(t){let e=t.nodes.length-1;for(;e>0&&"comment"===t.nodes[e].type;)e-=1;let i=this.raw(t,"semicolon");for(let s=0;s<t.nodes.length;s++){let r=t.nodes[s],n=this.raw(r,"before");n&&this.builder(n),this.stringify(r,e!==s||i)}}comment(t){let e=this.raw(t,"left","commentLeft"),i=this.raw(t,"right","commentRight");this.builder("/*"+e+t.text+i+"*/",t)}decl(t,e){let i=this.raw(t,"between","colon"),s=t.prop+i+this.rawValue(t,"value");t.important&&(s+=t.raws.important||" !important"),e&&(s+=";"),this.builder(s,t)}document(t){this.body(t)}raw(t,e,i){let s;if(i||(i=e),e&&(s=t.raws[e],void 0!==s))return s;let r=t.parent;if("before"===i){if(!r||"root"===r.type&&r.first===t)return"";if(r&&"document"===r.type)return""}if(!r)return _s[i];let n=t.root();if(n.rawCache||(n.rawCache={}),void 0!==n.rawCache[i])return n.rawCache[i];if("before"===i||"after"===i)return this.beforeAfter(t,i);{let r="raw"+((o=i)[0].toUpperCase()+o.slice(1));this[r]?s=this[r](n,t):n.walk(t=>{if(s=t.raws[e],void 0!==s)return!1})}var o;return void 0===s&&(s=_s[i]),n.rawCache[i]=s,s}rawBeforeClose(t){let e;return t.walk(t=>{if(t.nodes&&t.nodes.length>0&&void 0!==t.raws.after)return e=t.raws.after,e.includes("\n")&&(e=e.replace(/[^\n]+$/,"")),!1}),e&&(e=e.replace(/\S/g,"")),e}rawBeforeComment(t,e){let i;return t.walkComments(t=>{if(void 0!==t.raws.before)return i=t.raws.before,i.includes("\n")&&(i=i.replace(/[^\n]+$/,"")),!1}),void 0===i?i=this.raw(e,null,"beforeDecl"):i&&(i=i.replace(/\S/g,"")),i}rawBeforeDecl(t,e){let i;return t.walkDecls(t=>{if(void 0!==t.raws.before)return i=t.raws.before,i.includes("\n")&&(i=i.replace(/[^\n]+$/,"")),!1}),void 0===i?i=this.raw(e,null,"beforeRule"):i&&(i=i.replace(/\S/g,"")),i}rawBeforeOpen(t){let e;return t.walk(t=>{if("decl"!==t.type&&(e=t.raws.between,void 0!==e))return!1}),e}rawBeforeRule(t){let e;return t.walk(i=>{if(i.nodes&&(i.parent!==t||t.first!==i)&&void 0!==i.raws.before)return e=i.raws.before,e.includes("\n")&&(e=e.replace(/[^\n]+$/,"")),!1}),e&&(e=e.replace(/\S/g,"")),e}rawColon(t){let e;return t.walkDecls(t=>{if(void 0!==t.raws.between)return e=t.raws.between.replace(/[^\s:]/g,""),!1}),e}rawEmptyBody(t){let e;return t.walk(t=>{if(t.nodes&&0===t.nodes.length&&(e=t.raws.after,void 0!==e))return!1}),e}rawIndent(t){if(t.raws.indent)return t.raws.indent;let e;return t.walk(i=>{let s=i.parent;if(s&&s!==t&&s.parent&&s.parent===t&&void 0!==i.raws.before){let t=i.raws.before.split("\n");return e=t[t.length-1],e=e.replace(/\S/g,""),!1}}),e}rawSemicolon(t){let e;return t.walk(t=>{if(t.nodes&&t.nodes.length&&"decl"===t.last.type&&(e=t.raws.semicolon,void 0!==e))return!1}),e}rawValue(t,e){let i=t[e],s=t.raws[e];return s&&s.value===i?s.raw:i}root(t){this.body(t),t.raws.after&&this.builder(t.raws.after)}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(t.raws.ownSemicolon,t,"end")}stringify(t,e){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,e)}};var Qs=Hs;Hs.default=Hs;let qs=Qs;function tr(t,e){new qs(e).stringify(t)}var er=tr;tr.default=tr;let{isClean:ir,my:sr}=Ks,rr=$s,nr=Qs,or=er;function hr(t,e){let i=new t.constructor;for(let s in t){if(!Object.prototype.hasOwnProperty.call(t,s))continue;if("proxyCache"===s)continue;let r=t[s],n=typeof r;"parent"===s&&"object"===n?e&&(i[s]=e):"source"===s?i[s]=r:Array.isArray(r)?i[s]=r.map(t=>hr(t,i)):("object"===n&&null!==r&&(r=hr(r)),i[s]=r)}return i}let lr=class{constructor(t={}){this.raws={},this[ir]=!1,this[sr]=!0;for(let e in t)if("nodes"===e){this.nodes=[];for(let i of t[e])"function"==typeof i.clone?this.append(i.clone()):this.append(i)}else this[e]=t[e]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let e=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${e.input.from}:${e.start.line}:${e.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let e in t)this[e]=t[e];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let e=hr(this);for(let i in t)e[i]=t[i];return e}cloneAfter(t={}){let e=this.clone(t);return this.parent.insertAfter(this,e),e}cloneBefore(t={}){let e=this.clone(t);return this.parent.insertBefore(this,e),e}error(t,e={}){if(this.source){let{end:i,start:s}=this.rangeBy(e);return this.source.input.error(t,{column:s.column,line:s.line},{column:i.column,line:i.line},e)}return new rr(t)}getProxyProcessor(){return{get:(t,e)=>"proxyOf"===e?t:"root"===e?()=>t.root().toProxy():t[e],set:(t,e,i)=>(t[e]===i||(t[e]=i,"prop"!==e&&"value"!==e&&"name"!==e&&"params"!==e&&"important"!==e&&"text"!==e||t.markDirty()),!0)}}markDirty(){if(this[ir]){this[ir]=!1;let t=this;for(;t=t.parent;)t[ir]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t,e){let i=this.source.start;if(t.index)i=this.positionInside(t.index,e);else if(t.word){let s=(e=this.toString()).indexOf(t.word);-1!==s&&(i=this.positionInside(s,e))}return i}positionInside(t,e){let i=e||this.toString(),s=this.source.start.column,r=this.source.start.line;for(let e=0;e<t;e++)"\n"===i[e]?(s=1,r+=1):s+=1;return{column:s,line:r}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t){let e={column:this.source.start.column,line:this.source.start.line},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:e.column+1,line:e.line};if(t.word){let s=this.toString(),r=s.indexOf(t.word);-1!==r&&(e=this.positionInside(r,s),i=this.positionInside(r+t.word.length,s))}else t.start?e={column:t.start.column,line:t.start.line}:t.index&&(e=this.positionInside(t.index)),t.end?i={column:t.end.column,line:t.end.line}:"number"==typeof t.endIndex?i=this.positionInside(t.endIndex):t.index&&(i=this.positionInside(t.index+1));return(i.line<e.line||i.line===e.line&&i.column<=e.column)&&(i={column:e.column+1,line:e.line}),{end:i,start:e}}raw(t,e){return(new nr).raw(this,t,e)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let e=this,i=!1;for(let s of t)s===this?i=!0:i?(this.parent.insertAfter(e,s),e=s):this.parent.insertBefore(e,s);i||this.remove()}return this}root(){let t=this;for(;t.parent&&"document"!==t.parent.type;)t=t.parent;return t}toJSON(t,e){let i={},s=null==e;e=e||new Map;let r=0;for(let t in this){if(!Object.prototype.hasOwnProperty.call(this,t))continue;if("parent"===t||"proxyCache"===t)continue;let s=this[t];if(Array.isArray(s))i[t]=s.map(t=>"object"==typeof t&&t.toJSON?t.toJSON(null,e):t);else if("object"==typeof s&&s.toJSON)i[t]=s.toJSON(null,e);else if("source"===t){let n=e.get(s.input);null==n&&(n=r,e.set(s.input,r),r++),i[t]={end:s.end,inputId:n,start:s.start}}else i[t]=s}return s&&(i.inputs=[...e.keys()].map(t=>t.toJSON())),i}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=or){t.stringify&&(t=t.stringify);let e="";return t(this,t=>{e+=t}),e}warn(t,e,i){let s={node:this};for(let t in i)s[t]=i[t];return t.warn(e,s)}get proxyOf(){return this}};var ar=lr;lr.default=lr;let cr=ar,ur=class extends cr{constructor(t){t&&void 0!==t.value&&"string"!=typeof t.value&&(t={...t,value:String(t.value)}),super(t),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var fr=ur;ur.default=ur;var dr={nanoid:(t=21)=>{let e="",i=t;for(;i--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return e}};let{SourceMapConsumer:pr,SourceMapGenerator:mr}=Vs,{existsSync:gr,readFileSync:wr}=Vs,{dirname:yr,join:br}=Vs,vr=class{constructor(t,e){if(!1===e.map)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let i=e.map?e.map.prev:void 0,s=this.loadMap(e.from,i);!this.mapFile&&e.from&&(this.mapFile=e.from),this.mapFile&&(this.root=yr(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new pr(this.text)),this.consumerCache}decodeInline(t){if(/^data:application\/json;charset=utf-?8,/.test(t)||/^data:application\/json,/.test(t))return decodeURIComponent(t.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(t)||/^data:application\/json;base64,/.test(t))return e=t.substr(RegExp.lastMatch.length),Buffer?Buffer.from(e,"base64").toString():window.atob(e);var e;let i=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+i)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return"object"==typeof t&&("string"==typeof t.mappings||"string"==typeof t.h||Array.isArray(t.sections))}loadAnnotation(t){let e=t.match(/\/\*\s*# sourceMappingURL=/gm);if(!e)return;let i=t.lastIndexOf(e.pop()),s=t.indexOf("*/",i);i>-1&&s>-1&&(this.annotation=this.getAnnotationURL(t.substring(i,s)))}loadFile(t){if(this.root=yr(t),gr(t))return this.mapFile=t,wr(t,"utf-8").toString().trim()}loadMap(t,e){if(!1===e)return!1;if(e){if("string"==typeof e)return e;if("function"!=typeof e){if(e instanceof pr)return mr.fromSourceMap(e).toString();if(e instanceof mr)return e.toString();if(this.isMap(e))return JSON.stringify(e);throw new Error("Unsupported previous source map format: "+e.toString())}{let i=e(t);if(i){let t=this.loadFile(i);if(!t)throw new Error("Unable to load previous source map: "+i.toString());return t}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return t&&(e=br(yr(t),e)),this.loadFile(e)}}}startWith(t,e){return!!t&&t.substr(0,e.length)===e}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Cr=vr;vr.default=vr;let{SourceMapConsumer:Ir,SourceMapGenerator:Sr}=Vs,{fileURLToPath:kr,pathToFileURL:Ar}=Vs,{isAbsolute:xr,resolve:Rr}=Vs,{nanoid:Mr}=dr,Or=Vs,Tr=$s,Er=Cr,Br=Symbol("fromOffsetCache"),Fr=Boolean(Ir&&Sr),Nr=Boolean(Rr&&xr),Lr=class{constructor(t,e={}){if(null==t||"object"==typeof t&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,e.from&&(!Nr||/^\w+:\/\//.test(e.from)||xr(e.from)?this.file=e.from:this.file=Rr(e.from)),Nr&&Fr){let t=new Er(this.css,e);if(t.text){this.map=t;let e=t.consumer().file;!this.file&&e&&(this.file=this.mapResolve(e))}}this.file||(this.id="<input css "+Mr(6)+">"),this.map&&(this.map.file=this.from)}error(t,e,i,s={}){let r,n,o;if(e&&"object"==typeof e){let t=e,s=i;if("number"==typeof t.offset){let s=this.fromOffset(t.offset);e=s.line,i=s.col}else e=t.line,i=t.column;if("number"==typeof s.offset){let t=this.fromOffset(s.offset);n=t.line,o=t.col}else n=s.line,o=s.column}else if(!i){let t=this.fromOffset(e);e=t.line,i=t.col}let h=this.origin(e,i,n,o);return r=h?new Tr(t,void 0===h.endLine?h.line:{column:h.column,line:h.line},void 0===h.endLine?h.column:{column:h.endColumn,line:h.endLine},h.source,h.file,s.plugin):new Tr(t,void 0===n?e:{column:i,line:e},void 0===n?i:{column:o,line:n},this.css,this.file,s.plugin),r.input={column:i,endColumn:o,endLine:n,line:e,source:this.css},this.file&&(Ar&&(r.input.url=Ar(this.file).toString()),r.input.file=this.file),r}fromOffset(t){let e,i;if(this[Br])i=this[Br];else{let t=this.css.split("\n");i=new Array(t.length);let e=0;for(let s=0,r=t.length;s<r;s++)i[s]=e,e+=t[s].length+1;this[Br]=i}e=i[i.length-1];let s=0;if(t>=e)s=i.length-1;else{let e,r=i.length-2;for(;s<r;)if(e=s+(r-s>>1),t<i[e])r=e-1;else{if(!(t>=i[e+1])){s=e;break}s=e+1}}return{col:t-i[s]+1,line:s+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:Rr(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,e,i,s){if(!this.map)return!1;let r,n,o=this.map.consumer(),h=o.originalPositionFor({column:e,line:t});if(!h.source)return!1;"number"==typeof i&&(r=o.originalPositionFor({column:s,line:i})),n=xr(h.source)?Ar(h.source):new URL(h.source,this.map.consumer().sourceRoot||Ar(this.map.mapFile));let l={column:h.column,endColumn:r&&r.column,endLine:r&&r.line,line:h.line,url:n.toString()};if("file:"===n.protocol){if(!kr)throw new Error("file: protocol is not available in this PostCSS build");l.file=kr(n)}let a=o.sourceContentFor(h.source);return a&&(l.source=a),l}toJSON(){let t={};for(let e of["hasBOM","css","file","id"])null!=this[e]&&(t[e]=this[e]);return this.map&&(t.map={...this.map},t.map.consumerCache&&(t.map.consumerCache=void 0)),t}get from(){return this.file||this.id}};var jr=Lr;Lr.default=Lr,Or&&Or.registerInput&&Or.registerInput(Lr);let{SourceMapConsumer:Dr,SourceMapGenerator:Ur}=Vs,{dirname:Wr,relative:Yr,resolve:Zr,sep:Pr}=Vs,{pathToFileURL:Gr}=Vs,Vr=jr,zr=Boolean(Dr&&Ur),Xr=Boolean(Wr&&Zr&&Yr&&Pr);var Jr=class{constructor(t,e,i,s){this.stringify=t,this.mapOpts=i.map||{},this.root=e,this.opts=i,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 t;t=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 e="\n";this.css.includes("\r\n")&&(e="\r\n"),this.css+=e+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let e,i=this.toUrl(this.path(t.file)),s=t.root||Wr(t.file);!1===this.mapOpts.sourcesContent?(e=new Dr(t.text),e.sourcesContent&&(e.sourcesContent=null)):e=t.consumer(),this.map.applySourceMap(e,i,this.toUrl(this.path(s)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let t;for(let e=this.root.nodes.length-1;e>=0;e--)t=this.root.nodes[e],"comment"===t.type&&0===t.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(e)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Xr&&zr&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=Ur.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new Ur({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 Ur({file:this.outputFile(),ignoreInvalidMapping:!0});let t,e,i=1,s=1,r="<no source>",n={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(o,h,l)=>{if(this.css+=o,h&&"end"!==l&&(n.generated.line=i,n.generated.column=s-1,h.source&&h.source.start?(n.source=this.sourcePath(h),n.original.line=h.source.start.line,n.original.column=h.source.start.column-1,this.map.addMapping(n)):(n.source=r,n.original.line=1,n.original.column=0,this.map.addMapping(n))),t=o.match(/\n/g),t?(i+=t.length,e=o.lastIndexOf("\n"),s=o.length-e):s+=o.length,h&&"start"!==l){let t=h.parent||{raws:{}};("decl"===h.type||"atrule"===h.type&&!h.nodes)&&h===t.last&&!t.raws.semicolon||(h.source&&h.source.end?(n.source=this.sourcePath(h),n.original.line=h.source.end.line,n.original.column=h.source.end.column-1,n.generated.line=i,n.generated.column=s-2,this.map.addMapping(n)):(n.source=r,n.original.line=1,n.original.column=0,n.generated.line=i,n.generated.column=s-1,this.map.addMapping(n)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(t=>t.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let t=this.mapOpts.annotation;return(void 0===t||!0===t)&&(!this.previous().length||this.previous().some(t=>t.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(t=>t.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute)return t;if(60===t.charCodeAt(0))return t;if(/^\w+:\/\//.test(t))return t;let e=this.memoizedPaths.get(t);if(e)return e;let i=this.opts.to?Wr(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(i=Wr(Zr(i,this.mapOpts.annotation)));let s=Yr(i,t);return this.memoizedPaths.set(t,s),s}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let e=t.source.input.map;this.previousMaps.includes(e)||this.previousMaps.push(e)}});else{let t=new Vr(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(e=>{if(e.source){let i=e.source.input.from;if(i&&!t[i]){t[i]=!0;let s=this.usesFileUrls?this.toFileUrl(i):this.toUrl(this.path(i));this.map.setSourceContent(s,e.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(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let e=this.memoizedFileURLs.get(t);if(e)return e;if(Gr){let e=Gr(t).toString();return this.memoizedFileURLs.set(t,e),e}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let e=this.memoizedURLs.get(t);if(e)return e;"\\"===Pr&&(t=t.replace(/\\/g,"/"));let i=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,i),i}};let $r=ar,Kr=class extends $r{constructor(t){super(t),this.type="comment"}};var _r=Kr;Kr.default=Kr;let Hr,Qr,qr,tn,{isClean:en,my:sn}=Ks,rn=fr,nn=_r,on=ar;function hn(t){return t.map(t=>(t.nodes&&(t.nodes=hn(t.nodes)),delete t.source,t))}function ln(t){if(t[en]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)ln(e)}let an=class t extends on{append(...t){for(let e of t){let t=this.normalize(e,this.last);for(let e of t)this.proxyOf.nodes.push(e)}return this.markDirty(),this}cleanRaws(t){if(super.cleanRaws(t),this.nodes)for(let e of this.nodes)e.cleanRaws(t)}each(t){if(!this.proxyOf.nodes)return;let e,i,s=this.getIterator();for(;this.indexes[s]<this.proxyOf.nodes.length&&(e=this.indexes[s],i=t(this.proxyOf.nodes[e],e),!1!==i);)this.indexes[s]+=1;return delete this.indexes[s],i}every(t){return this.nodes.every(t)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let t=this.lastEach;return this.indexes[t]=0,t}getProxyProcessor(){return{get:(t,e)=>"proxyOf"===e?t:t[e]?"each"===e||"string"==typeof e&&e.startsWith("walk")?(...i)=>t[e](...i.map(t=>"function"==typeof t?(e,i)=>t(e.toProxy(),i):t)):"every"===e||"some"===e?i=>t[e]((t,...e)=>i(t.toProxy(),...e)):"root"===e?()=>t.root().toProxy():"nodes"===e?t.nodes.map(t=>t.toProxy()):"first"===e||"last"===e?t[e].toProxy():t[e]:t[e],set:(t,e,i)=>(t[e]===i||(t[e]=i,"name"!==e&&"params"!==e&&"selector"!==e||t.markDirty()),!0)}}index(t){return"number"==typeof t?t:(t.proxyOf&&(t=t.proxyOf),this.proxyOf.nodes.indexOf(t))}insertAfter(t,e){let i,s=this.index(t),r=this.normalize(e,this.proxyOf.nodes[s]).reverse();s=this.index(t);for(let t of r)this.proxyOf.nodes.splice(s+1,0,t);for(let t in this.indexes)i=this.indexes[t],s<i&&(this.indexes[t]=i+r.length);return this.markDirty(),this}insertBefore(t,e){let i,s=this.index(t),r=0===s&&"prepend",n=this.normalize(e,this.proxyOf.nodes[s],r).reverse();s=this.index(t);for(let t of n)this.proxyOf.nodes.splice(s,0,t);for(let t in this.indexes)i=this.indexes[t],s<=i&&(this.indexes[t]=i+n.length);return this.markDirty(),this}normalize(e,i){if("string"==typeof e)e=hn(Hr(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e)){e=e.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if("root"===e.type&&"document"!==this.type){e=e.nodes.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new rn(e)]}else if(e.selector)e=[new Qr(e)];else if(e.name)e=[new qr(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new nn(e)]}return e.map(e=>(e[sn]||t.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[en]&&ln(e),void 0===e.raws.before&&i&&void 0!==i.raws.before&&(e.raws.before=i.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...t){t=t.reverse();for(let e of t){let t=this.normalize(e,this.first,"prepend").reverse();for(let e of t)this.proxyOf.nodes.unshift(e);for(let e in this.indexes)this.indexes[e]=this.indexes[e]+t.length}return this.markDirty(),this}push(t){return t.parent=this,this.proxyOf.nodes.push(t),this}removeAll(){for(let t of this.proxyOf.nodes)t.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(t){let e;t=this.index(t),this.proxyOf.nodes[t].parent=void 0,this.proxyOf.nodes.splice(t,1);for(let i in this.indexes)e=this.indexes[i],e>=t&&(this.indexes[i]=e-1);return this.markDirty(),this}replaceValues(t,e,i){return i||(i=e,e={}),this.walkDecls(s=>{e.props&&!e.props.includes(s.prop)||e.fast&&!s.value.includes(e.fast)||(s.value=s.value.replace(t,i))}),this.markDirty(),this}some(t){return this.nodes.some(t)}walk(t){return this.each((e,i)=>{let s;try{s=t(e,i)}catch(t){throw e.addToError(t)}return!1!==s&&e.walk&&(s=e.walk(t)),s})}walkAtRules(t,e){return e?t instanceof RegExp?this.walk((i,s)=>{if("atrule"===i.type&&t.test(i.name))return e(i,s)}):this.walk((i,s)=>{if("atrule"===i.type&&i.name===t)return e(i,s)}):(e=t,this.walk((t,i)=>{if("atrule"===t.type)return e(t,i)}))}walkComments(t){return this.walk((e,i)=>{if("comment"===e.type)return t(e,i)})}walkDecls(t,e){return e?t instanceof RegExp?this.walk((i,s)=>{if("decl"===i.type&&t.test(i.prop))return e(i,s)}):this.walk((i,s)=>{if("decl"===i.type&&i.prop===t)return e(i,s)}):(e=t,this.walk((t,i)=>{if("decl"===t.type)return e(t,i)}))}walkRules(t,e){return e?t instanceof RegExp?this.walk((i,s)=>{if("rule"===i.type&&t.test(i.selector))return e(i,s)}):this.walk((i,s)=>{if("rule"===i.type&&i.selector===t)return e(i,s)}):(e=t,this.walk((t,i)=>{if("rule"===t.type)return e(t,i)}))}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]}};an.registerParse=t=>{Hr=t},an.registerRule=t=>{Qr=t},an.registerAtRule=t=>{qr=t},an.registerRoot=t=>{tn=t};var cn=an;an.default=an,an.rebuild=t=>{"atrule"===t.type?Object.setPrototypeOf(t,qr.prototype):"rule"===t.type?Object.setPrototypeOf(t,Qr.prototype):"decl"===t.type?Object.setPrototypeOf(t,rn.prototype):"comment"===t.type?Object.setPrototypeOf(t,nn.prototype):"root"===t.type&&Object.setPrototypeOf(t,tn.prototype),t[sn]=!0,t.nodes&&t.nodes.forEach(t=>{an.rebuild(t)})};let un,fn,dn=cn,pn=class extends dn{constructor(t){super({type:"document",...t}),this.nodes||(this.nodes=[])}toResult(t={}){return new un(new fn,this,t).stringify()}};pn.registerLazyResult=t=>{un=t},pn.registerProcessor=t=>{fn=t};var mn=pn;pn.default=pn;let gn={};var wn=function(t){gn[t]||(gn[t]=!0,"undefined"!=typeof console&&console.warn&&console.warn(t))};let yn=class{constructor(t,e={}){if(this.type="warning",this.text=t,e.node&&e.node.source){let t=e.node.rangeBy(e);this.line=t.start.line,this.column=t.start.column,this.endLine=t.end.line,this.endColumn=t.end.column}for(let t in e)this[t]=e[t]}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 bn=yn;yn.default=yn;let vn=bn,Cn=class{constructor(t,e,i){this.processor=t,this.messages=[],this.root=e,this.opts=i,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,e={}){e.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(e.plugin=this.lastPlugin.postcssPlugin);let i=new vn(t,e);return this.messages.push(i),i}warnings(){return this.messages.filter(t=>"warning"===t.type)}get content(){return this.css}};var In=Cn;Cn.default=Cn;const Sn="'".charCodeAt(0),kn='"'.charCodeAt(0),An="\\".charCodeAt(0),xn="/".charCodeAt(0),Rn="\n".charCodeAt(0),Mn=" ".charCodeAt(0),On="\f".charCodeAt(0),Tn="\t".charCodeAt(0),En="\r".charCodeAt(0),Bn="[".charCodeAt(0),Fn="]".charCodeAt(0),Nn="(".charCodeAt(0),Ln=")".charCodeAt(0),jn="{".charCodeAt(0),Dn="}".charCodeAt(0),Un=";".charCodeAt(0),Wn="*".charCodeAt(0),Yn=":".charCodeAt(0),Zn="@".charCodeAt(0),Pn=/[\t\n\f\r "#'()/;[\\\]{}]/g,Gn=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Vn=/.[\r\n"'(/\\]/,zn=/[\da-f]/i;let Xn=cn,Jn=class extends Xn{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}};var $n=Jn;Jn.default=Jn,Xn.registerAtRule(Jn);let Kn,_n,Hn=cn,Qn=class extends Hn{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,e,i){let s=super.normalize(t);if(e)if("prepend"===i)this.nodes.length>1?e.raws.before=this.nodes[1].raws.before:delete e.raws.before;else if(this.first!==e)for(let t of s)t.raws.before=e.raws.before;return s}removeChild(t,e){let i=this.index(t);return!e&&0===i&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[i].raws.before),super.removeChild(t)}toResult(t={}){return new Kn(new _n,this,t).stringify()}};Qn.registerLazyResult=t=>{Kn=t},Qn.registerProcessor=t=>{_n=t};var qn=Qn;Qn.default=Qn,Hn.registerRoot(Qn);let to={comma:t=>to.split(t,[","],!0),space:t=>to.split(t,[" ","\n","\t"]),split(t,e,i){let s=[],r="",n=!1,o=0,h=!1,l="",a=!1;for(let i of t)a?a=!1:"\\"===i?a=!0:h?i===l&&(h=!1):'"'===i||"'"===i?(h=!0,l=i):"("===i?o+=1:")"===i?o>0&&(o-=1):0===o&&e.includes(i)&&(n=!0),n?(""!==r&&s.push(r.trim()),r="",n=!1):r+=i;return(i||""!==r)&&s.push(r.trim()),s}};var eo=to;to.default=to;let io=cn,so=eo,ro=class extends io{constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return so.comma(this.selector)}set selectors(t){let e=this.selector?this.selector.match(/,\s*/):null,i=e?e[0]:","+this.raw("between","beforeOpen");this.selector=t.join(i)}};var no=ro;ro.default=ro,io.registerRule(ro);let oo=fr,ho=_r,lo=$n,ao=qn,co=no;const uo={empty:!0,space:!0};let fo=cn,po=class{constructor(t){this.input=t,this.root=new ao,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let e,i,s,r=new lo;r.name=t[1].slice(1),""===r.name&&this.unnamedAtrule(r,t),this.init(r,t[2]);let n=!1,o=!1,h=[],l=[];for(;!this.tokenizer.endOfFile();){if(e=(t=this.tokenizer.nextToken())[0],"("===e||"["===e?l.push("("===e?")":"]"):"{"===e&&l.length>0?l.push("}"):e===l[l.length-1]&&l.pop(),0===l.length){if(";"===e){r.source.end=this.getPosition(t[2]),r.source.end.offset++,this.semicolon=!0;break}if("{"===e){o=!0;break}if("}"===e){if(h.length>0){for(s=h.length-1,i=h[s];i&&"space"===i[0];)i=h[--s];i&&(r.source.end=this.getPosition(i[3]||i[2]),r.source.end.offset++)}this.end(t);break}h.push(t)}else h.push(t);if(this.tokenizer.endOfFile()){n=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(h),h.length?(r.raws.afterName=this.spacesAndCommentsFromStart(h),this.raw(r,"params",h),n&&(t=h[h.length-1],r.source.end=this.getPosition(t[3]||t[2]),r.source.end.offset++,this.spaces=r.raws.between,r.raws.between="")):(r.raws.afterName="",r.params=""),o&&(r.nodes=[],this.current=r)}checkMissedSemicolon(t){let e=this.colon(t);if(!1===e)return;let i,s=0;for(let r=e-1;r>=0&&(i=t[r],"space"===i[0]||(s+=1,2!==s));r--);throw this.input.error("Missed semicolon","word"===i[0]?i[3]+1:i[2])}colon(t){let e,i,s,r=0;for(let[n,o]of t.entries()){if(e=o,i=e[0],"("===i&&(r+=1),")"===i&&(r-=1),0===r&&":"===i){if(s){if("word"===s[0]&&"progid"===s[1])continue;return n}this.doubleColon(e)}s=e}return!1}comment(t){let e=new ho;this.init(e,t[2]),e.source.end=this.getPosition(t[3]||t[2]),e.source.end.offset++;let i=t[1].slice(2,-2);if(/^\s*$/.test(i))e.text="",e.raws.left=i,e.raws.right="";else{let t=i.match(/^(\s*)([^]*\S)(\s*)$/);e.text=t[2],e.raws.left=t[1],e.raws.right=t[3]}}createTokenizer(){this.tokenizer=function(t,e={}){let i,s,r,n,o,h,l,a,c,u,f=t.css.valueOf(),d=e.ignoreErrors,p=f.length,m=0,g=[],w=[];function y(e){throw t.error("Unclosed "+e,m)}return{back:function(t){w.push(t)},endOfFile:function(){return 0===w.length&&m>=p},nextToken:function(t){if(w.length)return w.pop();if(m>=p)return;let e=!!t&&t.ignoreUnclosed;switch(i=f.charCodeAt(m),i){case Rn:case Mn:case Tn:case En:case On:s=m;do{s+=1,i=f.charCodeAt(s)}while(i===Mn||i===Rn||i===Tn||i===En||i===On);u=["space",f.slice(m,s)],m=s-1;break;case Bn:case Fn:case jn:case Dn:case Yn:case Un:case Ln:{let t=String.fromCharCode(i);u=[t,t,m];break}case Nn:if(a=g.length?g.pop()[1]:"",c=f.charCodeAt(m+1),"url"===a&&c!==Sn&&c!==kn&&c!==Mn&&c!==Rn&&c!==Tn&&c!==On&&c!==En){s=m;do{if(h=!1,s=f.indexOf(")",s+1),-1===s){if(d||e){s=m;break}y("bracket")}for(l=s;f.charCodeAt(l-1)===An;)l-=1,h=!h}while(h);u=["brackets",f.slice(m,s+1),m,s],m=s}else s=f.indexOf(")",m+1),n=f.slice(m,s+1),-1===s||Vn.test(n)?u=["(","(",m]:(u=["brackets",n,m,s],m=s);break;case Sn:case kn:r=i===Sn?"'":'"',s=m;do{if(h=!1,s=f.indexOf(r,s+1),-1===s){if(d||e){s=m+1;break}y("string")}for(l=s;f.charCodeAt(l-1)===An;)l-=1,h=!h}while(h);u=["string",f.slice(m,s+1),m,s],m=s;break;case Zn:Pn.lastIndex=m+1,Pn.test(f),s=0===Pn.lastIndex?f.length-1:Pn.lastIndex-2,u=["at-word",f.slice(m,s+1),m,s],m=s;break;case An:for(s=m,o=!0;f.charCodeAt(s+1)===An;)s+=1,o=!o;if(i=f.charCodeAt(s+1),o&&i!==xn&&i!==Mn&&i!==Rn&&i!==Tn&&i!==En&&i!==On&&(s+=1,zn.test(f.charAt(s)))){for(;zn.test(f.charAt(s+1));)s+=1;f.charCodeAt(s+1)===Mn&&(s+=1)}u=["word",f.slice(m,s+1),m,s],m=s;break;default:i===xn&&f.charCodeAt(m+1)===Wn?(s=f.indexOf("*/",m+2)+1,0===s&&(d||e?s=f.length:y("comment")),u=["comment",f.slice(m,s+1),m,s],m=s):(Gn.lastIndex=m+1,Gn.test(f),s=0===Gn.lastIndex?f.length-1:Gn.lastIndex-2,u=["word",f.slice(m,s+1),m,s],g.push(u),m=s)}return m++,u},position:function(){return m}}}(this.input)}decl(t,e){let i=new oo;this.init(i,t[0][2]);let s,r=t[t.length-1];for(";"===r[0]&&(this.semicolon=!0,t.pop()),i.source.end=this.getPosition(r[3]||r[2]||function(t){for(let e=t.length-1;e>=0;e--){let i=t[e],s=i[3]||i[2];if(s)return s}}(t)),i.source.end.offset++;"word"!==t[0][0];)1===t.length&&this.unknownWord(t),i.raws.before+=t.shift()[1];for(i.source.start=this.getPosition(t[0][2]),i.prop="";t.length;){let e=t[0][0];if(":"===e||"space"===e||"comment"===e)break;i.prop+=t.shift()[1]}for(i.raws.between="";t.length;){if(s=t.shift(),":"===s[0]){i.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),i.raws.between+=s[1]}"_"!==i.prop[0]&&"*"!==i.prop[0]||(i.raws.before+=i.prop[0],i.prop=i.prop.slice(1));let n,o=[];for(;t.length&&(n=t[0][0],"space"===n||"comment"===n);)o.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(s=t[e],"!important"===s[1].toLowerCase()){i.important=!0;let s=this.stringFrom(t,e);s=this.spacesFromEnd(t)+s," !important"!==s&&(i.raws.important=s);break}if("important"===s[1].toLowerCase()){let s=t.slice(0),r="";for(let t=e;t>0;t--){let e=s[t][0];if(0===r.trim().indexOf("!")&&"space"!==e)break;r=s.pop()[1]+r}0===r.trim().indexOf("!")&&(i.important=!0,i.raws.important=r,t=s)}if("space"!==s[0]&&"comment"!==s[0])break}t.some(t=>"space"!==t[0]&&"comment"!==t[0])&&(i.raws.between+=o.map(t=>t[1]).join(""),o=[]),this.raw(i,"value",o.concat(t),e),i.value.includes(":")&&!e&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let e=new co;this.init(e,t[2]),e.selector="",e.raws.between="",this.current=e}end(t){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(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}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(t){if(this.spaces+=t[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&"rule"===t.type&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(t){let e=this.input.fromOffset(t);return{column:e.col,line:e.line,offset:t}}init(t,e){this.current.push(t),t.source={input:this.input,start:this.getPosition(e)},t.raws.before=this.spaces,this.spaces="","comment"!==t.type&&(this.semicolon=!1)}other(t){let e=!1,i=null,s=!1,r=null,n=[],o=t[1].startsWith("--"),h=[],l=t;for(;l;){if(i=l[0],h.push(l),"("===i||"["===i)r||(r=l),n.push("("===i?")":"]");else if(o&&s&&"{"===i)r||(r=l),n.push("}");else if(0===n.length){if(";"===i){if(s)return void this.decl(h,o);break}if("{"===i)return void this.rule(h);if("}"===i){this.tokenizer.back(h.pop()),e=!0;break}":"===i&&(s=!0)}else i===n[n.length-1]&&(n.pop(),0===n.length&&(r=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(e=!0),n.length>0&&this.unclosedBracket(r),e&&s){if(!o)for(;h.length&&(l=h[h.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(h.pop());this.decl(h,o)}else this.unknownWord(h)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t)}this.endFile()}precheckMissedSemicolon(){}raw(t,e,i,s){let r,n,o,h,l=i.length,a="",c=!0;for(let t=0;t<l;t+=1)r=i[t],n=r[0],"space"!==n||t!==l-1||s?"comment"===n?(h=i[t-1]?i[t-1][0]:"empty",o=i[t+1]?i[t+1][0]:"empty",uo[h]||uo[o]||","===a.slice(-1)?c=!1:a+=r[1]):a+=r[1]:c=!1;if(!c){let s=i.reduce((t,e)=>t+e[1],"");t.raws[e]={raw:s,value:a}}t[e]=a}rule(t){t.pop();let e=new co;this.init(e,t[0][2]),e.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(e,"selector",t),this.current=e}spacesAndCommentsFromEnd(t){let e,i="";for(;t.length&&(e=t[t.length-1][0],"space"===e||"comment"===e);)i=t.pop()[1]+i;return i}spacesAndCommentsFromStart(t){let e,i="";for(;t.length&&(e=t[0][0],"space"===e||"comment"===e);)i+=t.shift()[1];return i}spacesFromEnd(t){let e,i="";for(;t.length&&(e=t[t.length-1][0],"space"===e);)i=t.pop()[1]+i;return i}stringFrom(t,e){let i="";for(let s=e;s<t.length;s++)i+=t[s][1];return t.splice(e,t.length-e),i}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word",{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,e){throw this.input.error("At-rule without name",{offset:e[2]},{offset:e[2]+e[1].length})}},mo=jr;function go(t,e){let i=new mo(t,e),s=new po(i);try{s.parse()}catch(t){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===t.name&&e&&e.from&&(/\.scss$/i.test(e.from)?t.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(e.from)?t.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(e.from)&&(t.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),t}return s.root}var wo=go;go.default=go,fo.registerParse(go);let{isClean:yo,my:bo}=Ks,vo=Jr,Co=er,Io=cn,So=mn,ko=wn,Ao=In,xo=wo,Ro=qn;const Mo={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Oo={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},To={Once:!0,postcssPlugin:!0,prepare:!0};function Eo(t){return"object"==typeof t&&"function"==typeof t.then}function Bo(t){let e=!1,i=Mo[t.type];return"decl"===t.type?e=t.prop.toLowerCase():"atrule"===t.type&&(e=t.name.toLowerCase()),e&&t.append?[i,i+"-"+e,0,i+"Exit",i+"Exit-"+e]:e?[i,i+"-"+e,i+"Exit",i+"Exit-"+e]:t.append?[i,0,i+"Exit"]:[i,i+"Exit"]}function Fo(t){let e;return e="document"===t.type?["Document",0,"DocumentExit"]:"root"===t.type?["Root",0,"RootExit"]:Bo(t),{eventIndex:0,events:e,iterator:0,node:t,visitorIndex:0,visitors:[]}}function No(t){return t[yo]=!1,t.nodes&&t.nodes.forEach(t=>No(t)),t}let Lo={},jo=class t{constructor(e,i,s){let r;if(this.stringified=!1,this.processed=!1,"object"!=typeof i||null===i||"root"!==i.type&&"document"!==i.type)if(i instanceof t||i instanceof Ao)r=No(i.root),i.map&&(void 0===s.map&&(s.map={}),s.map.inline||(s.map.inline=!1),s.map.prev=i.map);else{let t=xo;s.syntax&&(t=s.syntax.parse),s.parser&&(t=s.parser),t.parse&&(t=t.parse);try{r=t(i,s)}catch(t){this.processed=!0,this.error=t}r&&!r[bo]&&Io.rebuild(r)}else r=No(i);this.result=new Ao(e,r,s),this.helpers={...Lo,postcss:Lo,result:this.result},this.plugins=this.processor.plugins.map(t=>"object"==typeof t&&t.prepare?{...t,...t.prepare(this.result)}:t)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(t,e){let i=this.result.lastPlugin;try{if(e&&e.addToError(t),this.error=t,"CssSyntaxError"!==t.name||t.plugin){if(i.postcssVersion&&"production"!==process.env.NODE_ENV){let t=i.postcssPlugin,e=i.postcssVersion,s=this.result.processor.version,r=e.split("."),n=s.split(".");(r[0]!==n[0]||parseInt(r[1])>parseInt(n[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+s+", but "+t+" uses "+e+". Perhaps this is the source of the error below.")}}else t.plugin=i.postcssPlugin,t.setMessage()}catch(t){console&&console.error&&console.error(t)}return t}prepareVisitors(){this.listeners={};let t=(t,e,i)=>{this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push([t,i])};for(let e of this.plugins)if("object"==typeof e)for(let i in e){if(!Oo[i]&&/^[A-Z]/.test(i))throw new Error(`Unknown event ${i} in ${e.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!To[i])if("object"==typeof e[i])for(let s in e[i])t(e,"*"===s?i:i+"-"+s.toLowerCase(),e[i][s]);else"function"==typeof e[i]&&t(e,i,e[i])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let t=0;t<this.plugins.length;t++){let e=this.plugins[t],i=this.runOnRoot(e);if(Eo(i))try{await i}catch(t){throw this.handleError(t)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[yo];){t[yo]=!0;let e=[Fo(t)];for(;e.length>0;){let t=this.visitTick(e);if(Eo(t))try{await t}catch(t){let i=e[e.length-1].node;throw this.handleError(t,i)}}}if(this.listeners.OnceExit)for(let[e,i]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if("document"===t.type){let e=t.nodes.map(t=>i(t,this.helpers));await Promise.all(e)}else await i(t,this.helpers)}catch(t){throw this.handleError(t)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{if("object"==typeof t&&t.Once){if("document"===this.result.root.type){let e=this.result.root.nodes.map(e=>t.Once(e,this.helpers));return Eo(e[0])?Promise.all(e):e}return t.Once(this.result.root,this.helpers)}if("function"==typeof t)return t(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let t=this.result.opts,e=Co;t.syntax&&(e=t.syntax.stringify),t.stringifier&&(e=t.stringifier),e.stringify&&(e=e.stringify);let i=new vo(e,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[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 t of this.plugins)if(Eo(this.runOnRoot(t)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[yo];)t[yo]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(t,e){return"production"!==process.env.NODE_ENV&&("from"in this.opts||ko("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(t,e)}toString(){return this.css}visitSync(t,e){for(let[i,s]of t){let t;this.result.lastPlugin=i;try{t=s(e,this.helpers)}catch(t){throw this.handleError(t,e.proxyOf)}if("root"!==e.type&&"document"!==e.type&&!e.parent)return!0;if(Eo(t))throw this.getAsyncError()}}visitTick(t){let e=t[t.length-1],{node:i,visitors:s}=e;if("root"!==i.type&&"document"!==i.type&&!i.parent)return void t.pop();if(s.length>0&&e.visitorIndex<s.length){let[t,r]=s[e.visitorIndex];e.visitorIndex+=1,e.visitorIndex===s.length&&(e.visitors=[],e.visitorIndex=0),this.result.lastPlugin=t;try{return r(i.toProxy(),this.helpers)}catch(t){throw this.handleError(t,i)}}if(0!==e.iterator){let s,r=e.iterator;for(;s=i.nodes[i.indexes[r]];)if(i.indexes[r]+=1,!s[yo])return s[yo]=!0,void t.push(Fo(s));e.iterator=0,delete i.indexes[r]}let r=e.events;for(;e.eventIndex<r.length;){let t=r[e.eventIndex];if(e.eventIndex+=1,0===t)return void(i.nodes&&i.nodes.length&&(i[yo]=!0,e.iterator=i.getIterator()));if(this.listeners[t])return void(e.visitors=this.listeners[t])}t.pop()}walkSync(t){t[yo]=!0;let e=Bo(t);for(let i of e)if(0===i)t.nodes&&t.each(t=>{t[yo]||this.walkSync(t)});else{let e=this.listeners[i];if(e&&this.visitSync(e,t.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"}};jo.registerPostcss=t=>{Lo=t};var Do=jo;jo.default=jo,Ro.registerLazyResult(jo),So.registerLazyResult(jo);let Uo=Jr,Wo=er,Yo=wn,Zo=wo;const Po=In;let Go=class{constructor(t,e,i){let s;e=e.toString(),this.stringified=!1,this.l=t,this.u=e,this.p=i,this.m=void 0;let r=Wo;this.result=new Po(this.l,s,this.p),this.result.css=e;let n=this;Object.defineProperty(this.result,"root",{get:()=>n.root});let o=new Uo(r,s,this.p,e);if(o.isMap()){let[t,e]=o.generate();t&&(this.result.css=t),e&&(this.result.map=e)}else o.clearAnnotation(),this.result.css=o.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,e){return"production"!==process.env.NODE_ENV&&("from"in this.p||Yo("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(t,e)}toString(){return this.u}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.v)return this.v;let t,e=Zo;try{t=e(this.u,this.p)}catch(t){this.error=t}if(this.error)throw this.error;return this.v=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}};var Vo=Go;Go.default=Go;let zo=Vo,Xo=Do,Jo=mn,$o=qn,Ko=class{constructor(t=[]){this.version="8.4.38",this.plugins=this.normalize(t)}normalize(t){let e=[];for(let i of t)if(!0===i.postcss?i=i():i.postcss&&(i=i.postcss),"object"==typeof i&&Array.isArray(i.plugins))e=e.concat(i.plugins);else if("object"==typeof i&&i.postcssPlugin)e.push(i);else if("function"==typeof i)e.push(i);else{if("object"!=typeof i||!i.parse&&!i.stringify)throw new Error(i+" 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 e}process(t,e={}){return this.plugins.length||e.parser||e.stringifier||e.syntax?new Xo(this,t,e):new zo(this,t,e)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};var _o=Ko;Ko.default=Ko,$o.registerProcessor(Ko),Jo.registerProcessor(Ko);let Ho=fr,Qo=Cr,qo=_r,th=$n,eh=jr,ih=qn,sh=no;function rh(t,e){if(Array.isArray(t))return t.map(t=>rh(t));let{inputs:i,...s}=t;if(i){e=[];for(let t of i){let i={...t,__proto__:eh.prototype};i.map&&(i.map={...i.map,__proto__:Qo.prototype}),e.push(i)}}if(s.nodes&&(s.nodes=t.nodes.map(t=>rh(t,e))),s.source){let{inputId:t,...i}=s.source;s.source=i,null!=t&&(s.source.input=e[t])}if("root"===s.type)return new ih(s);if("decl"===s.type)return new Ho(s);if("rule"===s.type)return new sh(s);if("comment"===s.type)return new qo(s);if("atrule"===s.type)return new th(s);throw new Error("Unknown node type: "+t.type)}var nh=rh;rh.default=rh;let oh=$s,hh=fr,lh=Do,ah=cn,ch=_o,uh=er,fh=nh,dh=mn,ph=bn,mh=_r,gh=$n,wh=In,yh=jr,bh=wo,vh=eo,Ch=no,Ih=qn,Sh=ar;function kh(...t){return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),new ch(t)}kh.plugin=function(t,e){let i,s=!1;function r(...i){console&&console.warn&&!s&&(s=!0,console.warn(t+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(t+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let r=e(...i);return r.postcssPlugin=t,r.postcssVersion=(new ch).version,r}return Object.defineProperty(r,"postcss",{get:()=>(i||(i=r()),i)}),r.process=function(t,e,i){return kh([r(i)]).process(t,e)},r},kh.stringify=uh,kh.parse=bh,kh.fromJSON=fh,kh.list=vh,kh.comment=t=>new mh(t),kh.atRule=t=>new gh(t),kh.decl=t=>new hh(t),kh.rule=t=>new Ch(t),kh.root=t=>new Ih(t),kh.document=t=>new dh(t),kh.CssSyntaxError=oh,kh.Declaration=hh,kh.Container=ah,kh.Processor=ch,kh.Document=dh,kh.Comment=mh,kh.Warning=ph,kh.AtRule=gh,kh.Result=wh,kh.Input=yh,kh.Rule=Ch,kh.Root=Ih,kh.Node=Sh,lh.registerPostcss(kh);var Ah=kh;kh.default=kh;const xh=Us(Ah);xh.stringify,xh.fromJSON,xh.plugin,xh.parse,xh.list,xh.document,xh.comment,xh.atRule,xh.rule,xh.decl,xh.root,xh.CssSyntaxError,xh.Declaration,xh.Container,xh.Processor,xh.Document,xh.Comment,xh.Warning,xh.AtRule,xh.Result,xh.Input,xh.Rule,xh.Root,xh.Node;class Rh{constructor(...t){Ds(this,"parentElement",null),Ds(this,"parentNode",null),Ds(this,"ownerDocument"),Ds(this,"firstChild",null),Ds(this,"lastChild",null),Ds(this,"previousSibling",null),Ds(this,"nextSibling",null),Ds(this,"ELEMENT_NODE",1),Ds(this,"TEXT_NODE",3),Ds(this,"nodeType"),Ds(this,"nodeName"),Ds(this,"RRNodeType")}get childNodes(){const t=[];let e=this.firstChild;for(;e;)t.push(e),e=e.nextSibling;return t}contains(t){if(!(t instanceof Rh))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,e){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const Mh={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Oh={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Th={};function Eh(t){if(Th[t])return Th[t];const e=globalThis[t],i=e.prototype,s=t in Mh?Mh[t]:void 0,r=Boolean(s&&s.every(t=>{var e,s;return Boolean(null==(s=null==(e=Object.getOwnPropertyDescriptor(i,t))?void 0:e.get)?void 0:s.toString().includes("[native code]"))})),n=t in Oh?Oh[t]:void 0,o=Boolean(n&&n.every(t=>{var e;return"function"==typeof i[t]&&(null==(e=i[t])?void 0:e.toString().includes("[native code]"))}));if(r&&o&&!globalThis.Zone)return Th[t]=e.prototype,e.prototype;try{const s=document.createElement("iframe");document.body.appendChild(s);const r=s.contentWindow;if(!r)return e.prototype;const n=r[t].prototype;return document.body.removeChild(s),n?Th[t]=n:i}catch{return i}}const Bh={};function Fh(t,e,i){var s;const r=`${t}.${String(i)}`;if(Bh[r])return Bh[r].call(e);const n=Eh(t),o=null==(s=Object.getOwnPropertyDescriptor(n,i))?void 0:s.get;return o?(Bh[r]=o,o.call(e)):e[i]}const Nh={};function Lh(t,e,i){const s=`${t}.${String(i)}`;if(Nh[s])return Nh[s].bind(e);const r=Eh(t)[i];return"function"!=typeof r?e[i]:(Nh[s]=r,r.bind(e))}const jh=function(t){return Fh("Node",t,"childNodes")},Dh=function(t){return Fh("Node",t,"parentNode")},Uh=function(t){return Fh("Node",t,"parentElement")},Wh=function(t){return Fh("Node",t,"textContent")},Yh=function(t,e){return Lh("Node",t,"contains")(e)},Zh=function(t){return Lh("Node",t,"getRootNode")()},Ph=function(t){return t&&"host"in t?Fh("ShadowRoot",t,"host"):null},Gh=function(t){return t&&"shadowRoot"in t?Fh("Element",t,"shadowRoot"):null};function Vh(t,e,i=document){const s={capture:!0,passive:!0};return i.addEventListener(t,e,s),()=>i.removeEventListener(t,e,s)}const zh="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 Xh={map:{},getId:()=>(console.error(zh),-1),getNode:()=>(console.error(zh),null),removeNodeFromMap(){console.error(zh)},has:()=>(console.error(zh),!1),reset(){console.error(zh)}};function Jh(t,e,i={}){let s=null,r=0;return function(...n){const o=Date.now();r||!1!==i.leading||(r=o);const h=e-(o-r),l=this;h<=0||h>e?(s&&(clearTimeout(s),s=null),r=o,t.apply(l,n)):s||!1===i.trailing||(s=setTimeout(()=>{r=!1===i.leading?0:Date.now(),s=null,t.apply(l,n)},h))}}function $h(t,e,i,s,r=window){const n=r.Object.getOwnPropertyDescriptor(t,e);return r.Object.defineProperty(t,e,s?i:{set(t){setTimeout(()=>{i.set.call(this,t)},0),n&&n.set&&n.set.call(this,t)}}),()=>$h(t,e,n||{},!0)}function Kh(t,e,i){try{if(!(e in t))return()=>{};const s=t[e],r=i(s);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{C:{enumerable:!1,value:s}})),t[e]=r,()=>{t[e]=s}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Xh=new Proxy(Xh,{get:(t,e,i)=>("map"===e&&console.error(zh),Reflect.get(t,e,i))}));let _h=Date.now;function Hh(t){var e,i,s,r;const n=t.document;return{left:n.scrollingElement?n.scrollingElement.scrollLeft:void 0!==t.pageXOffset?t.pageXOffset:n.documentElement.scrollLeft||(null==n?void 0:n.body)&&(null==(e=Uh(n.body))?void 0:e.scrollLeft)||(null==(i=null==n?void 0:n.body)?void 0:i.scrollLeft)||0,top:n.scrollingElement?n.scrollingElement.scrollTop:void 0!==t.pageYOffset?t.pageYOffset:(null==n?void 0:n.documentElement.scrollTop)||(null==n?void 0:n.body)&&(null==(s=Uh(n.body))?void 0:s.scrollTop)||(null==(r=null==n?void 0:n.body)?void 0:r.scrollTop)||0}}function Qh(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function qh(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function tl(t){return t?t.nodeType===t.ELEMENT_NODE?t:Uh(t):null}function el(t,e,i,s){if(!t)return!1;const r=tl(t);if(!r)return!1;try{if("string"==typeof e){if(r.classList.contains(e))return!0;if(s&&null!==r.closest("."+e))return!0}else if(z(r,e,s))return!0}catch(t){}if(i){if(r.matches(i))return!0;if(s&&null!==r.closest(i))return!0}return!1}function il(t,e,i){return!("TITLE"!==t.tagName||!i.headTitleMutations)||-2===e.getId(t)}function sl(t,e){if(w(t))return!1;const i=e.getId(t);if(!e.has(i))return!0;const s=Dh(t);return(!s||s.nodeType!==t.DOCUMENT_NODE)&&(!s||sl(s,e))}function rl(t){return Boolean(t.changedTouches)}function nl(t,e){return Boolean("IFRAME"===t.nodeName&&e.getMeta(t))}function ol(t,e){return Boolean("LINK"===t.nodeName&&t.nodeType===t.ELEMENT_NODE&&t.getAttribute&&"stylesheet"===t.getAttribute("rel")&&e.getMeta(t))}function hl(t){return!!t&&(t instanceof Rh&&"shadowRoot"in t?Boolean(t.shadowRoot):Boolean(Gh(t)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(_h=()=>(new Date).getTime());class ll{constructor(){i(this,"id",1),i(this,"styleIDMap",new WeakMap),i(this,"idStyleMap",new Map)}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,e){if(this.has(t))return this.getId(t);let i;return i=void 0===e?this.id++:e,this.styleIDMap.set(t,i),this.idStyleMap.set(i,t),i}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function al(t){var e;let i=null;return"getRootNode"in t&&(null==(e=Zh(t))?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Ph(Zh(t))&&(i=Ph(Zh(t))),i}function cl(t){const e=t.ownerDocument;return!!e&&(Yh(e,t)||function(t){const e=t.ownerDocument;if(!e)return!1;const i=function(t){let e,i=t;for(;e=al(i);)i=e;return i}(t);return Yh(e,i)}(t))}var ul=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t))(ul||{}),fl=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t))(fl||{}),dl=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(dl||{}),pl=(t=>(t[t.Mouse=0]="Mouse",t[t.Pen=1]="Pen",t[t.Touch=2]="Touch",t))(pl||{}),ml=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(ml||{}),gl=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(gl||{}),wl=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(wl||{});function yl(t){return"I"in t}class bl{constructor(){i(this,"length",0),i(this,"head",null),i(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");let e=this.head;for(let i=0;i<t;i++)e=(null==e?void 0:e.next)||null;return e}addNode(t){const e={value:t,previous:null,next:null};if(t.I=e,t.previousSibling&&yl(t.previousSibling)){const i=t.previousSibling.I.next;e.next=i,e.previous=t.previousSibling.I,t.previousSibling.I.next=e,i&&(i.previous=e)}else if(t.nextSibling&&yl(t.nextSibling)&&t.nextSibling.I.previous){const i=t.nextSibling.I.previous;e.previous=i,e.next=t.nextSibling.I,t.nextSibling.I.previous=e,i&&(i.next=e)}else this.head&&(this.head.previous=e),e.next=this.head,this.head=e;null===e.next&&(this.tail=e),this.length++}removeNode(t){const e=t.I;this.head&&(e.previous?(e.previous.next=e.next,e.next?e.next.previous=e.previous:this.tail=e.previous):(this.head=e.next,this.head?this.head.previous=null:this.tail=null),t.I&&delete t.I,this.length--)}}const vl=(t,e)=>`${t}@${e}`;class Cl{constructor(){i(this,"frozen",!1),i(this,"locked",!1),i(this,"texts",[]),i(this,"attributes",[]),i(this,"attributeMap",new WeakMap),i(this,"removes",[]),i(this,"mapRemoves",[]),i(this,"movedMap",{}),i(this,"addedSet",new Set),i(this,"movedSet",new Set),i(this,"droppedSet",new Set),i(this,"removesSubTreeCache",new Set),i(this,"mutationCb"),i(this,"blockClass"),i(this,"blockSelector"),i(this,"maskTextClass"),i(this,"maskTextSelector"),i(this,"inlineStylesheet"),i(this,"maskInputOptions"),i(this,"maskTextFn"),i(this,"maskInputFn"),i(this,"keepIframeSrcFn"),i(this,"recordCanvas"),i(this,"inlineImages"),i(this,"slimDOMOptions"),i(this,"dataURLOptions"),i(this,"doc"),i(this,"mirror"),i(this,"iframeManager"),i(this,"stylesheetManager"),i(this,"shadowDomManager"),i(this,"canvasManager"),i(this,"processedNodeManager"),i(this,"unattachedDoc"),i(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),i(this,"emit",()=>{if(this.frozen||this.locked)return;const t=[],e=new Set,i=new bl,s=t=>{let e=t,i=-2;for(;-2===i;)e=e&&e.nextSibling,i=e&&this.mirror.getId(e);return i},r=r=>{const n=Dh(r);if(!n||!cl(r))return;let o=!1;if(r.nodeType===Node.TEXT_NODE){const t=n.tagName;if("TEXTAREA"===t)return;"STYLE"===t&&this.addedSet.has(n)&&(o=!0)}const h=w(n)?this.mirror.getId(al(r)):this.mirror.getId(n),l=s(r);if(-1===h||-1===l)return i.addNode(r);const a=$(r,{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:t=>{nl(t,this.mirror)&&this.iframeManager.addIframe(t),ol(t,this.mirror)&&this.stylesheetManager.trackLinkElement(t),hl(r)&&this.shadowDomManager.addShadowRoot(Gh(r),this.doc)},onIframeLoad:(t,e)=>{this.iframeManager.attachIframe(t,e),this.shadowDomManager.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{this.stylesheetManager.attachLinkElement(t,e)},cssCaptured:o});a&&(t.push({parentId:h,nextId:l,node:a}),e.add(a.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const t of this.movedSet)Sl(this.removesSubTreeCache,t,this.mirror)&&!this.movedSet.has(Dh(t))||r(t);for(const t of this.addedSet)kl(this.droppedSet,t)||Sl(this.removesSubTreeCache,t,this.mirror)?kl(this.movedSet,t)?r(t):this.droppedSet.add(t):r(t);let n=null;for(;i.length;){let t=null;if(n){const e=this.mirror.getId(Dh(n.value)),i=s(n.value);-1!==e&&-1!==i&&(t=n)}if(!t){let e=i.tail;for(;e;){const i=e;if(e=e.previous,i){const e=this.mirror.getId(Dh(i.value));if(-1===s(i.value))continue;if(-1!==e){t=i;break}{const e=i.value,s=Dh(e);if(s&&s.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const e=Ph(s);if(-1!==this.mirror.getId(e)){t=i;break}}}}}}if(!t){for(;i.head;)i.removeNode(i.head.value);break}n=t.previous,i.removeNode(t.value),r(t.value)}const o={texts:this.texts.map(t=>{const e=t.node,i=Dh(e);return i&&"TEXTAREA"===i.tagName&&this.genTextAreaValueMutation(i),{id:this.mirror.getId(e),value:t.value}}).filter(t=>!e.has(t.id)).filter(t=>this.mirror.has(t.id)),attributes:this.attributes.map(t=>{const{attributes:e}=t;if("string"==typeof e.style){const i=JSON.stringify(t.styleDiff),s=JSON.stringify(t.S);i.length<e.style.length&&(i+s).split("var(").length===e.style.split("var(").length&&(e.style=t.styleDiff)}return{id:this.mirror.getId(t.node),attributes:e}}).filter(t=>!e.has(t.id)).filter(t=>this.mirror.has(t.id)),removes:this.removes,adds:t};(o.texts.length||o.attributes.length||o.removes.length||o.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(o))}),i(this,"genTextAreaValueMutation",t=>{let e=this.attributeMap.get(t);e||(e={node:t,attributes:{},styleDiff:{},S:{}},this.attributes.push(e),this.attributeMap.set(t,e)),e.attributes.value=Array.from(jh(t),t=>Wh(t)||"").join("")}),i(this,"processMutation",t=>{if(!il(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{const e=Wh(t.target);el(t.target,this.blockClass,this.blockSelector,!1)||e===t.oldValue||this.texts.push({value:X(t.target,this.maskTextClass,this.maskTextSelector,!0)&&e?this.maskTextFn?this.maskTextFn(e,tl(t.target)):e.replace(/[\S]/g,"*"):e,node:t.target});break}case"attributes":{const e=t.target;let i=t.attributeName,s=t.target.getAttribute(i);if("value"===i){const t=A(e);s=I({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:t,value:s,maskInputFn:this.maskInputFn})}if(el(t.target,this.blockClass,this.blockSelector,!1)||s===t.oldValue)return;let r=this.attributeMap.get(t.target);if("IFRAME"===e.tagName&&"src"===i&&!this.keepIframeSrcFn(s)){if(e.contentDocument)return;i="rr_src"}if(r||(r={node:t.target,attributes:{},styleDiff:{},S:{}},this.attributes.push(r),this.attributeMap.set(t.target,r)),"type"===i&&"INPUT"===e.tagName&&"password"===(t.oldValue||"").toLowerCase()&&e.setAttribute("data-rr-is-password","true"),!V(e.tagName,i))if(r.attributes[i]=G(this.doc,S(e.tagName),S(i),s),"style"===i){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}const i=this.unattachedDoc.createElement("span");t.oldValue&&i.setAttribute("style",t.oldValue);for(const t of Array.from(e.style)){const s=e.style.getPropertyValue(t),n=e.style.getPropertyPriority(t);s!==i.style.getPropertyValue(t)||n!==i.style.getPropertyPriority(t)?r.styleDiff[t]=""===n?s:[s,n]:r.S[t]=[s,n]}for(const t of Array.from(i.style))""===e.style.getPropertyValue(t)&&(r.styleDiff[t]=!1)}else"open"===i&&"DIALOG"===e.tagName&&(e.matches("dialog:modal")?r.attributes.rr_open_mode="modal":r.attributes.rr_open_mode="non-modal");break}case"childList":if(el(t.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===t.target.tagName)return void this.genTextAreaValueMutation(t.target);t.addedNodes.forEach(e=>this.genAdds(e,t.target)),t.removedNodes.forEach(e=>{const i=this.mirror.getId(e),s=w(t.target)?this.mirror.getId(Ph(t.target)):this.mirror.getId(t.target);el(t.target,this.blockClass,this.blockSelector,!1)||il(e,this.mirror,this.slimDOMOptions)||!function(t,e){return-1!==e.getId(t)}(e,this.mirror)||(this.addedSet.has(e)?(Il(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(t.target)&&-1===i||sl(t.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[vl(i,s)]?Il(this.movedSet,e):(this.removes.push({parentId:s,id:i,isShadow:!(!w(t.target)||!y(t.target))||void 0}),function(t,e){const i=[t];for(;i.length;){const t=i.pop();e.has(t)||(e.add(t),jh(t).forEach(t=>i.push(t)))}}(e,this.removesSubTreeCache))),this.mapRemoves.push(e))})}}),i(this,"genAdds",(t,e)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(il(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let i=null;e&&this.mirror.hasNode(e)&&(i=this.mirror.getId(e)),i&&-1!==i&&(this.movedMap[vl(this.mirror.getId(t),i)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);el(t,this.blockClass,this.blockSelector,!1)||(jh(t).forEach(t=>this.genAdds(t)),hl(t)&&jh(Gh(t)).forEach(e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)}))}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(e=>{this[e]=t[e]})}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 Il(t,e){t.delete(e),jh(e).forEach(e=>Il(t,e))}function Sl(t,e,i){return 0!==t.size&&function(t,e){const i=Dh(e);return!!i&&t.has(i)}(t,e)}function kl(t,e){return 0!==t.size&&Al(t,e)}function Al(t,e){const i=Dh(e);return!!i&&(!!t.has(i)||Al(t,i))}let xl;const Rl=t=>xl?(...e)=>{try{return t(...e)}catch(t){if(xl&&!0===xl(t))return;throw t}}:t,Ml=[];function Ol(t){try{if("composedPath"in t){const e=t.composedPath();if(e.length)return e[0]}else if("path"in t&&t.path.length)return t.path[0]}catch{}return t&&t.target}function Tl(t,e){const i=new Cl;Ml.push(i),i.init(t);const s=new(Eh("MutationObserver").constructor)(Rl(i.processMutations.bind(i)));return s.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function El({scrollCb:t,doc:e,mirror:i,blockClass:s,blockSelector:r,sampling:n}){return Vh("scroll",Rl(Jh(Rl(n=>{const o=Ol(n);if(!o||el(o,s,r,!0))return;const h=i.getId(o);if(o===e&&e.defaultView){const i=Hh(e.defaultView);t({id:h,x:i.left,y:i.top})}else t({id:h,x:o.scrollLeft,y:o.scrollTop})}),n.scroll||100)),e)}const Bl=["INPUT","TEXTAREA","SELECT"],Fl=new WeakMap;function Nl(t){return function(t,e){if(Ul("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||Ul("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||Ul("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||Ul("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){const i=Array.from(t.parentRule.cssRules).indexOf(t);e.unshift(i)}else if(t.parentStyleSheet){const i=Array.from(t.parentStyleSheet.cssRules).indexOf(t);e.unshift(i)}return e}(t,[])}function Ll(t,e,i){let s,r;return t?(t.ownerNode?s=e.getId(t.ownerNode):r=i.getId(t),{styleId:r,id:s}):{}}function jl({mirror:t,stylesheetManager:e},i){var s,r,n;let o=null;o="#document"===i.nodeName?t.getId(i):t.getId(Ph(i));const h="#document"===i.nodeName?null==(s=i.defaultView)?void 0:s.Document:null==(n=null==(r=i.ownerDocument)?void 0:r.defaultView)?void 0:n.ShadowRoot,l=(null==h?void 0:h.prototype)?Object.getOwnPropertyDescriptor(null==h?void 0:h.prototype,"adoptedStyleSheets"):void 0;return null!==o&&-1!==o&&h&&l?(Object.defineProperty(i,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var t;return null==(t=l.get)?void 0:t.call(this)},set(t){var i;const s=null==(i=l.set)?void 0:i.call(this,t);if(null!==o&&-1!==o)try{e.adoptStyleSheets(t,o)}catch(t){}return s}}),Rl(()=>{Object.defineProperty(i,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function Dl(t,e={}){const i=t.doc.defaultView;if(!i)return()=>{};let s;!function(t,e){const{mutationCb:i,mousemoveCb:s,mouseInteractionCb:r,scrollCb:n,viewportResizeCb:o,inputCb:h,mediaInteractionCb:l,styleSheetRuleCb:a,styleDeclarationCb:c,canvasMutationCb:u,fontCb:f,selectionCb:d,customElementCb:p}=t;t.mutationCb=(...t)=>{e.mutation&&e.mutation(...t),i(...t)},t.mousemoveCb=(...t)=>{e.mousemove&&e.mousemove(...t),s(...t)},t.mouseInteractionCb=(...t)=>{e.mouseInteraction&&e.mouseInteraction(...t),r(...t)},t.scrollCb=(...t)=>{e.scroll&&e.scroll(...t),n(...t)},t.viewportResizeCb=(...t)=>{e.viewportResize&&e.viewportResize(...t),o(...t)},t.inputCb=(...t)=>{e.input&&e.input(...t),h(...t)},t.mediaInteractionCb=(...t)=>{e.mediaInteaction&&e.mediaInteaction(...t),l(...t)},t.styleSheetRuleCb=(...t)=>{e.styleSheetRule&&e.styleSheetRule(...t),a(...t)},t.styleDeclarationCb=(...t)=>{e.styleDeclaration&&e.styleDeclaration(...t),c(...t)},t.canvasMutationCb=(...t)=>{e.canvasMutation&&e.canvasMutation(...t),u(...t)},t.fontCb=(...t)=>{e.font&&e.font(...t),f(...t)},t.selectionCb=(...t)=>{e.selection&&e.selection(...t),d(...t)},t.customElementCb=(...t)=>{e.customElement&&e.customElement(...t),p(...t)}}(t,e),t.recordDOM&&(s=Tl(t,t.doc));const r=function({mousemoveCb:t,sampling:e,doc:i,mirror:s}){if(!1===e.mousemove)return()=>{};const r="number"==typeof e.mousemove?e.mousemove:50,n="number"==typeof e.mousemoveCallback?e.mousemoveCallback:500;let o,h=[];const l=Jh(Rl(e=>{const i=Date.now()-o;t(h.map(t=>(t.timeOffset-=i,t)),e),h=[],o=null}),n),a=Rl(Jh(Rl(t=>{const e=Ol(t),{clientX:i,clientY:r}=rl(t)?t.changedTouches[0]:t;o||(o=_h()),h.push({x:i,y:r,id:s.getId(e),timeOffset:_h()-o}),l("undefined"!=typeof DragEvent&&t instanceof DragEvent?fl.Drag:t instanceof MouseEvent?fl.MouseMove:fl.TouchMove)}),r,{trailing:!1})),c=[Vh("mousemove",a,i),Vh("touchmove",a,i),Vh("drag",a,i)];return Rl(()=>{c.forEach(t=>t())})}(t),n=function({mouseInteractionCb:t,doc:e,mirror:i,blockClass:s,blockSelector:r,sampling:n}){if(!1===n.mouseInteraction)return()=>{};const o=!0===n.mouseInteraction||void 0===n.mouseInteraction?{}:n.mouseInteraction,h=[];let l=null;return Object.keys(dl).filter(t=>Number.isNaN(Number(t))&&!t.endsWith("_Departed")&&!1!==o[t]).forEach(n=>{let o=S(n);const a=(e=>n=>{const o=Ol(n);if(el(o,s,r,!0))return;let h=null,a=e;if("pointerType"in n){switch(n.pointerType){case"mouse":h=pl.Mouse;break;case"touch":h=pl.Touch;break;case"pen":h=pl.Pen}h===pl.Touch?dl[e]===dl.MouseDown?a="TouchStart":dl[e]===dl.MouseUp&&(a="TouchEnd"):pl.Pen}else rl(n)&&(h=pl.Touch);null!==h?(l=h,(a.startsWith("Touch")&&h===pl.Touch||a.startsWith("Mouse")&&h===pl.Mouse)&&(h=null)):dl[e]===dl.Click&&(h=l,l=null);const c=rl(n)?n.changedTouches[0]:n;if(!c)return;const u=i.getId(o),{clientX:f,clientY:d}=c;Rl(t)({type:dl[a],id:u,x:f,y:d,...null!==h&&{pointerType:h}})})(n);if(window.PointerEvent)switch(dl[n]){case dl.MouseDown:case dl.MouseUp:o=o.replace("mouse","pointer");break;case dl.TouchStart:case dl.TouchEnd:return}h.push(Vh(o,a,e))}),Rl(()=>{h.forEach(t=>t())})}(t),o=El(t),h=function({viewportResizeCb:t},{win:e}){let i=-1,s=-1;return Vh("resize",Rl(Jh(Rl(()=>{const e=Qh(),r=qh();i===e&&s===r||(t({width:Number(r),height:Number(e)}),i=e,s=r)}),200)),e)}(t,{win:i}),l=function({inputCb:t,doc:e,mirror:i,blockClass:s,blockSelector:r,ignoreClass:n,ignoreSelector:o,maskInputOptions:h,maskInputFn:l,sampling:a,userTriggeredOnInput:c}){function u(t){let i=Ol(t);const a=t.isTrusted,u=i&&i.tagName;if(i&&"OPTION"===u&&(i=Uh(i)),!i||!u||Bl.indexOf(u)<0||el(i,s,r,!0))return;if(i.classList.contains(n)||o&&i.matches(o))return;let d=i.value,p=!1;const m=A(i)||"";"radio"===m||"checkbox"===m?p=i.checked:(h[u.toLowerCase()]||h[m])&&(d=I({element:i,maskInputOptions:h,tagName:u,type:m,value:d,maskInputFn:l})),f(i,c?{text:d,isChecked:p,userTriggered:a}:{text:d,isChecked:p});const g=i.name;"radio"===m&&g&&p&&e.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(t=>{if(t!==i){const e=t.value;f(t,c?{text:e,isChecked:!p,userTriggered:!1}:{text:e,isChecked:!p})}})}function f(e,s){const r=Fl.get(e);if(!r||r.text!==s.text||r.isChecked!==s.isChecked){Fl.set(e,s);const r=i.getId(e);Rl(t)({...s,id:r})}}const d=("last"===a.input?["change"]:["input","change"]).map(t=>Vh(t,Rl(u),e)),p=e.defaultView;if(!p)return()=>{d.forEach(t=>t())};const m=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value"),g=[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&d.push(...g.map(t=>$h(t[0],t[1],{set(){Rl(u)({target:this,isTrusted:!1})}},!1,p))),Rl(()=>{d.forEach(t=>t())})}(t),a=function({mediaInteractionCb:t,blockClass:e,blockSelector:i,mirror:s,sampling:r,doc:n}){const o=Rl(n=>Jh(Rl(r=>{const o=Ol(r);if(!o||el(o,e,i,!0))return;const{currentTime:h,volume:l,muted:a,playbackRate:c,loop:u}=o;t({type:n,id:s.getId(o),currentTime:h,volume:l,muted:a,playbackRate:c,loop:u})}),r.media||500)),h=[Vh("play",o(gl.Play),n),Vh("pause",o(gl.Pause),n),Vh("seeked",o(gl.Seeked),n),Vh("volumechange",o(gl.VolumeChange),n),Vh("ratechange",o(gl.RateChange),n)];return Rl(()=>{h.forEach(t=>t())})}(t);let c=()=>{},u=()=>{},f=()=>{},d=()=>{};t.recordDOM&&(c=function({styleSheetRuleCb:t,mirror:e,stylesheetManager:i},{win:s}){if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};const r=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(r,{apply:Rl((s,r,n)=>{const[o,h]=n,{id:l,styleId:a}=Ll(r,e,i.styleMirror);return(l&&-1!==l||a&&-1!==a)&&t({id:l,styleId:a,adds:[{rule:o,index:h}]}),s.apply(r,n)})}),s.CSSStyleSheet.prototype.addRule=function(t,e,i=this.cssRules.length){const r=`${t} { ${e} }`;return s.CSSStyleSheet.prototype.insertRule.apply(this,[r,i])};const n=s.CSSStyleSheet.prototype.deleteRule;let o,h;s.CSSStyleSheet.prototype.deleteRule=new Proxy(n,{apply:Rl((s,r,n)=>{const[o]=n,{id:h,styleId:l}=Ll(r,e,i.styleMirror);return(h&&-1!==h||l&&-1!==l)&&t({id:h,styleId:l,removes:[{index:o}]}),s.apply(r,n)})}),s.CSSStyleSheet.prototype.removeRule=function(t){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[t])},s.CSSStyleSheet.prototype.replace&&(o=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:Rl((s,r,n)=>{const[o]=n,{id:h,styleId:l}=Ll(r,e,i.styleMirror);return(h&&-1!==h||l&&-1!==l)&&t({id:h,styleId:l,replace:o}),s.apply(r,n)})})),s.CSSStyleSheet.prototype.replaceSync&&(h=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(h,{apply:Rl((s,r,n)=>{const[o]=n,{id:h,styleId:l}=Ll(r,e,i.styleMirror);return(h&&-1!==h||l&&-1!==l)&&t({id:h,styleId:l,replaceSync:o}),s.apply(r,n)})}));const l={};Wl("CSSGroupingRule")?l.CSSGroupingRule=s.CSSGroupingRule:(Wl("CSSMediaRule")&&(l.CSSMediaRule=s.CSSMediaRule),Wl("CSSConditionRule")&&(l.CSSConditionRule=s.CSSConditionRule),Wl("CSSSupportsRule")&&(l.CSSSupportsRule=s.CSSSupportsRule));const a={};return Object.entries(l).forEach(([s,r])=>{a[s]={insertRule:r.prototype.insertRule,deleteRule:r.prototype.deleteRule},r.prototype.insertRule=new Proxy(a[s].insertRule,{apply:Rl((s,r,n)=>{const[o,h]=n,{id:l,styleId:a}=Ll(r.parentStyleSheet,e,i.styleMirror);return(l&&-1!==l||a&&-1!==a)&&t({id:l,styleId:a,adds:[{rule:o,index:[...Nl(r),h||0]}]}),s.apply(r,n)})}),r.prototype.deleteRule=new Proxy(a[s].deleteRule,{apply:Rl((s,r,n)=>{const[o]=n,{id:h,styleId:l}=Ll(r.parentStyleSheet,e,i.styleMirror);return(h&&-1!==h||l&&-1!==l)&&t({id:h,styleId:l,removes:[{index:[...Nl(r),o]}]}),s.apply(r,n)})})}),Rl(()=>{s.CSSStyleSheet.prototype.insertRule=r,s.CSSStyleSheet.prototype.deleteRule=n,o&&(s.CSSStyleSheet.prototype.replace=o),h&&(s.CSSStyleSheet.prototype.replaceSync=h),Object.entries(l).forEach(([t,e])=>{e.prototype.insertRule=a[t].insertRule,e.prototype.deleteRule=a[t].deleteRule})})}(t,{win:i}),u=jl(t,t.doc),f=function({styleDeclarationCb:t,mirror:e,ignoreCSSAttributes:i,stylesheetManager:s},{win:r}){const n=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=new Proxy(n,{apply:Rl((r,o,h)=>{var l;const[a,c,u]=h;if(i.has(a))return n.apply(o,[a,c,u]);const{id:f,styleId:d}=Ll(null==(l=o.parentRule)?void 0:l.parentStyleSheet,e,s.styleMirror);return(f&&-1!==f||d&&-1!==d)&&t({id:f,styleId:d,set:{property:a,value:c,priority:u},index:Nl(o.parentRule)}),r.apply(o,h)})});const o=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:Rl((r,n,h)=>{var l;const[a]=h;if(i.has(a))return o.apply(n,[a]);const{id:c,styleId:u}=Ll(null==(l=n.parentRule)?void 0:l.parentStyleSheet,e,s.styleMirror);return(c&&-1!==c||u&&-1!==u)&&t({id:c,styleId:u,remove:{property:a},index:Nl(n.parentRule)}),r.apply(n,h)})}),Rl(()=>{r.CSSStyleDeclaration.prototype.setProperty=n,r.CSSStyleDeclaration.prototype.removeProperty=o})}(t,{win:i}),t.collectFonts&&(d=function({fontCb:t,doc:e}){const i=e.defaultView;if(!i)return()=>{};const s=[],r=new WeakMap,n=i.FontFace;i.FontFace=function(t,e,i){const s=new n(t,e,i);return r.set(s,{family:t,buffer:"string"!=typeof e,descriptors:i,fontSource:"string"==typeof e?e:JSON.stringify(Array.from(new Uint8Array(e)))}),s};const o=Kh(e.fonts,"add",function(e){return function(i){return setTimeout(Rl(()=>{const e=r.get(i);e&&(t(e),r.delete(i))}),0),e.apply(this,[i])}});return s.push(()=>{i.FontFace=n}),s.push(o),Rl(()=>{s.forEach(t=>t())})}(t)));const p=function(t){const{doc:e,mirror:i,blockClass:s,blockSelector:r,selectionCb:n}=t;let o=!0;const h=Rl(()=>{const t=e.getSelection();if(!t||o&&(null==t?void 0:t.isCollapsed))return;o=t.isCollapsed||!1;const h=[],l=t.rangeCount||0;for(let e=0;e<l;e++){const n=t.getRangeAt(e),{startContainer:o,startOffset:l,endContainer:a,endOffset:c}=n;el(o,s,r,!0)||el(a,s,r,!0)||h.push({start:i.getId(o),startOffset:l,end:i.getId(a),endOffset:c})}n({ranges:h})});return h(),Vh("selectionchange",h)}(t),m=function({doc:t,customElementCb:e}){const i=t.defaultView;return i&&i.customElements?Kh(i.customElements,"define",function(t){return function(i,s,r){try{e({define:{name:i}})}catch(t){console.warn(`Custom element callback failed for ${i}`)}return t.apply(this,[i,s,r])}}):()=>{}}(t),g=[];for(const e of t.plugins)g.push(e.observer(e.callback,i,e.options));return Rl(()=>{Ml.forEach(t=>t.reset()),null==s||s.disconnect(),r(),n(),o(),h(),l(),a(),c(),u(),f(),d(),p(),m(),g.forEach(t=>t())})}function Ul(t){return void 0!==window[t]}function Wl(t){return Boolean(void 0!==window[t]&&window[t].prototype&&"insertRule"in window[t].prototype&&"deleteRule"in window[t].prototype)}class Yl{constructor(t){i(this,"iframeIdToRemoteIdMap",new WeakMap),i(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,e,i,s){const r=i||this.getIdToRemoteIdMap(t),n=s||this.getRemoteIdToIdMap(t);let o=r.get(e);return o||(o=this.generateIdFn(),r.set(e,o),n.set(o,e)),o}getIds(t,e){const i=this.getIdToRemoteIdMap(t),s=this.getRemoteIdToIdMap(t);return e.map(e=>this.getId(t,e,i,s))}getRemoteId(t,e,i){const s=i||this.getRemoteIdToIdMap(t);return"number"!=typeof e?e:s.get(e)||-1}getRemoteIds(t,e){const i=this.getRemoteIdToIdMap(t);return e.map(e=>this.getRemoteId(t,e,i))}reset(t){if(!t)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let e=this.iframeIdToRemoteIdMap.get(t);return e||(e=new Map,this.iframeIdToRemoteIdMap.set(t,e)),e}getRemoteIdToIdMap(t){let e=this.iframeRemoteIdToIdMap.get(t);return e||(e=new Map,this.iframeRemoteIdToIdMap.set(t,e)),e}}class Zl{constructor(t){i(this,"iframes",new WeakMap),i(this,"crossOriginIframeMap",new WeakMap),i(this,"crossOriginIframeMirror",new Yl(L)),i(this,"crossOriginIframeStyleMirror"),i(this,"crossOriginIframeRootIdMap",new WeakMap),i(this,"mirror"),i(this,"mutationCb"),i(this,"wrappedEmit"),i(this,"loadListener"),i(this,"stylesheetManager"),i(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Yl(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,e){var i,s;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:e}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(i=t.contentWindow)||i.addEventListener("message",this.handleMessage.bind(this))),null==(s=this.loadListener)||s.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const e=t;if("rrweb"!==e.data.type||e.origin!==e.data.origin)return;if(!t.source)return;const i=this.crossOriginIframeMap.get(t.source);if(!i)return;const s=this.transformCrossOriginEvent(i,e.data.event);s&&this.wrappedEmit(s,e.data.isCheckout)}transformCrossOriginEvent(t,e){var i;switch(e.type){case ul.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(e.data.node,t);const i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(t,i),this.patchRootIdOnNode(e.data.node,i),{timestamp:e.timestamp,type:ul.IncrementalSnapshot,data:{source:fl.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case ul.Meta:case ul.Load:case ul.DomContentLoaded:return!1;case ul.Plugin:return e;case ul.Custom:return this.replaceIds(e.data.payload,t,["id","parentId","previousId","nextId"]),e;case ul.IncrementalSnapshot:switch(e.data.source){case fl.Mutation:return e.data.adds.forEach(e=>{this.replaceIds(e,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,t);const i=this.crossOriginIframeRootIdMap.get(t);i&&this.patchRootIdOnNode(e.node,i)}),e.data.removes.forEach(e=>{this.replaceIds(e,t,["parentId","id"])}),e.data.attributes.forEach(e=>{this.replaceIds(e,t,["id"])}),e.data.texts.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case fl.Drag:case fl.TouchMove:case fl.MouseMove:return e.data.positions.forEach(e=>{this.replaceIds(e,t,["id"])}),e;case fl.ViewportResize:return!1;case fl.MediaInteraction:case fl.MouseInteraction:case fl.Scroll:case fl.CanvasMutation:case fl.Input:return this.replaceIds(e.data,t,["id"]),e;case fl.StyleSheetRule:case fl.StyleDeclaration:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleId"]),e;case fl.Font:return e;case fl.Selection:return e.data.ranges.forEach(e=>{this.replaceIds(e,t,["start","end"])}),e;case fl.AdoptedStyleSheet:return this.replaceIds(e.data,t,["id"]),this.replaceStyleIds(e.data,t,["styleIds"]),null==(i=e.data.styles)||i.forEach(e=>{this.replaceStyleIds(e,t,["styleId"])}),e}}return!1}replace(t,e,i,s){for(const r of s)(Array.isArray(e[r])||"number"==typeof e[r])&&(Array.isArray(e[r])?e[r]=t.getIds(i,e[r]):e[r]=t.getId(i,e[r]));return e}replaceIds(t,e,i){return this.replace(this.crossOriginIframeMirror,t,e,i)}replaceStyleIds(t,e,i){return this.replace(this.crossOriginIframeStyleMirror,t,e,i)}replaceIdOnNode(t,e){this.replaceIds(t,e,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(t=>{this.replaceIdOnNode(t,e)})}patchRootIdOnNode(t,e){t.type===wl.Document||t.rootId||(t.rootId=e),"childNodes"in t&&t.childNodes.forEach(t=>{this.patchRootIdOnNode(t,e)})}}class Pl{constructor(t){i(this,"shadowDoms",new WeakSet),i(this,"mutationCb"),i(this,"scrollCb"),i(this,"bypassOptions"),i(this,"mirror"),i(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,e){if(!y(t))return;if(this.shadowDoms.has(t))return;this.shadowDoms.add(t);const i=Tl({...this.bypassOptions,doc:e,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>i.disconnect()),this.restoreHandlers.push(El({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(Ph(t))),this.restoreHandlers.push(jl({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){t.contentWindow&&t.contentDocument&&this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,e){const i=this;this.restoreHandlers.push(Kh(t.prototype,"attachShadow",function(t){return function(s){const r=t.call(this,s),n=Gh(this);return n&&cl(this)&&i.addShadowRoot(n,e),r}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Gl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Vl="undefined"==typeof Uint8Array?[]:new Uint8Array(256),zl=0;zl<64;zl++)Vl[Gl.charCodeAt(zl)]=zl;const Xl=new Map,Jl=(t,e,i)=>{if(!t||!_l(t,e)&&"object"!=typeof t)return;const s=function(t,e){let i=Xl.get(t);return i||(i=new Map,Xl.set(t,i)),i.has(e)||i.set(e,[]),i.get(e)}(i,t.constructor.name);let r=s.indexOf(t);return-1===r&&(r=s.length,s.push(t)),r};function $l(t,e,i){if(t instanceof Array)return t.map(t=>$l(t,e,i));if(null===t)return t;if(t instanceof Float32Array||t instanceof Float64Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Int16Array||t instanceof Int8Array||t instanceof Uint8ClampedArray)return{rr_type:t.constructor.name,args:[Object.values(t)]};if(t instanceof ArrayBuffer)return{rr_type:t.constructor.name,base64:function(t){var e,i=new Uint8Array(t),s=i.length,r="";for(e=0;e<s;e+=3)r+=Gl[i[e]>>2],r+=Gl[(3&i[e])<<4|i[e+1]>>4],r+=Gl[(15&i[e+1])<<2|i[e+2]>>6],r+=Gl[63&i[e+2]];return s%3==2?r=r.substring(0,r.length-1)+"=":s%3==1&&(r=r.substring(0,r.length-2)+"=="),r}(t)};if(t instanceof DataView)return{rr_type:t.constructor.name,args:[$l(t.buffer,e,i),t.byteOffset,t.byteLength]};if(t instanceof HTMLImageElement){const e=t.constructor.name,{src:i}=t;return{rr_type:e,src:i}}return t instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:t.toDataURL()}:t instanceof ImageData?{rr_type:t.constructor.name,args:[$l(t.data,e,i),t.width,t.height]}:_l(t,e)||"object"==typeof t?{rr_type:t.constructor.name,index:Jl(t,e,i)}:t}const Kl=(t,e,i)=>t.map(t=>$l(t,e,i)),_l=(t,e)=>{const i=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(t=>"function"==typeof e[t]);return Boolean(i.find(i=>t instanceof e[i]))};function Hl(t,e,i,s){const r=[];try{const n=Kh(t.HTMLCanvasElement.prototype,"getContext",function(t){return function(r,...n){if(!el(this,e,i,!0)){const t=function(t){return"experimental-webgl"===t?"webgl":t}(r);if("i"in this||(this.i=t),s&&["webgl","webgl2"].includes(t))if(n[0]&&"object"==typeof n[0]){const t=n[0];t.preserveDrawingBuffer||(t.preserveDrawingBuffer=!0)}else n.splice(0,1,{preserveDrawingBuffer:!0})}return t.apply(this,[r,...n])}});r.push(n)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{r.forEach(t=>t())}}function Ql(t,e,i,s,r,n){const o=[],h=Object.getOwnPropertyNames(t);for(const l of h)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if("function"!=typeof t[l])continue;const h=Kh(t,l,function(t){return function(...o){const h=t.apply(this,o);if(Jl(h,n,this),"tagName"in this.canvas&&!el(this.canvas,s,r,!0)){const t=Kl(o,n,this),s={type:e,property:l,args:t};i(this.canvas,s)}return h}});o.push(h)}catch{const s=$h(t,l,{set(t){i(this.canvas,{type:e,property:l,args:[t],setter:!0})}});o.push(s)}return o}const ql="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",ta="undefined"!=typeof window&&window.Blob&&new Blob([(ea=ql,Uint8Array.from(atob(ea),t=>t.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});var ea;function ia(t){let e;try{if(e=ta&&(window.URL||window.webkitURL).createObjectURL(ta),!e)throw"";const i=new Worker(e,{name:null==t?void 0:t.name});return i.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),i}catch(e){return new Worker("data:text/javascript;base64,"+ql,{name:null==t?void 0:t.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class sa{constructor(t){i(this,"pendingCanvasMutations",new Map),i(this,"rafStamps",{latestId:0,invokeId:null}),i(this,"mirror"),i(this,"mutationCb"),i(this,"resetObservers"),i(this,"frozen",!1),i(this,"locked",!1),i(this,"processMutation",(t,e)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(t)||this.pendingCanvasMutations.set(t,[]),this.pendingCanvasMutations.get(t).push(e)});const{sampling:e="all",win:s,blockClass:r,blockSelector:n,recordCanvas:o,dataURLOptions:h}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,o&&"all"===e&&this.initCanvasMutationObserver(s,r,n),o&&"number"==typeof e&&this.initCanvasFPSObserver(e,s,r,n,{dataURLOptions:h})}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(t,e,i,s,r){const n=Hl(e,i,s,!0),o=new Map,h=new ia;h.onmessage=t=>{const{id:e}=t.data;if(o.set(e,!1),!("base64"in t.data))return;const{base64:i,type:s,width:r,height:n}=t.data;this.mutationCb({id:e,type:ml["2D"],commands:[{property:"clearRect",args:[0,0,r,n]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:i}],type:s}]},0,0]}]})};const l=1e3/t;let a,c=0;const u=t=>{c&&t-c<l||(c=t,(()=>{const t=[];return e.document.querySelectorAll("canvas").forEach(e=>{el(e,i,s,!0)||t.push(e)}),t})().forEach(async t=>{var e;const i=this.mirror.getId(t);if(o.get(i))return;if(0===t.width||0===t.height)return;if(o.set(i,!0),["webgl","webgl2"].includes(t.i)){const i=t.getContext(t.i);!1===(null==(e=null==i?void 0:i.getContextAttributes())?void 0:e.preserveDrawingBuffer)&&i.clear(i.COLOR_BUFFER_BIT)}const s=await createImageBitmap(t);h.postMessage({id:i,bitmap:s,width:t.width,height:t.height,dataURLOptions:r.dataURLOptions},[s])})),a=requestAnimationFrame(u)};a=requestAnimationFrame(u),this.resetObservers=()=>{n(),cancelAnimationFrame(a)}}initCanvasMutationObserver(t,e,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const s=Hl(t,e,i,!1),r=function(t,e,i,s){const r=[],n=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const o of n)try{if("function"!=typeof e.CanvasRenderingContext2D.prototype[o])continue;const n=Kh(e.CanvasRenderingContext2D.prototype,o,function(r){return function(...n){return el(this.canvas,i,s,!0)||setTimeout(()=>{const i=Kl(n,e,this);t(this.canvas,{type:ml["2D"],property:o,args:i})},0),r.apply(this,n)}});r.push(n)}catch{const i=$h(e.CanvasRenderingContext2D.prototype,o,{set(e){t(this.canvas,{type:ml["2D"],property:o,args:[e],setter:!0})}});r.push(i)}return()=>{r.forEach(t=>t())}}(this.processMutation.bind(this),t,e,i),n=function(t,e,i,s){const r=[];return r.push(...Ql(e.WebGLRenderingContext.prototype,ml.WebGL,t,i,s,e)),void 0!==e.WebGL2RenderingContext&&r.push(...Ql(e.WebGL2RenderingContext.prototype,ml.WebGL2,t,i,s,e)),()=>{r.forEach(t=>t())}}(this.processMutation.bind(this),t,e,i);this.resetObservers=()=>{s(),r(),n()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=e=>{this.rafStamps.latestId=e,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,e)=>{const i=this.mirror.getId(e);this.flushPendingCanvasMutationFor(e,i)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,e){if(this.frozen||this.locked)return;const i=this.pendingCanvasMutations.get(t);if(!i||-1===e)return;const s=i.map(t=>{const{type:e,...i}=t;return i}),{type:r}=i[0];this.mutationCb({id:e,type:r,commands:s}),this.pendingCanvasMutations.delete(t)}}class ra{constructor(t){i(this,"trackedLinkElements",new WeakSet),i(this,"mutationCb"),i(this,"adoptedStyleSheetCb"),i(this,"styleMirror",new ll),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,e){"t"in e.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:e.id,attributes:e.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,e){if(0===t.length)return;const i={id:e,styleIds:[]},s=[];for(const e of t){let t;this.styleMirror.has(e)?t=this.styleMirror.getId(e):(t=this.styleMirror.add(e),s.push({styleId:t,rules:Array.from(e.rules||CSSRule,(t,i)=>({rule:v(t,e.href),index:i}))})),i.styleIds.push(t)}s.length>0&&(i.styles=s),this.adoptedStyleSheetCb(i)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class na{constructor(){i(this,"nodeMap",new WeakMap),i(this,"active",!1)}inOtherBuffer(t,e){const i=this.nodeMap.get(t);return i&&Array.from(i).some(t=>t!==e)}add(t,e){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(e))}destroy(){}}let oa,ha,la,aa=!1;try{if(2!==Array.from([1],t=>2*t)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(t=e.contentWindow)?void 0:t.Array.from)||Array.from,document.body.removeChild(e)}}catch(t){console.debug("Unable to override Array.from",t)}const ca=new C;function ua(t={}){const{emit:e,checkoutEveryNms:i,checkoutEveryNth:s,blockClass:r="rr-block",blockSelector:n=null,ignoreClass:o="rr-ignore",ignoreSelector:h=null,maskTextClass:l="rr-mask",maskTextSelector:a=null,inlineStylesheet:c=!0,maskAllInputs:u,maskInputOptions:f,slimDOMOptions:d,maskInputFn:p,maskTextFn:m,hooks:g,packFn:w,sampling:y={},dataURLOptions:b={},mousemoveWait:v,recordDOM:I=!0,recordCanvas:S=!1,recordCrossOriginIframes:k=!1,recordAfter:A=("DOMContentLoaded"===t.recordAfter?t.recordAfter:"load"),userTriggeredOnInput:x=!1,collectFonts:R=!1,inlineImages:M=!1,plugins:O,keepIframeSrcFn:T=()=>!1,ignoreCSSAttributes:E=new Set([]),errorHandler:B}=t;xl=B;const F=!k||window.parent===window;let N=!1;if(!F)try{window.parent.document&&(N=!1)}catch(t){N=!0}if(F&&!e)throw new Error("emit function is required");if(!F&&!N)return()=>{};void 0!==v&&void 0===y.mousemove&&(y.mousemove=v),ca.reset();const L=!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!==f?f:{password:!0},j=!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 D;!function(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let U=0;const W=t=>{for(const e of O||[])e.eventProcessor&&(t=e.eventProcessor(t));return w&&!N&&(t=w(t)),t};oa=(t,r)=>{var n;const o=t;if(o.timestamp=_h(),!(null==(n=Ml[0])?void 0:n.isFrozen())||o.type===ul.FullSnapshot||o.type===ul.IncrementalSnapshot&&o.data.source===fl.Mutation||Ml.forEach(t=>t.unfreeze()),F)null==e||e(W(o),r);else if(N){const t={type:"rrweb",event:W(o),origin:window.location.origin,isCheckout:r};window.parent.postMessage(t,"*")}if(o.type===ul.FullSnapshot)D=o,U=0;else if(o.type===ul.IncrementalSnapshot){if(o.data.source===fl.Mutation&&o.data.isAttachIframe)return;U++;const t=s&&U>=s,e=i&&o.timestamp-D.timestamp>i;(t||e)&&ha(!0)}};const Y=t=>{oa({type:ul.IncrementalSnapshot,data:{source:fl.Mutation,...t}})},Z=t=>oa({type:ul.IncrementalSnapshot,data:{source:fl.Scroll,...t}}),P=t=>oa({type:ul.IncrementalSnapshot,data:{source:fl.CanvasMutation,...t}}),G=new ra({mutationCb:Y,adoptedStyleSheetCb:t=>oa({type:ul.IncrementalSnapshot,data:{source:fl.AdoptedStyleSheet,...t}})}),V=new Zl({mirror:ca,mutationCb:Y,stylesheetManager:G,recordCrossOriginIframes:k,wrappedEmit:oa});for(const t of O||[])t.getMirror&&t.getMirror({nodeMirror:ca,crossOriginIframeMirror:V.crossOriginIframeMirror,crossOriginIframeStyleMirror:V.crossOriginIframeStyleMirror});const z=new na;la=new sa({recordCanvas:S,mutationCb:P,win:window,blockClass:r,blockSelector:n,mirror:ca,sampling:y.canvas,dataURLOptions:b});const X=new Pl({mutationCb:Y,scrollCb:Z,bypassOptions:{blockClass:r,blockSelector:n,maskTextClass:l,maskTextSelector:a,inlineStylesheet:c,maskInputOptions:L,dataURLOptions:b,maskTextFn:m,maskInputFn:p,recordCanvas:S,inlineImages:M,sampling:y,slimDOMOptions:j,iframeManager:V,stylesheetManager:G,canvasManager:la,keepIframeSrcFn:T,processedNodeManager:z},mirror:ca});ha=(t=!1)=>{if(!I)return;oa({type:ul.Meta,data:{href:window.location.href,width:qh(),height:Qh()}},t),G.reset(),X.init(),Ml.forEach(t=>t.lock());const e=function(t,e){const{mirror:i=new C,blockClass:s="rr-block",blockSelector:r=null,maskTextClass:n="rr-mask",maskTextSelector:o=null,inlineStylesheet:h=!0,inlineImages:l=!1,recordCanvas:a=!1,maskAllInputs:c=!1,maskTextFn:u,maskInputFn:f,slimDOM:d=!1,dataURLOptions:p,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:w,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:v,keepIframeSrcFn:I=()=>!1}=e||{};return $(t,{doc:t,mirror:i,blockClass:s,blockSelector:r,maskTextClass:n,maskTextSelector:o,skipChild:!1,inlineStylesheet:h,maskInputOptions:!0===c?{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===c?{password:!0}:c,maskTextFn:u,maskInputFn:f,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:p,inlineImages:l,recordCanvas:a,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:w,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:v,keepIframeSrcFn:I,newlyAddedElement:!1})}(document,{mirror:ca,blockClass:r,blockSelector:n,maskTextClass:l,maskTextSelector:a,inlineStylesheet:c,maskAllInputs:L,maskTextFn:m,maskInputFn:p,slimDOM:j,dataURLOptions:b,recordCanvas:S,inlineImages:M,onSerialize:t=>{nl(t,ca)&&V.addIframe(t),ol(t,ca)&&G.trackLinkElement(t),hl(t)&&X.addShadowRoot(Gh(t),document)},onIframeLoad:(t,e)=>{V.attachIframe(t,e),X.observeAttachShadow(t)},onStylesheetLoad:(t,e)=>{G.attachLinkElement(t,e)},keepIframeSrcFn:T});if(!e)return console.warn("Failed to snapshot the document");oa({type:ul.FullSnapshot,data:{node:e,initialOffset:Hh(window)}},t),Ml.forEach(t=>t.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&G.adoptStyleSheets(document.adoptedStyleSheets,ca.getId(document))};try{const t=[],e=t=>{var e;return Rl(Dl)({mutationCb:Y,mousemoveCb:(t,e)=>oa({type:ul.IncrementalSnapshot,data:{source:e,positions:t}}),mouseInteractionCb:t=>oa({type:ul.IncrementalSnapshot,data:{source:fl.MouseInteraction,...t}}),scrollCb:Z,viewportResizeCb:t=>oa({type:ul.IncrementalSnapshot,data:{source:fl.ViewportResize,...t}}),inputCb:t=>oa({type:ul.IncrementalSnapshot,data:{source:fl.Input,...t}}),mediaInteractionCb:t=>oa({type:ul.IncrementalSnapshot,data:{source:fl.MediaInteraction,...t}}),styleSheetRuleCb:t=>oa({type:ul.IncrementalSnapshot,data:{source:fl.StyleSheetRule,...t}}),styleDeclarationCb:t=>oa({type:ul.IncrementalSnapshot,data:{source:fl.StyleDeclaration,...t}}),canvasMutationCb:P,fontCb:t=>oa({type:ul.IncrementalSnapshot,data:{source:fl.Font,...t}}),selectionCb:t=>{oa({type:ul.IncrementalSnapshot,data:{source:fl.Selection,...t}})},customElementCb:t=>{oa({type:ul.IncrementalSnapshot,data:{source:fl.CustomElement,...t}})},blockClass:r,ignoreClass:o,ignoreSelector:h,maskTextClass:l,maskTextSelector:a,maskInputOptions:L,inlineStylesheet:c,sampling:y,recordDOM:I,recordCanvas:S,inlineImages:M,userTriggeredOnInput:x,collectFonts:R,doc:t,maskInputFn:p,maskTextFn:m,keepIframeSrcFn:T,blockSelector:n,slimDOMOptions:j,dataURLOptions:b,mirror:ca,iframeManager:V,stylesheetManager:G,shadowDomManager:X,processedNodeManager:z,canvasManager:la,ignoreCSSAttributes:E,plugins:(null==(e=null==O?void 0:O.filter(t=>t.observer))?void 0:e.map(t=>({observer:t.observer,options:t.options,callback:e=>oa({type:ul.Plugin,data:{plugin:t.name,payload:e}})})))||[]},g)};V.addLoadListener(i=>{try{t.push(e(i.contentDocument))}catch(t){console.warn(t)}});const i=()=>{ha(),t.push(e(document)),aa=!0};return"interactive"===document.readyState||"complete"===document.readyState?i():(t.push(Vh("DOMContentLoaded",()=>{oa({type:ul.DomContentLoaded,data:{}}),"DOMContentLoaded"===A&&i()})),t.push(Vh("load",()=>{oa({type:ul.Load,data:{}}),"load"===A&&i()},window))),()=>{t.forEach(t=>t()),z.destroy(),aa=!1,xl=void 0}}catch(t){console.warn(t)}}var fa,da;ua.addCustomEvent=(t,e)=>{if(!aa)throw new Error("please add custom event after start recording");oa({type:ul.Custom,data:{tag:t,payload:e}})},ua.freezePage=()=>{Ml.forEach(t=>t.freeze())},ua.takeFullSnapshot=t=>{if(!aa)throw new Error("please take full snapshot after start recording");ha(t)},ua.mirror=ca,(da=fa||(fa={}))[da.NotStarted=0]="NotStarted",da[da.Running=1]="Running",da[da.Stopped=2]="Stopped";const{addCustomEvent:pa}=ua,{freezePage:ma}=ua,{takeFullSnapshot:ga}=ua;export{ul as EventType,fl as IncrementalSource,dl as MouseInteractions,pa as addCustomEvent,ma as freezePage,Xh as mirror,ua as record,ga as takeFullSnapshot};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Zaplier SDK v3.0.0 - Unified SDK
|
|
3
|
+
* Advanced privacy-first tracking with code splitting
|
|
4
|
+
* (c) 2026 Zaplier Team
|
|
5
|
+
*/
|
|
6
|
+
class t{constructor(t,i,s={}){this.events=[],this.isActive=!1,this.isPaused=!1,this.lastActivityTime=Date.now(),this.sessionStartTime=Date.now(),this.boundOnActivity=null,this.sessionId=t,this.visitorId=i,this.config={enabled:!0,sampleRate:1,batchInterval:1e4,inactivityTimeout:3e4,pauseOnInactive:!0,...s}}async start(){if(!this.config.enabled||this.isActive)return!1;if(Math.random()>this.config.sampleRate)return!1;try{const{record:t}=await import("./rrweb-CUXM0llf.min.js");return this.rrwebStopRecord=t({emit:t=>{this.onActivity(),this.isPaused||this.events.push(t)},inlineStylesheet:!0,collectFonts:!0,inlineImages:!0,sampling:{mousemove:!0,mouseInteraction:!1,scroll:150,input:"last"}}),this.isActive=!0,this.startBatchTimer(),this.startInactivityTracking(),!0}catch(t){return console.error("[Zaplier] Failed to start rrweb recording:",t),!1}}stop(){this.isActive&&(this.isActive=!1,this.rrwebStopRecord&&(this.rrwebStopRecord(),this.rrwebStopRecord=void 0),this.batchTimer&&(clearInterval(this.batchTimer),this.batchTimer=void 0),this.inactivityTimer&&(clearTimeout(this.inactivityTimer),this.inactivityTimer=void 0),this.boundOnActivity&&(["mousedown","mousemove","keypress","scroll","touchstart","click"].forEach(t=>{document.removeEventListener(t,this.boundOnActivity,!0)}),this.boundOnActivity=null),this.sendBatch())}startBatchTimer(){this.batchTimer=window.setInterval(()=>{this.sendBatch()},this.config.batchInterval)}sendBatch(){if(!this.sdkInstance)return void(this.config.pauseOnInactive&&this.events.length>0&&console.warn("[Zaplier] Replay: SDK instance not ready, holding batch"));if(0===this.events.length)return;const t={sessionId:this.sessionId,visitorId:this.visitorId,events:[...this.events],metadata:{userAgent:navigator.userAgent,timestamp:Date.now(),startUrl:window.location.href,duration:Date.now()-this.sessionStartTime,activeTime:this.getActiveTime(),funnelSteps:[],hasConversion:!1,eventsCount:this.events.length,isPaused:this.isPaused}};this.events=[],t.events.length,this.sendToBackend(t)}setSDKInstance(t){this.sdkInstance=t}async sendToBackend(t){try{if(!this.sdkInstance)return void console.error("[Zaplier] No SDK instance available for replay transport");const i=await this.sdkInstance.sendReplayBatch(t);i&&i.success||console.error("[Zaplier] Session replay batch failed:",i)}catch(t){console.error("[Zaplier] Session replay error:",t)}}getEventCount(){return this.events.length}isRecording(){return this.isActive}isPausedState(){return this.isPaused}startInactivityTracking(){this.config.pauseOnInactive&&(this.boundOnActivity=this.onActivity.bind(this),["mousedown","mousemove","keypress","scroll","touchstart","click"].forEach(t=>{document.addEventListener(t,this.boundOnActivity,!0)}),this.resetInactivityTimer())}onActivity(){this.lastActivityTime=Date.now(),this.isPaused&&this.resume(),this.resetInactivityTimer()}resetInactivityTimer(){this.inactivityTimer&&clearTimeout(this.inactivityTimer),this.inactivityTimer=window.setTimeout(()=>{this.pauseForInactivity()},this.config.inactivityTimeout)}pauseForInactivity(){this.isPaused||(this.isPaused=!0)}resume(){this.isPaused&&(this.isPaused=!1)}getActiveTime(){return Date.now()-this.sessionStartTime}getVisitorId(){return this.visitorId}}export{t as SessionReplayEngine};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Zaplier SDK v3.0.0 - Unified SDK
|
|
3
|
+
* Advanced privacy-first tracking with code splitting
|
|
4
|
+
* (c) 2026 Zaplier Team
|
|
5
|
+
*/
|
|
6
|
+
class t{constructor(t,i,s={}){this.events=[],this.isActive=!1,this.isPaused=!1,this.lastActivityTime=Date.now(),this.sessionStartTime=Date.now(),this.boundOnActivity=null,this.sessionId=t,this.visitorId=i,this.config={enabled:!0,sampleRate:1,batchInterval:1e4,inactivityTimeout:3e4,pauseOnInactive:!0,...s}}async start(){if(!this.config.enabled||this.isActive)return!1;if(Math.random()>this.config.sampleRate)return!1;try{const{record:t}=await import("./rrweb-CUXM0llf.min.js");return this.rrwebStopRecord=t({emit:t=>{this.onActivity(),this.isPaused||this.events.push(t)}}),this.isActive=!0,this.startBatchTimer(),this.startInactivityTracking(),!0}catch(t){return console.error("[Zaplier] Failed to start rrweb recording:",t),!1}}stop(){this.isActive&&(this.isActive=!1,this.rrwebStopRecord&&(this.rrwebStopRecord(),this.rrwebStopRecord=void 0),this.batchTimer&&(clearInterval(this.batchTimer),this.batchTimer=void 0),this.inactivityTimer&&(clearTimeout(this.inactivityTimer),this.inactivityTimer=void 0),this.boundOnActivity&&(["mousedown","mousemove","keypress","scroll","touchstart","click"].forEach(t=>{document.removeEventListener(t,this.boundOnActivity,!0)}),this.boundOnActivity=null),this.sendBatch())}startBatchTimer(){this.batchTimer=window.setInterval(()=>{this.sendBatch()},this.config.batchInterval)}sendBatch(){if(!this.sdkInstance)return void(this.config.pauseOnInactive&&this.events.length>0&&console.warn("[Zaplier] Replay: SDK instance not ready, holding batch"));if(0===this.events.length)return;const t={sessionId:this.sessionId,visitorId:this.visitorId,events:[...this.events],metadata:{userAgent:navigator.userAgent,timestamp:Date.now(),startUrl:window.location.href,duration:Date.now()-this.sessionStartTime,activeTime:this.getActiveTime(),funnelSteps:[],hasConversion:!1,eventsCount:this.events.length,isPaused:this.isPaused}};this.events=[],t.events.length,this.sendToBackend(t)}setSDKInstance(t){this.sdkInstance=t}async sendToBackend(t){try{if(!this.sdkInstance)return void console.error("[Zaplier] No SDK instance available for replay transport");const i=await this.sdkInstance.sendReplayBatch(t);i&&i.success||console.error("[Zaplier] Session replay batch failed:",i)}catch(t){console.error("[Zaplier] Session replay error:",t)}}getEventCount(){return this.events.length}isRecording(){return this.isActive}isPausedState(){return this.isPaused}startInactivityTracking(){this.config.pauseOnInactive&&(this.boundOnActivity=this.onActivity.bind(this),["mousedown","mousemove","keypress","scroll","touchstart","click"].forEach(t=>{document.addEventListener(t,this.boundOnActivity,!0)}),this.resetInactivityTimer())}onActivity(){this.lastActivityTime=Date.now(),this.isPaused&&this.resume(),this.resetInactivityTimer()}resetInactivityTimer(){this.inactivityTimer&&clearTimeout(this.inactivityTimer),this.inactivityTimer=window.setTimeout(()=>{this.pauseForInactivity()},this.config.inactivityTimeout)}pauseForInactivity(){this.isPaused||(this.isPaused=!0)}resume(){this.isPaused&&(this.isPaused=!1)}getActiveTime(){return Date.now()-this.sessionStartTime}getVisitorId(){return this.visitorId}}export{t as SessionReplayEngine};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Zaplier SDK v3.0.0 - Unified SDK
|
|
3
|
+
* Advanced privacy-first tracking with code splitting
|
|
4
|
+
* (c) 2026 Zaplier Team
|
|
5
|
+
*/
|
|
6
|
+
import{g as e}from"./core-C742iEqG.min.js";const t={session:"__zp_s",visitor:"__zp_v",device:"__zp_d",prefs:"__zp_p",analytics:"__zp_a"};class n{static setLocal(e,t){try{if("undefined"!=typeof window&&window.localStorage)return localStorage.setItem(e,t),!0}catch(e){}return!1}static getLocal(e){try{if("undefined"!=typeof window&&window.localStorage)return localStorage.getItem(e)}catch(e){}return null}static setSession(e,t){try{if("undefined"!=typeof window&&window.sessionStorage)return sessionStorage.setItem(e,t),!0}catch(e){}return!1}static getSession(e){try{if("undefined"!=typeof window&&window.sessionStorage)return sessionStorage.getItem(e)}catch(e){}return null}static setCookie(e,t,n=365){try{if("undefined"!=typeof document){const s=new Date(Date.now()+24*n*60*60*1e3).toUTCString();return document.cookie=`${e}=${t}; expires=${s}; path=/; SameSite=Lax`,!0}}catch(e){}return!1}static getCookie(e){try{if("undefined"!=typeof document){const t=e+"=",n=decodeURIComponent(document.cookie).split(";");for(let e=0;e<n.length;e++){let s=n[e];if(s){for(;" "===s.charAt(0);)s=s.substring(1);if(0===s.indexOf(t))return s.substring(t.length,s.length)}}}}catch(e){}return null}static setMemory(e,t){return this.memoryStore.set(e,t),!0}static getMemory(e){return this.memoryStore.get(e)||null}static get(e){let t=this.getLocal(e);return t?{value:t,method:"localStorage"}:(t=this.getSession(e),t?{value:t,method:"sessionStorage"}:(t=this.getCookie(e),t?{value:t,method:"cookie"}:(t=this.getMemory(e),t?{value:t,method:"memory"}:{value:null,method:"none"})))}static set(e,t){return this.setLocal(e,t)?{success:!0,method:"localStorage"}:this.setSession(e,t)?{success:!0,method:"sessionStorage"}:this.setCookie(e,t)?{success:!0,method:"cookie"}:(this.setMemory(e,t),{success:!0,method:"memory"})}}n.memoryStore=new Map;class s{generateSessionId(){const{value:s}=n.get(t.prefs);if(s)try{const t=JSON.parse(s);if(t.t&&!0===t.o)return e(t.t)}catch(e){}const o="temp-"+Date.now().toString(36);return e(o)}createCamouflageData(e,t,n,s=!1){return{theme:"auto",lang:(navigator.language||"en-US").substring(0,2),tz:Intl.DateTimeFormat().resolvedOptions().timeZone,analytics:!0,cookies:!0,t:e,i:t,u:n,o:!!s||void 0,ts:Date.now()}}extractFromCamouflage(e){try{const t=JSON.parse(e);if(t.t&&t.i&&t.u&&!0===t.o)return{visitorId:t.t,sessionId:t.i,stableCoreHash:t.u,persistenceMethod:"localStorage",confidence:.95,createdAt:t.ts||Date.now(),lastSeen:Date.now(),reused:!0};if(t.t&&!t.o)return null}catch(e){}return null}async getOrCreateVisitorIdentity(e){const{stableCoreHash:s}=e,{value:o,method:r}=n.get(t.prefs);if(o){const e=this.extractFromCamouflage(o);if(e&&e.stableCoreHash===s&&e.visitorId){const o=this.createCamouflageData(e.visitorId,e.sessionId,s);return n.set(t.prefs,JSON.stringify(o)),{...e,persistenceMethod:r,lastSeen:Date.now(),reused:!0}}}return{sessionId:e.sessionId||this.generateSessionId(),stableCoreHash:s,deviceFingerprint:e.deviceFingerprint,persistenceMethod:"memory",confidence:.9,createdAt:Date.now(),lastSeen:Date.now(),reused:!1,pendingBackendResponse:!0}}async updateVisitorIdFromBackend(s,o,r){try{let i=r||this.getCurrentSessionId();i&&!i.includes("temp-")||(i=e(s));const a=this.createCamouflageData(s,i,o,!0),{success:c,method:u}=n.set(t.prefs,JSON.stringify(a));return!!c&&(n.set(t.device,o),!0)}catch(e){return console.error("[VisitorIdentityManager] Failed to update visitor ID from backend:",e),!1}}getCurrentSessionId(){const{value:e}=n.get(t.prefs);if(e){const t=this.extractFromCamouflage(e);return(null==t?void 0:t.sessionId)||null}return null}getCurrentVisitorId(){const{value:e}=n.get(t.prefs);if(e){const t=this.extractFromCamouflage(e);return(null==t?void 0:t.visitorId)||null}return null}clearIdentity(){try{for(const e of Object.values(t)){try{"undefined"!=typeof window&&window.localStorage&&localStorage.removeItem(e)}catch{}try{"undefined"!=typeof window&&window.sessionStorage&&sessionStorage.removeItem(e)}catch{}}n.setCookie(t.prefs,"",-1),n.setCookie(t.device,"",-1)}catch(e){}}}export{s as VisitorIdentityManager};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Zaplier SDK v3.0.0 - Unified SDK
|
|
3
|
+
* Advanced privacy-first tracking with code splitting
|
|
4
|
+
* (c) 2026 Zaplier Team
|
|
5
|
+
*/
|
|
6
|
+
import{g as e}from"./core-DHYEYU6M.min.js";const t={session:"__zp_s",visitor:"__zp_v",device:"__zp_d",prefs:"__zp_p",analytics:"__zp_a"};class n{static setLocal(e,t){try{if("undefined"!=typeof window&&window.localStorage)return localStorage.setItem(e,t),!0}catch(e){}return!1}static getLocal(e){try{if("undefined"!=typeof window&&window.localStorage)return localStorage.getItem(e)}catch(e){}return null}static setSession(e,t){try{if("undefined"!=typeof window&&window.sessionStorage)return sessionStorage.setItem(e,t),!0}catch(e){}return!1}static getSession(e){try{if("undefined"!=typeof window&&window.sessionStorage)return sessionStorage.getItem(e)}catch(e){}return null}static setCookie(e,t,n=365){try{if("undefined"!=typeof document){const s=new Date(Date.now()+24*n*60*60*1e3).toUTCString();return document.cookie=`${e}=${t}; expires=${s}; path=/; SameSite=Lax`,!0}}catch(e){}return!1}static getCookie(e){try{if("undefined"!=typeof document){const t=e+"=",n=decodeURIComponent(document.cookie).split(";");for(let e=0;e<n.length;e++){let s=n[e];if(s){for(;" "===s.charAt(0);)s=s.substring(1);if(0===s.indexOf(t))return s.substring(t.length,s.length)}}}}catch(e){}return null}static setMemory(e,t){return this.memoryStore.set(e,t),!0}static getMemory(e){return this.memoryStore.get(e)||null}static get(e){let t=this.getLocal(e);return t?{value:t,method:"localStorage"}:(t=this.getSession(e),t?{value:t,method:"sessionStorage"}:(t=this.getCookie(e),t?{value:t,method:"cookie"}:(t=this.getMemory(e),t?{value:t,method:"memory"}:{value:null,method:"none"})))}static set(e,t){return this.setLocal(e,t)?{success:!0,method:"localStorage"}:this.setSession(e,t)?{success:!0,method:"sessionStorage"}:this.setCookie(e,t)?{success:!0,method:"cookie"}:(this.setMemory(e,t),{success:!0,method:"memory"})}}n.memoryStore=new Map;class s{generateSessionId(){const{value:s}=n.get(t.prefs);if(s)try{const t=JSON.parse(s);if(t.t&&!0===t.o)return e(t.t)}catch(e){}const o="temp-"+Date.now().toString(36);return e(o)}createCamouflageData(e,t,n,s=!1){return{theme:"auto",lang:(navigator.language||"en-US").substring(0,2),tz:Intl.DateTimeFormat().resolvedOptions().timeZone,analytics:!0,cookies:!0,t:e,i:t,u:n,o:!!s||void 0,ts:Date.now()}}extractFromCamouflage(e){try{const t=JSON.parse(e);if(t.t&&t.i&&t.u&&!0===t.o)return{visitorId:t.t,sessionId:t.i,stableCoreHash:t.u,persistenceMethod:"localStorage",confidence:.95,createdAt:t.ts||Date.now(),lastSeen:Date.now(),reused:!0};if(t.t&&!t.o)return null}catch(e){}return null}async getOrCreateVisitorIdentity(e){const{stableCoreHash:s}=e,{value:o,method:r}=n.get(t.prefs);if(o){const e=this.extractFromCamouflage(o);if(e&&e.stableCoreHash===s&&e.visitorId){const o=this.createCamouflageData(e.visitorId,e.sessionId,s);return n.set(t.prefs,JSON.stringify(o)),{...e,persistenceMethod:r,lastSeen:Date.now(),reused:!0}}}return{sessionId:e.sessionId||this.generateSessionId(),stableCoreHash:s,deviceFingerprint:e.deviceFingerprint,persistenceMethod:"memory",confidence:.9,createdAt:Date.now(),lastSeen:Date.now(),reused:!1,pendingBackendResponse:!0}}async updateVisitorIdFromBackend(s,o,r){try{let i=r||this.getCurrentSessionId();i&&!i.includes("temp-")||(i=e(s));const a=this.createCamouflageData(s,i,o,!0),{success:c,method:u}=n.set(t.prefs,JSON.stringify(a));return!!c&&(n.set(t.device,o),!0)}catch(e){return console.error("[VisitorIdentityManager] Failed to update visitor ID from backend:",e),!1}}getCurrentSessionId(){const{value:e}=n.get(t.prefs);if(e){const t=this.extractFromCamouflage(e);return(null==t?void 0:t.sessionId)||null}return null}getCurrentVisitorId(){const{value:e}=n.get(t.prefs);if(e){const t=this.extractFromCamouflage(e);return(null==t?void 0:t.visitorId)||null}return null}clearIdentity(){try{for(const e of Object.values(t)){try{"undefined"!=typeof window&&window.localStorage&&localStorage.removeItem(e)}catch{}try{"undefined"!=typeof window&&window.sessionStorage&&sessionStorage.removeItem(e)}catch{}}n.setCookie(t.prefs,"",-1),n.setCookie(t.device,"",-1)}catch(e){}}}export{s as VisitorIdentityManager};
|
package/dist/v2/core.min.js
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Advanced privacy-first tracking with code splitting
|
|
4
4
|
* (c) 2026 Zaplier Team
|
|
5
5
|
*/
|
|
6
|
-
export{Z as ZaplierCore,Z as default,i as initZaplier,a as initZaplierCore}from"./chunks/core-
|
|
6
|
+
export{Z as ZaplierCore,Z as default,i as initZaplier,a as initZaplierCore}from"./chunks/core-DHYEYU6M.min.js";
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Advanced privacy-first tracking with code splitting
|
|
4
4
|
* (c) 2026 Zaplier Team
|
|
5
5
|
*/
|
|
6
|
-
class t{constructor(t,i,s={}){this.events=[],this.isActive=!1,this.isPaused=!1,this.lastActivityTime=Date.now(),this.sessionStartTime=Date.now(),this.boundOnActivity=null,this.sessionId=t,this.visitorId=i,this.config={enabled:!0,sampleRate:1,batchInterval:1e4,inactivityTimeout:3e4,pauseOnInactive:!0,...s}}async start(){if(!this.config.enabled||this.isActive)return!1;if(Math.random()>this.config.sampleRate)return!1;try{const{record:t}=await import("rrweb");return this.rrwebStopRecord=t({emit:t=>{this.onActivity(),this.isPaused||this.events.push(t)}}),this.isActive=!0,this.startBatchTimer(),this.startInactivityTracking(),!0}catch(t){return!1}}stop(){this.isActive&&(this.isActive=!1,this.rrwebStopRecord&&(this.rrwebStopRecord(),this.rrwebStopRecord=void 0),this.batchTimer&&(clearInterval(this.batchTimer),this.batchTimer=void 0),this.inactivityTimer&&(clearTimeout(this.inactivityTimer),this.inactivityTimer=void 0),this.boundOnActivity&&(["mousedown","mousemove","keypress","scroll","touchstart","click"].forEach(t=>{document.removeEventListener(t,this.boundOnActivity,!0)}),this.boundOnActivity=null),this.sendBatch())}startBatchTimer(){this.batchTimer=window.setInterval(()=>{this.sendBatch()},this.config.batchInterval)}sendBatch(){if(!this.sdkInstance)return void(this.config.pauseOnInactive&&this.events.length);if(0===this.events.length)return;const t={sessionId:this.sessionId,visitorId:this.visitorId,events:[...this.events],metadata:{userAgent:navigator.userAgent,timestamp:Date.now(),startUrl:window.location.href,duration:Date.now()-this.sessionStartTime,activeTime:this.getActiveTime(),funnelSteps:[],hasConversion:!1,eventsCount:this.events.length,isPaused:this.isPaused}};this.events=[],this.sendToBackend(t)}setSDKInstance(t){this.sdkInstance=t}async sendToBackend(t){try{if(!this.sdkInstance)return;const i=await this.sdkInstance.sendReplayBatch(t);i&&i.success}catch(t){}}getEventCount(){return this.events.length}isRecording(){return this.isActive}isPausedState(){return this.isPaused}startInactivityTracking(){this.config.pauseOnInactive&&(this.boundOnActivity=this.onActivity.bind(this),["mousedown","mousemove","keypress","scroll","touchstart","click"].forEach(t=>{document.addEventListener(t,this.boundOnActivity,!0)}),this.resetInactivityTimer())}onActivity(){this.lastActivityTime=Date.now(),this.isPaused&&this.resume(),this.resetInactivityTimer()}resetInactivityTimer(){this.inactivityTimer&&clearTimeout(this.inactivityTimer),this.inactivityTimer=window.setTimeout(()=>{this.pauseForInactivity()},this.config.inactivityTimeout)}pauseForInactivity(){this.isPaused||(this.isPaused=!0)}resume(){this.isPaused&&(this.isPaused=!1)}getActiveTime(){return Date.now()-this.sessionStartTime}getVisitorId(){return this.visitorId}}export{t as SessionReplayEngine};
|
|
6
|
+
class t{constructor(t,i,s={}){this.events=[],this.isActive=!1,this.isPaused=!1,this.lastActivityTime=Date.now(),this.sessionStartTime=Date.now(),this.boundOnActivity=null,this.sessionId=t,this.visitorId=i,this.config={enabled:!0,sampleRate:1,batchInterval:1e4,inactivityTimeout:3e4,pauseOnInactive:!0,...s}}async start(){if(!this.config.enabled||this.isActive)return!1;if(Math.random()>this.config.sampleRate)return!1;try{const{record:t}=await import("./rrweb-CZOCorIZ.js");return this.rrwebStopRecord=t({emit:t=>{this.onActivity(),this.isPaused||this.events.push(t)},inlineStylesheet:!0,collectFonts:!0,inlineImages:!0,sampling:{mousemove:!0,mouseInteraction:!1,scroll:150,input:"last"}}),this.isActive=!0,this.startBatchTimer(),this.startInactivityTracking(),!0}catch(t){return!1}}stop(){this.isActive&&(this.isActive=!1,this.rrwebStopRecord&&(this.rrwebStopRecord(),this.rrwebStopRecord=void 0),this.batchTimer&&(clearInterval(this.batchTimer),this.batchTimer=void 0),this.inactivityTimer&&(clearTimeout(this.inactivityTimer),this.inactivityTimer=void 0),this.boundOnActivity&&(["mousedown","mousemove","keypress","scroll","touchstart","click"].forEach(t=>{document.removeEventListener(t,this.boundOnActivity,!0)}),this.boundOnActivity=null),this.sendBatch())}startBatchTimer(){this.batchTimer=window.setInterval(()=>{this.sendBatch()},this.config.batchInterval)}sendBatch(){if(!this.sdkInstance)return void(this.config.pauseOnInactive&&this.events.length);if(0===this.events.length)return;const t={sessionId:this.sessionId,visitorId:this.visitorId,events:[...this.events],metadata:{userAgent:navigator.userAgent,timestamp:Date.now(),startUrl:window.location.href,duration:Date.now()-this.sessionStartTime,activeTime:this.getActiveTime(),funnelSteps:[],hasConversion:!1,eventsCount:this.events.length,isPaused:this.isPaused}};this.events=[],this.sendToBackend(t)}setSDKInstance(t){this.sdkInstance=t}async sendToBackend(t){try{if(!this.sdkInstance)return;const i=await this.sdkInstance.sendReplayBatch(t);i&&i.success}catch(t){}}getEventCount(){return this.events.length}isRecording(){return this.isActive}isPausedState(){return this.isPaused}startInactivityTracking(){this.config.pauseOnInactive&&(this.boundOnActivity=this.onActivity.bind(this),["mousedown","mousemove","keypress","scroll","touchstart","click"].forEach(t=>{document.addEventListener(t,this.boundOnActivity,!0)}),this.resetInactivityTimer())}onActivity(){this.lastActivityTime=Date.now(),this.isPaused&&this.resume(),this.resetInactivityTimer()}resetInactivityTimer(){this.inactivityTimer&&clearTimeout(this.inactivityTimer),this.inactivityTimer=window.setTimeout(()=>{this.pauseForInactivity()},this.config.inactivityTimeout)}pauseForInactivity(){this.isPaused||(this.isPaused=!0)}resume(){this.isPaused&&(this.isPaused=!1)}getActiveTime(){return Date.now()-this.sessionStartTime}getVisitorId(){return this.visitorId}}export{t as SessionReplayEngine};
|