@statsig/js-client 3.24.4 → 3.25.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,8 +1 @@
|
|
|
1
|
-
var $Q=(e)=>Object.defineProperty(e,"__esModule",{value:!0});var $Q2=(a,b,c)=>Object.defineProperty(a,b,c);var $P=(a,b)=>Object.assign(a,b);var $A=()=>((t,r,u,l)=>{return new(u=u||Promise)(function(n,e){function i(t){try{s(l.next(t))}catch(t){e(t)}}function o(t){try{s(l.throw(t))}catch(t){e(t)}}function s(t){var e;t.done?n(t.value):((e=t.value)instanceof u?e:new u(function(t){t(e)})).then(i,o)}s((l=l.apply(t,r||[])).next())})});var rrwebRecord=function(){"use strict";var N;(function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"})(N||(N={}));function Bt(e){return e.nodeType===e.ELEMENT_NODE}function ce(e){const t=e?.host;return Boolean(t?.shadowRoot===e)}function de(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function Vt(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function Ht(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function ye(e){try{const t=e.rules||e.cssRules;return t?Vt(Array.from(t,He).join("")):null}catch{return null}}function He(e){let t;if(qt(e))try{t=ye(e.styleSheet)||Ht(e)}catch{}else if(Xt(e)&&e.selectorText.includes(":"))return Gt(e.cssText);return t||e.cssText}function Gt(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function qt(e){return"styleSheet"in e}function Xt(e){return"selectorText"in e}class Ge{constructor(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}getId(t){var r;if(!t)return-1;const n=(r=this.getMeta(t))===null||r===void 0?void 0:r.id;return n??-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(n=>this.removeNodeFromMap(n))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){const n=r.id;this.idNodeMap.set(n,t),this.nodeMetaMap.set(t,r)}replace(t,r){const n=this.getNode(t);if(n){const o=this.nodeMetaMap.get(n);o&&this.nodeMetaMap.set(r,o)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Yt(){return new Ge}function De({element:e,maskInputOptions:t,tagName:r,type:n,value:o,maskInputFn:a}){let l=o||"";const i=n&&K(n);return(t[r.toLowerCase()]||i&&t[i])&&(a?l=a(l,e):l="*".repeat(l.length)),l}function K(e){return e.toLowerCase()}const qe="__rrweb_original__";function Jt(e){const t=e.getContext("2d");if(!t)return!0;const r=50;for(let n=0;n<e.width;n+=r)for(let o=0;o<e.height;o+=r){const a=t.getImageData,l=qe in a?a[qe]:a;if(new Uint32Array(l.call(t,n,o,Math.min(r,e.width-n),Math.min(r,e.height-o)).data.buffer).some(i=>i!==0))return!1}return!0}function Ae(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?K(t):null}function Xe(e,t){var r;let n;try{n=new URL(e,t??window.location.href)}catch{return null}const o=/\.([0-9a-z]+)(?:$)/i,a=n.pathname.match(o);return(r=a?.[1])!==null&&r!==void 0?r:null}let Kt=1;const Qt=new RegExp("[^a-z0-9-_:]"),ue=-2;function Ye(){return Kt++}function Zt(e){if(e instanceof HTMLFormElement)return"form";const t=K(e.tagName);return Qt.test(t)?"div":t}function er(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}let re,Je;const tr=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,rr=/^(?:[a-z+]+:)?\/\//i,nr=/^www\..*/i,or=/^(data:)([^,]*),(.*)/i;function ge(e,t){return(e||"").replace(tr,(r,n,o,a,l,i)=>{const s=o||l||i,c=n||a||"";if(!s)return r;if(rr.test(s)||nr.test(s))return`url(${c}${s}${c})`;if(or.test(s))return`url(${c}${s}${c})`;if(s[0]==="/")return`url(${c}${er(t)+s}${c})`;const d=t.split("/"),p=s.split("/");d.pop();for(const h of p)h!=="."&&(h===".."?d.pop():d.push(h));return`url(${c}${d.join("/")}${c})`})}const sr=/^[^ \t\n\r\u000c]+/,ar=/^[, \t\n\r\u000c]+/;function ir(e,t){if(t.trim()==="")return t;let r=0;function n(a){let l;const i=a.exec(t.substring(r));return i?(l=i[0],r+=l.length,l):""}const o=[];for(;n(ar),!(r>=t.length);){let a=n(sr);if(a.slice(-1)===",")a=Se(e,a.substring(0,a.length-1)),o.push(a);else{let l="";a=Se(e,a);let i=!1;for(;;){const s=t.charAt(r);if(s===""){o.push((a+l).trim());break}else if(i)s===")"&&(i=!1);else if(s===","){r+=1,o.push((a+l).trim());break}else s==="("&&(i=!0);l+=s,r+=1}}}return o.join(", ")}const Ke=new WeakMap;function Se(e,t){return!t||t.trim()===""?t:be(e,t)}function lr(e){return Boolean(e.tagName==="svg"||e.ownerSVGElement)}function be(e,t){let r=Ke.get(e);if(r||(r=e.createElement("a"),Ke.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function Qe(e,t,r,n){return n&&(r==="src"||r==="href"&&!(t==="use"&&n[0]==="#")||r==="xlink:href"&&n[0]!=="#"||r==="background"&&(t==="table"||t==="td"||t==="th")?Se(e,n):r==="srcset"?ir(e,n):r==="style"?ge(n,be(e)):t==="object"&&r==="data"?Se(e,n):n)}function Ze(e,t,r){return(e==="video"||e==="audio")&&t==="autoplay"}function cr(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const o=e.classList[n];if(t.test(o))return!0}if(r)return e.matches(r)}catch{}return!1}function ve(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?ve(e.parentNode,t,r):!1;for(let n=e.classList.length;n--;){const o=e.classList[n];if(t.test(o))return!0}return r?ve(e.parentNode,t,r):!1}function et(e,t,r,n){try{const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(o===null)return!1;if(typeof t=="string"){if(n){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(ve(o,t,n))return!0;if(r){if(n){if(o.closest(r))return!0}else if(o.matches(r))return!0}}catch{}return!1}function dr(e,t,r){const n=e.contentWindow;if(!n)return;let o=!1,a;try{a=n.document.readyState}catch{return}if(a!=="complete"){const i=setTimeout(()=>{o||(t(),o=!0)},r);e.addEventListener("load",()=>{clearTimeout(i),o=!0,t()});return}const l="about:blank";if(n.location.href!==l||e.src===l||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function ur(e,t,r){let n=!1,o;try{o=e.sheet}catch{return}if(o)return;const a=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(a),n=!0,t()})}function pr(e,t){const{doc:r,mirror:n,blockClass:o,blockSelector:a,needsMask:l,inlineStylesheet:i,maskInputOptions:s={},maskTextFn:c,maskInputFn:d,dataURLOptions:p={},inlineImages:h,recordCanvas:m,keepIframeSrcFn:f,newlyAddedElement:u=!1}=t,y=hr(r,n);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:N.Document,childNodes:[],compatMode:e.compatMode}:{type:N.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:N.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return fr(e,{doc:r,blockClass:o,blockSelector:a,inlineStylesheet:i,maskInputOptions:s,maskInputFn:d,dataURLOptions:p,inlineImages:h,recordCanvas:m,keepIframeSrcFn:f,newlyAddedElement:u,rootId:y});case e.TEXT_NODE:return mr(e,{doc:r,needsMask:l,maskTextFn:c,rootId:y});case e.CDATA_SECTION_NODE:return{type:N.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:N.Comment,textContent:e.textContent||"",rootId:y};default:return!1}}function hr(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return r===1?void 0:r}function mr(e,t){var r;const{needsMask:n,maskTextFn:o,rootId:a}=t,l=e.parentNode&&e.parentNode.tagName;let i=e.textContent;const s=l==="STYLE"?!0:void 0,c=l==="SCRIPT"?!0:void 0;if(s&&i){try{e.nextSibling||e.previousSibling||!((r=e.parentNode.sheet)===null||r===void 0)&&r.cssRules&&(i=ye(e.parentNode.sheet))}catch(d){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${d}`,e)}i=ge(i,be(t.doc))}return c&&(i="SCRIPT_PLACEHOLDER"),!s&&!c&&i&&n&&(i=o?o(i,e.parentElement):i.replace(/[\S]/g,"*")),{type:N.Text,textContent:i||"",isStyle:s,rootId:a}}function fr(e,t){const{doc:r,blockClass:n,blockSelector:o,inlineStylesheet:a,maskInputOptions:l={},maskInputFn:i,dataURLOptions:s={},inlineImages:c,recordCanvas:d,keepIframeSrcFn:p,newlyAddedElement:h=!1,rootId:m}=t,f=cr(e,n,o),u=Zt(e);let y={};const S=e.attributes.length;for(let g=0;g<S;g++){const v=e.attributes[g];Ze(u,v.name,v.value)||(y[v.name]=Qe(r,u,K(v.name),v.value))}if(u==="link"&&a){const g=Array.from(r.styleSheets).find(R=>R.href===e.href);let v=null;g&&(v=ye(g)),v&&(delete y.rel,delete y.href,y._cssText=ge(v,g.href))}if(u==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const g=ye(e.sheet);g&&(y._cssText=ge(g,be(r)))}if(u==="input"||u==="textarea"||u==="select"){const g=e.value,v=e.checked;y.type!=="radio"&&y.type!=="checkbox"&&y.type!=="submit"&&y.type!=="button"&&g?y.value=De({element:e,type:Ae(e),tagName:u,value:g,maskInputOptions:l,maskInputFn:i}):v&&(y.checked=v)}if(u==="option"&&(e.selected&&!l.select?y.selected=!0:delete y.selected),u==="canvas"&&d){if(e.__context==="2d")Jt(e)||(y.rr_dataURL=e.toDataURL(s.type,s.quality));else if(!("__context"in e)){const g=e.toDataURL(s.type,s.quality),v=document.createElement("canvas");v.width=e.width,v.height=e.height;const R=v.toDataURL(s.type,s.quality);g!==R&&(y.rr_dataURL=g)}}if(u==="img"&&c){re||(re=r.createElement("canvas"),Je=re.getContext("2d"));const g=e,v=g.crossOrigin;g.crossOrigin="anonymous";const R=()=>{g.removeEventListener("load",R);try{re.width=g.naturalWidth,re.height=g.naturalHeight,Je.drawImage(g,0,0),y.rr_dataURL=re.toDataURL(s.type,s.quality)}catch(D){console.warn(`Cannot inline img src=${g.currentSrc}! Error: ${D}`)}v?y.crossOrigin=v:g.removeAttribute("crossorigin")};g.complete&&g.naturalWidth!==0?R():g.addEventListener("load",R)}if(u==="audio"||u==="video"){const g=y;g.rr_mediaState=e.paused?"paused":"played",g.rr_mediaCurrentTime=e.currentTime,g.rr_mediaPlaybackRate=e.playbackRate,g.rr_mediaMuted=e.muted,g.rr_mediaLoop=e.loop,g.rr_mediaVolume=e.volume}if(h||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),f){const{width:g,height:v}=e.getBoundingClientRect();y={class:y.class,rr_width:`${g}px`,rr_height:`${v}px`}}u==="iframe"&&!p(y.src)&&(e.contentDocument||(y.rr_src=y.src),delete y.src);let b;try{customElements.get(u)&&(b=!0)}catch{}return{type:N.Element,tagName:u,attributes:y,childNodes:[],isSVG:lr(e)||void 0,needBlock:f,rootId:m,isCustom:b}}function T(e){return e==null?"":e.toLowerCase()}function yr(e,t){return!!(t.comment&&e.type===N.Comment||e.type===N.Element&&(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")&&e.attributes.as==="script"||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&Xe(e.attributes.href)==="js")||t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(T(e.attributes.name).match(/^msapplication-tile(image|color)$/)||T(e.attributes.name)==="application-name"||T(e.attributes.rel)==="icon"||T(e.attributes.rel)==="apple-touch-icon"||T(e.attributes.rel)==="shortcut icon"))||e.tagName==="meta"&&(t.headMetaDescKeywords&&T(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(T(e.attributes.property).match(/^(og|twitter|fb):/)||T(e.attributes.name).match(/^(og|twitter):/)||T(e.attributes.name)==="pinterest")||t.headMetaRobots&&(T(e.attributes.name)==="robots"||T(e.attributes.name)==="googlebot"||T(e.attributes.name)==="bingbot")||t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0||t.headMetaAuthorship&&(T(e.attributes.name)==="author"||T(e.attributes.name)==="generator"||T(e.attributes.name)==="framework"||T(e.attributes.name)==="publisher"||T(e.attributes.name)==="progid"||T(e.attributes.property).match(/^article:/)||T(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(T(e.attributes.name)==="google-site-verification"||T(e.attributes.name)==="yandex-verification"||T(e.attributes.name)==="csrf-token"||T(e.attributes.name)==="p:domain_verify"||T(e.attributes.name)==="verify-v1"||T(e.attributes.name)==="verification"||T(e.attributes.name)==="shopify-checkout-api-token"))))}function ne(e,t){const{doc:r,mirror:n,blockClass:o,blockSelector:a,maskTextClass:l,maskTextSelector:i,skipChild:s=!1,inlineStylesheet:c=!0,maskInputOptions:d={},maskTextFn:p,maskInputFn:h,slimDOMOptions:m,dataURLOptions:f={},inlineImages:u=!1,recordCanvas:y=!1,onSerialize:S,onIframeLoad:b,iframeLoadTimeout:g=5e3,onStylesheetLoad:v,stylesheetLoadTimeout:R=5e3,keepIframeSrcFn:D=()=>!1,newlyAddedElement:V=!1}=t;let{needsMask:W}=t,{preserveWhiteSpace:j=!0}=t;!W&&e.childNodes&&(W=et(e,l,i,W===void 0));const z=pr(e,{doc:r,mirror:n,blockClass:o,blockSelector:a,needsMask:W,inlineStylesheet:c,maskInputOptions:d,maskTextFn:p,maskInputFn:h,dataURLOptions:f,inlineImages:u,recordCanvas:y,keepIframeSrcFn:D,newlyAddedElement:V});if(!z)return console.warn(e,"not serialized"),null;let X;n.hasNode(e)?X=n.getId(e):yr(z,m)||!j&&z.type===N.Text&&!z.isStyle&&!z.textContent.replace(/^\s+|\s+$/gm,"").length?X=ue:X=Ye();const C=Object.assign(z,{id:X});if(n.add(e,C),X===ue)return null;S&&S(e);let Z=!s;if(C.type===N.Element){Z=Z&&!C.needBlock,delete C.needBlock;const P=e.shadowRoot;P&&de(P)&&(C.isShadowHost=!0)}if((C.type===N.Document||C.type===N.Element)&&Z){m.headWhitespace&&C.type===N.Element&&C.tagName==="head"&&(j=!1);const P={doc:r,mirror:n,blockClass:o,blockSelector:a,needsMask:W,maskTextClass:l,maskTextSelector:i,skipChild:s,inlineStylesheet:c,maskInputOptions:d,maskTextFn:p,maskInputFn:h,slimDOMOptions:m,dataURLOptions:f,inlineImages:u,recordCanvas:y,preserveWhiteSpace:j,onSerialize:S,onIframeLoad:b,iframeLoadTimeout:g,onStylesheetLoad:v,stylesheetLoadTimeout:R,keepIframeSrcFn:D};if(!(C.type===N.Element&&C.tagName==="textarea"&&C.attributes.value!==void 0))for(const J of Array.from(e.childNodes)){const H=ne(J,P);H&&C.childNodes.push(H)}if(Bt(e)&&e.shadowRoot)for(const J of Array.from(e.shadowRoot.childNodes)){const H=ne(J,P);H&&(de(e.shadowRoot)&&(H.isShadow=!0),C.childNodes.push(H))}}return e.parentNode&&ce(e.parentNode)&&de(e.parentNode)&&(C.isShadow=!0),C.type===N.Element&&C.tagName==="iframe"&&dr(e,()=>{const P=e.contentDocument;if(P&&b){const J=ne(P,{doc:P,mirror:n,blockClass:o,blockSelector:a,needsMask:W,maskTextClass:l,maskTextSelector:i,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:p,maskInputFn:h,slimDOMOptions:m,dataURLOptions:f,inlineImages:u,recordCanvas:y,preserveWhiteSpace:j,onSerialize:S,onIframeLoad:b,iframeLoadTimeout:g,onStylesheetLoad:v,stylesheetLoadTimeout:R,keepIframeSrcFn:D});J&&b(e,J)}},g),C.type===N.Element&&C.tagName==="link"&&typeof C.attributes.rel=="string"&&(C.attributes.rel==="stylesheet"||C.attributes.rel==="preload"&&typeof C.attributes.href=="string"&&Xe(C.attributes.href)==="css")&&ur(e,()=>{if(v){const P=ne(e,{doc:r,mirror:n,blockClass:o,blockSelector:a,needsMask:W,maskTextClass:l,maskTextSelector:i,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:p,maskInputFn:h,slimDOMOptions:m,dataURLOptions:f,inlineImages:u,recordCanvas:y,preserveWhiteSpace:j,onSerialize:S,onIframeLoad:b,iframeLoadTimeout:g,onStylesheetLoad:v,stylesheetLoadTimeout:R,keepIframeSrcFn:D});P&&v(e,P)}},R),C}function gr(e,t){const{mirror:r=new Ge,blockClass:n="rr-block",blockSelector:o=null,maskTextClass:a="rr-mask",maskTextSelector:l=null,inlineStylesheet:i=!0,inlineImages:s=!1,recordCanvas:c=!1,maskAllInputs:d=!1,maskTextFn:p,maskInputFn:h,slimDOM:m=!1,dataURLOptions:f,preserveWhiteSpace:u,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:b,onStylesheetLoad:g,stylesheetLoadTimeout:v,keepIframeSrcFn:R=()=>!1}=t||{};return ne(e,{doc:e,mirror:r,blockClass:n,blockSelector:o,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:i,maskInputOptions:d===!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}:d===!1?{password:!0}:d,maskTextFn:p,maskInputFn:h,slimDOMOptions:m===!0||m==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:m==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:m===!1?{}:m,dataURLOptions:f,inlineImages:s,recordCanvas:c,preserveWhiteSpace:u,onSerialize:y,onIframeLoad:S,iframeLoadTimeout:b,onStylesheetLoad:g,stylesheetLoadTimeout:v,keepIframeSrcFn:R,newlyAddedElement:!1})}function A(e,t,r=document){const n={capture:!0,passive:!0};return r.addEventListener(e,t,n),()=>r.removeEventListener(e,t,n)}const oe=`Please stop import mirror directly. Instead of that,\r
|
|
2
|
-
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
3
|
-
or you can use record.mirror to access the mirror instance during recording.`;let tt={map:{},getId(){return console.error(oe),-1},getNode(){return console.error(oe),null},removeNodeFromMap(){console.error(oe)},has(){return console.error(oe),!1},reset(){console.error(oe)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(tt=new Proxy(tt,{get(e,t,r){return t==="map"&&console.error(oe),Reflect.get(e,t,r)}}));function pe(e,t,r={}){let n=null,o=0;return function(...a){const l=Date.now();!o&&r.leading===!1&&(o=l);const i=t-(l-o),s=this;i<=0||i>t?(n&&(clearTimeout(n),n=null),o=l,e.apply(s,a)):!n&&r.trailing!==!1&&(n=setTimeout(()=>{o=r.leading===!1?0:Date.now(),n=null,e.apply(s,a)},i))}}function Ie(e,t,r,n,o=window){const a=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,n?r:{set(l){setTimeout(()=>{r.set.call(this,l)},0),a&&a.set&&a.set.call(this,l)}}),()=>Ie(e,t,a||{},!0)}function se(e,t,r){try{if(!(t in e))return()=>{};const n=e[t],o=r(n);return typeof o=="function"&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=o,()=>{e[t]=n}}catch{return()=>{}}}let Me=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Me=()=>new Date().getTime());function rt(e){var t,r,n,o,a,l;const i=e.document;return{left:i.scrollingElement?i.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:i?.documentElement.scrollLeft||((r=(t=i?.body)==null?void 0:t.parentElement)==null?void 0:r.scrollLeft)||((n=i?.body)==null?void 0:n.scrollLeft)||0,top:i.scrollingElement?i.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:i?.documentElement.scrollTop||((a=(o=i?.body)==null?void 0:o.parentElement)==null?void 0:a.scrollTop)||((l=i?.body)==null?void 0:l.scrollTop)||0}}function nt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ot(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function st(e){return e?e.nodeType===e.ELEMENT_NODE?e:e.parentElement:null}function F(e,t,r,n){if(!e)return!1;const o=st(e);if(!o)return!1;try{if(typeof t=="string"){if(o.classList.contains(t)||n&&o.closest("."+t)!==null)return!0}else if(ve(o,t,n))return!0}catch{}return!!(r&&(o.matches(r)||n&&o.closest(r)!==null))}function Sr(e,t){return t.getId(e)!==-1}function Fe(e,t){return t.getId(e)===ue}function at(e,t){if(ce(e))return!1;const r=t.getId(e);return t.has(r)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?at(e.parentNode,t):!0:!0}function _e(e){return Boolean(e.changedTouches)}function br(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let r=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===r)return!0;while(r=r&&r.parentNode);return!1})}function it(e,t){return Boolean(e.nodeName==="IFRAME"&&t.getMeta(e))}function lt(e,t){return Boolean(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Pe(e){return Boolean(e?.shadowRoot)}class vr{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){var r;return(r=this.styleIDMap.get(t))!=null?r:-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let n;return r===void 0?n=this.id++:n=r,this.styleIDMap.set(t,n),this.idStyleMap.set(n,t),n}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function ct(e){var t,r;let n=null;return((r=(t=e.getRootNode)==null?void 0:t.call(e))==null?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(n=e.getRootNode().host),n}function Ir(e){let t=e,r;for(;r=ct(t);)t=r;return t}function Mr(e){const t=e.ownerDocument;if(!t)return!1;const r=Ir(e);return t.contains(r)}function dt(e){const t=e.ownerDocument;return t?t.contains(e)||Mr(e):!1}var w=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(w||{}),I=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(I||{}),_=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(_||{}),q=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(q||{}),ae=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ae||{}),ie=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(ie||{}),wr=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e.Destroy="destroy",e))(wr||{});function ut(e){return"__ln"in e}class Cr{constructor(){this.length=0,this.head=null,this.tail=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let n=0;n<t;n++)r=r?.next||null;return r}addNode(t){const r={value:t,previous:null,next:null};if(t.__ln=r,t.previousSibling&&ut(t.previousSibling)){const n=t.previousSibling.__ln.next;r.next=n,r.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=r,n&&(n.previous=r)}else if(t.nextSibling&&ut(t.nextSibling)&&t.nextSibling.__ln.previous){const n=t.nextSibling.__ln.previous;r.previous=n,r.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=r,n&&(n.next=r)}else this.head&&(this.head.previous=r),r.next=this.head,this.head=r;r.next===null&&(this.tail=r),this.length++}removeNode(t){const r=t.__ln;!this.head||(r.previous?(r.previous.next=r.next,r.next?r.next.previous=r.previous:this.tail=r.previous):(this.head=r.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}const pt=(e,t)=>`${e}@${t}`;class kr{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],r=new Set,n=new Cr,o=s=>{let c=s,d=ue;for(;d===ue;)c=c&&c.nextSibling,d=c&&this.mirror.getId(c);return d},a=s=>{if(!s.parentNode||!dt(s)||s.parentNode.tagName==="TEXTAREA")return;const c=ce(s.parentNode)?this.mirror.getId(ct(s)):this.mirror.getId(s.parentNode),d=o(s);if(c===-1||d===-1)return n.addNode(s);const p=ne(s,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:h=>{it(h,this.mirror)&&this.iframeManager.addIframe(h),lt(h,this.mirror)&&this.stylesheetManager.trackLinkElement(h),Pe(s)&&this.shadowDomManager.addShadowRoot(s.shadowRoot,this.doc)},onIframeLoad:(h,m)=>{this.iframeManager.attachIframe(h,m),this.shadowDomManager.observeAttachShadow(h)},onStylesheetLoad:(h,m)=>{this.stylesheetManager.attachLinkElement(h,m)}});p&&(t.push({parentId:c,nextId:d,node:p}),r.add(p.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const s of this.movedSet)ht(this.removes,s,this.mirror)&&!this.movedSet.has(s.parentNode)||a(s);for(const s of this.addedSet)!ft(this.droppedSet,s)&&!ht(this.removes,s,this.mirror)||ft(this.movedSet,s)?a(s):this.droppedSet.add(s);let l=null;for(;n.length;){let s=null;if(l){const c=this.mirror.getId(l.value.parentNode),d=o(l.value);c!==-1&&d!==-1&&(s=l)}if(!s){let c=n.tail;for(;c;){const d=c;if(c=c.previous,d){const p=this.mirror.getId(d.value.parentNode);if(o(d.value)===-1)continue;if(p!==-1){s=d;break}else{const h=d.value;if(h.parentNode&&h.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const m=h.parentNode.host;if(this.mirror.getId(m)!==-1){s=d;break}}}}}}if(!s){for(;n.head;)n.removeNode(n.head.value);break}l=s.previous,n.removeNode(s.value),a(s.value)}const i={texts:this.texts.map(s=>{const c=s.node;return c.parentNode&&c.parentNode.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c.parentNode),{id:this.mirror.getId(c),value:s.value}}).filter(s=>!r.has(s.id)).filter(s=>this.mirror.has(s.id)),attributes:this.attributes.map(s=>{const{attributes:c}=s;if(typeof c.style=="string"){const d=JSON.stringify(s.styleDiff),p=JSON.stringify(s._unchangedStyles);d.length<c.style.length&&(d+p).split("var(").length===c.style.split("var(").length&&(c.style=s.styleDiff)}return{id:this.mirror.getId(s.node),attributes:c}}).filter(s=>!r.has(s.id)).filter(s=>this.mirror.has(s.id)),removes:this.removes,adds:t};!i.texts.length&&!i.attributes.length&&!i.removes.length&&!i.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.movedMap={},this.mutationCb(i))},this.genTextAreaValueMutation=t=>{let r=this.attributeMap.get(t);r||(r={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(t,r)),r.attributes.value=Array.from(t.childNodes,n=>n.textContent||"").join("")},this.processMutation=t=>{if(!Fe(t.target,this.mirror))switch(t.type){case"characterData":{const r=t.target.textContent;!F(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:et(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,st(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target;let n=t.attributeName,o=t.target.getAttribute(n);if(n==="value"){const l=Ae(r);o=De({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:l,value:o,maskInputFn:this.maskInputFn})}if(F(t.target,this.blockClass,this.blockSelector,!1)||o===t.oldValue)return;let a=this.attributeMap.get(t.target);if(r.tagName==="IFRAME"&&n==="src"&&!this.keepIframeSrcFn(o))if(!r.contentDocument)n="rr_src";else return;if(a||(a={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(a),this.attributeMap.set(t.target,a)),n==="type"&&r.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!Ze(r.tagName,n)&&(a.attributes[n]=Qe(this.doc,K(r.tagName),K(n),o),n==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const l=this.unattachedDoc.createElement("span");t.oldValue&&l.setAttribute("style",t.oldValue);for(const i of Array.from(r.style)){const s=r.style.getPropertyValue(i),c=r.style.getPropertyPriority(i);s!==l.style.getPropertyValue(i)||c!==l.style.getPropertyPriority(i)?c===""?a.styleDiff[i]=s:a.styleDiff[i]=[s,c]:a._unchangedStyles[i]=[s,c]}for(const i of Array.from(l.style))r.style.getPropertyValue(i)===""&&(a.styleDiff[i]=!1)}break}case"childList":{if(F(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const n=this.mirror.getId(r),o=ce(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);F(t.target,this.blockClass,this.blockSelector,!1)||Fe(r,this.mirror)||!Sr(r,this.mirror)||(this.addedSet.has(r)?($e(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&n===-1||at(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[pt(n,o)]?$e(this.movedSet,r):this.removes.push({parentId:o,id:n,isShadow:ce(t.target)&&de(t.target)?!0:void 0})),this.mapRemoves.push(r))});break}}},this.genAdds=(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Fe(t,this.mirror))return;this.movedSet.add(t);let n=null;r&&this.mirror.hasNode(r)&&(n=this.mirror.getId(r)),n&&n!==-1&&(this.movedMap[pt(this.mirror.getId(t),n)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);F(t,this.blockClass,this.blockSelector,!1)||(t.childNodes.forEach(n=>this.genAdds(n)),Pe(t)&&t.shadowRoot.childNodes.forEach(n=>{this.processedNodeManager.add(n,this),this.genAdds(n,t)}))}}}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(r=>{this[r]=t[r]})}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 $e(e,t){e.delete(t),t.childNodes.forEach(r=>$e(e,r))}function ht(e,t,r){return e.length===0?!1:mt(e,t,r)}function mt(e,t,r){const{parentNode:n}=t;if(!n)return!1;const o=r.getId(n);return e.some(a=>a.id===o)?!0:mt(e,n,r)}function ft(e,t){return e.size===0?!1:yt(e,t)}function yt(e,t){const{parentNode:r}=t;return r?e.has(r)?!0:yt(e,r):!1}let he;function Or(e){he=e}function Tr(){he=void 0}const M=e=>he?(...t)=>{try{return e(...t)}catch(r){if(he&&he(r)===!0)return;throw r}}:e;var Er=Object.defineProperty,Rr=Object.defineProperties,xr=Object.getOwnPropertyDescriptors,gt=Object.getOwnPropertySymbols,Lr=Object.prototype.hasOwnProperty,Nr=Object.prototype.propertyIsEnumerable,St=(e,t,r)=>t in e?Er(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bt=(e,t)=>{for(var r in t||(t={}))Lr.call(t,r)&&St(e,r,t[r]);if(gt)for(var r of gt(t))Nr.call(t,r)&&St(e,r,t[r]);return e},Dr=(e,t)=>Rr(e,xr(t));const Q=[];function me(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function vt(e,t){var r,n;const o=new kr;Q.push(o),o.init(e);let a=window.MutationObserver||window.__rrMutationObserver;const l=(n=(r=window?.Zone)==null?void 0:r.__symbol__)==null?void 0:n.call(r,"MutationObserver");l&&window[l]&&(a=window[l]);const i=new a(M(o.processMutations.bind(o)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function Ar({mousemoveCb:e,sampling:t,doc:r,mirror:n}){if(t.mousemove===!1)return()=>{};const o=typeof t.mousemove=="number"?t.mousemove:50,a=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let l=[],i;const s=pe(M(p=>{const h=Date.now()-i;e(l.map(m=>(m.timeOffset-=h,m)),p),l=[],i=null}),a),c=M(pe(M(p=>{const h=me(p),{clientX:m,clientY:f}=_e(p)?p.changedTouches[0]:p;i||(i=Me()),l.push({x:m,y:f,id:n.getId(h),timeOffset:Me()-i}),s(typeof DragEvent<"u"&&p instanceof DragEvent?I.Drag:p instanceof MouseEvent?I.MouseMove:I.TouchMove)}),o,{trailing:!1})),d=[A("mousemove",c,r),A("touchmove",c,r),A("drag",c,r)];return M(()=>{d.forEach(p=>p())})}function Fr({mouseInteractionCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:a}){if(a.mouseInteraction===!1)return()=>{};const l=a.mouseInteraction===!0||a.mouseInteraction===void 0?{}:a.mouseInteraction,i=[];let s=null;const c=d=>p=>{const h=me(p);if(F(h,n,o,!0))return;let m=null,f=d;if("pointerType"in p){switch(p.pointerType){case"mouse":m=q.Mouse;break;case"touch":m=q.Touch;break;case"pen":m=q.Pen;break}m===q.Touch?_[d]===_.MouseDown?f="TouchStart":_[d]===_.MouseUp&&(f="TouchEnd"):q.Pen}else _e(p)&&(m=q.Touch);m!==null?(s=m,(f.startsWith("Touch")&&m===q.Touch||f.startsWith("Mouse")&&m===q.Mouse)&&(m=null)):_[d]===_.Click&&(m=s,s=null);const u=_e(p)?p.changedTouches[0]:p;if(!u)return;const y=r.getId(h),{clientX:S,clientY:b}=u;M(e)(bt({type:_[f],id:y,x:S,y:b},m!==null&&{pointerType:m}))};return Object.keys(_).filter(d=>Number.isNaN(Number(d))&&!d.endsWith("_Departed")&&l[d]!==!1).forEach(d=>{let p=K(d);const h=c(d);if(window.PointerEvent)switch(_[d]){case _.MouseDown:case _.MouseUp:p=p.replace("mouse","pointer");break;case _.TouchStart:case _.TouchEnd:return}i.push(A(p,h,t))}),M(()=>{i.forEach(d=>d())})}function It({scrollCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,sampling:a}){const l=M(pe(M(i=>{const s=me(i);if(!s||F(s,n,o,!0))return;const c=r.getId(s);if(s===t&&t.defaultView){const d=rt(t.defaultView);e({id:c,x:d.left,y:d.top})}else e({id:c,x:s.scrollLeft,y:s.scrollTop})}),a.scroll||100));return A("scroll",l,t)}function _r({viewportResizeCb:e},{win:t}){let r=-1,n=-1;const o=M(pe(M(()=>{const a=nt(),l=ot();(r!==a||n!==l)&&(e({width:Number(l),height:Number(a)}),r=a,n=l)}),200));return A("resize",o,t)}const Pr=["INPUT","TEXTAREA","SELECT"],Mt=new WeakMap;function $r({inputCb:e,doc:t,mirror:r,blockClass:n,blockSelector:o,ignoreClass:a,ignoreSelector:l,maskInputOptions:i,maskInputFn:s,sampling:c,userTriggeredOnInput:d}){function p(S){let b=me(S);const g=S.isTrusted,v=b&&b.tagName;if(b&&v==="OPTION"&&(b=b.parentElement),!b||!v||Pr.indexOf(v)<0||F(b,n,o,!0)||b.classList.contains(a)||l&&b.matches(l))return;let R=b.value,D=!1;const V=Ae(b)||"";V==="radio"||V==="checkbox"?D=b.checked:(i[v.toLowerCase()]||i[V])&&(R=De({element:b,maskInputOptions:i,tagName:v,type:V,value:R,maskInputFn:s})),h(b,d?{text:R,isChecked:D,userTriggered:g}:{text:R,isChecked:D});const W=b.name;V==="radio"&&W&&D&&t.querySelectorAll(`input[type="radio"][name="${W}"]`).forEach(j=>{if(j!==b){const z=j.value;h(j,d?{text:z,isChecked:!D,userTriggered:!1}:{text:z,isChecked:!D})}})}function h(S,b){const g=Mt.get(S);if(!g||g.text!==b.text||g.isChecked!==b.isChecked){Mt.set(S,b);const v=r.getId(S);M(e)(Dr(bt({},b),{id:v}))}}const m=(c.input==="last"?["change"]:["input","change"]).map(S=>A(S,M(p),t)),f=t.defaultView;if(!f)return()=>{m.forEach(S=>S())};const u=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),y=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return u&&u.set&&m.push(...y.map(S=>Ie(S[0],S[1],{set(){M(p)({target:this,isTrusted:!1})}},!1,f))),M(()=>{m.forEach(S=>S())})}function we(e){const t=[];function r(n,o){if(Ce("CSSGroupingRule")&&n.parentRule instanceof CSSGroupingRule||Ce("CSSMediaRule")&&n.parentRule instanceof CSSMediaRule||Ce("CSSSupportsRule")&&n.parentRule instanceof CSSSupportsRule||Ce("CSSConditionRule")&&n.parentRule instanceof CSSConditionRule){const a=Array.from(n.parentRule.cssRules).indexOf(n);o.unshift(a)}else if(n.parentStyleSheet){const a=Array.from(n.parentStyleSheet.cssRules).indexOf(n);o.unshift(a)}return o}return r(e,t)}function Y(e,t,r){let n,o;return e?(e.ownerNode?n=t.getId(e.ownerNode):o=r.getId(e),{styleId:o,id:n}):{}}function Wr({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:n}){if(!n.CSSStyleSheet||!n.CSSStyleSheet.prototype)return()=>{};const o=n.CSSStyleSheet.prototype.insertRule;n.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:M((d,p,h)=>{const[m,f]=h,{id:u,styleId:y}=Y(p,t,r.styleMirror);return(u&&u!==-1||y&&y!==-1)&&e({id:u,styleId:y,adds:[{rule:m,index:f}]}),d.apply(p,h)})});const a=n.CSSStyleSheet.prototype.deleteRule;n.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:M((d,p,h)=>{const[m]=h,{id:f,styleId:u}=Y(p,t,r.styleMirror);return(f&&f!==-1||u&&u!==-1)&&e({id:f,styleId:u,removes:[{index:m}]}),d.apply(p,h)})});let l;n.CSSStyleSheet.prototype.replace&&(l=n.CSSStyleSheet.prototype.replace,n.CSSStyleSheet.prototype.replace=new Proxy(l,{apply:M((d,p,h)=>{const[m]=h,{id:f,styleId:u}=Y(p,t,r.styleMirror);return(f&&f!==-1||u&&u!==-1)&&e({id:f,styleId:u,replace:m}),d.apply(p,h)})}));let i;n.CSSStyleSheet.prototype.replaceSync&&(i=n.CSSStyleSheet.prototype.replaceSync,n.CSSStyleSheet.prototype.replaceSync=new Proxy(i,{apply:M((d,p,h)=>{const[m]=h,{id:f,styleId:u}=Y(p,t,r.styleMirror);return(f&&f!==-1||u&&u!==-1)&&e({id:f,styleId:u,replaceSync:m}),d.apply(p,h)})}));const s={};ke("CSSGroupingRule")?s.CSSGroupingRule=n.CSSGroupingRule:(ke("CSSMediaRule")&&(s.CSSMediaRule=n.CSSMediaRule),ke("CSSConditionRule")&&(s.CSSConditionRule=n.CSSConditionRule),ke("CSSSupportsRule")&&(s.CSSSupportsRule=n.CSSSupportsRule));const c={};return Object.entries(s).forEach(([d,p])=>{c[d]={insertRule:p.prototype.insertRule,deleteRule:p.prototype.deleteRule},p.prototype.insertRule=new Proxy(c[d].insertRule,{apply:M((h,m,f)=>{const[u,y]=f,{id:S,styleId:b}=Y(m.parentStyleSheet,t,r.styleMirror);return(S&&S!==-1||b&&b!==-1)&&e({id:S,styleId:b,adds:[{rule:u,index:[...we(m),y||0]}]}),h.apply(m,f)})}),p.prototype.deleteRule=new Proxy(c[d].deleteRule,{apply:M((h,m,f)=>{const[u]=f,{id:y,styleId:S}=Y(m.parentStyleSheet,t,r.styleMirror);return(y&&y!==-1||S&&S!==-1)&&e({id:y,styleId:S,removes:[{index:[...we(m),u]}]}),h.apply(m,f)})})}),M(()=>{n.CSSStyleSheet.prototype.insertRule=o,n.CSSStyleSheet.prototype.deleteRule=a,l&&(n.CSSStyleSheet.prototype.replace=l),i&&(n.CSSStyleSheet.prototype.replaceSync=i),Object.entries(s).forEach(([d,p])=>{p.prototype.insertRule=c[d].insertRule,p.prototype.deleteRule=c[d].deleteRule})})}function wt({mirror:e,stylesheetManager:t},r){var n,o,a;let l=null;r.nodeName==="#document"?l=e.getId(r):l=e.getId(r.host);const i=r.nodeName==="#document"?(n=r.defaultView)==null?void 0:n.Document:(a=(o=r.ownerDocument)==null?void 0:o.defaultView)==null?void 0:a.ShadowRoot,s=i!=null&&i.prototype?Object.getOwnPropertyDescriptor(i?.prototype,"adoptedStyleSheets"):void 0;return l===null||l===-1||!i||!s?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get(){var c;return(c=s.get)==null?void 0:c.call(this)},set(c){var d;const p=(d=s.set)==null?void 0:d.call(this,c);if(l!==null&&l!==-1)try{t.adoptStyleSheets(c,l)}catch{}return p}}),M(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:s.configurable,enumerable:s.enumerable,get:s.get,set:s.set})}))}function Ur({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:n},{win:o}){const a=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:M((i,s,c)=>{var d;const[p,h,m]=c;if(r.has(p))return a.apply(s,[p,h,m]);const{id:f,styleId:u}=Y((d=s.parentRule)==null?void 0:d.parentStyleSheet,t,n.styleMirror);return(f&&f!==-1||u&&u!==-1)&&e({id:f,styleId:u,set:{property:p,value:h,priority:m},index:we(s.parentRule)}),i.apply(s,c)})});const l=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(l,{apply:M((i,s,c)=>{var d;const[p]=c;if(r.has(p))return l.apply(s,[p]);const{id:h,styleId:m}=Y((d=s.parentRule)==null?void 0:d.parentStyleSheet,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,remove:{property:p},index:we(s.parentRule)}),i.apply(s,c)})}),M(()=>{o.CSSStyleDeclaration.prototype.setProperty=a,o.CSSStyleDeclaration.prototype.removeProperty=l})}function jr({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:n,sampling:o,doc:a}){const l=M(s=>pe(M(c=>{const d=me(c);if(!d||F(d,t,r,!0))return;const{currentTime:p,volume:h,muted:m,playbackRate:f,loop:u}=d;e({type:s,id:n.getId(d),currentTime:p,volume:h,muted:m,playbackRate:f,loop:u})}),o.media||500)),i=[A("play",l(ie.Play),a),A("pause",l(ie.Pause),a),A("seeked",l(ie.Seeked),a),A("volumechange",l(ie.VolumeChange),a),A("ratechange",l(ie.RateChange),a)];return M(()=>{i.forEach(s=>s())})}function zr({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const n=[],o=new WeakMap,a=r.FontFace;r.FontFace=function(i,s,c){const d=new a(i,s,c);return o.set(d,{family:i,buffer:typeof s!="string",descriptors:c,fontSource:typeof s=="string"?s:JSON.stringify(Array.from(new Uint8Array(s)))}),d};const l=se(t.fonts,"add",function(i){return function(s){return setTimeout(M(()=>{const c=o.get(s);c&&(e(c),o.delete(s))}),0),i.apply(this,[s])}});return n.push(()=>{r.FontFace=a}),n.push(l),M(()=>{n.forEach(i=>i())})}function Br(e){const{doc:t,mirror:r,blockClass:n,blockSelector:o,selectionCb:a}=e;let l=!0;const i=M(()=>{const s=t.getSelection();if(!s||l&&s?.isCollapsed)return;l=s.isCollapsed||!1;const c=[],d=s.rangeCount||0;for(let p=0;p<d;p++){const h=s.getRangeAt(p),{startContainer:m,startOffset:f,endContainer:u,endOffset:y}=h;F(m,n,o,!0)||F(u,n,o,!0)||c.push({start:r.getId(m),startOffset:f,end:r.getId(u),endOffset:y})}a({ranges:c})});return i(),A("selectionchange",i)}function Vr({doc:e,customElementCb:t}){const r=e.defaultView;return!r||!r.customElements?()=>{}:se(r.customElements,"define",function(n){return function(o,a,l){try{t({define:{name:o}})}catch{console.warn(`Custom element callback failed for ${o}`)}return n.apply(this,[o,a,l])}})}function Hr(e,t){const{mutationCb:r,mousemoveCb:n,mouseInteractionCb:o,scrollCb:a,viewportResizeCb:l,inputCb:i,mediaInteractionCb:s,styleSheetRuleCb:c,styleDeclarationCb:d,canvasMutationCb:p,fontCb:h,selectionCb:m,customElementCb:f}=e;e.mutationCb=(...u)=>{t.mutation&&t.mutation(...u),r(...u)},e.mousemoveCb=(...u)=>{t.mousemove&&t.mousemove(...u),n(...u)},e.mouseInteractionCb=(...u)=>{t.mouseInteraction&&t.mouseInteraction(...u),o(...u)},e.scrollCb=(...u)=>{t.scroll&&t.scroll(...u),a(...u)},e.viewportResizeCb=(...u)=>{t.viewportResize&&t.viewportResize(...u),l(...u)},e.inputCb=(...u)=>{t.input&&t.input(...u),i(...u)},e.mediaInteractionCb=(...u)=>{t.mediaInteaction&&t.mediaInteaction(...u),s(...u)},e.styleSheetRuleCb=(...u)=>{t.styleSheetRule&&t.styleSheetRule(...u),c(...u)},e.styleDeclarationCb=(...u)=>{t.styleDeclaration&&t.styleDeclaration(...u),d(...u)},e.canvasMutationCb=(...u)=>{t.canvasMutation&&t.canvasMutation(...u),p(...u)},e.fontCb=(...u)=>{t.font&&t.font(...u),h(...u)},e.selectionCb=(...u)=>{t.selection&&t.selection(...u),m(...u)},e.customElementCb=(...u)=>{t.customElement&&t.customElement(...u),f(...u)}}function Gr(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};Hr(e,t);let n;e.recordDOM&&(n=vt(e,e.doc));const o=Ar(e),a=Fr(e),l=It(e),i=_r(e,{win:r}),s=$r(e),c=jr(e);let d=()=>{},p=()=>{},h=()=>{},m=()=>{};e.recordDOM&&(d=Wr(e,{win:r}),p=wt(e,e.doc),h=Ur(e,{win:r}),e.collectFonts&&(m=zr(e)));const f=Br(e),u=Vr(e),y=[];for(const S of e.plugins)y.push(S.observer(S.callback,r,S.options));return M(()=>{Q.forEach(S=>S.reset()),n?.disconnect(),o(),a(),l(),i(),s(),c(),d(),p(),h(),m(),f(),u(),y.forEach(S=>S())})}function Ce(e){return typeof window[e]<"u"}function ke(e){return Boolean(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Ct{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,r,n,o){const a=n||this.getIdToRemoteIdMap(t),l=o||this.getRemoteIdToIdMap(t);let i=a.get(r);return i||(i=this.generateIdFn(),a.set(r,i),l.set(i,r)),i}getIds(t,r){const n=this.getIdToRemoteIdMap(t),o=this.getRemoteIdToIdMap(t);return r.map(a=>this.getId(t,a,n,o))}getRemoteId(t,r,n){const o=n||this.getRemoteIdToIdMap(t);return typeof r!="number"?r:o.get(r)||-1}getRemoteIds(t,r){const n=this.getRemoteIdToIdMap(t);return r.map(o=>this.getRemoteId(t,o,n))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}}class qr{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Ct(Ye),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ct(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,r){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),(n=this.loadListener)==null||n.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;const n=this.crossOriginIframeMap.get(t.source);if(!n)return;const o=this.transformCrossOriginEvent(n,r.data.event);o&&this.wrappedEmit(o,r.data.isCheckout)}transformCrossOriginEvent(t,r){var n;switch(r.type){case w.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);const o=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,o),this.patchRootIdOnNode(r.data.node,o),{timestamp:r.timestamp,type:w.IncrementalSnapshot,data:{source:I.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case w.Meta:case w.Load:case w.DomContentLoaded:return!1;case w.Plugin:return r;case w.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case w.IncrementalSnapshot:switch(r.data.source){case I.Mutation:return r.data.adds.forEach(o=>{this.replaceIds(o,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(o.node,t);const a=this.crossOriginIframeRootIdMap.get(t);a&&this.patchRootIdOnNode(o.node,a)}),r.data.removes.forEach(o=>{this.replaceIds(o,t,["parentId","id"])}),r.data.attributes.forEach(o=>{this.replaceIds(o,t,["id"])}),r.data.texts.forEach(o=>{this.replaceIds(o,t,["id"])}),r;case I.Drag:case I.TouchMove:case I.MouseMove:return r.data.positions.forEach(o=>{this.replaceIds(o,t,["id"])}),r;case I.ViewportResize:return!1;case I.MediaInteraction:case I.MouseInteraction:case I.Scroll:case I.CanvasMutation:case I.Input:return this.replaceIds(r.data,t,["id"]),r;case I.StyleSheetRule:case I.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case I.Font:return r;case I.Selection:return r.data.ranges.forEach(o=>{this.replaceIds(o,t,["start","end"])}),r;case I.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(n=r.data.styles)==null||n.forEach(o=>{this.replaceStyleIds(o,t,["styleId"])}),r}}return!1}replace(t,r,n,o){for(const a of o)!Array.isArray(r[a])&&typeof r[a]!="number"||(Array.isArray(r[a])?r[a]=t.getIds(n,r[a]):r[a]=t.getId(n,r[a]));return r}replaceIds(t,r,n){return this.replace(this.crossOriginIframeMirror,t,r,n)}replaceStyleIds(t,r,n){return this.replace(this.crossOriginIframeStyleMirror,t,r,n)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(n=>{this.replaceIdOnNode(n,r)})}patchRootIdOnNode(t,r){t.type!==N.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(n=>{this.patchRootIdOnNode(n,r)})}}var Xr=Object.defineProperty,Yr=Object.defineProperties,Jr=Object.getOwnPropertyDescriptors,kt=Object.getOwnPropertySymbols,Kr=Object.prototype.hasOwnProperty,Qr=Object.prototype.propertyIsEnumerable,Ot=(e,t,r)=>t in e?Xr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Tt=(e,t)=>{for(var r in t||(t={}))Kr.call(t,r)&&Ot(e,r,t[r]);if(kt)for(var r of kt(t))Qr.call(t,r)&&Ot(e,r,t[r]);return e},Et=(e,t)=>Yr(e,Jr(t));class Zr{constructor(t){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,r){if(!de(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);const n=vt(Et(Tt({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(It(Et(Tt({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(wt({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,r){const n=this;this.restoreHandlers.push(se(t.prototype,"attachShadow",function(o){return function(a){const l=o.call(this,a);return this.shadowRoot&&dt(this)&&n.addShadowRoot(this.shadowRoot,r),l}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var le="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",en=typeof Uint8Array>"u"?[]:new Uint8Array(256),Oe=0;Oe<le.length;Oe++)en[le.charCodeAt(Oe)]=Oe;var tn=function(e){var t=new Uint8Array(e),r,n=t.length,o="";for(r=0;r<n;r+=3)o+=le[t[r]>>2],o+=le[(t[r]&3)<<4|t[r+1]>>4],o+=le[(t[r+1]&15)<<2|t[r+2]>>6],o+=le[t[r+2]&63];return n%3===2?o=o.substring(0,o.length-1)+"=":n%3===1&&(o=o.substring(0,o.length-2)+"=="),o};const Rt=new Map;function rn(e,t){let r=Rt.get(e);return r||(r=new Map,Rt.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const xt=(e,t,r)=>{if(!e||!(Nt(e,t)||typeof e=="object"))return;const n=e.constructor.name,o=rn(r,n);let a=o.indexOf(e);return a===-1&&(a=o.length,o.push(e)),a};function Te(e,t,r){if(e instanceof Array)return e.map(n=>Te(n,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer){const n=e.constructor.name,o=tn(e);return{rr_type:n,base64:o}}else{if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Te(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const n=e.constructor.name,{src:o}=e;return{rr_type:n,src:o}}else if(e instanceof HTMLCanvasElement){const n="HTMLImageElement",o=e.toDataURL();return{rr_type:n,src:o}}else{if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[Te(e.data,t,r),e.width,e.height]};if(Nt(e,t)||typeof e=="object"){const n=e.constructor.name,o=xt(e,t,r);return{rr_type:n,index:o}}}}return e}const Lt=(e,t,r)=>e.map(n=>Te(n,t,r)),Nt=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(n=>typeof t[n]=="function");return Boolean(r.find(n=>e instanceof t[n]))};function nn(e,t,r,n){const o=[],a=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const l of a)try{if(typeof t.CanvasRenderingContext2D.prototype[l]!="function")continue;const i=se(t.CanvasRenderingContext2D.prototype,l,function(s){return function(...c){return F(this.canvas,r,n,!0)||setTimeout(()=>{const d=Lt(c,t,this);e(this.canvas,{type:ae["2D"],property:l,args:d})},0),s.apply(this,c)}});o.push(i)}catch{const s=Ie(t.CanvasRenderingContext2D.prototype,l,{set(c){e(this.canvas,{type:ae["2D"],property:l,args:[c],setter:!0})}});o.push(s)}return()=>{o.forEach(l=>l())}}function on(e){return e==="experimental-webgl"?"webgl":e}function Dt(e,t,r,n){const o=[];try{const a=se(e.HTMLCanvasElement.prototype,"getContext",function(l){return function(i,...s){if(!F(this,t,r,!0)){const c=on(i);if("__context"in this||(this.__context=c),n&&["webgl","webgl2"].includes(c))if(s[0]&&typeof s[0]=="object"){const d=s[0];d.preserveDrawingBuffer||(d.preserveDrawingBuffer=!0)}else s.splice(0,1,{preserveDrawingBuffer:!0})}return l.apply(this,[i,...s])}});o.push(a)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach(a=>a())}}function At(e,t,r,n,o,a,l){const i=[],s=Object.getOwnPropertyNames(e);for(const c of s)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(c))try{if(typeof e[c]!="function")continue;const d=se(e,c,function(p){return function(...h){const m=p.apply(this,h);if(xt(m,l,this),"tagName"in this.canvas&&!F(this.canvas,n,o,!0)){const f=Lt(h,l,this),u={type:t,property:c,args:f};r(this.canvas,u)}return m}});i.push(d)}catch{const p=Ie(e,c,{set(h){r(this.canvas,{type:t,property:c,args:[h],setter:!0})}});i.push(p)}return i}function sn(e,t,r,n,o){const a=[];return a.push(...At(t.WebGLRenderingContext.prototype,ae.WebGL,e,r,n,o,t)),typeof t.WebGL2RenderingContext<"u"&&a.push(...At(t.WebGL2RenderingContext.prototype,ae.WebGL2,e,r,n,o,t)),()=>{a.forEach(l=>l())}}function an(e,t){var r=t===void 0?null:t,n=e.toString(),o=n.split(`
|
|
4
|
-
`);o.pop(),o.shift();for(var a=o[0].search(/\S/),l=/(['"])__worker_loader_strict__(['"])/g,i=0,s=o.length;i<s;++i)o[i]=o[i].substring(a).replace(l,"$1use strict$2")+`
|
|
5
|
-
`;return r&&o.push("//# sourceMappingURL="+r+`
|
|
6
|
-
`),o}function ln(e,t){var r=an(e,t),n=new Blob(r,{type:"application/javascript"});return URL.createObjectURL(n)}function cn(e,t){var r;return function(o){return r=r||ln(e,t),new Worker(r,o)}}var dn=cn(function(){(function(){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=typeof Uint8Array>"u"?[]:new Uint8Array(256),r=0;r<e.length;r++)t[e.charCodeAt(r)]=r;var n=function(s){var c=new Uint8Array(s),d,p=c.length,h="";for(d=0;d<p;d+=3)h+=e[c[d]>>2],h+=e[(c[d]&3)<<4|c[d+1]>>4],h+=e[(c[d+1]&15)<<2|c[d+2]>>6],h+=e[c[d+2]&63];return p%3===2?h=h.substring(0,h.length-1)+"=":p%3===1&&(h=h.substring(0,h.length-2)+"=="),h};const o=new Map,a=new Map;async function l(s,c,d){const p=`${s}-${c}`;if("OffscreenCanvas"in globalThis){if(a.has(p))return a.get(p);const h=new OffscreenCanvas(s,c);h.getContext("2d");const m=await(await h.convertToBlob(d)).arrayBuffer(),f=n(m);return a.set(p,f),f}else return""}const i=self;i.onmessage=async function(s){if("OffscreenCanvas"in globalThis){const{id:c,bitmap:d,width:p,height:h,dataURLOptions:m}=s.data,f=l(p,h,m),u=new OffscreenCanvas(p,h);u.getContext("2d").drawImage(d,0,0),d.close();const y=await u.convertToBlob(m),S=y.type,b=await y.arrayBuffer(),g=n(b);if(!o.has(c)&&await f===g)return o.set(c,g),i.postMessage({id:c});if(o.get(c)===g)return i.postMessage({id:c});i.postMessage({id:c,type:S,base64:g,width:p,height:h}),o.set(c,g)}else return i.postMessage({id:s.data.id})}})()},null),Ft=Object.getOwnPropertySymbols,un=Object.prototype.hasOwnProperty,pn=Object.prototype.propertyIsEnumerable,hn=(e,t)=>{var r={};for(var n in e)un.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ft)for(var n of Ft(e))t.indexOf(n)<0&&pn.call(e,n)&&(r[n]=e[n]);return r},mn=(e,t,r)=>new Promise((n,o)=>{var a=s=>{try{i(r.next(s))}catch(c){o(c)}},l=s=>{try{i(r.throw(s))}catch(c){o(c)}},i=s=>s.done?n(s.value):Promise.resolve(s.value).then(a,l);i((r=r.apply(e,t)).next())});class fn{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(s,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(s)||this.pendingCanvasMutations.set(s,[]),this.pendingCanvasMutations.get(s).push(c)};const{sampling:r="all",win:n,blockClass:o,blockSelector:a,recordCanvas:l,dataURLOptions:i}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,l&&r==="all"&&this.initCanvasMutationObserver(n,o,a),l&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,o,a,{dataURLOptions:i})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n,o,a){const l=Dt(r,n,o,!0),i=new Map,s=new dn;s.onmessage=f=>{const{id:u}=f.data;if(i.set(u,!1),!("base64"in f.data))return;const{base64:y,type:S,width:b,height:g}=f.data;this.mutationCb({id:u,type:ae["2D"],commands:[{property:"clearRect",args:[0,0,b,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:y}],type:S}]},0,0]}]})};const c=1e3/t;let d=0,p;const h=()=>{const f=[];return r.document.querySelectorAll("canvas").forEach(u=>{F(u,n,o,!0)||f.push(u)}),f},m=f=>{if(d&&f-d<c){p=requestAnimationFrame(m);return}d=f,h().forEach(u=>mn(this,null,function*(){var y;const S=this.mirror.getId(u);if(i.get(S)||u.width===0||u.height===0)return;if(i.set(S,!0),["webgl","webgl2"].includes(u.__context)){const g=u.getContext(u.__context);((y=g?.getContextAttributes())==null?void 0:y.preserveDrawingBuffer)===!1&&g.clear(g.COLOR_BUFFER_BIT)}const b=yield createImageBitmap(u);s.postMessage({id:S,bitmap:b,width:u.width,height:u.height,dataURLOptions:a.dataURLOptions},[b])})),p=requestAnimationFrame(m)};p=requestAnimationFrame(m),this.resetObservers=()=>{l(),cancelAnimationFrame(p)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const o=Dt(t,r,n,!1),a=nn(this.processMutation.bind(this),t,r,n),l=sn(this.processMutation.bind(this),t,r,n,this.mirror);this.resetObservers=()=>{o(),a(),l()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;const o=n.map(l=>hn(l,["type"])),{type:a}=n[0];this.mutationCb({id:r,type:a,commands:o}),this.pendingCanvasMutations.delete(t)}}class yn{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new vr,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;const n={id:r,styleIds:[]},o=[];for(const a of t){let l;this.styleMirror.has(a)?l=this.styleMirror.getId(a):(l=this.styleMirror.add(a),o.push({styleId:l,rules:Array.from(a.rules||CSSRule,(i,s)=>({rule:He(i),index:s}))})),n.styleIds.push(l)}o.length>0&&(n.styles=o),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class gn{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(t,r){const n=this.nodeMap.get(t);return n&&Array.from(n).some(o=>o!==r)}add(t,r){this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}var Sn=Object.defineProperty,_t=Object.getOwnPropertySymbols,bn=Object.prototype.hasOwnProperty,vn=Object.prototype.propertyIsEnumerable,Pt=(e,t,r)=>t in e?Sn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$=(e,t)=>{for(var r in t||(t={}))bn.call(t,r)&&Pt(e,r,t[r]);if(_t)for(var r of _t(t))vn.call(t,r)&&Pt(e,r,t[r]);return e},$t;let E,Ee,We,Re=!1;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(($t=e.contentWindow)==null?void 0:$t.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const U=Yt();function fe(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:a=null,ignoreClass:l="rr-ignore",ignoreSelector:i=null,maskTextClass:s="rr-mask",maskTextSelector:c=null,inlineStylesheet:d=!0,maskAllInputs:p,maskInputOptions:h,slimDOMOptions:m,maskInputFn:f,maskTextFn:u,hooks:y,packFn:S,sampling:b={},dataURLOptions:g={},mousemoveWait:v,recordDOM:R=!0,recordCanvas:D=!1,recordCrossOriginIframes:V=!1,recordAfter:W=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:j=!1,collectFonts:z=!1,inlineImages:X=!1,plugins:C,keepIframeSrcFn:Z=()=>!1,ignoreCSSAttributes:P=new Set([]),errorHandler:J}=e;Or(J);const H=V?window.parent===window:!0;let xe=!1;if(!H)try{window.parent.document&&(xe=!1)}catch{xe=!0}if(H&&!t)throw new Error("emit function is required");v!==void 0&&b.mousemove===void 0&&(b.mousemove=v),U.reset();const Ue=p===!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}:h!==void 0?h:{password:!0},je=m===!0||m==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:m==="all",headMetaDescKeywords:m==="all"}:m||{};br();let Wt,ze=0;const Ut=k=>{for(const B of C||[])B.eventProcessor&&(k=B.eventProcessor(k));return S&&!xe&&(k=S(k)),k};E=(k,B)=>{var x;const L=k;if(L.timestamp=Me(),((x=Q[0])==null?void 0:x.isFrozen())&&L.type!==w.FullSnapshot&&!(L.type===w.IncrementalSnapshot&&L.data.source===I.Mutation)&&Q.forEach(G=>G.unfreeze()),H)t?.(Ut(L),B);else if(xe){const G={type:"rrweb",event:Ut(L),origin:window.location.origin,isCheckout:B};window.parent.postMessage(G,"*")}if(L.type===w.FullSnapshot)Wt=L,ze=0;else if(L.type===w.IncrementalSnapshot){if(L.data.source===I.Mutation&&L.data.isAttachIframe)return;ze++;const G=n&&ze>=n,O=r&&L.timestamp-Wt.timestamp>r;(G||O)&&Ee(!0)}};const Le=k=>{E({type:w.IncrementalSnapshot,data:$({source:I.Mutation},k)})},jt=k=>E({type:w.IncrementalSnapshot,data:$({source:I.Scroll},k)}),zt=k=>E({type:w.IncrementalSnapshot,data:$({source:I.CanvasMutation},k)}),In=k=>E({type:w.IncrementalSnapshot,data:$({source:I.AdoptedStyleSheet},k)}),ee=new yn({mutationCb:Le,adoptedStyleSheetCb:In}),te=new qr({mirror:U,mutationCb:Le,stylesheetManager:ee,recordCrossOriginIframes:V,wrappedEmit:E});for(const k of C||[])k.getMirror&&k.getMirror({nodeMirror:U,crossOriginIframeMirror:te.crossOriginIframeMirror,crossOriginIframeStyleMirror:te.crossOriginIframeStyleMirror});const Be=new gn;We=new fn({recordCanvas:D,mutationCb:zt,win:window,blockClass:o,blockSelector:a,mirror:U,sampling:b.canvas,dataURLOptions:g});const Ne=new Zr({mutationCb:Le,scrollCb:jt,bypassOptions:{blockClass:o,blockSelector:a,maskTextClass:s,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:Ue,dataURLOptions:g,maskTextFn:u,maskInputFn:f,recordCanvas:D,inlineImages:X,sampling:b,slimDOMOptions:je,iframeManager:te,stylesheetManager:ee,canvasManager:We,keepIframeSrcFn:Z,processedNodeManager:Be},mirror:U});Ee=(k=!1)=>{if(!R)return;E({type:w.Meta,data:{href:window.location.href,width:ot(),height:nt()}},k),ee.reset(),Ne.init(),Q.forEach(x=>x.lock());const B=gr(document,{mirror:U,blockClass:o,blockSelector:a,maskTextClass:s,maskTextSelector:c,inlineStylesheet:d,maskAllInputs:Ue,maskTextFn:u,slimDOM:je,dataURLOptions:g,recordCanvas:D,inlineImages:X,onSerialize:x=>{it(x,U)&&te.addIframe(x),lt(x,U)&&ee.trackLinkElement(x),Pe(x)&&Ne.addShadowRoot(x.shadowRoot,document)},onIframeLoad:(x,L)=>{te.attachIframe(x,L),Ne.observeAttachShadow(x)},onStylesheetLoad:(x,L)=>{ee.attachLinkElement(x,L)},keepIframeSrcFn:Z});if(!B)return console.warn("Failed to snapshot the document");E({type:w.FullSnapshot,data:{node:B,initialOffset:rt(window)}},k),Q.forEach(x=>x.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ee.adoptStyleSheets(document.adoptedStyleSheets,U.getId(document))};try{const k=[],B=L=>{var G;return M(Gr)({mutationCb:Le,mousemoveCb:(O,Ve)=>E({type:w.IncrementalSnapshot,data:{source:Ve,positions:O}}),mouseInteractionCb:O=>E({type:w.IncrementalSnapshot,data:$({source:I.MouseInteraction},O)}),scrollCb:jt,viewportResizeCb:O=>E({type:w.IncrementalSnapshot,data:$({source:I.ViewportResize},O)}),inputCb:O=>E({type:w.IncrementalSnapshot,data:$({source:I.Input},O)}),mediaInteractionCb:O=>E({type:w.IncrementalSnapshot,data:$({source:I.MediaInteraction},O)}),styleSheetRuleCb:O=>E({type:w.IncrementalSnapshot,data:$({source:I.StyleSheetRule},O)}),styleDeclarationCb:O=>E({type:w.IncrementalSnapshot,data:$({source:I.StyleDeclaration},O)}),canvasMutationCb:zt,fontCb:O=>E({type:w.IncrementalSnapshot,data:$({source:I.Font},O)}),selectionCb:O=>{E({type:w.IncrementalSnapshot,data:$({source:I.Selection},O)})},customElementCb:O=>{E({type:w.IncrementalSnapshot,data:$({source:I.CustomElement},O)})},blockClass:o,ignoreClass:l,ignoreSelector:i,maskTextClass:s,maskTextSelector:c,maskInputOptions:Ue,inlineStylesheet:d,sampling:b,recordDOM:R,recordCanvas:D,inlineImages:X,userTriggeredOnInput:j,collectFonts:z,doc:L,maskInputFn:f,maskTextFn:u,keepIframeSrcFn:Z,blockSelector:a,slimDOMOptions:je,dataURLOptions:g,mirror:U,iframeManager:te,stylesheetManager:ee,shadowDomManager:Ne,processedNodeManager:Be,canvasManager:We,ignoreCSSAttributes:P,plugins:((G=C?.filter(O=>O.observer))==null?void 0:G.map(O=>({observer:O.observer,options:O.options,callback:Ve=>E({type:w.Plugin,data:{plugin:O.name,payload:Ve}})})))||[]},y)};te.addLoadListener(L=>{try{k.push(B(L.contentDocument))}catch(G){console.warn(G)}});const x=()=>{Ee(),k.push(B(document)),Re=!0};return document.readyState==="interactive"||document.readyState==="complete"?x():(k.push(A("DOMContentLoaded",()=>{E({type:w.DomContentLoaded,data:{}}),W==="DOMContentLoaded"&&x()})),k.push(A("load",()=>{E({type:w.Load,data:{}}),W==="load"&&x()},window))),()=>{k.forEach(L=>L()),Be.destroy(),Re=!1,Tr()}}catch(k){console.warn(k)}}return fe.addCustomEvent=(e,t)=>{if(!Re)throw new Error("please add custom event after start recording");E({type:w.Custom,data:{tag:e,payload:t}})},fe.freezePage=()=>{Q.forEach(e=>e.freeze())},fe.takeFullSnapshot=e=>{if(!Re)throw new Error("please take full snapshot after start recording");Ee(e)},fe.mirror=U,fe}();
|
|
7
|
-
|
|
8
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("rrwebRecord")):"function"==typeof define&&define.amd?define(["rrwebRecord"],e):"object"==typeof exports?exports.Statsig=e(require("rrwebRecord")):t.Statsig=e(t.rrwebRecord)}(this,e=>(()=>{"use strict";var i={3331:t=>{t.exports=e},1845:(t,i,e)=>{var n;$Q2(i,"__esModule",{value:!0}),i.t=i.i=i.l=void 0;const s=e(7512);i.l=()=>{try{return"undefined"!=typeof __STATSIG__?__STATSIG__:u}catch(t){return u}},i.i=t=>(0,i.l)()[t];i.t=t=>{var e=(0,i.l)();return t?e.instances&&e.instances[t]:(e.instances&&1<Object.keys(e.instances).length&&s.Log.warn("Call made to Statsig global instance without an SDK key but there is more than one client instance. If you are using mulitple clients, please specify the SDK key."),e.firstInstance)};var r="__STATSIG__",l="undefined"!=typeof window?window:{},e=void 0!==e.g?e.g:{},o="undefined"!=typeof globalThis?globalThis:{};const u=null!=(n=null!=(n=null!=(n=l[r])?n:e[r])?n:o[r])?n:{instance:i.t};l[r]=u,e[r]=u,o[r]=u},2137:(t,e,i)=>{$Q(e),e.o=e.u=void 0;const s=i(1406);function n(t,e,i){if(i)return i(t,e);const n=e&&e.customIDs?e.customIDs:{};e=["uid:"+(null!=(i=null==e?void 0:e.userID)?i:""),"cids:"+Object.keys(n).sort((t,e)=>t.localeCompare(e)).map(t=>t+"-"+n[t]).join(","),"k:"+t];return(0,s.h)(e.join("|"))}e.u=n,e.o=function(t,e,i){return e?n(t,e,i):(0,s.h)("k:"+t)}},6427:(t,e)=>{$Q(e)},694:function(t,e,i){var s=this&&this.__awaiter||$A();$Q(e),e.Wn=e.DataAdapterCore=void 0;const u=i(7512),a=i(9122),r=i(8578),l=i(4534),c=i(3401);function h(t,e,i,n){return{source:t,data:e,receivedAt:Date.now(),stableID:i,fullUserHash:(0,r.v)(n)}}e.DataAdapterCore=class{constructor(t,e){this._=t,this.p=e,this.m=null,this.O=null,this.j="statsig.last_modified_time."+e,this.S=new n}attach(t,e,i){this.O=t,this.m=e}getDataSync(t){var t=t&&(0,r.T)(t,this.m),e=this.k(t),i=this.S.get(e,t);return i&&this.Li(i)?i:(i=this.I(e))&&this.Li(i)?(this.S.add(e,i),this.S.get(e,t)):null}setData(t,e){var e=e&&(0,r.T)(e,this.m),i=this.k(e);this.S.add(i,h("Bootstrap",t,null,e))}Li(t){return null==t.stableID||t.stableID===a.StableID.get(this.C())}D(e,i,n){return s(this,void 0,void 0,function*(){l.Storage.isReady()||(yield l.Storage.isReadyResolver());var t=null!=e?e:this.getDataSync(i),t=[this.M(t,i,n)];return null!=n&&n.timeoutMs&&t.push(new Promise(t=>setTimeout(t,n.timeoutMs)).then(()=>(u.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(t)})}A(i,n){return s(this,void 0,void 0,function*(){var t=i&&(0,r.T)(i,this.m),e=this.k(t),t=yield this.D(null,t,n);t&&this.S.add(e,$P($P({},t),{source:"Prefetch"}))})}M(r,l,o){return s(this,void 0,void 0,function*(){var t=null!=(t=null==r?void 0:r.data)?t:null,e=null!=r&&this.N(r,l),e=yield this.R(t,l,o,e);if(!e)return u.Log.debug("No response returned for latest value"),null;var i=(0,c.P)(e,"has_updates","Response"),n=this.C(),n=a.StableID.get(n);let s=null;if(!0===(null==i?void 0:i.has_updates))s=h("Network",e,n,l);else{if(!t||!1!==(null==i?void 0:i.has_updates))return null;s=h("NetworkNotModified",t,n,l)}e=this.k(l);return this.S.add(e,s),this.U(e,s),s})}C(){return null!=this.O?this.O:(u.Log.error(this._+" is not attached to a Client"),"")}I(t){var e=null==(e=l.Storage.getItem)?void 0:e.call(l.Storage,t);return null!=e&&(t=(0,c.P)(e,"source","Cached Result"))?$P($P({},t),{source:"Cache"}):null}U(t,e){l.Storage.setItem(t,JSON.stringify(e)),this.F(t)}F(t){var e=null!=(e=(0,l.G)(this.j))?e:{},t=(e[t]=Date.now(),o(e,10));t&&(delete e[t],l.Storage.removeItem(t)),(0,l.L)(this.j,e)}},e.Wn=h;class n{constructor(){this.K={}}get(t,e){var t=this.K[t],i=null==t?void 0:t.stableID,e=null==(e=null==e?void 0:e.customIDs)?void 0:e.stableID;return e&&i&&e!==i?(u.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):t}add(t,e){var i=o(this.K,9);i&&delete this.K[i],this.K[t]=e}merge(t){this.K=$P($P({},this.K),t)}}function o(s,t){var e=Object.keys(s);return e.length<=t?null:e.reduce((t,e)=>{var i=s[t],n=s[e];return"object"==typeof i&&"object"==typeof n?n.receivedAt<i.receivedAt?e:t:n<i?e:t})}},8962:(t,l)=>{$Q2(l,"__esModule",{value:!0}),l.Diagnostics=void 0;const n=new Map,i="start";function s(t,e,i,n){return $P({key:i,action:e,step:n,timestamp:Date.now()},t)}function r(t,e){var i=null!=(i=n.get(t))?i:[];i.push(e),n.set(t,i)}function e(t,e){if(e in t)return t[e]}l.Diagnostics={q:t=>n.get(t),B:t=>{r(t,s({},i,"overall"))},V:(t,e,i)=>{r(t,s({success:e,error:e?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:i},"end","overall"))},J:(t,e)=>{r(t,s(e,i,"initialize","network_request"))},$:(t,e)=>{r(t,s(e,"end","initialize","network_request"))},W:t=>{r(t,s({},i,"initialize","process"))},H:(t,e)=>{r(t,s(e,"end","initialize","process"))},Y:t=>{n.delete(t)},X(t){if(t&&"object"==typeof t)return{code:e(t,"code"),name:e(t,"name"),message:e(t,"message")}},Z(t,e,i,n){return{success:!0===(null==t?void 0:t.ok),statusCode:null==t?void 0:t.status,sdkRegion:null==(t=null==t?void 0:t.headers)?void 0:t.get("x-statsig-region"),isDelta:!0===i.includes('"is_delta":true')||void 0,attempt:e,error:l.Diagnostics.X(n)}},tt(t,e,i,n){var s,r=l.Diagnostics.q(i);return null==r||r.length<=0?-1:(s=r[r.length-1].timestamp-r[0].timestamp,l.Diagnostics.Y(i),i=function(t,e){t={eventName:"statsig::diagnostics",user:t,value:null,metadata:e,time:Date.now()};return t}(t,{context:"initialize",markers:r.slice(),statsigOptions:n}),e.enqueue(i),s)}}},8809:function(t,e){var i=this&&this.__awaiter||$A();$Q(e),e.et=void 0;const s=new Uint8Array([0,0,1,0,0,1,0,0,0,0,0,0,13,102,101,97,116,117,114,101,97,115,115,101,116,115,3,111,114,103,0,0,16,0,1]),r="https://cloudflare-dns.com/dns-query",l=["i","e","d"],o=200;e.et=function(e){return i(this,void 0,void 0,function*(){var i=yield e(r,{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:s});if(i.ok){var t,i=yield i.arrayBuffer(),i=new Uint8Array(i);{var n=i,i=n.findIndex((t,e)=>e<o&&"="===String.fromCharCode(t)&&l.includes(String.fromCharCode(n[e-1])));if(-1===i)throw(t=new Error("Failed to parse TXT records from DNS")).name="DnsTxtParseError",t;let e="";for(let t=i-1;t<n.length;t++)e+=String.fromCharCode(n[t]);return e.split(",")}}throw(t=new Error("Failed to fetch TXT records from DNS")).name="DnsTxtFetchError",t})}},3539:(t,e)=>{$Q(e)},5542:function(t,o,e){var i=this&&this.__awaiter||$A();$Q2(o,"__esModule",{value:!0}),o.ErrorBoundary=o.EXCEPTION_ENDPOINT=void 0;const n=e(7512),u=e(5902),a=e(8e3),c=(o.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception","[Statsig] UnknownError");function h(t){return t instanceof Error?t:"string"==typeof t?new Error(t):new Error("An unknown error occurred.")}o.ErrorBoundary=class{constructor(t,e,i,n){this.O=t,this.m=e,this.nt=i,this.qn=n,this.it=new Set}wrap(n,s){try{const t=n;!function(t){const e=new Set;let i=Object.getPrototypeOf(t);for(;i&&i!==Object.prototype;)Object.getOwnPropertyNames(i).filter(t=>"function"==typeof(null===i||void 0===i?void 0:i[t])).forEach(t=>e.add(t)),i=Object.getPrototypeOf(i);return Array.from(e)}(t).forEach(e=>{const i=t[e];"$EB"in i||(t[e]=(...t)=>this.rt(s?s+":"+e:e,()=>i.apply(n,t)),t[e].$EB=!0)})}catch(t){this.st("eb:wrap",t)}}logError(t,e){this.st(t,e)}getLastSeenErrorAndReset(){var t=this.qn;return this.qn=void 0,null!=t?t:null}attachErrorIfNoneExists(t){this.qn||(this.qn=h(t))}rt(e,t){try{var i=t();return i&&i instanceof Promise?i.catch(t=>this.st(e,t)):i}catch(t){return this.st(e,t),null}}st(r,l){try{n.Log.warn("Caught error in "+r,{error:l});i(this,void 0,void 0,function*(){var t,e=l||Error(c),i=e instanceof Error,n=i?e.name:"No Name",s=h(e);this.qn=s,this.it.has(n)||(this.it.add(n),null!=(s=null==(s=this.m)?void 0:s.networkConfig)&&s.preventAllNetworkTraffic?null!=(s=this.nt)&&s.call(this,{name:"error",error:l,tag:r}):(s=u.SDKType.lt(this.O),t=a.StatsigMetadataProvider.get(),i=i?e.stack:function(t){try{return JSON.stringify(t)}catch(t){return c}}(e),e=$P({tag:r,exception:n,info:i,statsigOptions:function(t){if(!t)return{};const i={};return Object.entries(t).forEach(([t,e])=>{switch(typeof e){case"number":case"bigint":case"boolean":i[String(t)]=e;break;case"string":e.length<50?i[String(t)]=e:i[String(t)]="set";break;case"object":"environment"===t?i.environment=e:"networkConfig"===t?i.networkConfig=e:i[String(t)]=null!=e?"set":"unset"}}),i}(this.m)},$P($P({},t),{sdkType:s})),yield(null!=(n=null==(i=null==(n=this.m)?void 0:n.networkConfig)?void 0:i.networkOverrideFunc)?n:fetch)(o.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this.O,"STATSIG-SDK-TYPE":String(s),"STATSIG-SDK-VERSION":String(t.sdkVersion),"Content-Type":"application/json"},body:JSON.stringify(e)}),null!=(i=this.nt)&&i.call(this,{name:"error",error:l,tag:r})))}).then(()=>{}).catch(()=>{})}catch(t){}}}},2922:(t,e)=>{$Q(e)},2417:(t,e)=>{$Q(e)},7770:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.EventLogger=void 0;const s=i(2137),r=i(1406),l=i(7512),o=i(7410),u=i(6830),a=i(1637),c=i(586),h=i(4534),d=i(1881),v=i(2397),f={},g={Startup:"startup",GainedFocus:"gained_focus"};class _{static ot(t){null!=(t=f[t])&&t.flush().catch(()=>{})}static ut(t){null!=(t=f[t])&&t.ct(g.GainedFocus)}constructor(t,e,i,n){this.O=t,this.nt=e,this.ht=i,this.m=n,this.dt=[],this.vt={},this.ft={},this._t=!1,this.gt=Date.now(),this.Yn=null!=(t=null==n?void 0:n.loggingEnabled)?t:!0===(null==n?void 0:n.disableLogging)?c.LoggingEnabledOption.disabled:c.LoggingEnabledOption.browserOnly,null!=n&&n.loggingEnabled&&void 0!==n.disableLogging&&l.Log.warn("Detected both loggingEnabled and disableLogging options. loggingEnabled takes precedence - please remove disableLogging."),this.yt=null!=(e=null==n?void 0:n.loggingBufferMaxSize)?e:100;i=null==n?void 0:n.networkConfig;this.Ot=new d.UrlConfiguration(o.Endpoint.jt,null==i?void 0:i.logEventUrl,null==i?void 0:i.api,null==i?void 0:i.logEventFallbackUrls)}setLogEventCompressionMode(t){this.ht.setLogEventCompressionMode(t)}setLoggingEnabled(t){this.Yn=t}enqueue(t){this.St(t)&&(this.wt(t),this.Tt(),this.dt.length>this.yt)&&_.ot(this.O)}incrementNonExposureCount(t){var e=null!=(e=this.ft[t])?e:0;this.ft[t]=e+1}reset(){this.flush().catch(()=>{}),this.vt={}}start(){var t,e=(0,u.kt)();e&&"always"!==(null==(t=this.m)?void 0:t.loggingEnabled)||(f[this.O]=this,e||(0,v.It)(t=>{"background"===t?_.ot(this.O):"foreground"===t&&_.ut(this.O)}),this.ct(g.Startup),this.Dt())}stop(){return n(this,void 0,void 0,function*(){this.Et&&(clearInterval(this.Et),this.Et=null),delete f[this.O],yield this.flush()})}flush(){return n(this,void 0,void 0,function*(){var t;this.Mt(),0!==this.dt.length&&(t=this.dt,this.dt=[],yield this.At(t))})}Tt(){this._t||(this._t=!0,200<Date.now()-this.gt)||setTimeout(()=>_.ot(this.O),200)}St(t){if("always"!==(null==(e=this.m)?void 0:e.loggingEnabled)&&(0,u.kt)())return!1;if((0,a.xt)(t)){var e=t.user||{statsigEnvironment:void 0},e=(0,s.u)(this.O,e),i=t.metadata||{},t=[t.eventName,e,i.gate,i.config,i.ruleID,i.allocatedExperiment,i.parameterName,String(i.isExplicitParameter),i.reason].join("|"),e=this.vt[t],i=Date.now();if(e&&i-e<6e5)return!1;1e3<Object.keys(this.vt).length&&(this.vt={}),this.vt[t]=i}return!0}At(s){return n(this,void 0,void 0,function*(){var t,e;if("disabled"===this.Yn)return this.Nt(s),!1;try{var i=(0,v.Rt)()&&this.ht.isBeaconSupported()&&null==(null==(e=null==(t=this.m)?void 0:t.networkConfig)?void 0:e.networkOverrideFunc),n=(this.nt({name:"pre_logs_flushed",events:s}),i?this.Pt(s):yield this.Ct(s));return n.success?(this.nt({name:"logs_flushed",events:s}),!0):(l.Log.warn("Failed to flush events."),this.Nt(s),!1)}catch(t){return l.Log.warn("Failed to flush events."),!1}})}Ct(e){return n(this,void 0,void 0,function*(){var t=yield this.ht.post(this.Ut(e)),t=null!=(t=null==t?void 0:t.code)?t:-1;return{success:200<=t&&t<300}})}Pt(t){return{success:this.ht.beacon(this.Ut(t))}}Ut(t){return{sdkKey:this.O,data:{events:t},urlConfig:this.Ot,retries:3,isCompressable:!0,params:{[o.NetworkParam.EventCount]:String(t.length)},credentials:"same-origin"}}Nt(t){for(;500<t.length;)t.shift();var e=this.o();try{(0,h.L)(e,t)}catch(t){l.Log.warn("Unable to save failed logs to storage")}}ct(e){const i=this.o();n(this,void 0,void 0,function*(){h.Storage.isReady()||(yield h.Storage.isReadyResolver());var t=(0,h.G)(i);t&&(e===g.Startup&&h.Storage.removeItem(i),yield this.At(t))&&e===g.GainedFocus&&h.Storage.removeItem(i)}).catch(()=>{l.Log.warn("Failed to flush stored logs")})}o(){return"statsig.failed_logs."+(0,r.h)(this.O)}wt(t){t.user&&(t.user=$P({},t.user),delete t.user.privateAttributes);var e={},i=this.Ft(),i=(i&&(e.statsigMetadata={currentPage:i}),$P($P({},t),e));l.Log.debug("Enqueued Event:",i),this.dt.push(i)}Mt(){0!==Object.keys(this.ft).length&&(this.wt({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:$P({},this.ft)}}),this.ft={})}Ft(){var t;if(!1!==(null==(t=this.m)?void 0:t.includeCurrentPageUrlWithEvents))return(0,u.Gt)()}Dt(){var t=null!=(t=null==(t=this.m)?void 0:t.loggingIntervalMs)?t:1e4;const e=setInterval(()=>{var t=f[this.O];t&&t.Et===e?_.ot(this.O):clearInterval(e)},t);this.Et=e}}e.EventLogger=_},1406:(t,r,e)=>{$Q2(r,"__esModule",{value:!0}),r.Lt=r.Kt=r.h=void 0;const l=e(6634);r.h=e=>{let i=0;for(let t=0;t<e.length;t++){var n=e.charCodeAt(t);i=(i<<5)-i+n,i&=i}return String(i>>>0)},r.Kt=(t,e)=>(0,r.h)(JSON.stringify((0,r.Lt)(t,e)));r.Lt=(i,n)=>{if(null==i)return null;var t=Object.keys(i).sort();const s={};return t.forEach(t=>{var e=i[t];0===n||"object"!==(0,l.zt)(e)?s[t]=e:s[t]=(0,r.Lt)(e,null!=n?n-1:n)}),s}},1333:(t,e)=>{$Q(e)},7512:(t,e)=>{$Q(e),e.Log=e.LogLevel=void 0;function i(t){return t.unshift("[Statsig]"),t}e.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class n{static info(...t){n.level>=e.LogLevel.Info&&console.info(" INFO ",...i(t))}static debug(...t){n.level>=e.LogLevel.Debug&&console.debug(" DEBUG ",...i(t))}static warn(...t){n.level>=e.LogLevel.Warn&&console.warn(" WARN ",...i(t))}static error(...t){n.level>=e.LogLevel.Error&&console.error(" ERROR ",...i(t))}}(e.Log=n).level=e.LogLevel.Warn},7787:(t,e)=>{$Q(e),e.createMemoKey=e.MemoPrefix=void 0,e.MemoPrefix={Kn:"g",Ln:"c",Vn:"e",Ts:"cl",$n:"l",Bn:"p"};const r=new Set([]),l=new Set(["userPersistedValues"]);e.createMemoKey=function(t,e,i){let n=t+"|"+e;if(i)for(const s of Object.keys(i)){if(l.has(s))return;r.has(s)?n+=`|${s}=true`:n+=`|${s}=`+i[s]}return n}},7410:(t,e)=>{$Q(e),e.NetworkParam=e.NetworkDefault=e.Endpoint=void 0,e.Endpoint={qt:"initialize",jt:"rgstr",Bt:"download_config_specs"},e.NetworkDefault={[e.Endpoint.jt]:"https://prodregistryv2.org/v1",[e.Endpoint.qt]:"https://featureassets.org/v1",[e.Endpoint.Bt]:"https://api.statsigcdn.com/v1"},e.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}},7023:function(t,e,i){var m=this&&this.__awaiter||$A();$Q(e),e.NetworkCore=void 0,i(1845);const v=i(1845),O=i(8962),j=i(7512),S=i(7410),n=i(308),f=i(3091),l=i(5902),s=i(6830),o=i(4143),u=i(9122),w=i(2636),a=i(8e3),g=i(586),k=i(2397),E=500,R=3e4;const D=new Set([408,500,502,503,504,522,524,599]);e.NetworkCore=class{constructor(t,e){this.nt=e,this.$t=null,this.Vt=1e4,this.Jt={},this.m={},this.Oi={},this.Jn=null,t&&(this.m=t),this.m.networkConfig&&(this.Jt=this.m.networkConfig),this.Jt.networkTimeoutMs&&(this.Vt=this.Jt.networkTimeoutMs),this.Wt=new n.NetworkFallbackResolver(this.m),this.setLogEventCompressionMode(this.Qn(t))}setLogEventCompressionMode(t){this.m.logEventCompressionMode=t}setErrorBoundary(t){this.$t=t,this.$t.wrap(this),this.$t.wrap(this.Wt),this.Wt.setErrorBoundary(t)}isBeaconSupported(){return"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon}getLastUsedInitUrlAndReset(){var t=this.Jn;return this.Jn=null,t}beacon(t){var e,i;return!!T(t)&&(t=this.Ht("POST",t),e=this.Xt(t),(i=navigator).sendBeacon.bind(i)(e,t.body))}post(e){return m(this,void 0,void 0,function*(){var t=this.Ht("POST",e);return this.Pi(t),yield this.Ci(t),this.Zt(t)})}get(t){t=this.Ht("GET",t);return this.Zt(t)}Zt(y){return m(this,void 0,void 0,function*(){var e;if(!T(y))return null;if(this.Jt.preventAllNetworkTraffic)return null;var{method:i,body:n,retries:s,attempt:r}=y,l=y.urlConfig.endpoint;if(this.Si(l))return j.Log.warn(`Request to ${l} was blocked because you are making requests too frequently.`),null;r=null!=r?r:1;const o="undefined"!=typeof AbortController?new AbortController:null;var t=setTimeout(()=>{null!==o&&void 0!==o&&o.abort(`Timeout of ${this.Vt}ms expired.`)},this.Vt),u=this.Xt(y);let a=null;var c,h=(0,k.Rt)();try{var d,v,f,g={method:i,body:n,headers:$P({},y.headers),signal:null===o||void 0===o?void 0:o.signal,priority:y.priority,keepalive:h},_=(c=r,(p=y).urlConfig.endpoint===S.Endpoint.qt&&O.Diagnostics.J(p.sdkKey,{attempt:c}),this.Oi[l]),b=(_&&(_.lastRequestTime=Date.now(),this.Oi[l]=_),null!=(e=this.Jt.networkOverrideFunc)?e:fetch);if(a=yield b(u,g),clearTimeout(t),a.ok)return f=yield a.text(),I(y,a,r,f),this.Wt.tryBumpExpiryTime(y.sdkKey,y.urlConfig),{body:f,code:a.status};throw d=yield a.text().catch(()=>"No Text"),(v=new Error(`NetworkError: ${u} `+d)).name="NetworkError",v}catch(t){var n=function(t,e){if(null!=t&&t.signal.aborted&&"string"==typeof t.signal.reason)return t.signal.reason;if("string"==typeof e)return e;if(e instanceof Error)return e.name+": "+e.message;return"Unknown Error"}(o,t),h=function(t){t=(null==t?void 0:t.signal.aborted)&&"string"==typeof t.signal.reason&&t.signal.reason.includes("Timeout");return t||!1}(o),p=(I(y,a,r,"",t),yield this.Wt.tryFetchUpdatedFallbackInfo(y.sdkKey,y.urlConfig,n,h));return(p&&(y.fallbackUrl=this.Wt.getActiveFallbackUrl(y.sdkKey,y.urlConfig)),!s||s<r||!D.has(null!=(c=null===a||void 0===a?void 0:a.status)?c:500))?(null!=(l=this.nt)&&l.call(this,{name:"error",error:t,tag:w.ErrorTag.NetworkError,requestArgs:y}),_=`A networking error occurred during ${i} request to ${u}.`,j.Log.error(_,n,t),null!=(e=this.$t)&&e.attachErrorIfNoneExists(_),null):(yield function(e){return m(this,void 0,void 0,function*(){yield new Promise(t=>setTimeout(t,Math.min(E*(e*e),R)))})}(r),this.Zt($P($P({},y),{retries:s,attempt:r+1})))}})}Qn(t){let e=null==t?void 0:t.logEventCompressionMode;return e=(e=e||!0!==(null==t?void 0:t.disableCompression)?e:g.LogEventCompressionMode.Disabled)||g.LogEventCompressionMode.Enabled}Si(t){var e=Date.now(),i=null!=(i=this.Oi[t])?i:{count:0,lastRequestTime:e},n=e-i.lastRequestTime,n=Math.floor(.05*n);return i.count=Math.max(0,i.count-n),50<=i.count||(i.count+=1,i.lastRequestTime=e,this.Oi[t]=i,!1)}Xt(t){var e=null!=(e=t.fallbackUrl)?e:t.urlConfig.getUrl();t.urlConfig.endpoint!==S.Endpoint.qt&&t.urlConfig.endpoint!==S.Endpoint.Bt||(this.Jn=e);const i=$P({[S.NetworkParam.SdkKey]:t.sdkKey,[S.NetworkParam.SdkType]:l.SDKType.lt(t.sdkKey),[S.NetworkParam.SdkVersion]:a.SDK_VERSION,[S.NetworkParam.Time]:String(Date.now()),[S.NetworkParam.SessionID]:o.SessionID.get(t.sdkKey)},t.params);t=Object.keys(i).map(t=>encodeURIComponent(t)+"="+encodeURIComponent(i[t])).join("&");return e+(t?"?"+t:"")}Pi(e){var t,i=(0,s.te)(),n=e.body;if(e.isStatsigEncodable&&!this.m.disableStatsigEncoding&&"string"==typeof n&&null==(0,v.i)("no-encode")&&null!=i&&i.btoa)try{e.body=i.btoa(n).split("").reverse().join(""),e.params=$P($P({},null!=(t=e.params)?t:{}),{[S.NetworkParam.StatsigEncoded]:"1"})}catch(t){j.Log.warn("Request encoding failed for "+e.urlConfig.getUrl(),t)}}Ci(d){return m(this,void 0,void 0,function*(){var e,i=d.body;if("string"==typeof i&&function(t,e){if(!t.isCompressable)return;if(null!=(0,v.i)("no-compress")||"undefined"==typeof CompressionStream||"undefined"==typeof TextEncoder)return;var i=null!=t.urlConfig.customUrl||null!=t.urlConfig.fallbackUrls,n=!0===f.SDKFlags.get(t.sdkKey,"enable_log_event_compression");switch(e.logEventCompressionMode){case g.LogEventCompressionMode.Disabled:return;case g.LogEventCompressionMode.Enabled:return i&&!n?void 0:1;case g.LogEventCompressionMode.Forced:return 1;default:return}}(d,this.m))try{for(var n,s=(new TextEncoder).encode(i),r=new CompressionStream("gzip"),l=r.writable.getWriter(),o=(l.write(s).catch(j.Log.error),l.close().catch(j.Log.error),r.readable.getReader()),u=[];!(n=yield o.read()).done;)u.push(n.value);var a=u.reduce((t,e)=>t+e.length,0),c=new Uint8Array(a);let t=0;for(const h of u)c.set(h,t),t+=h.length;d.body=c,d.params=$P($P({},null!=(e=d.params)?e:{}),{[S.NetworkParam.IsGzipped]:"1"})}catch(t){j.Log.warn("Request compression failed for "+d.urlConfig.getUrl(),t)}})}Ht(t,e){var i=this.Wt.getActiveFallbackUrl(e.sdkKey,e.urlConfig),t=$P($P({},e),{method:t,fallbackUrl:i});return"data"in e&&r(t,e.data),t}};const T=t=>!!t.sdkKey||(j.Log.warn("Unable to make request without an SDK key"),!1),r=(t,e)=>{var{sdkKey:i,fallbackUrl:n}=t,s=u.StableID.get(i),r=o.SessionID.get(i),i=l.SDKType.lt(i);t.body=JSON.stringify($P($P({},e),{statsigMetadata:$P($P({},a.StatsigMetadataProvider.get()),{stableID:s,sessionID:r,sdkType:i,fallbackUrl:n})}))};function I(t,e,i,n,s){t.urlConfig.endpoint===S.Endpoint.qt&&O.Diagnostics.$(t.sdkKey,O.Diagnostics.Z(e,i,n,s))}},308:function(t,e,i){var o=this&&this.__awaiter||$A();$Q(e),e.ee=e.NetworkFallbackResolver=void 0;const l=i(8809),n=i(1406),r=i(7512),u=i(4534);function a(t,e){t=null!=(t=null==t?void 0:t.toLowerCase())?t:"";return e||t.includes("uncaught exception")||t.includes("failed to fetch")||t.includes("networkerror when attempting to fetch resource")}function c(t){return"statsig.network_fallback."+(0,n.h)(t)}function h(t,e){t=c(t);e&&0!==Object.keys(e).length?u.Storage.setItem(t,JSON.stringify(e)):u.Storage.removeItem(t)}e.NetworkFallbackResolver=class{constructor(t){this.ne=null,this.$t=null,this.ie={},this.re=null==(t=t.networkConfig)?void 0:t.networkOverrideFunc}setErrorBoundary(t){this.$t=t}tryBumpExpiryTime(t,e){var i=null==(i=this.ne)?void 0:i[e.endpoint];i&&(i.expiryTime=Date.now()+6048e5,h(t,$P($P({},this.ne),{[e.endpoint]:i})))}getActiveFallbackUrl(t,e){var i;if(null!=e.customUrl&&null!=e.fallbackUrls)return null;let n=this.ne;null==n&&(n=null!=(s=function(t){t=c(t),t=u.Storage.getItem(t);if(!t)return null;try{return JSON.parse(t)}catch(t){return r.Log.error("Failed to parse FallbackInfo"),null}}(t))?s:{},this.ne=n);var s=n[e.endpoint];return!s||Date.now()>(null!=(i=s.expiryTime)?i:0)||e.getChecksum()!==s.urlConfigChecksum?(delete n[e.endpoint],this.ne=n,h(t,this.ne),null):s.url||null}tryFetchUpdatedFallbackInfo(n,s,r,l){return o(this,void 0,void 0,function*(){var e,t,i;try{return a(r,l)?(t=null==s.customUrl&&null==s.fallbackUrls?yield this.se(s):s.fallbackUrls,!!(i=this.le(null==(e=this.ne)?void 0:e[s.endpoint],t))&&(this.oe(n,s,i),!0)):!1}catch(t){return null!=(e=this.$t)&&e.logError("tryFetchUpdatedFallbackInfo",t),!1}})}oe(t,e,i){var i={urlConfigChecksum:e.getChecksum(),url:i,expiryTime:Date.now()+6048e5,previous:[]},e=e.endpoint,n=null==(n=this.ne)?void 0:n[e],n=(n&&i.previous.push(...n.previous),10<i.previous.length&&(i.previous=[]),null==(n=null==(n=this.ne)?void 0:n[e])?void 0:n.url);null!=n&&i.previous.push(n),this.ne=$P($P({},this.ne),{[e]:i}),h(t,this.ne)}se(r){return o(this,void 0,void 0,function*(){var t=this.ie[r.endpoint];if(t&&Date.now()<t)return null;this.ie[r.endpoint]=Date.now()+144e5;var e=[],t=yield(0,l.et)(null!=(t=this.re)?t:fetch),i=function(t){try{return new URL(t).pathname}catch(t){return null}}(r.defaultUrl);for(const s of t)if(s.startsWith(r.endpointDnsKey+"=")){var n=s.split("=");if(1<n.length){let t=n[1];t.endsWith("/")&&(t=t.slice(0,-1)),e.push("https://"+t+i)}}return e})}le(t,e){var i;if(null==e)return null;var n=new Set(null!=(i=null==t?void 0:t.previous)?i:[]),s=null==t?void 0:t.url;let r=null;for(const o of e){var l=o.endsWith("/")?o.slice(0,-1):o;if(!n.has(o)&&l!==s){r=l;break}}return r}},e.ee=a},1405:(t,e)=>{$Q(e)},1361:(t,e)=>{$Q(e)},3091:(t,e)=>{$Q(e),e.SDKFlags=void 0;const i={};e.SDKFlags={setFlags:(t,e)=>{i[t]=e},get:(t,e)=>{return null!=(t=null==(t=i[t])?void 0:t[e])&&t}}},5902:(t,e)=>{$Q(e),e.SDKType=void 0;const i={};let n;e.SDKType={lt:t=>{return(null!=(t=i[t])?t:"js-mono")+(null!==n&&void 0!==n?n:"")},ue(t,e){i[t]=e},ae(t){n&&"-react"!==n||(n="-"+t)}}},6830:(t,n)=>{$Q2(n,"__esModule",{value:!0}),n.Hn=n.Gt=n.ce=n.he=n.kt=n.de=n.te=void 0;n.te=()=>"undefined"!=typeof window?window:null,n.de=()=>{var t=(0,n.te)();return null!=(t=null==t?void 0:t.document)?t:null},n.kt=()=>{var t;return null===(0,n.de)()&&(t="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,"string"==typeof EdgeRuntime||t)},n.he=(t,e)=>{var i=(0,n.te)();"function"==typeof(null==i?void 0:i.addEventListener)&&i.addEventListener(t,e)},n.ce=(t,e)=>{var i=(0,n.de)();"function"==typeof(null==i?void 0:i.addEventListener)&&i.addEventListener(t,e)},n.Gt=()=>{var t;try{return null==(t=(0,n.te)())?void 0:t.location.href.split(/[?#]/)[0]}catch(t){}};n.Hn=()=>{var t=(0,n.te)();return t&&"onpagehide"in t?"pagehide":"beforeunload"}},4143:(t,e,i)=>{$Q(e),e.StatsigSession=e.SessionID=void 0;const n=i(1845),s=i(2137),o=i(7512),u=i(4534),a=i(8023),c=18e5,h=144e5,d={};function v(e,t){return setTimeout(()=>{var t=null==(t=(0,n.l)())?void 0:t.instance(e);t&&t.$emt({name:"session_expired"})},t)}function f(t){return"statsig.session_id."+(0,s.o)(t)}e.SessionID={get:t=>e.StatsigSession.get(t).data.sessionID},e.StatsigSession={get:t=>{null==d[t]&&(d[t]=function(t){let e=function(t){t=f(t);return(0,u.G)(t)}(t);var i=Date.now();e=e||{sessionID:(0,a.getUUID)(),startTime:i,lastUpdate:i};return{data:e,sdkKey:t}}(t));var t=d[t],e=Date.now(),i=t.data,n=t.sdkKey,s=((function({lastUpdate:t}){return Date.now()-t>c}(i)||function({startTime:t}){return Date.now()-t>h}(i))&&(i.sessionID=(0,a.getUUID)(),i.startTime=e,l=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instance(n))&&l.$emt({name:"session_expired"}),i.lastUpdate=e,i),r=t.sdkKey;r=f(r);try{(0,u.L)(r,s)}catch(t){o.Log.warn("Failed to save SessionID")}clearTimeout(t.idleTimeoutID),clearTimeout(t.ageTimeoutID);var l=e-i.startTime;return t.idleTimeoutID=v(n,c),t.ageTimeoutID=v(n,h-l),t},overrideInitialSessionID:(t,e)=>{var i;d[e]=(t=t,e=e,i=Date.now(),{data:{sessionID:t,startTime:i,lastUpdate:i},sdkKey:e})}}},2176:(t,o)=>{$Q2(o,"__esModule",{value:!0}),o.hi=void 0;o.hi=(e,i)=>{let n=0;var s=Object.keys(e);for(let t=0;t<s.length;t++){var r=s[t],l=e[r];if((n=(n+=r.length)+("object"==typeof l&&null!==l?(0,o.hi)(l,i)+2:String(l).length+1))>=i)return n}return n}},9122:(t,e,i)=>{$Q(e),e.getCookieName=e.StableID=void 0;const n=i(2137),s=i(7512),r=i(6830),l=i(4534),o=i(8023),u={},a={},c={};function h(t){return"statsig.stable_id."+(0,n.o)(t)}function d(t,e){e=h(e);try{(0,l.L)(e,t)}catch(t){s.Log.warn("Failed to save StableID to storage")}}function v(t,e){var i;a[e]&&null!=(0,r.de)()&&((i=new Date).setFullYear(i.getFullYear()+1),document.cookie=`${f(e)}=${encodeURIComponent(t)}; expires=${i.toUTCString()}; path=/`)}function f(t){return"statsig.stable_id."+(0,n.o)(t)}e.StableID={cookiesEnabled:!1,randomID:Math.random().toString(36),get:t=>{if(c[t])return null;if(null!=u[t])return u[t];let e=null;return null!=(e=function(t){if(a[t]&&null!=(0,r.de)())for(const n of document.cookie.split(";")){var[e,i]=n.trim().split("=");if(e===f(t))return decodeURIComponent(i)}return null}(t))?d(u[t]=e,t):(d(e=null==(e=function(t){t=h(t);return(0,l.G)(t)}(t))?(0,o.getUUID)():e,t),v(e,t),u[t]=e),e},setOverride:(t,e)=>{d(u[e]=t,e),v(t,e)},Xn:(t,e)=>{a[t]=e},_e:(t,e)=>{c[t]=e}},e.getCookieName=f},1375:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.StatsigClientBase=void 0,i(1845);const l=i(1845),o=i(5542),u=i(7770),a=i(7512),r=i(7787),c=i(6830),h=i(4143),d=i(9122),s=i(586),v=i(4534);e.StatsigClientBase=class{constructor(t,e,i,n){this.loadingStatus="Uninitialized",this.ve=null,this.fe={};var s,r=this.$emt.bind(this);null!=(null==n?void 0:n.logLevel)&&(a.Log.level=n.logLevel),null!=n&&n.disableStorage&&v.Storage._e(!0),null!=n&&n.initialSessionID&&h.StatsigSession.overrideInitialSessionID(n.initialSessionID,t),null!=n&&n.storageProvider&&v.Storage.ge(n.storageProvider),null!=n&&n.enableCookies&&d.StableID.Xn(t,n.enableCookies),null!=n&&n.disableStableID&&d.StableID._e(t,!0),this.O=t,this.m=null!=n?n:{},this.ji={},this.overrideAdapter=null!=(s=null==n?void 0:n.overrideAdapter)?s:null,this.pe=new u.EventLogger(t,r,i,n),this.$t=new o.ErrorBoundary(t,n,r),this.$t.wrap(this),this.$t.wrap(e),this.$t.wrap(this.pe),i.setErrorBoundary(this.$t),this.dataAdapter=e,this.dataAdapter.attach(t,n,i),this.storageProvider=v.Storage,null!=(e=null==(r=null==(s=this.overrideAdapter)?void 0:s.loadFromStorage)?void 0:r.call(s))&&e.catch(t=>this.$t.logError("OA::loadFromStorage",t)),this.be(),n=t,i=this,(0,c.kt)()||(r=(0,l.l)(),s=null!=(s=r.instances)?s:{},i=i,null!=s[n]&&a.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),s[n]=i,r.firstInstance||(r.firstInstance=i),r.instances=s,__STATSIG__=r)}updateRuntimeOptions(t){t.loggingEnabled?(this.m.loggingEnabled=t.loggingEnabled,this.pe.setLoggingEnabled(t.loggingEnabled)):null!=t.disableLogging&&(this.m.disableLogging=t.disableLogging,this.pe.setLoggingEnabled(t.disableLogging?"disabled":"browser-only")),null!=t.disableStorage&&(this.m.disableStorage=t.disableStorage,v.Storage._e(t.disableStorage)),null!=t.enableCookies&&(this.m.enableCookies=t.enableCookies,d.StableID.Xn(this.O,t.enableCookies)),t.logEventCompressionMode?this.pe.setLogEventCompressionMode(t.logEventCompressionMode):t.disableCompression&&this.pe.setLogEventCompressionMode(s.LogEventCompressionMode.Disabled)}flush(){return this.pe.flush()}shutdown(){return n(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),this.me("Uninitialized",null),this.ve=null,yield this.pe.stop()})}on(t,e){this.fe[t]||(this.fe[t]=[]),this.fe[t].push(e)}off(t,e){this.fe[t]&&-1!==(e=this.fe[t].indexOf(e))&&this.fe[t].splice(e,1)}$on(t,e){e.__isInternal=!0,this.on(t,e)}$emt(i){var t;const e=e=>{try{e(i)}catch(t){!0===e.__isInternal?this.$t.logError("__emit:"+i.name,t):a.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",i)}};this.fe[i.name]&&this.fe[i.name].forEach(t=>e(t)),null!=(t=this.fe["*"])&&t.forEach(e)}me(t,e){this.loadingStatus=t,this.ji={},this.$emt({name:"values_updated",status:t,values:e})}ye(t,e,i){!0===(null==i?void 0:i.disableExposureLog)?this.pe.incrementNonExposureCount(t):this.pe.enqueue(e)}wi(n,s){return(t,e)=>{var i;return!this.m.disableEvaluationMemoization&&(i=(0,r.createMemoKey)(n,t,e))?(i in this.ji||(3e3<=Object.keys(this.ji).length&&(this.ji={}),this.ji[i]=s(t,e)),this.ji[i]):s(t,e)}}}},2636:(t,e)=>{$Q(e),e.ErrorTag=void 0,e.ErrorTag={NetworkError:"NetworkError"}},3206:(t,e)=>{$Q(e),e.DataAdapterCachePrefix=void 0,e.DataAdapterCachePrefix="statsig.cached"},1637:(t,e)=>{$Q(e),e.Oe=e.je=e.Ui=e.Se=e.xt=void 0;const r="statsig::config_exposure",l="statsig::gate_exposure",a="statsig::layer_exposure",c=(t,e,i,n,s)=>(i.bootstrapMetadata&&(n.bootstrapMetadata=i.bootstrapMetadata),{eventName:t,user:e,value:null,metadata:o(i,n),secondaryExposures:s,time:Date.now()});e.xt=({eventName:t})=>t===l||t===r||t===a;function h(t,e){return t.map(t=>"string"==typeof t?(null!=e?e:{})[t]:t).filter(t=>null!=t)}e.Se=(t,e,i)=>{var n,s={gate:e.name,gateValue:String(e.value),ruleID:e.ruleID};return null!=(null==(n=e.__evaluation)?void 0:n.version)&&(s.configVersion=e.__evaluation.version),c(l,t,e.details,s,h(null!=(t=null==(n=e.__evaluation)?void 0:n.secondary_exposures)?t:[],i))},e.Ui=h;e.je=(t,e,i)=>{var n,s={config:e.name,ruleID:e.ruleID};return null!=(null==(n=e.__evaluation)?void 0:n.version)&&(s.configVersion=e.__evaluation.version),null!=(null==(n=e.__evaluation)?void 0:n.passed)&&(s.rulePassed=String(e.__evaluation.passed)),c(r,t,e.details,s,h(null!=(t=null==(n=e.__evaluation)?void 0:n.secondary_exposures)?t:[],i))};e.Oe=(t,e,i,n)=>{var s=e.__evaluation,r=!0===(null==(r=null==s?void 0:s.explicit_parameters)?void 0:r.includes(i));let l="",o=null!=(u=null==s?void 0:s.undelegated_secondary_exposures)?u:[];r&&(l=null!=(u=s.allocated_experiment_name)?u:"",o=null!=(u=s.secondary_exposures)?u:[]);var u=null==(s=e.__evaluation)?void 0:s.parameter_rule_ids,u={config:e.name,parameterName:i,ruleID:null!=(s=null==u?void 0:u[i])?s:e.ruleID,allocatedExperiment:l,isExplicitParameter:String(r)};return null!=(null==(i=e.__evaluation)?void 0:i.version)&&(u.configVersion=e.__evaluation.version),c(a,t,e.details,u,h(o,n))};const o=(t,e)=>(e.reason=t.reason,t.lcut&&(e.lcut=String(t.lcut)),t.receivedAt&&(e.receivedAt=String(t.receivedAt)),e)},8e3:(t,e)=>{$Q(e),e.StatsigMetadataProvider=e.SDK_VERSION=void 0,e.SDK_VERSION="3.24.4";let i={sdkVersion:e.SDK_VERSION,sdkType:"js-mono"};e.StatsigMetadataProvider={get:()=>i,add:t=>{i=$P($P({},i),t)}}},586:(t,e)=>{$Q(e),e.LoggingEnabledOption=e.LogEventCompressionMode=void 0,e.LogEventCompressionMode={Disabled:"d",Enabled:"e",Forced:"f"},e.LoggingEnabledOption={disabled:"disabled",browserOnly:"browser-only",always:"always"}},1098:(t,e)=>{$Q(e)},2059:(t,e,i)=>{$Q(e),e.we=e.Te=e.ke=e.Ie=e.De=e.Ee=void 0;const l=i(7512),o=i(6634);function s(t,e,i,n){return{name:t,details:e,ruleID:null!=(t=null==i?void 0:i.rule_id)?t:"",__evaluation:i,value:n}}function n(t,e,i){var n=null!=(n=null==i?void 0:i.value)?n:{};return $P($P({},s(t,e,i,n)),{get:r(t,null==i?void 0:i.value)})}function r(n,s,r){return(t,e)=>{var i=null!=(i=null==s?void 0:s[t])?i:null;return null==i?null!=e?e:null:null==e||(0,o.Me)(i,e)?(null!=r&&r(t),i):(l.Log.warn(`Parameter type mismatch. '${n}.${t}' was found to be type '${typeof i}' but fallback/return type is '${typeof e}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),null!=e?e:null)}}e.Ee=function(t,e,i){return $P($P({},s(t,e,i,!0===(null==i?void 0:i.value))),{idType:null!=(t=null==i?void 0:i.id_type)?t:null})},e.De=n,e.Ie=function(t,e,i){return t=n(t,e,i),$P($P({},t),{groupName:null!=(e=null==i?void 0:i.group_name)?e:null})},e.ke=function(t,e,i,n){return $P($P({},s(t,e,i,void 0)),{get:r(t,null==i?void 0:i.value,n),groupName:null!=(e=null==i?void 0:i.group_name)?e:null,__value:null!=(t=null==i?void 0:i.value)?t:{}})},e.Te=function(t,e,i,n){return $P($P($P({},t),e),{get:r(t.name,i,n)})},e.we=r},1812:(t,e)=>{$Q(e)},3932:(t,e)=>{$Q(e),e.UPDATE_DETAIL_ERROR_MESSAGES=e.createUpdateDetails=void 0;e.createUpdateDetails=(t,e,i,n,s,r)=>({duration:i,source:e,success:t,error:n,sourceUrl:s,warnings:r}),e.UPDATE_DETAIL_ERROR_MESSAGES={NO_NETWORK_DATA:"No data was returned from the network. This may be due to a network timeout if a timeout value was specified in the options or ad blocker error."}},8578:(t,e,i)=>{$Q(e),e.v=e.T=void 0;const n=i(1406),s=i(7512);e.T=function(t,e,i){try{var n=JSON.parse(JSON.stringify(t));return null!=e&&null!=e.environment?n.statsigEnvironment=e.environment:null!=i&&(n.statsigEnvironment={tier:i}),n}catch(t){return s.Log.error("Failed to JSON.stringify user"),{statsigEnvironment:void 0}}},e.v=function(t){return t?(0,n.Kt)(t):null}},4534:(t,i,e)=>{$Q2(i,"__esModule",{value:!0}),i.L=i.G=i.Storage=void 0;var n=e(7512),e=e(6830);const s={},r={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:t=>s[t]||null,setItem:(t,e)=>{s[t]=e},removeItem:t=>{delete s[t]},getAllKeys:()=>Object.keys(s)};let l=null;try{const c=(0,e.te)();c&&c.localStorage&&"function"==typeof c.localStorage.getItem&&(l={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:t=>c.localStorage.getItem(t),setItem:(t,e)=>c.localStorage.setItem(t,e),removeItem:t=>c.localStorage.removeItem(t),getAllKeys:()=>Object.keys(c.localStorage)})}catch(t){n.Log.warn("Failed to setup localStorageProvider.")}let o=null!==l&&void 0!==l?l:r,u=o;function a(e){try{return e()}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return i.Storage.ge(r),null;throw t instanceof Error&&"QuotaExceededError"===t.name&&(e=i.Storage.getAllKeys().filter(t=>t.startsWith("statsig.")),t.message=t.message+". Statsig Keys: "+e.length),t}}i.Storage={isReady:()=>u.isReady(),isReadyResolver:()=>u.isReadyResolver(),getProviderName:()=>u.getProviderName(),getItem:t=>a(()=>u.getItem(t)),setItem:(t,e)=>a(()=>u.setItem(t,e)),removeItem:t=>u.removeItem(t),getAllKeys:()=>u.getAllKeys(),ge:t=>{o=t,u=t},_e:t=>{u=t?r:o}},i.G=function(t){return t=i.Storage.getItem(t),JSON.parse(null!=t?t:"null")},i.L=function(t,e){i.Storage.setItem(t,JSON.stringify(e))}},3401:(t,e,i)=>{$Q(e),e.P=void 0;const s=i(7512);e.P=function(t,e,i){try{var n=JSON.parse(t);if(n&&"object"==typeof n&&e in n)return n}catch(t){}return s.Log.error("Failed to parse "+i),null}},6634:(t,e)=>{$Q(e),e.Me=e.zt=void 0,e.zt=function(t){return Array.isArray(t)?"array":typeof t},e.Me=function(t,e){var i=t=>Array.isArray(t)?"array":null===t?"null":typeof t;return i(t)===i(e)}},8023:(t,e)=>{$Q(e),e.getUUID=void 0,e.getUUID=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();let i=(new Date).getTime(),n="undefined"!=typeof performance&&performance.now&&1e3*performance.now()||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(4*Math.random())]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,t=>{let e=16*Math.random();return 0<i?(e=(i+e)%16|0,i=Math.floor(i/16)):(e=(n+e)%16|0,n=Math.floor(n/16)),("x"===t?e:7&e|8).toString(16)})}},1881:(t,e,i)=>{$Q(e),e.UrlConfiguration=void 0;const n=i(1406),s=i(7410),r={[s.Endpoint.qt]:"i",[s.Endpoint.jt]:"e",[s.Endpoint.Bt]:"d"};e.UrlConfiguration=class{constructor(t,e,i,n){this.customUrl=null,this.fallbackUrls=null,this.endpoint=t,this.endpointDnsKey=r[t],e&&(this.customUrl=e),!e&&i&&(this.customUrl=i.endsWith("/")?""+i+t:i+"/"+t),n&&(this.fallbackUrls=n);e=s.NetworkDefault[t];this.defaultUrl=e+"/"+t}getUrl(){var t;return null!=(t=this.customUrl)?t:this.defaultUrl}getChecksum(){var t=(null!=(t=this.fallbackUrls)?t:[]).sort().join(",");return(0,n.h)(this.customUrl+t)}}},2397:(t,e,i)=>{$Q(e),e.Ae=e.It=e.Rt=e.xe=void 0;i=i(6830);const n="foreground",s="background",r=[];let l=n,o=!1;e.xe=()=>l===n,e.Rt=()=>o,e.It=t=>{r.unshift(t)};e.Ae=e=>{e!==l&&(l=e,r.forEach(t=>t(e)))},(0,i.he)("focus",()=>{(o=!1,e.Ae)(n)}),(0,i.he)("blur",()=>(0,e.Ae)(s)),(0,i.ce)("visibilitychange",()=>{(0,e.Ae)("visible"===document.visibilityState?n:s)}),(0,i.he)((0,i.Hn)(),()=>{o=!0,(0,e.Ae)(s)})},6914:function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),$Q2(t,n,s)}:function(t,e,i,n){t[n=void 0===n?i:n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)},r=($Q(e),e.Storage=e.Log=e.EventLogger=e.Diagnostics=void 0,i(1845),i(1845));const l=i(8962),o=($Q2(e,"Diagnostics",{enumerable:!0,get:function(){return l.Diagnostics}}),i(7770)),u=($Q2(e,"EventLogger",{enumerable:!0,get:function(){return o.EventLogger}}),i(7512));$Q2(e,"Log",{enumerable:!0,get:function(){return u.Log}});var a=i(8e3);const c=i(4534);$Q2(e,"Storage",{enumerable:!0,get:function(){return c.Storage}}),s(i(1845),e),s(i(2137),e),s(i(6427),e),s(i(694),e),s(i(8962),e),s(i(3539),e),s(i(5542),e),s(i(2922),e),s(i(2417),e),s(i(1406),e),s(i(1333),e),s(i(7512),e),s(i(7787),e),s(i(7410),e),s(i(7023),e),s(i(1405),e),s(i(1361),e),s(i(6830),e),s(i(5902),e),s(i(4143),e),s(i(2176),e),s(i(9122),e),s(i(1375),e),s(i(2636),e),s(i(3206),e),s(i(1637),e),s(i(8e3),e),s(i(586),e),s(i(1098),e),s(i(2059),e),s(i(1812),e),s(i(8578),e),s(i(4534),e),s(i(3401),e),s(i(6634),e),s(i(1881),e),s(i(8023),e),s(i(2397),e),s(i(3932),e),s(i(3091),e),$P((0,r.l)(),{Log:u.Log,SDK_VERSION:a.SDK_VERSION})},2016:(t,e,i)=>{$Q(e),e.AutoInit=void 0;const p=i(6914),y=i(2018);function m(t,e){var i;return null!=(i=e.get(t))?i:e.get(t.toLowerCase())}e.AutoInit=class{static attempt(e){var t,i,n,s,r;try{var l=(0,p.te)(),o=(0,p.de)();if(l&&o&&o.currentScript){var u=o.currentScript.getAttribute("src"),a=null==(t=l.location)?void 0:t.href;if(u&&a){var c=new URL(u,a).searchParams,h=null!=(i=m("sdkKey",c))?i:m("apiKey",c);if(h){var d={},v=m("proxy",c),f=(v&&(d.networkConfig={api:v}),null==(s=null==(n=(0,p.l)())?void 0:n.instances)?void 0:s[h]);let t=null;if(t=f instanceof y.StatsigClient?f:t)e({sdkKey:h,client:t});else{var g=o.currentScript.dataset;const _=function(t,e){if(t)if(t in e&&"function"==typeof e[t])return e[t];return null}(null!=(r=g.onstatsiginit)?r:g.onStatsigInit,l),b=new y.StatsigClient(h,function(){var t=(0,p.te)();if(!t)return{};let e=t.statsigUser||{};var i=(e="object"!=typeof e?{}:e).custom||{},n=e.customIDs||{};return $P($P({},e),{customIDs:$P({},n),custom:$P($P({},i),{useragent:t.navigator.userAgent,page_url:(0,p.Gt)()||"",language:null==(n=t.navigator)?void 0:n.language})})}(),d);b.initializeAsync().then(()=>{_&&_(b)}).catch(t=>{p.Log.error(t)}),e({sdkKey:h,client:b})}}}}}catch(t){p.Log.error("AutoInit failed",t)}}}},2043:function(t,e,i){var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},n=($Q(e),n(i(2018)));const s=i(3447);i=i(2016);e.default=n.default,i.AutoInit.attempt(({client:t})=>{new s.SessionReplay(t)})},7262:(t,e,i)=>{$Q(e),e.Ne=void 0;const n=i(6914);function s(t,e){null!=t&&t.forEach(t=>{delete e[t]})}e.Ne=function(t,e){var i;return(e=(0,n.P)(e,"checksum","DeltasEvaluationResponse"))?(t=t,i=e,t=$P($P($P({},t),i),{feature_gates:$P($P({},t.feature_gates),i.feature_gates),layer_configs:$P($P({},t.layer_configs),i.layer_configs),dynamic_configs:$P($P({},t.dynamic_configs),i.dynamic_configs)}),s((t=i=t).deleted_gates,t.feature_gates),delete t.deleted_gates,s(i.deleted_configs,t.dynamic_configs),delete t.deleted_configs,s(i.deleted_layers,t.layer_configs),delete t.deleted_layers,i=t,(t=(0,n.Kt)({feature_gates:i.feature_gates,dynamic_configs:i.dynamic_configs,layer_configs:i.layer_configs},2))===e.checksumV2?JSON.stringify(i):{hadBadDeltaChecksum:!0,badChecksum:t,badMergedConfigs:i,badFullResponse:e.deltas_full_response}):{hadBadDeltaChecksum:!0}}},4845:(t,e,i)=>{$Q(e);const s=i(6914);e.default=class{constructor(t){this.O=t,this.Re=null,this.Pe=null,this.Ce="Uninitialized",this.Ue=0,this.Fe=0,this.Ge=null,this.Le=new Set}reset(){this.Pe=null,this.Re=null,this.Ce="Loading",this.Ue=0,this.Fe=0,this.Ge=null,this.Le.clear()}finalize(){this.Pe||(this.Ce="NoValues")}getValues(){return this.Re?(0,s.P)(this.Re,"has_updates","EvaluationStoreValues"):null}setValues(t,e){var i;return!!t&&null!=(i=(0,s.P)(t.data,"has_updates","EvaluationResponse"))&&(this.Ce=t.source,!0===(null==i?void 0:i.has_updates)&&(this.Re=t.data,this.Ue=i.time,this.Fe=t.receivedAt,this.Pe=i,this.Ge=this.Ke(t.source,i),t.source&&i.user&&this.ze(e,i),s.SDKFlags.setFlags(this.O,null!=(t=i.sdk_flags)?t:{})),!0)}getWarnings(){if(0!==this.Le.size)return Array.from(this.Le)}getGate(t){var e;return this.qe(null==(e=this.Pe)?void 0:e.feature_gates,t)}getConfig(t){var e;return this.qe(null==(e=this.Pe)?void 0:e.dynamic_configs,t)}getConfigList(){var t;return null!=(t=this.Pe)&&t.dynamic_configs?Object.values(this.Pe.dynamic_configs).map(t=>t.name):[]}getLayer(t){var e;return this.qe(null==(e=this.Pe)?void 0:e.layer_configs,t)}getParamStore(t){var e;return this.qe(null==(e=this.Pe)?void 0:e.param_stores,t)}getSource(){return this.Ce}getExposureMapping(){var t;return null==(t=this.Pe)?void 0:t.exposures}Ke(t,e){return"Bootstrap"!==t?null:(t={},e.user&&(t.user=e.user),e.sdkInfo&&(t.generatorSDKInfo=e.sdkInfo),t.lcut=e.time,t)}qe(t,e){let i=null;return{result:i=t?t[e]||t[(0,s.h)(e)]:i,details:this.Be(null==i)}}ze(t,e){var i,n=s.StableID.get(this.O);(null==(i=t.customIDs)?void 0:i.stableID)!==n&&(null!=(i=t.customIDs)&&i.stableID||n)?this.Le.add("StableIDMismatch"):"user"in e&&(i=e.user,n=$P($P({},t),{analyticsOnlyMetadata:void 0,privateAttributes:void 0}),(0,s.v)(n)!==(0,s.v)(i))&&this.Le.add("PartialUserMatch")}getCurrentSourceDetails(){var t;return"Uninitialized"===this.Ce||"NoValues"===this.Ce?{reason:this.Ce}:(t={reason:this.Ce,lcut:this.Ue,receivedAt:this.Fe},0<this.Le.size&&(t.warnings=Array.from(this.Le)),t)}Be(t){var e=this.getCurrentSourceDetails();let i=e.reason;var n=null!=(n=e.warnings)?n:[],t=("Bootstrap"===this.Ce&&0<n.length&&(i+=n[0]),"Uninitialized"!==i&&"NoValues"!==i&&(i=i+":"+(t?"Unrecognized":"Recognized")),"Bootstrap"===this.Ce&&null!=(n=this.Ge)?n:void 0);return t&&(e.bootstrapMetadata=t),$P($P({},e),{reason:i})}}},8448:function(t,e,i){var u=this&&this.__awaiter||$A();$Q(e);const a=i(6914),l=i(7262);class n extends a.NetworkCore{constructor(t,e){super(t,e);e=null==t?void 0:t.networkConfig;this.Fi=t,this.Ve=new a.UrlConfiguration(a.Endpoint.qt,null==e?void 0:e.initializeUrl,null==e?void 0:e.api,null==e?void 0:e.initializeFallbackUrls)}fetchEvaluations(n,s,r,l,o){return u(this,void 0,void 0,function*(){var t,e=s?(0,a.P)(s,"has_updates","InitializeResponse"):null;let i={user:l,hash:null!=(t=null==(t=null==(t=this.Fi)?void 0:t.networkConfig)?void 0:t.initializeHashAlgorithm)?t:"djb2",deltasResponseRequested:!1,full_checksum:null};return null!=e&&e.has_updates&&(t=(null==e?void 0:e.hash_used)!==(null!=(t=null==(t=null==(t=this.Fi)?void 0:t.networkConfig)?void 0:t.initializeHashAlgorithm)?t:"djb2"),i=$P($P({},i),{sinceTime:o&&!t?e.time:0,previousDerivedFields:"derived_fields"in e&&o?e.derived_fields:{},deltasResponseRequested:!0,full_checksum:e.full_checksum,partialUserMatchSinceTime:t?0:e.time})),this.Je(n,e,i,r)})}Je(i,n,s,r){return u(this,void 0,void 0,function*(){var t,e=yield this.post({sdkKey:i,urlConfig:this.Ve,data:s,retries:2,isStatsigEncodable:!0,priority:r});return 204===(null==e?void 0:e.code)?'{"has_updates": false}':200!==(null==e?void 0:e.code)?null!=(t=null==e?void 0:e.body)?t:null:!0!==(null==n?void 0:n.has_updates)||!0!==(null==(t=e.body)?void 0:t.includes('"is_delta":true'))||!0!==s.deltasResponseRequested?e.body:"string"==typeof(t=(0,l.Ne)(n,e.body))?t:this.Je(i,n,$P($P($P({},s),t),{deltasResponseRequested:!1}),r)})}}e.default=n},3583:(t,e,i)=>{$Q(e),e.$e=void 0;const d=i(6914),v={disableExposureLog:!0};function f(t){return null==t||!1===t.disableExposureLog}function g(t,e){return null!=e&&!(0,d.Me)(t,e)}e.$e=function(a,c,h){return(t,e)=>{if(null==c)return e;var i,n,s,r,l,o,u=c[t];if(null==u||null!=e&&(0,d.zt)(e)!==u.param_type)return e;switch(u.ref_type){case"static":return u.value;case"gate":return o=u,a.getFeatureGate(o.gate_name,f(h)?void 0:v).value?o.pass_value:o.fail_value;case"dynamic_config":return o=u,l=e,g(r=(r=a).getDynamicConfig(o.config_name,f(h)?void 0:v).get(o.param_name),l)?l:r;case"experiment":return l=u,r=e,g(s=(s=a).getExperiment(l.experiment_name,f(h)?void 0:v).get(l.param_name),r)?r:s;case"layer":return s=u,n=e,g(i=(i=a).getLayer(s.layer_name,f(h)?void 0:v).get(s.param_name),n)?n:i;default:return e}}}},8198:function(t,e,i){var r=this&&this.__awaiter||$A();$Q(e);const l=i(6914),o=i(4845),u=i(8448),s=i(3583),a=i(4131);class n extends l.StatsigClientBase{static instance(t){var e=(0,l.l)().instance(t);return e instanceof n?e:(l.Log.warn((0,l.kt)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new n(null!=t?t:"",{}))}constructor(t,e,i=null){l.SDKType.ue(t,"javascript-client");var n,s=new u.default(i,t=>{this.$emt(t)}),t=(super(t,null!=(n=null==i?void 0:i.dataAdapter)?n:new a.StatsigEvaluationsDataAdapter,s,i),this.ar={},this.getFeatureGate=this.wi(l.MemoPrefix.Kn,this.Ti.bind(this)),this.getDynamicConfig=this.wi(l.MemoPrefix.Ln,this.Ii.bind(this)),this.getExperiment=this.wi(l.MemoPrefix.Vn,this.ki.bind(this)),this.getConfigList=this.wi(l.MemoPrefix.Ts,this.Ds.bind(this)),this.getLayer=this.wi(l.MemoPrefix.$n,this.Di.bind(this)),this.getParameterStore=this.wi(l.MemoPrefix.Bn,this.Ri.bind(this)),this.We=new o.default(t),this.ht=s,this.He=this.xi(e,i),this.js=(0,l.getUUID)(),null!=(n=null==i?void 0:i.plugins)?n:[]);for(const r of t)r.bind(this)}initializeSync(t){var e;return"Uninitialized"!==this.loadingStatus?(0,l.createUpdateDetails)(!0,this.We.getSource(),-1,null,null,["MultipleInitializations",...null!=(e=this.We.getWarnings())?e:[]]):(this.pe.start(),this.updateUserSync(this.He,t))}initializeAsync(t){return r(this,void 0,void 0,function*(){return this.ve||(this.ve=this.Ye(t)),this.ve})}updateUserSync(e,t){var i=performance.now();try{return this.zi(e,t,i)}catch(t){e=t instanceof Error?t:new Error(String(t));return this.Ki(e,i)}}zi(t,e,i){var n=[...null!=(n=this.We.getWarnings())?n:[]],t=(this.Xe(t),this.dataAdapter.getDataSync(this.He)),e=(null==t&&n.push("NoCachedValues"),this.We.setValues(t,this.He),this.Qe(t),null==e?void 0:e.disableBackgroundCacheRefresh);return!0===e||null==e&&"Bootstrap"===(null==t?void 0:t.source)||this.Ze(null!=t?t:null,this.He),(0,l.createUpdateDetails)(!0,this.We.getSource(),performance.now()-i,this.$t.getLastSeenErrorAndReset(),this.ht.getLastUsedInitUrlAndReset(),n)}updateUserAsync(t,n){return r(this,void 0,void 0,function*(){var e=performance.now();try{return yield this.qi(t,n)}catch(t){var i=t instanceof Error?t:new Error(String(t));return this.Ki(i,e)}})}qi(n,s){return r(this,void 0,void 0,function*(){this.Xe(n);var t=this.He,e=(l.Diagnostics.B(this.O),this.dataAdapter.getDataSync(t));if(this.We.setValues(e,this.He),this.me("Loading",e),e=yield this.dataAdapter.getDataAsync(e,t,s),t!==this.He)return(0,l.createUpdateDetails)(!1,this.We.getSource(),-1,new Error("User changed during update"),this.ht.getLastUsedInitUrlAndReset());let i=!1;null!=e&&(l.Diagnostics.W(this.O),i=this.We.setValues(e,this.He),l.Diagnostics.H(this.O,{success:i})),this.Qe(e),i||(this.$t.attachErrorIfNoneExists(l.UPDATE_DETAIL_ERROR_MESSAGES.NO_NETWORK_DATA),this.$emt({name:"initialization_failure"})),l.Diagnostics.V(this.O,i,this.We.getCurrentSourceDetails());t=l.Diagnostics.tt(this.He,this.pe,this.O,this.m);return(0,l.createUpdateDetails)(i,this.We.getSource(),t,this.$t.getLastSeenErrorAndReset(),this.ht.getLastUsedInitUrlAndReset(),this.We.getWarnings())})}getContext(){return{sdkKey:this.O,options:this.m,values:this.We.getValues(),user:JSON.parse(JSON.stringify(this.He)),errorBoundary:this.$t,session:l.StatsigSession.get(this.O),stableID:l.StableID.get(this.O),sdkInstanceID:this.js}}checkGate(t,e){return this.getFeatureGate(t,e).value}logEvent(t,e,i){e="string"==typeof t?{eventName:t,value:e,metadata:i}:t;this.$emt({name:"log_event_called",event:e}),this.pe.enqueue($P($P({},e),{user:this.He,time:Date.now()}))}updateUserWithAnalyticsOnlyMetadata(t){this.He=this.xi($P($P({},this.He),{analyticsOnlyMetadata:t}),this.m)}be(){this.$on("error",()=>{"Loading"===this.loadingStatus&&this.Qe(null)})}Ye(t){return r(this,void 0,void 0,function*(){return l.Storage.isReady()||(yield l.Storage.isReadyResolver()),this.pe.start(),this.updateUserAsync(this.He,t)})}Ki(t,e){return(0,l.createUpdateDetails)(!1,this.We.getSource(),performance.now()-e,t,null,[...null!=(e=this.We.getWarnings())?e:[]])}Qe(t){this.We.finalize(),this.me("Ready",t)}Ze(t,e){this.dataAdapter.getDataAsync(t,e,{priority:"low"}).catch(t=>{l.Log.error("An error occurred after update.",t)})}Xe(t){this.pe.reset(),this.We.reset(),this.He=this.xi(t,this.m)}xi(t,e){t=(0,l.T)(t,e),e=null==(e=t.customIDs)?void 0:e.stableID;return e&&l.StableID.setOverride(e,this.O),0<Object.keys(this.ar).length&&(t.analyticsOnlyMetadata=$P($P({},t.analyticsOnlyMetadata),this.ar)),t}Ti(t,e){var{result:i,details:n}=this.We.getGate(t),n=(0,l.Ee)(t,n,i),s=null==(s=null==(i=this.overrideAdapter)?void 0:i.getGateOverride)?void 0:s.call(i,n,this.He,e),i=null!=s?s:n;return this.ye(t,(0,l.Se)(this.He,i,this.We.getExposureMapping()),e),this.$emt({name:"gate_evaluation",gate:i}),i}Ii(t,e){var{result:i,details:n}=this.We.getConfig(t),n=(0,l.De)(t,n,i),s=null==(s=null==(i=this.overrideAdapter)?void 0:i.getDynamicConfigOverride)?void 0:s.call(i,n,this.He,e),i=null!=s?s:n;return this.ye(t,(0,l.je)(this.He,i,this.We.getExposureMapping()),e),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:i}),i}ki(t,e){var{result:i,details:n}=this.We.getConfig(t),n=(0,l.Ie)(t,n,i),s=(null!=n.__evaluation&&(n.__evaluation.secondary_exposures=(0,l.Ui)(null!=(i=null==(i=n.__evaluation)?void 0:i.secondary_exposures)?i:[],this.We.getExposureMapping())),null==(s=null==(i=this.overrideAdapter)?void 0:i.getExperimentOverride)?void 0:s.call(i,n,this.He,e)),i=null!=s?s:n;return this.ye(t,(0,l.je)(this.He,i,this.We.getExposureMapping()),e),this.$emt({name:"experiment_evaluation",experiment:i}),i}Ds(){return this.We.getConfigList()}Di(e,i){var{result:t,details:n}=this.We.getLayer(e),n=(0,l.ke)(e,n,t),s=null==(s=null==(t=this.overrideAdapter)?void 0:t.getLayerOverride)?void 0:s.call(t,n,this.He,i);null!=i&&i.disableExposureLog&&this.pe.incrementNonExposureCount(e);const r=(0,l.Te)(n,s,null!=(t=null==s?void 0:s.__value)?t:n.__value,t=>{null!=i&&i.disableExposureLog||this.ye(e,(0,l.Oe)(this.He,r,t,this.We.getExposureMapping()),i)});return this.$emt({name:"layer_evaluation",layer:r}),r}Ri(t,e){var{result:i,details:n}=this.We.getParamStore(t),t=(this.pe.incrementNonExposureCount(t),{name:t,details:n,__configuration:i,get:(0,s.$e)(this,i,e)}),i=null==(i=null==(n=this.overrideAdapter)?void 0:n.getParamStoreOverride)?void 0:i.call(n,t,e);return null!=i&&(t.__configuration=i.config,t.details=i.details,t.get=(0,s.$e)(this,i.config,e)),t}}e.default=n},4131:function(t,e,i){var r=this&&this.__awaiter||$A();$Q(e),e.StatsigEvaluationsDataAdapter=void 0;const n=i(6914),s=i(8448);class l extends n.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this.ht=null,this.m=null}attach(t,e,i){super.attach(t,e,i),null!==i&&i instanceof s.default?this.ht=i:this.ht=new s.default(null!=e?e:{})}getDataAsync(t,e,i){return this.D(t,(0,n.T)(e,this.m),i)}prefetchData(t,e){return this.A(t,e)}setData(t){var e=(0,n.P)(t,"has_updates","data");e&&"user"in e?super.setData(t,e.user):n.Log.error("StatsigUser not found. You may be using an older server SDK version. Please upgrade your SDK or use setDataLegacy.")}setDataLegacy(t,e){super.setData(t,e)}R(e,i,n,s){return r(this,void 0,void 0,function*(){var t=yield null==(t=this.ht)?void 0:t.fetchEvaluations(this.C(),e,null==n?void 0:n.priority,i,s);return null!=t?t:null})}k(t){t=(0,n.o)(this.C(),t,null==(t=this.m)?void 0:t.customUserCacheKeyFunc);return`${n.DataAdapterCachePrefix}.${this.p}.`+t}N(t,e){return null!=t.fullUserHash&&t.fullUserHash===(0,n.v)(e)}}e.StatsigEvaluationsDataAdapter=l},2018:function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),$Q2(t,n,s)}:function(t,e,i,n){t[n=void 0===n?i:n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)},r=($Q(e),e.StatsigClient=void 0,i(6914)),l=i(8198),s=(e.StatsigClient=l.default,s(i(6914),e),$P((0,r.l)(),{StatsigClient:l.default}));e.default=s},8788:(t,e,i)=>{$Q(e),e.SessionReplay=e.runStatsigSessionReplay=e.StatsigSessionReplayPlugin=void 0;const n=i(6914);var s=i(4069);const r=i(5967);function l(t,e){new o(t,e)}e.StatsigSessionReplayPlugin=class{constructor(t){this.options=t,this.__plugin="session-replay"}bind(t){l(t,this.options)}},e.runStatsigSessionReplay=l;class o extends s.SessionReplayBase{constructor(t,e){super(t,e),this.tn.$on("values_updated",()=>{var t;this.ts||this.li(null==(t=this.m)?void 0:t.forceRecording)}),this.li(null==(t=this.m)?void 0:t.forceRecording)}ri(t){super.es(t)}li(t=!1){var e;this.ns>=r.MAX_LOGS||(!0===(null==(e=this.tn.getContext().values)?void 0:e.recording_blocked)||!t&&!0!==(null==e?void 0:e.can_record_session)||!1===(null==e?void 0:e.passes_session_recording_targeting)?this.ri():this.si.isRecording()||(this.ts=!1,n.StatsigMetadataProvider.add({isRecordingSession:"true"}),this.si.record((t,e)=>this.ci(t,e),null!=(e=null==(t=this.m)?void 0:t.rrwebConfig)?e:{},()=>{this.ri()})))}}e.SessionReplay=o},4069:(t,e,i)=>{$Q(e),e.SessionReplayBase=e.forceStartRecording=e.startRecording=e.stopRecording=void 0;const a=i(6914),n=i(759),c=i(5967);function s(t){var e=null==t?(0,a.l)().firstSRInstance:null==(e=null==(e=(0,a.l)())?void 0:e.srInstances)?void 0:e[t];return e instanceof r?e:null}e.stopRecording=function(t){null!=(t=s(t))&&t.stopRecording()},e.startRecording=function(t){null!=(t=s(t))&&t.startRecording()},e.forceStartRecording=function(t){null!=(t=s(t))&&t.forceStartRecording()};class r{constructor(t,e){this.ti={startTime:-1,endTime:0,clickCount:0},this.ei=[],this.ts=!1,this.ss=0,this.ns=0,this.tn=t,this.m=e;var{sdkKey:t,errorBoundary:e}=this.tn.getContext();this.$t=e,this.$t.wrap(this),this.si=new n.SessionReplayClient,this.tn.$on("pre_shutdown",()=>this.ri()),this.tn.on("session_expired",()=>{this.ri("session_expired")}),(0,a.kt)()||((e=(0,a.l)()).srInstances=$P($P({},e.srInstances),{[t]:this}),e.firstSRInstance)||(e.firstSRInstance=this),this.ii=this.ni(),this.ui()}forceStartRecording(){this.ts=!1,this.li(!0)}stopRecording(){this.ts=!0,this.ri()}startRecording(){var t;this.ts=!1,this.li(null==(t=this.m)?void 0:t.forceRecording)}isRecording(){return this.si.isRecording()}oi(t){0!==this.ei.length&&(t=(0,a.Rt)()?"is_leaving_page":t,this.vi(this.ii,t))}ai(t){"background"===t&&(this.oi(),this.tn.flush().catch(t=>{this.$t.logError("SR::visibility",t)}))}ui(){const i=this.tn.getContext()["sdkKey"];(0,a.It)(t=>{var e=null==(e=null==(e=(0,a.l)())?void 0:e.srInstances)?void 0:e[i];e instanceof r&&e.ai(t)})}vi(e,i){var n=this.ti;if(0!==this.ei.length){var s=JSON.stringify(this.ei),r=(0,c.rs)(s),l=1<r.length?(0,a.getUUID)():null;for(let t=0;t<r.length;t++){var o=r[t],u=(0,c.ls)(o,s,e,n,this.tn.getContext().sdkInstanceID);null!=l&&(0,c.os)(u.metadata,l,t,r.length,o.length),i&&(u.metadata[i]="true"),this.ns++,this.tn.logEvent(u),null!=l&&this.tn.flush().catch(t=>{a.Log.error(t)})}this.ei=[],this.ns>c.MAX_LOGS&&this.ri()}}di(){this.ni(),this.oi()}ni(){return this.tn.getContext().session.data.sessionID}es(t){if(this.si.isRecording()){this.si.stop();const e=()=>{a.StatsigMetadataProvider.add({isRecordingSession:"false"}),this.tn.off("logs_flushed",e)};this.tn.$on("logs_flushed",e)}0!==this.ei.length&&this.oi(t),"session_expired"===t&&(this.ss=0,this.ti=this.us())}us(){return{startTime:-1,endTime:0,clickCount:0}}ci(t,e){var i;this.ii!==this.ni()?this.ri("session_expired"):this.ns>=c.MAX_LOGS?this.ri():(t.eventIndex=this.ss++,this.ti.clickCount+=e.clickCount,this.ti.startTime=-1===this.ti.startTime?e.startTime:Math.min(this.ti.startTime,e.startTime),this.ti.endTime=Math.max(this.ti.endTime,e.endTime),(e=(0,a.hi)(t,c.MAX_INDIVIDUAL_EVENT_BYTES))>c.MAX_INDIVIDUAL_EVENT_BYTES?a.Log.warn(`SessionReplay event is too large (~${e} bytes) and will not be logged`,t):(i=(0,a.hi)(this.ei,c.REPLAY_ENQUEUE_TRIGGER_BYTES),this.ei.push(t),i+e<c.REPLAY_ENQUEUE_TRIGGER_BYTES||((0,a.xe)()?this.di():this.oi())))}}e.SessionReplayBase=r},759:(t,e,i)=>{$Q(e),e.SessionReplayClient=void 0;const n=i(3331),l=i(6914);e.SessionReplayClient=class{constructor(){this.fi=null,this._i=null}record(s,t,e,r=!1){var i;null==(0,l.de)()||(this.fi=null,this._i=null,this.bi=e,this.pi)||(this.pi=(e=(t,e)=>{var i;r?this.fi=!e&&null!=(i=this.fi)?i:t.timestamp:null==this.fi&&(this.fi=t.timestamp),this._i=t.timestamp;let n=0;3!==(i=t).type||2!==i.data.source||2!==i.data.type&&4!==i.data.type||n++,s($P($P({},t),{eventIndex:0}),{startTime:this.fi,endTime:this._i,clickCount:n},null!=e&&e),144e5<this._i-this.fi&&(null!=(t=this.pi)&&t.call(this),this.bi)&&this.bi()},t=t,i=r,("function"==typeof n?n:n.record)(i?$P($P({},t),{emit:e,checkoutEveryNms:3e4}):$P($P({},t),{emit:e}))))}stop(){this.pi&&(this.pi(),this.pi=void 0)}isRecording(){return null!=this.pi}}},5967:(t,e,i)=>{$Q(e),e.os=e.rs=e.ls=e.MAX_LOGS=e.MAX_INDIVIDUAL_EVENT_BYTES=e.REPLAY_ENQUEUE_TRIGGER_BYTES=void 0;const r=i(6914);e.REPLAY_ENQUEUE_TRIGGER_BYTES=10240,e.MAX_INDIVIDUAL_EVENT_BYTES=10485760,e.MAX_LOGS=1e4,e.ls=function(t,e,i,n,s){return{eventName:"statsig::session_recording",value:i,metadata:{session_start_ts:String(n.startTime),session_end_ts:String(n.endTime),clicks_captured_cumulative:String(n.clickCount),rrweb_events:t,rrweb_payload_size:String(e.length),session_replay_sdk_version:r.SDK_VERSION,sdk_instance_id:s}}},e.rs=function(e){var i=[];for(let t=0;t<e.length;t+=1048576)i.push(e.slice(t,t+1048576));return i},e.os=function(t,e,i,n,s){t.sliced_id=e,t.slice_index=String(i),t.slice_count=String(n),t.slice_byte_size=String(s)}},3691:(t,e,i)=>{$Q(e),e.TriggeredSessionReplay=e.runStatsigTriggeredSessionReplay=e.StatsigTriggeredSessionReplayPlugin=void 0;const s=i(6914);var n=i(4069);const r=i(5967);function l(t,e){new o(t,e)}e.StatsigTriggeredSessionReplayPlugin=class{constructor(t){this.options=t,this.__plugin="triggered-session-replay"}bind(t){l(t,this.options)}},e.runStatsigTriggeredSessionReplay=l;class o extends n.SessionReplayBase{constructor(t,e){super(t,e),this.cs=[],this.hs=!1,this.ds(e),null!=e&&e.autoStartRecording?this.li(null==(t=this.m)?void 0:t.forceRecording):null!=e&&e.keepRollingWindow&&this.vs()}ds(t){this.fs(t),this.gs(),this._s(),this.ps()}fs(e){this.tn.$on("values_updated",()=>{var t;this.ts||(null!=e&&e.autoStartRecording?this.li(null==(t=this.m)?void 0:t.forceRecording):null!=e&&e.keepRollingWindow&&this.vs())})}gs(){this.tn.$on("log_event_called",t=>{var e;this.ts||!1===(null==(e=this.tn.getContext().values)?void 0:e.passes_session_recording_targeting)||null==(null==e?void 0:e.session_recording_event_triggers)||null==(e=e.session_recording_event_triggers[t.event.eventName])||!1===e.passes_sampling||null!=(e=e.values)&&!e.includes(String(null!=(e=t.event.value)?e:""))||this.li(!0)})}_s(){this.tn.$on("gate_evaluation",t=>{this.bs(t.gate.name,String(t.gate.value))})}ps(){this.tn.$on("experiment_evaluation",t=>{this.bs(t.experiment.name,null!=(t=t.experiment.groupName)?t:"")})}bs(t,e){var i,n;this.ts||!1===(null==(n=this.tn.getContext().values)?void 0:n.passes_session_recording_targeting)||null==(null==n?void 0:n.session_recording_exposure_triggers)||null==(i=null!=(i=n.session_recording_exposure_triggers[t])?i:n.session_recording_exposure_triggers[(0,s.h)(t)])||!1===i.passes_sampling||null!=(n=i.values)&&!n.includes(e)||this.li(!0)}forceStartRecording(){super.forceStartRecording()}stopRecording(){this.hs=!1,this.cs=[],super.stopRecording()}ys(){if(this.hs=!0,0!==this.cs.length){var e=this.cs.map(t=>t.events).flat();for(let t=0;t<e.length;t++)e[t].event.eventIndex=t,this.ti.clickCount+=e[t].data.clickCount,this.ti.startTime=-1===this.ti.startTime?e[t].data.startTime:Math.min(this.ti.startTime,e[t].data.startTime),this.ti.endTime=Math.max(this.ti.endTime,e[t].data.endTime);this.ei=e.map(t=>t.event),this.ss=e.length,(0,s.xe)()?this.di():this.oi(),this.si.stop()}}ri(t){this.hs=!1,this.cs=[],super.es(t)}ci(t,e,i){if(!this.hs)return this.ii!==this.ni()?void this.ri("session_expired"):void(i&&4===t.type||0===this.cs.length?(1<this.cs.length&&this.cs.shift(),this.cs.push({events:[{event:t,data:e}]})):this.cs[this.cs.length-1].events.push({event:t,data:e}));super.ci(t,e)}vs(){var t=this.tn.getContext().values;!1===(null==t?void 0:t.passes_session_recording_targeting)?this.ri():this.si.isRecording()||this.si.record((t,e,i)=>this.ci(t,e,i),null!=(t=null==(t=this.m)?void 0:t.rrwebConfig)?t:{},()=>{this.ri()},!0)}li(t=!1){var e;this.ns>=r.MAX_LOGS||(!0===(null==(e=this.tn.getContext().values)?void 0:e.recording_blocked)||!t&&!0!==(null==e?void 0:e.can_record_session)||!1===(null==e?void 0:e.passes_session_recording_targeting)?this.ri():(this.ys(),this.ts=!1,s.StatsigMetadataProvider.add({isRecordingSession:"true"}),this.si.isRecording()||this.si.record((t,e,i)=>this.ci(t,e,i),null!=(e=null==(t=this.m)?void 0:t.rrwebConfig)?e:{},()=>{this.ri()})))}}e.TriggeredSessionReplay=o},3447:(t,e,i)=>{$Q(e),e.forceStartRecording=e.stopRecording=e.startRecording=e.StatsigTriggeredSessionReplayPlugin=e.StatsigSessionReplayPlugin=e.runStatsigTriggeredSessionReplay=e.runStatsigSessionReplay=e.SessionReplay=e.SessionReplayClient=void 0;var n=i(6914);const s=i(8788),r=($Q2(e,"SessionReplay",{enumerable:!0,get:function(){return s.SessionReplay}}),$Q2(e,"StatsigSessionReplayPlugin",{enumerable:!0,get:function(){return s.StatsigSessionReplayPlugin}}),$Q2(e,"runStatsigSessionReplay",{enumerable:!0,get:function(){return s.runStatsigSessionReplay}}),i(4069)),l=($Q2(e,"forceStartRecording",{enumerable:!0,get:function(){return r.forceStartRecording}}),$Q2(e,"startRecording",{enumerable:!0,get:function(){return r.startRecording}}),$Q2(e,"stopRecording",{enumerable:!0,get:function(){return r.stopRecording}}),i(759)),o=($Q2(e,"SessionReplayClient",{enumerable:!0,get:function(){return l.SessionReplayClient}}),i(3691));$Q2(e,"StatsigTriggeredSessionReplayPlugin",{enumerable:!0,get:function(){return o.StatsigTriggeredSessionReplayPlugin}}),$Q2(e,"runStatsigTriggeredSessionReplay",{enumerable:!0,get:function(){return o.runStatsigTriggeredSessionReplay}}),$P((0,n.l)(),{SessionReplayClient:l.SessionReplayClient,SessionReplay:s.SessionReplay,runStatsigSessionReplay:s.runStatsigSessionReplay,runStatsigTriggeredSessionReplay:o.runStatsigTriggeredSessionReplay,StatsigSessionReplayPlugin:s.StatsigSessionReplayPlugin,StatsigTriggeredSessionReplayPlugin:o.StatsigTriggeredSessionReplayPlugin,startRecording:r.startRecording,stopRecording:r.stopRecording,forceStartRecording:r.forceStartRecording})}},n={};function s(t){var e=n[t];return void 0!==e||(e=n[t]={exports:{}},i[t].call(e.exports,e,e.exports,s)),e.exports}return s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),s(2043).default})());
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Statsig=t():e.Statsig=t()}(this,()=>(()=>{"use strict";var r={1845:(e,r,t)=>{var s;Object.defineProperty(r,"__esModule",{value:!0}),r._getInstance=r._getStatsigGlobalFlag=r._getStatsigGlobal=void 0;const n=t(7512);r._getStatsigGlobal=()=>{try{return"undefined"!=typeof __STATSIG__?__STATSIG__:l}catch(e){return l}},r._getStatsigGlobalFlag=e=>(0,r._getStatsigGlobal)()[e];r._getInstance=e=>{var t=(0,r._getStatsigGlobal)();return e?t.instances&&t.instances[e]:(t.instances&&1<Object.keys(t.instances).length&&n.Log.warn("Call made to Statsig global instance without an SDK key but there is more than one client instance. If you are using mulitple clients, please specify the SDK key."),t.firstInstance)};var i="__STATSIG__",o="undefined"!=typeof window?window:{},t=void 0!==t.g?t.g:{},a="undefined"!=typeof globalThis?globalThis:{};const l=null!=(s=null!=(s=null!=(s=o[i])?s:t[i])?s:a[i])?s:{instance:r._getInstance};o[i]=l,t[i]=l,a[i]=l},2137:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._getStorageKey=t._getUserStorageKey=void 0;const n=r(1406);function s(e,t,r){if(r)return r(e,t);const s=t&&t.customIDs?t.customIDs:{};t=["uid:"+(null!=(r=null==t?void 0:t.userID)?r:""),"cids:"+Object.keys(s).sort((e,t)=>e.localeCompare(t)).map(e=>e+"-"+s[e]).join(","),"k:"+e];return(0,n._DJB2)(t.join("|"))}t._getUserStorageKey=s,t._getStorageKey=function(e,t,r){return t?s(e,t,r):(0,n._DJB2)("k:"+e)}},6427:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},694:function(e,t,r){var n=this&&this.__awaiter||function(e,o,a,l){return new(a=a||Promise)(function(r,t){function s(e){try{i(l.next(e))}catch(e){t(e)}}function n(e){try{i(l.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(s,n)}i((l=l.apply(e,o||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t._makeDataAdapterResult=t.DataAdapterCore=void 0;const l=r(7512),u=r(9122),i=r(8578),o=r(4534),c=r(3401);function h(e,t,r,s){return{source:e,data:t,receivedAt:Date.now(),stableID:r,fullUserHash:(0,i._getFullUserHash)(s)}}t.DataAdapterCore=class{constructor(e,t){this._adapterName=e,this._cacheSuffix=t,this._options=null,this._sdkKey=null,this._lastModifiedStoreKey="statsig.last_modified_time."+t,this._inMemoryCache=new s}attach(e,t,r){this._sdkKey=e,this._options=t}getDataSync(e){var e=e&&(0,i._normalizeUser)(e,this._options),t=this._getCacheKey(e),r=this._inMemoryCache.get(t,e);return r&&this._getIsCacheValueValid(r)?r:(r=this._loadFromCache(t))&&this._getIsCacheValueValid(r)?(this._inMemoryCache.add(t,r),this._inMemoryCache.get(t,e)):null}setData(e,t){var t=t&&(0,i._normalizeUser)(t,this._options),r=this._getCacheKey(t);this._inMemoryCache.add(r,h("Bootstrap",e,null,t))}_getIsCacheValueValid(e){return null==e.stableID||e.stableID===u.StableID.get(this._getSdkKey())}_getDataAsyncImpl(t,r,s){return n(this,void 0,void 0,function*(){o.Storage.isReady()||(yield o.Storage.isReadyResolver());var e=null!=t?t:this.getDataSync(r),e=[this._fetchAndPrepFromNetwork(e,r,s)];return null!=s&&s.timeoutMs&&e.push(new Promise(e=>setTimeout(e,s.timeoutMs)).then(()=>(l.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(e)})}_prefetchDataImpl(r,s){return n(this,void 0,void 0,function*(){var e=r&&(0,i._normalizeUser)(r,this._options),t=this._getCacheKey(e),e=yield this._getDataAsyncImpl(null,e,s);e&&this._inMemoryCache.add(t,Object.assign(Object.assign({},e),{source:"Prefetch"}))})}_fetchAndPrepFromNetwork(i,o,a){return n(this,void 0,void 0,function*(){var e=null!=(e=null==i?void 0:i.data)?e:null,t=null!=i&&this._isCachedResultValidFor204(i,o),t=yield this._fetchFromNetwork(e,o,a,t);if(!t)return l.Log.debug("No response returned for latest value"),null;var r=(0,c._typedJsonParse)(t,"has_updates","Response"),s=this._getSdkKey(),s=u.StableID.get(s);let n=null;if(!0===(null==r?void 0:r.has_updates))n=h("Network",t,s,o);else{if(!e||!1!==(null==r?void 0:r.has_updates))return null;n=h("NetworkNotModified",e,s,o)}t=this._getCacheKey(o);return this._inMemoryCache.add(t,n),this._writeToCache(t,n),n})}_getSdkKey(){return null!=this._sdkKey?this._sdkKey:(l.Log.error(this._adapterName+" is not attached to a Client"),"")}_loadFromCache(e){var t=null==(t=o.Storage.getItem)?void 0:t.call(o.Storage,e);return null!=t&&(e=(0,c._typedJsonParse)(t,"source","Cached Result"))?Object.assign(Object.assign({},e),{source:"Cache"}):null}_writeToCache(e,t){o.Storage.setItem(e,JSON.stringify(t)),this._runLocalStorageCacheEviction(e)}_runLocalStorageCacheEviction(e){var t=null!=(t=(0,o._getObjectFromStorage)(this._lastModifiedStoreKey))?t:{},e=(t[e]=Date.now(),a(t,10));e&&(delete t[e],o.Storage.removeItem(e)),(0,o._setObjectInStorage)(this._lastModifiedStoreKey,t)}},t._makeDataAdapterResult=h;class s{constructor(){this._data={}}get(e,t){var e=this._data[e],r=null==e?void 0:e.stableID,t=null==(t=null==t?void 0:t.customIDs)?void 0:t.stableID;return t&&r&&t!==r?(l.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):e}add(e,t){var r=a(this._data,9);r&&delete this._data[r],this._data[e]=t}merge(e){this._data=Object.assign(Object.assign({},this._data),e)}}function a(n,e){var t=Object.keys(n);return t.length<=e?null:t.reduce((e,t)=>{var r=n[e],s=n[t];return"object"==typeof r&&"object"==typeof s?s.receivedAt<r.receivedAt?t:e:s<r?t:e})}},8962:(e,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Diagnostics=void 0;const s=new Map,r="start";function n(e,t,r,s){return Object.assign({key:r,action:t,step:s,timestamp:Date.now()},e)}function i(e,t){var r=null!=(r=s.get(e))?r:[];r.push(t),s.set(e,r)}function t(e,t){if(t in e)return e[t]}o.Diagnostics={_getMarkers:e=>s.get(e),_markInitOverallStart:e=>{i(e,n({},r,"overall"))},_markInitOverallEnd:(e,t,r)=>{i(e,n({success:t,error:t?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:r},"end","overall"))},_markInitNetworkReqStart:(e,t)=>{i(e,n(t,r,"initialize","network_request"))},_markInitNetworkReqEnd:(e,t)=>{i(e,n(t,"end","initialize","network_request"))},_markInitProcessStart:e=>{i(e,n({},r,"initialize","process"))},_markInitProcessEnd:(e,t)=>{i(e,n(t,"end","initialize","process"))},_clearMarkers:e=>{s.delete(e)},_formatError(e){if(e&&"object"==typeof e)return{code:t(e,"code"),name:t(e,"name"),message:t(e,"message")}},_getDiagnosticsData(e,t,r,s){return{success:!0===(null==e?void 0:e.ok),statusCode:null==e?void 0:e.status,sdkRegion:null==(e=null==e?void 0:e.headers)?void 0:e.get("x-statsig-region"),isDelta:!0===r.includes('"is_delta":true')||void 0,attempt:t,error:o.Diagnostics._formatError(s)}},_enqueueDiagnosticsEvent(e,t,r,s){var n,i=o.Diagnostics._getMarkers(r);return null==i||i.length<=0?-1:(n=i[i.length-1].timestamp-i[0].timestamp,o.Diagnostics._clearMarkers(r),r=function(e,t){e={eventName:"statsig::diagnostics",user:e,value:null,metadata:t,time:Date.now()};return e}(e,{context:"initialize",markers:i.slice(),statsigOptions:s}),t.enqueue(r),n)}}},8809:function(e,t){var r=this&&this.__awaiter||function(e,o,a,l){return new(a=a||Promise)(function(r,t){function s(e){try{i(l.next(e))}catch(e){t(e)}}function n(e){try{i(l.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(s,n)}i((l=l.apply(e,o||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t._fetchTxtRecords=void 0;const n=new Uint8Array([0,0,1,0,0,1,0,0,0,0,0,0,13,102,101,97,116,117,114,101,97,115,115,101,116,115,3,111,114,103,0,0,16,0,1]),i="https://cloudflare-dns.com/dns-query",o=["i","e","d"],a=200;t._fetchTxtRecords=function(t){return r(this,void 0,void 0,function*(){var r=yield t(i,{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:n});if(r.ok){var e,r=yield r.arrayBuffer(),r=new Uint8Array(r);{var s=r,r=s.findIndex((e,t)=>t<a&&"="===String.fromCharCode(e)&&o.includes(String.fromCharCode(s[t-1])));if(-1===r)throw(e=new Error("Failed to parse TXT records from DNS")).name="DnsTxtParseError",e;let t="";for(let e=r-1;e<s.length;e++)t+=String.fromCharCode(s[e]);return t.split(",")}}throw(e=new Error("Failed to fetch TXT records from DNS")).name="DnsTxtFetchError",e})}},3539:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5542:function(e,a,t){var r=this&&this.__awaiter||function(e,o,a,l){return new(a=a||Promise)(function(r,t){function s(e){try{i(l.next(e))}catch(e){t(e)}}function n(e){try{i(l.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(s,n)}i((l=l.apply(e,o||[])).next())})};Object.defineProperty(a,"__esModule",{value:!0}),a.ErrorBoundary=a.EXCEPTION_ENDPOINT=void 0;const s=t(7512),l=t(5902),u=t(8e3),c=(a.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception","[Statsig] UnknownError");function h(e){return e instanceof Error?e:"string"==typeof e?new Error(e):new Error("An unknown error occurred.")}a.ErrorBoundary=class{constructor(e,t,r,s){this._sdkKey=e,this._options=t,this._emitter=r,this._lastSeenError=s,this._seen=new Set}wrap(s,n){try{const e=s;!function(e){const t=new Set;let r=Object.getPrototypeOf(e);for(;r&&r!==Object.prototype;)Object.getOwnPropertyNames(r).filter(e=>"function"==typeof(null===r||void 0===r?void 0:r[e])).forEach(e=>t.add(e)),r=Object.getPrototypeOf(r);return Array.from(t)}(e).forEach(t=>{const r=e[t];"$EB"in r||(e[t]=(...e)=>this._capture(n?n+":"+t:t,()=>r.apply(s,e)),e[t].$EB=!0)})}catch(e){this._onError("eb:wrap",e)}}logError(e,t){this._onError(e,t)}getLastSeenErrorAndReset(){var e=this._lastSeenError;return this._lastSeenError=void 0,null!=e?e:null}attachErrorIfNoneExists(e){this._lastSeenError||(this._lastSeenError=h(e))}_capture(t,e){try{var r=e();return r&&r instanceof Promise?r.catch(e=>this._onError(t,e)):r}catch(e){return this._onError(t,e),null}}_onError(i,o){try{s.Log.warn("Caught error in "+i,{error:o});r(this,void 0,void 0,function*(){var e,t=o||Error(c),r=t instanceof Error,s=r?t.name:"No Name",n=h(t);this._lastSeenError=n,this._seen.has(s)||(this._seen.add(s),null!=(n=null==(n=this._options)?void 0:n.networkConfig)&&n.preventAllNetworkTraffic?null!=(n=this._emitter)&&n.call(this,{name:"error",error:o,tag:i}):(n=l.SDKType._get(this._sdkKey),e=u.StatsigMetadataProvider.get(),r=r?t.stack:function(e){try{return JSON.stringify(e)}catch(e){return c}}(t),t=Object.assign({tag:i,exception:s,info:r,statsigOptions:function(s){if(!s)return{};const n={};return Object.keys(s).forEach(e=>{var t=e,r=s[t];switch(typeof r){case"number":case"bigint":case"boolean":n[String(t)]=r;break;case"string":r.length<50?n[String(t)]=r:n[String(t)]="set";break;case"object":"environment"===t?n.environment=r:"networkConfig"===t?n.networkConfig=r:n[String(t)]=null!=r?"set":"unset"}}),n}(this._options)},Object.assign(Object.assign({},e),{sdkType:n})),yield(null!=(s=null==(r=null==(s=this._options)?void 0:s.networkConfig)?void 0:r.networkOverrideFunc)?s:fetch)(a.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this._sdkKey,"STATSIG-SDK-TYPE":String(n),"STATSIG-SDK-VERSION":String(e.sdkVersion),"Content-Type":"application/json"},body:JSON.stringify(t)}),null!=(r=this._emitter)&&r.call(this,{name:"error",error:o,tag:i})))}).then(()=>{}).catch(()=>{})}catch(e){}}}},2922:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},2417:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},7770:function(e,t,r){var s=this&&this.__awaiter||function(e,o,a,l){return new(a=a||Promise)(function(r,t){function s(e){try{i(l.next(e))}catch(e){t(e)}}function n(e){try{i(l.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(s,n)}i((l=l.apply(e,o||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.EventLogger=void 0;const n=r(2137),i=r(1406),o=r(7512),a=r(7410),l=r(6830),u=r(1637),c=r(586),h=r(4534),d=r(1881),p=r(2397),g={},f={Startup:"startup",GainedFocus:"gained_focus"};class m{static _safeFlushAndForget(e){null!=(e=g[e])&&e.flush().catch(()=>{})}static _safeRetryFailedLogs(e){null!=(e=g[e])&&e._retryFailedLogs(f.GainedFocus)}constructor(e,t,r,s){this._sdkKey=e,this._emitter=t,this._network=r,this._options=s,this._queue=[],this._lastExposureTimeMap={},this._nonExposedChecks={},this._hasRunQuickFlush=!1,this._creationTime=Date.now(),this._loggingEnabled=null!=(e=null==s?void 0:s.loggingEnabled)?e:!0===(null==s?void 0:s.disableLogging)?c.LoggingEnabledOption.disabled:c.LoggingEnabledOption.browserOnly,null!=s&&s.loggingEnabled&&void 0!==s.disableLogging&&o.Log.warn("Detected both loggingEnabled and disableLogging options. loggingEnabled takes precedence - please remove disableLogging."),this._maxQueueSize=null!=(t=null==s?void 0:s.loggingBufferMaxSize)?t:100;r=null==s?void 0:s.networkConfig;this._logEventUrlConfig=new d.UrlConfiguration(a.Endpoint._rgstr,null==r?void 0:r.logEventUrl,null==r?void 0:r.api,null==r?void 0:r.logEventFallbackUrls)}setLogEventCompressionMode(e){this._network.setLogEventCompressionMode(e)}setLoggingEnabled(e){this._loggingEnabled=e}enqueue(e){this._shouldLogEvent(e)&&(this._normalizeAndAppendEvent(e),this._quickFlushIfNeeded(),this._queue.length>this._maxQueueSize)&&m._safeFlushAndForget(this._sdkKey)}incrementNonExposureCount(e){var t=null!=(t=this._nonExposedChecks[e])?t:0;this._nonExposedChecks[e]=t+1}reset(){this.flush().catch(()=>{}),this._lastExposureTimeMap={}}start(){var e,t=(0,l._isServerEnv)();t&&"always"!==(null==(e=this._options)?void 0:e.loggingEnabled)||(g[this._sdkKey]=this,t||(0,p._subscribeToVisiblityChanged)(e=>{"background"===e?m._safeFlushAndForget(this._sdkKey):"foreground"===e&&m._safeRetryFailedLogs(this._sdkKey)}),this._retryFailedLogs(f.Startup),this._startBackgroundFlushInterval())}stop(){return s(this,void 0,void 0,function*(){this._flushIntervalId&&(clearInterval(this._flushIntervalId),this._flushIntervalId=null),delete g[this._sdkKey],yield this.flush()})}flush(){return s(this,void 0,void 0,function*(){var e;this._appendAndResetNonExposedChecks(),0!==this._queue.length&&(e=this._queue,this._queue=[],yield this._sendEvents(e))})}_quickFlushIfNeeded(){this._hasRunQuickFlush||(this._hasRunQuickFlush=!0,200<Date.now()-this._creationTime)||setTimeout(()=>m._safeFlushAndForget(this._sdkKey),200)}_shouldLogEvent(e){if("always"!==(null==(t=this._options)?void 0:t.loggingEnabled)&&(0,l._isServerEnv)())return!1;if((0,u._isExposureEvent)(e)){var t=e.user||{statsigEnvironment:void 0},t=(0,n._getUserStorageKey)(this._sdkKey,t),r=e.metadata||{},e=[e.eventName,t,r.gate,r.config,r.ruleID,r.allocatedExperiment,r.parameterName,String(r.isExplicitParameter),r.reason].join("|"),t=this._lastExposureTimeMap[e],r=Date.now();if(t&&r-t<6e5)return!1;1e3<Object.keys(this._lastExposureTimeMap).length&&(this._lastExposureTimeMap={}),this._lastExposureTimeMap[e]=r}return!0}_sendEvents(n){return s(this,void 0,void 0,function*(){var e,t;if("disabled"===this._loggingEnabled)return this._saveFailedLogsToStorage(n),!1;try{var r=(0,p._isUnloading)()&&this._network.isBeaconSupported()&&null==(null==(t=null==(e=this._options)?void 0:e.networkConfig)?void 0:t.networkOverrideFunc),s=(this._emitter({name:"pre_logs_flushed",events:n}),r?this._sendEventsViaBeacon(n):yield this._sendEventsViaPost(n));return s.success?(this._emitter({name:"logs_flushed",events:n}),!0):(o.Log.warn("Failed to flush events."),this._saveFailedLogsToStorage(n),!1)}catch(e){return o.Log.warn("Failed to flush events."),!1}})}_sendEventsViaPost(t){return s(this,void 0,void 0,function*(){var e=yield this._network.post(this._getRequestData(t)),e=null!=(e=null==e?void 0:e.code)?e:-1;return{success:200<=e&&e<300}})}_sendEventsViaBeacon(e){return{success:this._network.beacon(this._getRequestData(e))}}_getRequestData(e){return{sdkKey:this._sdkKey,data:{events:e},urlConfig:this._logEventUrlConfig,retries:3,isCompressable:!0,params:{[a.NetworkParam.EventCount]:String(e.length)},credentials:"same-origin"}}_saveFailedLogsToStorage(e){for(;500<e.length;)e.shift();var t=this._getStorageKey();try{(0,h._setObjectInStorage)(t,e)}catch(e){o.Log.warn("Unable to save failed logs to storage")}}_retryFailedLogs(t){const r=this._getStorageKey();s(this,void 0,void 0,function*(){h.Storage.isReady()||(yield h.Storage.isReadyResolver());var e=(0,h._getObjectFromStorage)(r);e&&(t===f.Startup&&h.Storage.removeItem(r),yield this._sendEvents(e))&&t===f.GainedFocus&&h.Storage.removeItem(r)}).catch(()=>{o.Log.warn("Failed to flush stored logs")})}_getStorageKey(){return"statsig.failed_logs."+(0,i._DJB2)(this._sdkKey)}_normalizeAndAppendEvent(e){e.user&&(e.user=Object.assign({},e.user),delete e.user.privateAttributes);var t={},r=this._getCurrentPageUrl(),r=(r&&(t.statsigMetadata={currentPage:r}),Object.assign(Object.assign({},e),t));o.Log.debug("Enqueued Event:",r),this._queue.push(r)}_appendAndResetNonExposedChecks(){0!==Object.keys(this._nonExposedChecks).length&&(this._normalizeAndAppendEvent({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:Object.assign({},this._nonExposedChecks)}}),this._nonExposedChecks={})}_getCurrentPageUrl(){var e;if(!1!==(null==(e=this._options)?void 0:e.includeCurrentPageUrlWithEvents))return(0,l._getCurrentPageUrlSafe)()}_startBackgroundFlushInterval(){var e=null!=(e=null==(e=this._options)?void 0:e.loggingIntervalMs)?e:1e4;const t=setInterval(()=>{var e=g[this._sdkKey];e&&e._flushIntervalId===t?m._safeFlushAndForget(this._sdkKey):clearInterval(t)},e);this._flushIntervalId=t}}t.EventLogger=m},1406:(e,i,t)=>{Object.defineProperty(i,"__esModule",{value:!0}),i._getSortedObject=i._DJB2Object=i._DJB2=void 0;const o=t(6634);i._DJB2=t=>{let r=0;for(let e=0;e<t.length;e++){var s=t.charCodeAt(e);r=(r<<5)-r+s,r&=r}return String(r>>>0)},i._DJB2Object=(e,t)=>(0,i._DJB2)(JSON.stringify((0,i._getSortedObject)(e,t)));i._getSortedObject=(r,s)=>{if(null==r)return null;var e=Object.keys(r).sort();const n={};return e.forEach(e=>{var t=r[e];0===s||"object"!==(0,o._typeOf)(t)?n[e]=t:n[e]=(0,i._getSortedObject)(t,null!=s?s-1:s)}),n}},1333:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},7512:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Log=t.LogLevel=void 0;function r(e){return e.unshift("[Statsig]"),e}t.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class s{static info(...e){s.level>=t.LogLevel.Info&&console.info(" INFO ",...r(e))}static debug(...e){s.level>=t.LogLevel.Debug&&console.debug(" DEBUG ",...r(e))}static warn(...e){s.level>=t.LogLevel.Warn&&console.warn(" WARN ",...r(e))}static error(...e){s.level>=t.LogLevel.Error&&console.error(" ERROR ",...r(e))}}(t.Log=s).level=t.LogLevel.Warn},7787:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createMemoKey=t.MemoPrefix=void 0,t.MemoPrefix={_gate:"g",_dynamicConfig:"c",_experiment:"e",_configList:"cl",_layer:"l",_paramStore:"p"};const i=new Set([]),o=new Set(["userPersistedValues"]);t.createMemoKey=function(e,t,r){let s=e+"|"+t;if(r)for(const n of Object.keys(r)){if(o.has(n))return;i.has(n)?s+=`|${n}=true`:s+=`|${n}=`+r[n]}return s}},7410:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkParam=t.NetworkDefault=t.Endpoint=void 0,t.Endpoint={_initialize:"initialize",_rgstr:"rgstr",_download_config_specs:"download_config_specs"},t.NetworkDefault={[t.Endpoint._rgstr]:"https://prodregistryv2.org/v1",[t.Endpoint._initialize]:"https://featureassets.org/v1",[t.Endpoint._download_config_specs]:"https://api.statsigcdn.com/v1"},t.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}},7023:function(e,t,r){var b=this&&this.__awaiter||function(e,o,a,l){return new(a=a||Promise)(function(r,t){function s(e){try{i(l.next(e))}catch(e){t(e)}}function n(e){try{i(l.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(s,n)}i((l=l.apply(e,o||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkCore=void 0,r(1845);const p=r(1845),w=r(8962),S=r(7512),C=r(7410),s=r(308),g=r(3091),o=r(5902),n=r(6830),a=r(4143),l=r(9122),I=r(2636),u=r(8e3),f=r(586),k=r(2397),x=500,O=3e4;const E=new Set([408,500,502,503,504,522,524,599]);t.NetworkCore=class{constructor(e,t){this._emitter=t,this._errorBoundary=null,this._timeout=1e4,this._netConfig={},this._options={},this._leakyBucket={},this._lastUsedInitUrl=null,e&&(this._options=e),this._options.networkConfig&&(this._netConfig=this._options.networkConfig),this._netConfig.networkTimeoutMs&&(this._timeout=this._netConfig.networkTimeoutMs),this._fallbackResolver=new s.NetworkFallbackResolver(this._options),this.setLogEventCompressionMode(this._getLogEventCompressionMode(e))}setLogEventCompressionMode(e){this._options.logEventCompressionMode=e}setErrorBoundary(e){this._errorBoundary=e,this._errorBoundary.wrap(this),this._errorBoundary.wrap(this._fallbackResolver),this._fallbackResolver.setErrorBoundary(e)}isBeaconSupported(){return"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon}getLastUsedInitUrlAndReset(){var e=this._lastUsedInitUrl;return this._lastUsedInitUrl=null,e}beacon(e){var t,r;return!!R(e)&&(e=this._getInternalRequestArgs("POST",e),t=this._getPopulatedURL(e),(r=navigator).sendBeacon.bind(r)(t,e.body))}post(t){return b(this,void 0,void 0,function*(){var e=this._getInternalRequestArgs("POST",t);return this._tryEncodeBody(e),yield this._tryToCompressBody(e),this._sendRequest(e)})}get(e){e=this._getInternalRequestArgs("GET",e);return this._sendRequest(e)}_sendRequest(_){return b(this,void 0,void 0,function*(){var t;if(!R(_))return null;if(this._netConfig.preventAllNetworkTraffic)return null;var{method:r,body:s,retries:n,attempt:i}=_,o=_.urlConfig.endpoint;if(this._isRateLimited(o))return S.Log.warn(`Request to ${o} was blocked because you are making requests too frequently.`),null;i=null!=i?i:1;const a="undefined"!=typeof AbortController?new AbortController:null;var e=setTimeout(()=>{null!==a&&void 0!==a&&a.abort(`Timeout of ${this._timeout}ms expired.`)},this._timeout),l=this._getPopulatedURL(_);let u=null;var c,h=(0,k._isUnloading)();try{var d,p,g,f={method:r,body:s,headers:Object.assign({},_.headers),signal:null===a||void 0===a?void 0:a.signal,priority:_.priority,keepalive:h},m=(c=i,(v=_).urlConfig.endpoint===C.Endpoint._initialize&&w.Diagnostics._markInitNetworkReqStart(v.sdkKey,{attempt:c}),this._leakyBucket[o]),y=(m&&(m.lastRequestTime=Date.now(),this._leakyBucket[o]=m),null!=(t=this._netConfig.networkOverrideFunc)?t:fetch);if(u=yield y(l,f),clearTimeout(e),u.ok)return g=yield u.text(),M(_,u,i,g),this._fallbackResolver.tryBumpExpiryTime(_.sdkKey,_.urlConfig),{body:g,code:u.status};throw d=yield u.text().catch(()=>"No Text"),(p=new Error(`NetworkError: ${l} `+d)).name="NetworkError",p}catch(e){var s=function(e,t){if(null!=e&&e.signal.aborted&&"string"==typeof e.signal.reason)return e.signal.reason;if("string"==typeof t)return t;if(t instanceof Error)return t.name+": "+t.message;return"Unknown Error"}(a,e),h=function(e){e=(null==e?void 0:e.signal.aborted)&&"string"==typeof e.signal.reason&&e.signal.reason.includes("Timeout");return e||!1}(a),v=(M(_,u,i,"",e),yield this._fallbackResolver.tryFetchUpdatedFallbackInfo(_.sdkKey,_.urlConfig,s,h));return(v&&(_.fallbackUrl=this._fallbackResolver.getActiveFallbackUrl(_.sdkKey,_.urlConfig)),!n||n<i||!E.has(null!=(c=null===u||void 0===u?void 0:u.status)?c:500))?(null!=(o=this._emitter)&&o.call(this,{name:"error",error:e,tag:I.ErrorTag.NetworkError,requestArgs:_}),m=`A networking error occurred during ${r} request to ${l}.`,S.Log.error(m,s,e),null!=(t=this._errorBoundary)&&t.attachErrorIfNoneExists(m),null):(yield function(t){return b(this,void 0,void 0,function*(){yield new Promise(e=>setTimeout(e,Math.min(x*(t*t),O)))})}(i),this._sendRequest(Object.assign(Object.assign({},_),{retries:n,attempt:i+1})))}})}_getLogEventCompressionMode(e){let t=null==e?void 0:e.logEventCompressionMode;return t=(t=t||!0!==(null==e?void 0:e.disableCompression)?t:f.LogEventCompressionMode.Disabled)||f.LogEventCompressionMode.Enabled}_isRateLimited(e){var t=Date.now(),r=null!=(r=this._leakyBucket[e])?r:{count:0,lastRequestTime:t},s=t-r.lastRequestTime,s=Math.floor(.05*s);return r.count=Math.max(0,r.count-s),50<=r.count||(r.count+=1,r.lastRequestTime=t,this._leakyBucket[e]=r,!1)}_getPopulatedURL(e){var t=null!=(t=e.fallbackUrl)?t:e.urlConfig.getUrl();e.urlConfig.endpoint!==C.Endpoint._initialize&&e.urlConfig.endpoint!==C.Endpoint._download_config_specs||(this._lastUsedInitUrl=t);const r=Object.assign({[C.NetworkParam.SdkKey]:e.sdkKey,[C.NetworkParam.SdkType]:o.SDKType._get(e.sdkKey),[C.NetworkParam.SdkVersion]:u.SDK_VERSION,[C.NetworkParam.Time]:String(Date.now()),[C.NetworkParam.SessionID]:a.SessionID.get(e.sdkKey)},e.params);e=Object.keys(r).map(e=>encodeURIComponent(e)+"="+encodeURIComponent(r[e])).join("&");return t+(e?"?"+e:"")}_tryEncodeBody(t){var e,r=(0,n._getWindowSafe)(),s=t.body;if(t.isStatsigEncodable&&!this._options.disableStatsigEncoding&&"string"==typeof s&&null==(0,p._getStatsigGlobalFlag)("no-encode")&&null!=r&&r.btoa)try{t.body=r.btoa(s).split("").reverse().join(""),t.params=Object.assign(Object.assign({},null!=(e=t.params)?e:{}),{[C.NetworkParam.StatsigEncoded]:"1"})}catch(e){S.Log.warn("Request encoding failed for "+t.urlConfig.getUrl(),e)}}_tryToCompressBody(d){return b(this,void 0,void 0,function*(){var t,r=d.body;if("string"==typeof r&&function(e,t){if(!e.isCompressable)return;if(null!=(0,p._getStatsigGlobalFlag)("no-compress")||"undefined"==typeof CompressionStream||"undefined"==typeof TextEncoder)return;var r=null!=e.urlConfig.customUrl||null!=e.urlConfig.fallbackUrls,s=!0===g.SDKFlags.get(e.sdkKey,"enable_log_event_compression");switch(t.logEventCompressionMode){case f.LogEventCompressionMode.Disabled:return;case f.LogEventCompressionMode.Enabled:return r&&!s?void 0:1;case f.LogEventCompressionMode.Forced:return 1;default:return}}(d,this._options))try{for(var s,n=(new TextEncoder).encode(r),i=new CompressionStream("gzip"),o=i.writable.getWriter(),a=(o.write(n).catch(S.Log.error),o.close().catch(S.Log.error),i.readable.getReader()),l=[];!(s=yield a.read()).done;)l.push(s.value);var u=l.reduce((e,t)=>e+t.length,0),c=new Uint8Array(u);let e=0;for(const h of l)c.set(h,e),e+=h.length;d.body=c,d.params=Object.assign(Object.assign({},null!=(t=d.params)?t:{}),{[C.NetworkParam.IsGzipped]:"1"})}catch(e){S.Log.warn("Request compression failed for "+d.urlConfig.getUrl(),e)}})}_getInternalRequestArgs(e,t){var r=this._fallbackResolver.getActiveFallbackUrl(t.sdkKey,t.urlConfig),e=Object.assign(Object.assign({},t),{method:e,fallbackUrl:r});return"data"in t&&i(e,t.data),e}};const R=e=>!!e.sdkKey||(S.Log.warn("Unable to make request without an SDK key"),!1),i=(e,t)=>{var{sdkKey:r,fallbackUrl:s}=e,n=l.StableID.get(r),i=a.SessionID.get(r),r=o.SDKType._get(r);e.body=JSON.stringify(Object.assign(Object.assign({},t),{statsigMetadata:Object.assign(Object.assign({},u.StatsigMetadataProvider.get()),{stableID:n,sessionID:i,sdkType:r,fallbackUrl:s})}))};function M(e,t,r,s,n){e.urlConfig.endpoint===C.Endpoint._initialize&&w.Diagnostics._markInitNetworkReqEnd(e.sdkKey,w.Diagnostics._getDiagnosticsData(t,r,s,n))}},308:function(e,t,r){var a=this&&this.__awaiter||function(e,o,a,l){return new(a=a||Promise)(function(r,t){function s(e){try{i(l.next(e))}catch(e){t(e)}}function n(e){try{i(l.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(s,n)}i((l=l.apply(e,o||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t._isDomainFailure=t.NetworkFallbackResolver=void 0;const o=r(8809),s=r(1406),i=r(7512),l=r(4534);function u(e,t){e=null!=(e=null==e?void 0:e.toLowerCase())?e:"";return t||e.includes("uncaught exception")||e.includes("failed to fetch")||e.includes("networkerror when attempting to fetch resource")}function c(e){return"statsig.network_fallback."+(0,s._DJB2)(e)}function h(e,t){e=c(e);t&&0!==Object.keys(t).length?l.Storage.setItem(e,JSON.stringify(t)):l.Storage.removeItem(e)}t.NetworkFallbackResolver=class{constructor(e){this._fallbackInfo=null,this._errorBoundary=null,this._dnsQueryCooldowns={},this._networkOverrideFunc=null==(e=e.networkConfig)?void 0:e.networkOverrideFunc}setErrorBoundary(e){this._errorBoundary=e}tryBumpExpiryTime(e,t){var r=null==(r=this._fallbackInfo)?void 0:r[t.endpoint];r&&(r.expiryTime=Date.now()+6048e5,h(e,Object.assign(Object.assign({},this._fallbackInfo),{[t.endpoint]:r})))}getActiveFallbackUrl(e,t){var r;if(null!=t.customUrl&&null!=t.fallbackUrls)return null;let s=this._fallbackInfo;null==s&&(s=null!=(n=function(e){e=c(e),e=l.Storage.getItem(e);if(!e)return null;try{return JSON.parse(e)}catch(e){return i.Log.error("Failed to parse FallbackInfo"),null}}(e))?n:{},this._fallbackInfo=s);var n=s[t.endpoint];return!n||Date.now()>(null!=(r=n.expiryTime)?r:0)||t.getChecksum()!==n.urlConfigChecksum?(delete s[t.endpoint],this._fallbackInfo=s,h(e,this._fallbackInfo),null):n.url||null}tryFetchUpdatedFallbackInfo(s,n,i,o){return a(this,void 0,void 0,function*(){var t,e,r;try{return u(i,o)?(e=null==n.customUrl&&null==n.fallbackUrls?yield this._tryFetchFallbackUrlsFromNetwork(n):n.fallbackUrls,!!(r=this._pickNewFallbackUrl(null==(t=this._fallbackInfo)?void 0:t[n.endpoint],e))&&(this._updateFallbackInfoWithNewUrl(s,n,r),!0)):!1}catch(e){return null!=(t=this._errorBoundary)&&t.logError("tryFetchUpdatedFallbackInfo",e),!1}})}_updateFallbackInfoWithNewUrl(e,t,r){var r={urlConfigChecksum:t.getChecksum(),url:r,expiryTime:Date.now()+6048e5,previous:[]},t=t.endpoint,s=null==(s=this._fallbackInfo)?void 0:s[t],s=(s&&r.previous.push(...s.previous),10<r.previous.length&&(r.previous=[]),null==(s=null==(s=this._fallbackInfo)?void 0:s[t])?void 0:s.url);null!=s&&r.previous.push(s),this._fallbackInfo=Object.assign(Object.assign({},this._fallbackInfo),{[t]:r}),h(e,this._fallbackInfo)}_tryFetchFallbackUrlsFromNetwork(i){return a(this,void 0,void 0,function*(){var e=this._dnsQueryCooldowns[i.endpoint];if(e&&Date.now()<e)return null;this._dnsQueryCooldowns[i.endpoint]=Date.now()+144e5;var t=[],e=yield(0,o._fetchTxtRecords)(null!=(e=this._networkOverrideFunc)?e:fetch),r=function(e){try{return new URL(e).pathname}catch(e){return null}}(i.defaultUrl);for(const n of e)if(n.startsWith(i.endpointDnsKey+"=")){var s=n.split("=");if(1<s.length){let e=s[1];e.endsWith("/")&&(e=e.slice(0,-1)),t.push("https://"+e+r)}}return t})}_pickNewFallbackUrl(e,t){var r;if(null==t)return null;var s=new Set(null!=(r=null==e?void 0:e.previous)?r:[]),n=null==e?void 0:e.url;let i=null;for(const a of t){var o=a.endsWith("/")?a.slice(0,-1):a;if(!s.has(a)&&o!==n){i=o;break}}return i}},t._isDomainFailure=u},1405:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},1361:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},3091:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SDKFlags=void 0;const r={};t.SDKFlags={setFlags:(e,t)=>{r[e]=t},get:(e,t)=>{return null!=(e=null==(e=r[e])?void 0:e[t])&&e}}},5902:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SDKType=void 0;const r={};let s;t.SDKType={_get:e=>{return(null!=(e=r[e])?e:"js-mono")+(null!==s&&void 0!==s?s:"")},_setClientType(e,t){r[e]=t},_setBindingType(e){s&&"-react"!==s||(s="-"+e)}}},6830:(e,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s._getUnloadEvent=s._getCurrentPageUrlSafe=s._addDocumentEventListenerSafe=s._addWindowEventListenerSafe=s._isServerEnv=s._getDocumentSafe=s._getWindowSafe=void 0;s._getWindowSafe=()=>"undefined"!=typeof window?window:null,s._getDocumentSafe=()=>{var e=(0,s._getWindowSafe)();return null!=(e=null==e?void 0:e.document)?e:null},s._isServerEnv=()=>{var e;return null===(0,s._getDocumentSafe)()&&(e="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,"string"==typeof EdgeRuntime||e)},s._addWindowEventListenerSafe=(e,t)=>{var r=(0,s._getWindowSafe)();"function"==typeof(null==r?void 0:r.addEventListener)&&r.addEventListener(e,t)},s._addDocumentEventListenerSafe=(e,t)=>{var r=(0,s._getDocumentSafe)();"function"==typeof(null==r?void 0:r.addEventListener)&&r.addEventListener(e,t)},s._getCurrentPageUrlSafe=()=>{var e;try{return null==(e=(0,s._getWindowSafe)())?void 0:e.location.href.split(/[?#]/)[0]}catch(e){}};s._getUnloadEvent=()=>{var e=(0,s._getWindowSafe)();return e&&"onpagehide"in e?"pagehide":"beforeunload"}},4143:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigSession=t.SessionID=void 0;const s=r(1845),n=r(2137),a=r(7512),l=r(4534),u=r(8023),c=18e5,h=144e5,d={};function p(t,e){return setTimeout(()=>{var e=null==(e=(0,s._getStatsigGlobal)())?void 0:e.instance(t);e&&e.$emt({name:"session_expired"})},e)}function g(e){return"statsig.session_id."+(0,n._getStorageKey)(e)}t.SessionID={get:e=>t.StatsigSession.get(e).data.sessionID},t.StatsigSession={get:e=>{null==d[e]&&(d[e]=function(e){let t=function(e){e=g(e);return(0,l._getObjectFromStorage)(e)}(e);var r=Date.now();t=t||{sessionID:(0,u.getUUID)(),startTime:r,lastUpdate:r};return{data:t,sdkKey:e}}(e));var e=d[e],t=Date.now(),r=e.data,s=e.sdkKey,n=((function({lastUpdate:e}){return Date.now()-e>c}(r)||function({startTime:e}){return Date.now()-e>h}(r))&&(r.sessionID=(0,u.getUUID)(),r.startTime=t,o=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instance(s))&&o.$emt({name:"session_expired"}),r.lastUpdate=t,r),i=e.sdkKey;i=g(i);try{(0,l._setObjectInStorage)(i,n)}catch(e){a.Log.warn("Failed to save SessionID")}clearTimeout(e.idleTimeoutID),clearTimeout(e.ageTimeoutID);var o=t-r.startTime;return e.idleTimeoutID=p(s,c),e.ageTimeoutID=p(s,h-o),e},overrideInitialSessionID:(e,t)=>{var r;d[t]=(e=e,t=t,r=Date.now(),{data:{sessionID:e,startTime:r,lastUpdate:r},sdkKey:t})}}},2176:(e,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a._fastApproxSizeOf=void 0;a._fastApproxSizeOf=(t,r)=>{let s=0;var n=Object.keys(t);for(let e=0;e<n.length;e++){var i=n[e],o=t[i];if((s=(s+=i.length)+("object"==typeof o&&null!==o?(0,a._fastApproxSizeOf)(o,r)+2:String(o).length+1))>=r)return s}return s}},9122:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getCookieName=t.StableID=void 0;const s=r(2137),n=r(7512),i=r(6830),o=r(4534),a=r(8023),l={},u={},c={};function h(e){return"statsig.stable_id."+(0,s._getStorageKey)(e)}function d(e,t){t=h(t);try{(0,o._setObjectInStorage)(t,e)}catch(e){n.Log.warn("Failed to save StableID to storage")}}function p(e,t){var r;u[t]&&null!=(0,i._getDocumentSafe)()&&((r=new Date).setFullYear(r.getFullYear()+1),document.cookie=`${g(t)}=${encodeURIComponent(e)}; expires=${r.toUTCString()}; path=/`)}function g(e){return"statsig.stable_id."+(0,s._getStorageKey)(e)}t.StableID={cookiesEnabled:!1,randomID:Math.random().toString(36),get:e=>{if(c[e])return null;if(null!=l[e])return l[e];let t=null;return null!=(t=function(e){if(u[e]&&null!=(0,i._getDocumentSafe)())for(const s of document.cookie.split(";")){var[t,r]=s.trim().split("=");if(t===g(e))return decodeURIComponent(r)}return null}(e))?d(l[e]=t,e):(d(t=null==(t=function(e){e=h(e);return(0,o._getObjectFromStorage)(e)}(e))?(0,a.getUUID)():t,e),p(t,e),l[e]=t),t},setOverride:(e,t)=>{d(l[t]=e,t),p(e,t)},_setCookiesEnabled:(e,t)=>{u[e]=t},_setDisabled:(e,t)=>{c[e]=t}},t.getCookieName=g},1375:function(e,t,r){var s=this&&this.__awaiter||function(e,o,a,l){return new(a=a||Promise)(function(r,t){function s(e){try{i(l.next(e))}catch(e){t(e)}}function n(e){try{i(l.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(s,n)}i((l=l.apply(e,o||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigClientBase=void 0,r(1845);const o=r(1845),a=r(5542),l=r(7770),u=r(7512),i=r(7787),c=r(6830),h=r(4143),d=r(9122),n=r(586),p=r(4534);t.StatsigClientBase=class{constructor(e,t,r,s){this.loadingStatus="Uninitialized",this._initializePromise=null,this._listeners={};var n,i=this.$emt.bind(this);null!=(null==s?void 0:s.logLevel)&&(u.Log.level=s.logLevel),null!=s&&s.disableStorage&&p.Storage._setDisabled(!0),null!=s&&s.initialSessionID&&h.StatsigSession.overrideInitialSessionID(s.initialSessionID,e),null!=s&&s.storageProvider&&p.Storage._setProvider(s.storageProvider),null!=s&&s.enableCookies&&d.StableID._setCookiesEnabled(e,s.enableCookies),null!=s&&s.disableStableID&&d.StableID._setDisabled(e,!0),this._sdkKey=e,this._options=null!=s?s:{},this._memoCache={},this.overrideAdapter=null!=(n=null==s?void 0:s.overrideAdapter)?n:null,this._logger=new l.EventLogger(e,i,r,s),this._errorBoundary=new a.ErrorBoundary(e,s,i),this._errorBoundary.wrap(this),this._errorBoundary.wrap(t),this._errorBoundary.wrap(this._logger),r.setErrorBoundary(this._errorBoundary),this.dataAdapter=t,this.dataAdapter.attach(e,s,r),this.storageProvider=p.Storage,null!=(t=null==(i=null==(n=this.overrideAdapter)?void 0:n.loadFromStorage)?void 0:i.call(n))&&t.catch(e=>this._errorBoundary.logError("OA::loadFromStorage",e)),this._primeReadyRipcord(),s=e,r=this,(0,c._isServerEnv)()||(i=(0,o._getStatsigGlobal)(),n=null!=(n=i.instances)?n:{},r=r,null!=n[s]&&u.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),n[s]=r,i.firstInstance||(i.firstInstance=r),i.instances=n,__STATSIG__=i)}updateRuntimeOptions(e){e.loggingEnabled?(this._options.loggingEnabled=e.loggingEnabled,this._logger.setLoggingEnabled(e.loggingEnabled)):null!=e.disableLogging&&(this._options.disableLogging=e.disableLogging,this._logger.setLoggingEnabled(e.disableLogging?"disabled":"browser-only")),null!=e.disableStorage&&(this._options.disableStorage=e.disableStorage,p.Storage._setDisabled(e.disableStorage)),null!=e.enableCookies&&(this._options.enableCookies=e.enableCookies,d.StableID._setCookiesEnabled(this._sdkKey,e.enableCookies)),e.logEventCompressionMode?this._logger.setLogEventCompressionMode(e.logEventCompressionMode):e.disableCompression&&this._logger.setLogEventCompressionMode(n.LogEventCompressionMode.Disabled)}flush(){return this._logger.flush()}shutdown(){return s(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),this._setStatus("Uninitialized",null),this._initializePromise=null,yield this._logger.stop()})}on(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)}off(e,t){this._listeners[e]&&-1!==(t=this._listeners[e].indexOf(t))&&this._listeners[e].splice(t,1)}$on(e,t){t.__isInternal=!0,this.on(e,t)}$emt(r){var e;const t=t=>{try{t(r)}catch(e){!0===t.__isInternal?this._errorBoundary.logError("__emit:"+r.name,e):u.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",r)}};this._listeners[r.name]&&this._listeners[r.name].forEach(e=>t(e)),null!=(e=this._listeners["*"])&&e.forEach(t)}_setStatus(e,t){this.loadingStatus=e,this._memoCache={},this.$emt({name:"values_updated",status:e,values:t})}_enqueueExposure(e,t,r){!0===(null==r?void 0:r.disableExposureLog)?this._logger.incrementNonExposureCount(e):this._logger.enqueue(t)}_memoize(s,n){return(e,t)=>{var r;return!this._options.disableEvaluationMemoization&&(r=(0,i.createMemoKey)(s,e,t))?(r in this._memoCache||(3e3<=Object.keys(this._memoCache).length&&(this._memoCache={}),this._memoCache[r]=n(e,t)),this._memoCache[r]):n(e,t)}}}},2636:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorTag=void 0,t.ErrorTag={NetworkError:"NetworkError"}},3206:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DataAdapterCachePrefix=void 0,t.DataAdapterCachePrefix="statsig.cached"},1637:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._createLayerParameterExposure=t._createConfigExposure=t._mapExposures=t._createGateExposure=t._isExposureEvent=void 0;const i="statsig::config_exposure",o="statsig::gate_exposure",u="statsig::layer_exposure",c=(e,t,r,s,n)=>(r.bootstrapMetadata&&(s.bootstrapMetadata=r.bootstrapMetadata),{eventName:e,user:t,value:null,metadata:a(r,s),secondaryExposures:n,time:Date.now()});t._isExposureEvent=({eventName:e})=>e===o||e===i||e===u;function h(e,t){return e.map(e=>"string"==typeof e?(null!=t?t:{})[e]:e).filter(e=>null!=e)}t._createGateExposure=(e,t,r)=>{var s,n={gate:t.name,gateValue:String(t.value),ruleID:t.ruleID};return null!=(null==(s=t.__evaluation)?void 0:s.version)&&(n.configVersion=t.__evaluation.version),c(o,e,t.details,n,h(null!=(e=null==(s=t.__evaluation)?void 0:s.secondary_exposures)?e:[],r))},t._mapExposures=h;t._createConfigExposure=(e,t,r)=>{var s,n={config:t.name,ruleID:t.ruleID};return null!=(null==(s=t.__evaluation)?void 0:s.version)&&(n.configVersion=t.__evaluation.version),null!=(null==(s=t.__evaluation)?void 0:s.passed)&&(n.rulePassed=String(t.__evaluation.passed)),c(i,e,t.details,n,h(null!=(e=null==(s=t.__evaluation)?void 0:s.secondary_exposures)?e:[],r))};t._createLayerParameterExposure=(e,t,r,s)=>{var n=t.__evaluation,i=!0===(null==(i=null==n?void 0:n.explicit_parameters)?void 0:i.includes(r));let o="",a=null!=(l=null==n?void 0:n.undelegated_secondary_exposures)?l:[];i&&(o=null!=(l=n.allocated_experiment_name)?l:"",a=null!=(l=n.secondary_exposures)?l:[]);var l=null==(n=t.__evaluation)?void 0:n.parameter_rule_ids,l={config:t.name,parameterName:r,ruleID:null!=(n=null==l?void 0:l[r])?n:t.ruleID,allocatedExperiment:o,isExplicitParameter:String(i)};return null!=(null==(r=t.__evaluation)?void 0:r.version)&&(l.configVersion=t.__evaluation.version),c(u,e,t.details,l,h(a,s))};const a=(e,t)=>(t.reason=e.reason,e.lcut&&(t.lcut=String(e.lcut)),e.receivedAt&&(t.receivedAt=String(e.receivedAt)),t)},8e3:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigMetadataProvider=t.SDK_VERSION=void 0,t.SDK_VERSION="3.25.0-beta.1";let r={sdkVersion:t.SDK_VERSION,sdkType:"js-mono"};t.StatsigMetadataProvider={get:()=>r,add:e=>{r=Object.assign(Object.assign({},r),e)}}},586:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LoggingEnabledOption=t.LogEventCompressionMode=void 0,t.LogEventCompressionMode={Disabled:"d",Enabled:"e",Forced:"f"},t.LoggingEnabledOption={disabled:"disabled",browserOnly:"browser-only",always:"always"}},1098:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},2059:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._makeTypedGet=t._mergeOverride=t._makeLayer=t._makeExperiment=t._makeDynamicConfig=t._makeFeatureGate=void 0;const o=r(7512),a=r(6634);function n(e,t,r,s){return{name:e,details:t,ruleID:null!=(e=null==r?void 0:r.rule_id)?e:"",__evaluation:r,value:s}}function s(e,t,r){var s=null!=(s=null==r?void 0:r.value)?s:{};return Object.assign(Object.assign({},n(e,t,r,s)),{get:i(e,null==r?void 0:r.value)})}function i(s,n,i){return(e,t)=>{var r=null!=(r=null==n?void 0:n[e])?r:null;return null==r?null!=t?t:null:null==t||(0,a._isTypeMatch)(r,t)?(null!=i&&i(e),r):(o.Log.warn(`Parameter type mismatch. '${s}.${e}' was found to be type '${typeof r}' but fallback/return type is '${typeof t}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),null!=t?t:null)}}t._makeFeatureGate=function(e,t,r){return Object.assign(Object.assign({},n(e,t,r,!0===(null==r?void 0:r.value))),{idType:null!=(e=null==r?void 0:r.id_type)?e:null})},t._makeDynamicConfig=s,t._makeExperiment=function(e,t,r){return e=s(e,t,r),Object.assign(Object.assign({},e),{groupName:null!=(t=null==r?void 0:r.group_name)?t:null})},t._makeLayer=function(e,t,r,s){return Object.assign(Object.assign({},n(e,t,r,void 0)),{get:i(e,null==r?void 0:r.value,s),groupName:null!=(t=null==r?void 0:r.group_name)?t:null,__value:null!=(e=null==r?void 0:r.value)?e:{}})},t._mergeOverride=function(e,t,r,s){return Object.assign(Object.assign(Object.assign({},e),t),{get:i(e.name,r,s)})},t._makeTypedGet=i},1812:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},3932:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UPDATE_DETAIL_ERROR_MESSAGES=t.createUpdateDetails=void 0;t.createUpdateDetails=(e,t,r,s,n,i)=>({duration:r,source:t,success:e,error:s,sourceUrl:n,warnings:i}),t.UPDATE_DETAIL_ERROR_MESSAGES={NO_NETWORK_DATA:"No data was returned from the network. This may be due to a network timeout if a timeout value was specified in the options or ad blocker error."}},8578:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._getFullUserHash=t._normalizeUser=void 0;const s=r(1406),n=r(7512);t._normalizeUser=function(e,t,r){try{var s=JSON.parse(JSON.stringify(e));return null!=t&&null!=t.environment?s.statsigEnvironment=t.environment:null!=r&&(s.statsigEnvironment={tier:r}),s}catch(e){return n.Log.error("Failed to JSON.stringify user"),{statsigEnvironment:void 0}}},t._getFullUserHash=function(e){return e?(0,s._DJB2Object)(e):null}},4534:(e,r,t)=>{Object.defineProperty(r,"__esModule",{value:!0}),r._setObjectInStorage=r._getObjectFromStorage=r.Storage=void 0;var s=t(7512),t=t(6830);const n={},i={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:e=>n[e]||null,setItem:(e,t)=>{n[e]=t},removeItem:e=>{delete n[e]},getAllKeys:()=>Object.keys(n)};let o=null;try{const c=(0,t._getWindowSafe)();c&&c.localStorage&&"function"==typeof c.localStorage.getItem&&(o={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:e=>c.localStorage.getItem(e),setItem:(e,t)=>c.localStorage.setItem(e,t),removeItem:e=>c.localStorage.removeItem(e),getAllKeys:()=>Object.keys(c.localStorage)})}catch(e){s.Log.warn("Failed to setup localStorageProvider.")}let a=null!==o&&void 0!==o?o:i,l=a;function u(t){try{return t()}catch(e){if(e instanceof Error&&"SecurityError"===e.name)return r.Storage._setProvider(i),null;throw e instanceof Error&&"QuotaExceededError"===e.name&&(t=r.Storage.getAllKeys().filter(e=>e.startsWith("statsig.")),e.message=e.message+". Statsig Keys: "+t.length),e}}r.Storage={isReady:()=>l.isReady(),isReadyResolver:()=>l.isReadyResolver(),getProviderName:()=>l.getProviderName(),getItem:e=>u(()=>l.getItem(e)),setItem:(e,t)=>u(()=>l.setItem(e,t)),removeItem:e=>l.removeItem(e),getAllKeys:()=>l.getAllKeys(),_setProvider:e=>{a=e,l=e},_setDisabled:e=>{l=e?i:a}},r._getObjectFromStorage=function(e){return e=r.Storage.getItem(e),JSON.parse(null!=e?e:"null")},r._setObjectInStorage=function(e,t){r.Storage.setItem(e,JSON.stringify(t))}},3401:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._typedJsonParse=void 0;const n=r(7512);t._typedJsonParse=function(e,t,r){try{var s=JSON.parse(e);if(s&&"object"==typeof s&&t in s)return s}catch(e){}return n.Log.error("Failed to parse "+r),null}},6634:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._isTypeMatch=t._typeOf=void 0,t._typeOf=function(e){return Array.isArray(e)?"array":typeof e},t._isTypeMatch=function(e,t){var r=e=>Array.isArray(e)?"array":null===e?"null":typeof e;return r(e)===r(t)}},8023:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getUUID=void 0,t.getUUID=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();let r=(new Date).getTime(),s="undefined"!=typeof performance&&performance.now&&1e3*performance.now()||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(4*Math.random())]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=16*Math.random();return 0<r?(t=(r+t)%16|0,r=Math.floor(r/16)):(t=(s+t)%16|0,s=Math.floor(s/16)),("x"===e?t:7&t|8).toString(16)})}},1881:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UrlConfiguration=void 0;const s=r(1406),n=r(7410),i={[n.Endpoint._initialize]:"i",[n.Endpoint._rgstr]:"e",[n.Endpoint._download_config_specs]:"d"};t.UrlConfiguration=class{constructor(e,t,r,s){this.customUrl=null,this.fallbackUrls=null,this.endpoint=e,this.endpointDnsKey=i[e],t&&(this.customUrl=t),!t&&r&&(this.customUrl=r.endsWith("/")?""+r+e:r+"/"+e),s&&(this.fallbackUrls=s);t=n.NetworkDefault[e];this.defaultUrl=t+"/"+e}getUrl(){var e;return null!=(e=this.customUrl)?e:this.defaultUrl}getChecksum(){var e=(null!=(e=this.fallbackUrls)?e:[]).sort().join(",");return(0,s._DJB2)(this.customUrl+e)}}},2397:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._notifyVisibilityChanged=t._subscribeToVisiblityChanged=t._isUnloading=t._isCurrentlyVisible=void 0;r=r(6830);const s="foreground",n="background",i=[];let o=s,a=!1;t._isCurrentlyVisible=()=>o===s,t._isUnloading=()=>a,t._subscribeToVisiblityChanged=e=>{i.unshift(e)};t._notifyVisibilityChanged=t=>{t!==o&&(o=t,i.forEach(e=>e(t)))},(0,r._addWindowEventListenerSafe)("focus",()=>{(a=!1,t._notifyVisibilityChanged)(s)}),(0,r._addWindowEventListenerSafe)("blur",()=>(0,t._notifyVisibilityChanged)(n)),(0,r._addDocumentEventListenerSafe)("visibilitychange",()=>{(0,t._notifyVisibilityChanged)("visible"===document.visibilityState?s:n)}),(0,r._addWindowEventListenerSafe)((0,r._getUnloadEvent)(),()=>{a=!0,(0,t._notifyVisibilityChanged)(n)})},6914:function(e,t,r){var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){void 0===s&&(s=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&("get"in n?t.__esModule:!n.writable&&!n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,s,n)}:function(e,t,r,s){e[s=void 0===s?r:s]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||s(t,e,r)},i=(Object.defineProperty(t,"__esModule",{value:!0}),t.Storage=t.Log=t.EventLogger=t.Diagnostics=void 0,r(1845),r(1845));const o=r(8962),a=(Object.defineProperty(t,"Diagnostics",{enumerable:!0,get:function(){return o.Diagnostics}}),r(7770)),l=(Object.defineProperty(t,"EventLogger",{enumerable:!0,get:function(){return a.EventLogger}}),r(7512));Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return l.Log}});var u=r(8e3);const c=r(4534);Object.defineProperty(t,"Storage",{enumerable:!0,get:function(){return c.Storage}}),n(r(1845),t),n(r(2137),t),n(r(6427),t),n(r(694),t),n(r(8962),t),n(r(3539),t),n(r(5542),t),n(r(2922),t),n(r(2417),t),n(r(1406),t),n(r(1333),t),n(r(7512),t),n(r(7787),t),n(r(7410),t),n(r(7023),t),n(r(1405),t),n(r(1361),t),n(r(6830),t),n(r(5902),t),n(r(4143),t),n(r(2176),t),n(r(9122),t),n(r(1375),t),n(r(2636),t),n(r(3206),t),n(r(1637),t),n(r(8e3),t),n(r(586),t),n(r(1098),t),n(r(2059),t),n(r(1812),t),n(r(8578),t),n(r(4534),t),n(r(3401),t),n(r(6634),t),n(r(1881),t),n(r(8023),t),n(r(2397),t),n(r(3932),t),n(r(3091),t),Object.assign((0,i._getStatsigGlobal)(),{Log:l.Log,SDK_VERSION:u.SDK_VERSION})},2016:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AutoInit=void 0;const v=r(6914),_=r(2018);function b(e,t){var r;return null!=(r=t.get(e))?r:t.get(e.toLowerCase())}t.AutoInit=class{static attempt(t){var e,r,s,n,i;try{var o=(0,v._getWindowSafe)(),a=(0,v._getDocumentSafe)();if(o&&a&&a.currentScript){var l=a.currentScript.getAttribute("src"),u=null==(e=o.location)?void 0:e.href;if(l&&u){var c=new URL(l,u).searchParams,h=null!=(r=b("sdkKey",c))?r:b("apiKey",c);if(h){var d={},p=b("proxy",c),g=(p&&(d.networkConfig={api:p}),null==(n=null==(s=(0,v._getStatsigGlobal)())?void 0:s.instances)?void 0:n[h]);let e=null;if(e=g instanceof _.StatsigClient?g:e)t({sdkKey:h,client:e});else{var f=a.currentScript.dataset;const m=function(e,t){if(e)if(e in t&&"function"==typeof t[e])return t[e];return null}(null!=(i=f.onstatsiginit)?i:f.onStatsigInit,o),y=new _.StatsigClient(h,function(){var e=(0,v._getWindowSafe)();if(!e)return{};let t=e.statsigUser||{};var r=(t="object"!=typeof t?{}:t).custom||{},s=t.customIDs||{};return Object.assign(Object.assign({},t),{customIDs:Object.assign({},s),custom:Object.assign(Object.assign({},r),{useragent:e.navigator.userAgent,page_url:(0,v._getCurrentPageUrlSafe)()||"",language:null==(s=e.navigator)?void 0:s.language})})}(),d);y.initializeAsync().then(()=>{m&&m(y)}).catch(e=>{v.Log.error(e)}),t({sdkKey:h,client:y})}}}}}catch(e){v.Log.error("AutoInit failed",e)}}}},2043:function(e,t,r){var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},s=(Object.defineProperty(t,"__esModule",{value:!0}),s(r(2018)));const n=r(3447);r=r(2016);t.default=s.default,r.AutoInit.attempt(({client:e})=>{new n.SessionReplay(e)})},7262:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._resolveDeltasResponse=void 0;const s=r(6914);function n(e,t){null!=e&&e.forEach(e=>{delete t[e]})}t._resolveDeltasResponse=function(e,t){var r;return(t=(0,s._typedJsonParse)(t,"checksum","DeltasEvaluationResponse"))?(e=e,r=t,e=Object.assign(Object.assign(Object.assign({},e),r),{feature_gates:Object.assign(Object.assign({},e.feature_gates),r.feature_gates),layer_configs:Object.assign(Object.assign({},e.layer_configs),r.layer_configs),dynamic_configs:Object.assign(Object.assign({},e.dynamic_configs),r.dynamic_configs)}),n((e=r=e).deleted_gates,e.feature_gates),delete e.deleted_gates,n(r.deleted_configs,e.dynamic_configs),delete e.deleted_configs,n(r.deleted_layers,e.layer_configs),delete e.deleted_layers,r=e,(e=(0,s._DJB2Object)({feature_gates:r.feature_gates,dynamic_configs:r.dynamic_configs,layer_configs:r.layer_configs},2))===t.checksumV2?JSON.stringify(r):{hadBadDeltaChecksum:!0,badChecksum:e,badMergedConfigs:r,badFullResponse:t.deltas_full_response}):{hadBadDeltaChecksum:!0}}},4845:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(6914);t.default=class{constructor(e){this._sdkKey=e,this._rawValues=null,this._values=null,this._source="Uninitialized",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings=new Set}reset(){this._values=null,this._rawValues=null,this._source="Loading",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings.clear()}finalize(){this._values||(this._source="NoValues")}getValues(){return this._rawValues?(0,n._typedJsonParse)(this._rawValues,"has_updates","EvaluationStoreValues"):null}setValues(e,t){var r;return!!e&&null!=(r=(0,n._typedJsonParse)(e.data,"has_updates","EvaluationResponse"))&&(this._source=e.source,!0===(null==r?void 0:r.has_updates)&&(this._rawValues=e.data,this._lcut=r.time,this._receivedAt=e.receivedAt,this._values=r,this._bootstrapMetadata=this._extractBootstrapMetadata(e.source,r),e.source&&r.user&&this._setWarningState(t,r),n.SDKFlags.setFlags(this._sdkKey,null!=(e=r.sdk_flags)?e:{})),!0)}getWarnings(){if(0!==this._warnings.size)return Array.from(this._warnings)}getGate(e){var t;return this._getDetailedStoreResult(null==(t=this._values)?void 0:t.feature_gates,e)}getConfig(e){var t;return this._getDetailedStoreResult(null==(t=this._values)?void 0:t.dynamic_configs,e)}getConfigList(){var e;return null!=(e=this._values)&&e.dynamic_configs?Object.values(this._values.dynamic_configs).map(e=>e.name):[]}getLayer(e){var t;return this._getDetailedStoreResult(null==(t=this._values)?void 0:t.layer_configs,e)}getParamStore(e){var t;return this._getDetailedStoreResult(null==(t=this._values)?void 0:t.param_stores,e)}getSource(){return this._source}getExposureMapping(){var e;return null==(e=this._values)?void 0:e.exposures}_extractBootstrapMetadata(e,t){return"Bootstrap"!==e?null:(e={},t.user&&(e.user=t.user),t.sdkInfo&&(e.generatorSDKInfo=t.sdkInfo),e.lcut=t.time,e)}_getDetailedStoreResult(e,t){let r=null;return{result:r=e?e[t]||e[(0,n._DJB2)(t)]:r,details:this._getDetails(null==r)}}_setWarningState(e,t){var r,s=n.StableID.get(this._sdkKey);(null==(r=e.customIDs)?void 0:r.stableID)!==s&&(null!=(r=e.customIDs)&&r.stableID||s)?this._warnings.add("StableIDMismatch"):"user"in t&&(r=t.user,s=Object.assign(Object.assign({},e),{analyticsOnlyMetadata:void 0,privateAttributes:void 0}),(0,n._getFullUserHash)(s)!==(0,n._getFullUserHash)(r))&&this._warnings.add("PartialUserMatch")}getCurrentSourceDetails(){var e;return"Uninitialized"===this._source||"NoValues"===this._source?{reason:this._source}:(e={reason:this._source,lcut:this._lcut,receivedAt:this._receivedAt},0<this._warnings.size&&(e.warnings=Array.from(this._warnings)),e)}_getDetails(e){var t=this.getCurrentSourceDetails();let r=t.reason;var s=null!=(s=t.warnings)?s:[],e=("Bootstrap"===this._source&&0<s.length&&(r+=s[0]),"Uninitialized"!==r&&"NoValues"!==r&&(r=r+":"+(e?"Unrecognized":"Recognized")),"Bootstrap"===this._source&&null!=(s=this._bootstrapMetadata)?s:void 0);return e&&(t.bootstrapMetadata=e),Object.assign(Object.assign({},t),{reason:r})}}},8448:function(e,t,r){var l=this&&this.__awaiter||function(e,o,a,l){return new(a=a||Promise)(function(r,t){function s(e){try{i(l.next(e))}catch(e){t(e)}}function n(e){try{i(l.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(s,n)}i((l=l.apply(e,o||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const u=r(6914),o=r(7262);class s extends u.NetworkCore{constructor(e,t){super(e,t);t=null==e?void 0:e.networkConfig;this._option=e,this._initializeUrlConfig=new u.UrlConfiguration(u.Endpoint._initialize,null==t?void 0:t.initializeUrl,null==t?void 0:t.api,null==t?void 0:t.initializeFallbackUrls)}fetchEvaluations(s,n,i,o,a){return l(this,void 0,void 0,function*(){var e,t=n?(0,u._typedJsonParse)(n,"has_updates","InitializeResponse"):null;let r={user:o,hash:null!=(e=null==(e=null==(e=this._option)?void 0:e.networkConfig)?void 0:e.initializeHashAlgorithm)?e:"djb2",deltasResponseRequested:!1,full_checksum:null};return null!=t&&t.has_updates&&(e=(null==t?void 0:t.hash_used)!==(null!=(e=null==(e=null==(e=this._option)?void 0:e.networkConfig)?void 0:e.initializeHashAlgorithm)?e:"djb2"),r=Object.assign(Object.assign({},r),{sinceTime:a&&!e?t.time:0,previousDerivedFields:"derived_fields"in t&&a?t.derived_fields:{},deltasResponseRequested:!0,full_checksum:t.full_checksum,partialUserMatchSinceTime:e?0:t.time})),this._fetchEvaluations(s,t,r,i)})}_fetchEvaluations(r,s,n,i){return l(this,void 0,void 0,function*(){var e,t=yield this.post({sdkKey:r,urlConfig:this._initializeUrlConfig,data:n,retries:2,isStatsigEncodable:!0,priority:i});return 204===(null==t?void 0:t.code)?'{"has_updates": false}':200!==(null==t?void 0:t.code)?null!=(e=null==t?void 0:t.body)?e:null:!0!==(null==s?void 0:s.has_updates)||!0!==(null==(e=t.body)?void 0:e.includes('"is_delta":true'))||!0!==n.deltasResponseRequested?t.body:"string"==typeof(e=(0,o._resolveDeltasResponse)(s,t.body))?e:this._fetchEvaluations(r,s,Object.assign(Object.assign(Object.assign({},n),e),{deltasResponseRequested:!1}),i)})}}t.default=s},3583:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._makeParamStoreGetter=void 0;const d=r(6914),p={disableExposureLog:!0};function g(e){return null==e||!1===e.disableExposureLog}function f(e,t){return null!=t&&!(0,d._isTypeMatch)(e,t)}t._makeParamStoreGetter=function(u,c,h){return(e,t)=>{if(null==c)return t;var r,s,n,i,o,a,l=c[e];if(null==l||null!=t&&(0,d._typeOf)(t)!==l.param_type)return t;switch(l.ref_type){case"static":return l.value;case"gate":return a=l,u.getFeatureGate(a.gate_name,g(h)?void 0:p).value?a.pass_value:a.fail_value;case"dynamic_config":return a=l,o=t,f(i=(i=u).getDynamicConfig(a.config_name,g(h)?void 0:p).get(a.param_name),o)?o:i;case"experiment":return o=l,i=t,f(n=(n=u).getExperiment(o.experiment_name,g(h)?void 0:p).get(o.param_name),i)?i:n;case"layer":return n=l,s=t,f(r=(r=u).getLayer(n.layer_name,g(h)?void 0:p).get(n.param_name),s)?s:r;default:return t}}}},8198:function(e,t,r){var i=this&&this.__awaiter||function(e,o,a,l){return new(a=a||Promise)(function(r,t){function s(e){try{i(l.next(e))}catch(e){t(e)}}function n(e){try{i(l.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(s,n)}i((l=l.apply(e,o||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const o=r(6914),a=r(4845),l=r(8448),n=r(3583),u=r(4131);class s extends o.StatsigClientBase{static instance(e){var t=(0,o._getStatsigGlobal)().instance(e);return t instanceof s?t:(o.Log.warn((0,o._isServerEnv)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new s(null!=e?e:"",{}))}constructor(e,t,r=null){o.SDKType._setClientType(e,"javascript-client");var s,n=new l.default(r,e=>{this.$emt(e)}),e=(super(e,null!=(s=null==r?void 0:r.dataAdapter)?s:new u.StatsigEvaluationsDataAdapter,n,r),this._possibleFirstTouchMetadata={},this.getFeatureGate=this._memoize(o.MemoPrefix._gate,this._getFeatureGateImpl.bind(this)),this.getDynamicConfig=this._memoize(o.MemoPrefix._dynamicConfig,this._getDynamicConfigImpl.bind(this)),this.getExperiment=this._memoize(o.MemoPrefix._experiment,this._getExperimentImpl.bind(this)),this.getConfigList=this._memoize(o.MemoPrefix._configList,this._getConfigListImpl.bind(this)),this.getLayer=this._memoize(o.MemoPrefix._layer,this._getLayerImpl.bind(this)),this.getParameterStore=this._memoize(o.MemoPrefix._paramStore,this._getParameterStoreImpl.bind(this)),this._store=new a.default(e),this._network=n,this._user=this._configureUser(t,r),this._sdkInstanceID=(0,o.getUUID)(),null!=(s=null==r?void 0:r.plugins)?s:[]);for(const i of e)i.bind(this)}initializeSync(e){var t;return"Uninitialized"!==this.loadingStatus?(0,o.createUpdateDetails)(!0,this._store.getSource(),-1,null,null,["MultipleInitializations",...null!=(t=this._store.getWarnings())?t:[]]):(this._logger.start(),this.updateUserSync(this._user,e))}initializeAsync(e){return i(this,void 0,void 0,function*(){return this._initializePromise||(this._initializePromise=this._initializeAsyncImpl(e)),this._initializePromise})}updateUserSync(t,e){var r=performance.now();try{return this._updateUserSyncImpl(t,e,r)}catch(e){t=e instanceof Error?e:new Error(String(e));return this._createErrorUpdateDetails(t,r)}}_updateUserSyncImpl(e,t,r){var s=[...null!=(s=this._store.getWarnings())?s:[]],e=(this._resetForUser(e),this.dataAdapter.getDataSync(this._user)),t=(null==e&&s.push("NoCachedValues"),this._store.setValues(e,this._user),this._finalizeUpdate(e),null==t?void 0:t.disableBackgroundCacheRefresh);return!0===t||null==t&&"Bootstrap"===(null==e?void 0:e.source)||this._runPostUpdate(null!=e?e:null,this._user),(0,o.createUpdateDetails)(!0,this._store.getSource(),performance.now()-r,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),s)}updateUserAsync(e,s){return i(this,void 0,void 0,function*(){var t=performance.now();try{return yield this._updateUserAsyncImpl(e,s)}catch(e){var r=e instanceof Error?e:new Error(String(e));return this._createErrorUpdateDetails(r,t)}})}_updateUserAsyncImpl(s,n){return i(this,void 0,void 0,function*(){this._resetForUser(s);var e=this._user,t=(o.Diagnostics._markInitOverallStart(this._sdkKey),this.dataAdapter.getDataSync(e));if(this._store.setValues(t,this._user),this._setStatus("Loading",t),t=yield this.dataAdapter.getDataAsync(t,e,n),e!==this._user)return(0,o.createUpdateDetails)(!1,this._store.getSource(),-1,new Error("User changed during update"),this._network.getLastUsedInitUrlAndReset());let r=!1;null!=t&&(o.Diagnostics._markInitProcessStart(this._sdkKey),r=this._store.setValues(t,this._user),o.Diagnostics._markInitProcessEnd(this._sdkKey,{success:r})),this._finalizeUpdate(t),r||(this._errorBoundary.attachErrorIfNoneExists(o.UPDATE_DETAIL_ERROR_MESSAGES.NO_NETWORK_DATA),this.$emt({name:"initialization_failure"})),o.Diagnostics._markInitOverallEnd(this._sdkKey,r,this._store.getCurrentSourceDetails());e=o.Diagnostics._enqueueDiagnosticsEvent(this._user,this._logger,this._sdkKey,this._options);return(0,o.createUpdateDetails)(r,this._store.getSource(),e,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),this._store.getWarnings())})}getContext(){return{sdkKey:this._sdkKey,options:this._options,values:this._store.getValues(),user:JSON.parse(JSON.stringify(this._user)),errorBoundary:this._errorBoundary,session:o.StatsigSession.get(this._sdkKey),stableID:o.StableID.get(this._sdkKey),sdkInstanceID:this._sdkInstanceID}}checkGate(e,t){return this.getFeatureGate(e,t).value}logEvent(e,t,r){t="string"==typeof e?{eventName:e,value:t,metadata:r}:e;this.$emt({name:"log_event_called",event:t}),this._logger.enqueue(Object.assign(Object.assign({},t),{user:this._user,time:Date.now()}))}updateUserWithAnalyticsOnlyMetadata(e){this._user=this._configureUser(Object.assign(Object.assign({},this._user),{analyticsOnlyMetadata:e}),this._options)}_primeReadyRipcord(){this.$on("error",()=>{"Loading"===this.loadingStatus&&this._finalizeUpdate(null)})}_initializeAsyncImpl(e){return i(this,void 0,void 0,function*(){return o.Storage.isReady()||(yield o.Storage.isReadyResolver()),this._logger.start(),this.updateUserAsync(this._user,e)})}_createErrorUpdateDetails(e,t){return(0,o.createUpdateDetails)(!1,this._store.getSource(),performance.now()-t,e,null,[...null!=(t=this._store.getWarnings())?t:[]])}_finalizeUpdate(e){this._store.finalize(),this._setStatus("Ready",e)}_runPostUpdate(e,t){this.dataAdapter.getDataAsync(e,t,{priority:"low"}).catch(e=>{o.Log.error("An error occurred after update.",e)})}_resetForUser(e){this._logger.reset(),this._store.reset(),this._user=this._configureUser(e,this._options)}_configureUser(e,t){e=(0,o._normalizeUser)(e,t),t=null==(t=e.customIDs)?void 0:t.stableID;return t&&o.StableID.setOverride(t,this._sdkKey),0<Object.keys(this._possibleFirstTouchMetadata).length&&(e.analyticsOnlyMetadata=Object.assign(Object.assign({},e.analyticsOnlyMetadata),this._possibleFirstTouchMetadata)),e}_getFeatureGateImpl(e,t){var{result:r,details:s}=this._store.getGate(e),s=(0,o._makeFeatureGate)(e,s,r),n=null==(n=null==(r=this.overrideAdapter)?void 0:r.getGateOverride)?void 0:n.call(r,s,this._user,t),r=null!=n?n:s;return this._enqueueExposure(e,(0,o._createGateExposure)(this._user,r,this._store.getExposureMapping()),t),this.$emt({name:"gate_evaluation",gate:r}),r}_getDynamicConfigImpl(e,t){var{result:r,details:s}=this._store.getConfig(e),s=(0,o._makeDynamicConfig)(e,s,r),n=null==(n=null==(r=this.overrideAdapter)?void 0:r.getDynamicConfigOverride)?void 0:n.call(r,s,this._user,t),r=null!=n?n:s;return this._enqueueExposure(e,(0,o._createConfigExposure)(this._user,r,this._store.getExposureMapping()),t),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:r}),r}_getExperimentImpl(e,t){var{result:r,details:s}=this._store.getConfig(e),s=(0,o._makeExperiment)(e,s,r),n=(null!=s.__evaluation&&(s.__evaluation.secondary_exposures=(0,o._mapExposures)(null!=(r=null==(r=s.__evaluation)?void 0:r.secondary_exposures)?r:[],this._store.getExposureMapping())),null==(n=null==(r=this.overrideAdapter)?void 0:r.getExperimentOverride)?void 0:n.call(r,s,this._user,t)),r=null!=n?n:s;return this._enqueueExposure(e,(0,o._createConfigExposure)(this._user,r,this._store.getExposureMapping()),t),this.$emt({name:"experiment_evaluation",experiment:r}),r}_getConfigListImpl(){return this._store.getConfigList()}_getLayerImpl(t,r){var{result:e,details:s}=this._store.getLayer(t),s=(0,o._makeLayer)(t,s,e),n=null==(n=null==(e=this.overrideAdapter)?void 0:e.getLayerOverride)?void 0:n.call(e,s,this._user,r);null!=r&&r.disableExposureLog&&this._logger.incrementNonExposureCount(t);const i=(0,o._mergeOverride)(s,n,null!=(e=null==n?void 0:n.__value)?e:s.__value,e=>{null!=r&&r.disableExposureLog||this._enqueueExposure(t,(0,o._createLayerParameterExposure)(this._user,i,e,this._store.getExposureMapping()),r)});return this.$emt({name:"layer_evaluation",layer:i}),i}_getParameterStoreImpl(e,t){var{result:r,details:s}=this._store.getParamStore(e),e=(this._logger.incrementNonExposureCount(e),{name:e,details:s,__configuration:r,get:(0,n._makeParamStoreGetter)(this,r,t)}),r=null==(r=null==(s=this.overrideAdapter)?void 0:s.getParamStoreOverride)?void 0:r.call(s,e,t);return null!=r&&(e.__configuration=r.config,e.details=r.details,e.get=(0,n._makeParamStoreGetter)(this,r.config,t)),e}}t.default=s},4131:function(e,t,r){var i=this&&this.__awaiter||function(e,o,a,l){return new(a=a||Promise)(function(r,t){function s(e){try{i(l.next(e))}catch(e){t(e)}}function n(e){try{i(l.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(s,n)}i((l=l.apply(e,o||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigEvaluationsDataAdapter=void 0;const s=r(6914),n=r(8448);class o extends s.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this._network=null,this._options=null}attach(e,t,r){super.attach(e,t,r),null!==r&&r instanceof n.default?this._network=r:this._network=new n.default(null!=t?t:{})}getDataAsync(e,t,r){return this._getDataAsyncImpl(e,(0,s._normalizeUser)(t,this._options),r)}prefetchData(e,t){return this._prefetchDataImpl(e,t)}setData(e){var t=(0,s._typedJsonParse)(e,"has_updates","data");t&&"user"in t?super.setData(e,t.user):s.Log.error("StatsigUser not found. You may be using an older server SDK version. Please upgrade your SDK or use setDataLegacy.")}setDataLegacy(e,t){super.setData(e,t)}_fetchFromNetwork(t,r,s,n){return i(this,void 0,void 0,function*(){var e=yield null==(e=this._network)?void 0:e.fetchEvaluations(this._getSdkKey(),t,null==s?void 0:s.priority,r,n);return null!=e?e:null})}_getCacheKey(e){e=(0,s._getStorageKey)(this._getSdkKey(),e,null==(e=this._options)?void 0:e.customUserCacheKeyFunc);return`${s.DataAdapterCachePrefix}.${this._cacheSuffix}.`+e}_isCachedResultValidFor204(e,t){return null!=e.fullUserHash&&e.fullUserHash===(0,s._getFullUserHash)(t)}}t.StatsigEvaluationsDataAdapter=o},2018:function(e,t,r){var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){void 0===s&&(s=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&("get"in n?t.__esModule:!n.writable&&!n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,s,n)}:function(e,t,r,s){e[s=void 0===s?r:s]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||s(t,e,r)},i=(Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigClient=void 0,r(6914)),o=r(8198),n=(t.StatsigClient=o.default,n(r(6914),t),Object.assign((0,i._getStatsigGlobal)(),{StatsigClient:o.default}));t.default=n},8788:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SessionReplay=t.runStatsigSessionReplay=t.StatsigSessionReplayPlugin=void 0;const s=r(6914);var n=r(4069);const i=r(5967);function o(e,t){new a(e,t)}t.StatsigSessionReplayPlugin=class{constructor(e){this.options=e,this.__plugin="session-replay"}bind(e){o(e,this.options)}},t.runStatsigSessionReplay=o;class a extends n.SessionReplayBase{constructor(e,t){super(e,t),this._client.$on("values_updated",()=>{var e;this._wasStopped||this._attemptToStartRecording(null==(e=this._options)?void 0:e.forceRecording)}),this._attemptToStartRecording(null==(e=this._options)?void 0:e.forceRecording)}_shutdown(e){super._shutdownImpl(e)}_attemptToStartRecording(e=!1){var t;this._totalLogs>=i.MAX_LOGS||(!0===(null==(t=this._client.getContext().values)?void 0:t.recording_blocked)||!e&&!0!==(null==t?void 0:t.can_record_session)||!1===(null==t?void 0:t.passes_session_recording_targeting)?this._shutdown():this._replayer.isRecording()||(this._wasStopped=!1,s.StatsigMetadataProvider.add({isRecordingSession:"true"}),this._replayer.record((e,t)=>this._onRecordingEvent(e,t),null!=(t=null==(e=this._options)?void 0:e.rrwebConfig)?t:{},()=>{this._shutdown()})))}}t.SessionReplay=a},4069:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SessionReplayBase=t.forceStartRecording=t.startRecording=t.stopRecording=void 0;const u=r(6914),s=r(759),c=r(5967);function n(e){var t=null==e?(0,u._getStatsigGlobal)().firstSRInstance:null==(t=null==(t=(0,u._getStatsigGlobal)())?void 0:t.srInstances)?void 0:t[e];return t instanceof i?t:null}t.stopRecording=function(e){null!=(e=n(e))&&e.stopRecording()},t.startRecording=function(e){null!=(e=n(e))&&e.startRecording()},t.forceStartRecording=function(e){null!=(e=n(e))&&e.forceStartRecording()};class i{constructor(e,t){this._sessionData={startTime:-1,endTime:0,clickCount:0},this._events=[],this._wasStopped=!1,this._currentEventIndex=0,this._totalLogs=0,this._client=e,this._options=t;var{sdkKey:e,errorBoundary:t}=this._client.getContext();this._errorBoundary=t,this._errorBoundary.wrap(this),this._replayer=new s.SessionReplayClient,this._client.$on("pre_shutdown",()=>this._shutdown()),this._client.on("session_expired",()=>{this._shutdown("session_expired")}),(0,u._isServerEnv)()||((t=(0,u._getStatsigGlobal)()).srInstances=Object.assign(Object.assign({},t.srInstances),{[e]:this}),t.firstSRInstance)||(t.firstSRInstance=this),this._currentSessionID=this._getSessionIdFromClient(),this._subscribeToVisibilityChanged()}forceStartRecording(){this._wasStopped=!1,this._attemptToStartRecording(!0)}stopRecording(){this._wasStopped=!0,this._shutdown()}startRecording(){var e;this._wasStopped=!1,this._attemptToStartRecording(null==(e=this._options)?void 0:e.forceRecording)}isRecording(){return this._replayer.isRecording()}_logRecording(e){0!==this._events.length&&(e=(0,u._isUnloading)()?"is_leaving_page":e,this._logRecordingWithSessionID(this._currentSessionID,e))}_onVisibilityChanged(e){"background"===e&&(this._logRecording(),this._client.flush().catch(e=>{this._errorBoundary.logError("SR::visibility",e)}))}_subscribeToVisibilityChanged(){const r=this._client.getContext()["sdkKey"];(0,u._subscribeToVisiblityChanged)(e=>{var t=null==(t=null==(t=(0,u._getStatsigGlobal)())?void 0:t.srInstances)?void 0:t[r];t instanceof i&&t._onVisibilityChanged(e)})}_logRecordingWithSessionID(t,r){var s=this._sessionData;if(0!==this._events.length){var n=JSON.stringify(this._events),i=(0,c._slicePayload)(n),o=1<i.length?(0,u.getUUID)():null;for(let e=0;e<i.length;e++){var a=i[e],l=(0,c._makeLoggableRrwebEvent)(a,n,t,s,this._client.getContext().sdkInstanceID);null!=o&&(0,c._appendSlicedMetadata)(l.metadata,o,e,i.length,a.length),r&&(l.metadata[r]="true"),this._totalLogs++,this._client.logEvent(l),null!=o&&this._client.flush().catch(e=>{u.Log.error(e)})}this._events=[],this._totalLogs>c.MAX_LOGS&&this._shutdown()}}_bumpSessionIdleTimerAndLogRecording(){this._getSessionIdFromClient(),this._logRecording()}_getSessionIdFromClient(){return this._client.getContext().session.data.sessionID}_shutdownImpl(e){if(this._replayer.isRecording()){this._replayer.stop();const t=()=>{u.StatsigMetadataProvider.add({isRecordingSession:"false"}),this._client.off("logs_flushed",t)};this._client.$on("logs_flushed",t)}0!==this._events.length&&this._logRecording(e),"session_expired"===e&&(this._currentEventIndex=0,this._sessionData=this._makeEmptySessionData())}_makeEmptySessionData(){return{startTime:-1,endTime:0,clickCount:0}}_onRecordingEvent(e,t){var r;this._currentSessionID!==this._getSessionIdFromClient()?this._shutdown("session_expired"):this._totalLogs>=c.MAX_LOGS?this._shutdown():(e.eventIndex=this._currentEventIndex++,this._sessionData.clickCount+=t.clickCount,this._sessionData.startTime=-1===this._sessionData.startTime?t.startTime:Math.min(this._sessionData.startTime,t.startTime),this._sessionData.endTime=Math.max(this._sessionData.endTime,t.endTime),(t=(0,u._fastApproxSizeOf)(e,c.MAX_INDIVIDUAL_EVENT_BYTES))>c.MAX_INDIVIDUAL_EVENT_BYTES?u.Log.warn(`SessionReplay event is too large (~${t} bytes) and will not be logged`,e):(r=(0,u._fastApproxSizeOf)(this._events,c.REPLAY_ENQUEUE_TRIGGER_BYTES),this._events.push(e),r+t<c.REPLAY_ENQUEUE_TRIGGER_BYTES||((0,u._isCurrentlyVisible)()?this._bumpSessionIdleTimerAndLogRecording():this._logRecording())))}}t.SessionReplayBase=i},759:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SessionReplayClient=void 0;const s=r(5980),o=r(6914);t.SessionReplayClient=class{constructor(){this._startTimestamp=null,this._endTimestamp=null}record(n,e,t,i=!1){null==(0,o._getDocumentSafe)()||(this._startTimestamp=null,this._endTimestamp=null,this._stopCallback=t,this._stopFn)||(this._stopFn=(t=(e,t)=>{var r;i?this._startTimestamp=!t&&null!=(r=this._startTimestamp)?r:e.timestamp:null==this._startTimestamp&&(this._startTimestamp=e.timestamp),this._endTimestamp=e.timestamp;let s=0;3!==(r=e).type||2!==r.data.source||2!==r.data.type&&4!==r.data.type||s++,n(Object.assign(Object.assign({},e),{eventIndex:0}),{startTime:this._startTimestamp,endTime:this._endTimestamp,clickCount:s},null!=t&&t),144e5<this._endTimestamp-this._startTimestamp&&(null!=(e=this._stopFn)&&e.call(this),this._stopCallback)&&this._stopCallback()},e=e,i?(0,s.record)(Object.assign(Object.assign({},e),{emit:t,checkoutEveryNms:3e4})):(0,s.record)(Object.assign(Object.assign({},e),{emit:t}))))}stop(){this._stopFn&&(this._stopFn(),this._stopFn=void 0)}isRecording(){return null!=this._stopFn}}},5967:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._appendSlicedMetadata=t._slicePayload=t._makeLoggableRrwebEvent=t.MAX_LOGS=t.MAX_INDIVIDUAL_EVENT_BYTES=t.REPLAY_ENQUEUE_TRIGGER_BYTES=void 0;const i=r(6914);t.REPLAY_ENQUEUE_TRIGGER_BYTES=10240,t.MAX_INDIVIDUAL_EVENT_BYTES=10485760,t.MAX_LOGS=1e4,t._makeLoggableRrwebEvent=function(e,t,r,s,n){return{eventName:"statsig::session_recording",value:r,metadata:{session_start_ts:String(s.startTime),session_end_ts:String(s.endTime),clicks_captured_cumulative:String(s.clickCount),rrweb_events:e,rrweb_payload_size:String(t.length),session_replay_sdk_version:i.SDK_VERSION,sdk_instance_id:n}}},t._slicePayload=function(t){var r=[];for(let e=0;e<t.length;e+=1048576)r.push(t.slice(e,e+1048576));return r},t._appendSlicedMetadata=function(e,t,r,s,n){e.sliced_id=t,e.slice_index=String(r),e.slice_count=String(s),e.slice_byte_size=String(n)}},3691:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TriggeredSessionReplay=t.runStatsigTriggeredSessionReplay=t.StatsigTriggeredSessionReplayPlugin=void 0;const n=r(6914);var s=r(4069);const i=r(5967);function o(e,t){new a(e,t)}t.StatsigTriggeredSessionReplayPlugin=class{constructor(e){this.options=e,this.__plugin="triggered-session-replay"}bind(e){o(e,this.options)}},t.runStatsigTriggeredSessionReplay=o;class a extends s.SessionReplayBase{constructor(e,t){super(e,t),this._runningEventData=[],this._isActiveRecording=!1,this._subscribeToClientEvents(t),null!=t&&t.autoStartRecording?this._attemptToStartRecording(null==(e=this._options)?void 0:e.forceRecording):null!=t&&t.keepRollingWindow&&this._attemptToStartRollingWindow()}_subscribeToClientEvents(e){this._subscribeToValuesUpdated(e),this._subscribeToLogEventCalled(),this._subscribeToGateEvaluation(),this._subscribeToExperimentEvaluation()}_subscribeToValuesUpdated(t){this._client.$on("values_updated",()=>{var e;this._wasStopped||(null!=t&&t.autoStartRecording?this._attemptToStartRecording(null==(e=this._options)?void 0:e.forceRecording):null!=t&&t.keepRollingWindow&&this._attemptToStartRollingWindow())})}_subscribeToLogEventCalled(){this._client.$on("log_event_called",e=>{var t;this._wasStopped||!1===(null==(t=this._client.getContext().values)?void 0:t.passes_session_recording_targeting)||null==(null==t?void 0:t.session_recording_event_triggers)||null==(t=t.session_recording_event_triggers[e.event.eventName])||!1===t.passes_sampling||null!=(t=t.values)&&!t.includes(String(null!=(t=e.event.value)?t:""))||this._attemptToStartRecording(!0)})}_subscribeToGateEvaluation(){this._client.$on("gate_evaluation",e=>{this._tryStartExposureRecording(e.gate.name,String(e.gate.value))})}_subscribeToExperimentEvaluation(){this._client.$on("experiment_evaluation",e=>{this._tryStartExposureRecording(e.experiment.name,null!=(e=e.experiment.groupName)?e:"")})}_tryStartExposureRecording(e,t){var r,s;this._wasStopped||!1===(null==(s=this._client.getContext().values)?void 0:s.passes_session_recording_targeting)||null==(null==s?void 0:s.session_recording_exposure_triggers)||null==(r=null!=(r=s.session_recording_exposure_triggers[e])?r:s.session_recording_exposure_triggers[(0,n._DJB2)(e)])||!1===r.passes_sampling||null!=(s=r.values)&&!s.includes(t)||this._attemptToStartRecording(!0)}forceStartRecording(){super.forceStartRecording()}stopRecording(){this._isActiveRecording=!1,this._runningEventData=[],super.stopRecording()}_handleStartActiveRecording(){if(this._isActiveRecording=!0,0!==this._runningEventData.length){var t=this._runningEventData.map(e=>e.events).flat();for(let e=0;e<t.length;e++)t[e].event.eventIndex=e,this._sessionData.clickCount+=t[e].data.clickCount,this._sessionData.startTime=-1===this._sessionData.startTime?t[e].data.startTime:Math.min(this._sessionData.startTime,t[e].data.startTime),this._sessionData.endTime=Math.max(this._sessionData.endTime,t[e].data.endTime);this._events=t.map(e=>e.event),this._currentEventIndex=t.length,(0,n._isCurrentlyVisible)()?this._bumpSessionIdleTimerAndLogRecording():this._logRecording(),this._replayer.stop()}}_shutdown(e){this._isActiveRecording=!1,this._runningEventData=[],super._shutdownImpl(e)}_onRecordingEvent(e,t,r){if(!this._isActiveRecording)return this._currentSessionID!==this._getSessionIdFromClient()?void this._shutdown("session_expired"):void(r&&4===e.type||0===this._runningEventData.length?(1<this._runningEventData.length&&this._runningEventData.shift(),this._runningEventData.push({events:[{event:e,data:t}]})):this._runningEventData[this._runningEventData.length-1].events.push({event:e,data:t}));super._onRecordingEvent(e,t)}_attemptToStartRollingWindow(){var e=this._client.getContext().values;!1===(null==e?void 0:e.passes_session_recording_targeting)?this._shutdown():this._replayer.isRecording()||this._replayer.record((e,t,r)=>this._onRecordingEvent(e,t,r),null!=(e=null==(e=this._options)?void 0:e.rrwebConfig)?e:{},()=>{this._shutdown()},!0)}_attemptToStartRecording(e=!1){var t;this._totalLogs>=i.MAX_LOGS||(!0===(null==(t=this._client.getContext().values)?void 0:t.recording_blocked)||!e&&!0!==(null==t?void 0:t.can_record_session)||!1===(null==t?void 0:t.passes_session_recording_targeting)?this._shutdown():(this._handleStartActiveRecording(),this._wasStopped=!1,n.StatsigMetadataProvider.add({isRecordingSession:"true"}),this._replayer.isRecording()||this._replayer.record((e,t,r)=>this._onRecordingEvent(e,t,r),null!=(t=null==(e=this._options)?void 0:e.rrwebConfig)?t:{},()=>{this._shutdown()})))}}t.TriggeredSessionReplay=a},3447:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.forceStartRecording=t.stopRecording=t.startRecording=t.StatsigTriggeredSessionReplayPlugin=t.StatsigSessionReplayPlugin=t.runStatsigTriggeredSessionReplay=t.runStatsigSessionReplay=t.SessionReplay=t.SessionReplayClient=void 0;var s=r(6914);const n=r(8788),i=(Object.defineProperty(t,"SessionReplay",{enumerable:!0,get:function(){return n.SessionReplay}}),Object.defineProperty(t,"StatsigSessionReplayPlugin",{enumerable:!0,get:function(){return n.StatsigSessionReplayPlugin}}),Object.defineProperty(t,"runStatsigSessionReplay",{enumerable:!0,get:function(){return n.runStatsigSessionReplay}}),r(4069)),o=(Object.defineProperty(t,"forceStartRecording",{enumerable:!0,get:function(){return i.forceStartRecording}}),Object.defineProperty(t,"startRecording",{enumerable:!0,get:function(){return i.startRecording}}),Object.defineProperty(t,"stopRecording",{enumerable:!0,get:function(){return i.stopRecording}}),r(759)),a=(Object.defineProperty(t,"SessionReplayClient",{enumerable:!0,get:function(){return o.SessionReplayClient}}),r(3691));Object.defineProperty(t,"StatsigTriggeredSessionReplayPlugin",{enumerable:!0,get:function(){return a.StatsigTriggeredSessionReplayPlugin}}),Object.defineProperty(t,"runStatsigTriggeredSessionReplay",{enumerable:!0,get:function(){return a.runStatsigTriggeredSessionReplay}}),Object.assign((0,s._getStatsigGlobal)(),{SessionReplayClient:o.SessionReplayClient,SessionReplay:n.SessionReplay,runStatsigSessionReplay:n.runStatsigSessionReplay,runStatsigTriggeredSessionReplay:a.runStatsigTriggeredSessionReplay,StatsigSessionReplayPlugin:n.StatsigSessionReplayPlugin,StatsigTriggeredSessionReplayPlugin:a.StatsigTriggeredSessionReplayPlugin,startRecording:i.startRecording,stopRecording:i.stopRecording,forceStartRecording:i.forceStartRecording})},5980:(x,O)=>{Object.defineProperty(O,Symbol.toStringTag,{value:"Module"});var E,R=Object.defineProperty,a=(e,t,r)=>{return r=r,(t="symbol"!=typeof t?t+"":t)in(e=e)?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r},M=Object.defineProperty,A=(e,t,r)=>{return r=r,(t="symbol"!=typeof t?t+"":t)in(e=e)?M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r},X=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(X||{});const D={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},T={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},N={};function F(e){if(N[e])return N[e];var t=globalThis[e];const r=t.prototype;var s=e in D?D[e]:void 0,s=Boolean(s&&s.every(e=>{return Boolean(null==(e=null==(e=Object.getOwnPropertyDescriptor(r,e))?void 0:e.get)?void 0:e.toString().includes("[native code]"))})),n=e in T?T[e]:void 0,n=Boolean(n&&n.every(e=>{return"function"==typeof r[e]&&(null==(e=r[e])?void 0:e.toString().includes("[native code]"))}));if(s&&n)return N[e]=t.prototype,t.prototype;try{var i,o=document.createElement("iframe"),a=(document.body.appendChild(o),o.contentWindow);return a?(i=a[e].prototype,document.body.removeChild(o),i?N[e]=i:r):t.prototype}catch{return r}}const U={};function j(e,t,r){var s=e+"."+String(r);return U[s]?U[s].call(t):(e=F(e),(e=null==(e=Object.getOwnPropertyDescriptor(e,r))?void 0:e.get)?(U[s]=e).call(t):t[r])}const B={};function z(e,t,r){var s=e+"."+String(r);return B[s]?B[s].bind(t):"function"!=typeof(e=F(e)[r])?t[r]:(B[s]=e).bind(t)}const $={childNodes:function(e){return j("Node",e,"childNodes")},parentNode:function(e){return j("Node",e,"parentNode")},parentElement:function(e){return j("Node",e,"parentElement")},textContent:function(e){return j("Node",e,"textContent")},contains:function(e,t){return z("Node",e,"contains")(t)},getRootNode:function(e){return z("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?j("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?j("Element",e,"shadowRoot"):null},querySelector:function(e,t){return j("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return j("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return F("MutationObserver").constructor}};function W(e){return e.nodeType===e.ELEMENT_NODE}function V(e){var t=e&&"host"in e&&"mode"in e&&$.host(e)||null;return Boolean(t&&"shadowRoot"in t&&$.shadowRoot(t)===e)}function G(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function se(t){try{var e,r=t.rules||t.cssRules;return r?(e=Array.from(r,e=>K(e,t.href)).join(""),s=(s=e).includes(" background-clip: text;")&&!s.includes(" -webkit-background-clip: text;")?s.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;"):s):null}catch(e){return null}var s}function K(r,t){if("styleSheet"in r){let t;try{t=se(r.styleSheet)||((s=(e=r).cssText).split('"').length<3?s:(s=["@import",`url(${JSON.stringify(e.href)})`],""===e.layerName?s.push("layer"):e.layerName&&s.push(`layer(${e.layerName})`),e.supportsText&&s.push(`supports(${e.supportsText})`),e.media.length&&s.push(e.media.mediaText),s.join(" ")+";"))}catch(e){t=r.cssText}return r.styleSheet.href?he(t,r.styleSheet.href):t}{let e=r.cssText;return"selectorText"in r&&r.selectorText.includes(":")&&(e=e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),t?he(e,t):e}var e,s}class ne{constructor(){A(this,"idNodeMap",new Map),A(this,"nodeMetaMap",new WeakMap)}getId(e){return e?(null==(e=this.getMeta(e))?void 0:e.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){var t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){var r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){var r=this.getNode(e);r&&(r=this.nodeMetaMap.get(r))&&this.nodeMetaMap.set(t,r),this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ie({element:e,maskInputOptions:t,tagName:r,type:s,value:n,maskInputFn:i}){let o=n||"";n=s&&oe(s);return o=t[r.toLowerCase()]||n&&t[n]?i?i(o,e):"*".repeat(o.length):o}function oe(e){return e.toLowerCase()}const ae="__rrweb_original__";function le(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?oe(t):null}function J(e,t){let r;try{r=new URL(e,t??window.location.href)}catch(e){return null}e=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==e?void 0:e[1])??null}const Y=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Z=/^(?:[a-z+]+:)?\/\//i,ue=/^www\..*/i,ce=/^(data:)([^,]*),(.*)/i;function he(e,l){return(e||"").replace(Y,(e,t,r,s,n,i)=>{r=r||n||i,n=t||s||"";if(!r)return e;if(Z.test(r)||ue.test(r))return`url(${n}${r}${n})`;if(ce.test(r))return`url(${n}${r}${n})`;if("/"===r[0])return`url(${n}${function(e){let t="";return t=(t=-1<e.indexOf("//")?e.split("/").slice(0,3).join("/"):e.split("/")[0]).split("?")[0]}(l)+r}${n})`;var o=l.split("/"),i=r.split("/");o.pop();for(const a of i)"."!==a&&(".."===a?o.pop():o.push(a));return`url(${n}${o.join("/")}${n})`})}let de=1;const pe=new RegExp("[^a-z0-9-_:]"),ge=-2;function fe(){return de++}let me,ye;const ve=/^[^ \t\n\r\u000c]+/,_e=/^[, \t\n\r\u000c]+/;function be(s,n){if(""===n.trim())return n;let i=0;function e(e){var e=e.exec(n.substring(i));return e?(e=e[0],i+=e.length,e):""}for(var o=[];e(_e),!(i>=n.length);){let r=e(ve);if(","===r.slice(-1))r=Se(s,r.substring(0,r.length-1)),o.push(r);else{let e="",t=(r=Se(s,r),!1);for(;;){var a=n.charAt(i);if(""===a){o.push((r+e).trim());break}if(t)")"===a&&(t=!1);else{if(","===a){i+=1,o.push((r+e).trim());break}"("===a&&(t=!0)}e+=a,i+=1}}}return o.join(", ")}const we=new WeakMap;function Se(e,t){return t&&""!==t.trim()?Ce(e,t):t}function Ce(e,t){let r=we.get(e);if(r||(r=e.createElement("a"),we.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function Ie(e,t,r,s){return s&&("src"!==r&&("href"!==r||"use"===t&&"#"===s[0])&&("xlink:href"!==r||"#"===s[0])&&("background"!==r||"table"!==t&&"td"!==t&&"th"!==t)?"srcset"===r?be(e,s):"style"===r?he(s,Ce(e)):"object"===t&&"data"===r?Se(e,s):s:Se(e,s))}function ke(e,t){return("video"===e||"audio"===e)&&"autoplay"===t}function xe(t,r,e){if(!t)return!1;if(t.nodeType!==t.ELEMENT_NODE)return!!e&&xe($.parentNode(t),r,e);for(let e=t.classList.length;e--;){var s=t.classList[e];if(r.test(s))return!0}return!!e&&xe($.parentNode(t),r,e)}function Oe(e,t,r,s){let n;if(W(e)){if(n=e,!$.childNodes(n).length)return!1}else{if(null===$.parentElement(e))return!1;n=$.parentElement(e)}try{if("string"==typeof t){if(s){if(n.closest("."+t))return!0}else if(n.classList.contains(t))return!0}else if(xe(n,t,s))return!0;if(r)if(s){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(e){}return!1}function Ee(r,e){var t,s,n,i,{doc:o,mirror:e,blockClass:a,blockSelector:l,needsMask:N,inlineStylesheet:F,maskInputOptions:U={},maskTextFn:j,maskInputFn:B,dataURLOptions:z={},inlineImages:W,recordCanvas:V,keepIframeSrcFn:G,newlyAddedElement:K=!1}=e,u=(t=o,!(e=e).hasNode(t)||1===(e=e.getId(t))?void 0:e);switch(r.nodeType){case r.DOCUMENT_NODE:return"CSS1Compat"!==r.compatMode?{type:X.Document,childNodes:[],compatMode:r.compatMode}:{type:X.Document,childNodes:[]};case r.DOCUMENT_TYPE_NODE:return{type:X.DocumentType,name:r.name,publicId:r.publicId,systemId:r.systemId,rootId:u};case r.ELEMENT_NODE:{var c=r;var h={doc:o,blockClass:a,blockSelector:l,inlineStylesheet:F,maskInputOptions:U,maskInputFn:B,dataURLOptions:z,inlineImages:W,recordCanvas:V,keepIframeSrcFn:G,newlyAddedElement:K,rootId:u};const{doc:v,blockClass:_,blockSelector:b,inlineStylesheet:w,maskInputOptions:S={},maskInputFn:C,dataURLOptions:I={},inlineImages:k,recordCanvas:x,keepIframeSrcFn:O,newlyAddedElement:E=!1,rootId:R}=h,M=function(t,r,e){try{if("string"==typeof r){if(t.classList.contains(r))return!0}else for(let e=t.classList.length;e--;){var s=t.classList[e];if(r.test(s))return!0}if(e)return t.matches(e)}catch(e){}return!1}(c,_,b),A=function(e){return e instanceof HTMLFormElement?"form":(e=oe(e.tagName),pe.test(e)?"div":e)}(c);let t={};var J=c.attributes.length;for(let e=0;e<J;e++){var d=c.attributes[e];ke(A,d.name,d.value)||(t[d.name]=Ie(v,A,oe(d.name),d.value))}if("link"===A&&w){h=Array.from(v.styleSheets).find(e=>e.href===c.href);let e=null;(e=h?se(h):e)&&(delete t.rel,delete t.href,t._cssText=e)}"style"===A&&c.sheet&&!(c.innerText||$.textContent(c)||"").trim().length&&(h=se(c.sheet))&&(t._cssText=h);"input"!==A&&"textarea"!==A&&"select"!==A||(h=c.value,s=c.checked,"radio"!==t.type&&"checkbox"!==t.type&&"submit"!==t.type&&"button"!==t.type&&h?t.value=ie({element:c,type:le(c),tagName:A,value:h,maskInputOptions:S,maskInputFn:C}):s&&(t.checked=s));"option"===A&&(c.selected&&!S.select?t.selected=!0:delete t.selected);"dialog"===A&&c.open&&(t.rr_open_mode=c.matches("dialog:modal")?"modal":"non-modal");"canvas"===A&&x&&("2d"===c.__context?function(r){var s=r.getContext("2d");if(s)for(let t=0;t<r.width;t+=50)for(let e=0;e<r.height;e+=50){var n=s.getImageData,n=ae in n?n[ae]:n;if(new Uint32Array(n.call(s,t,e,Math.min(50,r.width-t),Math.min(50,r.height-e)).data.buffer).some(e=>0!==e))return}return 1}(c)||(t.rr_dataURL=c.toDataURL(I.type,I.quality)):"__context"in c||(h=c.toDataURL(I.type,I.quality),(s=v.createElement("canvas")).width=c.width,s.height=c.height,n=s.toDataURL(I.type,I.quality),h!==n&&(t.rr_dataURL=h)));if("img"===A&&k){me||(me=v.createElement("canvas"),ye=me.getContext("2d"));const D=c,T=D.currentSrc||D.getAttribute("src")||"<unknown-src>",P=D.crossOrigin,L=()=>{D.removeEventListener("load",L);try{me.width=D.naturalWidth,me.height=D.naturalHeight,ye.drawImage(D,0,0),t.rr_dataURL=me.toDataURL(I.type,I.quality)}catch(e){if("anonymous"!==D.crossOrigin)return D.crossOrigin="anonymous",void(D.complete&&0!==D.naturalWidth?L():D.addEventListener("load",L));console.warn(`Cannot inline img src=${T}! Error: `+e)}"anonymous"===D.crossOrigin&&(P?t.crossOrigin=P:D.removeAttribute("crossorigin"))};D.complete&&0!==D.naturalWidth?L():D.addEventListener("load",L)}"audio"!==A&&"video"!==A||((n=t).rr_mediaState=c.paused?"paused":"played",n.rr_mediaCurrentTime=c.currentTime,n.rr_mediaPlaybackRate=c.playbackRate,n.rr_mediaMuted=c.muted,n.rr_mediaLoop=c.loop,n.rr_mediaVolume=c.volume);E||(c.scrollLeft&&(t.rr_scrollLeft=c.scrollLeft),c.scrollTop&&(t.rr_scrollTop=c.scrollTop));M&&({width:h,height:p}=c.getBoundingClientRect(),t={class:t.class,rr_width:h+"px",rr_height:p+"px"});"iframe"!==A||O(t.src)||(c.contentDocument||(t.rr_src=t.src),delete t.src);let e;try{customElements.get(A)&&(e=!0)}catch(e){}return{type:X.Element,tagName:A,attributes:t,childNodes:[],isSVG:function(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}(c)||void 0,needBlock:M,rootId:R,isCustom:e};return}case r.TEXT_NODE:{h=r;var p={doc:o,needsMask:N,maskTextFn:j,rootId:u};var{needsMask:Y,maskTextFn:g,rootId:Z}=p,f=$.parentNode(h),m=f&&f.tagName;let e=$.textContent(h);var y="STYLE"===m||void 0,m="SCRIPT"===m||void 0;if(y&&e){try{h.nextSibling||h.previousSibling||null!=(i=f.sheet)&&i.cssRules&&(e=se(f.sheet))}catch(e){console.warn("Cannot get CSS styles from text's parentNode. Error: "+e,h)}e=he(e,Ce(p.doc))}m&&(e="SCRIPT_PLACEHOLDER");!y&&!m&&e&&Y&&(e=g?g(e,$.parentElement(h)):e.replace(/[\S]/g,"*"));return{type:X.Text,textContent:e||"",isStyle:y,rootId:Z};return}case r.CDATA_SECTION_NODE:return{type:X.CDATA,textContent:"",rootId:u};case r.COMMENT_NODE:return{type:X.Comment,textContent:$.textContent(r)||"",rootId:u};default:return!1}}function P(e){return null==e?"":e.toLowerCase()}function Re(t,e){const{doc:r,mirror:s,blockClass:n,blockSelector:i,maskTextClass:o,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:g={},inlineImages:f=!1,recordCanvas:m=!1,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:_=5e3,onStylesheetLoad:b,stylesheetLoadTimeout:w=5e3,keepIframeSrcFn:S=()=>!1,newlyAddedElement:C=!1}=e;let I=e["needsMask"],{preserveWhiteSpace:k=!0}=e;I||(e=void 0===I,I=Oe(t,o,a,e));e=Ee(t,{doc:r,mirror:s,blockClass:n,blockSelector:i,needsMask:I,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,dataURLOptions:g,inlineImages:f,recordCanvas:m,keepIframeSrcFn:S,newlyAddedElement:C});if(!e)return console.warn(t,"not serialized"),null;let x;x=s.hasNode(t)?s.getId(t):!function(e,t){if(t.comment&&e.type===X.Comment)return 1;if(e.type===X.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===J(e.attributes.href)))return 1;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(P(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===P(e.attributes.name)||"icon"===P(e.attributes.rel)||"apple-touch-icon"===P(e.attributes.rel)||"shortcut icon"===P(e.attributes.rel))))return 1;if("meta"===e.tagName){if(t.headMetaDescKeywords&&P(e.attributes.name).match(/^description|keywords$/))return 1;if(t.headMetaSocial&&(P(e.attributes.property).match(/^(og|twitter|fb):/)||P(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===P(e.attributes.name)))return 1;if(t.headMetaRobots&&("robots"===P(e.attributes.name)||"googlebot"===P(e.attributes.name)||"bingbot"===P(e.attributes.name)))return 1;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return 1;if(t.headMetaAuthorship&&("author"===P(e.attributes.name)||"generator"===P(e.attributes.name)||"framework"===P(e.attributes.name)||"publisher"===P(e.attributes.name)||"progid"===P(e.attributes.name)||P(e.attributes.property).match(/^article:/)||P(e.attributes.property).match(/^product:/)))return 1;if(t.headMetaVerification&&("google-site-verification"===P(e.attributes.name)||"yandex-verification"===P(e.attributes.name)||"csrf-token"===P(e.attributes.name)||"p:domain_verify"===P(e.attributes.name)||"verify-v1"===P(e.attributes.name)||"verification"===P(e.attributes.name)||"shopify-checkout-api-token"===P(e.attributes.name)))return 1}}}(e,p)&&(k||e.type!==X.Text||e.isStyle||e.textContent.replace(/^\s+|\s+$/gm,"").length)?de++:ge;var O=Object.assign(e,{id:x});if(s.add(t,O),x===ge)return null;y&&y(t);let E=!l;if(O.type===X.Element&&(E=E&&!O.needBlock,delete O.needBlock,e=$.shadowRoot(t))&&G(e)&&(O.isShadowHost=!0),(O.type===X.Document||O.type===X.Element)&&E){p.headWhitespace&&O.type===X.Element&&"head"===O.tagName&&(k=!1);var R={doc:r,mirror:s,blockClass:n,blockSelector:i,needsMask:I,maskTextClass:o,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:g,inlineImages:f,recordCanvas:m,preserveWhiteSpace:k,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:_,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:S};if(O.type!==X.Element||"textarea"!==O.tagName||void 0===O.attributes.value)for(const D of Array.from($.childNodes(t))){var M=Re(D,R);M&&O.childNodes.push(M)}let e=null;if(W(t)&&(e=$.shadowRoot(t)))for(const T of Array.from($.childNodes(e))){var A=Re(T,R);A&&(G(e)&&(A.isShadow=!0),O.childNodes.push(A))}}e=$.parentNode(t);return e&&V(e)&&G(e)&&(O.isShadow=!0),O.type===X.Element&&"iframe"===O.tagName&&function(r,s,n){var i=r.contentWindow;if(i){let e=!1,t;try{t=i.document.readyState}catch(e){return}if("complete"!==t){const o=setTimeout(()=>{e||(s(),e=!0)},n);void r.addEventListener("load",()=>{clearTimeout(o),e=!0,s()})}else{n="about:blank";if(i.location.href!==n||r.src===n||""===r.src)return setTimeout(s,0),r.addEventListener("load",s);r.addEventListener("load",s)}}}(t,()=>{var e=t.contentDocument;e&&v&&(e=Re(e,{doc:e,mirror:s,blockClass:n,blockSelector:i,needsMask:I,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:g,inlineImages:f,recordCanvas:m,preserveWhiteSpace:k,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:_,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:S}))&&v(t,e)},_),O.type===X.Element&&"link"===O.tagName&&"string"==typeof O.attributes.rel&&("stylesheet"===O.attributes.rel||"preload"===O.attributes.rel&&"string"==typeof O.attributes.href&&"css"===J(O.attributes.href))&&function(e,t,r){let s=!1,n;try{n=e.sheet}catch(e){return}if(!n){const i=setTimeout(()=>{s||(t(),s=!0)},r);e.addEventListener("load",()=>{clearTimeout(i),s=!0,t()})}}(t,()=>{var e;b&&(e=Re(t,{doc:r,mirror:s,blockClass:n,blockSelector:i,needsMask:I,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:g,inlineImages:f,recordCanvas:m,preserveWhiteSpace:k,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:_,onStylesheetLoad:b,stylesheetLoadTimeout:w,keepIframeSrcFn:S}))&&b(t,e)},w),O}function Me(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ae(r){var t,s;return r.__esModule?r:("function"==typeof(t=r.default)?(s=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)}).prototype=t.prototype:s={},Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(r).forEach(function(e){var t=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(s,e,t.get?t:{enumerable:!0,get:function(){return r[e]}})}),s)}function De(){return{isColorSupported:!1,reset:t,bold:t,dim:t,italic:t,underline:t,inverse:t,hidden:t,strikethrough:t,black:t,red:t,green:t,yellow:t,blue:t,magenta:t,cyan:t,white:t,gray:t,bgBlack:t,bgRed:t,bgGreen:t,bgYellow:t,bgBlue:t,bgMagenta:t,bgCyan:t,bgWhite:t}}var e={exports:{}},t=String,e=(e.exports=De(),e.exports.createColors=De,e.exports),r=Ae(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Te=e,Pe=r;var e=class No extends Error{constructor(e,t,r,s,n,i){super(e),this.name="CssSyntaxError",this.reason=e,n&&(this.file=n),s&&(this.source=s),i&&(this.plugin=i),void 0!==t&&void 0!==r&&("number"==typeof t?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,No)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=Te.isColorSupported);var r=(t=Pe&&e?Pe(t):t).split(/\r?\n/);let s=Math.max(this.line-3,0);var n=Math.min(this.line+2,r.length);let i=String(n).length,o,a;if(e){let{bold:t,gray:r,red:s}=Te.createColors(!0);o=e=>t(s(e)),a=e=>r(e)}else o=a=e=>e;return r.slice(s,n).map((e,t)=>{var t=s+1+t,r=" "+(" "+t).slice(-i)+" | ";return t===this.line?(t=a(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," "),o(">")+a(r)+e+"\n "+t+o("^")):" "+a(r)+e}).join("\n")}toString(){let e=this.showSourceCode();return e=e&&"\n\n"+e+"\n",this.name+": "+this.message+e}},s=e,e=(e.default=e,{});e.isClean=Symbol("isClean"),e.my=Symbol("my");const Le={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};var n=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name;var s=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?r+=e.raws.afterName:s&&(r+=" "),e.nodes?this.block(e,r+s):(t=(e.raws.between||"")+(t?";":""),this.builder(r+s+t,e))}beforeAfter(e,t){let r,s=(r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose"),e.parent),n=0;for(;s&&"root"!==s.type;)n+=1,s=s.parent;if(r.includes("\n")){var i=this.raw(e,null,"indent");if(i.length)for(let e=0;e<n;e++)r+=i}return r}block(e,t){var r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start");let s;(s=e.nodes&&e.nodes.length?(this.body(e),this.raw(e,"after")):this.raw(e,"after","emptyBody"))&&this.builder(s),this.builder("}",e,"end")}body(t){let r=t.nodes.length-1;for(;0<r&&"comment"===t.nodes[r].type;)--r;var s=this.raw(t,"semicolon");for(let e=0;e<t.nodes.length;e++){var n=t.nodes[e],i=this.raw(n,"before");i&&this.builder(i),this.stringify(n,r!==e||s)}}comment(e){var t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){var r=this.raw(e,"between","colon");let s=e.prop+r+this.rawValue(e,"value");e.important&&(s+=e.raws.important||" !important"),t&&(s+=";"),this.builder(s,e)}document(e){this.body(e)}raw(e,t,r){let s;if(r=r||t,!t||void 0===(s=e.raws[t])){var n=e.parent;if("before"===r){if(!n||"root"===n.type&&n.first===e)return"";if(n&&"document"===n.type)return""}if(!n)return Le[r];n=e.root();if(n.rawCache||(n.rawCache={}),void 0!==n.rawCache[r])return n.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);var i="raw"+((i=r)[0].toUpperCase()+i.slice(1));this[i]?s=this[i](n,e):n.walk(e=>{if(void 0!==(s=e.raws[t]))return!1}),void 0===s&&(s=Le[r]),n.rawCache[r]=s}return s}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&0<e.nodes.length&&void 0!==e.raws.after)return(t=e.raws.after).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t=t&&t.replace(/\S/g,"")}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return(r=e.raws.before).includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeDecl"):r&&r.replace(/\S/g,"")}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return(r=e.raws.before).includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeRule"):r&&r.replace(/\S/g,"")}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t}rawBeforeRule(t){let r;return t.walk(e=>{if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return(r=e.raws.before).includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=r&&r.replace(/\S/g,"")}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&void 0!==(t=e.raws.after))return!1}),t}rawIndent(r){if(r.raws.indent)return r.raws.indent;let s;return r.walk(e=>{var t=e.parent;if(t&&t!==r&&t.parent&&t.parent===r&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),s=(s=t[t.length-1]).replace(/\S/g,""),!1}),s}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t}rawValue(e,t){var r=e[t],e=e.raws[t];return e&&e.value===r?e.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)}},i=n;n.default=n;let Ne=i;function Fe(e,t){new Ne(t).stringify(e)}n=Fe;Fe.default=Fe;let{isClean:Ue,my:je}=e,Be=s,ze=i,We=n;function Ve(t,r){let s=new t.constructor;for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&"proxyCache"!==n){let e=t[n];var i=typeof e;"parent"===n&&"object"==i?r&&(s[n]=r):"source"===n?s[n]=e:Array.isArray(e)?s[n]=e.map(e=>Ve(e,s)):("object"==i&&null!==e&&(e=Ve(e)),s[n]=e)}return s}var i=class{constructor(e={}){for(var t in this.raws={},this[Ue]=!1,this[je]=!0,e)if("nodes"===t){this.nodes=[];for(var r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)),e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(var 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={}){var t,r=Ve(this);for(t in e)r[t]=e[t];return r}cloneAfter(e={}){e=this.clone(e);return this.parent.insertAfter(this,e),e}cloneBefore(e={}){e=this.clone(e);return this.parent.insertBefore(this,e),e}error(e,t={}){var r,s;return this.source?({end:r,start:s}=this.rangeBy(t),this.source.input.error(e,{column:s.column,line:s.line},{column:r.column,line:r.line},t)):new Be(e)}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]!==r&&(e[t]=r,"prop"===t||"value"===t||"name"===t||"params"===t||"important"===t||"text"===t)&&e.markDirty(),!0}}}markDirty(){if(this[Ue]){this[Ue]=!1;let e=this;for(;e=e.parent;)e[Ue]=!1}}next(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;return e.index?r=this.positionInside(e.index,t):e.word&&-1!==(e=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(e,t)),r}positionInside(t,e){var r=e||this.toString();let s=this.source.start.column,n=this.source.start.line;for(let e=0;e<t;e++)"\n"===r[e]?(s=1,n+=1):s+=1;return{column:s,line:n}}prev(){var e;if(this.parent)return e=this.parent.index(this),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};var s,n;return e.word?-1!==(n=(s=this.toString()).indexOf(e.word))&&(t=this.positionInside(n,s),r=this.positionInside(n+e.word.length,s)):(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}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1))),{end:r=r.line<t.line||r.line===t.line&&r.column<=t.column?{column:t.column+1,line:t.line}:r,start:t}}raw(e,t){return(new ze).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...r){if(this.parent){let e=this,t=!1;for(var s of r)s===this?t=!0:t?(this.parent.insertAfter(e,s),e=s):this.parent.insertBefore(e,s);t||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){var r,s={},n=null==t;t=t||new Map;let i=0;for(r in this)if(Object.prototype.hasOwnProperty.call(this,r)&&"parent"!==r&&"proxyCache"!==r){var o=this[r];if(Array.isArray(o))s[r]=o.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof o&&o.toJSON)s[r]=o.toJSON(null,t);else if("source"===r){let e=t.get(o.input);null==e&&(e=i,t.set(o.input,i),i++),s[r]={end:o.end,inputId:e,start:o.start}}else s[r]=o}return n&&(s.inputs=[...t.keys()].map(e=>e.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=We){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){var s,n={node:this};for(s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}},o=i,i=(i.default=i,o),i=class extends i{constructor(e){super(e=e&&void 0!==e.value&&"string"!=typeof e.value?{...e,value:String(e.value)}:e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}},l=i;i.default=i;i={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(s,n=21)=>(e=n)=>{let t="",r=e;for(;r--;)t+=s[Math.random()*s.length|0];return t}};let{SourceMapConsumer:Ge,SourceMapGenerator:Ke}=r,{existsSync:Je,readFileSync:Ye}=r,{dirname:Ze,join:Xe}=r;var u=class{constructor(e,t){!1!==t.map&&(this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:"),e=t.map?t.map.prev:void 0,e=this.loadMap(t.from,e),!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Ze(this.mapFile)),e)&&(this.text=e)}consumer(){return this.consumerCache||(this.consumerCache=new Ge(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){var t,r=e.match(/\/\*\s*# sourceMappingURL=/gm);r&&(r=e.lastIndexOf(r.pop()),t=e.indexOf("*/",r),-1<r)&&-1<t&&(this.annotation=this.getAnnotationURL(e.substring(r,t)))}loadFile(e){if(this.root=Ze(e),Je(e))return this.mapFile=e,Ye(e,"utf-8").toString().trim()}loadMap(t,e){if(!1===e)return!1;if(e){if("string"==typeof e)return e;if("function"!=typeof e){if(e instanceof Ge)return Ke.fromSourceMap(e).toString();if(e instanceof Ke)return e.toString();if(this.isMap(e))return JSON.stringify(e);throw new Error("Unsupported previous source map format: "+e.toString())}e=e(t);if(e){var r=this.loadFile(e);if(r)return r;throw new Error("Unable to load previous source map: "+e.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return t&&(e=Xe(Ze(t),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&0<this.consumer().sourcesContent.length)}},c=u,{SourceMapConsumer:u,SourceMapGenerator:h}=(u.default=u,r);let{fileURLToPath:$e,pathToFileURL:He}=r,{isAbsolute:qe,resolve:Qe}=r,et=i["nanoid"];i=r;let tt=s,rt=c,st=Symbol("fromOffsetCache"),nt=Boolean(u&&h),it=Boolean(Qe&&qe);u=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!it||/^\w+:\/\//.test(t.from)||qe(t.from)?this.file=t.from:this.file=Qe(t.from)),it&&nt&&(e=new rt(this.css,t)).text&&(t=(this.map=e).consumer().file,!this.file)&&t&&(this.file=this.mapResolve(t)),this.file||(this.id="<input css "+et(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let n,i,o;t&&"object"==typeof t?(a=r,r="number"==typeof(l=t).offset?(t=(u=this.fromOffset(l.offset)).line,u.col):(t=l.line,l.column),o="number"==typeof a.offset?(u=this.fromOffset(a.offset),i=u.line,u.col):(i=a.line,a.column)):r||(t=(l=this.fromOffset(t)).line,r=l.col);var a,l,u=this.origin(t,r,i,o);return(n=u?new tt(e,void 0===u.endLine?u.line:{column:u.column,line:u.line},void 0===u.endLine?u.column:{column:u.endColumn,line:u.endLine},u.source,u.file,s.plugin):new tt(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,s.plugin)).input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(He&&(n.input.url=He(this.file).toString()),n.input.file=this.file),n}fromOffset(t){let s;if(this[st])s=this[st];else{var n=this.css.split("\n");s=new Array(n.length);let r=0;for(let e=0,t=n.length;e<t;e++)s[e]=r,r+=n[e].length+1;this[st]=s}let r=0;if(s[s.length-1]<=t)r=s.length-1;else{let e=s.length-2;for(var i;r<e;)if(i=r+(e-r>>1),t<s[i])e=i-1;else{if(!(t>=s[i+1])){r=i;break}r=i+1}}return{col:t-s[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Qe(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,s){if(!this.map)return!1;var n=this.map.consumer(),t=n.originalPositionFor({column:t,line:e});if(!t.source)return!1;let i;"number"==typeof r&&(i=n.originalPositionFor({column:s,line:r}));let o;o=qe(t.source)?He(t.source):new URL(t.source,this.map.consumer().sourceRoot||He(this.map.mapFile));e={column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:o.toString()};if("file:"===o.protocol){if(!$e)throw new Error("file: protocol is not available in this PostCSS build");e.file=$e(o)}s=n.sourceContentFor(t.source);return s&&(e.source=s),e}toJSON(){var e,t={};for(e of["hasBOM","css","file","id"])null!=this[e]&&(t[e]=this[e]);return this.map&&(t.map={...this.map},t.map.consumerCache)&&(t.map.consumerCache=void 0),t}get from(){return this.file||this.id}},h=u;u.default=u,i&&i.registerInput&&i.registerInput(u);let{SourceMapConsumer:ot,SourceMapGenerator:at}=r,{dirname:lt,relative:ut,resolve:ct,sep:ht}=r,dt=r["pathToFileURL"],pt=h,gt=Boolean(ot&&at),ft=Boolean(lt&&ct&&ut&&ht);i=class{constructor(e,t,r,s){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=s,this.originalCSS=s,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e,t=(e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map","\n");this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(var t of this.previous()){var r=this.toUrl(this.path(t.file)),s=t.root||lt(t.file);let e;!1===this.mapOpts.sourcesContent?(e=new ot(t.text)).sourcesContent&&(e.sourcesContent=null):e=t.consumer(),this.map.applySourceMap(e,r,this.toUrl(this.path(s)))}}clearAnnotation(){var t;if(!1!==this.mapOpts.annotation)if(this.root)for(let e=this.root.nodes.length-1;0<=e;e--)"comment"===(t=this.root.nodes[e]).type&&0===t.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(e);else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),ft&>&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){var e;return this.root?this.generateString():1===this.previous().length?((e=this.previous()[0].consumer()).file=this.outputFile(),this.map=at.fromSourceMap(e,{ignoreInvalidMapping:!0})):(this.map=new at({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>"})),this.isSourcesContent()&&this.setSourcesContent(),this.root&&0<this.previous().length&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new at({file:this.outputFile(),ignoreInvalidMapping:!0});let s=1,n=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""},a,l;this.stringify(this.root,(e,t,r)=>{this.css+=e,t&&"end"!==r&&(o.generated.line=s,o.generated.column=n-1,t.source&&t.source.start?(o.source=this.sourcePath(t),o.original.line=t.source.start.line,o.original.column=t.source.start.column-1):(o.source=i,o.original.line=1,o.original.column=0),this.map.addMapping(o)),(a=e.match(/\n/g))?(s+=a.length,l=e.lastIndexOf("\n"),n=e.length-l):n+=e.length,t&&"start"!==r&&(e=t.parent||{raws:{}},"decl"!==t.type&&("atrule"!==t.type||t.nodes)||t!==e.last||e.raws.semicolon)&&(t.source&&t.source.end?(o.source=this.sourcePath(t),o.original.line=t.source.end.line,o.original.column=t.source.end.column-1,o.generated.line=s,o.generated.column=n-2):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=s,o.generated.column=n-1),this.map.addMapping(o))})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){var e;return void 0!==this.mapOpts.inline?this.mapOpts.inline:(void 0===(e=this.mapOpts.annotation)||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:0<this.previous().length}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?lt(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=lt(ct(r,this.mapOpts.annotation)));t=ut(r,e);return this.memoizedPaths.set(e,t),t}previous(){var e;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(e=>{e.source&&e.source.input.map&&(e=e.source.input.map,this.previousMaps.includes(e)||this.previousMaps.push(e))}):(e=new pt(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}setSourcesContent(){let r={};var e;this.root?this.root.walk(e=>{var t;e.source&&(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=this.usesFileUrls?this.toFileUrl(t):this.toUrl(this.path(t)),this.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>",this.map.setSourceContent(e,this.css))}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(dt)return t=dt(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===ht&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}},u=class extends o{constructor(e){super(e),this.type="comment"}},r=u;u.default=u;let{isClean:mt,my:yt}=e,vt=l,_t=r,bt,wt,St,Ct;let It=class Fo extends o{append(...e){for(var t of e){var r;for(r of this.normalize(t,this.last))this.proxyOf.nodes.push(r)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(var t of this.nodes)t.cleanRaws(e)}each(r){if(this.proxyOf.nodes){var s=this.getIterator();let e,t;for(;this.indexes[s]<this.proxyOf.nodes.length&&(e=this.indexes[s],!1!==(t=r(this.proxyOf.nodes[e],e)));)this.indexes[s]+=1;return delete this.indexes[s],t}}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(t,s){return"proxyOf"===s?t:t[s]&&("each"===s||"string"==typeof s&&s.startsWith("walk")?(...e)=>t[s](...e.map(r=>"function"==typeof r?(e,t)=>r(e.toProxy(),t):r)):"every"===s||"some"===s?r=>t[s]((e,...t)=>r(e.toProxy(),...t)):"root"===s?()=>t.root().toProxy():"nodes"===s?t.nodes.map(e=>e.toProxy()):"first"===s||"last"===s?t[s].toProxy():t[s])},set(e,t,r){return e[t]!==r&&(e[t]=r,"name"===t||"params"===t||"selector"===t)&&e.markDirty(),!0}}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){var r,s,n,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i]).reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i+1,0,r);for(n in this.indexes)i<(s=this.indexes[n])&&(this.indexes[n]=s+o.length);return this.markDirty(),this}insertBefore(e,t){var r,s,n,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i],0===i&&"prepend").reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i,0,r);for(n in this.indexes)i<=(s=this.indexes[n])&&(this.indexes[n]=s+o.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=function t(e){return e.map(e=>(e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e))}(bt(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var r of e=e.slice(0))r.parent&&r.parent.removeChild(r,"ignore");else if("root"===e.type&&"document"!==this.type)for(var s of e=e.nodes.slice(0))s.parent&&s.parent.removeChild(s,"ignore");else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new vt(e)]}else if(e.selector)e=[new wt(e)];else if(e.name)e=[new St(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new _t(e)]}return e.map(e=>(e[yt]||Fo.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[mt]&&function e(t){if(t[mt]=!1,t.proxyOf.nodes)for(var r of t.proxyOf.nodes)e(r)}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){for(var t of e=e.reverse()){var r,s,n=this.normalize(t,this.first,"prepend").reverse();for(r of n)this.proxyOf.nodes.unshift(r);for(s in this.indexes)this.indexes[s]=this.indexes[s]+n.length}return this.markDirty(),this}push(e){return(e.parent=this).proxyOf.nodes.push(e),this}removeAll(){for(var e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){var t,r;for(r in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)e<=(t=this.indexes[r])&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(t,r,s){return s||(s=r,r={}),this.walkDecls(e=>{r.props&&!r.props.includes(e.prop)||r.fast&&!e.value.includes(r.fast)||(e.value=e.value.replace(t,s))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(s){return this.each((t,e)=>{let r;try{r=s(t,e)}catch(e){throw t.addToError(e)}return r=!1!==r&&t.walk?t.walk(s):r})}walkAtRules(r,s){return s?r instanceof RegExp?this.walk((e,t)=>{if("atrule"===e.type&&r.test(e.name))return s(e,t)}):this.walk((e,t)=>{if("atrule"===e.type&&e.name===r)return s(e,t)}):(s=r,this.walk((e,t)=>{if("atrule"===e.type)return s(e,t)}))}walkComments(r){return this.walk((e,t)=>{if("comment"===e.type)return r(e,t)})}walkDecls(r,s){return s?r instanceof RegExp?this.walk((e,t)=>{if("decl"===e.type&&r.test(e.prop))return s(e,t)}):this.walk((e,t)=>{if("decl"===e.type&&e.prop===r)return s(e,t)}):(s=r,this.walk((e,t)=>{if("decl"===e.type)return s(e,t)}))}walkRules(r,s){return s?r instanceof RegExp?this.walk((e,t)=>{if("rule"===e.type&&r.test(e.selector))return s(e,t)}):this.walk((e,t)=>{if("rule"===e.type&&e.selector===r)return s(e,t)}):(s=r,this.walk((e,t)=>{if("rule"===e.type)return s(e,t)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};It.registerParse=e=>{bt=e},It.registerRule=e=>{wt=e},It.registerAtRule=e=>{St=e},It.registerRoot=e=>{Ct=e};var u=It,d=((It.default=It).rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,St.prototype):"rule"===e.type?Object.setPrototypeOf(e,wt.prototype):"decl"===e.type?Object.setPrototypeOf(e,vt.prototype):"comment"===e.type?Object.setPrototypeOf(e,_t.prototype):"root"===e.type&&Object.setPrototypeOf(e,Ct.prototype),e[yt]=!0,e.nodes&&e.nodes.forEach(e=>{It.rebuild(e)})},u);let kt,xt;var d=class extends d{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new kt(new xt,this,e).stringify()}},p=(d.registerLazyResult=e=>{kt=e},d.registerProcessor=e=>{xt=e},d);d.default=d;var d=class{constructor(e,t={}){for(var r in this.type="warning",this.text=e,t.node&&t.node.source&&(e=t.node.rangeBy(t),this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column),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}},g=d;d.default=d;let Ot=g;var d=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);e=new Ot(e,t);return this.messages.push(e),e}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}},f=d;d.default=d;const Et="'".charCodeAt(0),Rt='"'.charCodeAt(0),Mt="\\".charCodeAt(0),At="/".charCodeAt(0),Dt="\n".charCodeAt(0),Tt=" ".charCodeAt(0),Pt="\f".charCodeAt(0),Lt="\t".charCodeAt(0),Nt="\r".charCodeAt(0),Ft="[".charCodeAt(0),Ut="]".charCodeAt(0),jt="(".charCodeAt(0),Bt=")".charCodeAt(0),zt="{".charCodeAt(0),Wt="}".charCodeAt(0),Vt=";".charCodeAt(0),Gt="*".charCodeAt(0),Kt=":".charCodeAt(0),Jt="@".charCodeAt(0),Yt=/[\t\n\f\r "#'()/;[\\\]{}]/g,Zt=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Xt=/.[\r\n"'(/\\]/,$t=/[\da-f]/i;var d=class extends u{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)}},m=d,d=(u.registerAtRule(d.default=d),u);let Ht,qt;var y=class extends d{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){e=super.normalize(e);if(t)if("prepend"===r)1<this.nodes.length?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(var s of e)s.raws.before=t.raws.before;return e}removeChild(e,t){var r=this.index(e);return!t&&0===r&&1<this.nodes.length&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new Ht(new qt,this,e).stringify()}},v=(y.registerLazyResult=e=>{Ht=e},y.registerProcessor=e=>{qt=e},y);d.registerRoot(y.default=y);let Qt={comma(e){return Qt.split(e,[","],!0)},space(e){return Qt.split(e,[" ","\n","\t"])},split(e,t,r){var s,n=[];let i="",o=!1,a=0,l=!1,u="",c=!1;for(s of e)c?c=!1:"\\"===s?c=!0:l?s===u&&(l=!1):'"'===s||"'"===s?(l=!0,u=s):"("===s?a+=1:")"===s?0<a&&--a:0===a&&t.includes(s)&&(o=!0),o?(""!==i&&n.push(i.trim()),i="",o=!1):i+=s;return!r&&""===i||n.push(i.trim()),n}};d=Qt;Qt.default=Qt;let er=d;var y=class extends u{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return er.comma(this.selector)}set selectors(e){var t=this.selector?this.selector.match(/,\s*/):null,t=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(t)}},_=y;u.registerRule(y.default=y);let tr=l,rr=function(t,e={}){let s=t.css.valueOf(),n=e.ignoreErrors,i,o,a,l,u,c,h,d,p,g,f=s.length,m=0,y=[],v=[];function _(e){throw t.error("Unclosed "+e,m)}return{back:function(e){v.push(e)},endOfFile:function(){return 0===v.length&&m>=f},nextToken:function(e){if(v.length)return v.pop();if(!(m>=f)){var t=!!e&&e.ignoreUnclosed;switch(i=s.charCodeAt(m)){case Dt:case Tt:case Lt:case Nt:case Pt:for(o=m;o+=1,(i=s.charCodeAt(o))===Tt||i===Dt||i===Lt||i===Nt||i===Pt;);g=["space",s.slice(m,o)],m=o-1;break;case Ft:case Ut:case zt:case Wt:case Kt:case Vt:case Bt:var r=String.fromCharCode(i);g=[r,r,m];break;case jt:if(d=y.length?y.pop()[1]:"",p=s.charCodeAt(m+1),"url"===d&&p!==Et&&p!==Rt&&p!==Tt&&p!==Dt&&p!==Lt&&p!==Pt&&p!==Nt){o=m;do{if(c=!1,-1===(o=s.indexOf(")",o+1))){if(n||t){o=m;break}_("bracket")}for(h=o;s.charCodeAt(h-1)===Mt;)--h,c=!c}while(c);g=["brackets",s.slice(m,o+1),m,o],m=o}else o=s.indexOf(")",m+1),l=s.slice(m,o+1),-1===o||Xt.test(l)?g=["(","(",m]:(g=["brackets",l,m,o],m=o);break;case Et:case Rt:a=i===Et?"'":'"',o=m;do{if(c=!1,-1===(o=s.indexOf(a,o+1))){if(n||t){o=m+1;break}_("string")}for(h=o;s.charCodeAt(h-1)===Mt;)--h,c=!c}while(c);g=["string",s.slice(m,o+1),m,o],m=o;break;case Jt:Yt.lastIndex=m+1,Yt.test(s),o=0===Yt.lastIndex?s.length-1:Yt.lastIndex-2,g=["at-word",s.slice(m,o+1),m,o],m=o;break;case Mt:for(o=m,u=!0;s.charCodeAt(o+1)===Mt;)o+=1,u=!u;if(i=s.charCodeAt(o+1),u&&i!==At&&i!==Tt&&i!==Dt&&i!==Lt&&i!==Nt&&i!==Pt&&(o+=1,$t.test(s.charAt(o)))){for(;$t.test(s.charAt(o+1));)o+=1;s.charCodeAt(o+1)===Tt&&(o+=1)}g=["word",s.slice(m,o+1),m,o],m=o;break;default:m=(i===At&&s.charCodeAt(m+1)===Gt?(0===(o=s.indexOf("*/",m+2)+1)&&(n||t?o=s.length:_("comment")),g=["comment",s.slice(m,o+1),m,o]):(Zt.lastIndex=m+1,Zt.test(s),o=0===Zt.lastIndex?s.length-1:Zt.lastIndex-2,g=["word",s.slice(m,o+1),m,o],y.push(g)),o)}return m++,g}},position:function(){return m}}},sr=r,nr=m,ir=v,or=_;const ar={empty:!0,space:!0};let lr=class{constructor(e){this.input=e,this.root=new ir,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){var t,r=new nr;r.name=e[1].slice(1),""===r.name&&this.unnamedAtrule(r,e),this.init(r,e[2]);let s,n,i=!1,o=!1;for(var a=[],l=[];!this.tokenizer.endOfFile();){if("("===(t=(e=this.tokenizer.nextToken())[0])||"["===t?l.push("("===t?")":"]"):"{"===t&&0<l.length?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){r.source.end=this.getPosition(e[2]),r.source.end.offset++,this.semicolon=!0;break}if("{"===t){o=!0;break}if("}"===t){if(0<a.length){for(n=a.length-1,s=a[n];s&&"space"===s[0];)s=a[--n];s&&(r.source.end=this.getPosition(s[3]||s[2]),r.source.end.offset++)}this.end(e);break}}if(a.push(e),this.tokenizer.endOfFile()){i=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(r.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(r,"params",a),i&&(e=a[a.length-1],r.source.end=this.getPosition(e[3]||e[2]),r.source.end.offset++,this.spaces=r.raws.between,r.raws.between="")):(r.raws.afterName="",r.params=""),o&&(r.nodes=[],this.current=r)}checkMissedSemicolon(s){var n=this.colon(s);if(!1!==n){let t=0,r;for(let e=n-1;0<=e&&("space"===(r=s[e])[0]||2!==(t+=1));e--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}}colon(e){let t=0,r,s,n;for(var[i,o]of e.entries()){if("("===(s=(r=o)[0])&&(t+=1),")"===s&&--t,0===t&&":"===s){if(n){if("word"===n[0]&&"progid"===n[1])continue;return i}this.doubleColon(r)}n=r}return!1}comment(e){var t=new sr,e=(this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,e[1].slice(2,-2));/^\s*$/.test(e)?(t.text="",t.raws.left=e,t.raws.right=""):(e=e.match(/^(\s*)([^]*\S)(\s*)$/),t.text=e[2],t.raws.left=e[1],t.raws.right=e[3])}createTokenizer(){this.tokenizer=rr(this.input)}decl(e,t){var r,s=new tr,n=(this.init(s,e[0][2]),e[e.length-1]);for(";"===n[0]&&(this.semicolon=!0,e.pop()),s.source.end=this.getPosition(n[3]||n[2]||function(t){for(let e=t.length-1;0<=e;e--){var r=t[e],r=r[3]||r[2];if(r)return r}}(e)),s.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),s.raws.before+=e.shift()[1];for(s.source.start=this.getPosition(e[0][2]),s.prop="";e.length;){var i=e[0][0];if(":"===i||"space"===i||"comment"===i)break;s.prop+=e.shift()[1]}s.raws.between="";let o;for(;e.length;){if(":"===(o=e.shift())[0]){s.raws.between+=o[1];break}"word"===o[0]&&/\w/.test(o[1])&&this.unknownWord([o]),s.raws.between+=o[1]}"_"!==s.prop[0]&&"*"!==s.prop[0]||(s.raws.before+=s.prop[0],s.prop=s.prop.slice(1));let a=[];for(;e.length&&("space"===(r=e[0][0])||"comment"===r);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let r=e.length-1;0<=r;r--){if("!important"===(o=e[r])[1].toLowerCase()){s.important=!0;var l=this.stringFrom(e,r);" !important"!==(l=this.spacesFromEnd(e)+l)&&(s.raws.important=l);break}if("important"===o[1].toLowerCase()){var u=e.slice(0);let t="";for(let e=r;0<e;e--){var c=u[e][0];if(0===t.trim().indexOf("!")&&"space"!==c)break;t=u.pop()[1]+t}0===t.trim().indexOf("!")&&(s.important=!0,s.raws.important=t,e=u)}if("space"!==o[0]&&"comment"!==o[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(s.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(s,"value",a.concat(e),t),s.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){var t=new or;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){this.spaces+=e[1],this.current.nodes&&(e=this.current.nodes[this.current.nodes.length-1])&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}getPosition(e){var 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="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1;var r;let s=!1,n=null;var i=[],o=e[1].startsWith("--"),a=[];let l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)n=n||l,i.push("("===r?")":"]");else if(o&&s&&"{"===r)n=n||l,i.push("}");else if(0===i.length){if(";"===r){if(s)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(s=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length)&&(n=null);l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),0<i.length&&this.unclosedBracket(n),t&&s){if(!o)for(;a.length&&("space"===(l=a[a.length-1][0])||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,o)}else this.unknownWord(a)}parse(){for(var e;!this.tokenizer.endOfFile();)switch((e=this.tokenizer.nextToken())[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)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,s){var n,i,o,a,l=r.length;let u="",c=!0;for(let e=0;e<l;e+=1)"space"===(o=(n=r[e])[0])&&e===l-1&&!s||"comment"===o&&(o=r[e-1]?r[e-1][0]:"empty",i=r[e+1]?r[e+1][0]:"empty",ar[o]||ar[i]||","===u.slice(-1))?c=!1:u+=n[1];c||(a=r.reduce((e,t)=>e+t[1],""),e.raws[t]={raw:a,value:u}),e[t]=u}rule(e){e.pop();var t=new or;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){var t;let r="";for(;e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){var t;let r="";for(;e.length&&("space"===(t=e[0][0])||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t="";for(;e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}stringFrom(t,r){let s="";for(let e=r;e<t.length;e++)s+=t[e][1];return t.splice(r,t.length-r),s}unclosedBlock(){var 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})}},ur=h;function cr(e,t){e=new ur(e,t),t=new lr(e);try{t.parse()}catch(e){throw e}return t.root}y=cr;u.registerParse(cr.default=cr);let{isClean:hr,my:dr}=e,pr=i,gr=n,fr=u;e=p;let mr=f,yr=y;var b=v;const vr={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},_r={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},br={Once:!0,postcssPlugin:!0,prepare:!0},wr=0;function Sr(e){return"object"==typeof e&&"function"==typeof e.then}function Cr(e){let t=!1;var r=vr[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,wr,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,wr,r+"Exit"]:[r,r+"Exit"]}function Ir(e){let t;return{eventIndex:0,events:t="document"===e.type?["Document",wr,"DocumentExit"]:"root"===e.type?["Root",wr,"RootExit"]:Cr(e),iterator:0,node:e,visitorIndex:0,visitors:[]}}function kr(e){return e[hr]=!1,e.nodes&&e.nodes.forEach(e=>kr(e)),e}let xr={};var w=class Uo{constructor(e,t,r){this.stringified=!1,this.processed=!1;let s;if("object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof Uo||t instanceof mr)s=kr(t.root),t.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let e=yr;r.syntax&&(e=r.syntax.parse),(e=r.parser?r.parser:e).parse&&(e=e.parse);try{s=e(t,r)}catch(e){this.processed=!0,this.error=e}s&&!s[dr]&&fr.rebuild(s)}else s=kr(t);this.result=new mr(e,s,r),this.helpers={...xr,postcss:xr,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}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){var r=this.result.lastPlugin;try{t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin?r.postcssVersion:(e.plugin=r.postcssPlugin,e.setMessage())}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};var e,t=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(e of this.plugins)if("object"==typeof e)for(var r in e){if(!_r[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${e.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!br[r])if("object"==typeof e[r])for(var s in e[r])"*"===s?t(e,r,e[r][s]):t(e,r+"-"+s.toLowerCase(),e[r][s]);else"function"==typeof e[r]&&t(e,r,e[r])}this.hasListener=0<Object.keys(this.listeners).length}async runAsync(){for(let e=this.plugin=0;e<this.plugins.length;e++){var t=this.plugins[e],t=this.runOnRoot(t);if(Sr(t))try{await t}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){for(var r,s=this.result.root;!s[hr];){s[hr]=!0;for(var n=[Ir(s)];0<n.length;){var i=this.visitTick(n);if(Sr(i))try{await i}catch(e){i=n[n.length-1].node;throw this.handleError(e,i)}}}if(this.listeners.OnceExit)for(let[e,t]of this.listeners.OnceExit){this.result.lastPlugin=e;try{"document"===s.type?(r=s.nodes.map(e=>t(e,this.helpers)),await Promise.all(r)):await t(s,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{var e;return"object"==typeof t&&t.Once?"document"===this.result.root.type?Sr((e=this.result.root.nodes.map(e=>t.Once(e,this.helpers)))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers):"function"==typeof t?t(this.result.root,this.result):void 0}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(!this.stringified){this.stringified=!0,this.sync();var t=this.result.opts;let e=gr;t.syntax&&(e=t.syntax.stringify),(e=t.stringifier?t.stringifier:e).stringify&&(e=e.stringify);t=new pr(e,this.result.root,this.result.opts).generate();this.result.css=t[0],this.result.map=t[1]}return this.result}sync(){if(this.error)throw this.error;if(!this.processed){if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e of this.plugins)if(Sr(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){for(var t=this.result.root;!t[hr];)t[hr]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(var r of t.nodes)this.visitSync(this.listeners.OnceExit,r);else this.visitSync(this.listeners.OnceExit,t)}}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(var[r,s]of e){this.result.lastPlugin=r;let e;try{e=s(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(Sr(e))throw this.getAsyncError()}}visitTick(e){var t=e[e.length-1],{node:r,visitors:s}=t;if("root"===r.type||"document"===r.type||r.parent){if(0<s.length&&t.visitorIndex<s.length){var[n,i]=s[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===s.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=n;try{return i(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){for(var o,a=t.iterator;o=r.nodes[r.indexes[a]];)if(r.indexes[a]+=1,!o[hr])return o[hr]=!0,void e.push(Ir(o));t.iterator=0,delete r.indexes[a]}for(var l=t.events;t.eventIndex<l.length;){var u=l[t.eventIndex];if(t.eventIndex+=1,u===wr)return void(r.nodes&&r.nodes.length&&(r[hr]=!0,t.iterator=r.getIterator()));if(this.listeners[u])return void(t.visitors=this.listeners[u])}}e.pop()}walkSync(e){var t;e[hr]=!0;for(t of Cr(e))if(t===wr)e.nodes&&e.each(e=>{e[hr]||this.walkSync(e)});else{var r=this.listeners[t];if(r&&this.visitSync(r,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"}},Or=(w.registerPostcss=e=>{xr=e},w);b.registerLazyResult(w.default=w),e.registerLazyResult(w);let Er=i,Rr=n;let Mr=y;const Ar=f;b=class{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;e=Rr;this.result=new Ar(this._processor,void 0,this._opts),this.result.css=t;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});r=new Er(e,void 0,this._opts,t);r.isMap()?([e,t]=r.generate(),e&&(this.result.css=e),t&&(this.result.map=t)):(r.clearAnnotation(),this.result.css=r.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 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;var t=Mr;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e}get[Symbol.toStringTag](){return"NoWorkResult"}},e=b;b.default=b;let Dr=e,Tr=Or;w=p,i=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(var r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return new(this.plugins.length||t.parser||t.stringifier||t.syntax?Tr:Dr)(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}},b=i;v.registerProcessor(i.default=i),w.registerProcessor(i);let Pr=l,Lr=c,Nr=r,Fr=m,Ur=h,jr=v,Br=_;function zr(e,r){if(Array.isArray(e))return e.map(e=>zr(e));let{inputs:t,...s}=e;if(t){r=[];for(var n of t){n={...n,__proto__:Ur.prototype};n.map&&(n.map={...n.map,__proto__:Lr.prototype}),r.push(n)}}if(s.nodes&&(s.nodes=e.nodes.map(e=>zr(e,r))),s.source){let{inputId:e,...t}=s.source;s.source=t,null!=e&&(s.source.input=r[e])}if("root"===s.type)return new jr(s);if("decl"===s.type)return new Pr(s);if("rule"===s.type)return new Br(s);if("comment"===s.type)return new Nr(s);if("atrule"===s.type)return new Fr(s);throw new Error("Unknown node type: "+e.type)}e=zr,zr.default=zr,w=s;let Wr=l;i=Or,c=u;let Vr=b;s=n,l=e;let Gr=p;Or=g;let Kr=r,Jr=m;u=f,b=h,n=y,e=d;let Yr=_,Zr=v;p=o;function S(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Vr(e)}S.plugin=function(t,r){let s=!1;function n(...e){console&&console.warn&&!s&&(s=!0,console.warn(t+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG)&&process.env.LANG.startsWith("cn")&&console.warn(t+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226");e=r(...e);return e.postcssPlugin=t,e.postcssVersion=(new Vr).version,e}let e;return Object.defineProperty(n,"postcss",{get(){return e=e||n()}}),n.process=function(e,t,r){return S([n(r)]).process(e,t)},n},S.stringify=s,S.parse=n,S.fromJSON=l,S.list=e,S.comment=e=>new Kr(e),S.atRule=e=>new Jr(e),S.decl=e=>new Wr(e),S.rule=e=>new Yr(e),S.root=e=>new Zr(e),S.document=e=>new Gr(e),S.CssSyntaxError=w,S.Declaration=Wr,S.Container=c,S.Processor=Vr,S.Document=Gr,S.Comment=Kr,S.Warning=Or,S.AtRule=Jr,S.Result=u,S.Input=b,S.Rule=Yr,S.Root=Zr,S.Node=p,i.registerPostcss(S);g=S,S.default=S,r=Me(g);r.stringify,r.fromJSON,r.plugin,r.parse,r.list,r.document,r.comment,r.atRule,r.rule,r.decl,r.root,r.CssSyntaxError,r.Declaration,r.Container,r.Processor,r.Document,r.Comment,r.Warning,r.AtRule,r.Result,r.Input,r.Rule,r.Root,r.Node,Object.defineProperty;function Xr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function $r(r){var t,s;return r.__esModule?r:("function"==typeof(t=r.default)?(s=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)}).prototype=t.prototype:s={},Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(r).forEach(function(e){var t=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(s,e,t.get?t:{enumerable:!0,get:function(){return r[e]}})}),s)}function Hr(){return{isColorSupported:!1,reset:C,bold:C,dim:C,italic:C,underline:C,inverse:C,hidden:C,strikethrough:C,black:C,red:C,green:C,yellow:C,blue:C,magenta:C,cyan:C,white:C,gray:C,bgBlack:C,bgRed:C,bgGreen:C,bgYellow:C,bgBlue:C,bgMagenta:C,bgCyan:C,bgWhite:C}}var m={exports:{}},C=String,f=(m.exports=Hr(),m.exports.createColors=Hr,m.exports),h=$r(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let qr=f,Qr=h;y=class jo extends Error{constructor(e,t,r,s,n,i){super(e),this.name="CssSyntaxError",this.reason=e,n&&(this.file=n),s&&(this.source=s),i&&(this.plugin=i),void 0!==t&&void 0!==r&&("number"==typeof t?(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,jo)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=qr.isColorSupported);var r=(t=Qr&&e?Qr(t):t).split(/\r?\n/);let s=Math.max(this.line-3,0);var n=Math.min(this.line+2,r.length);let i=String(n).length,o,a;if(e){let{bold:t,gray:r,red:s}=qr.createColors(!0);o=e=>t(s(e)),a=e=>r(e)}else o=a=e=>e;return r.slice(s,n).map((e,t)=>{var t=s+1+t,r=" "+(" "+t).slice(-i)+" | ";return t===this.line?(t=a(r.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," "),o(">")+a(r)+e+"\n "+t+o("^")):" "+a(r)+e}).join("\n")}toString(){let e=this.showSourceCode();return e=e&&"\n\n"+e+"\n",this.name+": "+this.message+e}},d=y,y.default=y,_={};_.isClean=Symbol("isClean"),_.my=Symbol("my");const es={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};v=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name;var s=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?r+=e.raws.afterName:s&&(r+=" "),e.nodes?this.block(e,r+s):(t=(e.raws.between||"")+(t?";":""),this.builder(r+s+t,e))}beforeAfter(e,t){let r,s=(r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose"),e.parent),n=0;for(;s&&"root"!==s.type;)n+=1,s=s.parent;if(r.includes("\n")){var i=this.raw(e,null,"indent");if(i.length)for(let e=0;e<n;e++)r+=i}return r}block(e,t){var r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start");let s;(s=e.nodes&&e.nodes.length?(this.body(e),this.raw(e,"after")):this.raw(e,"after","emptyBody"))&&this.builder(s),this.builder("}",e,"end")}body(t){let r=t.nodes.length-1;for(;0<r&&"comment"===t.nodes[r].type;)--r;var s=this.raw(t,"semicolon");for(let e=0;e<t.nodes.length;e++){var n=t.nodes[e],i=this.raw(n,"before");i&&this.builder(i),this.stringify(n,r!==e||s)}}comment(e){var t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){var r=this.raw(e,"between","colon");let s=e.prop+r+this.rawValue(e,"value");e.important&&(s+=e.raws.important||" !important"),t&&(s+=";"),this.builder(s,e)}document(e){this.body(e)}raw(e,t,r){let s;if(r=r||t,!t||void 0===(s=e.raws[t])){var n=e.parent;if("before"===r){if(!n||"root"===n.type&&n.first===e)return"";if(n&&"document"===n.type)return""}if(!n)return es[r];n=e.root();if(n.rawCache||(n.rawCache={}),void 0!==n.rawCache[r])return n.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);var i="raw"+((i=r)[0].toUpperCase()+i.slice(1));this[i]?s=this[i](n,e):n.walk(e=>{if(void 0!==(s=e.raws[t]))return!1}),void 0===s&&(s=es[r]),n.rawCache[r]=s}return s}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&0<e.nodes.length&&void 0!==e.raws.after)return(t=e.raws.after).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t=t&&t.replace(/\S/g,"")}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return(r=e.raws.before).includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeDecl"):r&&r.replace(/\S/g,"")}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return(r=e.raws.before).includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=void 0===r?this.raw(t,null,"beforeRule"):r&&r.replace(/\S/g,"")}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t}rawBeforeRule(t){let r;return t.walk(e=>{if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return(r=e.raws.before).includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),r=r&&r.replace(/\S/g,"")}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&void 0!==(t=e.raws.after))return!1}),t}rawIndent(r){if(r.raws.indent)return r.raws.indent;let s;return r.walk(e=>{var t=e.parent;if(t&&t!==r&&t.parent&&t.parent===r&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),s=(s=t[t.length-1]).replace(/\S/g,""),!1}),s}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t}rawValue(e,t){var r=e[t],e=e.raws[t];return e&&e.value===r?e.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)}},o=v;v.default=v;let ts=o;function rs(e,t){new ts(t).stringify(e)}s=rs;rs.default=rs;let{isClean:ss,my:ns}=_,is=d,os=o,as=s;function ls(t,r){let s=new t.constructor;for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&"proxyCache"!==n){let e=t[n];var i=typeof e;"parent"===n&&"object"==i?r&&(s[n]=r):"source"===n?s[n]=e:Array.isArray(e)?s[n]=e.map(e=>ls(e,s)):("object"==i&&null!==e&&(e=ls(e)),s[n]=e)}return s}n=class{constructor(e={}){for(var t in this.raws={},this[ss]=!1,this[ns]=!0,e)if("nodes"===t){this.nodes=[];for(var r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)),e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(var 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={}){var t,r=ls(this);for(t in e)r[t]=e[t];return r}cloneAfter(e={}){e=this.clone(e);return this.parent.insertAfter(this,e),e}cloneBefore(e={}){e=this.clone(e);return this.parent.insertBefore(this,e),e}error(e,t={}){var r,s;return this.source?({end:r,start:s}=this.rangeBy(t),this.source.input.error(e,{column:s.column,line:s.line},{column:r.column,line:r.line},t)):new is(e)}getProxyProcessor(){return{get(e,t){return"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]!==r&&(e[t]=r,"prop"===t||"value"===t||"name"===t||"params"===t||"important"===t||"text"===t)&&e.markDirty(),!0}}}markDirty(){if(this[ss]){this[ss]=!1;let e=this;for(;e=e.parent;)e[ss]=!1}}next(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;return e.index?r=this.positionInside(e.index,t):e.word&&-1!==(e=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(e,t)),r}positionInside(t,e){var r=e||this.toString();let s=this.source.start.column,n=this.source.start.line;for(let e=0;e<t;e++)"\n"===r[e]?(s=1,n+=1):s+=1;return{column:s,line:n}}prev(){var e;if(this.parent)return e=this.parent.index(this),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};var s,n;return e.word?-1!==(n=(s=this.toString()).indexOf(e.word))&&(t=this.positionInside(n,s),r=this.positionInside(n+e.word.length,s)):(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}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1))),{end:r=r.line<t.line||r.line===t.line&&r.column<=t.column?{column:t.column+1,line:t.line}:r,start:t}}raw(e,t){return(new os).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...r){if(this.parent){let e=this,t=!1;for(var s of r)s===this?t=!0:t?(this.parent.insertAfter(e,s),e=s):this.parent.insertBefore(e,s);t||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){var r,s={},n=null==t;t=t||new Map;let i=0;for(r in this)if(Object.prototype.hasOwnProperty.call(this,r)&&"parent"!==r&&"proxyCache"!==r){var o=this[r];if(Array.isArray(o))s[r]=o.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof o&&o.toJSON)s[r]=o.toJSON(null,t);else if("source"===r){let e=t.get(o.input);null==e&&(e=i,t.set(o.input,i),i++),s[r]={end:o.end,inputId:e,start:o.start}}else s[r]=o}return n&&(s.inputs=[...t.keys()].map(e=>e.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=as){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){var s,n={node:this};for(s in r)n[s]=r[s];return e.warn(t,n)}get proxyOf(){return this}},l=n,n.default=n,e=l,w=class extends e{constructor(e){super(e=e&&void 0!==e.value&&"string"!=typeof e.value?{...e,value:String(e.value)}:e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}},c=w;w.default=w;Or={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t},customAlphabet:(s,n=21)=>(e=n)=>{let t="",r=e;for(;r--;)t+=s[Math.random()*s.length|0];return t}};let{SourceMapConsumer:us,SourceMapGenerator:cs}=h,{existsSync:hs,readFileSync:ds}=h,{dirname:ps,join:gs}=h;var u=class{constructor(e,t){!1!==t.map&&(this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:"),e=t.map?t.map.prev:void 0,e=this.loadMap(t.from,e),!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=ps(this.mapFile)),e)&&(this.text=e)}consumer(){return this.consumerCache||(this.consumerCache=new us(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){var t,r=e.match(/\/\*\s*# sourceMappingURL=/gm);r&&(r=e.lastIndexOf(r.pop()),t=e.indexOf("*/",r),-1<r)&&-1<t&&(this.annotation=this.getAnnotationURL(e.substring(r,t)))}loadFile(e){if(this.root=ps(e),hs(e))return this.mapFile=e,ds(e,"utf-8").toString().trim()}loadMap(t,e){if(!1===e)return!1;if(e){if("string"==typeof e)return e;if("function"!=typeof e){if(e instanceof us)return cs.fromSourceMap(e).toString();if(e instanceof cs)return e.toString();if(this.isMap(e))return JSON.stringify(e);throw new Error("Unsupported previous source map format: "+e.toString())}e=e(t);if(e){var r=this.loadFile(e);if(r)return r;throw new Error("Unable to load previous source map: "+e.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let e=this.annotation;return t&&(e=gs(ps(t),e)),this.loadFile(e)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&0<this.consumer().sourcesContent.length)}},b=u,{SourceMapConsumer:p,SourceMapGenerator:i}=(u.default=u,h);let{fileURLToPath:fs,pathToFileURL:ms}=h,{isAbsolute:ys,resolve:vs}=h,_s=Or["nanoid"];g=h;let bs=d,ws=b,Ss=Symbol("fromOffsetCache"),Cs=Boolean(p&&i),Is=Boolean(vs&&ys);r=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Is||/^\w+:\/\//.test(t.from)||ys(t.from)?this.file=t.from:this.file=vs(t.from)),Is&&Cs&&(e=new ws(this.css,t)).text&&(t=(this.map=e).consumer().file,!this.file)&&t&&(this.file=this.mapResolve(t)),this.file||(this.id="<input css "+_s(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let n,i,o;t&&"object"==typeof t?(a=r,r="number"==typeof(l=t).offset?(t=(u=this.fromOffset(l.offset)).line,u.col):(t=l.line,l.column),o="number"==typeof a.offset?(u=this.fromOffset(a.offset),i=u.line,u.col):(i=a.line,a.column)):r||(t=(l=this.fromOffset(t)).line,r=l.col);var a,l,u=this.origin(t,r,i,o);return(n=u?new bs(e,void 0===u.endLine?u.line:{column:u.column,line:u.line},void 0===u.endLine?u.column:{column:u.endColumn,line:u.endLine},u.source,u.file,s.plugin):new bs(e,void 0===i?t:{column:r,line:t},void 0===i?r:{column:o,line:i},this.css,this.file,s.plugin)).input={column:r,endColumn:o,endLine:i,line:t,source:this.css},this.file&&(ms&&(n.input.url=ms(this.file).toString()),n.input.file=this.file),n}fromOffset(t){let s;if(this[Ss])s=this[Ss];else{var n=this.css.split("\n");s=new Array(n.length);let r=0;for(let e=0,t=n.length;e<t;e++)s[e]=r,r+=n[e].length+1;this[Ss]=s}let r=0;if(s[s.length-1]<=t)r=s.length-1;else{let e=s.length-2;for(var i;r<e;)if(i=r+(e-r>>1),t<s[i])e=i-1;else{if(!(t>=s[i+1])){r=i;break}r=i+1}}return{col:t-s[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:vs(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,s){if(!this.map)return!1;var n=this.map.consumer(),t=n.originalPositionFor({column:t,line:e});if(!t.source)return!1;let i;"number"==typeof r&&(i=n.originalPositionFor({column:s,line:r}));let o;o=ys(t.source)?ms(t.source):new URL(t.source,this.map.consumer().sourceRoot||ms(this.map.mapFile));e={column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:o.toString()};if("file:"===o.protocol){if(!fs)throw new Error("file: protocol is not available in this PostCSS build");e.file=fs(o)}s=n.sourceContentFor(t.source);return s&&(e.source=s),e}toJSON(){var e,t={};for(e of["hasBOM","css","file","id"])null!=this[e]&&(t[e]=this[e]);return this.map&&(t.map={...this.map},t.map.consumerCache)&&(t.map.consumerCache=void 0),t}get from(){return this.file||this.id}},m=r;r.default=r,g&&g.registerInput&&g.registerInput(r);let{SourceMapConsumer:ks,SourceMapGenerator:xs}=h,{dirname:Os,relative:Es,resolve:Rs,sep:Ms}=h,As=h["pathToFileURL"],Ds=m,Ts=Boolean(ks&&xs),Ps=Boolean(Os&&Rs&&Es&&Ms);f=class{constructor(e,t,r,s){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=s,this.originalCSS=s,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e,t=(e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map","\n");this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(var t of this.previous()){var r=this.toUrl(this.path(t.file)),s=t.root||Os(t.file);let e;!1===this.mapOpts.sourcesContent?(e=new ks(t.text)).sourcesContent&&(e.sourcesContent=null):e=t.consumer(),this.map.applySourceMap(e,r,this.toUrl(this.path(s)))}}clearAnnotation(){var t;if(!1!==this.mapOpts.annotation)if(this.root)for(let e=this.root.nodes.length-1;0<=e;e--)"comment"===(t=this.root.nodes[e]).type&&0===t.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(e);else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Ps&&Ts&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){var e;return this.root?this.generateString():1===this.previous().length?((e=this.previous()[0].consumer()).file=this.outputFile(),this.map=xs.fromSourceMap(e,{ignoreInvalidMapping:!0})):(this.map=new xs({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>"})),this.isSourcesContent()&&this.setSourcesContent(),this.root&&0<this.previous().length&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new xs({file:this.outputFile(),ignoreInvalidMapping:!0});let s=1,n=1,i="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""},a,l;this.stringify(this.root,(e,t,r)=>{this.css+=e,t&&"end"!==r&&(o.generated.line=s,o.generated.column=n-1,t.source&&t.source.start?(o.source=this.sourcePath(t),o.original.line=t.source.start.line,o.original.column=t.source.start.column-1):(o.source=i,o.original.line=1,o.original.column=0),this.map.addMapping(o)),(a=e.match(/\n/g))?(s+=a.length,l=e.lastIndexOf("\n"),n=e.length-l):n+=e.length,t&&"start"!==r&&(e=t.parent||{raws:{}},"decl"!==t.type&&("atrule"!==t.type||t.nodes)||t!==e.last||e.raws.semicolon)&&(t.source&&t.source.end?(o.source=this.sourcePath(t),o.original.line=t.source.end.line,o.original.column=t.source.end.column-1,o.generated.line=s,o.generated.column=n-2):(o.source=i,o.original.line=1,o.original.column=0,o.generated.line=s,o.generated.column=n-1),this.map.addMapping(o))})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){var e;return void 0!==this.mapOpts.inline?this.mapOpts.inline:(void 0===(e=this.mapOpts.annotation)||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:0<this.previous().length}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;var t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Os(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=Os(Rs(r,this.mapOpts.annotation)));t=Es(r,e);return this.memoizedPaths.set(e,t),t}previous(){var e;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(e=>{e.source&&e.source.input.map&&(e=e.source.input.map,this.previousMaps.includes(e)||this.previousMaps.push(e))}):(e=new Ds(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}setSourcesContent(){let r={};var e;this.root?this.root.walk(e=>{var t;e.source&&(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=this.usesFileUrls?this.toFileUrl(t):this.toUrl(this.path(t)),this.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>",this.map.setSourceContent(e,this.css))}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(As)return t=As(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===Ms&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}},y=class extends l{constructor(e){super(e),this.type="comment"}},v=y;y.default=y;let{isClean:Ls,my:Ns}=_,Fs=c,Us=v,js,Bs,zs,Ws;let Vs=class Bo extends l{append(...e){for(var t of e){var r;for(r of this.normalize(t,this.last))this.proxyOf.nodes.push(r)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(var t of this.nodes)t.cleanRaws(e)}each(r){if(this.proxyOf.nodes){var s=this.getIterator();let e,t;for(;this.indexes[s]<this.proxyOf.nodes.length&&(e=this.indexes[s],!1!==(t=r(this.proxyOf.nodes[e],e)));)this.indexes[s]+=1;return delete this.indexes[s],t}}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(t,s){return"proxyOf"===s?t:t[s]&&("each"===s||"string"==typeof s&&s.startsWith("walk")?(...e)=>t[s](...e.map(r=>"function"==typeof r?(e,t)=>r(e.toProxy(),t):r)):"every"===s||"some"===s?r=>t[s]((e,...t)=>r(e.toProxy(),...t)):"root"===s?()=>t.root().toProxy():"nodes"===s?t.nodes.map(e=>e.toProxy()):"first"===s||"last"===s?t[s].toProxy():t[s])},set(e,t,r){return e[t]!==r&&(e[t]=r,"name"===t||"params"===t||"selector"===t)&&e.markDirty(),!0}}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){var r,s,n,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i]).reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i+1,0,r);for(n in this.indexes)i<(s=this.indexes[n])&&(this.indexes[n]=s+o.length);return this.markDirty(),this}insertBefore(e,t){var r,s,n,i=this.index(e),o=this.normalize(t,this.proxyOf.nodes[i],0===i&&"prepend").reverse(),i=this.index(e);for(r of o)this.proxyOf.nodes.splice(i,0,r);for(n in this.indexes)i<=(s=this.indexes[n])&&(this.indexes[n]=s+o.length);return this.markDirty(),this}normalize(e,t){if("string"==typeof e)e=function t(e){return e.map(e=>(e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e))}(js(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e))for(var r of e=e.slice(0))r.parent&&r.parent.removeChild(r,"ignore");else if("root"===e.type&&"document"!==this.type)for(var s of e=e.nodes.slice(0))s.parent&&s.parent.removeChild(s,"ignore");else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new Fs(e)]}else if(e.selector)e=[new Bs(e)];else if(e.name)e=[new zs(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new Us(e)]}return e.map(e=>(e[Ns]||Bo.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[Ls]&&function e(t){if(t[Ls]=!1,t.proxyOf.nodes)for(var r of t.proxyOf.nodes)e(r)}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this.proxyOf,e))}prepend(...e){for(var t of e=e.reverse()){var r,s,n=this.normalize(t,this.first,"prepend").reverse();for(r of n)this.proxyOf.nodes.unshift(r);for(s in this.indexes)this.indexes[s]=this.indexes[s]+n.length}return this.markDirty(),this}push(e){return(e.parent=this).proxyOf.nodes.push(e),this}removeAll(){for(var e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){var t,r;for(r in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)e<=(t=this.indexes[r])&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(t,r,s){return s||(s=r,r={}),this.walkDecls(e=>{r.props&&!r.props.includes(e.prop)||r.fast&&!e.value.includes(r.fast)||(e.value=e.value.replace(t,s))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(s){return this.each((t,e)=>{let r;try{r=s(t,e)}catch(e){throw t.addToError(e)}return r=!1!==r&&t.walk?t.walk(s):r})}walkAtRules(r,s){return s?r instanceof RegExp?this.walk((e,t)=>{if("atrule"===e.type&&r.test(e.name))return s(e,t)}):this.walk((e,t)=>{if("atrule"===e.type&&e.name===r)return s(e,t)}):(s=r,this.walk((e,t)=>{if("atrule"===e.type)return s(e,t)}))}walkComments(r){return this.walk((e,t)=>{if("comment"===e.type)return r(e,t)})}walkDecls(r,s){return s?r instanceof RegExp?this.walk((e,t)=>{if("decl"===e.type&&r.test(e.prop))return s(e,t)}):this.walk((e,t)=>{if("decl"===e.type&&e.prop===r)return s(e,t)}):(s=r,this.walk((e,t)=>{if("decl"===e.type)return s(e,t)}))}walkRules(r,s){return s?r instanceof RegExp?this.walk((e,t)=>{if("rule"===e.type&&r.test(e.selector))return s(e,t)}):this.walk((e,t)=>{if("rule"===e.type&&e.selector===r)return s(e,t)}):(s=r,this.walk((e,t)=>{if("rule"===e.type)return s(e,t)}))}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]}};Vs.registerParse=e=>{js=e},Vs.registerRule=e=>{Bs=e},Vs.registerAtRule=e=>{zs=e},Vs.registerRoot=e=>{Ws=e};o=Vs,(Vs.default=Vs).rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,zs.prototype):"rule"===e.type?Object.setPrototypeOf(e,Bs.prototype):"decl"===e.type?Object.setPrototypeOf(e,Fs.prototype):"comment"===e.type?Object.setPrototypeOf(e,Us.prototype):"root"===e.type&&Object.setPrototypeOf(e,Ws.prototype),e[Ns]=!0,e.nodes&&e.nodes.forEach(e=>{Vs.rebuild(e)})},n=o;let Gs,Ks;e=class extends n{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Gs(new Ks,this,e).stringify()}},e.registerLazyResult=e=>{Gs=e},e.registerProcessor=e=>{Ks=e},w=e;e.default=e;u=class{constructor(e,t={}){for(var r in this.type="warning",this.text=e,t.node&&t.node.source&&(e=t.node.rangeBy(t),this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column),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}},Or=u;u.default=u;let Js=Or;p=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);e=new Js(e,t);return this.messages.push(e),e}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}},i=p;p.default=p;const Ys="'".charCodeAt(0),Zs='"'.charCodeAt(0),Xs="\\".charCodeAt(0),$s="/".charCodeAt(0),Hs="\n".charCodeAt(0),qs=" ".charCodeAt(0),Qs="\f".charCodeAt(0),en="\t".charCodeAt(0),tn="\r".charCodeAt(0),rn="[".charCodeAt(0),sn="]".charCodeAt(0),nn="(".charCodeAt(0),on=")".charCodeAt(0),an="{".charCodeAt(0),ln="}".charCodeAt(0),un=";".charCodeAt(0),cn="*".charCodeAt(0),hn=":".charCodeAt(0),dn="@".charCodeAt(0),pn=/[\t\n\f\r "#'()/;[\\\]{}]/g,gn=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,fn=/.[\r\n"'(/\\]/,mn=/[\da-f]/i;g=class extends o{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)}},r=g,o.registerAtRule(g.default=g),h=o;let yn,vn;y=class extends h{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){e=super.normalize(e);if(t)if("prepend"===r)1<this.nodes.length?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(var s of e)s.raws.before=t.raws.before;return e}removeChild(e,t){var r=this.index(e);return!t&&0===r&&1<this.nodes.length&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new yn(new vn,this,e).stringify()}},y.registerLazyResult=e=>{yn=e},y.registerProcessor=e=>{vn=e},n=y;h.registerRoot(y.default=y);let _n={comma(e){return _n.split(e,[","],!0)},space(e){return _n.split(e,[" ","\n","\t"])},split(e,t,r){var s,n=[];let i="",o=!1,a=0,l=!1,u="",c=!1;for(s of e)c?c=!1:"\\"===s?c=!0:l?s===u&&(l=!1):'"'===s||"'"===s?(l=!0,u=s):"("===s?a+=1:")"===s?0<a&&--a:0===a&&t.includes(s)&&(o=!0),o?(""!==i&&n.push(i.trim()),i="",o=!1):i+=s;return!r&&""===i||n.push(i.trim()),n}};e=_n;_n.default=_n;let bn=e;u=class extends o{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return bn.comma(this.selector)}set selectors(e){var t=this.selector?this.selector.match(/,\s*/):null,t=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(t)}},p=u;o.registerRule(u.default=u);let wn=c,Sn=function(t,e={}){let s=t.css.valueOf(),n=e.ignoreErrors,i,o,a,l,u,c,h,d,p,g,f=s.length,m=0,y=[],v=[];function _(e){throw t.error("Unclosed "+e,m)}return{back:function(e){v.push(e)},endOfFile:function(){return 0===v.length&&m>=f},nextToken:function(e){if(v.length)return v.pop();if(!(m>=f)){var t=!!e&&e.ignoreUnclosed;switch(i=s.charCodeAt(m)){case Hs:case qs:case en:case tn:case Qs:for(o=m;o+=1,(i=s.charCodeAt(o))===qs||i===Hs||i===en||i===tn||i===Qs;);g=["space",s.slice(m,o)],m=o-1;break;case rn:case sn:case an:case ln:case hn:case un:case on:var r=String.fromCharCode(i);g=[r,r,m];break;case nn:if(d=y.length?y.pop()[1]:"",p=s.charCodeAt(m+1),"url"===d&&p!==Ys&&p!==Zs&&p!==qs&&p!==Hs&&p!==en&&p!==Qs&&p!==tn){o=m;do{if(c=!1,-1===(o=s.indexOf(")",o+1))){if(n||t){o=m;break}_("bracket")}for(h=o;s.charCodeAt(h-1)===Xs;)--h,c=!c}while(c);g=["brackets",s.slice(m,o+1),m,o],m=o}else o=s.indexOf(")",m+1),l=s.slice(m,o+1),-1===o||fn.test(l)?g=["(","(",m]:(g=["brackets",l,m,o],m=o);break;case Ys:case Zs:a=i===Ys?"'":'"',o=m;do{if(c=!1,-1===(o=s.indexOf(a,o+1))){if(n||t){o=m+1;break}_("string")}for(h=o;s.charCodeAt(h-1)===Xs;)--h,c=!c}while(c);g=["string",s.slice(m,o+1),m,o],m=o;break;case dn:pn.lastIndex=m+1,pn.test(s),o=0===pn.lastIndex?s.length-1:pn.lastIndex-2,g=["at-word",s.slice(m,o+1),m,o],m=o;break;case Xs:for(o=m,u=!0;s.charCodeAt(o+1)===Xs;)o+=1,u=!u;if(i=s.charCodeAt(o+1),u&&i!==$s&&i!==qs&&i!==Hs&&i!==en&&i!==tn&&i!==Qs&&(o+=1,mn.test(s.charAt(o)))){for(;mn.test(s.charAt(o+1));)o+=1;s.charCodeAt(o+1)===qs&&(o+=1)}g=["word",s.slice(m,o+1),m,o],m=o;break;default:m=(i===$s&&s.charCodeAt(m+1)===cn?(0===(o=s.indexOf("*/",m+2)+1)&&(n||t?o=s.length:_("comment")),g=["comment",s.slice(m,o+1),m,o]):(gn.lastIndex=m+1,gn.test(s),o=0===gn.lastIndex?s.length-1:gn.lastIndex-2,g=["word",s.slice(m,o+1),m,o],y.push(g)),o)}return m++,g}},position:function(){return m}}},Cn=v,In=r,kn=n,xn=p;const On={empty:!0,space:!0};let En=class{constructor(e){this.input=e,this.root=new kn,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){var t,r=new In;r.name=e[1].slice(1),""===r.name&&this.unnamedAtrule(r,e),this.init(r,e[2]);let s,n,i=!1,o=!1;for(var a=[],l=[];!this.tokenizer.endOfFile();){if("("===(t=(e=this.tokenizer.nextToken())[0])||"["===t?l.push("("===t?")":"]"):"{"===t&&0<l.length?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){r.source.end=this.getPosition(e[2]),r.source.end.offset++,this.semicolon=!0;break}if("{"===t){o=!0;break}if("}"===t){if(0<a.length){for(n=a.length-1,s=a[n];s&&"space"===s[0];)s=a[--n];s&&(r.source.end=this.getPosition(s[3]||s[2]),r.source.end.offset++)}this.end(e);break}}if(a.push(e),this.tokenizer.endOfFile()){i=!0;break}}r.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(r.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(r,"params",a),i&&(e=a[a.length-1],r.source.end=this.getPosition(e[3]||e[2]),r.source.end.offset++,this.spaces=r.raws.between,r.raws.between="")):(r.raws.afterName="",r.params=""),o&&(r.nodes=[],this.current=r)}checkMissedSemicolon(s){var n=this.colon(s);if(!1!==n){let t=0,r;for(let e=n-1;0<=e&&("space"===(r=s[e])[0]||2!==(t+=1));e--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}}colon(e){let t=0,r,s,n;for(var[i,o]of e.entries()){if("("===(s=(r=o)[0])&&(t+=1),")"===s&&--t,0===t&&":"===s){if(n){if("word"===n[0]&&"progid"===n[1])continue;return i}this.doubleColon(r)}n=r}return!1}comment(e){var t=new Cn,e=(this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,e[1].slice(2,-2));/^\s*$/.test(e)?(t.text="",t.raws.left=e,t.raws.right=""):(e=e.match(/^(\s*)([^]*\S)(\s*)$/),t.text=e[2],t.raws.left=e[1],t.raws.right=e[3])}createTokenizer(){this.tokenizer=Sn(this.input)}decl(e,t){var r,s=new wn,n=(this.init(s,e[0][2]),e[e.length-1]);for(";"===n[0]&&(this.semicolon=!0,e.pop()),s.source.end=this.getPosition(n[3]||n[2]||function(t){for(let e=t.length-1;0<=e;e--){var r=t[e],r=r[3]||r[2];if(r)return r}}(e)),s.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),s.raws.before+=e.shift()[1];for(s.source.start=this.getPosition(e[0][2]),s.prop="";e.length;){var i=e[0][0];if(":"===i||"space"===i||"comment"===i)break;s.prop+=e.shift()[1]}s.raws.between="";let o;for(;e.length;){if(":"===(o=e.shift())[0]){s.raws.between+=o[1];break}"word"===o[0]&&/\w/.test(o[1])&&this.unknownWord([o]),s.raws.between+=o[1]}"_"!==s.prop[0]&&"*"!==s.prop[0]||(s.raws.before+=s.prop[0],s.prop=s.prop.slice(1));let a=[];for(;e.length&&("space"===(r=e[0][0])||"comment"===r);)a.push(e.shift());this.precheckMissedSemicolon(e);for(let r=e.length-1;0<=r;r--){if("!important"===(o=e[r])[1].toLowerCase()){s.important=!0;var l=this.stringFrom(e,r);" !important"!==(l=this.spacesFromEnd(e)+l)&&(s.raws.important=l);break}if("important"===o[1].toLowerCase()){var u=e.slice(0);let t="";for(let e=r;0<e;e--){var c=u[e][0];if(0===t.trim().indexOf("!")&&"space"!==c)break;t=u.pop()[1]+t}0===t.trim().indexOf("!")&&(s.important=!0,s.raws.important=t,e=u)}if("space"!==o[0]&&"comment"!==o[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(s.raws.between+=a.map(e=>e[1]).join(""),a=[]),this.raw(s,"value",a.concat(e),t),s.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){var t=new xn;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){this.spaces+=e[1],this.current.nodes&&(e=this.current.nodes[this.current.nodes.length-1])&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}getPosition(e){var 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="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1;var r;let s=!1,n=null;var i=[],o=e[1].startsWith("--"),a=[];let l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)n=n||l,i.push("("===r?")":"]");else if(o&&s&&"{"===r)n=n||l,i.push("}");else if(0===i.length){if(";"===r){if(s)return void this.decl(a,o);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(s=!0)}else r===i[i.length-1]&&(i.pop(),0===i.length)&&(n=null);l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),0<i.length&&this.unclosedBracket(n),t&&s){if(!o)for(;a.length&&("space"===(l=a[a.length-1][0])||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,o)}else this.unknownWord(a)}parse(){for(var e;!this.tokenizer.endOfFile();)switch((e=this.tokenizer.nextToken())[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)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,s){var n,i,o,a,l=r.length;let u="",c=!0;for(let e=0;e<l;e+=1)"space"===(o=(n=r[e])[0])&&e===l-1&&!s||"comment"===o&&(o=r[e-1]?r[e-1][0]:"empty",i=r[e+1]?r[e+1][0]:"empty",On[o]||On[i]||","===u.slice(-1))?c=!1:u+=n[1];c||(a=r.reduce((e,t)=>e+t[1],""),e.raws[t]={raw:a,value:u}),e[t]=u}rule(e){e.pop();var t=new xn;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){var t;let r="";for(;e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){var t;let r="";for(;e.length&&("space"===(t=e[0][0])||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t="";for(;e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}stringFrom(t,r){let s="";for(let e=r;e<t.length;e++)s+=t[e][1];return t.splice(r,t.length-r),s}unclosedBlock(){var 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})}},Rn=m;function Mn(e,t){e=new Rn(e,t),t=new En(e);try{t.parse()}catch(e){throw e}return t.root}g=Mn;o.registerParse(Mn.default=Mn);let{isClean:An,my:Dn}=_,Tn=f,Pn=s,Ln=o;h=w;let Nn=i,Fn=g;y=n;const Un={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},jn={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},Bn={Once:!0,postcssPlugin:!0,prepare:!0},zn=0;function Wn(e){return"object"==typeof e&&"function"==typeof e.then}function Vn(e){let t=!1;var r=Un[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,zn,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,zn,r+"Exit"]:[r,r+"Exit"]}function Gn(e){let t;return{eventIndex:0,events:t="document"===e.type?["Document",zn,"DocumentExit"]:"root"===e.type?["Root",zn,"RootExit"]:Vn(e),iterator:0,node:e,visitorIndex:0,visitors:[]}}function Kn(e){return e[An]=!1,e.nodes&&e.nodes.forEach(e=>Kn(e)),e}let Jn={};u=class zo{constructor(e,t,r){this.stringified=!1,this.processed=!1;let s;if("object"!=typeof t||null===t||"root"!==t.type&&"document"!==t.type)if(t instanceof zo||t instanceof Nn)s=Kn(t.root),t.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let e=Fn;r.syntax&&(e=r.syntax.parse),(e=r.parser?r.parser:e).parse&&(e=e.parse);try{s=e(t,r)}catch(e){this.processed=!0,this.error=e}s&&!s[Dn]&&Ln.rebuild(s)}else s=Kn(t);this.result=new Nn(e,s,r),this.helpers={...Jn,postcss:Jn,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}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){var r=this.result.lastPlugin;try{t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin?r.postcssVersion:(e.plugin=r.postcssPlugin,e.setMessage())}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};var e,t=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(e of this.plugins)if("object"==typeof e)for(var r in e){if(!jn[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${e.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Bn[r])if("object"==typeof e[r])for(var s in e[r])"*"===s?t(e,r,e[r][s]):t(e,r+"-"+s.toLowerCase(),e[r][s]);else"function"==typeof e[r]&&t(e,r,e[r])}this.hasListener=0<Object.keys(this.listeners).length}async runAsync(){for(let e=this.plugin=0;e<this.plugins.length;e++){var t=this.plugins[e],t=this.runOnRoot(t);if(Wn(t))try{await t}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){for(var r,s=this.result.root;!s[An];){s[An]=!0;for(var n=[Gn(s)];0<n.length;){var i=this.visitTick(n);if(Wn(i))try{await i}catch(e){i=n[n.length-1].node;throw this.handleError(e,i)}}}if(this.listeners.OnceExit)for(let[e,t]of this.listeners.OnceExit){this.result.lastPlugin=e;try{"document"===s.type?(r=s.nodes.map(e=>t(e,this.helpers)),await Promise.all(r)):await t(s,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(t){this.result.lastPlugin=t;try{var e;return"object"==typeof t&&t.Once?"document"===this.result.root.type?Wn((e=this.result.root.nodes.map(e=>t.Once(e,this.helpers)))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers):"function"==typeof t?t(this.result.root,this.result):void 0}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(!this.stringified){this.stringified=!0,this.sync();var t=this.result.opts;let e=Pn;t.syntax&&(e=t.syntax.stringify),(e=t.stringifier?t.stringifier:e).stringify&&(e=e.stringify);t=new Tn(e,this.result.root,this.result.opts).generate();this.result.css=t[0],this.result.map=t[1]}return this.result}sync(){if(this.error)throw this.error;if(!this.processed){if(this.processed=!0,this.processing)throw this.getAsyncError();for(var e of this.plugins)if(Wn(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){for(var t=this.result.root;!t[An];)t[An]=!0,this.walkSync(t);if(this.listeners.OnceExit)if("document"===t.type)for(var r of t.nodes)this.visitSync(this.listeners.OnceExit,r);else this.visitSync(this.listeners.OnceExit,t)}}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(var[r,s]of e){this.result.lastPlugin=r;let e;try{e=s(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(Wn(e))throw this.getAsyncError()}}visitTick(e){var t=e[e.length-1],{node:r,visitors:s}=t;if("root"===r.type||"document"===r.type||r.parent){if(0<s.length&&t.visitorIndex<s.length){var[n,i]=s[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===s.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=n;try{return i(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){for(var o,a=t.iterator;o=r.nodes[r.indexes[a]];)if(r.indexes[a]+=1,!o[An])return o[An]=!0,void e.push(Gn(o));t.iterator=0,delete r.indexes[a]}for(var l=t.events;t.eventIndex<l.length;){var u=l[t.eventIndex];if(t.eventIndex+=1,u===zn)return void(r.nodes&&r.nodes.length&&(r[An]=!0,t.iterator=r.getIterator()));if(this.listeners[u])return void(t.visitors=this.listeners[u])}}e.pop()}walkSync(e){var t;e[An]=!0;for(t of Vn(e))if(t===zn)e.nodes&&e.each(e=>{e[An]||this.walkSync(e)});else{var r=this.listeners[t];if(r&&this.visitSync(r,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"}},u.registerPostcss=e=>{Jn=e},_=u;y.registerLazyResult(u.default=u),h.registerLazyResult(u);let Yn=f,Zn=s;let Xn=g;const $n=i;y=class{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;e=Zn;this.result=new $n(this._processor,void 0,this._opts),this.result.css=t;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});r=new Yn(e,void 0,this._opts,t);r.isMap()?([e,t]=r.generate(),e&&(this.result.css=e),t&&(this.result.map=t)):(r.clearAnnotation(),this.result.css=r.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 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;var t=Xn;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e}get[Symbol.toStringTag](){return"NoWorkResult"}},h=y;y.default=y;let Hn=h,qn=_;u=w,f=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(var r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return new(this.plugins.length||t.parser||t.stringifier||t.syntax?qn:Hn)(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}},y=f;n.registerProcessor(f.default=f),u.registerProcessor(f);let Qn=c,ei=b,ti=v,ri=r,si=m,ni=n,ii=p;function oi(e,r){if(Array.isArray(e))return e.map(e=>oi(e));let{inputs:t,...s}=e;if(t){r=[];for(var n of t){n={...n,__proto__:si.prototype};n.map&&(n.map={...n.map,__proto__:ei.prototype}),r.push(n)}}if(s.nodes&&(s.nodes=e.nodes.map(e=>oi(e,r))),s.source){let{inputId:e,...t}=s.source;s.source=t,null!=e&&(s.source.input=r[e])}if("root"===s.type)return new ni(s);if("decl"===s.type)return new Qn(s);if("rule"===s.type)return new ii(s);if("comment"===s.type)return new ti(s);if("atrule"===s.type)return new ri(s);throw new Error("Unknown node type: "+e.type)}h=oi,oi.default=oi,u=d;let ai=c;f=_,b=o;let li=y;d=s,c=h;let ui=w;_=Or;let ci=v,hi=r;o=i,y=m,s=g,h=e;let di=p,pi=n;w=l;function I(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new li(e)}I.plugin=function(t,r){let s=!1;function n(...e){console&&console.warn&&!s&&(s=!0,console.warn(t+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG)&&process.env.LANG.startsWith("cn")&&console.warn(t+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226");e=r(...e);return e.postcssPlugin=t,e.postcssVersion=(new li).version,e}let e;return Object.defineProperty(n,"postcss",{get(){return e=e||n()}}),n.process=function(e,t,r){return I([n(r)]).process(e,t)},n},I.stringify=d,I.parse=s,I.fromJSON=c,I.list=h,I.comment=e=>new ci(e),I.atRule=e=>new hi(e),I.decl=e=>new ai(e),I.rule=e=>new di(e),I.root=e=>new pi(e),I.document=e=>new ui(e),I.CssSyntaxError=u,I.Declaration=ai,I.Container=b,I.Processor=li,I.Document=ui,I.Comment=ci,I.Warning=_,I.AtRule=hi,I.Result=o,I.Input=y,I.Rule=di,I.Root=pi,I.Node=w,f.registerPostcss(I);Or=I,I.default=I,v=Xr(Or);v.stringify,v.fromJSON,v.plugin,v.parse,v.list,v.document,v.comment,v.atRule,v.rule,v.decl,v.root,v.CssSyntaxError,v.Declaration,v.Container,v.Processor,v.Document,v.Comment,v.Warning,v.AtRule,v.Result,v.Input,v.Rule,v.Root,v.Node;const gi={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},fi={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},mi={};function yi(e){if(mi[e])return mi[e];var t=globalThis[e];const r=t.prototype;var s=e in gi?gi[e]:void 0,s=Boolean(s&&s.every(e=>{return Boolean(null==(e=null==(e=Object.getOwnPropertyDescriptor(r,e))?void 0:e.get)?void 0:e.toString().includes("[native code]"))})),n=e in fi?fi[e]:void 0,n=Boolean(n&&n.every(e=>{return"function"==typeof r[e]&&(null==(e=r[e])?void 0:e.toString().includes("[native code]"))}));if(s&&n)return mi[e]=t.prototype,t.prototype;try{var i,o=document.createElement("iframe"),a=(document.body.appendChild(o),o.contentWindow);return a?(i=a[e].prototype,document.body.removeChild(o),i?mi[e]=i:r):t.prototype}catch{return r}}const vi={};function _i(e,t,r){var s=e+"."+String(r);return vi[s]?vi[s].call(t):(e=yi(e),(e=null==(e=Object.getOwnPropertyDescriptor(e,r))?void 0:e.get)?(vi[s]=e).call(t):t[r])}const bi={};function wi(e,t,r){var s=e+"."+String(r);return bi[s]?bi[s].bind(t):"function"!=typeof(e=yi(e)[r])?t[r]:(bi[s]=e).bind(t)}function Si(){return yi("MutationObserver").constructor}const H={childNodes:function(e){return _i("Node",e,"childNodes")},parentNode:function(e){return _i("Node",e,"parentNode")},parentElement:function(e){return _i("Node",e,"parentElement")},textContent:function(e){return _i("Node",e,"textContent")},contains:function(e,t){return wi("Node",e,"contains")(t)},getRootNode:function(e){return wi("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?_i("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?_i("Element",e,"shadowRoot"):null},querySelector:function(e,t){return _i("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return _i("Element",e,"querySelectorAll")(t)},mutationObserver:Si};function q(e,t,r=document){const s={capture:!0,passive:!0};return r.addEventListener(e,t,s),()=>r.removeEventListener(e,t,s)}const Ci="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";r={map:{},getId(){return console.error(Ci),-1},getNode(){return console.error(Ci),null},removeNodeFromMap(){console.error(Ci)},has(){return console.error(Ci),!1},reset(){console.error(Ci)}};function Ii(n,i,o={}){let a=null,l=0;return function(...e){var t=Date.now(),r=(l||!1!==o.leading||(l=t),i-(t-l));const s=this;r<=0||i<r?(a&&(clearTimeout(a),a=null),l=t,n.apply(s,e)):a||!1===o.trailing||(a=setTimeout(()=>{l=!1===o.leading?0:Date.now(),a=null,n.apply(s,e)},r))}}function ki(e,t,r,s,n=window){const i=n.Object.getOwnPropertyDescriptor(e,t);return n.Object.defineProperty(e,t,s?r:{set(e){setTimeout(()=>{r.set.call(this,e)},0),i&&i.set&&i.set.call(this,e)}}),()=>ki(e,t,i||{},!0)}function xi(e,t,r){try{if(!(t in e))return()=>{};const n=e[t];var s=r(n);return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:n}})),e[t]=s,()=>{e[t]=n}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&new Proxy(r,{get(e,t,r){return"map"===t&&console.error(Ci),Reflect.get(e,t,r)}});let Oi=Date.now;function Ei(e){var t,r=e.document;return{left:r.scrollingElement?r.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:r.documentElement.scrollLeft||(null==r?void 0:r.body)&&(null==(t=H.parentElement(r.body))?void 0:t.scrollLeft)||(null==(t=null==r?void 0:r.body)?void 0:t.scrollLeft)||0,top:r.scrollingElement?r.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==r?void 0:r.documentElement.scrollTop)||(null==r?void 0:r.body)&&(null==(t=H.parentElement(r.body))?void 0:t.scrollTop)||(null==(e=null==r?void 0:r.body)?void 0:e.scrollTop)||0}}function Ri(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Mi(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ai(e){return e?e.nodeType===e.ELEMENT_NODE?e:H.parentElement(e):null}function L(e,t,r,s){if(e){e=Ai(e);if(e){try{if("string"==typeof t){if(e.classList.contains(t))return!0;if(s&&null!==e.closest("."+t))return!0}else if(xe(e,t,s))return!0}catch(e){}if(r){if(e.matches(r))return!0;if(s&&null!==e.closest(r))return!0}}}return!1}function Di(e,t,r){return"TITLE"===e.tagName&&r.headTitleMutations||t.getId(e)===ge}function Ti(e){return Boolean(e.changedTouches)}function Pi(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Li(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Ni(e){return e&&(!1&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(H.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Oi=()=>(new Date).getTime());class Fi{constructor(){a(this,"id",1),a(this,"styleIDMap",new WeakMap),a(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 r=void 0===t?this.id++: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 Ui(e){var t;let r=null;return r="getRootNode"in e&&(null==(t=H.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&H.host(H.getRootNode(e))?H.host(H.getRootNode(e)):r}function ji(e){var t=e.ownerDocument;return!!t&&(e=function(e){let t=e;for(var r;r=Ui(t);)t=r;return t}(e),H.contains(t,e))}function Bi(e){var t=e.ownerDocument;return t&&(H.contains(t,e)||ji(e))}var Q=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))({}),ee=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(ee||{}),k=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(k||{}),zi=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(zi||{}),Wi=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))({}),Vi=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Vi||{});function Gi(e){return"__ln"in e}class Ki{constructor(){a(this,"length",0),a(this,"head",null),a(this,"tail",null)}get(t){if(t>=this.length)throw new Error("Position outside of list range");let r=this.head;for(let e=0;e<t;e++)r=(null==r?void 0:r.next)||null;return r}addNode(e){var t,r={value:e,previous:null,next:null};e.__ln=r,e.previousSibling&&Gi(e.previousSibling)?(t=e.previousSibling.__ln.next,r.next=t,r.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=r,t&&(t.previous=r)):e.nextSibling&&Gi(e.nextSibling)&&e.nextSibling.__ln.previous?(t=e.nextSibling.__ln.previous,r.previous=t,r.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=r,t&&(t.next=r)):(this.head&&(this.head.previous=r),r.next=this.head,this.head=r),null===r.next&&(this.tail=r),this.length++}removeNode(e){var 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--)}}class Ji{constructor(){a(this,"frozen",!1),a(this,"locked",!1),a(this,"texts",[]),a(this,"attributes",[]),a(this,"attributeMap",new WeakMap),a(this,"removes",[]),a(this,"mapRemoves",[]),a(this,"movedMap",{}),a(this,"addedSet",new Set),a(this,"movedSet",new Set),a(this,"droppedSet",new Set),a(this,"mutationCb"),a(this,"blockClass"),a(this,"blockSelector"),a(this,"maskTextClass"),a(this,"maskTextSelector"),a(this,"inlineStylesheet"),a(this,"maskInputOptions"),a(this,"maskTextFn"),a(this,"maskInputFn"),a(this,"keepIframeSrcFn"),a(this,"recordCanvas"),a(this,"inlineImages"),a(this,"slimDOMOptions"),a(this,"dataURLOptions"),a(this,"doc"),a(this,"mirror"),a(this,"iframeManager"),a(this,"stylesheetManager"),a(this,"shadowDomManager"),a(this,"canvasManager"),a(this,"processedNodeManager"),a(this,"unattachedDoc"),a(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),a(this,"emit",()=>{if(!this.frozen&&!this.locked){const l=[],u=new Set,c=new Ki,h=e=>{let t=e,r=ge;for(;r===ge;)t=t&&t.nextSibling,r=t&&this.mirror.getId(t);return r};for(var r,s,n=t=>{var e,r,s=H.parentNode(t);if(s&&Bi(t)&&"TEXTAREA"!==s.tagName)return s=V(s)?this.mirror.getId(Ui(t)):this.mirror.getId(s),e=h(t),-1===s||-1===e?c.addNode(t):void((r=Re(t,{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:e=>{Pi(e,this.mirror)&&this.iframeManager.addIframe(e),Li(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Ni(t)&&this.shadowDomManager.addShadowRoot(H.shadowRoot(t),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}}))&&(l.push({parentId:s,nextId:e,node:r}),u.add(r.id)))};this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const d of this.movedSet)Zi(this.removes,d,this.mirror)&&!this.movedSet.has(H.parentNode(d))||n(d);for(const p of this.addedSet)!Xi(this.droppedSet,p)&&!Zi(this.removes,p,this.mirror)||Xi(this.movedSet,p)?n(p):this.droppedSet.add(p);let e=null;for(;c.length;){let t=null;if(!(t=e&&(r=this.mirror.getId(H.parentNode(e.value)),s=h(e.value),-1!==r)&&-1!==s?e:t)){let e=c.tail;for(;e;){var i=e;if(e=e.previous,i){var o=this.mirror.getId(H.parentNode(i.value)),a=h(i.value);if(-1!==a){if(-1!==o){t=i;break}a=i.value,o=H.parentNode(a);if(o&&o.nodeType===Node.DOCUMENT_FRAGMENT_NODE){a=H.host(o);if(-1!==this.mirror.getId(a)){t=i;break}}}}}}if(!t){for(;c.head;)c.removeNode(c.head.value);break}e=t.previous,c.removeNode(t.value),n(t.value)}var t={texts:this.texts.map(e=>{var t=e.node,r=H.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}}).filter(e=>!u.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{var t,r,s=e["attributes"];return"string"==typeof s.style&&(t=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles),t.length<s.style.length)&&(t+r).split("var(").length===s.style.split("var(").length&&(s.style=e.styleDiff),{id:this.mirror.getId(e.node),attributes:s}}).filter(e=>!u.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:l};(t.texts.length||t.attributes.length||t.removes.length||t.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.movedMap={},this.mutationCb(t))}}),a(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(H.childNodes(e),e=>H.textContent(e)||"").join("")}),a(this,"processMutation",s=>{if(!Di(s.target,this.mirror,this.slimDOMOptions))switch(s.type){case"characterData":var n=H.textContent(s.target);L(s.target,this.blockClass,this.blockSelector,!1)||n===s.oldValue||this.texts.push({value:Oe(s.target,this.maskTextClass,this.maskTextSelector,!0)&&n?this.maskTextFn?this.maskTextFn(n,Ai(s.target)):n.replace(/[\S]/g,"*"):n,node:s.target});break;case"attributes":{var i=s.target;let e=s.attributeName,t=s.target.getAttribute(e);if("value"===e&&(n=le(i),t=ie({element:i,maskInputOptions:this.maskInputOptions,tagName:i.tagName,type:n,value:t,maskInputFn:this.maskInputFn})),L(s.target,this.blockClass,this.blockSelector,!1)||t===s.oldValue)return;let r=this.attributeMap.get(s.target);if("IFRAME"===i.tagName&&"src"===e&&!this.keepIframeSrcFn(t)){if(i.contentDocument)return;e="rr_src"}if(r||(r={node:s.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(s.target,r)),"type"===e&&"INPUT"===i.tagName&&"password"===(s.oldValue||"").toLowerCase()&&i.setAttribute("data-rr-is-password","true"),!ke(i.tagName,e))if(r.attributes[e]=Ie(this.doc,oe(i.tagName),oe(e),t),"style"===e){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}var o=this.unattachedDoc.createElement("span");s.oldValue&&o.setAttribute("style",s.oldValue);for(const u of Array.from(i.style)){var a=i.style.getPropertyValue(u),l=i.style.getPropertyPriority(u);a!==o.style.getPropertyValue(u)||l!==o.style.getPropertyPriority(u)?r.styleDiff[u]=""===l?a:[a,l]:r._unchangedStyles[u]=[a,l]}for(const c of Array.from(o.style))""===i.style.getPropertyValue(c)&&(r.styleDiff[c]=!1)}else"open"===e&&"DIALOG"===i.tagName&&(i.matches("dialog:modal")?r.attributes.rr_open_mode="modal":r.attributes.rr_open_mode="non-modal");break}case"childList":L(s.target,this.blockClass,this.blockSelector,!0)||("TEXTAREA"!==s.target.tagName?(s.addedNodes.forEach(e=>this.genAdds(e,s.target)),s.removedNodes.forEach(e=>{var t=this.mirror.getId(e),r=V(s.target)?this.mirror.getId(H.host(s.target)):this.mirror.getId(s.target);L(s.target,this.blockClass,this.blockSelector,!1)||Di(e,this.mirror,this.slimDOMOptions)||-1===this.mirror.getId(e)||(this.addedSet.has(e)?(Yi(this.addedSet,e),this.droppedSet.add(e)):this.addedSet.has(s.target)&&-1===t||function e(t,r){var s;return!V(t)&&(s=r.getId(t),!r.has(s)||(!(s=H.parentNode(t))||s.nodeType!==t.DOCUMENT_NODE)&&(!s||e(s,r)))}(s.target,this.mirror)||(this.movedSet.has(e)&&this.movedMap[t+"@"+r]?Yi(this.movedSet,e):this.removes.push({parentId:r,id:t,isShadow:!(!V(s.target)||!G(s.target))||void 0})),this.mapRemoves.push(e))})):this.genTextAreaValueMutation(s.target))}}),a(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!this.addedSet.has(t)&&!this.movedSet.has(t)){if(this.mirror.hasNode(t)){if(Di(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let e=null;(e=r&&this.mirror.hasNode(r)?this.mirror.getId(r):e)&&-1!==e&&(this.movedMap[this.mirror.getId(t)+"@"+e]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);L(t,this.blockClass,this.blockSelector,!1)||(H.childNodes(t).forEach(e=>this.genAdds(e)),Ni(t)&&H.childNodes(H.shadowRoot(t)).forEach(e=>{this.processedNodeManager.add(e,this),this.genAdds(e,t)}))}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(e=>{this[e]=t[e]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Yi(t,e){t.delete(e),H.childNodes(e).forEach(e=>Yi(t,e))}function Zi(t,r,s){if(0!==t.length){var n=t;t=r;var i=s;let e=H.parentNode(t);for(;e;){const o=i.getId(e);if(n.some(e=>e.id===o))return 1;e=H.parentNode(e)}}}function Xi(e,t){return 0!==e.size&&function e(t,r){const s=H.parentNode(r);if(!s)return!1;if(t.has(s))return!0;return e(t,s)}(e,t)}let $i;const te=t=>{return $i?(...e)=>{try{return t(...e)}catch(e){if(!$i||!0!==$i(e))throw e}}:t},Hi=[];function qi(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Qi(e,t){var r=new Ji,e=(Hi.push(r),r.init(e),new(Si())(te(r.processMutations.bind(r))));return e.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),e}function eo({mouseInteractionCb:o,doc:s,mirror:a,blockClass:l,blockSelector:u,sampling:e}){if(!1===e.mouseInteraction)return()=>{};const t=!0===e.mouseInteraction||void 0===e.mouseInteraction?{}:e.mouseInteraction,n=[];let c=null;return Object.keys(k).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==t[e]).forEach(e=>{let t=oe(e);i=e;var i,r=r=>{var s=qi(r);if(!L(s,l,u,!0)){let e=null,t=i;if("pointerType"in r){switch(r.pointerType){case"mouse":e=zi.Mouse;break;case"touch":e=zi.Touch;break;case"pen":e=zi.Pen}e===zi.Touch?k[i]===k.MouseDown?t="TouchStart":k[i]===k.MouseUp&&(t="TouchEnd"):(e,zi.Pen)}else Ti(r)&&(e=zi.Touch);null!==e?(c=e,(t.startsWith("Touch")&&e===zi.Touch||t.startsWith("Mouse")&&e===zi.Mouse)&&(e=null)):k[i]===k.Click&&(e=c,c=null);var n,r=Ti(r)?r.changedTouches[0]:r;r&&(s=a.getId(s),{clientX:r,clientY:n}=r,te(o)({type:k[t],id:s,x:r,y:n,...null!==e&&{pointerType:e}}))}};if(window.PointerEvent)switch(k[e]){case k.MouseDown:case k.MouseUp:t=t.replace("mouse","pointer");break;case k.TouchStart:case k.TouchEnd:return}n.push(q(t,r,s))}),te(()=>{n.forEach(e=>e())})}function to({scrollCb:s,doc:n,mirror:i,blockClass:o,blockSelector:a,sampling:e}){return q("scroll",te(Ii(te(e=>{var t,r,e=qi(e);e&&!L(e,o,a,!0)&&(t=i.getId(e),e===n&&n.defaultView?(r=Ei(n.defaultView),s({id:t,x:r.left,y:r.top})):s({id:t,x:e.scrollLeft,y:e.scrollTop}))}),e.scroll||100)),n)}const ro=["INPUT","TEXTAREA","SELECT"],so=new WeakMap;function no(e){var t,r;return e=e,t=[],lo("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||lo("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||lo("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||lo("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule?(r=Array.from(e.parentRule.cssRules).indexOf(e),t.unshift(r)):e.parentStyleSheet&&(r=Array.from(e.parentStyleSheet.cssRules).indexOf(e),t.unshift(r)),t}function io(e,t,r){let s,n;return e?(e.ownerNode?s=t.getId(e.ownerNode):n=r.getId(e),{styleId:n,id:s}):{}}function oo({mirror:e,stylesheetManager:r},t){let s=null;s="#document"===t.nodeName?e.getId(t):e.getId(H.host(t));e="#document"===t.nodeName?null==(e=t.defaultView)?void 0:e.Document:null==(e=null==(e=t.ownerDocument)?void 0:e.defaultView)?void 0:e.ShadowRoot;const n=null!=e&&e.prototype?Object.getOwnPropertyDescriptor(null==e?void 0:e.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&e&&n?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:n.configurable,enumerable:n.enumerable,get(){var e;return null==(e=n.get)?void 0:e.call(this)},set(e){var t=null==(t=n.set)?void 0:t.call(this,e);if(null!==s&&-1!==s)try{r.adoptStyleSheets(e,s)}catch(e){}return t}}),te(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:n.configurable,enumerable:n.enumerable,get:n.get,set:n.set})})):()=>{}}function ao(e,t={}){var n,r=e.doc.defaultView;if(!r)return()=>{};{var s=e,i=t;const{mutationCb:b,mousemoveCb:w,mouseInteractionCb:S,scrollCb:C,viewportResizeCb:I,inputCb:k,mediaInteractionCb:x,styleSheetRuleCb:O,styleDeclarationCb:E,canvasMutationCb:R,fontCb:M,selectionCb:A,customElementCb:D}=s;s.mutationCb=(...e)=>{i.mutation&&i.mutation(...e),b(...e)},s.mousemoveCb=(...e)=>{i.mousemove&&i.mousemove(...e),w(...e)},s.mouseInteractionCb=(...e)=>{i.mouseInteraction&&i.mouseInteraction(...e),S(...e)},s.scrollCb=(...e)=>{i.scroll&&i.scroll(...e),C(...e)},s.viewportResizeCb=(...e)=>{i.viewportResize&&i.viewportResize(...e),I(...e)},s.inputCb=(...e)=>{i.input&&i.input(...e),k(...e)},s.mediaInteractionCb=(...e)=>{i.mediaInteaction&&i.mediaInteaction(...e),x(...e)},s.styleSheetRuleCb=(...e)=>{i.styleSheetRule&&i.styleSheetRule(...e),O(...e)},s.styleDeclarationCb=(...e)=>{i.styleDeclaration&&i.styleDeclaration(...e),E(...e)},s.canvasMutationCb=(...e)=>{i.canvasMutation&&i.canvasMutation(...e),R(...e)},s.fontCb=(...e)=>{i.font&&i.font(...e),M(...e)},s.selectionCb=(...e)=>{i.selection&&i.selection(...e),A(...e)},s.customElementCb=(...e)=>{i.customElement&&i.customElement(...e),D(...e)}}let o;e.recordDOM&&(o=Qi(e,e.doc));const a=function({mousemoveCb:r,sampling:e,doc:t,mirror:n}){if(!1===e.mousemove)return()=>{};var s="number"==typeof e.mousemove?e.mousemove:50,e="number"==typeof e.mousemoveCallback?e.mousemoveCallback:500;let i=[],o;const a=Ii(te(e=>{const t=Date.now()-o;r(i.map(e=>(e.timeOffset-=t,e)),e),i=[],o=null}),e),l=[q("mousemove",e=te(Ii(te(e=>{var t=qi(e),{clientX:r,clientY:s}=Ti(e)?e.changedTouches[0]:e;o=o||Oi(),i.push({x:r,y:s,id:n.getId(t),timeOffset:Oi()-o}),a("undefined"!=typeof DragEvent&&e instanceof DragEvent?ee.Drag:e instanceof MouseEvent?ee.MouseMove:ee.TouchMove)}),s,{trailing:!1})),t),q("touchmove",e,t),q("drag",e,t)];return te(()=>{l.forEach(e=>e())})}(e),l=eo(e),u=to(e),c=function({viewportResizeCb:r},{win:e}){let s=-1,n=-1;return q("resize",te(Ii(te(()=>{var e=Ri(),t=Mi();s===e&&n===t||(r({width:Number(t),height:Number(e)}),s=e,n=t)}),200)),e)}(e,{win:r}),h=function({inputCb:s,doc:o,mirror:n,blockClass:e,blockSelector:r,ignoreClass:a,ignoreSelector:l,maskInputOptions:u,maskInputFn:c,sampling:t,userTriggeredOnInput:h}){function i(t){let s=qi(t);var t=t.isTrusted,n=s&&s.tagName;if((s=s&&"OPTION"===n?H.parentElement(s):s)&&n&&!(ro.indexOf(n)<0)&&!L(s,e,r,!0)&&!(s.classList.contains(a)||l&&s.matches(l))){let e=s.value,r=!1;var i=le(s)||"",n=("radio"===i||"checkbox"===i?r=s.checked:(u[n.toLowerCase()]||u[i])&&(e=ie({element:s,maskInputOptions:u,tagName:n,type:i,value:e,maskInputFn:c})),d(s,h?{text:e,isChecked:r,userTriggered:t}:{text:e,isChecked:r}),s.name);"radio"===i&&n&&r&&o.querySelectorAll(`input[type="radio"][name="${n}"]`).forEach(e=>{var t;e!==s&&(t=e.value,d(e,h?{text:t,isChecked:!r,userTriggered:!1}:{text:t,isChecked:!r}))})}}function d(e,t){var r=so.get(e);r&&r.text===t.text&&r.isChecked===t.isChecked||(so.set(e,t),r=n.getId(e),te(s)({...t,id:r}))}var p;const g=("last"===t.input?["change"]:["input","change"]).map(e=>q(e,te(i),o)),f=o.defaultView;return f?(t=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),p=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]],t&&t.set&&g.push(...p.map(e=>ki(e[0],e[1],{set(){te(i)({target:this,isTrusted:!1})}},!1,f))),te(()=>{g.forEach(e=>e())})):()=>{g.forEach(e=>e())}}(e),d=function({mediaInteractionCb:a,blockClass:l,blockSelector:u,mirror:c,sampling:e,doc:t}){var r=te(o=>Ii(te(e=>{var t,r,s,n,i,e=qi(e);e&&!L(e,l,u,!0)&&({currentTime:t,volume:r,muted:s,playbackRate:n,loop:i}=e,a({type:o,id:c.getId(e),currentTime:t,volume:r,muted:s,playbackRate:n,loop:i}))}),e.media||500));const s=[q("play",r(Vi.Play),t),q("pause",r(Vi.Pause),t),q("seeked",r(Vi.Seeked),t),q("volumechange",r(Vi.VolumeChange),t),q("ratechange",r(Vi.RateChange),t)];return te(()=>{s.forEach(e=>e())})}(e);let p=()=>{},g=()=>{},f=()=>{},m=()=>{};e.recordDOM&&(p=function({styleSheetRuleCb:a,mirror:l,stylesheetManager:u},{win:s}){if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};const e=s.CSSStyleSheet.prototype.insertRule,t=(s.CSSStyleSheet.prototype.insertRule=new Proxy(e,{apply:te((e,t,r)=>{var[s,n]=r,{id:i,styleId:o}=io(t,l,u.styleMirror);return(i&&-1!==i||o&&-1!==o)&&a({id:i,styleId:o,adds:[{rule:s,index:n}]}),e.apply(t,r)})}),s.CSSStyleSheet.prototype.addRule=function(e,t,r=this.cssRules.length){return s.CSSStyleSheet.prototype.insertRule.apply(this,[e+` { ${t} }`,r])},s.CSSStyleSheet.prototype.deleteRule);s.CSSStyleSheet.prototype.deleteRule=new Proxy(t,{apply:te((e,t,r)=>{var[s]=r,{id:n,styleId:i}=io(t,l,u.styleMirror);return(n&&-1!==n||i&&-1!==i)&&a({id:n,styleId:i,removes:[{index:s}]}),e.apply(t,r)})}),s.CSSStyleSheet.prototype.removeRule=function(e){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[e])};let r;s.CSSStyleSheet.prototype.replace&&(r=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(r,{apply:te((e,t,r)=>{var[s]=r,{id:n,styleId:i}=io(t,l,u.styleMirror);return(n&&-1!==n||i&&-1!==i)&&a({id:n,styleId:i,replace:s}),e.apply(t,r)})}));let n;s.CSSStyleSheet.prototype.replaceSync&&(n=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(n,{apply:te((e,t,r)=>{var[s]=r,{id:n,styleId:i}=io(t,l,u.styleMirror);return(n&&-1!==n||i&&-1!==i)&&a({id:n,styleId:i,replaceSync:s}),e.apply(t,r)})}));const i={},o=(uo("CSSGroupingRule")?i.CSSGroupingRule=s.CSSGroupingRule:(uo("CSSMediaRule")&&(i.CSSMediaRule=s.CSSMediaRule),uo("CSSConditionRule")&&(i.CSSConditionRule=s.CSSConditionRule),uo("CSSSupportsRule")&&(i.CSSSupportsRule=s.CSSSupportsRule)),{});return Object.entries(i).forEach(([e,t])=>{o[e]={insertRule:t.prototype.insertRule,deleteRule:t.prototype.deleteRule},t.prototype.insertRule=new Proxy(o[e].insertRule,{apply:te((e,t,r)=>{var[s,n]=r,{id:i,styleId:o}=io(t.parentStyleSheet,l,u.styleMirror);return(i&&-1!==i||o&&-1!==o)&&a({id:i,styleId:o,adds:[{rule:s,index:[...no(t),n||0]}]}),e.apply(t,r)})}),t.prototype.deleteRule=new Proxy(o[e].deleteRule,{apply:te((e,t,r)=>{var[s]=r,{id:n,styleId:i}=io(t.parentStyleSheet,l,u.styleMirror);return(n&&-1!==n||i&&-1!==i)&&a({id:n,styleId:i,removes:[{index:[...no(t),s]}]}),e.apply(t,r)})})}),te(()=>{s.CSSStyleSheet.prototype.insertRule=e,s.CSSStyleSheet.prototype.deleteRule=t,r&&(s.CSSStyleSheet.prototype.replace=r),n&&(s.CSSStyleSheet.prototype.replaceSync=n),Object.entries(i).forEach(([e,t])=>{t.prototype.insertRule=o[e].insertRule,t.prototype.deleteRule=o[e].deleteRule})})}(e,{win:r}),g=oo(e,e.doc),f=function({styleDeclarationCb:l,mirror:u,ignoreCSSAttributes:c,stylesheetManager:h},{win:e}){const d=e.CSSStyleDeclaration.prototype.setProperty,o=(e.CSSStyleDeclaration.prototype.setProperty=new Proxy(d,{apply:te((e,t,r)=>{var s,n,[i,o,a]=r;return c.has(i)?d.apply(t,[i,o,a]):({id:s,styleId:n}=io(null==(s=t.parentRule)?void 0:s.parentStyleSheet,u,h.styleMirror),(s&&-1!==s||n&&-1!==n)&&l({id:s,styleId:n,set:{property:i,value:o,priority:a},index:no(t.parentRule)}),e.apply(t,r))})}),e.CSSStyleDeclaration.prototype.removeProperty);return e.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:te((e,t,r)=>{var s,n,[i]=r;return c.has(i)?o.apply(t,[i]):({id:s,styleId:n}=io(null==(s=t.parentRule)?void 0:s.parentStyleSheet,u,h.styleMirror),(s&&-1!==s||n&&-1!==n)&&l({id:s,styleId:n,remove:{property:i},index:no(t.parentRule)}),e.apply(t,r))})}),te(()=>{e.CSSStyleDeclaration.prototype.setProperty=d,e.CSSStyleDeclaration.prototype.removeProperty=o})}(e,{win:r}),e.collectFonts)&&(m=function({fontCb:r,doc:e}){const t=e.defaultView;if(!t)return()=>{};const s=[],n=new WeakMap,i=t.FontFace;return t.FontFace=function(e,t,r){var s=new i(e,t,r);return n.set(s,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),s},e=xi(e.fonts,"add",function(e){return function(t){return setTimeout(te(()=>{var e=n.get(t);e&&(r(e),n.delete(t))}),0),e.apply(this,[t])}}),s.push(()=>{t.FontFace=i}),s.push(e),te(()=>{s.forEach(e=>e())})}(e));const y=function(e){const{doc:l,mirror:u,blockClass:c,blockSelector:h,selectionCb:d}=e;let p=!0;return(e=te(()=>{var t=l.getSelection();if(!(!t||p&&null!=t&&t.isCollapsed)){p=t.isCollapsed||!1;var r=[],s=t.rangeCount||0;for(let e=0;e<s;e++){var{startContainer:n,startOffset:i,endContainer:o,endOffset:a}=t.getRangeAt(e);L(n,c,h,!0)||L(o,c,h,!0)||r.push({start:u.getId(n),startOffset:i,end:u.getId(o),endOffset:a})}d({ranges:r})}}))(),q("selectionchange",e)}(e),v=({doc:t,customElementCb:n}=[e][0],(t=t.defaultView)&&t.customElements?xi(t.customElements,"define",function(s){return function(t,e,r){try{n({define:{name:t}})}catch(e){console.warn("Custom element callback failed for "+t)}return s.apply(this,[t,e,r])}}):()=>{}),_=[];for(const T of e.plugins)_.push(T.observer(T.callback,r,T.options));return te(()=>{Hi.forEach(e=>e.reset()),null!=o&&o.disconnect(),a(),l(),u(),c(),h(),d(),p(),g(),f(),m(),y(),v(),_.forEach(e=>e())})}function lo(e){return void 0!==window[e]}function uo(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class co{constructor(e){a(this,"iframeIdToRemoteIdMap",new WeakMap),a(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,s){r=r||this.getIdToRemoteIdMap(e),s=s||this.getRemoteIdToIdMap(e);let n=r.get(t);return n||(n=this.generateIdFn(),r.set(t,n),s.set(n,t)),n}getIds(t,e){const r=this.getIdToRemoteIdMap(t),s=this.getRemoteIdToIdMap(t);return e.map(e=>this.getId(t,e,r,s))}getRemoteId(e,t,r){r=r||this.getRemoteIdToIdMap(e);return"number"!=typeof t?t:r.get(t)||-1}getRemoteIds(t,e){const r=this.getRemoteIdToIdMap(t);return e.map(e=>this.getRemoteId(t,e,r))}reset(e){e?(this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)):(this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap)}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 ho{constructor(e){a(this,"iframes",new WeakMap),a(this,"crossOriginIframeMap",new WeakMap),a(this,"crossOriginIframeMirror",new co(fe)),a(this,"crossOriginIframeStyleMirror"),a(this,"crossOriginIframeRootIdMap",new WeakMap),a(this,"mirror"),a(this,"mutationCb"),a(this,"wrappedEmit"),a(this,"loadListener"),a(this,"stylesheetManager"),a(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new co(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){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&null!=(t=e.contentWindow)&&t.addEventListener("message",this.handleMessage.bind(this)),null!=(t=this.loadListener)&&t.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&0<e.contentDocument.adoptedStyleSheets.length&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){var t=e;"rrweb"===t.data.type&&t.origin===t.data.origin&&e.source&&(e=(e=this.crossOriginIframeMap.get(e.source))&&this.transformCrossOriginEvent(e,t.data.event))&&this.wrappedEmit(e,t.data.isCheckout)}transformCrossOriginEvent(r,e){var t;switch(e.type){case Q.FullSnapshot:this.crossOriginIframeMirror.reset(r),this.crossOriginIframeStyleMirror.reset(r),this.replaceIdOnNode(e.data.node,r);var s=e.data.node.id;return this.crossOriginIframeRootIdMap.set(r,s),this.patchRootIdOnNode(e.data.node,s),{timestamp:e.timestamp,type:Q.IncrementalSnapshot,data:{source:ee.Mutation,adds:[{parentId:this.mirror.getId(r),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Q.Meta:case Q.Load:case Q.DomContentLoaded:return!1;case Q.Plugin:return e;case Q.Custom:return this.replaceIds(e.data.payload,r,["id","parentId","previousId","nextId"]),e;case Q.IncrementalSnapshot:switch(e.data.source){case ee.Mutation:return e.data.adds.forEach(e=>{this.replaceIds(e,r,["parentId","nextId","previousId"]),this.replaceIdOnNode(e.node,r);var t=this.crossOriginIframeRootIdMap.get(r);t&&this.patchRootIdOnNode(e.node,t)}),e.data.removes.forEach(e=>{this.replaceIds(e,r,["parentId","id"])}),e.data.attributes.forEach(e=>{this.replaceIds(e,r,["id"])}),e.data.texts.forEach(e=>{this.replaceIds(e,r,["id"])}),e;case ee.Drag:case ee.TouchMove:case ee.MouseMove:return e.data.positions.forEach(e=>{this.replaceIds(e,r,["id"])}),e;case ee.ViewportResize:return!1;case ee.MediaInteraction:case ee.MouseInteraction:case ee.Scroll:case ee.CanvasMutation:case ee.Input:return this.replaceIds(e.data,r,["id"]),e;case ee.StyleSheetRule:case ee.StyleDeclaration:return this.replaceIds(e.data,r,["id"]),this.replaceStyleIds(e.data,r,["styleId"]),e;case ee.Font:return e;case ee.Selection:return e.data.ranges.forEach(e=>{this.replaceIds(e,r,["start","end"])}),e;case ee.AdoptedStyleSheet:return this.replaceIds(e.data,r,["id"]),this.replaceStyleIds(e.data,r,["styleIds"]),null!=(t=e.data.styles)&&t.forEach(e=>{this.replaceStyleIds(e,r,["styleId"])}),e}}return!1}replace(e,t,r,s){for(const n of s)!Array.isArray(t[n])&&"number"!=typeof t[n]||(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(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type===X.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class po{constructor(e){a(this,"shadowDoms",new WeakSet),a(this,"mutationCb"),a(this,"scrollCb"),a(this,"bypassOptions"),a(this,"mirror"),a(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(G(e)&&!this.shadowDoms.has(e)){this.shadowDoms.add(e);const r=Qi({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(to({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&0<e.adoptedStyleSheets.length&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(H.host(e))),this.restoreHandlers.push(oo({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,s){const n=this;this.restoreHandlers.push(xi(e.prototype,"attachShadow",function(r){return function(e){var e=r.call(this,e),t=H.shadowRoot(this);return t&&Bi(this)&&n.addShadowRoot(t,s),e}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var go="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fo="undefined"==typeof Uint8Array?[]:new Uint8Array(256),mo=0;mo<go.length;mo++)fo[go.charCodeAt(mo)]=mo;function yo(e){for(var t=new Uint8Array(e),r=t.length,s="",n=0;n<r;n+=3)s=(s=(s=(s+=go[t[n]>>2])+go[(3&t[n])<<4|t[n+1]>>4])+go[(15&t[n+1])<<2|t[n+2]>>6])+go[63&t[n+2]];return r%3==2?s=s.substring(0,s.length-1)+"=":r%3==1&&(s=s.substring(0,s.length-2)+"=="),s}const vo=new Map;const _o=(t,r,s)=>{if(t&&(wo(t,r)||"object"==typeof t)){r=function(e,t){let r=vo.get(e);return r||(r=new Map,vo.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(s,t.constructor.name);let e=r.indexOf(t);return-1===e&&(e=r.length,r.push(t)),e}};const bo=(e,t,r)=>e.map(e=>function t(e,r,s){var n;return e instanceof Array?e.map(e=>t(e,r,s)):null===e?e:e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray?{rr_type:e.constructor.name,args:[Object.values(e)]}:e instanceof ArrayBuffer?{rr_type:e.constructor.name,base64:yo(e)}:e instanceof DataView?{rr_type:e.constructor.name,args:[t(e.buffer,r,s),e.byteOffset,e.byteLength]}:e instanceof HTMLImageElement?(n=e.src,{rr_type:e.constructor.name,src:n}):e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[t(e.data,r,s),e.width,e.height]}:wo(e,r)||"object"==typeof e?{rr_type:e.constructor.name,index:_o(e,r,s)}:e}(e,t,r)),wo=(t,r)=>{var e=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof r[e]);return Boolean(e.find(e=>t instanceof r[e]))};function So(e,n,i,o){const t=[];try{var r=xi(e.HTMLCanvasElement.prototype,"getContext",function(s){return function(e,...t){var r;return L(this,n,i,!0)||(r="experimental-webgl"===(r=e)?"webgl":r,"__context"in this||(this.__context=r),o&&["webgl","webgl2"].includes(r)&&(t[0]&&"object"==typeof t[0]?(r=t[0]).preserveDrawingBuffer||(r.preserveDrawingBuffer=!0):t.splice(0,1,{preserveDrawingBuffer:!0}))),s.apply(this,[e,...t])}});t.push(r)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{t.forEach(e=>e())}}function Co(e,s,n,i,o,a){var t,r=[];for(const u of Object.getOwnPropertyNames(e))if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(u))try{"function"==typeof e[u]&&(t=xi(e,u,function(r){return function(...e){var t=r.apply(this,e);return _o(t,a,this),"tagName"in this.canvas&&!L(this.canvas,i,o,!0)&&(e=bo(e,a,this),e={type:s,property:u,args:e},n(this.canvas,e)),t}}),r.push(t))}catch{var l=ki(e,u,{set(e){n(this.canvas,{type:s,property:u,args:[e],setter:!0})}});r.push(l)}return r}const Io="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=";var ko;const xo="undefined"!=typeof window&&window.Blob&&new Blob([(i=Io,Uint8Array.from(atob(i),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});function Oo(t){let e;try{var r;if(e=xo&&(window.URL||window.webkitURL).createObjectURL(xo))return(r=new Worker(e,{name:null==t?void 0:t.name})).addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),r;throw""}catch(e){return new Worker("data:text/javascript;base64,"+Io,{name:null==t?void 0:t.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class Eo{constructor(e){a(this,"pendingCanvasMutations",new Map),a(this,"rafStamps",{latestId:0,invokeId:null}),a(this,"mirror"),a(this,"mutationCb"),a(this,"resetObservers"),a(this,"frozen",!1),a(this,"locked",!1),a(this,"processMutation",(e,t)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)});var{sampling:t="all",win:r,blockClass:s,blockSelector:n,recordCanvas:i,dataURLOptions:o}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&"all"===t&&this.initCanvasMutationObserver(r,s,n),i&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,s,n,{dataURLOptions:o})}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,r,s,n,i){const t=So(r,s,n,!0),o=new Map,a=new Oo,l=(a.onmessage=e=>{var t,r,s,n=e.data["id"];o.set(n,!1),"base64"in e.data&&({base64:e,type:t,width:r,height:s}=e.data,this.mutationCb({id:n,type:Wi["2D"],commands:[{property:"clearRect",args:[0,0,r,s]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:e}],type:t}]},0,0]}]}))},1e3/e);let u=0,c;const h=()=>{const t=[];return r.document.querySelectorAll("canvas").forEach(e=>{L(e,s,n,!0)||t.push(e)}),t},d=e=>{c=(u&&e-u<l||(u=e,h().forEach(async e=>{var t,r,s=this.mirror.getId(e);o.get(s)||0!==e.width&&0!==e.height&&(o.set(s,!0),["webgl","webgl2"].includes(e.__context)&&!1===(null==(r=null==(t=e.getContext(e.__context))?void 0:t.getContextAttributes())?void 0:r.preserveDrawingBuffer)&&t.clear(t.COLOR_BUFFER_BIT),r=await createImageBitmap(e),a.postMessage({id:s,bitmap:r,width:e.width,height:e.height,dataURLOptions:i.dataURLOptions},[r]))})),requestAnimationFrame(d))};c=requestAnimationFrame(d),this.resetObservers=()=>{t(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const s=So(e,t,r,!1),n=function(r,s,n,i){const e=[];var t;for(const a of Object.getOwnPropertyNames(s.CanvasRenderingContext2D.prototype))try{"function"==typeof s.CanvasRenderingContext2D.prototype[a]&&(t=xi(s.CanvasRenderingContext2D.prototype,a,function(e){return function(...t){return L(this.canvas,n,i,!0)||setTimeout(()=>{var e=bo(t,s,this);r(this.canvas,{type:Wi["2D"],property:a,args:e})},0),e.apply(this,t)}}),e.push(t))}catch{var o=ki(s.CanvasRenderingContext2D.prototype,a,{set(e){r(this.canvas,{type:Wi["2D"],property:a,args:[e],setter:!0})}});e.push(o)}return()=>{e.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r),i=function(e,t,r,s){const n=[];return n.push(...Co(t.WebGLRenderingContext.prototype,Wi.WebGL,e,r,s,t)),void 0!==t.WebGL2RenderingContext&&n.push(...Co(t.WebGL2RenderingContext.prototype,Wi.WebGL2,e,r,s,t)),()=>{n.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{s(),n(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=e=>{this.rafStamps.latestId=e,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{var r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){var r,s;this.frozen||this.locked||(s=this.pendingCanvasMutations.get(e))&&-1!==t&&(r=s.map(e=>{const{type:t,...r}=e;return r}),s=s[0]["type"],this.mutationCb({id:t,type:s,commands:r}),this.pendingCanvasMutations.delete(e))}}class Ro{constructor(e){a(this,"trackedLinkElements",new WeakSet),a(this,"mutationCb"),a(this,"adoptedStyleSheetCb"),a(this,"styleMirror",new Fi),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(0!==e.length){var r={id:t,styleIds:[]},s=[];for(const n of e){let e;this.styleMirror.has(n)?e=this.styleMirror.getId(n):(e=this.styleMirror.add(n),s.push({styleId:e,rules:Array.from(n.rules||CSSRule,(e,t)=>({rule:K(e,n.href),index:t}))})),r.styleIds.push(e)}0<s.length&&(r.styles=s),this.adoptedStyleSheetCb(r)}}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Mo{constructor(){a(this,"nodeMap",new WeakMap),a(this,"active",!1)}inOtherBuffer(e,t){e=this.nodeMap.get(e);return e&&Array.from(e).some(e=>e!==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 re,Ao,Do,To=!1;try{2!==Array.from([1],e=>2*e)[0]&&(ko=document.createElement("iframe"),document.body.appendChild(ko),Array.from=(null==(E=ko.contentWindow)?void 0:E.Array.from)||Array.from,document.body.removeChild(ko))}catch(e){console.debug("Unable to override Array.from",e)}const Po=new ne;function Lo(e={}){const{emit:s,checkoutEveryNms:n,checkoutEveryNth:i,blockClass:r="rr-block",blockSelector:o=null,ignoreClass:N="rr-ignore",ignoreSelector:F=null,maskTextClass:a="rr-mask",maskTextSelector:l=null,inlineStylesheet:u=!0,maskAllInputs:U,maskInputOptions:t,slimDOMOptions:c,maskInputFn:h,maskTextFn:d,hooks:j,packFn:p,sampling:g={},dataURLOptions:f={},mousemoveWait:m,recordDOM:y=!0,recordCanvas:v=!1,recordCrossOriginIframes:B=!1,recordAfter:z="DOMContentLoaded"===e.recordAfter?e.recordAfter:"load",userTriggeredOnInput:W=!1,collectFonts:V=!1,inlineImages:_=!1,plugins:b,keepIframeSrcFn:w=()=>!1,ignoreCSSAttributes:G=new Set([]),errorHandler:K}=e;e=K,$i=e;const S=!B||window.parent===window;let C=!1;if(!S)try{window.parent.document&&(C=!1)}catch(e){C=!0}if(S&&!s)throw new Error("emit function is required");if(!S&&!C)return()=>{};void 0!==m&&void 0===g.mousemove&&(g.mousemove=m),Po.reset();const I=!0===U?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==t?t:{password:!0},k=!0===c||"all"===c?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===c,headMetaDescKeywords:"all"===c,headTitleMutations:"all"===c}:c||{};"NodeList"in(e=window)&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach);let J,x=0;const Y=e=>{for(const t of b||[])t.eventProcessor&&(e=t.eventProcessor(e));return e=p&&!C?p(e):e},O=(re=(e,t)=>{var r;e.timestamp=Oi(),null==(r=Hi[0])||!r.isFrozen()||e.type===Q.FullSnapshot||e.type===Q.IncrementalSnapshot&&e.data.source===ee.Mutation||Hi.forEach(e=>e.unfreeze()),S?null!=s&&s(Y(e),t):C&&(r={type:"rrweb",event:Y(e),origin:window.location.origin,isCheckout:t},window.parent.postMessage(r,"*")),e.type===Q.FullSnapshot?(J=e,x=0):e.type!==Q.IncrementalSnapshot||e.data.source===ee.Mutation&&e.data.isAttachIframe||(x++,t=i&&x>=i,r=n&&e.timestamp-J.timestamp>n,(t||r)&&Ao(!0))},e=>{re({type:Q.IncrementalSnapshot,data:{source:ee.Mutation,...e}})}),Z=e=>re({type:Q.IncrementalSnapshot,data:{source:ee.Scroll,...e}}),X=e=>re({type:Q.IncrementalSnapshot,data:{source:ee.CanvasMutation,...e}});const E=new Ro({mutationCb:O,adoptedStyleSheetCb:e=>re({type:Q.IncrementalSnapshot,data:{source:ee.AdoptedStyleSheet,...e}})}),R=new ho({mirror:Po,mutationCb:O,stylesheetManager:E,recordCrossOriginIframes:B,wrappedEmit:re});for(const D of b||[])D.getMirror&&D.getMirror({nodeMirror:Po,crossOriginIframeMirror:R.crossOriginIframeMirror,crossOriginIframeStyleMirror:R.crossOriginIframeStyleMirror});const M=new Mo,A=(Do=new Eo({recordCanvas:v,mutationCb:X,win:window,blockClass:r,blockSelector:o,mirror:Po,sampling:g.canvas,dataURLOptions:f}),new po({mutationCb:O,scrollCb:Z,bypassOptions:{blockClass:r,blockSelector:o,maskTextClass:a,maskTextSelector:l,inlineStylesheet:u,maskInputOptions:I,dataURLOptions:f,maskTextFn:d,maskInputFn:h,recordCanvas:v,inlineImages:_,sampling:g,slimDOMOptions:k,iframeManager:R,stylesheetManager:E,canvasManager:Do,keepIframeSrcFn:w,processedNodeManager:M},mirror:Po}));Ao=(e=!1)=>{if(y){re({type:Q.Meta,data:{href:window.location.href,width:Mi(),height:Ri()}},e),E.reset(),A.init(),Hi.forEach(e=>e.lock());var t=function(e,t){var{mirror:t=new ne,blockClass:r="rr-block",blockSelector:s=null,maskTextClass:n="rr-mask",maskTextSelector:i=null,inlineStylesheet:o=!0,inlineImages:a=!1,recordCanvas:l=!1,maskAllInputs:u=!1,maskTextFn:c,maskInputFn:h,slimDOM:d=!1,dataURLOptions:p,preserveWhiteSpace:g,onSerialize:f,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:v,stylesheetLoadTimeout:_,keepIframeSrcFn:b=()=>!1}=t||{};return Re(e,{doc:e,mirror:t,blockClass:r,blockSelector:s,maskTextClass:n,maskTextSelector:i,skipChild:!1,inlineStylesheet:o,maskInputOptions:!0===u?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===u?{password:!0}:u,maskTextFn:c,maskInputFn:h,slimDOMOptions:!0===d||"all"===d?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===d,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===d?{}:d,dataURLOptions:p,inlineImages:a,recordCanvas:l,preserveWhiteSpace:g,onSerialize:f,onIframeLoad:m,iframeLoadTimeout:y,onStylesheetLoad:v,stylesheetLoadTimeout:_,keepIframeSrcFn:b,newlyAddedElement:!1})}(document,{mirror:Po,blockClass:r,blockSelector:o,maskTextClass:a,maskTextSelector:l,inlineStylesheet:u,maskAllInputs:I,maskTextFn:d,maskInputFn:h,slimDOM:k,dataURLOptions:f,recordCanvas:v,inlineImages:_,onSerialize:e=>{Pi(e,Po)&&R.addIframe(e),Li(e,Po)&&E.trackLinkElement(e),Ni(e)&&A.addShadowRoot(H.shadowRoot(e),document)},onIframeLoad:(e,t)=>{R.attachIframe(e,t),A.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{E.attachLinkElement(e,t)},keepIframeSrcFn:w});if(!t)return console.warn("Failed to snapshot the document");re({type:Q.FullSnapshot,data:{node:t,initialOffset:Ei(window)}},e),Hi.forEach(e=>e.unlock()),document.adoptedStyleSheets&&0<document.adoptedStyleSheets.length&&E.adoptStyleSheets(document.adoptedStyleSheets,Po.getId(document))}};try{const T=[],P=e=>{return te(ao)({mutationCb:O,mousemoveCb:(e,t)=>re({type:Q.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>re({type:Q.IncrementalSnapshot,data:{source:ee.MouseInteraction,...e}}),scrollCb:Z,viewportResizeCb:e=>re({type:Q.IncrementalSnapshot,data:{source:ee.ViewportResize,...e}}),inputCb:e=>re({type:Q.IncrementalSnapshot,data:{source:ee.Input,...e}}),mediaInteractionCb:e=>re({type:Q.IncrementalSnapshot,data:{source:ee.MediaInteraction,...e}}),styleSheetRuleCb:e=>re({type:Q.IncrementalSnapshot,data:{source:ee.StyleSheetRule,...e}}),styleDeclarationCb:e=>re({type:Q.IncrementalSnapshot,data:{source:ee.StyleDeclaration,...e}}),canvasMutationCb:X,fontCb:e=>re({type:Q.IncrementalSnapshot,data:{source:ee.Font,...e}}),selectionCb:e=>{re({type:Q.IncrementalSnapshot,data:{source:ee.Selection,...e}})},customElementCb:e=>{re({type:Q.IncrementalSnapshot,data:{source:ee.CustomElement,...e}})},blockClass:r,ignoreClass:N,ignoreSelector:F,maskTextClass:a,maskTextSelector:l,maskInputOptions:I,inlineStylesheet:u,sampling:g,recordDOM:y,recordCanvas:v,inlineImages:_,userTriggeredOnInput:W,collectFonts:V,doc:e,maskInputFn:h,maskTextFn:d,keepIframeSrcFn:w,blockSelector:o,slimDOMOptions:k,dataURLOptions:f,mirror:Po,iframeManager:R,stylesheetManager:E,shadowDomManager:A,processedNodeManager:M,canvasManager:Do,ignoreCSSAttributes:G,plugins:(null==(e=null==b?void 0:b.filter(e=>e.observer))?void 0:e.map(t=>({observer:t.observer,options:t.options,callback:e=>re({type:Q.Plugin,data:{plugin:t.name,payload:e}})})))||[]},j)},L=(R.addLoadListener(e=>{try{T.push(P(e.contentDocument))}catch(e){console.warn(e)}}),()=>{Ao(),T.push(P(document)),To=!0});return"interactive"===document.readyState||"complete"===document.readyState?L():(T.push(q("DOMContentLoaded",()=>{re({type:Q.DomContentLoaded,data:{}}),"DOMContentLoaded"===z&&L()})),T.push(q("load",()=>{re({type:Q.Load,data:{}}),"load"===z&&L()},window))),()=>{T.forEach(e=>e()),M.destroy(),To=!1,$i=void 0}}catch(e){console.warn(e)}}Lo.addCustomEvent=(e,t)=>{if(!To)throw new Error("please add custom event after start recording");re({type:Q.Custom,data:{tag:e,payload:t}})},Lo.freezePage=()=>{Hi.forEach(e=>e.freeze())},Lo.takeFullSnapshot=e=>{if(!To)throw new Error("please take full snapshot after start recording");Ao(e)},Lo.mirror=Po,O.record=Lo}},s={};function n(e){var t=s[e];return void 0!==t||(t=s[e]={exports:{}},r[e].call(t.exports,t,t.exports,n)),t.exports}return n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n(2043).default})());
|