@sessionsight/insights 1.0.0 → 1.0.1
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/_worker-bundle.d.ts +1 -0
- package/dist/iife.d.ts +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +13850 -0
- package/dist/recorder.d.ts +115 -0
- package/dist/sessionsight.js +72 -0
- package/dist/transport.d.ts +43 -0
- package/dist/types.d.ts +71 -0
- package/dist/worker-bridge.d.ts +52 -0
- package/dist/worker-inline.d.ts +8 -0
- package/dist/worker.d.ts +8 -0
- package/package.json +4 -1
- package/build.ts +0 -47
- package/src/_worker-bundle.d.ts +0 -3
- package/src/iife.ts +0 -3
- package/src/index.ts +0 -240
- package/src/recorder.ts +0 -1396
- package/src/transport.ts +0 -241
- package/src/types.ts +0 -56
- package/src/worker-bridge.ts +0 -315
- package/src/worker-inline.ts +0 -23
- package/src/worker.ts +0 -302
- package/tsconfig.json +0 -13
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
(()=>{var O8=Object.defineProperty,A8=(X,J,Z)=>(J in X)?O8(X,J,{enumerable:!0,configurable:!0,writable:!0,value:Z}):X[J]=Z,P=(X,J,Z)=>A8(X,typeof J!=="symbol"?J+"":J,Z),G9,M8=Object.defineProperty,w8=(X,J,Z)=>(J in X)?M8(X,J,{enumerable:!0,configurable:!0,writable:!0,value:Z}):X[J]=Z,K9=(X,J,Z)=>w8(X,typeof J!=="symbol"?J+"":J,Z),i=((X)=>{return X[X.Document=0]="Document",X[X.DocumentType=1]="DocumentType",X[X.Element=2]="Element",X[X.Text=3]="Text",X[X.CDATA=4]="CDATA",X[X.Comment=5]="Comment",X})(i||{}),V9={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},W9={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},w1={},_8=()=>{return!!globalThis.Zone};function _Z(X){if(w1[X])return w1[X];let J=globalThis[X],Z=J.prototype,Q=X in V9?V9[X]:void 0,Y=Boolean(Q&&Q.every((V)=>{var K,W;return Boolean((W=(K=Object.getOwnPropertyDescriptor(Z,V))==null?void 0:K.get)==null?void 0:W.toString().includes("[native code]"))})),q=X in W9?W9[X]:void 0,G=Boolean(q&&q.every((V)=>{var K;return typeof Z[V]==="function"&&((K=Z[V])==null?void 0:K.toString().includes("[native code]"))}));if(Y&&G&&!_8())return w1[X]=J.prototype,J.prototype;try{let V=document.createElement("iframe");document.body.appendChild(V);let K=V.contentWindow;if(!K)return J.prototype;let W=K[X].prototype;if(document.body.removeChild(V),!W)return Z;return w1[X]=W}catch{return Z}}var NJ={};function D0(X,J,Z){var Q;let Y=`${X}.${String(Z)}`;if(NJ[Y])return NJ[Y].call(J);let q=_Z(X),G=(Q=Object.getOwnPropertyDescriptor(q,Z))==null?void 0:Q.get;if(!G)return J[Z];return NJ[Y]=G,G.call(J)}var IJ={};function G6(X,J,Z){let Q=`${X}.${String(Z)}`;if(IJ[Q])return IJ[Q].bind(J);let q=_Z(X)[Z];if(typeof q!=="function")return J[Z];return IJ[Q]=q,q.bind(J)}function C8(X){return D0("Node",X,"ownerDocument")}function $8(X){return D0("Node",X,"childNodes")}function R8(X){return D0("Node",X,"parentNode")}function E8(X){return D0("Node",X,"parentElement")}function N8(X){return D0("Node",X,"textContent")}function I8(X,J){return G6("Node",X,"contains")(J)}function S8(X){return G6("Node",X,"getRootNode")()}function T8(X){if(!X||!("host"in X))return null;return D0("ShadowRoot",X,"host")}function x8(X){return X.styleSheets}function f8(X){if(!X||!("shadowRoot"in X))return null;return D0("Element",X,"shadowRoot")}function b8(X,J){return D0("Element",X,"querySelector")(J)}function k8(X,J){return D0("Element",X,"querySelectorAll")(J)}function v8(){return _Z("MutationObserver").constructor}function h8(X,J,Z){try{if(!(J in X))return()=>{};let Q=X[J],Y=Z(Q);if(typeof Y==="function")Y.prototype=Y.prototype||{},Object.defineProperties(Y,{__rrweb_original__:{enumerable:!1,value:Q}});return X[J]=Y,()=>{X[J]=Q}}catch{return()=>{}}}var r={ownerDocument:C8,childNodes:$8,parentNode:R8,parentElement:E8,textContent:N8,contains:I8,getRootNode:S8,host:T8,styleSheets:x8,shadowRoot:f8,querySelector:b8,querySelectorAll:k8,mutationObserver:v8,patch:h8};function K6(X){return X.nodeType===X.ELEMENT_NODE}function e0(X){let J=X&&"host"in X&&"mode"in X&&r.host(X)||null;return Boolean(J&&"shadowRoot"in J&&r.shadowRoot(J)===X)}function J1(X){return Object.prototype.toString.call(X)==="[object ShadowRoot]"}function y8(X){if(X.includes(" background-clip: text;")&&!X.includes(" -webkit-background-clip: text;"))X=X.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;");return X}function g8(X){let{cssText:J}=X;if(J.split('"').length<3)return J;let Z=["@import",`url(${JSON.stringify(X.href)})`];if(X.layerName==="")Z.push("layer");else if(X.layerName)Z.push(`layer(${X.layerName})`);if(X.supportsText)Z.push(`supports(${X.supportsText})`);if(X.media.length)Z.push(X.media.mediaText);return Z.join(" ")+";"}function pJ(X){try{let J=X.rules||X.cssRules;if(!J)return null;let Z=X.href;if(!Z&&X.ownerNode)Z=X.ownerNode.baseURI;let Q=Array.from(J,(Y)=>V6(Y,Z)).join("");return y8(Q)}catch(J){return null}}function V6(X,J){if(u8(X)){let Z;try{Z=pJ(X.styleSheet)||g8(X)}catch(Q){Z=X.cssText}if(X.styleSheet.href)return e1(Z,X.styleSheet.href);return Z}else{let Z=X.cssText;if(p8(X)&&X.selectorText.includes(":"))Z=m8(Z);if(J)return e1(Z,J);return Z}}function m8(X){let J=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return X.replace(J,"$1\\$2")}function u8(X){return"styleSheet"in X}function p8(X){return"selectorText"in X}class CZ{constructor(){K9(this,"idNodeMap",new Map),K9(this,"nodeMetaMap",new WeakMap)}getId(X){var J;if(!X)return-1;return((J=this.getMeta(X))==null?void 0:J.id)??-1}getNode(X){return this.idNodeMap.get(X)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(X){return this.nodeMetaMap.get(X)||null}removeNodeFromMap(X){let J=this.getId(X);if(this.idNodeMap.delete(J),X.childNodes)X.childNodes.forEach((Z)=>this.removeNodeFromMap(Z))}has(X){return this.idNodeMap.has(X)}hasNode(X){return this.nodeMetaMap.has(X)}add(X,J){let Z=J.id;this.idNodeMap.set(Z,X),this.nodeMetaMap.set(X,J)}replace(X,J){let Z=this.getNode(X);if(Z){let Q=this.nodeMetaMap.get(Z);if(Q)this.nodeMetaMap.set(J,Q)}this.idNodeMap.set(X,J)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function c8(){return new CZ}function n1({element:X,maskInputOptions:J,tagName:Z,type:Q,value:Y,maskInputFn:q}){let G=Y||"",V=Q&&$0(Q);if(J[Z.toLowerCase()]||V&&J[V])if(q)G=q(G,X);else G="*".repeat(G.length);return G}function $0(X){return X.toLowerCase()}var j9="__rrweb_original__";function l8(X){let J=X.getContext("2d");if(!J)return!0;let Z=50;for(let Q=0;Q<X.width;Q+=Z)for(let Y=0;Y<X.height;Y+=Z){let q=J.getImageData,G=j9 in q?q[j9]:q;if(new Uint32Array(G.call(J,Q,Y,Math.min(Z,X.width-Q),Math.min(Z,X.height-Y)).data.buffer).some((K)=>K!==0))return!1}return!0}function t1(X){let J=X.type;return X.hasAttribute("data-rr-is-password")?"password":J?$0(J):null}function W6(X,J){let Z;try{Z=new URL(X,J??window.location.href)}catch(q){return null}let Q=/\.([0-9a-z]+)(?:$)/i,Y=Z.pathname.match(Q);return(Y==null?void 0:Y[1])??null}function d8(X){let J="";if(X.indexOf("//")>-1)J=X.split("/").slice(0,3).join("/");else J=X.split("/")[0];return J=J.split("?")[0],J}var i8=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,s8=/^(?:[a-z+]+:)?\/\//i,a8=/^www\..*/i,r8=/^(data:)([^,]*),(.*)/i;function e1(X,J){return(X||"").replace(i8,(Z,Q,Y,q,G,V)=>{let K=Y||G||V,W=Q||q||"";if(!K)return Z;if(s8.test(K)||a8.test(K))return`url(${W}${K}${W})`;if(r8.test(K))return`url(${W}${K}${W})`;if(K[0]==="/")return`url(${W}${d8(J)+K}${W})`;let j=J.split("/"),U=K.split("/");j.pop();for(let z of U)if(z===".")continue;else if(z==="..")j.pop();else j.push(z);return`url(${W}${j.join("/")}${W})`})}function _1(X,J=!1){if(J)return X.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"");else return X.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function o8(X,J,Z=!1){let Q=Array.from(J.childNodes),Y=[],q=0;if(Q.length>1&&X&&typeof X==="string"){let G=_1(X,Z),V=G.length/X.length;for(let K=1;K<Q.length;K++)if(Q[K].textContent&&typeof Q[K].textContent==="string"){let W=_1(Q[K].textContent,Z),j=100,U=3;for(;U<W.length;U++){if(W[U].match(/[a-zA-Z0-9]/)||W.indexOf(W.substring(0,U),1)!==-1)continue;break}for(;U<W.length;U++){let z=W.substring(0,U),H=G.split(z),D=-1;if(H.length===2)D=H[0].length;else if(H.length>2&&H[0]===""&&Q[K-1].textContent!=="")D=G.indexOf(z,1);else if(H.length===1){if(z=z.substring(0,z.length-1),H=G.split(z),H.length<=1)return Y.push(X),Y;U=101}else if(U===W.length-1)D=G.indexOf(z);if(H.length>=2&&U>100){let L=Q[K-1].textContent;if(L&&typeof L==="string"){let B=_1(L).length;D=G.indexOf(z,B)}if(D===-1)D=H[0].length}if(D!==-1){let L=Math.floor(D/V);for(;L>0&&L<X.length;){if(q+=1,q>50*Q.length)return Y.push(X),Y;let B=_1(X.substring(0,L),Z);if(B.length===D){Y.push(X.substring(0,L)),X=X.substring(L),G=G.substring(D);break}else if(B.length<D)L+=Math.max(1,Math.floor((D-B.length)/V));else L-=Math.max(1,Math.floor((B.length-D)*V))}break}}}}return Y.push(X),Y}function n8(X,J){return o8(X,J).join("/* rr_split */")}var t8=1,e8=new RegExp("[^a-z0-9-_:]"),X1=-2;function j6(){return t8++}function JQ(X){if(X instanceof HTMLFormElement)return"form";let J=$0(X.tagName);if(e8.test(J))return"div";return J}var T0,U9,ZQ=/^[^ \t\n\r\u000c]+/,XQ=/^[, \t\n\r\u000c]+/;function QQ(X,J){if(J.trim()==="")return J;let Z=0;function Q(q){let G,V=q.exec(J.substring(Z));if(V)return G=V[0],Z+=G.length,G;return""}let Y=[];while(!0){if(Q(XQ),Z>=J.length)break;let q=Q(ZQ);if(q.slice(-1)===",")q=k0(X,q.substring(0,q.length-1)),Y.push(q);else{let G="";q=k0(X,q);let V=!1;while(!0){let K=J.charAt(Z);if(K===""){Y.push((q+G).trim());break}else if(!V){if(K===","){Z+=1,Y.push((q+G).trim());break}else if(K==="(")V=!0}else if(K===")")V=!1;G+=K,Z+=1}}}return Y.join(", ")}var B9=new WeakMap;function k0(X,J){if(!J||J.trim()==="")return J;return $Z(X,J)}function YQ(X){return Boolean(X.tagName==="svg"||X.ownerSVGElement)}function $Z(X,J){let Z=B9.get(X);if(!Z)Z=X.createElement("a"),B9.set(X,Z);if(!J)J="";else if(J.startsWith("blob:")||J.startsWith("data:"))return J;return Z.setAttribute("href",J),Z.href}function U6(X,J,Z,Q){if(!Q)return Q;if(Z==="src"||Z==="href"&&!(J==="use"&&Q[0]==="#"))return k0(X,Q);else if(Z==="xlink:href"&&Q[0]!=="#")return k0(X,Q);else if(Z==="background"&&["table","td","th"].includes(J))return k0(X,Q);else if(Z==="srcset")return QQ(X,Q);else if(Z==="style")return e1(Q,$Z(X));else if(J==="object"&&Z==="data")return k0(X,Q);return Q}function B6(X,J,Z){return["video","audio"].includes(X)&&J==="autoplay"}function qQ(X,J,Z){try{if(typeof J==="string"){if(X.classList.contains(J))return!0}else for(let Q=X.classList.length;Q--;){let Y=X.classList[Q];if(J.test(Y))return!0}if(Z)return X.matches(Z)}catch(Q){}return!1}function JJ(X,J,Z){if(!X)return!1;if(X.nodeType!==X.ELEMENT_NODE){if(!Z)return!1;return JJ(r.parentNode(X),J,Z)}for(let Q=X.classList.length;Q--;){let Y=X.classList[Q];if(J.test(Y))return!0}if(!Z)return!1;return JJ(r.parentNode(X),J,Z)}function z6(X,J,Z,Q){let Y;if(K6(X)){if(Y=X,!r.childNodes(Y).length)return!1}else if(r.parentElement(X)===null)return!1;else Y=r.parentElement(X);try{if(typeof J==="string"){if(Q){if(Y.closest(`.${J}`))return!0}else if(Y.classList.contains(J))return!0}else if(JJ(Y,J,Q))return!0;if(Z){if(Q){if(Y.closest(Z))return!0}else if(Y.matches(Z))return!0}}catch(q){}return!1}function GQ(X,J,Z){let Q=X.contentWindow;if(!Q)return;let Y=!1,q;try{q=Q.document.readyState}catch(V){return}if(q!=="complete"){let V=setTimeout(()=>{if(!Y)J(),Y=!0},Z);X.addEventListener("load",()=>{clearTimeout(V),Y=!0,J()});return}let G="about:blank";if(Q.location.href!==G||X.src===G||X.src==="")return setTimeout(J,0),X.addEventListener("load",J);X.addEventListener("load",J)}function KQ(X,J,Z){let Q=!1,Y;try{Y=X.sheet}catch(G){return}if(Y)return;let q=setTimeout(()=>{if(!Q)J(),Q=!0},Z);X.addEventListener("load",()=>{clearTimeout(q),Q=!0,J()})}function VQ(X,J){let{doc:Z,mirror:Q,blockClass:Y,blockSelector:q,needsMask:G,inlineStylesheet:V,maskInputOptions:K={},maskTextFn:W,maskInputFn:j,dataURLOptions:U={},inlineImages:z,recordCanvas:H,keepIframeSrcFn:D,newlyAddedElement:L=!1,cssCaptured:B=!1}=J,A=WQ(Z,Q);switch(X.nodeType){case X.DOCUMENT_NODE:if(X.compatMode!=="CSS1Compat")return{type:i.Document,childNodes:[],compatMode:X.compatMode};else return{type:i.Document,childNodes:[]};case X.DOCUMENT_TYPE_NODE:return{type:i.DocumentType,name:X.name,publicId:X.publicId,systemId:X.systemId,rootId:A};case X.ELEMENT_NODE:return UQ(X,{doc:Z,blockClass:Y,blockSelector:q,inlineStylesheet:V,maskInputOptions:K,maskInputFn:j,dataURLOptions:U,inlineImages:z,recordCanvas:H,keepIframeSrcFn:D,newlyAddedElement:L,rootId:A});case X.TEXT_NODE:return jQ(X,{doc:Z,needsMask:G,maskTextFn:W,rootId:A,cssCaptured:B});case X.CDATA_SECTION_NODE:return{type:i.CDATA,textContent:"",rootId:A};case X.COMMENT_NODE:return{type:i.Comment,textContent:r.textContent(X)||"",rootId:A};default:return!1}}function WQ(X,J){if(!J.hasNode(X))return;let Z=J.getId(X);return Z===1?void 0:Z}function jQ(X,J){let{needsMask:Z,maskTextFn:Q,rootId:Y,cssCaptured:q}=J,G=r.parentNode(X),V=G&&G.tagName,K="",W=V==="STYLE"?!0:void 0,j=V==="SCRIPT"?!0:void 0;if(j)K="SCRIPT_PLACEHOLDER";else if(!q){if(K=r.textContent(X),W&&K)K=e1(K,$Z(J.doc))}if(!W&&!j&&K&&Z)K=Q?Q(K,r.parentElement(X)):K.replace(/[\S]/g,"*");return{type:i.Text,textContent:K||"",rootId:Y}}function UQ(X,J){let{doc:Z,blockClass:Q,blockSelector:Y,inlineStylesheet:q,maskInputOptions:G={},maskInputFn:V,dataURLOptions:K={},inlineImages:W,recordCanvas:j,keepIframeSrcFn:U,newlyAddedElement:z=!1,rootId:H}=J,D=qQ(X,Q,Y),L=JQ(X),B={},A=X.attributes.length;for(let F=0;F<A;F++){let M=X.attributes[F];if(!B6(L,M.name,M.value))B[M.name]=U6(Z,L,$0(M.name),M.value)}if(L==="link"&&q){let F=Array.from(Z.styleSheets).find((T)=>{return T.href===X.href}),M=null;if(F)M=pJ(F);if(M)delete B.rel,delete B.href,B._cssText=M}if(L==="style"&&X.sheet){let F=pJ(X.sheet);if(F){if(X.childNodes.length>1)F=n8(F,X);B._cssText=F}}if(["input","textarea","select"].includes(L)){let{value:F,checked:M}=X;if(B.type!=="radio"&&B.type!=="checkbox"&&B.type!=="submit"&&B.type!=="button"&&F)B.value=n1({element:X,type:t1(X),tagName:L,value:F,maskInputOptions:G,maskInputFn:V});else if(M)B.checked=M}if(L==="option")if(X.selected&&!G.select)B.selected=!0;else delete B.selected;if(L==="dialog"&&X.open)B.rr_open_mode=X.matches("dialog:modal")?"modal":"non-modal";if(L==="canvas"&&j){if(X.__context==="2d"){if(!l8(X))B.rr_dataURL=X.toDataURL(K.type,K.quality)}else if(!("__context"in X)){let F=X.toDataURL(K.type,K.quality),M=Z.createElement("canvas");M.width=X.width,M.height=X.height;let T=M.toDataURL(K.type,K.quality);if(F!==T)B.rr_dataURL=F}}if(L==="img"&&W){if(!T0)T0=Z.createElement("canvas"),U9=T0.getContext("2d");let F=X,M=F.currentSrc||F.getAttribute("src")||"<unknown-src>",T=F.crossOrigin,f=()=>{F.removeEventListener("load",f);try{T0.width=F.naturalWidth,T0.height=F.naturalHeight,U9.drawImage(F,0,0),B.rr_dataURL=T0.toDataURL(K.type,K.quality)}catch(l){if(F.crossOrigin!=="anonymous"){if(F.crossOrigin="anonymous",F.complete&&F.naturalWidth!==0)f();else F.addEventListener("load",f);return}else console.warn(`Cannot inline img src=${M}! Error: ${l}`)}if(F.crossOrigin==="anonymous")T?B.crossOrigin=T:F.removeAttribute("crossorigin")};if(F.complete&&F.naturalWidth!==0)f();else F.addEventListener("load",f)}if(["audio","video"].includes(L)){let F=B;F.rr_mediaState=X.paused?"paused":"played",F.rr_mediaCurrentTime=X.currentTime,F.rr_mediaPlaybackRate=X.playbackRate,F.rr_mediaMuted=X.muted,F.rr_mediaLoop=X.loop,F.rr_mediaVolume=X.volume}if(!z){if(X.scrollLeft)B.rr_scrollLeft=X.scrollLeft;if(X.scrollTop)B.rr_scrollTop=X.scrollTop}if(D){let{width:F,height:M}=X.getBoundingClientRect();B={class:B.class,rr_width:`${F}px`,rr_height:`${M}px`}}if(L==="iframe"&&!U(B.src)){if(!X.contentDocument)B.rr_src=B.src;delete B.src}let O;try{if(customElements.get(L))O=!0}catch(F){}return{type:i.Element,tagName:L,attributes:B,childNodes:[],isSVG:YQ(X)||void 0,needBlock:D,rootId:H,isCustom:O}}function b(X){if(X===void 0||X===null)return"";else return X.toLowerCase()}function H6(X){if(X===!0||X==="all")return{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:X==="all",headMetaDescKeywords:X==="all",headTitleMutations:X==="all"};else if(X)return X;return{}}function BQ(X,J){if(J.comment&&X.type===i.Comment)return!0;else if(X.type===i.Element){if(J.script&&(X.tagName==="script"||X.tagName==="link"&&(X.attributes.rel==="preload"&&X.attributes.as==="script"||X.attributes.rel==="modulepreload")||X.tagName==="link"&&X.attributes.rel==="prefetch"&&typeof X.attributes.href==="string"&&W6(X.attributes.href)==="js"))return!0;else if(J.headFavicon&&(X.tagName==="link"&&X.attributes.rel==="shortcut icon"||X.tagName==="meta"&&(b(X.attributes.name).match(/^msapplication-tile(image|color)$/)||b(X.attributes.name)==="application-name"||b(X.attributes.rel)==="icon"||b(X.attributes.rel)==="apple-touch-icon"||b(X.attributes.rel)==="shortcut icon")))return!0;else if(X.tagName==="meta"){if(J.headMetaDescKeywords&&b(X.attributes.name).match(/^description|keywords$/))return!0;else if(J.headMetaSocial&&(b(X.attributes.property).match(/^(og|twitter|fb):/)||b(X.attributes.name).match(/^(og|twitter):/)||b(X.attributes.name)==="pinterest"))return!0;else if(J.headMetaRobots&&(b(X.attributes.name)==="robots"||b(X.attributes.name)==="googlebot"||b(X.attributes.name)==="bingbot"))return!0;else if(J.headMetaHttpEquiv&&X.attributes["http-equiv"]!==void 0)return!0;else if(J.headMetaAuthorship&&(b(X.attributes.name)==="author"||b(X.attributes.name)==="generator"||b(X.attributes.name)==="framework"||b(X.attributes.name)==="publisher"||b(X.attributes.name)==="progid"||b(X.attributes.property).match(/^article:/)||b(X.attributes.property).match(/^product:/)))return!0;else if(J.headMetaVerification&&(b(X.attributes.name)==="google-site-verification"||b(X.attributes.name)==="yandex-verification"||b(X.attributes.name)==="csrf-token"||b(X.attributes.name)==="p:domain_verify"||b(X.attributes.name)==="verify-v1"||b(X.attributes.name)==="verification"||b(X.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function v0(X,J){let{doc:Z,mirror:Q,blockClass:Y,blockSelector:q,maskTextClass:G,maskTextSelector:V,skipChild:K=!1,inlineStylesheet:W=!0,maskInputOptions:j={},maskTextFn:U,maskInputFn:z,slimDOMOptions:H,dataURLOptions:D={},inlineImages:L=!1,recordCanvas:B=!1,onSerialize:A,onIframeLoad:O,iframeLoadTimeout:F=5000,onStylesheetLoad:M,stylesheetLoadTimeout:T=5000,keepIframeSrcFn:f=()=>!1,newlyAddedElement:l=!1,cssCaptured:h=!1}=J,{needsMask:c}=J,{preserveWhiteSpace:a=!0}=J;if(!c)c=z6(X,G,V,c===void 0);let J0=VQ(X,{doc:Z,mirror:Q,blockClass:Y,blockSelector:q,needsMask:c,inlineStylesheet:W,maskInputOptions:j,maskTextFn:U,maskInputFn:z,dataURLOptions:D,inlineImages:L,recordCanvas:B,keepIframeSrcFn:f,newlyAddedElement:l,cssCaptured:h});if(!J0)return console.warn(X,"not serialized"),null;let V0;if(Q.hasNode(X))V0=Q.getId(X);else if(BQ(J0,H)||!a&&J0.type===i.Text&&!J0.textContent.replace(/^\s+|\s+$/gm,"").length)V0=X1;else V0=j6();let E=Object.assign(J0,{id:V0});if(Q.add(X,E),V0===X1)return null;if(A)A(X);let s0=!K;if(E.type===i.Element){s0=s0&&!E.needBlock,delete E.needBlock;let d=r.shadowRoot(X);if(d&&J1(d))E.isShadowHost=!0}if((E.type===i.Document||E.type===i.Element)&&s0){if(H.headWhitespace&&E.type===i.Element&&E.tagName==="head")a=!1;let d={doc:Z,mirror:Q,blockClass:Y,blockSelector:q,needsMask:c,maskTextClass:G,maskTextSelector:V,skipChild:K,inlineStylesheet:W,maskInputOptions:j,maskTextFn:U,maskInputFn:z,slimDOMOptions:H,dataURLOptions:D,inlineImages:L,recordCanvas:B,preserveWhiteSpace:a,onSerialize:A,onIframeLoad:O,iframeLoadTimeout:F,onStylesheetLoad:M,stylesheetLoadTimeout:T,keepIframeSrcFn:f,cssCaptured:!1};if(E.type===i.Element&&E.tagName==="textarea"&&E.attributes.value!==void 0);else{if(E.type===i.Element&&E.attributes._cssText!==void 0&&typeof E.attributes._cssText==="string")d.cssCaptured=!0;for(let M0 of Array.from(r.childNodes(X))){let W0=v0(M0,d);if(W0)E.childNodes.push(W0)}}let Z0=null;if(K6(X)&&(Z0=r.shadowRoot(X)))for(let M0 of Array.from(r.childNodes(Z0))){let W0=v0(M0,d);if(W0)J1(Z0)&&(W0.isShadow=!0),E.childNodes.push(W0)}}let a0=r.parentNode(X);if(a0&&e0(a0)&&J1(a0))E.isShadow=!0;if(E.type===i.Element&&E.tagName==="iframe")GQ(X,()=>{let d=X.contentDocument;if(d&&O){let Z0=v0(d,{doc:d,mirror:Q,blockClass:Y,blockSelector:q,needsMask:c,maskTextClass:G,maskTextSelector:V,skipChild:!1,inlineStylesheet:W,maskInputOptions:j,maskTextFn:U,maskInputFn:z,slimDOMOptions:H,dataURLOptions:D,inlineImages:L,recordCanvas:B,preserveWhiteSpace:a,onSerialize:A,onIframeLoad:O,iframeLoadTimeout:F,onStylesheetLoad:M,stylesheetLoadTimeout:T,keepIframeSrcFn:f});if(Z0)O(X,Z0)}},F);if(E.type===i.Element&&E.tagName==="link"&&typeof E.attributes.rel==="string"&&(E.attributes.rel==="stylesheet"||E.attributes.rel==="preload"&&typeof E.attributes.href==="string"&&W6(E.attributes.href)==="css"))KQ(X,()=>{if(M){let d=v0(X,{doc:Z,mirror:Q,blockClass:Y,blockSelector:q,needsMask:c,maskTextClass:G,maskTextSelector:V,skipChild:!1,inlineStylesheet:W,maskInputOptions:j,maskTextFn:U,maskInputFn:z,slimDOMOptions:H,dataURLOptions:D,inlineImages:L,recordCanvas:B,preserveWhiteSpace:a,onSerialize:A,onIframeLoad:O,iframeLoadTimeout:F,onStylesheetLoad:M,stylesheetLoadTimeout:T,keepIframeSrcFn:f});if(d)M(X,d)}},T);return E}function zQ(X,J){let{mirror:Z=new CZ,blockClass:Q="rr-block",blockSelector:Y=null,maskTextClass:q="rr-mask",maskTextSelector:G=null,inlineStylesheet:V=!0,inlineImages:K=!1,recordCanvas:W=!1,maskAllInputs:j=!1,maskTextFn:U,maskInputFn:z,slimDOM:H=!1,dataURLOptions:D,preserveWhiteSpace:L,onSerialize:B,onIframeLoad:A,iframeLoadTimeout:O,onStylesheetLoad:F,stylesheetLoadTimeout:M,keepIframeSrcFn:T=()=>!1}=J||{},f=j===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:j===!1?{password:!0}:j,l=H6(H);return v0(X,{doc:X,mirror:Z,blockClass:Q,blockSelector:Y,maskTextClass:q,maskTextSelector:G,skipChild:!1,inlineStylesheet:V,maskInputOptions:f,maskTextFn:U,maskInputFn:z,slimDOMOptions:l,dataURLOptions:D,inlineImages:K,recordCanvas:W,preserveWhiteSpace:L,onSerialize:B,onIframeLoad:A,iframeLoadTimeout:O,onStylesheetLoad:F,stylesheetLoadTimeout:M,keepIframeSrcFn:T,newlyAddedElement:!1})}var HQ=/(max|min)-device-(width|height)/,CK=new RegExp(HQ.source,"g");function LQ(X){return X&&X.__esModule&&Object.prototype.hasOwnProperty.call(X,"default")?X.default:X}function DQ(X){if(X.__esModule)return X;var J=X.default;if(typeof J=="function"){var Z=function Q(){if(this instanceof Q)return Reflect.construct(J,arguments,this.constructor);return J.apply(this,arguments)};Z.prototype=J.prototype}else Z={};return Object.defineProperty(Z,"__esModule",{value:!0}),Object.keys(X).forEach(function(Q){var Y=Object.getOwnPropertyDescriptor(X,Q);Object.defineProperty(Z,Q,Y.get?Y:{enumerable:!0,get:function(){return X[Q]}})}),Z}var RZ={exports:{}},k=String,L6=function(){return{isColorSupported:!1,reset:k,bold:k,dim:k,italic:k,underline:k,inverse:k,hidden:k,strikethrough:k,black:k,red:k,green:k,yellow:k,blue:k,magenta:k,cyan:k,white:k,gray:k,bgBlack:k,bgRed:k,bgGreen:k,bgYellow:k,bgBlue:k,bgMagenta:k,bgCyan:k,bgWhite:k}};RZ.exports=L6();RZ.exports.createColors=L6;var FQ=RZ.exports,PQ={},OQ=Object.freeze(Object.defineProperty({__proto__:null,default:PQ},Symbol.toStringTag,{value:"Module"})),G0=DQ(OQ),z9=FQ,H9=G0,cJ=class X extends Error{constructor(J,Z,Q,Y,q,G){super(J);if(this.name="CssSyntaxError",this.reason=J,q)this.file=q;if(Y)this.source=Y;if(G)this.plugin=G;if(typeof Z<"u"&&typeof Q<"u")if(typeof Z==="number")this.line=Z,this.column=Q;else this.line=Z.line,this.column=Z.column,this.endLine=Q.line,this.endColumn=Q.column;if(this.setMessage(),Error.captureStackTrace)Error.captureStackTrace(this,X)}setMessage(){if(this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u")this.message+=":"+this.line+":"+this.column;this.message+=": "+this.reason}showSourceCode(J){if(!this.source)return"";let Z=this.source;if(J==null)J=z9.isColorSupported;if(H9){if(J)Z=H9(Z)}let Q=Z.split(/\r?\n/),Y=Math.max(this.line-3,0),q=Math.min(this.line+2,Q.length),G=String(q).length,V,K;if(J){let{bold:W,gray:j,red:U}=z9.createColors(!0);V=(z)=>W(U(z)),K=(z)=>j(z)}else V=K=(W)=>W;return Q.slice(Y,q).map((W,j)=>{let U=Y+1+j,z=" "+(" "+U).slice(-G)+" | ";if(U===this.line){let H=K(z.replace(/\d/g," "))+W.slice(0,this.column-1).replace(/[^\t]/g," ");return V(">")+K(z)+W+`
|
|
2
|
+
`+H+V("^")}return" "+K(z)+W}).join(`
|
|
3
|
+
`)}toString(){let J=this.showSourceCode();if(J)J=`
|
|
4
|
+
|
|
5
|
+
`+J+`
|
|
6
|
+
`;return this.name+": "+this.message+J}},EZ=cJ;cJ.default=cJ;var B1={};B1.isClean=Symbol("isClean");B1.my=Symbol("my");var L9={after:`
|
|
7
|
+
`,beforeClose:`
|
|
8
|
+
`,beforeComment:`
|
|
9
|
+
`,beforeDecl:`
|
|
10
|
+
`,beforeOpen:" ",beforeRule:`
|
|
11
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function AQ(X){return X[0].toUpperCase()+X.slice(1)}var lJ=class{constructor(J){this.builder=J}atrule(J,Z){let Q="@"+J.name,Y=J.params?this.rawValue(J,"params"):"";if(typeof J.raws.afterName<"u")Q+=J.raws.afterName;else if(Y)Q+=" ";if(J.nodes)this.block(J,Q+Y);else{let q=(J.raws.between||"")+(Z?";":"");this.builder(Q+Y+q,J)}}beforeAfter(J,Z){let Q;if(J.type==="decl")Q=this.raw(J,null,"beforeDecl");else if(J.type==="comment")Q=this.raw(J,null,"beforeComment");else if(Z==="before")Q=this.raw(J,null,"beforeRule");else Q=this.raw(J,null,"beforeClose");let Y=J.parent,q=0;while(Y&&Y.type!=="root")q+=1,Y=Y.parent;if(Q.includes(`
|
|
12
|
+
`)){let G=this.raw(J,null,"indent");if(G.length)for(let V=0;V<q;V++)Q+=G}return Q}block(J,Z){let Q=this.raw(J,"between","beforeOpen");this.builder(Z+Q+"{",J,"start");let Y;if(J.nodes&&J.nodes.length)this.body(J),Y=this.raw(J,"after");else Y=this.raw(J,"after","emptyBody");if(Y)this.builder(Y);this.builder("}",J,"end")}body(J){let Z=J.nodes.length-1;while(Z>0){if(J.nodes[Z].type!=="comment")break;Z-=1}let Q=this.raw(J,"semicolon");for(let Y=0;Y<J.nodes.length;Y++){let q=J.nodes[Y],G=this.raw(q,"before");if(G)this.builder(G);this.stringify(q,Z!==Y||Q)}}comment(J){let Z=this.raw(J,"left","commentLeft"),Q=this.raw(J,"right","commentRight");this.builder("/*"+Z+J.text+Q+"*/",J)}decl(J,Z){let Q=this.raw(J,"between","colon"),Y=J.prop+Q+this.rawValue(J,"value");if(J.important)Y+=J.raws.important||" !important";if(Z)Y+=";";this.builder(Y,J)}document(J){this.body(J)}raw(J,Z,Q){let Y;if(!Q)Q=Z;if(Z){if(Y=J.raws[Z],typeof Y<"u")return Y}let q=J.parent;if(Q==="before"){if(!q||q.type==="root"&&q.first===J)return"";if(q&&q.type==="document")return""}if(!q)return L9[Q];let G=J.root();if(!G.rawCache)G.rawCache={};if(typeof G.rawCache[Q]<"u")return G.rawCache[Q];if(Q==="before"||Q==="after")return this.beforeAfter(J,Q);else{let V="raw"+AQ(Q);if(this[V])Y=this[V](G,J);else G.walk((K)=>{if(Y=K.raws[Z],typeof Y<"u")return!1})}if(typeof Y>"u")Y=L9[Q];return G.rawCache[Q]=Y,Y}rawBeforeClose(J){let Z;if(J.walk((Q)=>{if(Q.nodes&&Q.nodes.length>0){if(typeof Q.raws.after<"u"){if(Z=Q.raws.after,Z.includes(`
|
|
13
|
+
`))Z=Z.replace(/[^\n]+$/,"");return!1}}}),Z)Z=Z.replace(/\S/g,"");return Z}rawBeforeComment(J,Z){let Q;if(J.walkComments((Y)=>{if(typeof Y.raws.before<"u"){if(Q=Y.raws.before,Q.includes(`
|
|
14
|
+
`))Q=Q.replace(/[^\n]+$/,"");return!1}}),typeof Q>"u")Q=this.raw(Z,null,"beforeDecl");else if(Q)Q=Q.replace(/\S/g,"");return Q}rawBeforeDecl(J,Z){let Q;if(J.walkDecls((Y)=>{if(typeof Y.raws.before<"u"){if(Q=Y.raws.before,Q.includes(`
|
|
15
|
+
`))Q=Q.replace(/[^\n]+$/,"");return!1}}),typeof Q>"u")Q=this.raw(Z,null,"beforeRule");else if(Q)Q=Q.replace(/\S/g,"");return Q}rawBeforeOpen(J){let Z;return J.walk((Q)=>{if(Q.type!=="decl"){if(Z=Q.raws.between,typeof Z<"u")return!1}}),Z}rawBeforeRule(J){let Z;if(J.walk((Q)=>{if(Q.nodes&&(Q.parent!==J||J.first!==Q)){if(typeof Q.raws.before<"u"){if(Z=Q.raws.before,Z.includes(`
|
|
16
|
+
`))Z=Z.replace(/[^\n]+$/,"");return!1}}}),Z)Z=Z.replace(/\S/g,"");return Z}rawColon(J){let Z;return J.walkDecls((Q)=>{if(typeof Q.raws.between<"u")return Z=Q.raws.between.replace(/[^\s:]/g,""),!1}),Z}rawEmptyBody(J){let Z;return J.walk((Q)=>{if(Q.nodes&&Q.nodes.length===0){if(Z=Q.raws.after,typeof Z<"u")return!1}}),Z}rawIndent(J){if(J.raws.indent)return J.raws.indent;let Z;return J.walk((Q)=>{let Y=Q.parent;if(Y&&Y!==J&&Y.parent&&Y.parent===J){if(typeof Q.raws.before<"u"){let q=Q.raws.before.split(`
|
|
17
|
+
`);return Z=q[q.length-1],Z=Z.replace(/\S/g,""),!1}}}),Z}rawSemicolon(J){let Z;return J.walk((Q)=>{if(Q.nodes&&Q.nodes.length&&Q.last.type==="decl"){if(Z=Q.raws.semicolon,typeof Z<"u")return!1}}),Z}rawValue(J,Z){let Q=J[Z],Y=J.raws[Z];if(Y&&Y.value===Q)return Y.raw;return Q}root(J){if(this.body(J),J.raws.after)this.builder(J.raws.after)}rule(J){if(this.block(J,this.rawValue(J,"selector")),J.raws.ownSemicolon)this.builder(J.raws.ownSemicolon,J,"end")}stringify(J,Z){if(!this[J.type])throw Error("Unknown AST node type "+J.type+". Maybe you need to change PostCSS stringifier.");this[J.type](J,Z)}},D6=lJ;lJ.default=lJ;var MQ=D6;function dJ(X,J){new MQ(J).stringify(X)}var BJ=dJ;dJ.default=dJ;var{isClean:C1,my:wQ}=B1,_Q=EZ,CQ=D6,$Q=BJ;function iJ(X,J){let Z=new X.constructor;for(let Q in X){if(!Object.prototype.hasOwnProperty.call(X,Q))continue;if(Q==="proxyCache")continue;let Y=X[Q],q=typeof Y;if(Q==="parent"&&q==="object"){if(J)Z[Q]=J}else if(Q==="source")Z[Q]=Y;else if(Array.isArray(Y))Z[Q]=Y.map((G)=>iJ(G,Z));else{if(q==="object"&&Y!==null)Y=iJ(Y);Z[Q]=Y}}return Z}var sJ=class{constructor(J={}){this.raws={},this[C1]=!1,this[wQ]=!0;for(let Z in J)if(Z==="nodes"){this.nodes=[];for(let Q of J[Z])if(typeof Q.clone==="function")this.append(Q.clone());else this.append(Q)}else this[Z]=J[Z]}addToError(J){if(J.postcssNode=this,J.stack&&this.source&&/\n\s{4}at /.test(J.stack)){let Z=this.source;J.stack=J.stack.replace(/\n\s{4}at /,`$&${Z.input.from}:${Z.start.line}:${Z.start.column}$&`)}return J}after(J){return this.parent.insertAfter(this,J),this}assign(J={}){for(let Z in J)this[Z]=J[Z];return this}before(J){return this.parent.insertBefore(this,J),this}cleanRaws(J){if(delete this.raws.before,delete this.raws.after,!J)delete this.raws.between}clone(J={}){let Z=iJ(this);for(let Q in J)Z[Q]=J[Q];return Z}cloneAfter(J={}){let Z=this.clone(J);return this.parent.insertAfter(this,Z),Z}cloneBefore(J={}){let Z=this.clone(J);return this.parent.insertBefore(this,Z),Z}error(J,Z={}){if(this.source){let{end:Q,start:Y}=this.rangeBy(Z);return this.source.input.error(J,{column:Y.column,line:Y.line},{column:Q.column,line:Q.line},Z)}return new _Q(J)}getProxyProcessor(){return{get(J,Z){if(Z==="proxyOf")return J;else if(Z==="root")return()=>J.root().toProxy();else return J[Z]},set(J,Z,Q){if(J[Z]===Q)return!0;if(J[Z]=Q,Z==="prop"||Z==="value"||Z==="name"||Z==="params"||Z==="important"||Z==="text")J.markDirty();return!0}}}markDirty(){if(this[C1]){this[C1]=!1;let J=this;while(J=J.parent)J[C1]=!1}}next(){if(!this.parent)return;let J=this.parent.index(this);return this.parent.nodes[J+1]}positionBy(J,Z){let Q=this.source.start;if(J.index)Q=this.positionInside(J.index,Z);else if(J.word){Z=this.toString();let Y=Z.indexOf(J.word);if(Y!==-1)Q=this.positionInside(Y,Z)}return Q}positionInside(J,Z){let Q=Z||this.toString(),Y=this.source.start.column,q=this.source.start.line;for(let G=0;G<J;G++)if(Q[G]===`
|
|
18
|
+
`)Y=1,q+=1;else Y+=1;return{column:Y,line:q}}prev(){if(!this.parent)return;let J=this.parent.index(this);return this.parent.nodes[J-1]}rangeBy(J){let Z={column:this.source.start.column,line:this.source.start.line},Q=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:Z.column+1,line:Z.line};if(J.word){let Y=this.toString(),q=Y.indexOf(J.word);if(q!==-1)Z=this.positionInside(q,Y),Q=this.positionInside(q+J.word.length,Y)}else{if(J.start)Z={column:J.start.column,line:J.start.line};else if(J.index)Z=this.positionInside(J.index);if(J.end)Q={column:J.end.column,line:J.end.line};else if(typeof J.endIndex==="number")Q=this.positionInside(J.endIndex);else if(J.index)Q=this.positionInside(J.index+1)}if(Q.line<Z.line||Q.line===Z.line&&Q.column<=Z.column)Q={column:Z.column+1,line:Z.line};return{end:Q,start:Z}}raw(J,Z){return new CQ().raw(this,J,Z)}remove(){if(this.parent)this.parent.removeChild(this);return this.parent=void 0,this}replaceWith(...J){if(this.parent){let Z=this,Q=!1;for(let Y of J)if(Y===this)Q=!0;else if(Q)this.parent.insertAfter(Z,Y),Z=Y;else this.parent.insertBefore(Z,Y);if(!Q)this.remove()}return this}root(){let J=this;while(J.parent&&J.parent.type!=="document")J=J.parent;return J}toJSON(J,Z){let Q={},Y=Z==null;Z=Z||new Map;let q=0;for(let G in this){if(!Object.prototype.hasOwnProperty.call(this,G))continue;if(G==="parent"||G==="proxyCache")continue;let V=this[G];if(Array.isArray(V))Q[G]=V.map((K)=>{if(typeof K==="object"&&K.toJSON)return K.toJSON(null,Z);else return K});else if(typeof V==="object"&&V.toJSON)Q[G]=V.toJSON(null,Z);else if(G==="source"){let K=Z.get(V.input);if(K==null)K=q,Z.set(V.input,q),q++;Q[G]={end:V.end,inputId:K,start:V.start}}else Q[G]=V}if(Y)Q.inputs=[...Z.keys()].map((G)=>G.toJSON());return Q}toProxy(){if(!this.proxyCache)this.proxyCache=new Proxy(this,this.getProxyProcessor());return this.proxyCache}toString(J=$Q){if(J.stringify)J=J.stringify;let Z="";return J(this,(Q)=>{Z+=Q}),Z}warn(J,Z,Q){let Y={node:this};for(let q in Q)Y[q]=Q[q];return J.warn(Z,Y)}get proxyOf(){return this}},zJ=sJ;sJ.default=sJ;var RQ=zJ,aJ=class extends RQ{constructor(J){if(J&&typeof J.value<"u"&&typeof J.value!=="string")J={...J,value:String(J.value)};super(J);this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}},HJ=aJ;aJ.default=aJ;var EQ="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",NQ=(X,J=21)=>{return(Z=J)=>{let Q="",Y=Z;while(Y--)Q+=X[Math.random()*X.length|0];return Q}},IQ=(X=21)=>{let J="",Z=X;while(Z--)J+=EQ[Math.random()*64|0];return J},SQ={nanoid:IQ,customAlphabet:NQ},{SourceMapConsumer:D9,SourceMapGenerator:F9}=G0,{existsSync:TQ,readFileSync:xQ}=G0,{dirname:SJ,join:fQ}=G0;function bQ(X){if(Buffer)return Buffer.from(X,"base64").toString();else return window.atob(X)}var rJ=class{constructor(J,Z){if(Z.map===!1)return;this.loadAnnotation(J),this.inline=this.startWith(this.annotation,"data:");let Q=Z.map?Z.map.prev:void 0,Y=this.loadMap(Z.from,Q);if(!this.mapFile&&Z.from)this.mapFile=Z.from;if(this.mapFile)this.root=SJ(this.mapFile);if(Y)this.text=Y}consumer(){if(!this.consumerCache)this.consumerCache=new D9(this.text);return this.consumerCache}decodeInline(J){let Z=/^data:application\/json;charset=utf-?8;base64,/,Q=/^data:application\/json;base64,/,Y=/^data:application\/json;charset=utf-?8,/,q=/^data:application\/json,/;if(Y.test(J)||q.test(J))return decodeURIComponent(J.substr(RegExp.lastMatch.length));if(Z.test(J)||Q.test(J))return bQ(J.substr(RegExp.lastMatch.length));let G=J.match(/data:application\/json;([^,]+),/)[1];throw Error("Unsupported source map encoding "+G)}getAnnotationURL(J){return J.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(J){if(typeof J!=="object")return!1;return typeof J.mappings==="string"||typeof J._mappings==="string"||Array.isArray(J.sections)}loadAnnotation(J){let Z=J.match(/\/\*\s*# sourceMappingURL=/gm);if(!Z)return;let Q=J.lastIndexOf(Z.pop()),Y=J.indexOf("*/",Q);if(Q>-1&&Y>-1)this.annotation=this.getAnnotationURL(J.substring(Q,Y))}loadFile(J){if(this.root=SJ(J),TQ(J))return this.mapFile=J,xQ(J,"utf-8").toString().trim()}loadMap(J,Z){if(Z===!1)return!1;if(Z)if(typeof Z==="string")return Z;else if(typeof Z==="function"){let Q=Z(J);if(Q){let Y=this.loadFile(Q);if(!Y)throw Error("Unable to load previous source map: "+Q.toString());return Y}}else if(Z instanceof D9)return F9.fromSourceMap(Z).toString();else if(Z instanceof F9)return Z.toString();else if(this.isMap(Z))return JSON.stringify(Z);else throw Error("Unsupported previous source map format: "+Z.toString());else if(this.inline)return this.decodeInline(this.annotation);else if(this.annotation){let Q=this.annotation;if(J)Q=fQ(SJ(J),Q);return this.loadFile(Q)}}startWith(J,Z){if(!J)return!1;return J.substr(0,Z.length)===Z}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},F6=rJ;rJ.default=rJ;var{SourceMapConsumer:kQ,SourceMapGenerator:vQ}=G0,{fileURLToPath:P9,pathToFileURL:$1}=G0,{isAbsolute:oJ,resolve:nJ}=G0,{nanoid:hQ}=SQ,TJ=G0,O9=EZ,yQ=F6,xJ=Symbol("fromOffsetCache"),gQ=Boolean(kQ&&vQ),A9=Boolean(nJ&&oJ),ZJ=class{constructor(J,Z={}){if(J===null||typeof J>"u"||typeof J==="object"&&!J.toString)throw Error(`PostCSS received ${J} instead of CSS string`);if(this.css=J.toString(),this.css[0]==="\uFEFF"||this.css[0]==="")this.hasBOM=!0,this.css=this.css.slice(1);else this.hasBOM=!1;if(Z.from)if(!A9||/^\w+:\/\//.test(Z.from)||oJ(Z.from))this.file=Z.from;else this.file=nJ(Z.from);if(A9&&gQ){let Q=new yQ(this.css,Z);if(Q.text){this.map=Q;let Y=Q.consumer().file;if(!this.file&&Y)this.file=this.mapResolve(Y)}}if(!this.file)this.id="<input css "+hQ(6)+">";if(this.map)this.map.file=this.from}error(J,Z,Q,Y={}){let q,G,V;if(Z&&typeof Z==="object"){let W=Z,j=Q;if(typeof W.offset==="number"){let U=this.fromOffset(W.offset);Z=U.line,Q=U.col}else Z=W.line,Q=W.column;if(typeof j.offset==="number"){let U=this.fromOffset(j.offset);G=U.line,V=U.col}else G=j.line,V=j.column}else if(!Q){let W=this.fromOffset(Z);Z=W.line,Q=W.col}let K=this.origin(Z,Q,G,V);if(K)q=new O9(J,K.endLine===void 0?K.line:{column:K.column,line:K.line},K.endLine===void 0?K.column:{column:K.endColumn,line:K.endLine},K.source,K.file,Y.plugin);else q=new O9(J,G===void 0?Z:{column:Q,line:Z},G===void 0?Q:{column:V,line:G},this.css,this.file,Y.plugin);if(q.input={column:Q,endColumn:V,endLine:G,line:Z,source:this.css},this.file){if($1)q.input.url=$1(this.file).toString();q.input.file=this.file}return q}fromOffset(J){let Z,Q;if(!this[xJ]){let q=this.css.split(`
|
|
19
|
+
`);Q=Array(q.length);let G=0;for(let V=0,K=q.length;V<K;V++)Q[V]=G,G+=q[V].length+1;this[xJ]=Q}else Q=this[xJ];Z=Q[Q.length-1];let Y=0;if(J>=Z)Y=Q.length-1;else{let q=Q.length-2,G;while(Y<q)if(G=Y+(q-Y>>1),J<Q[G])q=G-1;else if(J>=Q[G+1])Y=G+1;else{Y=G;break}}return{col:J-Q[Y]+1,line:Y+1}}mapResolve(J){if(/^\w+:\/\//.test(J))return J;return nJ(this.map.consumer().sourceRoot||this.map.root||".",J)}origin(J,Z,Q,Y){if(!this.map)return!1;let q=this.map.consumer(),G=q.originalPositionFor({column:Z,line:J});if(!G.source)return!1;let V;if(typeof Q==="number")V=q.originalPositionFor({column:Y,line:Q});let K;if(oJ(G.source))K=$1(G.source);else K=new URL(G.source,this.map.consumer().sourceRoot||$1(this.map.mapFile));let W={column:G.column,endColumn:V&&V.column,endLine:V&&V.line,line:G.line,url:K.toString()};if(K.protocol==="file:")if(P9)W.file=P9(K);else throw Error("file: protocol is not available in this PostCSS build");let j=q.sourceContentFor(G.source);if(j)W.source=j;return W}toJSON(){let J={};for(let Z of["hasBOM","css","file","id"])if(this[Z]!=null)J[Z]=this[Z];if(this.map){if(J.map={...this.map},J.map.consumerCache)J.map.consumerCache=void 0}return J}get from(){return this.file||this.id}},LJ=ZJ;ZJ.default=ZJ;if(TJ&&TJ.registerInput)TJ.registerInput(ZJ);var{SourceMapConsumer:P6,SourceMapGenerator:d1}=G0,{dirname:i1,relative:O6,resolve:A6,sep:M6}=G0,{pathToFileURL:M9}=G0,mQ=LJ,uQ=Boolean(P6&&d1),pQ=Boolean(i1&&A6&&O6&&M6),cQ=class{constructor(J,Z,Q,Y){this.stringify=J,this.mapOpts=Q.map||{},this.root=Z,this.opts=Q,this.css=Y,this.originalCSS=Y,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let J;if(this.isInline())J="data:application/json;base64,"+this.toBase64(this.map.toString());else if(typeof this.mapOpts.annotation==="string")J=this.mapOpts.annotation;else if(typeof this.mapOpts.annotation==="function")J=this.mapOpts.annotation(this.opts.to,this.root);else J=this.outputFile()+".map";let Z=`
|
|
20
|
+
`;if(this.css.includes(`\r
|
|
21
|
+
`))Z=`\r
|
|
22
|
+
`;this.css+=Z+"/*# sourceMappingURL="+J+" */"}applyPrevMaps(){for(let J of this.previous()){let Z=this.toUrl(this.path(J.file)),Q=J.root||i1(J.file),Y;if(this.mapOpts.sourcesContent===!1){if(Y=new P6(J.text),Y.sourcesContent)Y.sourcesContent=null}else Y=J.consumer();this.map.applySourceMap(Y,Z,this.toUrl(this.path(Q)))}}clearAnnotation(){if(this.mapOpts.annotation===!1)return;if(this.root){let J;for(let Z=this.root.nodes.length-1;Z>=0;Z--){if(J=this.root.nodes[Z],J.type!=="comment")continue;if(J.text.indexOf("# sourceMappingURL=")===0)this.root.removeChild(Z)}}else if(this.css)this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,"")}generate(){if(this.clearAnnotation(),pQ&&uQ&&this.isMap())return this.generateMap();else{let J="";return this.stringify(this.root,(Z)=>{J+=Z}),[J]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let J=this.previous()[0].consumer();J.file=this.outputFile(),this.map=d1.fromSourceMap(J,{ignoreInvalidMapping:!0})}else this.map=new d1({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>"});if(this.isSourcesContent())this.setSourcesContent();if(this.root&&this.previous().length>0)this.applyPrevMaps();if(this.isAnnotation())this.addAnnotation();if(this.isInline())return[this.css];else return[this.css,this.map]}generateString(){this.css="",this.map=new d1({file:this.outputFile(),ignoreInvalidMapping:!0});let J=1,Z=1,Q="<no source>",Y={generated:{column:0,line:0},original:{column:0,line:0},source:""},q,G;this.stringify(this.root,(V,K,W)=>{if(this.css+=V,K&&W!=="end")if(Y.generated.line=J,Y.generated.column=Z-1,K.source&&K.source.start)Y.source=this.sourcePath(K),Y.original.line=K.source.start.line,Y.original.column=K.source.start.column-1,this.map.addMapping(Y);else Y.source=Q,Y.original.line=1,Y.original.column=0,this.map.addMapping(Y);if(q=V.match(/\n/g),q)J+=q.length,G=V.lastIndexOf(`
|
|
23
|
+
`),Z=V.length-G;else Z+=V.length;if(K&&W!=="start"){let j=K.parent||{raws:{}};if(!(K.type==="decl"||K.type==="atrule"&&!K.nodes)||K!==j.last||j.raws.semicolon)if(K.source&&K.source.end)Y.source=this.sourcePath(K),Y.original.line=K.source.end.line,Y.original.column=K.source.end.column-1,Y.generated.line=J,Y.generated.column=Z-2,this.map.addMapping(Y);else Y.source=Q,Y.original.line=1,Y.original.column=0,Y.generated.line=J,Y.generated.column=Z-1,this.map.addMapping(Y)}})}isAnnotation(){if(this.isInline())return!0;if(typeof this.mapOpts.annotation<"u")return this.mapOpts.annotation;if(this.previous().length)return this.previous().some((J)=>J.annotation);return!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let J=this.mapOpts.annotation;if(typeof J<"u"&&J!==!0)return!1;if(this.previous().length)return this.previous().some((Z)=>Z.inline);return!0}isMap(){if(typeof this.opts.map<"u")return!!this.opts.map;return this.previous().length>0}isSourcesContent(){if(typeof this.mapOpts.sourcesContent<"u")return this.mapOpts.sourcesContent;if(this.previous().length)return this.previous().some((J)=>J.withContent());return!0}outputFile(){if(this.opts.to)return this.path(this.opts.to);else if(this.opts.from)return this.path(this.opts.from);else return"to.css"}path(J){if(this.mapOpts.absolute)return J;if(J.charCodeAt(0)===60)return J;if(/^\w+:\/\//.test(J))return J;let Z=this.memoizedPaths.get(J);if(Z)return Z;let Q=this.opts.to?i1(this.opts.to):".";if(typeof this.mapOpts.annotation==="string")Q=i1(A6(Q,this.mapOpts.annotation));let Y=O6(Q,J);return this.memoizedPaths.set(J,Y),Y}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((J)=>{if(J.source&&J.source.input.map){let Z=J.source.input.map;if(!this.previousMaps.includes(Z))this.previousMaps.push(Z)}});else{let J=new mQ(this.originalCSS,this.opts);if(J.map)this.previousMaps.push(J.map)}return this.previousMaps}setSourcesContent(){let J={};if(this.root)this.root.walk((Z)=>{if(Z.source){let Q=Z.source.input.from;if(Q&&!J[Q]){J[Q]=!0;let Y=this.usesFileUrls?this.toFileUrl(Q):this.toUrl(this.path(Q));this.map.setSourceContent(Y,Z.source.input.css)}}});else if(this.css){let Z=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(Z,this.css)}}sourcePath(J){if(this.mapOpts.from)return this.toUrl(this.mapOpts.from);else if(this.usesFileUrls)return this.toFileUrl(J.source.input.from);else return this.toUrl(this.path(J.source.input.from))}toBase64(J){if(Buffer)return Buffer.from(J).toString("base64");else return window.btoa(unescape(encodeURIComponent(J)))}toFileUrl(J){let Z=this.memoizedFileURLs.get(J);if(Z)return Z;if(M9){let Q=M9(J).toString();return this.memoizedFileURLs.set(J,Q),Q}else throw Error("`map.absolute` option is not available in this PostCSS build")}toUrl(J){let Z=this.memoizedURLs.get(J);if(Z)return Z;if(M6==="\\")J=J.replace(/\\/g,"/");let Q=encodeURI(J).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(J,Q),Q}},w6=cQ,lQ=zJ,tJ=class extends lQ{constructor(J){super(J);this.type="comment"}},DJ=tJ;tJ.default=tJ;var{isClean:_6,my:C6}=B1,$6=HJ,R6=DJ,dQ=zJ,E6,NZ,IZ,N6;function I6(X){return X.map((J)=>{if(J.nodes)J.nodes=I6(J.nodes);return delete J.source,J})}function S6(X){if(X[_6]=!1,X.proxyOf.nodes)for(let J of X.proxyOf.nodes)S6(J)}var H0=class X extends dQ{append(...J){for(let Z of J){let Q=this.normalize(Z,this.last);for(let Y of Q)this.proxyOf.nodes.push(Y)}return this.markDirty(),this}cleanRaws(J){if(super.cleanRaws(J),this.nodes)for(let Z of this.nodes)Z.cleanRaws(J)}each(J){if(!this.proxyOf.nodes)return;let Z=this.getIterator(),Q,Y;while(this.indexes[Z]<this.proxyOf.nodes.length){if(Q=this.indexes[Z],Y=J(this.proxyOf.nodes[Q],Q),Y===!1)break;this.indexes[Z]+=1}return delete this.indexes[Z],Y}every(J){return this.nodes.every(J)}getIterator(){if(!this.lastEach)this.lastEach=0;if(!this.indexes)this.indexes={};this.lastEach+=1;let J=this.lastEach;return this.indexes[J]=0,J}getProxyProcessor(){return{get(J,Z){if(Z==="proxyOf")return J;else if(!J[Z])return J[Z];else if(Z==="each"||typeof Z==="string"&&Z.startsWith("walk"))return(...Q)=>{return J[Z](...Q.map((Y)=>{if(typeof Y==="function")return(q,G)=>Y(q.toProxy(),G);else return Y}))};else if(Z==="every"||Z==="some")return(Q)=>{return J[Z]((Y,...q)=>Q(Y.toProxy(),...q))};else if(Z==="root")return()=>J.root().toProxy();else if(Z==="nodes")return J.nodes.map((Q)=>Q.toProxy());else if(Z==="first"||Z==="last")return J[Z].toProxy();else return J[Z]},set(J,Z,Q){if(J[Z]===Q)return!0;if(J[Z]=Q,Z==="name"||Z==="params"||Z==="selector")J.markDirty();return!0}}}index(J){if(typeof J==="number")return J;if(J.proxyOf)J=J.proxyOf;return this.proxyOf.nodes.indexOf(J)}insertAfter(J,Z){let Q=this.index(J),Y=this.normalize(Z,this.proxyOf.nodes[Q]).reverse();Q=this.index(J);for(let G of Y)this.proxyOf.nodes.splice(Q+1,0,G);let q;for(let G in this.indexes)if(q=this.indexes[G],Q<q)this.indexes[G]=q+Y.length;return this.markDirty(),this}insertBefore(J,Z){let Q=this.index(J),Y=Q===0?"prepend":!1,q=this.normalize(Z,this.proxyOf.nodes[Q],Y).reverse();Q=this.index(J);for(let V of q)this.proxyOf.nodes.splice(Q,0,V);let G;for(let V in this.indexes)if(G=this.indexes[V],Q<=G)this.indexes[V]=G+q.length;return this.markDirty(),this}normalize(J,Z){if(typeof J==="string")J=I6(E6(J).nodes);else if(typeof J>"u")J=[];else if(Array.isArray(J)){J=J.slice(0);for(let Y of J)if(Y.parent)Y.parent.removeChild(Y,"ignore")}else if(J.type==="root"&&this.type!=="document"){J=J.nodes.slice(0);for(let Y of J)if(Y.parent)Y.parent.removeChild(Y,"ignore")}else if(J.type)J=[J];else if(J.prop){if(typeof J.value>"u")throw Error("Value field is missed in node creation");else if(typeof J.value!=="string")J.value=String(J.value);J=[new $6(J)]}else if(J.selector)J=[new NZ(J)];else if(J.name)J=[new IZ(J)];else if(J.text)J=[new R6(J)];else throw Error("Unknown node type in node creation");return J.map((Y)=>{if(!Y[C6])X.rebuild(Y);if(Y=Y.proxyOf,Y.parent)Y.parent.removeChild(Y);if(Y[_6])S6(Y);if(typeof Y.raws.before>"u"){if(Z&&typeof Z.raws.before<"u")Y.raws.before=Z.raws.before.replace(/\S/g,"")}return Y.parent=this.proxyOf,Y})}prepend(...J){J=J.reverse();for(let Z of J){let Q=this.normalize(Z,this.first,"prepend").reverse();for(let Y of Q)this.proxyOf.nodes.unshift(Y);for(let Y in this.indexes)this.indexes[Y]=this.indexes[Y]+Q.length}return this.markDirty(),this}push(J){return J.parent=this,this.proxyOf.nodes.push(J),this}removeAll(){for(let J of this.proxyOf.nodes)J.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(J){J=this.index(J),this.proxyOf.nodes[J].parent=void 0,this.proxyOf.nodes.splice(J,1);let Z;for(let Q in this.indexes)if(Z=this.indexes[Q],Z>=J)this.indexes[Q]=Z-1;return this.markDirty(),this}replaceValues(J,Z,Q){if(!Q)Q=Z,Z={};return this.walkDecls((Y)=>{if(Z.props&&!Z.props.includes(Y.prop))return;if(Z.fast&&!Y.value.includes(Z.fast))return;Y.value=Y.value.replace(J,Q)}),this.markDirty(),this}some(J){return this.nodes.some(J)}walk(J){return this.each((Z,Q)=>{let Y;try{Y=J(Z,Q)}catch(q){throw Z.addToError(q)}if(Y!==!1&&Z.walk)Y=Z.walk(J);return Y})}walkAtRules(J,Z){if(!Z)return Z=J,this.walk((Q,Y)=>{if(Q.type==="atrule")return Z(Q,Y)});if(J instanceof RegExp)return this.walk((Q,Y)=>{if(Q.type==="atrule"&&J.test(Q.name))return Z(Q,Y)});return this.walk((Q,Y)=>{if(Q.type==="atrule"&&Q.name===J)return Z(Q,Y)})}walkComments(J){return this.walk((Z,Q)=>{if(Z.type==="comment")return J(Z,Q)})}walkDecls(J,Z){if(!Z)return Z=J,this.walk((Q,Y)=>{if(Q.type==="decl")return Z(Q,Y)});if(J instanceof RegExp)return this.walk((Q,Y)=>{if(Q.type==="decl"&&J.test(Q.prop))return Z(Q,Y)});return this.walk((Q,Y)=>{if(Q.type==="decl"&&Q.prop===J)return Z(Q,Y)})}walkRules(J,Z){if(!Z)return Z=J,this.walk((Q,Y)=>{if(Q.type==="rule")return Z(Q,Y)});if(J instanceof RegExp)return this.walk((Q,Y)=>{if(Q.type==="rule"&&J.test(Q.selector))return Z(Q,Y)});return this.walk((Q,Y)=>{if(Q.type==="rule"&&Q.selector===J)return Z(Q,Y)})}get first(){if(!this.proxyOf.nodes)return;return this.proxyOf.nodes[0]}get last(){if(!this.proxyOf.nodes)return;return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};H0.registerParse=(X)=>{E6=X};H0.registerRule=(X)=>{NZ=X};H0.registerAtRule=(X)=>{IZ=X};H0.registerRoot=(X)=>{N6=X};var R0=H0;H0.default=H0;H0.rebuild=(X)=>{if(X.type==="atrule")Object.setPrototypeOf(X,IZ.prototype);else if(X.type==="rule")Object.setPrototypeOf(X,NZ.prototype);else if(X.type==="decl")Object.setPrototypeOf(X,$6.prototype);else if(X.type==="comment")Object.setPrototypeOf(X,R6.prototype);else if(X.type==="root")Object.setPrototypeOf(X,N6.prototype);if(X[C6]=!0,X.nodes)X.nodes.forEach((J)=>{H0.rebuild(J)})};var iQ=R0,T6,x6,Q1=class extends iQ{constructor(J){super({type:"document",...J});if(!this.nodes)this.nodes=[]}toResult(J={}){return new T6(new x6,this,J).stringify()}};Q1.registerLazyResult=(X)=>{T6=X};Q1.registerProcessor=(X)=>{x6=X};var SZ=Q1;Q1.default=Q1;var w9={},f6=function(J){if(w9[J])return;if(w9[J]=!0,typeof console<"u"&&console.warn)console.warn(J)},eJ=class{constructor(J,Z={}){if(this.type="warning",this.text=J,Z.node&&Z.node.source){let Q=Z.node.rangeBy(Z);this.line=Q.start.line,this.column=Q.start.column,this.endLine=Q.end.line,this.endColumn=Q.end.column}for(let Q in Z)this[Q]=Z[Q]}toString(){if(this.node)return this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message;if(this.plugin)return this.plugin+": "+this.text;return this.text}},b6=eJ;eJ.default=eJ;var sQ=b6,JZ=class{constructor(J,Z,Q){this.processor=J,this.messages=[],this.root=Z,this.opts=Q,this.css=void 0,this.map=void 0}toString(){return this.css}warn(J,Z={}){if(!Z.plugin){if(this.lastPlugin&&this.lastPlugin.postcssPlugin)Z.plugin=this.lastPlugin.postcssPlugin}let Q=new sQ(J,Z);return this.messages.push(Q),Q}warnings(){return this.messages.filter((J)=>J.type==="warning")}get content(){return this.css}},TZ=JZ;JZ.default=JZ;var fJ=39,_9=34,R1=92,C9=47,E1=10,r0=32,N1=12,I1=9,S1=13,aQ=91,rQ=93,oQ=40,nQ=41,tQ=123,eQ=125,JY=59,ZY=42,XY=58,QY=64,T1=/[\t\n\f\r "#'()/;[\\\]{}]/g,x1=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,YY=/.[\r\n"'(/\\]/,$9=/[\da-f]/i,qY=function(J,Z={}){let Q=J.css.valueOf(),Y=Z.ignoreErrors,q,G,V,K,W,j,U,z,H,D,L=Q.length,B=0,A=[],O=[];function F(){return B}function M(h){throw J.error("Unclosed "+h,B)}function T(){return O.length===0&&B>=L}function f(h){if(O.length)return O.pop();if(B>=L)return;let c=h?h.ignoreUnclosed:!1;switch(q=Q.charCodeAt(B),q){case E1:case r0:case I1:case S1:case N1:{G=B;do G+=1,q=Q.charCodeAt(G);while(q===r0||q===E1||q===I1||q===S1||q===N1);D=["space",Q.slice(B,G)],B=G-1;break}case aQ:case rQ:case tQ:case eQ:case XY:case JY:case nQ:{let a=String.fromCharCode(q);D=[a,a,B];break}case oQ:{if(z=A.length?A.pop()[1]:"",H=Q.charCodeAt(B+1),z==="url"&&H!==fJ&&H!==_9&&H!==r0&&H!==E1&&H!==I1&&H!==N1&&H!==S1){G=B;do{if(j=!1,G=Q.indexOf(")",G+1),G===-1)if(Y||c){G=B;break}else M("bracket");U=G;while(Q.charCodeAt(U-1)===R1)U-=1,j=!j}while(j);D=["brackets",Q.slice(B,G+1),B,G],B=G}else if(G=Q.indexOf(")",B+1),K=Q.slice(B,G+1),G===-1||YY.test(K))D=["(","(",B];else D=["brackets",K,B,G],B=G;break}case fJ:case _9:{V=q===fJ?"'":'"',G=B;do{if(j=!1,G=Q.indexOf(V,G+1),G===-1)if(Y||c){G=B+1;break}else M("string");U=G;while(Q.charCodeAt(U-1)===R1)U-=1,j=!j}while(j);D=["string",Q.slice(B,G+1),B,G],B=G;break}case QY:{if(T1.lastIndex=B+1,T1.test(Q),T1.lastIndex===0)G=Q.length-1;else G=T1.lastIndex-2;D=["at-word",Q.slice(B,G+1),B,G],B=G;break}case R1:{G=B,W=!0;while(Q.charCodeAt(G+1)===R1)G+=1,W=!W;if(q=Q.charCodeAt(G+1),W&&q!==C9&&q!==r0&&q!==E1&&q!==I1&&q!==S1&&q!==N1){if(G+=1,$9.test(Q.charAt(G))){while($9.test(Q.charAt(G+1)))G+=1;if(Q.charCodeAt(G+1)===r0)G+=1}}D=["word",Q.slice(B,G+1),B,G],B=G;break}default:{if(q===C9&&Q.charCodeAt(B+1)===ZY){if(G=Q.indexOf("*/",B+2)+1,G===0)if(Y||c)G=Q.length;else M("comment");D=["comment",Q.slice(B,G+1),B,G],B=G}else{if(x1.lastIndex=B+1,x1.test(Q),x1.lastIndex===0)G=Q.length-1;else G=x1.lastIndex-2;D=["word",Q.slice(B,G+1),B,G],A.push(D),B=G}break}}return B++,D}function l(h){O.push(h)}return{back:l,endOfFile:T,nextToken:f,position:F}},k6=R0,XJ=class extends k6{constructor(J){super(J);this.type="atrule"}append(...J){if(!this.proxyOf.nodes)this.nodes=[];return super.append(...J)}prepend(...J){if(!this.proxyOf.nodes)this.nodes=[];return super.prepend(...J)}},xZ=XJ;XJ.default=XJ;k6.registerAtRule(XJ);var v6=R0,h6,y6,y0=class extends v6{constructor(J){super(J);if(this.type="root",!this.nodes)this.nodes=[]}normalize(J,Z,Q){let Y=super.normalize(J);if(Z){if(Q==="prepend")if(this.nodes.length>1)Z.raws.before=this.nodes[1].raws.before;else delete Z.raws.before;else if(this.first!==Z)for(let q of Y)q.raws.before=Z.raws.before}return Y}removeChild(J,Z){let Q=this.index(J);if(!Z&&Q===0&&this.nodes.length>1)this.nodes[1].raws.before=this.nodes[Q].raws.before;return super.removeChild(J)}toResult(J={}){return new h6(new y6,this,J).stringify()}};y0.registerLazyResult=(X)=>{h6=X};y0.registerProcessor=(X)=>{y6=X};var z1=y0;y0.default=y0;v6.registerRoot(y0);var Y1={comma(X){return Y1.split(X,[","],!0)},space(X){let J=[" ",`
|
|
24
|
+
`,"\t"];return Y1.split(X,J)},split(X,J,Z){let Q=[],Y="",q=!1,G=0,V=!1,K="",W=!1;for(let j of X){if(W)W=!1;else if(j==="\\")W=!0;else if(V){if(j===K)V=!1}else if(j==='"'||j==="'")V=!0,K=j;else if(j==="(")G+=1;else if(j===")"){if(G>0)G-=1}else if(G===0){if(J.includes(j))q=!0}if(q){if(Y!=="")Q.push(Y.trim());Y="",q=!1}else Y+=j}if(Z||Y!=="")Q.push(Y.trim());return Q}},g6=Y1;Y1.default=Y1;var m6=R0,GY=g6,QJ=class extends m6{constructor(J){super(J);if(this.type="rule",!this.nodes)this.nodes=[]}get selectors(){return GY.comma(this.selector)}set selectors(J){let Z=this.selector?this.selector.match(/,\s*/):null,Q=Z?Z[0]:","+this.raw("between","beforeOpen");this.selector=J.join(Q)}},fZ=QJ;QJ.default=QJ;m6.registerRule(QJ);var KY=HJ,VY=qY,WY=DJ,jY=xZ,UY=z1,R9=fZ,E9={empty:!0,space:!0};function BY(X){for(let J=X.length-1;J>=0;J--){let Z=X[J],Q=Z[3]||Z[2];if(Q)return Q}}var zY=class{constructor(J){this.input=J,this.root=new UY,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:J,start:{column:1,line:1,offset:0}}}atrule(J){let Z=new jY;if(Z.name=J[1].slice(1),Z.name==="")this.unnamedAtrule(Z,J);this.init(Z,J[2]);let Q,Y,q,G=!1,V=!1,K=[],W=[];while(!this.tokenizer.endOfFile()){if(J=this.tokenizer.nextToken(),Q=J[0],Q==="("||Q==="[")W.push(Q==="("?")":"]");else if(Q==="{"&&W.length>0)W.push("}");else if(Q===W[W.length-1])W.pop();if(W.length===0)if(Q===";"){Z.source.end=this.getPosition(J[2]),Z.source.end.offset++,this.semicolon=!0;break}else if(Q==="{"){V=!0;break}else if(Q==="}"){if(K.length>0){q=K.length-1,Y=K[q];while(Y&&Y[0]==="space")Y=K[--q];if(Y)Z.source.end=this.getPosition(Y[3]||Y[2]),Z.source.end.offset++}this.end(J);break}else K.push(J);else K.push(J);if(this.tokenizer.endOfFile()){G=!0;break}}if(Z.raws.between=this.spacesAndCommentsFromEnd(K),K.length){if(Z.raws.afterName=this.spacesAndCommentsFromStart(K),this.raw(Z,"params",K),G)J=K[K.length-1],Z.source.end=this.getPosition(J[3]||J[2]),Z.source.end.offset++,this.spaces=Z.raws.between,Z.raws.between=""}else Z.raws.afterName="",Z.params="";if(V)Z.nodes=[],this.current=Z}checkMissedSemicolon(J){let Z=this.colon(J);if(Z===!1)return;let Q=0,Y;for(let q=Z-1;q>=0;q--)if(Y=J[q],Y[0]!=="space"){if(Q+=1,Q===2)break}throw this.input.error("Missed semicolon",Y[0]==="word"?Y[3]+1:Y[2])}colon(J){let Z=0,Q,Y,q;for(let[G,V]of J.entries()){if(Q=V,Y=Q[0],Y==="(")Z+=1;if(Y===")")Z-=1;if(Z===0&&Y===":")if(!q)this.doubleColon(Q);else if(q[0]==="word"&&q[1]==="progid")continue;else return G;q=Q}return!1}comment(J){let Z=new WY;this.init(Z,J[2]),Z.source.end=this.getPosition(J[3]||J[2]),Z.source.end.offset++;let Q=J[1].slice(2,-2);if(/^\s*$/.test(Q))Z.text="",Z.raws.left=Q,Z.raws.right="";else{let Y=Q.match(/^(\s*)([^]*\S)(\s*)$/);Z.text=Y[2],Z.raws.left=Y[1],Z.raws.right=Y[3]}}createTokenizer(){this.tokenizer=VY(this.input)}decl(J,Z){let Q=new KY;this.init(Q,J[0][2]);let Y=J[J.length-1];if(Y[0]===";")this.semicolon=!0,J.pop();Q.source.end=this.getPosition(Y[3]||Y[2]||BY(J)),Q.source.end.offset++;while(J[0][0]!=="word"){if(J.length===1)this.unknownWord(J);Q.raws.before+=J.shift()[1]}Q.source.start=this.getPosition(J[0][2]),Q.prop="";while(J.length){let W=J[0][0];if(W===":"||W==="space"||W==="comment")break;Q.prop+=J.shift()[1]}Q.raws.between="";let q;while(J.length)if(q=J.shift(),q[0]===":"){Q.raws.between+=q[1];break}else{if(q[0]==="word"&&/\w/.test(q[1]))this.unknownWord([q]);Q.raws.between+=q[1]}if(Q.prop[0]==="_"||Q.prop[0]==="*")Q.raws.before+=Q.prop[0],Q.prop=Q.prop.slice(1);let G=[],V;while(J.length){if(V=J[0][0],V!=="space"&&V!=="comment")break;G.push(J.shift())}this.precheckMissedSemicolon(J);for(let W=J.length-1;W>=0;W--){if(q=J[W],q[1].toLowerCase()==="!important"){Q.important=!0;let j=this.stringFrom(J,W);if(j=this.spacesFromEnd(J)+j,j!==" !important")Q.raws.important=j;break}else if(q[1].toLowerCase()==="important"){let j=J.slice(0),U="";for(let z=W;z>0;z--){let H=j[z][0];if(U.trim().indexOf("!")===0&&H!=="space")break;U=j.pop()[1]+U}if(U.trim().indexOf("!")===0)Q.important=!0,Q.raws.important=U,J=j}if(q[0]!=="space"&&q[0]!=="comment")break}if(J.some((W)=>W[0]!=="space"&&W[0]!=="comment"))Q.raws.between+=G.map((W)=>W[1]).join(""),G=[];if(this.raw(Q,"value",G.concat(J),Z),Q.value.includes(":")&&!Z)this.checkMissedSemicolon(J)}doubleColon(J){throw this.input.error("Double colon",{offset:J[2]},{offset:J[2]+J[1].length})}emptyRule(J){let Z=new R9;this.init(Z,J[2]),Z.selector="",Z.raws.between="",this.current=Z}end(J){if(this.current.nodes&&this.current.nodes.length)this.current.raws.semicolon=this.semicolon;if(this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent)this.current.source.end=this.getPosition(J[2]),this.current.source.end.offset++,this.current=this.current.parent;else this.unexpectedClose(J)}endFile(){if(this.current.parent)this.unclosedBlock();if(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(J){if(this.spaces+=J[1],this.current.nodes){let Z=this.current.nodes[this.current.nodes.length-1];if(Z&&Z.type==="rule"&&!Z.raws.ownSemicolon)Z.raws.ownSemicolon=this.spaces,this.spaces=""}}getPosition(J){let Z=this.input.fromOffset(J);return{column:Z.col,line:Z.line,offset:J}}init(J,Z){if(this.current.push(J),J.source={input:this.input,start:this.getPosition(Z)},J.raws.before=this.spaces,this.spaces="",J.type!=="comment")this.semicolon=!1}other(J){let Z=!1,Q=null,Y=!1,q=null,G=[],V=J[1].startsWith("--"),K=[],W=J;while(W){if(Q=W[0],K.push(W),Q==="("||Q==="["){if(!q)q=W;G.push(Q==="("?")":"]")}else if(V&&Y&&Q==="{"){if(!q)q=W;G.push("}")}else if(G.length===0){if(Q===";")if(Y){this.decl(K,V);return}else break;else if(Q==="{"){this.rule(K);return}else if(Q==="}"){this.tokenizer.back(K.pop()),Z=!0;break}else if(Q===":")Y=!0}else if(Q===G[G.length-1]){if(G.pop(),G.length===0)q=null}W=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile())Z=!0;if(G.length>0)this.unclosedBracket(q);if(Z&&Y){if(!V)while(K.length){if(W=K[K.length-1][0],W!=="space"&&W!=="comment")break;this.tokenizer.back(K.pop())}this.decl(K,V)}else this.unknownWord(K)}parse(){let J;while(!this.tokenizer.endOfFile())switch(J=this.tokenizer.nextToken(),J[0]){case"space":this.spaces+=J[1];break;case";":this.freeSemicolon(J);break;case"}":this.end(J);break;case"comment":this.comment(J);break;case"at-word":this.atrule(J);break;case"{":this.emptyRule(J);break;default:this.other(J);break}this.endFile()}precheckMissedSemicolon(){}raw(J,Z,Q,Y){let q,G,V=Q.length,K="",W=!0,j,U;for(let z=0;z<V;z+=1)if(q=Q[z],G=q[0],G==="space"&&z===V-1&&!Y)W=!1;else if(G==="comment")if(U=Q[z-1]?Q[z-1][0]:"empty",j=Q[z+1]?Q[z+1][0]:"empty",!E9[U]&&!E9[j])if(K.slice(-1)===",")W=!1;else K+=q[1];else W=!1;else K+=q[1];if(!W){let z=Q.reduce((H,D)=>H+D[1],"");J.raws[Z]={raw:z,value:K}}J[Z]=K}rule(J){J.pop();let Z=new R9;this.init(Z,J[0][2]),Z.raws.between=this.spacesAndCommentsFromEnd(J),this.raw(Z,"selector",J),this.current=Z}spacesAndCommentsFromEnd(J){let Z,Q="";while(J.length){if(Z=J[J.length-1][0],Z!=="space"&&Z!=="comment")break;Q=J.pop()[1]+Q}return Q}spacesAndCommentsFromStart(J){let Z,Q="";while(J.length){if(Z=J[0][0],Z!=="space"&&Z!=="comment")break;Q+=J.shift()[1]}return Q}spacesFromEnd(J){let Z,Q="";while(J.length){if(Z=J[J.length-1][0],Z!=="space")break;Q=J.pop()[1]+Q}return Q}stringFrom(J,Z){let Q="";for(let Y=Z;Y<J.length;Y++)Q+=J[Y][1];return J.splice(Z,J.length-Z),Q}unclosedBlock(){let J=this.current.source.start;throw this.input.error("Unclosed block",J.line,J.column)}unclosedBracket(J){throw this.input.error("Unclosed bracket",{offset:J[2]},{offset:J[2]+1})}unexpectedClose(J){throw this.input.error("Unexpected }",{offset:J[2]},{offset:J[2]+1})}unknownWord(J){throw this.input.error("Unknown word",{offset:J[0][2]},{offset:J[0][2]+J[0][1].length})}unnamedAtrule(J,Z){throw this.input.error("At-rule without name",{offset:Z[2]},{offset:Z[2]+Z[1].length})}},HY=zY,LY=R0,DY=HY,FY=LJ;function YJ(X,J){let Z=new FY(X,J),Q=new DY(Z);try{Q.parse()}catch(Y){if(Y.name==="CssSyntaxError"&&J&&J.from){if(/\.scss$/i.test(J.from))Y.message+=`
|
|
25
|
+
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`;else if(/\.sass/i.test(J.from))Y.message+=`
|
|
26
|
+
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`;else if(/\.less$/i.test(J.from))Y.message+=`
|
|
27
|
+
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`}throw Y}return Q.root}var bZ=YJ;YJ.default=YJ;LY.registerParse(YJ);var{isClean:j0,my:PY}=B1,OY=w6,AY=BJ,MY=R0,wY=SZ,_Y=f6,N9=TZ,CY=bZ,$Y=z1,RY={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},EY={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},NY={Once:!0,postcssPlugin:!0,prepare:!0},g0=0;function o0(X){return typeof X==="object"&&typeof X.then==="function"}function u6(X){let J=!1,Z=RY[X.type];if(X.type==="decl")J=X.prop.toLowerCase();else if(X.type==="atrule")J=X.name.toLowerCase();if(J&&X.append)return[Z,Z+"-"+J,g0,Z+"Exit",Z+"Exit-"+J];else if(J)return[Z,Z+"-"+J,Z+"Exit",Z+"Exit-"+J];else if(X.append)return[Z,g0,Z+"Exit"];else return[Z,Z+"Exit"]}function I9(X){let J;if(X.type==="document")J=["Document",g0,"DocumentExit"];else if(X.type==="root")J=["Root",g0,"RootExit"];else J=u6(X);return{eventIndex:0,events:J,iterator:0,node:X,visitorIndex:0,visitors:[]}}function ZZ(X){if(X[j0]=!1,X.nodes)X.nodes.forEach((J)=>ZZ(J));return X}var XZ={},m0=class X{constructor(J,Z,Q){this.stringified=!1,this.processed=!1;let Y;if(typeof Z==="object"&&Z!==null&&(Z.type==="root"||Z.type==="document"))Y=ZZ(Z);else if(Z instanceof X||Z instanceof N9){if(Y=ZZ(Z.root),Z.map){if(typeof Q.map>"u")Q.map={};if(!Q.map.inline)Q.map.inline=!1;Q.map.prev=Z.map}}else{let q=CY;if(Q.syntax)q=Q.syntax.parse;if(Q.parser)q=Q.parser;if(q.parse)q=q.parse;try{Y=q(Z,Q)}catch(G){this.processed=!0,this.error=G}if(Y&&!Y[PY])MY.rebuild(Y)}this.result=new N9(J,Y,Q),this.helpers={...XZ,postcss:XZ,result:this.result},this.plugins=this.processor.plugins.map((q)=>{if(typeof q==="object"&&q.prepare)return{...q,...q.prepare(this.result)};else return q})}async(){if(this.error)return Promise.reject(this.error);if(this.processed)return Promise.resolve(this.result);if(!this.processing)this.processing=this.runAsync();return this.processing}catch(J){return this.async().catch(J)}finally(J){return this.async().then(J,J)}getAsyncError(){throw Error("Use process(css).then(cb) to work with async plugins")}handleError(J,Z){let Q=this.result.lastPlugin;try{if(Z)Z.addToError(J);if(this.error=J,J.name==="CssSyntaxError"&&!J.plugin)J.plugin=Q.postcssPlugin,J.setMessage();else if(Q.postcssVersion){let{postcssPlugin:Y,postcssVersion:q}=Q,G=this.result.processor.version,V=q.split("."),K=G.split(".");if(V[0]!==K[0]||parseInt(V[1])>parseInt(K[1]))console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+G+", but "+Y+" uses "+q+". Perhaps this is the source of the error below.")}}catch(Y){if(console&&console.error)console.error(Y)}return J}prepareVisitors(){this.listeners={};let J=(Z,Q,Y)=>{if(!this.listeners[Q])this.listeners[Q]=[];this.listeners[Q].push([Z,Y])};for(let Z of this.plugins)if(typeof Z==="object")for(let Q in Z){if(!EY[Q]&&/^[A-Z]/.test(Q))throw Error(`Unknown event ${Q} in ${Z.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!NY[Q]){if(typeof Z[Q]==="object")for(let Y in Z[Q])if(Y==="*")J(Z,Q,Z[Q][Y]);else J(Z,Q+"-"+Y.toLowerCase(),Z[Q][Y]);else if(typeof Z[Q]==="function")J(Z,Q,Z[Q])}}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let J=0;J<this.plugins.length;J++){let Z=this.plugins[J],Q=this.runOnRoot(Z);if(o0(Q))try{await Q}catch(Y){throw this.handleError(Y)}}if(this.prepareVisitors(),this.hasListener){let J=this.result.root;while(!J[j0]){J[j0]=!0;let Z=[I9(J)];while(Z.length>0){let Q=this.visitTick(Z);if(o0(Q))try{await Q}catch(Y){let q=Z[Z.length-1].node;throw this.handleError(Y,q)}}}if(this.listeners.OnceExit)for(let[Z,Q]of this.listeners.OnceExit){this.result.lastPlugin=Z;try{if(J.type==="document"){let Y=J.nodes.map((q)=>Q(q,this.helpers));await Promise.all(Y)}else await Q(J,this.helpers)}catch(Y){throw this.handleError(Y)}}}return this.processed=!0,this.stringify()}runOnRoot(J){this.result.lastPlugin=J;try{if(typeof J==="object"&&J.Once){if(this.result.root.type==="document"){let Z=this.result.root.nodes.map((Q)=>J.Once(Q,this.helpers));if(o0(Z[0]))return Promise.all(Z);return Z}return J.Once(this.result.root,this.helpers)}else if(typeof J==="function")return J(this.result.root,this.result)}catch(Z){throw this.handleError(Z)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let J=this.result.opts,Z=AY;if(J.syntax)Z=J.syntax.stringify;if(J.stringifier)Z=J.stringifier;if(Z.stringify)Z=Z.stringify;let Y=new OY(Z,this.result.root,this.result.opts).generate();return this.result.css=Y[0],this.result.map=Y[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 J of this.plugins){let Z=this.runOnRoot(J);if(o0(Z))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let J=this.result.root;while(!J[j0])J[j0]=!0,this.walkSync(J);if(this.listeners.OnceExit)if(J.type==="document")for(let Z of J.nodes)this.visitSync(this.listeners.OnceExit,Z);else this.visitSync(this.listeners.OnceExit,J)}return this.result}then(J,Z){if(!("from"in this.opts))_Y("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.");return this.async().then(J,Z)}toString(){return this.css}visitSync(J,Z){for(let[Q,Y]of J){this.result.lastPlugin=Q;let q;try{q=Y(Z,this.helpers)}catch(G){throw this.handleError(G,Z.proxyOf)}if(Z.type!=="root"&&Z.type!=="document"&&!Z.parent)return!0;if(o0(q))throw this.getAsyncError()}}visitTick(J){let Z=J[J.length-1],{node:Q,visitors:Y}=Z;if(Q.type!=="root"&&Q.type!=="document"&&!Q.parent){J.pop();return}if(Y.length>0&&Z.visitorIndex<Y.length){let[G,V]=Y[Z.visitorIndex];if(Z.visitorIndex+=1,Z.visitorIndex===Y.length)Z.visitors=[],Z.visitorIndex=0;this.result.lastPlugin=G;try{return V(Q.toProxy(),this.helpers)}catch(K){throw this.handleError(K,Q)}}if(Z.iterator!==0){let G=Z.iterator,V;while(V=Q.nodes[Q.indexes[G]])if(Q.indexes[G]+=1,!V[j0]){V[j0]=!0,J.push(I9(V));return}Z.iterator=0,delete Q.indexes[G]}let q=Z.events;while(Z.eventIndex<q.length){let G=q[Z.eventIndex];if(Z.eventIndex+=1,G===g0){if(Q.nodes&&Q.nodes.length)Q[j0]=!0,Z.iterator=Q.getIterator();return}else if(this.listeners[G]){Z.visitors=this.listeners[G];return}}J.pop()}walkSync(J){J[j0]=!0;let Z=u6(J);for(let Q of Z)if(Q===g0){if(J.nodes)J.each((Y)=>{if(!Y[j0])this.walkSync(Y)})}else{let Y=this.listeners[Q];if(Y){if(this.visitSync(Y,J.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"}};m0.registerPostcss=(X)=>{XZ=X};var p6=m0;m0.default=m0;$Y.registerLazyResult(m0);wY.registerLazyResult(m0);var IY=w6,SY=BJ,TY=f6,xY=bZ,fY=TZ,QZ=class{constructor(J,Z,Q){Z=Z.toString(),this.stringified=!1,this._processor=J,this._css=Z,this._opts=Q,this._map=void 0;let Y,q=SY;this.result=new fY(this._processor,Y,this._opts),this.result.css=Z;let G=this;Object.defineProperty(this.result,"root",{get(){return G.root}});let V=new IY(q,Y,this._opts,Z);if(V.isMap()){let[K,W]=V.generate();if(K)this.result.css=K;if(W)this.result.map=W}else V.clearAnnotation(),this.result.css=V.css}async(){if(this.error)return Promise.reject(this.error);return Promise.resolve(this.result)}catch(J){return this.async().catch(J)}finally(J){return this.async().then(J,J)}sync(){if(this.error)throw this.error;return this.result}then(J,Z){if(!("from"in this._opts))TY("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.");return this.async().then(J,Z)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let J,Z=xY;try{J=Z(this._css,this._opts)}catch(Q){this.error=Q}if(this.error)throw this.error;else return this._root=J,J}get[Symbol.toStringTag](){return"NoWorkResult"}},bY=QZ;QZ.default=QZ;var kY=bY,vY=p6,hY=SZ,yY=z1,q1=class{constructor(J=[]){this.version="8.4.38",this.plugins=this.normalize(J)}normalize(J){let Z=[];for(let Q of J){if(Q.postcss===!0)Q=Q();else if(Q.postcss)Q=Q.postcss;if(typeof Q==="object"&&Array.isArray(Q.plugins))Z=Z.concat(Q.plugins);else if(typeof Q==="object"&&Q.postcssPlugin)Z.push(Q);else if(typeof Q==="function")Z.push(Q);else if(typeof Q==="object"&&(Q.parse||Q.stringify))throw 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.");else throw Error(Q+" is not a PostCSS plugin")}return Z}process(J,Z={}){if(!this.plugins.length&&!Z.parser&&!Z.stringifier&&!Z.syntax)return new kY(this,J,Z);else return new vY(this,J,Z)}use(J){return this.plugins=this.plugins.concat(this.normalize([J])),this}},gY=q1;q1.default=q1;yY.registerProcessor(q1);hY.registerProcessor(q1);var mY=HJ,uY=F6,pY=DJ,cY=xZ,lY=LJ,dY=z1,iY=fZ;function G1(X,J){if(Array.isArray(X))return X.map((Y)=>G1(Y));let{inputs:Z,...Q}=X;if(Z){J=[];for(let Y of Z){let q={...Y,__proto__:lY.prototype};if(q.map)q.map={...q.map,__proto__:uY.prototype};J.push(q)}}if(Q.nodes)Q.nodes=X.nodes.map((Y)=>G1(Y,J));if(Q.source){let{inputId:Y,...q}=Q.source;if(Q.source=q,Y!=null)Q.source.input=J[Y]}if(Q.type==="root")return new dY(Q);else if(Q.type==="decl")return new mY(Q);else if(Q.type==="rule")return new iY(Q);else if(Q.type==="comment")return new pY(Q);else if(Q.type==="atrule")return new cY(Q);else throw Error("Unknown node type: "+X.type)}var sY=G1;G1.default=G1;var aY=EZ,c6=HJ,rY=p6,oY=R0,kZ=gY,nY=BJ,tY=sY,l6=SZ,eY=b6,d6=DJ,i6=xZ,J7=TZ,Z7=LJ,X7=bZ,Q7=g6,s6=fZ,a6=z1,Y7=zJ;function I(...X){if(X.length===1&&Array.isArray(X[0]))X=X[0];return new kZ(X)}I.plugin=function(J,Z){let Q=!1;function Y(...G){if(console&&console.warn&&!Q){if(Q=!0,console.warn(J+`: postcss.plugin was deprecated. Migration guide:
|
|
28
|
+
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn"))console.warn(J+`: 里面 postcss.plugin 被弃用. 迁移指南:
|
|
29
|
+
https://www.w3ctech.com/topic/2226`)}let V=Z(...G);return V.postcssPlugin=J,V.postcssVersion=new kZ().version,V}let q;return Object.defineProperty(Y,"postcss",{get(){if(!q)q=Y();return q}}),Y.process=function(G,V,K){return I([Y(K)]).process(G,V)},Y};I.stringify=nY;I.parse=X7;I.fromJSON=tY;I.list=Q7;I.comment=(X)=>new d6(X);I.atRule=(X)=>new i6(X);I.decl=(X)=>new c6(X);I.rule=(X)=>new s6(X);I.root=(X)=>new a6(X);I.document=(X)=>new l6(X);I.CssSyntaxError=aY;I.Declaration=c6;I.Container=oY;I.Processor=kZ;I.Document=l6;I.Comment=d6;I.Warning=eY;I.AtRule=i6;I.Result=J7;I.Input=Z7;I.Rule=s6;I.Root=a6;I.Node=Y7;rY.registerPostcss(I);var q7=I;I.default=I;var y=LQ(q7);y.stringify;y.fromJSON;y.plugin;y.parse;y.list;y.document;y.comment;y.atRule;y.rule;y.decl;y.root;y.CssSyntaxError;y.Declaration;y.Container;y.Processor;y.Document;y.Comment;y.Warning;y.AtRule;y.Result;y.Input;y.Rule;y.Root;y.Node;var G7=Object.defineProperty,K7=(X,J,Z)=>(J in X)?G7(X,J,{enumerable:!0,configurable:!0,writable:!0,value:Z}):X[J]=Z,X0=(X,J,Z)=>K7(X,typeof J!=="symbol"?J+"":J,Z);function V7(X){return X&&X.__esModule&&Object.prototype.hasOwnProperty.call(X,"default")?X.default:X}function W7(X){if(X.__esModule)return X;var J=X.default;if(typeof J=="function"){var Z=function Q(){if(this instanceof Q)return Reflect.construct(J,arguments,this.constructor);return J.apply(this,arguments)};Z.prototype=J.prototype}else Z={};return Object.defineProperty(Z,"__esModule",{value:!0}),Object.keys(X).forEach(function(Q){var Y=Object.getOwnPropertyDescriptor(X,Q);Object.defineProperty(Z,Q,Y.get?Y:{enumerable:!0,get:function(){return X[Q]}})}),Z}var vZ={exports:{}},v=String,r6=function(){return{isColorSupported:!1,reset:v,bold:v,dim:v,italic:v,underline:v,inverse:v,hidden:v,strikethrough:v,black:v,red:v,green:v,yellow:v,blue:v,magenta:v,cyan:v,white:v,gray:v,bgBlack:v,bgRed:v,bgGreen:v,bgYellow:v,bgBlue:v,bgMagenta:v,bgCyan:v,bgWhite:v}};vZ.exports=r6();vZ.exports.createColors=r6;var j7=vZ.exports,U7={},B7=Object.freeze(Object.defineProperty({__proto__:null,default:U7},Symbol.toStringTag,{value:"Module"})),K0=W7(B7),S9=j7,T9=K0,YZ=class X extends Error{constructor(J,Z,Q,Y,q,G){super(J);if(this.name="CssSyntaxError",this.reason=J,q)this.file=q;if(Y)this.source=Y;if(G)this.plugin=G;if(typeof Z<"u"&&typeof Q<"u")if(typeof Z==="number")this.line=Z,this.column=Q;else this.line=Z.line,this.column=Z.column,this.endLine=Q.line,this.endColumn=Q.column;if(this.setMessage(),Error.captureStackTrace)Error.captureStackTrace(this,X)}setMessage(){if(this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u")this.message+=":"+this.line+":"+this.column;this.message+=": "+this.reason}showSourceCode(J){if(!this.source)return"";let Z=this.source;if(J==null)J=S9.isColorSupported;if(T9){if(J)Z=T9(Z)}let Q=Z.split(/\r?\n/),Y=Math.max(this.line-3,0),q=Math.min(this.line+2,Q.length),G=String(q).length,V,K;if(J){let{bold:W,gray:j,red:U}=S9.createColors(!0);V=(z)=>W(U(z)),K=(z)=>j(z)}else V=K=(W)=>W;return Q.slice(Y,q).map((W,j)=>{let U=Y+1+j,z=" "+(" "+U).slice(-G)+" | ";if(U===this.line){let H=K(z.replace(/\d/g," "))+W.slice(0,this.column-1).replace(/[^\t]/g," ");return V(">")+K(z)+W+`
|
|
30
|
+
`+H+V("^")}return" "+K(z)+W}).join(`
|
|
31
|
+
`)}toString(){let J=this.showSourceCode();if(J)J=`
|
|
32
|
+
|
|
33
|
+
`+J+`
|
|
34
|
+
`;return this.name+": "+this.message+J}},hZ=YZ;YZ.default=YZ;var H1={};H1.isClean=Symbol("isClean");H1.my=Symbol("my");var x9={after:`
|
|
35
|
+
`,beforeClose:`
|
|
36
|
+
`,beforeComment:`
|
|
37
|
+
`,beforeDecl:`
|
|
38
|
+
`,beforeOpen:" ",beforeRule:`
|
|
39
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function z7(X){return X[0].toUpperCase()+X.slice(1)}var qZ=class{constructor(J){this.builder=J}atrule(J,Z){let Q="@"+J.name,Y=J.params?this.rawValue(J,"params"):"";if(typeof J.raws.afterName<"u")Q+=J.raws.afterName;else if(Y)Q+=" ";if(J.nodes)this.block(J,Q+Y);else{let q=(J.raws.between||"")+(Z?";":"");this.builder(Q+Y+q,J)}}beforeAfter(J,Z){let Q;if(J.type==="decl")Q=this.raw(J,null,"beforeDecl");else if(J.type==="comment")Q=this.raw(J,null,"beforeComment");else if(Z==="before")Q=this.raw(J,null,"beforeRule");else Q=this.raw(J,null,"beforeClose");let Y=J.parent,q=0;while(Y&&Y.type!=="root")q+=1,Y=Y.parent;if(Q.includes(`
|
|
40
|
+
`)){let G=this.raw(J,null,"indent");if(G.length)for(let V=0;V<q;V++)Q+=G}return Q}block(J,Z){let Q=this.raw(J,"between","beforeOpen");this.builder(Z+Q+"{",J,"start");let Y;if(J.nodes&&J.nodes.length)this.body(J),Y=this.raw(J,"after");else Y=this.raw(J,"after","emptyBody");if(Y)this.builder(Y);this.builder("}",J,"end")}body(J){let Z=J.nodes.length-1;while(Z>0){if(J.nodes[Z].type!=="comment")break;Z-=1}let Q=this.raw(J,"semicolon");for(let Y=0;Y<J.nodes.length;Y++){let q=J.nodes[Y],G=this.raw(q,"before");if(G)this.builder(G);this.stringify(q,Z!==Y||Q)}}comment(J){let Z=this.raw(J,"left","commentLeft"),Q=this.raw(J,"right","commentRight");this.builder("/*"+Z+J.text+Q+"*/",J)}decl(J,Z){let Q=this.raw(J,"between","colon"),Y=J.prop+Q+this.rawValue(J,"value");if(J.important)Y+=J.raws.important||" !important";if(Z)Y+=";";this.builder(Y,J)}document(J){this.body(J)}raw(J,Z,Q){let Y;if(!Q)Q=Z;if(Z){if(Y=J.raws[Z],typeof Y<"u")return Y}let q=J.parent;if(Q==="before"){if(!q||q.type==="root"&&q.first===J)return"";if(q&&q.type==="document")return""}if(!q)return x9[Q];let G=J.root();if(!G.rawCache)G.rawCache={};if(typeof G.rawCache[Q]<"u")return G.rawCache[Q];if(Q==="before"||Q==="after")return this.beforeAfter(J,Q);else{let V="raw"+z7(Q);if(this[V])Y=this[V](G,J);else G.walk((K)=>{if(Y=K.raws[Z],typeof Y<"u")return!1})}if(typeof Y>"u")Y=x9[Q];return G.rawCache[Q]=Y,Y}rawBeforeClose(J){let Z;if(J.walk((Q)=>{if(Q.nodes&&Q.nodes.length>0){if(typeof Q.raws.after<"u"){if(Z=Q.raws.after,Z.includes(`
|
|
41
|
+
`))Z=Z.replace(/[^\n]+$/,"");return!1}}}),Z)Z=Z.replace(/\S/g,"");return Z}rawBeforeComment(J,Z){let Q;if(J.walkComments((Y)=>{if(typeof Y.raws.before<"u"){if(Q=Y.raws.before,Q.includes(`
|
|
42
|
+
`))Q=Q.replace(/[^\n]+$/,"");return!1}}),typeof Q>"u")Q=this.raw(Z,null,"beforeDecl");else if(Q)Q=Q.replace(/\S/g,"");return Q}rawBeforeDecl(J,Z){let Q;if(J.walkDecls((Y)=>{if(typeof Y.raws.before<"u"){if(Q=Y.raws.before,Q.includes(`
|
|
43
|
+
`))Q=Q.replace(/[^\n]+$/,"");return!1}}),typeof Q>"u")Q=this.raw(Z,null,"beforeRule");else if(Q)Q=Q.replace(/\S/g,"");return Q}rawBeforeOpen(J){let Z;return J.walk((Q)=>{if(Q.type!=="decl"){if(Z=Q.raws.between,typeof Z<"u")return!1}}),Z}rawBeforeRule(J){let Z;if(J.walk((Q)=>{if(Q.nodes&&(Q.parent!==J||J.first!==Q)){if(typeof Q.raws.before<"u"){if(Z=Q.raws.before,Z.includes(`
|
|
44
|
+
`))Z=Z.replace(/[^\n]+$/,"");return!1}}}),Z)Z=Z.replace(/\S/g,"");return Z}rawColon(J){let Z;return J.walkDecls((Q)=>{if(typeof Q.raws.between<"u")return Z=Q.raws.between.replace(/[^\s:]/g,""),!1}),Z}rawEmptyBody(J){let Z;return J.walk((Q)=>{if(Q.nodes&&Q.nodes.length===0){if(Z=Q.raws.after,typeof Z<"u")return!1}}),Z}rawIndent(J){if(J.raws.indent)return J.raws.indent;let Z;return J.walk((Q)=>{let Y=Q.parent;if(Y&&Y!==J&&Y.parent&&Y.parent===J){if(typeof Q.raws.before<"u"){let q=Q.raws.before.split(`
|
|
45
|
+
`);return Z=q[q.length-1],Z=Z.replace(/\S/g,""),!1}}}),Z}rawSemicolon(J){let Z;return J.walk((Q)=>{if(Q.nodes&&Q.nodes.length&&Q.last.type==="decl"){if(Z=Q.raws.semicolon,typeof Z<"u")return!1}}),Z}rawValue(J,Z){let Q=J[Z],Y=J.raws[Z];if(Y&&Y.value===Q)return Y.raw;return Q}root(J){if(this.body(J),J.raws.after)this.builder(J.raws.after)}rule(J){if(this.block(J,this.rawValue(J,"selector")),J.raws.ownSemicolon)this.builder(J.raws.ownSemicolon,J,"end")}stringify(J,Z){if(!this[J.type])throw Error("Unknown AST node type "+J.type+". Maybe you need to change PostCSS stringifier.");this[J.type](J,Z)}},o6=qZ;qZ.default=qZ;var H7=o6;function GZ(X,J){new H7(J).stringify(X)}var FJ=GZ;GZ.default=GZ;var{isClean:f1,my:L7}=H1,D7=hZ,F7=o6,P7=FJ;function KZ(X,J){let Z=new X.constructor;for(let Q in X){if(!Object.prototype.hasOwnProperty.call(X,Q))continue;if(Q==="proxyCache")continue;let Y=X[Q],q=typeof Y;if(Q==="parent"&&q==="object"){if(J)Z[Q]=J}else if(Q==="source")Z[Q]=Y;else if(Array.isArray(Y))Z[Q]=Y.map((G)=>KZ(G,Z));else{if(q==="object"&&Y!==null)Y=KZ(Y);Z[Q]=Y}}return Z}var VZ=class{constructor(J={}){this.raws={},this[f1]=!1,this[L7]=!0;for(let Z in J)if(Z==="nodes"){this.nodes=[];for(let Q of J[Z])if(typeof Q.clone==="function")this.append(Q.clone());else this.append(Q)}else this[Z]=J[Z]}addToError(J){if(J.postcssNode=this,J.stack&&this.source&&/\n\s{4}at /.test(J.stack)){let Z=this.source;J.stack=J.stack.replace(/\n\s{4}at /,`$&${Z.input.from}:${Z.start.line}:${Z.start.column}$&`)}return J}after(J){return this.parent.insertAfter(this,J),this}assign(J={}){for(let Z in J)this[Z]=J[Z];return this}before(J){return this.parent.insertBefore(this,J),this}cleanRaws(J){if(delete this.raws.before,delete this.raws.after,!J)delete this.raws.between}clone(J={}){let Z=KZ(this);for(let Q in J)Z[Q]=J[Q];return Z}cloneAfter(J={}){let Z=this.clone(J);return this.parent.insertAfter(this,Z),Z}cloneBefore(J={}){let Z=this.clone(J);return this.parent.insertBefore(this,Z),Z}error(J,Z={}){if(this.source){let{end:Q,start:Y}=this.rangeBy(Z);return this.source.input.error(J,{column:Y.column,line:Y.line},{column:Q.column,line:Q.line},Z)}return new D7(J)}getProxyProcessor(){return{get(J,Z){if(Z==="proxyOf")return J;else if(Z==="root")return()=>J.root().toProxy();else return J[Z]},set(J,Z,Q){if(J[Z]===Q)return!0;if(J[Z]=Q,Z==="prop"||Z==="value"||Z==="name"||Z==="params"||Z==="important"||Z==="text")J.markDirty();return!0}}}markDirty(){if(this[f1]){this[f1]=!1;let J=this;while(J=J.parent)J[f1]=!1}}next(){if(!this.parent)return;let J=this.parent.index(this);return this.parent.nodes[J+1]}positionBy(J,Z){let Q=this.source.start;if(J.index)Q=this.positionInside(J.index,Z);else if(J.word){Z=this.toString();let Y=Z.indexOf(J.word);if(Y!==-1)Q=this.positionInside(Y,Z)}return Q}positionInside(J,Z){let Q=Z||this.toString(),Y=this.source.start.column,q=this.source.start.line;for(let G=0;G<J;G++)if(Q[G]===`
|
|
46
|
+
`)Y=1,q+=1;else Y+=1;return{column:Y,line:q}}prev(){if(!this.parent)return;let J=this.parent.index(this);return this.parent.nodes[J-1]}rangeBy(J){let Z={column:this.source.start.column,line:this.source.start.line},Q=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:Z.column+1,line:Z.line};if(J.word){let Y=this.toString(),q=Y.indexOf(J.word);if(q!==-1)Z=this.positionInside(q,Y),Q=this.positionInside(q+J.word.length,Y)}else{if(J.start)Z={column:J.start.column,line:J.start.line};else if(J.index)Z=this.positionInside(J.index);if(J.end)Q={column:J.end.column,line:J.end.line};else if(typeof J.endIndex==="number")Q=this.positionInside(J.endIndex);else if(J.index)Q=this.positionInside(J.index+1)}if(Q.line<Z.line||Q.line===Z.line&&Q.column<=Z.column)Q={column:Z.column+1,line:Z.line};return{end:Q,start:Z}}raw(J,Z){return new F7().raw(this,J,Z)}remove(){if(this.parent)this.parent.removeChild(this);return this.parent=void 0,this}replaceWith(...J){if(this.parent){let Z=this,Q=!1;for(let Y of J)if(Y===this)Q=!0;else if(Q)this.parent.insertAfter(Z,Y),Z=Y;else this.parent.insertBefore(Z,Y);if(!Q)this.remove()}return this}root(){let J=this;while(J.parent&&J.parent.type!=="document")J=J.parent;return J}toJSON(J,Z){let Q={},Y=Z==null;Z=Z||new Map;let q=0;for(let G in this){if(!Object.prototype.hasOwnProperty.call(this,G))continue;if(G==="parent"||G==="proxyCache")continue;let V=this[G];if(Array.isArray(V))Q[G]=V.map((K)=>{if(typeof K==="object"&&K.toJSON)return K.toJSON(null,Z);else return K});else if(typeof V==="object"&&V.toJSON)Q[G]=V.toJSON(null,Z);else if(G==="source"){let K=Z.get(V.input);if(K==null)K=q,Z.set(V.input,q),q++;Q[G]={end:V.end,inputId:K,start:V.start}}else Q[G]=V}if(Y)Q.inputs=[...Z.keys()].map((G)=>G.toJSON());return Q}toProxy(){if(!this.proxyCache)this.proxyCache=new Proxy(this,this.getProxyProcessor());return this.proxyCache}toString(J=P7){if(J.stringify)J=J.stringify;let Z="";return J(this,(Q)=>{Z+=Q}),Z}warn(J,Z,Q){let Y={node:this};for(let q in Q)Y[q]=Q[q];return J.warn(Z,Y)}get proxyOf(){return this}},PJ=VZ;VZ.default=VZ;var O7=PJ,WZ=class extends O7{constructor(J){if(J&&typeof J.value<"u"&&typeof J.value!=="string")J={...J,value:String(J.value)};super(J);this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}},OJ=WZ;WZ.default=WZ;var A7="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",M7=(X,J=21)=>{return(Z=J)=>{let Q="",Y=Z;while(Y--)Q+=X[Math.random()*X.length|0];return Q}},w7=(X=21)=>{let J="",Z=X;while(Z--)J+=A7[Math.random()*64|0];return J},_7={nanoid:w7,customAlphabet:M7},{SourceMapConsumer:f9,SourceMapGenerator:b9}=K0,{existsSync:C7,readFileSync:$7}=K0,{dirname:bJ,join:R7}=K0;function E7(X){if(Buffer)return Buffer.from(X,"base64").toString();else return window.atob(X)}var jZ=class{constructor(J,Z){if(Z.map===!1)return;this.loadAnnotation(J),this.inline=this.startWith(this.annotation,"data:");let Q=Z.map?Z.map.prev:void 0,Y=this.loadMap(Z.from,Q);if(!this.mapFile&&Z.from)this.mapFile=Z.from;if(this.mapFile)this.root=bJ(this.mapFile);if(Y)this.text=Y}consumer(){if(!this.consumerCache)this.consumerCache=new f9(this.text);return this.consumerCache}decodeInline(J){let Z=/^data:application\/json;charset=utf-?8;base64,/,Q=/^data:application\/json;base64,/,Y=/^data:application\/json;charset=utf-?8,/,q=/^data:application\/json,/;if(Y.test(J)||q.test(J))return decodeURIComponent(J.substr(RegExp.lastMatch.length));if(Z.test(J)||Q.test(J))return E7(J.substr(RegExp.lastMatch.length));let G=J.match(/data:application\/json;([^,]+),/)[1];throw Error("Unsupported source map encoding "+G)}getAnnotationURL(J){return J.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(J){if(typeof J!=="object")return!1;return typeof J.mappings==="string"||typeof J._mappings==="string"||Array.isArray(J.sections)}loadAnnotation(J){let Z=J.match(/\/\*\s*# sourceMappingURL=/gm);if(!Z)return;let Q=J.lastIndexOf(Z.pop()),Y=J.indexOf("*/",Q);if(Q>-1&&Y>-1)this.annotation=this.getAnnotationURL(J.substring(Q,Y))}loadFile(J){if(this.root=bJ(J),C7(J))return this.mapFile=J,$7(J,"utf-8").toString().trim()}loadMap(J,Z){if(Z===!1)return!1;if(Z)if(typeof Z==="string")return Z;else if(typeof Z==="function"){let Q=Z(J);if(Q){let Y=this.loadFile(Q);if(!Y)throw Error("Unable to load previous source map: "+Q.toString());return Y}}else if(Z instanceof f9)return b9.fromSourceMap(Z).toString();else if(Z instanceof b9)return Z.toString();else if(this.isMap(Z))return JSON.stringify(Z);else throw Error("Unsupported previous source map format: "+Z.toString());else if(this.inline)return this.decodeInline(this.annotation);else if(this.annotation){let Q=this.annotation;if(J)Q=R7(bJ(J),Q);return this.loadFile(Q)}}startWith(J,Z){if(!J)return!1;return J.substr(0,Z.length)===Z}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},n6=jZ;jZ.default=jZ;var{SourceMapConsumer:N7,SourceMapGenerator:I7}=K0,{fileURLToPath:k9,pathToFileURL:b1}=K0,{isAbsolute:UZ,resolve:BZ}=K0,{nanoid:S7}=_7,kJ=K0,v9=hZ,T7=n6,vJ=Symbol("fromOffsetCache"),x7=Boolean(N7&&I7),h9=Boolean(BZ&&UZ),qJ=class{constructor(J,Z={}){if(J===null||typeof J>"u"||typeof J==="object"&&!J.toString)throw Error(`PostCSS received ${J} instead of CSS string`);if(this.css=J.toString(),this.css[0]==="\uFEFF"||this.css[0]==="")this.hasBOM=!0,this.css=this.css.slice(1);else this.hasBOM=!1;if(Z.from)if(!h9||/^\w+:\/\//.test(Z.from)||UZ(Z.from))this.file=Z.from;else this.file=BZ(Z.from);if(h9&&x7){let Q=new T7(this.css,Z);if(Q.text){this.map=Q;let Y=Q.consumer().file;if(!this.file&&Y)this.file=this.mapResolve(Y)}}if(!this.file)this.id="<input css "+S7(6)+">";if(this.map)this.map.file=this.from}error(J,Z,Q,Y={}){let q,G,V;if(Z&&typeof Z==="object"){let W=Z,j=Q;if(typeof W.offset==="number"){let U=this.fromOffset(W.offset);Z=U.line,Q=U.col}else Z=W.line,Q=W.column;if(typeof j.offset==="number"){let U=this.fromOffset(j.offset);G=U.line,V=U.col}else G=j.line,V=j.column}else if(!Q){let W=this.fromOffset(Z);Z=W.line,Q=W.col}let K=this.origin(Z,Q,G,V);if(K)q=new v9(J,K.endLine===void 0?K.line:{column:K.column,line:K.line},K.endLine===void 0?K.column:{column:K.endColumn,line:K.endLine},K.source,K.file,Y.plugin);else q=new v9(J,G===void 0?Z:{column:Q,line:Z},G===void 0?Q:{column:V,line:G},this.css,this.file,Y.plugin);if(q.input={column:Q,endColumn:V,endLine:G,line:Z,source:this.css},this.file){if(b1)q.input.url=b1(this.file).toString();q.input.file=this.file}return q}fromOffset(J){let Z,Q;if(!this[vJ]){let q=this.css.split(`
|
|
47
|
+
`);Q=Array(q.length);let G=0;for(let V=0,K=q.length;V<K;V++)Q[V]=G,G+=q[V].length+1;this[vJ]=Q}else Q=this[vJ];Z=Q[Q.length-1];let Y=0;if(J>=Z)Y=Q.length-1;else{let q=Q.length-2,G;while(Y<q)if(G=Y+(q-Y>>1),J<Q[G])q=G-1;else if(J>=Q[G+1])Y=G+1;else{Y=G;break}}return{col:J-Q[Y]+1,line:Y+1}}mapResolve(J){if(/^\w+:\/\//.test(J))return J;return BZ(this.map.consumer().sourceRoot||this.map.root||".",J)}origin(J,Z,Q,Y){if(!this.map)return!1;let q=this.map.consumer(),G=q.originalPositionFor({column:Z,line:J});if(!G.source)return!1;let V;if(typeof Q==="number")V=q.originalPositionFor({column:Y,line:Q});let K;if(UZ(G.source))K=b1(G.source);else K=new URL(G.source,this.map.consumer().sourceRoot||b1(this.map.mapFile));let W={column:G.column,endColumn:V&&V.column,endLine:V&&V.line,line:G.line,url:K.toString()};if(K.protocol==="file:")if(k9)W.file=k9(K);else throw Error("file: protocol is not available in this PostCSS build");let j=q.sourceContentFor(G.source);if(j)W.source=j;return W}toJSON(){let J={};for(let Z of["hasBOM","css","file","id"])if(this[Z]!=null)J[Z]=this[Z];if(this.map){if(J.map={...this.map},J.map.consumerCache)J.map.consumerCache=void 0}return J}get from(){return this.file||this.id}},AJ=qJ;qJ.default=qJ;if(kJ&&kJ.registerInput)kJ.registerInput(qJ);var{SourceMapConsumer:t6,SourceMapGenerator:s1}=K0,{dirname:a1,relative:e6,resolve:JX,sep:ZX}=K0,{pathToFileURL:y9}=K0,f7=AJ,b7=Boolean(t6&&s1),k7=Boolean(a1&&JX&&e6&&ZX),v7=class{constructor(J,Z,Q,Y){this.stringify=J,this.mapOpts=Q.map||{},this.root=Z,this.opts=Q,this.css=Y,this.originalCSS=Y,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let J;if(this.isInline())J="data:application/json;base64,"+this.toBase64(this.map.toString());else if(typeof this.mapOpts.annotation==="string")J=this.mapOpts.annotation;else if(typeof this.mapOpts.annotation==="function")J=this.mapOpts.annotation(this.opts.to,this.root);else J=this.outputFile()+".map";let Z=`
|
|
48
|
+
`;if(this.css.includes(`\r
|
|
49
|
+
`))Z=`\r
|
|
50
|
+
`;this.css+=Z+"/*# sourceMappingURL="+J+" */"}applyPrevMaps(){for(let J of this.previous()){let Z=this.toUrl(this.path(J.file)),Q=J.root||a1(J.file),Y;if(this.mapOpts.sourcesContent===!1){if(Y=new t6(J.text),Y.sourcesContent)Y.sourcesContent=null}else Y=J.consumer();this.map.applySourceMap(Y,Z,this.toUrl(this.path(Q)))}}clearAnnotation(){if(this.mapOpts.annotation===!1)return;if(this.root){let J;for(let Z=this.root.nodes.length-1;Z>=0;Z--){if(J=this.root.nodes[Z],J.type!=="comment")continue;if(J.text.indexOf("# sourceMappingURL=")===0)this.root.removeChild(Z)}}else if(this.css)this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,"")}generate(){if(this.clearAnnotation(),k7&&b7&&this.isMap())return this.generateMap();else{let J="";return this.stringify(this.root,(Z)=>{J+=Z}),[J]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let J=this.previous()[0].consumer();J.file=this.outputFile(),this.map=s1.fromSourceMap(J,{ignoreInvalidMapping:!0})}else this.map=new s1({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>"});if(this.isSourcesContent())this.setSourcesContent();if(this.root&&this.previous().length>0)this.applyPrevMaps();if(this.isAnnotation())this.addAnnotation();if(this.isInline())return[this.css];else return[this.css,this.map]}generateString(){this.css="",this.map=new s1({file:this.outputFile(),ignoreInvalidMapping:!0});let J=1,Z=1,Q="<no source>",Y={generated:{column:0,line:0},original:{column:0,line:0},source:""},q,G;this.stringify(this.root,(V,K,W)=>{if(this.css+=V,K&&W!=="end")if(Y.generated.line=J,Y.generated.column=Z-1,K.source&&K.source.start)Y.source=this.sourcePath(K),Y.original.line=K.source.start.line,Y.original.column=K.source.start.column-1,this.map.addMapping(Y);else Y.source=Q,Y.original.line=1,Y.original.column=0,this.map.addMapping(Y);if(q=V.match(/\n/g),q)J+=q.length,G=V.lastIndexOf(`
|
|
51
|
+
`),Z=V.length-G;else Z+=V.length;if(K&&W!=="start"){let j=K.parent||{raws:{}};if(!(K.type==="decl"||K.type==="atrule"&&!K.nodes)||K!==j.last||j.raws.semicolon)if(K.source&&K.source.end)Y.source=this.sourcePath(K),Y.original.line=K.source.end.line,Y.original.column=K.source.end.column-1,Y.generated.line=J,Y.generated.column=Z-2,this.map.addMapping(Y);else Y.source=Q,Y.original.line=1,Y.original.column=0,Y.generated.line=J,Y.generated.column=Z-1,this.map.addMapping(Y)}})}isAnnotation(){if(this.isInline())return!0;if(typeof this.mapOpts.annotation<"u")return this.mapOpts.annotation;if(this.previous().length)return this.previous().some((J)=>J.annotation);return!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let J=this.mapOpts.annotation;if(typeof J<"u"&&J!==!0)return!1;if(this.previous().length)return this.previous().some((Z)=>Z.inline);return!0}isMap(){if(typeof this.opts.map<"u")return!!this.opts.map;return this.previous().length>0}isSourcesContent(){if(typeof this.mapOpts.sourcesContent<"u")return this.mapOpts.sourcesContent;if(this.previous().length)return this.previous().some((J)=>J.withContent());return!0}outputFile(){if(this.opts.to)return this.path(this.opts.to);else if(this.opts.from)return this.path(this.opts.from);else return"to.css"}path(J){if(this.mapOpts.absolute)return J;if(J.charCodeAt(0)===60)return J;if(/^\w+:\/\//.test(J))return J;let Z=this.memoizedPaths.get(J);if(Z)return Z;let Q=this.opts.to?a1(this.opts.to):".";if(typeof this.mapOpts.annotation==="string")Q=a1(JX(Q,this.mapOpts.annotation));let Y=e6(Q,J);return this.memoizedPaths.set(J,Y),Y}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk((J)=>{if(J.source&&J.source.input.map){let Z=J.source.input.map;if(!this.previousMaps.includes(Z))this.previousMaps.push(Z)}});else{let J=new f7(this.originalCSS,this.opts);if(J.map)this.previousMaps.push(J.map)}return this.previousMaps}setSourcesContent(){let J={};if(this.root)this.root.walk((Z)=>{if(Z.source){let Q=Z.source.input.from;if(Q&&!J[Q]){J[Q]=!0;let Y=this.usesFileUrls?this.toFileUrl(Q):this.toUrl(this.path(Q));this.map.setSourceContent(Y,Z.source.input.css)}}});else if(this.css){let Z=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(Z,this.css)}}sourcePath(J){if(this.mapOpts.from)return this.toUrl(this.mapOpts.from);else if(this.usesFileUrls)return this.toFileUrl(J.source.input.from);else return this.toUrl(this.path(J.source.input.from))}toBase64(J){if(Buffer)return Buffer.from(J).toString("base64");else return window.btoa(unescape(encodeURIComponent(J)))}toFileUrl(J){let Z=this.memoizedFileURLs.get(J);if(Z)return Z;if(y9){let Q=y9(J).toString();return this.memoizedFileURLs.set(J,Q),Q}else throw Error("`map.absolute` option is not available in this PostCSS build")}toUrl(J){let Z=this.memoizedURLs.get(J);if(Z)return Z;if(ZX==="\\")J=J.replace(/\\/g,"/");let Q=encodeURI(J).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(J,Q),Q}},XX=v7,h7=PJ,zZ=class extends h7{constructor(J){super(J);this.type="comment"}},MJ=zZ;zZ.default=zZ;var{isClean:QX,my:YX}=H1,qX=OJ,GX=MJ,y7=PJ,KX,yZ,gZ,VX;function WX(X){return X.map((J)=>{if(J.nodes)J.nodes=WX(J.nodes);return delete J.source,J})}function jX(X){if(X[QX]=!1,X.proxyOf.nodes)for(let J of X.proxyOf.nodes)jX(J)}var L0=class X extends y7{append(...J){for(let Z of J){let Q=this.normalize(Z,this.last);for(let Y of Q)this.proxyOf.nodes.push(Y)}return this.markDirty(),this}cleanRaws(J){if(super.cleanRaws(J),this.nodes)for(let Z of this.nodes)Z.cleanRaws(J)}each(J){if(!this.proxyOf.nodes)return;let Z=this.getIterator(),Q,Y;while(this.indexes[Z]<this.proxyOf.nodes.length){if(Q=this.indexes[Z],Y=J(this.proxyOf.nodes[Q],Q),Y===!1)break;this.indexes[Z]+=1}return delete this.indexes[Z],Y}every(J){return this.nodes.every(J)}getIterator(){if(!this.lastEach)this.lastEach=0;if(!this.indexes)this.indexes={};this.lastEach+=1;let J=this.lastEach;return this.indexes[J]=0,J}getProxyProcessor(){return{get(J,Z){if(Z==="proxyOf")return J;else if(!J[Z])return J[Z];else if(Z==="each"||typeof Z==="string"&&Z.startsWith("walk"))return(...Q)=>{return J[Z](...Q.map((Y)=>{if(typeof Y==="function")return(q,G)=>Y(q.toProxy(),G);else return Y}))};else if(Z==="every"||Z==="some")return(Q)=>{return J[Z]((Y,...q)=>Q(Y.toProxy(),...q))};else if(Z==="root")return()=>J.root().toProxy();else if(Z==="nodes")return J.nodes.map((Q)=>Q.toProxy());else if(Z==="first"||Z==="last")return J[Z].toProxy();else return J[Z]},set(J,Z,Q){if(J[Z]===Q)return!0;if(J[Z]=Q,Z==="name"||Z==="params"||Z==="selector")J.markDirty();return!0}}}index(J){if(typeof J==="number")return J;if(J.proxyOf)J=J.proxyOf;return this.proxyOf.nodes.indexOf(J)}insertAfter(J,Z){let Q=this.index(J),Y=this.normalize(Z,this.proxyOf.nodes[Q]).reverse();Q=this.index(J);for(let G of Y)this.proxyOf.nodes.splice(Q+1,0,G);let q;for(let G in this.indexes)if(q=this.indexes[G],Q<q)this.indexes[G]=q+Y.length;return this.markDirty(),this}insertBefore(J,Z){let Q=this.index(J),Y=Q===0?"prepend":!1,q=this.normalize(Z,this.proxyOf.nodes[Q],Y).reverse();Q=this.index(J);for(let V of q)this.proxyOf.nodes.splice(Q,0,V);let G;for(let V in this.indexes)if(G=this.indexes[V],Q<=G)this.indexes[V]=G+q.length;return this.markDirty(),this}normalize(J,Z){if(typeof J==="string")J=WX(KX(J).nodes);else if(typeof J>"u")J=[];else if(Array.isArray(J)){J=J.slice(0);for(let Y of J)if(Y.parent)Y.parent.removeChild(Y,"ignore")}else if(J.type==="root"&&this.type!=="document"){J=J.nodes.slice(0);for(let Y of J)if(Y.parent)Y.parent.removeChild(Y,"ignore")}else if(J.type)J=[J];else if(J.prop){if(typeof J.value>"u")throw Error("Value field is missed in node creation");else if(typeof J.value!=="string")J.value=String(J.value);J=[new qX(J)]}else if(J.selector)J=[new yZ(J)];else if(J.name)J=[new gZ(J)];else if(J.text)J=[new GX(J)];else throw Error("Unknown node type in node creation");return J.map((Y)=>{if(!Y[YX])X.rebuild(Y);if(Y=Y.proxyOf,Y.parent)Y.parent.removeChild(Y);if(Y[QX])jX(Y);if(typeof Y.raws.before>"u"){if(Z&&typeof Z.raws.before<"u")Y.raws.before=Z.raws.before.replace(/\S/g,"")}return Y.parent=this.proxyOf,Y})}prepend(...J){J=J.reverse();for(let Z of J){let Q=this.normalize(Z,this.first,"prepend").reverse();for(let Y of Q)this.proxyOf.nodes.unshift(Y);for(let Y in this.indexes)this.indexes[Y]=this.indexes[Y]+Q.length}return this.markDirty(),this}push(J){return J.parent=this,this.proxyOf.nodes.push(J),this}removeAll(){for(let J of this.proxyOf.nodes)J.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(J){J=this.index(J),this.proxyOf.nodes[J].parent=void 0,this.proxyOf.nodes.splice(J,1);let Z;for(let Q in this.indexes)if(Z=this.indexes[Q],Z>=J)this.indexes[Q]=Z-1;return this.markDirty(),this}replaceValues(J,Z,Q){if(!Q)Q=Z,Z={};return this.walkDecls((Y)=>{if(Z.props&&!Z.props.includes(Y.prop))return;if(Z.fast&&!Y.value.includes(Z.fast))return;Y.value=Y.value.replace(J,Q)}),this.markDirty(),this}some(J){return this.nodes.some(J)}walk(J){return this.each((Z,Q)=>{let Y;try{Y=J(Z,Q)}catch(q){throw Z.addToError(q)}if(Y!==!1&&Z.walk)Y=Z.walk(J);return Y})}walkAtRules(J,Z){if(!Z)return Z=J,this.walk((Q,Y)=>{if(Q.type==="atrule")return Z(Q,Y)});if(J instanceof RegExp)return this.walk((Q,Y)=>{if(Q.type==="atrule"&&J.test(Q.name))return Z(Q,Y)});return this.walk((Q,Y)=>{if(Q.type==="atrule"&&Q.name===J)return Z(Q,Y)})}walkComments(J){return this.walk((Z,Q)=>{if(Z.type==="comment")return J(Z,Q)})}walkDecls(J,Z){if(!Z)return Z=J,this.walk((Q,Y)=>{if(Q.type==="decl")return Z(Q,Y)});if(J instanceof RegExp)return this.walk((Q,Y)=>{if(Q.type==="decl"&&J.test(Q.prop))return Z(Q,Y)});return this.walk((Q,Y)=>{if(Q.type==="decl"&&Q.prop===J)return Z(Q,Y)})}walkRules(J,Z){if(!Z)return Z=J,this.walk((Q,Y)=>{if(Q.type==="rule")return Z(Q,Y)});if(J instanceof RegExp)return this.walk((Q,Y)=>{if(Q.type==="rule"&&J.test(Q.selector))return Z(Q,Y)});return this.walk((Q,Y)=>{if(Q.type==="rule"&&Q.selector===J)return Z(Q,Y)})}get first(){if(!this.proxyOf.nodes)return;return this.proxyOf.nodes[0]}get last(){if(!this.proxyOf.nodes)return;return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};L0.registerParse=(X)=>{KX=X};L0.registerRule=(X)=>{yZ=X};L0.registerAtRule=(X)=>{gZ=X};L0.registerRoot=(X)=>{VX=X};var E0=L0;L0.default=L0;L0.rebuild=(X)=>{if(X.type==="atrule")Object.setPrototypeOf(X,gZ.prototype);else if(X.type==="rule")Object.setPrototypeOf(X,yZ.prototype);else if(X.type==="decl")Object.setPrototypeOf(X,qX.prototype);else if(X.type==="comment")Object.setPrototypeOf(X,GX.prototype);else if(X.type==="root")Object.setPrototypeOf(X,VX.prototype);if(X[YX]=!0,X.nodes)X.nodes.forEach((J)=>{L0.rebuild(J)})};var g7=E0,UX,BX,K1=class extends g7{constructor(J){super({type:"document",...J});if(!this.nodes)this.nodes=[]}toResult(J={}){return new UX(new BX,this,J).stringify()}};K1.registerLazyResult=(X)=>{UX=X};K1.registerProcessor=(X)=>{BX=X};var mZ=K1;K1.default=K1;var g9={},zX=function(J){if(g9[J])return;if(g9[J]=!0,typeof console<"u"&&console.warn)console.warn(J)},HZ=class{constructor(J,Z={}){if(this.type="warning",this.text=J,Z.node&&Z.node.source){let Q=Z.node.rangeBy(Z);this.line=Q.start.line,this.column=Q.start.column,this.endLine=Q.end.line,this.endColumn=Q.end.column}for(let Q in Z)this[Q]=Z[Q]}toString(){if(this.node)return this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message;if(this.plugin)return this.plugin+": "+this.text;return this.text}},HX=HZ;HZ.default=HZ;var m7=HX,LZ=class{constructor(J,Z,Q){this.processor=J,this.messages=[],this.root=Z,this.opts=Q,this.css=void 0,this.map=void 0}toString(){return this.css}warn(J,Z={}){if(!Z.plugin){if(this.lastPlugin&&this.lastPlugin.postcssPlugin)Z.plugin=this.lastPlugin.postcssPlugin}let Q=new m7(J,Z);return this.messages.push(Q),Q}warnings(){return this.messages.filter((J)=>J.type==="warning")}get content(){return this.css}},uZ=LZ;LZ.default=LZ;var hJ=39,m9=34,k1=92,u9=47,v1=10,n0=32,h1=12,y1=9,g1=13,u7=91,p7=93,c7=40,l7=41,d7=123,i7=125,s7=59,a7=42,r7=58,o7=64,m1=/[\t\n\f\r "#'()/;[\\\]{}]/g,u1=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,n7=/.[\r\n"'(/\\]/,p9=/[\da-f]/i,t7=function(J,Z={}){let Q=J.css.valueOf(),Y=Z.ignoreErrors,q,G,V,K,W,j,U,z,H,D,L=Q.length,B=0,A=[],O=[];function F(){return B}function M(h){throw J.error("Unclosed "+h,B)}function T(){return O.length===0&&B>=L}function f(h){if(O.length)return O.pop();if(B>=L)return;let c=h?h.ignoreUnclosed:!1;switch(q=Q.charCodeAt(B),q){case v1:case n0:case y1:case g1:case h1:{G=B;do G+=1,q=Q.charCodeAt(G);while(q===n0||q===v1||q===y1||q===g1||q===h1);D=["space",Q.slice(B,G)],B=G-1;break}case u7:case p7:case d7:case i7:case r7:case s7:case l7:{let a=String.fromCharCode(q);D=[a,a,B];break}case c7:{if(z=A.length?A.pop()[1]:"",H=Q.charCodeAt(B+1),z==="url"&&H!==hJ&&H!==m9&&H!==n0&&H!==v1&&H!==y1&&H!==h1&&H!==g1){G=B;do{if(j=!1,G=Q.indexOf(")",G+1),G===-1)if(Y||c){G=B;break}else M("bracket");U=G;while(Q.charCodeAt(U-1)===k1)U-=1,j=!j}while(j);D=["brackets",Q.slice(B,G+1),B,G],B=G}else if(G=Q.indexOf(")",B+1),K=Q.slice(B,G+1),G===-1||n7.test(K))D=["(","(",B];else D=["brackets",K,B,G],B=G;break}case hJ:case m9:{V=q===hJ?"'":'"',G=B;do{if(j=!1,G=Q.indexOf(V,G+1),G===-1)if(Y||c){G=B+1;break}else M("string");U=G;while(Q.charCodeAt(U-1)===k1)U-=1,j=!j}while(j);D=["string",Q.slice(B,G+1),B,G],B=G;break}case o7:{if(m1.lastIndex=B+1,m1.test(Q),m1.lastIndex===0)G=Q.length-1;else G=m1.lastIndex-2;D=["at-word",Q.slice(B,G+1),B,G],B=G;break}case k1:{G=B,W=!0;while(Q.charCodeAt(G+1)===k1)G+=1,W=!W;if(q=Q.charCodeAt(G+1),W&&q!==u9&&q!==n0&&q!==v1&&q!==y1&&q!==g1&&q!==h1){if(G+=1,p9.test(Q.charAt(G))){while(p9.test(Q.charAt(G+1)))G+=1;if(Q.charCodeAt(G+1)===n0)G+=1}}D=["word",Q.slice(B,G+1),B,G],B=G;break}default:{if(q===u9&&Q.charCodeAt(B+1)===a7){if(G=Q.indexOf("*/",B+2)+1,G===0)if(Y||c)G=Q.length;else M("comment");D=["comment",Q.slice(B,G+1),B,G],B=G}else{if(u1.lastIndex=B+1,u1.test(Q),u1.lastIndex===0)G=Q.length-1;else G=u1.lastIndex-2;D=["word",Q.slice(B,G+1),B,G],A.push(D),B=G}break}}return B++,D}function l(h){O.push(h)}return{back:l,endOfFile:T,nextToken:f,position:F}},LX=E0,GJ=class extends LX{constructor(J){super(J);this.type="atrule"}append(...J){if(!this.proxyOf.nodes)this.nodes=[];return super.append(...J)}prepend(...J){if(!this.proxyOf.nodes)this.nodes=[];return super.prepend(...J)}},pZ=GJ;GJ.default=GJ;LX.registerAtRule(GJ);var DX=E0,FX,PX,u0=class extends DX{constructor(J){super(J);if(this.type="root",!this.nodes)this.nodes=[]}normalize(J,Z,Q){let Y=super.normalize(J);if(Z){if(Q==="prepend")if(this.nodes.length>1)Z.raws.before=this.nodes[1].raws.before;else delete Z.raws.before;else if(this.first!==Z)for(let q of Y)q.raws.before=Z.raws.before}return Y}removeChild(J,Z){let Q=this.index(J);if(!Z&&Q===0&&this.nodes.length>1)this.nodes[1].raws.before=this.nodes[Q].raws.before;return super.removeChild(J)}toResult(J={}){return new FX(new PX,this,J).stringify()}};u0.registerLazyResult=(X)=>{FX=X};u0.registerProcessor=(X)=>{PX=X};var L1=u0;u0.default=u0;DX.registerRoot(u0);var V1={comma(X){return V1.split(X,[","],!0)},space(X){let J=[" ",`
|
|
52
|
+
`,"\t"];return V1.split(X,J)},split(X,J,Z){let Q=[],Y="",q=!1,G=0,V=!1,K="",W=!1;for(let j of X){if(W)W=!1;else if(j==="\\")W=!0;else if(V){if(j===K)V=!1}else if(j==='"'||j==="'")V=!0,K=j;else if(j==="(")G+=1;else if(j===")"){if(G>0)G-=1}else if(G===0){if(J.includes(j))q=!0}if(q){if(Y!=="")Q.push(Y.trim());Y="",q=!1}else Y+=j}if(Z||Y!=="")Q.push(Y.trim());return Q}},OX=V1;V1.default=V1;var AX=E0,e7=OX,KJ=class extends AX{constructor(J){super(J);if(this.type="rule",!this.nodes)this.nodes=[]}get selectors(){return e7.comma(this.selector)}set selectors(J){let Z=this.selector?this.selector.match(/,\s*/):null,Q=Z?Z[0]:","+this.raw("between","beforeOpen");this.selector=J.join(Q)}},cZ=KJ;KJ.default=KJ;AX.registerRule(KJ);var Jq=OJ,Zq=t7,Xq=MJ,Qq=pZ,Yq=L1,c9=cZ,l9={empty:!0,space:!0};function qq(X){for(let J=X.length-1;J>=0;J--){let Z=X[J],Q=Z[3]||Z[2];if(Q)return Q}}var Gq=class{constructor(J){this.input=J,this.root=new Yq,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:J,start:{column:1,line:1,offset:0}}}atrule(J){let Z=new Qq;if(Z.name=J[1].slice(1),Z.name==="")this.unnamedAtrule(Z,J);this.init(Z,J[2]);let Q,Y,q,G=!1,V=!1,K=[],W=[];while(!this.tokenizer.endOfFile()){if(J=this.tokenizer.nextToken(),Q=J[0],Q==="("||Q==="[")W.push(Q==="("?")":"]");else if(Q==="{"&&W.length>0)W.push("}");else if(Q===W[W.length-1])W.pop();if(W.length===0)if(Q===";"){Z.source.end=this.getPosition(J[2]),Z.source.end.offset++,this.semicolon=!0;break}else if(Q==="{"){V=!0;break}else if(Q==="}"){if(K.length>0){q=K.length-1,Y=K[q];while(Y&&Y[0]==="space")Y=K[--q];if(Y)Z.source.end=this.getPosition(Y[3]||Y[2]),Z.source.end.offset++}this.end(J);break}else K.push(J);else K.push(J);if(this.tokenizer.endOfFile()){G=!0;break}}if(Z.raws.between=this.spacesAndCommentsFromEnd(K),K.length){if(Z.raws.afterName=this.spacesAndCommentsFromStart(K),this.raw(Z,"params",K),G)J=K[K.length-1],Z.source.end=this.getPosition(J[3]||J[2]),Z.source.end.offset++,this.spaces=Z.raws.between,Z.raws.between=""}else Z.raws.afterName="",Z.params="";if(V)Z.nodes=[],this.current=Z}checkMissedSemicolon(J){let Z=this.colon(J);if(Z===!1)return;let Q=0,Y;for(let q=Z-1;q>=0;q--)if(Y=J[q],Y[0]!=="space"){if(Q+=1,Q===2)break}throw this.input.error("Missed semicolon",Y[0]==="word"?Y[3]+1:Y[2])}colon(J){let Z=0,Q,Y,q;for(let[G,V]of J.entries()){if(Q=V,Y=Q[0],Y==="(")Z+=1;if(Y===")")Z-=1;if(Z===0&&Y===":")if(!q)this.doubleColon(Q);else if(q[0]==="word"&&q[1]==="progid")continue;else return G;q=Q}return!1}comment(J){let Z=new Xq;this.init(Z,J[2]),Z.source.end=this.getPosition(J[3]||J[2]),Z.source.end.offset++;let Q=J[1].slice(2,-2);if(/^\s*$/.test(Q))Z.text="",Z.raws.left=Q,Z.raws.right="";else{let Y=Q.match(/^(\s*)([^]*\S)(\s*)$/);Z.text=Y[2],Z.raws.left=Y[1],Z.raws.right=Y[3]}}createTokenizer(){this.tokenizer=Zq(this.input)}decl(J,Z){let Q=new Jq;this.init(Q,J[0][2]);let Y=J[J.length-1];if(Y[0]===";")this.semicolon=!0,J.pop();Q.source.end=this.getPosition(Y[3]||Y[2]||qq(J)),Q.source.end.offset++;while(J[0][0]!=="word"){if(J.length===1)this.unknownWord(J);Q.raws.before+=J.shift()[1]}Q.source.start=this.getPosition(J[0][2]),Q.prop="";while(J.length){let W=J[0][0];if(W===":"||W==="space"||W==="comment")break;Q.prop+=J.shift()[1]}Q.raws.between="";let q;while(J.length)if(q=J.shift(),q[0]===":"){Q.raws.between+=q[1];break}else{if(q[0]==="word"&&/\w/.test(q[1]))this.unknownWord([q]);Q.raws.between+=q[1]}if(Q.prop[0]==="_"||Q.prop[0]==="*")Q.raws.before+=Q.prop[0],Q.prop=Q.prop.slice(1);let G=[],V;while(J.length){if(V=J[0][0],V!=="space"&&V!=="comment")break;G.push(J.shift())}this.precheckMissedSemicolon(J);for(let W=J.length-1;W>=0;W--){if(q=J[W],q[1].toLowerCase()==="!important"){Q.important=!0;let j=this.stringFrom(J,W);if(j=this.spacesFromEnd(J)+j,j!==" !important")Q.raws.important=j;break}else if(q[1].toLowerCase()==="important"){let j=J.slice(0),U="";for(let z=W;z>0;z--){let H=j[z][0];if(U.trim().indexOf("!")===0&&H!=="space")break;U=j.pop()[1]+U}if(U.trim().indexOf("!")===0)Q.important=!0,Q.raws.important=U,J=j}if(q[0]!=="space"&&q[0]!=="comment")break}if(J.some((W)=>W[0]!=="space"&&W[0]!=="comment"))Q.raws.between+=G.map((W)=>W[1]).join(""),G=[];if(this.raw(Q,"value",G.concat(J),Z),Q.value.includes(":")&&!Z)this.checkMissedSemicolon(J)}doubleColon(J){throw this.input.error("Double colon",{offset:J[2]},{offset:J[2]+J[1].length})}emptyRule(J){let Z=new c9;this.init(Z,J[2]),Z.selector="",Z.raws.between="",this.current=Z}end(J){if(this.current.nodes&&this.current.nodes.length)this.current.raws.semicolon=this.semicolon;if(this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent)this.current.source.end=this.getPosition(J[2]),this.current.source.end.offset++,this.current=this.current.parent;else this.unexpectedClose(J)}endFile(){if(this.current.parent)this.unclosedBlock();if(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(J){if(this.spaces+=J[1],this.current.nodes){let Z=this.current.nodes[this.current.nodes.length-1];if(Z&&Z.type==="rule"&&!Z.raws.ownSemicolon)Z.raws.ownSemicolon=this.spaces,this.spaces=""}}getPosition(J){let Z=this.input.fromOffset(J);return{column:Z.col,line:Z.line,offset:J}}init(J,Z){if(this.current.push(J),J.source={input:this.input,start:this.getPosition(Z)},J.raws.before=this.spaces,this.spaces="",J.type!=="comment")this.semicolon=!1}other(J){let Z=!1,Q=null,Y=!1,q=null,G=[],V=J[1].startsWith("--"),K=[],W=J;while(W){if(Q=W[0],K.push(W),Q==="("||Q==="["){if(!q)q=W;G.push(Q==="("?")":"]")}else if(V&&Y&&Q==="{"){if(!q)q=W;G.push("}")}else if(G.length===0){if(Q===";")if(Y){this.decl(K,V);return}else break;else if(Q==="{"){this.rule(K);return}else if(Q==="}"){this.tokenizer.back(K.pop()),Z=!0;break}else if(Q===":")Y=!0}else if(Q===G[G.length-1]){if(G.pop(),G.length===0)q=null}W=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile())Z=!0;if(G.length>0)this.unclosedBracket(q);if(Z&&Y){if(!V)while(K.length){if(W=K[K.length-1][0],W!=="space"&&W!=="comment")break;this.tokenizer.back(K.pop())}this.decl(K,V)}else this.unknownWord(K)}parse(){let J;while(!this.tokenizer.endOfFile())switch(J=this.tokenizer.nextToken(),J[0]){case"space":this.spaces+=J[1];break;case";":this.freeSemicolon(J);break;case"}":this.end(J);break;case"comment":this.comment(J);break;case"at-word":this.atrule(J);break;case"{":this.emptyRule(J);break;default:this.other(J);break}this.endFile()}precheckMissedSemicolon(){}raw(J,Z,Q,Y){let q,G,V=Q.length,K="",W=!0,j,U;for(let z=0;z<V;z+=1)if(q=Q[z],G=q[0],G==="space"&&z===V-1&&!Y)W=!1;else if(G==="comment")if(U=Q[z-1]?Q[z-1][0]:"empty",j=Q[z+1]?Q[z+1][0]:"empty",!l9[U]&&!l9[j])if(K.slice(-1)===",")W=!1;else K+=q[1];else W=!1;else K+=q[1];if(!W){let z=Q.reduce((H,D)=>H+D[1],"");J.raws[Z]={raw:z,value:K}}J[Z]=K}rule(J){J.pop();let Z=new c9;this.init(Z,J[0][2]),Z.raws.between=this.spacesAndCommentsFromEnd(J),this.raw(Z,"selector",J),this.current=Z}spacesAndCommentsFromEnd(J){let Z,Q="";while(J.length){if(Z=J[J.length-1][0],Z!=="space"&&Z!=="comment")break;Q=J.pop()[1]+Q}return Q}spacesAndCommentsFromStart(J){let Z,Q="";while(J.length){if(Z=J[0][0],Z!=="space"&&Z!=="comment")break;Q+=J.shift()[1]}return Q}spacesFromEnd(J){let Z,Q="";while(J.length){if(Z=J[J.length-1][0],Z!=="space")break;Q=J.pop()[1]+Q}return Q}stringFrom(J,Z){let Q="";for(let Y=Z;Y<J.length;Y++)Q+=J[Y][1];return J.splice(Z,J.length-Z),Q}unclosedBlock(){let J=this.current.source.start;throw this.input.error("Unclosed block",J.line,J.column)}unclosedBracket(J){throw this.input.error("Unclosed bracket",{offset:J[2]},{offset:J[2]+1})}unexpectedClose(J){throw this.input.error("Unexpected }",{offset:J[2]},{offset:J[2]+1})}unknownWord(J){throw this.input.error("Unknown word",{offset:J[0][2]},{offset:J[0][2]+J[0][1].length})}unnamedAtrule(J,Z){throw this.input.error("At-rule without name",{offset:Z[2]},{offset:Z[2]+Z[1].length})}},Kq=Gq,Vq=E0,Wq=Kq,jq=AJ;function VJ(X,J){let Z=new jq(X,J),Q=new Wq(Z);try{Q.parse()}catch(Y){if(Y.name==="CssSyntaxError"&&J&&J.from){if(/\.scss$/i.test(J.from))Y.message+=`
|
|
53
|
+
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`;else if(/\.sass/i.test(J.from))Y.message+=`
|
|
54
|
+
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`;else if(/\.less$/i.test(J.from))Y.message+=`
|
|
55
|
+
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`}throw Y}return Q.root}var lZ=VJ;VJ.default=VJ;Vq.registerParse(VJ);var{isClean:U0,my:Uq}=H1,Bq=XX,zq=FJ,Hq=E0,Lq=mZ,Dq=zX,d9=uZ,Fq=lZ,Pq=L1,Oq={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Aq={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},Mq={Once:!0,postcssPlugin:!0,prepare:!0},p0=0;function t0(X){return typeof X==="object"&&typeof X.then==="function"}function MX(X){let J=!1,Z=Oq[X.type];if(X.type==="decl")J=X.prop.toLowerCase();else if(X.type==="atrule")J=X.name.toLowerCase();if(J&&X.append)return[Z,Z+"-"+J,p0,Z+"Exit",Z+"Exit-"+J];else if(J)return[Z,Z+"-"+J,Z+"Exit",Z+"Exit-"+J];else if(X.append)return[Z,p0,Z+"Exit"];else return[Z,Z+"Exit"]}function i9(X){let J;if(X.type==="document")J=["Document",p0,"DocumentExit"];else if(X.type==="root")J=["Root",p0,"RootExit"];else J=MX(X);return{eventIndex:0,events:J,iterator:0,node:X,visitorIndex:0,visitors:[]}}function DZ(X){if(X[U0]=!1,X.nodes)X.nodes.forEach((J)=>DZ(J));return X}var FZ={},c0=class X{constructor(J,Z,Q){this.stringified=!1,this.processed=!1;let Y;if(typeof Z==="object"&&Z!==null&&(Z.type==="root"||Z.type==="document"))Y=DZ(Z);else if(Z instanceof X||Z instanceof d9){if(Y=DZ(Z.root),Z.map){if(typeof Q.map>"u")Q.map={};if(!Q.map.inline)Q.map.inline=!1;Q.map.prev=Z.map}}else{let q=Fq;if(Q.syntax)q=Q.syntax.parse;if(Q.parser)q=Q.parser;if(q.parse)q=q.parse;try{Y=q(Z,Q)}catch(G){this.processed=!0,this.error=G}if(Y&&!Y[Uq])Hq.rebuild(Y)}this.result=new d9(J,Y,Q),this.helpers={...FZ,postcss:FZ,result:this.result},this.plugins=this.processor.plugins.map((q)=>{if(typeof q==="object"&&q.prepare)return{...q,...q.prepare(this.result)};else return q})}async(){if(this.error)return Promise.reject(this.error);if(this.processed)return Promise.resolve(this.result);if(!this.processing)this.processing=this.runAsync();return this.processing}catch(J){return this.async().catch(J)}finally(J){return this.async().then(J,J)}getAsyncError(){throw Error("Use process(css).then(cb) to work with async plugins")}handleError(J,Z){let Q=this.result.lastPlugin;try{if(Z)Z.addToError(J);if(this.error=J,J.name==="CssSyntaxError"&&!J.plugin)J.plugin=Q.postcssPlugin,J.setMessage();else if(Q.postcssVersion){let{postcssPlugin:Y,postcssVersion:q}=Q,G=this.result.processor.version,V=q.split("."),K=G.split(".");if(V[0]!==K[0]||parseInt(V[1])>parseInt(K[1]))console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+G+", but "+Y+" uses "+q+". Perhaps this is the source of the error below.")}}catch(Y){if(console&&console.error)console.error(Y)}return J}prepareVisitors(){this.listeners={};let J=(Z,Q,Y)=>{if(!this.listeners[Q])this.listeners[Q]=[];this.listeners[Q].push([Z,Y])};for(let Z of this.plugins)if(typeof Z==="object")for(let Q in Z){if(!Aq[Q]&&/^[A-Z]/.test(Q))throw Error(`Unknown event ${Q} in ${Z.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Mq[Q]){if(typeof Z[Q]==="object")for(let Y in Z[Q])if(Y==="*")J(Z,Q,Z[Q][Y]);else J(Z,Q+"-"+Y.toLowerCase(),Z[Q][Y]);else if(typeof Z[Q]==="function")J(Z,Q,Z[Q])}}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let J=0;J<this.plugins.length;J++){let Z=this.plugins[J],Q=this.runOnRoot(Z);if(t0(Q))try{await Q}catch(Y){throw this.handleError(Y)}}if(this.prepareVisitors(),this.hasListener){let J=this.result.root;while(!J[U0]){J[U0]=!0;let Z=[i9(J)];while(Z.length>0){let Q=this.visitTick(Z);if(t0(Q))try{await Q}catch(Y){let q=Z[Z.length-1].node;throw this.handleError(Y,q)}}}if(this.listeners.OnceExit)for(let[Z,Q]of this.listeners.OnceExit){this.result.lastPlugin=Z;try{if(J.type==="document"){let Y=J.nodes.map((q)=>Q(q,this.helpers));await Promise.all(Y)}else await Q(J,this.helpers)}catch(Y){throw this.handleError(Y)}}}return this.processed=!0,this.stringify()}runOnRoot(J){this.result.lastPlugin=J;try{if(typeof J==="object"&&J.Once){if(this.result.root.type==="document"){let Z=this.result.root.nodes.map((Q)=>J.Once(Q,this.helpers));if(t0(Z[0]))return Promise.all(Z);return Z}return J.Once(this.result.root,this.helpers)}else if(typeof J==="function")return J(this.result.root,this.result)}catch(Z){throw this.handleError(Z)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let J=this.result.opts,Z=zq;if(J.syntax)Z=J.syntax.stringify;if(J.stringifier)Z=J.stringifier;if(Z.stringify)Z=Z.stringify;let Y=new Bq(Z,this.result.root,this.result.opts).generate();return this.result.css=Y[0],this.result.map=Y[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 J of this.plugins){let Z=this.runOnRoot(J);if(t0(Z))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let J=this.result.root;while(!J[U0])J[U0]=!0,this.walkSync(J);if(this.listeners.OnceExit)if(J.type==="document")for(let Z of J.nodes)this.visitSync(this.listeners.OnceExit,Z);else this.visitSync(this.listeners.OnceExit,J)}return this.result}then(J,Z){if(!("from"in this.opts))Dq("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.");return this.async().then(J,Z)}toString(){return this.css}visitSync(J,Z){for(let[Q,Y]of J){this.result.lastPlugin=Q;let q;try{q=Y(Z,this.helpers)}catch(G){throw this.handleError(G,Z.proxyOf)}if(Z.type!=="root"&&Z.type!=="document"&&!Z.parent)return!0;if(t0(q))throw this.getAsyncError()}}visitTick(J){let Z=J[J.length-1],{node:Q,visitors:Y}=Z;if(Q.type!=="root"&&Q.type!=="document"&&!Q.parent){J.pop();return}if(Y.length>0&&Z.visitorIndex<Y.length){let[G,V]=Y[Z.visitorIndex];if(Z.visitorIndex+=1,Z.visitorIndex===Y.length)Z.visitors=[],Z.visitorIndex=0;this.result.lastPlugin=G;try{return V(Q.toProxy(),this.helpers)}catch(K){throw this.handleError(K,Q)}}if(Z.iterator!==0){let G=Z.iterator,V;while(V=Q.nodes[Q.indexes[G]])if(Q.indexes[G]+=1,!V[U0]){V[U0]=!0,J.push(i9(V));return}Z.iterator=0,delete Q.indexes[G]}let q=Z.events;while(Z.eventIndex<q.length){let G=q[Z.eventIndex];if(Z.eventIndex+=1,G===p0){if(Q.nodes&&Q.nodes.length)Q[U0]=!0,Z.iterator=Q.getIterator();return}else if(this.listeners[G]){Z.visitors=this.listeners[G];return}}J.pop()}walkSync(J){J[U0]=!0;let Z=MX(J);for(let Q of Z)if(Q===p0){if(J.nodes)J.each((Y)=>{if(!Y[U0])this.walkSync(Y)})}else{let Y=this.listeners[Q];if(Y){if(this.visitSync(Y,J.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"}};c0.registerPostcss=(X)=>{FZ=X};var wX=c0;c0.default=c0;Pq.registerLazyResult(c0);Lq.registerLazyResult(c0);var wq=XX,_q=FJ,Cq=zX,$q=lZ,Rq=uZ,PZ=class{constructor(J,Z,Q){Z=Z.toString(),this.stringified=!1,this._processor=J,this._css=Z,this._opts=Q,this._map=void 0;let Y,q=_q;this.result=new Rq(this._processor,Y,this._opts),this.result.css=Z;let G=this;Object.defineProperty(this.result,"root",{get(){return G.root}});let V=new wq(q,Y,this._opts,Z);if(V.isMap()){let[K,W]=V.generate();if(K)this.result.css=K;if(W)this.result.map=W}else V.clearAnnotation(),this.result.css=V.css}async(){if(this.error)return Promise.reject(this.error);return Promise.resolve(this.result)}catch(J){return this.async().catch(J)}finally(J){return this.async().then(J,J)}sync(){if(this.error)throw this.error;return this.result}then(J,Z){if(!("from"in this._opts))Cq("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.");return this.async().then(J,Z)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let J,Z=$q;try{J=Z(this._css,this._opts)}catch(Q){this.error=Q}if(this.error)throw this.error;else return this._root=J,J}get[Symbol.toStringTag](){return"NoWorkResult"}},Eq=PZ;PZ.default=PZ;var Nq=Eq,Iq=wX,Sq=mZ,Tq=L1,W1=class{constructor(J=[]){this.version="8.4.38",this.plugins=this.normalize(J)}normalize(J){let Z=[];for(let Q of J){if(Q.postcss===!0)Q=Q();else if(Q.postcss)Q=Q.postcss;if(typeof Q==="object"&&Array.isArray(Q.plugins))Z=Z.concat(Q.plugins);else if(typeof Q==="object"&&Q.postcssPlugin)Z.push(Q);else if(typeof Q==="function")Z.push(Q);else if(typeof Q==="object"&&(Q.parse||Q.stringify))throw 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.");else throw Error(Q+" is not a PostCSS plugin")}return Z}process(J,Z={}){if(!this.plugins.length&&!Z.parser&&!Z.stringifier&&!Z.syntax)return new Nq(this,J,Z);else return new Iq(this,J,Z)}use(J){return this.plugins=this.plugins.concat(this.normalize([J])),this}},xq=W1;W1.default=W1;Tq.registerProcessor(W1);Sq.registerProcessor(W1);var fq=OJ,bq=n6,kq=MJ,vq=pZ,hq=AJ,yq=L1,gq=cZ;function j1(X,J){if(Array.isArray(X))return X.map((Y)=>j1(Y));let{inputs:Z,...Q}=X;if(Z){J=[];for(let Y of Z){let q={...Y,__proto__:hq.prototype};if(q.map)q.map={...q.map,__proto__:bq.prototype};J.push(q)}}if(Q.nodes)Q.nodes=X.nodes.map((Y)=>j1(Y,J));if(Q.source){let{inputId:Y,...q}=Q.source;if(Q.source=q,Y!=null)Q.source.input=J[Y]}if(Q.type==="root")return new yq(Q);else if(Q.type==="decl")return new fq(Q);else if(Q.type==="rule")return new gq(Q);else if(Q.type==="comment")return new kq(Q);else if(Q.type==="atrule")return new vq(Q);else throw Error("Unknown node type: "+X.type)}var mq=j1;j1.default=j1;var uq=hZ,_X=OJ,pq=wX,cq=E0,dZ=xq,lq=FJ,dq=mq,CX=mZ,iq=HX,$X=MJ,RX=pZ,sq=uZ,aq=AJ,rq=lZ,oq=OX,EX=cZ,NX=L1,nq=PJ;function S(...X){if(X.length===1&&Array.isArray(X[0]))X=X[0];return new dZ(X)}S.plugin=function(J,Z){let Q=!1;function Y(...G){if(console&&console.warn&&!Q){if(Q=!0,console.warn(J+`: postcss.plugin was deprecated. Migration guide:
|
|
56
|
+
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn"))console.warn(J+`: 里面 postcss.plugin 被弃用. 迁移指南:
|
|
57
|
+
https://www.w3ctech.com/topic/2226`)}let V=Z(...G);return V.postcssPlugin=J,V.postcssVersion=new dZ().version,V}let q;return Object.defineProperty(Y,"postcss",{get(){if(!q)q=Y();return q}}),Y.process=function(G,V,K){return S([Y(K)]).process(G,V)},Y};S.stringify=lq;S.parse=rq;S.fromJSON=dq;S.list=oq;S.comment=(X)=>new $X(X);S.atRule=(X)=>new RX(X);S.decl=(X)=>new _X(X);S.rule=(X)=>new EX(X);S.root=(X)=>new NX(X);S.document=(X)=>new CX(X);S.CssSyntaxError=uq;S.Declaration=_X;S.Container=cq;S.Processor=dZ;S.Document=CX;S.Comment=$X;S.Warning=iq;S.AtRule=RX;S.Result=sq;S.Input=aq;S.Rule=EX;S.Root=NX;S.Node=nq;pq.registerPostcss(S);var tq=S;S.default=S;var g=V7(tq);g.stringify;g.fromJSON;g.plugin;g.parse;g.list;g.document;g.comment;g.atRule;g.rule;g.decl;g.root;g.CssSyntaxError;g.Declaration;g.Container;g.Processor;g.Document;g.Comment;g.Warning;g.AtRule;g.Result;g.Input;g.Rule;g.Root;g.Node;class iZ{constructor(...X){X0(this,"parentElement",null),X0(this,"parentNode",null),X0(this,"ownerDocument"),X0(this,"firstChild",null),X0(this,"lastChild",null),X0(this,"previousSibling",null),X0(this,"nextSibling",null),X0(this,"ELEMENT_NODE",1),X0(this,"TEXT_NODE",3),X0(this,"nodeType"),X0(this,"nodeName"),X0(this,"RRNodeType")}get childNodes(){let X=[],J=this.firstChild;while(J)X.push(J),J=J.nextSibling;return X}contains(X){if(!(X instanceof iZ))return!1;else if(X.ownerDocument!==this.ownerDocument)return!1;else if(X===this)return!0;while(X.parentNode){if(X.parentNode===this)return!0;X=X.parentNode}return!1}appendChild(X){throw Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(X,J){throw Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(X){throw Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}var s9={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},a9={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},p1={},eq=()=>{return!!globalThis.Zone};function sZ(X){if(p1[X])return p1[X];let J=globalThis[X],Z=J.prototype,Q=X in s9?s9[X]:void 0,Y=Boolean(Q&&Q.every((V)=>{var K,W;return Boolean((W=(K=Object.getOwnPropertyDescriptor(Z,V))==null?void 0:K.get)==null?void 0:W.toString().includes("[native code]"))})),q=X in a9?a9[X]:void 0,G=Boolean(q&&q.every((V)=>{var K;return typeof Z[V]==="function"&&((K=Z[V])==null?void 0:K.toString().includes("[native code]"))}));if(Y&&G&&!eq())return p1[X]=J.prototype,J.prototype;try{let V=document.createElement("iframe");document.body.appendChild(V);let K=V.contentWindow;if(!K)return J.prototype;let W=K[X].prototype;if(document.body.removeChild(V),!W)return Z;return p1[X]=W}catch{return Z}}var yJ={};function F0(X,J,Z){var Q;let Y=`${X}.${String(Z)}`;if(yJ[Y])return yJ[Y].call(J);let q=sZ(X),G=(Q=Object.getOwnPropertyDescriptor(q,Z))==null?void 0:Q.get;if(!G)return J[Z];return yJ[Y]=G,G.call(J)}var gJ={};function IX(X,J,Z){let Q=`${X}.${String(Z)}`;if(gJ[Q])return gJ[Q].bind(J);let q=sZ(X)[Z];if(typeof q!=="function")return J[Z];return gJ[Q]=q,q.bind(J)}function JG(X){return F0("Node",X,"ownerDocument")}function ZG(X){return F0("Node",X,"childNodes")}function XG(X){return F0("Node",X,"parentNode")}function QG(X){return F0("Node",X,"parentElement")}function YG(X){return F0("Node",X,"textContent")}function qG(X,J){return IX("Node",X,"contains")(J)}function GG(X){return IX("Node",X,"getRootNode")()}function KG(X){if(!X||!("host"in X))return null;return F0("ShadowRoot",X,"host")}function VG(X){return X.styleSheets}function WG(X){if(!X||!("shadowRoot"in X))return null;return F0("Element",X,"shadowRoot")}function jG(X,J){return F0("Element",X,"querySelector")(J)}function UG(X,J){return F0("Element",X,"querySelectorAll")(J)}function SX(){return sZ("MutationObserver").constructor}function N0(X,J,Z){try{if(!(J in X))return()=>{};let Q=X[J],Y=Z(Q);if(typeof Y==="function")Y.prototype=Y.prototype||{},Object.defineProperties(Y,{__rrweb_original__:{enumerable:!1,value:Q}});return X[J]=Y,()=>{X[J]=Q}}catch{return()=>{}}}var w={ownerDocument:JG,childNodes:ZG,parentNode:XG,parentElement:QG,textContent:YG,contains:qG,getRootNode:GG,host:KG,styleSheets:VG,shadowRoot:WG,querySelector:jG,querySelectorAll:UG,mutationObserver:SX,patch:N0};function o(X,J,Z=document){let Q={capture:!0,passive:!0};return Z.addEventListener(X,J,Q),()=>Z.removeEventListener(X,J,Q)}var x0=`Please stop import mirror directly. Instead of that,\r
|
|
58
|
+
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
59
|
+
or you can use record.mirror to access the mirror instance during recording.`,r9={map:{},getId(){return console.error(x0),-1},getNode(){return console.error(x0),null},removeNodeFromMap(){console.error(x0)},has(){return console.error(x0),!1},reset(){console.error(x0)}};if(typeof window<"u"&&window.Proxy&&window.Reflect)r9=new Proxy(r9,{get(X,J,Z){if(J==="map")console.error(x0);return Reflect.get(X,J,Z)}});function U1(X,J,Z={}){let Q=null,Y=0;return function(...q){let G=Date.now();if(!Y&&Z.leading===!1)Y=G;let V=J-(G-Y),K=this;if(V<=0||V>J){if(Q)clearTimeout(Q),Q=null;Y=G,X.apply(K,q)}else if(!Q&&Z.trailing!==!1)Q=setTimeout(()=>{Y=Z.leading===!1?0:Date.now(),Q=null,X.apply(K,q)},V)}}function wJ(X,J,Z,Q,Y=window){let q=Y.Object.getOwnPropertyDescriptor(X,J);return Y.Object.defineProperty(X,J,Q?Z:{set(G){if(setTimeout(()=>{Z.set.call(this,G)},0),q&&q.set)q.set.call(this,G)}}),()=>wJ(X,J,q||{},!0)}var WJ=Date.now;if(!/[1-9][0-9]{12}/.test(Date.now().toString()))WJ=()=>new Date().getTime();function TX(X){var J,Z,Q,Y;let q=X.document;return{left:q.scrollingElement?q.scrollingElement.scrollLeft:X.pageXOffset!==void 0?X.pageXOffset:q.documentElement.scrollLeft||(q==null?void 0:q.body)&&((J=w.parentElement(q.body))==null?void 0:J.scrollLeft)||((Z=q==null?void 0:q.body)==null?void 0:Z.scrollLeft)||0,top:q.scrollingElement?q.scrollingElement.scrollTop:X.pageYOffset!==void 0?X.pageYOffset:(q==null?void 0:q.documentElement.scrollTop)||(q==null?void 0:q.body)&&((Q=w.parentElement(q.body))==null?void 0:Q.scrollTop)||((Y=q==null?void 0:q.body)==null?void 0:Y.scrollTop)||0}}function xX(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function fX(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function bX(X){if(!X)return null;return X.nodeType===X.ELEMENT_NODE?X:w.parentElement(X)}function n(X,J,Z,Q){if(!X)return!1;let Y=bX(X);if(!Y)return!1;try{if(typeof J==="string"){if(Y.classList.contains(J))return!0;if(Q&&Y.closest("."+J)!==null)return!0}else if(JJ(Y,J,Q))return!0}catch(q){}if(Z){if(Y.matches(Z))return!0;if(Q&&Y.closest(Z)!==null)return!0}return!1}function BG(X,J){return J.getId(X)!==-1}function mJ(X,J,Z){if(X.tagName==="TITLE"&&Z.headTitleMutations)return!0;return J.getId(X)===X1}function kX(X,J){if(e0(X))return!1;let Z=J.getId(X);if(!J.has(Z))return!0;let Q=w.parentNode(X);if(Q&&Q.nodeType===X.DOCUMENT_NODE)return!1;if(!Q)return!0;return kX(Q,J)}function OZ(X){return Boolean(X.changedTouches)}function zG(X=window){if("NodeList"in X&&!X.NodeList.prototype.forEach)X.NodeList.prototype.forEach=Array.prototype.forEach;if("DOMTokenList"in X&&!X.DOMTokenList.prototype.forEach)X.DOMTokenList.prototype.forEach=Array.prototype.forEach}function vX(X,J){return Boolean(X.nodeName==="IFRAME"&&J.getMeta(X))}function hX(X,J){return Boolean(X.nodeName==="LINK"&&X.nodeType===X.ELEMENT_NODE&&X.getAttribute&&X.getAttribute("rel")==="stylesheet"&&J.getMeta(X))}function AZ(X){if(!X)return!1;if(X instanceof iZ&&"shadowRoot"in X)return Boolean(X.shadowRoot);return Boolean(w.shadowRoot(X))}class yX{constructor(){P(this,"id",1),P(this,"styleIDMap",new WeakMap),P(this,"idStyleMap",new Map)}getId(X){return this.styleIDMap.get(X)??-1}has(X){return this.styleIDMap.has(X)}add(X,J){if(this.has(X))return this.getId(X);let Z;if(J===void 0)Z=this.id++;else Z=J;return this.styleIDMap.set(X,Z),this.idStyleMap.set(Z,X),Z}getStyle(X){return this.idStyleMap.get(X)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function gX(X){var J;let Z=null;if("getRootNode"in X&&((J=w.getRootNode(X))==null?void 0:J.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&w.host(w.getRootNode(X)))Z=w.host(w.getRootNode(X));return Z}function HG(X){let J=X,Z;while(Z=gX(J))J=Z;return J}function LG(X){let J=w.ownerDocument(X);if(!J)return!1;let Z=HG(X);return w.contains(J,Z)}function mX(X){let J=w.ownerDocument(X);if(!J)return!1;return w.contains(J,X)||LG(X)}var R=((X)=>{return X[X.DomContentLoaded=0]="DomContentLoaded",X[X.Load=1]="Load",X[X.FullSnapshot=2]="FullSnapshot",X[X.IncrementalSnapshot=3]="IncrementalSnapshot",X[X.Meta=4]="Meta",X[X.Custom=5]="Custom",X[X.Plugin=6]="Plugin",X})(R||{}),_=((X)=>{return X[X.Mutation=0]="Mutation",X[X.MouseMove=1]="MouseMove",X[X.MouseInteraction=2]="MouseInteraction",X[X.Scroll=3]="Scroll",X[X.ViewportResize=4]="ViewportResize",X[X.Input=5]="Input",X[X.TouchMove=6]="TouchMove",X[X.MediaInteraction=7]="MediaInteraction",X[X.StyleSheetRule=8]="StyleSheetRule",X[X.CanvasMutation=9]="CanvasMutation",X[X.Font=10]="Font",X[X.Log=11]="Log",X[X.Drag=12]="Drag",X[X.StyleDeclaration=13]="StyleDeclaration",X[X.Selection=14]="Selection",X[X.AdoptedStyleSheet=15]="AdoptedStyleSheet",X[X.CustomElement=16]="CustomElement",X})(_||{}),t=((X)=>{return X[X.MouseUp=0]="MouseUp",X[X.MouseDown=1]="MouseDown",X[X.Click=2]="Click",X[X.ContextMenu=3]="ContextMenu",X[X.DblClick=4]="DblClick",X[X.Focus=5]="Focus",X[X.Blur=6]="Blur",X[X.TouchStart=7]="TouchStart",X[X.TouchMove_Departed=8]="TouchMove_Departed",X[X.TouchEnd=9]="TouchEnd",X[X.TouchCancel=10]="TouchCancel",X})(t||{}),z0=((X)=>{return X[X.Mouse=0]="Mouse",X[X.Pen=1]="Pen",X[X.Touch=2]="Touch",X})(z0||{}),l0=((X)=>{return X[X["2D"]=0]="2D",X[X.WebGL=1]="WebGL",X[X.WebGL2=2]="WebGL2",X})(l0||{}),f0=((X)=>{return X[X.Play=0]="Play",X[X.Pause=1]="Pause",X[X.Seeked=2]="Seeked",X[X.VolumeChange=3]="VolumeChange",X[X.RateChange=4]="RateChange",X})(f0||{});var uX=((X)=>{return X[X.Document=0]="Document",X[X.DocumentType=1]="DocumentType",X[X.Element=2]="Element",X[X.Text=3]="Text",X[X.CDATA=4]="CDATA",X[X.Comment=5]="Comment",X})(uX||{});function o9(X){return"__ln"in X}class pX{constructor(){P(this,"length",0),P(this,"head",null),P(this,"tail",null)}get(X){if(X>=this.length)throw Error("Position outside of list range");let J=this.head;for(let Z=0;Z<X;Z++)J=(J==null?void 0:J.next)||null;return J}addNode(X){let J={value:X,previous:null,next:null};if(X.__ln=J,X.previousSibling&&o9(X.previousSibling)){let Z=X.previousSibling.__ln.next;if(J.next=Z,J.previous=X.previousSibling.__ln,X.previousSibling.__ln.next=J,Z)Z.previous=J}else if(X.nextSibling&&o9(X.nextSibling)&&X.nextSibling.__ln.previous){let Z=X.nextSibling.__ln.previous;if(J.previous=Z,J.next=X.nextSibling.__ln,X.nextSibling.__ln.previous=J,Z)Z.next=J}else{if(this.head)this.head.previous=J;J.next=this.head,this.head=J}if(J.next===null)this.tail=J;this.length++}removeNode(X){let J=X.__ln;if(!this.head)return;if(!J.previous)if(this.head=J.next,this.head)this.head.previous=null;else this.tail=null;else if(J.previous.next=J.next,J.next)J.next.previous=J.previous;else this.tail=J.previous;if(X.__ln)delete X.__ln;this.length--}}var n9=(X,J)=>`${X}@${J}`;class cX{constructor(){P(this,"frozen",!1),P(this,"locked",!1),P(this,"texts",[]),P(this,"attributes",[]),P(this,"attributeMap",new WeakMap),P(this,"removes",[]),P(this,"mapRemoves",[]),P(this,"movedMap",{}),P(this,"addedSet",new Set),P(this,"movedSet",new Set),P(this,"droppedSet",new Set),P(this,"removesSubTreeCache",new Set),P(this,"mutationCb"),P(this,"blockClass"),P(this,"blockSelector"),P(this,"maskTextClass"),P(this,"maskTextSelector"),P(this,"inlineStylesheet"),P(this,"maskInputOptions"),P(this,"maskTextFn"),P(this,"maskInputFn"),P(this,"keepIframeSrcFn"),P(this,"recordCanvas"),P(this,"inlineImages"),P(this,"slimDOMOptions"),P(this,"dataURLOptions"),P(this,"doc"),P(this,"mirror"),P(this,"iframeManager"),P(this,"stylesheetManager"),P(this,"shadowDomManager"),P(this,"canvasManager"),P(this,"processedNodeManager"),P(this,"unattachedDoc"),P(this,"processMutations",(X)=>{X.forEach(this.processMutation),this.emit()}),P(this,"emit",()=>{if(this.frozen||this.locked)return;let X=[],J=new Set,Z=new pX,Q=(V)=>{let K=V,W=X1;while(W===X1)K=K&&K.nextSibling,W=K&&this.mirror.getId(K);return W},Y=(V)=>{let K=w.parentNode(V);if(!K||!mX(V))return;let W=!1;if(V.nodeType===Node.TEXT_NODE){let H=K.tagName;if(H==="TEXTAREA")return;else if(H==="STYLE"&&this.addedSet.has(K))W=!0}let j=e0(K)?this.mirror.getId(gX(V)):this.mirror.getId(K),U=Q(V);if(j===-1||U===-1)return Z.addNode(V);let z=v0(V,{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:(H)=>{if(vX(H,this.mirror))this.iframeManager.addIframe(H);if(hX(H,this.mirror))this.stylesheetManager.trackLinkElement(H);if(AZ(V))this.shadowDomManager.addShadowRoot(w.shadowRoot(V),this.doc)},onIframeLoad:(H,D)=>{this.iframeManager.attachIframe(H,D),this.shadowDomManager.observeAttachShadow(H)},onStylesheetLoad:(H,D)=>{this.stylesheetManager.attachLinkElement(H,D)},cssCaptured:W});if(z)X.push({parentId:j,nextId:U,node:z}),J.add(z.id)};while(this.mapRemoves.length)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let V of this.movedSet){if(t9(this.removesSubTreeCache,V,this.mirror)&&!this.movedSet.has(w.parentNode(V)))continue;Y(V)}for(let V of this.addedSet)if(!e9(this.droppedSet,V)&&!t9(this.removesSubTreeCache,V,this.mirror))Y(V);else if(e9(this.movedSet,V))Y(V);else this.droppedSet.add(V);let q=null;while(Z.length){let V=null;if(q){let K=this.mirror.getId(w.parentNode(q.value)),W=Q(q.value);if(K!==-1&&W!==-1)V=q}if(!V){let K=Z.tail;while(K){let W=K;if(K=K.previous,W){let j=this.mirror.getId(w.parentNode(W.value));if(Q(W.value)===-1)continue;else if(j!==-1){V=W;break}else{let z=W.value,H=w.parentNode(z);if(H&&H.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let D=w.host(H);if(this.mirror.getId(D)!==-1){V=W;break}}}}}}if(!V){while(Z.head)Z.removeNode(Z.head.value);break}q=V.previous,Z.removeNode(V.value),Y(V.value)}let G={texts:this.texts.map((V)=>{let K=V.node,W=w.parentNode(K);if(W&&W.tagName==="TEXTAREA")this.genTextAreaValueMutation(W);return{id:this.mirror.getId(K),value:V.value}}).filter((V)=>!J.has(V.id)).filter((V)=>this.mirror.has(V.id)),attributes:this.attributes.map((V)=>{let{attributes:K}=V;if(typeof K.style==="string"){let W=JSON.stringify(V.styleDiff),j=JSON.stringify(V._unchangedStyles);if(W.length<K.style.length){if((W+j).split("var(").length===K.style.split("var(").length)K.style=V.styleDiff}}return{id:this.mirror.getId(V.node),attributes:K}}).filter((V)=>!J.has(V.id)).filter((V)=>this.mirror.has(V.id)),removes:this.removes,adds:X};if(!G.texts.length&&!G.attributes.length&&!G.removes.length&&!G.adds.length)return;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(G)}),P(this,"genTextAreaValueMutation",(X)=>{let J=this.attributeMap.get(X);if(!J)J={node:X,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(J),this.attributeMap.set(X,J);let Z=Array.from(w.childNodes(X),(Q)=>w.textContent(Q)||"").join("");J.attributes.value=n1({element:X,maskInputOptions:this.maskInputOptions,tagName:X.tagName,type:t1(X),value:Z,maskInputFn:this.maskInputFn})}),P(this,"processMutation",(X)=>{if(mJ(X.target,this.mirror,this.slimDOMOptions))return;switch(X.type){case"characterData":{let J=w.textContent(X.target);if(!n(X.target,this.blockClass,this.blockSelector,!1)&&J!==X.oldValue)this.texts.push({value:z6(X.target,this.maskTextClass,this.maskTextSelector,!0)&&J?this.maskTextFn?this.maskTextFn(J,bX(X.target)):J.replace(/[\S]/g,"*"):J,node:X.target});break}case"attributes":{let{target:J,attributeName:Z}=X,Q=X.target.getAttribute(Z);if(Z==="value"){let q=t1(J);Q=n1({element:J,maskInputOptions:this.maskInputOptions,tagName:J.tagName,type:q,value:Q,maskInputFn:this.maskInputFn})}if(n(X.target,this.blockClass,this.blockSelector,!1)||Q===X.oldValue)return;let Y=this.attributeMap.get(X.target);if(J.tagName==="IFRAME"&&Z==="src"&&!this.keepIframeSrcFn(Q))if(!J.contentDocument)Z="rr_src";else return;if(!Y)Y={node:X.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(Y),this.attributeMap.set(X.target,Y);if(Z==="type"&&J.tagName==="INPUT"&&(X.oldValue||"").toLowerCase()==="password")J.setAttribute("data-rr-is-password","true");if(!B6(J.tagName,Z)){if(Y.attributes[Z]=U6(this.doc,$0(J.tagName),$0(Z),Q),Z==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(G){this.unattachedDoc=this.doc}let q=this.unattachedDoc.createElement("span");if(X.oldValue)q.setAttribute("style",X.oldValue);for(let G of Array.from(J.style)){let V=J.style.getPropertyValue(G),K=J.style.getPropertyPriority(G);if(V!==q.style.getPropertyValue(G)||K!==q.style.getPropertyPriority(G))if(K==="")Y.styleDiff[G]=V;else Y.styleDiff[G]=[V,K];else Y._unchangedStyles[G]=[V,K]}for(let G of Array.from(q.style))if(J.style.getPropertyValue(G)==="")Y.styleDiff[G]=!1}else if(Z==="open"&&J.tagName==="DIALOG")if(J.matches("dialog:modal"))Y.attributes.rr_open_mode="modal";else Y.attributes.rr_open_mode="non-modal"}break}case"childList":{if(n(X.target,this.blockClass,this.blockSelector,!0))return;if(X.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(X.target);return}X.addedNodes.forEach((J)=>this.genAdds(J,X.target)),X.removedNodes.forEach((J)=>{let Z=this.mirror.getId(J),Q=e0(X.target)?this.mirror.getId(w.host(X.target)):this.mirror.getId(X.target);if(n(X.target,this.blockClass,this.blockSelector,!1)||mJ(J,this.mirror,this.slimDOMOptions)||!BG(J,this.mirror))return;if(this.addedSet.has(J))MZ(this.addedSet,J),this.droppedSet.add(J);else if(this.addedSet.has(X.target)&&Z===-1);else if(kX(X.target,this.mirror));else if(this.movedSet.has(J)&&this.movedMap[n9(Z,Q)])MZ(this.movedSet,J);else this.removes.push({parentId:Q,id:Z,isShadow:e0(X.target)&&J1(X.target)?!0:void 0}),DG(J,this.removesSubTreeCache);this.mapRemoves.push(J)});break}}}),P(this,"genAdds",(X,J)=>{if(this.processedNodeManager.inOtherBuffer(X,this))return;if(this.addedSet.has(X)||this.movedSet.has(X))return;if(this.mirror.hasNode(X)){if(mJ(X,this.mirror,this.slimDOMOptions))return;this.movedSet.add(X);let Z=null;if(J&&this.mirror.hasNode(J))Z=this.mirror.getId(J);if(Z&&Z!==-1)this.movedMap[n9(this.mirror.getId(X),Z)]=!0}else this.addedSet.add(X),this.droppedSet.delete(X);if(!n(X,this.blockClass,this.blockSelector,!1)){if(w.childNodes(X).forEach((Z)=>this.genAdds(Z)),AZ(X))w.childNodes(w.shadowRoot(X)).forEach((Z)=>{this.processedNodeManager.add(Z,this),this.genAdds(Z,X)})}})}init(X){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach((J)=>{this[J]=X[J]})}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 MZ(X,J){X.delete(J),w.childNodes(J).forEach((Z)=>MZ(X,Z))}function DG(X,J){let Z=[X];while(Z.length){let Q=Z.pop();if(J.has(Q))continue;J.add(Q),w.childNodes(Q).forEach((Y)=>Z.push(Y))}return}function t9(X,J,Z){if(X.size===0)return!1;return FG(X,J)}function FG(X,J,Z){let Q=w.parentNode(J);if(!Q)return!1;return X.has(Q)}function e9(X,J){if(X.size===0)return!1;return lX(X,J)}function lX(X,J){let Z=w.parentNode(J);if(!Z)return!1;if(X.has(Z))return!0;return lX(X,Z)}var Z1;function PG(X){Z1=X}function OG(){Z1=void 0}var $=(X)=>{if(!Z1)return X;return(...Z)=>{try{return X(...Z)}catch(Q){if(Z1&&Z1(Q)===!0)return;throw Q}}},C0=[];function D1(X){try{if("composedPath"in X){let J=X.composedPath();if(J.length)return J[0]}else if("path"in X&&X.path.length)return X.path[0]}catch{}return X&&X.target}function dX(X,J){let Z=new cX;C0.push(Z),Z.init(X);let Q=new(SX())($(Z.processMutations.bind(Z)));return Q.observe(J,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),Q}function AG({mousemoveCb:X,sampling:J,doc:Z,mirror:Q}){if(J.mousemove===!1)return()=>{};let Y=typeof J.mousemove==="number"?J.mousemove:50,q=typeof J.mousemoveCallback==="number"?J.mousemoveCallback:500,G=[],V,K=U1($((U)=>{let z=Date.now()-V;X(G.map((H)=>{return H.timeOffset-=z,H}),U),G=[],V=null}),q),W=$(U1($((U)=>{let z=D1(U),{clientX:H,clientY:D}=OZ(U)?U.changedTouches[0]:U;if(!V)V=WJ();G.push({x:H,y:D,id:Q.getId(z),timeOffset:WJ()-V}),K(typeof DragEvent<"u"&&U instanceof DragEvent?_.Drag:U instanceof MouseEvent?_.MouseMove:_.TouchMove)}),Y,{trailing:!1})),j=[o("mousemove",W,Z),o("touchmove",W,Z),o("drag",W,Z)];return $(()=>{j.forEach((U)=>U())})}function MG({mouseInteractionCb:X,doc:J,mirror:Z,blockClass:Q,blockSelector:Y,sampling:q}){if(q.mouseInteraction===!1)return()=>{};let G=q.mouseInteraction===!0||q.mouseInteraction===void 0?{}:q.mouseInteraction,V=[],K=null,W=(j)=>{return(U)=>{let z=D1(U);if(n(z,Q,Y,!0))return;let H=null,D=j;if("pointerType"in U){switch(U.pointerType){case"mouse":H=z0.Mouse;break;case"touch":H=z0.Touch;break;case"pen":H=z0.Pen;break}if(H===z0.Touch){if(t[j]===t.MouseDown)D="TouchStart";else if(t[j]===t.MouseUp)D="TouchEnd"}else if(H===z0.Pen);}else if(OZ(U))H=z0.Touch;if(H!==null){if(K=H,D.startsWith("Touch")&&H===z0.Touch||D.startsWith("Mouse")&&H===z0.Mouse)H=null}else if(t[j]===t.Click)H=K,K=null;let L=OZ(U)?U.changedTouches[0]:U;if(!L)return;let B=Z.getId(z),{clientX:A,clientY:O}=L;$(X)({type:t[D],id:B,x:A,y:O,...H!==null&&{pointerType:H}})}};return Object.keys(t).filter((j)=>Number.isNaN(Number(j))&&!j.endsWith("_Departed")&&G[j]!==!1).forEach((j)=>{let U=$0(j),z=W(j);if(window.PointerEvent)switch(t[j]){case t.MouseDown:case t.MouseUp:U=U.replace("mouse","pointer");break;case t.TouchStart:case t.TouchEnd:return}V.push(o(U,z,J))}),$(()=>{V.forEach((j)=>j())})}function iX({scrollCb:X,doc:J,mirror:Z,blockClass:Q,blockSelector:Y,sampling:q}){let G=$(U1($((V)=>{let K=D1(V);if(!K||n(K,Q,Y,!0))return;let W=Z.getId(K);if(K===J&&J.defaultView){let j=TX(J.defaultView);X({id:W,x:j.left,y:j.top})}else X({id:W,x:K.scrollLeft,y:K.scrollTop})}),q.scroll||100));return o("scroll",G,J)}function wG({viewportResizeCb:X},{win:J}){let Z=-1,Q=-1,Y=$(U1($(()=>{let q=xX(),G=fX();if(Z!==q||Q!==G)X({width:Number(G),height:Number(q)}),Z=q,Q=G}),200));return o("resize",Y,J)}var _G=["INPUT","TEXTAREA","SELECT"],J6=new WeakMap;function CG({inputCb:X,doc:J,mirror:Z,blockClass:Q,blockSelector:Y,ignoreClass:q,ignoreSelector:G,maskInputOptions:V,maskInputFn:K,sampling:W,userTriggeredOnInput:j}){function U(O){let F=D1(O),M=O.isTrusted,T=F&&F.tagName;if(F&&T==="OPTION")F=w.parentElement(F);if(!F||!T||_G.indexOf(T)<0||n(F,Q,Y,!0))return;if(F.classList.contains(q)||G&&F.matches(G))return;let f=F.value,l=!1,h=t1(F)||"";if(h==="radio"||h==="checkbox")l=F.checked;else if(V[T.toLowerCase()]||V[h])f=n1({element:F,maskInputOptions:V,tagName:T,type:h,value:f,maskInputFn:K});z(F,j?{text:f,isChecked:l,userTriggered:M}:{text:f,isChecked:l});let c=F.name;if(h==="radio"&&c&&l)J.querySelectorAll(`input[type="radio"][name="${c}"]`).forEach((a)=>{if(a!==F){let J0=a.value;z(a,j?{text:J0,isChecked:!l,userTriggered:!1}:{text:J0,isChecked:!l})}})}function z(O,F){let M=J6.get(O);if(!M||M.text!==F.text||M.isChecked!==F.isChecked){J6.set(O,F);let T=Z.getId(O);$(X)({...F,id:T})}}let D=(W.input==="last"?["change"]:["input","change"]).map((O)=>o(O,$(U),J)),L=J.defaultView;if(!L)return()=>{D.forEach((O)=>O())};let B=L.Object.getOwnPropertyDescriptor(L.HTMLInputElement.prototype,"value"),A=[[L.HTMLInputElement.prototype,"value"],[L.HTMLInputElement.prototype,"checked"],[L.HTMLSelectElement.prototype,"value"],[L.HTMLTextAreaElement.prototype,"value"],[L.HTMLSelectElement.prototype,"selectedIndex"],[L.HTMLOptionElement.prototype,"selected"]];if(B&&B.set)D.push(...A.map((O)=>wJ(O[0],O[1],{set(){$(U)({target:this,isTrusted:!1})}},!1,L)));return $(()=>{D.forEach((O)=>O())})}function jJ(X){let J=[];function Z(Q,Y){if(c1("CSSGroupingRule")&&Q.parentRule instanceof CSSGroupingRule||c1("CSSMediaRule")&&Q.parentRule instanceof CSSMediaRule||c1("CSSSupportsRule")&&Q.parentRule instanceof CSSSupportsRule||c1("CSSConditionRule")&&Q.parentRule instanceof CSSConditionRule){let G=Array.from(Q.parentRule.cssRules).indexOf(Q);Y.unshift(G)}else if(Q.parentStyleSheet){let G=Array.from(Q.parentStyleSheet.cssRules).indexOf(Q);Y.unshift(G)}return Y}return Z(X,J)}function P0(X,J,Z){let Q,Y;if(!X)return{};if(X.ownerNode)Q=J.getId(X.ownerNode);else Y=Z.getId(X);return{styleId:Y,id:Q}}function $G({styleSheetRuleCb:X,mirror:J,stylesheetManager:Z},{win:Q}){if(!Q.CSSStyleSheet||!Q.CSSStyleSheet.prototype)return()=>{};let Y=Q.CSSStyleSheet.prototype.insertRule;Q.CSSStyleSheet.prototype.insertRule=new Proxy(Y,{apply:$((j,U,z)=>{let[H,D]=z,{id:L,styleId:B}=P0(U,J,Z.styleMirror);if(L&&L!==-1||B&&B!==-1)X({id:L,styleId:B,adds:[{rule:H,index:D}]});return j.apply(U,z)})}),Q.CSSStyleSheet.prototype.addRule=function(j,U,z=this.cssRules.length){let H=`${j} { ${U} }`;return Q.CSSStyleSheet.prototype.insertRule.apply(this,[H,z])};let q=Q.CSSStyleSheet.prototype.deleteRule;Q.CSSStyleSheet.prototype.deleteRule=new Proxy(q,{apply:$((j,U,z)=>{let[H]=z,{id:D,styleId:L}=P0(U,J,Z.styleMirror);if(D&&D!==-1||L&&L!==-1)X({id:D,styleId:L,removes:[{index:H}]});return j.apply(U,z)})}),Q.CSSStyleSheet.prototype.removeRule=function(j){return Q.CSSStyleSheet.prototype.deleteRule.apply(this,[j])};let G;if(Q.CSSStyleSheet.prototype.replace)G=Q.CSSStyleSheet.prototype.replace,Q.CSSStyleSheet.prototype.replace=new Proxy(G,{apply:$((j,U,z)=>{let[H]=z,{id:D,styleId:L}=P0(U,J,Z.styleMirror);if(D&&D!==-1||L&&L!==-1)X({id:D,styleId:L,replace:H});return j.apply(U,z)})});let V;if(Q.CSSStyleSheet.prototype.replaceSync)V=Q.CSSStyleSheet.prototype.replaceSync,Q.CSSStyleSheet.prototype.replaceSync=new Proxy(V,{apply:$((j,U,z)=>{let[H]=z,{id:D,styleId:L}=P0(U,J,Z.styleMirror);if(D&&D!==-1||L&&L!==-1)X({id:D,styleId:L,replaceSync:H});return j.apply(U,z)})});let K={};if(l1("CSSGroupingRule"))K.CSSGroupingRule=Q.CSSGroupingRule;else{if(l1("CSSMediaRule"))K.CSSMediaRule=Q.CSSMediaRule;if(l1("CSSConditionRule"))K.CSSConditionRule=Q.CSSConditionRule;if(l1("CSSSupportsRule"))K.CSSSupportsRule=Q.CSSSupportsRule}let W={};return Object.entries(K).forEach(([j,U])=>{W[j]={insertRule:U.prototype.insertRule,deleteRule:U.prototype.deleteRule},U.prototype.insertRule=new Proxy(W[j].insertRule,{apply:$((z,H,D)=>{let[L,B]=D,{id:A,styleId:O}=P0(H.parentStyleSheet,J,Z.styleMirror);if(A&&A!==-1||O&&O!==-1)X({id:A,styleId:O,adds:[{rule:L,index:[...jJ(H),B||0]}]});return z.apply(H,D)})}),U.prototype.deleteRule=new Proxy(W[j].deleteRule,{apply:$((z,H,D)=>{let[L]=D,{id:B,styleId:A}=P0(H.parentStyleSheet,J,Z.styleMirror);if(B&&B!==-1||A&&A!==-1)X({id:B,styleId:A,removes:[{index:[...jJ(H),L]}]});return z.apply(H,D)})})}),$(()=>{Q.CSSStyleSheet.prototype.insertRule=Y,Q.CSSStyleSheet.prototype.deleteRule=q,G&&(Q.CSSStyleSheet.prototype.replace=G),V&&(Q.CSSStyleSheet.prototype.replaceSync=V),Object.entries(K).forEach(([j,U])=>{U.prototype.insertRule=W[j].insertRule,U.prototype.deleteRule=W[j].deleteRule})})}function sX({mirror:X,stylesheetManager:J},Z){var Q,Y,q;let G=null;if(Z.nodeName==="#document")G=X.getId(Z);else G=X.getId(w.host(Z));let V=Z.nodeName==="#document"?(Q=Z.defaultView)==null?void 0:Q.Document:(q=(Y=Z.ownerDocument)==null?void 0:Y.defaultView)==null?void 0:q.ShadowRoot,K=(V==null?void 0:V.prototype)?Object.getOwnPropertyDescriptor(V==null?void 0:V.prototype,"adoptedStyleSheets"):void 0;if(G===null||G===-1||!V||!K)return()=>{};return Object.defineProperty(Z,"adoptedStyleSheets",{configurable:K.configurable,enumerable:K.enumerable,get(){var W;return(W=K.get)==null?void 0:W.call(this)},set(W){var j;let U=(j=K.set)==null?void 0:j.call(this,W);if(G!==null&&G!==-1)try{J.adoptStyleSheets(W,G)}catch(z){}return U}}),$(()=>{Object.defineProperty(Z,"adoptedStyleSheets",{configurable:K.configurable,enumerable:K.enumerable,get:K.get,set:K.set})})}function RG({styleDeclarationCb:X,mirror:J,ignoreCSSAttributes:Z,stylesheetManager:Q},{win:Y}){let q=Y.CSSStyleDeclaration.prototype.setProperty;Y.CSSStyleDeclaration.prototype.setProperty=new Proxy(q,{apply:$((V,K,W)=>{var j;let[U,z,H]=W;if(Z.has(U))return q.apply(K,[U,z,H]);let{id:D,styleId:L}=P0((j=K.parentRule)==null?void 0:j.parentStyleSheet,J,Q.styleMirror);if(D&&D!==-1||L&&L!==-1)X({id:D,styleId:L,set:{property:U,value:z,priority:H},index:jJ(K.parentRule)});return V.apply(K,W)})});let G=Y.CSSStyleDeclaration.prototype.removeProperty;return Y.CSSStyleDeclaration.prototype.removeProperty=new Proxy(G,{apply:$((V,K,W)=>{var j;let[U]=W;if(Z.has(U))return G.apply(K,[U]);let{id:z,styleId:H}=P0((j=K.parentRule)==null?void 0:j.parentStyleSheet,J,Q.styleMirror);if(z&&z!==-1||H&&H!==-1)X({id:z,styleId:H,remove:{property:U},index:jJ(K.parentRule)});return V.apply(K,W)})}),$(()=>{Y.CSSStyleDeclaration.prototype.setProperty=q,Y.CSSStyleDeclaration.prototype.removeProperty=G})}function EG({mediaInteractionCb:X,blockClass:J,blockSelector:Z,mirror:Q,sampling:Y,doc:q}){let G=$((K)=>U1($((W)=>{let j=D1(W);if(!j||n(j,J,Z,!0))return;let{currentTime:U,volume:z,muted:H,playbackRate:D,loop:L}=j;X({type:K,id:Q.getId(j),currentTime:U,volume:z,muted:H,playbackRate:D,loop:L})}),Y.media||500)),V=[o("play",G(f0.Play),q),o("pause",G(f0.Pause),q),o("seeked",G(f0.Seeked),q),o("volumechange",G(f0.VolumeChange),q),o("ratechange",G(f0.RateChange),q)];return $(()=>{V.forEach((K)=>K())})}function NG({fontCb:X,doc:J}){let Z=J.defaultView;if(!Z)return()=>{};let Q=[],Y=new WeakMap,q=Z.FontFace;Z.FontFace=function(K,W,j){let U=new q(K,W,j);return Y.set(U,{family:K,buffer:typeof W!=="string",descriptors:j,fontSource:typeof W==="string"?W:JSON.stringify(Array.from(new Uint8Array(W)))}),U};let G=N0(J.fonts,"add",function(V){return function(K){return setTimeout($(()=>{let W=Y.get(K);if(W)X(W),Y.delete(K)}),0),V.apply(this,[K])}});return Q.push(()=>{Z.FontFace=q}),Q.push(G),$(()=>{Q.forEach((V)=>V())})}function IG(X){let{doc:J,mirror:Z,blockClass:Q,blockSelector:Y,selectionCb:q}=X,G=!0,V=$(()=>{let K=J.getSelection();if(!K||G&&(K==null?void 0:K.isCollapsed))return;G=K.isCollapsed||!1;let W=[],j=K.rangeCount||0;for(let U=0;U<j;U++){let z=K.getRangeAt(U),{startContainer:H,startOffset:D,endContainer:L,endOffset:B}=z;if(n(H,Q,Y,!0)||n(L,Q,Y,!0))continue;W.push({start:Z.getId(H),startOffset:D,end:Z.getId(L),endOffset:B})}q({ranges:W})});return V(),o("selectionchange",V)}function SG({doc:X,customElementCb:J}){let Z=X.defaultView;if(!Z||!Z.customElements)return()=>{};return N0(Z.customElements,"define",function(Y){return function(q,G,V){try{J({define:{name:q}})}catch(K){console.warn(`Custom element callback failed for ${q}`)}return Y.apply(this,[q,G,V])}})}function TG(X,J){let{mutationCb:Z,mousemoveCb:Q,mouseInteractionCb:Y,scrollCb:q,viewportResizeCb:G,inputCb:V,mediaInteractionCb:K,styleSheetRuleCb:W,styleDeclarationCb:j,canvasMutationCb:U,fontCb:z,selectionCb:H,customElementCb:D}=X;X.mutationCb=(...L)=>{if(J.mutation)J.mutation(...L);Z(...L)},X.mousemoveCb=(...L)=>{if(J.mousemove)J.mousemove(...L);Q(...L)},X.mouseInteractionCb=(...L)=>{if(J.mouseInteraction)J.mouseInteraction(...L);Y(...L)},X.scrollCb=(...L)=>{if(J.scroll)J.scroll(...L);q(...L)},X.viewportResizeCb=(...L)=>{if(J.viewportResize)J.viewportResize(...L);G(...L)},X.inputCb=(...L)=>{if(J.input)J.input(...L);V(...L)},X.mediaInteractionCb=(...L)=>{if(J.mediaInteaction)J.mediaInteaction(...L);K(...L)},X.styleSheetRuleCb=(...L)=>{if(J.styleSheetRule)J.styleSheetRule(...L);W(...L)},X.styleDeclarationCb=(...L)=>{if(J.styleDeclaration)J.styleDeclaration(...L);j(...L)},X.canvasMutationCb=(...L)=>{if(J.canvasMutation)J.canvasMutation(...L);U(...L)},X.fontCb=(...L)=>{if(J.font)J.font(...L);z(...L)},X.selectionCb=(...L)=>{if(J.selection)J.selection(...L);H(...L)},X.customElementCb=(...L)=>{if(J.customElement)J.customElement(...L);D(...L)}}function xG(X,J={}){let Z=X.doc.defaultView;if(!Z)return()=>{};TG(X,J);let Q;if(X.recordDOM)Q=dX(X,X.doc);let Y=AG(X),q=MG(X),G=iX(X),V=wG(X,{win:Z}),K=CG(X),W=EG(X),j=()=>{},U=()=>{},z=()=>{},H=()=>{};if(X.recordDOM){if(j=$G(X,{win:Z}),U=sX(X,X.doc),z=RG(X,{win:Z}),X.collectFonts)H=NG(X)}let D=IG(X),L=SG(X),B=[];for(let A of X.plugins)B.push(A.observer(A.callback,Z,A.options));return $(()=>{C0.forEach((A)=>A.reset()),Q==null||Q.disconnect(),Y(),q(),G(),V(),K(),W(),j(),U(),z(),H(),D(),L(),B.forEach((A)=>A())})}function c1(X){return typeof window[X]<"u"}function l1(X){return Boolean(typeof window[X]<"u"&&window[X].prototype&&"insertRule"in window[X].prototype&&"deleteRule"in window[X].prototype)}class wZ{constructor(X){P(this,"iframeIdToRemoteIdMap",new WeakMap),P(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=X}getId(X,J,Z,Q){let Y=Z||this.getIdToRemoteIdMap(X),q=Q||this.getRemoteIdToIdMap(X),G=Y.get(J);if(!G)G=this.generateIdFn(),Y.set(J,G),q.set(G,J);return G}getIds(X,J){let Z=this.getIdToRemoteIdMap(X),Q=this.getRemoteIdToIdMap(X);return J.map((Y)=>this.getId(X,Y,Z,Q))}getRemoteId(X,J,Z){let Q=Z||this.getRemoteIdToIdMap(X);if(typeof J!=="number")return J;let Y=Q.get(J);if(!Y)return-1;return Y}getRemoteIds(X,J){let Z=this.getRemoteIdToIdMap(X);return J.map((Q)=>this.getRemoteId(X,Q,Z))}reset(X){if(!X){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(X),this.iframeRemoteIdToIdMap.delete(X)}getIdToRemoteIdMap(X){let J=this.iframeIdToRemoteIdMap.get(X);if(!J)J=new Map,this.iframeIdToRemoteIdMap.set(X,J);return J}getRemoteIdToIdMap(X){let J=this.iframeRemoteIdToIdMap.get(X);if(!J)J=new Map,this.iframeRemoteIdToIdMap.set(X,J);return J}}class aX{constructor(X){if(P(this,"iframes",new WeakMap),P(this,"crossOriginIframeMap",new WeakMap),P(this,"crossOriginIframeMirror",new wZ(j6)),P(this,"crossOriginIframeStyleMirror"),P(this,"crossOriginIframeRootIdMap",new WeakMap),P(this,"mirror"),P(this,"mutationCb"),P(this,"wrappedEmit"),P(this,"loadListener"),P(this,"stylesheetManager"),P(this,"recordCrossOriginIframes"),this.mutationCb=X.mutationCb,this.wrappedEmit=X.wrappedEmit,this.stylesheetManager=X.stylesheetManager,this.recordCrossOriginIframes=X.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new wZ(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=X.mirror,this.recordCrossOriginIframes)window.addEventListener("message",this.handleMessage.bind(this))}addIframe(X){if(this.iframes.set(X,!0),X.contentWindow)this.crossOriginIframeMap.set(X.contentWindow,X)}addLoadListener(X){this.loadListener=X}attachIframe(X,J){var Z,Q;if(this.mutationCb({adds:[{parentId:this.mirror.getId(X),nextId:null,node:J}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes)(Z=X.contentWindow)==null||Z.addEventListener("message",this.handleMessage.bind(this));if((Q=this.loadListener)==null||Q.call(this,X),X.contentDocument&&X.contentDocument.adoptedStyleSheets&&X.contentDocument.adoptedStyleSheets.length>0)this.stylesheetManager.adoptStyleSheets(X.contentDocument.adoptedStyleSheets,this.mirror.getId(X.contentDocument))}handleMessage(X){let J=X;if(J.data.type!=="rrweb"||J.origin!==J.data.origin)return;if(!X.source)return;let Q=this.crossOriginIframeMap.get(X.source);if(!Q)return;let Y=this.transformCrossOriginEvent(Q,J.data.event);if(Y)this.wrappedEmit(Y,J.data.isCheckout)}transformCrossOriginEvent(X,J){var Z;switch(J.type){case R.FullSnapshot:{this.crossOriginIframeMirror.reset(X),this.crossOriginIframeStyleMirror.reset(X),this.replaceIdOnNode(J.data.node,X);let Q=J.data.node.id;return this.crossOriginIframeRootIdMap.set(X,Q),this.patchRootIdOnNode(J.data.node,Q),{timestamp:J.timestamp,type:R.IncrementalSnapshot,data:{source:_.Mutation,adds:[{parentId:this.mirror.getId(X),nextId:null,node:J.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case R.Meta:case R.Load:case R.DomContentLoaded:return!1;case R.Plugin:return J;case R.Custom:return this.replaceIds(J.data.payload,X,["id","parentId","previousId","nextId"]),J;case R.IncrementalSnapshot:switch(J.data.source){case _.Mutation:return J.data.adds.forEach((Q)=>{this.replaceIds(Q,X,["parentId","nextId","previousId"]),this.replaceIdOnNode(Q.node,X);let Y=this.crossOriginIframeRootIdMap.get(X);Y&&this.patchRootIdOnNode(Q.node,Y)}),J.data.removes.forEach((Q)=>{this.replaceIds(Q,X,["parentId","id"])}),J.data.attributes.forEach((Q)=>{this.replaceIds(Q,X,["id"])}),J.data.texts.forEach((Q)=>{this.replaceIds(Q,X,["id"])}),J;case _.Drag:case _.TouchMove:case _.MouseMove:return J.data.positions.forEach((Q)=>{this.replaceIds(Q,X,["id"])}),J;case _.ViewportResize:return!1;case _.MediaInteraction:case _.MouseInteraction:case _.Scroll:case _.CanvasMutation:case _.Input:return this.replaceIds(J.data,X,["id"]),J;case _.StyleSheetRule:case _.StyleDeclaration:return this.replaceIds(J.data,X,["id"]),this.replaceStyleIds(J.data,X,["styleId"]),J;case _.Font:return J;case _.Selection:return J.data.ranges.forEach((Q)=>{this.replaceIds(Q,X,["start","end"])}),J;case _.AdoptedStyleSheet:return this.replaceIds(J.data,X,["id"]),this.replaceStyleIds(J.data,X,["styleIds"]),(Z=J.data.styles)==null||Z.forEach((Q)=>{this.replaceStyleIds(Q,X,["styleId"])}),J}}return!1}replace(X,J,Z,Q){for(let Y of Q){if(!Array.isArray(J[Y])&&typeof J[Y]!=="number")continue;if(Array.isArray(J[Y]))J[Y]=X.getIds(Z,J[Y]);else J[Y]=X.getId(Z,J[Y])}return J}replaceIds(X,J,Z){return this.replace(this.crossOriginIframeMirror,X,J,Z)}replaceStyleIds(X,J,Z){return this.replace(this.crossOriginIframeStyleMirror,X,J,Z)}replaceIdOnNode(X,J){if(this.replaceIds(X,J,["id","rootId"]),"childNodes"in X)X.childNodes.forEach((Z)=>{this.replaceIdOnNode(Z,J)})}patchRootIdOnNode(X,J){if(X.type!==uX.Document&&!X.rootId)X.rootId=J;if("childNodes"in X)X.childNodes.forEach((Z)=>{this.patchRootIdOnNode(Z,J)})}}class rX{constructor(X){P(this,"shadowDoms",new WeakSet),P(this,"mutationCb"),P(this,"scrollCb"),P(this,"bypassOptions"),P(this,"mirror"),P(this,"restoreHandlers",[]),this.mutationCb=X.mutationCb,this.scrollCb=X.scrollCb,this.bypassOptions=X.bypassOptions,this.mirror=X.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(X,J){if(!J1(X))return;if(this.shadowDoms.has(X))return;this.shadowDoms.add(X);let Z=dX({...this.bypassOptions,doc:J,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},X);this.restoreHandlers.push(()=>Z.disconnect()),this.restoreHandlers.push(iX({...this.bypassOptions,scrollCb:this.scrollCb,doc:X,mirror:this.mirror})),setTimeout(()=>{if(X.adoptedStyleSheets&&X.adoptedStyleSheets.length>0)this.bypassOptions.stylesheetManager.adoptStyleSheets(X.adoptedStyleSheets,this.mirror.getId(w.host(X)));this.restoreHandlers.push(sX({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},X))},0)}observeAttachShadow(X){if(!X.contentWindow||!X.contentDocument)return;this.patchAttachShadow(X.contentWindow.Element,X.contentDocument)}patchAttachShadow(X,J){let Z=this;this.restoreHandlers.push(N0(X.prototype,"attachShadow",function(Q){return function(Y){let q=Q.call(this,Y),G=w.shadowRoot(this);if(G&&mX(this))Z.addShadowRoot(G,J);return q}}))}reset(){this.restoreHandlers.forEach((X)=>{try{X()}catch(J){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}var h0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fG=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(b0=0;b0<h0.length;b0++)fG[h0.charCodeAt(b0)]=b0;var b0,bG=function(X){var J=new Uint8Array(X),Z,Q=J.length,Y="";for(Z=0;Z<Q;Z+=3)Y+=h0[J[Z]>>2],Y+=h0[(J[Z]&3)<<4|J[Z+1]>>4],Y+=h0[(J[Z+1]&15)<<2|J[Z+2]>>6],Y+=h0[J[Z+2]&63];if(Q%3===2)Y=Y.substring(0,Y.length-1)+"=";else if(Q%3===1)Y=Y.substring(0,Y.length-2)+"==";return Y};var Z6=new Map;function kG(X,J){let Z=Z6.get(X);if(!Z)Z=new Map,Z6.set(X,Z);if(!Z.has(J))Z.set(J,[]);return Z.get(J)}var oX=(X,J,Z)=>{if(!X||!(tX(X,J)||typeof X==="object"))return;let Q=X.constructor.name,Y=kG(Z,Q),q=Y.indexOf(X);if(q===-1)q=Y.length,Y.push(X);return q};function r1(X,J,Z){if(X instanceof Array)return X.map((Q)=>r1(Q,J,Z));else if(X===null)return X;else if(X instanceof Float32Array||X instanceof Float64Array||X instanceof Int32Array||X instanceof Uint32Array||X instanceof Uint8Array||X instanceof Uint16Array||X instanceof Int16Array||X instanceof Int8Array||X instanceof Uint8ClampedArray)return{rr_type:X.constructor.name,args:[Object.values(X)]};else if(X instanceof ArrayBuffer){let Q=X.constructor.name,Y=bG(X);return{rr_type:Q,base64:Y}}else if(X instanceof DataView)return{rr_type:X.constructor.name,args:[r1(X.buffer,J,Z),X.byteOffset,X.byteLength]};else if(X instanceof HTMLImageElement){let Q=X.constructor.name,{src:Y}=X;return{rr_type:Q,src:Y}}else if(X instanceof HTMLCanvasElement)return{rr_type:"HTMLImageElement",src:X.toDataURL()};else if(X instanceof ImageData)return{rr_type:X.constructor.name,args:[r1(X.data,J,Z),X.width,X.height]};else if(tX(X,J)||typeof X==="object"){let Q=X.constructor.name,Y=oX(X,J,Z);return{rr_type:Q,index:Y}}return X}var nX=(X,J,Z)=>{return X.map((Q)=>r1(Q,J,Z))},tX=(X,J)=>{let Q=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter((Y)=>typeof J[Y]==="function");return Boolean(Q.find((Y)=>X instanceof J[Y]))};function vG(X,J,Z,Q){let Y=[],q=Object.getOwnPropertyNames(J.CanvasRenderingContext2D.prototype);for(let G of q)try{if(typeof J.CanvasRenderingContext2D.prototype[G]!=="function")continue;let V=N0(J.CanvasRenderingContext2D.prototype,G,function(K){return function(...W){if(!n(this.canvas,Z,Q,!0))setTimeout(()=>{let j=nX(W,J,this);X(this.canvas,{type:l0["2D"],property:G,args:j})},0);return K.apply(this,W)}});Y.push(V)}catch{let V=wJ(J.CanvasRenderingContext2D.prototype,G,{set(K){X(this.canvas,{type:l0["2D"],property:G,args:[K],setter:!0})}});Y.push(V)}return()=>{Y.forEach((G)=>G())}}function hG(X){return X==="experimental-webgl"?"webgl":X}function X6(X,J,Z,Q){let Y=[];try{let q=N0(X.HTMLCanvasElement.prototype,"getContext",function(G){return function(V,...K){if(!n(this,J,Z,!0)){let W=hG(V);if(!("__context"in this))this.__context=W;if(Q&&["webgl","webgl2"].includes(W))if(K[0]&&typeof K[0]==="object"){let j=K[0];if(!j.preserveDrawingBuffer)j.preserveDrawingBuffer=!0}else K.splice(0,1,{preserveDrawingBuffer:!0})}return G.apply(this,[V,...K])}});Y.push(q)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{Y.forEach((q)=>q())}}function Q6(X,J,Z,Q,Y,q){let G=[],V=Object.getOwnPropertyNames(X);for(let K of V){if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(K))continue;try{if(typeof X[K]!=="function")continue;let W=N0(X,K,function(j){return function(...U){let z=j.apply(this,U);if(oX(z,q,this),"tagName"in this.canvas&&!n(this.canvas,Q,Y,!0)){let H=nX(U,q,this),D={type:J,property:K,args:H};Z(this.canvas,D)}return z}});G.push(W)}catch{let W=wJ(X,K,{set(j){Z(this.canvas,{type:J,property:K,args:[j],setter:!0})}});G.push(W)}}return G}function yG(X,J,Z,Q){let Y=[];if(Y.push(...Q6(J.WebGLRenderingContext.prototype,l0.WebGL,X,Z,Q,J)),typeof J.WebGL2RenderingContext<"u")Y.push(...Q6(J.WebGL2RenderingContext.prototype,l0.WebGL2,X,Z,Q,J));return()=>{Y.forEach((q)=>q())}}var eX="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",gG=(X)=>Uint8Array.from(atob(X),(J)=>J.charCodeAt(0)),Y6=typeof window<"u"&&window.Blob&&new Blob([gG(eX)],{type:"text/javascript;charset=utf-8"});function mG(X){let J;try{if(J=Y6&&(window.URL||window.webkitURL).createObjectURL(Y6),!J)throw"";let Z=new Worker(J,{name:X==null?void 0:X.name});return Z.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(J)}),Z}catch(Z){return new Worker("data:text/javascript;base64,"+eX,{name:X==null?void 0:X.name})}finally{J&&(window.URL||window.webkitURL).revokeObjectURL(J)}}class J8{constructor(X){P(this,"pendingCanvasMutations",new Map),P(this,"rafStamps",{latestId:0,invokeId:null}),P(this,"mirror"),P(this,"mutationCb"),P(this,"resetObservers"),P(this,"frozen",!1),P(this,"locked",!1),P(this,"processMutation",(V,K)=>{if(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)this.rafStamps.invokeId=this.rafStamps.latestId;if(!this.pendingCanvasMutations.has(V))this.pendingCanvasMutations.set(V,[]);this.pendingCanvasMutations.get(V).push(K)});let{sampling:J="all",win:Z,blockClass:Q,blockSelector:Y,recordCanvas:q,dataURLOptions:G}=X;if(this.mutationCb=X.mutationCb,this.mirror=X.mirror,q&&J==="all")this.initCanvasMutationObserver(Z,Q,Y);if(q&&typeof J==="number")this.initCanvasFPSObserver(J,Z,Q,Y,{dataURLOptions:G})}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(X,J,Z,Q,Y){let q=X6(J,Z,Q,!0),G=new Map,V=new mG;V.onmessage=(H)=>{let{id:D}=H.data;if(G.set(D,!1),!("base64"in H.data))return;let{base64:L,type:B,width:A,height:O}=H.data;this.mutationCb({id:D,type:l0["2D"],commands:[{property:"clearRect",args:[0,0,A,O]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:L}],type:B}]},0,0]}]})};let K=1000/X,W=0,j,U=()=>{let H=[];return J.document.querySelectorAll("canvas").forEach((D)=>{if(!n(D,Z,Q,!0))H.push(D)}),H},z=(H)=>{if(W&&H-W<K){j=requestAnimationFrame(z);return}W=H,U().forEach(async(D)=>{var L;let B=this.mirror.getId(D);if(G.get(B))return;if(D.width===0||D.height===0)return;if(G.set(B,!0),["webgl","webgl2"].includes(D.__context)){let O=D.getContext(D.__context);if(((L=O==null?void 0:O.getContextAttributes())==null?void 0:L.preserveDrawingBuffer)===!1)O.clear(O.COLOR_BUFFER_BIT)}let A=await createImageBitmap(D);V.postMessage({id:B,bitmap:A,width:D.width,height:D.height,dataURLOptions:Y.dataURLOptions},[A])}),j=requestAnimationFrame(z)};j=requestAnimationFrame(z),this.resetObservers=()=>{q(),cancelAnimationFrame(j)}}initCanvasMutationObserver(X,J,Z){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let Q=X6(X,J,Z,!1),Y=vG(this.processMutation.bind(this),X,J,Z),q=yG(this.processMutation.bind(this),X,J,Z);this.resetObservers=()=>{Q(),Y(),q()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let X=(J)=>{this.rafStamps.latestId=J,requestAnimationFrame(X)};requestAnimationFrame(X)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((X,J)=>{let Z=this.mirror.getId(J);this.flushPendingCanvasMutationFor(J,Z)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(X,J){if(this.frozen||this.locked)return;let Z=this.pendingCanvasMutations.get(X);if(!Z||J===-1)return;let Q=Z.map((q)=>{let{type:G,...V}=q;return V}),{type:Y}=Z[0];this.mutationCb({id:J,type:Y,commands:Q}),this.pendingCanvasMutations.delete(X)}}class Z8{constructor(X){P(this,"trackedLinkElements",new WeakSet),P(this,"mutationCb"),P(this,"adoptedStyleSheetCb"),P(this,"styleMirror",new yX),this.mutationCb=X.mutationCb,this.adoptedStyleSheetCb=X.adoptedStyleSheetCb}attachLinkElement(X,J){if("_cssText"in J.attributes)this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:J.id,attributes:J.attributes}]});this.trackLinkElement(X)}trackLinkElement(X){if(this.trackedLinkElements.has(X))return;this.trackedLinkElements.add(X),this.trackStylesheetInLinkElement(X)}adoptStyleSheets(X,J){if(X.length===0)return;let Z={id:J,styleIds:[]},Q=[];for(let Y of X){let q;if(!this.styleMirror.has(Y))q=this.styleMirror.add(Y),Q.push({styleId:q,rules:Array.from(Y.rules||CSSRule,(G,V)=>({rule:V6(G,Y.href),index:V}))});else q=this.styleMirror.getId(Y);Z.styleIds.push(q)}if(Q.length>0)Z.styles=Q;this.adoptedStyleSheetCb(Z)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(X){}}class X8{constructor(){P(this,"nodeMap",new WeakMap),P(this,"active",!1)}inOtherBuffer(X,J){let Z=this.nodeMap.get(X);return Z&&Array.from(Z).some((Q)=>Q!==J)}add(X,J){if(!this.active)this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1});this.nodeMap.set(X,(this.nodeMap.get(X)||new Set).add(J))}destroy(){}}var p,o1,uJ,UJ=!1;try{if(Array.from([1],(X)=>X*2)[0]!==2){let X=document.createElement("iframe");document.body.appendChild(X),Array.from=((G9=X.contentWindow)==null?void 0:G9.Array.from)||Array.from,document.body.removeChild(X)}}catch(X){console.debug("Unable to override Array.from",X)}var q0=c8();function O0(X={}){let{emit:J,checkoutEveryNms:Z,checkoutEveryNth:Q,blockClass:Y="rr-block",blockSelector:q=null,ignoreClass:G="rr-ignore",ignoreSelector:V=null,maskTextClass:K="rr-mask",maskTextSelector:W=null,inlineStylesheet:j=!0,maskAllInputs:U,maskInputOptions:z,slimDOMOptions:H,maskInputFn:D,maskTextFn:L,hooks:B,packFn:A,sampling:O={},dataURLOptions:F={},mousemoveWait:M,recordDOM:T=!0,recordCanvas:f=!1,recordCrossOriginIframes:l=!1,recordAfter:h=X.recordAfter==="DOMContentLoaded"?X.recordAfter:"load",userTriggeredOnInput:c=!1,collectFonts:a=!1,inlineImages:J0=!1,plugins:V0,keepIframeSrcFn:E=()=>!1,ignoreCSSAttributes:s0=new Set([]),errorHandler:a0}=X;PG(a0);let d=l?window.parent===window:!0,Z0=!1;if(!d)try{if(window.parent.document)Z0=!1}catch(N){Z0=!0}if(d&&!J)throw Error("emit function is required");if(!d&&!Z0)return()=>{};if(M!==void 0&&O.mousemove===void 0)O.mousemove=M;q0.reset();let M0=U===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:z!==void 0?z:{password:!0},W0=H6(H);zG();let X9,$J=0,Q9=(N)=>{for(let Y0 of V0||[])if(Y0.eventProcessor)N=Y0.eventProcessor(N);if(A&&!Z0)N=A(N);return N};p=(N,Y0)=>{var m;let u=N;if(u.timestamp=WJ(),((m=C0[0])==null?void 0:m.isFrozen())&&u.type!==R.FullSnapshot&&!(u.type===R.IncrementalSnapshot&&u.data.source===_.Mutation))C0.forEach((e)=>e.unfreeze());if(d)J==null||J(Q9(u),Y0);else if(Z0){let e={type:"rrweb",event:Q9(u),origin:window.location.origin,isCheckout:Y0};window.parent.postMessage(e,"*")}if(u.type===R.FullSnapshot)X9=u,$J=0;else if(u.type===R.IncrementalSnapshot){if(u.data.source===_.Mutation&&u.data.isAttachIframe)return;$J++;let e=Q&&$J>=Q,x=Z&&u.timestamp-X9.timestamp>Z;if(e||x)o1(!0)}};let A1=(N)=>{p({type:R.IncrementalSnapshot,data:{source:_.Mutation,...N}})},Y9=(N)=>p({type:R.IncrementalSnapshot,data:{source:_.Scroll,...N}}),q9=(N)=>p({type:R.IncrementalSnapshot,data:{source:_.CanvasMutation,...N}}),w0=new Z8({mutationCb:A1,adoptedStyleSheetCb:(N)=>p({type:R.IncrementalSnapshot,data:{source:_.AdoptedStyleSheet,...N}})}),_0=new aX({mirror:q0,mutationCb:A1,stylesheetManager:w0,recordCrossOriginIframes:l,wrappedEmit:p});for(let N of V0||[])if(N.getMirror)N.getMirror({nodeMirror:q0,crossOriginIframeMirror:_0.crossOriginIframeMirror,crossOriginIframeStyleMirror:_0.crossOriginIframeStyleMirror});let RJ=new X8;uJ=new J8({recordCanvas:f,mutationCb:q9,win:window,blockClass:Y,blockSelector:q,mirror:q0,sampling:O.canvas,dataURLOptions:F});let M1=new rX({mutationCb:A1,scrollCb:Y9,bypassOptions:{blockClass:Y,blockSelector:q,maskTextClass:K,maskTextSelector:W,inlineStylesheet:j,maskInputOptions:M0,dataURLOptions:F,maskTextFn:L,maskInputFn:D,recordCanvas:f,inlineImages:J0,sampling:O,slimDOMOptions:W0,iframeManager:_0,stylesheetManager:w0,canvasManager:uJ,keepIframeSrcFn:E,processedNodeManager:RJ},mirror:q0});o1=(N=!1)=>{if(!T)return;p({type:R.Meta,data:{href:window.location.href,width:fX(),height:xX()}},N),w0.reset(),M1.init(),C0.forEach((m)=>m.lock());let Y0=zQ(document,{mirror:q0,blockClass:Y,blockSelector:q,maskTextClass:K,maskTextSelector:W,inlineStylesheet:j,maskAllInputs:M0,maskTextFn:L,maskInputFn:D,slimDOM:W0,dataURLOptions:F,recordCanvas:f,inlineImages:J0,onSerialize:(m)=>{if(vX(m,q0))_0.addIframe(m);if(hX(m,q0))w0.trackLinkElement(m);if(AZ(m))M1.addShadowRoot(w.shadowRoot(m),document)},onIframeLoad:(m,u)=>{_0.attachIframe(m,u),M1.observeAttachShadow(m)},onStylesheetLoad:(m,u)=>{w0.attachLinkElement(m,u)},keepIframeSrcFn:E});if(!Y0)return console.warn("Failed to snapshot the document");if(p({type:R.FullSnapshot,data:{node:Y0,initialOffset:TX(window)}},N),C0.forEach((m)=>m.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0)w0.adoptStyleSheets(document.adoptedStyleSheets,q0.getId(document))};try{let N=[],Y0=(u)=>{var e;return $(xG)({mutationCb:A1,mousemoveCb:(x,EJ)=>p({type:R.IncrementalSnapshot,data:{source:EJ,positions:x}}),mouseInteractionCb:(x)=>p({type:R.IncrementalSnapshot,data:{source:_.MouseInteraction,...x}}),scrollCb:Y9,viewportResizeCb:(x)=>p({type:R.IncrementalSnapshot,data:{source:_.ViewportResize,...x}}),inputCb:(x)=>p({type:R.IncrementalSnapshot,data:{source:_.Input,...x}}),mediaInteractionCb:(x)=>p({type:R.IncrementalSnapshot,data:{source:_.MediaInteraction,...x}}),styleSheetRuleCb:(x)=>p({type:R.IncrementalSnapshot,data:{source:_.StyleSheetRule,...x}}),styleDeclarationCb:(x)=>p({type:R.IncrementalSnapshot,data:{source:_.StyleDeclaration,...x}}),canvasMutationCb:q9,fontCb:(x)=>p({type:R.IncrementalSnapshot,data:{source:_.Font,...x}}),selectionCb:(x)=>{p({type:R.IncrementalSnapshot,data:{source:_.Selection,...x}})},customElementCb:(x)=>{p({type:R.IncrementalSnapshot,data:{source:_.CustomElement,...x}})},blockClass:Y,ignoreClass:G,ignoreSelector:V,maskTextClass:K,maskTextSelector:W,maskInputOptions:M0,inlineStylesheet:j,sampling:O,recordDOM:T,recordCanvas:f,inlineImages:J0,userTriggeredOnInput:c,collectFonts:a,doc:u,maskInputFn:D,maskTextFn:L,keepIframeSrcFn:E,blockSelector:q,slimDOMOptions:W0,dataURLOptions:F,mirror:q0,iframeManager:_0,stylesheetManager:w0,shadowDomManager:M1,processedNodeManager:RJ,canvasManager:uJ,ignoreCSSAttributes:s0,plugins:((e=V0==null?void 0:V0.filter((x)=>x.observer))==null?void 0:e.map((x)=>({observer:x.observer,options:x.options,callback:(EJ)=>p({type:R.Plugin,data:{plugin:x.name,payload:EJ}})})))||[]},B)};_0.addLoadListener((u)=>{try{N.push(Y0(u.contentDocument))}catch(e){console.warn(e)}});let m=()=>{o1(),N.push(Y0(document)),UJ=!0};if(["interactive","complete"].includes(document.readyState))m();else N.push(o("DOMContentLoaded",()=>{if(p({type:R.DomContentLoaded,data:{}}),h==="DOMContentLoaded")m()})),N.push(o("load",()=>{if(p({type:R.Load,data:{}}),h==="load")m()},window));return()=>{N.forEach((u)=>{try{u()}catch(e){if(!String(e).toLowerCase().includes("cross-origin"))console.warn(e)}}),RJ.destroy(),UJ=!1,OG()}}catch(N){console.warn(N)}}O0.addCustomEvent=(X,J)=>{if(!UJ)throw Error("please add custom event after start recording");p({type:R.Custom,data:{tag:X,payload:J}})};O0.freezePage=()=>{C0.forEach((X)=>X.freeze())};O0.takeFullSnapshot=(X)=>{if(!UJ)throw Error("please take full snapshot after start recording");o1(X)};O0.mirror=q0;/*! *****************************************************************************
|
|
60
|
+
Copyright (c) Microsoft Corporation.
|
|
61
|
+
|
|
62
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
63
|
+
purpose with or without fee is hereby granted.
|
|
64
|
+
|
|
65
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
66
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
67
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
68
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
69
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
70
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
71
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
72
|
+
***************************************************************************** */var q6;(function(X){X[X.NotStarted=0]="NotStarted",X[X.Running=1]="Running",X[X.Stopped=2]="Stopped"})(q6||(q6={}));function K8(X){let J=(X||"https://api.sessionsight.com").replace(/\/$/,"");if(J.startsWith("http://")&&!J.startsWith("http://localhost"))console.warn("SessionSight: API URL uses http:// instead of https://. Data will be transmitted unencrypted.");return J}var aZ="sessionsight_visitor_id",rZ="ss_vid",Q8=31536000;function uG(X){if(typeof document>"u")return null;try{let J=X.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Z=document.cookie.match(new RegExp("(?:^|; )"+J+"=([^;]*)"));return Z?decodeURIComponent(Z[1]):null}catch{return null}}function Y8(X,J,Z){if(typeof document>"u")return;try{let Q=location.protocol==="https:"?"; Secure":"";document.cookie=`${X}=${J}; path=/; max-age=${Z}; SameSite=Lax${Q}`}catch{}}function q8(){if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(X)=>{let J=Math.random()*16|0;return(X==="x"?J:J&3|8).toString(16)})}var pG=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function G8(X){return pG.test(X)}function cG(){try{return localStorage.setItem("__ss_test__","1"),localStorage.removeItem("__ss_test__"),!0}catch{return!1}}function lG(){if(typeof navigator<"u"){if(navigator.globalPrivacyControl===!0)return!0;if(navigator.doNotTrack==="1")return!0}return!1}function V8(X){if(X)return X;if(lG())return q8();let J=typeof window<"u"&&cG(),Z=uG(rZ);if(Z&&G8(Z)){if(J)localStorage.setItem(aZ,Z);return Z}if(J){let Y=localStorage.getItem(aZ);if(Y&&G8(Y))return Y8(rZ,Y,Q8),Y}let Q=q8();if(J)localStorage.setItem(aZ,Q);return Y8(rZ,Q,Q8),Q}var dG=new Map;function W8(X){return dG.get(X)}var iG=5000,sG=6000,j8=4,aG=5,L8=2,rG=3,oG=0,nG=2;function tG(X){let J=0,Z=!1;for(let Q=X.length-1;Q>=0;Q--){let Y=parseInt(X[Q],10);if(Z){if(Y*=2,Y>9)Y-=9}J+=Y,Z=!Z}return J%10===0}var eG=/\b(\d[\d\s\-]{11,22}\d)\b/g,JK=/\b(?!000|666|9\d\d)(\d{3})[- ]?(?!00)(\d{2})[- ]?(?!0000)(\d{4})\b/g,ZK=/\b[A-Za-z0-9._%+\-]+@[A-Za-z0-9.\-]+\.[A-Za-z]{2,}\b/g,XK=/(?:\+?1[\s.\-]?)?\(?\d{3}\)?[\s.\-]?\d{3}[\s.\-]?\d{4}\b/g,QK=/\+\d{1,3}[\s.\-]\d[\d\s.\-]{6,16}\d\b/g,YK=/\b[A-Z]{2}\d{2}[\s\-]?[\dA-Z]{4}[\s\-]?(?:[\dA-Z]{4}[\s\-]?){1,7}[\dA-Z]{1,4}\b/g,qK=/\b(?:sk-[A-Za-z0-9]{20,}|sk_(?:live|test)_[A-Za-z0-9]{20,}|pk_(?:live|test)_[A-Za-z0-9]{20,}|ghp_[A-Za-z0-9]{36,}|gho_[A-Za-z0-9]{36,}|AKIA[A-Z0-9]{16})\b/g,B0="[REDACTED]";function tZ(X){return X=X.replace(YK,B0),X=X.replace(eG,(J)=>{let Z=J.replace(/[\s\-]/g,"");if(Z.length>=13&&Z.length<=19&&tG(Z))return B0;return J}),X=X.replace(JK,B0),X=X.replace(ZK,B0),X=X.replace(XK,B0),X=X.replace(QK,(J)=>{let Z=J.replace(/\D/g,"");if(Z.length>=8&&Z.length<=15)return B0;return J}),X=X.replace(qK,B0),X}var GK={narrow:["i","j","l"],semiNarrow:["f","r","t"],medium:["a","b","c","d","e","g","h","k","n","o","p","q","s","u","v","x","y","z"],wide:["m","w"]},KK={narrow:["I","J"],semiNarrow:["E","F","L","T"],medium:["A","B","C","D","G","H","K","N","O","P","Q","R","S","U","V","X","Y","Z"],wide:["M","W"]},eZ=new Map;for(let X of Object.values(GK))for(let J of X)eZ.set(J,X);for(let X of Object.values(KK))for(let J of X)eZ.set(J,X);function F1(X){if(X.includes(B0))return X.split(B0).map((Z)=>F1(Z)).join(B0);let J="";for(let Z=0;Z<X.length;Z++){let Q=X[Z],Y=eZ.get(Q);if(Y){let q=Y.indexOf(Q);J+=Y[(q+1)%Y.length]}else{let q=Q.charCodeAt(0);if(q>=48&&q<=57)J+=String.fromCharCode(48+(q-48+3)%10);else J+=Q}}return J}function VK(X){if(!X)return null;let J=X.closest("[data-ss-mask], [data-ss-unmask]");if(!J)return null;return J.hasAttribute("data-ss-mask")?"mask":"unmask"}var U8=4000,d0=new Map;function WK(X){return d0.get(X)}function jK(X,J){if(d0.size>=U8){let Z=U8/4,Q=0;for(let Y of d0.keys()){if(Q++>=Z)break;d0.delete(Y)}}d0.set(X,J)}function B8(){d0.clear()}function z8(X,J,Z){let Q=VK(J),Y=`${Q??"d"}:${Z}:${X}`,q=WK(Y);if(q!==void 0)return q;let G=tZ(X);if(Q==="mask")G=F1(G);else if(Q==="unmask");else if(Z==="default")G=F1(G);return jK(Y,G),G}var UK=new Set(["input","textarea"]);function nZ(X,J,Z){if(X.type===nG){let Q=X.attributes;if(Q){if("data-ss-unmask"in Q)Z="unmask";else if("data-ss-mask"in Q)Z="mask"}if(Q&&UK.has(X.tagName)&&typeof Q.placeholder==="string"&&Q.placeholder){if(Q.placeholder=tZ(Q.placeholder),Z==="mask"||Z!=="unmask"&&J==="default")Q.placeholder=F1(Q.placeholder)}}if(X.childNodes)for(let Q of X.childNodes)nZ(Q,J,Z)}function BK(X,J){if(X.type===L8){let Z=X.data;if(Z.node)nZ(Z.node,J,null);return}if(X.type===rG){let Z=X.data;if(Z.source!==oG)return;if(Z.adds)for(let Q of Z.adds)nZ(Q.node,J,null);if(Z.attributes){for(let Q of Z.attributes)if(typeof Q.attributes.placeholder==="string"&&Q.attributes.placeholder){if(Q.attributes.placeholder=tZ(Q.attributes.placeholder),J==="default")Q.attributes.placeholder=F1(Q.attributes.placeholder)}}}}function H8(X){try{let Z="^"+X.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,".*")+"$";return new RegExp(Z)}catch(J){return console.warn("SessionSight: invalid excludePages pattern",X,J),null}}function oZ(X,J){for(let Z of J)if(Z.test(X))return!0;return!1}class s{bridge;visitorId;preBuffer=[];isRecording=!1;stopRrweb=null;userId=null;userProperties={};userPropertiesDirty=!1;lastHref="";lastEmittedFlagToken=null;flagCheckTimer=null;origPushState=null;origReplaceState=null;formStarted=new Set;formStartTimestamps=new Map;focusTimestamps=new Map;lastMouseMoveEmit=0;scrollHistory=[];lastScrollDirection=null;lastScrollY=0;fieldFocusCounts=new Map;lastInteractionTime=0;idleTimer=null;idleEmitted=!1;static IDLE_THRESHOLD_MS=30000;lastErrorMessage="";lastErrorTime=0;static SCROLL_DEPTH_THRESHOLDS=[25,50,75,100];scrollDepthHits=new Set;scrollSentinels=[];scrollDepthObserver=null;settledSnapshotTimer=null;static SETTLED_SNAPSHOT_DELAY_MS=3000;hiddenAt=null;static VISIBILITY_GRACE_MS=120000;endedByVisibility=!1;isHidden=!1;propertyId;privacyMode;excludePagePatterns;isPaused=!1;constructor(X,J,Z,Q){this.bridge=X,this.propertyId=J,this.visitorId=Z,this.privacyMode=Q?.privacyMode??"default",this.excludePagePatterns=(Q?.excludePages??[]).map(H8).filter((Y)=>Y!==null),this.bridge.onKilled(()=>{if(this.preBuffer=[],this.isRecording=!1,this.stopRrweb)this.stopRrweb(),this.stopRrweb=null})}start(X){try{this.lastHref=window.location.href;let J=this.excludePagePatterns.length>0&&oZ(window.location.pathname,this.excludePagePatterns);if(X)this.isRecording=!0,this.bridge.postMetadata(this.collectMetadata());if(this.startRrweb(),J)this.emitCustomEvent("ss-page-excluded",{href:window.location.href}),this.bridge.flush(),this.isPaused=!0;this.patchHistoryMethods(),window.addEventListener("popstate",this.handleNavigation),document.addEventListener("click",this.handleClick,!0),document.addEventListener("submit",this.handleFormSubmit,!0),document.addEventListener("focusin",this.handleFieldFocus,!0),document.addEventListener("focusout",this.handleFieldBlur,!0),document.addEventListener("click",this.handleHeatmapClick,!0),document.addEventListener("mousemove",this.handleHeatmapMouseMove,{capture:!0,passive:!0}),window.addEventListener("scroll",this.handleHeatmapScroll,{capture:!0,passive:!0}),this.setupScrollDepthObserver(),window.addEventListener("error",this.handleWindowError),window.addEventListener("unhandledrejection",this.handleUnhandledRejection),document.addEventListener("keydown",this.handleKeydown,!0),this.lastInteractionTime=Date.now(),this.resetIdleTimer(),document.addEventListener("visibilitychange",this.handleVisibilityChange),window.addEventListener("beforeunload",this.handleBeforeUnload),this.flagCheckTimer=setInterval(()=>this.checkFlagToken(),sG)}catch(J){console.warn("SessionSight: failed to start recorder",J)}}beginRecording(X){if(this.isRecording)return;this.isRecording=!0,this.bridge.postMetadata(this.collectMetadata());let J=Math.min(5,Math.max(0,X?.preRecordSecs||0));if(J>0&&this.preBuffer.length>0){let Z=Date.now()-J*1000;for(let Q of this.preBuffer)if(Q.timestamp>=Z)this.bridge.postEvent(Q)}this.preBuffer=[],this.bridge.flush()}stop(){if(this.settledSnapshotTimer)clearTimeout(this.settledSnapshotTimer),this.settledSnapshotTimer=null;if(this.flagCheckTimer)clearInterval(this.flagCheckTimer),this.flagCheckTimer=null;if(this.hiddenAt=null,this.isHidden=!1,this.stopRrweb)this.stopRrweb(),this.stopRrweb=null;if(this.unpatchHistoryMethods(),window.removeEventListener("popstate",this.handleNavigation),document.removeEventListener("click",this.handleClick,!0),document.removeEventListener("submit",this.handleFormSubmit,!0),document.removeEventListener("focusin",this.handleFieldFocus,!0),document.removeEventListener("focusout",this.handleFieldBlur,!0),document.removeEventListener("click",this.handleHeatmapClick,!0),document.removeEventListener("mousemove",this.handleHeatmapMouseMove,{capture:!0}),window.removeEventListener("scroll",this.handleHeatmapScroll,{capture:!0}),this.teardownScrollDepthObserver(),window.removeEventListener("error",this.handleWindowError),window.removeEventListener("unhandledrejection",this.handleUnhandledRejection),document.removeEventListener("keydown",this.handleKeydown,!0),this.idleTimer)clearTimeout(this.idleTimer),this.idleTimer=null;if(document.removeEventListener("visibilitychange",this.handleVisibilityChange),window.removeEventListener("beforeunload",this.handleBeforeUnload),this.isRecording)this.bridge.flush();this.isRecording=!1,this.bridge.destroy(),B8()}getVisitorId(){return this.visitorId}getBridge(){return this.bridge}getPropertyId(){return this.propertyId}identify(X,J){if(this.userId=X,this.bridge.postIdentify(X,J),J)Object.assign(this.userProperties,J),this.userPropertiesDirty=!0,this.emitCustomEvent("set_user_properties",{...J})}applyPrivacyConfig(X){let J=X.privacyMode!==this.privacyMode;this.privacyMode=X.privacyMode,this.excludePagePatterns=(X.excludePages??[]).map(H8).filter((Q)=>Q!==null);let Z=this.excludePagePatterns.length>0&&oZ(window.location.pathname,this.excludePagePatterns);if(Z&&!this.isPaused)this.bridge.flush(),this.emitCustomEvent("ss-page-excluded",{href:window.location.href}),this.bridge.flush(),this.isPaused=!0;else if(!Z&&this.isPaused)this.isPaused=!1;if(J&&!this.isPaused){if(this.stopRrweb)this.stopRrweb();this.startRrweb()}}stampExcludedDimensions(){let X=document.querySelectorAll("[data-ss-exclude]");for(let J of X){let Z=J;if(Z.style.getPropertyValue("--ss-stamped"))continue;let Q=Z.getBoundingClientRect();Z.style.setProperty("width",Q.width+"px","important"),Z.style.setProperty("height",Q.height+"px","important"),Z.style.setProperty("min-height",Q.height+"px","important"),Z.style.setProperty("box-sizing","border-box","important"),Z.style.setProperty("--ss-stamped","1")}}startRrweb(){try{let X=this.privacyMode;this.stampExcludedDimensions(),this.stopRrweb=O0({emit:(J)=>{try{BK(J,X),this.pushEvent(J)}catch(Z){console.warn("SessionSight: error in rrweb emit callback",Z)}},checkoutEveryNms:30000,sampling:{scroll:50},inlineStylesheet:!0,blockSelector:"[data-ss-exclude]",maskAllInputs:!0,maskInputFn:(J,Z)=>{try{return z8(J,Z,X)}catch(Q){return console.warn("SessionSight: error in maskInputFn",Q),J}},maskTextSelector:"*",maskTextFn:(J,Z)=>{try{return z8(J,Z,X)}catch(Q){return console.warn("SessionSight: error in maskTextFn",Q),J}}})??null,this.scheduleSettledSnapshot()}catch(X){console.warn("SessionSight: failed to start rrweb",X)}}scheduleSettledSnapshot(){if(this.settledSnapshotTimer)clearTimeout(this.settledSnapshotTimer);this.settledSnapshotTimer=setTimeout(()=>{if(this.settledSnapshotTimer=null,this.stopRrweb&&!this.isPaused)O0.takeFullSnapshot()},s.SETTLED_SNAPSHOT_DELAY_MS)}pushEvent(X){if(this.isPaused)return;if(this.isHidden)return;if(this.isRecording){if(this.bridge.postEvent(X),X.type===L8)this.bridge.flush()}else this.preBuffer.push(X),this.trimPreBuffer()}trimPreBuffer(){if(this.preBuffer.length===0)return;let X=Date.now()-iG,J=0;while(J<this.preBuffer.length&&this.preBuffer[J].timestamp<X)J++;if(J>0)this.preBuffer.splice(0,J)}emitCustomEvent(X,J){let Z={type:aG,data:{tag:X,payload:J},timestamp:Date.now()};this.pushEvent(Z)}static INPUT_SELECTOR='input:not([type="hidden"]):not([type="submit"]):not([type="button"]), textarea, select';getFormContainer(X){return X.closest("form")||X.closest("[data-ss-form]")}getFormInfo(X){let J=window.location.pathname;if(!X)return{formId:`${J}:_page`,formName:J};if(X.tagName==="FORM"){let q=Array.from(document.querySelectorAll("form")).indexOf(X),G=q>=0?String(q):"0",V=`${J}:${X.id||G}`,W=X.getAttribute("data-ss-form")||X.id||`Form ${q+1}`;return{formId:V,formName:W}}let Z=X.getAttribute("data-ss-form");return{formId:`${J}:${X.id||Z}`,formName:Z}}getFieldInfo(X,J){let Y=Array.from((J||document).querySelectorAll(s.INPUT_SELECTOR)).indexOf(X),q=X.id||X.name||`field-${Y}`,G=X.name||X.id||`field-${Y}`,V=X.tagName==="SELECT"?"select":X.tagName==="TEXTAREA"?"textarea":X.type||"text",K="";if(X.id){let W=document.querySelector(`label[for="${CSS.escape(X.id)}"]`);if(W)K=(W.textContent?.trim()||"").slice(0,50)}if(!K){let W=X.closest("label");if(W){let j=W.cloneNode(!0);j.querySelectorAll("input, textarea, select").forEach((U)=>U.remove()),K=(j.textContent?.trim()||"").slice(0,50)}}if(!K)K=X.getAttribute("placeholder")?.slice(0,50)||G;return{fieldId:q,fieldName:G,fieldType:V,fieldLabel:K}}handleFieldFocus=(X)=>{try{let J=X.target;if(!J)return;if(!J.matches(s.INPUT_SELECTOR))return;let Z=this.getFormContainer(J),{formId:Q,formName:Y}=this.getFormInfo(Z),q=this.getFieldInfo(J,Z),G=window.location.pathname;if(!this.formStarted.has(Q)){this.formStarted.add(Q),this.formStartTimestamps.set(Q,Date.now());let H=(Z||document).querySelectorAll(s.INPUT_SELECTOR);this.emitCustomEvent("form_start",{formId:Q,formName:Y,page:G,fieldCount:H.length})}let V=`${Q}:${q.fieldId}`;this.focusTimestamps.set(V,Date.now()),this.emitCustomEvent("field_focus",{formId:Q,formName:Y,page:G,...q});let K=Date.now(),W=this.fieldFocusCounts.get(V)||[];W.push(K);let j=K-30000,U=W.filter((z)=>z>=j);if(this.fieldFocusCounts.set(V,U),U.length>=3)this.emitCustomEvent("form_field_retry",{formName:Y,fieldName:q.fieldName,page:G,retries:U.length}),this.fieldFocusCounts.set(V,[]);this.resetIdleTimer()}catch(J){console.warn("SessionSight: error in field focus handler",J)}};handleFieldBlur=(X)=>{try{let J=X.target;if(!J)return;if(!J.matches(s.INPUT_SELECTOR))return;let Z=this.getFormContainer(J),{formId:Q,formName:Y}=this.getFormInfo(Z),q=this.getFieldInfo(J,Z),G=window.location.pathname,V=`${Q}:${q.fieldId}`,K=this.focusTimestamps.get(V),W=K?Date.now()-K:0;this.focusTimestamps.delete(V);let j=J,U=!1;if(j.type==="checkbox"||j.type==="radio")U=j.checked;else U=(j.value||"").trim().length>0;this.emitCustomEvent("field_blur",{formId:Q,formName:Y,page:G,...q,timeSpent:W,hasValue:U})}catch(J){console.warn("SessionSight: error in field blur handler",J)}};handleClick=(X)=>{try{let J=X.target;if(!J)return;let Z=J.closest('button, a, [role="button"], input[type="submit"], input[type="button"]');if(!Z)return;let Q=this.getElementLabel(Z)||Z.tagName.toLowerCase(),Y;try{let q=Z.href;if(q)Y=new URL(q,window.location.origin).pathname}catch{}this.emitCustomEvent("click",{label:Q,tag:Z.tagName.toLowerCase(),page:window.location.pathname,href:Y})}catch(J){console.warn("SessionSight: error in click handler",J)}};getElementLabel(X){let J=X.getAttribute("aria-label");if(J)return J.slice(0,80);let Z=X.textContent?.trim();if(Z&&Z.length<=80)return Z;if(Z)return Z.slice(0,77)+"...";let Q=X.getAttribute("title");if(Q)return Q.slice(0,80);if(X.tagName==="INPUT"){let Y=X.value;if(Y)return Y.slice(0,80)}return null}handleFormSubmit=(X)=>{try{let J=X.target;if(!J||J.tagName!=="FORM")return;let{formId:Z,formName:Q}=this.getFormInfo(J),Y=window.location.pathname,q=J.querySelectorAll(s.INPUT_SELECTOR),G=Array.from(q).filter((W)=>{let j=W;if(j.type==="checkbox"||j.type==="radio")return j.checked;return j.value.trim().length>0}).length,V=this.formStartTimestamps.get(Z),K=V?Date.now()-V:0;this.emitCustomEvent("form_submit",{formId:Z,formName:Q,page:Y,totalFields:q.length,filledFields:G,timeToComplete:K})}catch(J){console.warn("SessionSight: error in form submit handler",J)}};static INTERACTIVE_SELECTOR=["a","button","select","textarea","input","label","summary","details",'[role="button"]','[role="link"]','[role="tab"]','[role="radio"]','[role="checkbox"]','[role="option"]','[role="menuitem"]','[role="switch"]','[role="slider"]',"[tabindex]","[onclick]","[data-action]"].join(", ");static DEAD_CLICK_DEFER_MS=400;handleHeatmapClick=(X)=>{try{let J=X.target,Z=J?.closest(s.INTERACTIVE_SELECTOR),Q=Z||J,Y=Q?.tagName?.toLowerCase()||"",q=(Q?.textContent||"").trim().slice(0,100),G=Q?.href||"",V={x:Math.round(X.clientX/window.innerWidth*1e4)/100,y:Math.round((X.clientY+window.scrollY)/document.documentElement.scrollHeight*1e4)/100,documentHeight:document.documentElement.scrollHeight,viewportX:X.clientX,viewportY:X.clientY,page:window.location.pathname,elementTag:Y,elementText:q,elementHref:G,isInteractive:!0};if(Z)this.emitCustomEvent("mouse_click",V);else this.deferDeadClickCheck(V);this.resetIdleTimer()}catch(J){console.warn("SessionSight: error in heatmap click handler",J)}};deferDeadClickCheck(X){let J=window.location.href,Z=!1,Q=document.body||document.documentElement;if(!Q){X.isInteractive=!1,this.emitCustomEvent("mouse_click",X);return}let Y=new MutationObserver(()=>{Z=!0});try{Y.observe(Q,{childList:!0,subtree:!0})}catch(q){console.warn("SessionSight: error observing mutations",q),X.isInteractive=!1,this.emitCustomEvent("mouse_click",X);return}setTimeout(()=>{Y.disconnect();let q=window.location.href!==J;X.isInteractive=Z||q,this.emitCustomEvent("mouse_click",X)},s.DEAD_CLICK_DEFER_MS)}handleHeatmapMouseMove=(X)=>{try{let J=Date.now();if(J-this.lastInteractionTime>5000)this.resetIdleTimer();if(J-this.lastMouseMoveEmit<500)return;this.lastMouseMoveEmit=J,this.emitCustomEvent("mouse_move",{x:Math.round(X.clientX/window.innerWidth*1e4)/100,y:Math.round((X.clientY+window.scrollY)/document.documentElement.scrollHeight*1e4)/100,documentHeight:document.documentElement.scrollHeight,page:window.location.pathname})}catch(J){console.warn("SessionSight: error in mousemove handler",J)}};handleHeatmapScroll=()=>{try{let X=Date.now(),J=window.scrollY;if(this.lastScrollY!==0){let Z=J>this.lastScrollY?"down":"up";if(Z!==this.lastScrollDirection&&this.lastScrollDirection!==null){this.scrollHistory.push({y:J,t:X,dir:Z});let Q=X-3000;while(this.scrollHistory.length>0&&this.scrollHistory[0].t<Q)this.scrollHistory.shift();if(this.scrollHistory.length>=4)this.emitCustomEvent("excessive_scroll",{page:window.location.pathname,count:this.scrollHistory.length}),this.scrollHistory=[]}this.lastScrollDirection=Z}this.lastScrollY=J,this.resetIdleTimer()}catch(X){console.warn("SessionSight: error in scroll handler",X)}};setupScrollDepthObserver(){if(this.teardownScrollDepthObserver(),typeof IntersectionObserver>"u")return;this.scrollDepthObserver=new IntersectionObserver((X)=>{try{for(let J of X){if(!J.isIntersecting)continue;let Z=Number(J.target.dataset.ssDepth);if(isNaN(Z)||this.scrollDepthHits.has(Z))continue;this.scrollDepthHits.add(Z);let Q=window.scrollY,Y=Math.max(1,document.documentElement.scrollHeight-window.innerHeight);if(this.emitCustomEvent("scroll_depth",{scrollY:Q,maxScrollY:Y,scrollPercent:Z,viewportHeight:window.innerHeight,page:window.location.pathname}),Z<100&&this.stopRrweb&&!this.isPaused)O0.takeFullSnapshot();this.scrollDepthObserver?.unobserve(J.target)}}catch(J){console.warn("SessionSight: error in scroll depth observer",J)}},{threshold:0}),this.placeSentinels()}placeSentinels(){for(let J of this.scrollSentinels)J.remove();this.scrollSentinels=[];let X=document.documentElement.scrollHeight;for(let J of s.SCROLL_DEPTH_THRESHOLDS){if(this.scrollDepthHits.has(J))continue;let Z=document.createElement("div");Z.dataset.ssDepth=String(J),Z.setAttribute("aria-hidden","true"),Z.style.cssText="position:absolute;left:0;width:1px;height:1px;pointer-events:none;opacity:0;z-index:-1;",Z.style.top=`${Math.min(X-1,J/100*X)}px`,document.documentElement.appendChild(Z),this.scrollSentinels.push(Z),this.scrollDepthObserver?.observe(Z)}}teardownScrollDepthObserver(){if(this.scrollDepthObserver)this.scrollDepthObserver.disconnect(),this.scrollDepthObserver=null;for(let X of this.scrollSentinels)X.remove();this.scrollSentinels=[]}sanitizePii(X){return X.replace(/[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}/g,"[email]").replace(/(\+?\d{1,3}[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}/g,"[phone]").replace(/(https?:\/\/[^\s?#]+)\?[^\s)"]*/g,"$1?[redacted]")}stripQueryString(X){try{let J=new URL(X);return J.origin+J.pathname}catch{return X.replace(/\?.*$/,"")}}emitErrorEvent(X){let J=Date.now();if(X.message===this.lastErrorMessage&&J-this.lastErrorTime<1000)return;this.lastErrorMessage=X.message,this.lastErrorTime=J,this.emitCustomEvent("error",{message:this.sanitizePii(X.message),stack:this.sanitizePii(X.stack),source:this.stripQueryString(X.source),lineno:X.lineno,colno:X.colno,type:X.type,page:window.location.pathname})}handleWindowError=(X)=>{this.emitErrorEvent({message:X.message||"Unknown error",stack:(X.error?.stack||"").slice(0,4000),source:X.filename||"",lineno:X.lineno||0,colno:X.colno||0,type:"uncaught"})};handleUnhandledRejection=(X)=>{let J=X.reason,Z=J instanceof Error?J.message:String(J||"Unhandled rejection"),Q=J instanceof Error?(J.stack||"").slice(0,4000):"";this.emitErrorEvent({message:Z,stack:Q,source:"",lineno:0,colno:0,type:"unhandled_rejection"})};resetIdleTimer(){if(this.lastInteractionTime=Date.now(),this.idleEmitted=!1,this.idleTimer)clearTimeout(this.idleTimer);this.idleTimer=setTimeout(()=>this.checkIdle(),s.IDLE_THRESHOLD_MS)}checkIdle(){if(this.idleEmitted)return;if(document.visibilityState!=="visible")return;let X=Date.now()-this.lastInteractionTime;if(X>=s.IDLE_THRESHOLD_MS)this.idleEmitted=!0,this.emitCustomEvent("idle_detected",{duration:X,page:window.location.pathname})}handleKeydown=()=>{this.resetIdleTimer()};patchHistoryMethods(){let X=History.prototype.pushState,J=History.prototype.replaceState;this.origPushState=history.pushState.bind(history),this.origReplaceState=history.replaceState.bind(history);let Z=this;history.pushState=function(...Q){(Z.origPushState||X.bind(history))(...Q);try{Z.handleNavigation()}catch(q){console.warn("SessionSight: error in pushState handler",q)}},history.replaceState=function(...Q){(Z.origReplaceState||J.bind(history))(...Q);try{Z.handleNavigation()}catch(q){console.warn("SessionSight: error in replaceState handler",q)}}}unpatchHistoryMethods(){if(this.origPushState)history.pushState=this.origPushState,this.origPushState=null;if(this.origReplaceState)history.replaceState=this.origReplaceState,this.origReplaceState=null}handleNavigation=()=>{try{let X=window.location.href;if(X===this.lastHref)return;this.lastHref=X;let J=this.excludePagePatterns.length>0&&oZ(window.location.pathname,this.excludePagePatterns);if(J&&!this.isPaused){this.bridge.flush();let Q={type:j8,data:{href:X,width:window.innerWidth,height:window.innerHeight},timestamp:Date.now()};this.pushEvent(Q),this.emitCustomEvent("ss-page-excluded",{href:X}),this.bridge.flush(),this.isPaused=!0;return}if(!J&&this.isPaused)this.isPaused=!1;this.bridge.flush(),B8();let Z={type:j8,data:{href:X,width:window.innerWidth,height:window.innerHeight},timestamp:Date.now()};if(this.pushEvent(Z),this.settledSnapshotTimer)clearTimeout(this.settledSnapshotTimer),this.settledSnapshotTimer=null;if(this.stopRrweb)this.stopRrweb(),this.stopRrweb=null;this.scrollDepthHits.clear(),setTimeout(()=>{this.startRrweb(),this.setupScrollDepthObserver()},100)}catch(X){console.warn("SessionSight: error in navigation handler",X)}};checkFlagToken(){try{let X=W8("flagEvaluationToken");if(X&&X!==this.lastEmittedFlagToken)this.lastEmittedFlagToken=X,this.emitCustomEvent("flag_evaluation",{token:X})}catch(X){console.warn("SessionSight: error checking flag token",X)}}collectMetadata(){return{url:window.location.href,referrer:document.referrer||"",userAgent:navigator.userAgent,screenWidth:window.innerWidth,screenHeight:window.innerHeight,language:navigator.language}}handleVisibilityChange=()=>{try{if(document.visibilityState==="hidden")this.bridge.sendBeacon(),this.hiddenAt=Date.now(),this.isHidden=!0;else if(this.isHidden=!1,this.hiddenAt&&Date.now()-this.hiddenAt>=s.VISIBILITY_GRACE_MS)this.hiddenAt=null,this.endedByVisibility=!0,this.stop();else this.hiddenAt=null}catch(X){console.warn("SessionSight: error in visibility handler",X)}};handleBeforeUnload=()=>{try{this.bridge.sendBeacon()}catch(X){console.warn("SessionSight: error in beforeunload handler",X)}}}class _J{apiUrl;publicApiKey;propertyId;killed=!1;ws=null;wsReady=!1;reconnectTimer=null;reconnectDelay=1000;static MAX_RECONNECT_DELAY=30000;closed=!1;onPrivacyConfig=null;constructor(X,J,Z){this.apiUrl=X,this.publicApiKey=J,this.propertyId=Z,this.connectWs()}onPrivacy(X){this.onPrivacyConfig=X}isKilled(){return this.killed}connectWs(){if(this.killed||this.closed)return;try{let X=this.apiUrl.replace(/^http/,"ws").replace(/\/$/,"");this.ws=new WebSocket(`${X}/ws/ingest?key=${encodeURIComponent(this.publicApiKey)}&propertyId=${encodeURIComponent(this.propertyId)}`),this.ws.onopen=()=>{},this.ws.onmessage=(J)=>{try{let Z=JSON.parse(typeof J.data==="string"?J.data:"");if(Z.type==="ready"){if(this.wsReady=!0,this.reconnectDelay=1000,Z.privacy&&this.onPrivacyConfig)this.onPrivacyConfig(Z.privacy)}if(Z.type==="error"&&Z.code==="QUOTA_EXCEEDED");}catch{}},this.ws.onclose=(J)=>{if(this.wsReady=!1,this.ws=null,J.code===4001){this.killed=!0,console.warn("SessionSight: invalid API key. Ingestion disabled.");return}if(J.code===4002){this.killed=!0;return}this.scheduleReconnect()},this.ws.onerror=()=>{}}catch{this.scheduleReconnect()}}scheduleReconnect(){if(this.killed||this.closed||this.reconnectTimer)return;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connectWs()},this.reconnectDelay),this.reconnectDelay=Math.min(this.reconnectDelay*2+Math.random()*500,_J.MAX_RECONNECT_DELAY)}async send(X){if(this.killed)return;if(this.wsReady&&this.ws?.readyState===WebSocket.OPEN)try{this.ws.send(JSON.stringify(X));return}catch{}let J=this.chunkEvents(X);for(let Z of J)if(await this.sendHttpChunk(Z),this.killed)return}sendBeacon(X){if(this.killed)return;let J=this.chunkEvents(X);for(let Z of J)try{let Q=JSON.stringify({...Z,apiKey:this.publicApiKey});if(Q.length>60000){this.sendHttpChunk(Z);continue}let Y=new Blob([Q],{type:"application/json"});navigator.sendBeacon(`${this.apiUrl}/v1/ingest`,Y)}catch{}}destroy(){if(this.closed=!0,this.reconnectTimer)clearTimeout(this.reconnectTimer),this.reconnectTimer=null;if(this.ws){try{this.ws.close(1000)}catch{}this.ws=null}this.wsReady=!1}chunkEvents(X){let{events:J,...Z}=X;if(J.length===0)return[X];let Q=JSON.stringify({...Z,events:[]}).length,Y=[],q=[],G=Q;for(let V of J){let K=JSON.stringify(V).length+1;if(q.length>0&&G+K>60000)Y.push({...Z,events:q}),q=[],G=Q;q.push(V),G+=K}if(q.length>0)Y.push({...Z,events:q});return Y}async sendHttpChunk(X){try{let J=JSON.stringify(X),Z=await fetch(`${this.apiUrl}/v1/ingest`,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":this.publicApiKey},body:J,keepalive:J.length<60000});if(Z.status===401||Z.status===403)this.killed=!0,console.warn("SessionSight: invalid API key. Ingestion disabled.")}catch{}}}var J9='var K="",F="",U="",b="",q="",N=null,Y=null,W=!1,_=null,D=!1,$=!1,C=[],L=null,J=null,M=!1,H=null,X=1000,S=30000,A=!1;function I(){if($||A)return;try{let B=K.replace(/^http/,"ws").replace(/\\/$/,"");J=new WebSocket(`${B}/ws/ingest?key=${encodeURIComponent(F)}&propertyId=${encodeURIComponent(U)}`),J.onmessage=(j)=>{try{let G=JSON.parse(typeof j.data==="string"?j.data:"");if(G.type==="ready"){if(M=!0,X=1000,self.postMessage({type:"ready"}),G.privacy)self.postMessage({type:"privacy",config:G.privacy})}}catch{}},J.onclose=(j)=>{if(M=!1,J=null,j.code===4001){$=!0,self.postMessage({type:"killed",reason:"invalid_api_key"});return}if(j.code===4002){$=!0,self.postMessage({type:"killed",reason:"subscription_required"});return}P()},J.onerror=()=>{}}catch{P()}}function P(){if($||A||H)return;H=setTimeout(()=>{H=null,I()},X),X=Math.min(X*2+Math.random()*500,S)}function O(B=!1){if($||C.length===0)return;let j=C.splice(0),G=j.map((V)=>V.event),Z=j[0].seq,Q=j[j.length-1].seq,x={sessionId:b,propertyId:U,visitorId:q,events:G,seqStart:Z,seqEnd:Q};if(N)x.userId=N;if(W&&Y)x.userProperties={...Y},W=!1;if(!D&&_)x.metadata=_,D=!0;if(B)x.final=!0;T(x,Q)}function T(B,j){if(M&&J?.readyState===WebSocket.OPEN)try{J.send(JSON.stringify(B)),self.postMessage({type:"ack",seq:j});return}catch{}k(B,j)}async function k(B,j){let G=w(B),Z=!1;for(let Q of G)try{let x=JSON.stringify(Q),V=await fetch(`${K}/v1/ingest`,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":F},body:x,keepalive:x.length<60000});if(V.status===401||V.status===403){$=!0,self.postMessage({type:"killed",reason:"invalid_api_key"});return}}catch{Z=!0}if(!Z)self.postMessage({type:"ack",seq:j})}function w(B){let{events:j,...G}=B;if(j.length===0)return[B];let Z=JSON.stringify({...G,events:[]}).length,Q=[],x=[],V=Z;for(let z of j){let R=JSON.stringify(z).length+1;if(x.length>0&&V+R>60000)Q.push({...G,events:x}),x=[],V=Z;x.push(z),V+=R}if(x.length>0)Q.push({...G,events:x});return Q}self.onmessage=(B)=>{try{let j=B.data;switch(j.type){case"init":K=j.apiUrl,F=j.publicApiKey,U=j.propertyId,b=j.sessionId,q=j.visitorId,I(),L=setInterval(()=>O(),6000);break;case"event":if($)break;if(C.push({event:j.event,seq:j.seq}),C.length>=50)O();break;case"metadata":_=j.metadata;break;case"identify":if(N=j.userId,j.userProperties)Y={...Y||{},...j.userProperties},W=!0;break;case"flush":O();break;case"flush-final":if(L)clearInterval(L),L=null;if(O(!0),A=!0,J){try{J.close(1000)}catch{}J=null}if(M=!1,H)clearTimeout(H),H=null;break}}catch(j){console.warn("SessionSight worker: error handling message",j)}};\n';function D8(){try{if(typeof Worker>"u"||!J9)return null;let X=new Blob([J9],{type:"application/javascript"}),J=URL.createObjectURL(X),Z=new Worker(J);return setTimeout(()=>URL.revokeObjectURL(J),0),Z}catch(X){return console.warn("SessionSight: failed to create worker, using main-thread fallback",X),null}}var zK=6000,HK=50,LK=60000;class Z9{worker=null;seq=0;lastAckedSeq=0;mirrorBuffer=[];_killed=!1;onPrivacyCallback=null;onKilledCallback=null;sessionId;propertyId;visitorId;apiUrl;publicApiKey;metadata=null;metadataSent=!1;userId=null;userProperties=null;userPropertiesDirty=!1;fallbackTransport=null;fallbackBuffer=[];fallbackFlushTimer=null;constructor(X,J,Z,Q,Y){this.apiUrl=X,this.publicApiKey=J,this.propertyId=Z,this.sessionId=Q,this.visitorId=Y;let q=D8();if(q)this.worker=q,this.worker.onmessage=this.handleWorkerMessage,this.worker.onerror=(G)=>{console.warn("SessionSight: worker error, falling back to main thread",G),this.switchToFallback()},this.worker.postMessage({type:"init",apiUrl:X,publicApiKey:J,propertyId:Z,sessionId:Q,visitorId:Y});else this.initFallback()}postEvent(X){if(this._killed)return;let J=++this.seq;if(this.worker){this.mirrorBuffer.push({event:X,seq:J});try{this.worker.postMessage({type:"event",event:X,seq:J})}catch(Z){console.warn("SessionSight: postMessage failed, falling back",Z),this.switchToFallback(),this.fallbackBuffer.push(X)}}else if(this.fallbackBuffer.push(X),this.fallbackBuffer.length>=HK)this.fallbackFlush()}postMetadata(X){if(this.metadata=X,this.worker)try{this.worker.postMessage({type:"metadata",metadata:X})}catch{}}postIdentify(X,J){if(this.userId=X,J)this.userProperties={...this.userProperties||{},...J},this.userPropertiesDirty=!0;if(this.worker)try{this.worker.postMessage({type:"identify",userId:X,userProperties:J})}catch{}}flush(){if(this.worker)try{this.worker.postMessage({type:"flush"})}catch{}else this.fallbackFlush()}sendBeacon(){if(this.worker)try{this.worker.postMessage({type:"flush-final"})}catch{}let X=this.worker?this.mirrorBuffer.filter((Q)=>Q.seq>this.lastAckedSeq):this.fallbackBuffer.splice(0).map((Q,Y)=>({event:Q,seq:this.lastAckedSeq+Y+1}));if(X.length===0)return;let J=X.map((Q)=>Q.event),Z={sessionId:this.sessionId,propertyId:this.propertyId,visitorId:this.visitorId,events:J,seqStart:X[0].seq,seqEnd:X[X.length-1].seq,final:!0};if(this.userId)Z.userId=this.userId;if(this.userPropertiesDirty&&this.userProperties)Z.userProperties={...this.userProperties};if(!this.metadataSent&&this.metadata)Z.metadata=this.metadata,this.metadataSent=!0;try{let Q=JSON.stringify({...Z,apiKey:this.publicApiKey});if(Q.length<=LK){let Y=new Blob([Q],{type:"application/json"});navigator.sendBeacon(`${this.apiUrl}/v1/ingest`,Y)}else fetch(`${this.apiUrl}/v1/ingest`,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":this.publicApiKey},body:Q,keepalive:!0}).catch(()=>{})}catch{}}onPrivacy(X){if(this.onPrivacyCallback=X,this.fallbackTransport)this.fallbackTransport.onPrivacy(X)}onKilled(X){this.onKilledCallback=X}isKilled(){return this._killed}destroy(){if(this.worker){try{this.worker.terminate()}catch{}this.worker=null}if(this.fallbackTransport)this.fallbackTransport.destroy(),this.fallbackTransport=null;if(this.fallbackFlushTimer)clearInterval(this.fallbackFlushTimer),this.fallbackFlushTimer=null;this.mirrorBuffer=[],this.fallbackBuffer=[]}handleWorkerMessage=(X)=>{try{let J=X.data;switch(J.type){case"ack":this.lastAckedSeq=J.seq;while(this.mirrorBuffer.length>0&&this.mirrorBuffer[0].seq<=J.seq)this.mirrorBuffer.shift();break;case"privacy":if(this.onPrivacyCallback)this.onPrivacyCallback(J.config);break;case"killed":if(this._killed=!0,this.onKilledCallback)this.onKilledCallback();break;case"ready":break}}catch(J){console.warn("SessionSight: error handling worker message",J)}};initFallback(){if(this.fallbackTransport=new _J(this.apiUrl,this.publicApiKey,this.propertyId),this.onPrivacyCallback)this.fallbackTransport.onPrivacy(this.onPrivacyCallback);this.fallbackFlushTimer=setInterval(()=>this.fallbackFlush(),zK)}switchToFallback(){if(this.fallbackTransport)return;if(this.worker){try{this.worker.terminate()}catch{}this.worker=null}this.initFallback();for(let X of this.mirrorBuffer)this.fallbackBuffer.push(X.event);this.mirrorBuffer=[]}fallbackFlush(){if(!this.fallbackTransport||this.fallbackBuffer.length===0)return;if(this.fallbackTransport.isKilled()){if(this._killed=!0,this.fallbackBuffer=[],this.fallbackFlushTimer)clearInterval(this.fallbackFlushTimer),this.fallbackFlushTimer=null;if(this.onKilledCallback)this.onKilledCallback();return}let X=this.fallbackBuffer.splice(0),J={sessionId:this.sessionId,propertyId:this.propertyId,visitorId:this.visitorId,events:X};if(this.userId)J.userId=this.userId;if(this.userPropertiesDirty&&this.userProperties)J.userProperties={...this.userProperties},this.userPropertiesDirty=!1;if(!this.metadataSent&&this.metadata)J.metadata=this.metadata,this.metadataSent=!0;this.fallbackTransport.send(J)}}var F8="sessionsight_privacy_config",C=null,Q0=null,S0=null,P1=null,O1=null,i0=null,A0={privacyMode:"default",excludePages:[]},CJ=null,I0="";function DK(X){try{let J=sessionStorage.getItem(F8);if(J){let Z=JSON.parse(J);if(Z.propertyId===X)return{privacyMode:Z.privacyMode,excludePages:Z.excludePages}}}catch{}return{privacyMode:"default",excludePages:[]}}function FK(X,J){try{sessionStorage.setItem(F8,JSON.stringify({propertyId:X,privacyMode:J.privacyMode,excludePages:J.excludePages}))}catch{}}function PK(){if(!S0)return;let X=S0();if(X===O1)return;if(O1=X,X){if(C||!Q0)return;let{bridge:J,propertyId:Z,autoRecord:Q}=Q0;Q0=null,C=new s(J,Z,I0,{privacyMode:A0.privacyMode,excludePages:A0.excludePages}),C.start(Q)}else{if(!C)return;Q0={bridge:C.getBridge(),propertyId:C.getPropertyId(),autoRecord:!0},C.stop(),C=null}}function OK(){if(document.visibilityState!=="visible")return;if(!C?.endedByVisibility)return;if(!CJ)return;if(S0&&!S0())return;let{bridge:X,propertyId:J,autoRecord:Z}=CJ;C=new s(X,J,I0,{privacyMode:A0.privacyMode,excludePages:A0.excludePages}),C.start(Z)}function AK(){if(P1)return;P1=setInterval(PK,1000)}function MK(){if(P1)clearInterval(P1),P1=null}var wK={init(X){try{if(typeof window>"u"||typeof document>"u"){console.warn("SessionSight: browser environment required. Skipping initialization in SSR/Node.");return}if(C||Q0){console.warn("SessionSight is already initialized.");return}if(!X.publicApiKey){console.error("SessionSight: publicApiKey is required.");return}let J=X.propertyId||"dev",Z=K8(X.apiUrl||""),Q=X.autoRecord!==!1,Y=DK(J);A0=Y;let{privacyMode:q,excludePages:G}=Y,V=typeof crypto<"u"&&typeof crypto.randomUUID==="function"?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`;I0=V8();let K=new Z9(Z,X.publicApiKey,J,V,I0);if(K.onPrivacy((j)=>{if(A0=j,FK(J,j),C)C.applyPrivacyConfig(j)}),CJ={bridge:K,propertyId:J,autoRecord:Q},!i0)i0=OK,document.addEventListener("visibilitychange",i0);let W=X.enabled;if(typeof W==="function"){S0=W;let j=S0();if(O1=j,j)C=new s(K,J,I0,{privacyMode:q,excludePages:G}),C.start(Q);else Q0={bridge:K,propertyId:J,autoRecord:Q};AK()}else if(W!==!1)C=new s(K,J,I0,{privacyMode:q,excludePages:G}),C.start(Q);else Q0={bridge:K,propertyId:J,autoRecord:Q}}catch(J){console.warn("SessionSight: failed to initialize",J)}},setEnabled(X){if(X){if(C)return;if(!Q0){console.warn("SessionSight: call init() before setEnabled().");return}let{bridge:J,propertyId:Z,autoRecord:Q}=Q0;Q0=null,C=new s(J,Z,I0,{privacyMode:A0.privacyMode,excludePages:A0.excludePages}),C.start(Q)}else{if(!C)return;Q0={bridge:C.getBridge(),propertyId:C.getPropertyId(),autoRecord:!0},C.stop(),C=null}O1=X},record(X){if(C)C.beginRecording(X)},stop(){if(MK(),S0=null,O1=null,CJ=null,i0)document.removeEventListener("visibilitychange",i0),i0=null;if(C)C.stop(),C=null;Q0=null},identify(X,J){if(C)C.identify(X,J)},getVisitorId(){return C?C.getVisitorId():null}},P8=wK;window.SessionSight=P8;})();
|