(globalThis.webpackChunknotion_next=globalThis.webpackChunknotion_next||[]).push([[28911],{12610:(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"}},14358:function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(s,n){function a(e){try{l(i.next(e))}catch(e){n(e)}}function o(e){try{l(i.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,o)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorBoundary=t.EXCEPTION_ENDPOINT=void 0,t.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception";let s="[Statsig] UnknownError";function n(e){return e instanceof Error?e:"string"==typeof e?Error(e):Error("An unknown error occurred.")}t.ErrorBoundary=class{constructor(e,t,r,i){this._sdkKey=e,this._options=t,this._emitter=r,this._lastSeenError=i,this._seen=new Set}wrap(e){try{(function(e){let t=new Set,r=Object.getPrototypeOf(e);for(;r&&r!==Object.prototype;)Object.getOwnPropertyNames(r).filter(e=>"function"==typeof(null==r?void 0:r[e])).forEach(e=>t.add(e)),r=Object.getPrototypeOf(r);return Array.from(t)})(e).forEach(t=>{let r=e[t];"$EB"in r||(e[t]=(...i)=>this._capture(t,()=>r.apply(e,i)),e[t].$EB=!0)})}catch(e){this._onError("eb:wrap",e)}}logError(e,t){this._onError(e,t)}getLastSeenErrorAndReset(){let e=this._lastSeenError;return this._lastSeenError=void 0,null!=e?e:null}attachErrorIfNoneExists(e){this._lastSeenError||(this._lastSeenError=n(e))}_capture(e,t){try{let r=t();if(r&&r instanceof Promise)return r.catch(t=>this._onError(e,t));return r}catch(t){return this._onError(e,t),null}}_onError(e,a){try{r(668024).Log.warn(`Caught error in ${e}`,{error:a}),i(this,void 0,void 0,function*(){var i,o,l,u,c,d,h;let _=a||Error(s),g=_ instanceof Error,f=g?_.name:"No Name",v=n(_);if(this._lastSeenError=v,this._seen.has(f))return;if(this._seen.add(f),null==(o=null==(i=this._options)?void 0:i.networkConfig)?void 0:o.preventAllNetworkTraffic){null==(l=this._emitter)||l.call(this,{name:"error",error:a,tag:e});return}let p=r(810686).SDKType._get(this._sdkKey),m=r(146512).StatsigMetadataProvider.get(),y=g?_.stack:function(e){try{return JSON.stringify(e)}catch(e){return s}}(_),b=Object.assign({tag:e,exception:f,info:y,statsigOptions:function(e){if(!e)return{};let t={};return Object.entries(e).forEach(([e,r])=>{switch(typeof r){case"number":case"bigint":case"boolean":t[String(e)]=r;break;case"string":r.length<50?t[String(e)]=r:t[String(e)]="set";break;case"object":"environment"===e?t.environment=r:"networkConfig"===e?t.networkConfig=r:t[String(e)]=null!=r?"set":"unset"}}),t}(this._options)},Object.assign(Object.assign({},m),{sdkType:p})),S=null!=(d=null==(c=null==(u=this._options)?void 0:u.networkConfig)?void 0:c.networkOverrideFunc)?d:fetch;yield S(t.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this._sdkKey,"STATSIG-SDK-TYPE":String(p),"STATSIG-SDK-VERSION":String(m.sdkVersion),"Content-Type":"application/json"},body:JSON.stringify(b)}),null==(h=this._emitter)||h.call(this,{name:"error",error:a,tag:e})}).then(()=>{}).catch(()=>{})}catch(e){}}}},32626:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StableID=void 0;let i={},s={},n={};function a(e){return`statsig.stable_id.${(0,r(894681)._getStorageKey)(e)}`}function o(e,t){let i=a(t);try{(0,r(601638)._setObjectInStorage)(i,e)}catch(e){r(668024).Log.warn("Failed to save StableID to storage")}}function l(e,t){if(!s[t]||!document)return;let r=new Date;r.setFullYear(r.getFullYear()+1),document.cookie=`${u(t)}=${encodeURIComponent(e)}; expires=${r.toUTCString()}; path=/`}function u(e){return`statsig.stable_id.${(0,r(894681)._getStorageKey)(e)}`}t.StableID={cookiesEnabled:!1,randomID:Math.random().toString(36),get:e=>{let t;if(n[e])return null;if(null!=i[e])return i[e];let c=null;return null!=(c=function(e){if(!s[e]||null==(0,r(600414)._getDocumentSafe)())return null;for(let t of document.cookie.split(";")){let[r,i]=t.trim().split("=");if(r===u(e))return decodeURIComponent(i)}return null}(e))?(i[e]=c,o(c,e)):(null==(t=a(e),c=(0,r(601638)._getObjectFromStorage)(t))&&(c=(0,r(537047).getUUID)()),o(c,e),l(c,e),i[e]=c),c},setOverride:(e,t)=>{i[t]=e,o(e,t),l(e,t)},_setCookiesEnabled:(e,t)=>{s[e]=t},_setDisabled:(e,t)=>{n[e]=t}}},36944:(e,t,r)=>{e.exports=r(873893)("round")},37253:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._createLayerParameterExposure=t._createConfigExposure=t._mapExposures=t._createGateExposure=t._isExposureEvent=void 0;let r="statsig::config_exposure",i="statsig::gate_exposure",s="statsig::layer_exposure",n=(e,t,r,i,s)=>(r.bootstrapMetadata&&(i.bootstrapMetadata=r.bootstrapMetadata),{eventName:e,user:t,value:null,metadata:o(r,i),secondaryExposures:s,time:Date.now()});function a(e,t){return e.map(e=>"string"==typeof e?(null!=t?t:{})[e]:e).filter(e=>null!=e)}t._isExposureEvent=({eventName:e})=>e===i||e===r||e===s,t._createGateExposure=(e,t,r)=>{var s,o,l;let u={gate:t.name,gateValue:String(t.value),ruleID:t.ruleID};return(null==(s=t.__evaluation)?void 0:s.version)!=null&&(u.configVersion=t.__evaluation.version),n(i,e,t.details,u,a(null!=(l=null==(o=t.__evaluation)?void 0:o.secondary_exposures)?l:[],r))},t._mapExposures=a,t._createConfigExposure=(e,t,i)=>{var s,o,l,u;let c={config:t.name,ruleID:t.ruleID};return(null==(s=t.__evaluation)?void 0:s.version)!=null&&(c.configVersion=t.__evaluation.version),(null==(o=t.__evaluation)?void 0:o.passed)!=null&&(c.rulePassed=String(t.__evaluation.passed)),n(r,e,t.details,c,a(null!=(u=null==(l=t.__evaluation)?void 0:l.secondary_exposures)?u:[],i))},t._createLayerParameterExposure=(e,t,r,i)=>{var o,l,u,c,d,h;let _=t.__evaluation,g=(null==(o=null==_?void 0:_.explicit_parameters)?void 0:o.includes(r))===!0,f="",v=null!=(l=null==_?void 0:_.undelegated_secondary_exposures)?l:[];g&&(f=null!=(u=_.allocated_experiment_name)?u:"",v=_.secondary_exposures);let p=null==(c=t.__evaluation)?void 0:c.parameter_rule_ids,m={config:t.name,parameterName:r,ruleID:null!=(d=null==p?void 0:p[r])?d:t.ruleID,allocatedExperiment:f,isExplicitParameter:String(g)};return(null==(h=t.__evaluation)?void 0:h.version)!=null&&(m.configVersion=t.__evaluation.version),n(s,e,t.details,m,a(v,i))};let o=(e,t)=>(t.reason=e.reason,e.lcut&&(t.lcut=String(e.lcut)),e.receivedAt&&(t.receivedAt=String(e.receivedAt)),t)},54387:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},79999:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._makeParamStoreGetter=void 0;let i={disableExposureLog:!0};function s(e){return null==e||!1===e.disableExposureLog}function n(e,t){return null!=t&&!(0,r(636978)._isTypeMatch)(e,t)}t._makeParamStoreGetter=function(e,t,a){return(o,l)=>{if(null==t)return l;let u=t[o];if(null==u||null!=l&&(0,r(636978)._typeOf)(l)!==u.param_type)return l;switch(u.ref_type){case"static":return u.value;case"gate":return e.getFeatureGate(u.gate_name,s(a)?void 0:i).value?u.pass_value:u.fail_value;case"dynamic_config":let c;return n(c=e.getDynamicConfig(u.config_name,s(a)?void 0:i).get(u.param_name),l)?l:c;case"experiment":let d;return n(d=e.getExperiment(u.experiment_name,s(a)?void 0:i).get(u.param_name),l)?l:d;case"layer":let h;return n(h=e.getLayer(u.layer_name,s(a)?void 0:i).get(u.param_name),l)?l:h;default:return l}}}},81570:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._getFullUserHash=t._normalizeUser=void 0,t._normalizeUser=function(e,t,i){try{let r=JSON.parse(JSON.stringify(e));return null!=t&&null!=t.environment?r.statsigEnvironment=t.environment:null!=i&&(r.statsigEnvironment={tier:i}),r}catch(e){return r(668024).Log.error("Failed to JSON.stringify user"),{statsigEnvironment:void 0}}},t._getFullUserHash=function(e){return e?(0,r(483918)._DJB2Object)(e):null}},84351:function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(s,n){function a(e){try{l(i.next(e))}catch(e){n(e)}}function o(e){try{l(i.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,o)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigClientBase=void 0,r(843509),t.StatsigClientBase=class{constructor(e,t,i,s){var n,a,o,l;this.loadingStatus="Uninitialized",this._initializePromise=null,this._listeners={};const u=this.$emt.bind(this);(null==s?void 0:s.logLevel)!=null&&(r(668024).Log.level=s.logLevel),(null==s?void 0:s.disableStorage)&&r(601638).Storage._setDisabled(!0),(null==s?void 0:s.initialSessionID)&&r(339839).StatsigSession.overrideInitialSessionID(s.initialSessionID,e),(null==s?void 0:s.storageProvider)&&r(601638).Storage._setProvider(s.storageProvider),(null==s?void 0:s.enableCookies)&&r(32626).StableID._setCookiesEnabled(e,s.enableCookies),(null==s?void 0:s.disableStableID)&&r(32626).StableID._setDisabled(e,!0),this._sdkKey=e,this._options=null!=s?s:{},this._memoCache={},this.overrideAdapter=null!=(n=null==s?void 0:s.overrideAdapter)?n:null,this._logger=new(r(85434)).EventLogger(e,u,i,s),this._errorBoundary=new(r(14358)).ErrorBoundary(e,s,u),this._errorBoundary.wrap(this),this._errorBoundary.wrap(t),this._errorBoundary.wrap(this._logger),i.setErrorBoundary(this._errorBoundary),this.dataAdapter=t,this.dataAdapter.attach(e,s,i),this.storageProvider=r(601638).Storage,null==(l=null==(o=null==(a=this.overrideAdapter)?void 0:a.loadFromStorage)?void 0:o.call(a))||l.catch(e=>this._errorBoundary.logError("OA::loadFromStorage",e)),this._primeReadyRipcord(),function(e,t){var i;if((0,r(600414)._isServerEnv)())return;let s=(0,r(843509)._getStatsigGlobal)(),n=null!=(i=s.instances)?i:{};null!=n[e]&&r(668024).Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),n[e]=t,s.firstInstance||(s.firstInstance=t),s.instances=n,__STATSIG__=s}(e,this)}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,r(601638).Storage._setDisabled(e.disableStorage)),null!=e.enableCookies&&(this._options.enableCookies=e.enableCookies,r(32626).StableID._setCookiesEnabled(this._sdkKey,e.enableCookies)),e.logEventCompressionMode?this._logger.setLogEventCompressionMode(e.logEventCompressionMode):e.disableCompression&&this._logger.setLogEventCompressionMode(r(647754).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){if(this._listeners[e]){let r=this._listeners[e].indexOf(t);-1!==r&&this._listeners[e].splice(r,1)}}$on(e,t){t.__isInternal=!0,this.on(e,t)}$emt(e){var t;let i=t=>{try{t(e)}catch(i){if(!0===t.__isInternal)return void this._errorBoundary.logError(`__emit:${e.name}`,i);r(668024).Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",e)}};this._listeners[e.name]&&this._listeners[e.name].forEach(e=>i(e)),null==(t=this._listeners["*"])||t.forEach(i)}_setStatus(e,t){this.loadingStatus=e,this._memoCache={},this.$emt({name:"values_updated",status:e,values:t})}_enqueueExposure(e,t,r){(null==r?void 0:r.disableExposureLog)===!0?this._logger.incrementNonExposureCount(e):this._logger.enqueue(t)}_memoize(e,t){return(i,s)=>{if(this._options.disableEvaluationMemoization)return t(i,s);let n=(0,r(240843).createMemoKey)(e,i,s);return n?(n in this._memoCache||(Object.keys(this._memoCache).length>=3e3&&(this._memoCache={}),this._memoCache[n]=t(i,s)),this._memoCache[n]):t(i,s)}}}},85434:function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(s,n){function a(e){try{l(i.next(e))}catch(e){n(e)}}function o(e){try{l(i.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,o)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.EventLogger=void 0;let s={},n="startup",a="gained_focus";class o{static _safeFlushAndForget(e){var t;null==(t=s[e])||t.flush().catch(()=>{})}static _safeRetryFailedLogs(e){var t;null==(t=s[e])||t._retryFailedLogs(a)}constructor(e,t,i,s){var n,a;this._sdkKey=e,this._emitter=t,this._network=i,this._options=s,this._queue=[],this._lastExposureTimeMap={},this._nonExposedChecks={},this._hasRunQuickFlush=!1,this._creationTime=Date.now(),this._loggingEnabled=null!=(n=null==s?void 0:s.loggingEnabled)?n:(null==s?void 0:s.disableLogging)===!0?r(647754).LoggingEnabledOption.disabled:r(647754).LoggingEnabledOption.browserOnly,(null==s?void 0:s.loggingEnabled)&&void 0!==s.disableLogging&&r(668024).Log.warn("Detected both loggingEnabled and disableLogging options. loggingEnabled takes precedence - please remove disableLogging."),this._maxQueueSize=null!=(a=null==s?void 0:s.loggingBufferMaxSize)?a:100;const o=null==s?void 0:s.networkConfig;this._logEventUrlConfig=new(r(188873)).UrlConfiguration(r(12610).Endpoint._rgstr,null==o?void 0:o.logEventUrl,null==o?void 0:o.api,null==o?void 0:o.logEventFallbackUrls)}setLogEventCompressionMode(e){this._network.setLogEventCompressionMode(e)}setLoggingEnabled(e){this._loggingEnabled=e}enqueue(e){this._shouldLogEvent(e)&&(this._normalizeAndAppendEvent(e),this._quickFlushIfNeeded(),this._queue.length>this._maxQueueSize&&o._safeFlushAndForget(this._sdkKey))}incrementNonExposureCount(e){var t;let r=null!=(t=this._nonExposedChecks[e])?t:0;this._nonExposedChecks[e]=r+1}reset(){this._lastExposureTimeMap={}}start(){var e;let t=(0,r(600414)._isServerEnv)();t&&(null==(e=this._options)?void 0:e.loggingEnabled)!=="always"||(s[this._sdkKey]=this,t||(0,r(592701)._subscribeToVisiblityChanged)(e=>{"background"===e?o._safeFlushAndForget(this._sdkKey):"foreground"===e&&o._safeRetryFailedLogs(this._sdkKey)}),this._retryFailedLogs(n),this._startBackgroundFlushInterval())}stop(){return i(this,void 0,void 0,function*(){this._flushIntervalId&&(clearInterval(this._flushIntervalId),this._flushIntervalId=null),delete s[this._sdkKey],yield this.flush()})}flush(){return i(this,void 0,void 0,function*(){if(this._appendAndResetNonExposedChecks(),0===this._queue.length)return;let e=this._queue;this._queue=[],yield this._sendEvents(e)})}_quickFlushIfNeeded(){this._hasRunQuickFlush||(this._hasRunQuickFlush=!0,Date.now()-this._creationTime>200||setTimeout(()=>o._safeFlushAndForget(this._sdkKey),200))}_shouldLogEvent(e){var t;if((null==(t=this._options)?void 0:t.loggingEnabled)!=="always"&&(0,r(600414)._isServerEnv)())return!1;if(!(0,r(37253)._isExposureEvent)(e))return!0;let i=e.user?e.user:{statsigEnvironment:void 0},s=(0,r(894681)._getUserStorageKey)(this._sdkKey,i),n=e.metadata?e.metadata:{},a=[e.eventName,s,n.gate,n.config,n.ruleID,n.allocatedExperiment,n.parameterName,String(n.isExplicitParameter),n.reason].join("|"),o=this._lastExposureTimeMap[a],l=Date.now();return(!o||!(l-o<6e5))&&(Object.keys(this._lastExposureTimeMap).length>1e3&&(this._lastExposureTimeMap={}),this._lastExposureTimeMap[a]=l,!0)}_sendEvents(e){var t,s;return i(this,void 0,void 0,function*(){if("disabled"===this._loggingEnabled)return this._saveFailedLogsToStorage(e),!1;try{let i=(0,r(592701)._isUnloading)()&&this._network.isBeaconSupported()&&(null==(s=null==(t=this._options)?void 0:t.networkConfig)?void 0:s.networkOverrideFunc)==null;if(this._emitter({name:"pre_logs_flushed",events:e}),(i?yield this._sendEventsViaBeacon(e):yield this._sendEventsViaPost(e)).success)return this._emitter({name:"logs_flushed",events:e}),!0;return r(668024).Log.warn("Failed to flush events."),this._saveFailedLogsToStorage(e),!1}catch(e){return r(668024).Log.warn("Failed to flush events."),!1}})}_sendEventsViaPost(e){var t;return i(this,void 0,void 0,function*(){let r=yield this._network.post(this._getRequestData(e)),i=null!=(t=null==r?void 0:r.code)?t:-1;return{success:i>=200&&i<300}})}_sendEventsViaBeacon(e){return i(this,void 0,void 0,function*(){return{success:yield this._network.beacon(this._getRequestData(e))}})}_getRequestData(e){return{sdkKey:this._sdkKey,data:{events:e},urlConfig:this._logEventUrlConfig,retries:3,isCompressable:!0,params:{[r(12610).NetworkParam.EventCount]:String(e.length)},credentials:"same-origin"}}_saveFailedLogsToStorage(e){for(;e.length>500;)e.shift();let t=this._getStorageKey();try{(0,r(601638)._setObjectInStorage)(t,e)}catch(e){r(668024).Log.warn("Unable to save failed logs to storage")}}_retryFailedLogs(e){let t=this._getStorageKey();i(this,void 0,void 0,function*(){r(601638).Storage.isReady()||(yield r(601638).Storage.isReadyResolver());let i=(0,r(601638)._getObjectFromStorage)(t);!i||(e===n&&r(601638).Storage.removeItem(t),(yield this._sendEvents(i))&&e===a&&r(601638).Storage.removeItem(t))}).catch(()=>{r(668024).Log.warn("Failed to flush stored logs")})}_getStorageKey(){return`statsig.failed_logs.${(0,r(483918)._DJB2)(this._sdkKey)}`}_normalizeAndAppendEvent(e){e.user&&(e.user=Object.assign({},e.user),delete e.user.privateAttributes);let t={},i=this._getCurrentPageUrl();i&&(t.statsigMetadata={currentPage:i});let s=Object.assign(Object.assign({},e),t);r(668024).Log.debug("Enqueued Event:",s),this._queue.push(s)}_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((null==(e=this._options)?void 0:e.includeCurrentPageUrlWithEvents)!==!1)return(0,r(600414)._getCurrentPageUrlSafe)()}_startBackgroundFlushInterval(){var e,t;let r=setInterval(()=>{let e=s[this._sdkKey];e&&e._flushIntervalId===r?o._safeFlushAndForget(this._sdkKey):clearInterval(r)},null!=(t=null==(e=this._options)?void 0:e.loggingIntervalMs)?t:1e4);this._flushIntervalId=r}}t.EventLogger=o},87677:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),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}finalize(){this._values||(this._source="NoValues")}getValues(){return this._rawValues?(0,r(636978)._typedJsonParse)(this._rawValues,"has_updates","EvaluationStoreValues"):null}setValues(e,t){var i;if(!e)return!1;let s=(0,r(636978)._typedJsonParse)(e.data,"has_updates","EvaluationResponse");return null!=s&&(this._source=e.source,(null==s?void 0:s.has_updates)!==!0||(this._rawValues=e.data,this._lcut=s.time,this._receivedAt=e.receivedAt,this._values=s,this._bootstrapMetadata=this._extractBootstrapMetadata(e.source,s),e.source&&s.user&&this._setWarningState(t,s),r(636978).SDKFlags.setFlags(this._sdkKey,null!=(i=s.sdk_flags)?i:{}),!0))}getWarnings(){if(0!==this._warnings.size)return Array.from(this._warnings)}getGate(e){var t;return this._getDetailedStoreResult(null==(t=this._values)?void 0:t.feature_gates,e)}getConfig(e){var t;return this._getDetailedStoreResult(null==(t=this._values)?void 0:t.dynamic_configs,e)}getLayer(e){var t;return this._getDetailedStoreResult(null==(t=this._values)?void 0:t.layer_configs,e)}getParamStore(e){var t;return this._getDetailedStoreResult(null==(t=this._values)?void 0:t.param_stores,e)}getSource(){return this._source}getExposureMapping(){var e;return null==(e=this._values)?void 0:e.exposures}_extractBootstrapMetadata(e,t){if("Bootstrap"!==e)return null;let r={};return t.user&&(r.user=t.user),t.sdkInfo&&(r.generatorSDKInfo=t.sdkInfo),r.lcut=t.time,r}_getDetailedStoreResult(e,t){let i=null;return e&&(i=e[t]?e[t]:e[(0,r(636978)._DJB2)(t)]),{result:i,details:this._getDetails(null==i)}}_setWarningState(e,t){var i,s;let n=r(636978).StableID.get(this._sdkKey);if((null==(i=e.customIDs)?void 0:i.stableID)!==n&&((null==(s=e.customIDs)?void 0:s.stableID)||n))return void this._warnings.add("StableIDMismatch");if("user"in t){let i=t.user;(0,r(636978)._getFullUserHash)(e)!==(0,r(636978)._getFullUserHash)(i)&&this._warnings.add("PartialUserMatch")}}getCurrentSourceDetails(){if("Uninitialized"===this._source||"NoValues"===this._source)return{reason:this._source};let e={reason:this._source,lcut:this._lcut,receivedAt:this._receivedAt};return this._warnings.size>0&&(e.warnings=Array.from(this._warnings)),e}_getDetails(e){var t,r;let i=this.getCurrentSourceDetails(),s=i.reason,n=null!=(t=i.warnings)?t:[];"Bootstrap"===this._source&&n.length>0&&(s+=n[0]),"Uninitialized"!==s&&"NoValues"!==s&&(s=`${s}:${e?"Unrecognized":"Recognized"}`);let a="Bootstrap"===this._source&&null!=(r=this._bootstrapMetadata)?r:void 0;return a&&(i.bootstrapMetadata=a),Object.assign(Object.assign({},i),{reason:s})}}},99652:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},105138:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,s)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigClient=void 0,t.StatsigClient=r(907686).default,s(r(636978),t),t.default=Object.assign((0,r(636978)._getStatsigGlobal)(),{StatsigClient:r(907686).default})},146512:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigMetadataProvider=t.SDK_VERSION=void 0,t.SDK_VERSION="3.17.1";let r={sdkVersion:t.SDK_VERSION,sdkType:"js-mono"};t.StatsigMetadataProvider={get:()=>r,add:e=>{r=Object.assign(Object.assign({},r),e)}}},150104:(e,t,r)=>{function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var s=function(){var r=arguments,i=t?t.apply(this,r):r[0],n=s.cache;if(n.has(i))return n.get(i);var a=e.apply(this,r);return s.cache=n.set(i,a)||n,a};return s.cache=new(i.Cache||r(353661)),s}i.Cache=r(353661),e.exports=i},183673:e=>{e.exports=function(e){for(var t=-1,r=null==e?0:e.length,i=0,s=[];++t{"use strict";function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=f,t.resolve=function(e,t){return f(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?f(e,!1,!0).resolveObject(t):t},t.format=function(e){return(r(732268).isString(e)&&(e=f(e)),e instanceof i)?e.format():i.prototype.format.call(e)},t.Url=i;var s=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,o=["'"].concat(["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n"," "])),l=["%","/","?",";","#"].concat(o),u=["/","?","#"],c=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,h={javascript:!0,"javascript:":!0},_={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function f(e,t,s){if(e&&r(732268).isObject(e)&&e instanceof i)return e;var n=new i;return n.parse(e,t,s),n}i.prototype.parse=function(e,t,i){if(!r(732268).isString(e))throw TypeError("Parameter 'url' must be a string, not "+typeof e);var n=e.indexOf("?"),f=-1!==n&&n127?P+="x":P+=j[A];if(!P.match(c)){var U=C.slice(0,E),N=C.slice(E+1),T=j.match(d);T&&(U.push(T[1]),N.unshift(T[2])),N.length&&(p="/"+N.join(".")+p),this.hostname=U.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),D||(this.hostname=r(361270).toASCII(this.hostname));var M=this.port?":"+this.port:"",R=this.hostname||"";this.host=R+M,this.href+=this.host,D&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==p[0]&&(p="/"+p))}if(!h[b])for(var E=0,I=o.length;E0)&&s.host.split("@");E&&(s.auth=E.shift(),s.host=s.hostname=E.shift())}return s.search=e.search,s.query=e.query,r(732268).isNull(s.pathname)&&r(732268).isNull(s.search)||(s.path=(s.pathname?s.pathname:"")+(s.search?s.search:"")),s.href=s.format(),s}if(!O.length)return s.pathname=null,s.search?s.path="/"+s.search:s.path=null,s.href=s.format(),s;for(var k=O.slice(-1)[0],D=(s.host||e.host||O.length>1)&&("."===k||".."===k)||""===k,C=0,I=O.length;I>=0;I--)"."===(k=O[I])?O.splice(I,1):".."===k?(O.splice(I,1),C++):C&&(O.splice(I,1),C--);if(!S&&!x)for(;C--;)O.unshift("..");S&&""!==O[0]&&(!O[0]||"/"!==O[0].charAt(0))&&O.unshift(""),D&&"/"!==O.join("/").substr(-1)&&O.push("");var j=""===O[0]||O[0]&&"/"===O[0].charAt(0);if(w){s.hostname=s.host=j?"":O.length?O.shift():"";var E=!!(s.host&&s.host.indexOf("@")>0)&&s.host.split("@");E&&(s.auth=E.shift(),s.host=s.hostname=E.shift())}return(S=S||s.host&&O.length)&&!j&&O.unshift(""),O.length?s.pathname=O.join("/"):(s.pathname=null,s.path=null),r(732268).isNull(s.pathname)&&r(732268).isNull(s.search)||(s.path=(s.pathname?s.pathname:"")+(s.search?s.search:"")),s.auth=e.auth||s.auth,s.slashes=s.slashes||e.slashes,s.href=s.format(),s},i.prototype.parseHost=function(){var e=this.host,t=n.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},188873:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UrlConfiguration=void 0;let i={[r(12610).Endpoint._initialize]:"i",[r(12610).Endpoint._rgstr]:"e",[r(12610).Endpoint._download_config_specs]:"d"};t.UrlConfiguration=class{constructor(e,t,s,n){this.customUrl=null,this.fallbackUrls=null,this.endpoint=e,this.endpointDnsKey=i[e],t&&(this.customUrl=t),!t&&s&&(this.customUrl=s.endsWith("/")?`${s}${e}`:`${s}/${e}`),n&&(this.fallbackUrls=n);const a=r(12610).NetworkDefault[e];this.defaultUrl=`${a}/${e}`}getUrl(){var e;return null!=(e=this.customUrl)?e:this.defaultUrl}getChecksum(){var e;let t=(null!=(e=this.fallbackUrls)?e:[]).sort().join(",");return(0,r(483918)._DJB2)(this.customUrl+t)}}},214263:function(e,t,r){var i,s,n;!function(a){"use strict";s=[r(540343)],void 0===(n="function"==typeof(i=a)?i.apply(t,s):i)||(e.exports=n)}(function(e){"use strict";var t=/(^|@)\S+:\d+/,r=/^\s*at .*(\S+:\d+|\(native\))/m,i=/^(eval@)?(\[native code])?$/;return{parse:function(e){if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(r))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw Error("Cannot parse given Error object")},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(t){return t.stack.split("\n").filter(function(e){return!!e.match(r)},this).map(function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var r=t.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),i=r.match(/ (\(.+\)$)/);r=i?r.replace(i[0],""):r;var s=this.extractLocation(i?i[1]:r);return new e({functionName:i&&r||void 0,fileName:["eval",""].indexOf(s[0])>-1?void 0:s[0],lineNumber:s[1],columnNumber:s[2],source:t})},this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter(function(e){return!e.match(i)},this).map(function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new e({functionName:t});var r=/((.*".+"[^@]*)?[^@]*)(?:@)/,i=t.match(r),s=i&&i[1]?i[1]:void 0,n=this.extractLocation(t.replace(r,""));return new e({functionName:s,fileName:n[0],lineNumber:n[1],columnNumber:n[2],source:t})},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(t){for(var r=/Line (\d+).*script (?:in )?(\S+)/i,i=t.message.split("\n"),s=[],n=2,a=i.length;n/,"$2").replace(/\([^)]*\)/g,"")||void 0;return n.match(/\(([^)]*)\)/)&&(r=n.replace(/^[^(]+\(([^)]*)\)$/,"$1")),new e({functionName:a,args:void 0===r||"[arguments not available]"===r?void 0:r.split(","),fileName:s[0],lineNumber:s[1],columnNumber:s[2],source:t})},this)}}})},230882:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Diagnostics=void 0;let r=new Map,i="start";function s(e,t,r,i){return Object.assign({key:r,action:t,step:i,timestamp:Date.now()},e)}function n(e,t){var i;let s=null!=(i=r.get(e))?i:[];s.push(t),r.set(e,s)}function a(e,t){if(t in e)return e[t]}t.Diagnostics={_getMarkers:e=>r.get(e),_markInitOverallStart:e=>{n(e,s({},i,"overall"))},_markInitOverallEnd:(e,t,r)=>{n(e,s({success:t,error:t?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:r},"end","overall"))},_markInitNetworkReqStart:(e,t)=>{n(e,s(t,i,"initialize","network_request"))},_markInitNetworkReqEnd:(e,t)=>{n(e,s(t,"end","initialize","network_request"))},_markInitProcessStart:e=>{n(e,s({},i,"initialize","process"))},_markInitProcessEnd:(e,t)=>{n(e,s(t,"end","initialize","process"))},_clearMarkers:e=>{r.delete(e)},_formatError(e){if(e&&"object"==typeof e)return{code:a(e,"code"),name:a(e,"name"),message:a(e,"message")}},_getDiagnosticsData(e,r,i,s){var n;return{success:(null==e?void 0:e.ok)===!0,statusCode:null==e?void 0:e.status,sdkRegion:null==(n=null==e?void 0:e.headers)?void 0:n.get("x-statsig-region"),isDelta:!0===i.includes('"is_delta":true')||void 0,attempt:r,error:t.Diagnostics._formatError(s)}},_enqueueDiagnosticsEvent(e,r,i,s){let n=t.Diagnostics._getMarkers(i);if(null==n||n.length<=0)return -1;let a=n[n.length-1].timestamp-n[0].timestamp;t.Diagnostics._clearMarkers(i);let o={eventName:"statsig::diagnostics",user:e,value:null,metadata:{context:"initialize",markers:n.slice(),statsigOptions:s},time:Date.now()};return r.enqueue(o),a}}},240843:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createMemoKey=t.MemoPrefix=void 0,t.MemoPrefix={_gate:"g",_dynamicConfig:"c",_experiment:"e",_layer:"l",_paramStore:"p"};let r=new Set([]),i=new Set(["userPersistedValues"]);t.createMemoKey=function(e,t,s){let n=`${e}|${t}`;if(!s)return n;for(let e of Object.keys(s)){if(i.has(e))return;r.has(e)?n+=`|${e}=true`:n+=`|${e}=${s[e]}`}return n}},244703:function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(s,n){function a(e){try{l(i.next(e))}catch(e){n(e)}}function o(e){try{l(i.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,o)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkCore=void 0,r(843509);let s=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(r(250052)).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"u">typeof navigator&&"function"==typeof navigator.sendBeacon}getLastUsedInitUrlAndReset(){let e=this._lastUsedInitUrl;return this._lastUsedInitUrl=null,e}beacon(e){return i(this,void 0,void 0,function*(){if(!n(e))return!1;let t=this._getInternalRequestArgs("POST",e);yield this._tryToCompressBody(t);let r=yield this._getPopulatedURL(t),i=navigator;return i.sendBeacon.bind(i)(r,t.body)})}post(e){return i(this,void 0,void 0,function*(){let t=this._getInternalRequestArgs("POST",e);return this._tryEncodeBody(t),yield this._tryToCompressBody(t),this._sendRequest(t)})}get(e){let t=this._getInternalRequestArgs("GET",e);return this._sendRequest(t)}_sendRequest(e){var t,a,l,u;return i(this,void 0,void 0,function*(){var c,d,h,_,g;if(!n(e)||this._netConfig.preventAllNetworkTraffic)return null;let{method:f,body:v,retries:p,attempt:m}=e,y=e.urlConfig.endpoint;if(this._isRateLimited(y))return r(668024).Log.warn(`Request to ${y} was blocked because you are making requests too frequently.`),null;let b=null!=m?m:1,S="u">typeof AbortController?new AbortController:null,x=setTimeout(()=>{null==S||S.abort(`Timeout of ${this._timeout}ms expired.`)},this._timeout),O=yield this._getPopulatedURL(e),w=null,E=(0,r(592701)._isUnloading)();try{let i={method:f,body:v,headers:Object.assign({},e.headers),signal:null==S?void 0:S.signal,priority:e.priority,keepalive:E};c=e,d=b,c.urlConfig.endpoint===r(12610).Endpoint._initialize&&r(230882).Diagnostics._markInitNetworkReqStart(c.sdkKey,{attempt:d});let s=this._leakyBucket[y];s&&(s.lastRequestTime=Date.now(),this._leakyBucket[y]=s);let n=null!=(t=this._netConfig.networkOverrideFunc)?t:fetch;if(w=yield n(O,i),clearTimeout(x),!w.ok){let e=yield w.text().catch(()=>"No Text"),t=Error(`NetworkError: ${O} ${e}`);throw t.name="NetworkError",t}let a=yield w.text();return o(e,w,b,a),this._fallbackResolver.tryBumpExpiryTime(e.sdkKey,e.urlConfig),{body:a,code:w.status}}catch(c){let t=(h=S,_=c,(null==h?void 0:h.signal.aborted)&&"string"==typeof h.signal.reason?h.signal.reason:"string"==typeof _?_:_ instanceof Error?`${_.name}: ${_.message}`:"Unknown Error"),n=(null==(g=S)?void 0:g.signal.aborted)&&"string"==typeof g.signal.reason&&g.signal.reason.includes("Timeout")||!1;if(o(e,w,b,"",c),(yield this._fallbackResolver.tryFetchUpdatedFallbackInfo(e.sdkKey,e.urlConfig,t,n))&&(e.fallbackUrl=this._fallbackResolver.getActiveFallbackUrl(e.sdkKey,e.urlConfig)),!p||b>p||!s.has(null!=(a=null==w?void 0:w.status)?a:500)){null==(l=this._emitter)||l.call(this,{name:"error",error:c,tag:r(971180).ErrorTag.NetworkError,requestArgs:e});let i=`A networking error occurred during ${f} request to ${O}.`;return r(668024).Log.error(i,t,c),null==(u=this._errorBoundary)||u.attachErrorIfNoneExists(i),null}return yield function(e){return i(this,void 0,void 0,function*(){yield new Promise(t=>setTimeout(t,Math.min(e*e*500,3e4)))})}(b),this._sendRequest(Object.assign(Object.assign({},e),{retries:p,attempt:b+1}))}})}_getLogEventCompressionMode(e){let t=null==e?void 0:e.logEventCompressionMode;return t||(null==e?void 0:e.disableCompression)!==!0||(t=r(647754).LogEventCompressionMode.Disabled),t||(t=r(647754).LogEventCompressionMode.Enabled),t}_isRateLimited(e){var t;let r=Date.now(),i=null!=(t=this._leakyBucket[e])?t:{count:0,lastRequestTime:r},s=Math.floor((r-i.lastRequestTime)*.05);return i.count=Math.max(0,i.count-s),i.count>=50||(i.count+=1,i.lastRequestTime=r,this._leakyBucket[e]=i,!1)}_getPopulatedURL(e){var t;return i(this,void 0,void 0,function*(){let i=null!=(t=e.fallbackUrl)?t:e.urlConfig.getUrl();(e.urlConfig.endpoint===r(12610).Endpoint._initialize||e.urlConfig.endpoint===r(12610).Endpoint._download_config_specs)&&(this._lastUsedInitUrl=i);let s=Object.assign({[r(12610).NetworkParam.SdkKey]:e.sdkKey,[r(12610).NetworkParam.SdkType]:r(810686).SDKType._get(e.sdkKey),[r(12610).NetworkParam.SdkVersion]:r(146512).SDK_VERSION,[r(12610).NetworkParam.Time]:String(Date.now()),[r(12610).NetworkParam.SessionID]:r(339839).SessionID.get(e.sdkKey)},e.params),n=Object.keys(s).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(s[e])}`).join("&");return`${i}${n?`?${n}`:""}`})}_tryEncodeBody(e){var t;let i=(0,r(600414)._getWindowSafe)(),s=e.body;if(e.isStatsigEncodable&&!this._options.disableStatsigEncoding&&"string"==typeof s&&null==(0,r(843509)._getStatsigGlobalFlag)("no-encode")&&(null==i?void 0:i.btoa))try{e.body=i.btoa(s).split("").reverse().join(""),e.params=Object.assign(Object.assign({},null!=(t=e.params)?t:{}),{[r(12610).NetworkParam.StatsigEncoded]:"1"})}catch(t){r(668024).Log.warn(`Request encoding failed for ${e.urlConfig.getUrl()}`,t)}}_tryToCompressBody(e){var t;return i(this,void 0,void 0,function*(){let i=e.body;if("string"==typeof i&&function(e,t){if(!e.isCompressable||null!=(0,r(843509)._getStatsigGlobalFlag)("no-compress")||"u"e+t.length,0),d=new Uint8Array(c),h=0;for(let e of u)d.set(e,h),h+=e.length;e.body=d,e.params=Object.assign(Object.assign({},null!=(t=e.params)?t:{}),{[r(12610).NetworkParam.IsGzipped]:"1"})}catch(t){r(668024).Log.warn(`Request compression failed for ${e.urlConfig.getUrl()}`,t)}})}_getInternalRequestArgs(e,t){let r=this._fallbackResolver.getActiveFallbackUrl(t.sdkKey,t.urlConfig),i=Object.assign(Object.assign({},t),{method:e,fallbackUrl:r});return"data"in t&&a(i,t.data),i}};let n=e=>!!e.sdkKey||(r(668024).Log.warn("Unable to make request without an SDK key"),!1),a=(e,t)=>{let{sdkKey:i,fallbackUrl:s}=e,n=r(32626).StableID.get(i),a=r(339839).SessionID.get(i),o=r(810686).SDKType._get(i);e.body=JSON.stringify(Object.assign(Object.assign({},t),{statsigMetadata:Object.assign(Object.assign({},r(146512).StatsigMetadataProvider.get()),{stableID:n,sessionID:a,sdkType:o,fallbackUrl:s})}))};function o(e,t,i,s,n){e.urlConfig.endpoint===r(12610).Endpoint._initialize&&r(230882).Diagnostics._markInitNetworkReqEnd(e.sdkKey,r(230882).Diagnostics._getDiagnosticsData(t,i,s,n))}},250052:function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(s,n){function a(e){try{l(i.next(e))}catch(e){n(e)}}function o(e){try{l(i.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,o)}l((i=i.apply(e,t||[])).next())})};function s(e,t){var r;let i=null!=(r=null==e?void 0:e.toLowerCase())?r:"";return t||i.includes("uncaught exception")||i.includes("failed to fetch")||i.includes("networkerror when attempting to fetch resource")}function n(e){return`statsig.network_fallback.${(0,r(483918)._DJB2)(e)}`}function a(e,t){let i=n(e);t&&0!==Object.keys(t).length?r(601638).Storage.setItem(i,JSON.stringify(t)):r(601638).Storage.removeItem(i)}Object.defineProperty(t,"__esModule",{value:!0}),t._isDomainFailure=t.NetworkFallbackResolver=void 0,t.NetworkFallbackResolver=class{constructor(e){var t;this._fallbackInfo=null,this._errorBoundary=null,this._dnsQueryCooldowns={},this._networkOverrideFunc=null==(t=e.networkConfig)?void 0:t.networkOverrideFunc}setErrorBoundary(e){this._errorBoundary=e}tryBumpExpiryTime(e,t){var r;let i=null==(r=this._fallbackInfo)?void 0:r[t.endpoint];i&&(i.expiryTime=Date.now()+6048e5,a(e,Object.assign(Object.assign({},this._fallbackInfo),{[t.endpoint]:i})))}getActiveFallbackUrl(e,t){var i,s;if(null!=t.customUrl&&null!=t.fallbackUrls)return null;let o=this._fallbackInfo;null==o&&(o=null!=(i=function(e){let t=n(e),i=r(601638).Storage.getItem(t);if(!i)return null;try{return JSON.parse(i)}catch(e){return r(668024).Log.error("Failed to parse FallbackInfo"),null}}(e))?i:{},this._fallbackInfo=o);let l=o[t.endpoint];return!l||Date.now()>(null!=(s=l.expiryTime)?s:0)||t.getChecksum()!==l.urlConfigChecksum?(delete o[t.endpoint],this._fallbackInfo=o,a(e,this._fallbackInfo),null):l.url?l.url:null}tryFetchUpdatedFallbackInfo(e,t,r,n){var a,o;return i(this,void 0,void 0,function*(){try{if(!s(r,n))return!1;let i=null==t.customUrl&&null==t.fallbackUrls?yield this._tryFetchFallbackUrlsFromNetwork(t):t.fallbackUrls,o=this._pickNewFallbackUrl(null==(a=this._fallbackInfo)?void 0:a[t.endpoint],i);if(!o)return!1;return this._updateFallbackInfoWithNewUrl(e,t,o),!0}catch(e){return null==(o=this._errorBoundary)||o.logError("tryFetchUpdatedFallbackInfo",e),!1}})}_updateFallbackInfoWithNewUrl(e,t,r){var i,s,n;let o={urlConfigChecksum:t.getChecksum(),url:r,expiryTime:Date.now()+6048e5,previous:[]},l=t.endpoint,u=null==(i=this._fallbackInfo)?void 0:i[l];u&&o.previous.push(...u.previous),o.previous.length>10&&(o.previous=[]);let c=null==(n=null==(s=this._fallbackInfo)?void 0:s[l])?void 0:n.url;null!=c&&o.previous.push(c),this._fallbackInfo=Object.assign(Object.assign({},this._fallbackInfo),{[l]:o}),a(e,this._fallbackInfo)}_tryFetchFallbackUrlsFromNetwork(e){var t;return i(this,void 0,void 0,function*(){let i=this._dnsQueryCooldowns[e.endpoint];if(i&&Date.now()1){let e=r[1];e.endsWith("/")&&(e=e.slice(0,-1)),s.push(`https://${e}${a}`)}}return s})}_pickNewFallbackUrl(e,t){var r;if(null==t)return null;let i=new Set(null!=(r=null==e?void 0:e.previous)?r:[]),s=null==e?void 0:e.url,n=null;for(let e of t){let t=e.endsWith("/")?e.slice(0,-1):e;if(!i.has(e)&&t!==s){n=t;break}}return n}},t._isDomainFailure=s},251148:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UPDATE_DETAIL_ERROR_MESSAGES=t.createUpdateDetails=void 0,t.createUpdateDetails=(e,t,r,i,s,n)=>({duration:r,source:t,success:e,error:i,sourceUrl:s,warnings:n}),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."}},272669:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA256=void 0,t.SHA256=function(e){return new n().update(e)};let r=[-0x80000000,8388608,32768,128],i=[24,16,8,0],s=[0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2];class n{constructor(){this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.h0=0x6a09e667,this.h1=0xbb67ae85,this.h2=0x3c6ef372,this.h3=0xa54ff53a,this.h4=0x510e527f,this.h5=0x9b05688c,this.h6=0x1f83d9ab,this.h7=0x5be0cd19,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.lastByteIndex=-1}update(e){let t,r;if(this.finalized)return this;if("string"!=typeof e)throw Error('Must be of type "string"');let s=0,n=e.length,a=this.blocks;for(;s>2]|=t<>2]|=(192|t>>6)<=57344?a[r>>2]|=(224|t>>12)<>2]|=(240|t>>18)<>2]|=(128|t>>12&63)<>2]|=(128|t>>6&63)<>2]|=(128|63&t)<=64?(this.block=a[16],this.start=r-64,this.hash(),this.hashed=!0):this.start=r}return this.bytes>0xffffffff&&(this.hBytes+=this.bytes/0x100000000|0,this.bytes=this.bytes%0x100000000),this}finalize(){if(this.finalized)return;this.finalized=!0;let e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>2]|=r[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}hash(){let e=this.blocks,t=this.h0,r=this.h1,i=this.h2,n=this.h3,a=this.h4,o=this.h5,l=this.h6,u=this.h7,c,d,h,_,g,f,v,p,m,y;for(c=16;c<64;++c)d=((g=e[c-15])>>>7|g<<25)^(g>>>18|g<<14)^g>>>3,h=((g=e[c-2])>>>17|g<<15)^(g>>>19|g<<13)^g>>>10,e[c]=e[c-16]+d+e[c-7]+h|0;for(c=0,y=r&i;c<64;c+=4)this.first?(v=0x2a01a605,u=(g=e[0]-0xc881298)-0x5ab00ac6|0,n=g+0x8909ae5|0,this.first=!1):(d=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),h=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),_=(v=t&r)^t&i^y,g=u+h+(a&o^~a&l)+s[c]+e[c],f=d+_,u=n+g|0,n=g+f|0),d=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),h=(u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7),_=(p=n&t)^n&r^v,g=l+h+(u&a^~u&o)+s[c+1]+e[c+1],f=d+_,l=i+g|0,d=((i=g+f|0)>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),h=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7),_=(m=i&n)^i&t^p,g=o+h+(l&u^~l&a)+s[c+2]+e[c+2],f=d+_,o=r+g|0,d=((r=g+f|0)>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),h=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),_=(y=r&i)^r&n^m,g=a+h+(o&l^~o&u)+s[c+3]+e[c+3],f=d+_,a=t+g|0,t=g+f|0;this.h0=this.h0+t|0,this.h1=this.h1+r|0,this.h2=this.h2+i|0,this.h3=this.h3+n|0,this.h4=this.h4+a|0,this.h5=this.h5+o|0,this.h6=this.h6+l|0,this.h7=this.h7+u|0}arrayBuffer(){return this._getOutputs().buffer}dataView(){return this._getOutputs().dataView}_getOutputs(){this.finalize();let e=new ArrayBuffer(32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),t.setUint32(28,this.h7),{dataView:t,buffer:e}}}},286913:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},320295:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resultToLayerEval=t.resultToConfigEval=t.resultToGateEval=t.makeEvalResult=void 0,t.makeEvalResult=function(e){return Object.assign(Object.assign({},{unsupported:!1,bool_value:!1,rule_id:"",secondary_exposures:[],json_value:{},explicit_parameters:null,allocated_experiment_name:null,is_experiment_group:!1,group_name:null,undelegated_secondary_exposures:void 0}),e)},t.resultToGateEval=function(e,t){var r;return{name:e.name,id_type:e.idType,rule_id:t.rule_id,value:t.bool_value,secondary_exposures:t.secondary_exposures,version:null==(r=e.version)?void 0:r.toString()}},t.resultToConfigEval=function(e,t){var r,i,s;return{name:e.name,id_type:e.idType,rule_id:t.rule_id,value:t.json_value,secondary_exposures:t.secondary_exposures,group:null!=(r=t.group_name)?r:"",group_name:null!=(i=t.group_name)?i:void 0,is_device_based:!1,is_experiment_active:e.isActive,is_user_in_experiment:t.is_experiment_group,version:null==(s=e.version)?void 0:s.toString(),passed:t.bool_value}},t.resultToLayerEval=function(e,t,r){var i,s,n,a,o;return{name:e.name,rule_id:r.rule_id,value:r.json_value,secondary_exposures:r.secondary_exposures,undelegated_secondary_exposures:r.undelegated_secondary_exposures,allocated_experiment_name:null!=(i=r.allocated_experiment_name)?i:"",explicit_parameters:null!=(s=r.explicit_parameters)?s:[],group:null!=(n=r.group_name)?n:"",group_name:null!=(a=r.group_name)?a:void 0,is_device_based:!1,is_experiment_active:null==t?void 0:t.isActive,is_user_in_experiment:r.is_experiment_group,version:null==(o=e.version)?void 0:o.toString()}}},333031:(e,t,r)=>{e.exports=r(269302)(function(e,t){if(null==e)return[];var i=t.length;return i>1&&r(936800)(e,t[0],t[1])?t=[]:i>2&&r(936800)(t[0],t[1],t[2])&&(t=[t[0]]),r(146155)(e,r(983120)(t,1),[])})},336119:(e,t,r)=>{e.exports=function(e){return e&&e.length?r(17721)(e,r(383488)):0}},339839:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigSession=t.SessionID=void 0;let i={};function s(e,t){return setTimeout(()=>{var t;let i=null==(t=(0,r(843509)._getStatsigGlobal)())?void 0:t.instance(e);i&&i.$emt({name:"session_expired"})},t)}function n(e){return`statsig.session_id.${(0,r(894681)._getStorageKey)(e)}`}t.SessionID={get:e=>t.StatsigSession.get(e).data.sessionID},t.StatsigSession={get:e=>{var t;let a,o,l;return null==i[e]&&(i[e]=(o=(a=n(t=e),(0,r(601638)._getObjectFromStorage)(a)),l=Date.now(),o||(o={sessionID:(0,r(537047).getUUID)(),startTime:l,lastUpdate:l}),{data:o,sdkKey:t})),function(e){let t=Date.now(),i=e.data,a=e.sdkKey;if(function({lastUpdate:e}){return Date.now()-e>18e5}(i)||function({startTime:e}){return Date.now()-e>144e5}(i)){i.sessionID=(0,r(537047).getUUID)(),i.startTime=t;let e=null==__STATSIG__?void 0:__STATSIG__.instance(a);e&&e.$emt({name:"session_expired"})}i.lastUpdate=t,function(e,t){let i=n(t);try{(0,r(601638)._setObjectInStorage)(i,e)}catch(e){r(668024).Log.warn("Failed to save SessionID")}}(i,e.sdkKey),clearTimeout(e.idleTimeoutID),clearTimeout(e.ageTimeoutID);let o=t-i.startTime;return e.idleTimeoutID=s(a,18e5),e.ageTimeoutID=s(a,144e5-o),e}(i[e])},overrideInitialSessionID:(e,t)=>{var r,s;let n;i[t]=(r=e,s=t,{data:{sessionID:r,startTime:n=Date.now(),lastUpdate:n},sdkKey:s})}}},365694:(e,t,r)=>{"use strict";function i(e,t){null==e||e.forEach(e=>{delete t[e]})}Object.defineProperty(t,"__esModule",{value:!0}),t._resolveDeltasResponse=void 0,t._resolveDeltasResponse=function(e,t){var s,n,a;let o=(0,r(636978)._typedJsonParse)(t,"checksum","DeltasEvaluationResponse");if(!o)return{hadBadDeltaChecksum:!0};let l=(i((a=(s=e,n=o,Object.assign(Object.assign(Object.assign({},s),n),{feature_gates:Object.assign(Object.assign({},s.feature_gates),n.feature_gates),layer_configs:Object.assign(Object.assign({},s.layer_configs),n.layer_configs),dynamic_configs:Object.assign(Object.assign({},s.dynamic_configs),n.dynamic_configs)}))).deleted_gates,a.feature_gates),delete a.deleted_gates,i(a.deleted_configs,a.dynamic_configs),delete a.deleted_configs,i(a.deleted_layers,a.layer_configs),delete a.deleted_layers,a),u=(0,r(636978)._DJB2Object)({feature_gates:l.feature_gates,dynamic_configs:l.dynamic_configs,layer_configs:l.layer_configs},2);return u!==o.checksumV2?{hadBadDeltaChecksum:!0,badChecksum:u,badMergedConfigs:l,badFullResponse:o.deltas_full_response}:JSON.stringify(l)}},385638:function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(s,n){function a(e){try{l(i.next(e))}catch(e){n(e)}}function o(e){try{l(i.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,o)}l((i=i.apply(e,t||[])).next())})};function s(e,t,i,s){return{source:e,data:t,receivedAt:Date.now(),stableID:i,fullUserHash:(0,r(81570)._getFullUserHash)(s)}}Object.defineProperty(t,"__esModule",{value:!0}),t._makeDataAdapterResult=t.DataAdapterCore=void 0,t.DataAdapterCore=class{constructor(e,t){this._adapterName=e,this._cacheSuffix=t,this._options=null,this._sdkKey=null,this._lastModifiedStoreKey=`statsig.last_modified_time.${t}`,this._inMemoryCache=new n}attach(e,t,r){this._sdkKey=e,this._options=t}getDataSync(e){let t=e&&(0,r(81570)._normalizeUser)(e,this._options),i=this._getCacheKey(t),s=this._inMemoryCache.get(i,t);if(s)return s;let n=this._loadFromCache(i);return n?(this._inMemoryCache.add(i,n),this._inMemoryCache.get(i,t)):null}setData(e,t){let i=t&&(0,r(81570)._normalizeUser)(t,this._options),n=this._getCacheKey(i);this._inMemoryCache.add(n,s("Bootstrap",e,null,i))}_getDataAsyncImpl(e,t,s){return i(this,void 0,void 0,function*(){r(601638).Storage.isReady()||(yield r(601638).Storage.isReadyResolver());let i=null!=e?e:this.getDataSync(t),n=[this._fetchAndPrepFromNetwork(i,t,s)];return(null==s?void 0:s.timeoutMs)&&n.push(new Promise(e=>setTimeout(e,s.timeoutMs)).then(()=>(r(668024).Log.debug("Fetching latest value timed out"),null))),yield Promise.race(n)})}_prefetchDataImpl(e,t){return i(this,void 0,void 0,function*(){let i=e&&(0,r(81570)._normalizeUser)(e,this._options),s=this._getCacheKey(i),n=yield this._getDataAsyncImpl(null,i,t);n&&this._inMemoryCache.add(s,Object.assign(Object.assign({},n),{source:"Prefetch"}))})}_fetchAndPrepFromNetwork(e,t,n){var a;return i(this,void 0,void 0,function*(){let i=null!=(a=null==e?void 0:e.data)?a:null,o=null!=e&&this._isCachedResultValidFor204(e,t),l=yield this._fetchFromNetwork(i,t,n,o);if(!l)return r(668024).Log.debug("No response returned for latest value"),null;let u=(0,r(953705)._typedJsonParse)(l,"has_updates","Response"),c=this._getSdkKey(),d=r(32626).StableID.get(c),h=null;if((null==u?void 0:u.has_updates)===!0)h=s("Network",l,d,t);else{if(!i||(null==u?void 0:u.has_updates)!==!1)return null;h=s("NetworkNotModified",i,d,t)}let _=this._getCacheKey(t);return this._inMemoryCache.add(_,h),this._writeToCache(_,h),h})}_getSdkKey(){return null!=this._sdkKey?this._sdkKey:(r(668024).Log.error(`${this._adapterName} is not attached to a Client`),"")}_loadFromCache(e){var t;let i=null==(t=r(601638).Storage.getItem)?void 0:t.call(r(601638).Storage,e);if(null==i)return null;let s=(0,r(953705)._typedJsonParse)(i,"source","Cached Result");return s?Object.assign(Object.assign({},s),{source:"Cache"}):null}_writeToCache(e,t){r(601638).Storage.setItem(e,JSON.stringify(t)),this._runLocalStorageCacheEviction(e)}_runLocalStorageCacheEviction(e){var t;let i=null!=(t=(0,r(601638)._getObjectFromStorage)(this._lastModifiedStoreKey))?t:{};i[e]=Date.now();let s=a(i,10);s&&(delete i[s],r(601638).Storage.removeItem(s)),(0,r(601638)._setObjectInStorage)(this._lastModifiedStoreKey,i)}},t._makeDataAdapterResult=s;class n{constructor(){this._data={}}get(e,t){var i;let s=this._data[e],n=null==s?void 0:s.stableID,a=null==(i=null==t?void 0:t.customIDs)?void 0:i.stableID;return a&&n&&a!==n?(r(668024).Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):s}add(e,t){let r=a(this._data,9);r&&delete this._data[r],this._data[e]=t}merge(e){this._data=Object.assign(Object.assign({},this._data),e)}}function a(e,t){let r=Object.keys(e);return r.length<=t?null:r.reduce((t,r)=>{let i=e[t],s=e[r];return"object"==typeof i&&"object"==typeof s?s.receivedAt{e.exports=function(e,t,i){var s=!0,n=!0;if("function"!=typeof e)throw TypeError("Expected a function");return r(223805)(i)&&(s="leading"in i?!!i.leading:s,n="trailing"in i?!!i.trailing:n),r(738221)(e,t,{leading:s,maxWait:t,trailing:n})}},454759:(e,t)=>{"use strict";function r(e){return e.setUTCHours(0,0,0,0),e.getTime()}Object.defineProperty(t,"__esModule",{value:!0}),t.default={compareNumbers(e,t,r){if(null==e||null==t)return!1;let i=Number(e),s=Number(t);if(isNaN(i)||isNaN(s))return!1;switch(r){case"gt":return e>t;case"gte":return e>=t;case"lt":return e{let t=e.indexOf("-");return -1!==t?e.substring(0,t):e};i=n(i);let a=((e,t)=>{let r=e.split(".").map(e=>parseInt(e)),i=t.split(".").map(e=>parseInt(e)),s=0;for(;st)return 1;s++}return 0})(i,s=n(s));switch(r){case"version_gt":return a>0;case"version_gte":return a>=0;case"version_lt":return a<0;case"version_lte":return a<=0;case"version_eq":return 0===a;case"version_neq":return 0!==a;default:return!1}},compareStringInArray(e,t,r){if(!Array.isArray(t))return!1;let i="any_case_sensitive"!==r&&"none_case_sensitive"!==r,s=-1!==t.findIndex(t=>{let s=String(e),n=String(t),a=i?s.toLowerCase():s,o=i?n.toLowerCase():n;switch(r){case"any":case"none":case"any_case_sensitive":case"none_case_sensitive":return a===o;case"str_starts_with_any":return a.startsWith(o);case"str_ends_with_any":return a.endsWith(o);case"str_contains_any":case"str_contains_none":return a.includes(o);default:return!1}});switch(r){case"none":case"none_case_sensitive":case"str_contains_none":return!s;default:return s}},compareStringWithRegEx(e,t){try{let r=String(e);if(r.length<1e3)return new RegExp(String(t)).test(r)}catch(e){}return!1},compareTime(e,t,i){if(null==e||null==t)return!1;try{let s=new Date(String(e));isNaN(s.getTime())&&(s=new Date(Number(e)));let n=new Date(String(t));isNaN(n.getTime())&&(n=new Date(Number(t)));let a=s.getTime(),o=n.getTime();if(isNaN(a)||isNaN(o))return!1;switch(i){case"before":return ao;case"on":return r(s)===r(n);default:return!1}}catch(e){return!1}},arrayHasValue(e,t){let r=new Set(e);for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._getSortedObject=t._DJB2Object=t._DJB2=void 0,t._DJB2=e=>{let t=0;for(let r=0;r>>0)},t._DJB2Object=(e,r)=>(0,t._DJB2)(JSON.stringify((0,t._getSortedObject)(e,r))),t._getSortedObject=(e,i)=>{if(null==e)return null;let s=Object.keys(e).sort(),n={};return s.forEach(s=>{let a=e[s];if(0===i||"object"!==(0,r(690010)._typeOf)(a)){n[s]=a;return}n[s]=(0,t._getSortedObject)(a,null!=i?i-1:i)}),n}},504269:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},512166:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DataAdapterCachePrefix=void 0,t.DataAdapterCachePrefix="statsig.cached"},512335:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Evaluator=void 0;let i=()=>r(320295);function s(e,t){var r,i,s;return"string"==typeof t&&"userid"!==t.toLowerCase()?null!=(i=null==(r=e.customIDs)?void 0:r[t])?i:null==(s=null==e?void 0:e.customIDs)?void 0:s[t.toLowerCase()]:e.userID}function n(e){return(0,r(766944).SHA256)(e).dataView().getBigUint64(0,!1)}function a(e){return null!=e&&"object"==typeof e}t.Evaluator=class{constructor(e){this._store=e}evaluateGate(e,t){let{spec:r,details:s}=this._getSpecAndDetails("gate",e);return r?{evaluation:(0,i().resultToGateEval)(r,this._evaluateSpec(r,t)),details:s}:{evaluation:null,details:s}}evaluateConfig(e,t){let{spec:r,details:s}=this._getSpecAndDetails("config",e);return r?{evaluation:(0,i().resultToConfigEval)(r,this._evaluateSpec(r,t)),details:s}:{evaluation:null,details:s}}evaluateLayer(e,t){var r;let{spec:s,details:n}=this._getSpecAndDetails("layer",e);if(!s)return{evaluation:null,details:n};let a=this._evaluateSpec(s,t),o=null!=(r=null==a?void 0:a.allocated_experiment_name)?r:"",l=this._store.getSpecAndSourceInfo("config",o).spec;return{evaluation:(0,i().resultToLayerEval)(s,l,a),details:n}}getParamStoreConfig(e){var t;let r=this._store.getParamStoreAndSourceInfo(e),i=this._getEvaluationDetails(r);return{config:null!=(t=r.paramStoreConfig)?t:null,details:i}}_getSpecAndDetails(e,t){let r=this._store.getSpecAndSourceInfo(e,t);return{details:this._getEvaluationDetails(r),spec:r.spec}}_getEvaluationDetails(e){let{source:t,lcut:r,receivedAt:i}=e;if("Uninitialized"===t||"NoValues"===t)return{reason:t};let s=("spec"in e?e.spec:e.paramStoreConfig)==null?"Unrecognized":"Recognized";return{reason:`${t}:${s}`,lcut:r,receivedAt:i}}_evaluateSpec(e,t){let r=a(e.defaultValue)?e.defaultValue:void 0;if(!e.enabled)return(0,i().makeEvalResult)({json_value:r,rule_id:"disabled"});let o=[];for(let a of e.rules){let l=this._evaluateRule(a,t);if(l.unsupported)return l;if(o.push(...l.secondary_exposures),!l.bool_value)continue;let u=this._evaluateDelegate(a.configDelegate,t,o);if(u)return u;let c=function(e,t,r){var i,a;return 100===e.passPercentage||0!==e.passPercentage&&Number(n(r.salt+"."+(null!=(i=e.salt)?i:e.id)+"."+(null!=(a=s(t,e.idType))?a:""))%BigInt(1e4))<100*e.passPercentage}(a,t,e);return(0,i().makeEvalResult)({rule_id:l.rule_id,bool_value:c,json_value:c?l.json_value:r,secondary_exposures:o,undelegated_secondary_exposures:o,is_experiment_group:l.is_experiment_group,group_name:l.group_name})}return(0,i().makeEvalResult)({json_value:r,secondary_exposures:o,undelegated_secondary_exposures:o,rule_id:"default"})}_evaluateRule(e,t){let r=[],s=!0;for(let i of e.conditions){let e=this._evaluateCondition(i,t);if(e.unsupported)return e;r.push(...e.secondary_exposures),e.bool_value||(s=!1)}return(0,i().makeEvalResult)({rule_id:e.id,bool_value:s,json_value:a(e.returnValue)?e.returnValue:void 0,secondary_exposures:r,is_experiment_group:!0===e.isExperimentGroup,group_name:e.groupName})}_evaluateCondition(e,t){var a,o,l,u,c,d,h,_,g,f,v,p,m,y,b,S;let x=null,O=!1,w=e.field,E=e.targetValue,k=e.idType,D=e.type;switch(D){case"public":return(0,i().makeEvalResult)({bool_value:!0});case"pass_gate":case"fail_gate":{let e=String(E),r=this._evaluateNestedGate(e,t);return(0,i().makeEvalResult)({bool_value:"fail_gate"===D?!r.bool_value:r.bool_value,secondary_exposures:r.secondary_exposures})}case"multi_pass_gate":case"multi_fail_gate":return this._evaluateMultiNestedGates(E,D,t);case"user_field":case"ip_based":case"ua_based":u=t,x=null==(c=w)||"object"!=typeof u||null==u?null:null!=(m=null!=(v=null!=(g=null!=(h=null!=(d=u[c])?d:u[c.toLowerCase()])?h:null==(_=null==u?void 0:u.custom)?void 0:_[c])?g:null==(f=null==u?void 0:u.custom)?void 0:f[c.toLowerCase()])?v:null==(p=null==u?void 0:u.privateAttributes)?void 0:p[c])?m:null==(y=null==u?void 0:u.privateAttributes)?void 0:y[c.toLowerCase()];break;case"environment_field":b=t,x=null==(S=w)?null:function(e,t){if(null==e)return;let r=t.toLowerCase(),i=Object.keys(e).find(e=>e.toLowerCase()===r);if(void 0!==i)return e[i]}(b.statsigEnvironment,S);break;case"current_time":x=Date.now();break;case"user_bucket":x=Number(n(String(null!=(o=null==(a=e.additionalValues)?void 0:a.salt)?o:"")+"."+(null!=(l=s(t,k))?l:""))%BigInt(1e3));break;case"unit_id":x=s(t,k);break;default:return(0,i().makeEvalResult)({unsupported:!0})}let C=e.operator;switch(C){case"gt":case"gte":case"lt":case"lte":O=r(454759).default.compareNumbers(x,E,C);break;case"version_gt":case"version_gte":case"version_lt":case"version_lte":case"version_eq":case"version_neq":O=r(454759).default.compareVersions(x,E,C);break;case"any":case"none":case"str_starts_with_any":case"str_ends_with_any":case"str_contains_any":case"str_contains_none":case"any_case_sensitive":case"none_case_sensitive":O=r(454759).default.compareStringInArray(x,E,C);break;case"str_matches":O=r(454759).default.compareStringWithRegEx(x,E);break;case"before":case"after":case"on":O=r(454759).default.compareTime(x,E,C);break;case"eq":O=x==E;break;case"neq":O=x!=E;break;case"in_segment_list":case"not_in_segment_list":return(0,i().makeEvalResult)({unsupported:!0});case"array_contains_any":case"array_contains_none":{if(!Array.isArray(E)||!Array.isArray(x)){O=!1;break}let e=r(454759).default.arrayHasValue(x,E);O="array_contains_any"===C?e:!e;break}case"array_contains_all":case"not_array_contains_all":{if(!Array.isArray(E)||!Array.isArray(x)){O=!1;break}let e=r(454759).default.arrayHasAllValues(x,E);O="array_contains_all"===C?e:!e}}return(0,i().makeEvalResult)({bool_value:O})}_evaluateDelegate(e,t,r){if(!e)return null;let{spec:s}=this._store.getSpecAndSourceInfo("config",e);if(!s)return null;let n=this._evaluateSpec(s,t);return(0,i().makeEvalResult)(Object.assign(Object.assign({},n),{allocated_experiment_name:e,explicit_parameters:s.explicitParameters,secondary_exposures:r.concat(n.secondary_exposures),undelegated_secondary_exposures:r}))}_evaluateNestedGate(e,t){let r=[],s=!1,{spec:n}=this._store.getSpecAndSourceInfo("gate",e);if(n){let i=this._evaluateSpec(n,t);if(i.unsupported)return i;s=i.bool_value,r.push(...i.secondary_exposures),r.push({gate:e,gateValue:String(s),ruleID:i.rule_id})}return(0,i().makeEvalResult)({bool_value:s,secondary_exposures:r})}_evaluateMultiNestedGates(e,t,r){if(!Array.isArray(e))return(0,i().makeEvalResult)({unsupported:!0});let s="multi_pass_gate"===t,n=[],a=!1;for(let t of e){if("string"!=typeof t)return(0,i().makeEvalResult)({unsupported:!0});let e=this._evaluateNestedGate(t,r);if(e.unsupported)return e;if(n.push(...e.secondary_exposures),s?!0===e.bool_value:!1===e.bool_value){a=!0;break}}return(0,i().makeEvalResult)({bool_value:a,secondary_exposures:n})}}},537047:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUUID=void 0,t.getUUID=function(){if("u">typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();let e=new Date().getTime(),t="u">typeof performance&&performance.now&&1e3*performance.now()||0,r="89ab"[Math.floor(4*Math.random())];return`xxxxxxxx-xxxx-4xxx-${r}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,r=>{let i=16*Math.random();return e>0?(i=(e+i)%16|0,e=Math.floor(e/16)):(i=(t+i)%16|0,t=Math.floor(t/16)),("x"===r?i:7&i|8).toString(16)})}},539950:function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(s,n){function a(e){try{l(i.next(e))}catch(e){n(e)}}function o(e){try{l(i.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,o)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.LocalOverrideAdapter=void 0;let s="LocalOverride:Recognized";function n(){return{gate:{},dynamicConfig:{},experiment:{},layer:{}}}t.LocalOverrideAdapter=class{constructor(e){this._overrides=n(),this._sdkKey=null!=e?e:null}_getLocalOverridesStorageKey(e){return`statsig.local-overrides.${(0,r(636978)._getStorageKey)(e)}`}loadFromStorage(){return i(this,void 0,void 0,function*(){var e;if(null==this._sdkKey)return;r(636978).Storage.isReady()||(yield r(636978).Storage.isReadyResolver());let t=this._getLocalOverridesStorageKey(this._sdkKey),i=r(636978).Storage.getItem(t),s=i?(0,r(636978)._typedJsonParse)(i,"gate","LocalOverrideAdapter overrides"):null,n=this._hasInMemoryOverrides();s&&(this._overrides=n?(e=this._overrides,{gate:Object.assign({},s.gate,e.gate),dynamicConfig:Object.assign({},s.dynamicConfig,e.dynamicConfig),experiment:Object.assign({},s.experiment,e.experiment),layer:Object.assign({},s.layer,e.layer)}):s),n&&this._saveOverridesToStorage()})}_saveOverridesToStorage(){if(null==this._sdkKey||!r(636978).Storage.isReady())return;let e=this._getLocalOverridesStorageKey(this._sdkKey);r(636978).Storage.setItem(e,JSON.stringify(this._overrides))}overrideGate(e,t){this._overrides.gate[e]=t,this._overrides.gate[(0,r(636978)._DJB2)(e)]=t,this._saveOverridesToStorage()}_warnIfStorageNotReady(){r(636978).Storage.isReady()||r(636978).Log.warn("Storage is not ready. Override removal may not persist.")}removeGateOverride(e){this._warnIfStorageNotReady(),delete this._overrides.gate[e],delete this._overrides.gate[(0,(0,r(636978))._DJB2)(e)],this._saveOverridesToStorage()}getGateOverride(e,t){var i;let n=null!=(i=this._overrides.gate[e.name])?i:this._overrides.gate[(0,r(636978)._DJB2)(e.name)];return null==n?null:Object.assign(Object.assign({},e),{value:n,details:Object.assign(Object.assign({},e.details),{reason:s})})}overrideDynamicConfig(e,t){this._overrides.dynamicConfig[e]=t,this._overrides.dynamicConfig[(0,r(636978)._DJB2)(e)]=t,this._saveOverridesToStorage()}removeDynamicConfigOverride(e){this._warnIfStorageNotReady(),delete this._overrides.dynamicConfig[e],delete this._overrides.dynamicConfig[(0,(0,r(636978))._DJB2)(e)],this._saveOverridesToStorage()}getDynamicConfigOverride(e,t){return this._getConfigOverride(e,this._overrides.dynamicConfig)}overrideExperiment(e,t){this._overrides.experiment[e]=t,this._overrides.experiment[(0,r(636978)._DJB2)(e)]=t,this._saveOverridesToStorage()}removeExperimentOverride(e){this._warnIfStorageNotReady(),delete this._overrides.experiment[e],delete this._overrides.experiment[(0,(0,r(636978))._DJB2)(e)],this._saveOverridesToStorage()}getExperimentOverride(e,t){return this._getConfigOverride(e,this._overrides.experiment)}overrideLayer(e,t){this._overrides.layer[e]=t,this._overrides.layer[(0,r(636978)._DJB2)(e)]=t,this._saveOverridesToStorage()}removeLayerOverride(e){this._warnIfStorageNotReady(),delete this._overrides.layer[e],delete this._overrides.layer[(0,(0,r(636978))._DJB2)(e)],this._saveOverridesToStorage()}getAllOverrides(){return JSON.parse(JSON.stringify(this._overrides))}removeAllOverrides(){this._warnIfStorageNotReady(),this._overrides=n(),this._saveOverridesToStorage()}getLayerOverride(e,t){var i;let n=null!=(i=this._overrides.layer[e.name])?i:this._overrides.layer[(0,r(636978)._DJB2)(e.name)];return null==n?null:Object.assign(Object.assign({},e),{__value:n,get:(0,r(636978)._makeTypedGet)(e.name,n),details:Object.assign(Object.assign({},e.details),{reason:s})})}_getConfigOverride(e,t){var i;let n=null!=(i=t[e.name])?i:t[(0,r(636978)._DJB2)(e.name)];return null==n?null:Object.assign(Object.assign({},e),{value:n,get:(0,r(636978)._makeTypedGet)(e.name,n),details:Object.assign(Object.assign({},e.details),{reason:s})})}_hasInMemoryOverrides(){return Object.keys(this._overrides.gate).length>0||Object.keys(this._overrides.dynamicConfig).length>0||Object.keys(this._overrides.experiment).length>0||Object.keys(this._overrides.layer).length>0}}},540343:function(e,t){var r,i,s;!function(n){"use strict";i=[],void 0===(s="function"==typeof(r=n)?r.apply(t,i):r)||(e.exports=s)}(function(){"use strict";function e(e){return e.charAt(0).toUpperCase()+e.substring(1)}function t(e){return function(){return this[e]}}var r=["isConstructor","isEval","isNative","isToplevel"],i=["columnNumber","lineNumber"],s=["fileName","functionName","source"],n=r.concat(i,s,["args"],["evalOrigin"]);function a(t){if(t)for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},563528:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,s)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),s(r(908128),t)},592701:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._notifyVisibilityChanged=t._subscribeToVisiblityChanged=t._isUnloading=t._isCurrentlyVisible=void 0;let i="foreground",s="background",n=[],a=i,o=!1;t._isCurrentlyVisible=()=>a===i,t._isUnloading=()=>o,t._subscribeToVisiblityChanged=e=>{n.unshift(e)},t._notifyVisibilityChanged=e=>{e!==a&&(a=e,n.forEach(t=>t(e)))},(0,r(600414)._addWindowEventListenerSafe)("focus",()=>{o=!1,(0,t._notifyVisibilityChanged)(i)}),(0,r(600414)._addWindowEventListenerSafe)("blur",()=>(0,t._notifyVisibilityChanged)(s)),(0,r(600414)._addDocumentEventListenerSafe)("visibilitychange",()=>{(0,t._notifyVisibilityChanged)("visible"===document.visibilityState?i:s)}),(0,r(600414)._addWindowEventListenerSafe)((0,r(600414)._getUnloadEvent)(),()=>{o=!0,(0,t._notifyVisibilityChanged)(s)})},600414:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._getUnloadEvent=t._getCurrentPageUrlSafe=t._addDocumentEventListenerSafe=t._addWindowEventListenerSafe=t._isServerEnv=t._getDocumentSafe=t._getWindowSafe=void 0,t._getWindowSafe=()=>"u">typeof window?window:null,t._getDocumentSafe=()=>{var e;let r=(0,t._getWindowSafe)();return null!=(e=null==r?void 0:r.document)?e:null},t._isServerEnv=()=>{if(null!==(0,t._getDocumentSafe)())return!1;let e="u">typeof process&&null!=process.versions&&null!=process.versions.node;return"string"==typeof EdgeRuntime||e},t._addWindowEventListenerSafe=(e,r)=>{let i=(0,t._getWindowSafe)();"function"==typeof(null==i?void 0:i.addEventListener)&&i.addEventListener(e,r)},t._addDocumentEventListenerSafe=(e,r)=>{let i=(0,t._getDocumentSafe)();"function"==typeof(null==i?void 0:i.addEventListener)&&i.addEventListener(e,r)},t._getCurrentPageUrlSafe=()=>{var e;try{return null==(e=(0,t._getWindowSafe)())?void 0:e.location.href.split(/[?#]/)[0]}catch(e){return}},t._getUnloadEvent=()=>{let e=(0,t._getWindowSafe)();return e&&"onpagehide"in e?"pagehide":"beforeunload"}},601638:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._setObjectInStorage=t._getObjectFromStorage=t.Storage=void 0;let i={},s={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:e=>i[e]?i[e]:null,setItem:(e,t)=>{i[e]=t},removeItem:e=>{delete i[e]},getAllKeys:()=>Object.keys(i)},n=null;try{let e=(0,r(600414)._getWindowSafe)();e&&e.localStorage&&"function"==typeof e.localStorage.getItem&&(n={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:t=>e.localStorage.getItem(t),setItem:(t,r)=>e.localStorage.setItem(t,r),removeItem:t=>e.localStorage.removeItem(t),getAllKeys:()=>Object.keys(e.localStorage)})}catch(e){r(668024).Log.warn("Failed to setup localStorageProvider.")}let a=null!=n?n:s,o=a;function l(e){try{return e()}catch(e){if(e instanceof Error&&"SecurityError"===e.name)return t.Storage._setProvider(s),null;if(e instanceof Error&&"QuotaExceededError"===e.name){let r=t.Storage.getAllKeys().filter(e=>e.startsWith("statsig."));e.message=`${e.message}. Statsig Keys: ${r.length}`}throw e}}t.Storage={isReady:()=>o.isReady(),isReadyResolver:()=>o.isReadyResolver(),getProviderName:()=>o.getProviderName(),getItem:e=>l(()=>o.getItem(e)),setItem:(e,t)=>l(()=>o.setItem(e,t)),removeItem:e=>o.removeItem(e),getAllKeys:()=>o.getAllKeys(),_setProvider:e=>{a=e,o=e},_setDisabled:e=>{o=e?s:a}},t._getObjectFromStorage=function(e){let r=t.Storage.getItem(e);return JSON.parse(null!=r?r:"null")},t._setObjectInStorage=function(e,r){t.Storage.setItem(e,JSON.stringify(r))}},636978:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,s)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.Storage=t.Log=t.EventLogger=t.Diagnostics=void 0,r(843509),Object.defineProperty(t,"Diagnostics",{enumerable:!0,get:function(){return r(230882).Diagnostics}}),Object.defineProperty(t,"EventLogger",{enumerable:!0,get:function(){return r(85434).EventLogger}}),Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return r(668024).Log}}),Object.defineProperty(t,"Storage",{enumerable:!0,get:function(){return r(601638).Storage}}),s(r(843509),t),s(r(894681),t),s(r(658683),t),s(r(385638),t),s(r(230882),t),s(r(54387),t),s(r(14358),t),s(r(543194),t),s(r(286913),t),s(r(483918),t),s(r(757061),t),s(r(668024),t),s(r(240843),t),s(r(12610),t),s(r(244703),t),s(r(882509),t),s(r(905025),t),s(r(600414),t),s(r(810686),t),s(r(339839),t),s(r(32626),t),s(r(84351),t),s(r(971180),t),s(r(512166),t),s(r(37253),t),s(r(146512),t),s(r(647754),t),s(r(968474),t),s(r(709851),t),s(r(99652),t),s(r(81570),t),s(r(601638),t),s(r(953705),t),s(r(690010),t),s(r(188873),t),s(r(537047),t),s(r(592701),t),s(r(251148),t),s(r(895747),t),Object.assign((0,r(843509)._getStatsigGlobal)(),{Log:r(668024).Log,SDK_VERSION:r(146512).SDK_VERSION})},647754:(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"}},658683:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},660457:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(s,n){function a(e){try{l(i.next(e))}catch(e){n(e)}}function o(e){try{l(i.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,o)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t._fetchTxtRecords=void 0;let i=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=["i","e","d"];t._fetchTxtRecords=function(e){return r(this,void 0,void 0,function*(){let t=yield e("https://cloudflare-dns.com/dns-query",{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:i});if(!t.ok){let e=Error("Failed to fetch TXT records from DNS");throw e.name="DnsTxtFetchError",e}return function(e){let t=e.findIndex((t,r)=>r<200&&"="===String.fromCharCode(t)&&s.includes(String.fromCharCode(e[r-1])));if(-1===t){let e=Error("Failed to parse TXT records from DNS");throw e.name="DnsTxtParseError",e}let r="";for(let i=t-1;i{"use strict";function r(e){return e.unshift("[Statsig]"),e}Object.defineProperty(t,"__esModule",{value:!0}),t.Log=t.LogLevel=void 0,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 ",...r(e))}static debug(...e){i.level>=t.LogLevel.Debug&&console.debug(" DEBUG ",...r(e))}static warn(...e){i.level>=t.LogLevel.Warn&&console.warn(" WARN ",...r(e))}static error(...e){i.level>=t.LogLevel.Error&&console.error(" ERROR ",...r(e))}}t.Log=i,i.level=t.LogLevel.Warn},688055:(e,t,r)=>{e.exports=function(e){return r(509999)(e,5)}},690010:(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){let r=e=>Array.isArray(e)?"array":typeof e;return r(e)===r(t)}},709851:(e,t,r)=>{"use strict";function i(e,t,r,i){var s;return{name:e,details:t,ruleID:null!=(s=null==r?void 0:r.rule_id)?s:"",__evaluation:r,value:i}}function s(e,t,r){var s;let a=null!=(s=null==r?void 0:r.value)?s:{};return Object.assign(Object.assign({},i(e,t,r,a)),{get:n(e,null==r?void 0:r.value)})}function n(e,t,i){return(s,n)=>{var a;let o=null!=(a=null==t?void 0:t[s])?a:null;return null==o?null!=n?n:null:null==n||(0,r(690010)._isTypeMatch)(o,n)?(null==i||i(s),o):(r(668024).Log.warn(`Parameter type mismatch. '${e}.${s}' was found to be type '${typeof o}' but fallback/return type is '${typeof n}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),null!=n?n:null)}}Object.defineProperty(t,"__esModule",{value:!0}),t._makeTypedGet=t._mergeOverride=t._makeLayer=t._makeExperiment=t._makeDynamicConfig=t._makeFeatureGate=void 0,t._makeFeatureGate=function(e,t,r){var s;return Object.assign(Object.assign({},i(e,t,r,(null==r?void 0:r.value)===!0)),{idType:null!=(s=null==r?void 0:r.id_type)?s:null})},t._makeDynamicConfig=s,t._makeExperiment=function(e,t,r){var i;return Object.assign(Object.assign({},s(e,t,r)),{groupName:null!=(i=null==r?void 0:r.group_name)?i:null})},t._makeLayer=function(e,t,r,s){var a,o;return Object.assign(Object.assign({},i(e,t,r,void 0)),{get:n(e,null==r?void 0:r.value,s),groupName:null!=(a=null==r?void 0:r.group_name)?a:null,__value:null!=(o=null==r?void 0:r.value)?o:{}})},t._mergeOverride=function(e,t,r,i){return Object.assign(Object.assign(Object.assign({},e),t),{get:n(e.name,r,i)})},t._makeTypedGet=n},717344:(e,t,r)=>{"use strict";var i;let s,n;function a(e,...t){if(!(e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function o(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function l(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function u(e,t){return e<<32-t|e>>>t}function c(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}(e)),a(e),e}r.d(t,{sc:()=>p});class d{clone(){return this._cloneInto()}}class h extends d{constructor(e,t,r,i){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=l(this.buffer)}update(e){o(this);let{view:t,buffer:r,blockLen:i}=this,s=(e=c(e)).length;for(let n=0;ns-u&&(this.process(i,0),u=0);for(let e=u;e>s&n),o=Number(r&n),l=4*!!i,u=4*!i;e.setUint32(t+l,a,i),e.setUint32(t+u,o,i)}(i,s-8,BigInt(8*this.length),n),this.process(i,0);let c=l(e),d=this.outputLen;if(d%4)throw Error("_sha2: outputLen should be aligned to 32bit");let h=d/4,_=this.get();if(h>_.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e>>3,s=u(r,17)^u(r,19)^r>>>10;f[e]=s+f[e-7]+i+f[e-16]|0}let{A:r,B:i,C:s,D:n,E:a,F:o,G:l,H:c}=this;for(let e=0;e<64;e++){var d,h,g,v;let t=c+(u(a,6)^u(a,11)^u(a,25))+((d=a)&o^~d&l)+_[e]+f[e]|0,p=(u(r,2)^u(r,13)^u(r,22))+((h=r)&(g=i)^h&(v=s)^g&v)|0;c=l,l=o,o=a,a=n+t|0,n=s,s=i,i=r,r=t+p|0}r=r+this.A|0,i=i+this.B|0,s=s+this.C|0,n=n+this.D|0,a=a+this.E|0,o=o+this.F|0,l=l+this.G|0,c=c+this.H|0,this.set(r,i,s,n,a,o,l,c)}roundClean(){f.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}let p=(i=()=>new v,(s=e=>i().update(c(e)).digest()).outputLen=(n=i()).outputLen,s.blockLen=n.blockLen,s.create=()=>i(),s)},719651:function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(s,n){function a(e){try{l(i.next(e))}catch(e){n(e)}}function o(e){try{l(i.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,o)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.UserPersistentOverrideAdapter=void 0,t.UserPersistentOverrideAdapter=class{constructor(e){this.storage=e}loadUserPersistedValues(e,t){var r;let i=this._getStorageKey(e,t);return null!=(r=this.storage.load(i))?r:{}}loadUserPersistedValuesAsync(e,t){var r;return i(this,void 0,void 0,function*(){let i=this._getStorageKey(e,t);return null!=(r=yield this.storage.loadAsync(i))?r:{}})}getExperimentOverride(e,t,r){let i=e.__evaluation;if(null==i)return null;let s=null==r?void 0:r.userPersistedValues;if(!0!==i.is_experiment_active||null==s||"object"!=typeof s)return this._handleDelete(t,e.name,i.id_type),null;let n=s[e.name];return null!=n?this._makeStickyExperiment(i,n):(i.is_user_in_experiment&&this._handleSave(t,e,i),null)}_makeStickyExperiment(e,t){let{id_type:i,name:s}=e,{json_value:n,secondary_exposures:a,group_name:o,rule_id:l,time:u}=t;return(0,r(636978)._makeExperiment)(s,{reason:"Persisted",lcut:u},{value:n,secondary_exposures:a,group_name:null!=o?o:void 0,group:null!=o?o:"",rule_id:l,id_type:i,name:s,is_device_based:e.is_device_based})}_handleDelete(e,t,r){let i=this._getStorageKey(e,r),s=this.storage.load(i);null!=s&&(delete s[t],this.storage.delete(i,t))}_handleSave(e,t,r){var i;let s=this._getStorageKey(e,r.id_type),n={value:!0,rule_id:r.rule_id,json_value:r.value,secondary_exposures:r.secondary_exposures,group_name:r.group,time:null!=(i=t.details.lcut)?i:0};this.storage.save(s,t.name,JSON.stringify(n))}_getStorageKey(e,t){var r,i,s,n,a;return`${String((r=e,"string"==typeof(i=t)&&"userid"!==i.toLowerCase()?null!=(n=null==(s=r.customIDs)?void 0:s[i])?n:null==(a=null==r?void 0:r.customIDs)?void 0:a[i.toLowerCase()]:r.userID))}:${t}`}}},729094:(e,t,r)=>{"use strict";function i(e){return(0,r(636978)._typedJsonParse)(e,"has_updates","DownloadConfigSpecsResponse")}Object.defineProperty(t,"__esModule",{value:!0}),t.SpecStore=void 0,t.SpecStore=class{constructor(){this._rawValues=null,this._values=null,this._source="Uninitialized",this._lcut=0,this._receivedAt=0,this._defaultEnvironment=null}getValues(){return this._rawValues?i(this._rawValues):null}getSource(){return this._source}getDefaultEnvironment(){return this._defaultEnvironment}setValuesFromDataAdapter(e){var t;if(!e)return;let r=i(e.data);(null==r?void 0:r.has_updates)===!0&&(this._lcut=r.time,this._receivedAt=e.receivedAt,this._source=e.source,this._values=r,this._rawValues=e.data,this._defaultEnvironment=null!=(t=r.default_environment)?t:null)}reset(){this._values=null,this._rawValues=null,this._source="Loading"}finalize(){this._values||(this._source="NoValues")}getSpecAndSourceInfo(e,t){var r;let i=this._getSpecs(e);return{spec:null!=(r=null==i?void 0:i.find(e=>e.name===t))?r:null,source:this._source,lcut:this._lcut,receivedAt:this._receivedAt}}getParamStoreAndSourceInfo(e){var t,r,i;let s=null==(t=this._values)?void 0:t.param_stores;return{paramStoreConfig:null!=(i=null==(r=null==s?void 0:s[e])?void 0:r.parameters)?i:null,source:this._source,lcut:this._lcut,receivedAt:this._receivedAt}}_getSpecs(e){var t,r,i;switch(e){case"gate":return null==(t=this._values)?void 0:t.feature_gates;case"config":return null==(r=this._values)?void 0:r.dynamic_configs;case"layer":return null==(i=this._values)?void 0:i.layer_configs}}}},738221:(e,t,r)=>{var i=Math.max,s=Math.min;e.exports=function(e,t,n){var a,o,l,u,c,d,h=0,_=!1,g=!1,f=!0;if("function"!=typeof e)throw TypeError("Expected a function");function v(t){var r=a,i=o;return a=o=void 0,h=t,u=e.apply(i,r)}function p(e){var r=e-d,i=e-h;return void 0===d||r>=t||r<0||g&&i>=l}function m(){var e,i,n,a=r(10124)();if(p(a))return y(a);c=setTimeout(m,(e=a-d,i=a-h,n=t-e,g?s(n,l-i):n))}function y(e){return(c=void 0,f&&a)?v(e):(a=o=void 0,u)}function b(){var e,i=r(10124)(),s=p(i);if(a=arguments,o=this,d=i,s){if(void 0===c)return h=e=d,c=setTimeout(m,t),_?v(e):u;if(g)return clearTimeout(c),c=setTimeout(m,t),v(d)}return void 0===c&&(c=setTimeout(m,t)),u}return t=r(399374)(t)||0,r(223805)(n)&&(_=!!n.leading,l=(g="maxWait"in n)?i(r(399374)(n.maxWait)||0,t):l,f="trailing"in n?!!n.trailing:f),b.cancel=function(){void 0!==c&&clearTimeout(c),h=0,a=d=o=c=void 0},b.flush=function(){return void 0===c?u:y(r(10124)())},b}},757061:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},763375:(e,t,r)=>{e.exports=function(e){return e&&e.length?r(855765)(e):[]}},766944:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA256=void 0,Object.defineProperty(t,"SHA256",{enumerable:!0,get:function(){return r(272669).SHA256}})},782944:function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(s,n){function a(e){try{l(i.next(e))}catch(e){n(e)}}function o(e){try{l(i.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,o)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});let s=()=>r(636978);class n extends s().NetworkCore{constructor(e,t){super(e,t);const r=null==e?void 0:e.networkConfig;this._option=e,this._initializeUrlConfig=new(s()).UrlConfiguration(s().Endpoint._initialize,null==r?void 0:r.initializeUrl,null==r?void 0:r.api,null==r?void 0:r.initializeFallbackUrls)}fetchEvaluations(e,t,r,n,a){var o,l,u,c,d,h;return i(this,void 0,void 0,function*(){let i=t?(0,s()._typedJsonParse)(t,"has_updates","InitializeResponse"):null,_={user:n,hash:null!=(u=null==(l=null==(o=this._option)?void 0:o.networkConfig)?void 0:l.initializeHashAlgorithm)?u:"djb2",deltasResponseRequested:!1,full_checksum:null};if(null==i?void 0:i.has_updates){let e=(null==i?void 0:i.hash_used)!==(null!=(h=null==(d=null==(c=this._option)?void 0:c.networkConfig)?void 0:d.initializeHashAlgorithm)?h:"djb2");_=Object.assign(Object.assign({},_),{sinceTime:a&&!e?i.time:0,previousDerivedFields:"derived_fields"in i&&a?i.derived_fields:{},deltasResponseRequested:!0,full_checksum:i.full_checksum,partialUserMatchSinceTime:e?0:i.time})}return this._fetchEvaluations(e,i,_,r)})}_fetchEvaluations(e,t,s,n){var a,o;return i(this,void 0,void 0,function*(){let i=yield this.post({sdkKey:e,urlConfig:this._initializeUrlConfig,data:s,retries:2,isStatsigEncodable:!0,priority:n});if((null==i?void 0:i.code)===204)return'{"has_updates": false}';if((null==i?void 0:i.code)!==200)return null!=(a=null==i?void 0:i.body)?a:null;if((null==t?void 0:t.has_updates)!==!0||(null==(o=i.body)?void 0:o.includes('"is_delta":true'))!==!0||!0!==s.deltasResponseRequested)return i.body;let l=(0,r(365694)._resolveDeltasResponse)(t,i.body);return"string"==typeof l?l:this._fetchEvaluations(e,t,Object.assign(Object.assign(Object.assign({},s),l),{deltasResponseRequested:!1}),n)})}}t.default=n},788238:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,s)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),s(r(539950),t)},810686:(e,t)=>{"use strict";let r;Object.defineProperty(t,"__esModule",{value:!0}),t.SDKType=void 0;let i={};t.SDKType={_get:e=>{var t;return(null!=(t=i[e])?t:"js-mono")+(null!=r?r:"")},_setClientType(e,t){i[e]=t},_setBindingType(e){r&&"-react"!==r||(r="-"+e)}}},814628:(e,t,r)=>{"use strict";var i=r(746518),s=r(836043);i({target:"Promise",stat:!0},{withResolvers:function(){var e=s.f(this);return{promise:e.promise,resolve:e.resolve,reject:e.reject}}})},821013:(e,t,r)=>{var i=()=>r(225160),s=Math.ceil,n=Math.max;e.exports=function(e,t,a){t=(a?r(936800)(e,t,a):void 0===t)?1:n(r(761489)(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var l=0,u=0,c=Array(s(o/t));l{"use strict";var i=r(479306),s=TypeError,n=function(e){var t,r;this.promise=new e(function(e,i){if(void 0!==t||void 0!==r)throw new s("Bad Promise constructor");t=e,r=i}),this.resolve=i(t),this.reject=i(r)};e.exports.f=function(e){return new n(e)}},842451:function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(s,n){function a(e){try{l(i.next(e))}catch(e){n(e)}}function o(e){try{l(i.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,o)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigEvaluationsDataAdapter=void 0;let s=()=>r(636978);class n extends s().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(782944).default?this._network=i:this._network=new(r(782944)).default(null!=t?t:{})}getDataAsync(e,t,r){return this._getDataAsyncImpl(e,(0,s()._normalizeUser)(t,this._options),r)}prefetchData(e,t){return this._prefetchDataImpl(e,t)}setData(e){let t=(0,s()._typedJsonParse)(e,"has_updates","data");t&&"user"in t?super.setData(e,t.user):s().Log.error("StatsigUser not found. You may be using an older server SDK version. Please upgrade your SDK or use setDataLegacy.")}setDataLegacy(e,t){super.setData(e,t)}_fetchFromNetwork(e,t,r,s){var n;return i(this,void 0,void 0,function*(){let i=yield null==(n=this._network)?void 0:n.fetchEvaluations(this._getSdkKey(),e,null==r?void 0:r.priority,t,s);return null!=i?i:null})}_getCacheKey(e){var t;let r=(0,s()._getStorageKey)(this._getSdkKey(),e,null==(t=this._options)?void 0:t.customUserCacheKeyFunc);return`${s().DataAdapterCachePrefix}.${this._cacheSuffix}.${r}`}_isCachedResultValidFor204(e,t){return null!=e.fullUserHash&&e.fullUserHash===(0,s()._getFullUserHash)(t)}}t.StatsigEvaluationsDataAdapter=n},843509:(e,t,r)=>{"use strict";var i,s,n;Object.defineProperty(t,"__esModule",{value:!0}),t._getInstance=t._getStatsigGlobalFlag=t._getStatsigGlobal=void 0,t._getStatsigGlobal=()=>{try{return"u">typeof __STATSIG__?__STATSIG__:c}catch(e){return c}},t._getStatsigGlobalFlag=e=>(0,t._getStatsigGlobal)()[e],t._getInstance=e=>{let i=(0,t._getStatsigGlobal)();return e?i.instances&&i.instances[e]:(i.instances&&Object.keys(i.instances).length>1&&r(668024).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."),i.firstInstance)};let a="__STATSIG__",o="u">typeof window?window:{},l=void 0!==r.g?r.g:{},u="u">typeof globalThis?globalThis:{},c=null!=(n=null!=(s=null!=(i=o[a])?i:l[a])?s:u[a])?n:{instance:t._getInstance};o[a]=c,l[a]=c,u[a]=c},882509:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},894681:(e,t,r)=>{"use strict";function i(e,t,i){var s;if(i)return i(e,t);let n=t&&t.customIDs?t.customIDs:{},a=[`uid:${null!=(s=null==t?void 0:t.userID)?s:""}`,`cids:${Object.keys(n).sort((e,t)=>e.localeCompare(t)).map(e=>`${e}-${n[e]}`).join(",")}`,`k:${e}`];return(0,r(483918)._DJB2)(a.join("|"))}Object.defineProperty(t,"__esModule",{value:!0}),t._getStorageKey=t._getUserStorageKey=void 0,t._getUserStorageKey=i,t._getStorageKey=function(e,t,s){return t?i(e,t,s):(0,r(483918)._DJB2)(`k:${e}`)}},895747:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SDKFlags=void 0;let r={};t.SDKFlags={setFlags:(e,t)=>{r[e]=t},get:(e,t)=>{var i,s;return null!=(s=null==(i=r[e])?void 0:i[t])&&s}}},905025:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},907686:function(e,t,r){"use strict";var i=this&&this.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(s,n){function a(e){try{l(i.next(e))}catch(e){n(e)}}function o(e){try{l(i.throw(e))}catch(e){n(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,o)}l((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});let s=()=>r(636978);class n extends s().StatsigClientBase{static instance(e){let t=(0,s()._getStatsigGlobal)().instance(e);return t instanceof n?t:(s().Log.warn((0,s()._isServerEnv)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new n(null!=e?e:"",{}))}constructor(e,t,i=null){var n,a;s().SDKType._setClientType(e,"javascript-client");const o=new(r(782944)).default(i,e=>{this.$emt(e)});for(const l of(super(e,null!=(n=null==i?void 0:i.dataAdapter)?n:new(r(842451)).StatsigEvaluationsDataAdapter,o,i),this.getFeatureGate=this._memoize(s().MemoPrefix._gate,this._getFeatureGateImpl.bind(this)),this.getDynamicConfig=this._memoize(s().MemoPrefix._dynamicConfig,this._getDynamicConfigImpl.bind(this)),this.getExperiment=this._memoize(s().MemoPrefix._experiment,this._getExperimentImpl.bind(this)),this.getLayer=this._memoize(s().MemoPrefix._layer,this._getLayerImpl.bind(this)),this.getParameterStore=this._memoize(s().MemoPrefix._paramStore,this._getParameterStoreImpl.bind(this)),this._store=new(r(87677)).default(e),this._network=o,this._user=this._configureUser(t,i),null!=(a=null==i?void 0:i.plugins)?a:[]))l.bind(this)}initializeSync(e){var t;return"Uninitialized"!==this.loadingStatus?(0,s().createUpdateDetails)(!0,this._store.getSource(),-1,null,null,["MultipleInitializations",...null!=(t=this._store.getWarnings())?t:[]]):(this._logger.start(),this.updateUserSync(this._user,e))}initializeAsync(e){return i(this,void 0,void 0,function*(){return this._initializePromise||(this._initializePromise=this._initializeAsyncImpl(e)),this._initializePromise})}updateUserSync(e,t){var r;let i=performance.now(),n=[...null!=(r=this._store.getWarnings())?r:[]];this._resetForUser(e);let a=this.dataAdapter.getDataSync(this._user);null==a&&n.push("NoCachedValues"),this._store.setValues(a,this._user),this._finalizeUpdate(a);let o=null==t?void 0:t.disableBackgroundCacheRefresh;return!0===o||null==o&&(null==a?void 0:a.source)==="Bootstrap"||this._runPostUpdate(null!=a?a:null,this._user),(0,s().createUpdateDetails)(!0,this._store.getSource(),performance.now()-i,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),n)}updateUserAsync(e,t){return i(this,void 0,void 0,function*(){this._resetForUser(e);let r=this._user;s().Diagnostics._markInitOverallStart(this._sdkKey);let i=this.dataAdapter.getDataSync(r);if(this._store.setValues(i,this._user),this._setStatus("Loading",i),i=yield this.dataAdapter.getDataAsync(i,r,t),r!==this._user)return(0,s().createUpdateDetails)(!1,this._store.getSource(),-1,Error("User changed during update"),this._network.getLastUsedInitUrlAndReset());let n=!1;null!=i&&(s().Diagnostics._markInitProcessStart(this._sdkKey),n=this._store.setValues(i,this._user),s().Diagnostics._markInitProcessEnd(this._sdkKey,{success:n})),this._finalizeUpdate(i),n||(this._errorBoundary.attachErrorIfNoneExists(s().UPDATE_DETAIL_ERROR_MESSAGES.NO_NETWORK_DATA),this.$emt({name:"initialization_failure"})),s().Diagnostics._markInitOverallEnd(this._sdkKey,n,this._store.getCurrentSourceDetails());let a=s().Diagnostics._enqueueDiagnosticsEvent(this._user,this._logger,this._sdkKey,this._options);return(0,s().createUpdateDetails)(n,this._store.getSource(),a,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),this._store.getWarnings())})}getContext(){return{sdkKey:this._sdkKey,options:this._options,values:this._store.getValues(),user:JSON.parse(JSON.stringify(this._user)),errorBoundary:this._errorBoundary,session:s().StatsigSession.get(this._sdkKey),stableID:s().StableID.get(this._sdkKey)}}checkGate(e,t){return this.getFeatureGate(e,t).value}logEvent(e,t,r){let i="string"==typeof e?{eventName:e,value:t,metadata:r}:e;this.$emt({name:"log_event_called",event:i}),this._logger.enqueue(Object.assign(Object.assign({},i),{user:this._user,time:Date.now()}))}_primeReadyRipcord(){this.$on("error",()=>{"Loading"===this.loadingStatus&&this._finalizeUpdate(null)})}_initializeAsyncImpl(e){return i(this,void 0,void 0,function*(){return s().Storage.isReady()||(yield s().Storage.isReadyResolver()),this._logger.start(),this.updateUserAsync(this._user,e)})}_finalizeUpdate(e){this._store.finalize(),this._setStatus("Ready",e)}_runPostUpdate(e,t){this.dataAdapter.getDataAsync(e,t,{priority:"low"}).catch(e=>{s().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 r;let i=(0,s()._normalizeUser)(e,t),n=null==(r=i.customIDs)?void 0:r.stableID;return n&&s().StableID.setOverride(n,this._sdkKey),i}_getFeatureGateImpl(e,t){var r,i;let{result:n,details:a}=this._store.getGate(e),o=(0,s()._makeFeatureGate)(e,a,n),l=null==(i=null==(r=this.overrideAdapter)?void 0:r.getGateOverride)?void 0:i.call(r,o,this._user,t),u=null!=l?l:o;return this._enqueueExposure(e,(0,s()._createGateExposure)(this._user,u,this._store.getExposureMapping()),t),this.$emt({name:"gate_evaluation",gate:u}),u}_getDynamicConfigImpl(e,t){var r,i;let{result:n,details:a}=this._store.getConfig(e),o=(0,s()._makeDynamicConfig)(e,a,n),l=null==(i=null==(r=this.overrideAdapter)?void 0:r.getDynamicConfigOverride)?void 0:i.call(r,o,this._user,t),u=null!=l?l:o;return this._enqueueExposure(e,(0,s()._createConfigExposure)(this._user,u,this._store.getExposureMapping()),t),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:u}),u}_getExperimentImpl(e,t){var r,i,n,a;let{result:o,details:l}=this._store.getConfig(e),u=(0,s()._makeExperiment)(e,l,o);null!=u.__evaluation&&(u.__evaluation.secondary_exposures=(0,s()._mapExposures)(null!=(i=null==(r=u.__evaluation)?void 0:r.secondary_exposures)?i:[],this._store.getExposureMapping()));let c=null==(a=null==(n=this.overrideAdapter)?void 0:n.getExperimentOverride)?void 0:a.call(n,u,this._user,t),d=null!=c?c:u;return this._enqueueExposure(e,(0,s()._createConfigExposure)(this._user,d,this._store.getExposureMapping()),t),this.$emt({name:"experiment_evaluation",experiment:d}),d}_getLayerImpl(e,t){var r,i,n;let{result:a,details:o}=this._store.getLayer(e),l=(0,s()._makeLayer)(e,o,a),u=null==(i=null==(r=this.overrideAdapter)?void 0:r.getLayerOverride)?void 0:i.call(r,l,this._user,t);(null==t?void 0:t.disableExposureLog)&&this._logger.incrementNonExposureCount(e);let c=(0,s()._mergeOverride)(l,u,null!=(n=null==u?void 0:u.__value)?n:l.__value,r=>{null!=t&&t.disableExposureLog||this._enqueueExposure(e,(0,s()._createLayerParameterExposure)(this._user,c,r,this._store.getExposureMapping()),t)});return this.$emt({name:"layer_evaluation",layer:c}),c}_getParameterStoreImpl(e,t){var i,s;let{result:n,details:a}=this._store.getParamStore(e);this._logger.incrementNonExposureCount(e);let o={name:e,details:a,__configuration:n,get:(0,r(79999)._makeParamStoreGetter)(this,n,t)},l=null==(s=null==(i=this.overrideAdapter)?void 0:i.getParamStoreOverride)?void 0:s.call(i,o,t);return null!=l&&(o.__configuration=l.config,o.details=l.details,o.get=(0,r(79999)._makeParamStoreGetter)(this,l.config,t)),o}}t.default=n},908128:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OnDeviceEvalAdapter=void 0,t.OnDeviceEvalAdapter=class{constructor(e){this._store=new(r(982026)).SpecStore,this._evaluator=new(r(982026)).Evaluator(this._store),null!=e&&this.setData(e)}setData(e){let t=(0,r(636978)._makeDataAdapterResult)("Bootstrap",e,null);this._store.setValuesFromDataAdapter(t)}getGateOverride(e,t,i){return this._evaluate(e,t,this._evaluator.evaluateGate.bind(this._evaluator),r(636978)._makeFeatureGate)}getDynamicConfigOverride(e,t,i){return this._evaluate(e,t,this._evaluator.evaluateConfig.bind(this._evaluator),r(636978)._makeDynamicConfig)}getExperimentOverride(e,t,i){return this._evaluate(e,t,this._evaluator.evaluateConfig.bind(this._evaluator),r(636978)._makeExperiment)}getLayerOverride(e,t,i){return this._evaluate(e,t,this._evaluator.evaluateLayer.bind(this._evaluator),r(636978)._makeLayer)}getParamStoreOverride(e,t){if(!this._shouldTryOnDeviceEval(e.details))return null;let{config:r,details:i}=this._evaluator.getParamStoreConfig(e.name);return i.reason="[OnDevice]"+i.reason,{config:null!=r?r:{},details:i}}_evaluate(e,t,r,i){if(!this._shouldTryOnDeviceEval(e.details))return null;let s=e.name,{evaluation:n,details:a}=r(s,t);return a.reason="[OnDevice]"+a.reason,i(s,a,n)}_shouldTryOnDeviceEval(e){let t=this._store.getValues();return null!=t&&(!e.lcut||t.time>e.lcut)}}},933426:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,s)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),s(r(719651),t),s(r(504269),t)},950014:(e,t,r)=>{e.exports=function(e,t){return e&&e.length?r(855765)(e,r(315389)(t,2)):[]}},953705:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t._typedJsonParse=void 0,t._typedJsonParse=function(e,t,i){try{let r=JSON.parse(e);if(r&&"object"==typeof r&&t in r)return r}catch(e){}return r(668024).Log.error(`Failed to parse ${i}`),null}},968474:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},971180:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorTag=void 0,t.ErrorTag={NetworkError:"NetworkError"}},982026:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,s)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),s(r(512335),t),s(r(729094),t)}}]);