UNPKG

humanbehavior-js

Version:

SDK for HumanBehavior session and event recording

1 lines 217 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).HumanBehaviorTracker={})}(this,function(e){"use strict";function t(e,t,s,r){return new(s||(s=Promise))(function(n,o){function i(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof s?t:new s(function(e){e(t)})).then(i,a)}l((r=r.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;var s,r=Object.defineProperty,n=(e,t,s)=>((e,t,s)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s),o=Object.defineProperty,i=(e,t,s)=>((e,t,s)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s),a=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(a||{});const l={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},c={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},h={};function u(e){if(h[e])return h[e];const t=globalThis[e],s=t.prototype,r=e in l?l[e]:void 0,n=Boolean(r&&r.every(e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(s,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))})),o=e in c?c[e]:void 0,i=Boolean(o&&o.every(e=>{var t;return"function"==typeof s[e]&&(null==(t=s[e])?void 0:t.toString().includes("[native code]"))}));if(n&&i&&!globalThis.Zone)return h[e]=t.prototype,t.prototype;try{const r=document.createElement("iframe");document.body.appendChild(r);const n=r.contentWindow;if(!n)return t.prototype;const o=n[e].prototype;return document.body.removeChild(r),o?h[e]=o:s}catch{return s}}const d={};function p(e,t,s){var r;const n=`${e}.${String(s)}`;if(d[n])return d[n].call(t);const o=u(e),i=null==(r=Object.getOwnPropertyDescriptor(o,s))?void 0:r.get;return i?(d[n]=i,i.call(t)):t[s]}const f={};function m(e,t,s){const r=`${e}.${String(s)}`;if(f[r])return f[r].bind(t);const n=u(e)[s];return"function"!=typeof n?t[s]:(f[r]=n,n.bind(t))}const g={childNodes:function(e){return p("Node",e,"childNodes")},parentNode:function(e){return p("Node",e,"parentNode")},parentElement:function(e){return p("Node",e,"parentElement")},textContent:function(e){return p("Node",e,"textContent")},contains:function(e,t){return m("Node",e,"contains")(t)},getRootNode:function(e){return m("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?p("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?p("Element",e,"shadowRoot"):null},querySelector:function(e,t){return p("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return p("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return u("MutationObserver").constructor}};function y(e){return e.nodeType===e.ELEMENT_NODE}function w(e){const t=e&&"host"in e&&"mode"in e&&g.host(e)||null;return Boolean(t&&"shadowRoot"in t&&g.shadowRoot(t)===e)}function v(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function b(e){try{const s=e.rules||e.cssRules;if(!s)return null;let r=e.href;!r&&e.ownerNode&&e.ownerNode.ownerDocument&&(r=e.ownerNode.ownerDocument.location.href);const n=Array.from(s,e=>S(e,r)).join("");return(t=n).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}catch(e){return null}var t}function S(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=b(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const s=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?s.push("layer"):e.layerName&&s.push(`layer(${e.layerName})`),e.supportsText&&s.push(`supports(${e.supportsText})`),e.media.length&&s.push(e.media.mediaText),s.join(" ")+";"}(e)}catch(s){t=e.cssText}return e.styleSheet.href?N(t,e.styleSheet.href):t}{let s=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(s=function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(s)),t?N(s,t):s}}class C{constructor(){i(this,"idNodeMap",new Map),i(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const s=t.id;this.idNodeMap.set(s,e),this.nodeMetaMap.set(e,t)}replace(e,t){const s=this.getNode(e);if(s){const e=this.nodeMetaMap.get(s);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function I({element:e,maskInputOptions:t,tagName:s,type:r,value:n,maskInputFn:o}){let i=n||"";const a=r&&k(r);return(t[s.toLowerCase()]||a&&t[a])&&(i=o?o(i,e):"*".repeat(i.length)),i}function k(e){return e.toLowerCase()}const x="__rrweb_original__";function O(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?k(t):null}function E(e,t){let s;try{s=new URL(e,t??window.location.href)}catch(e){return null}const r=s.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==r?void 0:r[1])??null}const M=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,R=/^(?:[a-z+]+:)?\/\//i,A=/^www\..*/i,T=/^(data:)([^,]*),(.*)/i;function N(e,t){return(e||"").replace(M,(e,s,r,n,o,i)=>{const a=r||o||i,l=s||n||"";if(!a)return e;if(R.test(a)||A.test(a))return`url(${l}${a}${l})`;if(T.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${l})`;const c=t.split("/"),h=a.split("/");c.pop();for(const e of h)"."!==e&&(".."===e?c.pop():c.push(e));return`url(${l}${c.join("/")}${l})`})}function L(e){return e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function F(e,t){return function(e,t){const s=Array.from(t.childNodes),r=[];if(s.length>1&&e&&"string"==typeof e){const t=L(e);for(let n=1;n<s.length;n++)if(s[n].textContent&&"string"==typeof s[n].textContent){const o=L(s[n].textContent);for(let s=3;s<o.length;s++){const n=o.substring(0,s);if(2===t.split(n).length){const s=t.indexOf(n);for(let t=s;t<e.length;t++)if(L(e.substring(0,t)).length===s){r.push(e.substring(0,t)),e=e.substring(t);break}break}}}}return r.push(e),r}(e,t).join("/* rr_split */")}let D=1;const P=new RegExp("[^a-z0-9-_:]");function _(){return D++}let U,B;const z=/^[^ \t\n\r\u000c]+/,j=/^[, \t\n\r\u000c]+/;const $=new WeakMap;function W(e,t){return t&&""!==t.trim()?G(e,t):t}function V(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function G(e,t){let s=$.get(e);if(s||(s=e.createElement("a"),$.set(e,s)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return s.setAttribute("href",t),s.href}function Y(e,t,s,r){return r?"src"===s||"href"===s&&("use"!==t||"#"!==r[0])||"xlink:href"===s&&"#"!==r[0]?W(e,r):"background"!==s||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===s?function(e,t){if(""===t.trim())return t;let s=0;function r(e){let r;const n=e.exec(t.substring(s));return n?(r=n[0],s+=r.length,r):""}const n=[];for(;r(j),!(s>=t.length);){let o=r(z);if(","===o.slice(-1))o=W(e,o.substring(0,o.length-1)),n.push(o);else{let r="";o=W(e,o);let i=!1;for(;;){const e=t.charAt(s);if(""===e){n.push((o+r).trim());break}if(i)")"===e&&(i=!1);else{if(","===e){s+=1,n.push((o+r).trim());break}"("===e&&(i=!0)}r+=e,s+=1}}}return n.join(", ")}(e,r):"style"===s?N(r,G(e)):"object"===t&&"data"===s?W(e,r):r:W(e,r):r}function K(e,t,s){return("video"===e||"audio"===e)&&"autoplay"===t}function Z(e,t,s){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!s&&Z(g.parentNode(e),t,s);for(let s=e.classList.length;s--;){const r=e.classList[s];if(t.test(r))return!0}return!!s&&Z(g.parentNode(e),t,s)}function J(e,t,s,r){let n;if(y(e)){if(n=e,!g.childNodes(n).length)return!1}else{if(null===g.parentElement(e))return!1;n=g.parentElement(e)}try{if("string"==typeof t){if(r){if(n.closest(`.${t}`))return!0}else if(n.classList.contains(t))return!0}else if(Z(n,t,r))return!0;if(s)if(r){if(n.closest(s))return!0}else if(n.matches(s))return!0}catch(e){}return!1}function H(e,t){const{doc:s,mirror:r,blockClass:n,blockSelector:o,needsMask:i,inlineStylesheet:l,maskInputOptions:c={},maskTextFn:h,maskInputFn:u,dataURLOptions:d={},inlineImages:p,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:y=!1,cssCaptured:w=!1}=t,v=function(e,t){if(!t.hasNode(e))return;const s=t.getId(e);return 1===s?void 0:s}(s,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:a.Document,childNodes:[],compatMode:e.compatMode}:{type:a.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:a.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:return function(e,t){const{doc:s,blockClass:r,blockSelector:n,inlineStylesheet:o,maskInputOptions:i={},maskInputFn:l,dataURLOptions:c={},inlineImages:h,recordCanvas:u,keepIframeSrcFn:d,newlyAddedElement:p=!1,rootId:f}=t,m=function(e,t,s){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let s=e.classList.length;s--;){const r=e.classList[s];if(t.test(r))return!0}if(s)return e.matches(s)}catch(e){}return!1}(e,r,n),g=function(e){if(e instanceof HTMLFormElement)return"form";const t=k(e.tagName);return P.test(t)?"div":t}(e);let y={};const w=e.attributes.length;for(let t=0;t<w;t++){const r=e.attributes[t];K(g,r.name,r.value)||(y[r.name]=Y(s,g,k(r.name),r.value))}if("link"===g&&o){const t=Array.from(s.styleSheets).find(t=>t.href===e.href);let r=null;t&&(r=b(t)),r&&(delete y.rel,delete y.href,y._cssText=r)}if("style"===g&&e.sheet){let t=b(e.sheet);t&&(e.childNodes.length>1&&(t=F(t,e)),y._cssText=t)}if("input"===g||"textarea"===g||"select"===g){const t=e.value,s=e.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&t?y.value=I({element:e,type:O(e),tagName:g,value:t,maskInputOptions:i,maskInputFn:l}):s&&(y.checked=s)}"option"===g&&(e.selected&&!i.select?y.selected=!0:delete y.selected);"dialog"===g&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===g&&u)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let s=0;s<e.width;s+=50)for(let r=0;r<e.height;r+=50){const n=t.getImageData,o=x in n?n[x]:n;if(new Uint32Array(o.call(t,s,r,Math.min(50,e.width-s),Math.min(50,e.height-r)).data.buffer).some(e=>0!==e))return!1}return!0})(e)||(y.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){const t=e.toDataURL(c.type,c.quality),r=s.createElement("canvas");r.width=e.width,r.height=e.height;t!==r.toDataURL(c.type,c.quality)&&(y.rr_dataURL=t)}if("img"===g&&h){U||(U=s.createElement("canvas"),B=U.getContext("2d"));const t=e,r=t.currentSrc||t.getAttribute("src")||"<unknown-src>",n=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{U.width=t.naturalWidth,U.height=t.naturalHeight,B.drawImage(t,0,0),y.rr_dataURL=U.toDataURL(c.type,c.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o));console.warn(`Cannot inline img src=${r}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(n?y.crossOrigin=n:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}if("audio"===g||"video"===g){const t=y;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}p||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop));if(m){const{width:t,height:s}=e.getBoundingClientRect();y={class:y.class,rr_width:`${t}px`,rr_height:`${s}px`}}"iframe"!==g||d(y.src)||(e.contentDocument||(y.rr_src=y.src),delete y.src);let v;try{customElements.get(g)&&(v=!0)}catch(e){}return{type:a.Element,tagName:g,attributes:y,childNodes:[],isSVG:V(e)||void 0,needBlock:m,rootId:f,isCustom:v}}(e,{doc:s,blockClass:n,blockSelector:o,inlineStylesheet:l,maskInputOptions:c,maskInputFn:u,dataURLOptions:d,inlineImages:p,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:y,rootId:v});case e.TEXT_NODE:return function(e,t){const{needsMask:s,maskTextFn:r,rootId:n,cssCaptured:o}=t,i=g.parentNode(e),l=i&&i.tagName;let c="";const h="STYLE"===l||void 0,u="SCRIPT"===l||void 0;u?c="SCRIPT_PLACEHOLDER":o||(c=g.textContent(e),h&&c&&(c=N(c,G(t.doc))));!h&&!u&&c&&s&&(c=r?r(c,g.parentElement(e)):c.replace(/[\S]/g,"*"));return{type:a.Text,textContent:c||"",rootId:n}}(e,{doc:s,needsMask:i,maskTextFn:h,rootId:v,cssCaptured:w});case e.CDATA_SECTION_NODE:return{type:a.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return{type:a.Comment,textContent:g.textContent(e)||"",rootId:v};default:return!1}}function X(e){return null==e?"":e.toLowerCase()}function q(e,t){const{doc:s,mirror:r,blockClass:n,blockSelector:o,maskTextClass:i,maskTextSelector:l,skipChild:c=!1,inlineStylesheet:h=!0,maskInputOptions:u={},maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:m={},inlineImages:b=!1,recordCanvas:S=!1,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:k=5e3,onStylesheetLoad:x,stylesheetLoadTimeout:O=5e3,keepIframeSrcFn:M=()=>!1,newlyAddedElement:R=!1,cssCaptured:A=!1}=t;let{needsMask:T}=t,{preserveWhiteSpace:N=!0}=t;if(!T){T=J(e,i,l,void 0===T)}const L=H(e,{doc:s,mirror:r,blockClass:n,blockSelector:o,needsMask:T,inlineStylesheet:h,maskInputOptions:u,maskTextFn:d,maskInputFn:p,dataURLOptions:m,inlineImages:b,recordCanvas:S,keepIframeSrcFn:M,newlyAddedElement:R,cssCaptured:A});if(!L)return console.warn(e,"not serialized"),null;let F;F=r.hasNode(e)?r.getId(e):function(e,t){if(t.comment&&e.type===a.Comment)return!0;if(e.type===a.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===E(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(X(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===X(e.attributes.name)||"icon"===X(e.attributes.rel)||"apple-touch-icon"===X(e.attributes.rel)||"shortcut icon"===X(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&X(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(X(e.attributes.property).match(/^(og|twitter|fb):/)||X(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===X(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===X(e.attributes.name)||"googlebot"===X(e.attributes.name)||"bingbot"===X(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===X(e.attributes.name)||"generator"===X(e.attributes.name)||"framework"===X(e.attributes.name)||"publisher"===X(e.attributes.name)||"progid"===X(e.attributes.name)||X(e.attributes.property).match(/^article:/)||X(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===X(e.attributes.name)||"yandex-verification"===X(e.attributes.name)||"csrf-token"===X(e.attributes.name)||"p:domain_verify"===X(e.attributes.name)||"verify-v1"===X(e.attributes.name)||"verification"===X(e.attributes.name)||"shopify-checkout-api-token"===X(e.attributes.name)))return!0}}return!1}(L,f)||!N&&L.type===a.Text&&!L.textContent.replace(/^\s+|\s+$/gm,"").length?-2:_();const D=Object.assign(L,{id:F});if(r.add(e,D),-2===F)return null;C&&C(e);let P=!c;if(D.type===a.Element){P=P&&!D.needBlock,delete D.needBlock;const t=g.shadowRoot(e);t&&v(t)&&(D.isShadowHost=!0)}if((D.type===a.Document||D.type===a.Element)&&P){f.headWhitespace&&D.type===a.Element&&"head"===D.tagName&&(N=!1);const t={doc:s,mirror:r,blockClass:n,blockSelector:o,needsMask:T,maskTextClass:i,maskTextSelector:l,skipChild:c,inlineStylesheet:h,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:m,inlineImages:b,recordCanvas:S,preserveWhiteSpace:N,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:O,keepIframeSrcFn:M,cssCaptured:!1};if(D.type===a.Element&&"textarea"===D.tagName&&void 0!==D.attributes.value);else{D.type===a.Element&&void 0!==D.attributes._cssText&&"string"==typeof D.attributes._cssText&&(t.cssCaptured=!0);for(const s of Array.from(g.childNodes(e))){const e=q(s,t);e&&D.childNodes.push(e)}}let w=null;if(y(e)&&(w=g.shadowRoot(e)))for(const e of Array.from(g.childNodes(w))){const s=q(e,t);s&&(v(w)&&(s.isShadow=!0),D.childNodes.push(s))}}const U=g.parentNode(e);return U&&w(U)&&v(U)&&(D.isShadow=!0),D.type===a.Element&&"iframe"===D.tagName&&function(e,t,s){const r=e.contentWindow;if(!r)return;let n,o=!1;try{n=r.document.readyState}catch(e){return}if("complete"!==n){const r=setTimeout(()=>{o||(t(),o=!0)},s);return void e.addEventListener("load",()=>{clearTimeout(r),o=!0,t()})}const i="about:blank";if(r.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{const t=e.contentDocument;if(t&&I){const s=q(t,{doc:t,mirror:r,blockClass:n,blockSelector:o,needsMask:T,maskTextClass:i,maskTextSelector:l,skipChild:!1,inlineStylesheet:h,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:m,inlineImages:b,recordCanvas:S,preserveWhiteSpace:N,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:O,keepIframeSrcFn:M});s&&I(e,s)}},k),D.type===a.Element&&"link"===D.tagName&&"string"==typeof D.attributes.rel&&("stylesheet"===D.attributes.rel||"preload"===D.attributes.rel&&"string"==typeof D.attributes.href&&"css"===E(D.attributes.href))&&function(e,t,s){let r,n=!1;try{r=e.sheet}catch(e){return}if(r)return;const o=setTimeout(()=>{n||(t(),n=!0)},s);e.addEventListener("load",()=>{clearTimeout(o),n=!0,t()})}(e,()=>{if(x){const t=q(e,{doc:s,mirror:r,blockClass:n,blockSelector:o,needsMask:T,maskTextClass:i,maskTextSelector:l,skipChild:!1,inlineStylesheet:h,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:m,inlineImages:b,recordCanvas:S,preserveWhiteSpace:N,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:O,keepIframeSrcFn:M});t&&x(e,t)}},O),D}function Q(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ee(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var s=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(s,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),s}var te={exports:{}},se=String,re=function(){return{isColorSupported:!1,reset:se,bold:se,dim:se,italic:se,underline:se,inverse:se,hidden:se,strikethrough:se,black:se,red:se,green:se,yellow:se,blue:se,magenta:se,cyan:se,white:se,gray:se,bgBlack:se,bgRed:se,bgGreen:se,bgYellow:se,bgBlue:se,bgMagenta:se,bgCyan:se,bgWhite:se}};te.exports=re(),te.exports.createColors=re;var ne=te.exports;const oe=ee(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let ie=ne,ae=oe,le=class e extends Error{constructor(t,s,r,n,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),n&&(this.source=n),i&&(this.plugin=i),void 0!==s&&void 0!==r&&("number"==typeof s?(this.line=s,this.column=r):(this.line=s.line,this.column=s.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=ie.isColorSupported),ae&&e&&(t=ae(t));let s,r,n=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,n.length),a=String(i).length;if(e){let{bold:e,gray:t,red:n}=ie.createColors(!0);s=t=>e(n(t)),r=e=>t(e)}else s=r=e=>e;return n.slice(o,i).map((e,t)=>{let n=o+1+t,i=" "+(" "+n).slice(-a)+" | ";if(n===this.line){let t=r(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+r(i)+e+"\n "+t+s("^")}return" "+r(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var ce=le;le.default=le;var he={};he.isClean=Symbol("isClean"),he.my=Symbol("my");const ue={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let de=class{constructor(e){this.builder=e}atrule(e,t){let s="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?s+=e.raws.afterName:r&&(s+=" "),e.nodes)this.block(e,s+r);else{let n=(e.raws.between||"")+(t?";":"");this.builder(s+r+n,e)}}beforeAfter(e,t){let s;s="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let r=e.parent,n=0;for(;r&&"root"!==r.type;)n+=1,r=r.parent;if(s.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<n;e++)s+=t}return s}block(e,t){let s,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),s=this.raw(e,"after")):s=this.raw(e,"after","emptyBody"),s&&this.builder(s),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let s=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let n=e.nodes[r],o=this.raw(n,"before");o&&this.builder(o),this.stringify(n,t!==r||s)}}comment(e){let t=this.raw(e,"left","commentLeft"),s=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+s+"*/",e)}decl(e,t){let s=this.raw(e,"between","colon"),r=e.prop+s+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)}document(e){this.body(e)}raw(e,t,s){let r;if(s||(s=t),t&&(r=e.raws[t],void 0!==r))return r;let n=e.parent;if("before"===s){if(!n||"root"===n.type&&n.first===e)return"";if(n&&"document"===n.type)return""}if(!n)return ue[s];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[s])return o.rawCache[s];if("before"===s||"after"===s)return this.beforeAfter(e,s);{let n="raw"+((i=s)[0].toUpperCase()+i.slice(1));this[n]?r=this[n](o,e):o.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var i;return void 0===r&&(r=ue[s]),o.rawCache[s]=r,r}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let s;return e.walkComments(e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(t,null,"beforeDecl"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeDecl(e,t){let s;return e.walkDecls(e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(t,null,"beforeRule"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(s=>{if(s.nodes&&(s.parent!==e||e.first!==s)&&void 0!==s.raws.before)return t=s.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(s=>{let r=s.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==s.raws.before){let e=s.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let s=e[t],r=e.raws[t];return r&&r.value===s?r.raw:s}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var pe=de;de.default=de;let fe=pe;function me(e,t){new fe(t).stringify(e)}var ge=me;me.default=me;let{isClean:ye,my:we}=he,ve=ce,be=pe,Se=ge;function Ce(e,t){let s=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if("proxyCache"===r)continue;let n=e[r],o=typeof n;"parent"===r&&"object"===o?t&&(s[r]=t):"source"===r?s[r]=n:Array.isArray(n)?s[r]=n.map(e=>Ce(e,s)):("object"===o&&null!==n&&(n=Ce(n)),s[r]=n)}return s}let Ie=class{constructor(e={}){this.raws={},this[ye]=!1,this[we]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let s of e[t])"function"==typeof s.clone?this.append(s.clone()):this.append(s)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=Ce(this);for(let s in e)t[s]=e[s];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:s,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:s.column,line:s.line},t)}return new ve(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,s)=>(e[t]===s||(e[t]=s,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[ye]){this[ye]=!1;let e=this;for(;e=e.parent;)e[ye]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let s=this.source.start;if(e.index)s=this.positionInside(e.index,t);else if(e.word){let r=(t=this.toString()).indexOf(e.word);-1!==r&&(s=this.positionInside(r,t))}return s}positionInside(e,t){let s=t||this.toString(),r=this.source.start.column,n=this.source.start.line;for(let t=0;t<e;t++)"\n"===s[t]?(r=1,n+=1):r+=1;return{column:r,line:n}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},s=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let r=this.toString(),n=r.indexOf(e.word);-1!==n&&(t=this.positionInside(n,r),s=this.positionInside(n+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?s={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?s=this.positionInside(e.endIndex):e.index&&(s=this.positionInside(e.index+1));return(s.line<t.line||s.line===t.line&&s.column<=t.column)&&(s={column:t.column+1,line:t.line}),{end:s,start:t}}raw(e,t){return(new be).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,s=!1;for(let r of e)r===this?s=!0:s?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);s||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let s={},r=null==t;t=t||new Map;let n=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let r=this[e];if(Array.isArray(r))s[e]=r.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof r&&r.toJSON)s[e]=r.toJSON(null,t);else if("source"===e){let o=t.get(r.input);null==o&&(o=n,t.set(r.input,n),n++),s[e]={end:r.end,inputId:o,start:r.start}}else s[e]=r}return r&&(s.inputs=[...t.keys()].map(e=>e.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Se){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,s){let r={node:this};for(let e in s)r[e]=s[e];return e.warn(t,r)}get proxyOf(){return this}};var ke=Ie;Ie.default=Ie;let xe=ke,Oe=class extends xe{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var Ee=Oe;Oe.default=Oe;var Me={nanoid:(e=21)=>{let t="",s=e;for(;s--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:Re,SourceMapGenerator:Ae}=oe,{existsSync:Te,readFileSync:Ne}=oe,{dirname:Le,join:Fe}=oe;let De=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let s=t.map?t.map.prev:void 0,r=this.loadMap(t.from,s);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Le(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new Re(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let s=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let s=e.lastIndexOf(t.pop()),r=e.indexOf("*/",s);s>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(s,r)))}loadFile(e){if(this.root=Le(e),Te(e))return this.mapFile=e,Ne(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof Re)return Ae.fromSourceMap(t).toString();if(t instanceof Ae)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let s=t(e);if(s){let e=this.loadFile(s);if(!e)throw new Error("Unable to load previous source map: "+s.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=Fe(Le(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Pe=De;De.default=De;let{SourceMapConsumer:_e,SourceMapGenerator:Ue}=oe,{fileURLToPath:Be,pathToFileURL:ze}=oe,{isAbsolute:je,resolve:$e}=oe,{nanoid:We}=Me,Ve=oe,Ge=ce,Ye=Pe,Ke=Symbol("fromOffsetCache"),Ze=Boolean(_e&&Ue),Je=Boolean($e&&je),He=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Je||/^\w+:\/\//.test(t.from)||je(t.from)?this.file=t.from:this.file=$e(t.from)),Je&&Ze){let e=new Ye(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+We(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,s,r={}){let n,o,i;if(t&&"object"==typeof t){let e=t,r=s;if("number"==typeof e.offset){let r=this.fromOffset(e.offset);t=r.line,s=r.col}else t=e.line,s=e.column;if("number"==typeof r.offset){let e=this.fromOffset(r.offset);o=e.line,i=e.col}else o=r.line,i=r.column}else if(!s){let e=this.fromOffset(t);t=e.line,s=e.col}let a=this.origin(t,s,o,i);return n=a?new Ge(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,r.plugin):new Ge(e,void 0===o?t:{column:s,line:t},void 0===o?s:{column:i,line:o},this.css,this.file,r.plugin),n.input={column:s,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(ze&&(n.input.url=ze(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,s;if(this[Ke])s=this[Ke];else{let e=this.css.split("\n");s=new Array(e.length);let t=0;for(let r=0,n=e.length;r<n;r++)s[r]=t,t+=e[r].length+1;this[Ke]=s}t=s[s.length-1];let r=0;if(e>=t)r=s.length-1;else{let t,n=s.length-2;for(;r<n;)if(t=r+(n-r>>1),e<s[t])n=t-1;else{if(!(e>=s[t+1])){r=t;break}r=t+1}}return{col:e-s[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:$e(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,s,r){if(!this.map)return!1;let n,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof s&&(n=i.originalPositionFor({column:r,line:s})),o=je(a.source)?ze(a.source):new URL(a.source,this.map.consumer().sourceRoot||ze(this.map.mapFile));let l={column:a.column,endColumn:n&&n.column,endLine:n&&n.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!Be)throw new Error("file: protocol is not available in this PostCSS build");l.file=Be(o)}let c=i.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var Xe=He;He.default=He,Ve&&Ve.registerInput&&Ve.registerInput(He);let{SourceMapConsumer:qe,SourceMapGenerator:Qe}=oe,{dirname:et,relative:tt,resolve:st,sep:rt}=oe,{pathToFileURL:nt}=oe,ot=Xe,it=Boolean(qe&&Qe),at=Boolean(et&&st&&tt&&rt);var lt=class{constructor(e,t,s,r){this.stringify=e,this.mapOpts=s.map||{},this.root=t,this.opts=s,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,s=this.toUrl(this.path(e.file)),r=e.root||et(e.file);!1===this.mapOpts.sourcesContent?(t=new qe(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,s,this.toUrl(this.path(r)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),at&&it&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Qe.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Qe({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 Qe({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,s=1,r=1,n="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=s,o.generated.column=r-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=i.match(/\n/g),e?(s+=e.length,t=i.lastIndexOf("\n"),r=i.length-t):r+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=s,o.generated.column=r-2,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,o.generated.line=s,o.generated.column=r-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let s=this.opts.to?et(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(s=et(st(s,this.mapOpts.annotation)));let r=tt(s,e);return this.memoizedPaths.set(e,r),r}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new ot(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let s=t.source.input.from;if(s&&!e[s]){e[s]=!0;let r=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(nt){let t=nt(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===rt&&(e=e.replace(/\\/g,"/"));let s=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,s),s}};let ct=ke,ht=class extends ct{constructor(e){super(e),this.type="comment"}};var ut=ht;ht.default=ht;let dt,pt,ft,mt,{isClean:gt,my:yt}=he,wt=Ee,vt=ut,bt=ke;function St(e){return e.map(e=>(e.nodes&&(e.nodes=St(e.nodes)),delete e.source,e))}function Ct(e){if(e[gt]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Ct(t)}let It=class e extends bt{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,s,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],s=e(this.proxyOf.nodes[t],t),!1!==s);)this.indexes[r]+=1;return delete this.indexes[r],s}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...s)=>e[t](...s.map(e=>"function"==typeof e?(t,s)=>e(t.toProxy(),s):e)):"every"===t||"some"===t?s=>e[t]((e,...t)=>s(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,s)=>(e[t]===s||(e[t]=s,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let s,r=this.index(e),n=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let e of n)this.proxyOf.nodes.splice(r+1,0,e);for(let e in this.indexes)s=this.indexes[e],r<s&&(this.indexes[e]=s+n.length);return this.markDirty(),this}insertBefore(e,t){let s,r=this.index(e),n=0===r&&"prepend",o=this.normalize(t,this.proxyOf.nodes[r],n).reverse();r=this.index(e);for(let e of o)this.proxyOf.nodes.splice(r,0,e);for(let e in this.indexes)s=this.indexes[e],r<=s&&(this.indexes[e]=s+o.length);return this.markDirty(),this}normalize(t,s){if("string"==typeof t)t=St(dt(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new wt(t)]}else if(t.selector)t=[new pt(t)];else if(t.name)t=[new ft(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new vt(t)]}return t.map(t=>(t[yt]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[gt]&&Ct(t),void 0===t.raws.before&&s&&void 0!==s.raws.before&&(t.raws.before=s.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let s in this.indexes)t=this.indexes[s],t>=e&&(this.indexes[s]=t-1);return this.markDirty(),this}replaceValues(e,t,s){return s||(s=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,s))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,s)=>{let r;try{r=e(t,s)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("atrule"===s.type&&e.test(s.name))return t(s,r)}):this.walk((s,r)=>{if("atrule"===s.type&&s.name===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("atrule"===e.type)return t(e,s)}))}walkComments(e){return this.walk((t,s)=>{if("comment"===t.type)return e(t,s)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("decl"===s.type&&e.test(s.prop))return t(s,r)}):this.walk((s,r)=>{if("decl"===s.type&&s.prop===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("decl"===e.type)return t(e,s)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("rule"===s.type&&e.test(s.selector))return t(s,r)}):this.walk((s,r)=>{if("rule"===s.type&&s.selector===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("rule"===e.type)return t(e,s)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};It.registerParse=e=>{dt=e},It.registerRule=e=>{pt=e},It.registerAtRule=e=>{ft=e},It.registerRoot=e=>{mt=e};var kt=It;It.default=It,It.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,ft.prototype):"rule"===e.type?Object.setPrototypeOf(e,pt.prototype):"decl"===e.type?Object.setPrototypeOf(e,wt.prototype):"comment"===e.type?Object.setPrototypeOf(e,vt.prototype):"root"===e.type&&Object.setPrototypeOf(e,mt.prototype),e[yt]=!0,e.nodes&&e.nodes.forEach(e=>{It.rebuild(e)})};let xt,Ot,Et=kt,Mt=class extends Et{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new xt(new Ot,this,e).stringify()}};Mt.registerLazyResult=e=>{xt=e},Mt.registerProcessor=e=>{Ot=e};var Rt=Mt;Mt.default=Mt;let At={};var Tt=function(e){At[e]||(At[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Nt=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var Lt=Nt;Nt.default=Nt;let Ft=Lt,Dt=class{constructor(e,t,s){this.processor=e,this.messages=[],this.root=t,this.opts=s,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let s=new Ft(e,t);return this.messages.push(s),s}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Pt=Dt;Dt.default=Dt;const _t="'".charCodeAt(0),Ut='"'.charCodeAt(0),Bt="\\".charCodeAt(0),zt="/".charCodeAt(0),jt="\n".charCodeAt(0),$t=" ".charCodeAt(0),Wt="\f".charCodeAt(0),Vt="\t".charCodeAt(0),Gt="\r".charCodeAt(0),Yt="[".charCodeAt(0),Kt="]".charCodeAt(0),Zt="(".charCodeAt(0),Jt=")".charCodeAt(0),Ht="{".charCodeAt(0),Xt="}".charCodeAt(0),qt=";".charCodeAt(0),Qt="*".charCodeAt(0),es=":".charCodeAt(0),ts="@".charCodeAt(0),ss=/[\t\n\f\r "#'()/;[\\\]{}]/g,rs=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,ns=/.[\r\n"'(/\\]/,os=/[\da-f]/i;let is=kt,as=class extends is{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var ls=as;as.default=as,is.registerAtRule(as);let cs,hs,us=kt,ds=class extends us{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,s){let r=super.normalize(e);if(t)if("prepend"===s)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of r)e.raws.before=t.raws.before;return r}removeChild(e,t){let s=this.index(e);return!t&&0===s&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[s].raws.before),super.removeChild(e)}toResult(e={}){return new cs(new hs,this,e).stringify()}};ds.registerLazyResult=e=>{cs=e},ds.registerProcessor=e=>{hs=e};var ps=ds;ds.default=ds,us.registerRoot(ds);let fs={comma:e=>fs.split(e,[","],!0),space:e=>fs.split(e,[" ","\n","\t"]),split(e,t,s){let r=[],n="",o=!1,i=0,a=!1,l="",c=!1;for(let s of e)c?c=!1:"\\"===s?c=!0:a?s===l&&(a=!1):'"'===s||"'"===s?(a=!0,l=s):"("===s?i+=1:")"===s?i>0&&(i-=1):0===i&&t.includes(s)&&(o=!0),o?(""!==n&&r.push(n.trim()),n="",o=!1):n+=s;return(s||""!==n)&&r.push(n.trim()),r}};var ms=fs;fs.default=fs;let gs=kt,ys=ms,ws=class extends gs{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return ys.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,s=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(s)}};var vs=ws;ws.default=ws,gs.registerRule(ws);let bs=Ee,Ss=function(e,t={}){let s,r,n,o,i,a,l,c,h,u,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,m=0,g=[],y=[];function w(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(s=d.charCodeAt(m),s){case jt:case $t:case Vt:case Gt:case Wt:r=m;do{r+=1,s=d.charCodeAt(r)}while(s===$t||s===jt||s===Vt||s===Gt||s===Wt);u=["space",d.slice(m,r)],m=r-1;break;case Yt:case Kt:case Ht:case Xt:case es:case qt:case Jt:{let e=String.