@statsig/js-client 3.30.2-beta.2 → 3.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
  !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)})))}))}}));
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Statsig=t():e.Statsig=t()}(this,()=>{return i={1845:(e,n,t)=>{"use strict";var i;Object.defineProperty(n,"__esModule",{value:!0}),n._getInstance=n._getStatsigGlobalFlag=n._getStatsigGlobal=void 0;const r=t(7512);n._getStatsigGlobal=()=>{try{return"undefined"!=typeof __STATSIG__?__STATSIG__:l}catch(e){return l}},n._getStatsigGlobalFlag=e=>(0,n._getStatsigGlobal)()[e];n._getInstance=e=>{var t=(0,n._getStatsigGlobal)();return e?t.instances&&t.instances[e]:(t.instances&&1<Object.keys(t.instances).length&&r.Log.warn("Call made to Statsig global instance without an SDK key but there is more than one client instance. If you are using mulitple clients, please specify the SDK key."),t.firstInstance)};var s="__STATSIG__",a="undefined"!=typeof window?window:{},t=void 0!==t.g?t.g:{},o="undefined"!=typeof globalThis?globalThis:{};const l=null!=(i=null!=(i=null!=(i=a[s])?i:t[s])?i:o[s])?i:{instance:n._getInstance};a[s]=l,t[s]=l,o[s]=l},7463:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BatchQueue=void 0;const r=n(1956),i=n(4309);t.BatchQueue=class{constructor(e=i.EventRetryConstants.DEFAULT_BATCH_SIZE){this._batches=[],this._batchSize=e}batchSize(){return this._batchSize}requeueBatch(e){return this._enqueueBatch(e)}hasFullBatch(){return this._batches.some(e=>e.events.length>=this._batchSize)}takeNextBatch(){var e;return null!=(e=this._batches.shift())?e:null}takeAllBatches(){var e=this._batches;return this._batches=[],e}createBatches(e){let t=0,n=0;for(;t<e.length;){var i=e.slice(t,t+this._batchSize);n+=this._enqueueBatch(new r.EventBatch(i)),t+=this._batchSize}return n}_enqueueBatch(e){this._batches.push(e);let t=0;for(;this._batches.length>i.EventRetryConstants.MAX_PENDING_BATCHES;){var n=this._batches.shift();n&&(t+=n.events.length)}return t}}},2137:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._getStorageKey=t._getUserStorageKey=void 0;const r=n(1406);function i(e,t,n){if(n)return n(e,t);const i=t&&t.customIDs?t.customIDs:{};t=["uid:"+(null!=(n=null==t?void 0:t.userID)?n:""),"cids:"+Object.keys(i).sort((e,t)=>e.localeCompare(t)).map(e=>e+"-"+i[e]).join(","),"k:"+e];return(0,r._DJB2)(t.join("|"))}t._getUserStorageKey=i,t._getStorageKey=function(e,t,n){return t?i(e,t,n):(0,r._DJB2)("k:"+e)}},6427:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},694:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,a,o,l){return new(o=o||Promise)(function(n,t){function i(e){try{s(l.next(e))}catch(e){t(e)}}function r(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?n(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(i,r)}s((l=l.apply(e,a||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t._makeDataAdapterResult=t.DataAdapterCore=void 0;const l=n(7512),u=n(9122),s=n(8578),a=n(4534),c=n(3401);function d(e,t,n,i){return{source:e,data:t,receivedAt:Date.now(),stableID:n,fullUserHash:(0,s._getFullUserHash)(i)}}t.DataAdapterCore=class{constructor(e,t){this._adapterName=e,this._cacheSuffix=t,this._options=null,this._sdkKey=null,this._cacheLimit=10,this._lastModifiedStoreKey="statsig.last_modified_time."+t,this._inMemoryCache=new i}attach(e,t,n){this._sdkKey=e,this._options=t}getDataSync(e){var e=e&&(0,s._normalizeUser)(e,this._options),t=this._getCacheKey(e),n=this._inMemoryCache.get(t,e);return n&&this._getIsCacheValueValid(n)?n:(n=this._loadFromCache(t))&&this._getIsCacheValueValid(n)?(this._inMemoryCache.add(t,n,this._cacheLimit),this._inMemoryCache.get(t,e)):null}setData(e,t){var t=t&&(0,s._normalizeUser)(t,this._options),n=this._getCacheKey(t);this._inMemoryCache.add(n,d("Bootstrap",e,null,t),this._cacheLimit)}_getIsCacheValueValid(e){return null==e.stableID||e.stableID===u.StableID.get(this._getSdkKey())}_getDataAsyncImpl(t,n,i){return r(this,void 0,void 0,function*(){a.Storage.isReady()||(yield a.Storage.isReadyResolver());var e=null!=t?t:this.getDataSync(n),e=[this._fetchAndPrepFromNetwork(e,n,i)];return null!=i&&i.timeoutMs&&e.push(new Promise(e=>setTimeout(e,i.timeoutMs)).then(()=>(l.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(e)})}_prefetchDataImpl(n,i){return r(this,void 0,void 0,function*(){var e=n&&(0,s._normalizeUser)(n,this._options),t=this._getCacheKey(e),e=yield this._getDataAsyncImpl(null,e,i);e&&this._inMemoryCache.add(t,Object.assign(Object.assign({},e),{source:"Prefetch"}),this._cacheLimit)})}_fetchAndPrepFromNetwork(s,a,o){return r(this,void 0,void 0,function*(){var e=null!=(e=null==s?void 0:s.data)?e:null,t=null!=s&&this._isCachedResultValidFor204(s,a),t=yield this._fetchFromNetwork(e,a,o,t);if(!t)return l.Log.debug("No response returned for latest value"),null;var n=(0,c._typedJsonParse)(t,"has_updates","Response"),i=this._getSdkKey(),i=u.StableID.get(i);let r=null;if(!0===(null==n?void 0:n.has_updates))r=d("Network",t,i,a);else{if(!e||!1!==(null==n?void 0:n.has_updates))return null;r=d("NetworkNotModified",e,i,a)}t=this._getCacheKey(a);return this._inMemoryCache.add(t,r,this._cacheLimit),this._writeToCache(t,r),r})}_getSdkKey(){return null!=this._sdkKey?this._sdkKey:(l.Log.error(this._adapterName+" is not attached to a Client"),"")}_loadFromCache(e){var t=null==(t=a.Storage.getItem)?void 0:t.call(a.Storage,e);return null!=t&&(e=(0,c._typedJsonParse)(t,"source","Cached Result"))?Object.assign(Object.assign({},e),{source:"Cache"}):null}_writeToCache(t,e){var n=JSON.stringify(e);for(let e=0;e<8;e++)try{a.Storage.setItem(t,n);break}catch(e){if(!(e instanceof Error)||!e.toString().includes("QuotaExceededError")&&!e.toString().includes("QUOTA_EXCEEDED_ERR")||this._cacheLimit<=1)throw e;this._cacheLimit=Math.ceil(this._cacheLimit/2),this._runLocalStorageCacheEviction(t,this._cacheLimit-1)}this._runLocalStorageCacheEviction(t)}_runLocalStorageCacheEviction(e,t=this._cacheLimit){var n=null!=(i=(0,a._getObjectFromStorage)(this._lastModifiedStoreKey))?i:{},i=(n[e]=Date.now(),o(n,t));for(const r of i)delete n[r],a.Storage.removeItem(r);(0,a._setObjectInStorage)(this._lastModifiedStoreKey,n)}},t._makeDataAdapterResult=d;class i{constructor(){this._data={}}get(e,t){var e=this._data[e],n=null==e?void 0:e.stableID,t=null==(t=null==t?void 0:t.customIDs)?void 0:t.stableID;return t&&n&&t!==n?(l.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):e}add(e,t,n){for(const i of o(this._data,n-1))delete this._data[i];this._data[e]=t}merge(e){this._data=Object.assign(Object.assign({},this._data),e)}}function o(n,e){var t=Object.keys(n);return t.length<=e?[]:0===e?t:t.sort((e,t)=>{e=n[e],t=n[t];return"object"==typeof e&&"object"==typeof t?e.receivedAt-t.receivedAt:e-t}).slice(0,t.length-e)}},8962:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.Diagnostics=void 0;const i=new Map,n="start";function r(e,t,n,i){return Object.assign({key:n,action:t,step:i,timestamp:Date.now()},e)}function s(e,t){var n=null!=(n=i.get(e))?n:[];n.push(t),i.set(e,n)}function t(e,t){if(t in e)return e[t]}a.Diagnostics={_getMarkers:e=>i.get(e),_markInitOverallStart:e=>{s(e,r({},n,"overall"))},_markInitOverallEnd:(e,t,n)=>{s(e,r({success:t,error:t?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:n},"end","overall"))},_markInitNetworkReqStart:(e,t)=>{s(e,r(t,n,"initialize","network_request"))},_markInitNetworkReqEnd:(e,t)=>{s(e,r(t,"end","initialize","network_request"))},_markInitProcessStart:e=>{s(e,r({},n,"initialize","process"))},_markInitProcessEnd:(e,t)=>{s(e,r(t,"end","initialize","process"))},_clearMarkers:e=>{i.delete(e)},_formatError(e){if(e&&"object"==typeof e)return{code:t(e,"code"),name:t(e,"name"),message:t(e,"message")}},_getDiagnosticsData(e,t,n,i){return{success:!0===(null==e?void 0:e.ok),statusCode:null==e?void 0:e.status,sdkRegion:null==(e=null==e?void 0:e.headers)?void 0:e.get("x-statsig-region"),isDelta:!0===n.includes('"is_delta":true')||void 0,attempt:t,error:a.Diagnostics._formatError(i)}},_enqueueDiagnosticsEvent(e,t,n,i){var r,s=a.Diagnostics._getMarkers(n);return null==s||s.length<=0?-1:(r=s[s.length-1].timestamp-s[0].timestamp,a.Diagnostics._clearMarkers(n),n=function(e,t){e={eventName:"statsig::diagnostics",user:e,value:null,metadata:t,time:Date.now()};return e}(e,{context:"initialize",markers:s.slice(),statsigOptions:i}),t.enqueue(n),r)}}},8809:function(e,t){"use strict";var n=this&&this.__awaiter||function(e,a,o,l){return new(o=o||Promise)(function(n,t){function i(e){try{s(l.next(e))}catch(e){t(e)}}function r(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?n(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(i,r)}s((l=l.apply(e,a||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t._fetchTxtRecords=void 0;const r=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]),s="https://cloudflare-dns.com/dns-query",a=["i","e","d"],o=200;t._fetchTxtRecords=function(t){return n(this,void 0,void 0,function*(){var n=yield t(s,{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:r});if(n.ok){var e,n=yield n.arrayBuffer(),n=new Uint8Array(n);{var i=n,n=i.findIndex((e,t)=>t<o&&"="===String.fromCharCode(e)&&a.includes(String.fromCharCode(i[t-1])));if(-1===n)throw(e=new Error("Failed to parse TXT records from DNS")).name="DnsTxtParseError",e;let t="";for(let e=n-1;e<i.length;e++)t+=String.fromCharCode(i[e]);return t.split(",")}}throw(e=new Error("Failed to fetch TXT records from DNS")).name="DnsTxtFetchError",e})}},3539:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5542:function(e,u,t){"use strict";var n=this&&this.__awaiter||function(e,a,o,l){return new(o=o||Promise)(function(n,t){function i(e){try{s(l.next(e))}catch(e){t(e)}}function r(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?n(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(i,r)}s((l=l.apply(e,a||[])).next())})};Object.defineProperty(u,"__esModule",{value:!0}),u.ErrorBoundary=u.EXCEPTION_ENDPOINT=void 0;const i=t(7512),c=t(5902),d=t(8e3),h=(u.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception","[Statsig] UnknownError");function _(e){return e instanceof Error?e:"string"==typeof e?new Error(e):new Error("An unknown error occurred.")}u.ErrorBoundary=class{constructor(e,t,n,i){this._sdkKey=e,this._options=t,this._emitter=n,this._lastSeenError=i,this._seen=new Set}wrap(i,r){try{const e=i;!function(e){const t=new Set;let n=Object.getPrototypeOf(e);for(;n&&n!==Object.prototype;)Object.getOwnPropertyNames(n).filter(e=>"function"==typeof(null===n||void 0===n?void 0:n[e])).forEach(e=>t.add(e)),n=Object.getPrototypeOf(n);return Array.from(t)}(e).forEach(t=>{const n=e[t];"$EB"in n||(e[t]=(...e)=>this._capture(r?r+":"+t:t,()=>n.apply(i,e)),e[t].$EB=!0)})}catch(e){this._onError("eb:wrap",e)}}logError(e,t){this._onError(e,t)}logDroppedEvents(e,t,n){const i={eventCount:String(e)};n&&Object.entries(n).forEach(([e,t])=>{i[e]=String(t)}),this._onError("statsig::log_event_dropped_event_count",new Error(t),!0,i)}logEventRequestFailure(e,t,n,i){e={eventCount:String(e),flushType:n,statusCode:String(i)};this._onError("statsig::log_event_failed",new Error(t),!0,e)}getLastSeenErrorAndReset(){var e=this._lastSeenError;return this._lastSeenError=void 0,null!=e?e:null}attachErrorIfNoneExists(e){this._lastSeenError||(this._lastSeenError=_(e))}_capture(t,e){try{var n=e();return n&&n instanceof Promise?n.catch(e=>this._onError(t,e)):n}catch(e){return this._onError(t,e),null}}_onError(s,a,o=!1,l){try{i.Log.warn("Caught error in "+s,{error:a});n(this,void 0,void 0,function*(){var e,t=a||Error(h),n=t instanceof Error,i=n?t.name:"No Name",r=_(t);this._lastSeenError=r,!o&&this._seen.has(i)||(this._seen.add(i),null!=(r=null==(r=this._options)?void 0:r.networkConfig)&&r.preventAllNetworkTraffic?null!=(r=this._emitter)&&r.call(this,{name:"error",error:a,tag:s}):(r=c.SDKType._get(this._sdkKey),e=d.StatsigMetadataProvider.get(),n=n?t.stack:function(e){try{return JSON.stringify(e)}catch(e){return h}}(t),t=Object.assign({tag:s,exception:i,info:n,extra:l,statsigOptions:function(i){if(!i)return{};const r={};return Object.keys(i).forEach(e=>{var t=e,n=i[t];switch(typeof n){case"number":case"bigint":case"boolean":r[String(t)]=n;break;case"string":n.length<50?r[String(t)]=n:r[String(t)]="set";break;case"object":"environment"===t?r.environment=n:"networkConfig"===t?r.networkConfig=n:r[String(t)]=null!=n?"set":"unset"}}),r}(this._options)},Object.assign(Object.assign({},e),{sdkType:r})),yield(null!=(i=null==(n=null==(i=this._options)?void 0:i.networkConfig)?void 0:n.networkOverrideFunc)?i:fetch)(u.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this._sdkKey,"STATSIG-SDK-TYPE":String(r),"STATSIG-SDK-VERSION":String(e.sdkVersion),"Content-Type":"application/json"},body:JSON.stringify(t)}),null!=(n=this._emitter)&&n.call(this,{name:"error",error:a,tag:s})))}).then(()=>{}).catch(()=>{})}catch(e){}}}},2922:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2417:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1956:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventBatch=void 0;t.EventBatch=class{constructor(e){this.attempts=0,this.createdAt=Date.now(),this.events=e}incrementAttempts(){this.attempts++}}},7770:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,a,o,l){return new(o=o||Promise)(function(n,t){function i(e){try{s(l.next(e))}catch(e){t(e)}}function r(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?n(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(i,r)}s((l=l.apply(e,a||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.EventLogger=void 0;const s=n(7463),r=n(2137),a=n(4309),o=n(4312),l=n(1406),u=n(7512),c=n(7410),d=n(1228),h=n(6830),_=n(1637),g=n(586),v=n(4534),f=n(1881),p=n(2397),m={};class y{static _safeFlushAndForget(e){null!=(e=m[e])&&e.flush().catch(()=>{})}constructor(e,t,n,i,r){this._sdkKey=e,this._emitter=t,this._network=n,this._options=i,this._errorBoundary=r,this._lastExposureTimeMap={},this._nonExposedChecks={},this._isShuttingDown=!1,this._storageKey=null,this._loggingEnabled=null!=(e=null==i?void 0:i.loggingEnabled)?e:!0===(null==i?void 0:i.disableLogging)?g.LoggingEnabledOption.disabled:g.LoggingEnabledOption.browserOnly,null!=i&&i.loggingEnabled&&void 0!==i.disableLogging&&u.Log.warn("Detected both loggingEnabled and disableLogging options. loggingEnabled takes precedence - please remove disableLogging.");t=null==i?void 0:i.networkConfig,this._logEventUrlConfig=new f.UrlConfiguration(c.Endpoint._rgstr,null==t?void 0:t.logEventUrl,null==t?void 0:t.api,null==t?void 0:t.logEventFallbackUrls),r=null!=(n=null==i?void 0:i.loggingBufferMaxSize)?n:a.EventRetryConstants.DEFAULT_BATCH_SIZE;this._pendingEvents=new d.PendingEvents(r),this._batchQueue=new s.BatchQueue(r),this._flushCoordinator=new o.FlushCoordinator(this._batchQueue,this._pendingEvents,()=>this.appendAndResetNonExposedChecks(),this._sdkKey,this._network,this._emitter,this._logEventUrlConfig,this._options,this._loggingEnabled,this._errorBoundary)}setLogEventCompressionMode(e){this._flushCoordinator.setLogEventCompressionMode(e)}setLoggingEnabled(e){var t="disabled"===this._loggingEnabled,n="disabled"!==e;this._loggingEnabled=e,this._flushCoordinator.setLoggingEnabled(e),t&&n&&(e=this._loadStoredEvents(),u.Log.debug(`Loaded ${e.length} stored event(s) from storage`),0<e.length)&&(e.forEach(e=>{this._flushCoordinator.addEvent(e)}),this.flush().catch(e=>{u.Log.warn("Failed to flush events after enabling logging:",e)}))}enqueue(e){this._shouldLogEvent(e)&&(e=this._normalizeEvent(e),"disabled"===this._loggingEnabled?this._storeEventToStorage(e):(this._flushCoordinator.addEvent(e),this._flushCoordinator.checkQuickFlush()))}incrementNonExposureCount(e){var t=null!=(t=this._nonExposedChecks[e])?t:0;this._nonExposedChecks[e]=t+1}reset(){this.flush().catch(()=>{}),this._lastExposureTimeMap={}}start(){var e,t=(0,h._isServerEnv)();t&&"always"!==(null==(e=this._options)?void 0:e.loggingEnabled)||(m[this._sdkKey]=this,t||(0,p._subscribeToVisiblityChanged)(e=>{"background"===e?y._safeFlushAndForget(this._sdkKey):"foreground"===e&&this._flushCoordinator.startScheduledFlushCycle()}),this._flushCoordinator.loadAndRetryShutdownFailedEvents().catch(e=>{u.Log.warn("Failed to load failed shutdown events:",e)}),this._flushCoordinator.startScheduledFlushCycle())}stop(){return i(this,void 0,void 0,function*(){this._isShuttingDown=!0,yield this._flushCoordinator.processShutdown(),delete m[this._sdkKey]})}flush(){return i(this,void 0,void 0,function*(){return this._flushCoordinator.processManualFlush()})}appendAndResetNonExposedChecks(){var e;0!==Object.keys(this._nonExposedChecks).length&&(e=this._normalizeEvent({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:Object.assign({},this._nonExposedChecks)}}),this._flushCoordinator.addEvent(e),this._nonExposedChecks={})}_shouldLogEvent(e){if("always"!==(null==(t=this._options)?void 0:t.loggingEnabled)&&(0,h._isServerEnv)())return!1;if((0,_._isExposureEvent)(e)){var t=e.user||{statsigEnvironment:void 0},t=(0,r._getUserStorageKey)(this._sdkKey,t),n=e.metadata||{},e=[e.eventName,t,n.gate,n.config,n.ruleID,n.allocatedExperiment,n.parameterName,String(n.isExplicitParameter),n.reason].join("|"),t=this._lastExposureTimeMap[e],n=Date.now();if(t&&n-t<6e5)return!1;1e3<Object.keys(this._lastExposureTimeMap).length&&(this._lastExposureTimeMap={}),this._lastExposureTimeMap[e]=n}return!0}_getCurrentPageUrl(){var e;if(!1!==(null==(e=this._options)?void 0:e.includeCurrentPageUrlWithEvents))return(0,h._getCurrentPageUrlSafe)()}_getStorageKey(){return this._storageKey||(this._storageKey="statsig.pending_events."+(0,l._DJB2)(this._sdkKey)),this._storageKey}_storeEventToStorage(t){var n=this._getStorageKey();try{let e=this._getEventsFromStorage(n);e.push(t),e.length>a.EventRetryConstants.MAX_LOCAL_STORAGE&&(e=e.slice(-a.EventRetryConstants.MAX_LOCAL_STORAGE)),(0,v._setObjectInStorage)(n,e)}catch(e){u.Log.warn("Unable to save events to storage")}}_getEventsFromStorage(e){try{var t=(0,v._getObjectFromStorage)(e);return Array.isArray(t)?t:[]}catch(e){return[]}}_loadStoredEvents(){var e=this._getStorageKey(),t=this._getEventsFromStorage(e);return 0<t.length&&v.Storage.removeItem(e),t}_normalizeEvent(e){e.user&&(e.user=Object.assign({},e.user),delete e.user.privateAttributes);var t={},n=this._getCurrentPageUrl();return n&&(t.statsigMetadata={currentPage:n}),Object.assign(Object.assign({},e),t)}}t.EventLogger=y},4309:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventRetryConstants=void 0,t.EventRetryConstants={MAX_RETRY_ATTEMPTS:5,DEFAULT_BATCH_SIZE:100,MAX_PENDING_BATCHES:30,TICK_INTERVAL_MS:1e3,QUICK_FLUSH_WINDOW_MS:200,MAX_LOCAL_STORAGE:500,get MAX_QUEUED_EVENTS(){return this.DEFAULT_BATCH_SIZE*this.MAX_PENDING_BATCHES}}},6351:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,a,o,l){return new(o=o||Promise)(function(n,t){function i(e){try{s(l.next(e))}catch(e){t(e)}}function r(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?n(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(i,r)}s((l=l.apply(e,a||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.EventSender=void 0;const s=n(7512),r=n(7410),a=n(2397);t.EventSender=class{constructor(e,t,n,i,r,s){this._sdkKey=e,this._network=t,this._emitter=n,this._options=r,this._logEventUrlConfig=i,this._loggingEnabled=s}setLogEventCompressionMode(e){this._network.setLogEventCompressionMode(e)}setLoggingEnabled(e){this._loggingEnabled=e}sendBatch(r){return i(this,void 0,void 0,function*(){var e,t;try{var n=(0,a._isUnloading)()&&this._network.isBeaconSupported()&&null==(null==(t=null==(e=this._options)?void 0:e.networkConfig)?void 0:t.networkOverrideFunc),i=(this._emitter({name:"pre_logs_flushed",events:r.events}),n?this._sendEventsViaBeacon(r):yield this._sendEventsViaPost(r));return i.success?(this._emitter({name:"logs_flushed",events:r.events}),i):{success:!1,statusCode:-1}}catch(e){return s.Log.warn("Failed to send batch:",e),{success:!1,statusCode:-1}}})}_sendEventsViaPost(t){return i(this,void 0,void 0,function*(){var e=yield this._network.post(this._getRequestData(t)),e=null!=(e=null==e?void 0:e.code)?e:-1;return{success:200<=e&&e<300,statusCode:e}})}_sendEventsViaBeacon(e){e=this._network.beacon(this._getRequestData(e));return{success:e,statusCode:e?200:-1}}_getRequestData(e){return{sdkKey:this._sdkKey,data:{events:e.events},urlConfig:this._logEventUrlConfig,retries:3,isCompressable:!0,params:{[r.NetworkParam.EventCount]:String(e.events.length)},headers:{"statsig-event-count":String(e.events.length),"statsig-retry-count":String(e.attempts)},credentials:"same-origin"}}}},4312:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,a,o,l){return new(o=o||Promise)(function(n,t){function i(e){try{s(l.next(e))}catch(e){t(e)}}function r(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?n(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(i,r)}s((l=l.apply(e,a||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.FlushCoordinator=void 0;const r=n(4309),c=n(6351),d=n(8153),s=n(323),a=n(1406),o=n(7512),l=n(7023),u=n(4534);t.FlushCoordinator=class{constructor(e,t,n,i,r,s,a,o,l,u){this._cooldownTimer=null,this._maxIntervalTimer=null,this._hasRunQuickFlush=!1,this._currentFlushPromise=null,this._creationTime=Date.now(),this._storageKey=null,this._flushInterval=new d.FlushInterval,this._batchQueue=e,this._pendingEvents=t,this._onPrepareFlush=n,this._errorBoundary=u,this._sdkKey=i,this._eventSender=new c.EventSender(i,r,s,a,o,l)}setLoggingEnabled(e){this._eventSender.setLoggingEnabled(e)}setLogEventCompressionMode(e){this._eventSender.setLogEventCompressionMode(e)}startScheduledFlushCycle(){this._scheduleNextFlush()}stopScheduledFlushCycle(){this._clearAllTimers()}addEvent(e){this._pendingEvents.addToPendingEventsQueue(e),this._pendingEvents.hasEventsForFullBatch()&&this.processLimitFlush()}processManualFlush(){return i(this,void 0,void 0,function*(){return this._currentFlushPromise&&(yield this._currentFlushPromise),this._currentFlushPromise=this._executeFlush(s.FlushType.Manual).finally(()=>{this._currentFlushPromise=null,this._scheduleNextFlush()}),this._currentFlushPromise})}processShutdown(){return i(this,void 0,void 0,function*(){return this._currentFlushPromise&&(yield this._currentFlushPromise),this._currentFlushPromise=this._executeFlush(s.FlushType.Shutdown).catch(e=>{o.Log.error("Error during shutdown flush: "+e)}).finally(()=>{this._currentFlushPromise=null}),this._currentFlushPromise})}_executeFlush(t){return i(this,void 0,void 0,function*(){this._clearAllTimers();try{this._prepareQueueForFlush(t);var e=this._batchQueue.takeAllBatches();0!==e.length&&(yield Promise.all(e.map(e=>this._processOneBatch(e,t))))}finally{this._scheduleNextFlush()}})}checkQuickFlush(){this._hasRunQuickFlush||Date.now()-this._creationTime>r.EventRetryConstants.QUICK_FLUSH_WINDOW_MS||(this._hasRunQuickFlush=!0,setTimeout(()=>{this.processManualFlush().catch(e=>{o.Log.warn("Quick flush failed:",e)})},r.EventRetryConstants.QUICK_FLUSH_WINDOW_MS))}_attemptScheduledFlush(){if(this._currentFlushPromise)this._scheduleNextFlush();else{var t=this.containsAtLeastOneFullBatch(),e=this._flushInterval.hasReachedMaxInterval();if(t||e){this._flushInterval.markFlushAttempt();let e;e=t?s.FlushType.ScheduledFullBatch:s.FlushType.ScheduledMaxTime,this._currentFlushPromise=this._processNextBatch(e).then(()=>{}).catch(e=>{o.Log.error("Error during scheduled flush:",e)}).finally(()=>{this._currentFlushPromise=null,this._scheduleNextFlush()})}else this._scheduleNextFlush()}}processLimitFlush(){!this._flushInterval.hasCompletelyRecoveredFromBackoff()||this._currentFlushPromise||(this._currentFlushPromise=this._processLimitFlushInternal().catch(e=>{o.Log.error("Error during limit flush",e)}).finally(()=>{this._currentFlushPromise=null,this._scheduleNextFlush()}))}_processLimitFlushInternal(){return i(this,void 0,void 0,function*(){const e=yield this._processNextBatch(s.FlushType.Limit);if(e)for(;this._flushInterval.hasCompletelyRecoveredFromBackoff()&&this.containsAtLeastOneFullBatch();){const e=yield this._processNextBatch(s.FlushType.Limit);if(!e)break}})}_scheduleNextFlush(){this._clearAllTimers();var e=Math.max(0,this._flushInterval.getTimeUntilNextFlush()),e=(this._cooldownTimer=setTimeout(()=>{this._cooldownTimer=null,this._attemptScheduledFlush()},e),Math.max(0,this._flushInterval.getTimeTillMaxInterval()));this._maxIntervalTimer=setTimeout(()=>{this._maxIntervalTimer=null,this._attemptScheduledFlush()},e)}_clearAllTimers(){null!==this._cooldownTimer&&(clearTimeout(this._cooldownTimer),this._cooldownTimer=null),null!==this._maxIntervalTimer&&(clearTimeout(this._maxIntervalTimer),this._maxIntervalTimer=null)}_processNextBatch(t){return i(this,void 0,void 0,function*(){this._prepareQueueForFlush(t);var e=this._batchQueue.takeNextBatch();return!!e&&this._processOneBatch(e,t)})}_processOneBatch(t,n){return i(this,void 0,void 0,function*(){var e=yield this._eventSender.sendBatch(t);return e.success?(this._flushInterval.adjustForSuccess(),!0):(this._flushInterval.adjustForFailure(),this._handleFailure(t,n,e.statusCode),!1)})}_prepareQueueForFlush(e){this._onPrepareFlush();var t=this.convertPendingEventsToBatches();0<t&&(o.Log.warn(`Dropped ${t} events`),this._errorBoundary.logDroppedEvents(t,"Batch queue limit reached",{loggingInterval:this._flushInterval.getCurrentIntervalMs(),batchSize:this._batchQueue.batchSize(),maxPendingBatches:r.EventRetryConstants.MAX_PENDING_BATCHES,flushType:e}))}containsAtLeastOneFullBatch(){return this._pendingEvents.hasEventsForFullBatch()||this._batchQueue.hasFullBatch()}convertPendingEventsToBatches(){var e;return this._pendingEvents.isEmpty()?0:(e=this._pendingEvents.takeAll(),this._batchQueue.createBatches(e))}_handleFailure(e,t,n){var i;t===s.FlushType.Shutdown?(o.Log.warn(t+" flush failed during shutdown. "+e.events.length+" event(s) will be saved to storage for retry in next session."),this._saveShutdownFailedEventsToStorage(e.events),this._errorBoundary.logEventRequestFailure(e.events.length,"flush failed during shutdown - saved to storage",t,n)):l.RETRYABLE_CODES.has(n)?e.attempts>=r.EventRetryConstants.MAX_RETRY_ATTEMPTS?(o.Log.warn(`${t} flush failed after ${e.attempts} attempt(s). `+e.events.length+" event(s) will be dropped."),this._errorBoundary.logEventRequestFailure(e.events.length,"max retry attempts exceeded",t,n)):(e.incrementAttempts(),0<(i=this._batchQueue.requeueBatch(e))&&(o.Log.warn(`Failed to requeue batch : dropped ${i} events due to full queue`),this._errorBoundary.logDroppedEvents(i,"Batch queue limit reached",{loggingInterval:this._flushInterval.getCurrentIntervalMs(),batchSize:this._batchQueue.batchSize(),maxPendingBatches:r.EventRetryConstants.MAX_PENDING_BATCHES,flushType:t}))):(o.Log.warn(`${t} flush failed after ${e.attempts} attempt(s). `+e.events.length+" event(s) will be dropped. Non-retryable error: "+n),this._errorBoundary.logEventRequestFailure(e.events.length,"non-retryable error",t,n))}loadAndRetryShutdownFailedEvents(){return i(this,void 0,void 0,function*(){var e=this._getStorageKey();try{var t=this._getShutdownFailedEventsFromStorage(e);0!==t.length&&(o.Log.debug(`Loading ${t.length} failed shutdown event(s) from storage for retry`),u.Storage.removeItem(e),t.forEach(e=>{this.addEvent(e)}),yield this.processManualFlush())}catch(e){o.Log.warn("Failed to load and retry failed shutdown events:",e)}})}_getStorageKey(){return this._storageKey||(this._storageKey="statsig.failed_shutdown_events."+(0,a._DJB2)(this._sdkKey)),this._storageKey}_saveShutdownFailedEventsToStorage(t){var n=this._getStorageKey();try{let e=[...this._getShutdownFailedEventsFromStorage(n),...t];e.length>r.EventRetryConstants.MAX_LOCAL_STORAGE&&(e=e.slice(-r.EventRetryConstants.MAX_LOCAL_STORAGE)),(0,u._setObjectInStorage)(n,e),o.Log.debug(`Saved ${t.length} failed shutdown event(s) to storage (total stored: ${e.length})`)}catch(e){o.Log.warn("Unable to save failed shutdown events to storage:",e)}}_getShutdownFailedEventsFromStorage(e){try{var t=(0,u._getObjectFromStorage)(e);return Array.isArray(t)?t:[]}catch(e){return[]}}}},8153:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FlushInterval=void 0;t.FlushInterval=class{constructor(){this._currentIntervalMs=1e3,this._lastFlushAttemptTime=Date.now()}getCurrentIntervalMs(){return this._currentIntervalMs}markFlushAttempt(){this._lastFlushAttemptTime=Date.now()}getTimeSinceLastAttempt(){return Date.now()-this._lastFlushAttemptTime}hasReachedMaxInterval(){return 6e4<=this.getTimeSinceLastAttempt()}getTimeTillMaxInterval(){return 6e4-this.getTimeSinceLastAttempt()}hasCompletelyRecoveredFromBackoff(){return this._currentIntervalMs<=1e3}adjustForSuccess(){var e=this._currentIntervalMs;1e3!==e&&(this._currentIntervalMs=Math.max(1e3,Math.floor(e/2)))}adjustForFailure(){var e=this._currentIntervalMs;this._currentIntervalMs=Math.min(6e4,2*e)}getTimeUntilNextFlush(){return this.getCurrentIntervalMs()-this.getTimeSinceLastAttempt()}}},323:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FlushType=void 0,t.FlushType={ScheduledMaxTime:"scheduled:max_time",ScheduledFullBatch:"scheduled:full_batch",Limit:"limit",Manual:"manual",Shutdown:"shutdown"}},1406:(e,s,t)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s._getSortedObject=s._DJB2Object=s._DJB2=void 0;const a=t(6634);s._DJB2=t=>{let n=0;for(let e=0;e<t.length;e++){var i=t.charCodeAt(e);n=(n<<5)-n+i,n&=n}return String(n>>>0)},s._DJB2Object=(e,t)=>(0,s._DJB2)(JSON.stringify((0,s._getSortedObject)(e,t)));s._getSortedObject=(n,i)=>{if(null==n)return null;var e=Object.keys(n).sort();const r={};return e.forEach(e=>{var t=n[e];0===i||"object"!==(0,a._typeOf)(t)?r[e]=t:r[e]=(0,s._getSortedObject)(t,null!=i?i-1:i)}),r}},1333:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7512:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Log=t.LogLevel=void 0;function n(e){return e.unshift("[Statsig]"),e}t.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class i{static info(...e){i.level>=t.LogLevel.Info&&console.info(" INFO ",...n(e))}static debug(...e){i.level>=t.LogLevel.Debug&&console.debug(" DEBUG ",...n(e))}static warn(...e){i.level>=t.LogLevel.Warn&&console.warn(" WARN ",...n(e))}static error(...e){i.level>=t.LogLevel.Error&&console.error(" ERROR ",...n(e))}}(t.Log=i).level=t.LogLevel.Warn},7787:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMemoKey=t.MemoPrefix=void 0,t.MemoPrefix={_gate:"g",_dynamicConfig:"c",_experiment:"e",_configList:"cl",_layer:"l",_paramStore:"p"};const s=new Set([]),a=new Set(["userPersistedValues"]);t.createMemoKey=function(e,t,n){let i=e+"|"+t;if(n)for(const r of Object.keys(n)){if(a.has(r))return;s.has(r)?i+=`|${r}=true`:i+=`|${r}=`+n[r]}return i}},7410:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkParam=t.NetworkDefault=t.Endpoint=void 0,t.Endpoint={_initialize:"initialize",_rgstr:"rgstr",_download_config_specs:"download_config_specs"},t.NetworkDefault={[t.Endpoint._rgstr]:"https://prodregistryv2.org/v1",[t.Endpoint._initialize]:"https://featureassets.org/v1",[t.Endpoint._download_config_specs]:"https://api.statsigcdn.com/v1"},t.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}},7023:function(e,y,t){"use strict";var b=this&&this.__awaiter||function(e,a,o,l){return new(o=o||Promise)(function(n,t){function i(e){try{s(l.next(e))}catch(e){t(e)}}function r(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?n(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(i,r)}s((l=l.apply(e,a||[])).next())})};Object.defineProperty(y,"__esModule",{value:!0}),y.NetworkCore=y.RETRYABLE_CODES=void 0,t(1845);const _=t(1845),S=t(8962),E=t(7512),C=t(7410),n=t(308),g=t(3091),a=t(5902),r=t(6830),o=t(4143),l=t(9122),w=t(2636),u=t(8e3),v=t(586),k=t(2397),O=500,D=3e4;y.RETRYABLE_CODES=new Set([408,500,502,503,504,522,524,599]);y.NetworkCore=class{constructor(e,t){this._emitter=t,this._errorBoundary=null,this._timeout=1e4,this._netConfig={},this._options={},this._leakyBucket={},this._lastUsedInitUrl=null,e&&(this._options=e),this._options.networkConfig&&(this._netConfig=this._options.networkConfig),this._netConfig.networkTimeoutMs&&(this._timeout=this._netConfig.networkTimeoutMs),this._fallbackResolver=new n.NetworkFallbackResolver(this._options),this.setLogEventCompressionMode(this._getLogEventCompressionMode(e))}setLogEventCompressionMode(e){this._options.logEventCompressionMode=e}setErrorBoundary(e){this._errorBoundary=e,this._errorBoundary.wrap(this),this._errorBoundary.wrap(this._fallbackResolver),this._fallbackResolver.setErrorBoundary(e)}isBeaconSupported(){return"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon}getLastUsedInitUrlAndReset(){var e=this._lastUsedInitUrl;return this._lastUsedInitUrl=null,e}beacon(e){var t,n;return!!T(e)&&(e=this._getInternalRequestArgs("POST",e),t=this._getPopulatedURL(e),(n=navigator).sendBeacon.bind(n)(t,e.body))}post(t){return b(this,void 0,void 0,function*(){var e=this._getInternalRequestArgs("POST",t);return this._tryEncodeBody(e),yield this._tryToCompressBody(e),this._sendRequest(e)})}get(e){e=this._getInternalRequestArgs("GET",e);return this._sendRequest(e)}_sendRequest(m){return b(this,void 0,void 0,function*(){var t;if(!T(m))return null;if(this._netConfig.preventAllNetworkTraffic)return null;var{method:i,body:r,retries:n,attempt:s}=m,a=m.urlConfig.endpoint;if(this._isRateLimited(a))return E.Log.warn(`Request to ${a} was blocked because you are making requests too frequently.`),null;s=null!=s?s:1;let o=!1;var l=this._getPopulatedURL(m);let u=null;var c,d=(0,k._isUnloading)();try{var e,h,_,g={method:i,body:r,headers:Object.assign({},m.headers),priority:m.priority,keepalive:d},v=(c=s,(p=m).urlConfig.endpoint===C.Endpoint._initialize&&S.Diagnostics._markInitNetworkReqStart(p.sdkKey,{attempt:c}),this._leakyBucket[a]),f=(v&&(v.lastRequestTime=Date.now(),this._leakyBucket[a]=v),null!=(t=this._netConfig.networkOverrideFunc)?t:fetch);let n;if((u=yield Promise.race([f(l,g).finally(()=>clearTimeout(n)),new Promise((e,t)=>{n=setTimeout(()=>{o=!0,t(new Error(`Timeout of ${this._timeout}ms expired.`))},this._timeout)})])).ok)return _=yield u.text(),M(m,u,s,_),this._fallbackResolver.tryBumpExpiryTime(m.sdkKey,m.urlConfig),{body:_,code:u.status};throw e=yield u.text().catch(()=>"No Text"),(h=new Error(`NetworkError: ${l} `+e)).name="NetworkError",h}catch(e){var r=function(e){if("string"==typeof e)return e;if(e instanceof Error)return e.name+": "+e.message;return"Unknown Error"}(e),d=function(e,t){e=e.includes("Timeout");return e||t}(null!=r?r:"",o),p=(M(m,u,s,"",e),yield this._fallbackResolver.tryFetchUpdatedFallbackInfo(m.sdkKey,m.urlConfig,r,d));return(p&&(m.fallbackUrl=this._fallbackResolver.getActiveFallbackUrl(m.sdkKey,m.urlConfig)),!n||n<s||!y.RETRYABLE_CODES.has(null!=(c=null===u||void 0===u?void 0:u.status)?c:500))?(null!=(a=this._emitter)&&a.call(this,{name:"error",error:e,tag:w.ErrorTag.NetworkError,requestArgs:m}),v=`A networking error occurred during ${i} request to ${l}.`,E.Log.error(v,r,e),null!=(t=this._errorBoundary)&&t.attachErrorIfNoneExists(v),null):(yield function(t){return b(this,void 0,void 0,function*(){yield new Promise(e=>setTimeout(e,Math.min(O*(t*t),D)))})}(s),this._sendRequest(Object.assign(Object.assign({},m),{retries:n,attempt:s+1})))}})}_getLogEventCompressionMode(e){let t=null==e?void 0:e.logEventCompressionMode;return t=(t=t||!0!==(null==e?void 0:e.disableCompression)?t:v.LogEventCompressionMode.Disabled)||v.LogEventCompressionMode.Enabled}_isRateLimited(e){var t=Date.now(),n=null!=(n=this._leakyBucket[e])?n:{count:0,lastRequestTime:t},i=t-n.lastRequestTime,i=Math.floor(.05*i);return n.count=Math.max(0,n.count-i),50<=n.count||(n.count+=1,n.lastRequestTime=t,this._leakyBucket[e]=n,!1)}_getPopulatedURL(e){var t=null!=(t=e.fallbackUrl)?t:e.urlConfig.getUrl();e.urlConfig.endpoint!==C.Endpoint._initialize&&e.urlConfig.endpoint!==C.Endpoint._download_config_specs||(this._lastUsedInitUrl=t);const n=Object.assign({[C.NetworkParam.SdkKey]:e.sdkKey,[C.NetworkParam.SdkType]:a.SDKType._get(e.sdkKey),[C.NetworkParam.SdkVersion]:u.SDK_VERSION,[C.NetworkParam.Time]:String(Date.now()),[C.NetworkParam.SessionID]:o.SessionID.get(e.sdkKey)},e.params);e=Object.keys(n).map(e=>encodeURIComponent(e)+"="+encodeURIComponent(n[e])).join("&");return t+(e?"?"+e:"")}_tryEncodeBody(t){var e,n=(0,r._getWindowSafe)(),i=t.body;if(t.isStatsigEncodable&&!this._options.disableStatsigEncoding&&"string"==typeof i&&null==(0,_._getStatsigGlobalFlag)("no-encode")&&null!=n&&n.btoa)try{t.body=n.btoa(i).split("").reverse().join(""),t.params=Object.assign(Object.assign({},null!=(e=t.params)?e:{}),{[C.NetworkParam.StatsigEncoded]:"1"})}catch(e){E.Log.warn("Request encoding failed for "+t.urlConfig.getUrl(),e)}}_tryToCompressBody(h){return b(this,void 0,void 0,function*(){var t,n=h.body;if("string"==typeof n&&function(e,t){if(!e.isCompressable)return;if(null!=(0,_._getStatsigGlobalFlag)("no-compress")||"undefined"==typeof CompressionStream||"undefined"==typeof TextEncoder)return;var n=null!=e.urlConfig.customUrl||null!=e.urlConfig.fallbackUrls,i=!0===g.SDKFlags.get(e.sdkKey,"enable_log_event_compression");switch(t.logEventCompressionMode){case v.LogEventCompressionMode.Disabled:return;case v.LogEventCompressionMode.Enabled:return n&&!i?void 0:1;case v.LogEventCompressionMode.Forced:return 1;default:return}}(h,this._options))try{for(var i,r=(new TextEncoder).encode(n),s=new CompressionStream("gzip"),a=s.writable.getWriter(),o=(a.write(r).catch(E.Log.error),a.close().catch(E.Log.error),s.readable.getReader()),l=[];!(i=yield o.read()).done;)l.push(i.value);var u=l.reduce((e,t)=>e+t.length,0),c=new Uint8Array(u);let e=0;for(const d of l)c.set(d,e),e+=d.length;h.body=c,h.params=Object.assign(Object.assign({},null!=(t=h.params)?t:{}),{[C.NetworkParam.IsGzipped]:"1"})}catch(e){E.Log.warn("Request compression failed for "+h.urlConfig.getUrl(),e)}})}_getInternalRequestArgs(e,t){var n=this._fallbackResolver.getActiveFallbackUrl(t.sdkKey,t.urlConfig),e=Object.assign(Object.assign({},t),{method:e,fallbackUrl:n});return"data"in t&&i(e,t.data),e}};const T=e=>!!e.sdkKey||(E.Log.warn("Unable to make request without an SDK key"),!1),i=(e,t)=>{var{sdkKey:n,fallbackUrl:i}=e,r=l.StableID.get(n),s=o.SessionID.get(n),n=a.SDKType._get(n);e.body=JSON.stringify(Object.assign(Object.assign({},t),{statsigMetadata:Object.assign(Object.assign({},u.StatsigMetadataProvider.get()),{stableID:r,sessionID:s,sdkType:n,fallbackUrl:i})}))};function M(e,t,n,i,r){e.urlConfig.endpoint===C.Endpoint._initialize&&S.Diagnostics._markInitNetworkReqEnd(e.sdkKey,S.Diagnostics._getDiagnosticsData(t,n,i,r))}},308:function(e,t,n){"use strict";var o=this&&this.__awaiter||function(e,a,o,l){return new(o=o||Promise)(function(n,t){function i(e){try{s(l.next(e))}catch(e){t(e)}}function r(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?n(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(i,r)}s((l=l.apply(e,a||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t._isDomainFailure=t.NetworkFallbackResolver=void 0;const a=n(8809),i=n(1406),s=n(7512),l=n(4534);function u(e,t){e=null!=(e=null==e?void 0:e.toLowerCase())?e:"";return t||e.includes("uncaught exception")||e.includes("failed to fetch")||e.includes("networkerror when attempting to fetch resource")}function c(e){return"statsig.network_fallback."+(0,i._DJB2)(e)}function d(e,t){e=c(e);t&&0!==Object.keys(t).length?l.Storage.setItem(e,JSON.stringify(t)):l.Storage.removeItem(e)}t.NetworkFallbackResolver=class{constructor(e){this._fallbackInfo=null,this._errorBoundary=null,this._dnsQueryCooldowns={},this._networkOverrideFunc=null==(e=e.networkConfig)?void 0:e.networkOverrideFunc}setErrorBoundary(e){this._errorBoundary=e}tryBumpExpiryTime(e,t){var n=null==(n=this._fallbackInfo)?void 0:n[t.endpoint];n&&(n.expiryTime=Date.now()+6048e5,d(e,Object.assign(Object.assign({},this._fallbackInfo),{[t.endpoint]:n})))}getActiveFallbackUrl(e,t){var n;if(null!=t.customUrl&&null!=t.fallbackUrls)return null;let i=this._fallbackInfo;null==i&&(i=null!=(r=function(e){e=c(e),e=l.Storage.getItem(e);if(!e)return null;try{return JSON.parse(e)}catch(e){return s.Log.error("Failed to parse FallbackInfo"),null}}(e))?r:{},this._fallbackInfo=i);var r=i[t.endpoint];return!r||Date.now()>(null!=(n=r.expiryTime)?n:0)||t.getChecksum()!==r.urlConfigChecksum?(delete i[t.endpoint],this._fallbackInfo=i,d(e,this._fallbackInfo),null):r.url||null}tryFetchUpdatedFallbackInfo(i,r,s,a){return o(this,void 0,void 0,function*(){var t,e,n;try{return u(s,a)?(e=null==r.customUrl&&null==r.fallbackUrls?yield this._tryFetchFallbackUrlsFromNetwork(r):r.fallbackUrls,!!(n=this._pickNewFallbackUrl(null==(t=this._fallbackInfo)?void 0:t[r.endpoint],e))&&(this._updateFallbackInfoWithNewUrl(i,r,n),!0)):!1}catch(e){return null!=(t=this._errorBoundary)&&t.logError("tryFetchUpdatedFallbackInfo",e),!1}})}_updateFallbackInfoWithNewUrl(e,t,n){var n={urlConfigChecksum:t.getChecksum(),url:n,expiryTime:Date.now()+6048e5,previous:[]},t=t.endpoint,i=null==(i=this._fallbackInfo)?void 0:i[t],i=(i&&n.previous.push(...i.previous),10<n.previous.length&&(n.previous=[]),null==(i=null==(i=this._fallbackInfo)?void 0:i[t])?void 0:i.url);null!=i&&n.previous.push(i),this._fallbackInfo=Object.assign(Object.assign({},this._fallbackInfo),{[t]:n}),d(e,this._fallbackInfo)}_tryFetchFallbackUrlsFromNetwork(s){return o(this,void 0,void 0,function*(){var e=this._dnsQueryCooldowns[s.endpoint];if(e&&Date.now()<e)return null;this._dnsQueryCooldowns[s.endpoint]=Date.now()+144e5;var t=[],e=yield(0,a._fetchTxtRecords)(null!=(e=this._networkOverrideFunc)?e:fetch),n=function(e){try{return new URL(e).pathname}catch(e){return null}}(s.defaultUrl);for(const r of e)if(r.startsWith(s.endpointDnsKey+"=")){var i=r.split("=");if(1<i.length){let e=i[1];e.endsWith("/")&&(e=e.slice(0,-1)),t.push("https://"+e+n)}}return t})}_pickNewFallbackUrl(e,t){var n;if(null==t)return null;var i=new Set(null!=(n=null==e?void 0:e.previous)?n:[]),r=null==e?void 0:e.url;let s=null;for(const o of t){var a=o.endsWith("/")?o.slice(0,-1):o;if(!i.has(o)&&a!==r){s=a;break}}return s}},t._isDomainFailure=u},1405:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1361:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1228:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PendingEvents=void 0;const i=n(7512);t.PendingEvents=class{constructor(e){this._pendingEvents=[],this._batchSize=e}addToPendingEventsQueue(e){this._pendingEvents.push(e),i.Log.debug("Enqueued Event:",e)}hasEventsForFullBatch(){return this._pendingEvents.length>=this._batchSize}takeAll(){var e=this._pendingEvents;return this._pendingEvents=[],e}isEmpty(){return 0===this._pendingEvents.length}}},3091:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SDKFlags=void 0;const n={};t.SDKFlags={setFlags:(e,t)=>{n[e]=t},get:(e,t)=>{return null!=(e=null==(e=n[e])?void 0:e[t])&&e}}},5902:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SDKType=void 0;const n={};let i;t.SDKType={_get:e=>{return(null!=(e=n[e])?e:"js-mono")+(null!==i&&void 0!==i?i:"")},_setClientType(e,t){n[e]=t},_setBindingType(e){i&&"-react"!==i||(i="-"+e)}}},6830:(e,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i._getUnloadEvent=i._getCurrentPageUrlSafe=i._addDocumentEventListenerSafe=i._addWindowEventListenerSafe=i._isServerEnv=i._getDocumentSafe=i._getWindowSafe=void 0;i._getWindowSafe=()=>"undefined"!=typeof window?window:null,i._getDocumentSafe=()=>{var e=(0,i._getWindowSafe)();return null!=(e=null==e?void 0:e.document)?e:null},i._isServerEnv=()=>{var e;return null===(0,i._getDocumentSafe)()&&(e="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,"string"==typeof EdgeRuntime||e)},i._addWindowEventListenerSafe=(e,t)=>{var n=(0,i._getWindowSafe)();"function"==typeof(null==n?void 0:n.addEventListener)&&n.addEventListener(e,t)},i._addDocumentEventListenerSafe=(e,t)=>{var n=(0,i._getDocumentSafe)();"function"==typeof(null==n?void 0:n.addEventListener)&&n.addEventListener(e,t)},i._getCurrentPageUrlSafe=()=>{var e;try{return null==(e=(0,i._getWindowSafe)())?void 0:e.location.href.split(/[?#]/)[0]}catch(e){}};i._getUnloadEvent=()=>{var e=(0,i._getWindowSafe)();return e&&"onpagehide"in e?"pagehide":"beforeunload"}},4143:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigSession=t.SessionID=void 0;const i=n(1845),r=n(2137),o=n(7512),l=n(4534),u=n(8023),c=18e5,d=144e5,h={};function _(t,e){return setTimeout(()=>{var e=null==(e=(0,i._getStatsigGlobal)())?void 0:e.instance(t);e&&e.$emt({name:"session_expired"})},e)}function g(e){return"statsig.session_id."+(0,r._getStorageKey)(e)}t.SessionID={get:e=>t.StatsigSession.get(e).data.sessionID},t.StatsigSession={get:e=>{null==h[e]&&(h[e]=function(e){let t=function(e){e=g(e);return(0,l._getObjectFromStorage)(e)}(e);var n=Date.now();t=t||{sessionID:(0,u.getUUID)(),startTime:n,lastUpdate:n};return{data:t,sdkKey:e}}(e));var e=h[e],t=Date.now(),n=e.data,i=e.sdkKey,r=((function({lastUpdate:e}){return Date.now()-e>c}(n)||function({startTime:e}){return Date.now()-e>d}(n))&&(n.sessionID=(0,u.getUUID)(),n.startTime=t,a=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instance(i))&&a.$emt({name:"session_expired"}),n.lastUpdate=t,n),s=e.sdkKey;s=g(s);try{(0,l._setObjectInStorage)(s,r)}catch(e){o.Log.warn("Failed to save SessionID")}clearTimeout(e.idleTimeoutID),clearTimeout(e.ageTimeoutID);var a=t-n.startTime;return e.idleTimeoutID=_(i,c),e.ageTimeoutID=_(i,d-a),e},overrideInitialSessionID:(e,t)=>{var n;h[t]=(e=e,t=t,n=Date.now(),{data:{sessionID:e,startTime:n,lastUpdate:n},sdkKey:t})}}},2176:(e,o)=>{"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o._fastApproxSizeOf=void 0;o._fastApproxSizeOf=(t,n)=>{let i=0;var r=Object.keys(t);for(let e=0;e<r.length;e++){var s=r[e],a=t[s];if((i=(i+=s.length)+("object"==typeof a&&null!==a?(0,o._fastApproxSizeOf)(a,n)+2:String(a).length+1))>=n)return i}return i}},9122:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCookieName=t.StableID=void 0;const i=n(2137),r=n(7512),s=n(6830),a=n(4534),o=n(8023),l={},u={},c={};function d(e){return"statsig.stable_id."+(0,i._getStorageKey)(e)}function h(e,t){t=d(t);try{(0,a._setObjectInStorage)(t,e)}catch(e){r.Log.warn("Failed to save StableID to storage")}}function _(e,t){var n;u[t]&&null!=(0,s._getDocumentSafe)()&&((n=new Date).setFullYear(n.getFullYear()+1),document.cookie=`${g(t)}=${encodeURIComponent(e)}; expires=${n.toUTCString()}; path=/`)}function g(e){return"statsig.stable_id."+(0,i._getStorageKey)(e)}t.StableID={cookiesEnabled:!1,randomID:Math.random().toString(36),get:e=>{if(c[e])return null;if(null!=l[e])return l[e];let t=null;return null!=(t=function(e){if(u[e]&&null!=(0,s._getDocumentSafe)())for(const i of document.cookie.split(";")){var[t,n]=i.trim().split("=");if(t===g(e))return decodeURIComponent(n)}return null}(e))?h(l[e]=t,e):(h(t=null==(t=function(e){e=d(e);return(0,a._getObjectFromStorage)(e)}(e))?(0,o.getUUID)():t,e),_(t,e),l[e]=t),t},setOverride:(e,t)=>{h(l[t]=e,t),_(e,t)},_setCookiesEnabled:(e,t)=>{u[e]=t},_setDisabled:(e,t)=>{c[e]=t}},t.getCookieName=g},1375:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,a,o,l){return new(o=o||Promise)(function(n,t){function i(e){try{s(l.next(e))}catch(e){t(e)}}function r(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?n(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(i,r)}s((l=l.apply(e,a||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigClientBase=void 0,n(1845);const a=n(1845),o=n(5542),l=n(7770),u=n(7512),s=n(7787),c=n(6830),d=n(4143),h=n(9122),r=n(586),_=n(4534);t.StatsigClientBase=class{constructor(e,t,n,i){this.loadingStatus="Uninitialized",this._initializePromise=null,this._listeners={};var r,s=this.$emt.bind(this);null!=(null==i?void 0:i.logLevel)&&(u.Log.level=i.logLevel),null!=i&&i.disableStorage&&_.Storage._setDisabled(!0),null!=i&&i.initialSessionID&&d.StatsigSession.overrideInitialSessionID(i.initialSessionID,e),null!=i&&i.storageProvider&&_.Storage._setProvider(i.storageProvider),null!=i&&i.enableCookies&&h.StableID._setCookiesEnabled(e,i.enableCookies),null!=i&&i.disableStableID&&h.StableID._setDisabled(e,!0),this._sdkKey=e,this._options=null!=i?i:{},this._memoCache={},this.overrideAdapter=null!=(r=null==i?void 0:i.overrideAdapter)?r:null,this._errorBoundary=new o.ErrorBoundary(e,i,s),this._logger=new l.EventLogger(e,s,n,i,this._errorBoundary),this._errorBoundary.wrap(this),this._errorBoundary.wrap(t),this._errorBoundary.wrap(this._logger),n.setErrorBoundary(this._errorBoundary),this.dataAdapter=t,this.dataAdapter.attach(e,i,n),this.storageProvider=_.Storage,null!=(t=null==(s=null==(r=this.overrideAdapter)?void 0:r.loadFromStorage)?void 0:s.call(r))&&t.catch(e=>this._errorBoundary.logError("OA::loadFromStorage",e)),this._primeReadyRipcord(),i=e,n=this,(0,c._isServerEnv)()||(s=(0,a._getStatsigGlobal)(),r=null!=(r=s.instances)?r:{},n=n,null!=r[i]&&u.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),r[i]=n,s.firstInstance||(s.firstInstance=n),s.instances=r,__STATSIG__=s)}updateRuntimeOptions(e){e.loggingEnabled?(this._options.loggingEnabled=e.loggingEnabled,this._logger.setLoggingEnabled(e.loggingEnabled)):null!=e.disableLogging&&(this._options.disableLogging=e.disableLogging,this._logger.setLoggingEnabled(e.disableLogging?"disabled":"browser-only")),null!=e.disableStorage&&(this._options.disableStorage=e.disableStorage,_.Storage._setDisabled(e.disableStorage)),null!=e.enableCookies&&(this._options.enableCookies=e.enableCookies,h.StableID._setCookiesEnabled(this._sdkKey,e.enableCookies)),e.logEventCompressionMode?this._logger.setLogEventCompressionMode(e.logEventCompressionMode):e.disableCompression&&this._logger.setLogEventCompressionMode(r.LogEventCompressionMode.Disabled)}flush(){return this._logger.flush()}shutdown(){return i(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),this._setStatus("Uninitialized",null),this._initializePromise=null,yield this._logger.stop()})}on(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)}off(e,t){this._listeners[e]&&-1!==(t=this._listeners[e].indexOf(t))&&this._listeners[e].splice(t,1)}$on(e,t){t.__isInternal=!0,this.on(e,t)}$emt(n){var e;const t=t=>{try{t(n)}catch(e){!0===t.__isInternal?this._errorBoundary.logError("__emit:"+n.name,e):u.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",n)}};this._listeners[n.name]&&this._listeners[n.name].forEach(e=>t(e)),null!=(e=this._listeners["*"])&&e.forEach(t)}_setStatus(e,t){this.loadingStatus=e,this._memoCache={},this.$emt({name:"values_updated",status:e,values:t})}_enqueueExposure(e,t,n){!0===(null==n?void 0:n.disableExposureLog)?this._logger.incrementNonExposureCount(e):this._logger.enqueue(t)}_memoize(i,r){return(e,t)=>{var n;return!this._options.disableEvaluationMemoization&&(n=(0,s.createMemoKey)(i,e,t))?(n in this._memoCache||(3e3<=Object.keys(this._memoCache).length&&(this._memoCache={}),this._memoCache[n]=r(e,t)),this._memoCache[n]):r(e,t)}}}},2636:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorTag=void 0,t.ErrorTag={NetworkError:"NetworkError"}},3206:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DataAdapterCachePrefix=void 0,t.DataAdapterCachePrefix="statsig.cached"},1637:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._createLayerParameterExposure=t._createConfigExposure=t._mapExposures=t._createGateExposure=t._isExposureEvent=void 0;const s="statsig::config_exposure",a="statsig::gate_exposure",u="statsig::layer_exposure",c=(e,t,n,i,r)=>(n.bootstrapMetadata&&(i.bootstrapMetadata=n.bootstrapMetadata),{eventName:e,user:t,value:null,metadata:o(n,i),secondaryExposures:r,time:Date.now()});t._isExposureEvent=({eventName:e})=>e===a||e===s||e===u;function d(e,t){return e.map(e=>"string"==typeof e?(null!=t?t:{})[e]:e).filter(e=>null!=e)}t._createGateExposure=(e,t,n)=>{var i,r={gate:t.name,gateValue:String(t.value),ruleID:t.ruleID};return null!=(null==(i=t.__evaluation)?void 0:i.version)&&(r.configVersion=t.__evaluation.version),c(a,e,t.details,r,d(null!=(e=null==(i=t.__evaluation)?void 0:i.secondary_exposures)?e:[],n))},t._mapExposures=d;t._createConfigExposure=(e,t,n)=>{var i,r={config:t.name,ruleID:t.ruleID};return null!=(null==(i=t.__evaluation)?void 0:i.version)&&(r.configVersion=t.__evaluation.version),null!=(null==(i=t.__evaluation)?void 0:i.passed)&&(r.rulePassed=String(t.__evaluation.passed)),c(s,e,t.details,r,d(null!=(e=null==(i=t.__evaluation)?void 0:i.secondary_exposures)?e:[],n))};t._createLayerParameterExposure=(e,t,n,i)=>{var r=t.__evaluation,s=!0===(null==(s=null==r?void 0:r.explicit_parameters)?void 0:s.includes(n));let a="",o=null!=(l=null==r?void 0:r.undelegated_secondary_exposures)?l:[];s&&(a=null!=(l=r.allocated_experiment_name)?l:"",o=null!=(l=r.secondary_exposures)?l:[]);var l=null==(r=t.__evaluation)?void 0:r.parameter_rule_ids,l={config:t.name,parameterName:n,ruleID:null!=(r=null==l?void 0:l[n])?r:t.ruleID,allocatedExperiment:a,isExplicitParameter:String(s)};return null!=(null==(n=t.__evaluation)?void 0:n.version)&&(l.configVersion=t.__evaluation.version),c(u,e,t.details,l,d(o,i))};const o=(e,t)=>(t.reason=e.reason,e.lcut&&(t.lcut=String(e.lcut)),e.receivedAt&&(t.receivedAt=String(e.receivedAt)),t)},8e3:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigMetadataProvider=t.SDK_VERSION=void 0,t.SDK_VERSION="3.30.2-beta.2";let n={sdkVersion:t.SDK_VERSION,sdkType:"js-mono"};t.StatsigMetadataProvider={get:()=>n,add:e=>{n=Object.assign(Object.assign({},n),e)}}},586:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LoggingEnabledOption=t.LogEventCompressionMode=void 0,t.LogEventCompressionMode={Disabled:"d",Enabled:"e",Forced:"f"},t.LoggingEnabledOption={disabled:"disabled",browserOnly:"browser-only",always:"always"}},1098:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2059:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._makeTypedGet=t._mergeOverride=t._makeLayer=t._makeExperiment=t._makeDynamicConfig=t._makeFeatureGate=void 0;const a=n(7512),o=n(6634);function r(e,t,n,i){return{name:e,details:t,ruleID:null!=(e=null==n?void 0:n.rule_id)?e:"",__evaluation:n,value:i}}function i(e,t,n){var i=null!=(i=null==n?void 0:n.value)?i:{};return Object.assign(Object.assign({},r(e,t,n,i)),{idType:null!=(t=null==n?void 0:n.id_type)?t:null,get:s(e,null==n?void 0:n.value)})}function s(i,r,s){return(e,t)=>{var n=null!=(n=null==r?void 0:r[e])?n:null;return null==n?null!=t?t:null:null==t||(0,o._isTypeMatch)(n,t)?(null!=s&&s(e),n):(a.Log.warn(`Parameter type mismatch. '${i}.${e}' was found to be type '${typeof n}' but fallback/return type is '${typeof t}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),null!=t?t:null)}}t._makeFeatureGate=function(e,t,n){return Object.assign(Object.assign({},r(e,t,n,!0===(null==n?void 0:n.value))),{idType:null!=(e=null==n?void 0:n.id_type)?e:null})},t._makeDynamicConfig=i,t._makeExperiment=function(e,t,n){return e=i(e,t,n),Object.assign(Object.assign({},e),{groupName:null!=(t=null==n?void 0:n.group_name)?t:null})},t._makeLayer=function(e,t,n,i){return Object.assign(Object.assign({},r(e,t,n,void 0)),{get:s(e,null==n?void 0:n.value,i),groupName:null!=(t=null==n?void 0:n.group_name)?t:null,__value:null!=(e=null==n?void 0:n.value)?e:{}})},t._mergeOverride=function(e,t,n,i){return Object.assign(Object.assign(Object.assign({},e),t),{get:s(e.name,n,i)})},t._makeTypedGet=s},1812:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3932:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UPDATE_DETAIL_ERROR_MESSAGES=t.createUpdateDetails=void 0;t.createUpdateDetails=(e,t,n,i,r,s)=>({duration:n,source:t,success:e,error:i,sourceUrl:r,warnings:s}),t.UPDATE_DETAIL_ERROR_MESSAGES={NO_NETWORK_DATA:"No data was returned from the network. This may be due to a network timeout if a timeout value was specified in the options or ad blocker error."}},8578:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._getFullUserHash=t._normalizeUser=void 0;const i=n(1406),r=n(7512);t._normalizeUser=function(e,t,n){try{var i=JSON.parse(JSON.stringify(e));return null!=t&&null!=t.environment?i.statsigEnvironment=t.environment:null!=n&&(i.statsigEnvironment={tier:n}),i}catch(e){return r.Log.error("Failed to JSON.stringify user"),{statsigEnvironment:void 0}}},t._getFullUserHash=function(e){return e?(0,i._DJB2Object)(e):null}},4534:(e,n,t)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n._setObjectInStorage=n._getObjectFromStorage=n.Storage=void 0;const i=t(7512);t=t(6830);const r={},s={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:e=>r[e]||null,setItem:(e,t)=>{r[e]=t},removeItem:e=>{delete r[e]},getAllKeys:()=>Object.keys(r)};let a=null;try{const c=(0,t._getWindowSafe)();c&&c.localStorage&&"function"==typeof c.localStorage.getItem&&(a={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:e=>c.localStorage.getItem(e),setItem:(e,t)=>c.localStorage.setItem(e,t),removeItem:e=>c.localStorage.removeItem(e),getAllKeys:()=>Object.keys(c.localStorage)})}catch(e){i.Log.warn("Failed to setup localStorageProvider.")}let o=null!==a&&void 0!==a?a:s,l=o;function u(e){try{return e()}catch(e){if(e instanceof Error&&"SecurityError"===e.name)return n.Storage._setProvider(s),null;throw e}}n.Storage={isReady:()=>l.isReady(),isReadyResolver:()=>l.isReadyResolver(),getProviderName:()=>l.getProviderName(),getItem:e=>u(()=>l.getItem(e)),setItem:(e,t)=>u(()=>l.setItem(e,t)),removeItem:e=>l.removeItem(e),getAllKeys:()=>l.getAllKeys(),_setProvider:e=>{o=e,l=e},_setDisabled:e=>{l=e?s:o}},n._getObjectFromStorage=function(t){var e=n.Storage.getItem(t);try{return JSON.parse(null!=e?e:"null")}catch(e){return i.Log.error(`Failed to parse value for key "${t}"`),null}},n._setObjectInStorage=function(e,t){n.Storage.setItem(e,JSON.stringify(t))}},3401:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._typedJsonParse=void 0;const r=n(7512);t._typedJsonParse=function(e,t,n){try{var i=JSON.parse(e);if(i&&"object"==typeof i&&t in i)return i}catch(e){}return r.Log.error("Failed to parse "+n),null}},6634:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._isTypeMatch=t._typeOf=void 0,t._typeOf=function(e){return Array.isArray(e)?"array":typeof e},t._isTypeMatch=function(e,t){var n=e=>Array.isArray(e)?"array":null===e?"null":typeof e;return n(e)===n(t)}},8023:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUUID=void 0,t.getUUID=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();let n=(new Date).getTime(),i="undefined"!=typeof performance&&performance.now&&1e3*performance.now()||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(4*Math.random())]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=16*Math.random();return 0<n?(t=(n+t)%16|0,n=Math.floor(n/16)):(t=(i+t)%16|0,i=Math.floor(i/16)),("x"===e?t:7&t|8).toString(16)})}},1881:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UrlConfiguration=void 0;const i=n(1406),r=n(7410),s={[r.Endpoint._initialize]:"i",[r.Endpoint._rgstr]:"e",[r.Endpoint._download_config_specs]:"d"};t.UrlConfiguration=class{constructor(e,t,n,i){this.customUrl=null,this.fallbackUrls=null,this.endpoint=e,this.endpointDnsKey=s[e],t&&(this.customUrl=t),!t&&n&&(this.customUrl=n.endsWith("/")?""+n+e:n+"/"+e),i&&(this.fallbackUrls=i);t=r.NetworkDefault[e];this.defaultUrl=t+"/"+e}getUrl(){var e;return null!=(e=this.customUrl)?e:this.defaultUrl}getChecksum(){var e=(null!=(e=this.fallbackUrls)?e:[]).sort().join(",");return(0,i._DJB2)(this.customUrl+e)}}},2397:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._notifyVisibilityChanged=t._subscribeToVisiblityChanged=t._isUnloading=t._isCurrentlyVisible=void 0;n=n(6830);const i="foreground",r="background",s=[];let a=i,o=!1;t._isCurrentlyVisible=()=>a===i,t._isUnloading=()=>o,t._subscribeToVisiblityChanged=e=>{s.unshift(e)};t._notifyVisibilityChanged=t=>{t!==a&&(a=t,s.forEach(e=>e(t)))},(0,n._addWindowEventListenerSafe)("focus",()=>{(o=!1,t._notifyVisibilityChanged)(i)}),(0,n._addWindowEventListenerSafe)("blur",()=>(0,t._notifyVisibilityChanged)(r)),(0,n._addDocumentEventListenerSafe)("visibilitychange",()=>{(0,t._notifyVisibilityChanged)("visible"===document.visibilityState?i:r)}),(0,n._addWindowEventListenerSafe)((0,n._getUnloadEvent)(),()=>{o=!0,(0,t._notifyVisibilityChanged)(r)})},6914:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&("get"in r?t.__esModule:!r.writable&&!r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){e[i=void 0===i?n:i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)},s=(Object.defineProperty(t,"__esModule",{value:!0}),t.Storage=t.Log=t.EventLogger=t.Diagnostics=void 0,n(1845),n(1845));const a=n(8962),o=(Object.defineProperty(t,"Diagnostics",{enumerable:!0,get:function(){return a.Diagnostics}}),n(7770)),l=(Object.defineProperty(t,"EventLogger",{enumerable:!0,get:function(){return o.EventLogger}}),n(7512));Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return l.Log}});var u=n(8e3);const c=n(4534);Object.defineProperty(t,"Storage",{enumerable:!0,get:function(){return c.Storage}}),r(n(1845),t),r(n(2137),t),r(n(6427),t),r(n(694),t),r(n(8962),t),r(n(3539),t),r(n(5542),t),r(n(2922),t),r(n(2417),t),r(n(1406),t),r(n(1333),t),r(n(7512),t),r(n(7787),t),r(n(7410),t),r(n(7023),t),r(n(1405),t),r(n(1361),t),r(n(6830),t),r(n(5902),t),r(n(4143),t),r(n(2176),t),r(n(9122),t),r(n(1375),t),r(n(2636),t),r(n(3206),t),r(n(1637),t),r(n(8e3),t),r(n(586),t),r(n(1098),t),r(n(2059),t),r(n(1812),t),r(n(8578),t),r(n(4534),t),r(n(3401),t),r(n(6634),t),r(n(1881),t),r(n(8023),t),r(n(2397),t),r(n(3932),t),r(n(3091),t),Object.assign((0,s._getStatsigGlobal)(),{Log:l.Log,SDK_VERSION:u.SDK_VERSION})},2016:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AutoInit=void 0;const m=n(6914),y=n(2018);function b(e,t){var n;return null!=(n=t.get(e))?n:t.get(e.toLowerCase())}t.AutoInit=class{static attempt(t){var e,n,i,r,s;try{var a=(0,m._getWindowSafe)(),o=(0,m._getDocumentSafe)();if(a&&o&&o.currentScript){var l=o.currentScript.getAttribute("src"),u=null==(e=a.location)?void 0:e.href;if(l&&u){var c=new URL(l,u).searchParams,d=null!=(n=b("sdkKey",c))?n:b("apiKey",c);if(d){var h={},_=b("proxy",c),g=(_&&(h.networkConfig={api:_}),null==(r=null==(i=(0,m._getStatsigGlobal)())?void 0:i.instances)?void 0:r[d]);let e=null;if(e=g instanceof y.StatsigClient?g:e)t({sdkKey:d,client:e});else{var v=o.currentScript.dataset;const f=function(e,t){if(e)if(e in t&&"function"==typeof t[e])return t[e];return null}(null!=(s=v.onstatsiginit)?s:v.onStatsigInit,a),p=new y.StatsigClient(d,function(){var e=(0,m._getWindowSafe)();if(!e)return{};let t=e.statsigUser||{};var n=(t="object"!=typeof t?{}:t).custom||{},i=t.customIDs||{};return Object.assign(Object.assign({},t),{customIDs:Object.assign({},i),custom:Object.assign(Object.assign({},n),{useragent:e.navigator.userAgent,page_url:(0,m._getCurrentPageUrlSafe)()||"",language:null==(i=e.navigator)?void 0:i.language})})}(),h);p.initializeAsync().then(()=>{f&&f(p)}).catch(e=>{m.Log.error(e)}),t({sdkKey:d,client:p})}}}}}catch(e){m.Log.error("AutoInit failed",e)}}}},7476:function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(1964);i=i(n(1964)),n=n(2016);t.default=i.default,n.AutoInit.attempt(({client:e})=>{new r.AutoCapture(e)})},7262:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._resolveDeltasResponse=void 0;const i=n(6914);function r(e,t){null!=e&&e.forEach(e=>{delete t[e]})}t._resolveDeltasResponse=function(e,t){var n;return(t=(0,i._typedJsonParse)(t,"checksum","DeltasEvaluationResponse"))?(e=e,n=t,e=Object.assign(Object.assign(Object.assign({},e),n),{feature_gates:Object.assign(Object.assign({},e.feature_gates),n.feature_gates),layer_configs:Object.assign(Object.assign({},e.layer_configs),n.layer_configs),dynamic_configs:Object.assign(Object.assign({},e.dynamic_configs),n.dynamic_configs)}),r((e=n=e).deleted_gates,e.feature_gates),delete e.deleted_gates,r(n.deleted_configs,e.dynamic_configs),delete e.deleted_configs,r(n.deleted_layers,e.layer_configs),delete e.deleted_layers,n=e,(e=(0,i._DJB2Object)({feature_gates:n.feature_gates,dynamic_configs:n.dynamic_configs,layer_configs:n.layer_configs},2))===t.checksumV2?JSON.stringify(n):{hadBadDeltaChecksum:!0,badChecksum:e,badMergedConfigs:n,badFullResponse:t.deltas_full_response}):{hadBadDeltaChecksum:!0}}},4845:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(6914),s=n(140),a=n(7095);t.default=class{constructor(e){this._sdkKey=e,this._rawValues=null,this._values=null,this._source="Uninitialized",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings=new Set}reset(){this._values=null,this._rawValues=null,this._source="Loading",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings.clear()}finalize(){this._values||(this._source="NoValues")}getValues(){return this._rawValues?(0,r._typedJsonParse)(this._rawValues,"has_updates","EvaluationStoreValues"):null}setValues(e,t){var n,i;return!!e&&null!=(i=(0,r._typedJsonParse)(e.data,"has_updates","EvaluationResponse"))&&(this._source=e.source,!0!==(null==i?void 0:i.has_updates)||(null!=(n=i.time)?n:0)<this._lcut||(this._rawValues=e.data,this._lcut=i.time,this._receivedAt=e.receivedAt,"init-v2"===i.response_format?this._values=new a.V2InitializeContainer(i):this._values=new s.V1InitializeContainer(i),this._bootstrapMetadata=this._extractBootstrapMetadata(e.source,i),e.source&&i.user&&this._setWarningState(t,i),r.SDKFlags.setFlags(this._sdkKey,null!=(n=i.sdk_flags)?n:{})),!0)}getWarnings(){if(0!==this._warnings.size)return Array.from(this._warnings)}getGate(e){e=this._values?this._values.getGate(e):null;return this._getDetailedStoreResult(e)}getConfig(e){e=this._values?this._values.getConfig(e):null;return this._getDetailedStoreResult(e)}getConfigList(){return this._values?this._values.getConfigList():[]}getLayer(e){e=this._values?this._values.getLayer(e):null;return this._getDetailedStoreResult(e)}getParamStore(e){e=this._values?this._values.getParamStore(e):null;return this._getDetailedStoreResult(e)}getSource(){return this._source}getExposureMapping(){var e;return null==(e=this._values)?void 0:e.getExposureMapping()}_extractBootstrapMetadata(e,t){return"Bootstrap"!==e?null:(e={},t.user&&(e.user=t.user),t.sdkInfo&&(e.generatorSDKInfo=t.sdkInfo),e.lcut=t.time,e)}_getDetailedStoreResult(e){return{result:e,details:this._getDetails(null==e)}}_setWarningState(e,t){var n,i=r.StableID.get(this._sdkKey);(null==(n=e.customIDs)?void 0:n.stableID)!==i&&(null!=(n=e.customIDs)&&n.stableID||i)?this._warnings.add("StableIDMismatch"):"user"in t&&(n=t.user,i=Object.assign(Object.assign({},e),{analyticsOnlyMetadata:void 0,privateAttributes:void 0}),(0,r._getFullUserHash)(i)!==(0,r._getFullUserHash)(n))&&this._warnings.add("PartialUserMatch")}getCurrentSourceDetails(){var e;return"Uninitialized"===this._source||"NoValues"===this._source?{reason:this._source}:(e={reason:this._source,lcut:this._lcut,receivedAt:this._receivedAt},0<this._warnings.size&&(e.warnings=Array.from(this._warnings)),e)}_getDetails(e){var t=this.getCurrentSourceDetails();let n=t.reason;var i=null!=(i=t.warnings)?i:[],e=("Bootstrap"===this._source&&0<i.length&&(n+=i[0]),"Uninitialized"!==n&&"NoValues"!==n&&(n=n+":"+(e?"Unrecognized":"Recognized")),"Bootstrap"===this._source&&null!=(i=this._bootstrapMetadata)?i:void 0);return e&&(t.bootstrapMetadata=e),Object.assign(Object.assign({},t),{reason:n})}}},8448:function(e,t,n){"use strict";var l=this&&this.__awaiter||function(e,a,o,l){return new(o=o||Promise)(function(n,t){function i(e){try{s(l.next(e))}catch(e){t(e)}}function r(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?n(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(i,r)}s((l=l.apply(e,a||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const u=n(6914),a=n(7262);class i extends u.NetworkCore{constructor(e,t){super(e,t);t=null==e?void 0:e.networkConfig;this._option=e,this._initializeUrlConfig=new u.UrlConfiguration(u.Endpoint._initialize,null==t?void 0:t.initializeUrl,null==t?void 0:t.api,null==t?void 0:t.initializeFallbackUrls)}fetchEvaluations(i,r,s,a,o){return l(this,void 0,void 0,function*(){var e,t=r?(0,u._typedJsonParse)(r,"has_updates","InitializeResponse"):null;let n={user:a,hash:null!=(e=null==(e=null==(e=this._option)?void 0:e.networkConfig)?void 0:e.initializeHashAlgorithm)?e:"djb2",deltasResponseRequested:!1,full_checksum:null};return null!=t&&t.has_updates&&(e=(null==t?void 0:t.hash_used)!==(null!=(e=null==(e=null==(e=this._option)?void 0:e.networkConfig)?void 0:e.initializeHashAlgorithm)?e:"djb2"),n=Object.assign(Object.assign({},n),{sinceTime:o&&!e?t.time:0,previousDerivedFields:"derived_fields"in t&&o?t.derived_fields:{},deltasResponseRequested:!0,full_checksum:t.full_checksum,partialUserMatchSinceTime:e?0:t.time})),this._fetchEvaluations(i,t,n,s)})}_fetchEvaluations(n,i,r,s){return l(this,void 0,void 0,function*(){var e,t=yield this.post({sdkKey:n,urlConfig:this._initializeUrlConfig,data:r,retries:2,isStatsigEncodable:!0,priority:s});return 204===(null==t?void 0:t.code)?'{"has_updates": false}':200!==(null==t?void 0:t.code)?null!=(e=null==t?void 0:t.body)?e:null:!0!==(null==i?void 0:i.has_updates)||!0!==(null==(e=t.body)?void 0:e.includes('"is_delta":true'))||!0!==r.deltasResponseRequested?t.body:"string"==typeof(e=(0,a._resolveDeltasResponse)(i,t.body))?e:this._fetchEvaluations(n,i,Object.assign(Object.assign(Object.assign({},r),e),{deltasResponseRequested:!1}),s)})}}t.default=i},3583:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._makeParamStoreGetter=void 0;const h=n(6914),_={disableExposureLog:!0};function g(e){return null==e||!1===e.disableExposureLog}function v(e,t){return null!=t&&!(0,h._isTypeMatch)(e,t)}t._makeParamStoreGetter=function(u,c,d){return(e,t)=>{if(null==c)return t;var n,i,r,s,a,o,l=c[e];if(null==l||null!=t&&(0,h._typeOf)(t)!==l.param_type)return t;switch(l.ref_type){case"static":return l.value;case"gate":return o=l,u.getFeatureGate(o.gate_name,g(d)?void 0:_).value?o.pass_value:o.fail_value;case"dynamic_config":return o=l,a=t,v(s=(s=u).getDynamicConfig(o.config_name,g(d)?void 0:_).get(o.param_name),a)?a:s;case"experiment":return a=l,s=t,v(r=(r=u).getExperiment(a.experiment_name,g(d)?void 0:_).get(a.param_name),s)?s:r;case"layer":return r=l,i=t,v(n=(n=u).getLayer(r.layer_name,g(d)?void 0:_).get(r.param_name),i)?i:n;default:return t}}}},8198:function(e,t,n){"use strict";var s=this&&this.__awaiter||function(e,a,o,l){return new(o=o||Promise)(function(n,t){function i(e){try{s(l.next(e))}catch(e){t(e)}}function r(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?n(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(i,r)}s((l=l.apply(e,a||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const a=n(6914),o=n(4845),l=n(8448),r=n(3583),u=n(4131);class i extends a.StatsigClientBase{static instance(e){var t=(0,a._getStatsigGlobal)().instance(e);return t instanceof i?t:(a.Log.warn((0,a._isServerEnv)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new i(null!=e?e:"",{}))}constructor(e,t,n=null){a.SDKType._setClientType(e,"javascript-client");var i,r=new l.default(n,e=>{this.$emt(e)}),e=(super(e,null!=(i=null==n?void 0:n.dataAdapter)?i:new u.StatsigEvaluationsDataAdapter,r,n),this._possibleFirstTouchMetadata={},this.getFeatureGate=this._memoize(a.MemoPrefix._gate,this._getFeatureGateImpl.bind(this)),this.getDynamicConfig=this._memoize(a.MemoPrefix._dynamicConfig,this._getDynamicConfigImpl.bind(this)),this.getExperiment=this._memoize(a.MemoPrefix._experiment,this._getExperimentImpl.bind(this)),this.getConfigList=this._memoize(a.MemoPrefix._configList,this._getConfigListImpl.bind(this)),this.getLayer=this._memoize(a.MemoPrefix._layer,this._getLayerImpl.bind(this)),this.getParameterStore=this._memoize(a.MemoPrefix._paramStore,this._getParameterStoreImpl.bind(this)),this._store=new o.default(e),this._network=r,this._user=this._configureUser(t,n),this._sdkInstanceID=(0,a.getUUID)(),null!=(i=null==n?void 0:n.plugins)?i:[]);for(const s of e)s.bind(this)}initializeSync(e){var t;return"Uninitialized"!==this.loadingStatus?(0,a.createUpdateDetails)(!0,this._store.getSource(),-1,null,null,["MultipleInitializations",...null!=(t=this._store.getWarnings())?t:[]]):(this._logger.start(),this.updateUserSync(this._user,e))}initializeAsync(e){return s(this,void 0,void 0,function*(){return this._initializePromise||(this._initializePromise=this._initializeAsyncImpl(e)),this._initializePromise})}updateUserSync(t,e){var n=performance.now();try{return this._updateUserSyncImpl(t,e,n)}catch(e){t=e instanceof Error?e:new Error(String(e));return this._createErrorUpdateDetails(t,n)}}_updateUserSyncImpl(e,t,n){var i=[...null!=(i=this._store.getWarnings())?i:[]],e=(this._resetForUser(e),this.dataAdapter.getDataSync(this._user)),t=(null==e&&i.push("NoCachedValues"),this._store.setValues(e,this._user),this._finalizeUpdate(e),null==t?void 0:t.disableBackgroundCacheRefresh);return!0===t||null==t&&"Bootstrap"===(null==e?void 0:e.source)||this._runPostUpdate(null!=e?e:null,this._user),(0,a.createUpdateDetails)(!0,this._store.getSource(),performance.now()-n,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),i)}updateUserAsync(e,i){return s(this,void 0,void 0,function*(){var t=performance.now();try{return yield this._updateUserAsyncImpl(e,i)}catch(e){var n=e instanceof Error?e:new Error(String(e));return this._createErrorUpdateDetails(n,t)}})}_updateUserAsyncImpl(i,r){return s(this,void 0,void 0,function*(){this._resetForUser(i);var e=this._user,t=(a.Diagnostics._markInitOverallStart(this._sdkKey),this.dataAdapter.getDataSync(e));if(this._store.setValues(t,this._user),this._setStatus("Loading",t),t=yield this.dataAdapter.getDataAsync(t,e,r),e!==this._user)return(0,a.createUpdateDetails)(!1,this._store.getSource(),-1,new Error("User changed during update"),this._network.getLastUsedInitUrlAndReset());let n=!1;null!=t&&(a.Diagnostics._markInitProcessStart(this._sdkKey),n=this._store.setValues(t,this._user),a.Diagnostics._markInitProcessEnd(this._sdkKey,{success:n})),this._finalizeUpdate(t),n||(this._errorBoundary.attachErrorIfNoneExists(a.UPDATE_DETAIL_ERROR_MESSAGES.NO_NETWORK_DATA),this.$emt({name:"initialization_failure"})),a.Diagnostics._markInitOverallEnd(this._sdkKey,n,this._store.getCurrentSourceDetails());e=a.Diagnostics._enqueueDiagnosticsEvent(this._user,this._logger,this._sdkKey,this._options);return(0,a.createUpdateDetails)(n,this._store.getSource(),e,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),this._store.getWarnings())})}getContext(){let e={};try{e=JSON.parse(JSON.stringify(this._user))}catch(e){a.Log.error("Failed to parse user")}return{sdkKey:this._sdkKey,options:this._options,values:this._store.getValues(),user:e,errorBoundary:this._errorBoundary,session:a.StatsigSession.get(this._sdkKey),stableID:a.StableID.get(this._sdkKey),sdkInstanceID:this._sdkInstanceID}}checkGate(e,t){return this.getFeatureGate(e,t).value}logEvent(e,t,n){t="string"==typeof e?{eventName:e,value:t,metadata:n}:e;this.$emt({name:"log_event_called",event:t}),this._logger.enqueue(Object.assign(Object.assign({},t),{user:this._user,time:Date.now()}))}updateUserWithAnalyticsOnlyMetadata(e){this._user=this._configureUser(Object.assign(Object.assign({},this._user),{analyticsOnlyMetadata:e}),this._options)}_primeReadyRipcord(){this.$on("error",()=>{"Loading"===this.loadingStatus&&this._finalizeUpdate(null)})}_initializeAsyncImpl(e){return s(this,void 0,void 0,function*(){return a.Storage.isReady()||(yield a.Storage.isReadyResolver()),this._logger.start(),this.updateUserAsync(this._user,e)})}_createErrorUpdateDetails(e,t){return(0,a.createUpdateDetails)(!1,this._store.getSource(),performance.now()-t,e,null,[...null!=(t=this._store.getWarnings())?t:[]])}_finalizeUpdate(e){this._store.finalize(),this._setStatus("Ready",e)}_runPostUpdate(e,t){this.dataAdapter.getDataAsync(e,t,{priority:"low"}).catch(e=>{a.Log.error("An error occurred after update.",e)})}_resetForUser(e){this._logger.reset(),this._store.reset(),this._user=this._configureUser(e,this._options)}_configureUser(e,t){var n,e=(0,a._normalizeUser)(e,t);const i=null==(t=e.customIDs)?void 0:t.stableID;return i&&((n=null==(n=(t=this.storageProvider).isReadyResolver)?void 0:n.call(t))?n.then(()=>a.StableID.setOverride(i,this._sdkKey),()=>a.StableID.setOverride(i,this._sdkKey)):a.StableID.setOverride(i,this._sdkKey)),0<Object.keys(this._possibleFirstTouchMetadata).length&&(e.analyticsOnlyMetadata=Object.assign(Object.assign({},e.analyticsOnlyMetadata),this._possibleFirstTouchMetadata)),e}_getFeatureGateImpl(e,t){var{result:n,details:i}=this._store.getGate(e),i=(0,a._makeFeatureGate)(e,i,n),r=null==(r=null==(n=this.overrideAdapter)?void 0:n.getGateOverride)?void 0:r.call(n,i,this._user,t),n=null!=r?r:i;return this._enqueueExposure(e,(0,a._createGateExposure)(this._user,n,this._store.getExposureMapping()),t),this.$emt({name:"gate_evaluation",gate:n}),n}_getDynamicConfigImpl(e,t){var{result:n,details:i}=this._store.getConfig(e),i=(0,a._makeDynamicConfig)(e,i,n),r=null==(r=null==(n=this.overrideAdapter)?void 0:n.getDynamicConfigOverride)?void 0:r.call(n,i,this._user,t),n=null!=r?r:i;return this._enqueueExposure(e,(0,a._createConfigExposure)(this._user,n,this._store.getExposureMapping()),t),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:n}),n}_getExperimentImpl(e,t){var{result:n,details:i}=this._store.getConfig(e),i=(0,a._makeExperiment)(e,i,n),r=(null!=i.__evaluation&&(i.__evaluation.secondary_exposures=(0,a._mapExposures)(null!=(n=null==(n=i.__evaluation)?void 0:n.secondary_exposures)?n:[],this._store.getExposureMapping())),null==(r=null==(n=this.overrideAdapter)?void 0:n.getExperimentOverride)?void 0:r.call(n,i,this._user,t)),n=null!=r?r:i;return this._enqueueExposure(e,(0,a._createConfigExposure)(this._user,n,this._store.getExposureMapping()),t),this.$emt({name:"experiment_evaluation",experiment:n}),n}_getConfigListImpl(){return this._store.getConfigList()}_getLayerImpl(t,n){var{result:e,details:i}=this._store.getLayer(t),i=(0,a._makeLayer)(t,i,e),r=null==(r=null==(e=this.overrideAdapter)?void 0:e.getLayerOverride)?void 0:r.call(e,i,this._user,n);null!=n&&n.disableExposureLog&&this._logger.incrementNonExposureCount(t);const s=(0,a._mergeOverride)(i,r,null!=(e=null==r?void 0:r.__value)?e:i.__value,e=>{null!=n&&n.disableExposureLog||this._enqueueExposure(t,(0,a._createLayerParameterExposure)(this._user,s,e,this._store.getExposureMapping()),n)});return this.$emt({name:"layer_evaluation",layer:s}),s}_getParameterStoreImpl(e,t){var{result:n,details:i}=this._store.getParamStore(e),e=(this._logger.incrementNonExposureCount(e),{name:e,details:i,__configuration:n,get:(0,r._makeParamStoreGetter)(this,n,t)}),n=null==(n=null==(i=this.overrideAdapter)?void 0:i.getParamStoreOverride)?void 0:n.call(i,e,t);return null!=n&&(e.__configuration=n.config,e.details=n.details,e.get=(0,r._makeParamStoreGetter)(this,n.config,t)),e}}t.default=i},4131:function(e,t,n){"use strict";var s=this&&this.__awaiter||function(e,a,o,l){return new(o=o||Promise)(function(n,t){function i(e){try{s(l.next(e))}catch(e){t(e)}}function r(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?n(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(i,r)}s((l=l.apply(e,a||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigEvaluationsDataAdapter=void 0;const i=n(6914),r=n(8448);class a extends i.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this._network=null,this._options=null}attach(e,t,n){super.attach(e,t,n),null!==n&&n instanceof r.default?this._network=n:this._network=new r.default(null!=t?t:{})}getDataAsync(e,t,n){return this._getDataAsyncImpl(e,(0,i._normalizeUser)(t,this._options),n)}prefetchData(e,t){return this._prefetchDataImpl(e,t)}setData(e){var t=(0,i._typedJsonParse)(e,"has_updates","data");t&&"user"in t?super.setData(e,t.user):i.Log.error("StatsigUser not found. You may be using an older server SDK version. Please upgrade your SDK or use setDataLegacy.")}setDataLegacy(e,t){super.setData(e,t)}_fetchFromNetwork(t,n,i,r){return s(this,void 0,void 0,function*(){var e=yield null==(e=this._network)?void 0:e.fetchEvaluations(this._getSdkKey(),t,null==i?void 0:i.priority,n,r);return null!=e?e:null})}_getCacheKey(e){e=(0,i._getStorageKey)(this._getSdkKey(),e,null==(e=this._options)?void 0:e.customUserCacheKeyFunc);return`${i.DataAdapterCachePrefix}.${this._cacheSuffix}.`+e}_isCachedResultValidFor204(e,t){return null!=e.fullUserHash&&e.fullUserHash===(0,i._getFullUserHash)(t)}}t.StatsigEvaluationsDataAdapter=a},140:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.V1InitializeContainer=void 0;const i=n(6914);t.V1InitializeContainer=class{constructor(e){this._values=e}getGate(e){return this._getResultFromLookup(this._values.feature_gates,e)}getConfig(e){return this._getResultFromLookup(this._values.dynamic_configs,e)}getLayer(e){return this._getResultFromLookup(this._values.layer_configs,e)}getParamStore(e){return this._getResultFromLookup(this._values.param_stores,e)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(e,t){var n;return e&&null!=(n=null!=(n=e[t])?n:e[(0,i._DJB2)(t)])?n:null}}},7095:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.V2InitializeContainer=void 0;const i=n(6914);t.V2InitializeContainer=class{constructor(e){this._values=e}getGate(e){var t=this._getResultFromLookup(this._values.feature_gates,e);return t?{name:e,value:!0===t.v,rule_id:null!=(e=t.r)?e:"default",secondary_exposures:null!=(e=t.s)?e:[],id_type:null!=(e=t.i)?e:""}:null}getConfig(e){var t=this._getResultFromLookup(this._values.dynamic_configs,e);return t?{name:e,value:null!=(e=this._values.values[t.v])?e:{},rule_id:t.r,secondary_exposures:null!=(e=t.s)?e:[],id_type:null!=(e=t.i)?e:"",is_user_in_experiment:!0===t.ue,passed:!0===t.p,group_name:null!=(e=t.gn)?e:void 0,is_experiment_active:!0===t.ea,group:t.r,is_device_based:"stableID"===t.i}:null}getLayer(e){var t=this._getResultFromLookup(this._values.layer_configs,e);return t?{name:e,value:null!=(e=this._values.values[t.v])?e:{},rule_id:t.r,secondary_exposures:null!=(e=t.s)?e:[],is_user_in_experiment:!0===t.ue,group_name:null!=(e=t.gn)?e:void 0,is_experiment_active:!0===t.ea,group:t.r,is_device_based:"stableID"===t.i,allocated_experiment_name:null!=(e=t.ae)?e:"",explicit_parameters:null!=(e=t.ep)?e:[],undelegated_secondary_exposures:null!=(e=t.us)?e:[],parameter_rule_ids:t.pr}:null}getParamStore(e){return this._getResultFromLookup(this._values.param_stores,e)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(e,t){var n;return e&&null!=(n=null!=(n=e[t])?n:e[(0,i._DJB2)(t)])?n:null}}},2018:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&("get"in r?t.__esModule:!r.writable&&!r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){e[i=void 0===i?n:i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)},s=(Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigClient=void 0,n(6914)),a=n(8198),r=(t.StatsigClient=a.default,r(n(6914),t),Object.assign((0,s._getStatsigGlobal)(),{StatsigClient:a.default}));t.default=r},4535:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AutoCapture=t.runStatsigAutoCapture=t.StatsigAutoCapturePlugin=void 0;const c=n(6914),a=n(5423),r=n(8872),s=n(7875),o=n(6714),l=n(4716),u=n(2678),d=n(5864),h=n(3769),_=n(9900),g={submit:a.AutoCaptureEventName.FORM_SUBMIT,click:a.AutoCaptureEventName.CLICK,copy:a.AutoCaptureEventName.COPY,cut:a.AutoCaptureEventName.COPY};function i(e,t){if((0,c._isServerEnv)())return null;var n=e.getContext()["sdkKey"];if(!(0,c._isServerEnv)()){var i=null!=(i=(0,c._getStatsigGlobal)().acInstances)?i:{};if(i[n])return i[n]}return new v(e,t)}t.StatsigAutoCapturePlugin=class{constructor(e){this._options=e,this.__plugin="auto-capture"}bind(e){i(e,this._options)}},t.runStatsigAutoCapture=i;class v{constructor(e,t){this._client=e,this._disabledEvents={},this._previousLoggedPageViewUrl=null,this._hasLoggedPageViewEnd=!1,this._pageViewLogged=!1;var{sdkKey:e,errorBoundary:n,values:i}=e.getContext(),n=(this._options=t,this._disabledEvents=null!=(i=null==(i=null==i?void 0:i.auto_capture_settings)?void 0:i.disabled_events)?i:{},this._errorBoundary=n,this._errorBoundary.wrap(this,"autoCapture:"),this._client.$on("values_updated",()=>{var e=this._client.getContext().values;this._disabledEvents=null!=(e=null==(e=null==e?void 0:e.auto_capture_settings)?void 0:e.disabled_events)?e:this._disabledEvents}),this._engagementManager=new o.EngagementManager,this._rageClickManager=new l.default,this._webVitalsManager=new u.WebVitalsManager(this._enqueueAutoCapture.bind(this),n),this._deadClickManager=new s.default(this._enqueueAutoCapture.bind(this),n),this._consoleLogManager=new r.ConsoleLogManager(this._enqueueAutoCapture.bind(this),n,null!=(i=null==t?void 0:t.consoleLogAutoCaptureSettings)?i:{enabled:!1}),this._eventFilterFunc=null==t?void 0:t.eventFilterFunc,(0,c._getDocumentSafe)());(0,c._isServerEnv)()||((t=null!=(i=(__STATSIG__=(0,c._getStatsigGlobal)()).acInstances)?i:{})[e]=this,__STATSIG__.acInstances=t),"loading"===(null==n?void 0:n.readyState)?n.addEventListener("DOMContentLoaded",()=>this._initialize()):this._initialize()}_addEventHandlers(){var e=(0,c._getWindowSafe)(),t=(0,c._getDocumentSafe)();if(e&&t){const n=(e,t=!0)=>{e=e||(null==(e=(0,c._getWindowSafe)())?void 0:e.event);this._autoLogEvent(e),t&&this._engagementManager.bumpInactiveTimer(),"click"===e.type&&e instanceof MouseEvent&&this._rageClickManager.isRageClick(e.clientX,e.clientY,Date.now())&&this._logRageClick(e)};(0,d._registerEventHandler)(t,"click",e=>n(e)),(0,d._registerEventHandler)(t,"submit",e=>n(e)),(0,d._registerEventHandler)(t,"copy",e=>n(e)),(0,d._registerEventHandler)(t,"cut",e=>n(e)),(0,d._registerEventHandler)(e,"error",e=>n(e,!1)),(0,d._registerEventHandler)(e,"pagehide",()=>this._tryLogPageViewEnd()),(0,d._registerEventHandler)(e,"beforeunload",()=>this._tryLogPageViewEnd())}}_addPageViewTracking(){var e=(0,c._getWindowSafe)(),t=(0,c._getDocumentSafe)();if(e&&t){if((0,d._registerEventHandler)(e,"popstate",()=>this._tryLogPageView("popstate")),e.history&&"function"==typeof Proxy&&"function"==typeof e.history.pushState)try{var n=e.history.pushState;e.history.pushState=new Proxy(n,{apply:(e,t,[n,i,r])=>{e=e.apply(t,[n,i,r]);return this._tryLogPageView("pushstate"),e}})}catch(e){}if(e.history&&"function"==typeof Proxy&&"function"==typeof e.history.replaceState)try{var i=e.history.replaceState;e.history.replaceState=new Proxy(i,{apply:(e,t,[n,i,r])=>{e=e.apply(t,[n,i,r]);return this._tryLogPageView("replacestate"),e}})}catch(e){}this._tryLogPageView()}}_autoLogEvent(e){var t=null==(t=e.type)?void 0:t.toLowerCase();if("error"===t&&e instanceof ErrorEvent)this._logError(e);else{var n=(0,d._getTargetNode)(e);if(n){t=g[t];if(t){var i=t===a.AutoCaptureEventName.COPY;if((0,d._shouldLogEvent)(e,n,i)){var r={};if(i){i=null==(i=null==(i=(0,c._getWindowSafe)())?void 0:i.getSelection())?void 0:i.toString();if(!i)return;null!=(s=this._options)&&s.captureCopyText&&(r.selectedText=(0,d._sanitizeString)(i));var s=e.type||"clipboard";r.clipType=s}var{value:i,metadata:e}=(0,h._gatherEventData)(n),s=(e.isOutbound&&this._engagementManager.setMeaningfulEngagementOccurred(!0),Object.assign(r,e),(0,_._gatherAllMetadata)((0,d._getSafeUrl)()));this._enqueueAutoCapture(t,i,Object.assign(Object.assign({},s),r))}}}}}_initialize(){this._webVitalsManager.startTracking(),this._deadClickManager.startTracking(),this._consoleLogManager.startTracking(),this._engagementManager.startInactivityTracking(()=>this._tryLogPageViewEnd(!0)),this._addEventHandlers(),this._addPageViewTracking(),this._logSessionStart(),this._logPerformance()}_logError(e){var t=(null==e?void 0:e.error)||{};let n=t;if("object"==typeof t)try{n=JSON.stringify(t)}catch(e){n="function"==typeof(null==t?void 0:t.toString)?t.toString():"Unknown Error"}this._enqueueAutoCapture(a.AutoCaptureEventName.ERROR,e.message,{message:e.message,filename:e.filename,lineno:e.lineno,colno:e.colno,error_str:n})}_logSessionStart(){var e=this._getSessionFromClient();try{this._isNewSession(e)&&this._enqueueAutoCapture(a.AutoCaptureEventName.SESSION_START,(0,d._getSanitizedPageUrl)(),Object.assign({sessionID:e.data.sessionID},(0,_._gatherAllMetadata)((0,d._getSafeUrl)())),{flushImmediately:!0})}catch(e){this._errorBoundary.logError("AC::logSession",e)}}_tryLogPageView(e){var t=(0,d._getSafeUrl)(),n=this._previousLoggedPageViewUrl;n&&t.pathname===n.pathname||(this._engagementManager.setLastPageViewTime(Date.now()),n=(this._hasLoggedPageViewEnd=!1,_._gatherAllMetadata)(t),e&&(n.navigation_type=e),this._previousLoggedPageViewUrl&&(n.last_page_view_url=this._previousLoggedPageViewUrl.href),this._pageViewLogged||(this._updateClientWithPossibleFirstTouchMetadata(),this._pageViewLogged=!0),this._enqueueAutoCapture(a.AutoCaptureEventName.PAGE_VIEW,(0,d._getSanitizedPageUrl)(),n,{flushImmediately:!0,addNewSessionMetadata:!0}),this._previousLoggedPageViewUrl=t,this._engagementManager.bumpInactiveTimer())}_tryLogPageViewEnd(e=!1){this._hasLoggedPageViewEnd||(this._hasLoggedPageViewEnd=!0,this._enqueueAutoCapture(a.AutoCaptureEventName.PAGE_VIEW_END,(0,d._getSanitizedPageUrl)(),Object.assign(Object.assign({},this._engagementManager.getPageViewEndMetadata()),{dueToInactivity:e}),{flushImmediately:!0}))}_logRageClick(e){var t,n;(0,d._shouldLogEvent)(e,e.target)&&({value:t,metadata:n}=(0,h._gatherEventData)(e.target),this._enqueueAutoCapture(a.AutoCaptureEventName.RAGE_CLICK,t,Object.assign(Object.assign({x:e.clientX,y:e.clientY,timestamp:Date.now()},(0,_._gatherAllMetadata)((0,d._getSafeUrl)())),n)))}_logPerformance(){const n=(0,c._getWindowSafe)();n&&n.performance&&void 0!==(null===n||void 0===n?void 0:n.performance)&&"function"==typeof n.performance.getEntriesByType&&"function"==typeof n.performance.getEntriesByName&&setTimeout(()=>{var e={},t=n.performance.getEntriesByType("navigation"),t=(t&&0<t.length&&t[0]instanceof PerformanceNavigationTiming&&(t=t[0],e.load_time_ms=t.duration,e.dom_interactive_time_ms=t.domInteractive-t.startTime,e.redirect_count=t.redirectCount,e.transfer_bytes=t.transferSize),n.performance.getEntriesByName("first-contentful-paint"));t&&0<t.length&&t[0]instanceof PerformancePaintTiming&&(e.first_contentful_paint_time_ms=t[0].startTime),this._enqueueAutoCapture(a.AutoCaptureEventName.PERFORMANCE,(0,d._getSanitizedPageUrl)(),Object.assign(Object.assign({},e),(0,_._getNetworkInfo)()))},1)}_enqueueAutoCapture(e,t,n,i){var r,s,a;if(t){var o=e.slice("auto_capture::".length);if(!this._disabledEvents[e]&&!this._disabledEvents[o]){o=this._getSessionFromClient();try{var l=Object.assign({sessionID:o.data.sessionID,page_url:null!=(a=null==(s=null==(r=(0,c._getWindowSafe)())?void 0:r.location)?void 0:s.href)?a:""},n),u=(null!=i&&i.addNewSessionMetadata&&(l.isNewSession=String(this._isNewSession(o))),{eventName:e,value:t,metadata:l});this._eventFilterFunc&&!this._eventFilterFunc(u)||(this._client.logEvent(u),null!=i&&i.flushImmediately&&this._flushImmediately())}catch(e){this._errorBoundary.logError("AC::enqueue",e)}}}}_updateClientWithPossibleFirstTouchMetadata(){var e=this._client;e._possibleFirstTouchMetadata=(0,_._getPossibleFirstTouchMetadata)((0,d._getSafeUrl)()),0<Object.keys(e._possibleFirstTouchMetadata).length&&(e._user=Object.assign(Object.assign({},e._user),{analyticsOnlyMetadata:Object.assign(Object.assign({},e._possibleFirstTouchMetadata),e._user.analyticsOnlyMetadata)}))}_flushImmediately(){this._client.flush().catch(e=>{c.Log.error(e)})}_isNewSession(e){return Math.abs(e.data.startTime-Date.now())<1e3}_getSessionFromClient(){return this._client.getContext().session}static getAllMetadata(){return(0,_._gatherAllMetadata)((0,d._getSafeUrl)())}}t.AutoCapture=v},5423:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AutoCaptureEventName=void 0,t.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:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConsoleLogManager=void 0;const i=n(6914),r=n(5423),o=n(5864),l=n(8135),s=n(9900),u={trace:10,debug:20,log:30,info:30,warn:40,error:50};t.ConsoleLogManager=class{constructor(e,t,n){this._enqueueFn=e,this._errorBoundary=t,this._options=n,this._restoreFns=[],this._isTracking=!1,this._logLevel="info",this.__source="js-auto-capture",this._logLevel=null!=(e=this._options.logLevel)?e:"info",this._maxKeys=null!=(t=this._options.maxKeys)?t:50,this._maxDepth=null!=(n=this._options.maxDepth)?n:10,this._maxStringLength=null!=(e=this._options.maxStringLength)?e:2500}startTracking(){try{!this._isTracking&&this._options.enabled&&(0,i._getWindowSafe)()&&(this._patchConsole(),this._isTracking=!0)}catch(e){i.Log.error("Error starting console log tracking",e),this._errorBoundary.logError("autoCapture:ConsoleLogManager",e)}}stopTracking(){this._isTracking&&(this._restoreFns.forEach(e=>e()),this._restoreFns=[],this._isTracking=!1)}_patchConsole(){Object.entries(u).forEach(([s,e])=>{if(!(e<u[this._logLevel])&&console[s]){const a=console[s].bind(console);let r=!1;e=(0,o.wrapFunctionWithRestore)(console,s,i=>(...t)=>{if(i(...t),!r){r=!0;try{var e=t.map(e=>(0,l._safeStringify)(e,this._maxKeys,this._maxDepth,this._maxStringLength)),n=(0,l._getStackTrace)();this._enqueueConsoleLog(s,e,n)}catch(e){a("console observer error:",e,...t),this._errorBoundary.logError("autoCapture:ConsoleLogManager",e)}finally{r=!1}}});this._restoreFns.push(e)}})}_enqueueConsoleLog(e,t,n){this._shouldLog(t)&&(e=Object.assign({status:"log"===e?"info":e,log_level:e,payload:t,trace:n,timestamp:Date.now(),source:this.__source},(0,s._gatherAllMetadata)((0,o._getSafeUrl)())),this._enqueueFn(r.AutoCaptureEventName.CONSOLE_LOG,t.join(" "),e))}_shouldLog(e){for(const t of e)if(t.includes("[Statsig]"))return!1;return!this._options.sampleRate||"number"!=typeof this._options.sampleRate||this._options.sampleRate<=0||1<=this._options.sampleRate||Math.random()<this._options.sampleRate}}},7875:(e,n,t)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DeadClickConfig=void 0;const a=t(6914),r=t(5423),s=t(5864),o=t(3769),l=t(9900);n.DeadClickConfig={CLICK_CHECK_TIMEOUT:1e3,SCROLL_DELAY_MS:100,SELECTION_CHANGE_DELAY_MS:100,MUTATION_DELAY_MS:2500,ABSOLUTE_DEAD_CLICK_TIMEOUT:2750};n.default=class{constructor(e,t){this._enqueueFn=e,this._errorBoundary=t,this._lastMutationTime=0,this._lastSelectionChangeTime=0,this._clicks=[],this._deadClickConfig=n.DeadClickConfig,this._handleScroll=(0,s.throttle)(()=>{const t=Date.now();this._clicks.forEach(e=>{e.scrollDelayMs||(e.scrollDelayMs=t-e.timestamp)})},50)}startTracking(){try{var e=(0,a._getWindowSafe)();e&&(e.addEventListener("click",e=>this._handleClick(e),{capture:!0}),e.addEventListener("scroll",()=>this._handleScroll(),{capture:!0,passive:!0}),e.addEventListener("selectionchange",()=>this._handleSelectionChange()),this._setupMutationObserver())}catch(e){a.Log.error("Error starting dead click tracking",e),this._errorBoundary.logError("autoCapture:DeadClickManager",e)}}_handleClick(e){var t,e=e.target;e&&(t={timestamp:Date.now(),eventTarget:e},s.interactiveElements.includes(null==(e=null==e?void 0:e.tagName)?void 0:e.toLowerCase())||this._clicks.push(t),this._clicks.length)&&!this._clickCheckTimer&&(this._clickCheckTimer=null==(e=(0,a._getWindowSafe)())?void 0:e.setTimeout(()=>{this._checkForDeadClick()},this._deadClickConfig.CLICK_CHECK_TIMEOUT))}_handleSelectionChange(){this._lastSelectionChangeTime=Date.now()}_setupMutationObserver(){var e=(0,a._getDocumentSafe)();e&&(this._observer=new MutationObserver(()=>{this._lastMutationTime=Date.now()}),this._observer.observe(e.body,{childList:!0,subtree:!0,attributes:!0,characterData:!0}))}_checkForDeadClick(){if(this._clicks.length){clearTimeout(this._clickCheckTimer),this._clickCheckTimer=void 0;var e=this._clicks;this._clicks=[];for(const s of e){this._updateClickDelayMs(s);var t,n=null!=s.scrollDelayMs&&s.scrollDelayMs<this._deadClickConfig.SCROLL_DELAY_MS,i=null!=s.selectionChangeDelayMs&&s.selectionChangeDelayMs<this._deadClickConfig.SELECTION_CHANGE_DELAY_MS,r=null!=s.mutationDelayMs&&s.mutationDelayMs<this._deadClickConfig.MUTATION_DELAY_MS;n||i||r||(n=null!=s.scrollDelayMs&&s.scrollDelayMs>this._deadClickConfig.SCROLL_DELAY_MS,i=null!=s.selectionChangeDelayMs&&s.selectionChangeDelayMs>this._deadClickConfig.SELECTION_CHANGE_DELAY_MS,r=null!=s.mutationDelayMs&&s.mutationDelayMs>this._deadClickConfig.MUTATION_DELAY_MS,t=null!=s.absoluteDelayMs&&s.absoluteDelayMs>this._deadClickConfig.ABSOLUTE_DEAD_CLICK_TIMEOUT,n||i||r||t?this._logDeadClick(s,{scrollTimeout:n,selectionChangeTimeout:i,mutationTimeout:r,absoluteTimeout:t}):null!=s.absoluteDelayMs&&s.absoluteDelayMs<this._deadClickConfig.ABSOLUTE_DEAD_CLICK_TIMEOUT&&this._clicks.push(s))}this._clicks.length&&!this._clickCheckTimer&&(this._clickCheckTimer=null==(e=(0,a._getWindowSafe)())?void 0:e.setTimeout(()=>{this._checkForDeadClick()},this._deadClickConfig.CLICK_CHECK_TIMEOUT))}}_logDeadClick(e,t){var{value:n,metadata:i}=(0,o._gatherEventData)(e.eventTarget);n&&this._enqueueFn(r.AutoCaptureEventName.DEAD_CLICK,n,Object.assign(Object.assign(Object.assign(Object.assign({},i),t),(0,l._gatherCommonMetadata)((0,s._getSafeUrl)())),{scrollDelayMs:e.scrollDelayMs,selectionChangeDelayMs:e.selectionChangeDelayMs,mutationDelayMs:e.mutationDelayMs,absoluteDelayMs:e.absoluteDelayMs}))}_updateClickDelayMs(e){!e.mutationDelayMs&&0<this._lastMutationTime&&e.timestamp<=this._lastMutationTime&&(e.mutationDelayMs=Date.now()-this._lastMutationTime),!e.selectionChangeDelayMs&&0<this._lastSelectionChangeTime&&e.timestamp<=this._lastSelectionChangeTime&&(e.selectionChangeDelayMs=Date.now()-this._lastSelectionChangeTime),e.absoluteDelayMs=Date.now()-e.timestamp}}},6714:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EngagementManager=void 0;const i=n(6914);t.EngagementManager=class{constructor(){this._lastScrollY=0,this._maxScrollY=0,this._lastScrollPercentage=0,this._maxScrollPercentage=0,this._lastPageViewTime=Date.now(),this._inactiveTimer=null,this._onInactivityCallback=null,this._meaningfulEngagementOccurred=!1,this._initializeScrollTracking()}_initializeScrollTracking(){var e=(0,i._getWindowSafe)();e&&(e.addEventListener("scroll",()=>this._handleScroll()),e.addEventListener("scrollend",()=>this._handleScroll()),e.addEventListener("resize",()=>this._handleScroll()))}_handleScroll(){var e,t=(0,i._getWindowSafe)(),n=(0,i._getDocumentSafe)();t&&n&&(e=n.body.scrollHeight,n=t.scrollY||n.documentElement.scrollTop||0,t=t.innerHeight,this._lastScrollY=n,this._maxScrollY=Math.max(this._maxScrollY,n),n=Math.min(100,Math.round((n+t)/e*100)),this._lastScrollPercentage=n,this._maxScrollPercentage=Math.max(this._maxScrollPercentage,n),this.bumpInactiveTimer())}getScrollMetrics(){return{lastScrollY:this._lastScrollY,maxScrollY:this._maxScrollY,lastScrollPercentage:this._lastScrollPercentage,maxScrollPercentage:this._maxScrollPercentage,scrollDepth:this._maxScrollPercentage}}getPageViewLength(){return Date.now()-this._lastPageViewTime}setLastPageViewTime(e){this._lastPageViewTime=e}startInactivityTracking(e){this._onInactivityCallback=e}bumpInactiveTimer(){var e=(0,i._getWindowSafe)();e&&(this._inactiveTimer&&clearTimeout(this._inactiveTimer),this._inactiveTimer=e.setTimeout(()=>{this._onInactivityCallback&&this._onInactivityCallback()},6e5))}setMeaningfulEngagementOccurred(e){this._meaningfulEngagementOccurred=e}getPageViewEndMetadata(){var e=Object.assign(Object.assign({},this.getScrollMetrics()),{pageViewLength:this.getPageViewLength(),meaningfulEngagementOccurred:this._meaningfulEngagementOccurred});return this.setMeaningfulEngagementOccurred(!1),e}}},4716:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this._clicks=[]}isRageClick(e,t,n){this._clicks=this._clicks.filter(e=>n-e.timestamp<1e3);var i,r;return 0<this._clicks.length&&(i=this._clicks[this._clicks.length-1],r=e-i.x,i=t-i.y,!(Math.abs(r)+Math.abs(i)<=30))&&(this._clicks=[]),this._clicks.push({x:e,y:t,timestamp:n}),3<=this._clicks.length}}},2678:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebVitalsManager=void 0;const i=n(8572),r=n(6914),s=n(5423),a=n(5864),o=["CLS","FCP","INP","LCP","TTFB"];t.WebVitalsManager=class{constructor(e,t){this._enqueueFn=e,this._errorBoundary=t,this._isInitialized=!1,this._metricEvent={url:(0,a._getSafeUrlString)(),sanitizedUrl:(0,a._getSanitizedPageUrl)(),metrics:[],firstMetricTimestamp:void 0}}startTracking(){var e,t,n;try{this._isInitialized||"https:"!==(n=null==(t=null==(e=(0,r._getWindowSafe)())?void 0:e.location)?void 0:t.protocol)&&"http:"!==n||((0,i.onCLS)(e=>this._handleMetric(e)),(0,i.onFCP)(e=>this._handleMetric(e)),(0,i.onINP)(e=>this._handleMetric(e)),(0,i.onLCP)(e=>this._handleMetric(e)),(0,i.onTTFB)(e=>this._handleMetric(e)),this._isInitialized=!0)}catch(e){r.Log.error("Error starting web vitals tracking",e),this._errorBoundary.logError("autoCapture:WebVitalsManager",e)}}_handleMetric(e){var t;void 0===this._metricEvent.firstMetricTimestamp&&(this._metricEvent.firstMetricTimestamp=Date.now()),void 0!==e&&void 0!==(null==e?void 0:e.name)&&""!==(t=(0,a._getSafeUrlString)())&&o.includes(e.name)&&(t!==this._metricEvent.url&&(this._enqueueWebVitalsAutoCaptureEvent(),this._metricEvent.url=t),this._metricEvent.metrics.push({name:e.name,value:e.value,delta:e.delta,id:e.id}),this._metricEvent.metrics.length===o.length)&&this._enqueueWebVitalsAutoCaptureEvent()}_enqueueWebVitalsAutoCaptureEvent(){if(""!==this._metricEvent.url&&0!==this._metricEvent.metrics.length){const n={};this._metricEvent.metrics.forEach(e=>{var t=e.name.toLowerCase();n[t+"_value"]=e.value,n[t+"_delta"]=e.delta,n[t+"_id"]=e.id}),this._enqueueFn(s.AutoCaptureEventName.WEB_VITALS,this._metricEvent.sanitizedUrl,Object.assign(Object.assign({},n),{first_metric_timestamp:this._metricEvent.firstMetricTimestamp})),this._metricEvent={url:(0,a._getSafeUrlString)(),sanitizedUrl:(0,a._getSanitizedPageUrl)(),metrics:[],firstMetricTimestamp:void 0}}}}},1964:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigAutoCapturePlugin=t.runStatsigAutoCapture=t.AutoCapture=t.AutoCaptureEventName=void 0;var i=n(6914);const r=n(4535);Object.defineProperty(t,"AutoCapture",{enumerable:!0,get:function(){return r.AutoCapture}}),Object.defineProperty(t,"StatsigAutoCapturePlugin",{enumerable:!0,get:function(){return r.StatsigAutoCapturePlugin}}),Object.defineProperty(t,"runStatsigAutoCapture",{enumerable:!0,get:function(){return r.runStatsigAutoCapture}});var s=n(5423),n=(Object.defineProperty(t,"AutoCaptureEventName",{enumerable:!0,get:function(){return s.AutoCaptureEventName}}),Object.assign((0,i._getStatsigGlobal)(),{AutoCapture:r.AutoCapture,runStatsigAutoCapture:r.runStatsigAutoCapture,StatsigAutoCapturePlugin:r.StatsigAutoCapturePlugin}));t.default=n},5864:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.wrapFunctionWithRestore=a.throttle=a._sanitizeString=a._getAnchorNodeInHierarchy=a._getSafeTimezoneOffset=a._getSafeTimezone=a._getSafeNetworkInformation=a._registerEventHandler=a._getSanitizedPageUrl=a._getSafeUrlString=a._getSafeUrl=a._shouldLogEvent=a._getTargetNode=a._stripEmptyValues=a.interactiveElements=void 0;const n=t(6914);const i=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 s(){var e=null!=(e=null==(e=null==(e=(0,n._getWindowSafe)())?void 0:e.location)?void 0:e.href)?e:"";let t;try{t=new URL(e)}catch(e){t=new URL("error:")}return t}function o(t){if(t){let e=t;for(;e;){var n=e.tagName.toLowerCase();if(["body","document"].includes(n))return null;if("a"===e.tagName.toLowerCase())return e;e=e.parentElement}}return null}a.interactiveElements=["button","a","input","select","textarea","form","select","label"],a._stripEmptyValues=function(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>null!=e&&""!==e&&void 0!==e))},a._getTargetNode=function(e){if(!e)return null;let t=e.target||e.srcElement;return t&&t instanceof Element?t=3===t.nodeType?t.parentNode||null:t:null},a._shouldLogEvent=function(e,t,n=!1){if(!e||!t||1!==t.nodeType)return!1;var i=t.tagName.toLowerCase(),r=e.type.toLowerCase();if(t.classList.contains("statsig-no-capture"))return!1;if(n)return!0;switch(i){case"html":return!1;case"form":return 0<=["submit"].indexOf(r);case"input":case"select":case"textarea":return 0<=["change","click"].indexOf(r);default:if("click"===r){var s=window.getComputedStyle(t);if(s&&"pointer"===s.getPropertyValue("cursor"))return!0;if(a.interactiveElements.includes(i))return!0;if("true"===t.getAttribute("contenteditable"))return!0;if(o(t))return!0}return!1}},a._getSafeUrl=s,a._getSafeUrlString=function(){var e=s().toString();return e.startsWith("error:")?"":e},a._getSanitizedPageUrl=function(){return(0,n._getCurrentPageUrlSafe)()||""},a._registerEventHandler=function(e,t,n){e&&e.addEventListener&&e.addEventListener(t,n,!0)},a._getSafeNetworkInformation=function(){var e=(0,n._getWindowSafe)();return e&&e.navigator&&e.navigator.connection||null},a._getSafeTimezone=function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return null}},a._getSafeTimezoneOffset=function(){try{return(new Date).getTimezoneOffset()}catch(e){return null}},a._getAnchorNodeInHierarchy=o,a._sanitizeString=function(e){return e?e.replace(/<[^>]*>/g,"").trim().split(/(\s+)/).filter(e=>{return!i.test((e||"").replace(/[- ]/g,""))&&!r.test((e||"").replace(/[- ]/g,""))}).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255):null},a.throttle=function(n,i){let r=0;return function(...e){var t=Date.now();t-r>=i&&(r=t,n(...e))}},a.wrapFunctionWithRestore=function(e,t,n){const i=e[t];if("function"!=typeof i)return()=>{};try{var r=n(i);return Object.defineProperty(r,"__statsig_original__",{enumerable:!1,value:i}),e[t]=r,()=>{e[t]=i}}catch(e){return()=>{}}}},8135:(e,t)=>{"use strict";function s(e,t){return e.length<=t?e:e.slice(0,t)+"..."}Object.defineProperty(t,"__esModule",{value:!0}),t._getStackTrace=t._safeStringify=void 0,t._safeStringify=function(e,t,n,i){try{return function(e,t,n){if(function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e)){if(Object.keys(e).length>t)return 1;if(function t(n,i){if(i<=0)return!0;if("object"!=typeof n||null===n)return!1;return Object.keys(n).some(e=>t(n[e],i-1))}(e,n))return 1}return"function"==typeof e}(e,t,n)?(r=i,s(e.toString(),r)):s("string"==typeof e?e:"object"==typeof e&&null!==e?JSON.stringify(e):String(e),i)}catch(e){return s("[Unserializable]",i)}var r},t._getStackTrace=function(){var e,t;try{return null!=(t=null==(e=(new Error).stack)?void 0:e.split("\n").slice(2))?t:[]}catch(e){return[]}}},3769:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._getMetadataFromElement=t._gatherCopyEventData=t._gatherEventData=void 0;const i=n(6914),l=n(5864),r=1e3,s=100,a=50;function o(e,t){return e?e.length>t?e.substring(0,t)+"...":e:null}function u(e){var t={};return t.class=(o(e.getAttribute("class"),r)||"").replace(/\s+/g," ").trim(),t.id=o(e.getAttribute("id"),r),t.ariaLabel=o(e.getAttribute("aria-label"),r),t.name=o(e.getAttribute("name"),r),t}function c(e){var t={},n=u(e),n=(Object.assign(t,n),Array.from(e.classList));return t.classList=0<n.length?n.slice(0,s):null,t.selector=function(t){if(!t)return"";if(!t.parentNode){var n=t.tagName.toLowerCase();if(t.id)return"#"+t.id;let e=n;return t.className&&"string"==typeof t.className&&0<(n=t.className.trim().split(/\s+/)).length&&""!==n[0]&&(e+="."+n.join(".")),e}var e=[];let i=t,r=0;for(;i&&i.nodeType===Node.ELEMENT_NODE&&r<a;){var s=function(i){var e=i.tagName.toLowerCase();if(i.id)return"#"+i.id;let r=e;i.className&&"string"==typeof i.className&&0<(e=i.className.trim().split(/\s+/)).length&&""!==e[0]&&(r+="."+e.join("."));e=i.parentElement;if(e&&1<e.children.length){let e=1,t=1,n=i.previousElementSibling;for(;n;)e++,n.tagName===i.tagName&&t++,n=n.previousElementSibling;r+=`:nth-child(${e})`,(1<t||function(e){let t=e.nextElementSibling;for(;t;){if(t.tagName===e.tagName)return 1;t=t.nextElementSibling}return}(i))&&(r+=`:nth-of-type(${t})`)}return r}(i);if(e.unshift(s),i.id)break;if((i=i.parentElement)&&"body"===i.tagName.toLowerCase())break;r++}return e.join(" > ")}(e),t}t._gatherEventData=function(e){var t,n,i,r,s,a=(0,l._getSanitizedPageUrl)()||"",o=e.tagName.toLowerCase();return"input"===(t=e).tagName.toLowerCase()&&["button","checkbox","submit","reset"].includes(t.getAttribute("type")||"")||"textarea"===t.tagName.toLowerCase()||"select"===t.tagName.toLowerCase()||"true"===t.getAttribute("contenteditable")?{value:a,metadata:u(e)}:((t={}).tagName=o,r=c(e),Object.assign(t,r),"form"===o&&Object.assign(t,((r={}).action=(n=e).getAttribute("action"),r.method=null!=(i=n.getAttribute("method"))?i:"GET",r.formName=n.getAttribute("name"),r.formId=n.getAttribute("id"),r)),"input"===o&&Object.assign(t,((i={}).content=(n=e).value,i.inputName=n.getAttribute("name"),i)),(r=(0,l._getAnchorNodeInHierarchy)(e))&&Object.assign(t,((s={}).href=r.getAttribute("href"),s)),"button"!==o&&!r||Object.assign(t,((s={}).content=((o=r||e).textContent||"").trim(),o=function(e){var t={};if(e){var n=null==e?void 0:e.dataset;if(n)for(const i in n)t["data-"+i]=n[i]||""}return t}(o),Object.assign(s,o),s)),function(e){if(Array.isArray(e.classList)&&null!=(t=e.classList)&&t.includes("statsig-ctr-capture"))return 1;var t=e.href;if(t)try{var n=(0,l._getSafeUrl)(),i=new URL(t);return n.host!==i.host}catch(e){}return}(t)&&(t.isOutbound="true"),{value:a,metadata:t})},t._gatherCopyEventData=function(e){var t=null==(t=null==(t=(0,i._getWindowSafe)())?void 0:t.getSelection())?void 0:t.toString(),n={},t=(n.selectedText=(0,l._sanitizeString)(t),e.type||"clipboard");return n.clipType=t,n},t._getMetadataFromElement=c},9900:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._getPossibleFirstTouchMetadata=t._getNetworkInfo=t._gatherAllMetadata=t._gatherCommonMetadata=void 0;const a=n(6914),o=n(5864);function s(e){var t=(0,a._getDocumentSafe)(),n=(0,a._getWindowSafe)();return(0,o._stripEmptyValues)(Object.assign({title:null==t?void 0:t.title,current_url:null==(t=null==n?void 0:n.location)?void 0:t.href,user_agent:null!=(t=null==n?void 0:n.navigator)&&t.userAgent&&200<(null==(t=null==(t=null==n?void 0:n.navigator)?void 0:t.userAgent)?void 0:t.length)?n.navigator.userAgent.substring(0,200):null==(t=null==n?void 0:n.navigator)?void 0:t.userAgent,locale:null==(t=null==n?void 0:n.navigator)?void 0:t.language,hostname:e.hostname,pathname:e.pathname,screen_width:null==(t=null==n?void 0:n.screen)?void 0:t.width,screen_height:null==(e=null==n?void 0:n.screen)?void 0:e.height,viewport_width:null==n?void 0:n.innerWidth,viewport_height:null==n?void 0:n.innerHeight,viewport:`${null==n?void 0:n.innerWidth}x`+(null==n?void 0:n.innerHeight),timestamp:Date.now(),timezone:(0,o._getSafeTimezone)(),timezone_offset:(0,o._getSafeTimezoneOffset)()},i()))}function i(){var e=(0,o._getSafeNetworkInformation)(),t={};return void 0!==(null==e?void 0:e.effectiveType)&&(t.effective_connection_type=e.effectiveType),void 0!==(null==e?void 0:e.rtt)&&(t.rtt_ms=e.rtt),void 0!==(null==e?void 0:e.downlink)&&(t.downlink_mbps=e.downlink,t.downlink_kbps=1e3*e.downlink),void 0!==(null==e?void 0:e.saveData)&&(t.save_data=e.saveData),t}function l(e){e=(null==e?void 0:e.referrer)||"";if(!e)return{referrer:null,referrer_domain:null,referrer_path:null,searchEngine:"",searchQuery:""};try{var t=new URL(e);const r=t.hostname;var n=["google","bing","yahoo","duckduckgo","baidu"].find(e=>r.includes(e+"."))||"",i=t.searchParams.get("yahoo"===n?"p":"q")||"";return{referrer:e,referrer_domain:t.hostname,referrer_path:t.pathname,searchEngine:n,searchQuery:i}}catch(e){return{referrer:null,referrer_domain:null,referrer_path:null,searchEngine:"",searchQuery:""}}}function u(e){const n=e.searchParams,i={};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(e=>{var t=n.get(e);t&&(i[e]=t)}),i}t._gatherCommonMetadata=s,t._gatherAllMetadata=function(e){var t=(0,a._getDocumentSafe)(),n=(0,a._getWindowSafe)();if(!t||!n)return{};var n=l(t),t=s(e),i=u(e);const r={};return e.searchParams.forEach((e,t)=>{r[t]=e}),Object.assign(Object.assign({},t),(0,o._stripEmptyValues)(Object.assign(Object.assign(Object.assign({},n),i),r)))},t._getNetworkInfo=i,t._getPossibleFirstTouchMetadata=function(e){var t=(0,a._getDocumentSafe)(),n=(0,a._getWindowSafe)();if(!t||!n)return{};var i,r,n=l(t),t=u(e),e=(0,o._stripEmptyValues)(Object.assign(Object.assign({},n),t)),s={};for([i,r]of Object.entries(e))s["$s_"+i]=r;return s}},8572:function(e,t){!function(e){"use strict";let r=-1;const l=t=>{addEventListener("pageshow",e=>{e.persisted&&(r=e.timeStamp,t(e))},!0)},u=(t,n,i,r)=>{let s,a;return e=>{n.value>=0&&(e||r)&&(a=n.value-(s??0),(a||void 0===s)&&(s=n.value,n.delta=a,n.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(n.value,i),t(n)))}},c=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},d=()=>{const e=s();return e?.activationStart??0},h=(e,t=-1)=>{const n=s();let i="navigate";r>=0?i="back-forward-cache":n&&(document.prerendering||d()>0?i="prerender":document.wasDiscarded?i="restore":n.type&&(i=n.type.replace(/_/g,"-")));return{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:i}},n=new WeakMap;function _(e,t){return n.get(e)||n.set(e,new t),n.get(e)}class o{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 g=(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{}},v=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let i=-1;const a=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,t=e=>{"hidden"===document.visibilityState&&i>-1&&(i="visibilitychange"===e.type?e.timeStamp:0,p())},f=()=>{addEventListener("visibilitychange",t,!0),addEventListener("prerenderingchange",t,!0)},p=()=>{removeEventListener("visibilitychange",t,!0),removeEventListener("prerenderingchange",t,!0)},m=()=>{if(i<0){const t=d(),e=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(e=>"hidden"===e.name&&e.startTime>t)[0]?.startTime;i=e??a(),f(),l(()=>{setTimeout(()=>{i=a(),f()})})}return{get firstHiddenTime(){return i}}},y=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},b=[1800,3e3],S=(t,a={})=>{y(()=>{const n=m();let i,r=h("FCP");const s=g("paint",e=>{for(const t of e)"first-contentful-paint"===t.name&&(s.disconnect(),t.startTime<n.firstHiddenTime&&(r.value=Math.max(t.startTime-d(),0),r.entries.push(t),i(!0)))});s&&(i=u(t,r,b,a.reportAllChanges),l(e=>{r=h("FCP"),i=u(t,r,b,a.reportAllChanges),c(()=>{r.value=performance.now()-e.timeStamp,i(!0)})}))})},E=[.1,.25];let C=0,w=1/0,k=0;const O=e=>{for(const t of e)t.interactionId&&(w=Math.min(w,t.interactionId),k=Math.max(k,t.interactionId),C=k?(k-w)/7+1:0)};let D;const T=()=>D?C:performance.interactionCount??0,M=()=>{"interactionCount"in performance||D||(D=g("event",O,{type:"event",buffered:!0,durationThreshold:0}))};let L=0;class j{u=[];l=new Map;m;p;v(){L=T(),this.u.length=0,this.l.clear()}T(){const e=Math.min(this.u.length-1,Math.floor((T()-L)/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 I=e=>{const t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=v(e),document.addEventListener("visibilitychange",e,{once:!0}),t(()=>{e(),document.removeEventListener("visibilitychange",e)}))},P=[200,500];class U{m;h(e){this.m?.(e)}}const A=[2500,4e3],x=[800,1800],F=e=>{document.prerendering?y(()=>F(e)):"complete"!==document.readyState?addEventListener("load",()=>F(e),!0):setTimeout(e)};e.CLSThresholds=E,e.FCPThresholds=b,e.INPThresholds=P,e.LCPThresholds=A,e.TTFBThresholds=x,e.onCLS=(s,a={})=>{S(v(()=>{let n,i=h("CLS",0);const r=_(a,o),e=e=>{for(const t of e)r.h(t);r.i>i.value&&(i.value=r.i,i.entries=r.o,n())},t=g("layout-shift",e);t&&(n=u(s,i,E,a.reportAllChanges),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&(e(t.takeRecords()),n(!0))}),l(()=>{r.i=0,i=h("CLS",0),n=u(s,i,E,a.reportAllChanges),c(()=>n())}),setTimeout(n))}))},e.onFCP=S,e.onINP=(s,a={})=>{globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype&&y(()=>{M();let n,i=h("INP");const r=_(a,j),e=t=>{I(()=>{for(const e of t)r.h(e);const e=r.T();e&&e.P!==i.value&&(i.value=e.P,i.entries=e.entries,n())})},t=g("event",e,{durationThreshold:a.durationThreshold??40});n=u(s,i,P,a.reportAllChanges),t&&(t.observe({type:"first-input",buffered:!0}),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&(e(t.takeRecords()),n(!0))}),l(()=>{r.v(),i=h("INP"),n=u(s,i,P,a.reportAllChanges)}))})},e.onLCP=(a,o={})=>{y(()=>{const t=m();let n,i=h("LCP");const r=_(o,U),e=e=>{o.reportAllChanges||(e=e.slice(-1));for(const o of e)r.h(o),o.startTime<t.firstHiddenTime&&(i.value=Math.max(o.startTime-d(),0),i.entries=[o],n())},s=g("largest-contentful-paint",e);if(s){n=u(a,i,A,o.reportAllChanges);const t=v(()=>{e(s.takeRecords()),s.disconnect(),n(!0)});for(const a of["keydown","click","visibilitychange"])addEventListener(a,()=>I(t),{capture:!0,once:!0});l(e=>{i=h("LCP"),n=u(a,i,A,o.reportAllChanges),c(()=>{i.value=performance.now()-e.timeStamp,n(!0)})})}})},e.onTTFB=(t,n={})=>{let i=h("TTFB"),r=u(t,i,x,n.reportAllChanges);F(()=>{const e=s();e&&(i.value=Math.max(e.responseStart-d(),0),i.entries=[e],r(!0),l(()=>{i=h("TTFB",0),r=u(t,i,x,n.reportAllChanges),r(!0)}))})}}(t)}},r={},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n(7476).default;function n(e){var t=r[e];return void 0!==t||(t=r[e]={exports:{}},i[e].call(t.exports,t,t.exports,n)),t.exports}var i,r});
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Statsig=t():e.Statsig=t()}(this,()=>{return n={1845:(e,i,t)=>{"use strict";var n;Object.defineProperty(i,"__esModule",{value:!0}),i._getInstance=i._getStatsigGlobalFlag=i._getStatsigGlobal=void 0;const r=t(7512);i._getStatsigGlobal=()=>{try{return"undefined"!=typeof __STATSIG__?__STATSIG__:l}catch(e){return l}},i._getStatsigGlobalFlag=e=>(0,i._getStatsigGlobal)()[e];i._getInstance=e=>{var t=(0,i._getStatsigGlobal)();return e?t.instances&&t.instances[e]:(t.instances&&1<Object.keys(t.instances).length&&r.Log.warn("Call made to Statsig global instance without an SDK key but there is more than one client instance. If you are using mulitple clients, please specify the SDK key."),t.firstInstance)};var s="__STATSIG__",a="undefined"!=typeof window?window:{},t=void 0!==t.g?t.g:{},o="undefined"!=typeof globalThis?globalThis:{};const l=null!=(n=null!=(n=null!=(n=a[s])?n:t[s])?n:o[s])?n:{instance:i._getInstance};a[s]=l,t[s]=l,o[s]=l},2137:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._getStorageKey=t._getUserStorageKey=void 0;const r=i(1406);function n(e,t,i){if(i)return i(e,t);const n=t&&t.customIDs?t.customIDs:{};t=["uid:"+(null!=(i=null==t?void 0:t.userID)?i:""),"cids:"+Object.keys(n).sort((e,t)=>e.localeCompare(t)).map(e=>e+"-"+n[e]).join(","),"k:"+e];return(0,r._DJB2)(t.join("|"))}t._getUserStorageKey=n,t._getStorageKey=function(e,t,i){return t?n(e,t,i):(0,r._DJB2)("k:"+e)}},6427:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},694:function(e,t,i){"use strict";var r=this&&this.__awaiter||function(e,a,o,l){return new(o=o||Promise)(function(i,t){function n(e){try{s(l.next(e))}catch(e){t(e)}}function r(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?i(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(n,r)}s((l=l.apply(e,a||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t._makeDataAdapterResult=t.DataAdapterCore=void 0;const l=i(7512),u=i(9122),s=i(8578),a=i(4534),c=i(3401);function d(e,t,i,n){return{source:e,data:t,receivedAt:Date.now(),stableID:i,fullUserHash:(0,s._getFullUserHash)(n)}}t.DataAdapterCore=class{constructor(e,t){this._adapterName=e,this._cacheSuffix=t,this._options=null,this._sdkKey=null,this._cacheLimit=10,this._lastModifiedStoreKey="statsig.last_modified_time."+t,this._inMemoryCache=new n}attach(e,t,i){this._sdkKey=e,this._options=t}getDataSync(e){var e=e&&(0,s._normalizeUser)(e,this._options),t=this._getCacheKey(e),i=this._inMemoryCache.get(t,e);return i&&this._getIsCacheValueValid(i)?i:(i=this._loadFromCache(t))&&this._getIsCacheValueValid(i)?(this._inMemoryCache.add(t,i,this._cacheLimit),this._inMemoryCache.get(t,e)):null}setData(e,t){var t=t&&(0,s._normalizeUser)(t,this._options),i=this._getCacheKey(t);this._inMemoryCache.add(i,d("Bootstrap",e,null,t),this._cacheLimit)}_getIsCacheValueValid(e){return null==e.stableID||e.stableID===u.StableID.get(this._getSdkKey())}_getDataAsyncImpl(t,i,n){return r(this,void 0,void 0,function*(){a.Storage.isReady()||(yield a.Storage.isReadyResolver());var e=null!=t?t:this.getDataSync(i),e=[this._fetchAndPrepFromNetwork(e,i,n)];return null!=n&&n.timeoutMs&&e.push(new Promise(e=>setTimeout(e,n.timeoutMs)).then(()=>(l.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(e)})}_prefetchDataImpl(i,n){return r(this,void 0,void 0,function*(){var e=i&&(0,s._normalizeUser)(i,this._options),t=this._getCacheKey(e),e=yield this._getDataAsyncImpl(null,e,n);e&&this._inMemoryCache.add(t,Object.assign(Object.assign({},e),{source:"Prefetch"}),this._cacheLimit)})}_fetchAndPrepFromNetwork(s,a,o){return r(this,void 0,void 0,function*(){var e=null!=(e=null==s?void 0:s.data)?e:null,t=null!=s&&this._isCachedResultValidFor204(s,a),t=yield this._fetchFromNetwork(e,a,o,t);if(!t)return l.Log.debug("No response returned for latest value"),null;var i=(0,c._typedJsonParse)(t,"has_updates","Response"),n=this._getSdkKey(),n=u.StableID.get(n);let r=null;if(!0===(null==i?void 0:i.has_updates))r=d("Network",t,n,a);else{if(!e||!1!==(null==i?void 0:i.has_updates))return null;r=d("NetworkNotModified",e,n,a)}t=this._getCacheKey(a);return this._inMemoryCache.add(t,r,this._cacheLimit),this._writeToCache(t,r),r})}_getSdkKey(){return null!=this._sdkKey?this._sdkKey:(l.Log.error(this._adapterName+" is not attached to a Client"),"")}_loadFromCache(e){var t=null==(t=a.Storage.getItem)?void 0:t.call(a.Storage,e);return null!=t&&(e=(0,c._typedJsonParse)(t,"source","Cached Result"))?Object.assign(Object.assign({},e),{source:"Cache"}):null}_writeToCache(t,e){var i=JSON.stringify(e);for(let e=0;e<8;e++)try{a.Storage.setItem(t,i);break}catch(e){if(!(e instanceof Error)||!e.toString().includes("QuotaExceededError")&&!e.toString().includes("QUOTA_EXCEEDED_ERR")||this._cacheLimit<=1)throw e;this._cacheLimit=Math.ceil(this._cacheLimit/2),this._runLocalStorageCacheEviction(t,this._cacheLimit-1)}this._runLocalStorageCacheEviction(t)}_runLocalStorageCacheEviction(e,t=this._cacheLimit){var i=null!=(n=(0,a._getObjectFromStorage)(this._lastModifiedStoreKey))?n:{},n=(i[e]=Date.now(),o(i,t));for(const r of n)delete i[r],a.Storage.removeItem(r);(0,a._setObjectInStorage)(this._lastModifiedStoreKey,i)}},t._makeDataAdapterResult=d;class n{constructor(){this._data={}}get(e,t){var e=this._data[e],i=null==e?void 0:e.stableID,t=null==(t=null==t?void 0:t.customIDs)?void 0:t.stableID;return t&&i&&t!==i?(l.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):e}add(e,t,i){for(const n of o(this._data,i-1))delete this._data[n];this._data[e]=t}merge(e){this._data=Object.assign(Object.assign({},this._data),e)}}function o(i,e){var t=Object.keys(i);return t.length<=e?[]:0===e?t:t.sort((e,t)=>{e=i[e],t=i[t];return"object"==typeof e&&"object"==typeof t?e.receivedAt-t.receivedAt:e-t}).slice(0,t.length-e)}},8962:(e,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.Diagnostics=void 0;const n=new Map,i="start";function r(e,t,i,n){return Object.assign({key:i,action:t,step:n,timestamp:Date.now()},e)}function s(e,t){var i=null!=(i=n.get(e))?i:[];i.push(t),n.set(e,i)}function t(e,t){if(t in e)return e[t]}a.Diagnostics={_getMarkers:e=>n.get(e),_markInitOverallStart:e=>{s(e,r({},i,"overall"))},_markInitOverallEnd:(e,t,i)=>{s(e,r({success:t,error:t?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:i},"end","overall"))},_markInitNetworkReqStart:(e,t)=>{s(e,r(t,i,"initialize","network_request"))},_markInitNetworkReqEnd:(e,t)=>{s(e,r(t,"end","initialize","network_request"))},_markInitProcessStart:e=>{s(e,r({},i,"initialize","process"))},_markInitProcessEnd:(e,t)=>{s(e,r(t,"end","initialize","process"))},_clearMarkers:e=>{n.delete(e)},_formatError(e){if(e&&"object"==typeof e)return{code:t(e,"code"),name:t(e,"name"),message:t(e,"message")}},_getDiagnosticsData(e,t,i,n){return{success:!0===(null==e?void 0:e.ok),statusCode:null==e?void 0:e.status,sdkRegion:null==(e=null==e?void 0:e.headers)?void 0:e.get("x-statsig-region"),isDelta:!0===i.includes('"is_delta":true')||void 0,attempt:t,error:a.Diagnostics._formatError(n)}},_enqueueDiagnosticsEvent(e,t,i,n){var r,s=a.Diagnostics._getMarkers(i);return null==s||s.length<=0?-1:(r=s[s.length-1].timestamp-s[0].timestamp,a.Diagnostics._clearMarkers(i),i=function(e,t){e={eventName:"statsig::diagnostics",user:e,value:null,metadata:t,time:Date.now()};return e}(e,{context:"initialize",markers:s.slice(),statsigOptions:n}),t.enqueue(i),r)}}},8809:function(e,t){"use strict";var i=this&&this.__awaiter||function(e,a,o,l){return new(o=o||Promise)(function(i,t){function n(e){try{s(l.next(e))}catch(e){t(e)}}function r(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?i(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(n,r)}s((l=l.apply(e,a||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t._fetchTxtRecords=void 0;const r=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]),s="https://cloudflare-dns.com/dns-query",a=["i","e","d"],o=200;t._fetchTxtRecords=function(t){return i(this,void 0,void 0,function*(){var i=yield t(s,{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:r});if(i.ok){var e,i=yield i.arrayBuffer(),i=new Uint8Array(i);{var n=i,i=n.findIndex((e,t)=>t<o&&"="===String.fromCharCode(e)&&a.includes(String.fromCharCode(n[t-1])));if(-1===i)throw(e=new Error("Failed to parse TXT records from DNS")).name="DnsTxtParseError",e;let t="";for(let e=i-1;e<n.length;e++)t+=String.fromCharCode(n[e]);return t.split(",")}}throw(e=new Error("Failed to fetch TXT records from DNS")).name="DnsTxtFetchError",e})}},3539:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5542:function(e,o,t){"use strict";var i=this&&this.__awaiter||function(e,a,o,l){return new(o=o||Promise)(function(i,t){function n(e){try{s(l.next(e))}catch(e){t(e)}}function r(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?i(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(n,r)}s((l=l.apply(e,a||[])).next())})};Object.defineProperty(o,"__esModule",{value:!0}),o.ErrorBoundary=o.EXCEPTION_ENDPOINT=void 0;const n=t(7512),l=t(5902),u=t(8e3),c=(o.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception","[Statsig] UnknownError");function d(e){return e instanceof Error?e:"string"==typeof e?new Error(e):new Error("An unknown error occurred.")}o.ErrorBoundary=class{constructor(e,t,i,n){this._sdkKey=e,this._options=t,this._emitter=i,this._lastSeenError=n,this._seen=new Set}wrap(n,r){try{const e=n;!function(e){const t=new Set;let i=Object.getPrototypeOf(e);for(;i&&i!==Object.prototype;)Object.getOwnPropertyNames(i).filter(e=>"function"==typeof(null===i||void 0===i?void 0:i[e])).forEach(e=>t.add(e)),i=Object.getPrototypeOf(i);return Array.from(t)}(e).forEach(t=>{const i=e[t];"$EB"in i||(e[t]=(...e)=>this._capture(r?r+":"+t:t,()=>i.apply(n,e)),e[t].$EB=!0)})}catch(e){this._onError("eb:wrap",e)}}logError(e,t){this._onError(e,t)}getLastSeenErrorAndReset(){var e=this._lastSeenError;return this._lastSeenError=void 0,null!=e?e:null}attachErrorIfNoneExists(e){this._lastSeenError||(this._lastSeenError=d(e))}_capture(t,e){try{var i=e();return i&&i instanceof Promise?i.catch(e=>this._onError(t,e)):i}catch(e){return this._onError(t,e),null}}_onError(s,a){try{n.Log.warn("Caught error in "+s,{error:a});i(this,void 0,void 0,function*(){var e,t=a||Error(c),i=t instanceof Error,n=i?t.name:"No Name",r=d(t);this._lastSeenError=r,this._seen.has(n)||(this._seen.add(n),null!=(r=null==(r=this._options)?void 0:r.networkConfig)&&r.preventAllNetworkTraffic?null!=(r=this._emitter)&&r.call(this,{name:"error",error:a,tag:s}):(r=l.SDKType._get(this._sdkKey),e=u.StatsigMetadataProvider.get(),i=i?t.stack:function(e){try{return JSON.stringify(e)}catch(e){return c}}(t),t=Object.assign({tag:s,exception:n,info:i,statsigOptions:function(n){if(!n)return{};const r={};return Object.keys(n).forEach(e=>{var t=e,i=n[t];switch(typeof i){case"number":case"bigint":case"boolean":r[String(t)]=i;break;case"string":i.length<50?r[String(t)]=i:r[String(t)]="set";break;case"object":"environment"===t?r.environment=i:"networkConfig"===t?r.networkConfig=i:r[String(t)]=null!=i?"set":"unset"}}),r}(this._options)},Object.assign(Object.assign({},e),{sdkType:r})),yield(null!=(n=null==(i=null==(n=this._options)?void 0:n.networkConfig)?void 0:i.networkOverrideFunc)?n:fetch)(o.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this._sdkKey,"STATSIG-SDK-TYPE":String(r),"STATSIG-SDK-VERSION":String(e.sdkVersion),"Content-Type":"application/json"},body:JSON.stringify(t)}),null!=(i=this._emitter)&&i.call(this,{name:"error",error:a,tag:s})))}).then(()=>{}).catch(()=>{})}catch(e){}}}},2922:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2417:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7770:function(e,t,i){"use strict";var n=this&&this.__awaiter||function(e,a,o,l){return new(o=o||Promise)(function(i,t){function n(e){try{s(l.next(e))}catch(e){t(e)}}function r(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?i(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(n,r)}s((l=l.apply(e,a||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.EventLogger=void 0;const r=i(2137),s=i(1406),a=i(7512),o=i(7410),l=i(6830),u=i(1637),c=i(586),d=i(4534),g=i(1881),_=i(2397),h={};class v{static _safeFlushAndForget(e){null!=(e=h[e])&&e.flush().catch(()=>{})}static _safeRetryFailedLogs(e){null!=(e=h[e])&&e._retryFailedLogs()}constructor(e,t,i,n){this._sdkKey=e,this._emitter=t,this._network=i,this._options=n,this._queue=[],this._lastExposureTimeMap={},this._nonExposedChecks={},this._hasRunQuickFlush=!1,this._creationTime=Date.now(),this._loggingEnabled=null!=(e=null==n?void 0:n.loggingEnabled)?e:!0===(null==n?void 0:n.disableLogging)?c.LoggingEnabledOption.disabled:c.LoggingEnabledOption.browserOnly,null!=n&&n.loggingEnabled&&void 0!==n.disableLogging&&a.Log.warn("Detected both loggingEnabled and disableLogging options. loggingEnabled takes precedence - please remove disableLogging."),this._maxQueueSize=null!=(t=null==n?void 0:n.loggingBufferMaxSize)?t:100;i=null==n?void 0:n.networkConfig;this._logEventUrlConfig=new g.UrlConfiguration(o.Endpoint._rgstr,null==i?void 0:i.logEventUrl,null==i?void 0:i.api,null==i?void 0:i.logEventFallbackUrls)}setLogEventCompressionMode(e){this._network.setLogEventCompressionMode(e)}setLoggingEnabled(e){var t,i;"disabled"===this._loggingEnabled&&"disabled"!==e&&(t=this._getStorageKey(),(i=(0,d._getObjectFromStorage)(t))&&this._queue.push(...i),d.Storage.removeItem(t)),this._loggingEnabled=e}enqueue(e){this._shouldLogEvent(e)&&(this._normalizeAndAppendEvent(e),this._quickFlushIfNeeded(),this._queue.length>this._maxQueueSize)&&v._safeFlushAndForget(this._sdkKey)}incrementNonExposureCount(e){var t=null!=(t=this._nonExposedChecks[e])?t:0;this._nonExposedChecks[e]=t+1}reset(){this.flush().catch(()=>{}),this._lastExposureTimeMap={}}start(){var e,t=(0,l._isServerEnv)();t&&"always"!==(null==(e=this._options)?void 0:e.loggingEnabled)||(h[this._sdkKey]=this,t||(0,_._subscribeToVisiblityChanged)(e=>{"background"===e?v._safeFlushAndForget(this._sdkKey):"foreground"===e&&v._safeRetryFailedLogs(this._sdkKey)}),this._retryFailedLogs(),this._startBackgroundFlushInterval())}stop(){return n(this,void 0,void 0,function*(){this._flushIntervalId&&(clearInterval(this._flushIntervalId),this._flushIntervalId=null),delete h[this._sdkKey],yield this.flush()})}flush(){return n(this,void 0,void 0,function*(){var e;this._appendAndResetNonExposedChecks(),0!==this._queue.length&&(e=this._queue,this._queue=[],yield this._sendEvents(e))})}_quickFlushIfNeeded(){this._hasRunQuickFlush||(this._hasRunQuickFlush=!0,200<Date.now()-this._creationTime)||setTimeout(()=>v._safeFlushAndForget(this._sdkKey),200)}_shouldLogEvent(e){if("always"!==(null==(t=this._options)?void 0:t.loggingEnabled)&&(0,l._isServerEnv)())return!1;if((0,u._isExposureEvent)(e)){var t=e.user||{statsigEnvironment:void 0},t=(0,r._getUserStorageKey)(this._sdkKey,t),i=e.metadata||{},e=[e.eventName,t,i.gate,i.config,i.ruleID,i.allocatedExperiment,i.parameterName,String(i.isExplicitParameter),i.reason].join("|"),t=this._lastExposureTimeMap[e],i=Date.now();if(t&&i-t<6e5)return!1;1e3<Object.keys(this._lastExposureTimeMap).length&&(this._lastExposureTimeMap={}),this._lastExposureTimeMap[e]=i}return!0}_sendEvents(r){return n(this,void 0,void 0,function*(){var e,t;if("disabled"===this._loggingEnabled)return this._saveFailedLogsToStorage(r),!1;try{var i=(0,_._isUnloading)()&&this._network.isBeaconSupported()&&null==(null==(t=null==(e=this._options)?void 0:e.networkConfig)?void 0:t.networkOverrideFunc),n=(this._emitter({name:"pre_logs_flushed",events:r}),i?this._sendEventsViaBeacon(r):yield this._sendEventsViaPost(r));return n.success?(this._emitter({name:"logs_flushed",events:r}),!0):(a.Log.warn("Failed to flush events."),this._saveFailedLogsToStorage(r),!1)}catch(e){return a.Log.warn("Failed to flush events."),!1}})}_sendEventsViaPost(t){return n(this,void 0,void 0,function*(){var e=yield this._network.post(this._getRequestData(t)),e=null!=(e=null==e?void 0:e.code)?e:-1;return{success:200<=e&&e<300}})}_sendEventsViaBeacon(e){return{success:this._network.beacon(this._getRequestData(e))}}_getRequestData(e){return{sdkKey:this._sdkKey,data:{events:e},urlConfig:this._logEventUrlConfig,retries:3,isCompressable:!0,params:{[o.NetworkParam.EventCount]:String(e.length)},credentials:"same-origin"}}_saveFailedLogsToStorage(e){for(;500<e.length;)e.shift();var t=this._getStorageKey();try{var i=this._getFailedLogsFromStorage(t);(0,d._setObjectInStorage)(t,[...i,...e])}catch(e){a.Log.warn("Unable to save failed logs to storage")}}_getFailedLogsFromStorage(e){let t=[];try{var i=(0,d._getObjectFromStorage)(e);return t=Array.isArray(i)?i:t}catch(e){return[]}}_retryFailedLogs(){const t=this._getStorageKey();n(this,void 0,void 0,function*(){d.Storage.isReady()||(yield d.Storage.isReadyResolver());var e=(0,d._getObjectFromStorage)(t);e&&(d.Storage.removeItem(t),yield this._sendEvents(e))}).catch(()=>{a.Log.warn("Failed to flush stored logs")})}_getStorageKey(){return"statsig.failed_logs."+(0,s._DJB2)(this._sdkKey)}_normalizeAndAppendEvent(e){e.user&&(e.user=Object.assign({},e.user),delete e.user.privateAttributes);var t={},i=this._getCurrentPageUrl(),i=(i&&(t.statsigMetadata={currentPage:i}),Object.assign(Object.assign({},e),t));a.Log.debug("Enqueued Event:",i),this._queue.push(i)}_appendAndResetNonExposedChecks(){0!==Object.keys(this._nonExposedChecks).length&&(this._normalizeAndAppendEvent({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:Object.assign({},this._nonExposedChecks)}}),this._nonExposedChecks={})}_getCurrentPageUrl(){var e;if(!1!==(null==(e=this._options)?void 0:e.includeCurrentPageUrlWithEvents))return(0,l._getCurrentPageUrlSafe)()}_startBackgroundFlushInterval(){var e=null!=(e=null==(e=this._options)?void 0:e.loggingIntervalMs)?e:1e4;const t=setInterval(()=>{var e=h[this._sdkKey];e&&e._flushIntervalId===t?v._safeFlushAndForget(this._sdkKey):clearInterval(t)},e);this._flushIntervalId=t}}t.EventLogger=v},1406:(e,s,t)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s._getSortedObject=s._DJB2Object=s._DJB2=void 0;const a=t(6634);s._DJB2=t=>{let i=0;for(let e=0;e<t.length;e++){var n=t.charCodeAt(e);i=(i<<5)-i+n,i&=i}return String(i>>>0)},s._DJB2Object=(e,t)=>(0,s._DJB2)(JSON.stringify((0,s._getSortedObject)(e,t)));s._getSortedObject=(i,n)=>{if(null==i)return null;var e=Object.keys(i).sort();const r={};return e.forEach(e=>{var t=i[e];0===n||"object"!==(0,a._typeOf)(t)?r[e]=t:r[e]=(0,s._getSortedObject)(t,null!=n?n-1:n)}),r}},1333:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7512:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Log=t.LogLevel=void 0;function i(e){return e.unshift("[Statsig]"),e}t.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class n{static info(...e){n.level>=t.LogLevel.Info&&console.info(" INFO ",...i(e))}static debug(...e){n.level>=t.LogLevel.Debug&&console.debug(" DEBUG ",...i(e))}static warn(...e){n.level>=t.LogLevel.Warn&&console.warn(" WARN ",...i(e))}static error(...e){n.level>=t.LogLevel.Error&&console.error(" ERROR ",...i(e))}}(t.Log=n).level=t.LogLevel.Warn},7787:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMemoKey=t.MemoPrefix=void 0,t.MemoPrefix={_gate:"g",_dynamicConfig:"c",_experiment:"e",_configList:"cl",_layer:"l",_paramStore:"p"};const s=new Set([]),a=new Set(["userPersistedValues"]);t.createMemoKey=function(e,t,i){let n=e+"|"+t;if(i)for(const r of Object.keys(i)){if(a.has(r))return;s.has(r)?n+=`|${r}=true`:n+=`|${r}=`+i[r]}return n}},7410:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkParam=t.NetworkDefault=t.Endpoint=void 0,t.Endpoint={_initialize:"initialize",_rgstr:"rgstr",_download_config_specs:"download_config_specs"},t.NetworkDefault={[t.Endpoint._rgstr]:"https://prodregistryv2.org/v1",[t.Endpoint._initialize]:"https://featureassets.org/v1",[t.Endpoint._download_config_specs]:"https://api.statsigcdn.com/v1"},t.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}},7023:function(e,t,i){"use strict";var y=this&&this.__awaiter||function(e,a,o,l){return new(o=o||Promise)(function(i,t){function n(e){try{s(l.next(e))}catch(e){t(e)}}function r(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?i(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(n,r)}s((l=l.apply(e,a||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkCore=void 0,i(1845);const _=i(1845),b=i(8962),S=i(7512),E=i(7410),n=i(308),h=i(3091),a=i(5902),r=i(6830),o=i(4143),l=i(9122),C=i(2636),u=i(8e3),v=i(586),k=i(2397),w=500,O=3e4;const D=new Set([408,500,502,503,504,522,524,599]);t.NetworkCore=class{constructor(e,t){this._emitter=t,this._errorBoundary=null,this._timeout=1e4,this._netConfig={},this._options={},this._leakyBucket={},this._lastUsedInitUrl=null,e&&(this._options=e),this._options.networkConfig&&(this._netConfig=this._options.networkConfig),this._netConfig.networkTimeoutMs&&(this._timeout=this._netConfig.networkTimeoutMs),this._fallbackResolver=new n.NetworkFallbackResolver(this._options),this.setLogEventCompressionMode(this._getLogEventCompressionMode(e))}setLogEventCompressionMode(e){this._options.logEventCompressionMode=e}setErrorBoundary(e){this._errorBoundary=e,this._errorBoundary.wrap(this),this._errorBoundary.wrap(this._fallbackResolver),this._fallbackResolver.setErrorBoundary(e)}isBeaconSupported(){return"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon}getLastUsedInitUrlAndReset(){var e=this._lastUsedInitUrl;return this._lastUsedInitUrl=null,e}beacon(e){var t,i;return!!I(e)&&(e=this._getInternalRequestArgs("POST",e),t=this._getPopulatedURL(e),(i=navigator).sendBeacon.bind(i)(t,e.body))}post(t){return y(this,void 0,void 0,function*(){var e=this._getInternalRequestArgs("POST",t);return this._tryEncodeBody(e),yield this._tryToCompressBody(e),this._sendRequest(e)})}get(e){e=this._getInternalRequestArgs("GET",e);return this._sendRequest(e)}_sendRequest(m){return y(this,void 0,void 0,function*(){var t;if(!I(m))return null;if(this._netConfig.preventAllNetworkTraffic)return null;var{method:n,body:r,retries:i,attempt:s}=m,a=m.urlConfig.endpoint;if(this._isRateLimited(a))return S.Log.warn(`Request to ${a} was blocked because you are making requests too frequently.`),null;s=null!=s?s:1;let o=!1;var l=this._getPopulatedURL(m);let u=null;var c,d=(0,k._isUnloading)();try{var e,g,_,h={method:n,body:r,headers:Object.assign({},m.headers),priority:m.priority,keepalive:d},v=(c=s,(p=m).urlConfig.endpoint===E.Endpoint._initialize&&b.Diagnostics._markInitNetworkReqStart(p.sdkKey,{attempt:c}),this._leakyBucket[a]),f=(v&&(v.lastRequestTime=Date.now(),this._leakyBucket[a]=v),null!=(t=this._netConfig.networkOverrideFunc)?t:fetch);let i;if((u=yield Promise.race([f(l,h).finally(()=>clearTimeout(i)),new Promise((e,t)=>{i=setTimeout(()=>{o=!0,t(new Error(`Timeout of ${this._timeout}ms expired.`))},this._timeout)})])).ok)return _=yield u.text(),L(m,u,s,_),this._fallbackResolver.tryBumpExpiryTime(m.sdkKey,m.urlConfig),{body:_,code:u.status};throw e=yield u.text().catch(()=>"No Text"),(g=new Error(`NetworkError: ${l} `+e)).name="NetworkError",g}catch(e){var r=function(e){if("string"==typeof e)return e;if(e instanceof Error)return e.name+": "+e.message;return"Unknown Error"}(e),d=function(e,t){e=e.includes("Timeout");return e||t}(null!=r?r:"",o),p=(L(m,u,s,"",e),yield this._fallbackResolver.tryFetchUpdatedFallbackInfo(m.sdkKey,m.urlConfig,r,d));return(p&&(m.fallbackUrl=this._fallbackResolver.getActiveFallbackUrl(m.sdkKey,m.urlConfig)),!i||i<s||!D.has(null!=(c=null===u||void 0===u?void 0:u.status)?c:500))?(null!=(a=this._emitter)&&a.call(this,{name:"error",error:e,tag:C.ErrorTag.NetworkError,requestArgs:m}),v=`A networking error occurred during ${n} request to ${l}.`,S.Log.error(v,r,e),null!=(t=this._errorBoundary)&&t.attachErrorIfNoneExists(v),null):(yield function(t){return y(this,void 0,void 0,function*(){yield new Promise(e=>setTimeout(e,Math.min(w*(t*t),O)))})}(s),this._sendRequest(Object.assign(Object.assign({},m),{retries:i,attempt:s+1})))}})}_getLogEventCompressionMode(e){let t=null==e?void 0:e.logEventCompressionMode;return t=(t=t||!0!==(null==e?void 0:e.disableCompression)?t:v.LogEventCompressionMode.Disabled)||v.LogEventCompressionMode.Enabled}_isRateLimited(e){var t=Date.now(),i=null!=(i=this._leakyBucket[e])?i:{count:0,lastRequestTime:t},n=t-i.lastRequestTime,n=Math.floor(.05*n);return i.count=Math.max(0,i.count-n),50<=i.count||(i.count+=1,i.lastRequestTime=t,this._leakyBucket[e]=i,!1)}_getPopulatedURL(e){var t=null!=(t=e.fallbackUrl)?t:e.urlConfig.getUrl();e.urlConfig.endpoint!==E.Endpoint._initialize&&e.urlConfig.endpoint!==E.Endpoint._download_config_specs||(this._lastUsedInitUrl=t);const i=Object.assign({[E.NetworkParam.SdkKey]:e.sdkKey,[E.NetworkParam.SdkType]:a.SDKType._get(e.sdkKey),[E.NetworkParam.SdkVersion]:u.SDK_VERSION,[E.NetworkParam.Time]:String(Date.now()),[E.NetworkParam.SessionID]:o.SessionID.get(e.sdkKey)},e.params);e=Object.keys(i).map(e=>encodeURIComponent(e)+"="+encodeURIComponent(i[e])).join("&");return t+(e?"?"+e:"")}_tryEncodeBody(t){var e,i=(0,r._getWindowSafe)(),n=t.body;if(t.isStatsigEncodable&&!this._options.disableStatsigEncoding&&"string"==typeof n&&null==(0,_._getStatsigGlobalFlag)("no-encode")&&null!=i&&i.btoa)try{t.body=i.btoa(n).split("").reverse().join(""),t.params=Object.assign(Object.assign({},null!=(e=t.params)?e:{}),{[E.NetworkParam.StatsigEncoded]:"1"})}catch(e){S.Log.warn("Request encoding failed for "+t.urlConfig.getUrl(),e)}}_tryToCompressBody(g){return y(this,void 0,void 0,function*(){var t,i=g.body;if("string"==typeof i&&function(e,t){if(!e.isCompressable)return;if(null!=(0,_._getStatsigGlobalFlag)("no-compress")||"undefined"==typeof CompressionStream||"undefined"==typeof TextEncoder)return;var i=null!=e.urlConfig.customUrl||null!=e.urlConfig.fallbackUrls,n=!0===h.SDKFlags.get(e.sdkKey,"enable_log_event_compression");switch(t.logEventCompressionMode){case v.LogEventCompressionMode.Disabled:return;case v.LogEventCompressionMode.Enabled:return i&&!n?void 0:1;case v.LogEventCompressionMode.Forced:return 1;default:return}}(g,this._options))try{for(var n,r=(new TextEncoder).encode(i),s=new CompressionStream("gzip"),a=s.writable.getWriter(),o=(a.write(r).catch(S.Log.error),a.close().catch(S.Log.error),s.readable.getReader()),l=[];!(n=yield o.read()).done;)l.push(n.value);var u=l.reduce((e,t)=>e+t.length,0),c=new Uint8Array(u);let e=0;for(const d of l)c.set(d,e),e+=d.length;g.body=c,g.params=Object.assign(Object.assign({},null!=(t=g.params)?t:{}),{[E.NetworkParam.IsGzipped]:"1"})}catch(e){S.Log.warn("Request compression failed for "+g.urlConfig.getUrl(),e)}})}_getInternalRequestArgs(e,t){var i=this._fallbackResolver.getActiveFallbackUrl(t.sdkKey,t.urlConfig),e=Object.assign(Object.assign({},t),{method:e,fallbackUrl:i});return"data"in t&&s(e,t.data),e}};const I=e=>!!e.sdkKey||(S.Log.warn("Unable to make request without an SDK key"),!1),s=(e,t)=>{var{sdkKey:i,fallbackUrl:n}=e,r=l.StableID.get(i),s=o.SessionID.get(i),i=a.SDKType._get(i);e.body=JSON.stringify(Object.assign(Object.assign({},t),{statsigMetadata:Object.assign(Object.assign({},u.StatsigMetadataProvider.get()),{stableID:r,sessionID:s,sdkType:i,fallbackUrl:n})}))};function L(e,t,i,n,r){e.urlConfig.endpoint===E.Endpoint._initialize&&b.Diagnostics._markInitNetworkReqEnd(e.sdkKey,b.Diagnostics._getDiagnosticsData(t,i,n,r))}},308:function(e,t,i){"use strict";var o=this&&this.__awaiter||function(e,a,o,l){return new(o=o||Promise)(function(i,t){function n(e){try{s(l.next(e))}catch(e){t(e)}}function r(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?i(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(n,r)}s((l=l.apply(e,a||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t._isDomainFailure=t.NetworkFallbackResolver=void 0;const a=i(8809),n=i(1406),s=i(7512),l=i(4534);function u(e,t){e=null!=(e=null==e?void 0:e.toLowerCase())?e:"";return t||e.includes("uncaught exception")||e.includes("failed to fetch")||e.includes("networkerror when attempting to fetch resource")}function c(e){return"statsig.network_fallback."+(0,n._DJB2)(e)}function d(e,t){e=c(e);t&&0!==Object.keys(t).length?l.Storage.setItem(e,JSON.stringify(t)):l.Storage.removeItem(e)}t.NetworkFallbackResolver=class{constructor(e){this._fallbackInfo=null,this._errorBoundary=null,this._dnsQueryCooldowns={},this._networkOverrideFunc=null==(e=e.networkConfig)?void 0:e.networkOverrideFunc}setErrorBoundary(e){this._errorBoundary=e}tryBumpExpiryTime(e,t){var i=null==(i=this._fallbackInfo)?void 0:i[t.endpoint];i&&(i.expiryTime=Date.now()+6048e5,d(e,Object.assign(Object.assign({},this._fallbackInfo),{[t.endpoint]:i})))}getActiveFallbackUrl(e,t){var i;if(null!=t.customUrl&&null!=t.fallbackUrls)return null;let n=this._fallbackInfo;null==n&&(n=null!=(r=function(e){e=c(e),e=l.Storage.getItem(e);if(!e)return null;try{return JSON.parse(e)}catch(e){return s.Log.error("Failed to parse FallbackInfo"),null}}(e))?r:{},this._fallbackInfo=n);var r=n[t.endpoint];return!r||Date.now()>(null!=(i=r.expiryTime)?i:0)||t.getChecksum()!==r.urlConfigChecksum?(delete n[t.endpoint],this._fallbackInfo=n,d(e,this._fallbackInfo),null):r.url||null}tryFetchUpdatedFallbackInfo(n,r,s,a){return o(this,void 0,void 0,function*(){var t,e,i;try{return u(s,a)?(e=null==r.customUrl&&null==r.fallbackUrls?yield this._tryFetchFallbackUrlsFromNetwork(r):r.fallbackUrls,!!(i=this._pickNewFallbackUrl(null==(t=this._fallbackInfo)?void 0:t[r.endpoint],e))&&(this._updateFallbackInfoWithNewUrl(n,r,i),!0)):!1}catch(e){return null!=(t=this._errorBoundary)&&t.logError("tryFetchUpdatedFallbackInfo",e),!1}})}_updateFallbackInfoWithNewUrl(e,t,i){var i={urlConfigChecksum:t.getChecksum(),url:i,expiryTime:Date.now()+6048e5,previous:[]},t=t.endpoint,n=null==(n=this._fallbackInfo)?void 0:n[t],n=(n&&i.previous.push(...n.previous),10<i.previous.length&&(i.previous=[]),null==(n=null==(n=this._fallbackInfo)?void 0:n[t])?void 0:n.url);null!=n&&i.previous.push(n),this._fallbackInfo=Object.assign(Object.assign({},this._fallbackInfo),{[t]:i}),d(e,this._fallbackInfo)}_tryFetchFallbackUrlsFromNetwork(s){return o(this,void 0,void 0,function*(){var e=this._dnsQueryCooldowns[s.endpoint];if(e&&Date.now()<e)return null;this._dnsQueryCooldowns[s.endpoint]=Date.now()+144e5;var t=[],e=yield(0,a._fetchTxtRecords)(null!=(e=this._networkOverrideFunc)?e:fetch),i=function(e){try{return new URL(e).pathname}catch(e){return null}}(s.defaultUrl);for(const r of e)if(r.startsWith(s.endpointDnsKey+"=")){var n=r.split("=");if(1<n.length){let e=n[1];e.endsWith("/")&&(e=e.slice(0,-1)),t.push("https://"+e+i)}}return t})}_pickNewFallbackUrl(e,t){var i;if(null==t)return null;var n=new Set(null!=(i=null==e?void 0:e.previous)?i:[]),r=null==e?void 0:e.url;let s=null;for(const o of t){var a=o.endsWith("/")?o.slice(0,-1):o;if(!n.has(o)&&a!==r){s=a;break}}return s}},t._isDomainFailure=u},1405:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1361:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3091:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SDKFlags=void 0;const i={};t.SDKFlags={setFlags:(e,t)=>{i[e]=t},get:(e,t)=>{return null!=(e=null==(e=i[e])?void 0:e[t])&&e}}},5902:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SDKType=void 0;const i={};let n;t.SDKType={_get:e=>{return(null!=(e=i[e])?e:"js-mono")+(null!==n&&void 0!==n?n:"")},_setClientType(e,t){i[e]=t},_setBindingType(e){n&&"-react"!==n||(n="-"+e)}}},6830:(e,n,t)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n._cloneObject=n._getUnloadEvent=n._getCurrentPageUrlSafe=n._addDocumentEventListenerSafe=n._addWindowEventListenerSafe=n._isServerEnv=n._getDocumentSafe=n._getWindowSafe=void 0;const i=t(7512);n._getWindowSafe=()=>"undefined"!=typeof window?window:null,n._getDocumentSafe=()=>{var e=(0,n._getWindowSafe)();return null!=(e=null==e?void 0:e.document)?e:null},n._isServerEnv=()=>{var e;return null===(0,n._getDocumentSafe)()&&(e="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,"string"==typeof EdgeRuntime||e)},n._addWindowEventListenerSafe=(e,t)=>{var i=(0,n._getWindowSafe)();"function"==typeof(null==i?void 0:i.addEventListener)&&i.addEventListener(e,t)},n._addDocumentEventListenerSafe=(e,t)=>{var i=(0,n._getDocumentSafe)();"function"==typeof(null==i?void 0:i.addEventListener)&&i.addEventListener(e,t)},n._getCurrentPageUrlSafe=()=>{var e;try{return null==(e=(0,n._getWindowSafe)())?void 0:e.location.href.split(/[?#]/)[0]}catch(e){}},n._getUnloadEvent=()=>{var e=(0,n._getWindowSafe)();return e&&"onpagehide"in e?"pagehide":"beforeunload"};n._cloneObject=(t,e)=>{try{return JSON.parse(JSON.stringify(e))}catch(e){return i.Log.error("Failed to clone object "+t),null}}},4143:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigSession=t.SessionID=void 0;const n=i(1845),r=i(2137),o=i(7512),l=i(4534),u=i(8023),c=18e5,d=144e5,g={};function _(t,e){return setTimeout(()=>{var e=null==(e=(0,n._getStatsigGlobal)())?void 0:e.instance(t);e&&e.$emt({name:"session_expired"})},e)}function h(e){return"statsig.session_id."+(0,r._getStorageKey)(e)}t.SessionID={get:e=>t.StatsigSession.get(e).data.sessionID},t.StatsigSession={get:e=>{null==g[e]&&(g[e]=function(e){let t=function(e){e=h(e);return(0,l._getObjectFromStorage)(e)}(e);var i=Date.now();t=t||{sessionID:(0,u.getUUID)(),startTime:i,lastUpdate:i};return{data:t,sdkKey:e}}(e));var e=g[e],t=Date.now(),i=e.data,n=e.sdkKey,r=((function({lastUpdate:e}){return Date.now()-e>c}(i)||function({startTime:e}){return Date.now()-e>d}(i))&&(i.sessionID=(0,u.getUUID)(),i.startTime=t,a=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instance(n))&&a.$emt({name:"session_expired"}),i.lastUpdate=t,i),s=e.sdkKey;s=h(s);try{(0,l._setObjectInStorage)(s,r)}catch(e){o.Log.warn("Failed to save SessionID")}clearTimeout(e.idleTimeoutID),clearTimeout(e.ageTimeoutID);var a=t-i.startTime;return e.idleTimeoutID=_(n,c),e.ageTimeoutID=_(n,d-a),e},overrideInitialSessionID:(e,t)=>{var i;g[t]=(e=e,t=t,i=Date.now(),{data:{sessionID:e,startTime:i,lastUpdate:i},sdkKey:t})}}},2176:(e,o)=>{"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o._fastApproxSizeOf=void 0;o._fastApproxSizeOf=(t,i)=>{let n=0;var r=Object.keys(t);for(let e=0;e<r.length;e++){var s=r[e],a=t[s];if((n=(n+=s.length)+("object"==typeof a&&null!==a?(0,o._fastApproxSizeOf)(a,i)+2:String(a).length+1))>=i)return n}return n}},9122:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCookieName=t.StableID=void 0;const n=i(2137),r=i(7512),s=i(6830),a=i(4534),o=i(8023),l={},u={},c={};function d(e){return"statsig.stable_id."+(0,n._getStorageKey)(e)}function g(e,t){t=d(t);try{(0,a._setObjectInStorage)(t,e)}catch(e){r.Log.warn("Failed to save StableID to storage")}}function _(e,t){var i;u[t]&&null!=(0,s._getDocumentSafe)()&&((i=new Date).setFullYear(i.getFullYear()+1),document.cookie=`${h(t)}=${encodeURIComponent(e)}; expires=${i.toUTCString()}; path=/`)}function h(e){return"statsig.stable_id."+(0,n._getStorageKey)(e)}t.StableID={cookiesEnabled:!1,randomID:Math.random().toString(36),get:e=>{if(c[e])return null;if(null!=l[e])return l[e];let t=null;return null!=(t=function(e){if(u[e]&&null!=(0,s._getDocumentSafe)())for(const n of document.cookie.split(";")){var[t,i]=n.trim().split("=");if(t===h(e))return decodeURIComponent(i)}return null}(e))?g(l[e]=t,e):(g(t=null==(t=function(e){e=d(e);return(0,a._getObjectFromStorage)(e)}(e))?(0,o.getUUID)():t,e),_(t,e),l[e]=t),t},setOverride:(e,t)=>{g(l[t]=e,t),_(e,t)},_setCookiesEnabled:(e,t)=>{u[e]=t},_setDisabled:(e,t)=>{c[e]=t}},t.getCookieName=h},1375:function(e,t,i){"use strict";var n=this&&this.__awaiter||function(e,a,o,l){return new(o=o||Promise)(function(i,t){function n(e){try{s(l.next(e))}catch(e){t(e)}}function r(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?i(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(n,r)}s((l=l.apply(e,a||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigClientBase=void 0,i(1845);const a=i(1845),o=i(5542),l=i(7770),u=i(7512),s=i(7787),c=i(6830),d=i(4143),g=i(9122),r=i(586),_=i(4534);t.StatsigClientBase=class{constructor(e,t,i,n){this.loadingStatus="Uninitialized",this._initializePromise=null,this._listeners={};var r,s=this.$emt.bind(this);null!=(null==n?void 0:n.logLevel)&&(u.Log.level=n.logLevel),null!=n&&n.disableStorage&&_.Storage._setDisabled(!0),null!=n&&n.initialSessionID&&d.StatsigSession.overrideInitialSessionID(n.initialSessionID,e),null!=n&&n.storageProvider&&_.Storage._setProvider(n.storageProvider),null!=n&&n.enableCookies&&g.StableID._setCookiesEnabled(e,n.enableCookies),null!=n&&n.disableStableID&&g.StableID._setDisabled(e,!0),this._sdkKey=e,this._options=null!=n?n:{},this._memoCache={},this.overrideAdapter=null!=(r=null==n?void 0:n.overrideAdapter)?r:null,this._logger=new l.EventLogger(e,s,i,n),this._errorBoundary=new o.ErrorBoundary(e,n,s),this._errorBoundary.wrap(this),this._errorBoundary.wrap(t),this._errorBoundary.wrap(this._logger),i.setErrorBoundary(this._errorBoundary),this.dataAdapter=t,this.dataAdapter.attach(e,n,i),this.storageProvider=_.Storage,null!=(t=null==(s=null==(r=this.overrideAdapter)?void 0:r.loadFromStorage)?void 0:s.call(r))&&t.catch(e=>this._errorBoundary.logError("OA::loadFromStorage",e)),this._primeReadyRipcord(),n=e,i=this,(0,c._isServerEnv)()||(s=(0,a._getStatsigGlobal)(),r=null!=(r=s.instances)?r:{},i=i,null!=r[n]&&u.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),r[n]=i,s.firstInstance||(s.firstInstance=i),s.instances=r,__STATSIG__=s)}updateRuntimeOptions(e){e.loggingEnabled?(this._options.loggingEnabled=e.loggingEnabled,this._logger.setLoggingEnabled(e.loggingEnabled)):null!=e.disableLogging&&(this._options.disableLogging=e.disableLogging,this._logger.setLoggingEnabled(e.disableLogging?"disabled":"browser-only")),null!=e.disableStorage&&(this._options.disableStorage=e.disableStorage,_.Storage._setDisabled(e.disableStorage)),null!=e.enableCookies&&(this._options.enableCookies=e.enableCookies,g.StableID._setCookiesEnabled(this._sdkKey,e.enableCookies)),e.logEventCompressionMode?this._logger.setLogEventCompressionMode(e.logEventCompressionMode):e.disableCompression&&this._logger.setLogEventCompressionMode(r.LogEventCompressionMode.Disabled)}flush(){return this._logger.flush()}shutdown(){return n(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),this._setStatus("Uninitialized",null),this._initializePromise=null,yield this._logger.stop()})}on(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)}off(e,t){this._listeners[e]&&-1!==(t=this._listeners[e].indexOf(t))&&this._listeners[e].splice(t,1)}$on(e,t){t.__isInternal=!0,this.on(e,t)}$emt(i){var e;const t=t=>{try{t(i)}catch(e){!0===t.__isInternal?this._errorBoundary.logError("__emit:"+i.name,e):u.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",i)}};this._listeners[i.name]&&this._listeners[i.name].forEach(e=>t(e)),null!=(e=this._listeners["*"])&&e.forEach(t)}_setStatus(e,t){this.loadingStatus=e,this._memoCache={},this.$emt({name:"values_updated",status:e,values:t})}_enqueueExposure(e,t,i){!0===(null==i?void 0:i.disableExposureLog)?this._logger.incrementNonExposureCount(e):this._logger.enqueue(t)}_memoize(n,r){return(e,t)=>{var i;return!this._options.disableEvaluationMemoization&&(i=(0,s.createMemoKey)(n,e,t))?(i in this._memoCache||(3e3<=Object.keys(this._memoCache).length&&(this._memoCache={}),this._memoCache[i]=r(e,t)),this._memoCache[i]):r(e,t)}}}},2636:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorTag=void 0,t.ErrorTag={NetworkError:"NetworkError"}},3206:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DataAdapterCachePrefix=void 0,t.DataAdapterCachePrefix="statsig.cached"},1637:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._createLayerParameterExposure=t._createConfigExposure=t._mapExposures=t._createGateExposure=t._isExposureEvent=void 0;const s="statsig::config_exposure",a="statsig::gate_exposure",u="statsig::layer_exposure",c=(e,t,i,n,r)=>(i.bootstrapMetadata&&(n.bootstrapMetadata=i.bootstrapMetadata),{eventName:e,user:t,value:null,metadata:o(i,n),secondaryExposures:r,time:Date.now()});t._isExposureEvent=({eventName:e})=>e===a||e===s||e===u;function d(e,t){return e.map(e=>"string"==typeof e?(null!=t?t:{})[e]:e).filter(e=>null!=e)}t._createGateExposure=(e,t,i)=>{var n,r={gate:t.name,gateValue:String(t.value),ruleID:t.ruleID};return null!=(null==(n=t.__evaluation)?void 0:n.version)&&(r.configVersion=t.__evaluation.version),c(a,e,t.details,r,d(null!=(e=null==(n=t.__evaluation)?void 0:n.secondary_exposures)?e:[],i))},t._mapExposures=d;t._createConfigExposure=(e,t,i)=>{var n,r={config:t.name,ruleID:t.ruleID};return null!=(null==(n=t.__evaluation)?void 0:n.version)&&(r.configVersion=t.__evaluation.version),null!=(null==(n=t.__evaluation)?void 0:n.passed)&&(r.rulePassed=String(t.__evaluation.passed)),c(s,e,t.details,r,d(null!=(e=null==(n=t.__evaluation)?void 0:n.secondary_exposures)?e:[],i))};t._createLayerParameterExposure=(e,t,i,n)=>{var r=t.__evaluation,s=!0===(null==(s=null==r?void 0:r.explicit_parameters)?void 0:s.includes(i));let a="",o=null!=(l=null==r?void 0:r.undelegated_secondary_exposures)?l:[];s&&(a=null!=(l=r.allocated_experiment_name)?l:"",o=null!=(l=r.secondary_exposures)?l:[]);var l=null==(r=t.__evaluation)?void 0:r.parameter_rule_ids,l={config:t.name,parameterName:i,ruleID:null!=(r=null==l?void 0:l[i])?r:t.ruleID,allocatedExperiment:a,isExplicitParameter:String(s)};return null!=(null==(i=t.__evaluation)?void 0:i.version)&&(l.configVersion=t.__evaluation.version),c(u,e,t.details,l,d(o,n))};const o=(e,t)=>(t.reason=e.reason,e.lcut&&(t.lcut=String(e.lcut)),e.receivedAt&&(t.receivedAt=String(e.receivedAt)),t)},8e3:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigMetadataProvider=t.SDK_VERSION=void 0,t.SDK_VERSION="3.31.0";let i={sdkVersion:t.SDK_VERSION,sdkType:"js-mono"};t.StatsigMetadataProvider={get:()=>i,add:e=>{i=Object.assign(Object.assign({},i),e)}}},586:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LoggingEnabledOption=t.LogEventCompressionMode=void 0,t.LogEventCompressionMode={Disabled:"d",Enabled:"e",Forced:"f"},t.LoggingEnabledOption={disabled:"disabled",browserOnly:"browser-only",always:"always"}},1098:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2059:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._makeTypedGet=t._mergeOverride=t._makeLayer=t._makeExperiment=t._makeDynamicConfig=t._makeFeatureGate=void 0;const a=i(7512),o=i(6634);function r(e,t,i,n){return{name:e,details:t,ruleID:null!=(e=null==i?void 0:i.rule_id)?e:"",__evaluation:i,value:n}}function n(e,t,i){var n=null!=(n=null==i?void 0:i.value)?n:{};return Object.assign(Object.assign({},r(e,t,i,n)),{idType:null!=(t=null==i?void 0:i.id_type)?t:null,get:s(e,null==i?void 0:i.value)})}function s(n,r,s){return(e,t)=>{var i=null!=(i=null==r?void 0:r[e])?i:null;return null==i?null!=t?t:null:null==t||(0,o._isTypeMatch)(i,t)?(null!=s&&s(e),i):(a.Log.warn(`Parameter type mismatch. '${n}.${e}' was found to be type '${typeof i}' but fallback/return type is '${typeof t}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),null!=t?t:null)}}t._makeFeatureGate=function(e,t,i){return Object.assign(Object.assign({},r(e,t,i,!0===(null==i?void 0:i.value))),{idType:null!=(e=null==i?void 0:i.id_type)?e:null})},t._makeDynamicConfig=n,t._makeExperiment=function(e,t,i){return e=n(e,t,i),Object.assign(Object.assign({},e),{groupName:null!=(t=null==i?void 0:i.group_name)?t:null})},t._makeLayer=function(e,t,i,n){return Object.assign(Object.assign({},r(e,t,i,void 0)),{get:s(e,null==i?void 0:i.value,n),groupName:null!=(t=null==i?void 0:i.group_name)?t:null,__value:null!=(e=null==i?void 0:i.value)?e:{}})},t._mergeOverride=function(e,t,i,n){return Object.assign(Object.assign(Object.assign({},e),t),{get:s(e.name,i,n)})},t._makeTypedGet=s},1812:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3932:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UPDATE_DETAIL_ERROR_MESSAGES=t.createUpdateDetails=void 0;t.createUpdateDetails=(e,t,i,n,r,s)=>({duration:i,source:t,success:e,error:n,sourceUrl:r,warnings:s}),t.UPDATE_DETAIL_ERROR_MESSAGES={NO_NETWORK_DATA:"No data was returned from the network. This may be due to a network timeout if a timeout value was specified in the options or ad blocker error."}},8578:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._getFullUserHash=t._normalizeUser=void 0;const n=i(1406),r=i(7512),s=i(6830);t._normalizeUser=function(e,t,i){return null==(e=(0,s._cloneObject)("StatsigUser",e))?(r.Log.error("Failed to clone user"),{statsigEnvironment:void 0}):(null!=t&&null!=t.environment?e.statsigEnvironment=t.environment:null!=i&&(e.statsigEnvironment={tier:i}),e)},t._getFullUserHash=function(e){return e?(0,n._DJB2Object)(e):null}},4534:(e,i,t)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i._setObjectInStorage=i._getObjectFromStorage=i.Storage=void 0;const n=t(7512);t=t(6830);const r={},s={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:e=>r[e]||null,setItem:(e,t)=>{r[e]=t},removeItem:e=>{delete r[e]},getAllKeys:()=>Object.keys(r)};let a=null;try{const c=(0,t._getWindowSafe)();c&&c.localStorage&&"function"==typeof c.localStorage.getItem&&(a={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:e=>c.localStorage.getItem(e),setItem:(e,t)=>c.localStorage.setItem(e,t),removeItem:e=>c.localStorage.removeItem(e),getAllKeys:()=>Object.keys(c.localStorage)})}catch(e){n.Log.warn("Failed to setup localStorageProvider.")}let o=null!==a&&void 0!==a?a:s,l=o;function u(e){try{return e()}catch(e){if(e instanceof Error&&"SecurityError"===e.name)return i.Storage._setProvider(s),null;throw e}}i.Storage={isReady:()=>l.isReady(),isReadyResolver:()=>l.isReadyResolver(),getProviderName:()=>l.getProviderName(),getItem:e=>u(()=>l.getItem(e)),setItem:(e,t)=>u(()=>l.setItem(e,t)),removeItem:e=>l.removeItem(e),getAllKeys:()=>l.getAllKeys(),_setProvider:e=>{o=e,l=e},_setDisabled:e=>{l=e?s:o}},i._getObjectFromStorage=function(t){var e=i.Storage.getItem(t);try{return JSON.parse(null!=e?e:"null")}catch(e){return n.Log.error(`Failed to parse value for key "${t}"`),null}},i._setObjectInStorage=function(e,t){i.Storage.setItem(e,JSON.stringify(t))}},3401:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._typedJsonParse=void 0;const r=i(7512);t._typedJsonParse=function(e,t,i){try{var n=JSON.parse(e);if(n&&"object"==typeof n&&t in n)return n}catch(e){}return r.Log.error("Failed to parse "+i),null}},6634:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._isTypeMatch=t._typeOf=void 0,t._typeOf=function(e){return Array.isArray(e)?"array":typeof e},t._isTypeMatch=function(e,t){var i=e=>Array.isArray(e)?"array":null===e?"null":typeof e;return i(e)===i(t)}},8023:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUUID=void 0,t.getUUID=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();let 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,e=>{let t=16*Math.random();return 0<i?(t=(i+t)%16|0,i=Math.floor(i/16)):(t=(n+t)%16|0,n=Math.floor(n/16)),("x"===e?t:7&t|8).toString(16)})}},1881:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UrlConfiguration=void 0;const n=i(1406),r=i(7410),s={[r.Endpoint._initialize]:"i",[r.Endpoint._rgstr]:"e",[r.Endpoint._download_config_specs]:"d"};t.UrlConfiguration=class{constructor(e,t,i,n){this.customUrl=null,this.fallbackUrls=null,this.endpoint=e,this.endpointDnsKey=s[e],t&&(this.customUrl=t),!t&&i&&(this.customUrl=i.endsWith("/")?""+i+e:i+"/"+e),n&&(this.fallbackUrls=n);t=r.NetworkDefault[e];this.defaultUrl=t+"/"+e}getUrl(){var e;return null!=(e=this.customUrl)?e:this.defaultUrl}getChecksum(){var e=(null!=(e=this.fallbackUrls)?e:[]).sort().join(",");return(0,n._DJB2)(this.customUrl+e)}}},2397:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._notifyVisibilityChanged=t._subscribeToVisiblityChanged=t._isUnloading=t._isCurrentlyVisible=void 0;i=i(6830);const n="foreground",r="background",s=[];let a=n,o=!1;t._isCurrentlyVisible=()=>a===n,t._isUnloading=()=>o,t._subscribeToVisiblityChanged=e=>{s.unshift(e)};t._notifyVisibilityChanged=t=>{t!==a&&(a=t,s.forEach(e=>e(t)))},(0,i._addWindowEventListenerSafe)("focus",()=>{(o=!1,t._notifyVisibilityChanged)(n)}),(0,i._addWindowEventListenerSafe)("blur",()=>(0,t._notifyVisibilityChanged)(r)),(0,i._addDocumentEventListenerSafe)("visibilitychange",()=>{(0,t._notifyVisibilityChanged)("visible"===document.visibilityState?n:r)}),(0,i._addWindowEventListenerSafe)((0,i._getUnloadEvent)(),()=>{o=!0,(0,t._notifyVisibilityChanged)(r)})},6914:function(e,t,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&("get"in r?t.__esModule:!r.writable&&!r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){e[n=void 0===n?i:n]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)},s=(Object.defineProperty(t,"__esModule",{value:!0}),t.Storage=t.Log=t.EventLogger=t.Diagnostics=void 0,i(1845),i(1845));const a=i(8962),o=(Object.defineProperty(t,"Diagnostics",{enumerable:!0,get:function(){return a.Diagnostics}}),i(7770)),l=(Object.defineProperty(t,"EventLogger",{enumerable:!0,get:function(){return o.EventLogger}}),i(7512));Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return l.Log}});var u=i(8e3);const c=i(4534);Object.defineProperty(t,"Storage",{enumerable:!0,get:function(){return c.Storage}}),r(i(1845),t),r(i(2137),t),r(i(6427),t),r(i(694),t),r(i(8962),t),r(i(3539),t),r(i(5542),t),r(i(2922),t),r(i(2417),t),r(i(1406),t),r(i(1333),t),r(i(7512),t),r(i(7787),t),r(i(7410),t),r(i(7023),t),r(i(1405),t),r(i(1361),t),r(i(6830),t),r(i(5902),t),r(i(4143),t),r(i(2176),t),r(i(9122),t),r(i(1375),t),r(i(2636),t),r(i(3206),t),r(i(1637),t),r(i(8e3),t),r(i(586),t),r(i(1098),t),r(i(2059),t),r(i(1812),t),r(i(8578),t),r(i(4534),t),r(i(3401),t),r(i(6634),t),r(i(1881),t),r(i(8023),t),r(i(2397),t),r(i(3932),t),r(i(3091),t),Object.assign((0,s._getStatsigGlobal)(),{Log:l.Log,SDK_VERSION:u.SDK_VERSION})},2016:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AutoInit=void 0;const m=i(6914),y=i(2018);function b(e,t){var i;return null!=(i=t.get(e))?i:t.get(e.toLowerCase())}t.AutoInit=class{static attempt(t){var e,i,n,r,s;try{var a=(0,m._getWindowSafe)(),o=(0,m._getDocumentSafe)();if(a&&o&&o.currentScript){var l=o.currentScript.getAttribute("src"),u=null==(e=a.location)?void 0:e.href;if(l&&u){var c=new URL(l,u).searchParams,d=null!=(i=b("sdkKey",c))?i:b("apiKey",c);if(d){var g={},_=b("proxy",c),h=(_&&(g.networkConfig={api:_}),null==(r=null==(n=(0,m._getStatsigGlobal)())?void 0:n.instances)?void 0:r[d]);let e=null;if(e=h instanceof y.StatsigClient?h:e)t({sdkKey:d,client:e});else{var v=o.currentScript.dataset;const f=function(e,t){if(e)if(e in t&&"function"==typeof t[e])return t[e];return null}(null!=(s=v.onstatsiginit)?s:v.onStatsigInit,a),p=new y.StatsigClient(d,function(){var e=(0,m._getWindowSafe)();if(!e)return{};let t=e.statsigUser||{};var i=(t="object"!=typeof t?{}:t).custom||{},n=t.customIDs||{};return Object.assign(Object.assign({},t),{customIDs:Object.assign({},n),custom:Object.assign(Object.assign({},i),{useragent:e.navigator.userAgent,page_url:(0,m._getCurrentPageUrlSafe)()||"",language:null==(n=e.navigator)?void 0:n.language})})}(),g);p.initializeAsync().then(()=>{f&&f(p)}).catch(e=>{m.Log.error(e)}),t({sdkKey:d,client:p})}}}}}catch(e){m.Log.error("AutoInit failed",e)}}}},7476:function(e,t,i){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=i(1964);n=n(i(1964)),i=i(2016);t.default=n.default,i.AutoInit.attempt(({client:e})=>{new r.AutoCapture(e)})},7262:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._resolveDeltasResponse=void 0;const n=i(6914);function r(e,t){null!=e&&e.forEach(e=>{delete t[e]})}t._resolveDeltasResponse=function(e,t){var i;return(t=(0,n._typedJsonParse)(t,"checksum","DeltasEvaluationResponse"))?(e=e,i=t,e=Object.assign(Object.assign(Object.assign({},e),i),{feature_gates:Object.assign(Object.assign({},e.feature_gates),i.feature_gates),layer_configs:Object.assign(Object.assign({},e.layer_configs),i.layer_configs),dynamic_configs:Object.assign(Object.assign({},e.dynamic_configs),i.dynamic_configs)}),r((e=i=e).deleted_gates,e.feature_gates),delete e.deleted_gates,r(i.deleted_configs,e.dynamic_configs),delete e.deleted_configs,r(i.deleted_layers,e.layer_configs),delete e.deleted_layers,i=e,(e=(0,n._DJB2Object)({feature_gates:i.feature_gates,dynamic_configs:i.dynamic_configs,layer_configs:i.layer_configs},2))===t.checksumV2?JSON.stringify(i):{hadBadDeltaChecksum:!0,badChecksum:e,badMergedConfigs:i,badFullResponse:t.deltas_full_response}):{hadBadDeltaChecksum:!0}}},4845:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=i(6914),s=i(140),a=i(7095);t.default=class{constructor(e){this._sdkKey=e,this._valuesForExternalUse=null,this._values=null,this._source="Uninitialized",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings=new Set}reset(){this._values=null,this._valuesForExternalUse=null,this._source="Loading",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings.clear()}finalize(){this._values||(this._source="NoValues")}getValues(){return this._valuesForExternalUse}setValues(e,t){var i,n;return!!e&&null!=(n=(0,r._typedJsonParse)(e.data,"has_updates","EvaluationResponse"))&&(this._source=e.source,!0!==(null==n?void 0:n.has_updates)||(null!=(i=n.time)?i:0)<this._lcut||(this._valuesForExternalUse=(0,r._typedJsonParse)(e.data,"has_updates","EvaluationResponse"),this._lcut=n.time,this._receivedAt=e.receivedAt,"init-v2"===n.response_format?this._values=new a.V2InitializeContainer(n):this._values=new s.V1InitializeContainer(n),this._bootstrapMetadata=this._extractBootstrapMetadata(e.source,n),e.source&&n.user&&this._setWarningState(t,n),r.SDKFlags.setFlags(this._sdkKey,null!=(i=n.sdk_flags)?i:{})),!0)}getWarnings(){if(0!==this._warnings.size)return Array.from(this._warnings)}getGate(e){e=this._values?this._values.getGate(e):null;return this._getDetailedStoreResult(e)}getConfig(e){e=this._values?this._values.getConfig(e):null;return this._getDetailedStoreResult(e)}getConfigList(){return this._values?this._values.getConfigList():[]}getLayer(e){e=this._values?this._values.getLayer(e):null;return this._getDetailedStoreResult(e)}getParamStore(e){e=this._values?this._values.getParamStore(e):null;return this._getDetailedStoreResult(e)}getSource(){return this._source}getExposureMapping(){var e;return null==(e=this._values)?void 0:e.getExposureMapping()}_extractBootstrapMetadata(e,t){return"Bootstrap"!==e?null:(e={},t.user&&(e.user=t.user),t.sdkInfo&&(e.generatorSDKInfo=t.sdkInfo),e.lcut=t.time,e)}_getDetailedStoreResult(e){return{result:e,details:this._getDetails(null==e)}}_setWarningState(e,t){var i,n=r.StableID.get(this._sdkKey);(null==(i=e.customIDs)?void 0:i.stableID)!==n&&(null!=(i=e.customIDs)&&i.stableID||n)?this._warnings.add("StableIDMismatch"):"user"in t&&(i=t.user,n=Object.assign(Object.assign({},e),{analyticsOnlyMetadata:void 0,privateAttributes:void 0}),(0,r._getFullUserHash)(n)!==(0,r._getFullUserHash)(i))&&this._warnings.add("PartialUserMatch")}getCurrentSourceDetails(){var e;return"Uninitialized"===this._source||"NoValues"===this._source?{reason:this._source}:(e={reason:this._source,lcut:this._lcut,receivedAt:this._receivedAt},0<this._warnings.size&&(e.warnings=Array.from(this._warnings)),e)}_getDetails(e){var t=this.getCurrentSourceDetails();let i=t.reason;var n=null!=(n=t.warnings)?n:[],e=("Bootstrap"===this._source&&0<n.length&&(i+=n[0]),"Uninitialized"!==i&&"NoValues"!==i&&(i=i+":"+(e?"Unrecognized":"Recognized")),"Bootstrap"===this._source&&null!=(n=this._bootstrapMetadata)?n:void 0);return e&&(t.bootstrapMetadata=e),Object.assign(Object.assign({},t),{reason:i})}}},8448:function(e,t,i){"use strict";var l=this&&this.__awaiter||function(e,a,o,l){return new(o=o||Promise)(function(i,t){function n(e){try{s(l.next(e))}catch(e){t(e)}}function r(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?i(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(n,r)}s((l=l.apply(e,a||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const u=i(6914),a=i(7262);class n extends u.NetworkCore{constructor(e,t){super(e,t);t=null==e?void 0:e.networkConfig;this._option=e,this._initializeUrlConfig=new u.UrlConfiguration(u.Endpoint._initialize,null==t?void 0:t.initializeUrl,null==t?void 0:t.api,null==t?void 0:t.initializeFallbackUrls)}fetchEvaluations(n,r,s,a,o){return l(this,void 0,void 0,function*(){var e,t=r?(0,u._typedJsonParse)(r,"has_updates","InitializeResponse"):null;let i={user:a,hash:null!=(e=null==(e=null==(e=this._option)?void 0:e.networkConfig)?void 0:e.initializeHashAlgorithm)?e:"djb2",deltasResponseRequested:!1,full_checksum:null};return null!=t&&t.has_updates&&(e=(null==t?void 0:t.hash_used)!==(null!=(e=null==(e=null==(e=this._option)?void 0:e.networkConfig)?void 0:e.initializeHashAlgorithm)?e:"djb2"),i=Object.assign(Object.assign({},i),{sinceTime:o&&!e?t.time:0,previousDerivedFields:"derived_fields"in t&&o?t.derived_fields:{},deltasResponseRequested:!0,full_checksum:t.full_checksum,partialUserMatchSinceTime:e?0:t.time})),this._fetchEvaluations(n,t,i,s)})}_fetchEvaluations(i,n,r,s){return l(this,void 0,void 0,function*(){var e,t=yield this.post({sdkKey:i,urlConfig:this._initializeUrlConfig,data:r,retries:2,isStatsigEncodable:!0,priority:s});return 204===(null==t?void 0:t.code)?'{"has_updates": false}':200!==(null==t?void 0:t.code)?null!=(e=null==t?void 0:t.body)?e:null:!0!==(null==n?void 0:n.has_updates)||!0!==(null==(e=t.body)?void 0:e.includes('"is_delta":true'))||!0!==r.deltasResponseRequested?t.body:"string"==typeof(e=(0,a._resolveDeltasResponse)(n,t.body))?e:this._fetchEvaluations(i,n,Object.assign(Object.assign(Object.assign({},r),e),{deltasResponseRequested:!1}),s)})}}t.default=n},3583:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._makeParamStoreGetter=void 0;const g=i(6914),_={disableExposureLog:!0};function h(e){return null==e||!1===e.disableExposureLog}function v(e,t){return null!=t&&!(0,g._isTypeMatch)(e,t)}t._makeParamStoreGetter=function(u,c,d){return(e,t)=>{if(null==c)return t;var i,n,r,s,a,o,l=c[e];if(null==l||null!=t&&(0,g._typeOf)(t)!==l.param_type)return t;switch(l.ref_type){case"static":return l.value;case"gate":return o=l,u.getFeatureGate(o.gate_name,h(d)?void 0:_).value?o.pass_value:o.fail_value;case"dynamic_config":return o=l,a=t,v(s=(s=u).getDynamicConfig(o.config_name,h(d)?void 0:_).get(o.param_name),a)?a:s;case"experiment":return a=l,s=t,v(r=(r=u).getExperiment(a.experiment_name,h(d)?void 0:_).get(a.param_name),s)?s:r;case"layer":return r=l,n=t,v(i=(i=u).getLayer(r.layer_name,h(d)?void 0:_).get(r.param_name),n)?n:i;default:return t}}}},8198:function(e,t,i){"use strict";var s=this&&this.__awaiter||function(e,a,o,l){return new(o=o||Promise)(function(i,t){function n(e){try{s(l.next(e))}catch(e){t(e)}}function r(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?i(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(n,r)}s((l=l.apply(e,a||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const a=i(6914),o=i(4845),l=i(8448),r=i(3583),u=i(4131);class n extends a.StatsigClientBase{static instance(e){var t=(0,a._getStatsigGlobal)().instance(e);return t instanceof n?t:(a.Log.warn((0,a._isServerEnv)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new n(null!=e?e:"",{}))}constructor(e,t,i=null){a.SDKType._setClientType(e,"javascript-client");var n,r=new l.default(i,e=>{this.$emt(e)}),e=(super(e,null!=(n=null==i?void 0:i.dataAdapter)?n:new u.StatsigEvaluationsDataAdapter,r,i),this._possibleFirstTouchMetadata={},this.getFeatureGate=this._memoize(a.MemoPrefix._gate,this._getFeatureGateImpl.bind(this)),this.getDynamicConfig=this._memoize(a.MemoPrefix._dynamicConfig,this._getDynamicConfigImpl.bind(this)),this.getExperiment=this._memoize(a.MemoPrefix._experiment,this._getExperimentImpl.bind(this)),this.getConfigList=this._memoize(a.MemoPrefix._configList,this._getConfigListImpl.bind(this)),this.getLayer=this._memoize(a.MemoPrefix._layer,this._getLayerImpl.bind(this)),this.getParameterStore=this._memoize(a.MemoPrefix._paramStore,this._getParameterStoreImpl.bind(this)),this._store=new o.default(e),this._network=r,this._user=this._configureUser(t,i),this._sdkInstanceID=(0,a.getUUID)(),null!=(n=null==i?void 0:i.plugins)?n:[]);for(const s of e)s.bind(this)}initializeSync(e){var t;return"Uninitialized"!==this.loadingStatus?(0,a.createUpdateDetails)(!0,this._store.getSource(),-1,null,null,["MultipleInitializations",...null!=(t=this._store.getWarnings())?t:[]]):(this._logger.start(),this.updateUserSync(this._user,e))}initializeAsync(e){return s(this,void 0,void 0,function*(){return this._initializePromise||(this._initializePromise=this._initializeAsyncImpl(e)),this._initializePromise})}updateUserSync(t,e){var i=performance.now();try{return this._updateUserSyncImpl(t,e,i)}catch(e){t=e instanceof Error?e:new Error(String(e));return this._createErrorUpdateDetails(t,i)}}_updateUserSyncImpl(e,t,i){var n=[...null!=(n=this._store.getWarnings())?n:[]],e=(this._resetForUser(e),this.dataAdapter.getDataSync(this._user)),t=(null==e&&n.push("NoCachedValues"),this._store.setValues(e,this._user),this._finalizeUpdate(e),null==t?void 0:t.disableBackgroundCacheRefresh);return!0===t||null==t&&"Bootstrap"===(null==e?void 0:e.source)||this._runPostUpdate(null!=e?e:null,this._user),(0,a.createUpdateDetails)(!0,this._store.getSource(),performance.now()-i,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),n)}updateUserAsync(e,n){return s(this,void 0,void 0,function*(){var t=performance.now();try{return yield this._updateUserAsyncImpl(e,n)}catch(e){var i=e instanceof Error?e:new Error(String(e));return this._createErrorUpdateDetails(i,t)}})}_updateUserAsyncImpl(n,r){return s(this,void 0,void 0,function*(){this._resetForUser(n);var e=this._user,t=(a.Diagnostics._markInitOverallStart(this._sdkKey),this.dataAdapter.getDataSync(e));if(this._store.setValues(t,this._user),this._setStatus("Loading",t),t=yield this.dataAdapter.getDataAsync(t,e,r),e!==this._user)return(0,a.createUpdateDetails)(!1,this._store.getSource(),-1,new Error("User changed during update"),this._network.getLastUsedInitUrlAndReset());let i=!1;null!=t&&(a.Diagnostics._markInitProcessStart(this._sdkKey),i=this._store.setValues(t,this._user),a.Diagnostics._markInitProcessEnd(this._sdkKey,{success:i})),this._finalizeUpdate(t),i||(this._errorBoundary.attachErrorIfNoneExists(a.UPDATE_DETAIL_ERROR_MESSAGES.NO_NETWORK_DATA),this.$emt({name:"initialization_failure"})),a.Diagnostics._markInitOverallEnd(this._sdkKey,i,this._store.getCurrentSourceDetails());e=a.Diagnostics._enqueueDiagnosticsEvent(this._user,this._logger,this._sdkKey,this._options);return(0,a.createUpdateDetails)(i,this._store.getSource(),e,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),this._store.getWarnings())})}getContext(){let e=(0,a._cloneObject)("StatsigUser",this._user);return null==e&&(a.Log.error("Failed to clone user"),e={}),{sdkKey:this._sdkKey,options:this._options,values:this._store.getValues(),user:e,errorBoundary:this._errorBoundary,session:a.StatsigSession.get(this._sdkKey),stableID:a.StableID.get(this._sdkKey),sdkInstanceID:this._sdkInstanceID}}checkGate(e,t){return this.getFeatureGate(e,t).value}logEvent(e,t,i){t="string"==typeof e?{eventName:e,value:t,metadata:i}:e;this.$emt({name:"log_event_called",event:t}),this._logger.enqueue(Object.assign(Object.assign({},t),{user:this._user,time:Date.now()}))}updateUserWithAnalyticsOnlyMetadata(e){this._user=this._configureUser(Object.assign(Object.assign({},this._user),{analyticsOnlyMetadata:e}),this._options)}_primeReadyRipcord(){this.$on("error",()=>{"Loading"===this.loadingStatus&&this._finalizeUpdate(null)})}_initializeAsyncImpl(e){return s(this,void 0,void 0,function*(){return a.Storage.isReady()||(yield a.Storage.isReadyResolver()),this._logger.start(),this.updateUserAsync(this._user,e)})}_createErrorUpdateDetails(e,t){return(0,a.createUpdateDetails)(!1,this._store.getSource(),performance.now()-t,e,null,[...null!=(t=this._store.getWarnings())?t:[]])}_finalizeUpdate(e){this._store.finalize(),this._setStatus("Ready",e)}_runPostUpdate(e,t){this.dataAdapter.getDataAsync(e,t,{priority:"low"}).catch(e=>{a.Log.error("An error occurred after update.",e)})}_resetForUser(e){this._logger.reset(),this._store.reset(),this._user=this._configureUser(e,this._options)}_configureUser(e,t){var i,e=(0,a._normalizeUser)(e,t);const n=null==(t=e.customIDs)?void 0:t.stableID;return n&&((i=null==(i=(t=this.storageProvider).isReadyResolver)?void 0:i.call(t))?i.then(()=>a.StableID.setOverride(n,this._sdkKey),()=>a.StableID.setOverride(n,this._sdkKey)):a.StableID.setOverride(n,this._sdkKey)),0<Object.keys(this._possibleFirstTouchMetadata).length&&(e.analyticsOnlyMetadata=Object.assign(Object.assign({},e.analyticsOnlyMetadata),this._possibleFirstTouchMetadata)),e}_getFeatureGateImpl(e,t){var{result:i,details:n}=this._store.getGate(e),n=(0,a._makeFeatureGate)(e,n,i),r=null==(r=null==(i=this.overrideAdapter)?void 0:i.getGateOverride)?void 0:r.call(i,n,this._user,t),i=null!=r?r:n;return this._enqueueExposure(e,(0,a._createGateExposure)(this._user,i,this._store.getExposureMapping()),t),this.$emt({name:"gate_evaluation",gate:i}),i}_getDynamicConfigImpl(e,t){var{result:i,details:n}=this._store.getConfig(e),n=(0,a._makeDynamicConfig)(e,n,i),r=null==(r=null==(i=this.overrideAdapter)?void 0:i.getDynamicConfigOverride)?void 0:r.call(i,n,this._user,t),i=null!=r?r:n;return this._enqueueExposure(e,(0,a._createConfigExposure)(this._user,i,this._store.getExposureMapping()),t),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:i}),i}_getExperimentImpl(e,t){var{result:i,details:n}=this._store.getConfig(e),n=(0,a._makeExperiment)(e,n,i),r=(null!=n.__evaluation&&(n.__evaluation.secondary_exposures=(0,a._mapExposures)(null!=(i=null==(i=n.__evaluation)?void 0:i.secondary_exposures)?i:[],this._store.getExposureMapping())),null==(r=null==(i=this.overrideAdapter)?void 0:i.getExperimentOverride)?void 0:r.call(i,n,this._user,t)),i=null!=r?r:n;return this._enqueueExposure(e,(0,a._createConfigExposure)(this._user,i,this._store.getExposureMapping()),t),this.$emt({name:"experiment_evaluation",experiment:i}),i}_getConfigListImpl(){return this._store.getConfigList()}_getLayerImpl(t,i){var{result:e,details:n}=this._store.getLayer(t),n=(0,a._makeLayer)(t,n,e),r=null==(r=null==(e=this.overrideAdapter)?void 0:e.getLayerOverride)?void 0:r.call(e,n,this._user,i);null!=i&&i.disableExposureLog&&this._logger.incrementNonExposureCount(t);const s=(0,a._mergeOverride)(n,r,null!=(e=null==r?void 0:r.__value)?e:n.__value,e=>{null!=i&&i.disableExposureLog||this._enqueueExposure(t,(0,a._createLayerParameterExposure)(this._user,s,e,this._store.getExposureMapping()),i)});return this.$emt({name:"layer_evaluation",layer:s}),s}_getParameterStoreImpl(e,t){var{result:i,details:n}=this._store.getParamStore(e),e=(this._logger.incrementNonExposureCount(e),{name:e,details:n,__configuration:i,get:(0,r._makeParamStoreGetter)(this,i,t)}),i=null==(i=null==(n=this.overrideAdapter)?void 0:n.getParamStoreOverride)?void 0:i.call(n,e,t);return null!=i&&(e.__configuration=i.config,e.details=i.details,e.get=(0,r._makeParamStoreGetter)(this,i.config,t)),e}}t.default=n},4131:function(e,t,i){"use strict";var s=this&&this.__awaiter||function(e,a,o,l){return new(o=o||Promise)(function(i,t){function n(e){try{s(l.next(e))}catch(e){t(e)}}function r(e){try{s(l.throw(e))}catch(e){t(e)}}function s(e){var t;e.done?i(e.value):((t=e.value)instanceof o?t:new o(function(e){e(t)})).then(n,r)}s((l=l.apply(e,a||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigEvaluationsDataAdapter=void 0;const n=i(6914),r=i(8448);class a extends n.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this._network=null,this._options=null}attach(e,t,i){super.attach(e,t,i),null!==i&&i instanceof r.default?this._network=i:this._network=new r.default(null!=t?t:{})}getDataAsync(e,t,i){return this._getDataAsyncImpl(e,(0,n._normalizeUser)(t,this._options),i)}prefetchData(e,t){return this._prefetchDataImpl(e,t)}setData(e){var t=(0,n._typedJsonParse)(e,"has_updates","data");t&&"user"in t?super.setData(e,t.user):n.Log.error("StatsigUser not found. You may be using an older server SDK version. Please upgrade your SDK or use setDataLegacy.")}setDataLegacy(e,t){super.setData(e,t)}_fetchFromNetwork(t,i,n,r){return s(this,void 0,void 0,function*(){var e=yield null==(e=this._network)?void 0:e.fetchEvaluations(this._getSdkKey(),t,null==n?void 0:n.priority,i,r);return null!=e?e:null})}_getCacheKey(e){e=(0,n._getStorageKey)(this._getSdkKey(),e,null==(e=this._options)?void 0:e.customUserCacheKeyFunc);return`${n.DataAdapterCachePrefix}.${this._cacheSuffix}.`+e}_isCachedResultValidFor204(e,t){return null!=e.fullUserHash&&e.fullUserHash===(0,n._getFullUserHash)(t)}}t.StatsigEvaluationsDataAdapter=a},140:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.V1InitializeContainer=void 0;const n=i(6914);t.V1InitializeContainer=class{constructor(e){this._values=e}getGate(e){return this._getResultFromLookup(this._values.feature_gates,e)}getConfig(e){return this._getResultFromLookup(this._values.dynamic_configs,e)}getLayer(e){return this._getResultFromLookup(this._values.layer_configs,e)}getParamStore(e){return this._getResultFromLookup(this._values.param_stores,e)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(e,t){var i;return e&&null!=(i=null!=(i=e[t])?i:e[(0,n._DJB2)(t)])?i:null}}},7095:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.V2InitializeContainer=void 0;const n=i(6914);t.V2InitializeContainer=class{constructor(e){this._values=e}getGate(e){var t=this._getResultFromLookup(this._values.feature_gates,e);return t?{name:e,value:!0===t.v,rule_id:null!=(e=t.r)?e:"default",secondary_exposures:null!=(e=t.s)?e:[],id_type:null!=(e=t.i)?e:""}:null}getConfig(e){var t=this._getResultFromLookup(this._values.dynamic_configs,e);return t?{name:e,value:null!=(e=this._values.values[t.v])?e:{},rule_id:t.r,secondary_exposures:null!=(e=t.s)?e:[],id_type:null!=(e=t.i)?e:"",is_user_in_experiment:!0===t.ue,passed:!0===t.p,group_name:null!=(e=t.gn)?e:void 0,is_experiment_active:!0===t.ea,group:t.r,is_device_based:"stableID"===t.i}:null}getLayer(e){var t=this._getResultFromLookup(this._values.layer_configs,e);return t?{name:e,value:null!=(e=this._values.values[t.v])?e:{},rule_id:t.r,secondary_exposures:null!=(e=t.s)?e:[],is_user_in_experiment:!0===t.ue,group_name:null!=(e=t.gn)?e:void 0,is_experiment_active:!0===t.ea,group:t.r,is_device_based:"stableID"===t.i,allocated_experiment_name:null!=(e=t.ae)?e:"",explicit_parameters:null!=(e=t.ep)?e:[],undelegated_secondary_exposures:null!=(e=t.us)?e:[],parameter_rule_ids:t.pr}:null}getParamStore(e){return this._getResultFromLookup(this._values.param_stores,e)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(e,t){var i;return e&&null!=(i=null!=(i=e[t])?i:e[(0,n._DJB2)(t)])?i:null}}},2018:function(e,t,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&("get"in r?t.__esModule:!r.writable&&!r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){e[n=void 0===n?i:n]=t[i]}),r=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)},s=(Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigClient=void 0,i(6914)),a=i(8198),r=(t.StatsigClient=a.default,r(i(6914),t),Object.assign((0,s._getStatsigGlobal)(),{StatsigClient:a.default}));t.default=r},4535:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AutoCapture=t.runStatsigAutoCapture=t.StatsigAutoCapturePlugin=void 0;const c=i(6914),a=i(5423),r=i(8872),s=i(7875),o=i(6714),l=i(4716),u=i(2678),d=i(5864),g=i(3769),_=i(9900),h={submit:a.AutoCaptureEventName.FORM_SUBMIT,click:a.AutoCaptureEventName.CLICK,copy:a.AutoCaptureEventName.COPY,cut:a.AutoCaptureEventName.COPY};function n(e,t){if((0,c._isServerEnv)())return null;var i=e.getContext()["sdkKey"];if(!(0,c._isServerEnv)()){var n=null!=(n=(0,c._getStatsigGlobal)().acInstances)?n:{};if(n[i])return n[i]}return new v(e,t)}t.StatsigAutoCapturePlugin=class{constructor(e){this._options=e,this.__plugin="auto-capture"}bind(e){n(e,this._options)}},t.runStatsigAutoCapture=n;class v{constructor(e,t){this._client=e,this._disabledEvents={},this._previousLoggedPageViewUrl=null,this._hasLoggedPageViewEnd=!1,this._pageViewLogged=!1;var{sdkKey:e,errorBoundary:i,values:n}=e.getContext(),i=(this._options=t,this._disabledEvents=null!=(n=null==(n=null==n?void 0:n.auto_capture_settings)?void 0:n.disabled_events)?n:{},this._errorBoundary=i,this._errorBoundary.wrap(this,"autoCapture:"),this._client.$on("values_updated",()=>{var e=this._client.getContext().values;this._disabledEvents=null!=(e=null==(e=null==e?void 0:e.auto_capture_settings)?void 0:e.disabled_events)?e:this._disabledEvents}),this._engagementManager=new o.EngagementManager,this._rageClickManager=new l.default,this._webVitalsManager=new u.WebVitalsManager(this._enqueueAutoCapture.bind(this),i),this._deadClickManager=new s.default(this._enqueueAutoCapture.bind(this),i),this._consoleLogManager=new r.ConsoleLogManager(this._enqueueAutoCapture.bind(this),i,null!=(n=null==t?void 0:t.consoleLogAutoCaptureSettings)?n:{enabled:!1}),this._eventFilterFunc=null==t?void 0:t.eventFilterFunc,(0,c._getDocumentSafe)());(0,c._isServerEnv)()||((t=null!=(n=(__STATSIG__=(0,c._getStatsigGlobal)()).acInstances)?n:{})[e]=this,__STATSIG__.acInstances=t),"loading"===(null==i?void 0:i.readyState)?i.addEventListener("DOMContentLoaded",()=>this._initialize()):this._initialize()}_addEventHandlers(){var e=(0,c._getWindowSafe)(),t=(0,c._getDocumentSafe)();if(e&&t){const i=(e,t=!0)=>{e=e||(null==(e=(0,c._getWindowSafe)())?void 0:e.event);this._autoLogEvent(e),t&&this._engagementManager.bumpInactiveTimer(),"click"===e.type&&e instanceof MouseEvent&&this._rageClickManager.isRageClick(e.clientX,e.clientY,Date.now())&&this._logRageClick(e)};(0,d._registerEventHandler)(t,"click",e=>i(e)),(0,d._registerEventHandler)(t,"submit",e=>i(e)),(0,d._registerEventHandler)(t,"copy",e=>i(e)),(0,d._registerEventHandler)(t,"cut",e=>i(e)),(0,d._registerEventHandler)(e,"error",e=>i(e,!1)),(0,d._registerEventHandler)(e,"pagehide",()=>this._tryLogPageViewEnd()),(0,d._registerEventHandler)(e,"beforeunload",()=>this._tryLogPageViewEnd())}}_addPageViewTracking(){var e=(0,c._getWindowSafe)(),t=(0,c._getDocumentSafe)();if(e&&t){if((0,d._registerEventHandler)(e,"popstate",()=>this._tryLogPageView("popstate")),e.history&&"function"==typeof Proxy&&"function"==typeof e.history.pushState)try{var i=e.history.pushState;e.history.pushState=new Proxy(i,{apply:(e,t,[i,n,r])=>{e=e.apply(t,[i,n,r]);return this._tryLogPageView("pushstate"),e}})}catch(e){}if(e.history&&"function"==typeof Proxy&&"function"==typeof e.history.replaceState)try{var n=e.history.replaceState;e.history.replaceState=new Proxy(n,{apply:(e,t,[i,n,r])=>{e=e.apply(t,[i,n,r]);return this._tryLogPageView("replacestate"),e}})}catch(e){}this._tryLogPageView()}}_autoLogEvent(e){var t=null==(t=e.type)?void 0:t.toLowerCase();if("error"===t&&e instanceof ErrorEvent)this._logError(e);else{var i=(0,d._getTargetNode)(e);if(i){t=h[t];if(t){var n=t===a.AutoCaptureEventName.COPY;if((0,d._shouldLogEvent)(e,i,n)){var r={};if(n){n=null==(n=null==(n=(0,c._getWindowSafe)())?void 0:n.getSelection())?void 0:n.toString();if(!n)return;null!=(s=this._options)&&s.captureCopyText&&(r.selectedText=(0,d._sanitizeString)(n));var s=e.type||"clipboard";r.clipType=s}var{value:n,metadata:e}=(0,g._gatherEventData)(i),s=(e.isOutbound&&this._engagementManager.setMeaningfulEngagementOccurred(!0),Object.assign(r,e),(0,_._gatherAllMetadata)((0,d._getSafeUrl)()));this._enqueueAutoCapture(t,n,Object.assign(Object.assign({},s),r))}}}}}_initialize(){this._webVitalsManager.startTracking(),this._deadClickManager.startTracking(),this._consoleLogManager.startTracking(),this._engagementManager.startInactivityTracking(()=>this._tryLogPageViewEnd(!0)),this._addEventHandlers(),this._addPageViewTracking(),this._logSessionStart(),this._logPerformance()}_logError(e){var t=(null==e?void 0:e.error)||{};let i=t;if("object"==typeof t)try{i=JSON.stringify(t)}catch(e){i="function"==typeof(null==t?void 0:t.toString)?t.toString():"Unknown Error"}this._enqueueAutoCapture(a.AutoCaptureEventName.ERROR,e.message,{message:e.message,filename:e.filename,lineno:e.lineno,colno:e.colno,error_str:i})}_logSessionStart(){var e=this._getSessionFromClient();try{this._isNewSession(e)&&this._enqueueAutoCapture(a.AutoCaptureEventName.SESSION_START,(0,d._getSanitizedPageUrl)(),Object.assign({sessionID:e.data.sessionID},(0,_._gatherAllMetadata)((0,d._getSafeUrl)())),{flushImmediately:!0})}catch(e){this._errorBoundary.logError("AC::logSession",e)}}_tryLogPageView(e){var t=(0,d._getSafeUrl)(),i=this._previousLoggedPageViewUrl;i&&t.pathname===i.pathname||(this._engagementManager.setLastPageViewTime(Date.now()),i=(this._hasLoggedPageViewEnd=!1,_._gatherAllMetadata)(t),e&&(i.navigation_type=e),this._previousLoggedPageViewUrl&&(i.last_page_view_url=this._previousLoggedPageViewUrl.href),this._pageViewLogged||(this._updateClientWithPossibleFirstTouchMetadata(),this._pageViewLogged=!0),this._enqueueAutoCapture(a.AutoCaptureEventName.PAGE_VIEW,(0,d._getSanitizedPageUrl)(),i,{flushImmediately:!0,addNewSessionMetadata:!0}),this._previousLoggedPageViewUrl=t,this._engagementManager.bumpInactiveTimer())}_tryLogPageViewEnd(e=!1){this._hasLoggedPageViewEnd||(this._hasLoggedPageViewEnd=!0,this._enqueueAutoCapture(a.AutoCaptureEventName.PAGE_VIEW_END,(0,d._getSanitizedPageUrl)(),Object.assign(Object.assign({},this._engagementManager.getPageViewEndMetadata()),{dueToInactivity:e}),{flushImmediately:!0}))}_logRageClick(e){var t,i;(0,d._shouldLogEvent)(e,e.target)&&({value:t,metadata:i}=(0,g._gatherEventData)(e.target),this._enqueueAutoCapture(a.AutoCaptureEventName.RAGE_CLICK,t,Object.assign(Object.assign({x:e.clientX,y:e.clientY,timestamp:Date.now()},(0,_._gatherAllMetadata)((0,d._getSafeUrl)())),i)))}_logPerformance(){const i=(0,c._getWindowSafe)();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 e={},t=i.performance.getEntriesByType("navigation"),t=(t&&0<t.length&&t[0]instanceof PerformanceNavigationTiming&&(t=t[0],e.load_time_ms=t.duration,e.dom_interactive_time_ms=t.domInteractive-t.startTime,e.redirect_count=t.redirectCount,e.transfer_bytes=t.transferSize),i.performance.getEntriesByName("first-contentful-paint"));t&&0<t.length&&t[0]instanceof PerformancePaintTiming&&(e.first_contentful_paint_time_ms=t[0].startTime),this._enqueueAutoCapture(a.AutoCaptureEventName.PERFORMANCE,(0,d._getSanitizedPageUrl)(),Object.assign(Object.assign({},e),(0,_._getNetworkInfo)()))},1)}_enqueueAutoCapture(e,t,i,n){var r,s,a;if(t){var o=e.slice("auto_capture::".length);if(!this._disabledEvents[e]&&!this._disabledEvents[o]){o=this._getSessionFromClient();try{var l=Object.assign({sessionID:o.data.sessionID,page_url:null!=(a=null==(s=null==(r=(0,c._getWindowSafe)())?void 0:r.location)?void 0:s.href)?a:""},i),u=(null!=n&&n.addNewSessionMetadata&&(l.isNewSession=String(this._isNewSession(o))),{eventName:e,value:t,metadata:l});this._eventFilterFunc&&!this._eventFilterFunc(u)||(this._client.logEvent(u),null!=n&&n.flushImmediately&&this._flushImmediately())}catch(e){this._errorBoundary.logError("AC::enqueue",e)}}}}_updateClientWithPossibleFirstTouchMetadata(){var e=this._client;e._possibleFirstTouchMetadata=(0,_._getPossibleFirstTouchMetadata)((0,d._getSafeUrl)()),0<Object.keys(e._possibleFirstTouchMetadata).length&&(e._user=Object.assign(Object.assign({},e._user),{analyticsOnlyMetadata:Object.assign(Object.assign({},e._possibleFirstTouchMetadata),e._user.analyticsOnlyMetadata)}))}_flushImmediately(){this._client.flush().catch(e=>{c.Log.error(e)})}_isNewSession(e){return Math.abs(e.data.startTime-Date.now())<1e3}_getSessionFromClient(){return this._client.getContext().session}static getAllMetadata(){return(0,_._gatherAllMetadata)((0,d._getSafeUrl)())}}t.AutoCapture=v},5423:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AutoCaptureEventName=void 0,t.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:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConsoleLogManager=void 0;const n=i(6914),r=i(5423),o=i(5864),l=i(8135),s=i(9900),u={trace:10,debug:20,log:30,info:30,warn:40,error:50};t.ConsoleLogManager=class{constructor(e,t,i){this._enqueueFn=e,this._errorBoundary=t,this._options=i,this._restoreFns=[],this._isTracking=!1,this._logLevel="info",this.__source="js-auto-capture",this._logLevel=null!=(e=this._options.logLevel)?e:"info",this._maxKeys=null!=(t=this._options.maxKeys)?t:50,this._maxDepth=null!=(i=this._options.maxDepth)?i:10,this._maxStringLength=null!=(e=this._options.maxStringLength)?e:2500}startTracking(){try{!this._isTracking&&this._options.enabled&&(0,n._getWindowSafe)()&&(this._patchConsole(),this._isTracking=!0)}catch(e){n.Log.error("Error starting console log tracking",e),this._errorBoundary.logError("autoCapture:ConsoleLogManager",e)}}stopTracking(){this._isTracking&&(this._restoreFns.forEach(e=>e()),this._restoreFns=[],this._isTracking=!1)}_patchConsole(){Object.entries(u).forEach(([s,e])=>{if(!(e<u[this._logLevel])&&console[s]){const a=console[s].bind(console);let r=!1;e=(0,o.wrapFunctionWithRestore)(console,s,n=>(...t)=>{if(n(...t),!r){r=!0;try{var e=t.map(e=>(0,l._safeStringify)(e,this._maxKeys,this._maxDepth,this._maxStringLength)),i=(0,l._getStackTrace)();this._enqueueConsoleLog(s,e,i)}catch(e){a("console observer error:",e,...t),this._errorBoundary.logError("autoCapture:ConsoleLogManager",e)}finally{r=!1}}});this._restoreFns.push(e)}})}_enqueueConsoleLog(e,t,i){this._shouldLog(t)&&(e=Object.assign({status:"log"===e?"info":e,log_level:e,payload:t,trace:i,timestamp:Date.now(),source:this.__source},(0,s._gatherAllMetadata)((0,o._getSafeUrl)())),this._enqueueFn(r.AutoCaptureEventName.CONSOLE_LOG,t.join(" "),e))}_shouldLog(e){for(const t of e)if(t.includes("[Statsig]"))return!1;return!this._options.sampleRate||"number"!=typeof this._options.sampleRate||this._options.sampleRate<=0||1<=this._options.sampleRate||Math.random()<this._options.sampleRate}}},7875:(e,i,t)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.DeadClickConfig=void 0;const a=t(6914),r=t(5423),s=t(5864),o=t(3769),l=t(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(e,t){this._enqueueFn=e,this._errorBoundary=t,this._lastMutationTime=0,this._lastSelectionChangeTime=0,this._clicks=[],this._deadClickConfig=i.DeadClickConfig,this._handleScroll=(0,s.throttle)(()=>{const t=Date.now();this._clicks.forEach(e=>{e.scrollDelayMs||(e.scrollDelayMs=t-e.timestamp)})},50)}startTracking(){try{var e=(0,a._getWindowSafe)();e&&(e.addEventListener("click",e=>this._handleClick(e),{capture:!0}),e.addEventListener("scroll",()=>this._handleScroll(),{capture:!0,passive:!0}),e.addEventListener("selectionchange",()=>this._handleSelectionChange()),this._setupMutationObserver())}catch(e){a.Log.error("Error starting dead click tracking",e),this._errorBoundary.logError("autoCapture:DeadClickManager",e)}}_handleClick(e){var t,e=e.target;e&&(t={timestamp:Date.now(),eventTarget:e},s.interactiveElements.includes(null==(e=null==e?void 0:e.tagName)?void 0:e.toLowerCase())||this._clicks.push(t),this._clicks.length)&&!this._clickCheckTimer&&(this._clickCheckTimer=null==(e=(0,a._getWindowSafe)())?void 0:e.setTimeout(()=>{this._checkForDeadClick()},this._deadClickConfig.CLICK_CHECK_TIMEOUT))}_handleSelectionChange(){this._lastSelectionChangeTime=Date.now()}_setupMutationObserver(){var e=(0,a._getDocumentSafe)();e&&(this._observer=new MutationObserver(()=>{this._lastMutationTime=Date.now()}),this._observer.observe(e.body,{childList:!0,subtree:!0,attributes:!0,characterData:!0}))}_checkForDeadClick(){if(this._clicks.length){clearTimeout(this._clickCheckTimer),this._clickCheckTimer=void 0;var e=this._clicks;this._clicks=[];for(const s of e){this._updateClickDelayMs(s);var t,i=null!=s.scrollDelayMs&&s.scrollDelayMs<this._deadClickConfig.SCROLL_DELAY_MS,n=null!=s.selectionChangeDelayMs&&s.selectionChangeDelayMs<this._deadClickConfig.SELECTION_CHANGE_DELAY_MS,r=null!=s.mutationDelayMs&&s.mutationDelayMs<this._deadClickConfig.MUTATION_DELAY_MS;i||n||r||(i=null!=s.scrollDelayMs&&s.scrollDelayMs>this._deadClickConfig.SCROLL_DELAY_MS,n=null!=s.selectionChangeDelayMs&&s.selectionChangeDelayMs>this._deadClickConfig.SELECTION_CHANGE_DELAY_MS,r=null!=s.mutationDelayMs&&s.mutationDelayMs>this._deadClickConfig.MUTATION_DELAY_MS,t=null!=s.absoluteDelayMs&&s.absoluteDelayMs>this._deadClickConfig.ABSOLUTE_DEAD_CLICK_TIMEOUT,i||n||r||t?this._logDeadClick(s,{scrollTimeout:i,selectionChangeTimeout:n,mutationTimeout:r,absoluteTimeout:t}):null!=s.absoluteDelayMs&&s.absoluteDelayMs<this._deadClickConfig.ABSOLUTE_DEAD_CLICK_TIMEOUT&&this._clicks.push(s))}this._clicks.length&&!this._clickCheckTimer&&(this._clickCheckTimer=null==(e=(0,a._getWindowSafe)())?void 0:e.setTimeout(()=>{this._checkForDeadClick()},this._deadClickConfig.CLICK_CHECK_TIMEOUT))}}_logDeadClick(e,t){var{value:i,metadata:n}=(0,o._gatherEventData)(e.eventTarget);i&&this._enqueueFn(r.AutoCaptureEventName.DEAD_CLICK,i,Object.assign(Object.assign(Object.assign(Object.assign({},n),t),(0,l._gatherCommonMetadata)((0,s._getSafeUrl)())),{scrollDelayMs:e.scrollDelayMs,selectionChangeDelayMs:e.selectionChangeDelayMs,mutationDelayMs:e.mutationDelayMs,absoluteDelayMs:e.absoluteDelayMs}))}_updateClickDelayMs(e){!e.mutationDelayMs&&0<this._lastMutationTime&&e.timestamp<=this._lastMutationTime&&(e.mutationDelayMs=Date.now()-this._lastMutationTime),!e.selectionChangeDelayMs&&0<this._lastSelectionChangeTime&&e.timestamp<=this._lastSelectionChangeTime&&(e.selectionChangeDelayMs=Date.now()-this._lastSelectionChangeTime),e.absoluteDelayMs=Date.now()-e.timestamp}}},6714:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EngagementManager=void 0;const n=i(6914);t.EngagementManager=class{constructor(){this._lastScrollY=0,this._maxScrollY=0,this._lastScrollPercentage=0,this._maxScrollPercentage=0,this._lastPageViewTime=Date.now(),this._inactiveTimer=null,this._onInactivityCallback=null,this._meaningfulEngagementOccurred=!1,this._initializeScrollTracking()}_initializeScrollTracking(){var e=(0,n._getWindowSafe)();e&&(e.addEventListener("scroll",()=>this._handleScroll()),e.addEventListener("scrollend",()=>this._handleScroll()),e.addEventListener("resize",()=>this._handleScroll()))}_handleScroll(){var e,t=(0,n._getWindowSafe)(),i=(0,n._getDocumentSafe)();t&&i&&(e=i.body.scrollHeight,i=t.scrollY||i.documentElement.scrollTop||0,t=t.innerHeight,this._lastScrollY=i,this._maxScrollY=Math.max(this._maxScrollY,i),i=Math.min(100,Math.round((i+t)/e*100)),this._lastScrollPercentage=i,this._maxScrollPercentage=Math.max(this._maxScrollPercentage,i),this.bumpInactiveTimer())}getScrollMetrics(){return{lastScrollY:this._lastScrollY,maxScrollY:this._maxScrollY,lastScrollPercentage:this._lastScrollPercentage,maxScrollPercentage:this._maxScrollPercentage,scrollDepth:this._maxScrollPercentage}}getPageViewLength(){return Date.now()-this._lastPageViewTime}setLastPageViewTime(e){this._lastPageViewTime=e}startInactivityTracking(e){this._onInactivityCallback=e}bumpInactiveTimer(){var e=(0,n._getWindowSafe)();e&&(this._inactiveTimer&&clearTimeout(this._inactiveTimer),this._inactiveTimer=e.setTimeout(()=>{this._onInactivityCallback&&this._onInactivityCallback()},6e5))}setMeaningfulEngagementOccurred(e){this._meaningfulEngagementOccurred=e}getPageViewEndMetadata(){var e=Object.assign(Object.assign({},this.getScrollMetrics()),{pageViewLength:this.getPageViewLength(),meaningfulEngagementOccurred:this._meaningfulEngagementOccurred});return this.setMeaningfulEngagementOccurred(!1),e}}},4716:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this._clicks=[]}isRageClick(e,t,i){this._clicks=this._clicks.filter(e=>i-e.timestamp<1e3);var n,r;return 0<this._clicks.length&&(n=this._clicks[this._clicks.length-1],r=e-n.x,n=t-n.y,!(Math.abs(r)+Math.abs(n)<=30))&&(this._clicks=[]),this._clicks.push({x:e,y:t,timestamp:i}),3<=this._clicks.length}}},2678:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebVitalsManager=void 0;const n=i(8572),r=i(6914),s=i(5423),a=i(5864),o=["CLS","FCP","INP","LCP","TTFB"];t.WebVitalsManager=class{constructor(e,t){this._enqueueFn=e,this._errorBoundary=t,this._isInitialized=!1,this._metricEvent={url:(0,a._getSafeUrlString)(),sanitizedUrl:(0,a._getSanitizedPageUrl)(),metrics:[],firstMetricTimestamp:void 0}}startTracking(){var e,t,i;try{this._isInitialized||"https:"!==(i=null==(t=null==(e=(0,r._getWindowSafe)())?void 0:e.location)?void 0:t.protocol)&&"http:"!==i||((0,n.onCLS)(e=>this._handleMetric(e)),(0,n.onFCP)(e=>this._handleMetric(e)),(0,n.onINP)(e=>this._handleMetric(e)),(0,n.onLCP)(e=>this._handleMetric(e)),(0,n.onTTFB)(e=>this._handleMetric(e)),this._isInitialized=!0)}catch(e){r.Log.error("Error starting web vitals tracking",e),this._errorBoundary.logError("autoCapture:WebVitalsManager",e)}}_handleMetric(e){var t;void 0===this._metricEvent.firstMetricTimestamp&&(this._metricEvent.firstMetricTimestamp=Date.now()),void 0!==e&&void 0!==(null==e?void 0:e.name)&&""!==(t=(0,a._getSafeUrlString)())&&o.includes(e.name)&&(t!==this._metricEvent.url&&(this._enqueueWebVitalsAutoCaptureEvent(),this._metricEvent.url=t),this._metricEvent.metrics.push({name:e.name,value:e.value,delta:e.delta,id:e.id}),this._metricEvent.metrics.length===o.length)&&this._enqueueWebVitalsAutoCaptureEvent()}_enqueueWebVitalsAutoCaptureEvent(){if(""!==this._metricEvent.url&&0!==this._metricEvent.metrics.length){const i={};this._metricEvent.metrics.forEach(e=>{var t=e.name.toLowerCase();i[t+"_value"]=e.value,i[t+"_delta"]=e.delta,i[t+"_id"]=e.id}),this._enqueueFn(s.AutoCaptureEventName.WEB_VITALS,this._metricEvent.sanitizedUrl,Object.assign(Object.assign({},i),{first_metric_timestamp:this._metricEvent.firstMetricTimestamp})),this._metricEvent={url:(0,a._getSafeUrlString)(),sanitizedUrl:(0,a._getSanitizedPageUrl)(),metrics:[],firstMetricTimestamp:void 0}}}}},1964:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigAutoCapturePlugin=t.runStatsigAutoCapture=t.AutoCapture=t.AutoCaptureEventName=void 0;var n=i(6914);const r=i(4535);Object.defineProperty(t,"AutoCapture",{enumerable:!0,get:function(){return r.AutoCapture}}),Object.defineProperty(t,"StatsigAutoCapturePlugin",{enumerable:!0,get:function(){return r.StatsigAutoCapturePlugin}}),Object.defineProperty(t,"runStatsigAutoCapture",{enumerable:!0,get:function(){return r.runStatsigAutoCapture}});var s=i(5423),i=(Object.defineProperty(t,"AutoCaptureEventName",{enumerable:!0,get:function(){return s.AutoCaptureEventName}}),Object.assign((0,n._getStatsigGlobal)(),{AutoCapture:r.AutoCapture,runStatsigAutoCapture:r.runStatsigAutoCapture,StatsigAutoCapturePlugin:r.StatsigAutoCapturePlugin}));t.default=i},5864:(e,a,t)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.wrapFunctionWithRestore=a.throttle=a._sanitizeString=a._getAnchorNodeInHierarchy=a._getSafeTimezoneOffset=a._getSafeTimezone=a._getSafeNetworkInformation=a._registerEventHandler=a._getSanitizedPageUrl=a._getSafeUrlString=a._getSafeUrl=a._shouldLogEvent=a._getTargetNode=a._stripEmptyValues=a.interactiveElements=void 0;const i=t(6914);const n=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 s(){var e=null!=(e=null==(e=null==(e=(0,i._getWindowSafe)())?void 0:e.location)?void 0:e.href)?e:"";let t;try{t=new URL(e)}catch(e){t=new URL("error:")}return t}function o(t){if(t){let e=t;for(;e;){var i=e.tagName.toLowerCase();if(["body","document"].includes(i))return null;if("a"===e.tagName.toLowerCase())return e;e=e.parentElement}}return null}a.interactiveElements=["button","a","input","select","textarea","form","select","label"],a._stripEmptyValues=function(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>null!=e&&""!==e&&void 0!==e))},a._getTargetNode=function(e){if(!e)return null;let t=e.target||e.srcElement;return t&&t instanceof Element?t=3===t.nodeType?t.parentNode||null:t:null},a._shouldLogEvent=function(e,t,i=!1){if(!e||!t||1!==t.nodeType)return!1;var n=t.tagName.toLowerCase(),r=e.type.toLowerCase();if(t.classList.contains("statsig-no-capture"))return!1;if(i)return!0;switch(n){case"html":return!1;case"form":return 0<=["submit"].indexOf(r);case"input":case"select":case"textarea":return 0<=["change","click"].indexOf(r);default:if("click"===r){var s=window.getComputedStyle(t);if(s&&"pointer"===s.getPropertyValue("cursor"))return!0;if(a.interactiveElements.includes(n))return!0;if("true"===t.getAttribute("contenteditable"))return!0;if(o(t))return!0}return!1}},a._getSafeUrl=s,a._getSafeUrlString=function(){var e=s().toString();return e.startsWith("error:")?"":e},a._getSanitizedPageUrl=function(){return(0,i._getCurrentPageUrlSafe)()||""},a._registerEventHandler=function(e,t,i){e&&e.addEventListener&&e.addEventListener(t,i,!0)},a._getSafeNetworkInformation=function(){var e=(0,i._getWindowSafe)();return e&&e.navigator&&e.navigator.connection||null},a._getSafeTimezone=function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return null}},a._getSafeTimezoneOffset=function(){try{return(new Date).getTimezoneOffset()}catch(e){return null}},a._getAnchorNodeInHierarchy=o,a._sanitizeString=function(e){return e?e.replace(/<[^>]*>/g,"").trim().split(/(\s+)/).filter(e=>{return!n.test((e||"").replace(/[- ]/g,""))&&!r.test((e||"").replace(/[- ]/g,""))}).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255):null},a.throttle=function(i,n){let r=0;return function(...e){var t=Date.now();t-r>=n&&(r=t,i(...e))}},a.wrapFunctionWithRestore=function(e,t,i){const n=e[t];if("function"!=typeof n)return()=>{};try{var r=i(n);return Object.defineProperty(r,"__statsig_original__",{enumerable:!1,value:n}),e[t]=r,()=>{e[t]=n}}catch(e){return()=>{}}}},8135:(e,t)=>{"use strict";function s(e,t){return e.length<=t?e:e.slice(0,t)+"..."}Object.defineProperty(t,"__esModule",{value:!0}),t._getStackTrace=t._safeStringify=void 0,t._safeStringify=function(e,t,i,n){try{return function(e,t,i){if(function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e)){if(Object.keys(e).length>t)return 1;if(function t(i,n){if(n<=0)return!0;if("object"!=typeof i||null===i)return!1;return Object.keys(i).some(e=>t(i[e],n-1))}(e,i))return 1}return"function"==typeof e}(e,t,i)?(r=n,s(e.toString(),r)):s("string"==typeof e?e:"object"==typeof e&&null!==e?JSON.stringify(e):String(e),n)}catch(e){return s("[Unserializable]",n)}var r},t._getStackTrace=function(){var e,t;try{return null!=(t=null==(e=(new Error).stack)?void 0:e.split("\n").slice(2))?t:[]}catch(e){return[]}}},3769:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._getMetadataFromElement=t._gatherCopyEventData=t._gatherEventData=void 0;const n=i(6914),l=i(5864),r=1e3,s=100,a=50;function o(e,t){return e?e.length>t?e.substring(0,t)+"...":e:null}function u(e){var t={};return t.class=(o(e.getAttribute("class"),r)||"").replace(/\s+/g," ").trim(),t.id=o(e.getAttribute("id"),r),t.ariaLabel=o(e.getAttribute("aria-label"),r),t.name=o(e.getAttribute("name"),r),t}function c(e){var t={},i=u(e),i=(Object.assign(t,i),Array.from(e.classList));return t.classList=0<i.length?i.slice(0,s):null,t.selector=function(t){if(!t)return"";if(!t.parentNode){var i=t.tagName.toLowerCase();if(t.id)return"#"+t.id;let e=i;return t.className&&"string"==typeof t.className&&0<(i=t.className.trim().split(/\s+/)).length&&""!==i[0]&&(e+="."+i.join(".")),e}var e=[];let n=t,r=0;for(;n&&n.nodeType===Node.ELEMENT_NODE&&r<a;){var s=function(n){var e=n.tagName.toLowerCase();if(n.id)return"#"+n.id;let r=e;n.className&&"string"==typeof n.className&&0<(e=n.className.trim().split(/\s+/)).length&&""!==e[0]&&(r+="."+e.join("."));e=n.parentElement;if(e&&1<e.children.length){let e=1,t=1,i=n.previousElementSibling;for(;i;)e++,i.tagName===n.tagName&&t++,i=i.previousElementSibling;r+=`:nth-child(${e})`,(1<t||function(e){let t=e.nextElementSibling;for(;t;){if(t.tagName===e.tagName)return 1;t=t.nextElementSibling}return}(n))&&(r+=`:nth-of-type(${t})`)}return r}(n);if(e.unshift(s),n.id)break;if((n=n.parentElement)&&"body"===n.tagName.toLowerCase())break;r++}return e.join(" > ")}(e),t}t._gatherEventData=function(e){var t,i,n,r,s,a=(0,l._getSanitizedPageUrl)()||"",o=e.tagName.toLowerCase();return"input"===(t=e).tagName.toLowerCase()&&["button","checkbox","submit","reset"].includes(t.getAttribute("type")||"")||"textarea"===t.tagName.toLowerCase()||"select"===t.tagName.toLowerCase()||"true"===t.getAttribute("contenteditable")?{value:a,metadata:u(e)}:((t={}).tagName=o,r=c(e),Object.assign(t,r),"form"===o&&Object.assign(t,((r={}).action=(i=e).getAttribute("action"),r.method=null!=(n=i.getAttribute("method"))?n:"GET",r.formName=i.getAttribute("name"),r.formId=i.getAttribute("id"),r)),"input"===o&&Object.assign(t,((n={}).content=(i=e).value,n.inputName=i.getAttribute("name"),n)),(r=(0,l._getAnchorNodeInHierarchy)(e))&&Object.assign(t,((s={}).href=r.getAttribute("href"),s)),"button"!==o&&!r||Object.assign(t,((s={}).content=((o=r||e).textContent||"").trim(),o=function(e){var t={};if(e){var i=null==e?void 0:e.dataset;if(i)for(const n in i)t["data-"+n]=i[n]||""}return t}(o),Object.assign(s,o),s)),function(e){if(Array.isArray(e.classList)&&null!=(t=e.classList)&&t.includes("statsig-ctr-capture"))return 1;var t=e.href;if(t)try{var i=(0,l._getSafeUrl)(),n=new URL(t);return i.host!==n.host}catch(e){}return}(t)&&(t.isOutbound="true"),{value:a,metadata:t})},t._gatherCopyEventData=function(e){var t=null==(t=null==(t=(0,n._getWindowSafe)())?void 0:t.getSelection())?void 0:t.toString(),i={},t=(i.selectedText=(0,l._sanitizeString)(t),e.type||"clipboard");return i.clipType=t,i},t._getMetadataFromElement=c},9900:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._getPossibleFirstTouchMetadata=t._getNetworkInfo=t._gatherAllMetadata=t._gatherCommonMetadata=void 0;const a=i(6914),o=i(5864);function s(e){var t=(0,a._getDocumentSafe)(),i=(0,a._getWindowSafe)();return(0,o._stripEmptyValues)(Object.assign({title:null==t?void 0:t.title,current_url:null==(t=null==i?void 0:i.location)?void 0:t.href,user_agent:null!=(t=null==i?void 0:i.navigator)&&t.userAgent&&200<(null==(t=null==(t=null==i?void 0:i.navigator)?void 0:t.userAgent)?void 0:t.length)?i.navigator.userAgent.substring(0,200):null==(t=null==i?void 0:i.navigator)?void 0:t.userAgent,locale:null==(t=null==i?void 0:i.navigator)?void 0:t.language,hostname:e.hostname,pathname:e.pathname,screen_width:null==(t=null==i?void 0:i.screen)?void 0:t.width,screen_height:null==(e=null==i?void 0:i.screen)?void 0:e.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._getSafeTimezone)(),timezone_offset:(0,o._getSafeTimezoneOffset)()},n()))}function n(){var e=(0,o._getSafeNetworkInformation)(),t={};return void 0!==(null==e?void 0:e.effectiveType)&&(t.effective_connection_type=e.effectiveType),void 0!==(null==e?void 0:e.rtt)&&(t.rtt_ms=e.rtt),void 0!==(null==e?void 0:e.downlink)&&(t.downlink_mbps=e.downlink,t.downlink_kbps=1e3*e.downlink),void 0!==(null==e?void 0:e.saveData)&&(t.save_data=e.saveData),t}function l(e){e=(null==e?void 0:e.referrer)||"";if(!e)return{referrer:null,referrer_domain:null,referrer_path:null,searchEngine:"",searchQuery:""};try{var t=new URL(e);const r=t.hostname;var i=["google","bing","yahoo","duckduckgo","baidu"].find(e=>r.includes(e+"."))||"",n=t.searchParams.get("yahoo"===i?"p":"q")||"";return{referrer:e,referrer_domain:t.hostname,referrer_path:t.pathname,searchEngine:i,searchQuery:n}}catch(e){return{referrer:null,referrer_domain:null,referrer_path:null,searchEngine:"",searchQuery:""}}}function u(e){const i=e.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(e=>{var t=i.get(e);t&&(n[e]=t)}),n}t._gatherCommonMetadata=s,t._gatherAllMetadata=function(e){var t=(0,a._getDocumentSafe)(),i=(0,a._getWindowSafe)();if(!t||!i)return{};var i=l(t),t=s(e),n=u(e);const r={};return e.searchParams.forEach((e,t)=>{r[t]=e}),Object.assign(Object.assign({},t),(0,o._stripEmptyValues)(Object.assign(Object.assign(Object.assign({},i),n),r)))},t._getNetworkInfo=n,t._getPossibleFirstTouchMetadata=function(e){var t=(0,a._getDocumentSafe)(),i=(0,a._getWindowSafe)();if(!t||!i)return{};var n,r,i=l(t),t=u(e),e=(0,o._stripEmptyValues)(Object.assign(Object.assign({},i),t)),s={};for([n,r]of Object.entries(e))s["$s_"+n]=r;return s}},8572:function(e,t){!function(e){"use strict";let r=-1;const l=t=>{addEventListener("pageshow",e=>{e.persisted&&(r=e.timeStamp,t(e))},!0)},u=(t,i,n,r)=>{let s,a;return e=>{i.value>=0&&(e||r)&&(a=i.value-(s??0),(a||void 0===s)&&(s=i.value,i.delta=a,i.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(i.value,n),t(i)))}},c=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},s=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},d=()=>{const e=s();return e?.activationStart??0},g=(e,t=-1)=>{const i=s();let n="navigate";r>=0?n="back-forward-cache":i&&(document.prerendering||d()>0?n="prerender":document.wasDiscarded?n="restore":i.type&&(n=i.type.replace(/_/g,"-")));return{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:n}},i=new WeakMap;function _(e,t){return i.get(e)||i.set(e,new t),i.get(e)}class o{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],i=this.o.at(-1);this.i&&t&&i&&e.startTime-i.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 h=(e,t,i={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const n=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return n.observe({type:e,buffered:!0,...i}),n}}catch{}},v=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let n=-1;const a=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,t=e=>{"hidden"===document.visibilityState&&n>-1&&(n="visibilitychange"===e.type?e.timeStamp:0,p())},f=()=>{addEventListener("visibilitychange",t,!0),addEventListener("prerenderingchange",t,!0)},p=()=>{removeEventListener("visibilitychange",t,!0),removeEventListener("prerenderingchange",t,!0)},m=()=>{if(n<0){const t=d(),e=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(e=>"hidden"===e.name&&e.startTime>t)[0]?.startTime;n=e??a(),f(),l(()=>{setTimeout(()=>{n=a(),f()})})}return{get firstHiddenTime(){return n}}},y=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},b=[1800,3e3],S=(t,a={})=>{y(()=>{const i=m();let n,r=g("FCP");const s=h("paint",e=>{for(const t of e)"first-contentful-paint"===t.name&&(s.disconnect(),t.startTime<i.firstHiddenTime&&(r.value=Math.max(t.startTime-d(),0),r.entries.push(t),n(!0)))});s&&(n=u(t,r,b,a.reportAllChanges),l(e=>{r=g("FCP"),n=u(t,r,b,a.reportAllChanges),c(()=>{r.value=performance.now()-e.timeStamp,n(!0)})}))})},E=[.1,.25];let C=0,k=1/0,w=0;const O=e=>{for(const t of e)t.interactionId&&(k=Math.min(k,t.interactionId),w=Math.max(w,t.interactionId),C=w?(w-k)/7+1:0)};let D;const I=()=>D?C:performance.interactionCount??0,L=()=>{"interactionCount"in performance||D||(D=h("event",O,{type:"event",buffered:!0,durationThreshold:0}))};let M=0;class U{u=[];l=new Map;m;p;v(){M=I(),this.u.length=0,this.l.clear()}T(){const e=Math.min(this.u.length-1,Math.floor((I()-M)/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 i=this.l.get(e.interactionId);if(i||this.u.length<10||e.duration>t.P){if(i?e.duration>i.P?(i.entries=[e],i.P=e.duration):e.duration===i.P&&e.startTime===i.entries[0].startTime&&i.entries.push(e):(i={id:e.interactionId,entries:[e],P:e.duration},this.l.set(i.id,i),this.u.push(i)),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?.(i)}}}const T=e=>{const t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=v(e),document.addEventListener("visibilitychange",e,{once:!0}),t(()=>{e(),document.removeEventListener("visibilitychange",e)}))},P=[200,500];class N{m;h(e){this.m?.(e)}}const j=[2500,4e3],A=[800,1800],x=e=>{document.prerendering?y(()=>x(e)):"complete"!==document.readyState?addEventListener("load",()=>x(e),!0):setTimeout(e)};e.CLSThresholds=E,e.FCPThresholds=b,e.INPThresholds=P,e.LCPThresholds=j,e.TTFBThresholds=A,e.onCLS=(s,a={})=>{S(v(()=>{let i,n=g("CLS",0);const r=_(a,o),e=e=>{for(const t of e)r.h(t);r.i>n.value&&(n.value=r.i,n.entries=r.o,i())},t=h("layout-shift",e);t&&(i=u(s,n,E,a.reportAllChanges),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&(e(t.takeRecords()),i(!0))}),l(()=>{r.i=0,n=g("CLS",0),i=u(s,n,E,a.reportAllChanges),c(()=>i())}),setTimeout(i))}))},e.onFCP=S,e.onINP=(s,a={})=>{globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype&&y(()=>{L();let i,n=g("INP");const r=_(a,U),e=t=>{T(()=>{for(const e of t)r.h(e);const e=r.T();e&&e.P!==n.value&&(n.value=e.P,n.entries=e.entries,i())})},t=h("event",e,{durationThreshold:a.durationThreshold??40});i=u(s,n,P,a.reportAllChanges),t&&(t.observe({type:"first-input",buffered:!0}),document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&(e(t.takeRecords()),i(!0))}),l(()=>{r.v(),n=g("INP"),i=u(s,n,P,a.reportAllChanges)}))})},e.onLCP=(a,o={})=>{y(()=>{const t=m();let i,n=g("LCP");const r=_(o,N),e=e=>{o.reportAllChanges||(e=e.slice(-1));for(const o of e)r.h(o),o.startTime<t.firstHiddenTime&&(n.value=Math.max(o.startTime-d(),0),n.entries=[o],i())},s=h("largest-contentful-paint",e);if(s){i=u(a,n,j,o.reportAllChanges);const t=v(()=>{e(s.takeRecords()),s.disconnect(),i(!0)});for(const a of["keydown","click","visibilitychange"])addEventListener(a,()=>T(t),{capture:!0,once:!0});l(e=>{n=g("LCP"),i=u(a,n,j,o.reportAllChanges),c(()=>{n.value=performance.now()-e.timeStamp,i(!0)})})}})},e.onTTFB=(t,i={})=>{let n=g("TTFB"),r=u(t,n,A,i.reportAllChanges);x(()=>{const e=s();e&&(n.value=Math.max(e.responseStart-d(),0),n.entries=[e],r(!0),l(()=>{n=g("TTFB",0),r=u(t,n,A,i.reportAllChanges),r(!0)}))})}}(t)}},r={},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i(7476).default;function i(e){var t=r[e];return void 0!==t||(t=r[e]={exports:{}},n[e].call(t.exports,t,t.exports,i)),t.exports}var n,r});