@bworlds/launchkit 0.1.0

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.
@@ -0,0 +1,441 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var Ha=Object.defineProperty,ja=(s,e,t)=>e in s?Ha(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,S=(s,e,t)=>ja(s,typeof e!="symbol"?e+"":e,t),gi,Ga=Object.defineProperty,Va=(s,e,t)=>e in s?Ga(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,yi=(s,e,t)=>Va(s,typeof e!="symbol"?e+"":e,t),K=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(K||{});const wi={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},bi={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},wt={},Ya=()=>!!globalThis.Zone;function Ps(s){if(wt[s])return wt[s];const e=globalThis[s],t=e.prototype,r=s in wi?wi[s]:void 0,i=!!(r&&r.every(l=>{var a,u;return!!((u=(a=Object.getOwnPropertyDescriptor(t,l))==null?void 0:a.get)!=null&&u.toString().includes("[native code]"))})),n=s in bi?bi[s]:void 0,o=!!(n&&n.every(l=>{var a;return typeof t[l]=="function"&&((a=t[l])==null?void 0:a.toString().includes("[native code]"))}));if(i&&o&&!Ya())return wt[s]=e.prototype,e.prototype;try{const l=document.createElement("iframe");document.body.appendChild(l);const a=l.contentWindow;if(!a)return e.prototype;const u=a[s].prototype;return document.body.removeChild(l),u?wt[s]=u:t}catch{return t}}const Ar={};function we(s,e,t){var r;const i=`${s}.${String(t)}`;if(Ar[i])return Ar[i].call(e);const n=Ps(s),o=(r=Object.getOwnPropertyDescriptor(n,t))==null?void 0:r.get;return o?(Ar[i]=o,o.call(e)):e[t]}const Or={};function $n(s,e,t){const r=`${s}.${String(t)}`;if(Or[r])return Or[r].bind(e);const n=Ps(s)[t];return typeof n!="function"?e[t]:(Or[r]=n,n.bind(e))}function Za(s){return we("Node",s,"childNodes")}function Ja(s){return we("Node",s,"parentNode")}function Xa(s){return we("Node",s,"parentElement")}function Ka(s){return we("Node",s,"textContent")}function Qa(s,e){return $n("Node",s,"contains")(e)}function qa(s){return $n("Node",s,"getRootNode")()}function el(s){return!s||!("host"in s)?null:we("ShadowRoot",s,"host")}function tl(s){return s.styleSheets}function rl(s){return!s||!("shadowRoot"in s)?null:we("Element",s,"shadowRoot")}function sl(s,e){return we("Element",s,"querySelector")(e)}function il(s,e){return we("Element",s,"querySelectorAll")(e)}function nl(){return Ps("MutationObserver").constructor}const q={childNodes:Za,parentNode:Ja,parentElement:Xa,textContent:Ka,contains:Qa,getRootNode:qa,host:el,styleSheets:tl,shadowRoot:rl,querySelector:sl,querySelectorAll:il,mutationObserver:nl};function Nn(s){return s.nodeType===s.ELEMENT_NODE}function Xe(s){const e=s&&"host"in s&&"mode"in s&&q.host(s)||null;return!!(e&&"shadowRoot"in e&&q.shadowRoot(e)===s)}function Ke(s){return Object.prototype.toString.call(s)==="[object ShadowRoot]"}function ol(s){return s.includes(" background-clip: text;")&&!s.includes(" -webkit-background-clip: text;")&&(s=s.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),s}function al(s){const{cssText:e}=s;if(e.split('"').length<3)return e;const t=["@import",`url(${JSON.stringify(s.href)})`];return s.layerName===""?t.push("layer"):s.layerName&&t.push(`layer(${s.layerName})`),s.supportsText&&t.push(`supports(${s.supportsText})`),s.media.length&&t.push(s.media.mediaText),t.join(" ")+";"}function Yr(s){try{const e=s.rules||s.cssRules;if(!e)return null;let t=s.href;!t&&s.ownerNode&&s.ownerNode.ownerDocument&&(t=s.ownerNode.ownerDocument.location.href);const r=Array.from(e,i=>Tn(i,t)).join("");return ol(r)}catch{return null}}function Tn(s,e){if(ul(s)){let t;try{t=Yr(s.styleSheet)||al(s)}catch{t=s.cssText}return s.styleSheet.href?Qt(t,s.styleSheet.href):t}else{let t=s.cssText;return cl(s)&&s.selectorText.includes(":")&&(t=ll(t)),e?Qt(t,e):t}}function ll(s){const e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return s.replace(e,"$1\\$2")}function ul(s){return"styleSheet"in s}function cl(s){return"selectorText"in s}class Pn{constructor(){yi(this,"idNodeMap",new Map),yi(this,"nodeMetaMap",new WeakMap)}getId(e){var t;return e?((t=this.getMeta(e))==null?void 0:t.id)??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){const r=this.getNode(e);if(r){const i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function hl(){return new Pn}function Ds({element:s,maskInputOptions:e,tagName:t,type:r,value:i,maskInputFn:n}){let o=i||"";const l=r&&Ie(r);return(e[t.toLowerCase()]||l&&e[l])&&(n?o=n(o,s):o="*".repeat(o.length)),o}function Ie(s){return s.toLowerCase()}const vi="__rrweb_original__";function fl(s){const e=s.getContext("2d");if(!e)return!0;const t=50;for(let r=0;r<s.width;r+=t)for(let i=0;i<s.height;i+=t){const n=e.getImageData,o=vi in n?n[vi]:n;if(new Uint32Array(o.call(e,r,i,Math.min(t,s.width-r),Math.min(t,s.height-i)).data.buffer).some(a=>a!==0))return!1}return!0}function Ls(s){const e=s.type;return s.hasAttribute("data-rr-is-password")?"password":e?Ie(e):null}function Dn(s,e){let t;try{t=new URL(s,e??window.location.href)}catch{return null}const r=/\.([0-9a-z]+)(?:$)/i,i=t.pathname.match(r);return(i==null?void 0:i[1])??null}function dl(s){let e="";return s.indexOf("//")>-1?e=s.split("/").slice(0,3).join("/"):e=s.split("/")[0],e=e.split("?")[0],e}const pl=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ml=/^(?:[a-z+]+:)?\/\//i,gl=/^www\..*/i,yl=/^(data:)([^,]*),(.*)/i;function Qt(s,e){return(s||"").replace(pl,(t,r,i,n,o,l)=>{const a=i||o||l,u=r||n||"";if(!a)return t;if(ml.test(a)||gl.test(a))return`url(${u}${a}${u})`;if(yl.test(a))return`url(${u}${a}${u})`;if(a[0]==="/")return`url(${u}${dl(e)+a}${u})`;const c=e.split("/"),h=a.split("/");c.pop();for(const p of h)p!=="."&&(p===".."?c.pop():c.push(p));return`url(${u}${c.join("/")}${u})`})}function $r(s){return s.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function wl(s,e){const t=Array.from(e.childNodes),r=[];if(t.length>1&&s&&typeof s=="string"){const i=$r(s);for(let n=1;n<t.length;n++)if(t[n].textContent&&typeof t[n].textContent=="string"){const o=$r(t[n].textContent);for(let l=3;l<o.length;l++){const a=o.substring(0,l);if(i.split(a).length===2){const u=i.indexOf(a);for(let c=u;c<s.length;c++)if($r(s.substring(0,c)).length===u){r.push(s.substring(0,c)),s=s.substring(c);break}break}}}}return r.push(s),r}function bl(s,e){return wl(s,e).join("/* rr_split */")}let vl=1;const Sl=new RegExp("[^a-z0-9-_:]"),qe=-2;function Ln(){return vl++}function Cl(s){if(s instanceof HTMLFormElement)return"form";const e=Ie(s.tagName);return Sl.test(e)?"div":e}let Ee,Si;const _l=/^[^ \t\n\r\u000c]+/,xl=/^[, \t\n\r\u000c]+/;function Il(s,e){if(e.trim()==="")return e;let t=0;function r(n){let o;const l=n.exec(e.substring(t));return l?(o=l[0],t+=o.length,o):""}const i=[];for(;r(xl),!(t>=e.length);){let n=r(_l);if(n.slice(-1)===",")n=Oe(s,n.substring(0,n.length-1)),i.push(n);else{let o="";n=Oe(s,n);let l=!1;for(;;){const a=e.charAt(t);if(a===""){i.push((n+o).trim());break}else if(l)a===")"&&(l=!1);else if(a===","){t+=1,i.push((n+o).trim());break}else a==="("&&(l=!0);o+=a,t+=1}}}return i.join(", ")}const Ci=new WeakMap;function Oe(s,e){return!e||e.trim()===""?e:Fs(s,e)}function Rl(s){return!!(s.tagName==="svg"||s.ownerSVGElement)}function Fs(s,e){let t=Ci.get(s);if(t||(t=s.createElement("a"),Ci.set(s,t)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return t.setAttribute("href",e),t.href}function Fn(s,e,t,r){return r&&(t==="src"||t==="href"&&!(e==="use"&&r[0]==="#")||t==="xlink:href"&&r[0]!=="#"||t==="background"&&(e==="table"||e==="td"||e==="th")?Oe(s,r):t==="srcset"?Il(s,r):t==="style"?Qt(r,Fs(s)):e==="object"&&t==="data"?Oe(s,r):r)}function Un(s,e,t){return(s==="video"||s==="audio")&&e==="autoplay"}function kl(s,e,t){try{if(typeof e=="string"){if(s.classList.contains(e))return!0}else for(let r=s.classList.length;r--;){const i=s.classList[r];if(e.test(i))return!0}if(t)return s.matches(t)}catch{}return!1}function qt(s,e,t){if(!s)return!1;if(s.nodeType!==s.ELEMENT_NODE)return t?qt(q.parentNode(s),e,t):!1;for(let r=s.classList.length;r--;){const i=s.classList[r];if(e.test(i))return!0}return t?qt(q.parentNode(s),e,t):!1}function Bn(s,e,t,r){let i;if(Nn(s)){if(i=s,!q.childNodes(i).length)return!1}else{if(q.parentElement(s)===null)return!1;i=q.parentElement(s)}try{if(typeof e=="string"){if(r){if(i.closest(`.${e}`))return!0}else if(i.classList.contains(e))return!0}else if(qt(i,e,r))return!0;if(t){if(r){if(i.closest(t))return!0}else if(i.matches(t))return!0}}catch{}return!1}function El(s,e,t){const r=s.contentWindow;if(!r)return;let i=!1,n;try{n=r.document.readyState}catch{return}if(n!=="complete"){const l=setTimeout(()=>{i||(e(),i=!0)},t);s.addEventListener("load",()=>{clearTimeout(l),i=!0,e()});return}const o="about:blank";if(r.location.href!==o||s.src===o||s.src==="")return setTimeout(e,0),s.addEventListener("load",e);s.addEventListener("load",e)}function Ml(s,e,t){let r=!1,i;try{i=s.sheet}catch{return}if(i)return;const n=setTimeout(()=>{r||(e(),r=!0)},t);s.addEventListener("load",()=>{clearTimeout(n),r=!0,e()})}function Al(s,e){const{doc:t,mirror:r,blockClass:i,blockSelector:n,needsMask:o,inlineStylesheet:l,maskInputOptions:a={},maskTextFn:u,maskInputFn:c,dataURLOptions:h={},inlineImages:p,recordCanvas:d,keepIframeSrcFn:g,newlyAddedElement:m=!1,cssCaptured:f=!1}=e,v=Ol(t,r);switch(s.nodeType){case s.DOCUMENT_NODE:return s.compatMode!=="CSS1Compat"?{type:K.Document,childNodes:[],compatMode:s.compatMode}:{type:K.Document,childNodes:[]};case s.DOCUMENT_TYPE_NODE:return{type:K.DocumentType,name:s.name,publicId:s.publicId,systemId:s.systemId,rootId:v};case s.ELEMENT_NODE:return Nl(s,{doc:t,blockClass:i,blockSelector:n,inlineStylesheet:l,maskInputOptions:a,maskInputFn:c,dataURLOptions:h,inlineImages:p,recordCanvas:d,keepIframeSrcFn:g,newlyAddedElement:m,rootId:v});case s.TEXT_NODE:return $l(s,{doc:t,needsMask:o,maskTextFn:u,rootId:v,cssCaptured:f});case s.CDATA_SECTION_NODE:return{type:K.CDATA,textContent:"",rootId:v};case s.COMMENT_NODE:return{type:K.Comment,textContent:q.textContent(s)||"",rootId:v};default:return!1}}function Ol(s,e){if(!e.hasNode(s))return;const t=e.getId(s);return t===1?void 0:t}function $l(s,e){const{needsMask:t,maskTextFn:r,rootId:i,cssCaptured:n}=e,o=q.parentNode(s),l=o&&o.tagName;let a="";const u=l==="STYLE"?!0:void 0,c=l==="SCRIPT"?!0:void 0;return c?a="SCRIPT_PLACEHOLDER":n||(a=q.textContent(s),u&&a&&(a=Qt(a,Fs(e.doc)))),!u&&!c&&a&&t&&(a=r?r(a,q.parentElement(s)):a.replace(/[\S]/g,"*")),{type:K.Text,textContent:a||"",rootId:i}}function Nl(s,e){const{doc:t,blockClass:r,blockSelector:i,inlineStylesheet:n,maskInputOptions:o={},maskInputFn:l,dataURLOptions:a={},inlineImages:u,recordCanvas:c,keepIframeSrcFn:h,newlyAddedElement:p=!1,rootId:d}=e,g=kl(s,r,i),m=Cl(s);let f={};const v=s.attributes.length;for(let y=0;y<v;y++){const C=s.attributes[y];Un(m,C.name,C.value)||(f[C.name]=Fn(t,m,Ie(C.name),C.value))}if(m==="link"&&n){const y=Array.from(t.styleSheets).find(k=>k.href===s.href);let C=null;y&&(C=Yr(y)),C&&(delete f.rel,delete f.href,f._cssText=C)}if(m==="style"&&s.sheet){let y=Yr(s.sheet);y&&(s.childNodes.length>1&&(y=bl(y,s)),f._cssText=y)}if(m==="input"||m==="textarea"||m==="select"){const y=s.value,C=s.checked;f.type!=="radio"&&f.type!=="checkbox"&&f.type!=="submit"&&f.type!=="button"&&y?f.value=Ds({element:s,type:Ls(s),tagName:m,value:y,maskInputOptions:o,maskInputFn:l}):C&&(f.checked=C)}if(m==="option"&&(s.selected&&!o.select?f.selected=!0:delete f.selected),m==="dialog"&&s.open&&(f.rr_open_mode=s.matches("dialog:modal")?"modal":"non-modal"),m==="canvas"&&c){if(s.__context==="2d")fl(s)||(f.rr_dataURL=s.toDataURL(a.type,a.quality));else if(!("__context"in s)){const y=s.toDataURL(a.type,a.quality),C=t.createElement("canvas");C.width=s.width,C.height=s.height;const k=C.toDataURL(a.type,a.quality);y!==k&&(f.rr_dataURL=y)}}if(m==="img"&&u){Ee||(Ee=t.createElement("canvas"),Si=Ee.getContext("2d"));const y=s,C=y.currentSrc||y.getAttribute("src")||"<unknown-src>",k=y.crossOrigin,M=()=>{y.removeEventListener("load",M);try{Ee.width=y.naturalWidth,Ee.height=y.naturalHeight,Si.drawImage(y,0,0),f.rr_dataURL=Ee.toDataURL(a.type,a.quality)}catch(V){if(y.crossOrigin!=="anonymous"){y.crossOrigin="anonymous",y.complete&&y.naturalWidth!==0?M():y.addEventListener("load",M);return}else console.warn(`Cannot inline img src=${C}! Error: ${V}`)}y.crossOrigin==="anonymous"&&(k?f.crossOrigin=k:y.removeAttribute("crossorigin"))};y.complete&&y.naturalWidth!==0?M():y.addEventListener("load",M)}if(m==="audio"||m==="video"){const y=f;y.rr_mediaState=s.paused?"paused":"played",y.rr_mediaCurrentTime=s.currentTime,y.rr_mediaPlaybackRate=s.playbackRate,y.rr_mediaMuted=s.muted,y.rr_mediaLoop=s.loop,y.rr_mediaVolume=s.volume}if(p||(s.scrollLeft&&(f.rr_scrollLeft=s.scrollLeft),s.scrollTop&&(f.rr_scrollTop=s.scrollTop)),g){const{width:y,height:C}=s.getBoundingClientRect();f={class:f.class,rr_width:`${y}px`,rr_height:`${C}px`}}m==="iframe"&&!h(f.src)&&(s.contentDocument||(f.rr_src=f.src),delete f.src);let b;try{customElements.get(m)&&(b=!0)}catch{}return{type:K.Element,tagName:m,attributes:f,childNodes:[],isSVG:Rl(s)||void 0,needBlock:g,rootId:d,isCustom:b}}function L(s){return s==null?"":s.toLowerCase()}function Tl(s,e){if(e.comment&&s.type===K.Comment)return!0;if(s.type===K.Element){if(e.script&&(s.tagName==="script"||s.tagName==="link"&&(s.attributes.rel==="preload"||s.attributes.rel==="modulepreload")&&s.attributes.as==="script"||s.tagName==="link"&&s.attributes.rel==="prefetch"&&typeof s.attributes.href=="string"&&Dn(s.attributes.href)==="js"))return!0;if(e.headFavicon&&(s.tagName==="link"&&s.attributes.rel==="shortcut icon"||s.tagName==="meta"&&(L(s.attributes.name).match(/^msapplication-tile(image|color)$/)||L(s.attributes.name)==="application-name"||L(s.attributes.rel)==="icon"||L(s.attributes.rel)==="apple-touch-icon"||L(s.attributes.rel)==="shortcut icon")))return!0;if(s.tagName==="meta"){if(e.headMetaDescKeywords&&L(s.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(L(s.attributes.property).match(/^(og|twitter|fb):/)||L(s.attributes.name).match(/^(og|twitter):/)||L(s.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(L(s.attributes.name)==="robots"||L(s.attributes.name)==="googlebot"||L(s.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&s.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(L(s.attributes.name)==="author"||L(s.attributes.name)==="generator"||L(s.attributes.name)==="framework"||L(s.attributes.name)==="publisher"||L(s.attributes.name)==="progid"||L(s.attributes.property).match(/^article:/)||L(s.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(L(s.attributes.name)==="google-site-verification"||L(s.attributes.name)==="yandex-verification"||L(s.attributes.name)==="csrf-token"||L(s.attributes.name)==="p:domain_verify"||L(s.attributes.name)==="verify-v1"||L(s.attributes.name)==="verification"||L(s.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function $e(s,e){const{doc:t,mirror:r,blockClass:i,blockSelector:n,maskTextClass:o,maskTextSelector:l,skipChild:a=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:h,maskInputFn:p,slimDOMOptions:d,dataURLOptions:g={},inlineImages:m=!1,recordCanvas:f=!1,onSerialize:v,onIframeLoad:b,iframeLoadTimeout:y=5e3,onStylesheetLoad:C,stylesheetLoadTimeout:k=5e3,keepIframeSrcFn:M=()=>!1,newlyAddedElement:V=!1,cssCaptured:O=!1}=e;let{needsMask:D}=e,{preserveWhiteSpace:Y=!0}=e;D||(D=Bn(s,o,l,D===void 0));const W=Al(s,{doc:t,mirror:r,blockClass:i,blockSelector:n,needsMask:D,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:p,dataURLOptions:g,inlineImages:m,recordCanvas:f,keepIframeSrcFn:M,newlyAddedElement:V,cssCaptured:O});if(!W)return console.warn(s,"not serialized"),null;let Q;r.hasNode(s)?Q=r.getId(s):Tl(W,d)||!Y&&W.type===K.Text&&!W.textContent.replace(/^\s+|\s+$/gm,"").length?Q=qe:Q=Ln();const E=Object.assign(W,{id:Q});if(r.add(s,E),Q===qe)return null;v&&v(s);let je=!a;if(E.type===K.Element){je=je&&!E.needBlock,delete E.needBlock;const J=q.shadowRoot(s);J&&Ke(J)&&(E.isShadowHost=!0)}if((E.type===K.Document||E.type===K.Element)&&je){d.headWhitespace&&E.type===K.Element&&E.tagName==="head"&&(Y=!1);const J={doc:t,mirror:r,blockClass:i,blockSelector:n,needsMask:D,maskTextClass:o,maskTextSelector:l,skipChild:a,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:p,slimDOMOptions:d,dataURLOptions:g,inlineImages:m,recordCanvas:f,preserveWhiteSpace:Y,onSerialize:v,onIframeLoad:b,iframeLoadTimeout:y,onStylesheetLoad:C,stylesheetLoadTimeout:k,keepIframeSrcFn:M,cssCaptured:!1};if(!(E.type===K.Element&&E.tagName==="textarea"&&E.attributes.value!==void 0)){E.type===K.Element&&E.attributes._cssText!==void 0&&typeof E.attributes._cssText=="string"&&(J.cssCaptured=!0);for(const ve of Array.from(q.childNodes(s))){const ue=$e(ve,J);ue&&E.childNodes.push(ue)}}let se=null;if(Nn(s)&&(se=q.shadowRoot(s)))for(const ve of Array.from(q.childNodes(se))){const ue=$e(ve,J);ue&&(Ke(se)&&(ue.isShadow=!0),E.childNodes.push(ue))}}const Ge=q.parentNode(s);return Ge&&Xe(Ge)&&Ke(Ge)&&(E.isShadow=!0),E.type===K.Element&&E.tagName==="iframe"&&El(s,()=>{const J=s.contentDocument;if(J&&b){const se=$e(J,{doc:J,mirror:r,blockClass:i,blockSelector:n,needsMask:D,maskTextClass:o,maskTextSelector:l,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:p,slimDOMOptions:d,dataURLOptions:g,inlineImages:m,recordCanvas:f,preserveWhiteSpace:Y,onSerialize:v,onIframeLoad:b,iframeLoadTimeout:y,onStylesheetLoad:C,stylesheetLoadTimeout:k,keepIframeSrcFn:M});se&&b(s,se)}},y),E.type===K.Element&&E.tagName==="link"&&typeof E.attributes.rel=="string"&&(E.attributes.rel==="stylesheet"||E.attributes.rel==="preload"&&typeof E.attributes.href=="string"&&Dn(E.attributes.href)==="css")&&Ml(s,()=>{if(C){const J=$e(s,{doc:t,mirror:r,blockClass:i,blockSelector:n,needsMask:D,maskTextClass:o,maskTextSelector:l,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:p,slimDOMOptions:d,dataURLOptions:g,inlineImages:m,recordCanvas:f,preserveWhiteSpace:Y,onSerialize:v,onIframeLoad:b,iframeLoadTimeout:y,onStylesheetLoad:C,stylesheetLoadTimeout:k,keepIframeSrcFn:M});J&&C(s,J)}},k),E}function Pl(s,e){const{mirror:t=new Pn,blockClass:r="rr-block",blockSelector:i=null,maskTextClass:n="rr-mask",maskTextSelector:o=null,inlineStylesheet:l=!0,inlineImages:a=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:h,maskInputFn:p,slimDOM:d=!1,dataURLOptions:g,preserveWhiteSpace:m,onSerialize:f,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:y,stylesheetLoadTimeout:C,keepIframeSrcFn:k=()=>!1}=e||{};return $e(s,{doc:s,mirror:t,blockClass:r,blockSelector:i,maskTextClass:n,maskTextSelector:o,skipChild:!1,inlineStylesheet:l,maskInputOptions:c===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:c===!1?{password:!0}:c,maskTextFn:h,maskInputFn:p,slimDOMOptions:d===!0||d==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:d==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:d===!1?{}:d,dataURLOptions:g,inlineImages:a,recordCanvas:u,preserveWhiteSpace:m,onSerialize:f,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:y,stylesheetLoadTimeout:C,keepIframeSrcFn:k,newlyAddedElement:!1})}function Dl(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function Ll(s){if(s.__esModule)return s;var e=s.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(r){var i=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return s[r]}})}),t}var Us={exports:{}},F=String,zn=function(){return{isColorSupported:!1,reset:F,bold:F,dim:F,italic:F,underline:F,inverse:F,hidden:F,strikethrough:F,black:F,red:F,green:F,yellow:F,blue:F,magenta:F,cyan:F,white:F,gray:F,bgBlack:F,bgRed:F,bgGreen:F,bgYellow:F,bgBlue:F,bgMagenta:F,bgCyan:F,bgWhite:F}};Us.exports=zn();Us.exports.createColors=zn;var Fl=Us.exports;const Ul={},Bl=Object.freeze(Object.defineProperty({__proto__:null,default:Ul},Symbol.toStringTag,{value:"Module"})),ae=Ll(Bl);let _i=Fl,xi=ae,Zr=class Wn extends Error{constructor(e,t,r,i,n,o){super(e),this.name="CssSyntaxError",this.reason=e,n&&(this.file=n),i&&(this.source=i),o&&(this.plugin=o),typeof t<"u"&&typeof r<"u"&&(typeof t=="number"?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Wn)}setMessage(){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(e){if(!this.source)return"";let t=this.source;e==null&&(e=_i.isColorSupported),xi&&e&&(t=xi(t));let r=t.split(/\r?\n/),i=Math.max(this.line-3,0),n=Math.min(this.line+2,r.length),o=String(n).length,l,a;if(e){let{bold:u,gray:c,red:h}=_i.createColors(!0);l=p=>u(h(p)),a=p=>c(p)}else l=a=u=>u;return r.slice(i,n).map((u,c)=>{let h=i+1+c,p=" "+(" "+h).slice(-o)+" | ";if(h===this.line){let d=a(p.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return l(">")+a(p)+u+`
2
+ `+d+l("^")}return" "+a(p)+u}).join(`
3
+ `)}toString(){let e=this.showSourceCode();return e&&(e=`
4
+
5
+ `+e+`
6
+ `),this.name+": "+this.message+e}};var Bs=Zr;Zr.default=Zr;var ct={};ct.isClean=Symbol("isClean");ct.my=Symbol("my");const Ii={after:`
7
+ `,beforeClose:`
8
+ `,beforeComment:`
9
+ `,beforeDecl:`
10
+ `,beforeOpen:" ",beforeRule:`
11
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function zl(s){return s[0].toUpperCase()+s.slice(1)}let Jr=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,i=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?r+=e.raws.afterName:i&&(r+=" "),e.nodes)this.block(e,r+i);else{let n=(e.raws.between||"")+(t?";":"");this.builder(r+i+n,e)}}beforeAfter(e,t){let r;e.type==="decl"?r=this.raw(e,null,"beforeDecl"):e.type==="comment"?r=this.raw(e,null,"beforeComment"):t==="before"?r=this.raw(e,null,"beforeRule"):r=this.raw(e,null,"beforeClose");let i=e.parent,n=0;for(;i&&i.type!=="root";)n+=1,i=i.parent;if(r.includes(`
12
+ `)){let o=this.raw(e,null,"indent");if(o.length)for(let l=0;l<n;l++)r+=o}return r}block(e,t){let r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start");let i;e.nodes&&e.nodes.length?(this.body(e),i=this.raw(e,"after")):i=this.raw(e,"after","emptyBody"),i&&this.builder(i),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let r=this.raw(e,"semicolon");for(let i=0;i<e.nodes.length;i++){let n=e.nodes[i],o=this.raw(n,"before");o&&this.builder(o),this.stringify(n,t!==i||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),i=e.prop+r+this.rawValue(e,"value");e.important&&(i+=e.raws.important||" !important"),t&&(i+=";"),this.builder(i,e)}document(e){this.body(e)}raw(e,t,r){let i;if(r||(r=t),t&&(i=e.raws[t],typeof i<"u"))return i;let n=e.parent;if(r==="before"&&(!n||n.type==="root"&&n.first===e||n&&n.type==="document"))return"";if(!n)return Ii[r];let o=e.root();if(o.rawCache||(o.rawCache={}),typeof o.rawCache[r]<"u")return o.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(e,r);{let l="raw"+zl(r);this[l]?i=this[l](o,e):o.walk(a=>{if(i=a.raws[t],typeof i<"u")return!1})}return typeof i>"u"&&(i=Ii[r]),o.rawCache[r]=i,i}rawBeforeClose(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return t=r.raws.after,t.includes(`
13
+ `)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
14
+ `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
15
+ `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(r=>{if(r.type!=="decl"&&(t=r.raws.between,typeof t<"u"))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&typeof r.raws.before<"u")return t=r.raws.before,t.includes(`
16
+ `)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(r=>{if(typeof r.raws.between<"u")return t=r.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length===0&&(t=r.raws.after,typeof t<"u"))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let i=r.parent;if(i&&i!==e&&i.parent&&i.parent===e&&typeof r.raws.before<"u"){let n=r.raws.before.split(`
17
+ `);return t=n[n.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(t=r.raws.semicolon,typeof t<"u"))return!1}),t}rawValue(e,t){let r=e[t],i=e.raws[t];return i&&i.value===r?i.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var Hn=Jr;Jr.default=Jr;let Wl=Hn;function Xr(s,e){new Wl(e).stringify(s)}var pr=Xr;Xr.default=Xr;let{isClean:bt,my:Hl}=ct,jl=Bs,Gl=Hn,Vl=pr;function Kr(s,e){let t=new s.constructor;for(let r in s){if(!Object.prototype.hasOwnProperty.call(s,r)||r==="proxyCache")continue;let i=s[r],n=typeof i;r==="parent"&&n==="object"?e&&(t[r]=e):r==="source"?t[r]=i:Array.isArray(i)?t[r]=i.map(o=>Kr(o,t)):(n==="object"&&i!==null&&(i=Kr(i)),t[r]=i)}return t}let Qr=class{constructor(e={}){this.raws={},this[bt]=!1,this[Hl]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let r of e[t])typeof r.clone=="function"?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=Kr(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:i}=this.rangeBy(t);return this.source.input.error(e,{column:i.column,line:i.line},{column:r.column,line:r.line},t)}return new jl(e)}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="prop"||t==="value"||t==="name"||t==="params"||t==="important"||t==="text")&&e.markDirty()),!0}}}markDirty(){if(this[bt]){this[bt]=!1;let e=this;for(;e=e.parent;)e[bt]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){t=this.toString();let i=t.indexOf(e.word);i!==-1&&(r=this.positionInside(i,t))}return r}positionInside(e,t){let r=t||this.toString(),i=this.source.start.column,n=this.source.start.line;for(let o=0;o<e;o++)r[o]===`
18
+ `?(i=1,n+=1):i+=1;return{column:i,line:n}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let i=this.toString(),n=i.indexOf(e.word);n!==-1&&(t=this.positionInside(n,i),r=this.positionInside(n+e.word.length,i))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:typeof e.endIndex=="number"?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return new Gl().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let i of e)i===this?r=!0:r?(this.parent.insertAfter(t,i),t=i):this.parent.insertBefore(t,i);r||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,t){let r={},i=t==null;t=t||new Map;let n=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o)||o==="parent"||o==="proxyCache")continue;let l=this[o];if(Array.isArray(l))r[o]=l.map(a=>typeof a=="object"&&a.toJSON?a.toJSON(null,t):a);else if(typeof l=="object"&&l.toJSON)r[o]=l.toJSON(null,t);else if(o==="source"){let a=t.get(l.input);a==null&&(a=n,t.set(l.input,n),n++),r[o]={end:l.end,inputId:a,start:l.start}}else r[o]=l}return i&&(r.inputs=[...t.keys()].map(o=>o.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Vl){e.stringify&&(e=e.stringify);let t="";return e(this,r=>{t+=r}),t}warn(e,t,r){let i={node:this};for(let n in r)i[n]=r[n];return e.warn(t,i)}get proxyOf(){return this}};var mr=Qr;Qr.default=Qr;let Yl=mr,qr=class extends Yl{constructor(e){e&&typeof e.value<"u"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}};var gr=qr;qr.default=qr;let Zl="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Jl=(s=21)=>{let e="",t=s;for(;t--;)e+=Zl[Math.random()*64|0];return e};var Xl={nanoid:Jl};let{SourceMapConsumer:Ri,SourceMapGenerator:ki}=ae,{existsSync:Kl,readFileSync:Ql}=ae,{dirname:Nr,join:ql}=ae;function eu(s){return Buffer?Buffer.from(s,"base64").toString():window.atob(s)}let es=class{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,i=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Nr(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new Ri(this.text)),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,n=/^data:application\/json,/;if(i.test(e)||n.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||r.test(e))return eu(e.substr(RegExp.lastMatch.length));let o=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+o)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e!="object"?!1:typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections)}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),i=e.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,i)))}loadFile(e){if(this.root=Nr(e),Kl(e))return this.mapFile=e,Ql(e,"utf-8").toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t=="string")return t;if(typeof t=="function"){let r=t(e);if(r){let i=this.loadFile(r);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(t instanceof Ri)return ki.fromSourceMap(t).toString();if(t instanceof ki)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return e&&(r=ql(Nr(e),r)),this.loadFile(r)}}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var jn=es;es.default=es;let{SourceMapConsumer:tu,SourceMapGenerator:ru}=ae,{fileURLToPath:Ei,pathToFileURL:vt}=ae,{isAbsolute:ts,resolve:rs}=ae,{nanoid:su}=Xl,Tr=ae,Mi=Bs,iu=jn,Pr=Symbol("fromOffsetCache"),nu=!!(tu&&ru),Ai=!!(rs&&ts),er=class{constructor(e,t={}){if(e===null||typeof e>"u"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]==="\uFEFF"||this.css[0]==="￾"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Ai||/^\w+:\/\//.test(t.from)||ts(t.from)?this.file=t.from:this.file=rs(t.from)),Ai&&nu){let r=new iu(this.css,t);if(r.text){this.map=r;let i=r.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+su(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,i={}){let n,o,l;if(t&&typeof t=="object"){let u=t,c=r;if(typeof u.offset=="number"){let h=this.fromOffset(u.offset);t=h.line,r=h.col}else t=u.line,r=u.column;if(typeof c.offset=="number"){let h=this.fromOffset(c.offset);o=h.line,l=h.col}else o=c.line,l=c.column}else if(!r){let u=this.fromOffset(t);t=u.line,r=u.col}let a=this.origin(t,r,o,l);return a?n=new Mi(e,a.endLine===void 0?a.line:{column:a.column,line:a.line},a.endLine===void 0?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,i.plugin):n=new Mi(e,o===void 0?t:{column:r,line:t},o===void 0?r:{column:l,line:o},this.css,this.file,i.plugin),n.input={column:r,endColumn:l,endLine:o,line:t,source:this.css},this.file&&(vt&&(n.input.url=vt(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,r;if(this[Pr])r=this[Pr];else{let n=this.css.split(`
19
+ `);r=new Array(n.length);let o=0;for(let l=0,a=n.length;l<a;l++)r[l]=o,o+=n[l].length+1;this[Pr]=r}t=r[r.length-1];let i=0;if(e>=t)i=r.length-1;else{let n=r.length-2,o;for(;i<n;)if(o=i+(n-i>>1),e<r[o])n=o-1;else if(e>=r[o+1])i=o+1;else{i=o;break}}return{col:e-r[i]+1,line:i+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:rs(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,i){if(!this.map)return!1;let n=this.map.consumer(),o=n.originalPositionFor({column:t,line:e});if(!o.source)return!1;let l;typeof r=="number"&&(l=n.originalPositionFor({column:i,line:r}));let a;ts(o.source)?a=vt(o.source):a=new URL(o.source,this.map.consumer().sourceRoot||vt(this.map.mapFile));let u={column:o.column,endColumn:l&&l.column,endLine:l&&l.line,line:o.line,url:a.toString()};if(a.protocol==="file:")if(Ei)u.file=Ei(a);else throw new Error("file: protocol is not available in this PostCSS build");let c=n.sourceContentFor(o.source);return c&&(u.source=c),u}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var yr=er;er.default=er;Tr&&Tr.registerInput&&Tr.registerInput(er);let{SourceMapConsumer:Gn,SourceMapGenerator:Wt}=ae,{dirname:Ht,relative:Vn,resolve:Yn,sep:Zn}=ae,{pathToFileURL:Oi}=ae,ou=yr,au=!!(Gn&&Wt),lu=!!(Ht&&Yn&&Vn&&Zn),uu=class{constructor(e,t,r,i){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";let t=`
20
+ `;this.css.includes(`\r
21
+ `)&&(t=`\r
22
+ `),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),r=e.root||Ht(e.file),i;this.mapOpts.sourcesContent===!1?(i=new Gn(e.text),i.sourcesContent&&(i.sourcesContent=null)):i=e.consumer(),this.map.applySourceMap(i,t,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type==="comment"&&e.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),lu&&au&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Wt.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Wt({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new Wt({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,t=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},n,o;this.stringify(this.root,(l,a,u)=>{if(this.css+=l,a&&u!=="end"&&(i.generated.line=e,i.generated.column=t-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),n=l.match(/\n/g),n?(e+=n.length,o=l.lastIndexOf(`
23
+ `),t=l.length-o):t+=l.length,a&&u!=="start"){let c=a.parent||{raws:{}};(!(a.type==="decl"||a.type==="atrule"&&!a.nodes)||a!==c.last||c.raws.semicolon)&&(a.source&&a.source.end?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=e,i.generated.column=t-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=e,i.generated.column=t-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e<"u"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(e=>e.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Ht(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Ht(Yn(r,this.mapOpts.annotation)));let i=Vn(r,e);return this.memoizedPaths.set(e,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new ou(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Oi){let r=Oi(e).toString();return this.memoizedFileURLs.set(e,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;Zn==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};var Jn=uu;let cu=mr,ss=class extends cu{constructor(e){super(e),this.type="comment"}};var wr=ss;ss.default=ss;let{isClean:Xn,my:Kn}=ct,Qn=gr,qn=wr,hu=mr,eo,zs,Ws,to;function ro(s){return s.map(e=>(e.nodes&&(e.nodes=ro(e.nodes)),delete e.source,e))}function so(s){if(s[Xn]=!1,s.proxyOf.nodes)for(let e of s.proxyOf.nodes)so(e)}let me=class io extends hu{append(...e){for(let t of e){let r=this.normalize(t,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),r,i;for(;this.indexes[t]<this.proxyOf.nodes.length&&(r=this.indexes[t],i=e(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[t]+=1;return delete this.indexes[t],i}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:e[t]?t==="each"||typeof t=="string"&&t.startsWith("walk")?(...r)=>e[t](...r.map(i=>typeof i=="function"?(n,o)=>i(n.toProxy(),o):i)):t==="every"||t==="some"?r=>e[t]((i,...n)=>r(i.toProxy(),...n)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(r=>r.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="name"||t==="params"||t==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let o of i)this.proxyOf.nodes.splice(r+1,0,o);let n;for(let o in this.indexes)n=this.indexes[o],r<n&&(this.indexes[o]=n+i.length);return this.markDirty(),this}insertBefore(e,t){let r=this.index(e),i=r===0?"prepend":!1,n=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let l of n)this.proxyOf.nodes.splice(r,0,l);let o;for(let l in this.indexes)o=this.indexes[l],r<=o&&(this.indexes[l]=o+n.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=ro(eo(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Qn(e)]}else if(e.selector)e=[new zs(e)];else if(e.name)e=[new Ws(e)];else if(e.text)e=[new qn(e)];else throw new Error("Unknown node type in node creation");return e.map(i=>(i[Kn]||io.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Xn]&&so(i),typeof i.raws.before>"u"&&t&&typeof t.raws.before<"u"&&(i.raws.before=t.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...e){e=e.reverse();for(let t of e){let r=this.normalize(t,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(i=>{t.props&&!t.props.includes(i.prop)||t.fast&&!i.value.includes(t.fast)||(i.value=i.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let i;try{i=e(t,r)}catch(n){throw t.addToError(n)}return i!==!1&&t.walk&&(i=t.walk(e)),i})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&e.test(r.name))return t(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="atrule")return t(r,i)}))}walkComments(e){return this.walk((t,r)=>{if(t.type==="comment")return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&e.test(r.prop))return t(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="decl")return t(r,i)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&e.test(r.selector))return t(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="rule")return t(r,i)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};me.registerParse=s=>{eo=s};me.registerRule=s=>{zs=s};me.registerAtRule=s=>{Ws=s};me.registerRoot=s=>{to=s};var Re=me;me.default=me;me.rebuild=s=>{s.type==="atrule"?Object.setPrototypeOf(s,Ws.prototype):s.type==="rule"?Object.setPrototypeOf(s,zs.prototype):s.type==="decl"?Object.setPrototypeOf(s,Qn.prototype):s.type==="comment"?Object.setPrototypeOf(s,qn.prototype):s.type==="root"&&Object.setPrototypeOf(s,to.prototype),s[Kn]=!0,s.nodes&&s.nodes.forEach(e=>{me.rebuild(e)})};let fu=Re,no,oo,et=class extends fu{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new no(new oo,this,e).stringify()}};et.registerLazyResult=s=>{no=s};et.registerProcessor=s=>{oo=s};var Hs=et;et.default=et;let $i={};var ao=function(e){$i[e]||($i[e]=!0,typeof console<"u"&&console.warn&&console.warn(e))};let is=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let r=t.node.rangeBy(t);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var lo=is;is.default=is;let du=lo,ns=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new du(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}};var js=ns;ns.default=ns;const Dr=39,Ni=34,St=92,Ti=47,Ct=10,Ve=32,_t=12,xt=9,It=13,pu=91,mu=93,gu=40,yu=41,wu=123,bu=125,vu=59,Su=42,Cu=58,_u=64,Rt=/[\t\n\f\r "#'()/;[\\\]{}]/g,kt=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,xu=/.[\r\n"'(/\\]/,Pi=/[\da-f]/i;var Iu=function(e,t={}){let r=e.css.valueOf(),i=t.ignoreErrors,n,o,l,a,u,c,h,p,d,g,m=r.length,f=0,v=[],b=[];function y(){return f}function C(O){throw e.error("Unclosed "+O,f)}function k(){return b.length===0&&f>=m}function M(O){if(b.length)return b.pop();if(f>=m)return;let D=O?O.ignoreUnclosed:!1;switch(n=r.charCodeAt(f),n){case Ct:case Ve:case xt:case It:case _t:{o=f;do o+=1,n=r.charCodeAt(o);while(n===Ve||n===Ct||n===xt||n===It||n===_t);g=["space",r.slice(f,o)],f=o-1;break}case pu:case mu:case wu:case bu:case Cu:case vu:case yu:{let Y=String.fromCharCode(n);g=[Y,Y,f];break}case gu:{if(p=v.length?v.pop()[1]:"",d=r.charCodeAt(f+1),p==="url"&&d!==Dr&&d!==Ni&&d!==Ve&&d!==Ct&&d!==xt&&d!==_t&&d!==It){o=f;do{if(c=!1,o=r.indexOf(")",o+1),o===-1)if(i||D){o=f;break}else C("bracket");for(h=o;r.charCodeAt(h-1)===St;)h-=1,c=!c}while(c);g=["brackets",r.slice(f,o+1),f,o],f=o}else o=r.indexOf(")",f+1),a=r.slice(f,o+1),o===-1||xu.test(a)?g=["(","(",f]:(g=["brackets",a,f,o],f=o);break}case Dr:case Ni:{l=n===Dr?"'":'"',o=f;do{if(c=!1,o=r.indexOf(l,o+1),o===-1)if(i||D){o=f+1;break}else C("string");for(h=o;r.charCodeAt(h-1)===St;)h-=1,c=!c}while(c);g=["string",r.slice(f,o+1),f,o],f=o;break}case _u:{Rt.lastIndex=f+1,Rt.test(r),Rt.lastIndex===0?o=r.length-1:o=Rt.lastIndex-2,g=["at-word",r.slice(f,o+1),f,o],f=o;break}case St:{for(o=f,u=!0;r.charCodeAt(o+1)===St;)o+=1,u=!u;if(n=r.charCodeAt(o+1),u&&n!==Ti&&n!==Ve&&n!==Ct&&n!==xt&&n!==It&&n!==_t&&(o+=1,Pi.test(r.charAt(o)))){for(;Pi.test(r.charAt(o+1));)o+=1;r.charCodeAt(o+1)===Ve&&(o+=1)}g=["word",r.slice(f,o+1),f,o],f=o;break}default:{n===Ti&&r.charCodeAt(f+1)===Su?(o=r.indexOf("*/",f+2)+1,o===0&&(i||D?o=r.length:C("comment")),g=["comment",r.slice(f,o+1),f,o],f=o):(kt.lastIndex=f+1,kt.test(r),kt.lastIndex===0?o=r.length-1:o=kt.lastIndex-2,g=["word",r.slice(f,o+1),f,o],v.push(g),f=o);break}}return f++,g}function V(O){b.push(O)}return{back:V,endOfFile:k,nextToken:M,position:y}};let uo=Re,tr=class extends uo{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var Gs=tr;tr.default=tr;uo.registerAtRule(tr);let co=Re,ho,fo,Te=class extends co{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let i=super.normalize(e);if(t){if(r==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let n of i)n.raws.before=t.raws.before}return i}removeChild(e,t){let r=this.index(e);return!t&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new ho(new fo,this,e).stringify()}};Te.registerLazyResult=s=>{ho=s};Te.registerProcessor=s=>{fo=s};var ht=Te;Te.default=Te;co.registerRoot(Te);let tt={comma(s){return tt.split(s,[","],!0)},space(s){let e=[" ",`
24
+ `," "];return tt.split(s,e)},split(s,e,t){let r=[],i="",n=!1,o=0,l=!1,a="",u=!1;for(let c of s)u?u=!1:c==="\\"?u=!0:l?c===a&&(l=!1):c==='"'||c==="'"?(l=!0,a=c):c==="("?o+=1:c===")"?o>0&&(o-=1):o===0&&e.includes(c)&&(n=!0),n?(i!==""&&r.push(i.trim()),i="",n=!1):i+=c;return(t||i!=="")&&r.push(i.trim()),r}};var po=tt;tt.default=tt;let mo=Re,Ru=po,rr=class extends mo{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Ru.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var Vs=rr;rr.default=rr;mo.registerRule(rr);let ku=gr,Eu=Iu,Mu=wr,Au=Gs,Ou=ht,Di=Vs;const Li={empty:!0,space:!0};function $u(s){for(let e=s.length-1;e>=0;e--){let t=s[e],r=t[3]||t[2];if(r)return r}}let Nu=class{constructor(e){this.input=e,this.root=new Ou,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new Au;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let r,i,n,o=!1,l=!1,a=[],u=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),r=e[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){l=!0;break}else if(r==="}"){if(a.length>0){for(n=a.length-1,i=a[n];i&&i[0]==="space";)i=a[--n];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}else a.push(e);else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(t.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(t,"params",a),o&&(e=a[a.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),l&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let r=0,i;for(let n=t-1;n>=0&&(i=e[n],!(i[0]!=="space"&&(r+=1,r===2)));n--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(e){let t=0,r,i,n;for(let[o,l]of e.entries()){if(r=l,i=r[0],i==="("&&(t+=1),i===")"&&(t-=1),t===0&&i===":")if(!n)this.doubleColon(r);else{if(n[0]==="word"&&n[1]==="progid")continue;return o}n=r}return!1}comment(e){let t=new Mu;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let i=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=i[2],t.raws.left=i[1],t.raws.right=i[3]}}createTokenizer(){this.tokenizer=Eu(this.input)}decl(e,t){let r=new ku;this.init(r,e[0][2]);let i=e[e.length-1];for(i[0]===";"&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(i[3]||i[2]||$u(e)),r.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let u=e[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=e.shift()[1]}r.raws.between="";let n;for(;e.length;)if(n=e.shift(),n[0]===":"){r.raws.between+=n[1];break}else n[0]==="word"&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o=[],l;for(;e.length&&(l=e[0][0],!(l!=="space"&&l!=="comment"));)o.push(e.shift());this.precheckMissedSemicolon(e);for(let u=e.length-1;u>=0;u--){if(n=e[u],n[1].toLowerCase()==="!important"){r.important=!0;let c=this.stringFrom(e,u);c=this.spacesFromEnd(e)+c,c!==" !important"&&(r.raws.important=c);break}else if(n[1].toLowerCase()==="important"){let c=e.slice(0),h="";for(let p=u;p>0;p--){let d=c[p][0];if(h.trim().indexOf("!")===0&&d!=="space")break;h=c.pop()[1]+h}h.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=h,e=c)}if(n[0]!=="space"&&n[0]!=="comment")break}e.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=o.map(u=>u[1]).join(""),o=[]),this.raw(r,"value",o.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Di;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let t=!1,r=null,i=!1,n=null,o=[],l=e[1].startsWith("--"),a=[],u=e;for(;u;){if(r=u[0],a.push(u),r==="("||r==="[")n||(n=u),o.push(r==="("?")":"]");else if(l&&i&&r==="{")n||(n=u),o.push("}");else if(o.length===0)if(r===";")if(i){this.decl(a,l);return}else break;else if(r==="{"){this.rule(a);return}else if(r==="}"){this.tokenizer.back(a.pop()),t=!0;break}else r===":"&&(i=!0);else r===o[o.length-1]&&(o.pop(),o.length===0&&(n=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&i){if(!l)for(;a.length&&(u=a[a.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(a.pop());this.decl(a,l)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,i){let n,o,l=r.length,a="",u=!0,c,h;for(let p=0;p<l;p+=1)n=r[p],o=n[0],o==="space"&&p===l-1&&!i?u=!1:o==="comment"?(h=r[p-1]?r[p-1][0]:"empty",c=r[p+1]?r[p+1][0]:"empty",!Li[h]&&!Li[c]?a.slice(-1)===","?u=!1:a+=n[1]:u=!1):a+=n[1];if(!u){let p=r.reduce((d,g)=>d+g[1],"");e.raws[t]={raw:p,value:a}}e[t]=a}rule(e){e.pop();let t=new Di;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],!(t!=="space"&&t!=="comment"));)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],t==="space");)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let i=t;i<e.length;i++)r+=e[i][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};var Tu=Nu;let Pu=Re,Du=Tu,Lu=yr;function sr(s,e){let t=new Lu(s,e),r=new Du(t);try{r.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&e&&e.from&&(/\.scss$/i.test(e.from)?i.message+=`
25
+ You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(e.from)?i.message+=`
26
+ You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(e.from)&&(i.message+=`
27
+ You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return r.root}var Ys=sr;sr.default=sr;Pu.registerParse(sr);let{isClean:he,my:Fu}=ct,Uu=Jn,Bu=pr,zu=Re,Wu=Hs,Hu=ao,Fi=js,ju=Ys,Gu=ht;const Vu={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Yu={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},Zu={Once:!0,postcssPlugin:!0,prepare:!0},Pe=0;function Ye(s){return typeof s=="object"&&typeof s.then=="function"}function go(s){let e=!1,t=Vu[s.type];return s.type==="decl"?e=s.prop.toLowerCase():s.type==="atrule"&&(e=s.name.toLowerCase()),e&&s.append?[t,t+"-"+e,Pe,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:s.append?[t,Pe,t+"Exit"]:[t,t+"Exit"]}function Ui(s){let e;return s.type==="document"?e=["Document",Pe,"DocumentExit"]:s.type==="root"?e=["Root",Pe,"RootExit"]:e=go(s),{eventIndex:0,events:e,iterator:0,node:s,visitorIndex:0,visitors:[]}}function os(s){return s[he]=!1,s.nodes&&s.nodes.forEach(e=>os(e)),s}let as={},De=class yo{constructor(e,t,r){this.stringified=!1,this.processed=!1;let i;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))i=os(t);else if(t instanceof yo||t instanceof Fi)i=os(t.root),t.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let n=ju;r.syntax&&(n=r.syntax.parse),r.parser&&(n=r.parser),n.parse&&(n=n.parse);try{i=n(t,r)}catch(o){this.processed=!0,this.error=o}i&&!i[Fu]&&zu.rebuild(i)}this.result=new Fi(e,i,r),this.helpers={...as,postcss:as,result:this.result},this.plugins=this.processor.plugins.map(n=>typeof n=="object"&&n.prepare?{...n,...n.prepare(this.result)}:n)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin)e.plugin=r.postcssPlugin,e.setMessage();else if(r.postcssVersion&&process.env.NODE_ENV!=="production"){let i=r.postcssPlugin,n=r.postcssVersion,o=this.result.processor.version,l=n.split("."),a=o.split(".");(l[0]!==a[0]||parseInt(l[1])>parseInt(a[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+o+", but "+i+" uses "+n+". Perhaps this is the source of the error below.")}}catch(i){console&&console.error&&console.error(i)}return e}prepareVisitors(){this.listeners={};let e=(t,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([t,i])};for(let t of this.plugins)if(typeof t=="object")for(let r in t){if(!Yu[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Zu[r])if(typeof t[r]=="object")for(let i in t[r])i==="*"?e(t,r,t[r][i]):e(t,r+"-"+i.toLowerCase(),t[r][i]);else typeof t[r]=="function"&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(Ye(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[he];){e[he]=!0;let t=[Ui(e)];for(;t.length>0;){let r=this.visitTick(t);if(Ye(r))try{await r}catch(i){let n=t[t.length-1].node;throw this.handleError(i,n)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type==="document"){let i=e.nodes.map(n=>r(n,this.helpers));await Promise.all(i)}else await r(e,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let t=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return Ye(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Bu;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new Uu(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){let t=this.runOnRoot(e);if(Ye(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[he];)e[he]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return process.env.NODE_ENV!=="production"&&("from"in this.opts||Hu("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,i]of e){this.result.lastPlugin=r;let n;try{n=i(t,this.helpers)}catch(o){throw this.handleError(o,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(Ye(n))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:i}=t;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(i.length>0&&t.visitorIndex<i.length){let[o,l]=i[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===i.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return l(r.toProxy(),this.helpers)}catch(a){throw this.handleError(a,r)}}if(t.iterator!==0){let o=t.iterator,l;for(;l=r.nodes[r.indexes[o]];)if(r.indexes[o]+=1,!l[he]){l[he]=!0,e.push(Ui(l));return}t.iterator=0,delete r.indexes[o]}let n=t.events;for(;t.eventIndex<n.length;){let o=n[t.eventIndex];if(t.eventIndex+=1,o===Pe){r.nodes&&r.nodes.length&&(r[he]=!0,t.iterator=r.getIterator());return}else if(this.listeners[o]){t.visitors=this.listeners[o];return}}e.pop()}walkSync(e){e[he]=!0;let t=go(e);for(let r of t)if(r===Pe)e.nodes&&e.each(i=>{i[he]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};De.registerPostcss=s=>{as=s};var wo=De;De.default=De;Gu.registerLazyResult(De);Wu.registerLazyResult(De);let Ju=Jn,Xu=pr,Ku=ao,Qu=Ys;const qu=js;let ls=class{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let i,n=Xu;this.result=new qu(this._processor,i,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let l=new Ju(n,i,this._opts,t);if(l.isMap()){let[a,u]=l.generate();a&&(this.result.css=a),u&&(this.result.map=u)}else l.clearAnnotation(),this.result.css=l.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return process.env.NODE_ENV!=="production"&&("from"in this._opts||Ku("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=Qu;try{e=t(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var ec=ls;ls.default=ls;let tc=ec,rc=wo,sc=Hs,ic=ht,rt=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)t.push(r);else if(typeof r=="function")t.push(r);else if(typeof r=="object"&&(r.parse||r.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new tc(this,e,t):new rc(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var nc=rt;rt.default=rt;ic.registerProcessor(rt);sc.registerProcessor(rt);let oc=gr,ac=jn,lc=wr,uc=Gs,cc=yr,hc=ht,fc=Vs;function st(s,e){if(Array.isArray(s))return s.map(i=>st(i));let{inputs:t,...r}=s;if(t){e=[];for(let i of t){let n={...i,__proto__:cc.prototype};n.map&&(n.map={...n.map,__proto__:ac.prototype}),e.push(n)}}if(r.nodes&&(r.nodes=s.nodes.map(i=>st(i,e))),r.source){let{inputId:i,...n}=r.source;r.source=n,i!=null&&(r.source.input=e[i])}if(r.type==="root")return new hc(r);if(r.type==="decl")return new oc(r);if(r.type==="rule")return new fc(r);if(r.type==="comment")return new lc(r);if(r.type==="atrule")return new uc(r);throw new Error("Unknown node type: "+s.type)}var dc=st;st.default=st;let pc=Bs,bo=gr,mc=wo,gc=Re,Zs=nc,yc=pr,wc=dc,vo=Hs,bc=lo,So=wr,Co=Gs,vc=js,Sc=yr,Cc=Ys,_c=po,_o=Vs,xo=ht,xc=mr;function $(...s){return s.length===1&&Array.isArray(s[0])&&(s=s[0]),new Zs(s)}$.plugin=function(e,t){let r=!1;function i(...o){console&&console.warn&&!r&&(r=!0,console.warn(e+`: 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(e+`: 里面 postcss.plugin 被弃用. 迁移指南:
29
+ https://www.w3ctech.com/topic/2226`));let l=t(...o);return l.postcssPlugin=e,l.postcssVersion=new Zs().version,l}let n;return Object.defineProperty(i,"postcss",{get(){return n||(n=i()),n}}),i.process=function(o,l,a){return $([i(a)]).process(o,l)},i};$.stringify=yc;$.parse=Cc;$.fromJSON=wc;$.list=_c;$.comment=s=>new So(s);$.atRule=s=>new Co(s);$.decl=s=>new bo(s);$.rule=s=>new _o(s);$.root=s=>new xo(s);$.document=s=>new vo(s);$.CssSyntaxError=pc;$.Declaration=bo;$.Container=gc;$.Processor=Zs;$.Document=vo;$.Comment=So;$.Warning=bc;$.AtRule=Co;$.Result=vc;$.Input=Sc;$.Rule=_o;$.Root=xo;$.Node=xc;mc.registerPostcss($);var Ic=$;$.default=$;const B=Dl(Ic);B.stringify;B.fromJSON;B.plugin;B.parse;B.list;B.document;B.comment;B.atRule;B.rule;B.decl;B.root;B.CssSyntaxError;B.Declaration;B.Container;B.Processor;B.Document;B.Comment;B.Warning;B.AtRule;B.Result;B.Input;B.Rule;B.Root;B.Node;var Rc=Object.defineProperty,kc=(s,e,t)=>e in s?Rc(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,ie=(s,e,t)=>kc(s,typeof e!="symbol"?e+"":e,t);function Ec(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function Mc(s){if(s.__esModule)return s;var e=s.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(r){var i=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return s[r]}})}),t}var Js={exports:{}},U=String,Io=function(){return{isColorSupported:!1,reset:U,bold:U,dim:U,italic:U,underline:U,inverse:U,hidden:U,strikethrough:U,black:U,red:U,green:U,yellow:U,blue:U,magenta:U,cyan:U,white:U,gray:U,bgBlack:U,bgRed:U,bgGreen:U,bgYellow:U,bgBlue:U,bgMagenta:U,bgCyan:U,bgWhite:U}};Js.exports=Io();Js.exports.createColors=Io;var Ac=Js.exports;const Oc={},$c=Object.freeze(Object.defineProperty({__proto__:null,default:Oc},Symbol.toStringTag,{value:"Module"})),le=Mc($c);let Bi=Ac,zi=le,us=class Ro extends Error{constructor(e,t,r,i,n,o){super(e),this.name="CssSyntaxError",this.reason=e,n&&(this.file=n),i&&(this.source=i),o&&(this.plugin=o),typeof t<"u"&&typeof r<"u"&&(typeof t=="number"?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Ro)}setMessage(){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(e){if(!this.source)return"";let t=this.source;e==null&&(e=Bi.isColorSupported),zi&&e&&(t=zi(t));let r=t.split(/\r?\n/),i=Math.max(this.line-3,0),n=Math.min(this.line+2,r.length),o=String(n).length,l,a;if(e){let{bold:u,gray:c,red:h}=Bi.createColors(!0);l=p=>u(h(p)),a=p=>c(p)}else l=a=u=>u;return r.slice(i,n).map((u,c)=>{let h=i+1+c,p=" "+(" "+h).slice(-o)+" | ";if(h===this.line){let d=a(p.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return l(">")+a(p)+u+`
30
+ `+d+l("^")}return" "+a(p)+u}).join(`
31
+ `)}toString(){let e=this.showSourceCode();return e&&(e=`
32
+
33
+ `+e+`
34
+ `),this.name+": "+this.message+e}};var Xs=us;us.default=us;var ft={};ft.isClean=Symbol("isClean");ft.my=Symbol("my");const Wi={after:`
35
+ `,beforeClose:`
36
+ `,beforeComment:`
37
+ `,beforeDecl:`
38
+ `,beforeOpen:" ",beforeRule:`
39
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function Nc(s){return s[0].toUpperCase()+s.slice(1)}let cs=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,i=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?r+=e.raws.afterName:i&&(r+=" "),e.nodes)this.block(e,r+i);else{let n=(e.raws.between||"")+(t?";":"");this.builder(r+i+n,e)}}beforeAfter(e,t){let r;e.type==="decl"?r=this.raw(e,null,"beforeDecl"):e.type==="comment"?r=this.raw(e,null,"beforeComment"):t==="before"?r=this.raw(e,null,"beforeRule"):r=this.raw(e,null,"beforeClose");let i=e.parent,n=0;for(;i&&i.type!=="root";)n+=1,i=i.parent;if(r.includes(`
40
+ `)){let o=this.raw(e,null,"indent");if(o.length)for(let l=0;l<n;l++)r+=o}return r}block(e,t){let r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start");let i;e.nodes&&e.nodes.length?(this.body(e),i=this.raw(e,"after")):i=this.raw(e,"after","emptyBody"),i&&this.builder(i),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let r=this.raw(e,"semicolon");for(let i=0;i<e.nodes.length;i++){let n=e.nodes[i],o=this.raw(n,"before");o&&this.builder(o),this.stringify(n,t!==i||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),i=e.prop+r+this.rawValue(e,"value");e.important&&(i+=e.raws.important||" !important"),t&&(i+=";"),this.builder(i,e)}document(e){this.body(e)}raw(e,t,r){let i;if(r||(r=t),t&&(i=e.raws[t],typeof i<"u"))return i;let n=e.parent;if(r==="before"&&(!n||n.type==="root"&&n.first===e||n&&n.type==="document"))return"";if(!n)return Wi[r];let o=e.root();if(o.rawCache||(o.rawCache={}),typeof o.rawCache[r]<"u")return o.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(e,r);{let l="raw"+Nc(r);this[l]?i=this[l](o,e):o.walk(a=>{if(i=a.raws[t],typeof i<"u")return!1})}return typeof i>"u"&&(i=Wi[r]),o.rawCache[r]=i,i}rawBeforeClose(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return t=r.raws.after,t.includes(`
41
+ `)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
42
+ `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
43
+ `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(r=>{if(r.type!=="decl"&&(t=r.raws.between,typeof t<"u"))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&typeof r.raws.before<"u")return t=r.raws.before,t.includes(`
44
+ `)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(r=>{if(typeof r.raws.between<"u")return t=r.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length===0&&(t=r.raws.after,typeof t<"u"))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let i=r.parent;if(i&&i!==e&&i.parent&&i.parent===e&&typeof r.raws.before<"u"){let n=r.raws.before.split(`
45
+ `);return t=n[n.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(t=r.raws.semicolon,typeof t<"u"))return!1}),t}rawValue(e,t){let r=e[t],i=e.raws[t];return i&&i.value===r?i.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var ko=cs;cs.default=cs;let Tc=ko;function hs(s,e){new Tc(e).stringify(s)}var br=hs;hs.default=hs;let{isClean:Et,my:Pc}=ft,Dc=Xs,Lc=ko,Fc=br;function fs(s,e){let t=new s.constructor;for(let r in s){if(!Object.prototype.hasOwnProperty.call(s,r)||r==="proxyCache")continue;let i=s[r],n=typeof i;r==="parent"&&n==="object"?e&&(t[r]=e):r==="source"?t[r]=i:Array.isArray(i)?t[r]=i.map(o=>fs(o,t)):(n==="object"&&i!==null&&(i=fs(i)),t[r]=i)}return t}let ds=class{constructor(e={}){this.raws={},this[Et]=!1,this[Pc]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let r of e[t])typeof r.clone=="function"?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=fs(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:i}=this.rangeBy(t);return this.source.input.error(e,{column:i.column,line:i.line},{column:r.column,line:r.line},t)}return new Dc(e)}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="prop"||t==="value"||t==="name"||t==="params"||t==="important"||t==="text")&&e.markDirty()),!0}}}markDirty(){if(this[Et]){this[Et]=!1;let e=this;for(;e=e.parent;)e[Et]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){t=this.toString();let i=t.indexOf(e.word);i!==-1&&(r=this.positionInside(i,t))}return r}positionInside(e,t){let r=t||this.toString(),i=this.source.start.column,n=this.source.start.line;for(let o=0;o<e;o++)r[o]===`
46
+ `?(i=1,n+=1):i+=1;return{column:i,line:n}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let i=this.toString(),n=i.indexOf(e.word);n!==-1&&(t=this.positionInside(n,i),r=this.positionInside(n+e.word.length,i))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:typeof e.endIndex=="number"?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return new Lc().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let i of e)i===this?r=!0:r?(this.parent.insertAfter(t,i),t=i):this.parent.insertBefore(t,i);r||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,t){let r={},i=t==null;t=t||new Map;let n=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o)||o==="parent"||o==="proxyCache")continue;let l=this[o];if(Array.isArray(l))r[o]=l.map(a=>typeof a=="object"&&a.toJSON?a.toJSON(null,t):a);else if(typeof l=="object"&&l.toJSON)r[o]=l.toJSON(null,t);else if(o==="source"){let a=t.get(l.input);a==null&&(a=n,t.set(l.input,n),n++),r[o]={end:l.end,inputId:a,start:l.start}}else r[o]=l}return i&&(r.inputs=[...t.keys()].map(o=>o.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Fc){e.stringify&&(e=e.stringify);let t="";return e(this,r=>{t+=r}),t}warn(e,t,r){let i={node:this};for(let n in r)i[n]=r[n];return e.warn(t,i)}get proxyOf(){return this}};var vr=ds;ds.default=ds;let Uc=vr,ps=class extends Uc{constructor(e){e&&typeof e.value<"u"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}};var Sr=ps;ps.default=ps;let Bc="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",zc=(s=21)=>{let e="",t=s;for(;t--;)e+=Bc[Math.random()*64|0];return e};var Wc={nanoid:zc};let{SourceMapConsumer:Hi,SourceMapGenerator:ji}=le,{existsSync:Hc,readFileSync:jc}=le,{dirname:Lr,join:Gc}=le;function Vc(s){return Buffer?Buffer.from(s,"base64").toString():window.atob(s)}let ms=class{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,i=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Lr(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new Hi(this.text)),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,n=/^data:application\/json,/;if(i.test(e)||n.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||r.test(e))return Vc(e.substr(RegExp.lastMatch.length));let o=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+o)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e!="object"?!1:typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections)}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),i=e.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,i)))}loadFile(e){if(this.root=Lr(e),Hc(e))return this.mapFile=e,jc(e,"utf-8").toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t=="string")return t;if(typeof t=="function"){let r=t(e);if(r){let i=this.loadFile(r);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(t instanceof Hi)return ji.fromSourceMap(t).toString();if(t instanceof ji)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return e&&(r=Gc(Lr(e),r)),this.loadFile(r)}}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Eo=ms;ms.default=ms;let{SourceMapConsumer:Yc,SourceMapGenerator:Zc}=le,{fileURLToPath:Gi,pathToFileURL:Mt}=le,{isAbsolute:gs,resolve:ys}=le,{nanoid:Jc}=Wc,Fr=le,Vi=Xs,Xc=Eo,Ur=Symbol("fromOffsetCache"),Kc=!!(Yc&&Zc),Yi=!!(ys&&gs),ir=class{constructor(e,t={}){if(e===null||typeof e>"u"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]==="\uFEFF"||this.css[0]==="￾"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Yi||/^\w+:\/\//.test(t.from)||gs(t.from)?this.file=t.from:this.file=ys(t.from)),Yi&&Kc){let r=new Xc(this.css,t);if(r.text){this.map=r;let i=r.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+Jc(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,i={}){let n,o,l;if(t&&typeof t=="object"){let u=t,c=r;if(typeof u.offset=="number"){let h=this.fromOffset(u.offset);t=h.line,r=h.col}else t=u.line,r=u.column;if(typeof c.offset=="number"){let h=this.fromOffset(c.offset);o=h.line,l=h.col}else o=c.line,l=c.column}else if(!r){let u=this.fromOffset(t);t=u.line,r=u.col}let a=this.origin(t,r,o,l);return a?n=new Vi(e,a.endLine===void 0?a.line:{column:a.column,line:a.line},a.endLine===void 0?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,i.plugin):n=new Vi(e,o===void 0?t:{column:r,line:t},o===void 0?r:{column:l,line:o},this.css,this.file,i.plugin),n.input={column:r,endColumn:l,endLine:o,line:t,source:this.css},this.file&&(Mt&&(n.input.url=Mt(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,r;if(this[Ur])r=this[Ur];else{let n=this.css.split(`
47
+ `);r=new Array(n.length);let o=0;for(let l=0,a=n.length;l<a;l++)r[l]=o,o+=n[l].length+1;this[Ur]=r}t=r[r.length-1];let i=0;if(e>=t)i=r.length-1;else{let n=r.length-2,o;for(;i<n;)if(o=i+(n-i>>1),e<r[o])n=o-1;else if(e>=r[o+1])i=o+1;else{i=o;break}}return{col:e-r[i]+1,line:i+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:ys(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,i){if(!this.map)return!1;let n=this.map.consumer(),o=n.originalPositionFor({column:t,line:e});if(!o.source)return!1;let l;typeof r=="number"&&(l=n.originalPositionFor({column:i,line:r}));let a;gs(o.source)?a=Mt(o.source):a=new URL(o.source,this.map.consumer().sourceRoot||Mt(this.map.mapFile));let u={column:o.column,endColumn:l&&l.column,endLine:l&&l.line,line:o.line,url:a.toString()};if(a.protocol==="file:")if(Gi)u.file=Gi(a);else throw new Error("file: protocol is not available in this PostCSS build");let c=n.sourceContentFor(o.source);return c&&(u.source=c),u}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var Cr=ir;ir.default=ir;Fr&&Fr.registerInput&&Fr.registerInput(ir);let{SourceMapConsumer:Mo,SourceMapGenerator:jt}=le,{dirname:Gt,relative:Ao,resolve:Oo,sep:$o}=le,{pathToFileURL:Zi}=le,Qc=Cr,qc=!!(Mo&&jt),eh=!!(Gt&&Oo&&Ao&&$o),th=class{constructor(e,t,r,i){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";let t=`
48
+ `;this.css.includes(`\r
49
+ `)&&(t=`\r
50
+ `),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),r=e.root||Gt(e.file),i;this.mapOpts.sourcesContent===!1?(i=new Mo(e.text),i.sourcesContent&&(i.sourcesContent=null)):i=e.consumer(),this.map.applySourceMap(i,t,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type==="comment"&&e.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),eh&&qc&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=jt.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new jt({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new jt({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,t=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},n,o;this.stringify(this.root,(l,a,u)=>{if(this.css+=l,a&&u!=="end"&&(i.generated.line=e,i.generated.column=t-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),n=l.match(/\n/g),n?(e+=n.length,o=l.lastIndexOf(`
51
+ `),t=l.length-o):t+=l.length,a&&u!=="start"){let c=a.parent||{raws:{}};(!(a.type==="decl"||a.type==="atrule"&&!a.nodes)||a!==c.last||c.raws.semicolon)&&(a.source&&a.source.end?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=e,i.generated.column=t-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=e,i.generated.column=t-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e<"u"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(e=>e.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Gt(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Gt(Oo(r,this.mapOpts.annotation)));let i=Ao(r,e);return this.memoizedPaths.set(e,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Qc(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Zi){let r=Zi(e).toString();return this.memoizedFileURLs.set(e,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;$o==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};var No=th;let rh=vr,ws=class extends rh{constructor(e){super(e),this.type="comment"}};var _r=ws;ws.default=ws;let{isClean:To,my:Po}=ft,Do=Sr,Lo=_r,sh=vr,Fo,Ks,Qs,Uo;function Bo(s){return s.map(e=>(e.nodes&&(e.nodes=Bo(e.nodes)),delete e.source,e))}function zo(s){if(s[To]=!1,s.proxyOf.nodes)for(let e of s.proxyOf.nodes)zo(e)}let ge=class Wo extends sh{append(...e){for(let t of e){let r=this.normalize(t,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),r,i;for(;this.indexes[t]<this.proxyOf.nodes.length&&(r=this.indexes[t],i=e(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[t]+=1;return delete this.indexes[t],i}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:e[t]?t==="each"||typeof t=="string"&&t.startsWith("walk")?(...r)=>e[t](...r.map(i=>typeof i=="function"?(n,o)=>i(n.toProxy(),o):i)):t==="every"||t==="some"?r=>e[t]((i,...n)=>r(i.toProxy(),...n)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(r=>r.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="name"||t==="params"||t==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let o of i)this.proxyOf.nodes.splice(r+1,0,o);let n;for(let o in this.indexes)n=this.indexes[o],r<n&&(this.indexes[o]=n+i.length);return this.markDirty(),this}insertBefore(e,t){let r=this.index(e),i=r===0?"prepend":!1,n=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let l of n)this.proxyOf.nodes.splice(r,0,l);let o;for(let l in this.indexes)o=this.indexes[l],r<=o&&(this.indexes[l]=o+n.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=Bo(Fo(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Do(e)]}else if(e.selector)e=[new Ks(e)];else if(e.name)e=[new Qs(e)];else if(e.text)e=[new Lo(e)];else throw new Error("Unknown node type in node creation");return e.map(i=>(i[Po]||Wo.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[To]&&zo(i),typeof i.raws.before>"u"&&t&&typeof t.raws.before<"u"&&(i.raws.before=t.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...e){e=e.reverse();for(let t of e){let r=this.normalize(t,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(i=>{t.props&&!t.props.includes(i.prop)||t.fast&&!i.value.includes(t.fast)||(i.value=i.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let i;try{i=e(t,r)}catch(n){throw t.addToError(n)}return i!==!1&&t.walk&&(i=t.walk(e)),i})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&e.test(r.name))return t(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="atrule")return t(r,i)}))}walkComments(e){return this.walk((t,r)=>{if(t.type==="comment")return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&e.test(r.prop))return t(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="decl")return t(r,i)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&e.test(r.selector))return t(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="rule")return t(r,i)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};ge.registerParse=s=>{Fo=s};ge.registerRule=s=>{Ks=s};ge.registerAtRule=s=>{Qs=s};ge.registerRoot=s=>{Uo=s};var ke=ge;ge.default=ge;ge.rebuild=s=>{s.type==="atrule"?Object.setPrototypeOf(s,Qs.prototype):s.type==="rule"?Object.setPrototypeOf(s,Ks.prototype):s.type==="decl"?Object.setPrototypeOf(s,Do.prototype):s.type==="comment"?Object.setPrototypeOf(s,Lo.prototype):s.type==="root"&&Object.setPrototypeOf(s,Uo.prototype),s[Po]=!0,s.nodes&&s.nodes.forEach(e=>{ge.rebuild(e)})};let ih=ke,Ho,jo,it=class extends ih{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Ho(new jo,this,e).stringify()}};it.registerLazyResult=s=>{Ho=s};it.registerProcessor=s=>{jo=s};var qs=it;it.default=it;let Ji={};var Go=function(e){Ji[e]||(Ji[e]=!0,typeof console<"u"&&console.warn&&console.warn(e))};let bs=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let r=t.node.rangeBy(t);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var Vo=bs;bs.default=bs;let nh=Vo,vs=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new nh(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}};var ei=vs;vs.default=vs;const Br=39,Xi=34,At=92,Ki=47,Ot=10,Ze=32,$t=12,Nt=9,Tt=13,oh=91,ah=93,lh=40,uh=41,ch=123,hh=125,fh=59,dh=42,ph=58,mh=64,Pt=/[\t\n\f\r "#'()/;[\\\]{}]/g,Dt=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,gh=/.[\r\n"'(/\\]/,Qi=/[\da-f]/i;var yh=function(e,t={}){let r=e.css.valueOf(),i=t.ignoreErrors,n,o,l,a,u,c,h,p,d,g,m=r.length,f=0,v=[],b=[];function y(){return f}function C(O){throw e.error("Unclosed "+O,f)}function k(){return b.length===0&&f>=m}function M(O){if(b.length)return b.pop();if(f>=m)return;let D=O?O.ignoreUnclosed:!1;switch(n=r.charCodeAt(f),n){case Ot:case Ze:case Nt:case Tt:case $t:{o=f;do o+=1,n=r.charCodeAt(o);while(n===Ze||n===Ot||n===Nt||n===Tt||n===$t);g=["space",r.slice(f,o)],f=o-1;break}case oh:case ah:case ch:case hh:case ph:case fh:case uh:{let Y=String.fromCharCode(n);g=[Y,Y,f];break}case lh:{if(p=v.length?v.pop()[1]:"",d=r.charCodeAt(f+1),p==="url"&&d!==Br&&d!==Xi&&d!==Ze&&d!==Ot&&d!==Nt&&d!==$t&&d!==Tt){o=f;do{if(c=!1,o=r.indexOf(")",o+1),o===-1)if(i||D){o=f;break}else C("bracket");for(h=o;r.charCodeAt(h-1)===At;)h-=1,c=!c}while(c);g=["brackets",r.slice(f,o+1),f,o],f=o}else o=r.indexOf(")",f+1),a=r.slice(f,o+1),o===-1||gh.test(a)?g=["(","(",f]:(g=["brackets",a,f,o],f=o);break}case Br:case Xi:{l=n===Br?"'":'"',o=f;do{if(c=!1,o=r.indexOf(l,o+1),o===-1)if(i||D){o=f+1;break}else C("string");for(h=o;r.charCodeAt(h-1)===At;)h-=1,c=!c}while(c);g=["string",r.slice(f,o+1),f,o],f=o;break}case mh:{Pt.lastIndex=f+1,Pt.test(r),Pt.lastIndex===0?o=r.length-1:o=Pt.lastIndex-2,g=["at-word",r.slice(f,o+1),f,o],f=o;break}case At:{for(o=f,u=!0;r.charCodeAt(o+1)===At;)o+=1,u=!u;if(n=r.charCodeAt(o+1),u&&n!==Ki&&n!==Ze&&n!==Ot&&n!==Nt&&n!==Tt&&n!==$t&&(o+=1,Qi.test(r.charAt(o)))){for(;Qi.test(r.charAt(o+1));)o+=1;r.charCodeAt(o+1)===Ze&&(o+=1)}g=["word",r.slice(f,o+1),f,o],f=o;break}default:{n===Ki&&r.charCodeAt(f+1)===dh?(o=r.indexOf("*/",f+2)+1,o===0&&(i||D?o=r.length:C("comment")),g=["comment",r.slice(f,o+1),f,o],f=o):(Dt.lastIndex=f+1,Dt.test(r),Dt.lastIndex===0?o=r.length-1:o=Dt.lastIndex-2,g=["word",r.slice(f,o+1),f,o],v.push(g),f=o);break}}return f++,g}function V(O){b.push(O)}return{back:V,endOfFile:k,nextToken:M,position:y}};let Yo=ke,nr=class extends Yo{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var ti=nr;nr.default=nr;Yo.registerAtRule(nr);let Zo=ke,Jo,Xo,Le=class extends Zo{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let i=super.normalize(e);if(t){if(r==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let n of i)n.raws.before=t.raws.before}return i}removeChild(e,t){let r=this.index(e);return!t&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new Jo(new Xo,this,e).stringify()}};Le.registerLazyResult=s=>{Jo=s};Le.registerProcessor=s=>{Xo=s};var dt=Le;Le.default=Le;Zo.registerRoot(Le);let nt={comma(s){return nt.split(s,[","],!0)},space(s){let e=[" ",`
52
+ `," "];return nt.split(s,e)},split(s,e,t){let r=[],i="",n=!1,o=0,l=!1,a="",u=!1;for(let c of s)u?u=!1:c==="\\"?u=!0:l?c===a&&(l=!1):c==='"'||c==="'"?(l=!0,a=c):c==="("?o+=1:c===")"?o>0&&(o-=1):o===0&&e.includes(c)&&(n=!0),n?(i!==""&&r.push(i.trim()),i="",n=!1):i+=c;return(t||i!=="")&&r.push(i.trim()),r}};var Ko=nt;nt.default=nt;let Qo=ke,wh=Ko,or=class extends Qo{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return wh.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var ri=or;or.default=or;Qo.registerRule(or);let bh=Sr,vh=yh,Sh=_r,Ch=ti,_h=dt,qi=ri;const en={empty:!0,space:!0};function xh(s){for(let e=s.length-1;e>=0;e--){let t=s[e],r=t[3]||t[2];if(r)return r}}let Ih=class{constructor(e){this.input=e,this.root=new _h,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new Ch;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let r,i,n,o=!1,l=!1,a=[],u=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),r=e[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){l=!0;break}else if(r==="}"){if(a.length>0){for(n=a.length-1,i=a[n];i&&i[0]==="space";)i=a[--n];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}else a.push(e);else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(t.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(t,"params",a),o&&(e=a[a.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),l&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let r=0,i;for(let n=t-1;n>=0&&(i=e[n],!(i[0]!=="space"&&(r+=1,r===2)));n--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(e){let t=0,r,i,n;for(let[o,l]of e.entries()){if(r=l,i=r[0],i==="("&&(t+=1),i===")"&&(t-=1),t===0&&i===":")if(!n)this.doubleColon(r);else{if(n[0]==="word"&&n[1]==="progid")continue;return o}n=r}return!1}comment(e){let t=new Sh;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let i=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=i[2],t.raws.left=i[1],t.raws.right=i[3]}}createTokenizer(){this.tokenizer=vh(this.input)}decl(e,t){let r=new bh;this.init(r,e[0][2]);let i=e[e.length-1];for(i[0]===";"&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(i[3]||i[2]||xh(e)),r.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let u=e[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=e.shift()[1]}r.raws.between="";let n;for(;e.length;)if(n=e.shift(),n[0]===":"){r.raws.between+=n[1];break}else n[0]==="word"&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o=[],l;for(;e.length&&(l=e[0][0],!(l!=="space"&&l!=="comment"));)o.push(e.shift());this.precheckMissedSemicolon(e);for(let u=e.length-1;u>=0;u--){if(n=e[u],n[1].toLowerCase()==="!important"){r.important=!0;let c=this.stringFrom(e,u);c=this.spacesFromEnd(e)+c,c!==" !important"&&(r.raws.important=c);break}else if(n[1].toLowerCase()==="important"){let c=e.slice(0),h="";for(let p=u;p>0;p--){let d=c[p][0];if(h.trim().indexOf("!")===0&&d!=="space")break;h=c.pop()[1]+h}h.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=h,e=c)}if(n[0]!=="space"&&n[0]!=="comment")break}e.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=o.map(u=>u[1]).join(""),o=[]),this.raw(r,"value",o.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new qi;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let t=!1,r=null,i=!1,n=null,o=[],l=e[1].startsWith("--"),a=[],u=e;for(;u;){if(r=u[0],a.push(u),r==="("||r==="[")n||(n=u),o.push(r==="("?")":"]");else if(l&&i&&r==="{")n||(n=u),o.push("}");else if(o.length===0)if(r===";")if(i){this.decl(a,l);return}else break;else if(r==="{"){this.rule(a);return}else if(r==="}"){this.tokenizer.back(a.pop()),t=!0;break}else r===":"&&(i=!0);else r===o[o.length-1]&&(o.pop(),o.length===0&&(n=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&i){if(!l)for(;a.length&&(u=a[a.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(a.pop());this.decl(a,l)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,i){let n,o,l=r.length,a="",u=!0,c,h;for(let p=0;p<l;p+=1)n=r[p],o=n[0],o==="space"&&p===l-1&&!i?u=!1:o==="comment"?(h=r[p-1]?r[p-1][0]:"empty",c=r[p+1]?r[p+1][0]:"empty",!en[h]&&!en[c]?a.slice(-1)===","?u=!1:a+=n[1]:u=!1):a+=n[1];if(!u){let p=r.reduce((d,g)=>d+g[1],"");e.raws[t]={raw:p,value:a}}e[t]=a}rule(e){e.pop();let t=new qi;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],!(t!=="space"&&t!=="comment"));)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],t==="space");)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let i=t;i<e.length;i++)r+=e[i][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};var Rh=Ih;let kh=ke,Eh=Rh,Mh=Cr;function ar(s,e){let t=new Mh(s,e),r=new Eh(t);try{r.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&e&&e.from&&(/\.scss$/i.test(e.from)?i.message+=`
53
+ You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(e.from)?i.message+=`
54
+ You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(e.from)&&(i.message+=`
55
+ You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return r.root}var si=ar;ar.default=ar;kh.registerParse(ar);let{isClean:fe,my:Ah}=ft,Oh=No,$h=br,Nh=ke,Th=qs,Ph=Go,tn=ei,Dh=si,Lh=dt;const Fh={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Uh={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},Bh={Once:!0,postcssPlugin:!0,prepare:!0},Fe=0;function Je(s){return typeof s=="object"&&typeof s.then=="function"}function qo(s){let e=!1,t=Fh[s.type];return s.type==="decl"?e=s.prop.toLowerCase():s.type==="atrule"&&(e=s.name.toLowerCase()),e&&s.append?[t,t+"-"+e,Fe,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:s.append?[t,Fe,t+"Exit"]:[t,t+"Exit"]}function rn(s){let e;return s.type==="document"?e=["Document",Fe,"DocumentExit"]:s.type==="root"?e=["Root",Fe,"RootExit"]:e=qo(s),{eventIndex:0,events:e,iterator:0,node:s,visitorIndex:0,visitors:[]}}function Ss(s){return s[fe]=!1,s.nodes&&s.nodes.forEach(e=>Ss(e)),s}let Cs={},Ue=class ea{constructor(e,t,r){this.stringified=!1,this.processed=!1;let i;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))i=Ss(t);else if(t instanceof ea||t instanceof tn)i=Ss(t.root),t.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let n=Dh;r.syntax&&(n=r.syntax.parse),r.parser&&(n=r.parser),n.parse&&(n=n.parse);try{i=n(t,r)}catch(o){this.processed=!0,this.error=o}i&&!i[Ah]&&Nh.rebuild(i)}this.result=new tn(e,i,r),this.helpers={...Cs,postcss:Cs,result:this.result},this.plugins=this.processor.plugins.map(n=>typeof n=="object"&&n.prepare?{...n,...n.prepare(this.result)}:n)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin)e.plugin=r.postcssPlugin,e.setMessage();else if(r.postcssVersion&&process.env.NODE_ENV!=="production"){let i=r.postcssPlugin,n=r.postcssVersion,o=this.result.processor.version,l=n.split("."),a=o.split(".");(l[0]!==a[0]||parseInt(l[1])>parseInt(a[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+o+", but "+i+" uses "+n+". Perhaps this is the source of the error below.")}}catch(i){console&&console.error&&console.error(i)}return e}prepareVisitors(){this.listeners={};let e=(t,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([t,i])};for(let t of this.plugins)if(typeof t=="object")for(let r in t){if(!Uh[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Bh[r])if(typeof t[r]=="object")for(let i in t[r])i==="*"?e(t,r,t[r][i]):e(t,r+"-"+i.toLowerCase(),t[r][i]);else typeof t[r]=="function"&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(Je(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[fe];){e[fe]=!0;let t=[rn(e)];for(;t.length>0;){let r=this.visitTick(t);if(Je(r))try{await r}catch(i){let n=t[t.length-1].node;throw this.handleError(i,n)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type==="document"){let i=e.nodes.map(n=>r(n,this.helpers));await Promise.all(i)}else await r(e,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let t=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return Je(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=$h;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new Oh(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){let t=this.runOnRoot(e);if(Je(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[fe];)e[fe]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return process.env.NODE_ENV!=="production"&&("from"in this.opts||Ph("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,i]of e){this.result.lastPlugin=r;let n;try{n=i(t,this.helpers)}catch(o){throw this.handleError(o,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(Je(n))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:i}=t;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(i.length>0&&t.visitorIndex<i.length){let[o,l]=i[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===i.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return l(r.toProxy(),this.helpers)}catch(a){throw this.handleError(a,r)}}if(t.iterator!==0){let o=t.iterator,l;for(;l=r.nodes[r.indexes[o]];)if(r.indexes[o]+=1,!l[fe]){l[fe]=!0,e.push(rn(l));return}t.iterator=0,delete r.indexes[o]}let n=t.events;for(;t.eventIndex<n.length;){let o=n[t.eventIndex];if(t.eventIndex+=1,o===Fe){r.nodes&&r.nodes.length&&(r[fe]=!0,t.iterator=r.getIterator());return}else if(this.listeners[o]){t.visitors=this.listeners[o];return}}e.pop()}walkSync(e){e[fe]=!0;let t=qo(e);for(let r of t)if(r===Fe)e.nodes&&e.each(i=>{i[fe]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Ue.registerPostcss=s=>{Cs=s};var ta=Ue;Ue.default=Ue;Lh.registerLazyResult(Ue);Th.registerLazyResult(Ue);let zh=No,Wh=br,Hh=Go,jh=si;const Gh=ei;let _s=class{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let i,n=Wh;this.result=new Gh(this._processor,i,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let l=new zh(n,i,this._opts,t);if(l.isMap()){let[a,u]=l.generate();a&&(this.result.css=a),u&&(this.result.map=u)}else l.clearAnnotation(),this.result.css=l.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return process.env.NODE_ENV!=="production"&&("from"in this._opts||Hh("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=jh;try{e=t(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Vh=_s;_s.default=_s;let Yh=Vh,Zh=ta,Jh=qs,Xh=dt,ot=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)t.push(r);else if(typeof r=="function")t.push(r);else if(typeof r=="object"&&(r.parse||r.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new Yh(this,e,t):new Zh(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Kh=ot;ot.default=ot;Xh.registerProcessor(ot);Jh.registerProcessor(ot);let Qh=Sr,qh=Eo,ef=_r,tf=ti,rf=Cr,sf=dt,nf=ri;function at(s,e){if(Array.isArray(s))return s.map(i=>at(i));let{inputs:t,...r}=s;if(t){e=[];for(let i of t){let n={...i,__proto__:rf.prototype};n.map&&(n.map={...n.map,__proto__:qh.prototype}),e.push(n)}}if(r.nodes&&(r.nodes=s.nodes.map(i=>at(i,e))),r.source){let{inputId:i,...n}=r.source;r.source=n,i!=null&&(r.source.input=e[i])}if(r.type==="root")return new sf(r);if(r.type==="decl")return new Qh(r);if(r.type==="rule")return new nf(r);if(r.type==="comment")return new ef(r);if(r.type==="atrule")return new tf(r);throw new Error("Unknown node type: "+s.type)}var of=at;at.default=at;let af=Xs,ra=Sr,lf=ta,uf=ke,ii=Kh,cf=br,hf=of,sa=qs,ff=Vo,ia=_r,na=ti,df=ei,pf=Cr,mf=si,gf=Ko,oa=ri,aa=dt,yf=vr;function N(...s){return s.length===1&&Array.isArray(s[0])&&(s=s[0]),new ii(s)}N.plugin=function(e,t){let r=!1;function i(...o){console&&console.warn&&!r&&(r=!0,console.warn(e+`: 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(e+`: 里面 postcss.plugin 被弃用. 迁移指南:
57
+ https://www.w3ctech.com/topic/2226`));let l=t(...o);return l.postcssPlugin=e,l.postcssVersion=new ii().version,l}let n;return Object.defineProperty(i,"postcss",{get(){return n||(n=i()),n}}),i.process=function(o,l,a){return N([i(a)]).process(o,l)},i};N.stringify=cf;N.parse=mf;N.fromJSON=hf;N.list=gf;N.comment=s=>new ia(s);N.atRule=s=>new na(s);N.decl=s=>new ra(s);N.rule=s=>new oa(s);N.root=s=>new aa(s);N.document=s=>new sa(s);N.CssSyntaxError=af;N.Declaration=ra;N.Container=uf;N.Processor=ii;N.Document=sa;N.Comment=ia;N.Warning=ff;N.AtRule=na;N.Result=df;N.Input=pf;N.Rule=oa;N.Root=aa;N.Node=yf;lf.registerPostcss(N);var wf=N;N.default=N;const z=Ec(wf);z.stringify;z.fromJSON;z.plugin;z.parse;z.list;z.document;z.comment;z.atRule;z.rule;z.decl;z.root;z.CssSyntaxError;z.Declaration;z.Container;z.Processor;z.Document;z.Comment;z.Warning;z.AtRule;z.Result;z.Input;z.Rule;z.Root;z.Node;class ni{constructor(...e){ie(this,"parentElement",null),ie(this,"parentNode",null),ie(this,"ownerDocument"),ie(this,"firstChild",null),ie(this,"lastChild",null),ie(this,"previousSibling",null),ie(this,"nextSibling",null),ie(this,"ELEMENT_NODE",1),ie(this,"TEXT_NODE",3),ie(this,"nodeType"),ie(this,"nodeName"),ie(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(e instanceof ni){if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0}else return!1;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const sn={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},nn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Lt={},bf=()=>!!globalThis.Zone;function oi(s){if(Lt[s])return Lt[s];const e=globalThis[s],t=e.prototype,r=s in sn?sn[s]:void 0,i=!!(r&&r.every(l=>{var a,u;return!!((u=(a=Object.getOwnPropertyDescriptor(t,l))==null?void 0:a.get)!=null&&u.toString().includes("[native code]"))})),n=s in nn?nn[s]:void 0,o=!!(n&&n.every(l=>{var a;return typeof t[l]=="function"&&((a=t[l])==null?void 0:a.toString().includes("[native code]"))}));if(i&&o&&!bf())return Lt[s]=e.prototype,e.prototype;try{const l=document.createElement("iframe");document.body.appendChild(l);const a=l.contentWindow;if(!a)return e.prototype;const u=a[s].prototype;return document.body.removeChild(l),u?Lt[s]=u:t}catch{return t}}const zr={};function be(s,e,t){var r;const i=`${s}.${String(t)}`;if(zr[i])return zr[i].call(e);const n=oi(s),o=(r=Object.getOwnPropertyDescriptor(n,t))==null?void 0:r.get;return o?(zr[i]=o,o.call(e)):e[t]}const Wr={};function la(s,e,t){const r=`${s}.${String(t)}`;if(Wr[r])return Wr[r].bind(e);const n=oi(s)[t];return typeof n!="function"?e[t]:(Wr[r]=n,n.bind(e))}function vf(s){return be("Node",s,"childNodes")}function Sf(s){return be("Node",s,"parentNode")}function Cf(s){return be("Node",s,"parentElement")}function _f(s){return be("Node",s,"textContent")}function xf(s,e){return la("Node",s,"contains")(e)}function If(s){return la("Node",s,"getRootNode")()}function Rf(s){return!s||!("host"in s)?null:be("ShadowRoot",s,"host")}function kf(s){return s.styleSheets}function Ef(s){return!s||!("shadowRoot"in s)?null:be("Element",s,"shadowRoot")}function Mf(s,e){return be("Element",s,"querySelector")(e)}function Af(s,e){return be("Element",s,"querySelectorAll")(e)}function ua(){return oi("MutationObserver").constructor}const _={childNodes:vf,parentNode:Sf,parentElement:Cf,textContent:_f,contains:xf,getRootNode:If,host:Rf,styleSheets:kf,shadowRoot:Ef,querySelector:Mf,querySelectorAll:Af,mutationObserver:ua};function ee(s,e,t=document){const r={capture:!0,passive:!0};return t.addEventListener(s,e,r),()=>t.removeEventListener(s,e,r)}const Me=`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.`;let on={map:{},getId(){return console.error(Me),-1},getNode(){return console.error(Me),null},removeNodeFromMap(){console.error(Me)},has(){return console.error(Me),!1},reset(){console.error(Me)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(on=new Proxy(on,{get(s,e,t){return e==="map"&&console.error(Me),Reflect.get(s,e,t)}}));function lt(s,e,t={}){let r=null,i=0;return function(...n){const o=Date.now();!i&&t.leading===!1&&(i=o);const l=e-(o-i),a=this;l<=0||l>e?(r&&(clearTimeout(r),r=null),i=o,s.apply(a,n)):!r&&t.trailing!==!1&&(r=setTimeout(()=>{i=t.leading===!1?0:Date.now(),r=null,s.apply(a,n)},l))}}function xr(s,e,t,r,i=window){const n=i.Object.getOwnPropertyDescriptor(s,e);return i.Object.defineProperty(s,e,r?t:{set(o){setTimeout(()=>{t.set.call(this,o)},0),n&&n.set&&n.set.call(this,o)}}),()=>xr(s,e,n||{},!0)}function He(s,e,t){try{if(!(e in s))return()=>{};const r=s[e],i=t(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),s[e]=i,()=>{s[e]=r}}catch{return()=>{}}}let lr=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(lr=()=>new Date().getTime());function ca(s){var e,t,r,i;const n=s.document;return{left:n.scrollingElement?n.scrollingElement.scrollLeft:s.pageXOffset!==void 0?s.pageXOffset:n.documentElement.scrollLeft||(n==null?void 0:n.body)&&((e=_.parentElement(n.body))==null?void 0:e.scrollLeft)||((t=n==null?void 0:n.body)==null?void 0:t.scrollLeft)||0,top:n.scrollingElement?n.scrollingElement.scrollTop:s.pageYOffset!==void 0?s.pageYOffset:(n==null?void 0:n.documentElement.scrollTop)||(n==null?void 0:n.body)&&((r=_.parentElement(n.body))==null?void 0:r.scrollTop)||((i=n==null?void 0:n.body)==null?void 0:i.scrollTop)||0}}function ha(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function fa(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function da(s){return s?s.nodeType===s.ELEMENT_NODE?s:_.parentElement(s):null}function te(s,e,t,r){if(!s)return!1;const i=da(s);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(qt(i,e,r))return!0}catch{}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function Of(s,e){return e.getId(s)!==-1}function Hr(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(s)===qe}function pa(s,e){if(Xe(s))return!1;const t=e.getId(s);if(!e.has(t))return!0;const r=_.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?!1:r?pa(r,e):!0}function xs(s){return!!s.changedTouches}function $f(s=window){"NodeList"in s&&!s.NodeList.prototype.forEach&&(s.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in s&&!s.DOMTokenList.prototype.forEach&&(s.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function ma(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function ga(s,e){return!!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function Is(s){return s?s instanceof ni&&"shadowRoot"in s?!!s.shadowRoot:!!_.shadowRoot(s):!1}class Nf{constructor(){S(this,"id",1),S(this,"styleIDMap",new WeakMap),S(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return t===void 0?r=this.id++:r=t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function ya(s){var e;let t=null;return"getRootNode"in s&&((e=_.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&_.host(_.getRootNode(s))&&(t=_.host(_.getRootNode(s))),t}function Tf(s){let e=s,t;for(;t=ya(e);)e=t;return e}function Pf(s){const e=s.ownerDocument;if(!e)return!1;const t=Tf(s);return _.contains(e,t)}function wa(s){const e=s.ownerDocument;return e?_.contains(e,s)||Pf(s):!1}var I=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(I||{}),x=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s))(x||{}),re=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))(re||{}),de=(s=>(s[s.Mouse=0]="Mouse",s[s.Pen=1]="Pen",s[s.Touch=2]="Touch",s))(de||{}),Be=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))(Be||{}),Ae=(s=>(s[s.Play=0]="Play",s[s.Pause=1]="Pause",s[s.Seeked=2]="Seeked",s[s.VolumeChange=3]="VolumeChange",s[s.RateChange=4]="RateChange",s))(Ae||{}),ba=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(ba||{});function an(s){return"__ln"in s}class Df{constructor(){S(this,"length",0),S(this,"head",null),S(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(t==null?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&an(e.previousSibling)){const r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&an(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const ln=(s,e)=>`${s}@${e}`;class Lf{constructor(){S(this,"frozen",!1),S(this,"locked",!1),S(this,"texts",[]),S(this,"attributes",[]),S(this,"attributeMap",new WeakMap),S(this,"removes",[]),S(this,"mapRemoves",[]),S(this,"movedMap",{}),S(this,"addedSet",new Set),S(this,"movedSet",new Set),S(this,"droppedSet",new Set),S(this,"removesSubTreeCache",new Set),S(this,"mutationCb"),S(this,"blockClass"),S(this,"blockSelector"),S(this,"maskTextClass"),S(this,"maskTextSelector"),S(this,"inlineStylesheet"),S(this,"maskInputOptions"),S(this,"maskTextFn"),S(this,"maskInputFn"),S(this,"keepIframeSrcFn"),S(this,"recordCanvas"),S(this,"inlineImages"),S(this,"slimDOMOptions"),S(this,"dataURLOptions"),S(this,"doc"),S(this,"mirror"),S(this,"iframeManager"),S(this,"stylesheetManager"),S(this,"shadowDomManager"),S(this,"canvasManager"),S(this,"processedNodeManager"),S(this,"unattachedDoc"),S(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),S(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new Df,i=a=>{let u=a,c=qe;for(;c===qe;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},n=a=>{const u=_.parentNode(a);if(!u||!wa(a))return;let c=!1;if(a.nodeType===Node.TEXT_NODE){const g=u.tagName;if(g==="TEXTAREA")return;g==="STYLE"&&this.addedSet.has(u)&&(c=!0)}const h=Xe(u)?this.mirror.getId(ya(a)):this.mirror.getId(u),p=i(a);if(h===-1||p===-1)return r.addNode(a);const d=$e(a,{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:g=>{ma(g,this.mirror)&&this.iframeManager.addIframe(g),ga(g,this.mirror)&&this.stylesheetManager.trackLinkElement(g),Is(a)&&this.shadowDomManager.addShadowRoot(_.shadowRoot(a),this.doc)},onIframeLoad:(g,m)=>{this.iframeManager.attachIframe(g,m),this.shadowDomManager.observeAttachShadow(g)},onStylesheetLoad:(g,m)=>{this.stylesheetManager.attachLinkElement(g,m)},cssCaptured:c});d&&(e.push({parentId:h,nextId:p,node:d}),t.add(d.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)un(this.removesSubTreeCache,a,this.mirror)&&!this.movedSet.has(_.parentNode(a))||n(a);for(const a of this.addedSet)!cn(this.droppedSet,a)&&!un(this.removesSubTreeCache,a,this.mirror)||cn(this.movedSet,a)?n(a):this.droppedSet.add(a);let o=null;for(;r.length;){let a=null;if(o){const u=this.mirror.getId(_.parentNode(o.value)),c=i(o.value);u!==-1&&c!==-1&&(a=o)}if(!a){let u=r.tail;for(;u;){const c=u;if(u=u.previous,c){const h=this.mirror.getId(_.parentNode(c.value));if(i(c.value)===-1)continue;if(h!==-1){a=c;break}else{const d=c.value,g=_.parentNode(d);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const m=_.host(g);if(this.mirror.getId(m)!==-1){a=c;break}}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}o=a.previous,r.removeNode(a.value),n(a.value)}const l={texts:this.texts.map(a=>{const u=a.node,c=_.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:a.value}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{const{attributes:u}=a;if(typeof u.style=="string"){const c=JSON.stringify(a.styleDiff),h=JSON.stringify(a._unchangedStyles);c.length<u.style.length&&(c+h).split("var(").length===u.style.split("var(").length&&(u.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:u}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:e};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(l))}),S(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(_.childNodes(e),r=>_.textContent(r)||"").join("")}),S(this,"processMutation",e=>{if(!Hr(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=_.textContent(e.target);!te(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:Bn(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,da(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let r=e.attributeName,i=e.target.getAttribute(r);if(r==="value"){const o=Ls(t);i=Ds({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:o,value:i,maskInputFn:this.maskInputFn})}if(te(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let n=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)r="rr_src";else return;if(n||(n={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e.target,n)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!Un(t.tagName,r))if(n.attributes[r]=Fn(this.doc,Ie(t.tagName),Ie(r),i),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const o=this.unattachedDoc.createElement("span");e.oldValue&&o.setAttribute("style",e.oldValue);for(const l of Array.from(t.style)){const a=t.style.getPropertyValue(l),u=t.style.getPropertyPriority(l);a!==o.style.getPropertyValue(l)||u!==o.style.getPropertyPriority(l)?u===""?n.styleDiff[l]=a:n.styleDiff[l]=[a,u]:n._unchangedStyles[l]=[a,u]}for(const l of Array.from(o.style))t.style.getPropertyValue(l)===""&&(n.styleDiff[l]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?n.attributes.rr_open_mode="modal":n.attributes.rr_open_mode="non-modal");break}case"childList":{if(te(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const r=this.mirror.getId(t),i=Xe(e.target)?this.mirror.getId(_.host(e.target)):this.mirror.getId(e.target);te(e.target,this.blockClass,this.blockSelector,!1)||Hr(t,this.mirror,this.slimDOMOptions)||!Of(t,this.mirror)||(this.addedSet.has(t)?(Rs(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||pa(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[ln(r,i)]?Rs(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:Xe(e.target)&&Ke(e.target)?!0:void 0}),Ff(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}}),S(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Hr(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&r!==-1&&(this.movedMap[ln(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);te(e,this.blockClass,this.blockSelector,!1)||(_.childNodes(e).forEach(r=>this.genAdds(r)),Is(e)&&_.childNodes(_.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Rs(s,e){s.delete(e),_.childNodes(e).forEach(t=>Rs(s,t))}function Ff(s,e){const t=[s];for(;t.length;){const r=t.pop();e.has(r)||(e.add(r),_.childNodes(r).forEach(i=>t.push(i)))}}function un(s,e,t){return s.size===0?!1:Uf(s,e)}function Uf(s,e,t){const r=_.parentNode(e);return r?s.has(r):!1}function cn(s,e){return s.size===0?!1:va(s,e)}function va(s,e){const t=_.parentNode(e);return t?s.has(t)?!0:va(s,t):!1}let Qe;function Bf(s){Qe=s}function zf(){Qe=void 0}const R=s=>Qe?(...t)=>{try{return s(...t)}catch(r){if(Qe&&Qe(r)===!0)return;throw r}}:s,xe=[];function pt(s){try{if("composedPath"in s){const e=s.composedPath();if(e.length)return e[0]}else if("path"in s&&s.path.length)return s.path[0]}catch{}return s&&s.target}function Sa(s,e){const t=new Lf;xe.push(t),t.init(s);const r=new(ua())(R(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function Wf({mousemoveCb:s,sampling:e,doc:t,mirror:r}){if(e.mousemove===!1)return()=>{};const i=typeof e.mousemove=="number"?e.mousemove:50,n=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let o=[],l;const a=lt(R(h=>{const p=Date.now()-l;s(o.map(d=>(d.timeOffset-=p,d)),h),o=[],l=null}),n),u=R(lt(R(h=>{const p=pt(h),{clientX:d,clientY:g}=xs(h)?h.changedTouches[0]:h;l||(l=lr()),o.push({x:d,y:g,id:r.getId(p),timeOffset:lr()-l}),a(typeof DragEvent<"u"&&h instanceof DragEvent?x.Drag:h instanceof MouseEvent?x.MouseMove:x.TouchMove)}),i,{trailing:!1})),c=[ee("mousemove",u,t),ee("touchmove",u,t),ee("drag",u,t)];return R(()=>{c.forEach(h=>h())})}function Hf({mouseInteractionCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){if(n.mouseInteraction===!1)return()=>{};const o=n.mouseInteraction===!0||n.mouseInteraction===void 0?{}:n.mouseInteraction,l=[];let a=null;const u=c=>h=>{const p=pt(h);if(te(p,r,i,!0))return;let d=null,g=c;if("pointerType"in h){switch(h.pointerType){case"mouse":d=de.Mouse;break;case"touch":d=de.Touch;break;case"pen":d=de.Pen;break}d===de.Touch?re[c]===re.MouseDown?g="TouchStart":re[c]===re.MouseUp&&(g="TouchEnd"):de.Pen}else xs(h)&&(d=de.Touch);d!==null?(a=d,(g.startsWith("Touch")&&d===de.Touch||g.startsWith("Mouse")&&d===de.Mouse)&&(d=null)):re[c]===re.Click&&(d=a,a=null);const m=xs(h)?h.changedTouches[0]:h;if(!m)return;const f=t.getId(p),{clientX:v,clientY:b}=m;R(s)({type:re[g],id:f,x:v,y:b,...d!==null&&{pointerType:d}})};return Object.keys(re).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&o[c]!==!1).forEach(c=>{let h=Ie(c);const p=u(c);if(window.PointerEvent)switch(re[c]){case re.MouseDown:case re.MouseUp:h=h.replace("mouse","pointer");break;case re.TouchStart:case re.TouchEnd:return}l.push(ee(h,p,e))}),R(()=>{l.forEach(c=>c())})}function Ca({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){const o=R(lt(R(l=>{const a=pt(l);if(!a||te(a,r,i,!0))return;const u=t.getId(a);if(a===e&&e.defaultView){const c=ca(e.defaultView);s({id:u,x:c.left,y:c.top})}else s({id:u,x:a.scrollLeft,y:a.scrollTop})}),n.scroll||100));return ee("scroll",o,e)}function jf({viewportResizeCb:s},{win:e}){let t=-1,r=-1;const i=R(lt(R(()=>{const n=ha(),o=fa();(t!==n||r!==o)&&(s({width:Number(o),height:Number(n)}),t=n,r=o)}),200));return ee("resize",i,e)}const Gf=["INPUT","TEXTAREA","SELECT"],hn=new WeakMap;function Vf({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,ignoreClass:n,ignoreSelector:o,maskInputOptions:l,maskInputFn:a,sampling:u,userTriggeredOnInput:c}){function h(b){let y=pt(b);const C=b.isTrusted,k=y&&y.tagName;if(y&&k==="OPTION"&&(y=_.parentElement(y)),!y||!k||Gf.indexOf(k)<0||te(y,r,i,!0)||y.classList.contains(n)||o&&y.matches(o))return;let M=y.value,V=!1;const O=Ls(y)||"";O==="radio"||O==="checkbox"?V=y.checked:(l[k.toLowerCase()]||l[O])&&(M=Ds({element:y,maskInputOptions:l,tagName:k,type:O,value:M,maskInputFn:a})),p(y,c?{text:M,isChecked:V,userTriggered:C}:{text:M,isChecked:V});const D=y.name;O==="radio"&&D&&V&&e.querySelectorAll(`input[type="radio"][name="${D}"]`).forEach(Y=>{if(Y!==y){const W=Y.value;p(Y,c?{text:W,isChecked:!V,userTriggered:!1}:{text:W,isChecked:!V})}})}function p(b,y){const C=hn.get(b);if(!C||C.text!==y.text||C.isChecked!==y.isChecked){hn.set(b,y);const k=t.getId(b);R(s)({...y,id:k})}}const g=(u.input==="last"?["change"]:["input","change"]).map(b=>ee(b,R(h),e)),m=e.defaultView;if(!m)return()=>{g.forEach(b=>b())};const f=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),v=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return f&&f.set&&g.push(...v.map(b=>xr(b[0],b[1],{set(){R(h)({target:this,isTrusted:!1})}},!1,m))),R(()=>{g.forEach(b=>b())})}function ur(s){const e=[];function t(r,i){if(Ft("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Ft("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Ft("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Ft("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const o=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(o)}else if(r.parentStyleSheet){const o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(o)}return i}return t(s,e)}function ye(s,e,t){let r,i;return s?(s.ownerNode?r=e.getId(s.ownerNode):i=t.getId(s),{styleId:i,id:r}):{}}function Yf({styleSheetRuleCb:s,mirror:e,stylesheetManager:t},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:R((c,h,p)=>{const[d,g]=p,{id:m,styleId:f}=ye(h,e,t.styleMirror);return(m&&m!==-1||f&&f!==-1)&&s({id:m,styleId:f,adds:[{rule:d,index:g}]}),c.apply(h,p)})}),r.CSSStyleSheet.prototype.addRule=function(c,h,p=this.cssRules.length){const d=`${c} { ${h} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[d,p])};const n=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(n,{apply:R((c,h,p)=>{const[d]=p,{id:g,styleId:m}=ye(h,e,t.styleMirror);return(g&&g!==-1||m&&m!==-1)&&s({id:g,styleId:m,removes:[{index:d}]}),c.apply(h,p)})}),r.CSSStyleSheet.prototype.removeRule=function(c){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:R((c,h,p)=>{const[d]=p,{id:g,styleId:m}=ye(h,e,t.styleMirror);return(g&&g!==-1||m&&m!==-1)&&s({id:g,styleId:m,replace:d}),c.apply(h,p)})}));let l;r.CSSStyleSheet.prototype.replaceSync&&(l=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:R((c,h,p)=>{const[d]=p,{id:g,styleId:m}=ye(h,e,t.styleMirror);return(g&&g!==-1||m&&m!==-1)&&s({id:g,styleId:m,replaceSync:d}),c.apply(h,p)})}));const a={};Ut("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(Ut("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),Ut("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),Ut("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(a).forEach(([c,h])=>{u[c]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(u[c].insertRule,{apply:R((p,d,g)=>{const[m,f]=g,{id:v,styleId:b}=ye(d.parentStyleSheet,e,t.styleMirror);return(v&&v!==-1||b&&b!==-1)&&s({id:v,styleId:b,adds:[{rule:m,index:[...ur(d),f||0]}]}),p.apply(d,g)})}),h.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:R((p,d,g)=>{const[m]=g,{id:f,styleId:v}=ye(d.parentStyleSheet,e,t.styleMirror);return(f&&f!==-1||v&&v!==-1)&&s({id:f,styleId:v,removes:[{index:[...ur(d),m]}]}),p.apply(d,g)})})}),R(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=n,o&&(r.CSSStyleSheet.prototype.replace=o),l&&(r.CSSStyleSheet.prototype.replaceSync=l),Object.entries(a).forEach(([c,h])=>{h.prototype.insertRule=u[c].insertRule,h.prototype.deleteRule=u[c].deleteRule})})}function _a({mirror:s,stylesheetManager:e},t){var r,i,n;let o=null;t.nodeName==="#document"?o=s.getId(t):o=s.getId(_.host(t));const l=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(n=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:n.ShadowRoot,a=l!=null&&l.prototype?Object.getOwnPropertyDescriptor(l==null?void 0:l.prototype,"adoptedStyleSheets"):void 0;return o===null||o===-1||!l||!a?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var u;return(u=a.get)==null?void 0:u.call(this)},set(u){var c;const h=(c=a.set)==null?void 0:c.call(this,u);if(o!==null&&o!==-1)try{e.adoptStyleSheets(u,o)}catch{}return h}}),R(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function Zf({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:i}){const n=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(n,{apply:R((l,a,u)=>{var c;const[h,p,d]=u;if(t.has(h))return n.apply(a,[h,p,d]);const{id:g,styleId:m}=ye((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(g&&g!==-1||m&&m!==-1)&&s({id:g,styleId:m,set:{property:h,value:p,priority:d},index:ur(a.parentRule)}),l.apply(a,u)})});const o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:R((l,a,u)=>{var c;const[h]=u;if(t.has(h))return o.apply(a,[h]);const{id:p,styleId:d}=ye((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(p&&p!==-1||d&&d!==-1)&&s({id:p,styleId:d,remove:{property:h},index:ur(a.parentRule)}),l.apply(a,u)})}),R(()=>{i.CSSStyleDeclaration.prototype.setProperty=n,i.CSSStyleDeclaration.prototype.removeProperty=o})}function Jf({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:i,doc:n}){const o=R(a=>lt(R(u=>{const c=pt(u);if(!c||te(c,e,t,!0))return;const{currentTime:h,volume:p,muted:d,playbackRate:g,loop:m}=c;s({type:a,id:r.getId(c),currentTime:h,volume:p,muted:d,playbackRate:g,loop:m})}),i.media||500)),l=[ee("play",o(Ae.Play),n),ee("pause",o(Ae.Pause),n),ee("seeked",o(Ae.Seeked),n),ee("volumechange",o(Ae.VolumeChange),n),ee("ratechange",o(Ae.RateChange),n)];return R(()=>{l.forEach(a=>a())})}function Xf({fontCb:s,doc:e}){const t=e.defaultView;if(!t)return()=>{};const r=[],i=new WeakMap,n=t.FontFace;t.FontFace=function(a,u,c){const h=new n(a,u,c);return i.set(h,{family:a,buffer:typeof u!="string",descriptors:c,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),h};const o=He(e.fonts,"add",function(l){return function(a){return setTimeout(R(()=>{const u=i.get(a);u&&(s(u),i.delete(a))}),0),l.apply(this,[a])}});return r.push(()=>{t.FontFace=n}),r.push(o),R(()=>{r.forEach(l=>l())})}function Kf(s){const{doc:e,mirror:t,blockClass:r,blockSelector:i,selectionCb:n}=s;let o=!0;const l=R(()=>{const a=e.getSelection();if(!a||o&&(a!=null&&a.isCollapsed))return;o=a.isCollapsed||!1;const u=[],c=a.rangeCount||0;for(let h=0;h<c;h++){const p=a.getRangeAt(h),{startContainer:d,startOffset:g,endContainer:m,endOffset:f}=p;te(d,r,i,!0)||te(m,r,i,!0)||u.push({start:t.getId(d),startOffset:g,end:t.getId(m),endOffset:f})}n({ranges:u})});return l(),ee("selectionchange",l)}function Qf({doc:s,customElementCb:e}){const t=s.defaultView;return!t||!t.customElements?()=>{}:He(t.customElements,"define",function(i){return function(n,o,l){try{e({define:{name:n}})}catch{console.warn(`Custom element callback failed for ${n}`)}return i.apply(this,[n,o,l])}})}function qf(s,e){const{mutationCb:t,mousemoveCb:r,mouseInteractionCb:i,scrollCb:n,viewportResizeCb:o,inputCb:l,mediaInteractionCb:a,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:h,fontCb:p,selectionCb:d,customElementCb:g}=s;s.mutationCb=(...m)=>{e.mutation&&e.mutation(...m),t(...m)},s.mousemoveCb=(...m)=>{e.mousemove&&e.mousemove(...m),r(...m)},s.mouseInteractionCb=(...m)=>{e.mouseInteraction&&e.mouseInteraction(...m),i(...m)},s.scrollCb=(...m)=>{e.scroll&&e.scroll(...m),n(...m)},s.viewportResizeCb=(...m)=>{e.viewportResize&&e.viewportResize(...m),o(...m)},s.inputCb=(...m)=>{e.input&&e.input(...m),l(...m)},s.mediaInteractionCb=(...m)=>{e.mediaInteaction&&e.mediaInteaction(...m),a(...m)},s.styleSheetRuleCb=(...m)=>{e.styleSheetRule&&e.styleSheetRule(...m),u(...m)},s.styleDeclarationCb=(...m)=>{e.styleDeclaration&&e.styleDeclaration(...m),c(...m)},s.canvasMutationCb=(...m)=>{e.canvasMutation&&e.canvasMutation(...m),h(...m)},s.fontCb=(...m)=>{e.font&&e.font(...m),p(...m)},s.selectionCb=(...m)=>{e.selection&&e.selection(...m),d(...m)},s.customElementCb=(...m)=>{e.customElement&&e.customElement(...m),g(...m)}}function ed(s,e={}){const t=s.doc.defaultView;if(!t)return()=>{};qf(s,e);let r;s.recordDOM&&(r=Sa(s,s.doc));const i=Wf(s),n=Hf(s),o=Ca(s),l=jf(s,{win:t}),a=Vf(s),u=Jf(s);let c=()=>{},h=()=>{},p=()=>{},d=()=>{};s.recordDOM&&(c=Yf(s,{win:t}),h=_a(s,s.doc),p=Zf(s,{win:t}),s.collectFonts&&(d=Xf(s)));const g=Kf(s),m=Qf(s),f=[];for(const v of s.plugins)f.push(v.observer(v.callback,t,v.options));return R(()=>{xe.forEach(v=>v.reset()),r==null||r.disconnect(),i(),n(),o(),l(),a(),u(),c(),h(),p(),d(),g(),m(),f.forEach(v=>v())})}function Ft(s){return typeof window[s]<"u"}function Ut(s){return!!(typeof window[s]<"u"&&window[s].prototype&&"insertRule"in window[s].prototype&&"deleteRule"in window[s].prototype)}class fn{constructor(e){S(this,"iframeIdToRemoteIdMap",new WeakMap),S(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){const n=r||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e);let l=n.get(t);return l||(l=this.generateIdFn(),n.set(t,l),o.set(l,t)),l}getIds(e,t){const r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(n=>this.getId(e,n,r,i))}getRemoteId(e,t,r){const i=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;const n=i.get(t);return n||-1}getRemoteIds(e,t){const r=this.getRemoteIdToIdMap(e);return t.map(i=>this.getRemoteId(e,i,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class td{constructor(e){S(this,"iframes",new WeakMap),S(this,"crossOriginIframeMap",new WeakMap),S(this,"crossOriginIframeMirror",new fn(Ln)),S(this,"crossOriginIframeStyleMirror"),S(this,"crossOriginIframeRootIdMap",new WeakMap),S(this,"mirror"),S(this,"mutationCb"),S(this,"wrappedEmit"),S(this,"loadListener"),S(this,"stylesheetManager"),S(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new fn(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;const i=this.crossOriginIframeMap.get(e.source);if(!i)return;const n=this.transformCrossOriginEvent(i,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case I.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:I.IncrementalSnapshot,data:{source:x.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case I.Meta:case I.Load:case I.DomContentLoaded:return!1;case I.Plugin:return t;case I.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case I.IncrementalSnapshot:switch(t.data.source){case x.Mutation:return t.data.adds.forEach(i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(i.node,n)}),t.data.removes.forEach(i=>{this.replaceIds(i,e,["parentId","id"])}),t.data.attributes.forEach(i=>{this.replaceIds(i,e,["id"])}),t.data.texts.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case x.Drag:case x.TouchMove:case x.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case x.ViewportResize:return!1;case x.MediaInteraction:case x.MouseInteraction:case x.Scroll:case x.CanvasMutation:case x.Input:return this.replaceIds(t.data,e,["id"]),t;case x.StyleSheetRule:case x.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case x.Font:return t;case x.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"])}),t;case x.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(r=t.data.styles)==null||r.forEach(i=>{this.replaceStyleIds(i,e,["styleId"])}),t}}return!1}replace(e,t,r,i){for(const n of i)!Array.isArray(t[n])&&typeof t[n]!="number"||(Array.isArray(t[n])?t[n]=e.getIds(r,t[n]):t[n]=e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,t)})}patchRootIdOnNode(e,t){e.type!==ba.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}}class rd{constructor(e){S(this,"shadowDoms",new WeakSet),S(this,"mutationCb"),S(this,"scrollCb"),S(this,"bypassOptions"),S(this,"mirror"),S(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!Ke(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=Sa({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Ca({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(_.host(e))),this.restoreHandlers.push(_a({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const r=this;this.restoreHandlers.push(He(e.prototype,"attachShadow",function(i){return function(n){const o=i.call(this,n),l=_.shadowRoot(this);return l&&wa(this)&&r.addShadowRoot(l,t),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}var Ne="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",sd=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Bt=0;Bt<Ne.length;Bt++)sd[Ne.charCodeAt(Bt)]=Bt;var id=function(s){var e=new Uint8Array(s),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=Ne[e[t]>>2],i+=Ne[(e[t]&3)<<4|e[t+1]>>4],i+=Ne[(e[t+1]&15)<<2|e[t+2]>>6],i+=Ne[e[t+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i};const dn=new Map;function nd(s,e){let t=dn.get(s);return t||(t=new Map,dn.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}const xa=(s,e,t)=>{if(!s||!(Ra(s,e)||typeof s=="object"))return;const r=s.constructor.name,i=nd(t,r);let n=i.indexOf(s);return n===-1&&(n=i.length,i.push(s)),n};function Vt(s,e,t){if(s instanceof Array)return s.map(r=>Vt(r,e,t));if(s===null)return s;if(s instanceof Float32Array||s instanceof Float64Array||s instanceof Int32Array||s instanceof Uint32Array||s instanceof Uint8Array||s instanceof Uint16Array||s instanceof Int16Array||s instanceof Int8Array||s instanceof Uint8ClampedArray)return{rr_type:s.constructor.name,args:[Object.values(s)]};if(s instanceof ArrayBuffer){const r=s.constructor.name,i=id(s);return{rr_type:r,base64:i}}else{if(s instanceof DataView)return{rr_type:s.constructor.name,args:[Vt(s.buffer,e,t),s.byteOffset,s.byteLength]};if(s instanceof HTMLImageElement){const r=s.constructor.name,{src:i}=s;return{rr_type:r,src:i}}else if(s instanceof HTMLCanvasElement){const r="HTMLImageElement",i=s.toDataURL();return{rr_type:r,src:i}}else{if(s instanceof ImageData)return{rr_type:s.constructor.name,args:[Vt(s.data,e,t),s.width,s.height]};if(Ra(s,e)||typeof s=="object"){const r=s.constructor.name,i=xa(s,e,t);return{rr_type:r,index:i}}}}return s}const Ia=(s,e,t)=>s.map(r=>Vt(r,e,t)),Ra=(s,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof e[i]=="function").find(i=>s instanceof e[i]);function od(s,e,t,r){const i=[],n=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const o of n)try{if(typeof e.CanvasRenderingContext2D.prototype[o]!="function")continue;const l=He(e.CanvasRenderingContext2D.prototype,o,function(a){return function(...u){return te(this.canvas,t,r,!0)||setTimeout(()=>{const c=Ia(u,e,this);s(this.canvas,{type:Be["2D"],property:o,args:c})},0),a.apply(this,u)}});i.push(l)}catch{const l=xr(e.CanvasRenderingContext2D.prototype,o,{set(a){s(this.canvas,{type:Be["2D"],property:o,args:[a],setter:!0})}});i.push(l)}return()=>{i.forEach(o=>o())}}function ad(s){return s==="experimental-webgl"?"webgl":s}function pn(s,e,t,r){const i=[];try{const n=He(s.HTMLCanvasElement.prototype,"getContext",function(o){return function(l,...a){if(!te(this,e,t,!0)){const u=ad(l);if("__context"in this||(this.__context=u),r&&["webgl","webgl2"].includes(u))if(a[0]&&typeof a[0]=="object"){const c=a[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return o.apply(this,[l,...a])}});i.push(n)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(n=>n())}}function mn(s,e,t,r,i,n){const o=[],l=Object.getOwnPropertyNames(s);for(const a of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))try{if(typeof s[a]!="function")continue;const u=He(s,a,function(c){return function(...h){const p=c.apply(this,h);if(xa(p,n,this),"tagName"in this.canvas&&!te(this.canvas,r,i,!0)){const d=Ia(h,n,this),g={type:e,property:a,args:d};t(this.canvas,g)}return p}});o.push(u)}catch{const u=xr(s,a,{set(c){t(this.canvas,{type:e,property:a,args:[c],setter:!0})}});o.push(u)}return o}function ld(s,e,t,r){const i=[];return i.push(...mn(e.WebGLRenderingContext.prototype,Be.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext<"u"&&i.push(...mn(e.WebGL2RenderingContext.prototype,Be.WebGL2,s,t,r,e)),()=>{i.forEach(n=>n())}}const ka="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",ud=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),gn=typeof window<"u"&&window.Blob&&new Blob([ud(ka)],{type:"text/javascript;charset=utf-8"});function cd(s){let e;try{if(e=gn&&(window.URL||window.webkitURL).createObjectURL(gn),!e)throw"";const t=new Worker(e,{name:s==null?void 0:s.name});return t.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),t}catch{return new Worker("data:text/javascript;base64,"+ka,{name:s==null?void 0:s.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class hd{constructor(e){S(this,"pendingCanvasMutations",new Map),S(this,"rafStamps",{latestId:0,invokeId:null}),S(this,"mirror"),S(this,"mutationCb"),S(this,"resetObservers"),S(this,"frozen",!1),S(this,"locked",!1),S(this,"processMutation",(a,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(u)});const{sampling:t="all",win:r,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&t==="all"&&this.initCanvasMutationObserver(r,i,n),o&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,i,n,{dataURLOptions:l})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,i,n){const o=pn(t,r,i,!0),l=new Map,a=new cd;a.onmessage=g=>{const{id:m}=g.data;if(l.set(m,!1),!("base64"in g.data))return;const{base64:f,type:v,width:b,height:y}=g.data;this.mutationCb({id:m,type:Be["2D"],commands:[{property:"clearRect",args:[0,0,b,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:f}],type:v}]},0,0]}]})};const u=1e3/e;let c=0,h;const p=()=>{const g=[];return t.document.querySelectorAll("canvas").forEach(m=>{te(m,r,i,!0)||g.push(m)}),g},d=g=>{if(c&&g-c<u){h=requestAnimationFrame(d);return}c=g,p().forEach(async m=>{var f;const v=this.mirror.getId(m);if(l.get(v)||m.width===0||m.height===0)return;if(l.set(v,!0),["webgl","webgl2"].includes(m.__context)){const y=m.getContext(m.__context);((f=y==null?void 0:y.getContextAttributes())==null?void 0:f.preserveDrawingBuffer)===!1&&y.clear(y.COLOR_BUFFER_BIT)}const b=await createImageBitmap(m);a.postMessage({id:v,bitmap:b,width:m.width,height:m.height,dataURLOptions:n.dataURLOptions},[b])}),h=requestAnimationFrame(d)};h=requestAnimationFrame(d),this.resetObservers=()=>{o(),cancelAnimationFrame(h)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=pn(e,t,r,!1),n=od(this.processMutation.bind(this),e,t,r),o=ld(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||t===-1)return;const i=r.map(o=>{const{type:l,...a}=o;return a}),{type:n}=r[0];this.mutationCb({id:t,type:n,commands:i}),this.pendingCanvasMutations.delete(e)}}class fd{constructor(e){S(this,"trackedLinkElements",new WeakSet),S(this,"mutationCb"),S(this,"adoptedStyleSheetCb"),S(this,"styleMirror",new Nf),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;const r={id:t,styleIds:[]},i=[];for(const n of e){let o;this.styleMirror.has(n)?o=this.styleMirror.getId(n):(o=this.styleMirror.add(n),i.push({styleId:o,rules:Array.from(n.rules||CSSRule,(l,a)=>({rule:Tn(l,n.href),index:a}))})),r.styleIds.push(o)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class dd{constructor(){S(this,"nodeMap",new WeakMap),S(this,"active",!1)}inOtherBuffer(e,t){const r=this.nodeMap.get(e);return r&&Array.from(r).some(i=>i!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}let G,Yt,jr,cr=!1;try{if(Array.from([1],s=>s*2)[0]!==2){const s=document.createElement("iframe");document.body.appendChild(s),Array.from=((gi=s.contentWindow)==null?void 0:gi.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){console.debug("Unable to override Array.from",s)}const oe=hl();function mt(s={}){const{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:n=null,ignoreClass:o="rr-ignore",ignoreSelector:l=null,maskTextClass:a="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:p,slimDOMOptions:d,maskInputFn:g,maskTextFn:m,hooks:f,packFn:v,sampling:b={},dataURLOptions:y={},mousemoveWait:C,recordDOM:k=!0,recordCanvas:M=!1,recordCrossOriginIframes:V=!1,recordAfter:O=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",userTriggeredOnInput:D=!1,collectFonts:Y=!1,inlineImages:W=!1,plugins:Q,keepIframeSrcFn:E=()=>!1,ignoreCSSAttributes:je=new Set([]),errorHandler:Ge}=s;Bf(Ge);const J=V?window.parent===window:!0;let se=!1;if(!J)try{window.parent.document&&(se=!1)}catch{se=!0}if(J&&!e)throw new Error("emit function is required");if(!J&&!se)return()=>{};C!==void 0&&b.mousemove===void 0&&(b.mousemove=C),oe.reset();const ve=h===!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}:p!==void 0?p:{password:!0},ue=d===!0||d==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:d==="all",headMetaDescKeywords:d==="all",headTitleMutations:d==="all"}:d||{};$f();let fi,kr=0;const di=A=>{for(const ne of Q||[])ne.eventProcessor&&(A=ne.eventProcessor(A));return v&&!se&&(A=v(A)),A};G=(A,ne)=>{var H;const j=A;if(j.timestamp=lr(),(H=xe[0])!=null&&H.isFrozen()&&j.type!==I.FullSnapshot&&!(j.type===I.IncrementalSnapshot&&j.data.source===x.Mutation)&&xe.forEach(ce=>ce.unfreeze()),J)e==null||e(di(j),ne);else if(se){const ce={type:"rrweb",event:di(j),origin:window.location.origin,isCheckout:ne};window.parent.postMessage(ce,"*")}if(j.type===I.FullSnapshot)fi=j,kr=0;else if(j.type===I.IncrementalSnapshot){if(j.data.source===x.Mutation&&j.data.isAttachIframe)return;kr++;const ce=r&&kr>=r,T=t&&j.timestamp-fi.timestamp>t;(ce||T)&&Yt(!0)}};const gt=A=>{G({type:I.IncrementalSnapshot,data:{source:x.Mutation,...A}})},pi=A=>G({type:I.IncrementalSnapshot,data:{source:x.Scroll,...A}}),mi=A=>G({type:I.IncrementalSnapshot,data:{source:x.CanvasMutation,...A}}),Wa=A=>G({type:I.IncrementalSnapshot,data:{source:x.AdoptedStyleSheet,...A}}),Se=new fd({mutationCb:gt,adoptedStyleSheetCb:Wa}),Ce=new td({mirror:oe,mutationCb:gt,stylesheetManager:Se,recordCrossOriginIframes:V,wrappedEmit:G});for(const A of Q||[])A.getMirror&&A.getMirror({nodeMirror:oe,crossOriginIframeMirror:Ce.crossOriginIframeMirror,crossOriginIframeStyleMirror:Ce.crossOriginIframeStyleMirror});const Er=new dd;jr=new hd({recordCanvas:M,mutationCb:mi,win:window,blockClass:i,blockSelector:n,mirror:oe,sampling:b.canvas,dataURLOptions:y});const yt=new rd({mutationCb:gt,scrollCb:pi,bypassOptions:{blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:ve,dataURLOptions:y,maskTextFn:m,maskInputFn:g,recordCanvas:M,inlineImages:W,sampling:b,slimDOMOptions:ue,iframeManager:Ce,stylesheetManager:Se,canvasManager:jr,keepIframeSrcFn:E,processedNodeManager:Er},mirror:oe});Yt=(A=!1)=>{if(!k)return;G({type:I.Meta,data:{href:window.location.href,width:fa(),height:ha()}},A),Se.reset(),yt.init(),xe.forEach(H=>H.lock());const ne=Pl(document,{mirror:oe,blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:ve,maskTextFn:m,maskInputFn:g,slimDOM:ue,dataURLOptions:y,recordCanvas:M,inlineImages:W,onSerialize:H=>{ma(H,oe)&&Ce.addIframe(H),ga(H,oe)&&Se.trackLinkElement(H),Is(H)&&yt.addShadowRoot(_.shadowRoot(H),document)},onIframeLoad:(H,j)=>{Ce.attachIframe(H,j),yt.observeAttachShadow(H)},onStylesheetLoad:(H,j)=>{Se.attachLinkElement(H,j)},keepIframeSrcFn:E});if(!ne)return console.warn("Failed to snapshot the document");G({type:I.FullSnapshot,data:{node:ne,initialOffset:ca(window)}},A),xe.forEach(H=>H.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Se.adoptStyleSheets(document.adoptedStyleSheets,oe.getId(document))};try{const A=[],ne=j=>{var ce;return R(ed)({mutationCb:gt,mousemoveCb:(T,Mr)=>G({type:I.IncrementalSnapshot,data:{source:Mr,positions:T}}),mouseInteractionCb:T=>G({type:I.IncrementalSnapshot,data:{source:x.MouseInteraction,...T}}),scrollCb:pi,viewportResizeCb:T=>G({type:I.IncrementalSnapshot,data:{source:x.ViewportResize,...T}}),inputCb:T=>G({type:I.IncrementalSnapshot,data:{source:x.Input,...T}}),mediaInteractionCb:T=>G({type:I.IncrementalSnapshot,data:{source:x.MediaInteraction,...T}}),styleSheetRuleCb:T=>G({type:I.IncrementalSnapshot,data:{source:x.StyleSheetRule,...T}}),styleDeclarationCb:T=>G({type:I.IncrementalSnapshot,data:{source:x.StyleDeclaration,...T}}),canvasMutationCb:mi,fontCb:T=>G({type:I.IncrementalSnapshot,data:{source:x.Font,...T}}),selectionCb:T=>{G({type:I.IncrementalSnapshot,data:{source:x.Selection,...T}})},customElementCb:T=>{G({type:I.IncrementalSnapshot,data:{source:x.CustomElement,...T}})},blockClass:i,ignoreClass:o,ignoreSelector:l,maskTextClass:a,maskTextSelector:u,maskInputOptions:ve,inlineStylesheet:c,sampling:b,recordDOM:k,recordCanvas:M,inlineImages:W,userTriggeredOnInput:D,collectFonts:Y,doc:j,maskInputFn:g,maskTextFn:m,keepIframeSrcFn:E,blockSelector:n,slimDOMOptions:ue,dataURLOptions:y,mirror:oe,iframeManager:Ce,stylesheetManager:Se,shadowDomManager:yt,processedNodeManager:Er,canvasManager:jr,ignoreCSSAttributes:je,plugins:((ce=Q==null?void 0:Q.filter(T=>T.observer))==null?void 0:ce.map(T=>({observer:T.observer,options:T.options,callback:Mr=>G({type:I.Plugin,data:{plugin:T.name,payload:Mr}})})))||[]},f)};Ce.addLoadListener(j=>{try{A.push(ne(j.contentDocument))}catch(ce){console.warn(ce)}});const H=()=>{Yt(),A.push(ne(document)),cr=!0};return document.readyState==="interactive"||document.readyState==="complete"?H():(A.push(ee("DOMContentLoaded",()=>{G({type:I.DomContentLoaded,data:{}}),O==="DOMContentLoaded"&&H()})),A.push(ee("load",()=>{G({type:I.Load,data:{}}),O==="load"&&H()},window))),()=>{A.forEach(j=>j()),Er.destroy(),cr=!1,zf()}}catch(A){console.warn(A)}}mt.addCustomEvent=(s,e)=>{if(!cr)throw new Error("please add custom event after start recording");G({type:I.Custom,data:{tag:s,payload:e}})};mt.freezePage=()=>{xe.forEach(s=>s.freeze())};mt.takeFullSnapshot=s=>{if(!cr)throw new Error("please take full snapshot after start recording");Yt(s)};mt.mirror=oe;var yn;(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped"})(yn||(yn={}));const pd=['input[type="password"]','input[type="credit-card"]','input[autocomplete="cc-number"]','input[autocomplete="cc-csc"]','input[autocomplete="cc-exp"]','input[autocomplete="cc-exp-month"]','input[autocomplete="cc-exp-year"]','input[autocomplete="new-password"]','input[autocomplete="current-password"]','input[name*="password"]','input[name*="passwd"]','input[name*="secret"]','input[name*="token"]','input[name*="apikey"]','input[name*="api_key"]','input[name*="api-key"]','input[name*="credit"]','input[name*="card"]','input[name*="cvv"]','input[name*="cvc"]','input[name*="ssn"]','input[id*="password"]','input[id*="secret"]','input[id*="token"]',"[data-private]","[data-mask]","[data-sensitive]"];function md(){return pd.join(", ")}function gd(){return"[data-private-text], [data-mask-text]"}function yd(s){return s.matches(md())}function wd(s){return s?{maskAllInputs:!1,maskTextSelector:gd(),maskInputOptions:{password:!0},maskInputFn:(e,t)=>yd(t)?"*".repeat(Math.min(e.length,20)):e,blockSelector:"[data-recorder-block], [data-bw-recorder-ui], #bw-recorder-root",ignoreSelector:"[data-recorder-ignore]"}:{maskAllInputs:!1,maskTextSelector:null,maskInputOptions:{}}}const bd=900*1e3,vd=30*1e3,Sd=100;class Cd{constructor(e){this.state="idle",this.events=[],this.stopFn=null,this.startTime=0,this.pauseTime=0,this.totalPausedDuration=0,this.chunkIndex=0,this.maxDurationTimer=null,this.chunkTimer=null,this.uploader=null,this.metadata=null,this.onEventCallback=null,this.config={...e,maxDuration:e.maxDuration??bd,maskInputs:e.maskInputs??!0}}setUploader(e){this.uploader=e}onEvent(e){this.onEventCallback=e}getState(){return this.state}getElapsedTime(){return this.state==="idle"||this.startTime===0?0:this.state==="paused"?this.pauseTime-this.startTime-this.totalPausedDuration:Date.now()-this.startTime-this.totalPausedDuration}getEvents(){return[...this.events]}async start(){var r,i;if(this.state!=="idle")throw new Error(`Cannot start recording: state is ${this.state}`);if(this.setState("recording"),this.startTime=Date.now(),this.events=[],this.chunkIndex=0,this.totalPausedDuration=0,this.metadata={url:window.location.href,userAgent:navigator.userAgent,viewport:{width:window.innerWidth,height:window.innerHeight},startedAt:this.startTime},this.uploader)try{await this.uploader.start(this.metadata)}catch(n){throw(i=(r=this.config).onError)==null||i.call(r,n),this.setState("idle"),n}const e=wd(this.config.maskInputs),t=mt({emit:n=>this.handleEvent(n),maskAllInputs:e.maskAllInputs,maskTextSelector:e.maskTextSelector??void 0,maskInputFn:e.maskInputFn,blockSelector:e.blockSelector,recordCanvas:!0,collectFonts:!0,inlineStylesheet:!0,sampling:{mousemove:!0,mouseInteraction:!0,scroll:150,input:"last"}});this.stopFn=t??null,this.maxDurationTimer=setTimeout(()=>{this.stop()},this.config.maxDuration),this.chunkTimer=setInterval(()=>{this.flushChunk()},vd)}pause(){if(this.state!=="recording")throw new Error(`Cannot pause: state is ${this.state}`);this.setState("paused"),this.pauseTime=Date.now()}resume(){if(this.state!=="paused")throw new Error(`Cannot resume: state is ${this.state}`);this.totalPausedDuration+=Date.now()-this.pauseTime,this.setState("recording")}async stop(e=[]){var t,r,i,n;if(this.state==="idle"||this.state==="stopped")return null;if(this.maxDurationTimer&&(clearTimeout(this.maxDurationTimer),this.maxDurationTimer=null),this.chunkTimer&&(clearInterval(this.chunkTimer),this.chunkTimer=null),this.stopFn&&(this.stopFn(),this.stopFn=null),this.setState("stopped"),await this.flushChunk(),this.uploader)try{const o=await this.uploader.complete(this.getElapsedTime(),this.events.length,e);return(r=(t=this.config).onComplete)==null||r.call(t,o),o}catch(o){return(n=(i=this.config).onError)==null||n.call(i,o),null}return null}handleEvent(e){var t;this.state!=="paused"&&(this.events.push(e),(t=this.onEventCallback)==null||t.call(this,e),this.events.length>=Sd&&this.flushChunk())}async flushChunk(){var t,r;if(this.events.length===0||!this.uploader)return;const e={index:this.chunkIndex++,events:[...this.events],timestamp:Date.now()};this.events=[];try{await this.uploader.uploadChunk(e)}catch(i){this.events=[...e.events,...this.events],this.chunkIndex--,(r=(t=this.config).onError)==null||r.call(t,i)}}setState(e){var t,r;this.state=e,(r=(t=this.config).onStateChange)==null||r.call(t,e)}reset(){this.stop(),this.state="idle",this.events=[],this.startTime=0,this.pauseTime=0,this.totalPausedDuration=0,this.chunkIndex=0,this.metadata=null}}class _d{constructor(){this.markers=[],this.recordingStartTime=0,this.isRecording=!1,this.captureDebounceTimer=null}setStartTime(e){this.recordingStartTime=e,this.isRecording=!0}getMarkers(){return[...this.markers]}getCount(){return this.markers.length}capture(e){if(!this.isRecording||this.recordingStartTime===0)return null;const t={timestamp:Date.now()-this.recordingStartTime,eventType:e};return this.markers.push(t),console.log("[BWorlds Recorder] Screenshot marker added",{timestamp:t.timestamp,eventType:t.eventType,totalMarkers:this.markers.length}),t}captureDebounced(e,t=500){this.captureDebounceTimer&&clearTimeout(this.captureDebounceTimer),this.captureDebounceTimer=setTimeout(()=>{this.capture(e),this.captureDebounceTimer=null},t)}stop(){this.isRecording=!1,this.captureDebounceTimer&&(clearTimeout(this.captureDebounceTimer),this.captureDebounceTimer=null)}reset(){this.markers=[],this.recordingStartTime=0,this.isRecording=!1,this.captureDebounceTimer&&(clearTimeout(this.captureDebounceTimer),this.captureDebounceTimer=null)}}class xd{constructor(e){this.lastScrollY=0,this.viewportHeight=0,this.observers=[],this.isRecording=!1,this.hasInitialScreenshot=!1,this.handleScroll=()=>{if(!this.isRecording)return;const t=window.scrollY;Math.abs(t-this.lastScrollY)>this.viewportHeight*.5&&(this.lastScrollY=t,this.screenshotCapture.captureDebounced("scroll",500))},this.handleFormSubmit=t=>{this.isRecording&&this.triggerScreenshot("form_submit")},this.handleNavigation=()=>{this.isRecording&&setTimeout(()=>{this.triggerScreenshot("navigation")},500)},this.screenshotCapture=e,this.viewportHeight=window.innerHeight}start(){this.isRecording||(this.isRecording=!0,this.lastScrollY=window.scrollY,this.viewportHeight=window.innerHeight,this.hasInitialScreenshot=!1,this.setupModalDetection(),this.setupScrollDetection(),this.setupFormDetection(),this.setupNavigationDetection(),setTimeout(()=>{this.isRecording&&!this.hasInitialScreenshot&&(this.hasInitialScreenshot=!0,this.triggerScreenshot("load"))},500))}stop(){this.isRecording=!1,this.observers.forEach(e=>e.disconnect()),this.observers=[],window.removeEventListener("scroll",this.handleScroll),window.removeEventListener("popstate",this.handleNavigation)}handleRrwebEvent(e){this.isRecording&&e.type===I.IncrementalSnapshot&&e.data.source}triggerScreenshot(e){this.isRecording&&this.screenshotCapture.capture(e)}setupModalDetection(){const e=new MutationObserver(t=>{for(const r of t){if(r.type==="childList"){for(const i of r.addedNodes)if(i instanceof HTMLElement&&this.isModal(i)){setTimeout(()=>{this.triggerScreenshot("modal_open")},300);return}}if(r.type==="attributes"){const i=r.target;if(r.attributeName==="open"&&i.tagName==="DIALOG"&&i.hasAttribute("open")){setTimeout(()=>{this.triggerScreenshot("modal_open")},300);return}}}});e.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["open","aria-hidden","aria-modal"]}),this.observers.push(e)}isModal(e){if(e.tagName.toLowerCase()==="dialog"||e.getAttribute("role")==="dialog"||e.getAttribute("role")==="alertdialog"||e.getAttribute("aria-modal")==="true")return!0;const r=e.className.toLowerCase(),i=["modal","dialog","overlay","popup","lightbox"];for(const o of i)if(r.includes(o))return!0;const n=window.getComputedStyle(e);if((n.position==="fixed"||n.position==="absolute")&&parseInt(n.zIndex)>100){const o=e.getBoundingClientRect(),l=window.innerWidth*window.innerHeight;if(o.width*o.height>l*.3)return!0}return!1}setupScrollDetection(){window.addEventListener("scroll",this.handleScroll,{passive:!0})}setupFormDetection(){document.addEventListener("submit",this.handleFormSubmit,!0)}setupNavigationDetection(){window.addEventListener("popstate",this.handleNavigation);const e=history.pushState.bind(history),t=history.replaceState.bind(history);history.pushState=(...r)=>{e(...r),this.handleNavigation()},history.replaceState=(...r)=>{t(...r),this.handleNavigation()}}destroy(){this.stop(),document.removeEventListener("submit",this.handleFormSubmit,!0)}}class Id{constructor(){this.recordingId="",this.sessionToken="",this.metadata=null,this.chunks=[],this.screenshotMarkers=[]}async start(e){return this.recordingId=`rec_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,this.sessionToken=`tok_${Math.random().toString(36).substr(2,16)}`,this.metadata=e,this.chunks=[],this.screenshotMarkers=[],console.log("[BWorlds Recorder] Recording started",{recordingId:this.recordingId,metadata:{url:e.url,viewport:e.viewport,startedAt:new Date(e.startedAt).toISOString()}}),{token:this.sessionToken,recordingId:this.recordingId,expiresAt:Date.now()+3600*1e3}}async uploadChunk(e){this.chunks.push(e),console.log("[BWorlds Recorder] Chunk uploaded",{recordingId:this.recordingId,chunkIndex:e.index,eventCount:e.events.length,totalEvents:this.chunks.reduce((t,r)=>t+r.events.length,0)})}async complete(e,t,r){this.screenshotMarkers=r;const i={recordingId:this.recordingId,playbackUrl:`https://app.bworlds.com/recordings/${this.recordingId}`,duration:e,eventCount:this.chunks.reduce((n,o)=>n+o.events.length,0),screenshotCount:r.length};return console.log("[BWorlds Recorder] Recording completed",{...i,metadata:this.metadata,screenshotMarkers:r.map(n=>({timestamp:n.timestamp,eventType:n.eventType}))}),console.log("[BWorlds Recorder] Recording data summary:",{chunks:this.chunks.length,screenshotMarkers:r.length,totalEvents:i.eventCount,duration:`${Math.round(e/1e3)}s`}),i}getData(){return{metadata:this.metadata,chunks:this.chunks,screenshotMarkers:this.screenshotMarkers}}}class Rd{constructor(e,t){this.sessionToken="",this.recordingId="",this.apiEndpoint=e,this.apiKey=t}async start(e){const t=await fetch(`${this.apiEndpoint}/api/recordings/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({api_key:this.apiKey,metadata:{url:e.url,user_agent:e.userAgent,viewport:e.viewport}})});if(!t.ok)throw new Error(`Failed to start recording: ${t.statusText}`);const r=await t.json();return this.sessionToken=r.session_token,this.recordingId=r.recording_id,{token:r.session_token,recordingId:r.recording_id,expiresAt:r.expires_at}}async uploadChunk(e){const t=await fetch(`${this.apiEndpoint}/api/recordings/${this.recordingId}/chunk`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.sessionToken}`},body:JSON.stringify({events:e.events,chunk_index:e.index})});if(!t.ok)throw new Error(`Failed to upload chunk: ${t.statusText}`)}async complete(e,t,r){const i=await fetch(`${this.apiEndpoint}/api/recordings/${this.recordingId}/complete`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.sessionToken}`},body:JSON.stringify({duration_ms:e,event_count:t,screenshot_markers:r.map(o=>({timestamp_ms:o.timestamp,event_type:o.eventType}))})});if(!i.ok)throw new Error(`Failed to complete recording: ${i.statusText}`);const n=await i.json();return{recordingId:this.recordingId,playbackUrl:n.playback_url,duration:e,eventCount:t,screenshotCount:r.length}}}var Ir,P,Ea,_e,wn,Ma,Aa,Oa,ai,ks,Es,ut={},$a=[],kd=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Rr=Array.isArray;function pe(s,e){for(var t in e)s[t]=e[t];return s}function li(s){s&&s.parentNode&&s.parentNode.removeChild(s)}function Ed(s,e,t){var r,i,n,o={};for(n in e)n=="key"?r=e[n]:n=="ref"?i=e[n]:o[n]=e[n];if(arguments.length>2&&(o.children=arguments.length>3?Ir.call(arguments,2):t),typeof s=="function"&&s.defaultProps!=null)for(n in s.defaultProps)o[n]===void 0&&(o[n]=s.defaultProps[n]);return Zt(s,o,r,i,null)}function Zt(s,e,t,r,i){var n={type:s,props:e,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Ea,__i:-1,__u:0};return i==null&&P.vnode!=null&&P.vnode(n),n}function ze(s){return s.children}function Jt(s,e){this.props=s,this.context=e}function We(s,e){if(e==null)return s.__?We(s.__,s.__i+1):null;for(var t;e<s.__k.length;e++)if((t=s.__k[e])!=null&&t.__e!=null)return t.__e;return typeof s.type=="function"?We(s):null}function Na(s){var e,t;if((s=s.__)!=null&&s.__c!=null){for(s.__e=s.__c.base=null,e=0;e<s.__k.length;e++)if((t=s.__k[e])!=null&&t.__e!=null){s.__e=s.__c.base=t.__e;break}return Na(s)}}function bn(s){(!s.__d&&(s.__d=!0)&&_e.push(s)&&!hr.__r++||wn!=P.debounceRendering)&&((wn=P.debounceRendering)||Ma)(hr)}function hr(){for(var s,e,t,r,i,n,o,l=1;_e.length;)_e.length>l&&_e.sort(Aa),s=_e.shift(),l=_e.length,s.__d&&(t=void 0,r=void 0,i=(r=(e=s).__v).__e,n=[],o=[],e.__P&&((t=pe({},r)).__v=r.__v+1,P.vnode&&P.vnode(t),ui(e.__P,t,r,e.__n,e.__P.namespaceURI,32&r.__u?[i]:null,n,i??We(r),!!(32&r.__u),o),t.__v=r.__v,t.__.__k[t.__i]=t,Da(n,t,o),r.__e=r.__=null,t.__e!=i&&Na(t)));hr.__r=0}function Ta(s,e,t,r,i,n,o,l,a,u,c){var h,p,d,g,m,f,v,b=r&&r.__k||$a,y=e.length;for(a=Md(t,e,b,a,y),h=0;h<y;h++)(d=t.__k[h])!=null&&(p=d.__i==-1?ut:b[d.__i]||ut,d.__i=h,f=ui(s,d,p,i,n,o,l,a,u,c),g=d.__e,d.ref&&p.ref!=d.ref&&(p.ref&&ci(p.ref,null,d),c.push(d.ref,d.__c||g,d)),m==null&&g!=null&&(m=g),(v=!!(4&d.__u))||p.__k===d.__k?a=Pa(d,a,s,v):typeof d.type=="function"&&f!==void 0?a=f:g&&(a=g.nextSibling),d.__u&=-7);return t.__e=m,a}function Md(s,e,t,r,i){var n,o,l,a,u,c=t.length,h=c,p=0;for(s.__k=new Array(i),n=0;n<i;n++)(o=e[n])!=null&&typeof o!="boolean"&&typeof o!="function"?(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?o=s.__k[n]=Zt(null,o,null,null,null):Rr(o)?o=s.__k[n]=Zt(ze,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=s.__k[n]=Zt(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):s.__k[n]=o,a=n+p,o.__=s,o.__b=s.__b+1,l=null,(u=o.__i=Ad(o,t,a,h))!=-1&&(h--,(l=t[u])&&(l.__u|=2)),l==null||l.__v==null?(u==-1&&(i>c?p--:i<c&&p++),typeof o.type!="function"&&(o.__u|=4)):u!=a&&(u==a-1?p--:u==a+1?p++:(u>a?p--:p++,o.__u|=4))):s.__k[n]=null;if(h)for(n=0;n<c;n++)(l=t[n])!=null&&(2&l.__u)==0&&(l.__e==r&&(r=We(l)),Fa(l,l));return r}function Pa(s,e,t,r){var i,n;if(typeof s.type=="function"){for(i=s.__k,n=0;i&&n<i.length;n++)i[n]&&(i[n].__=s,e=Pa(i[n],e,t,r));return e}s.__e!=e&&(r&&(e&&s.type&&!e.parentNode&&(e=We(s)),t.insertBefore(s.__e,e||null)),e=s.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Ad(s,e,t,r){var i,n,o,l=s.key,a=s.type,u=e[t],c=u!=null&&(2&u.__u)==0;if(u===null&&l==null||c&&l==u.key&&a==u.type)return t;if(r>(c?1:0)){for(i=t-1,n=t+1;i>=0||n<e.length;)if((u=e[o=i>=0?i--:n++])!=null&&(2&u.__u)==0&&l==u.key&&a==u.type)return o}return-1}function vn(s,e,t){e[0]=="-"?s.setProperty(e,t??""):s[e]=t==null?"":typeof t!="number"||kd.test(e)?t:t+"px"}function zt(s,e,t,r,i){var n,o;e:if(e=="style")if(typeof t=="string")s.style.cssText=t;else{if(typeof r=="string"&&(s.style.cssText=r=""),r)for(e in r)t&&e in t||vn(s.style,e,"");if(t)for(e in t)r&&t[e]==r[e]||vn(s.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")n=e!=(e=e.replace(Oa,"$1")),o=e.toLowerCase(),e=o in s||e=="onFocusOut"||e=="onFocusIn"?o.slice(2):e.slice(2),s.l||(s.l={}),s.l[e+n]=t,t?r?t.u=r.u:(t.u=ai,s.addEventListener(e,n?Es:ks,n)):s.removeEventListener(e,n?Es:ks,n);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in s)try{s[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!="-"?s.removeAttribute(e):s.setAttribute(e,e=="popover"&&t==1?"":t))}}function Sn(s){return function(e){if(this.l){var t=this.l[e.type+s];if(e.t==null)e.t=ai++;else if(e.t<t.u)return;return t(P.event?P.event(e):e)}}}function ui(s,e,t,r,i,n,o,l,a,u){var c,h,p,d,g,m,f,v,b,y,C,k,M,V,O,D,Y,W=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(a=!!(32&t.__u),n=[l=e.__e=t.__e]),(c=P.__b)&&c(e);e:if(typeof W=="function")try{if(v=e.props,b="prototype"in W&&W.prototype.render,y=(c=W.contextType)&&r[c.__c],C=c?y?y.props.value:c.__:r,t.__c?f=(h=e.__c=t.__c).__=h.__E:(b?e.__c=h=new W(v,C):(e.__c=h=new Jt(v,C),h.constructor=W,h.render=$d),y&&y.sub(h),h.state||(h.state={}),h.__n=r,p=h.__d=!0,h.__h=[],h._sb=[]),b&&h.__s==null&&(h.__s=h.state),b&&W.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=pe({},h.__s)),pe(h.__s,W.getDerivedStateFromProps(v,h.__s))),d=h.props,g=h.state,h.__v=e,p)b&&W.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),b&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(b&&W.getDerivedStateFromProps==null&&v!==d&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(v,C),e.__v==t.__v||!h.__e&&h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(v,h.__s,C)===!1){for(e.__v!=t.__v&&(h.props=v,h.state=h.__s,h.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.some(function(Q){Q&&(Q.__=e)}),k=0;k<h._sb.length;k++)h.__h.push(h._sb[k]);h._sb=[],h.__h.length&&o.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(v,h.__s,C),b&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(d,g,m)})}if(h.context=C,h.props=v,h.__P=s,h.__e=!1,M=P.__r,V=0,b){for(h.state=h.__s,h.__d=!1,M&&M(e),c=h.render(h.props,h.state,h.context),O=0;O<h._sb.length;O++)h.__h.push(h._sb[O]);h._sb=[]}else do h.__d=!1,M&&M(e),c=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++V<25);h.state=h.__s,h.getChildContext!=null&&(r=pe(pe({},r),h.getChildContext())),b&&!p&&h.getSnapshotBeforeUpdate!=null&&(m=h.getSnapshotBeforeUpdate(d,g)),D=c,c!=null&&c.type===ze&&c.key==null&&(D=La(c.props.children)),l=Ta(s,Rr(D)?D:[D],e,t,r,i,n,o,l,a,u),h.base=e.__e,e.__u&=-161,h.__h.length&&o.push(h),f&&(h.__E=h.__=null)}catch(Q){if(e.__v=null,a||n!=null)if(Q.then){for(e.__u|=a?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;n[n.indexOf(l)]=null,e.__e=l}else{for(Y=n.length;Y--;)li(n[Y]);Ms(e)}else e.__e=t.__e,e.__k=t.__k,Q.then||Ms(e);P.__e(Q,e,t)}else n==null&&e.__v==t.__v?(e.__k=t.__k,e.__e=t.__e):l=e.__e=Od(t.__e,e,t,r,i,n,o,a,u);return(c=P.diffed)&&c(e),128&e.__u?void 0:l}function Ms(s){s&&s.__c&&(s.__c.__e=!0),s&&s.__k&&s.__k.forEach(Ms)}function Da(s,e,t){for(var r=0;r<t.length;r++)ci(t[r],t[++r],t[++r]);P.__c&&P.__c(e,s),s.some(function(i){try{s=i.__h,i.__h=[],s.some(function(n){n.call(i)})}catch(n){P.__e(n,i.__v)}})}function La(s){return typeof s!="object"||s==null||s.__b&&s.__b>0?s:Rr(s)?s.map(La):pe({},s)}function Od(s,e,t,r,i,n,o,l,a){var u,c,h,p,d,g,m,f=t.props||ut,v=e.props,b=e.type;if(b=="svg"?i="http://www.w3.org/2000/svg":b=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),n!=null){for(u=0;u<n.length;u++)if((d=n[u])&&"setAttribute"in d==!!b&&(b?d.localName==b:d.nodeType==3)){s=d,n[u]=null;break}}if(s==null){if(b==null)return document.createTextNode(v);s=document.createElementNS(i,b,v.is&&v),l&&(P.__m&&P.__m(e,n),l=!1),n=null}if(b==null)f===v||l&&s.data==v||(s.data=v);else{if(n=n&&Ir.call(s.childNodes),!l&&n!=null)for(f={},u=0;u<s.attributes.length;u++)f[(d=s.attributes[u]).name]=d.value;for(u in f)if(d=f[u],u!="children"){if(u=="dangerouslySetInnerHTML")h=d;else if(!(u in v)){if(u=="value"&&"defaultValue"in v||u=="checked"&&"defaultChecked"in v)continue;zt(s,u,null,d,i)}}for(u in v)d=v[u],u=="children"?p=d:u=="dangerouslySetInnerHTML"?c=d:u=="value"?g=d:u=="checked"?m=d:l&&typeof d!="function"||f[u]===d||zt(s,u,d,f[u],i);if(c)l||h&&(c.__html==h.__html||c.__html==s.innerHTML)||(s.innerHTML=c.__html),e.__k=[];else if(h&&(s.innerHTML=""),Ta(e.type=="template"?s.content:s,Rr(p)?p:[p],e,t,r,b=="foreignObject"?"http://www.w3.org/1999/xhtml":i,n,o,n?n[0]:t.__k&&We(t,0),l,a),n!=null)for(u=n.length;u--;)li(n[u]);l||(u="value",b=="progress"&&g==null?s.removeAttribute("value"):g!=null&&(g!==s[u]||b=="progress"&&!g||b=="option"&&g!=f[u])&&zt(s,u,g,f[u],i),u="checked",m!=null&&m!=s[u]&&zt(s,u,m,f[u],i))}return s}function ci(s,e,t){try{if(typeof s=="function"){var r=typeof s.__u=="function";r&&s.__u(),r&&e==null||(s.__u=s(e))}else s.current=e}catch(i){P.__e(i,t)}}function Fa(s,e,t){var r,i;if(P.unmount&&P.unmount(s),(r=s.ref)&&(r.current&&r.current!=s.__e||ci(r,null,e)),(r=s.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(n){P.__e(n,e)}r.base=r.__P=null}if(r=s.__k)for(i=0;i<r.length;i++)r[i]&&Fa(r[i],e,t||typeof s.type!="function");t||li(s.__e),s.__c=s.__=s.__e=void 0}function $d(s,e,t){return this.constructor(s,t)}function fr(s,e,t){var r,i,n,o;e==document&&(e=document.documentElement),P.__&&P.__(s,e),i=(r=!1)?null:e.__k,n=[],o=[],ui(e,s=e.__k=Ed(ze,null,[s]),i||ut,ut,e.namespaceURI,i?null:e.firstChild?Ir.call(e.childNodes):null,n,i?i.__e:e.firstChild,r,o),Da(n,s,o)}Ir=$a.slice,P={__e:function(s,e,t,r){for(var i,n,o;e=e.__;)if((i=e.__c)&&!i.__)try{if((n=i.constructor)&&n.getDerivedStateFromError!=null&&(i.setState(n.getDerivedStateFromError(s)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(s,r||{}),o=i.__d),o)return i.__E=i}catch(l){s=l}throw s}},Ea=0,Jt.prototype.setState=function(s,e){var t;t=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=pe({},this.state),typeof s=="function"&&(s=s(pe({},t),this.props)),s&&pe(t,s),s!=null&&this.__v&&(e&&this._sb.push(e),bn(this))},Jt.prototype.forceUpdate=function(s){this.__v&&(this.__e=!0,s&&this.__h.push(s),bn(this))},Jt.prototype.render=ze,_e=[],Ma=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Aa=function(s,e){return s.__v.__b-e.__v.__b},hr.__r=0,Oa=/(PointerCapture)$|Capture$/i,ai=0,ks=Sn(!1),Es=Sn(!0);var Nd=0;function w(s,e,t,r,i,n){e||(e={});var o,l,a=e;if("ref"in a)for(l in a={},e)l=="ref"?o=e[l]:a[l]=e[l];var u={type:s,props:a,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Nd,__i:-1,__u:0,__source:i,__self:n};if(typeof s=="function"&&(o=s.defaultProps))for(l in o)a[l]===void 0&&(a[l]=o[l]);return P.vnode&&P.vnode(u),u}const As="bw-recorder-styles",Td=`
60
+ .bw-recorder-toolbar {
61
+ --bw-cream: #FAF7F2;
62
+ --bw-cream-dim: #F0EBE0;
63
+ --bw-charcoal: #1F1F23;
64
+ --bw-coral: #E64C3C;
65
+ --bw-coral-light: #EF6355;
66
+ --bw-stone-200: #e7e5e4;
67
+ --bw-stone-400: #a8a29e;
68
+ --bw-stone-500: #78716c;
69
+ position: fixed;
70
+ z-index: 2147483647;
71
+ font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
72
+ font-size: 13px;
73
+ line-height: 1;
74
+ box-sizing: border-box;
75
+ }
76
+ .bw-recorder-toolbar * { box-sizing: border-box; }
77
+ .bw-recorder-toolbar.bottom-right { bottom: 16px; right: 16px; }
78
+ .bw-recorder-toolbar.bottom-left { bottom: 16px; left: 16px; }
79
+ .bw-recorder-toolbar.top-right { top: 16px; right: 16px; }
80
+ .bw-recorder-toolbar.top-left { top: 16px; left: 16px; }
81
+ .bw-toolbar-container {
82
+ display: flex;
83
+ align-items: center;
84
+ gap: 2px;
85
+ background: var(--bw-cream);
86
+ border: 1px solid var(--bw-stone-200);
87
+ border-radius: 8px;
88
+ padding: 4px;
89
+ box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
90
+ }
91
+ .bw-toolbar-status {
92
+ display: flex;
93
+ align-items: center;
94
+ gap: 8px;
95
+ padding: 0 12px 0 8px;
96
+ border-right: 1px solid var(--bw-stone-200);
97
+ min-width: 130px;
98
+ }
99
+ .bw-status-indicator {
100
+ width: 8px;
101
+ height: 8px;
102
+ border-radius: 50%;
103
+ background: var(--bw-stone-400);
104
+ flex-shrink: 0;
105
+ }
106
+ .bw-status-indicator.recording {
107
+ background: var(--bw-coral);
108
+ animation: bw-pulse 1.5s ease-in-out infinite;
109
+ }
110
+ .bw-status-indicator.paused { background: var(--bw-stone-500); }
111
+ @keyframes bw-pulse {
112
+ 0%, 100% { opacity: 1; }
113
+ 50% { opacity: 0.5; }
114
+ }
115
+ @keyframes bw-spin {
116
+ 0% { transform: rotate(0deg); }
117
+ 100% { transform: rotate(360deg); }
118
+ }
119
+ .bw-spin {
120
+ animation: bw-spin 1s linear infinite;
121
+ }
122
+ .bw-saving {
123
+ color: var(--bw-stone-500);
124
+ }
125
+ .bw-status-text {
126
+ color: var(--bw-charcoal);
127
+ font-weight: 500;
128
+ font-size: 12px;
129
+ }
130
+ .bw-status-time {
131
+ color: var(--bw-stone-500);
132
+ font-variant-numeric: tabular-nums;
133
+ font-size: 12px;
134
+ min-width: 40px;
135
+ }
136
+ .bw-toolbar-btn {
137
+ display: flex;
138
+ align-items: center;
139
+ justify-content: center;
140
+ width: 32px;
141
+ height: 32px;
142
+ border: none;
143
+ border-radius: 6px;
144
+ background: transparent;
145
+ color: var(--bw-charcoal);
146
+ cursor: pointer;
147
+ transition: all 0.15s ease;
148
+ padding: 0;
149
+ }
150
+ .bw-toolbar-btn:hover { background: var(--bw-cream-dim); }
151
+ .bw-toolbar-btn:active { transform: translateY(1px); }
152
+ .bw-toolbar-btn:disabled { opacity: 0.4; cursor: not-allowed; }
153
+ .bw-toolbar-btn:disabled:hover { background: transparent; }
154
+ .bw-toolbar-btn svg { width: 16px; height: 16px; }
155
+ .bw-toolbar-btn.primary { background: var(--bw-coral); color: white; }
156
+ .bw-toolbar-btn.primary:hover { background: var(--bw-coral-light); }
157
+ .bw-toolbar-btn.stop { color: var(--bw-coral); }
158
+ .bw-toolbar-btn.stop:hover { background: rgba(230, 76, 60, 0.1); }
159
+ .bw-toolbar-divider {
160
+ width: 1px;
161
+ height: 20px;
162
+ background: var(--bw-stone-200);
163
+ margin: 0 4px;
164
+ }
165
+ .bw-toolbar-logo {
166
+ display: flex;
167
+ align-items: center;
168
+ padding: 0 8px 0 4px;
169
+ color: var(--bw-stone-400);
170
+ font-size: 11px;
171
+ font-weight: 600;
172
+ letter-spacing: 0.5px;
173
+ text-transform: lowercase;
174
+ }
175
+ .bw-toolbar-idle {
176
+ display: flex;
177
+ align-items: center;
178
+ gap: 8px;
179
+ padding: 8px 12px;
180
+ background: var(--bw-cream);
181
+ border: 1px solid var(--bw-stone-200);
182
+ border-radius: 8px;
183
+ box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
184
+ cursor: pointer;
185
+ transition: all 0.15s ease;
186
+ }
187
+ .bw-toolbar-idle:hover {
188
+ background: var(--bw-cream-dim);
189
+ box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
190
+ transform: translateY(1px);
191
+ }
192
+ .bw-toolbar-idle .bw-idle-icon {
193
+ width: 10px;
194
+ height: 10px;
195
+ border-radius: 50%;
196
+ background: var(--bw-coral);
197
+ }
198
+ .bw-toolbar-idle .bw-idle-text {
199
+ color: var(--bw-charcoal);
200
+ font-weight: 500;
201
+ font-size: 12px;
202
+ }
203
+ .bw-toolbar-idle .bw-idle-logo {
204
+ color: var(--bw-stone-400);
205
+ font-size: 10px;
206
+ font-weight: 600;
207
+ margin-left: 4px;
208
+ }
209
+ .bw-toolbar-complete {
210
+ display: flex;
211
+ align-items: center;
212
+ gap: 8px;
213
+ padding: 8px 12px;
214
+ background: var(--bw-cream);
215
+ border: 1px solid var(--bw-stone-200);
216
+ border-radius: 8px;
217
+ box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
218
+ }
219
+ .bw-toolbar-complete .bw-complete-icon { color: #2AA9A1; }
220
+ .bw-toolbar-complete .bw-complete-icon svg { width: 16px; height: 16px; }
221
+ .bw-toolbar-complete .bw-complete-text {
222
+ color: var(--bw-charcoal);
223
+ font-weight: 500;
224
+ font-size: 12px;
225
+ }
226
+ .bw-toolbar-complete a {
227
+ color: var(--bw-coral);
228
+ text-decoration: none;
229
+ font-weight: 500;
230
+ }
231
+ .bw-toolbar-complete a:hover { text-decoration: underline; }
232
+ .bw-restart-btn {
233
+ margin-left: 8px;
234
+ padding: 4px 10px;
235
+ background: var(--bw-cream-dim);
236
+ border: 1px solid var(--bw-stone-200);
237
+ border-radius: 4px;
238
+ color: var(--bw-charcoal);
239
+ font-size: 11px;
240
+ font-weight: 500;
241
+ cursor: pointer;
242
+ transition: all 0.15s ease;
243
+ }
244
+ .bw-restart-btn:hover {
245
+ background: var(--bw-stone-200);
246
+ }
247
+ .bw-restart-btn:active {
248
+ transform: translateY(1px);
249
+ }
250
+
251
+ /* Invite Dialog Styles */
252
+ .bw-invite-overlay {
253
+ position: fixed;
254
+ top: 0;
255
+ left: 0;
256
+ right: 0;
257
+ bottom: 0;
258
+ background: rgba(0, 0, 0, 0.6);
259
+ display: flex;
260
+ align-items: center;
261
+ justify-content: center;
262
+ z-index: 2147483646;
263
+ font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
264
+ box-sizing: border-box;
265
+ }
266
+ .bw-invite-overlay * { box-sizing: border-box; }
267
+ .bw-invite-dialog {
268
+ background: white;
269
+ border-radius: 12px;
270
+ padding: 32px;
271
+ width: 100%;
272
+ max-width: 360px;
273
+ box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
274
+ animation: bw-invite-fade-in 0.2s ease-out;
275
+ }
276
+ @keyframes bw-invite-fade-in {
277
+ from { opacity: 0; transform: scale(0.95); }
278
+ to { opacity: 1; transform: scale(1); }
279
+ }
280
+ .bw-invite-logo {
281
+ display: flex;
282
+ justify-content: center;
283
+ margin-bottom: 24px;
284
+ color: var(--bw-coral, #E64C3C);
285
+ }
286
+ .bw-invite-logo svg {
287
+ width: 40px;
288
+ height: 40px;
289
+ }
290
+ .bw-invite-title {
291
+ text-align: center;
292
+ font-size: 24px;
293
+ font-weight: 600;
294
+ color: #1F1F23;
295
+ margin: 0 0 8px 0;
296
+ }
297
+ .bw-invite-subtitle {
298
+ text-align: center;
299
+ font-size: 14px;
300
+ color: #6b7280;
301
+ margin: 0 0 24px 0;
302
+ line-height: 1.5;
303
+ }
304
+ .bw-invite-form {
305
+ display: flex;
306
+ flex-direction: column;
307
+ gap: 12px;
308
+ }
309
+ .bw-invite-field {
310
+ position: relative;
311
+ }
312
+ .bw-invite-input {
313
+ width: 100%;
314
+ padding: 12px 16px;
315
+ font-size: 14px;
316
+ border: 1px solid #e5e7eb;
317
+ border-radius: 8px;
318
+ background: white;
319
+ color: #1F1F23;
320
+ outline: none;
321
+ transition: border-color 0.15s ease, box-shadow 0.15s ease;
322
+ }
323
+ .bw-invite-input:focus {
324
+ border-color: var(--bw-coral, #E64C3C);
325
+ box-shadow: 0 0 0 3px rgba(230, 76, 60, 0.1);
326
+ }
327
+ .bw-invite-input[readonly] {
328
+ background: #f9fafb;
329
+ color: #6b7280;
330
+ cursor: not-allowed;
331
+ }
332
+ .bw-invite-input::placeholder {
333
+ color: #9ca3af;
334
+ }
335
+ .bw-invite-input[type="password"] {
336
+ padding-right: 44px;
337
+ }
338
+ .bw-invite-input[type="text"]:not([readonly]) {
339
+ padding-right: 44px;
340
+ }
341
+ .bw-invite-eye-btn {
342
+ position: absolute;
343
+ right: 8px;
344
+ top: 50%;
345
+ transform: translateY(-50%);
346
+ width: 32px;
347
+ height: 32px;
348
+ display: flex;
349
+ align-items: center;
350
+ justify-content: center;
351
+ background: none;
352
+ border: none;
353
+ cursor: pointer;
354
+ color: #9ca3af;
355
+ border-radius: 4px;
356
+ transition: color 0.15s ease;
357
+ }
358
+ .bw-invite-eye-btn:hover {
359
+ color: #6b7280;
360
+ }
361
+ .bw-invite-eye-btn svg {
362
+ width: 18px;
363
+ height: 18px;
364
+ }
365
+ .bw-invite-submit {
366
+ display: flex;
367
+ align-items: center;
368
+ justify-content: center;
369
+ gap: 8px;
370
+ width: 100%;
371
+ padding: 12px 16px;
372
+ font-size: 14px;
373
+ font-weight: 500;
374
+ color: white;
375
+ background: #10b981;
376
+ border: none;
377
+ border-radius: 8px;
378
+ cursor: pointer;
379
+ transition: background 0.15s ease;
380
+ margin-top: 4px;
381
+ }
382
+ .bw-invite-submit:hover:not(:disabled) {
383
+ background: #059669;
384
+ }
385
+ .bw-invite-submit:disabled {
386
+ opacity: 0.6;
387
+ cursor: not-allowed;
388
+ }
389
+ .bw-invite-submit svg {
390
+ width: 16px;
391
+ height: 16px;
392
+ }
393
+ @keyframes bw-invite-spin {
394
+ from { transform: rotate(0deg); }
395
+ to { transform: rotate(360deg); }
396
+ }
397
+ .bw-invite-spin {
398
+ animation: bw-invite-spin 1s linear infinite;
399
+ }
400
+ .bw-invite-login-text {
401
+ text-align: center;
402
+ font-size: 13px;
403
+ color: #6b7280;
404
+ margin: 20px 0 0 0;
405
+ }
406
+ .bw-invite-login-link {
407
+ color: #10b981;
408
+ text-decoration: none;
409
+ font-weight: 500;
410
+ }
411
+ .bw-invite-login-link:hover {
412
+ text-decoration: underline;
413
+ }
414
+ .bw-invite-success {
415
+ display: flex;
416
+ flex-direction: column;
417
+ align-items: center;
418
+ padding: 16px 0;
419
+ animation: bw-invite-fade-in 0.3s ease-out;
420
+ }
421
+ .bw-invite-success-icon {
422
+ color: #10b981;
423
+ margin-bottom: 16px;
424
+ }
425
+ .bw-invite-success-icon svg {
426
+ width: 48px;
427
+ height: 48px;
428
+ }
429
+ .bw-invite-success-title {
430
+ font-size: 20px;
431
+ font-weight: 600;
432
+ color: #1F1F23;
433
+ margin: 0 0 4px 0;
434
+ }
435
+ .bw-invite-success-text {
436
+ font-size: 14px;
437
+ color: #6b7280;
438
+ margin: 0;
439
+ }
440
+ `;let Xt=!1;function Ua(){if(Xt||typeof document>"u")return;if(document.getElementById(As)){Xt=!0;return}const s=document.createElement("style");s.id=As,s.textContent=Td,document.head.appendChild(s),Xt=!0}function Pd(){const s=document.getElementById(As);s&&(s.remove(),Xt=!1)}const Dd=()=>w("svg",{viewBox:"0 0 24 24",fill:"currentColor",stroke:"none",children:w("path",{d:"M8 5v14l11-7z"})}),Ld=()=>w("svg",{viewBox:"0 0 24 24",fill:"currentColor",stroke:"none",children:w("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"})}),Fd=()=>w("svg",{viewBox:"0 0 24 24",fill:"currentColor",stroke:"none",children:w("path",{d:"M6 6h12v12H6z"})}),Ud=()=>w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:[w("path",{d:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"}),w("circle",{cx:"12",cy:"13",r:"4"})]}),Bd=()=>w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:w("path",{d:"M20 6L9 17l-5-5"})}),zd=()=>w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",class:"bw-spin",children:w("path",{d:"M12 2v4m0 12v4m10-10h-4M6 12H2m15.07-5.07l-2.83 2.83M9.76 14.24l-2.83 2.83m11.14 0l-2.83-2.83M9.76 9.76L6.93 6.93"})});function Wd(s){const e=Math.floor(s/1e3),t=Math.floor(e/60),r=e%60;return`${t.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`}function Hd({position:s,state:e,elapsedTime:t,result:r,onStart:i,onPause:n,onResume:o,onStop:l,onScreenshot:a,onRestart:u}){if(e==="idle")return w("div",{class:`bw-recorder-toolbar ${s}`,"data-bw-recorder-ui":!0,children:w("button",{class:"bw-toolbar-idle",onClick:i,type:"button",children:[w("span",{class:"bw-idle-icon"}),w("span",{class:"bw-idle-text",children:"Start Recording"}),w("span",{class:"bw-idle-logo",children:"bw"})]})});if(e==="stopped"&&r)return w("div",{class:`bw-recorder-toolbar ${s}`,"data-bw-recorder-ui":!0,children:w("div",{class:"bw-toolbar-complete",children:[w("span",{class:"bw-complete-icon",children:w(Bd,{})}),w("span",{class:"bw-complete-text",children:["Recording saved!"," ",w("a",{href:r.playbackUrl,target:"_blank",rel:"noopener noreferrer",children:"View"})]}),w("button",{class:"bw-restart-btn",onClick:u,type:"button",title:"Start new recording",children:"New"})]})});if(e==="stopped")return w("div",{class:`bw-recorder-toolbar ${s}`,"data-bw-recorder-ui":!0,children:w("div",{class:"bw-toolbar-complete",children:[w("span",{class:"bw-complete-icon bw-saving",children:w(zd,{})}),w("span",{class:"bw-complete-text",children:"Saving..."})]})});const c=e==="recording",h=e==="paused";return w("div",{class:`bw-recorder-toolbar ${s}`,"data-bw-recorder-ui":!0,children:w("div",{class:"bw-toolbar-container",children:[w("div",{class:"bw-toolbar-status",children:[w("span",{class:`bw-status-indicator ${c?"recording":""} ${h?"paused":""}`}),w("span",{class:"bw-status-text",children:c?"Recording":"Paused"}),w("span",{class:"bw-status-time",children:Wd(t)})]}),w("button",{class:"bw-toolbar-btn",onClick:c?n:o,title:c?"Pause":"Resume",type:"button",children:c?w(Ld,{}):w(Dd,{})}),w("button",{class:"bw-toolbar-btn stop",onClick:l,title:"Stop Recording",type:"button",children:w(Fd,{})}),w("div",{class:"bw-toolbar-divider"}),w("button",{class:"bw-toolbar-btn",onClick:a,title:"Take Screenshot",disabled:!c,type:"button",children:w(Ud,{})}),w("div",{class:"bw-toolbar-divider"}),w("span",{class:"bw-toolbar-logo",children:"bw"})]})})}class jd{constructor(e="bottom-right"){this.container=null,this.state="idle",this.elapsedTime=0,this.result=null,this.updateInterval=null,this.getElapsedTime=null,this.onStartCallback=null,this.onPauseCallback=null,this.onResumeCallback=null,this.onStopCallback=null,this.onScreenshotCallback=null,this.onRestartCallback=null,this.position=e}mount(){this.container||(Ua(),this.container=document.createElement("div"),this.container.id="bw-recorder-root",this.container.setAttribute("data-bw-recorder-ui",""),document.body.appendChild(this.container),this.render())}unmount(){this.updateInterval&&(clearInterval(this.updateInterval),this.updateInterval=null),this.container&&(fr(null,this.container),this.container.remove(),this.container=null),Pd()}setCallbacks(e){this.onStartCallback=e.onStart??null,this.onPauseCallback=e.onPause??null,this.onResumeCallback=e.onResume??null,this.onStopCallback=e.onStop??null,this.onScreenshotCallback=e.onScreenshot??null,this.onRestartCallback=e.onRestart??null,this.getElapsedTime=e.getElapsedTime??null}setState(e){this.state=e,e==="recording"?this.startTimeUpdates():(e==="stopped"||e==="idle")&&this.stopTimeUpdates(),this.render()}setResult(e){this.result=e,this.render()}reset(){this.state="idle",this.result=null,this.elapsedTime=0,this.render()}startTimeUpdates(){this.updateInterval||(this.updateInterval=setInterval(()=>{this.getElapsedTime&&(this.elapsedTime=this.getElapsedTime(),this.render())},100))}stopTimeUpdates(){this.updateInterval&&(clearInterval(this.updateInterval),this.updateInterval=null)}render(){this.container&&fr(w(Hd,{position:this.position,state:this.state,elapsedTime:this.elapsedTime,result:this.result,onStart:()=>{var e;return(e=this.onStartCallback)==null?void 0:e.call(this)},onPause:()=>{var e;return(e=this.onPauseCallback)==null?void 0:e.call(this)},onResume:()=>{var e;return(e=this.onResumeCallback)==null?void 0:e.call(this)},onStop:()=>{var e;return(e=this.onStopCallback)==null?void 0:e.call(this)},onScreenshot:()=>{var e;return(e=this.onScreenshotCallback)==null?void 0:e.call(this)},onRestart:()=>{var e;return(e=this.onRestartCallback)==null?void 0:e.call(this)}}),this.container)}}var Os,Z,Gr,Cn,$s=0,Ba=[],X=P,_n=X.__b,xn=X.__r,In=X.diffed,Rn=X.__c,kn=X.unmount,En=X.__;function Gd(s,e){X.__h&&X.__h(Z,s,$s||e),$s=0;var t=Z.__H||(Z.__H={__:[],__h:[]});return s>=t.__.length&&t.__.push({}),t.__[s]}function Vr(s){return $s=1,Vd(za,s)}function Vd(s,e,t){var r=Gd(Os++,2);if(r.t=s,!r.__c&&(r.__=[za(void 0,e),function(l){var a=r.__N?r.__N[0]:r.__[0],u=r.t(a,l);a!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=Z,!Z.__f)){var i=function(l,a,u){if(!r.__c.__H)return!0;var c=r.__c.__H.__.filter(function(p){return!!p.__c});if(c.every(function(p){return!p.__N}))return!n||n.call(this,l,a,u);var h=r.__c.props!==l;return c.forEach(function(p){if(p.__N){var d=p.__[0];p.__=p.__N,p.__N=void 0,d!==p.__[0]&&(h=!0)}}),n&&n.call(this,l,a,u)||h};Z.__f=!0;var n=Z.shouldComponentUpdate,o=Z.componentWillUpdate;Z.componentWillUpdate=function(l,a,u){if(this.__e){var c=n;n=void 0,i(l,a,u),n=c}o&&o.call(this,l,a,u)},Z.shouldComponentUpdate=i}return r.__N||r.__}function Yd(){for(var s;s=Ba.shift();)if(s.__P&&s.__H)try{s.__H.__h.forEach(Kt),s.__H.__h.forEach(Ns),s.__H.__h=[]}catch(e){s.__H.__h=[],X.__e(e,s.__v)}}X.__b=function(s){Z=null,_n&&_n(s)},X.__=function(s,e){s&&e.__k&&e.__k.__m&&(s.__m=e.__k.__m),En&&En(s,e)},X.__r=function(s){xn&&xn(s),Os=0;var e=(Z=s.__c).__H;e&&(Gr===Z?(e.__h=[],Z.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.forEach(Kt),e.__h.forEach(Ns),e.__h=[],Os=0)),Gr=Z},X.diffed=function(s){In&&In(s);var e=s.__c;e&&e.__H&&(e.__H.__h.length&&(Ba.push(e)!==1&&Cn===X.requestAnimationFrame||((Cn=X.requestAnimationFrame)||Zd)(Yd)),e.__H.__.forEach(function(t){t.u&&(t.__H=t.u),t.u=void 0})),Gr=Z=null},X.__c=function(s,e){e.some(function(t){try{t.__h.forEach(Kt),t.__h=t.__h.filter(function(r){return!r.__||Ns(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],X.__e(r,t.__v)}}),Rn&&Rn(s,e)},X.unmount=function(s){kn&&kn(s);var e,t=s.__c;t&&t.__H&&(t.__H.__.forEach(function(r){try{Kt(r)}catch(i){e=i}}),t.__H=void 0,e&&X.__e(e,t.__v))};var Mn=typeof requestAnimationFrame=="function";function Zd(s){var e,t=function(){clearTimeout(r),Mn&&cancelAnimationFrame(e),setTimeout(s)},r=setTimeout(t,35);Mn&&(e=requestAnimationFrame(t))}function Kt(s){var e=Z,t=s.__c;typeof t=="function"&&(s.__c=void 0,t()),Z=e}function Ns(s){var e=Z;s.__c=s.__(),Z=e}function za(s,e){return typeof e=="function"?e(s):e}const dr="bw_invite_completed",Jd=()=>w("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[w("path",{d:"m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9"}),w("path",{d:"m18 15 4-4"}),w("path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5"})]}),Xd=()=>w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[w("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),w("circle",{cx:"12",cy:"12",r:"3"})]}),Kd=()=>w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[w("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),w("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}),Qd=()=>w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[w("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),w("polyline",{points:"22 4 12 14.01 9 11.01"})]}),qd=()=>w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",class:"bw-invite-spin",children:w("path",{d:"M12 2v4m0 12v4m10-10h-4M6 12H2m15.07-5.07l-2.83 2.83M9.76 14.24l-2.83 2.83m11.14 0l-2.83-2.83M9.76 9.76L6.93 6.93"})});function ep({email:s,onComplete:e,onLogin:t}){const[r,i]=Vr("form"),[n,o]=Vr(""),[l,a]=Vr(!1),u=h=>{h.preventDefault(),n.trim()&&(i("loading"),setTimeout(()=>{i("success"),localStorage.setItem(dr,JSON.stringify({email:s,timestamp:Date.now()})),setTimeout(()=>{e()},1500)},1200))},c=h=>{h.preventDefault(),localStorage.setItem(dr,JSON.stringify({email:s,timestamp:Date.now()})),t()};return w("div",{class:"bw-invite-overlay","data-bw-launchkit-ui":!0,children:w("div",{class:"bw-invite-dialog",children:r==="success"?w("div",{class:"bw-invite-success",children:[w("div",{class:"bw-invite-success-icon",children:w(Qd,{})}),w("h2",{class:"bw-invite-success-title",children:"You're in!"}),w("p",{class:"bw-invite-success-text",children:"Welcome aboard."})]}):w(ze,{children:[w("div",{class:"bw-invite-logo",children:w(Jd,{})}),w("h2",{class:"bw-invite-title",children:"Welcome"}),w("p",{class:"bw-invite-subtitle",children:"You've been invited. Set a password to continue."}),w("form",{class:"bw-invite-form",onSubmit:u,children:[w("div",{class:"bw-invite-field",children:w("input",{type:"email",value:s,readonly:!0,class:"bw-invite-input",placeholder:"Email address"})}),w("div",{class:"bw-invite-field",children:[w("input",{type:l?"text":"password",value:n,onInput:h=>o(h.target.value),class:"bw-invite-input",placeholder:"Password",disabled:r==="loading",autoFocus:!0}),w("button",{type:"button",class:"bw-invite-eye-btn",onClick:()=>a(!l),tabIndex:-1,children:l?w(Kd,{}):w(Xd,{})})]}),w("button",{type:"submit",class:"bw-invite-submit",disabled:r==="loading"||!n.trim(),children:r==="loading"?w(ze,{children:[w(qd,{}),w("span",{children:"Setting up..."})]}):"Continue"})]}),w("p",{class:"bw-invite-login-text",children:["Already have an account?"," ",w("a",{href:"#",onClick:c,class:"bw-invite-login-link",children:"Log in"})]})]})})})}class Ts{constructor(e){this.container=null,this.onCompleteCallback=null,this.handleComplete=()=>{var t;this.unmount(),(t=this.onCompleteCallback)==null||t.call(this)},this.handleLogin=()=>{var t;this.unmount(),(t=this.onCompleteCallback)==null||t.call(this)},this.email=e}static isCompleted(){return typeof localStorage>"u"?!1:localStorage.getItem(dr)!==null}static clearCompletion(){typeof localStorage>"u"||localStorage.removeItem(dr)}mount(){this.container||(Ua(),this.container=document.createElement("div"),this.container.id="bw-invite-root",this.container.setAttribute("data-bw-launchkit-ui",""),document.body.appendChild(this.container),this.render())}unmount(){this.container&&(fr(null,this.container),this.container.remove(),this.container=null)}onComplete(e){this.onCompleteCallback=e}render(){this.container&&fr(w(ep,{email:this.email,onComplete:this.handleComplete,onLogin:this.handleLogin}),this.container)}}class hi{constructor(e){this.toolbar=null,this.isInitialized=!1;const t=e.onStateChange;this.config={apiEndpoint:"https://api.bworlds.com",maxDuration:900*1e3,maskInputs:!0,autoOpenPlayback:!0,toolbar:{enabled:!0,position:"bottom-right"},...e,onStateChange:n=>{this.handleStateChange(n),t==null||t(n)}},this.recorder=new Cd(this.config),this.screenshotMarker=new _d,this.eventDetector=new xd(this.screenshotMarker);const i=this.config.apiEndpoint&&this.config.apiEndpoint!=="https://api.bworlds.com"?new Rd(this.config.apiEndpoint,this.config.apiKey):new Id;this.recorder.setUploader(i),this.recorder.onEvent(n=>{this.eventDetector.handleRrwebEvent(n)})}init(){var e,t;if(!this.isInitialized&&(this.isInitialized=!0,((e=this.config.toolbar)==null?void 0:e.enabled)!==!1)){const r=((t=this.config.toolbar)==null?void 0:t.position)??"bottom-right";this.toolbar=new jd(r),this.toolbar.setCallbacks({onStart:()=>this.start(),onPause:()=>this.pause(),onResume:()=>this.resume(),onStop:()=>this.stop(),onScreenshot:()=>this.screenshot(),onRestart:()=>this.restart(),getElapsedTime:()=>this.recorder.getElapsedTime()}),this.toolbar.mount()}}async start(){var e;await this.recorder.start(),this.screenshotMarker.setStartTime(Date.now()),this.eventDetector.start(),(e=this.toolbar)==null||e.setState("recording")}pause(){var e;this.recorder.pause(),(e=this.toolbar)==null||e.setState("paused")}resume(){var e;this.recorder.resume(),(e=this.toolbar)==null||e.setState("recording")}async stop(){var n,o,l;this.eventDetector.stop(),this.screenshotMarker.stop();const e=this.screenshotMarker.getMarkers(),t=await this.recorder.stop(e);if((n=this.toolbar)==null||n.setState("stopped"),t)return(o=this.toolbar)==null||o.setResult(t),this.config.autoOpenPlayback!==!1&&t.playbackUrl&&window.open(t.playbackUrl,"_blank"),t;const r=this.recorder.getEvents(),i={recordingId:`rec_${Date.now()}`,playbackUrl:"",duration:this.recorder.getElapsedTime(),eventCount:r.length,screenshotCount:e.length};return(l=this.toolbar)==null||l.setResult(i),i}screenshot(){this.screenshotMarker.capture("manual")}restart(){var e;this.eventDetector.destroy(),this.recorder.reset(),this.screenshotMarker.reset(),(e=this.toolbar)==null||e.reset()}getState(){return this.recorder.getState()}getElapsedTime(){return this.recorder.getElapsedTime()}destroy(){var e;this.eventDetector.destroy(),this.recorder.reset(),this.screenshotMarker.reset(),(e=this.toolbar)==null||e.unmount(),this.isInitialized=!1}handleStateChange(e){var t;(t=this.toolbar)==null||t.setState(e)}}const tp="_bw_record",rp="_bw_invite";function sp(){return typeof window>"u"?null:new URLSearchParams(window.location.search).get(tp)}function ip(){return typeof window>"u"?null:new URLSearchParams(window.location.search).get(rp)}function np(){const s=sp(),e=ip();document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{e&&An(e),s&&On(s)}):(e&&An(e),s&&On(s))}function An(s){if(Ts.isCompleted()){console.log("[BWorlds LaunchKit] Invite already completed");return}console.log("[BWorlds LaunchKit] Showing invite dialog for:",s);const e=new Ts(s);e.onComplete(()=>{console.log("[BWorlds LaunchKit] Invite flow completed")}),e.mount(),typeof window<"u"&&(window.__bwInviteDialog=e)}function On(s){const t=new URLSearchParams(window.location.search).get("_bw_api")||"http://localhost:3941";console.log("[BWorlds Recorder] Initializing with endpoint:",t);const r=new hi({apiKey:s,apiEndpoint:t,onComplete:i=>{console.log("[BWorlds Recorder] Recording complete:",i.playbackUrl)},onError:i=>{console.error("[BWorlds Recorder] Error:",i)}});r.init(),typeof window<"u"&&(window.__bwRecorder=r)}np();exports.DemoRecorder=hi;exports.InviteDialogController=Ts;exports.default=hi;
441
+ //# sourceMappingURL=launchkit.cjs.map