@statsig/js-client 3.24.3 → 3.24.4

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.
@@ -6,4 +6,4 @@ or you can use record.mirror to access the mirror instance during recording.`;le
6
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
7
 
8
8
  !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).webVitals={})}(this,(function(e){"use strict";let t=-1;const n=e=>{addEventListener("pageshow",(n=>{n.persisted&&(t=n.timeStamp,e(n))}),!0)},i=(e,t,n,i)=>{let o,s;return r=>{t.value>=0&&(r||i)&&(s=t.value-(o??0),(s||void 0===o)&&(o=t.value,t.delta=s,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,n),e(t)))}},o=e=>{requestAnimationFrame((()=>requestAnimationFrame((()=>e()))))},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},r=()=>{const e=s();return e?.activationStart??0},c=(e,n=-1)=>{const i=s();let o="navigate";t>=0?o="back-forward-cache":i&&(document.prerendering||r()>0?o="prerender":document.wasDiscarded?o="restore":i.type&&(o=i.type.replace(/_/g,"-")));return{name:e,value:n,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:o}},a=new WeakMap;function d(e,t){return a.get(e)||a.set(e,new t),a.get(e)}class h{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}}const f=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const i=new PerformanceObserver((e=>{Promise.resolve().then((()=>{t(e.getEntries())}))}));return i.observe({type:e,buffered:!0,...n}),i}}catch{}},u=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let l=-1;const m=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,p=e=>{"hidden"===document.visibilityState&&l>-1&&(l="visibilitychange"===e.type?e.timeStamp:0,v())},g=()=>{addEventListener("visibilitychange",p,!0),addEventListener("prerenderingchange",p,!0)},v=()=>{removeEventListener("visibilitychange",p,!0),removeEventListener("prerenderingchange",p,!0)},y=()=>{if(l<0){const e=r(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter((t=>"hidden"===t.name&&t.startTime>e))[0]?.startTime;l=t??m(),g(),n((()=>{setTimeout((()=>{l=m(),g()}))}))}return{get firstHiddenTime(){return l}}},b=e=>{document.prerendering?addEventListener("prerenderingchange",(()=>e()),!0):e()},T=[1800,3e3],P=(e,t={})=>{b((()=>{const s=y();let a,d=c("FCP");const h=f("paint",(e=>{for(const t of e)"first-contentful-paint"===t.name&&(h.disconnect(),t.startTime<s.firstHiddenTime&&(d.value=Math.max(t.startTime-r(),0),d.entries.push(t),a(!0)))}));h&&(a=i(e,d,T,t.reportAllChanges),n((n=>{d=c("FCP"),a=i(e,d,T,t.reportAllChanges),o((()=>{d.value=performance.now()-n.timeStamp,a(!0)}))})))}))},E=[.1,.25];let _=0,L=1/0,M=0;const C=e=>{for(const t of e)t.interactionId&&(L=Math.min(L,t.interactionId),M=Math.max(M,t.interactionId),_=M?(M-L)/7+1:0)};let I;const w=()=>I?_:performance.interactionCount??0,F=()=>{"interactionCount"in performance||I||(I=f("event",C,{type:"event",buffered:!0,durationThreshold:0}))};let k=0;class x{u=[];l=new Map;m;p;v(){k=w(),this.u.length=0,this.l.clear()}T(){const e=Math.min(this.u.length-1,Math.floor((w()-k)/50));return this.u[e]}h(e){if(this.m?.(e),!e.interactionId&&"first-input"!==e.entryType)return;const t=this.u.at(-1);let n=this.l.get(e.interactionId);if(n||this.u.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.l.set(n.id,n),this.u.push(n)),this.u.sort(((e,t)=>t.P-e.P)),this.u.length>10){const e=this.u.splice(10);for(const t of e)this.l.delete(t.id)}this.p?.(n)}}}const A=e=>{const t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=u(e),document.addEventListener("visibilitychange",e,{once:!0}),t((()=>{e(),document.removeEventListener("visibilitychange",e)})))},B=[200,500];class N{m;h(e){this.m?.(e)}}const S=[2500,4e3],q=[800,1800],O=e=>{document.prerendering?b((()=>O(e))):"complete"!==document.readyState?addEventListener("load",(()=>O(e)),!0):setTimeout(e)};e.CLSThresholds=E,e.FCPThresholds=T,e.INPThresholds=B,e.LCPThresholds=S,e.TTFBThresholds=q,e.onCLS=(e,t={})=>{P(u((()=>{let s,r=c("CLS",0);const a=d(t,h),u=e=>{for(const t of e)a.h(t);a.i>r.value&&(r.value=a.i,r.entries=a.o,s())},l=f("layout-shift",u);l&&(s=i(e,r,E,t.reportAllChanges),document.addEventListener("visibilitychange",(()=>{"hidden"===document.visibilityState&&(u(l.takeRecords()),s(!0))})),n((()=>{a.i=0,r=c("CLS",0),s=i(e,r,E,t.reportAllChanges),o((()=>s()))})),setTimeout(s))})))},e.onFCP=P,e.onINP=(e,t={})=>{globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype&&b((()=>{F();let o,s=c("INP");const r=d(t,x),a=e=>{A((()=>{for(const t of e)r.h(t);const t=r.T();t&&t.P!==s.value&&(s.value=t.P,s.entries=t.entries,o())}))},h=f("event",a,{durationThreshold:t.durationThreshold??40});o=i(e,s,B,t.reportAllChanges),h&&(h.observe({type:"first-input",buffered:!0}),document.addEventListener("visibilitychange",(()=>{"hidden"===document.visibilityState&&(a(h.takeRecords()),o(!0))})),n((()=>{r.v(),s=c("INP"),o=i(e,s,B,t.reportAllChanges)})))}))},e.onLCP=(e,t={})=>{b((()=>{const s=y();let a,h=c("LCP");const l=d(t,N),m=e=>{t.reportAllChanges||(e=e.slice(-1));for(const t of e)l.h(t),t.startTime<s.firstHiddenTime&&(h.value=Math.max(t.startTime-r(),0),h.entries=[t],a())},p=f("largest-contentful-paint",m);if(p){a=i(e,h,S,t.reportAllChanges);const s=u((()=>{m(p.takeRecords()),p.disconnect(),a(!0)}));for(const e of["keydown","click","visibilitychange"])addEventListener(e,(()=>A(s)),{capture:!0,once:!0});n((n=>{h=c("LCP"),a=i(e,h,S,t.reportAllChanges),o((()=>{h.value=performance.now()-n.timeStamp,a(!0)}))}))}}))},e.onTTFB=(e,t={})=>{let o=c("TTFB"),a=i(e,o,q,t.reportAllChanges);O((()=>{const d=s();d&&(o.value=Math.max(d.responseStart-r(),0),o.entries=[d],a(!0),n((()=>{o=c("TTFB",0),a=i(e,o,q,t.reportAllChanges),a(!0)})))}))}}));
9
- !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=>{return i={3331:t=>{"use strict";t.exports=e},1845:(t,i,e)=>{"use strict";var n;Object.defineProperty(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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},694:function(t,e,i){"use strict";var s=this&&this.__awaiter||$A();Object.defineProperty(e,"__esModule",{value:!0}),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,Object.assign(Object.assign({},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"))?Object.assign(Object.assign({},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=Object.assign(Object.assign({},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)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.Diagnostics=void 0;const n=new Map,i="start";function s(t,e,i,n){return Object.assign({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){"use strict";var i=this&&this.__awaiter||$A();Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},5542:function(t,o,e){"use strict";var i=this&&this.__awaiter||$A();Object.defineProperty(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=Object.assign({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)},Object.assign(Object.assign({},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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},2417:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},7770:function(t,e,i){"use strict";var n=this&&this.__awaiter||$A();Object.defineProperty(e,"__esModule",{value:!0}),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=Object.assign({},t.user),delete t.user.privateAttributes);var e={},i=this.Ft(),i=(i&&(e.statsigMetadata={currentPage:i}),Object.assign(Object.assign({},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:Object.assign({},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)=>{"use strict";Object.defineProperty(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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},7512:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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){"use strict";var y=this&&this.__awaiter||$A();Object.defineProperty(e,"__esModule",{value:!0}),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),E=i(2397),k=500,T=3e4;const M=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!!D(t)&&(t=this.Ht("POST",t),e=this.Xt(t),(i=navigator).sendBeacon.bind(i)(e,t.body))}post(e){return y(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(m){return y(this,void 0,void 0,function*(){var e;if(!D(m))return null;if(this.Jt.preventAllNetworkTraffic)return null;var{method:i,body:n,retries:s,attempt:r}=m,l=m.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(m);let a=null;var c,h=(0,E.Rt)();try{var d,v,f,g={method:i,body:n,headers:Object.assign({},m.headers),signal:null===o||void 0===o?void 0:o.signal,priority:m.priority,keepalive:h},_=(c=r,(p=m).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(),C(m,a,r,f),this.Wt.tryBumpExpiryTime(m.sdkKey,m.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=(C(m,a,r,"",t),yield this.Wt.tryFetchUpdatedFallbackInfo(m.sdkKey,m.urlConfig,n,h));return(p&&(m.fallbackUrl=this.Wt.getActiveFallbackUrl(m.sdkKey,m.urlConfig)),!s||s<r||!M.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:m}),_=`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 y(this,void 0,void 0,function*(){yield new Promise(t=>setTimeout(t,Math.min(k*(e*e),T)))})}(r),this.Zt(Object.assign(Object.assign({},m),{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=Object.assign({[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=Object.assign(Object.assign({},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 y(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=Object.assign(Object.assign({},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=Object.assign(Object.assign({},e),{method:t,fallbackUrl:i});return"data"in e&&r(t,e.data),t}};const D=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(Object.assign(Object.assign({},e),{statsigMetadata:Object.assign(Object.assign({},a.StatsigMetadataProvider.get()),{stableID:s,sessionID:r,sdkType:i,fallbackUrl:n})}))};function C(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){"use strict";var o=this&&this.__awaiter||$A();Object.defineProperty(e,"__esModule",{value:!0}),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,Object.assign(Object.assign({},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=Object.assign(Object.assign({},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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1361:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},3091:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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]&&document&&((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}}},1375:function(t,e,i){"use strict";var n=this&&this.__awaiter||$A();Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorTag=void 0,e.ErrorTag={NetworkError:"NetworkError"}},3206:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DataAdapterCachePrefix=void 0,e.DataAdapterCachePrefix="statsig.cached"},1637:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StatsigMetadataProvider=e.SDK_VERSION=void 0,e.SDK_VERSION="3.24.3";let i={sdkVersion:e.SDK_VERSION,sdkType:"js-mono"};e.StatsigMetadataProvider={get:()=>i,add:t=>{i=Object.assign(Object.assign({},i),t)}}},586:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},2059:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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 Object.assign(Object.assign({},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 Object.assign(Object.assign({},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),Object.assign(Object.assign({},t),{groupName:null!=(e=null==i?void 0:i.group_name)?e:null})},e.ke=function(t,e,i,n){return Object.assign(Object.assign({},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 Object.assign(Object.assign(Object.assign({},t),e),{get:r(t.name,i,n)})},e.we=r},1812:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},3932:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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){"use strict";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]}}),Object.defineProperty(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=(Object.defineProperty(e,"__esModule",{value:!0}),e.Storage=e.Log=e.EventLogger=e.Diagnostics=void 0,i(1845),i(1845));const l=i(8962),o=(Object.defineProperty(e,"Diagnostics",{enumerable:!0,get:function(){return l.Diagnostics}}),i(7770)),u=(Object.defineProperty(e,"EventLogger",{enumerable:!0,get:function(){return o.EventLogger}}),i(7512));Object.defineProperty(e,"Log",{enumerable:!0,get:function(){return u.Log}});var a=i(8e3);const c=i(4534);Object.defineProperty(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),Object.assign((0,r.l)(),{Log:u.Log,SDK_VERSION:a.SDK_VERSION})},2016:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AutoInit=void 0;const p=i(6914),m=i(2018);function y(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=y("sdkKey",c))?i:y("apiKey",c);if(h){var d={},v=y("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 m.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 m.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 Object.assign(Object.assign({},e),{customIDs:Object.assign({},n),custom:Object.assign(Object.assign({},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)}}}},7262:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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=Object.assign(Object.assign(Object.assign({},t),i),{feature_gates:Object.assign(Object.assign({},t.feature_gates),i.feature_gates),layer_configs:Object.assign(Object.assign({},t.layer_configs),i.layer_configs),dynamic_configs:Object.assign(Object.assign({},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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});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=Object.assign(Object.assign({},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),Object.assign(Object.assign({},e),{reason:i})}}},8448:function(t,e,i){"use strict";var u=this&&this.__awaiter||$A();Object.defineProperty(e,"__esModule",{value:!0});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=Object.assign(Object.assign({},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,Object.assign(Object.assign(Object.assign({},s),t),{deltasResponseRequested:!1}),r)})}}e.default=n},3583:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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){"use strict";var r=this&&this.__awaiter||$A();Object.defineProperty(e,"__esModule",{value:!0});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(Object.assign(Object.assign({},e),{user:this.He,time:Date.now()}))}updateUserWithAnalyticsOnlyMetadata(t){this.He=this.xi(Object.assign(Object.assign({},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=Object.assign(Object.assign({},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){"use strict";var r=this&&this.__awaiter||$A();Object.defineProperty(e,"__esModule",{value:!0}),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){"use strict";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]}}),Object.defineProperty(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=(Object.defineProperty(e,"__esModule",{value:!0}),e.StatsigClient=void 0,i(6914)),l=i(8198),s=(e.StatsigClient=l.default,s(i(6914),e),Object.assign((0,r.l)(),{StatsigClient:l.default}));e.default=s},8788:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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=Object.assign(Object.assign({},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){this.si.isRecording()&&(this.si.stop(),a.StatsigMetadataProvider.add({isRecordingSession:"false"})),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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(Object.assign(Object.assign({},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?Object.assign(Object.assign({},t),{emit:e,checkoutEveryNms:3e4}):Object.assign(Object.assign({},t),{emit:e}))))}stop(){this.pi&&(this.pi(),this.pi=void 0)}isRecording(){return null!=this.pi}}},5967:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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=(Object.defineProperty(e,"SessionReplay",{enumerable:!0,get:function(){return s.SessionReplay}}),Object.defineProperty(e,"StatsigSessionReplayPlugin",{enumerable:!0,get:function(){return s.StatsigSessionReplayPlugin}}),Object.defineProperty(e,"runStatsigSessionReplay",{enumerable:!0,get:function(){return s.runStatsigSessionReplay}}),i(4069)),l=(Object.defineProperty(e,"forceStartRecording",{enumerable:!0,get:function(){return r.forceStartRecording}}),Object.defineProperty(e,"startRecording",{enumerable:!0,get:function(){return r.startRecording}}),Object.defineProperty(e,"stopRecording",{enumerable:!0,get:function(){return r.stopRecording}}),i(759)),o=(Object.defineProperty(e,"SessionReplayClient",{enumerable:!0,get:function(){return l.SessionReplayClient}}),i(3691));Object.defineProperty(e,"StatsigTriggeredSessionReplayPlugin",{enumerable:!0,get:function(){return o.StatsigTriggeredSessionReplayPlugin}}),Object.defineProperty(e,"runStatsigTriggeredSessionReplay",{enumerable:!0,get:function(){return o.runStatsigTriggeredSessionReplay}}),Object.assign((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})},4535:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AutoCapture=e.runStatsigAutoCapture=e.StatsigAutoCapturePlugin=void 0;const c=i(6914),r=i(5423),s=i(8872),l=i(7875),o=i(6714),u=i(4716),a=i(2678),h=i(5864),d=i(3769),v=i(9900),f={submit:r.AutoCaptureEventName.FORM_SUBMIT,click:r.AutoCaptureEventName.CLICK,copy:r.AutoCaptureEventName.COPY,cut:r.AutoCaptureEventName.COPY};function n(t,e){var i=t.getContext()["sdkKey"];if(!(0,c.kt)()){var n=null!=(n=(0,c.l)().acInstances)?n:{};if(n[i])return n[i]}return new g(t,e)}e.StatsigAutoCapturePlugin=class{constructor(t){this.m=t,this.__plugin="auto-capture"}bind(t){n(t,this.m)}},e.runStatsigAutoCapture=n;class g{constructor(t,e){this.tn=t,this.rn={},this.sn=null,this.Ei=!1,this.cr=!1;var{sdkKey:t,errorBoundary:i,values:n}=t.getContext(),i=(this.rn=null!=(n=null==(n=null==n?void 0:n.auto_capture_settings)?void 0:n.disabled_events)?n:{},this.$t=i,this.$t.wrap(this,"autoCapture:"),this.tn.$on("values_updated",()=>{var t=this.tn.getContext().values;this.rn=null!=(t=null==(t=null==t?void 0:t.auto_capture_settings)?void 0:t.disabled_events)?t:this.rn}),this.Vi=new o.EngagementManager,this.Gi=new u.default,this.hr=new a.WebVitalsManager(this.bn.bind(this),i),this.xs=new l.default(this.bn.bind(this),i),this.Ns=new s.ConsoleLogManager(this.bn.bind(this),i,null!=(n=null==e?void 0:e.consoleLogAutoCaptureSettings)?n:{enabled:!1}),this.ln=null==e?void 0:e.eventFilterFunc,(0,c.de)());(0,c.kt)()||((e=null!=(n=(__STATSIG__=(0,c.l)()).acInstances)?n:{})[t]=this,__STATSIG__.acInstances=e),"loading"===(null==i?void 0:i.readyState)?i.addEventListener("DOMContentLoaded",()=>this.qt()):this.qt()}un(){var t=(0,c.te)(),e=(0,c.de)();if(t&&e){const i=(t,e=!0)=>{t=t||(null==(t=(0,c.te)())?void 0:t.event);this.an(t),e&&this.Vi.bumpInactiveTimer(),"click"===t.type&&t instanceof MouseEvent&&this.Gi.isRageClick(t.clientX,t.clientY,Date.now())&&this.Bi(t)};(0,h.cn)(e,"click",t=>i(t)),(0,h.cn)(e,"submit",t=>i(t)),(0,h.cn)(e,"copy",t=>i(t)),(0,h.cn)(e,"cut",t=>i(t)),(0,h.cn)(t,"error",t=>i(t,!1)),(0,h.cn)(t,"pagehide",()=>this.Mi()),(0,h.cn)(t,"beforeunload",()=>this.Mi())}}vn(){var t=(0,c.te)(),e=(0,c.de)();t&&e&&((0,h.cn)(t,"popstate",()=>this.fn()),window.history.pushState=new Proxy(window.history.pushState,{apply:(t,e,[i,n,s])=>{t.apply(e,[i,n,s]),this.fn()}}),window.history.replaceState=new Proxy(window.history.replaceState,{apply:(t,e,[i,n,s])=>{t.apply(e,[i,n,s]),this.fn()}}),this.fn())}an(t){var e=null==(e=t.type)?void 0:e.toLowerCase();if("error"===e&&t instanceof ErrorEvent)this._n(t);else{var i=(0,h.gn)(t);if(i){e=f[e];if(e){var n=e===r.AutoCaptureEventName.COPY;if((0,h.St)(t,i,n)){var s={};if(n){n=null==(n=null==(n=(0,c.te)())?void 0:n.getSelection())?void 0:n.toString();if(!n)return;s.selectedText=(0,h.Ls)(n);n=t.type||"clipboard";s.clipType=n}var{value:t,metadata:n}=(0,d.pn)(i),i=(Object.assign(s,n),(0,v.$i)((0,h.wn)()));this.bn(e,t,Object.assign(Object.assign({},i),s))}}}}}qt(){this.hr.startTracking(),this.xs.startTracking(),this.Ns.startTracking(),this.Vi.startInactivityTracking(()=>this.Mi(!0)),this.un(),this.vn(),this.mn(),this.yn()}_n(t){var e=(null==t?void 0:t.error)||{};let i=e;if("object"==typeof e)try{i=JSON.stringify(e)}catch(t){i="function"==typeof(null==e?void 0:e.toString)?e.toString():"Unknown Error"}this.bn(r.AutoCaptureEventName.ERROR,t.message,{message:t.message,filename:t.filename,lineno:t.lineno,colno:t.colno,error_str:i})}mn(){var t=this.On();try{this.jn(t)&&this.bn(r.AutoCaptureEventName.SESSION_START,(0,h.Sn)(),Object.assign({sessionID:t.data.sessionID},(0,v.$i)((0,h.wn)())),{flushImmediately:!0})}catch(t){this.$t.logError("AC::logSession",t)}}fn(){var t=(0,h.wn)(),e=this.sn;e&&t.href===e.href||(this.Vi.setLastPageViewTime(Date.now()),e=(this.Ei=!1,v.$i)(t),this.sn&&(e.last_page_view_url=this.sn.href),this.cr||(this.dr(),this.cr=!0),this.bn(r.AutoCaptureEventName.PAGE_VIEW,(0,h.Sn)(),e,{flushImmediately:!0,addNewSessionMetadata:!0}),this.sn=t,this.Vi.bumpInactiveTimer())}Mi(t=!1){var e,i;this.Ei||(this.Ei=!0,e=this.Vi.getScrollMetrics(),i=this.Vi.getPageViewLength(),this.bn(r.AutoCaptureEventName.PAGE_VIEW_END,(0,h.Sn)(),Object.assign(Object.assign({},e),{pageViewLength:i,dueToInactivity:t}),{flushImmediately:!0}))}Bi(t){var{value:e,metadata:i}=(0,d.pn)(t.target);this.bn(r.AutoCaptureEventName.RAGE_CLICK,e,Object.assign(Object.assign({x:t.clientX,y:t.clientY,timestamp:Date.now()},(0,v.$i)((0,h.wn)())),i))}yn(){const i=(0,c.te)();i&&i.performance&&void 0!==(null===i||void 0===i?void 0:i.performance)&&"function"==typeof i.performance.getEntriesByType&&"function"==typeof i.performance.getEntriesByName&&setTimeout(()=>{var t={},e=i.performance.getEntriesByType("navigation"),e=(e&&0<e.length&&e[0]instanceof PerformanceNavigationTiming&&(e=e[0],t.load_time_ms=e.duration,t.dom_interactive_time_ms=e.domInteractive-e.startTime,t.redirect_count=e.redirectCount,t.transfer_bytes=e.transferSize),i.performance.getEntriesByName("first-contentful-paint"));e&&0<e.length&&e[0]instanceof PerformancePaintTiming&&(t.first_contentful_paint_time_ms=e[0].startTime),this.bn(r.AutoCaptureEventName.PERFORMANCE,(0,h.Sn)(),Object.assign(Object.assign({},t),(0,v.Ji)()))},1)}bn(t,e,i,n){var s,r,l;if(e){var o=t.slice("auto_capture::".length);if(!this.rn[t]&&!this.rn[o]){o=this.On();try{var u=Object.assign({sessionID:o.data.sessionID,page_url:null!=(l=null==(r=null==(s=(0,c.te)())?void 0:s.location)?void 0:r.href)?l:""},i),a=(null!=n&&n.addNewSessionMetadata&&(u.isNewSession=String(this.jn(o))),{eventName:t,value:e,metadata:u});this.ln&&!this.ln(a)||(this.tn.logEvent(a),null!=n&&n.flushImmediately&&this.vr())}catch(t){this.$t.logError("AC::enqueue",t)}}}}dr(){var t=this.tn;t.ar=(0,v.gr)((0,h.wn)()),t.He=Object.assign(Object.assign({},t.He),{analyticsOnlyMetadata:Object.assign(Object.assign({},t.ar),t.He.analyticsOnlyMetadata)})}vr(){this.tn.flush().catch(t=>{c.Log.error(t)})}jn(t){return Math.abs(t.data.startTime-Date.now())<1e3}On(){return this.tn.getContext().session}static getAllMetadata(){return(0,v.$i)((0,h.wn)())}}e.AutoCapture=g},5423:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AutoCaptureEventName=void 0,e.AutoCaptureEventName={PAGE_VIEW:"auto_capture::page_view",PAGE_VIEW_END:"auto_capture::page_view_end",ERROR:"auto_capture::error",SESSION_START:"auto_capture::session_start",PERFORMANCE:"auto_capture::performance",FORM_SUBMIT:"auto_capture::form_submit",CLICK:"auto_capture::click",RAGE_CLICK:"auto_capture::rage_click",WEB_VITALS:"auto_capture::web_vitals",DEAD_CLICK:"auto_capture::dead_click",COPY:"auto_capture::copy",CONSOLE_LOG:"statsig::log_line"}},8872:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ConsoleLogManager=void 0;const n=i(6914),s=i(5423),o=i(5864),r=i(9900),u={trace:10,debug:20,log:30,info:30,warn:40,error:50};e.ConsoleLogManager=class{constructor(t,e,i){this._r=t,this.$t=e,this.m=i,this.Ps=[],this.Us=!1,this.Fs="info",this.__source="js-auto-capture",this.Fs=null!=(t=this.m.logLevel)?t:"info"}startTracking(){try{!this.Us&&this.m.enabled&&(0,n.te)()&&(this.Ks(),this.Us=!0)}catch(t){n.Log.error("Error starting console log tracking",t),this.$t.logError("autoCapture:ConsoleLogManager",t)}}stopTracking(){this.Us&&(this.Ps.forEach(t=>t()),this.Ps=[],this.Us=!1)}Ks(){Object.entries(u).forEach(([r,t])=>{if(!(t<u[this.Fs])&&console[r]){const l=console[r].bind(console);let s=!1;t=(0,o.wrapFunctionWithRestore)(console,r,n=>(...e)=>{if(n(...e),!s){s=!0;try{var t=e.map(t=>this.zs(t)),i=this.qs();this.Vs(r,t,i)}catch(t){l("console observer error:",t,...e),this.$t.logError("autoCapture:ConsoleLogManager",t)}finally{s=!1}}});this.Ps.push(t)}})}Vs(t,e,i){this.Bs()&&(t=Object.assign({status:"log"===t?"info":t,log_level:t,payload:e,trace:i,timestamp:Date.now(),source:this.__source},(0,r.$i)((0,o.wn)())),this._r(s.AutoCaptureEventName.CONSOLE_LOG,e.join(" "),t))}Bs(){return!this.m.sampleRate||"number"!=typeof this.m.sampleRate||this.m.sampleRate<=0||1<=this.m.sampleRate||Math.random()<this.m.sampleRate}zs(t){try{return"string"==typeof t?t:"object"==typeof t&&null!==t?JSON.stringify(t):String(t)}catch(t){return"[Unserializable]"}}qs(){var t,e;try{return null!=(e=null==(t=(new Error).stack)?void 0:t.split("\n").slice(2))?e:[]}catch(t){return[]}}}},7875:(t,i,e)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.DeadClickConfig=void 0;const l=e(6914),s=e(5423),r=e(5864),o=e(3769),u=e(9900);i.DeadClickConfig={CLICK_CHECK_TIMEOUT:1e3,SCROLL_DELAY_MS:100,SELECTION_CHANGE_DELAY_MS:100,MUTATION_DELAY_MS:2500,ABSOLUTE_DEAD_CLICK_TIMEOUT:2750};i.default=class{constructor(t,e){this._r=t,this.$t=e,this.$s=0,this.Gs=0,this.er=[],this.Js=i.DeadClickConfig,this.tr=(0,r.throttle)(()=>{const e=Date.now();this.er.forEach(t=>{t.scrollDelayMs||(t.scrollDelayMs=e-t.timestamp)})},50)}startTracking(){try{var t=(0,l.te)();t&&(t.addEventListener("click",t=>this.Ws(t),{capture:!0}),t.addEventListener("scroll",()=>this.tr(),{capture:!0,passive:!0}),t.addEventListener("selectionchange",()=>this.Ys()),this.Hs())}catch(t){l.Log.error("Error starting dead click tracking",t),this.$t.logError("autoCapture:DeadClickManager",t)}}Ws(t){var e,t=t.target;t&&(e={timestamp:Date.now(),eventTarget:t},r.interactiveElements.includes(null==(t=null==t?void 0:t.tagName)?void 0:t.toLowerCase())||this.er.push(e),this.er.length)&&!this.Qs&&(this.Qs=null==(t=(0,l.te)())?void 0:t.setTimeout(()=>{this.Xs()},this.Js.CLICK_CHECK_TIMEOUT))}Ys(){this.Gs=Date.now()}Hs(){var t=(0,l.de)();t&&(this.Zs=new MutationObserver(()=>{this.$s=Date.now()}),this.Zs.observe(t.body,{childList:!0,subtree:!0,attributes:!0,characterData:!0}))}Xs(){if(this.er.length){clearTimeout(this.Qs),this.Qs=void 0;var t=this.er;this.er=[];for(const r of t){this.jr(r);var e,i=null!=r.scrollDelayMs&&r.scrollDelayMs<this.Js.SCROLL_DELAY_MS,n=null!=r.selectionChangeDelayMs&&r.selectionChangeDelayMs<this.Js.SELECTION_CHANGE_DELAY_MS,s=null!=r.mutationDelayMs&&r.mutationDelayMs<this.Js.MUTATION_DELAY_MS;i||n||s||(i=null!=r.scrollDelayMs&&r.scrollDelayMs>this.Js.SCROLL_DELAY_MS,n=null!=r.selectionChangeDelayMs&&r.selectionChangeDelayMs>this.Js.SELECTION_CHANGE_DELAY_MS,s=null!=r.mutationDelayMs&&r.mutationDelayMs>this.Js.MUTATION_DELAY_MS,e=null!=r.absoluteDelayMs&&r.absoluteDelayMs>this.Js.ABSOLUTE_DEAD_CLICK_TIMEOUT,i||n||s||e?this.Sr(r,{scrollTimeout:i,selectionChangeTimeout:n,mutationTimeout:s,absoluteTimeout:e}):null!=r.absoluteDelayMs&&r.absoluteDelayMs<this.Js.ABSOLUTE_DEAD_CLICK_TIMEOUT&&this.er.push(r))}this.er.length&&!this.Qs&&(this.Qs=null==(t=(0,l.te)())?void 0:t.setTimeout(()=>{this.Xs()},this.Js.CLICK_CHECK_TIMEOUT))}}Sr(t,e){var{value:i,metadata:n}=(0,o.pn)(t.eventTarget);i&&this._r(s.AutoCaptureEventName.DEAD_CLICK,i,Object.assign(Object.assign(Object.assign(Object.assign({},n),e),(0,u.ur)((0,r.wn)())),{scrollDelayMs:t.scrollDelayMs,selectionChangeDelayMs:t.selectionChangeDelayMs,mutationDelayMs:t.mutationDelayMs,absoluteDelayMs:t.absoluteDelayMs}))}jr(t){!t.mutationDelayMs&&0<this.$s&&t.timestamp<=this.$s&&(t.mutationDelayMs=Date.now()-this.$s),!t.selectionChangeDelayMs&&0<this.Gs&&t.timestamp<=this.Gs&&(t.selectionChangeDelayMs=Date.now()-this.Gs),t.absoluteDelayMs=Date.now()-t.timestamp}}},6714:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EngagementManager=void 0;const n=i(6914);e.EngagementManager=class{constructor(){this.Wi=0,this.Yi=0,this.Qi=0,this.Hi=0,this.Xi=Date.now(),this.Ai=null,this.Zi=null,this.Zn()}Zn(){var t=(0,n.te)();t&&(t.addEventListener("scroll",()=>this.tr()),t.addEventListener("scrollend",()=>this.tr()),t.addEventListener("resize",()=>this.tr()))}tr(){var t,e=(0,n.te)(),i=(0,n.de)();e&&i&&(t=i.body.scrollHeight,i=e.scrollY||i.documentElement.scrollTop||0,e=e.innerHeight,this.Wi=i,this.Yi=Math.max(this.Yi,i),i=Math.min(100,Math.round((i+e)/t*100)),this.Qi=i,this.Hi=Math.max(this.Hi,i),this.bumpInactiveTimer())}getScrollMetrics(){return{lastScrollY:this.Wi,maxScrollY:this.Yi,lastScrollPercentage:this.Qi,maxScrollPercentage:this.Hi,scrollDepth:this.Hi}}getPageViewLength(){return Date.now()-this.Xi}setLastPageViewTime(t){this.Xi=t}startInactivityTracking(t){this.Zi=t}bumpInactiveTimer(){var t=(0,n.te)();t&&(this.Ai&&clearTimeout(this.Ai),this.Ai=t.setTimeout(()=>{this.Zi&&this.Zi()},6e5))}}},4716:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=class{constructor(){this.er=[]}isRageClick(t,e,i){this.er=this.er.filter(t=>i-t.timestamp<1e3);var n,s;return 0<this.er.length&&(n=this.er[this.er.length-1],s=t-n.x,n=e-n.y,!(Math.abs(s)+Math.abs(n)<=30))&&(this.er=[]),this.er.push({x:t,y:e,timestamp:i}),3<=this.er.length}}},2678:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WebVitalsManager=void 0;const n=i(8572),s=i(6914),r=i(5423),l=i(5864),o=["CLS","FCP","LCP","TTFB"];e.WebVitalsManager=class{constructor(t,e){this._r=t,this.$t=e,this.pr=!1,this.Er={url:(0,l.br)(),sanitizedUrl:(0,l.Sn)(),metrics:[],firstMetricTimestamp:void 0}}startTracking(){var t,e,i;try{this.pr||"https:"!==(i=null==(e=null==(t=(0,s.te)())?void 0:t.location)?void 0:e.protocol)&&"http:"!==i||((0,n.onCLS)(t=>this.mr(t)),(0,n.onFCP)(t=>this.mr(t)),(0,n.onLCP)(t=>this.mr(t)),(0,n.onTTFB)(t=>this.mr(t)),this.pr=!0)}catch(t){s.Log.error("Error starting web vitals tracking",t),this.$t.logError("autoCapture:WebVitalsManager",t)}}mr(t){var e;void 0===this.Er.firstMetricTimestamp&&(this.Er.firstMetricTimestamp=Date.now()),void 0!==t&&void 0!==(null==t?void 0:t.name)&&""!==(e=(0,l.br)())&&o.includes(t.name)&&(e!==this.Er.url&&(this.yr(),this.Er.url=e),this.Er.metrics.push({name:t.name,value:t.value,delta:t.delta,id:t.id}),this.Er.metrics.length===o.length)&&this.yr()}yr(){if(""!==this.Er.url&&0!==this.Er.metrics.length){const i={};this.Er.metrics.forEach(t=>{var e=t.name.toLowerCase();i[e+"_value"]=t.value,i[e+"_delta"]=t.delta,i[e+"_id"]=t.id}),this._r(r.AutoCaptureEventName.WEB_VITALS,this.Er.sanitizedUrl,Object.assign(Object.assign({},i),{first_metric_timestamp:this.Er.firstMetricTimestamp})),this.Er={url:(0,l.br)(),sanitizedUrl:(0,l.Sn)(),metrics:[],firstMetricTimestamp:void 0}}}}},1964:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StatsigAutoCapturePlugin=e.runStatsigAutoCapture=e.AutoCapture=e.AutoCaptureEventName=void 0;var n=i(6914);const s=i(4535);Object.defineProperty(e,"AutoCapture",{enumerable:!0,get:function(){return s.AutoCapture}}),Object.defineProperty(e,"StatsigAutoCapturePlugin",{enumerable:!0,get:function(){return s.StatsigAutoCapturePlugin}}),Object.defineProperty(e,"runStatsigAutoCapture",{enumerable:!0,get:function(){return s.runStatsigAutoCapture}});var r=i(5423),i=(Object.defineProperty(e,"AutoCaptureEventName",{enumerable:!0,get:function(){return r.AutoCaptureEventName}}),Object.assign((0,n.l)(),{AutoCapture:s.AutoCapture,runStatsigAutoCapture:s.runStatsigAutoCapture,StatsigAutoCapturePlugin:s.StatsigAutoCapturePlugin}));e.default=i},5864:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.wrapFunctionWithRestore=e.throttle=e.Ls=e.ir=e.nr=e.rr=e.kn=e.cn=e.Sn=e.br=e.wn=e.St=e.gn=e.sr=e.interactiveElements=void 0;const n=i(6914);const s=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$");const r=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$");function l(){var t=null!=(t=null==(t=null==(t=(0,n.te)())?void 0:t.location)?void 0:t.href)?t:"";let e;try{e=new URL(t)}catch(t){e=new URL("error:")}return e}function o(e){if(e){let t=e;for(;t;){var i=t.tagName.toLowerCase();if(["body","document"].includes(i))return null;if("a"===t.tagName.toLowerCase())return t;t=t.parentElement}}return null}e.interactiveElements=["button","a","input","select","textarea","form","select","label"],e.sr=function(t){return Object.fromEntries(Object.entries(t).filter(([,t])=>null!=t&&""!==t&&void 0!==t))},e.gn=function(t){if(!t)return null;let e=t.target||t.srcElement;return e&&e instanceof Element?e=3===e.nodeType?e.parentNode||null:e:null},e.St=function(t,e,i=!1){if(!t||!e||1!==e.nodeType)return!1;var n=e.tagName.toLowerCase(),s=t.type.toLowerCase();if(e.classList.contains("statsig-no-capture"))return!1;if(i)return!0;switch(n){case"html":return!1;case"form":return 0<=["submit"].indexOf(s);case"input":case"select":case"textarea":return 0<=["change","click"].indexOf(s);default:if("click"===s){if("button"===n)return!0;if(o(e))return!0}return!1}},e.wn=l,e.br=function(){var t=l().toString();return t.startsWith("error:")?"":t},e.Sn=function(){return(0,n.Gt)()||""},e.cn=function(t,e,i){t&&t.addEventListener&&t.addEventListener(e,i,!0)},e.kn=function(){var t=(0,n.te)();return t&&t.navigator&&t.navigator.connection||null},e.rr=function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return null}},e.nr=function(){try{return(new Date).getTimezoneOffset()}catch(t){return null}},e.ir=o,e.Ls=function(t){return t?t.replace(/<[^>]*>/g,"").trim().split(/(\s+)/).filter(t=>{return!s.test((t||"").replace(/[- ]/g,""))&&!r.test((t||"").replace(/[- ]/g,""))}).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255):null},e.throttle=function(i,n){let s=0;return function(...t){var e=Date.now();e-s>=n&&(s=e,i(...t))}},e.wrapFunctionWithRestore=function(t,e,i){const n=t[e];if("function"!=typeof n)return()=>{};try{var s=i(n);return Object.defineProperty(s,"__statsig_original__",{enumerable:!1,value:n}),t[e]=s,()=>{t[e]=n}}catch(t){return()=>{}}}},3769:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.lr=e.wr=e.pn=void 0;const n=i(6914),u=i(5864),s=1e3,r=100,l=50;function o(t,e){return t?t.length>e?t.substring(0,e)+"...":t:null}function a(t){var e={},i=Array.from(t.classList);return e.classList=0<i.length?i.slice(0,r):null,e.class=(o(t.getAttribute("class"),s)||"").replace(/\s+/g," ").trim(),e.id=o(t.getAttribute("id"),s),e.ariaLabel=o(t.getAttribute("aria-label"),s),e.selector=function(e){if(!e)return"";if(!e.parentNode){var i=e.tagName.toLowerCase();if(e.id)return"#"+e.id;let t=i;return e.className&&"string"==typeof e.className&&0<(i=e.className.trim().split(/\s+/)).length&&""!==i[0]&&(t+="."+i.join(".")),t}var t=[];let n=e,s=0;for(;n&&n.nodeType===Node.ELEMENT_NODE&&s<l;){var r=function(n){var t=n.tagName.toLowerCase();if(n.id)return"#"+n.id;let s=t;n.className&&"string"==typeof n.className&&0<(t=n.className.trim().split(/\s+/)).length&&""!==t[0]&&(s+="."+t.join("."));t=n.parentElement;if(t&&1<t.children.length){let t=1,e=1,i=n.previousElementSibling;for(;i;)t++,i.tagName===n.tagName&&e++,i=i.previousElementSibling;s+=`:nth-child(${t})`,(1<e||function(t){let e=t.nextElementSibling;for(;e;){if(e.tagName===t.tagName)return 1;e=e.nextElementSibling}return}(n))&&(s+=`:nth-of-type(${e})`)}return s}(n);if(t.unshift(r),n.id)break;if((n=n.parentElement)&&"body"===n.tagName.toLowerCase())break;s++}return t.join(" > ")}(t),e}e.pn=function(t){var e,i,n,s,r,l,o;return"input"===(l=t).tagName.toLowerCase()&&["button","checkbox","submit","reset"].includes(l.getAttribute("type")||"")||"textarea"===l.tagName.toLowerCase()||"select"===l.tagName.toLowerCase()||"true"===l.getAttribute("contenteditable")?{value:null,metadata:{}}:(l=t.tagName.toLowerCase(),e={},i=(0,u.Sn)()||"",e.tagName=l,r=a(t),Object.assign(e,r),"form"===l&&Object.assign(e,((r={}).action=(n=t).getAttribute("action"),r.method=null!=(s=n.getAttribute("method"))?s:"GET",r.formName=n.getAttribute("name"),r.formId=n.getAttribute("id"),r)),"input"===l&&Object.assign(e,((s={}).content=(n=t).value,s.inputName=n.getAttribute("name"),s)),(r=(0,u.ir)(t))&&Object.assign(e,((o={}).href=r.getAttribute("href"),o)),"button"!==l&&!r||Object.assign(e,((o={}).content=((l=r||t).textContent||"").trim(),l=function(t){var e={};if(t){var i=null==t?void 0:t.dataset;if(i)for(const n in i)e["data-"+n]=i[n]||""}return e}(l),Object.assign(o,l),o)),{value:i,metadata:e})},e.wr=function(t){var e=null==(e=null==(e=(0,n.te)())?void 0:e.getSelection())?void 0:e.toString(),i={},e=(i.selectedText=(0,u.Ls)(e),t.type||"clipboard");return i.clipType=e,i},e.lr=a},9900:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.gr=e.Ji=e.$i=e.ur=void 0;const l=i(6914),o=i(5864);function r(t){var e=(0,l.de)(),i=(0,l.te)();return(0,o.sr)(Object.assign({title:null==e?void 0:e.title,current_url:null==(e=null==i?void 0:i.location)?void 0:e.href,user_agent:null!=(e=null==i?void 0:i.navigator)&&e.userAgent&&200<(null==(e=null==(e=null==i?void 0:i.navigator)?void 0:e.userAgent)?void 0:e.length)?i.navigator.userAgent.substring(0,200):null==(e=null==i?void 0:i.navigator)?void 0:e.userAgent,locale:null==(e=null==i?void 0:i.navigator)?void 0:e.language,hostname:t.hostname,pathname:t.pathname,screen_width:null==(e=null==i?void 0:i.screen)?void 0:e.width,screen_height:null==(t=null==i?void 0:i.screen)?void 0:t.height,viewport_width:null==i?void 0:i.innerWidth,viewport_height:null==i?void 0:i.innerHeight,viewport:`${null==i?void 0:i.innerWidth}x`+(null==i?void 0:i.innerHeight),timestamp:Date.now(),timezone:(0,o.rr)(),timezone_offset:(0,o.nr)()},n()))}function n(){var t=(0,o.kn)(),e={};return void 0!==(null==t?void 0:t.effectiveType)&&(e.effective_connection_type=t.effectiveType),void 0!==(null==t?void 0:t.rtt)&&(e.rtt_ms=t.rtt),void 0!==(null==t?void 0:t.downlink)&&(e.downlink_mbps=t.downlink,e.downlink_kbps=1e3*t.downlink),void 0!==(null==t?void 0:t.saveData)&&(e.save_data=t.saveData),e}function u(t){t=(null==t?void 0:t.referrer)||"";if(!t)return{referrer:null,referrer_domain:null,referrer_path:null,searchEngine:"",searchQuery:""};try{var e=new URL(t);const s=e.hostname;var i=["google","bing","yahoo","duckduckgo","baidu"].find(t=>s.includes(t+"."))||"",n=e.searchParams.get("yahoo"===i?"p":"q")||"";return{referrer:t,referrer_domain:e.hostname,referrer_path:e.pathname,searchEngine:i,searchQuery:n}}catch(t){return{referrer:null,referrer_domain:null,referrer_path:null,searchEngine:"",searchQuery:""}}}function a(t){const i=t.searchParams,n={};return["utm_source","utm_medium","utm_campaign","utm_term","utm_content","msclkid","dclid","fbclid","gad_source","gclid","gclsrc","wbraid","utm_id","irclid","igshid","_kx","li_fat_id","mc_cid","mc_eid","epik","qclid","rdt_cid","sccid","ttc","ttclid","ttc_id","twclid"].forEach(t=>{var e=i.get(t);e&&(n[t]=e)}),n}e.ur=r,e.$i=function(t){var e=(0,l.de)(),i=(0,l.te)();if(!e||!i)return{};var i=u(e),e=r(t),n=a(t);const s={};return t.searchParams.forEach((t,e)=>{s[e]=t}),Object.assign(Object.assign({},e),(0,o.sr)(Object.assign(Object.assign(Object.assign({},i),n),s)))},e.Ji=n,e.gr=function(t){var e=(0,l.de)(),i=(0,l.te)();if(!e||!i)return{};var n,s,i=u(e),e=a(t),t=(0,o.sr)(Object.assign(Object.assign({},i),e)),r={};for([n,s]of Object.entries(t))r["$s_"+n]=s;return r}},8572:function(t,e){!function(t){"use strict";let s=-1;const u=e=>{addEventListener("pageshow",t=>{t.persisted&&(s=t.timeStamp,e(t))},!0)},a=(e,i,n,s)=>{let r,l;return t=>{i.value>=0&&(t||s)&&(l=i.value-(r??0),(l||void 0===r)&&(r=i.value,i.delta=l,i.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(i.value,n),e(i)))}},c=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},r=()=>{const t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},h=()=>{const t=r();return t?.activationStart??0},d=(t,e=-1)=>{const i=r();let n="navigate";s>=0?n="back-forward-cache":i&&(document.prerendering||h()>0?n="prerender":document.wasDiscarded?n="restore":i.type&&(n=i.type.replace(/_/g,"-")));return{name:t,value:e,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:n}},i=new WeakMap;function v(t,e){return i.get(t)||i.set(t,new e),i.get(t)}class o{t;i=0;o=[];h(t){if(t.hadRecentInput)return;const e=this.o[0],i=this.o.at(-1);this.i&&e&&i&&t.startTime-i.startTime<1e3&&t.startTime-e.startTime<5e3?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),this.t?.(t)}}const f=(t,e,i={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const n=new PerformanceObserver(t=>{Promise.resolve().then(()=>{e(t.getEntries())})});return n.observe({type:t,buffered:!0,...i}),n}}catch{}},g=t=>{let e=!1;return()=>{e||(t(),e=!0)}};let n=-1;const l=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,e=t=>{"hidden"===document.visibilityState&&n>-1&&(n="visibilitychange"===t.type?t.timeStamp:0,b())},_=()=>{addEventListener("visibilitychange",e,!0),addEventListener("prerenderingchange",e,!0)},b=()=>{removeEventListener("visibilitychange",e,!0),removeEventListener("prerenderingchange",e,!0)},p=()=>{if(n<0){const e=h(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>"hidden"===t.name&&t.startTime>e)[0]?.startTime;n=t??l(),_(),u(()=>{setTimeout(()=>{n=l(),_()})})}return{get firstHiddenTime(){return n}}},m=t=>{document.prerendering?addEventListener("prerenderingchange",()=>t(),!0):t()},y=[1800,3e3],O=(e,l={})=>{m(()=>{const i=p();let n,s=d("FCP");const r=f("paint",t=>{for(const e of t)"first-contentful-paint"===e.name&&(r.disconnect(),e.startTime<i.firstHiddenTime&&(s.value=Math.max(e.startTime-h(),0),s.entries.push(e),n(!0)))});r&&(n=a(e,s,y,l.reportAllChanges),u(t=>{s=d("FCP"),n=a(e,s,y,l.reportAllChanges),c(()=>{s.value=performance.now()-t.timeStamp,n(!0)})}))})},j=[.1,.25];let S=0,w=1/0,E=0;const k=t=>{for(const e of t)e.interactionId&&(w=Math.min(w,e.interactionId),E=Math.max(E,e.interactionId),S=E?(E-w)/7+1:0)};let T;const M=()=>T?S:performance.interactionCount??0,D=()=>{"interactionCount"in performance||T||(T=f("event",k,{type:"event",buffered:!0,durationThreshold:0}))};let C=0;class P{u=[];l=new Map;m;p;v(){C=M(),this.u.length=0,this.l.clear()}T(){const t=Math.min(this.u.length-1,Math.floor((M()-C)/50));return this.u[t]}h(t){if(this.m?.(t),!t.interactionId&&"first-input"!==t.entryType)return;const e=this.u.at(-1);let i=this.l.get(t.interactionId);if(i||this.u.length<10||t.duration>e.P){if(i?t.duration>i.P?(i.entries=[t],i.P=t.duration):t.duration===i.P&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(i={id:t.interactionId,entries:[t],P:t.duration},this.l.set(i.id,i),this.u.push(i)),this.u.sort((t,e)=>e.P-t.P),this.u.length>10){const t=this.u.splice(10);for(const e of t)this.l.delete(e.id)}this.p?.(i)}}}const I=t=>{const e=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?t():(t=g(t),document.addEventListener("visibilitychange",t,{once:!0}),e(()=>{t(),document.removeEventListener("visibilitychange",t)}))},R=[200,500];class L{m;h(t){this.m?.(t)}}const x=[2500,4e3],A=[800,1800],N=t=>{document.prerendering?m(()=>N(t)):"complete"!==document.readyState?addEventListener("load",()=>N(t),!0):setTimeout(t)};t.CLSThresholds=j,t.FCPThresholds=y,t.INPThresholds=R,t.LCPThresholds=x,t.TTFBThresholds=A,t.onCLS=(r,l={})=>{O(g(()=>{let i,n=d("CLS",0);const s=v(l,o),t=t=>{for(const e of t)s.h(e);s.i>n.value&&(n.value=s.i,n.entries=s.o,i())},e=f("layout-shift",t);e&&(i=a(r,n,j,l.reportAllChanges),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&(t(e.takeRecords()),i(!0))}),u(()=>{s.i=0,n=d("CLS",0),i=a(r,n,j,l.reportAllChanges),c(()=>i())}),setTimeout(i))}))},t.onFCP=O,t.onINP=(r,l={})=>{globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype&&m(()=>{D();let i,n=d("INP");const s=v(l,P),t=e=>{I(()=>{for(const t of e)s.h(t);const t=s.T();t&&t.P!==n.value&&(n.value=t.P,n.entries=t.entries,i())})},e=f("event",t,{durationThreshold:l.durationThreshold??40});i=a(r,n,R,l.reportAllChanges),e&&(e.observe({type:"first-input",buffered:!0}),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&(t(e.takeRecords()),i(!0))}),u(()=>{s.v(),n=d("INP"),i=a(r,n,R,l.reportAllChanges)}))})},t.onLCP=(l,o={})=>{m(()=>{const e=p();let i,n=d("LCP");const s=v(o,L),t=t=>{o.reportAllChanges||(t=t.slice(-1));for(const o of t)s.h(o),o.startTime<e.firstHiddenTime&&(n.value=Math.max(o.startTime-h(),0),n.entries=[o],i())},r=f("largest-contentful-paint",t);if(r){i=a(l,n,x,o.reportAllChanges);const e=g(()=>{t(r.takeRecords()),r.disconnect(),i(!0)});for(const l of["keydown","click","visibilitychange"])addEventListener(l,()=>I(e),{capture:!0,once:!0});u(t=>{n=d("LCP"),i=a(l,n,x,o.reportAllChanges),c(()=>{n.value=performance.now()-t.timeStamp,i(!0)})})}})},t.onTTFB=(e,i={})=>{let n=d("TTFB"),s=a(e,n,A,i.reportAllChanges);N(()=>{const t=r();t&&(n.value=Math.max(t.responseStart-h(),0),n.entries=[t],s(!0),u(()=>{n=d("TTFB",0),s=a(e,n,A,i.reportAllChanges),s(!0)}))})}}(e)}},n={},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),l={},(()=>{"use strict";var t=l,e=r(6914);const i=r(3447),n=r(1964);var s=r(2016),e=(0,e.l)();t.default=e,s.AutoInit.attempt(({client:t})=>{new i.SessionReplay(t),new n.AutoCapture(t)})})(),l.default;function r(t){var e=n[t];return void 0!==e||(e=n[t]={exports:{}},i[t].call(e.exports,e,e.exports,r)),e.exports}var i,n,l});
9
+ !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=>{return i={3331:t=>{"use strict";t.exports=e},1845:(t,i,e)=>{"use strict";var n;Object.defineProperty(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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},694:function(t,e,i){"use strict";var s=this&&this.__awaiter||$A();Object.defineProperty(e,"__esModule",{value:!0}),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,Object.assign(Object.assign({},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"))?Object.assign(Object.assign({},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=Object.assign(Object.assign({},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)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.Diagnostics=void 0;const n=new Map,i="start";function s(t,e,i,n){return Object.assign({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){"use strict";var i=this&&this.__awaiter||$A();Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},5542:function(t,o,e){"use strict";var i=this&&this.__awaiter||$A();Object.defineProperty(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=Object.assign({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)},Object.assign(Object.assign({},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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},2417:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},7770:function(t,e,i){"use strict";var n=this&&this.__awaiter||$A();Object.defineProperty(e,"__esModule",{value:!0}),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=Object.assign({},t.user),delete t.user.privateAttributes);var e={},i=this.Ft(),i=(i&&(e.statsigMetadata={currentPage:i}),Object.assign(Object.assign({},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:Object.assign({},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)=>{"use strict";Object.defineProperty(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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},7512:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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){"use strict";var y=this&&this.__awaiter||$A();Object.defineProperty(e,"__esModule",{value:!0}),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),E=i(2397),k=500,T=3e4;const M=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!!D(t)&&(t=this.Ht("POST",t),e=this.Xt(t),(i=navigator).sendBeacon.bind(i)(e,t.body))}post(e){return y(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(m){return y(this,void 0,void 0,function*(){var e;if(!D(m))return null;if(this.Jt.preventAllNetworkTraffic)return null;var{method:i,body:n,retries:s,attempt:r}=m,l=m.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(m);let a=null;var c,h=(0,E.Rt)();try{var d,v,f,g={method:i,body:n,headers:Object.assign({},m.headers),signal:null===o||void 0===o?void 0:o.signal,priority:m.priority,keepalive:h},_=(c=r,(p=m).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(),C(m,a,r,f),this.Wt.tryBumpExpiryTime(m.sdkKey,m.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=(C(m,a,r,"",t),yield this.Wt.tryFetchUpdatedFallbackInfo(m.sdkKey,m.urlConfig,n,h));return(p&&(m.fallbackUrl=this.Wt.getActiveFallbackUrl(m.sdkKey,m.urlConfig)),!s||s<r||!M.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:m}),_=`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 y(this,void 0,void 0,function*(){yield new Promise(t=>setTimeout(t,Math.min(k*(e*e),T)))})}(r),this.Zt(Object.assign(Object.assign({},m),{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=Object.assign({[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=Object.assign(Object.assign({},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 y(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=Object.assign(Object.assign({},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=Object.assign(Object.assign({},e),{method:t,fallbackUrl:i});return"data"in e&&r(t,e.data),t}};const D=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(Object.assign(Object.assign({},e),{statsigMetadata:Object.assign(Object.assign({},a.StatsigMetadataProvider.get()),{stableID:s,sessionID:r,sdkType:i,fallbackUrl:n})}))};function C(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){"use strict";var o=this&&this.__awaiter||$A();Object.defineProperty(e,"__esModule",{value:!0}),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,Object.assign(Object.assign({},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=Object.assign(Object.assign({},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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1361:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},3091:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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){"use strict";var n=this&&this.__awaiter||$A();Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorTag=void 0,e.ErrorTag={NetworkError:"NetworkError"}},3206:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DataAdapterCachePrefix=void 0,e.DataAdapterCachePrefix="statsig.cached"},1637:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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=Object.assign(Object.assign({},i),t)}}},586:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},2059:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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 Object.assign(Object.assign({},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 Object.assign(Object.assign({},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),Object.assign(Object.assign({},t),{groupName:null!=(e=null==i?void 0:i.group_name)?e:null})},e.ke=function(t,e,i,n){return Object.assign(Object.assign({},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 Object.assign(Object.assign(Object.assign({},t),e),{get:r(t.name,i,n)})},e.we=r},1812:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},3932:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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){"use strict";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]}}),Object.defineProperty(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=(Object.defineProperty(e,"__esModule",{value:!0}),e.Storage=e.Log=e.EventLogger=e.Diagnostics=void 0,i(1845),i(1845));const l=i(8962),o=(Object.defineProperty(e,"Diagnostics",{enumerable:!0,get:function(){return l.Diagnostics}}),i(7770)),u=(Object.defineProperty(e,"EventLogger",{enumerable:!0,get:function(){return o.EventLogger}}),i(7512));Object.defineProperty(e,"Log",{enumerable:!0,get:function(){return u.Log}});var a=i(8e3);const c=i(4534);Object.defineProperty(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),Object.assign((0,r.l)(),{Log:u.Log,SDK_VERSION:a.SDK_VERSION})},2016:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AutoInit=void 0;const p=i(6914),m=i(2018);function y(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=y("sdkKey",c))?i:y("apiKey",c);if(h){var d={},v=y("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 m.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 m.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 Object.assign(Object.assign({},e),{customIDs:Object.assign({},n),custom:Object.assign(Object.assign({},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)}}}},7262:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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=Object.assign(Object.assign(Object.assign({},t),i),{feature_gates:Object.assign(Object.assign({},t.feature_gates),i.feature_gates),layer_configs:Object.assign(Object.assign({},t.layer_configs),i.layer_configs),dynamic_configs:Object.assign(Object.assign({},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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});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=Object.assign(Object.assign({},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),Object.assign(Object.assign({},e),{reason:i})}}},8448:function(t,e,i){"use strict";var u=this&&this.__awaiter||$A();Object.defineProperty(e,"__esModule",{value:!0});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=Object.assign(Object.assign({},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,Object.assign(Object.assign(Object.assign({},s),t),{deltasResponseRequested:!1}),r)})}}e.default=n},3583:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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){"use strict";var r=this&&this.__awaiter||$A();Object.defineProperty(e,"__esModule",{value:!0});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(Object.assign(Object.assign({},e),{user:this.He,time:Date.now()}))}updateUserWithAnalyticsOnlyMetadata(t){this.He=this.xi(Object.assign(Object.assign({},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=Object.assign(Object.assign({},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){"use strict";var r=this&&this.__awaiter||$A();Object.defineProperty(e,"__esModule",{value:!0}),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){"use strict";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]}}),Object.defineProperty(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=(Object.defineProperty(e,"__esModule",{value:!0}),e.StatsigClient=void 0,i(6914)),l=i(8198),s=(e.StatsigClient=l.default,s(i(6914),e),Object.assign((0,r.l)(),{StatsigClient:l.default}));e.default=s},8788:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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=Object.assign(Object.assign({},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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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(Object.assign(Object.assign({},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?Object.assign(Object.assign({},t),{emit:e,checkoutEveryNms:3e4}):Object.assign(Object.assign({},t),{emit:e}))))}stop(){this.pi&&(this.pi(),this.pi=void 0)}isRecording(){return null!=this.pi}}},5967:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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=(Object.defineProperty(e,"SessionReplay",{enumerable:!0,get:function(){return s.SessionReplay}}),Object.defineProperty(e,"StatsigSessionReplayPlugin",{enumerable:!0,get:function(){return s.StatsigSessionReplayPlugin}}),Object.defineProperty(e,"runStatsigSessionReplay",{enumerable:!0,get:function(){return s.runStatsigSessionReplay}}),i(4069)),l=(Object.defineProperty(e,"forceStartRecording",{enumerable:!0,get:function(){return r.forceStartRecording}}),Object.defineProperty(e,"startRecording",{enumerable:!0,get:function(){return r.startRecording}}),Object.defineProperty(e,"stopRecording",{enumerable:!0,get:function(){return r.stopRecording}}),i(759)),o=(Object.defineProperty(e,"SessionReplayClient",{enumerable:!0,get:function(){return l.SessionReplayClient}}),i(3691));Object.defineProperty(e,"StatsigTriggeredSessionReplayPlugin",{enumerable:!0,get:function(){return o.StatsigTriggeredSessionReplayPlugin}}),Object.defineProperty(e,"runStatsigTriggeredSessionReplay",{enumerable:!0,get:function(){return o.runStatsigTriggeredSessionReplay}}),Object.assign((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})},4535:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AutoCapture=e.runStatsigAutoCapture=e.StatsigAutoCapturePlugin=void 0;const c=i(6914),r=i(5423),s=i(8872),l=i(7875),o=i(6714),u=i(4716),a=i(2678),h=i(5864),d=i(3769),v=i(9900),f={submit:r.AutoCaptureEventName.FORM_SUBMIT,click:r.AutoCaptureEventName.CLICK,copy:r.AutoCaptureEventName.COPY,cut:r.AutoCaptureEventName.COPY};function n(t,e){var i=t.getContext()["sdkKey"];if(!(0,c.kt)()){var n=null!=(n=(0,c.l)().acInstances)?n:{};if(n[i])return n[i]}return new g(t,e)}e.StatsigAutoCapturePlugin=class{constructor(t){this.m=t,this.__plugin="auto-capture"}bind(t){n(t,this.m)}},e.runStatsigAutoCapture=n;class g{constructor(t,e){this.tn=t,this.rn={},this.sn=null,this.Ei=!1,this.cr=!1;var{sdkKey:t,errorBoundary:i,values:n}=t.getContext(),i=(this.rn=null!=(n=null==(n=null==n?void 0:n.auto_capture_settings)?void 0:n.disabled_events)?n:{},this.$t=i,this.$t.wrap(this,"autoCapture:"),this.tn.$on("values_updated",()=>{var t=this.tn.getContext().values;this.rn=null!=(t=null==(t=null==t?void 0:t.auto_capture_settings)?void 0:t.disabled_events)?t:this.rn}),this.Vi=new o.EngagementManager,this.Gi=new u.default,this.hr=new a.WebVitalsManager(this.bn.bind(this),i),this.xs=new l.default(this.bn.bind(this),i),this.Ns=new s.ConsoleLogManager(this.bn.bind(this),i,null!=(n=null==e?void 0:e.consoleLogAutoCaptureSettings)?n:{enabled:!1}),this.ln=null==e?void 0:e.eventFilterFunc,(0,c.de)());(0,c.kt)()||((e=null!=(n=(__STATSIG__=(0,c.l)()).acInstances)?n:{})[t]=this,__STATSIG__.acInstances=e),"loading"===(null==i?void 0:i.readyState)?i.addEventListener("DOMContentLoaded",()=>this.qt()):this.qt()}un(){var t=(0,c.te)(),e=(0,c.de)();if(t&&e){const i=(t,e=!0)=>{t=t||(null==(t=(0,c.te)())?void 0:t.event);this.an(t),e&&this.Vi.bumpInactiveTimer(),"click"===t.type&&t instanceof MouseEvent&&this.Gi.isRageClick(t.clientX,t.clientY,Date.now())&&this.Bi(t)};(0,h.cn)(e,"click",t=>i(t)),(0,h.cn)(e,"submit",t=>i(t)),(0,h.cn)(e,"copy",t=>i(t)),(0,h.cn)(e,"cut",t=>i(t)),(0,h.cn)(t,"error",t=>i(t,!1)),(0,h.cn)(t,"pagehide",()=>this.Mi()),(0,h.cn)(t,"beforeunload",()=>this.Mi())}}vn(){var t=(0,c.te)(),e=(0,c.de)();t&&e&&((0,h.cn)(t,"popstate",()=>this.fn()),window.history.pushState=new Proxy(window.history.pushState,{apply:(t,e,[i,n,s])=>{t.apply(e,[i,n,s]),this.fn()}}),window.history.replaceState=new Proxy(window.history.replaceState,{apply:(t,e,[i,n,s])=>{t.apply(e,[i,n,s]),this.fn()}}),this.fn())}an(t){var e=null==(e=t.type)?void 0:e.toLowerCase();if("error"===e&&t instanceof ErrorEvent)this._n(t);else{var i=(0,h.gn)(t);if(i){e=f[e];if(e){var n=e===r.AutoCaptureEventName.COPY;if((0,h.St)(t,i,n)){var s={};if(n){n=null==(n=null==(n=(0,c.te)())?void 0:n.getSelection())?void 0:n.toString();if(!n)return;s.selectedText=(0,h.Ls)(n);n=t.type||"clipboard";s.clipType=n}var{value:t,metadata:n}=(0,d.pn)(i),i=(Object.assign(s,n),(0,v.$i)((0,h.wn)()));this.bn(e,t,Object.assign(Object.assign({},i),s))}}}}}qt(){this.hr.startTracking(),this.xs.startTracking(),this.Ns.startTracking(),this.Vi.startInactivityTracking(()=>this.Mi(!0)),this.un(),this.vn(),this.mn(),this.yn()}_n(t){var e=(null==t?void 0:t.error)||{};let i=e;if("object"==typeof e)try{i=JSON.stringify(e)}catch(t){i="function"==typeof(null==e?void 0:e.toString)?e.toString():"Unknown Error"}this.bn(r.AutoCaptureEventName.ERROR,t.message,{message:t.message,filename:t.filename,lineno:t.lineno,colno:t.colno,error_str:i})}mn(){var t=this.On();try{this.jn(t)&&this.bn(r.AutoCaptureEventName.SESSION_START,(0,h.Sn)(),Object.assign({sessionID:t.data.sessionID},(0,v.$i)((0,h.wn)())),{flushImmediately:!0})}catch(t){this.$t.logError("AC::logSession",t)}}fn(){var t=(0,h.wn)(),e=this.sn;e&&t.href===e.href||(this.Vi.setLastPageViewTime(Date.now()),e=(this.Ei=!1,v.$i)(t),this.sn&&(e.last_page_view_url=this.sn.href),this.cr||(this.dr(),this.cr=!0),this.bn(r.AutoCaptureEventName.PAGE_VIEW,(0,h.Sn)(),e,{flushImmediately:!0,addNewSessionMetadata:!0}),this.sn=t,this.Vi.bumpInactiveTimer())}Mi(t=!1){var e,i;this.Ei||(this.Ei=!0,e=this.Vi.getScrollMetrics(),i=this.Vi.getPageViewLength(),this.bn(r.AutoCaptureEventName.PAGE_VIEW_END,(0,h.Sn)(),Object.assign(Object.assign({},e),{pageViewLength:i,dueToInactivity:t}),{flushImmediately:!0}))}Bi(t){var{value:e,metadata:i}=(0,d.pn)(t.target);this.bn(r.AutoCaptureEventName.RAGE_CLICK,e,Object.assign(Object.assign({x:t.clientX,y:t.clientY,timestamp:Date.now()},(0,v.$i)((0,h.wn)())),i))}yn(){const i=(0,c.te)();i&&i.performance&&void 0!==(null===i||void 0===i?void 0:i.performance)&&"function"==typeof i.performance.getEntriesByType&&"function"==typeof i.performance.getEntriesByName&&setTimeout(()=>{var t={},e=i.performance.getEntriesByType("navigation"),e=(e&&0<e.length&&e[0]instanceof PerformanceNavigationTiming&&(e=e[0],t.load_time_ms=e.duration,t.dom_interactive_time_ms=e.domInteractive-e.startTime,t.redirect_count=e.redirectCount,t.transfer_bytes=e.transferSize),i.performance.getEntriesByName("first-contentful-paint"));e&&0<e.length&&e[0]instanceof PerformancePaintTiming&&(t.first_contentful_paint_time_ms=e[0].startTime),this.bn(r.AutoCaptureEventName.PERFORMANCE,(0,h.Sn)(),Object.assign(Object.assign({},t),(0,v.Ji)()))},1)}bn(t,e,i,n){var s,r,l;if(e){var o=t.slice("auto_capture::".length);if(!this.rn[t]&&!this.rn[o]){o=this.On();try{var u=Object.assign({sessionID:o.data.sessionID,page_url:null!=(l=null==(r=null==(s=(0,c.te)())?void 0:s.location)?void 0:r.href)?l:""},i),a=(null!=n&&n.addNewSessionMetadata&&(u.isNewSession=String(this.jn(o))),{eventName:t,value:e,metadata:u});this.ln&&!this.ln(a)||(this.tn.logEvent(a),null!=n&&n.flushImmediately&&this.vr())}catch(t){this.$t.logError("AC::enqueue",t)}}}}dr(){var t=this.tn;t.ar=(0,v.gr)((0,h.wn)()),t.He=Object.assign(Object.assign({},t.He),{analyticsOnlyMetadata:Object.assign(Object.assign({},t.ar),t.He.analyticsOnlyMetadata)})}vr(){this.tn.flush().catch(t=>{c.Log.error(t)})}jn(t){return Math.abs(t.data.startTime-Date.now())<1e3}On(){return this.tn.getContext().session}static getAllMetadata(){return(0,v.$i)((0,h.wn)())}}e.AutoCapture=g},5423:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AutoCaptureEventName=void 0,e.AutoCaptureEventName={PAGE_VIEW:"auto_capture::page_view",PAGE_VIEW_END:"auto_capture::page_view_end",ERROR:"auto_capture::error",SESSION_START:"auto_capture::session_start",PERFORMANCE:"auto_capture::performance",FORM_SUBMIT:"auto_capture::form_submit",CLICK:"auto_capture::click",RAGE_CLICK:"auto_capture::rage_click",WEB_VITALS:"auto_capture::web_vitals",DEAD_CLICK:"auto_capture::dead_click",COPY:"auto_capture::copy",CONSOLE_LOG:"statsig::log_line"}},8872:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ConsoleLogManager=void 0;const n=i(6914),s=i(5423),o=i(5864),r=i(9900),u={trace:10,debug:20,log:30,info:30,warn:40,error:50};e.ConsoleLogManager=class{constructor(t,e,i){this._r=t,this.$t=e,this.m=i,this.Ps=[],this.Us=!1,this.Fs="info",this.__source="js-auto-capture",this.Fs=null!=(t=this.m.logLevel)?t:"info"}startTracking(){try{!this.Us&&this.m.enabled&&(0,n.te)()&&(this.Ks(),this.Us=!0)}catch(t){n.Log.error("Error starting console log tracking",t),this.$t.logError("autoCapture:ConsoleLogManager",t)}}stopTracking(){this.Us&&(this.Ps.forEach(t=>t()),this.Ps=[],this.Us=!1)}Ks(){Object.entries(u).forEach(([r,t])=>{if(!(t<u[this.Fs])&&console[r]){const l=console[r].bind(console);let s=!1;t=(0,o.wrapFunctionWithRestore)(console,r,n=>(...e)=>{if(n(...e),!s){s=!0;try{var t=e.map(t=>this.zs(t)),i=this.qs();this.Vs(r,t,i)}catch(t){l("console observer error:",t,...e),this.$t.logError("autoCapture:ConsoleLogManager",t)}finally{s=!1}}});this.Ps.push(t)}})}Vs(t,e,i){this.Bs()&&(t=Object.assign({status:"log"===t?"info":t,log_level:t,payload:e,trace:i,timestamp:Date.now(),source:this.__source},(0,r.$i)((0,o.wn)())),this._r(s.AutoCaptureEventName.CONSOLE_LOG,e.join(" "),t))}Bs(){return!this.m.sampleRate||"number"!=typeof this.m.sampleRate||this.m.sampleRate<=0||1<=this.m.sampleRate||Math.random()<this.m.sampleRate}zs(t){try{return"string"==typeof t?t:"object"==typeof t&&null!==t?JSON.stringify(t):String(t)}catch(t){return"[Unserializable]"}}qs(){var t,e;try{return null!=(e=null==(t=(new Error).stack)?void 0:t.split("\n").slice(2))?e:[]}catch(t){return[]}}}},7875:(t,i,e)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.DeadClickConfig=void 0;const l=e(6914),s=e(5423),r=e(5864),o=e(3769),u=e(9900);i.DeadClickConfig={CLICK_CHECK_TIMEOUT:1e3,SCROLL_DELAY_MS:100,SELECTION_CHANGE_DELAY_MS:100,MUTATION_DELAY_MS:2500,ABSOLUTE_DEAD_CLICK_TIMEOUT:2750};i.default=class{constructor(t,e){this._r=t,this.$t=e,this.$s=0,this.Gs=0,this.er=[],this.Js=i.DeadClickConfig,this.tr=(0,r.throttle)(()=>{const e=Date.now();this.er.forEach(t=>{t.scrollDelayMs||(t.scrollDelayMs=e-t.timestamp)})},50)}startTracking(){try{var t=(0,l.te)();t&&(t.addEventListener("click",t=>this.Ws(t),{capture:!0}),t.addEventListener("scroll",()=>this.tr(),{capture:!0,passive:!0}),t.addEventListener("selectionchange",()=>this.Ys()),this.Hs())}catch(t){l.Log.error("Error starting dead click tracking",t),this.$t.logError("autoCapture:DeadClickManager",t)}}Ws(t){var e,t=t.target;t&&(e={timestamp:Date.now(),eventTarget:t},r.interactiveElements.includes(null==(t=null==t?void 0:t.tagName)?void 0:t.toLowerCase())||this.er.push(e),this.er.length)&&!this.Qs&&(this.Qs=null==(t=(0,l.te)())?void 0:t.setTimeout(()=>{this.Xs()},this.Js.CLICK_CHECK_TIMEOUT))}Ys(){this.Gs=Date.now()}Hs(){var t=(0,l.de)();t&&(this.Zs=new MutationObserver(()=>{this.$s=Date.now()}),this.Zs.observe(t.body,{childList:!0,subtree:!0,attributes:!0,characterData:!0}))}Xs(){if(this.er.length){clearTimeout(this.Qs),this.Qs=void 0;var t=this.er;this.er=[];for(const r of t){this.jr(r);var e,i=null!=r.scrollDelayMs&&r.scrollDelayMs<this.Js.SCROLL_DELAY_MS,n=null!=r.selectionChangeDelayMs&&r.selectionChangeDelayMs<this.Js.SELECTION_CHANGE_DELAY_MS,s=null!=r.mutationDelayMs&&r.mutationDelayMs<this.Js.MUTATION_DELAY_MS;i||n||s||(i=null!=r.scrollDelayMs&&r.scrollDelayMs>this.Js.SCROLL_DELAY_MS,n=null!=r.selectionChangeDelayMs&&r.selectionChangeDelayMs>this.Js.SELECTION_CHANGE_DELAY_MS,s=null!=r.mutationDelayMs&&r.mutationDelayMs>this.Js.MUTATION_DELAY_MS,e=null!=r.absoluteDelayMs&&r.absoluteDelayMs>this.Js.ABSOLUTE_DEAD_CLICK_TIMEOUT,i||n||s||e?this.Sr(r,{scrollTimeout:i,selectionChangeTimeout:n,mutationTimeout:s,absoluteTimeout:e}):null!=r.absoluteDelayMs&&r.absoluteDelayMs<this.Js.ABSOLUTE_DEAD_CLICK_TIMEOUT&&this.er.push(r))}this.er.length&&!this.Qs&&(this.Qs=null==(t=(0,l.te)())?void 0:t.setTimeout(()=>{this.Xs()},this.Js.CLICK_CHECK_TIMEOUT))}}Sr(t,e){var{value:i,metadata:n}=(0,o.pn)(t.eventTarget);i&&this._r(s.AutoCaptureEventName.DEAD_CLICK,i,Object.assign(Object.assign(Object.assign(Object.assign({},n),e),(0,u.ur)((0,r.wn)())),{scrollDelayMs:t.scrollDelayMs,selectionChangeDelayMs:t.selectionChangeDelayMs,mutationDelayMs:t.mutationDelayMs,absoluteDelayMs:t.absoluteDelayMs}))}jr(t){!t.mutationDelayMs&&0<this.$s&&t.timestamp<=this.$s&&(t.mutationDelayMs=Date.now()-this.$s),!t.selectionChangeDelayMs&&0<this.Gs&&t.timestamp<=this.Gs&&(t.selectionChangeDelayMs=Date.now()-this.Gs),t.absoluteDelayMs=Date.now()-t.timestamp}}},6714:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EngagementManager=void 0;const n=i(6914);e.EngagementManager=class{constructor(){this.Wi=0,this.Yi=0,this.Qi=0,this.Hi=0,this.Xi=Date.now(),this.Ai=null,this.Zi=null,this.Zn()}Zn(){var t=(0,n.te)();t&&(t.addEventListener("scroll",()=>this.tr()),t.addEventListener("scrollend",()=>this.tr()),t.addEventListener("resize",()=>this.tr()))}tr(){var t,e=(0,n.te)(),i=(0,n.de)();e&&i&&(t=i.body.scrollHeight,i=e.scrollY||i.documentElement.scrollTop||0,e=e.innerHeight,this.Wi=i,this.Yi=Math.max(this.Yi,i),i=Math.min(100,Math.round((i+e)/t*100)),this.Qi=i,this.Hi=Math.max(this.Hi,i),this.bumpInactiveTimer())}getScrollMetrics(){return{lastScrollY:this.Wi,maxScrollY:this.Yi,lastScrollPercentage:this.Qi,maxScrollPercentage:this.Hi,scrollDepth:this.Hi}}getPageViewLength(){return Date.now()-this.Xi}setLastPageViewTime(t){this.Xi=t}startInactivityTracking(t){this.Zi=t}bumpInactiveTimer(){var t=(0,n.te)();t&&(this.Ai&&clearTimeout(this.Ai),this.Ai=t.setTimeout(()=>{this.Zi&&this.Zi()},6e5))}}},4716:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=class{constructor(){this.er=[]}isRageClick(t,e,i){this.er=this.er.filter(t=>i-t.timestamp<1e3);var n,s;return 0<this.er.length&&(n=this.er[this.er.length-1],s=t-n.x,n=e-n.y,!(Math.abs(s)+Math.abs(n)<=30))&&(this.er=[]),this.er.push({x:t,y:e,timestamp:i}),3<=this.er.length}}},2678:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WebVitalsManager=void 0;const n=i(8572),s=i(6914),r=i(5423),l=i(5864),o=["CLS","FCP","LCP","TTFB"];e.WebVitalsManager=class{constructor(t,e){this._r=t,this.$t=e,this.pr=!1,this.Er={url:(0,l.br)(),sanitizedUrl:(0,l.Sn)(),metrics:[],firstMetricTimestamp:void 0}}startTracking(){var t,e,i;try{this.pr||"https:"!==(i=null==(e=null==(t=(0,s.te)())?void 0:t.location)?void 0:e.protocol)&&"http:"!==i||((0,n.onCLS)(t=>this.mr(t)),(0,n.onFCP)(t=>this.mr(t)),(0,n.onLCP)(t=>this.mr(t)),(0,n.onTTFB)(t=>this.mr(t)),this.pr=!0)}catch(t){s.Log.error("Error starting web vitals tracking",t),this.$t.logError("autoCapture:WebVitalsManager",t)}}mr(t){var e;void 0===this.Er.firstMetricTimestamp&&(this.Er.firstMetricTimestamp=Date.now()),void 0!==t&&void 0!==(null==t?void 0:t.name)&&""!==(e=(0,l.br)())&&o.includes(t.name)&&(e!==this.Er.url&&(this.yr(),this.Er.url=e),this.Er.metrics.push({name:t.name,value:t.value,delta:t.delta,id:t.id}),this.Er.metrics.length===o.length)&&this.yr()}yr(){if(""!==this.Er.url&&0!==this.Er.metrics.length){const i={};this.Er.metrics.forEach(t=>{var e=t.name.toLowerCase();i[e+"_value"]=t.value,i[e+"_delta"]=t.delta,i[e+"_id"]=t.id}),this._r(r.AutoCaptureEventName.WEB_VITALS,this.Er.sanitizedUrl,Object.assign(Object.assign({},i),{first_metric_timestamp:this.Er.firstMetricTimestamp})),this.Er={url:(0,l.br)(),sanitizedUrl:(0,l.Sn)(),metrics:[],firstMetricTimestamp:void 0}}}}},1964:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StatsigAutoCapturePlugin=e.runStatsigAutoCapture=e.AutoCapture=e.AutoCaptureEventName=void 0;var n=i(6914);const s=i(4535);Object.defineProperty(e,"AutoCapture",{enumerable:!0,get:function(){return s.AutoCapture}}),Object.defineProperty(e,"StatsigAutoCapturePlugin",{enumerable:!0,get:function(){return s.StatsigAutoCapturePlugin}}),Object.defineProperty(e,"runStatsigAutoCapture",{enumerable:!0,get:function(){return s.runStatsigAutoCapture}});var r=i(5423),i=(Object.defineProperty(e,"AutoCaptureEventName",{enumerable:!0,get:function(){return r.AutoCaptureEventName}}),Object.assign((0,n.l)(),{AutoCapture:s.AutoCapture,runStatsigAutoCapture:s.runStatsigAutoCapture,StatsigAutoCapturePlugin:s.StatsigAutoCapturePlugin}));e.default=i},5864:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.wrapFunctionWithRestore=e.throttle=e.Ls=e.ir=e.nr=e.rr=e.kn=e.cn=e.Sn=e.br=e.wn=e.St=e.gn=e.sr=e.interactiveElements=void 0;const n=i(6914);const s=new RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$");const r=new RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$");function l(){var t=null!=(t=null==(t=null==(t=(0,n.te)())?void 0:t.location)?void 0:t.href)?t:"";let e;try{e=new URL(t)}catch(t){e=new URL("error:")}return e}function o(e){if(e){let t=e;for(;t;){var i=t.tagName.toLowerCase();if(["body","document"].includes(i))return null;if("a"===t.tagName.toLowerCase())return t;t=t.parentElement}}return null}e.interactiveElements=["button","a","input","select","textarea","form","select","label"],e.sr=function(t){return Object.fromEntries(Object.entries(t).filter(([,t])=>null!=t&&""!==t&&void 0!==t))},e.gn=function(t){if(!t)return null;let e=t.target||t.srcElement;return e&&e instanceof Element?e=3===e.nodeType?e.parentNode||null:e:null},e.St=function(t,e,i=!1){if(!t||!e||1!==e.nodeType)return!1;var n=e.tagName.toLowerCase(),s=t.type.toLowerCase();if(e.classList.contains("statsig-no-capture"))return!1;if(i)return!0;switch(n){case"html":return!1;case"form":return 0<=["submit"].indexOf(s);case"input":case"select":case"textarea":return 0<=["change","click"].indexOf(s);default:if("click"===s){if("button"===n)return!0;if(o(e))return!0}return!1}},e.wn=l,e.br=function(){var t=l().toString();return t.startsWith("error:")?"":t},e.Sn=function(){return(0,n.Gt)()||""},e.cn=function(t,e,i){t&&t.addEventListener&&t.addEventListener(e,i,!0)},e.kn=function(){var t=(0,n.te)();return t&&t.navigator&&t.navigator.connection||null},e.rr=function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return null}},e.nr=function(){try{return(new Date).getTimezoneOffset()}catch(t){return null}},e.ir=o,e.Ls=function(t){return t?t.replace(/<[^>]*>/g,"").trim().split(/(\s+)/).filter(t=>{return!s.test((t||"").replace(/[- ]/g,""))&&!r.test((t||"").replace(/[- ]/g,""))}).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255):null},e.throttle=function(i,n){let s=0;return function(...t){var e=Date.now();e-s>=n&&(s=e,i(...t))}},e.wrapFunctionWithRestore=function(t,e,i){const n=t[e];if("function"!=typeof n)return()=>{};try{var s=i(n);return Object.defineProperty(s,"__statsig_original__",{enumerable:!1,value:n}),t[e]=s,()=>{t[e]=n}}catch(t){return()=>{}}}},3769:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.lr=e.wr=e.pn=void 0;const n=i(6914),u=i(5864),s=1e3,r=100,l=50;function o(t,e){return t?t.length>e?t.substring(0,e)+"...":t:null}function a(t){var e={},i=Array.from(t.classList);return e.classList=0<i.length?i.slice(0,r):null,e.class=(o(t.getAttribute("class"),s)||"").replace(/\s+/g," ").trim(),e.id=o(t.getAttribute("id"),s),e.ariaLabel=o(t.getAttribute("aria-label"),s),e.selector=function(e){if(!e)return"";if(!e.parentNode){var i=e.tagName.toLowerCase();if(e.id)return"#"+e.id;let t=i;return e.className&&"string"==typeof e.className&&0<(i=e.className.trim().split(/\s+/)).length&&""!==i[0]&&(t+="."+i.join(".")),t}var t=[];let n=e,s=0;for(;n&&n.nodeType===Node.ELEMENT_NODE&&s<l;){var r=function(n){var t=n.tagName.toLowerCase();if(n.id)return"#"+n.id;let s=t;n.className&&"string"==typeof n.className&&0<(t=n.className.trim().split(/\s+/)).length&&""!==t[0]&&(s+="."+t.join("."));t=n.parentElement;if(t&&1<t.children.length){let t=1,e=1,i=n.previousElementSibling;for(;i;)t++,i.tagName===n.tagName&&e++,i=i.previousElementSibling;s+=`:nth-child(${t})`,(1<e||function(t){let e=t.nextElementSibling;for(;e;){if(e.tagName===t.tagName)return 1;e=e.nextElementSibling}return}(n))&&(s+=`:nth-of-type(${e})`)}return s}(n);if(t.unshift(r),n.id)break;if((n=n.parentElement)&&"body"===n.tagName.toLowerCase())break;s++}return t.join(" > ")}(t),e}e.pn=function(t){var e,i,n,s,r,l,o;return"input"===(l=t).tagName.toLowerCase()&&["button","checkbox","submit","reset"].includes(l.getAttribute("type")||"")||"textarea"===l.tagName.toLowerCase()||"select"===l.tagName.toLowerCase()||"true"===l.getAttribute("contenteditable")?{value:null,metadata:{}}:(l=t.tagName.toLowerCase(),e={},i=(0,u.Sn)()||"",e.tagName=l,r=a(t),Object.assign(e,r),"form"===l&&Object.assign(e,((r={}).action=(n=t).getAttribute("action"),r.method=null!=(s=n.getAttribute("method"))?s:"GET",r.formName=n.getAttribute("name"),r.formId=n.getAttribute("id"),r)),"input"===l&&Object.assign(e,((s={}).content=(n=t).value,s.inputName=n.getAttribute("name"),s)),(r=(0,u.ir)(t))&&Object.assign(e,((o={}).href=r.getAttribute("href"),o)),"button"!==l&&!r||Object.assign(e,((o={}).content=((l=r||t).textContent||"").trim(),l=function(t){var e={};if(t){var i=null==t?void 0:t.dataset;if(i)for(const n in i)e["data-"+n]=i[n]||""}return e}(l),Object.assign(o,l),o)),{value:i,metadata:e})},e.wr=function(t){var e=null==(e=null==(e=(0,n.te)())?void 0:e.getSelection())?void 0:e.toString(),i={},e=(i.selectedText=(0,u.Ls)(e),t.type||"clipboard");return i.clipType=e,i},e.lr=a},9900:(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.gr=e.Ji=e.$i=e.ur=void 0;const l=i(6914),o=i(5864);function r(t){var e=(0,l.de)(),i=(0,l.te)();return(0,o.sr)(Object.assign({title:null==e?void 0:e.title,current_url:null==(e=null==i?void 0:i.location)?void 0:e.href,user_agent:null!=(e=null==i?void 0:i.navigator)&&e.userAgent&&200<(null==(e=null==(e=null==i?void 0:i.navigator)?void 0:e.userAgent)?void 0:e.length)?i.navigator.userAgent.substring(0,200):null==(e=null==i?void 0:i.navigator)?void 0:e.userAgent,locale:null==(e=null==i?void 0:i.navigator)?void 0:e.language,hostname:t.hostname,pathname:t.pathname,screen_width:null==(e=null==i?void 0:i.screen)?void 0:e.width,screen_height:null==(t=null==i?void 0:i.screen)?void 0:t.height,viewport_width:null==i?void 0:i.innerWidth,viewport_height:null==i?void 0:i.innerHeight,viewport:`${null==i?void 0:i.innerWidth}x`+(null==i?void 0:i.innerHeight),timestamp:Date.now(),timezone:(0,o.rr)(),timezone_offset:(0,o.nr)()},n()))}function n(){var t=(0,o.kn)(),e={};return void 0!==(null==t?void 0:t.effectiveType)&&(e.effective_connection_type=t.effectiveType),void 0!==(null==t?void 0:t.rtt)&&(e.rtt_ms=t.rtt),void 0!==(null==t?void 0:t.downlink)&&(e.downlink_mbps=t.downlink,e.downlink_kbps=1e3*t.downlink),void 0!==(null==t?void 0:t.saveData)&&(e.save_data=t.saveData),e}function u(t){t=(null==t?void 0:t.referrer)||"";if(!t)return{referrer:null,referrer_domain:null,referrer_path:null,searchEngine:"",searchQuery:""};try{var e=new URL(t);const s=e.hostname;var i=["google","bing","yahoo","duckduckgo","baidu"].find(t=>s.includes(t+"."))||"",n=e.searchParams.get("yahoo"===i?"p":"q")||"";return{referrer:t,referrer_domain:e.hostname,referrer_path:e.pathname,searchEngine:i,searchQuery:n}}catch(t){return{referrer:null,referrer_domain:null,referrer_path:null,searchEngine:"",searchQuery:""}}}function a(t){const i=t.searchParams,n={};return["utm_source","utm_medium","utm_campaign","utm_term","utm_content","msclkid","dclid","fbclid","gad_source","gclid","gclsrc","wbraid","utm_id","irclid","igshid","_kx","li_fat_id","mc_cid","mc_eid","epik","qclid","rdt_cid","sccid","ttc","ttclid","ttc_id","twclid"].forEach(t=>{var e=i.get(t);e&&(n[t]=e)}),n}e.ur=r,e.$i=function(t){var e=(0,l.de)(),i=(0,l.te)();if(!e||!i)return{};var i=u(e),e=r(t),n=a(t);const s={};return t.searchParams.forEach((t,e)=>{s[e]=t}),Object.assign(Object.assign({},e),(0,o.sr)(Object.assign(Object.assign(Object.assign({},i),n),s)))},e.Ji=n,e.gr=function(t){var e=(0,l.de)(),i=(0,l.te)();if(!e||!i)return{};var n,s,i=u(e),e=a(t),t=(0,o.sr)(Object.assign(Object.assign({},i),e)),r={};for([n,s]of Object.entries(t))r["$s_"+n]=s;return r}},8572:function(t,e){!function(t){"use strict";let s=-1;const u=e=>{addEventListener("pageshow",t=>{t.persisted&&(s=t.timeStamp,e(t))},!0)},a=(e,i,n,s)=>{let r,l;return t=>{i.value>=0&&(t||s)&&(l=i.value-(r??0),(l||void 0===r)&&(r=i.value,i.delta=l,i.rating=((t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good")(i.value,n),e(i)))}},c=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},r=()=>{const t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},h=()=>{const t=r();return t?.activationStart??0},d=(t,e=-1)=>{const i=r();let n="navigate";s>=0?n="back-forward-cache":i&&(document.prerendering||h()>0?n="prerender":document.wasDiscarded?n="restore":i.type&&(n=i.type.replace(/_/g,"-")));return{name:t,value:e,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:n}},i=new WeakMap;function v(t,e){return i.get(t)||i.set(t,new e),i.get(t)}class o{t;i=0;o=[];h(t){if(t.hadRecentInput)return;const e=this.o[0],i=this.o.at(-1);this.i&&e&&i&&t.startTime-i.startTime<1e3&&t.startTime-e.startTime<5e3?(this.i+=t.value,this.o.push(t)):(this.i=t.value,this.o=[t]),this.t?.(t)}}const f=(t,e,i={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const n=new PerformanceObserver(t=>{Promise.resolve().then(()=>{e(t.getEntries())})});return n.observe({type:t,buffered:!0,...i}),n}}catch{}},g=t=>{let e=!1;return()=>{e||(t(),e=!0)}};let n=-1;const l=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,e=t=>{"hidden"===document.visibilityState&&n>-1&&(n="visibilitychange"===t.type?t.timeStamp:0,b())},_=()=>{addEventListener("visibilitychange",e,!0),addEventListener("prerenderingchange",e,!0)},b=()=>{removeEventListener("visibilitychange",e,!0),removeEventListener("prerenderingchange",e,!0)},p=()=>{if(n<0){const e=h(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>"hidden"===t.name&&t.startTime>e)[0]?.startTime;n=t??l(),_(),u(()=>{setTimeout(()=>{n=l(),_()})})}return{get firstHiddenTime(){return n}}},m=t=>{document.prerendering?addEventListener("prerenderingchange",()=>t(),!0):t()},y=[1800,3e3],O=(e,l={})=>{m(()=>{const i=p();let n,s=d("FCP");const r=f("paint",t=>{for(const e of t)"first-contentful-paint"===e.name&&(r.disconnect(),e.startTime<i.firstHiddenTime&&(s.value=Math.max(e.startTime-h(),0),s.entries.push(e),n(!0)))});r&&(n=a(e,s,y,l.reportAllChanges),u(t=>{s=d("FCP"),n=a(e,s,y,l.reportAllChanges),c(()=>{s.value=performance.now()-t.timeStamp,n(!0)})}))})},j=[.1,.25];let S=0,w=1/0,E=0;const k=t=>{for(const e of t)e.interactionId&&(w=Math.min(w,e.interactionId),E=Math.max(E,e.interactionId),S=E?(E-w)/7+1:0)};let T;const M=()=>T?S:performance.interactionCount??0,D=()=>{"interactionCount"in performance||T||(T=f("event",k,{type:"event",buffered:!0,durationThreshold:0}))};let C=0;class P{u=[];l=new Map;m;p;v(){C=M(),this.u.length=0,this.l.clear()}T(){const t=Math.min(this.u.length-1,Math.floor((M()-C)/50));return this.u[t]}h(t){if(this.m?.(t),!t.interactionId&&"first-input"!==t.entryType)return;const e=this.u.at(-1);let i=this.l.get(t.interactionId);if(i||this.u.length<10||t.duration>e.P){if(i?t.duration>i.P?(i.entries=[t],i.P=t.duration):t.duration===i.P&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(i={id:t.interactionId,entries:[t],P:t.duration},this.l.set(i.id,i),this.u.push(i)),this.u.sort((t,e)=>e.P-t.P),this.u.length>10){const t=this.u.splice(10);for(const e of t)this.l.delete(e.id)}this.p?.(i)}}}const I=t=>{const e=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?t():(t=g(t),document.addEventListener("visibilitychange",t,{once:!0}),e(()=>{t(),document.removeEventListener("visibilitychange",t)}))},R=[200,500];class L{m;h(t){this.m?.(t)}}const x=[2500,4e3],A=[800,1800],N=t=>{document.prerendering?m(()=>N(t)):"complete"!==document.readyState?addEventListener("load",()=>N(t),!0):setTimeout(t)};t.CLSThresholds=j,t.FCPThresholds=y,t.INPThresholds=R,t.LCPThresholds=x,t.TTFBThresholds=A,t.onCLS=(r,l={})=>{O(g(()=>{let i,n=d("CLS",0);const s=v(l,o),t=t=>{for(const e of t)s.h(e);s.i>n.value&&(n.value=s.i,n.entries=s.o,i())},e=f("layout-shift",t);e&&(i=a(r,n,j,l.reportAllChanges),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&(t(e.takeRecords()),i(!0))}),u(()=>{s.i=0,n=d("CLS",0),i=a(r,n,j,l.reportAllChanges),c(()=>i())}),setTimeout(i))}))},t.onFCP=O,t.onINP=(r,l={})=>{globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype&&m(()=>{D();let i,n=d("INP");const s=v(l,P),t=e=>{I(()=>{for(const t of e)s.h(t);const t=s.T();t&&t.P!==n.value&&(n.value=t.P,n.entries=t.entries,i())})},e=f("event",t,{durationThreshold:l.durationThreshold??40});i=a(r,n,R,l.reportAllChanges),e&&(e.observe({type:"first-input",buffered:!0}),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&(t(e.takeRecords()),i(!0))}),u(()=>{s.v(),n=d("INP"),i=a(r,n,R,l.reportAllChanges)}))})},t.onLCP=(l,o={})=>{m(()=>{const e=p();let i,n=d("LCP");const s=v(o,L),t=t=>{o.reportAllChanges||(t=t.slice(-1));for(const o of t)s.h(o),o.startTime<e.firstHiddenTime&&(n.value=Math.max(o.startTime-h(),0),n.entries=[o],i())},r=f("largest-contentful-paint",t);if(r){i=a(l,n,x,o.reportAllChanges);const e=g(()=>{t(r.takeRecords()),r.disconnect(),i(!0)});for(const l of["keydown","click","visibilitychange"])addEventListener(l,()=>I(e),{capture:!0,once:!0});u(t=>{n=d("LCP"),i=a(l,n,x,o.reportAllChanges),c(()=>{n.value=performance.now()-t.timeStamp,i(!0)})})}})},t.onTTFB=(e,i={})=>{let n=d("TTFB"),s=a(e,n,A,i.reportAllChanges);N(()=>{const t=r();t&&(n.value=Math.max(t.responseStart-h(),0),n.entries=[t],s(!0),u(()=>{n=d("TTFB",0),s=a(e,n,A,i.reportAllChanges),s(!0)}))})}}(e)}},n={},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),l={},(()=>{"use strict";var t=l,e=r(6914);const i=r(3447),n=r(1964);var s=r(2016),e=(0,e.l)();t.default=e,s.AutoInit.attempt(({client:t})=>{new i.SessionReplay(t),new n.AutoCapture(t)})})(),l.default;function r(t){var e=n[t];return void 0!==e||(e=n[t]={exports:{}},i[t].call(e.exports,e,e.exports,r)),e.exports}var i,n,l});