statsig-js-lite
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -1,1 +0,1 @@ | ||
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.statsig=n():t.statsig=n()}(this,()=>(()=>{"use strict";var e={825:(t,n)=>{function i(t,n,i,e,r,u,o){void 0===r&&(r=[]),void 0===u&&(u=""),void 0===o&&(o=null),this.t=null,this.value=JSON.parse(JSON.stringify(null!=n?n:{})),this.i=t,this.u=null!=i?i:"",this.o=r,this.h=u,this.l=e,this.t=o}Object.defineProperty(n,"v",{value:!0}),i.prototype.get=function(t,n,i){var e=this.getValue(t,n);if(null!=e){var r=Array.isArray(n)?"array":typeof n,u=Array.isArray(e)?"array":typeof e;if(i)return i(e)?e:(null!=(i=this.t)&&i.call(this,this,t,r,u),n);if(null==n||r==u)return e;null!=(i=this.t)&&i.call(this,this,t,r,u)}return n},i.prototype.getValue=function(t,n){return null==t?this.value:(null==n&&(n=null),null==this.value[t]?n:this.value[t])},n.default=i},742:function(t,f,n){var i=this&&this.__awaiter||function(t,o,s,c){return new(s=s||Promise)(function(i,n){function e(t){try{u(c.next(t))}catch(t){n(t)}}function r(t){try{u(c.throw(t))}catch(t){n(t)}}function u(t){var n;t.done?i(t.value):((n=t.value)instanceof s?n:new s(function(t){t(n)})).then(e,r)}u((c=c.apply(t,o||[])).next())})},h=this&&this.__generator||function(e,r){var u,o,s,c={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},f={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(f[Symbol.iterator]=function(){return this}),f;function t(i){return function(t){var n=[i,t];if(u)throw new TypeError("Generator is already executing.");for(;c=f&&n[f=0]?0:c;)try{if(u=1,o&&(s=2&n[0]?o.return:n[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,n[1])).done)return s;switch(o=0,(n=s?[2&n[0],s.value]:n)[0]){case 0:case 1:s=n;break;case 4:return c.label++,{value:n[1],done:!1};case 5:c.label++,o=n[1],n=[0];continue;case 7:n=c.ops.pop(),c.trys.pop();continue;default:if(!(s=0<(s=c.trys).length&&s[s.length-1])&&(6===n[0]||2===n[0])){c=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3]))c.label=n[1];else if(6===n[0]&&c.label<s[1])c.label=s[1],s=n;else{if(!(s&&c.label<s[2])){s[2]&&c.ops.pop(),c.trys.pop();continue}c.label=s[2],c.ops.push(n)}}n=r.call(e,c)}catch(t){n=[6,t],o=0}finally{u=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}}},r=(Object.defineProperty(f,"v",{value:!0}),f.ExceptionEndpoint=void 0,n(187)),n=(f.ExceptionEndpoint="https://statsigapi.net/v1/sdk_exception",e.prototype.p=function(t){this.g=t},e.prototype.m=function(t,n){this.S(t,n,function(){})},e.prototype.S=function(n,t,i,e){var r=this;try{var u=t();return u instanceof Promise?u.catch(function(t){return r._(n,t,i,e)}):u}catch(t){return this._(n,t,i,e)}},e.prototype.O=function(o,s,c){var t=this;if(!this.T.disableAllLogging)try{i(t,void 0,void 0,function(){var n,i,e,r,u;return h(this,function(t){switch(t.label){case 0:return"function"!=typeof c?[3,2]:[4,c()];case 1:return i=t.sent(),[3,3];case 2:i=null,t.label=3;case 3:return(n=i,u=null!=s?s:Error("[Statsig] Error was empty"),e=u instanceof Error,r=e?u.name:"No Name",this.j.has(r))?[2]:(this.j.add(r),e=e?u.stack:this.D(u),u=null!=(u=this.g)?u:{},r=JSON.stringify({tag:o,exception:r,info:e,statsigMetadata:u,extra:null!=n?n:{}}),[2,fetch(f.ExceptionEndpoint,{method:"POST",headers:{"STATSIG-API-KEY":this.I,"STATSIG-SDK-TYPE":String(u.sdkType),"STATSIG-SDK-VERSION":String(u.sdkVersion),"Content-Type":"application/json","Content-Length":"".concat(r.length)},body:r})])}})}).then(function(){}).catch(function(){})}catch(t){}},e.prototype._=function(t,n,i,e){if(n instanceof r.StatsigUninitializedError||n instanceof r.StatsigInvalidArgumentError)throw n;return console.error("[Statsig] An unexpected exception occurred.",n),this.O(t,n,e),i()},e.prototype.D=function(t){try{return JSON.stringify(t)}catch(t){return"[Statsig] Failed to get string for error."}},e);function e(t,n){this.j=new Set,this.I=t,this.T=n}f.default=n},187:function(t,n){var e,i,r,u=this&&this.__extends||(e=function(t,n){return(e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,n){t.__proto__=n}:function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}))(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),o=(Object.defineProperty(n,"v",{value:!0}),n.StatsigSDKKeyMismatchError=n.StatsigInvalidArgumentError=n.StatsigUninitializedError=n.StatsigErrorMessage=void 0,(o=i=n.StatsigErrorMessage||(n.StatsigErrorMessage={})).REQUIRE_ASYNC_INITIALIZE="Call initialize() first.",o.REQUIRE_SYNC_INITIALIZE="Call and wait for initialize() to finish first.",o.REQUIRE_INITIALIZE_FOR_LOG_EVENT="Must initialize() before logging events.",r=Error,u(s,r),s);function s(t){t=r.call(this,null!=t?t:i.REQUIRE_SYNC_INITIALIZE)||this;return Object.setPrototypeOf(t,s.prototype),t}n.StatsigUninitializedError=o;c=Error,u(f,c);var c,o=f;function f(t){t=c.call(this,t)||this;return Object.setPrototypeOf(t,f.prototype),t}n.StatsigInvalidArgumentError=o;h=Error,u(a,h);var h,o=a;function a(t){t=h.call(this,t)||this;return Object.setPrototypeOf(t,a.prototype),t}n.StatsigSDKKeyMismatchError=o},857:(t,n)=>{function f(t,n,i,e,r,u,o,s,c){void 0===u&&(u=[]),void 0===o&&(o=[]),void 0===s&&(s=""),void 0===c&&(c=[]),this.M=r=void 0===r?null:r,this.i=t,this.N=JSON.parse(JSON.stringify(null!=n?n:{})),this.u=null!=i?i:"",this.l=e,this.o=u,this.P=o,this.h=s,this.A=c}Object.defineProperty(n,"v",{value:!0}),f.G=function(t,n,i,e,r,u,o,s,c){return new f(t,n,i,e,r=void 0===r?null:r,u=void 0===u?[]:u,o=void 0===o?[]:o,s=void 0===s?"":s,c=void 0===c?[]:c)},f.prototype.get=function(t,n,i){var e,r=this,u=this.N[t];return null==u?n:(e=function(){return r.k(t),u},i?i(u)?e():n:null==n||typeof u==typeof n&&Array.isArray(n)===Array.isArray(u)?e():n)},f.prototype.getValue=function(t,n){null==n&&(n=null);var i=this.N[t];return null!=i&&this.k(t),null!=i?i:n},f.prototype.k=function(t){var n;null!=(n=this.M)&&n.call(this,this,t)},n.default=f},766:function(t,n,i){var e=this&&this.__importDefault||function(t){return t&&t.v?t:{default:t}},r=(Object.defineProperty(n,"v",{value:!0}),n.saveOverridesToLocalStorage=n.loadOverridesFromLocalStorage=n.makeEmptyOverrides=n.STORAGE_KEY=void 0,e(i(682)));function u(){return{gates:{},configs:{},layers:{}}}n.STORAGE_KEY="STATSIG_JS_LITE_LOCAL_OVERRIDES",n.makeEmptyOverrides=u,n.loadOverridesFromLocalStorage=function(){var t=r.default.getItem(n.STORAGE_KEY);if(t)try{return JSON.parse(t)}catch(t){}return u()},n.saveOverridesToLocalStorage=function(t){r.default.setItem(n.STORAGE_KEY,JSON.stringify(t))}},820:function(t,n){var s=this&&this.__assign||function(){return(s=Object.assign||function(t){for(var n,i=1,e=arguments.length;i<e;i++)for(var r in n=arguments[i])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}).apply(this,arguments)};Object.defineProperty(n,"v",{value:!0}),n.default=function(t,n,i,e,r,u){void 0===e&&(e=null),void 0===r&&(r=null);var o=n;return null!=o&&o.privateAttributes&&delete(o=s({},n)).privateAttributes,{time:Date.now(),eventName:t,statsigMetadata:i,user:o,value:e,metadata:r,secondaryExposures:u}}},888:(t,n)=>{Object.defineProperty(n,"v",{value:!0}),n.version=void 0,n.version="1.3.0"},793:function(t,n,i){var e=this&&this.__assign||function(){return(e=Object.assign||function(t){for(var n,i=1,e=arguments.length;i<e;i++)for(var r in n=arguments[i])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}).apply(this,arguments)},r=this&&this.__createBinding||(Object.create?function(t,n,i,e){void 0===e&&(e=i);var r=Object.getOwnPropertyDescriptor(n,i);r&&("get"in r?n.v:!r.writable&&!r.configurable)||(r={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,e,r)}:function(t,n,i,e){t[e=void 0===e?i:e]=n[i]}),u=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||function(t){if(t&&t.v)return t;var n={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&r(n,t,i);return u(n,t),n},s=this&&this.__awaiter||function(t,o,s,c){return new(s=s||Promise)(function(i,n){function e(t){try{u(c.next(t))}catch(t){n(t)}}function r(t){try{u(c.throw(t))}catch(t){n(t)}}function u(t){var n;t.done?i(t.value):((n=t.value)instanceof s?n:new s(function(t){t(n)})).then(e,r)}u((c=c.apply(t,o||[])).next())})},c=this&&this.__generator||function(e,r){var u,o,s,c={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},f={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(f[Symbol.iterator]=function(){return this}),f;function t(i){return function(t){var n=[i,t];if(u)throw new TypeError("Generator is already executing.");for(;c=f&&n[f=0]?0:c;)try{if(u=1,o&&(s=2&n[0]?o.return:n[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,n[1])).done)return s;switch(o=0,(n=s?[2&n[0],s.value]:n)[0]){case 0:case 1:s=n;break;case 4:return c.label++,{value:n[1],done:!1};case 5:c.label++,o=n[1],n=[0];continue;case 7:n=c.ops.pop(),c.trys.pop();continue;default:if(!(s=0<(s=c.trys).length&&s[s.length-1])&&(6===n[0]||2===n[0])){c=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3]))c.label=n[1];else if(6===n[0]&&c.label<s[1])c.label=s[1],s=n;else{if(!(s&&c.label<s[2])){s[2]&&c.ops.pop(),c.trys.pop();continue}c.label=s[2],c.ops.push(n)}}n=r.call(e,c)}catch(t){n=[6,t],o=0}finally{u=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}}},f=this&&this.__importDefault||function(t){return t&&t.v?t:{default:t}},h=(Object.defineProperty(n,"v",{value:!0}),f(i(825))),a=f(i(742)),l=i(187),v=f(i(857)),d=f(i(578)),y=f(i(332)),w=f(i(69)),p=f(i(574)),g=o(i(567)),m=i(645),b=f(i(682)),S=i(28),_=f(i(820)),O=i(766);function T(t,n,i){var o=this;if(this.J=!1,this.L=null,this.I=null,this.C=function(t,n,i){void 0===i&&(i=!1);var e="",r=t.P,u=t.A.includes(n);u&&(e=t.h,r=t.o),o.R.logLayerExposure(o.V.K,t.i,t.u,r,e,n,u,t.l,i)},!0!==(null==i?void 0:i.localMode)&&("string"!=typeof t||!t.startsWith("client-")))throw new l.StatsigInvalidArgumentError("Invalid key provided. You must use a Client SDK Key from the Statsig console to initialize the sdk");this.I=t,this.q=(0,S.now)(),this.T=new p.default(i),this.U=new a.default(t,this.T),this.Y=!1,b.default.disabled=this.T.disableLocalStorage,this.F=(0,O.loadOverridesFromLocalStorage)(),this.V=new d.default(t,this.W(null!=n?n:null),this.T.overrideStableID),this.B=new w.default(this.T,this.V,this.U),this.R=new y.default(this.T,this.V,this.B,this.U),this.H=new g.default(this.V,this.R.logConfigDefaultValueFallback,this.T.initializeValues),this.U.p(this.V.g),null!=this.T.initializeValues&&(this.Y=!0,this.J=!0,setTimeout(function(){return o.X()},20))}T.prototype.setInitializeValues=function(t){var n=this;this.U.S("setInitializeValues",function(){n.H.bootstrap(t),n.Y||(n.Y=!0,n.J=!0),n.R.sendSavedRequests()},function(){n.Y=!0,n.J=!0})},T.prototype.initializeAsync=function(){return s(this,void 0,void 0,function(){var n=this;return c(this,function(t){return[2,this.U.S("initializeAsync",function(){return s(n,void 0,void 0,function(){var n,i=this;return c(this,function(t){if(null==this.L){if(this.Y)return[2,Promise.resolve()];if(this.J=!0,this.T.localMode)return[2,Promise.resolve()];n=this.V.K,this.L=this.Z(n,this.T.initTimeoutMs).then(function(){}).catch(function(t){return i.U.O("initializeAsync:fetchAndSaveValues",t),{success:!1,message:t.message}}).then(function(){}).finally(function(){return s(i,void 0,void 0,function(){return c(this,function(t){return this.L=null,this.Y=!0,this.X(),[2]})})})}return[2,this.L]})})},function(){return n.Y=!0,n.J=!0,Promise.resolve()})]})})},T.prototype.getEvaluationDetails=function(){var t=this;return this.U.S("getEvaluationDetails",function(){return t.H.getGlobalEvaluationDetails()},function(){return{time:Date.now(),reason:g.EvaluationReason.Error}})},T.prototype.checkGate=function(t){return this.$(t,"checkGate")},T.prototype.checkGateWithExposureLoggingDisabled=function(t){return this.$(t,"checkGateWithExposureLoggingDisabled")},T.prototype.logGateExposure=function(t){var n=this;this.U.m("logGateExposure",function(){n.tt(t)})},T.prototype.getConfig=function(t){return this.nt(t,"getConfig")},T.prototype.getConfigWithExposureLoggingDisabled=function(t){return this.nt(t,"getConfigWithExposureLoggingDisabled")},T.prototype.logConfigExposure=function(t){var n=this;this.U.m("logConfigExposure",function(){n.it(t)})},T.prototype.getExperiment=function(t){return this.getConfig(t)},T.prototype.getExperimentWithExposureLoggingDisabled=function(t){return this.getConfigWithExposureLoggingDisabled(t)},T.prototype.logExperimentExposure=function(t){this.logConfigExposure(t)},T.prototype.getLayer=function(t){return this.et(t,"getLayer")},T.prototype.getLayerWithExposureLoggingDisabled=function(t){return this.et(t,"getLayerWithExposureLoggingDisabled")},T.prototype.logLayerParameterExposure=function(n,i){var e=this;this.U.m("logLayerParameterExposure",function(){var t=e.rt(null,n);e.C(t,i,!0)})},T.prototype.logEvent=function(n,i,e){var r=this;void 0===i&&(i=null),void 0===e&&(e=null),this.U.m("logEvent",function(){if(!r.R||!r.V.I)throw new l.StatsigUninitializedError(l.StatsigErrorMessage.REQUIRE_INITIALIZE_FOR_LOG_EVENT);var t;"string"==typeof n&&0!==n.length&&(t=(0,_.default)(n,r.V.K,r.V.g,i,e),r.R.log(t))})},T.prototype.updateUserWithValues=function(t,n){var i,e=this,r=Date.now();return this.U.S("updateUserWithValues",function(){if(e.initializeCalled())return i=function(t,n){var i=e.T.updateUserCompletionCallback;null!=i&&i(Date.now()-r,t,n)},e.V.K=e.W(t),e.H.bootstrap(n),i(!0,null),!0;throw new l.StatsigUninitializedError(l.StatsigErrorMessage.REQUIRE_ASYNC_INITIALIZE)},function(){return null!=i&&i(!1,"Failed to update user. An unexpected error occured."),!1})},T.prototype.updateUser=function(u){return s(this,void 0,void 0,function(){var r,i,n=this;return c(this,function(t){return r=Date.now(),[2,this.U.S("updateUser",function(){return s(n,void 0,void 0,function(){var n,e=this;return c(this,function(t){switch(t.label){case 0:if(this.initializeCalled())return i=function(t,n){var i=e.T.updateUserCompletionCallback;null!=i&&i(Date.now()-r,t,n)},this.V.K=this.W(u),this.H.updateUser(),this.R.resetDedupeKeys(),null==this.L?[3,2]:[4,this.L];throw new l.StatsigUninitializedError(l.StatsigErrorMessage.REQUIRE_ASYNC_INITIALIZE);case 1:t.sent(),t.label=2;case 2:return this.T.localMode?(i(!0,null),[2,Promise.resolve(!0)]):(n=this.V.K,this.L=this.Z(n).finally(function(){e.L=null}),[2,this.L.then(function(){return i(!0,null),Promise.resolve(!0)}).catch(function(t){return i(!1,"Failed to update user: ".concat(t)),Promise.resolve(!1)})])}})})},function(){return i(!1,"Failed to update user. An unexpected error occured."),Promise.resolve(!1)})]})})},T.prototype.shutdown=function(){var t=this;this.U.m("shutdown",function(){t.R.shutdown()})},T.prototype.getStableID=function(){var t=this;return this.U.S("getStableID",function(){return t.V.g.stableID},function(){return""})},T.prototype.initializeCalled=function(){return this.J},T.prototype.overrideGate=function(t,n){this.ut("gates",t,n)},T.prototype.overrideConfig=function(t,n){this.ut("configs",t,n)},T.prototype.overrideLayer=function(t,n){this.ut("layers",t,n)},T.prototype.setOverrides=function(t){var n=this;this.U.m("setOverrides",function(){n.F=null!=t?t:(0,O.makeEmptyOverrides)(),(0,O.saveOverridesToLocalStorage)(n.F)})},T.prototype.getOverrides=function(){var t=this;return this.U.S("getOverrides",function(){return t.F},function(){return(0,O.makeEmptyOverrides)()})},T.prototype.X=function(){var t=this;this.U.m("delayedSetup",function(){t.V.saveStableID(),t.R.sendSavedRequests().then(function(){})})},T.prototype.W=function(t){var n={};try{n=JSON.parse(JSON.stringify(t))}catch(t){throw new l.StatsigInvalidArgumentError("User object must be convertable to JSON string.")}return n=null!=this.T.environment?e(e({},n),{statsigEnvironment:this.T.environment}):n},T.prototype.ot=function(){if(!this.H.isLoaded())throw new l.StatsigUninitializedError},T.prototype.st=function(){return{time:Date.now(),reason:g.EvaluationReason.Error}},T.prototype.Z=function(r,u){return void 0===u&&(u=this.T.initTimeoutMs),s(this,void 0,void 0,function(){var n,i,e=this;return c(this,function(t){return n=this.H.getLastUpdateTime(r),i=this.H.getPreviousDerivedFields(r),[2,this.B.fetchValues(r,n,u,i).eventually(function(t){var n;(0,m.verifySDKKeyUsed)(t,null!=(n=e.I)?n:"",e.U)&&null!=t&&t.has_updates&&e.H.save(r,t,!1)}).then(function(i){return s(e,void 0,void 0,function(){var n=this;return c(this,function(t){return[2,this.U.m("fetchAndSaveValues",function(){return s(n,void 0,void 0,function(){var n;return c(this,function(t){switch(t.label){case 0:return(0,m.verifySDKKeyUsed)(i,null!=(n=this.I)?n:"",this.U)?null!=i&&i.has_updates?[4,this.H.save(r,i)]:[3,2]:[2];case 1:return t.sent(),[3,3];case 2:null!=i&&i.is_no_content&&this.H.setEvaluationReason(g.EvaluationReason.NetworkNotModified),t.label=3;case 3:return[2]}})})})]})})})]})})},T.prototype.$=function(n,i){var e=this;return this.U.S(i,function(){var t;return"boolean"==typeof e.F.gates[n]?e.F.gates[n]:(t=e.ct(n),"checkGate"===i&&e.tt(n,t),!0===t.gate.value)},function(){return!1})},T.prototype.ct=function(t){if(this.ot(),"string"!=typeof t||0===t.length)throw new l.StatsigInvalidArgumentError("Must pass a valid string as the gateName.");return this.H.checkGate(t)},T.prototype.tt=function(t,n){var i=!n,n=null!=n?n:this.ct(t),e=n.gate;this.R.logGateExposure(this.V.K,t,e.value,e.rule_id,e.secondary_exposures,n.evaluationDetails,i)},T.prototype.nt=function(n,i){var e=this;return this.U.S(i,function(){var t;return e.F.configs[n]?new h.default(n,e.F.configs[n],"local_override",{reason:g.EvaluationReason.LocalOverride,time:Date.now()}):(t=e.ft(n),"getConfig"===i&&e.it(n,t),t)},function(){return e.ht(n)})},T.prototype.ft=function(t){if(this.ot(),"string"!=typeof t||0===t.length)throw new l.StatsigInvalidArgumentError("Must pass a valid string as the configName.");return this.H.getConfig(t)},T.prototype.it=function(t,n){var i=!n,n=null!=n?n:this.ft(t);this.R.logConfigExposure(this.V.K,t,n.u,n.o,n.l,i)},T.prototype.et=function(n,i){var e=this;return this.U.S(i,function(){var t;return e.F.layers[n]?v.default.G(n,e.F.layers[n],"local_override",{reason:g.EvaluationReason.LocalOverride,time:Date.now()}):(t="getLayer"===i?e.C:null,e.rt(t,n))},function(){return v.default.G(n,{},"",e.st())})},T.prototype.rt=function(t,n){if(this.ot(),"string"!=typeof n||0===n.length)throw new l.StatsigInvalidArgumentError("Must pass a valid string as the layerName.");return this.H.getLayer(t,n)},T.prototype.ht=function(t){return new h.default(t,{},"",this.st())},T.prototype.ut=function(t,n,i){null==i?delete this.F[t][n]:this.F[t][n]=i,this.setOverrides(this.F)},n.default=T},578:function(t,n,i){var e=this&&this.__importDefault||function(t){return t&&t.v?t:{default:t}},r=(Object.defineProperty(n,"v",{value:!0}),i(652)),u=i(898),o=e(i(682)),s=i(888);function c(t,n,i){this.lt="js-lite",this.I=t,this.K=n,this.vt=s.version;t=null!=(n=null!=(t=i)?t:o.default.getItem(r.STATSIG_STABLE_ID_KEY))?n:this.dt();this.g={stableID:t,sdkType:this.lt,sdkVersion:this.vt}}c.prototype.saveStableID=function(){null!=this.g.stableID&&o.default.setItem(r.STATSIG_STABLE_ID_KEY,this.g.stableID)},c.prototype.getUserCacheKey=function(){return(0,u.getUserCacheKey)(this.K)},c.prototype.dt=function(){for(var t="",n=0;n<32;n++){8!==n&&12!==n&&16!==n&&20!==n||(t+="-");var i=16*Math.random()|0;t+=12===n?"4":(16===n?3&i|8:i).toString(16)}return t},n.default=c},332:function(t,n,i){var u=this&&this.__awaiter||function(t,o,s,c){return new(s=s||Promise)(function(i,n){function e(t){try{u(c.next(t))}catch(t){n(t)}}function r(t){try{u(c.throw(t))}catch(t){n(t)}}function u(t){var n;t.done?i(t.value):((n=t.value)instanceof s?n:new s(function(t){t(n)})).then(e,r)}u((c=c.apply(t,o||[])).next())})},h=this&&this.__generator||function(e,r){var u,o,s,c={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},f={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(f[Symbol.iterator]=function(){return this}),f;function t(i){return function(t){var n=[i,t];if(u)throw new TypeError("Generator is already executing.");for(;c=f&&n[f=0]?0:c;)try{if(u=1,o&&(s=2&n[0]?o.return:n[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,n[1])).done)return s;switch(o=0,(n=s?[2&n[0],s.value]:n)[0]){case 0:case 1:s=n;break;case 4:return c.label++,{value:n[1],done:!1};case 5:c.label++,o=n[1],n=[0];continue;case 7:n=c.ops.pop(),c.trys.pop();continue;default:if(!(s=0<(s=c.trys).length&&s[s.length-1])&&(6===n[0]||2===n[0])){c=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3]))c.label=n[1];else if(6===n[0]&&c.label<s[1])c.label=s[1],s=n;else{if(!(s&&c.label<s[2])){s[2]&&c.ops.pop(),c.trys.pop();continue}c.label=s[2],c.ops.push(n)}}n=r.call(e,c)}catch(t){n=[6,t],o=0}finally{u=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}}},e=this&&this.__importDefault||function(t){return t&&t.v?t:{default:t}},a=(Object.defineProperty(n,"v",{value:!0}),e(i(820))),l=i(69),v=i(652),d=e(i(682)),e="statsig::",o=e+"log_event_failed";function r(t,n,i,e){var r=this;this.yt=0,this.logConfigDefaultValueFallback=function(t,n,i){t=(0,a.default)("statsig::default_value_type_mismatch",t,r.V.g,n,i);r.log(t),r.wt.add(n)},this.T=t,this.V=n,this.B=i,this.U=e,this.gt=[],this.bt=null,this.wt=new Set,this.St=[],this._t={},this.yt=0,this.Ot()}r.prototype.log=function(t){if(!this.T.disableAllLogging){try{var n;this.T.disableCurrentPageLogging||"undefined"==typeof window||null==window||"object"!=typeof window.location||"string"!=typeof window.location.href||0<(null==(n=window.location.href.split(/[?#]/))?void 0:n.length)&&(t.statsigMetadata.currentPage=n[0])}catch(t){}this.gt.push(t),this.gt.length>=this.T.loggingBufferMaxSize&&this.flush()}},r.prototype.resetDedupeKeys=function(){this._t={}},r.prototype.logGateExposure=function(t,n,i,e,r,u,o){var s=n+String(i)+e+u.reason;this.Tt(s)&&(s={gate:n,gateValue:String(i),ruleID:e,reason:u.reason,time:u.time},o&&(s.isManualExposure="true"),n=(0,a.default)("statsig::gate_exposure",t,this.V.g,null,s,r),this.log(n))},r.prototype.logConfigExposure=function(t,n,i,e,r,u){var o=n+i+r.reason;this.Tt(o)&&(o={config:n,ruleID:i,reason:r.reason,time:r.time},u&&(o.isManualExposure="true"),n=(0,a.default)("statsig::config_exposure",t,this.V.g,null,o,e),this.log(n))},r.prototype.logLayerExposure=function(t,n,i,e,r,u,o,s,c){var f=[n,i,r,u,String(o),s.reason].join("|");this.Tt(f)&&(f={config:n,ruleID:i,allocatedExperiment:r,parameterName:u,isExplicitParameter:String(o),reason:s.reason,time:s.time},c&&(f.isManualExposure="true"),n=(0,a.default)("statsig::layer_exposure",t,this.V.g,null,f,e),this.log(n))},r.prototype.shutdown=function(){this.bt&&(clearInterval(this.bt),this.bt=null),this.flush(!0)},r.prototype.flush=function(n){var i,e,r,t=this;void 0===n&&(n=!1),0!==this.gt.length&&(i=this.V.g,e=this.gt,this.gt=[],n&&!this.B.supportsKeepalive()&&"undefined"!=typeof navigator&&null!=navigator&&navigator.sendBeacon?this.B.sendLogBeacon({events:e,statsigMetadata:i})||(this.gt=e.concat(this.gt),0<this.gt.length&&(this.jt({events:this.gt,statsigMetadata:i,time:Date.now()}),this.gt=[]),this.Et()):(r=this).B.postToEndpoint(l.StatsigEndpoint.Rgstr,{events:e,statsigMetadata:i},3,1e3,n).then(function(t){if(!t.ok)throw t}).catch(function(i){"function"==typeof i.text?i.text().then(function(n){t.U.O(o,i,function(){return u(t,void 0,void 0,function(){return h(this,function(t){return[2,{eventCount:e.length,error:n}]})})})}):t.U.O(o,i,function(){return u(t,void 0,void 0,function(){return h(this,function(t){return[2,{eventCount:e.length,error:i.message}]})})}),r.Dt(o,e)}).finally(function(){return u(t,void 0,void 0,function(){return h(this,function(t){switch(t.label){case 0:return n?(0<this.gt.length&&(this.jt({events:this.gt,statsigMetadata:i,time:Date.now()}),this.gt=[]),[4,r.Et()]):[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})}))},r.prototype.sendSavedRequests=function(){return u(this,void 0,void 0,function(){var n,i,e,r,u,o,s,c,f=this;return h(this,function(t){if(i=!1,null==(n=d.default.getItem(v.STATSIG_LOCAL_STORAGE_LOGGING_REQUEST_KEY)))this.xt();else{1024e3<n.length&&(i=!0),0;try{for(e=JSON.parse(n),r=function(n){null!=n&&n.events&&Array.isArray(n.events)&&u.B.postToEndpoint(l.StatsigEndpoint.Rgstr,n).then(function(t){if(!t.ok)throw Error(t.status+"")}).catch(function(t){i||f.jt(n)})},u=this,o=0,s=e;o<s.length;o++)c=s[o],r(c)}catch(t){}finally{this.xt()}}return[2]})})},r.prototype.Ot=function(){var t,n=this;"undefined"!=typeof window&&"function"==typeof window.addEventListener&&(window.addEventListener("blur",function(){return n.flush(!0)}),window.addEventListener("beforeunload",function(){return n.flush(!0)}),window.addEventListener("load",function(){setTimeout(function(){return n.flush()},100),setTimeout(function(){return n.flush()},1e3)})),"undefined"!=typeof document&&"function"==typeof document.addEventListener&&document.addEventListener("visibilitychange",function(){n.flush("visible"!==document.visibilityState)}),(this.T.ignoreWindowUndefined||"undefined"!=typeof window&&null!=window)&&!this.T.localMode&&((t=this).bt=setInterval(function(){t.flush()},this.T.loggingIntervalMillis),setTimeout(function(){return n.flush()},100),setTimeout(function(){return n.flush()},1e3))},r.prototype.Tt=function(t){var n=this._t[t],i=Date.now();if(null!=n&&i-6e5<=n)return!1;return this._t[t]=i,!0},r.prototype.Et=function(){return u(this,void 0,void 0,function(){var n;return h(this,function(t){if(0<this.St.length){if(1024e3<(n=JSON.stringify(this.St)).length)return this.xt(),[2];d.default.setItem(v.STATSIG_LOCAL_STORAGE_LOGGING_REQUEST_KEY,n)}return[2]})})},r.prototype.jt=function(t){var n;t.time<Date.now()-432e6||100<this.St.length||(n=t.events.length,1e3<this.yt+n)||(this.St.push(t),this.yt+=n)},r.prototype.xt=function(){d.default.removeItem(v.STATSIG_LOCAL_STORAGE_LOGGING_REQUEST_KEY)},r.prototype.Dt=function(t,n){this.wt.has(t)||(this.wt.add(t),this.St.push({events:n,statsigMetadata:this.V.g,time:Date.now()}),this.Et().then(function(){}))},n.default=r},69:function(t,n){var h,i,l=this&&this.__awaiter||function(t,o,s,c){return new(s=s||Promise)(function(i,n){function e(t){try{u(c.next(t))}catch(t){n(t)}}function r(t){try{u(c.throw(t))}catch(t){n(t)}}function u(t){var n;t.done?i(t.value):((n=t.value)instanceof s?n:new s(function(t){t(n)})).then(e,r)}u((c=c.apply(t,o||[])).next())})},v=this&&this.__generator||function(e,r){var u,o,s,c={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},f={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(f[Symbol.iterator]=function(){return this}),f;function t(i){return function(t){var n=[i,t];if(u)throw new TypeError("Generator is already executing.");for(;c=f&&n[f=0]?0:c;)try{if(u=1,o&&(s=2&n[0]?o.return:n[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,n[1])).done)return s;switch(o=0,(n=s?[2&n[0],s.value]:n)[0]){case 0:case 1:s=n;break;case 4:return c.label++,{value:n[1],done:!1};case 5:c.label++,o=n[1],n=[0];continue;case 7:n=c.ops.pop(),c.trys.pop();continue;default:if(!(s=0<(s=c.trys).length&&s[s.length-1])&&(6===n[0]||2===n[0])){c=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3]))c.label=n[1];else if(6===n[0]&&c.label<s[1])c.label=s[1],s=n;else{if(!(s&&c.label<s[2])){s[2]&&c.ops.pop(),c.trys.pop();continue}c.label=s[2],c.ops.push(n)}}n=r.call(e,c)}catch(t){n=[6,t],o=0}finally{u=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}}};Object.defineProperty(n,"v",{value:!0}),n.StatsigEndpoint=void 0,(i=h=n.StatsigEndpoint||(n.StatsigEndpoint={})).Initialize="initialize",i.Rgstr="rgstr",i.LogEventBeacon="log_event_beacon";function e(t,n,i){this.retryCodes={408:!0,500:!0,502:!0,503:!0,504:!0,522:!0,524:!0,599:!0},this.canUseKeepalive=!1,this.T=t,this.V=n,this.U=i,this.leakyBucket={},this.Ot()}e.prototype.fetchValues=function(t,n,i,e){t={user:t,statsigMetadata:this.V.g,sinceTime:null!=n?n:void 0,hash:"djb2",previousDerivedFields:e};return this.It(h.Initialize,t,i,3)},e.prototype.sendLogBeacon=function(t){if(this.T.localMode)return!0;var n=new URL(this.T.eventLoggingApi+h.LogEventBeacon),i=(n.searchParams.append("k",this.V.I),t.clientTime=Date.now()+"",null);try{i=JSON.stringify(t)}catch(t){return!1}return navigator.sendBeacon(n.toString(),i)},e.prototype.postToEndpoint=function(u,o,s,c,f){return void 0===s&&(s=0),void 0===c&&(c=1e3),void 0===f&&(f=!1),l(this,void 0,void 0,function(){var i,n,e,r=this;return v(this,function(t){return this.T.localMode?[2,Promise.reject("no network requests in localMode")]:"function"!=typeof fetch?[2,Promise.reject("fetch is not defined")]:"undefined"!=typeof window||this.T.ignoreWindowUndefined?(e=[h.Initialize].includes(u)?this.T.api:this.T.eventLoggingApi,i=e+u,null!=(e=this.leakyBucket[i])&&30<=e?[2,Promise.reject(new Error("Request failed because you are making the same request too frequently."))]:(this.leakyBucket[i]=null==e?1:e+1,e=JSON.stringify(o),n=this.V.g,e={method:"POST",body:e,headers:{"Content-type":"application/json; charset=UTF-8","STATSIG-API-KEY":this.V.I,"STATSIG-CLIENT-TIME":Date.now()+"","STATSIG-SDK-TYPE":n.sdkType,"STATSIG-SDK-VERSION":n.sdkVersion}},this.canUseKeepalive&&f&&(e.keepalive=!0),[2,fetch(i,e).then(function(e){return l(r,void 0,void 0,function(){var n,i;return v(this,function(t){switch(t.label){case 0:return e.ok?204!==(n=e).status?[3,1]:(n.data={has_updates:!1,is_no_content:!0},[3,3]):[3,4];case 1:return[4,e.text()];case 2:i=t.sent(),n.data=JSON.parse(i),t.label=3;case 3:return[2,Promise.resolve(n)];case 4:return this.retryCodes[e.status]||(s=0),[4,e.text()];case 5:return i=t.sent(),[2,Promise.reject(new Error("".concat(e.status,": ").concat(i)))]}})})}).catch(function(t){return 0<s?new Promise(function(t,n){setTimeout(function(){r.leakyBucket[i]=Math.max(r.leakyBucket[i]-1,0),r.postToEndpoint(u,o,s-1,2*c,f).then(t).catch(n)},c)}):Promise.reject(t)}).finally(function(){r.leakyBucket[i]=Math.max(r.leakyBucket[i]-1,0)})])):[2,Promise.reject("window is not defined")]})})},e.prototype.supportsKeepalive=function(){return this.canUseKeepalive},e.prototype.Ot=function(){if(!this.T.disableNetworkKeepalive)try{this.canUseKeepalive="keepalive"in new Request("")}catch(t){}},e.prototype.It=function(e,r,i,u,o){var n,s=this,c=(void 0===u&&(u=0),void 0===o&&(o=1e3),!1),t=null,f=null,h=[],a=(0!=(i=void 0===i?0:i)&&(t=new Promise(function(t,n){setTimeout(function(){c=!0,n(new Error("The initialization timeout of ".concat(i,"ms has been hit before the network request has completed.")))},i)})),this.postToEndpoint(e,r,u,o).then(function(n){var t,i;return n.ok?"object"!=typeof n.data?(t=new Error("Request to ".concat(e," received invalid response type. Expected 'object' but got '").concat(typeof n.data,"'")),s.U.O("postWithTimeoutInvalidRes",t,function(){return l(s,void 0,void 0,function(){return v(this,function(t){return[2,this.Mt(e,r,u,o,n)]})})}),Promise.reject(t)):(i=n.data,s.U.S("postWithTimeout",function(){return l(s,void 0,void 0,function(){return v(this,function(t){return f=i,c&&(h.forEach(function(t){return t(i)}),h=[]),[2,Promise.resolve(i)]})})},function(){return Promise.resolve({})},function(){return l(s,void 0,void 0,function(){return v(this,function(t){return[2,this.Mt(e,r,u,o,n)]})})})):Promise.reject(new Error("Request to ".concat(e," failed with status ").concat(n.status)))}).catch(function(t){return Promise.reject(t)})),t=t?Promise.race([a,t]):a;return t.eventually=(n=t,function(t){return c&&f?t(f):h.push(t),n}),t},e.prototype.Mt=function(n,e,r,u,o){var s;return l(this,void 0,void 0,function(){var i;return v(this,function(t){try{return i={},(null!=(s=o.headers)?s:[]).forEach(function(t,n){i[n]=t}),[2,{responseInfo:{headers:i,status:o.status,statusText:o.statusText,type:o.type,url:o.url,redirected:o.redirected,bodySnippet:o.data?JSON.stringify(o.data).slice(0,500):null},requestInfo:{endpointName:n,bodySnippet:JSON.stringify(e).slice(0,500),retries:r,backoff:u}}]}catch(t){return[2,{statusText:"statsig::failed to extract extra data"}]}return[2]})})},n.default=e},574:(t,i)=>{Object.defineProperty(i,"v",{value:!0}),i.INIT_TIMEOUT_DEFAULT_MS=void 0;i.INIT_TIMEOUT_DEFAULT_MS=3e3,e.prototype.normalizeNumberInput=function(t,n){return null==t?n.default:Math.max(Math.min(t,n.max),n.min)};var n=e;function e(t){var n=null!=(n=(t=null==t?{}:t).api)?n:"https://featuregates.org/v1/",n=(this.api=n.endsWith("/")?n:n+"/",this.disableCurrentPageLogging=null!=(n=t.disableCurrentPageLogging)&&n,this.environment=null!=(n=t.environment)?n:null,this.loggingIntervalMillis=this.normalizeNumberInput(t.loggingIntervalMillis,{default:1e4,min:1e3,max:6e4}),this.loggingBufferMaxSize=this.normalizeNumberInput(t.loggingBufferMaxSize,{default:100,min:2,max:500}),this.disableNetworkKeepalive=null!=(n=t.disableNetworkKeepalive)&&n,this.overrideStableID=null!=(n=t.overrideStableID)?n:null,this.localMode=null!=(n=t.localMode)&&n,this.initTimeoutMs=t.initTimeoutMs&&0<=t.initTimeoutMs?t.initTimeoutMs:i.INIT_TIMEOUT_DEFAULT_MS,this.disableErrorLogging=null!=(n=t.disableErrorLogging)&&n,this.disableAutoMetricsLogging=null!=(n=t.disableAutoMetricsLogging)&&n,this.initializeValues=null!=(n=t.initializeValues)?n:null,null!=(n=null!=(n=t.eventLoggingApi)?n:t.api)?n:"https://events.statsigapi.net/v1/");this.eventLoggingApi=n.endsWith("/")?n:n+"/",this.disableLocalStorage=null!=(n=t.disableLocalStorage)&&n,this.ignoreWindowUndefined=null!=(n=null==t?void 0:t.ignoreWindowUndefined)&&n,this.updateUserCompletionCallback=null!=(n=null==t?void 0:t.updateUserCompletionCallback)?n:null,this.disableAllLogging=null!=(n=null==t?void 0:t.disableAllLogging)&&n}i.default=n},567:function(t,n,i){var o,s=this&&this.__awaiter||function(t,o,s,c){return new(s=s||Promise)(function(i,n){function e(t){try{u(c.next(t))}catch(t){n(t)}}function r(t){try{u(c.throw(t))}catch(t){n(t)}}function u(t){var n;t.done?i(t.value):((n=t.value)instanceof s?n:new s(function(t){t(n)})).then(e,r)}u((c=c.apply(t,o||[])).next())})},c=this&&this.__generator||function(e,r){var u,o,s,c={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},f={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(f[Symbol.iterator]=function(){return this}),f;function t(i){return function(t){var n=[i,t];if(u)throw new TypeError("Generator is already executing.");for(;c=f&&n[f=0]?0:c;)try{if(u=1,o&&(s=2&n[0]?o.return:n[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,n[1])).done)return s;switch(o=0,(n=s?[2&n[0],s.value]:n)[0]){case 0:case 1:s=n;break;case 4:return c.label++,{value:n[1],done:!1};case 5:c.label++,o=n[1],n=[0];continue;case 7:n=c.ops.pop(),c.trys.pop();continue;default:if(!(s=0<(s=c.trys).length&&s[s.length-1])&&(6===n[0]||2===n[0])){c=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3]))c.label=n[1];else if(6===n[0]&&c.label<s[1])c.label=s[1],s=n;else{if(!(s&&c.label<s[2])){s[2]&&c.ops.pop(),c.trys.pop();continue}c.label=s[2],c.ops.push(n)}}n=r.call(e,c)}catch(t){n=[6,t],o=0}finally{u=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}}},e=this&&this.__importDefault||function(t){return t&&t.v?t:{default:t}},r=(Object.defineProperty(n,"v",{value:!0}),n.EvaluationReason=void 0,e(i(825))),u=e(i(857)),f=e(i(477)),h=i(652),a=i(898),l=e(i(682));(e=o=n.EvaluationReason||(n.EvaluationReason={})).Network="Network",e.Bootstrap="Bootstrap",e.InvalidBootstrap="InvalidBootstrap",e.Cache="Cache",e.Unrecognized="Unrecognized",e.Uninitialized="Uninitialized",e.Error="Error",e.NetworkNotModified="NetworkNotModified",e.LocalOverride="LocalOverride";function v(t,n,i){this.V=t,this.t=n,this.Nt=this.V.getUserCacheKey(),this.Pt={},this.At=this.Gt(),this.kt=!1,this.Jt=o.Uninitialized,i?this.bootstrap(i):this.Lt()}v.prototype.updateUser=function(){return this.Nt=this.V.getUserCacheKey(),this.Ct()},v.prototype.bootstrap=function(t){var n,i,e,r=this.V.getUserCacheKey(),u=this.V.K,u=f.default.isValid(u,t)?o.Bootstrap:o.InvalidBootstrap;this.kt=!0;try{this.At.feature_gates=null!=(n=t.feature_gates)?n:{},this.At.dynamic_configs=null!=(i=t.dynamic_configs)?i:{},this.At.layer_configs=null!=(e=t.layer_configs)?e:{},this.At.evaluation_time=Date.now(),this.At.time=Date.now(),this.Pt[r]=this.At,this.Jt=u}catch(t){}},v.prototype.isLoaded=function(){return this.kt},v.prototype.getLastUpdateTime=function(t){t=(0,a.djb2HashForObject)(t);return this.At.user_hash==t?this.At.time:null},v.prototype.getPreviousDerivedFields=function(t){t=(0,a.djb2HashForObject)(t);if(this.At.user_hash==t)return this.At.derived_fields},v.prototype.setEvaluationReason=function(t){this.Jt=t},v.prototype.save=function(e,r,u){return void 0===u&&(u=!0),s(this,void 0,void 0,function(){var n,i;return c(this,function(t){switch(t.label){case 0:return i=(0,a.getUserCacheKey)(e),this.Rt(r,this.Pt,i,e,function(t){return t}),u&&(n=this.Pt[i])&&i&&i==this.Nt&&(this.At=n,this.Jt=o.Network),[4,(i=this).Kt(this.Pt)];case 1:return i.Pt=t.sent(),[2]}})})},v.prototype.checkGate=function(t){var n=(0,a.getHashValue)(t,this.At.hash_used),t={name:t,value:!1,rule_id:"",secondary_exposures:[]},i=null==(i=this.At)?void 0:i.feature_gates[n];return i&&(t=i),{evaluationDetails:this.Vt(null!=i),gate:t}},v.prototype.getConfig=function(t){var n,i,e=(0,a.getHashValue)(t,this.At.hash_used);return null!=(null==(n=this.At)?void 0:n.dynamic_configs[e])?(n=null==(n=this.At)?void 0:n.dynamic_configs[e],i=this.Vt(!0),this.zt(t,n,i)):(i=this.Vt(!1),new r.default(t,{},"",i))},v.prototype.getLayer=function(t,n){var i=this.qt(n,"layer_configs"),e=this.Vt(null!=i);return u.default.G(n,null!=(n=null==i?void 0:i.value)?n:{},null!=(n=null==i?void 0:i.rule_id)?n:"",e,t,null==i?void 0:i.secondary_exposures,null==i?void 0:i.undelegated_secondary_exposures,null!=(n=null==i?void 0:i.allocated_experiment_name)?n:"",null==i?void 0:i.explicit_parameters)},v.prototype.getGlobalEvaluationDetails=function(){var t;return{reason:null!=(t=this.Jt)?t:o.Uninitialized,time:null!=(t=this.At.evaluation_time)?t:0}},v.prototype.Lt=function(){this.Ut(l.default.getItem(h.INTERNAL_STORE_KEY)),this.kt=!0},v.prototype.Ut=function(t){try{this.Pt=t?JSON.parse(t):this.Pt,this.Ct()}catch(t){this.Yt(h.INTERNAL_STORE_KEY)}},v.prototype.Ct=function(){var t=this.Pt[this.Nt];return null==t?(this.Ft(),this.Jt=o.Uninitialized,null):(this.At=t,this.Jt=o.Cache,null!=(t=t.evaluation_time)?t:0)},v.prototype.Yt=function(t){l.default.removeItem(t)},v.prototype.Rt=function(t,n,i,e,r){var u;i&&(u=this.Wt(t,i),t.has_updates&&t.time&&(t=(0,a.djb2HashForObject)(e),u.user_hash=t),n[i]=r(u,i))},v.prototype.Gt=function(){return{feature_gates:{},layer_configs:{},dynamic_configs:{},time:0,evaluation_time:0,has_updates:!1}},v.prototype.Kt=function(i){return s(this,void 0,void 0,function(){var n;return c(this,function(t){return n=Object.entries(i).sort(function(t,n){var i,t=t[1],n=n[1];return null==t?1:null==n?-1:(null!=(i=null==n?void 0:n.evaluation_time)?i:null==n?void 0:n.time)-(null!=(i=null==t?void 0:t.evaluation_time)?i:null==t?void 0:t.time)}).slice(0,10),i=Object.fromEntries(n),l.default.setItem(h.INTERNAL_STORE_KEY,JSON.stringify(i)),[2,i]})})},v.prototype.qt=function(t,n){var i,e=(0,a.getHashValue)(t,this.At.hash_used);return null!=(i=null==(i=null==(i=this.At)?void 0:i[n])?void 0:i[e])?i:null==(i=null==(e=this.At)?void 0:e[n])?void 0:i[t]},v.prototype.zt=function(t,n,i){return new r.default(t,null!=(t=null==n?void 0:n.value)?t:{},null!=(t=null==n?void 0:n.rule_id)?t:"",i,null==n?void 0:n.secondary_exposures,null!=(t=null==n?void 0:n.allocated_experiment_name)?t:"",this.Bt(this.V.K))},v.prototype.Vt=function(t,n){return t?{reason:this.Jt,time:null!=(t=this.At.evaluation_time)?t:Date.now()}:{reason:null!=n?n:this.Jt==o.Uninitialized?o.Uninitialized:o.Unrecognized,time:Date.now()}},v.prototype.Ft=function(){this.At=this.Gt()},v.prototype.Wt=function(t,n){return{feature_gates:t.feature_gates,layer_configs:t.layer_configs,dynamic_configs:t.dynamic_configs,time:null==t.time||isNaN(t.time)?0:t.time,evaluation_time:Date.now(),derived_fields:t.derived_fields,hash_used:t.hash_used}},v.prototype.Bt=function(r){var u=this;return function(t,n,i,e){u.isLoaded()&&u.t(r,"Parameter ".concat(n," is a value of type ").concat(e,".\n Returning requested defaultValue type ").concat(i),{name:t.i,ruleID:t.u,parameter:n,defaultValueType:i,valueType:e})}},n.default=v},607:function(t,n,i){var o=this&&this.__awaiter||function(t,o,s,c){return new(s=s||Promise)(function(i,n){function e(t){try{u(c.next(t))}catch(t){n(t)}}function r(t){try{u(c.throw(t))}catch(t){n(t)}}function u(t){var n;t.done?i(t.value):((n=t.value)instanceof s?n:new s(function(t){t(n)})).then(e,r)}u((c=c.apply(t,o||[])).next())})},s=this&&this.__generator||function(e,r){var u,o,s,c={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},f={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(f[Symbol.iterator]=function(){return this}),f;function t(i){return function(t){var n=[i,t];if(u)throw new TypeError("Generator is already executing.");for(;c=f&&n[f=0]?0:c;)try{if(u=1,o&&(s=2&n[0]?o.return:n[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,n[1])).done)return s;switch(o=0,(n=s?[2&n[0],s.value]:n)[0]){case 0:case 1:s=n;break;case 4:return c.label++,{value:n[1],done:!1};case 5:c.label++,o=n[1],n=[0];continue;case 7:n=c.ops.pop(),c.trys.pop();continue;default:if(!(s=0<(s=c.trys).length&&s[s.length-1])&&(6===n[0]||2===n[0])){c=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3]))c.label=n[1];else if(6===n[0]&&c.label<s[1])c.label=s[1],s=n;else{if(!(s&&c.label<s[2])){s[2]&&c.ops.pop(),c.trys.pop();continue}c.label=s[2],c.ops.push(n)}}n=r.call(e,c)}catch(t){n=[6,t],o=0}finally{u=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}}},e=this&&this.__importDefault||function(t){return t&&t.v?t:{default:t}},r=(Object.defineProperty(n,"v",{value:!0}),n.EvaluationReason=n.DynamicConfig=void 0,i(187)),c=e(i(793)),u=i(567),f=i(825),h=(Object.defineProperty(n,"DynamicConfig",{enumerable:!0,get:function(){return e(f).default}}),i(567));function a(){}Object.defineProperty(n,"EvaluationReason",{enumerable:!0,get:function(){return h.EvaluationReason}}),a.initialize=function(i,e,r){var u;return o(this,void 0,void 0,function(){var n;return s(this,function(t){return n=null!=(u=a.instance)?u:new c.default(i,e,r),a.instance||(a.instance=n),[2,n.initializeAsync()]})})},a.setInitializeValues=function(t){a.Qt().setInitializeValues(t)},a.checkGate=function(t){return a.Qt().checkGate(t)},a.checkGateWithExposureLoggingDisabled=function(t){return a.Qt().checkGateWithExposureLoggingDisabled(t)},a.manuallyLogGateExposure=function(t){a.Qt().logGateExposure(t)},a.getConfig=function(t){return a.Qt().getConfig(t)},a.getConfigWithExposureLoggingDisabled=function(t){return a.Qt().getConfigWithExposureLoggingDisabled(t)},a.manuallyLogConfigExposure=function(t){a.Qt().logConfigExposure(t)},a.getExperiment=function(t){return a.Qt().getExperiment(t)},a.getExperimentWithExposureLoggingDisabled=function(t){return a.Qt().getExperimentWithExposureLoggingDisabled(t)},a.manuallyLogExperimentExposure=function(t){a.Qt().logExperimentExposure(t)},a.getLayer=function(t){return a.Qt().getLayer(t)},a.getLayerWithExposureLoggingDisabled=function(t){return a.Qt().getLayerWithExposureLoggingDisabled(t)},a.manuallyLogLayerParameterExposure=function(t,n){a.Qt().logLayerParameterExposure(t,n)},a.logEvent=function(t,n,i){return void 0===n&&(n=null),void 0===i&&(i=null),a.Qt().logEvent(t,n,i)},a.updateUser=function(t){return a.Qt().updateUser(t)},a.updateUserWithValues=function(t,n){return a.Qt().updateUserWithValues(t,n)},a.shutdown=function(){a.Qt().shutdown(),a.instance=null},a.overrideGate=function(t,n){a.Qt().overrideGate(t,n)},a.overrideConfig=function(t,n){a.Qt().overrideConfig(t,n)},a.overrideLayer=function(t,n){a.Qt().overrideLayer(t,n)},a.setOverrides=function(t){a.Qt().setOverrides(t)},a.getOverrides=function(){return a.Qt().getOverrides()},a.getStableID=function(){return a.Qt().getStableID()},a.getEvaluationDetails=function(){var t;return null!=(t=null==(t=a.instance)?void 0:t.getEvaluationDetails())?t:{reason:u.EvaluationReason.Uninitialized,time:0}},a.initializeCalled=function(){return null!=a.instance&&a.instance.initializeCalled()},a.Qt=function(){if(a.instance)return a.instance;throw new r.StatsigUninitializedError},a.instance=null,n.default=a},477:function(t,n){var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var n,i=1,e=arguments.length;i<e;i++)for(var r in n=arguments[i])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}).apply(this,arguments)};function u(){}Object.defineProperty(n,"v",{value:!0}),u.isValid=function(t,n){try{var i,e,r=n.evaluated_keys;return r&&"object"==typeof r?(i=this.copyObject(r),e=null==t?null:this.copyObject(t),u.validate(i,e)&&u.validate(e,i)):!0}catch(t){}return!0},u.validate=function(t,n){if(null==t)return null==n;if(null==n)return!1;for(var i=0,e=Object.entries(t);i<e.length;i++){var r=e[i],u=r[0],r=r[1];if("stableID"!==u){if(typeof r!=typeof n[u])return!1;if("string"!=typeof r)return"object"==typeof r&&this.validate(r,n[u]);if(r!==n[u])return!1}}return!0},u.copyObject=function(t){var n;return null==t?null:(n={},null!=t&&t.userID&&(n.userID=null==t?void 0:t.userID),null!=t&&t.customIDs&&(delete(t=i({},t.customIDs)).stableID,0!==Object.keys(t).length)&&(n.customIDs=t),n)},n.default=u},652:(t,n)=>{Object.defineProperty(n,"v",{value:!0}),n.LOCAL_STORAGE_KEYS=n.STATSIG_LOCAL_STORAGE_LOGGING_REQUEST_KEY=n.STATSIG_STABLE_ID_KEY=n.INTERNAL_STORE_KEY=void 0,n.INTERNAL_STORE_KEY="STATSIG_STORE",n.STATSIG_STABLE_ID_KEY="STATSIG_STABLE_ID",n.STATSIG_LOCAL_STORAGE_LOGGING_REQUEST_KEY="STATSIG_LOGS",n.LOCAL_STORAGE_KEYS={INTERNAL_STORE_KEY:!0,STATSIG_STABLE_ID_KEY:!0,STATSIG_LOCAL_STORAGE_LOGGING_REQUEST_KEY:!0}},898:(t,n)=>{function s(t){for(var n=0,i=0;i<t.length;i++){n=(n<<5)-n+t.charCodeAt(i);n&=n}return String(n>>>0)}function r(i){var t,e;return null==i?null:(t=Object.keys(i).sort(),e={},t.forEach(function(t){var n=i[t];n instanceof Object&&(n=r(n)),e[t]=n}),e)}Object.defineProperty(n,"v",{value:!0}),n.getUserCacheKey=n.getSortedObject=n.djb2HashForObject=n.getHashValue=n.SimpleHash=void 0,n.SimpleHash=s,n.getHashValue=function(t,n){return"none"===n?t:s(t)},n.djb2HashForObject=function(t){return s(JSON.stringify(r(t)))},n.getSortedObject=r,n.getUserCacheKey=function(t){var n="userID:".concat(String(null!=(i=null==t?void 0:t.userID)?i:"")),i=null==t?void 0:t.customIDs;if(null!=i)for(var e=0,r=Object.entries(i);e<r.length;e++){var u=r[e],o=u[0],u=u[1];n+=";".concat(o,":").concat(u)}return s(n)}},645:(t,n,i)=>{Object.defineProperty(n,"v",{value:!0}),n.verifySDKKeyUsed=void 0;var e=i(187),r=i(898);n.verifySDKKeyUsed=function(t,n,i){return null==(t=null==t?void 0:t.hashed_sdk_key_used)||t===(0,r.SimpleHash)(null!=n?n:"")||(i.O("fetchAndSaveValues",new e.StatsigSDKKeyMismatchError("The SDK key provided does not match the one used to generate values.")),!1)}},682:(t,n)=>{function i(){}Object.defineProperty(n,"v",{value:!0}),i.getItem=function(t){try{if(this.isStorageAccessible())return window.localStorage.getItem(t)}catch(t){}return null!=(t=this.fallbackSessionCache[t])?t:null},i.setItem=function(t,n){try{if(this.isStorageAccessible())return void window.localStorage.setItem(t,n)}catch(t){}this.fallbackSessionCache[t]=n},i.removeItem=function(t){try{if(this.isStorageAccessible())return void window.localStorage.removeItem(t)}catch(t){}delete this.fallbackSessionCache[t]},i.isStorageAccessible=function(t){void 0===t&&(t=!1),null==this.canAccessStorageAccessible&&(this.canAccessStorageAccessible="undefined"!=typeof Storage&&"undefined"!=typeof window&&null!=window&&null!=window.localStorage);var n=this.canAccessStorageAccessible;return(t||!this.disabled)&&n},i.disabled=!1,i.fallbackSessionCache={},i.canAccessStorageAccessible=null,n.default=i},28:(t,n)=>{function i(){return"undefined"!=typeof performance&&performance?0|performance.now():Date.now()}Object.defineProperty(n,"v",{value:!0}),n.difference=n.now=void 0,n.now=i,n.difference=function(t){return i()-t}}},r={};return function t(n){var i=r[n];return void 0===i&&(i=r[n]={exports:{}},e[n].call(i.exports,i,i.exports,t)),i.exports}(607).default})()); | ||
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.statsig=n():t.statsig=n()}(this,()=>(()=>{"use strict";var e={825:(t,n)=>{function i(t,n,i,e,r,u,o){void 0===r&&(r=[]),void 0===u&&(u=""),void 0===o&&(o=null),this.t=null,this.value=JSON.parse(JSON.stringify(null!=n?n:{})),this.i=t,this.u=null!=i?i:"",this.o=r,this.h=u,this.l=e,this.t=o}Object.defineProperty(n,"v",{value:!0}),i.prototype.get=function(t,n,i){var e=this.getValue(t,n);if(null!=e){var r=Array.isArray(n)?"array":typeof n,u=Array.isArray(e)?"array":typeof e;if(i)return i(e)?e:(null!=(i=this.t)&&i.call(this,this,t,r,u),n);if(null==n||r==u)return e;null!=(i=this.t)&&i.call(this,this,t,r,u)}return n},i.prototype.getValue=function(t,n){return null==t?this.value:(null==n&&(n=null),null==this.value[t]?n:this.value[t])},n.default=i},742:function(t,f,n){var i=this&&this.__awaiter||function(t,o,s,c){return new(s=s||Promise)(function(i,n){function e(t){try{u(c.next(t))}catch(t){n(t)}}function r(t){try{u(c.throw(t))}catch(t){n(t)}}function u(t){var n;t.done?i(t.value):((n=t.value)instanceof s?n:new s(function(t){t(n)})).then(e,r)}u((c=c.apply(t,o||[])).next())})},h=this&&this.__generator||function(e,r){var u,o,s,c={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},f={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(f[Symbol.iterator]=function(){return this}),f;function t(i){return function(t){var n=[i,t];if(u)throw new TypeError("Generator is already executing.");for(;c=f&&n[f=0]?0:c;)try{if(u=1,o&&(s=2&n[0]?o.return:n[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,n[1])).done)return s;switch(o=0,(n=s?[2&n[0],s.value]:n)[0]){case 0:case 1:s=n;break;case 4:return c.label++,{value:n[1],done:!1};case 5:c.label++,o=n[1],n=[0];continue;case 7:n=c.ops.pop(),c.trys.pop();continue;default:if(!(s=0<(s=c.trys).length&&s[s.length-1])&&(6===n[0]||2===n[0])){c=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3]))c.label=n[1];else if(6===n[0]&&c.label<s[1])c.label=s[1],s=n;else{if(!(s&&c.label<s[2])){s[2]&&c.ops.pop(),c.trys.pop();continue}c.label=s[2],c.ops.push(n)}}n=r.call(e,c)}catch(t){n=[6,t],o=0}finally{u=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}}},r=(Object.defineProperty(f,"v",{value:!0}),f.ExceptionEndpoint=void 0,n(187)),n=(f.ExceptionEndpoint="https://statsigapi.net/v1/sdk_exception",e.prototype.p=function(t){this.g=t},e.prototype.m=function(t,n){this.S(t,n,function(){})},e.prototype.S=function(n,t,i,e){var r=this;try{var u=t();return u instanceof Promise?u.catch(function(t){return r._(n,t,i,e)}):u}catch(t){return this._(n,t,i,e)}},e.prototype.O=function(o,s,c){var t=this;if(!this.T.disableAllLogging)try{i(t,void 0,void 0,function(){var n,i,e,r,u;return h(this,function(t){switch(t.label){case 0:return"function"!=typeof c?[3,2]:[4,c()];case 1:return i=t.sent(),[3,3];case 2:i=null,t.label=3;case 3:return(n=i,u=null!=s?s:Error("[Statsig] Error was empty"),e=u instanceof Error,r=e?u.name:"No Name",this.j.has(r))?[2]:(this.j.add(r),e=e?u.stack:this.D(u),u=null!=(u=this.g)?u:{},r=JSON.stringify({tag:o,exception:r,info:e,statsigMetadata:u,extra:null!=n?n:{}}),[2,fetch(f.ExceptionEndpoint,{method:"POST",headers:{"STATSIG-API-KEY":this.I,"STATSIG-SDK-TYPE":String(u.sdkType),"STATSIG-SDK-VERSION":String(u.sdkVersion),"Content-Type":"application/json","Content-Length":"".concat(r.length)},body:r})])}})}).then(function(){}).catch(function(){})}catch(t){}},e.prototype._=function(t,n,i,e){if(n instanceof r.StatsigUninitializedError||n instanceof r.StatsigInvalidArgumentError)throw n;return console.error("[Statsig] An unexpected exception occurred.",n),this.O(t,n,e),i()},e.prototype.D=function(t){try{return JSON.stringify(t)}catch(t){return"[Statsig] Failed to get string for error."}},e);function e(t,n){this.j=new Set,this.I=t,this.T=n}f.default=n},187:function(t,n){var e,i,r,u=this&&this.__extends||(e=function(t,n){return(e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,n){t.__proto__=n}:function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}))(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}),o=(Object.defineProperty(n,"v",{value:!0}),n.StatsigSDKKeyMismatchError=n.StatsigInvalidArgumentError=n.StatsigUninitializedError=n.StatsigErrorMessage=void 0,(o=i=n.StatsigErrorMessage||(n.StatsigErrorMessage={})).REQUIRE_ASYNC_INITIALIZE="Call initialize() first.",o.REQUIRE_SYNC_INITIALIZE="Call and wait for initialize() to finish first.",o.REQUIRE_INITIALIZE_FOR_LOG_EVENT="Must initialize() before logging events.",r=Error,u(s,r),s);function s(t){t=r.call(this,null!=t?t:i.REQUIRE_SYNC_INITIALIZE)||this;return Object.setPrototypeOf(t,s.prototype),t}n.StatsigUninitializedError=o;c=Error,u(f,c);var c,o=f;function f(t){t=c.call(this,t)||this;return Object.setPrototypeOf(t,f.prototype),t}n.StatsigInvalidArgumentError=o;h=Error,u(a,h);var h,o=a;function a(t){t=h.call(this,t)||this;return Object.setPrototypeOf(t,a.prototype),t}n.StatsigSDKKeyMismatchError=o},857:(t,n)=>{function f(t,n,i,e,r,u,o,s,c){void 0===u&&(u=[]),void 0===o&&(o=[]),void 0===s&&(s=""),void 0===c&&(c=[]),this.M=r=void 0===r?null:r,this.i=t,this.N=JSON.parse(JSON.stringify(null!=n?n:{})),this.u=null!=i?i:"",this.l=e,this.o=u,this.P=o,this.h=s,this.A=c}Object.defineProperty(n,"v",{value:!0}),f.G=function(t,n,i,e,r,u,o,s,c){return new f(t,n,i,e,r=void 0===r?null:r,u=void 0===u?[]:u,o=void 0===o?[]:o,s=void 0===s?"":s,c=void 0===c?[]:c)},f.prototype.get=function(t,n,i){var e,r=this,u=this.N[t];return null==u?n:(e=function(){return r.k(t),u},i?i(u)?e():n:null==n||typeof u==typeof n&&Array.isArray(n)===Array.isArray(u)?e():n)},f.prototype.getValue=function(t,n){null==n&&(n=null);var i=this.N[t];return null!=i&&this.k(t),null!=i?i:n},f.prototype.k=function(t){var n;null!=(n=this.M)&&n.call(this,this,t)},n.default=f},766:function(t,n,i){var e=this&&this.__importDefault||function(t){return t&&t.v?t:{default:t}},r=(Object.defineProperty(n,"v",{value:!0}),n.saveOverridesToLocalStorage=n.loadOverridesFromLocalStorage=n.makeEmptyOverrides=n.STORAGE_KEY=void 0,e(i(682)));function u(){return{gates:{},configs:{},layers:{}}}n.STORAGE_KEY="STATSIG_JS_LITE_LOCAL_OVERRIDES",n.makeEmptyOverrides=u,n.loadOverridesFromLocalStorage=function(){var t=r.default.getItem(n.STORAGE_KEY);if(t)try{return JSON.parse(t)}catch(t){}return u()},n.saveOverridesToLocalStorage=function(t){r.default.setItem(n.STORAGE_KEY,JSON.stringify(t))}},820:function(t,n){var s=this&&this.__assign||function(){return(s=Object.assign||function(t){for(var n,i=1,e=arguments.length;i<e;i++)for(var r in n=arguments[i])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}).apply(this,arguments)};Object.defineProperty(n,"v",{value:!0}),n.default=function(t,n,i,e,r,u){void 0===e&&(e=null),void 0===r&&(r=null);var o=n;return null!=o&&o.privateAttributes&&delete(o=s({},n)).privateAttributes,{time:Date.now(),eventName:t,statsigMetadata:i,user:o,value:e,metadata:r,secondaryExposures:u}}},888:(t,n)=>{Object.defineProperty(n,"v",{value:!0}),n.version=void 0,n.version="1.3.1"},793:function(t,n,i){var e=this&&this.__assign||function(){return(e=Object.assign||function(t){for(var n,i=1,e=arguments.length;i<e;i++)for(var r in n=arguments[i])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}).apply(this,arguments)},r=this&&this.__createBinding||(Object.create?function(t,n,i,e){void 0===e&&(e=i);var r=Object.getOwnPropertyDescriptor(n,i);r&&("get"in r?n.v:!r.writable&&!r.configurable)||(r={enumerable:!0,get:function(){return n[i]}}),Object.defineProperty(t,e,r)}:function(t,n,i,e){t[e=void 0===e?i:e]=n[i]}),u=this&&this.__setModuleDefault||(Object.create?function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}:function(t,n){t.default=n}),o=this&&this.__importStar||function(t){if(t&&t.v)return t;var n={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&r(n,t,i);return u(n,t),n},s=this&&this.__awaiter||function(t,o,s,c){return new(s=s||Promise)(function(i,n){function e(t){try{u(c.next(t))}catch(t){n(t)}}function r(t){try{u(c.throw(t))}catch(t){n(t)}}function u(t){var n;t.done?i(t.value):((n=t.value)instanceof s?n:new s(function(t){t(n)})).then(e,r)}u((c=c.apply(t,o||[])).next())})},c=this&&this.__generator||function(e,r){var u,o,s,c={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},f={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(f[Symbol.iterator]=function(){return this}),f;function t(i){return function(t){var n=[i,t];if(u)throw new TypeError("Generator is already executing.");for(;c=f&&n[f=0]?0:c;)try{if(u=1,o&&(s=2&n[0]?o.return:n[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,n[1])).done)return s;switch(o=0,(n=s?[2&n[0],s.value]:n)[0]){case 0:case 1:s=n;break;case 4:return c.label++,{value:n[1],done:!1};case 5:c.label++,o=n[1],n=[0];continue;case 7:n=c.ops.pop(),c.trys.pop();continue;default:if(!(s=0<(s=c.trys).length&&s[s.length-1])&&(6===n[0]||2===n[0])){c=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3]))c.label=n[1];else if(6===n[0]&&c.label<s[1])c.label=s[1],s=n;else{if(!(s&&c.label<s[2])){s[2]&&c.ops.pop(),c.trys.pop();continue}c.label=s[2],c.ops.push(n)}}n=r.call(e,c)}catch(t){n=[6,t],o=0}finally{u=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}}},f=this&&this.__importDefault||function(t){return t&&t.v?t:{default:t}},h=(Object.defineProperty(n,"v",{value:!0}),f(i(825))),a=f(i(742)),l=i(187),v=f(i(857)),d=f(i(578)),y=f(i(332)),w=f(i(69)),p=f(i(574)),g=o(i(567)),m=i(645),b=f(i(682)),S=i(28),_=f(i(820)),O=i(766);function T(t,n,i){var o=this;if(this.J=!1,this.L=null,this.I=null,this.C=function(t,n,i){void 0===i&&(i=!1);var e="",r=t.P,u=t.A.includes(n);u&&(e=t.h,r=t.o),o.R.logLayerExposure(o.V.K,t.i,t.u,r,e,n,u,t.l,i)},!0!==(null==i?void 0:i.localMode)&&("string"!=typeof t||!t.startsWith("client-")))throw new l.StatsigInvalidArgumentError("Invalid key provided. You must use a Client SDK Key from the Statsig console to initialize the sdk");this.I=t,this.q=(0,S.now)(),this.T=new p.default(i),this.U=new a.default(t,this.T),this.Y=!1,b.default.disabled=this.T.disableLocalStorage,this.F=(0,O.loadOverridesFromLocalStorage)(),this.V=new d.default(t,this.W(null!=n?n:null),this.T.overrideStableID),this.B=new w.default(this.T,this.V,this.U),this.R=new y.default(this.T,this.V,this.B,this.U),this.H=new g.default(this.V,this.R.logConfigDefaultValueFallback,this.T.initializeValues),this.U.p(this.V.g),null!=this.T.initializeValues&&(this.Y=!0,this.J=!0,setTimeout(function(){return o.X()},20))}T.prototype.setInitializeValues=function(t){var n=this;this.U.S("setInitializeValues",function(){n.H.bootstrap(t),n.Y||(n.Y=!0,n.J=!0),n.R.sendSavedRequests()},function(){n.Y=!0,n.J=!0})},T.prototype.initializeAsync=function(){return s(this,void 0,void 0,function(){var n=this;return c(this,function(t){return[2,this.U.S("initializeAsync",function(){return s(n,void 0,void 0,function(){var n,i=this;return c(this,function(t){if(null==this.L){if(this.Y)return[2,Promise.resolve()];if(this.J=!0,this.T.localMode)return[2,Promise.resolve()];n=this.V.K,this.L=this.Z(n,this.T.initTimeoutMs).then(function(){}).catch(function(t){return i.U.O("initializeAsync:fetchAndSaveValues",t),{success:!1,message:t.message}}).then(function(){}).finally(function(){return s(i,void 0,void 0,function(){return c(this,function(t){return this.L=null,this.Y=!0,this.X(),[2]})})})}return[2,this.L]})})},function(){return n.Y=!0,n.J=!0,Promise.resolve()})]})})},T.prototype.getEvaluationDetails=function(){var t=this;return this.U.S("getEvaluationDetails",function(){return t.H.getGlobalEvaluationDetails()},function(){return{time:Date.now(),reason:g.EvaluationReason.Error}})},T.prototype.checkGate=function(t){return this.$(t,"checkGate")},T.prototype.checkGateWithExposureLoggingDisabled=function(t){return this.$(t,"checkGateWithExposureLoggingDisabled")},T.prototype.logGateExposure=function(t){var n=this;this.U.m("logGateExposure",function(){n.tt(t)})},T.prototype.getConfig=function(t){return this.nt(t,"getConfig")},T.prototype.getConfigWithExposureLoggingDisabled=function(t){return this.nt(t,"getConfigWithExposureLoggingDisabled")},T.prototype.logConfigExposure=function(t){var n=this;this.U.m("logConfigExposure",function(){n.it(t)})},T.prototype.getExperiment=function(t){return this.getConfig(t)},T.prototype.getExperimentWithExposureLoggingDisabled=function(t){return this.getConfigWithExposureLoggingDisabled(t)},T.prototype.logExperimentExposure=function(t){this.logConfigExposure(t)},T.prototype.getLayer=function(t){return this.et(t,"getLayer")},T.prototype.getLayerWithExposureLoggingDisabled=function(t){return this.et(t,"getLayerWithExposureLoggingDisabled")},T.prototype.logLayerParameterExposure=function(n,i){var e=this;this.U.m("logLayerParameterExposure",function(){var t=e.rt(null,n);e.C(t,i,!0)})},T.prototype.logEvent=function(n,i,e){var r=this;void 0===i&&(i=null),void 0===e&&(e=null),this.U.m("logEvent",function(){if(!r.R||!r.V.I)throw new l.StatsigUninitializedError(l.StatsigErrorMessage.REQUIRE_INITIALIZE_FOR_LOG_EVENT);var t;"string"==typeof n&&0!==n.length&&(t=(0,_.default)(n,r.V.K,r.V.g,i,e),r.R.log(t))})},T.prototype.updateUserWithValues=function(t,n){var i,e=this,r=Date.now();return this.U.S("updateUserWithValues",function(){if(e.initializeCalled())return i=function(t,n){var i=e.T.updateUserCompletionCallback;null!=i&&i(Date.now()-r,t,n)},e.V.K=e.W(t),e.H.bootstrap(n),e.R.resetDedupeKeys(),i(!0,null),!0;throw new l.StatsigUninitializedError(l.StatsigErrorMessage.REQUIRE_ASYNC_INITIALIZE)},function(){return null!=i&&i(!1,"Failed to update user. An unexpected error occured."),!1})},T.prototype.updateUser=function(u){return s(this,void 0,void 0,function(){var r,i,n=this;return c(this,function(t){return r=Date.now(),[2,this.U.S("updateUser",function(){return s(n,void 0,void 0,function(){var n,e=this;return c(this,function(t){switch(t.label){case 0:if(this.initializeCalled())return i=function(t,n){var i=e.T.updateUserCompletionCallback;null!=i&&i(Date.now()-r,t,n)},this.V.K=this.W(u),this.H.updateUser(),this.R.resetDedupeKeys(),null==this.L?[3,2]:[4,this.L];throw new l.StatsigUninitializedError(l.StatsigErrorMessage.REQUIRE_ASYNC_INITIALIZE);case 1:t.sent(),t.label=2;case 2:return this.T.localMode?(i(!0,null),[2,Promise.resolve(!0)]):(n=this.V.K,this.L=this.Z(n).finally(function(){e.L=null}),[2,this.L.then(function(){return i(!0,null),Promise.resolve(!0)}).catch(function(t){return i(!1,"Failed to update user: ".concat(t)),Promise.resolve(!1)})])}})})},function(){return i(!1,"Failed to update user. An unexpected error occured."),Promise.resolve(!1)})]})})},T.prototype.shutdown=function(){var t=this;this.U.m("shutdown",function(){t.R.shutdown()})},T.prototype.getStableID=function(){var t=this;return this.U.S("getStableID",function(){return t.V.g.stableID},function(){return""})},T.prototype.initializeCalled=function(){return this.J},T.prototype.overrideGate=function(t,n){this.ut("gates",t,n)},T.prototype.overrideConfig=function(t,n){this.ut("configs",t,n)},T.prototype.overrideLayer=function(t,n){this.ut("layers",t,n)},T.prototype.setOverrides=function(t){var n=this;this.U.m("setOverrides",function(){n.F=null!=t?t:(0,O.makeEmptyOverrides)(),(0,O.saveOverridesToLocalStorage)(n.F)})},T.prototype.getOverrides=function(){var t=this;return this.U.S("getOverrides",function(){return t.F},function(){return(0,O.makeEmptyOverrides)()})},T.prototype.X=function(){var t=this;this.U.m("delayedSetup",function(){t.V.saveStableID(),t.R.sendSavedRequests().then(function(){})})},T.prototype.W=function(t){var n={};try{n=JSON.parse(JSON.stringify(t))}catch(t){throw new l.StatsigInvalidArgumentError("User object must be convertable to JSON string.")}return n=null!=this.T.environment?e(e({},n),{statsigEnvironment:this.T.environment}):n},T.prototype.ot=function(){if(!this.H.isLoaded())throw new l.StatsigUninitializedError},T.prototype.st=function(){return{time:Date.now(),reason:g.EvaluationReason.Error}},T.prototype.Z=function(r,u){return void 0===u&&(u=this.T.initTimeoutMs),s(this,void 0,void 0,function(){var n,i,e=this;return c(this,function(t){return n=this.H.getLastUpdateTime(r),i=this.H.getPreviousDerivedFields(r),[2,this.B.fetchValues(r,n,u,i).eventually(function(t){var n;(0,m.verifySDKKeyUsed)(t,null!=(n=e.I)?n:"",e.U)&&null!=t&&t.has_updates&&e.H.save(r,t,!1)}).then(function(i){return s(e,void 0,void 0,function(){var n=this;return c(this,function(t){return[2,this.U.m("fetchAndSaveValues",function(){return s(n,void 0,void 0,function(){var n;return c(this,function(t){switch(t.label){case 0:return(0,m.verifySDKKeyUsed)(i,null!=(n=this.I)?n:"",this.U)?null!=i&&i.has_updates?[4,this.H.save(r,i)]:[3,2]:[2];case 1:return t.sent(),[3,3];case 2:null!=i&&i.is_no_content&&this.H.setEvaluationReason(g.EvaluationReason.NetworkNotModified),t.label=3;case 3:return[2]}})})})]})})})]})})},T.prototype.$=function(n,i){var e=this;return this.U.S(i,function(){var t;return"boolean"==typeof e.F.gates[n]?e.F.gates[n]:(t=e.ct(n),"checkGate"===i&&e.tt(n,t),!0===t.gate.value)},function(){return!1})},T.prototype.ct=function(t){if(this.ot(),"string"!=typeof t||0===t.length)throw new l.StatsigInvalidArgumentError("Must pass a valid string as the gateName.");return this.H.checkGate(t)},T.prototype.tt=function(t,n){var i=!n,n=null!=n?n:this.ct(t),e=n.gate;this.R.logGateExposure(this.V.K,t,e.value,e.rule_id,e.secondary_exposures,n.evaluationDetails,i)},T.prototype.nt=function(n,i){var e=this;return this.U.S(i,function(){var t;return e.F.configs[n]?new h.default(n,e.F.configs[n],"local_override",{reason:g.EvaluationReason.LocalOverride,time:Date.now()}):(t=e.ft(n),"getConfig"===i&&e.it(n,t),t)},function(){return e.ht(n)})},T.prototype.ft=function(t){if(this.ot(),"string"!=typeof t||0===t.length)throw new l.StatsigInvalidArgumentError("Must pass a valid string as the configName.");return this.H.getConfig(t)},T.prototype.it=function(t,n){var i=!n,n=null!=n?n:this.ft(t);this.R.logConfigExposure(this.V.K,t,n.u,n.o,n.l,i)},T.prototype.et=function(n,i){var e=this;return this.U.S(i,function(){var t;return e.F.layers[n]?v.default.G(n,e.F.layers[n],"local_override",{reason:g.EvaluationReason.LocalOverride,time:Date.now()}):(t="getLayer"===i?e.C:null,e.rt(t,n))},function(){return v.default.G(n,{},"",e.st())})},T.prototype.rt=function(t,n){if(this.ot(),"string"!=typeof n||0===n.length)throw new l.StatsigInvalidArgumentError("Must pass a valid string as the layerName.");return this.H.getLayer(t,n)},T.prototype.ht=function(t){return new h.default(t,{},"",this.st())},T.prototype.ut=function(t,n,i){null==i?delete this.F[t][n]:this.F[t][n]=i,this.setOverrides(this.F)},n.default=T},578:function(t,n,i){var e=this&&this.__importDefault||function(t){return t&&t.v?t:{default:t}},r=(Object.defineProperty(n,"v",{value:!0}),i(652)),u=i(898),o=e(i(682)),s=i(888);function c(t,n,i){this.lt="js-lite",this.I=t,this.K=n,this.vt=s.version;t=null!=(n=null!=(t=i)?t:o.default.getItem(r.STATSIG_STABLE_ID_KEY))?n:this.dt();this.g={stableID:t,sdkType:this.lt,sdkVersion:this.vt}}c.prototype.saveStableID=function(){null!=this.g.stableID&&o.default.setItem(r.STATSIG_STABLE_ID_KEY,this.g.stableID)},c.prototype.getUserCacheKey=function(){return(0,u.getUserCacheKey)(this.K)},c.prototype.dt=function(){for(var t="",n=0;n<32;n++){8!==n&&12!==n&&16!==n&&20!==n||(t+="-");var i=16*Math.random()|0;t+=12===n?"4":(16===n?3&i|8:i).toString(16)}return t},n.default=c},332:function(t,n,i){var u=this&&this.__awaiter||function(t,o,s,c){return new(s=s||Promise)(function(i,n){function e(t){try{u(c.next(t))}catch(t){n(t)}}function r(t){try{u(c.throw(t))}catch(t){n(t)}}function u(t){var n;t.done?i(t.value):((n=t.value)instanceof s?n:new s(function(t){t(n)})).then(e,r)}u((c=c.apply(t,o||[])).next())})},h=this&&this.__generator||function(e,r){var u,o,s,c={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},f={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(f[Symbol.iterator]=function(){return this}),f;function t(i){return function(t){var n=[i,t];if(u)throw new TypeError("Generator is already executing.");for(;c=f&&n[f=0]?0:c;)try{if(u=1,o&&(s=2&n[0]?o.return:n[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,n[1])).done)return s;switch(o=0,(n=s?[2&n[0],s.value]:n)[0]){case 0:case 1:s=n;break;case 4:return c.label++,{value:n[1],done:!1};case 5:c.label++,o=n[1],n=[0];continue;case 7:n=c.ops.pop(),c.trys.pop();continue;default:if(!(s=0<(s=c.trys).length&&s[s.length-1])&&(6===n[0]||2===n[0])){c=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3]))c.label=n[1];else if(6===n[0]&&c.label<s[1])c.label=s[1],s=n;else{if(!(s&&c.label<s[2])){s[2]&&c.ops.pop(),c.trys.pop();continue}c.label=s[2],c.ops.push(n)}}n=r.call(e,c)}catch(t){n=[6,t],o=0}finally{u=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}}},e=this&&this.__importDefault||function(t){return t&&t.v?t:{default:t}},a=(Object.defineProperty(n,"v",{value:!0}),e(i(820))),l=i(69),v=i(652),d=e(i(682)),e="statsig::",o=e+"log_event_failed";function r(t,n,i,e){var r=this;this.yt=0,this.logConfigDefaultValueFallback=function(t,n,i){t=(0,a.default)("statsig::default_value_type_mismatch",t,r.V.g,n,i);r.log(t),r.wt.add(n)},this.T=t,this.V=n,this.B=i,this.U=e,this.gt=[],this.bt=null,this.wt=new Set,this.St=[],this._t={},this.yt=0,this.Ot()}r.prototype.log=function(t){if(!this.T.disableAllLogging){try{var n;this.T.disableCurrentPageLogging||"undefined"==typeof window||null==window||"object"!=typeof window.location||"string"!=typeof window.location.href||0<(null==(n=window.location.href.split(/[?#]/))?void 0:n.length)&&(t.statsigMetadata.currentPage=n[0])}catch(t){}this.gt.push(t),this.gt.length>=this.T.loggingBufferMaxSize&&this.flush()}},r.prototype.resetDedupeKeys=function(){this._t={}},r.prototype.logGateExposure=function(t,n,i,e,r,u,o){var s=n+String(i)+e+u.reason;this.Tt(s)&&(s={gate:n,gateValue:String(i),ruleID:e,reason:u.reason,time:u.time},o&&(s.isManualExposure="true"),n=(0,a.default)("statsig::gate_exposure",t,this.V.g,null,s,r),this.log(n))},r.prototype.logConfigExposure=function(t,n,i,e,r,u){var o=n+i+r.reason;this.Tt(o)&&(o={config:n,ruleID:i,reason:r.reason,time:r.time},u&&(o.isManualExposure="true"),n=(0,a.default)("statsig::config_exposure",t,this.V.g,null,o,e),this.log(n))},r.prototype.logLayerExposure=function(t,n,i,e,r,u,o,s,c){var f=[n,i,r,u,String(o),s.reason].join("|");this.Tt(f)&&(f={config:n,ruleID:i,allocatedExperiment:r,parameterName:u,isExplicitParameter:String(o),reason:s.reason,time:s.time},c&&(f.isManualExposure="true"),n=(0,a.default)("statsig::layer_exposure",t,this.V.g,null,f,e),this.log(n))},r.prototype.shutdown=function(){this.bt&&(clearInterval(this.bt),this.bt=null),this.flush(!0)},r.prototype.flush=function(n){var i,e,r,t=this;void 0===n&&(n=!1),0!==this.gt.length&&(i=this.V.g,e=this.gt,this.gt=[],n&&!this.B.supportsKeepalive()&&"undefined"!=typeof navigator&&null!=navigator&&navigator.sendBeacon?this.B.sendLogBeacon({events:e,statsigMetadata:i})||(this.gt=e.concat(this.gt),0<this.gt.length&&(this.jt({events:this.gt,statsigMetadata:i,time:Date.now()}),this.gt=[]),this.Et()):(r=this).B.postToEndpoint(l.StatsigEndpoint.Rgstr,{events:e,statsigMetadata:i},3,1e3,n).then(function(t){if(!t.ok)throw t}).catch(function(i){"function"==typeof i.text?i.text().then(function(n){t.U.O(o,i,function(){return u(t,void 0,void 0,function(){return h(this,function(t){return[2,{eventCount:e.length,error:n}]})})})}):t.U.O(o,i,function(){return u(t,void 0,void 0,function(){return h(this,function(t){return[2,{eventCount:e.length,error:i.message}]})})}),r.Dt(o,e)}).finally(function(){return u(t,void 0,void 0,function(){return h(this,function(t){switch(t.label){case 0:return n?(0<this.gt.length&&(this.jt({events:this.gt,statsigMetadata:i,time:Date.now()}),this.gt=[]),[4,r.Et()]):[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})}))},r.prototype.sendSavedRequests=function(){return u(this,void 0,void 0,function(){var n,i,e,r,u,o,s,c,f=this;return h(this,function(t){if(i=!1,null==(n=d.default.getItem(v.STATSIG_LOCAL_STORAGE_LOGGING_REQUEST_KEY)))this.xt();else{1024e3<n.length&&(i=!0),0;try{for(e=JSON.parse(n),r=function(n){null!=n&&n.events&&Array.isArray(n.events)&&u.B.postToEndpoint(l.StatsigEndpoint.Rgstr,n).then(function(t){if(!t.ok)throw Error(t.status+"")}).catch(function(t){i||f.jt(n)})},u=this,o=0,s=e;o<s.length;o++)c=s[o],r(c)}catch(t){}finally{this.xt()}}return[2]})})},r.prototype.Ot=function(){var t,n=this;"undefined"!=typeof window&&"function"==typeof window.addEventListener&&(window.addEventListener("blur",function(){return n.flush(!0)}),window.addEventListener("beforeunload",function(){return n.flush(!0)}),window.addEventListener("load",function(){setTimeout(function(){return n.flush()},100),setTimeout(function(){return n.flush()},1e3)})),"undefined"!=typeof document&&"function"==typeof document.addEventListener&&document.addEventListener("visibilitychange",function(){n.flush("visible"!==document.visibilityState)}),(this.T.ignoreWindowUndefined||"undefined"!=typeof window&&null!=window)&&!this.T.localMode&&((t=this).bt=setInterval(function(){t.flush()},this.T.loggingIntervalMillis),setTimeout(function(){return n.flush()},100),setTimeout(function(){return n.flush()},1e3))},r.prototype.Tt=function(t){var n=this._t[t],i=Date.now();if(null!=n&&i-6e5<=n)return!1;return this._t[t]=i,!0},r.prototype.Et=function(){return u(this,void 0,void 0,function(){var n;return h(this,function(t){if(0<this.St.length){if(1024e3<(n=JSON.stringify(this.St)).length)return this.xt(),[2];d.default.setItem(v.STATSIG_LOCAL_STORAGE_LOGGING_REQUEST_KEY,n)}return[2]})})},r.prototype.jt=function(t){var n;t.time<Date.now()-432e6||100<this.St.length||(n=t.events.length,1e3<this.yt+n)||(this.St.push(t),this.yt+=n)},r.prototype.xt=function(){d.default.removeItem(v.STATSIG_LOCAL_STORAGE_LOGGING_REQUEST_KEY)},r.prototype.Dt=function(t,n){this.wt.has(t)||(this.wt.add(t),this.St.push({events:n,statsigMetadata:this.V.g,time:Date.now()}),this.Et().then(function(){}))},n.default=r},69:function(t,n){var h,i,l=this&&this.__awaiter||function(t,o,s,c){return new(s=s||Promise)(function(i,n){function e(t){try{u(c.next(t))}catch(t){n(t)}}function r(t){try{u(c.throw(t))}catch(t){n(t)}}function u(t){var n;t.done?i(t.value):((n=t.value)instanceof s?n:new s(function(t){t(n)})).then(e,r)}u((c=c.apply(t,o||[])).next())})},v=this&&this.__generator||function(e,r){var u,o,s,c={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},f={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(f[Symbol.iterator]=function(){return this}),f;function t(i){return function(t){var n=[i,t];if(u)throw new TypeError("Generator is already executing.");for(;c=f&&n[f=0]?0:c;)try{if(u=1,o&&(s=2&n[0]?o.return:n[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,n[1])).done)return s;switch(o=0,(n=s?[2&n[0],s.value]:n)[0]){case 0:case 1:s=n;break;case 4:return c.label++,{value:n[1],done:!1};case 5:c.label++,o=n[1],n=[0];continue;case 7:n=c.ops.pop(),c.trys.pop();continue;default:if(!(s=0<(s=c.trys).length&&s[s.length-1])&&(6===n[0]||2===n[0])){c=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3]))c.label=n[1];else if(6===n[0]&&c.label<s[1])c.label=s[1],s=n;else{if(!(s&&c.label<s[2])){s[2]&&c.ops.pop(),c.trys.pop();continue}c.label=s[2],c.ops.push(n)}}n=r.call(e,c)}catch(t){n=[6,t],o=0}finally{u=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}}};Object.defineProperty(n,"v",{value:!0}),n.StatsigEndpoint=void 0,(i=h=n.StatsigEndpoint||(n.StatsigEndpoint={})).Initialize="initialize",i.Rgstr="rgstr",i.LogEventBeacon="log_event_beacon";function e(t,n,i){this.retryCodes={408:!0,500:!0,502:!0,503:!0,504:!0,522:!0,524:!0,599:!0},this.canUseKeepalive=!1,this.T=t,this.V=n,this.U=i,this.leakyBucket={},this.Ot()}e.prototype.fetchValues=function(t,n,i,e){t={user:t,statsigMetadata:this.V.g,sinceTime:null!=n?n:void 0,hash:"djb2",previousDerivedFields:e};return this.It(h.Initialize,t,i,3)},e.prototype.sendLogBeacon=function(t){if(this.T.localMode)return!0;var n=new URL(this.T.eventLoggingApi+h.LogEventBeacon),i=(n.searchParams.append("k",this.V.I),t.clientTime=Date.now()+"",null);try{i=JSON.stringify(t)}catch(t){return!1}return navigator.sendBeacon(n.toString(),i)},e.prototype.postToEndpoint=function(u,o,s,c,f){return void 0===s&&(s=0),void 0===c&&(c=1e3),void 0===f&&(f=!1),l(this,void 0,void 0,function(){var i,n,e,r=this;return v(this,function(t){return this.T.localMode?[2,Promise.reject("no network requests in localMode")]:"function"!=typeof fetch?[2,Promise.reject("fetch is not defined")]:"undefined"!=typeof window||this.T.ignoreWindowUndefined?(e=[h.Initialize].includes(u)?this.T.api:this.T.eventLoggingApi,i=e+u,null!=(e=this.leakyBucket[i])&&30<=e?[2,Promise.reject(new Error("Request failed because you are making the same request too frequently."))]:(this.leakyBucket[i]=null==e?1:e+1,e=JSON.stringify(o),n=this.V.g,e={method:"POST",body:e,headers:{"Content-type":"application/json; charset=UTF-8","STATSIG-API-KEY":this.V.I,"STATSIG-CLIENT-TIME":Date.now()+"","STATSIG-SDK-TYPE":n.sdkType,"STATSIG-SDK-VERSION":n.sdkVersion}},this.canUseKeepalive&&f&&(e.keepalive=!0),[2,fetch(i,e).then(function(e){return l(r,void 0,void 0,function(){var n,i;return v(this,function(t){switch(t.label){case 0:return e.ok?204!==(n=e).status?[3,1]:(n.data={has_updates:!1,is_no_content:!0},[3,3]):[3,4];case 1:return[4,e.text()];case 2:i=t.sent(),n.data=JSON.parse(i),t.label=3;case 3:return[2,Promise.resolve(n)];case 4:return this.retryCodes[e.status]||(s=0),[4,e.text()];case 5:return i=t.sent(),[2,Promise.reject(new Error("".concat(e.status,": ").concat(i)))]}})})}).catch(function(t){return 0<s?new Promise(function(t,n){setTimeout(function(){r.leakyBucket[i]=Math.max(r.leakyBucket[i]-1,0),r.postToEndpoint(u,o,s-1,2*c,f).then(t).catch(n)},c)}):Promise.reject(t)}).finally(function(){r.leakyBucket[i]=Math.max(r.leakyBucket[i]-1,0)})])):[2,Promise.reject("window is not defined")]})})},e.prototype.supportsKeepalive=function(){return this.canUseKeepalive},e.prototype.Ot=function(){if(!this.T.disableNetworkKeepalive)try{this.canUseKeepalive="keepalive"in new Request("")}catch(t){}},e.prototype.It=function(e,r,i,u,o){var n,s=this,c=(void 0===u&&(u=0),void 0===o&&(o=1e3),!1),t=null,f=null,h=[],a=(0!=(i=void 0===i?0:i)&&(t=new Promise(function(t,n){setTimeout(function(){c=!0,n(new Error("The initialization timeout of ".concat(i,"ms has been hit before the network request has completed.")))},i)})),this.postToEndpoint(e,r,u,o).then(function(n){var t,i;return n.ok?"object"!=typeof n.data?(t=new Error("Request to ".concat(e," received invalid response type. Expected 'object' but got '").concat(typeof n.data,"'")),s.U.O("postWithTimeoutInvalidRes",t,function(){return l(s,void 0,void 0,function(){return v(this,function(t){return[2,this.Mt(e,r,u,o,n)]})})}),Promise.reject(t)):(i=n.data,s.U.S("postWithTimeout",function(){return l(s,void 0,void 0,function(){return v(this,function(t){return f=i,c&&(h.forEach(function(t){return t(i)}),h=[]),[2,Promise.resolve(i)]})})},function(){return Promise.resolve({})},function(){return l(s,void 0,void 0,function(){return v(this,function(t){return[2,this.Mt(e,r,u,o,n)]})})})):Promise.reject(new Error("Request to ".concat(e," failed with status ").concat(n.status)))}).catch(function(t){return Promise.reject(t)})),t=t?Promise.race([a,t]):a;return t.eventually=(n=t,function(t){return c&&f?t(f):h.push(t),n}),t},e.prototype.Mt=function(n,e,r,u,o){var s;return l(this,void 0,void 0,function(){var i;return v(this,function(t){try{return i={},(null!=(s=o.headers)?s:[]).forEach(function(t,n){i[n]=t}),[2,{responseInfo:{headers:i,status:o.status,statusText:o.statusText,type:o.type,url:o.url,redirected:o.redirected,bodySnippet:o.data?JSON.stringify(o.data).slice(0,500):null},requestInfo:{endpointName:n,bodySnippet:JSON.stringify(e).slice(0,500),retries:r,backoff:u}}]}catch(t){return[2,{statusText:"statsig::failed to extract extra data"}]}return[2]})})},n.default=e},574:(t,i)=>{Object.defineProperty(i,"v",{value:!0}),i.INIT_TIMEOUT_DEFAULT_MS=void 0;i.INIT_TIMEOUT_DEFAULT_MS=3e3,e.prototype.normalizeNumberInput=function(t,n){return null==t?n.default:Math.max(Math.min(t,n.max),n.min)};var n=e;function e(t){var n=null!=(n=(t=null==t?{}:t).api)?n:"https://featuregates.org/v1/",n=(this.api=n.endsWith("/")?n:n+"/",this.disableCurrentPageLogging=null!=(n=t.disableCurrentPageLogging)&&n,this.environment=null!=(n=t.environment)?n:null,this.loggingIntervalMillis=this.normalizeNumberInput(t.loggingIntervalMillis,{default:1e4,min:1e3,max:6e4}),this.loggingBufferMaxSize=this.normalizeNumberInput(t.loggingBufferMaxSize,{default:100,min:2,max:500}),this.disableNetworkKeepalive=null!=(n=t.disableNetworkKeepalive)&&n,this.overrideStableID=null!=(n=t.overrideStableID)?n:null,this.localMode=null!=(n=t.localMode)&&n,this.initTimeoutMs=t.initTimeoutMs&&0<=t.initTimeoutMs?t.initTimeoutMs:i.INIT_TIMEOUT_DEFAULT_MS,this.disableErrorLogging=null!=(n=t.disableErrorLogging)&&n,this.disableAutoMetricsLogging=null!=(n=t.disableAutoMetricsLogging)&&n,this.initializeValues=null!=(n=t.initializeValues)?n:null,null!=(n=null!=(n=t.eventLoggingApi)?n:t.api)?n:"https://events.statsigapi.net/v1/");this.eventLoggingApi=n.endsWith("/")?n:n+"/",this.disableLocalStorage=null!=(n=t.disableLocalStorage)&&n,this.ignoreWindowUndefined=null!=(n=null==t?void 0:t.ignoreWindowUndefined)&&n,this.updateUserCompletionCallback=null!=(n=null==t?void 0:t.updateUserCompletionCallback)?n:null,this.disableAllLogging=null!=(n=null==t?void 0:t.disableAllLogging)&&n}i.default=n},567:function(t,n,i){var o,s=this&&this.__awaiter||function(t,o,s,c){return new(s=s||Promise)(function(i,n){function e(t){try{u(c.next(t))}catch(t){n(t)}}function r(t){try{u(c.throw(t))}catch(t){n(t)}}function u(t){var n;t.done?i(t.value):((n=t.value)instanceof s?n:new s(function(t){t(n)})).then(e,r)}u((c=c.apply(t,o||[])).next())})},c=this&&this.__generator||function(e,r){var u,o,s,c={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},f={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(f[Symbol.iterator]=function(){return this}),f;function t(i){return function(t){var n=[i,t];if(u)throw new TypeError("Generator is already executing.");for(;c=f&&n[f=0]?0:c;)try{if(u=1,o&&(s=2&n[0]?o.return:n[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,n[1])).done)return s;switch(o=0,(n=s?[2&n[0],s.value]:n)[0]){case 0:case 1:s=n;break;case 4:return c.label++,{value:n[1],done:!1};case 5:c.label++,o=n[1],n=[0];continue;case 7:n=c.ops.pop(),c.trys.pop();continue;default:if(!(s=0<(s=c.trys).length&&s[s.length-1])&&(6===n[0]||2===n[0])){c=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3]))c.label=n[1];else if(6===n[0]&&c.label<s[1])c.label=s[1],s=n;else{if(!(s&&c.label<s[2])){s[2]&&c.ops.pop(),c.trys.pop();continue}c.label=s[2],c.ops.push(n)}}n=r.call(e,c)}catch(t){n=[6,t],o=0}finally{u=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}}},e=this&&this.__importDefault||function(t){return t&&t.v?t:{default:t}},r=(Object.defineProperty(n,"v",{value:!0}),n.EvaluationReason=void 0,e(i(825))),u=e(i(857)),f=e(i(477)),h=i(652),a=i(898),l=e(i(682));(e=o=n.EvaluationReason||(n.EvaluationReason={})).Network="Network",e.Bootstrap="Bootstrap",e.InvalidBootstrap="InvalidBootstrap",e.Cache="Cache",e.Unrecognized="Unrecognized",e.Uninitialized="Uninitialized",e.Error="Error",e.NetworkNotModified="NetworkNotModified",e.LocalOverride="LocalOverride";function v(t,n,i){this.V=t,this.t=n,this.Nt=this.V.getUserCacheKey(),this.Pt={},this.At=this.Gt(),this.kt=!1,this.Jt=o.Uninitialized,i?this.bootstrap(i):this.Lt()}v.prototype.updateUser=function(){return this.Nt=this.V.getUserCacheKey(),this.Ct()},v.prototype.bootstrap=function(t){var n,i,e,r=this.V.getUserCacheKey(),u=this.V.K,u=f.default.isValid(u,t)?o.Bootstrap:o.InvalidBootstrap;this.kt=!0;try{this.At.feature_gates=null!=(n=t.feature_gates)?n:{},this.At.dynamic_configs=null!=(i=t.dynamic_configs)?i:{},this.At.layer_configs=null!=(e=t.layer_configs)?e:{},this.At.evaluation_time=Date.now(),this.At.time=Date.now(),this.Pt[r]=this.At,this.Jt=u}catch(t){}},v.prototype.isLoaded=function(){return this.kt},v.prototype.getLastUpdateTime=function(t){t=(0,a.djb2HashForObject)(t);return this.At.user_hash==t?this.At.time:null},v.prototype.getPreviousDerivedFields=function(t){t=(0,a.djb2HashForObject)(t);if(this.At.user_hash==t)return this.At.derived_fields},v.prototype.setEvaluationReason=function(t){this.Jt=t},v.prototype.save=function(e,r,u){return void 0===u&&(u=!0),s(this,void 0,void 0,function(){var n,i;return c(this,function(t){switch(t.label){case 0:return i=(0,a.getUserCacheKey)(e),this.Rt(r,this.Pt,i,e,function(t){return t}),u&&(n=this.Pt[i])&&i&&i==this.Nt&&(this.At=n,this.Jt=o.Network),[4,(i=this).Kt(this.Pt)];case 1:return i.Pt=t.sent(),[2]}})})},v.prototype.checkGate=function(t){var n=(0,a.getHashValue)(t,this.At.hash_used),t={name:t,value:!1,rule_id:"",secondary_exposures:[]},i=null==(i=this.At)?void 0:i.feature_gates[n];return i&&(t=i),{evaluationDetails:this.Vt(null!=i),gate:t}},v.prototype.getConfig=function(t){var n,i,e=(0,a.getHashValue)(t,this.At.hash_used);return null!=(null==(n=this.At)?void 0:n.dynamic_configs[e])?(n=null==(n=this.At)?void 0:n.dynamic_configs[e],i=this.Vt(!0),this.zt(t,n,i)):(i=this.Vt(!1),new r.default(t,{},"",i))},v.prototype.getLayer=function(t,n){var i=this.qt(n,"layer_configs"),e=this.Vt(null!=i);return u.default.G(n,null!=(n=null==i?void 0:i.value)?n:{},null!=(n=null==i?void 0:i.rule_id)?n:"",e,t,null==i?void 0:i.secondary_exposures,null==i?void 0:i.undelegated_secondary_exposures,null!=(n=null==i?void 0:i.allocated_experiment_name)?n:"",null==i?void 0:i.explicit_parameters)},v.prototype.getGlobalEvaluationDetails=function(){var t;return{reason:null!=(t=this.Jt)?t:o.Uninitialized,time:null!=(t=this.At.evaluation_time)?t:0}},v.prototype.Lt=function(){this.Ut(l.default.getItem(h.INTERNAL_STORE_KEY)),this.kt=!0},v.prototype.Ut=function(t){try{this.Pt=t?JSON.parse(t):this.Pt,this.Ct()}catch(t){this.Yt(h.INTERNAL_STORE_KEY)}},v.prototype.Ct=function(){var t=this.Pt[this.Nt];return null==t?(this.Ft(),this.Jt=o.Uninitialized,null):(this.At=t,this.Jt=o.Cache,null!=(t=t.evaluation_time)?t:0)},v.prototype.Yt=function(t){l.default.removeItem(t)},v.prototype.Rt=function(t,n,i,e,r){var u;i&&(u=this.Wt(t,i),t.has_updates&&t.time&&(t=(0,a.djb2HashForObject)(e),u.user_hash=t),n[i]=r(u,i))},v.prototype.Gt=function(){return{feature_gates:{},layer_configs:{},dynamic_configs:{},time:0,evaluation_time:0,has_updates:!1}},v.prototype.Kt=function(i){return s(this,void 0,void 0,function(){var n;return c(this,function(t){return n=Object.entries(i).sort(function(t,n){var i,t=t[1],n=n[1];return null==t?1:null==n?-1:(null!=(i=null==n?void 0:n.evaluation_time)?i:null==n?void 0:n.time)-(null!=(i=null==t?void 0:t.evaluation_time)?i:null==t?void 0:t.time)}).slice(0,10),i=Object.fromEntries(n),l.default.setItem(h.INTERNAL_STORE_KEY,JSON.stringify(i)),[2,i]})})},v.prototype.qt=function(t,n){var i,e=(0,a.getHashValue)(t,this.At.hash_used);return null!=(i=null==(i=null==(i=this.At)?void 0:i[n])?void 0:i[e])?i:null==(i=null==(e=this.At)?void 0:e[n])?void 0:i[t]},v.prototype.zt=function(t,n,i){return new r.default(t,null!=(t=null==n?void 0:n.value)?t:{},null!=(t=null==n?void 0:n.rule_id)?t:"",i,null==n?void 0:n.secondary_exposures,null!=(t=null==n?void 0:n.allocated_experiment_name)?t:"",this.Bt(this.V.K))},v.prototype.Vt=function(t,n){return t?{reason:this.Jt,time:null!=(t=this.At.evaluation_time)?t:Date.now()}:{reason:null!=n?n:this.Jt==o.Uninitialized?o.Uninitialized:o.Unrecognized,time:Date.now()}},v.prototype.Ft=function(){this.At=this.Gt()},v.prototype.Wt=function(t,n){return{feature_gates:t.feature_gates,layer_configs:t.layer_configs,dynamic_configs:t.dynamic_configs,time:null==t.time||isNaN(t.time)?0:t.time,evaluation_time:Date.now(),derived_fields:t.derived_fields,hash_used:t.hash_used}},v.prototype.Bt=function(r){var u=this;return function(t,n,i,e){u.isLoaded()&&u.t(r,"Parameter ".concat(n," is a value of type ").concat(e,".\n Returning requested defaultValue type ").concat(i),{name:t.i,ruleID:t.u,parameter:n,defaultValueType:i,valueType:e})}},n.default=v},607:function(t,n,i){var o=this&&this.__awaiter||function(t,o,s,c){return new(s=s||Promise)(function(i,n){function e(t){try{u(c.next(t))}catch(t){n(t)}}function r(t){try{u(c.throw(t))}catch(t){n(t)}}function u(t){var n;t.done?i(t.value):((n=t.value)instanceof s?n:new s(function(t){t(n)})).then(e,r)}u((c=c.apply(t,o||[])).next())})},s=this&&this.__generator||function(e,r){var u,o,s,c={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},f={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(f[Symbol.iterator]=function(){return this}),f;function t(i){return function(t){var n=[i,t];if(u)throw new TypeError("Generator is already executing.");for(;c=f&&n[f=0]?0:c;)try{if(u=1,o&&(s=2&n[0]?o.return:n[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,n[1])).done)return s;switch(o=0,(n=s?[2&n[0],s.value]:n)[0]){case 0:case 1:s=n;break;case 4:return c.label++,{value:n[1],done:!1};case 5:c.label++,o=n[1],n=[0];continue;case 7:n=c.ops.pop(),c.trys.pop();continue;default:if(!(s=0<(s=c.trys).length&&s[s.length-1])&&(6===n[0]||2===n[0])){c=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3]))c.label=n[1];else if(6===n[0]&&c.label<s[1])c.label=s[1],s=n;else{if(!(s&&c.label<s[2])){s[2]&&c.ops.pop(),c.trys.pop();continue}c.label=s[2],c.ops.push(n)}}n=r.call(e,c)}catch(t){n=[6,t],o=0}finally{u=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}}},e=this&&this.__importDefault||function(t){return t&&t.v?t:{default:t}},r=(Object.defineProperty(n,"v",{value:!0}),n.EvaluationReason=n.DynamicConfig=void 0,i(187)),c=e(i(793)),u=i(567),f=i(825),h=(Object.defineProperty(n,"DynamicConfig",{enumerable:!0,get:function(){return e(f).default}}),i(567));function a(){}Object.defineProperty(n,"EvaluationReason",{enumerable:!0,get:function(){return h.EvaluationReason}}),a.initialize=function(i,e,r){var u;return o(this,void 0,void 0,function(){var n;return s(this,function(t){return n=null!=(u=a.instance)?u:new c.default(i,e,r),a.instance||(a.instance=n),[2,n.initializeAsync()]})})},a.setInitializeValues=function(t){a.Qt().setInitializeValues(t)},a.checkGate=function(t){return a.Qt().checkGate(t)},a.checkGateWithExposureLoggingDisabled=function(t){return a.Qt().checkGateWithExposureLoggingDisabled(t)},a.manuallyLogGateExposure=function(t){a.Qt().logGateExposure(t)},a.getConfig=function(t){return a.Qt().getConfig(t)},a.getConfigWithExposureLoggingDisabled=function(t){return a.Qt().getConfigWithExposureLoggingDisabled(t)},a.manuallyLogConfigExposure=function(t){a.Qt().logConfigExposure(t)},a.getExperiment=function(t){return a.Qt().getExperiment(t)},a.getExperimentWithExposureLoggingDisabled=function(t){return a.Qt().getExperimentWithExposureLoggingDisabled(t)},a.manuallyLogExperimentExposure=function(t){a.Qt().logExperimentExposure(t)},a.getLayer=function(t){return a.Qt().getLayer(t)},a.getLayerWithExposureLoggingDisabled=function(t){return a.Qt().getLayerWithExposureLoggingDisabled(t)},a.manuallyLogLayerParameterExposure=function(t,n){a.Qt().logLayerParameterExposure(t,n)},a.logEvent=function(t,n,i){return void 0===n&&(n=null),void 0===i&&(i=null),a.Qt().logEvent(t,n,i)},a.updateUser=function(t){return a.Qt().updateUser(t)},a.updateUserWithValues=function(t,n){return a.Qt().updateUserWithValues(t,n)},a.shutdown=function(){a.Qt().shutdown(),a.instance=null},a.overrideGate=function(t,n){a.Qt().overrideGate(t,n)},a.overrideConfig=function(t,n){a.Qt().overrideConfig(t,n)},a.overrideLayer=function(t,n){a.Qt().overrideLayer(t,n)},a.setOverrides=function(t){a.Qt().setOverrides(t)},a.getOverrides=function(){return a.Qt().getOverrides()},a.getStableID=function(){return a.Qt().getStableID()},a.getEvaluationDetails=function(){var t;return null!=(t=null==(t=a.instance)?void 0:t.getEvaluationDetails())?t:{reason:u.EvaluationReason.Uninitialized,time:0}},a.initializeCalled=function(){return null!=a.instance&&a.instance.initializeCalled()},a.Qt=function(){if(a.instance)return a.instance;throw new r.StatsigUninitializedError},a.instance=null,n.default=a},477:function(t,n){var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var n,i=1,e=arguments.length;i<e;i++)for(var r in n=arguments[i])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}).apply(this,arguments)};function u(){}Object.defineProperty(n,"v",{value:!0}),u.isValid=function(t,n){try{var i,e,r=n.evaluated_keys;return r&&"object"==typeof r?(i=this.copyObject(r),e=null==t?null:this.copyObject(t),u.validate(i,e)&&u.validate(e,i)):!0}catch(t){}return!0},u.validate=function(t,n){if(null==t)return null==n;if(null==n)return!1;for(var i=0,e=Object.entries(t);i<e.length;i++){var r=e[i],u=r[0],r=r[1];if("stableID"!==u){if(typeof r!=typeof n[u])return!1;if("string"!=typeof r)return"object"==typeof r&&this.validate(r,n[u]);if(r!==n[u])return!1}}return!0},u.copyObject=function(t){var n;return null==t?null:(n={},null!=t&&t.userID&&(n.userID=null==t?void 0:t.userID),null!=t&&t.customIDs&&(delete(t=i({},t.customIDs)).stableID,0!==Object.keys(t).length)&&(n.customIDs=t),n)},n.default=u},652:(t,n)=>{Object.defineProperty(n,"v",{value:!0}),n.LOCAL_STORAGE_KEYS=n.STATSIG_LOCAL_STORAGE_LOGGING_REQUEST_KEY=n.STATSIG_STABLE_ID_KEY=n.INTERNAL_STORE_KEY=void 0,n.INTERNAL_STORE_KEY="STATSIG_STORE",n.STATSIG_STABLE_ID_KEY="STATSIG_STABLE_ID",n.STATSIG_LOCAL_STORAGE_LOGGING_REQUEST_KEY="STATSIG_LOGS",n.LOCAL_STORAGE_KEYS={INTERNAL_STORE_KEY:!0,STATSIG_STABLE_ID_KEY:!0,STATSIG_LOCAL_STORAGE_LOGGING_REQUEST_KEY:!0}},898:(t,n)=>{function s(t){for(var n=0,i=0;i<t.length;i++){n=(n<<5)-n+t.charCodeAt(i);n&=n}return String(n>>>0)}function r(i){var t,e;return null==i?null:(t=Object.keys(i).sort(),e={},t.forEach(function(t){var n=i[t];n instanceof Object&&(n=r(n)),e[t]=n}),e)}Object.defineProperty(n,"v",{value:!0}),n.getUserCacheKey=n.getSortedObject=n.djb2HashForObject=n.getHashValue=n.SimpleHash=void 0,n.SimpleHash=s,n.getHashValue=function(t,n){return"none"===n?t:s(t)},n.djb2HashForObject=function(t){return s(JSON.stringify(r(t)))},n.getSortedObject=r,n.getUserCacheKey=function(t){var n="userID:".concat(String(null!=(i=null==t?void 0:t.userID)?i:"")),i=null==t?void 0:t.customIDs;if(null!=i)for(var e=0,r=Object.entries(i);e<r.length;e++){var u=r[e],o=u[0],u=u[1];n+=";".concat(o,":").concat(u)}return s(n)}},645:(t,n,i)=>{Object.defineProperty(n,"v",{value:!0}),n.verifySDKKeyUsed=void 0;var e=i(187),r=i(898);n.verifySDKKeyUsed=function(t,n,i){return null==(t=null==t?void 0:t.hashed_sdk_key_used)||t===(0,r.SimpleHash)(null!=n?n:"")||(i.O("fetchAndSaveValues",new e.StatsigSDKKeyMismatchError("The SDK key provided does not match the one used to generate values.")),!1)}},682:(t,n)=>{function i(){}Object.defineProperty(n,"v",{value:!0}),i.getItem=function(t){try{if(this.isStorageAccessible())return window.localStorage.getItem(t)}catch(t){}return null!=(t=this.fallbackSessionCache[t])?t:null},i.setItem=function(t,n){try{if(this.isStorageAccessible())return void window.localStorage.setItem(t,n)}catch(t){}this.fallbackSessionCache[t]=n},i.removeItem=function(t){try{if(this.isStorageAccessible())return void window.localStorage.removeItem(t)}catch(t){}delete this.fallbackSessionCache[t]},i.isStorageAccessible=function(t){void 0===t&&(t=!1),null==this.canAccessStorageAccessible&&(this.canAccessStorageAccessible="undefined"!=typeof Storage&&"undefined"!=typeof window&&null!=window&&null!=window.localStorage);var n=this.canAccessStorageAccessible;return(t||!this.disabled)&&n},i.disabled=!1,i.fallbackSessionCache={},i.canAccessStorageAccessible=null,n.default=i},28:(t,n)=>{function i(){return"undefined"!=typeof performance&&performance?0|performance.now():Date.now()}Object.defineProperty(n,"v",{value:!0}),n.difference=n.now=void 0,n.now=i,n.difference=function(t){return i()-t}}},r={};return function t(n){var i=r[n];return void 0===i&&(i=r[n]={exports:{}},e[n].call(i.exports,i,i.exports,t)),i.exports}(607).default})()); |
@@ -1,1 +0,1 @@ | ||
export declare const version = "1.3.0"; | ||
export declare const version = "1.3.1"; |
@@ -5,2 +5,2 @@ "use strict"; | ||
// Generated by genversion. | ||
exports.version = '1.3.0'; | ||
exports.version = '1.3.1'; |
@@ -293,2 +293,3 @@ "use strict"; | ||
_this._store.bootstrap(values); | ||
_this._logger.resetDedupeKeys(); | ||
fireCompletionCallback(true, null); | ||
@@ -295,0 +296,0 @@ return true; |
{ | ||
"name": "statsig-js-lite", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "A slimmed version of the Statsig JavaScript client SDK for single user environments.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
201604
3147
7