"use strict";(self.webpackChunkfareharbor_com=self.webpackChunkfareharbor_com||[]).push([[5717],{24601:function(e,t,n){n.d(t,{OT:function(){return a},Qc:function(){return i},Yo:function(){return o},oP:function(){return r}});var r="persistentStorageIdentifier",i=function(){return[["US",cT('"USA" acronym for United States of America',"USA")],["AF",T("Afghanistan")],["AL",T("Albania")],["DZ",T("Algeria")],["AS",T("American Samoa")],["AD",T("Andorra")],["AO",T("Angola")],["AI",T("Anguilla")],["AG",T("Antigua and Barbuda")],["AR",T("Argentina")],["AM",T("Armenia")],["AW",T("Aruba")],["AC",T("Ascension Island")],["AU",T("Australia")],["AT",T("Austria")],["AZ",T("Azerbaijan")],["BS",T("Bahamas")],["BH",T("Bahrain")],["BD",T("Bangladesh")],["BB",T("Barbados")],["BY",T("Belarus")],["BE",T("Belgium")],["BZ",T("Belize")],["BJ",T("Benin")],["BM",T("Bermuda")],["BT",T("Bhutan")],["BO",T("Bolivia")],["BA",T("Bosnia and Herzegovina")],["BW",T("Botswana")],["BR",T("Brazil")],["IO",T("British Indian Ocean Territory")],["VG",T("British Virgin Islands")],["BN",T("Brunei")],["BG",T("Bulgaria")],["BF",T("Burkina Faso")],["BI",T("Burundi")],["KH",T("Cambodia")],["CM",T("Cameroon")],["CA",T("Canada")],["CV",T("Cape Verde")],["BQ",T("Caribbean Netherlands")],["KY",T("Cayman Islands")],["CF",T("Central African Republic")],["TD",T("Chad")],["CL",T("Chile")],["CN",T("China")],["CX",T("Christmas Island")],["CC",T("Cocos (Keeling) Islands")],["CO",T("Colombia")],["KM",T("Comoros")],["CD",T("Congo (DRC)")],["CG",T("Congo (Republic)")],["CK",T("Cook Islands")],["CR",T("Costa Rica")],["CI",T("Côte d’Ivoire")],["HR",T("Croatia")],["CU",T("Cuba")],["CW",T("Curaçao")],["CY",T("Cyprus")],["CZ",T("Czech Republic")],["DK",T("Denmark")],["DJ",T("Djibouti")],["DM",T("Dominica")],["DO",T("Dominican Republic")],["EC",T("Ecuador")],["EG",T("Egypt")],["SV",T("El Salvador")],["GQ",T("Equatorial Guinea")],["ER",T("Eritrea")],["EE",T("Estonia")],["SZ",T("Eswatini")],["ET",T("Ethiopia")],["FK",T("Falkland Islands (Malvinas)")],["FO",T("Faroe Islands")],["FJ",T("Fiji")],["FI",T("Finland")],["FR",T("France")],["GF",T("French Guiana")],["PF",T("French Polynesia")],["GA",T("Gabon")],["GM",T("Gambia")],["GE",T("Georgia")],["DE",T("Germany")],["GH",T("Ghana")],["GI",T("Gibraltar")],["GR",T("Greece")],["GL",T("Greenland")],["GD",T("Grenada")],["GP",T("Guadeloupe")],["GU",T("Guam")],["GT",T("Guatemala")],["GG",T("Guernsey")],["GN",T("Guinea")],["GW",T("Guinea-Bissau")],["GY",T("Guyana")],["HT",T("Haiti")],["HN",T("Honduras")],["HK",T("Hong Kong")],["HU",T("Hungary")],["IS",T("Iceland")],["IN",T("India")],["ID",T("Indonesia")],["IR",T("Iran")],["IQ",T("Iraq")],["IE",T("Ireland")],["IM",T("Isle of Man")],["IL",T("Israel")],["IT",T("Italy")],["JM",T("Jamaica")],["JP",T("Japan")],["JE",T("Jersey")],["JO",T("Jordan")],["KZ",T("Kazakhstan")],["KE",T("Kenya")],["KI",T("Kiribati")],["XK",T("Kosovo")],["KW",T("Kuwait")],["KG",T("Kyrgyzstan")],["LA",T("Laos")],["LV",T("Latvia")],["LB",T("Lebanon")],["LS",T("Lesotho")],["LR",T("Liberia")],["LY",T("Libya")],["LI",T("Liechtenstein")],["LT",T("Lithuania")],["LU",T("Luxembourg")],["MO",T("Macau")],["MG",T("Madagascar")],["MW",T("Malawi")],["MY",T("Malaysia")],["MV",T("Maldives")],["ML",T("Mali")],["MT",T("Malta")],["MH",T("Marshall Islands")],["MQ",T("Martinique")],["MR",T("Mauritania")],["MU",T("Mauritius")],["YT",T("Mayotte")],["MX",T("Mexico")],["FM",T("Micronesia")],["MD",T("Moldova")],["MC",T("Monaco")],["MN",T("Mongolia")],["ME",T("Montenegro")],["MS",T("Montserrat")],["MA",T("Morocco")],["MZ",T("Mozambique")],["MM",T("Myanmar")],["NA",T("Namibia")],["NR",T("Nauru")],["NP",T("Nepal")],["NL",T("Netherlands")],["NC",T("New Caledonia")],["NZ",T("New Zealand")],["NI",T("Nicaragua")],["NE",T("Niger")],["NG",T("Nigeria")],["NU",T("Niue")],["NF",T("Norfolk Island")],["KP",T("North Korea")],["MK",T("North Macedonia")],["MP",T("Northern Mariana Islands")],["NO",T("Norway")],["OM",T("Oman")],["PK",T("Pakistan")],["PW",T("Palau")],["PS",T("Palestine")],["PA",T("Panama")],["PG",T("Papua New Guinea")],["PY",T("Paraguay")],["PE",T("Peru")],["PH",T("Philippines")],["PL",T("Poland")],["PT",T("Portugal")],["PR",T("Puerto Rico")],["QA",T("Qatar")],["RE",T("Réunion")],["RO",T("Romania")],["RU",T("Russia")],["RW",T("Rwanda")],["BL",T("Saint Barthélemy")],["SH",T("Saint Helena")],["KN",T("Saint Kitts and Nevis")],["LC",T("Saint Lucia")],["MF",T("Saint Martin")],["PM",T("Saint Pierre and Miquelon")],["VC",T("Saint Vincent and the Grenadines")],["WS",T("Samoa")],["SM",T("San Marino")],["ST",T("São Tomé and Príncipe")],["SA",T("Saudi Arabia")],["SN",T("Senegal")],["RS",T("Serbia")],["SC",T("Seychelles")],["SL",T("Sierra Leone")],["SG",T("Singapore")],["SX",T("Sint Maarten")],["SK",T("Slovakia")],["SI",T("Slovenia")],["SB",T("Solomon Islands")],["SO",T("Somalia")],["ZA",T("South Africa")],["KR",T("South Korea")],["SS",T("South Sudan")],["ES",T("Spain")],["LK",T("Sri Lanka")],["SD",T("Sudan")],["SR",T("Suriname")],["SJ",T("Svalbard and Jan Mayen")],["SE",T("Sweden")],["CH",T("Switzerland")],["SY",T("Syria")],["TW",T("Taiwan")],["TJ",T("Tajikistan")],["TZ",T("Tanzania")],["TH",T("Thailand")],["TL",T("Timor-Leste")],["TG",T("Togo")],["TK",T("Tokelau")],["TO",T("Tonga")],["TT",T("Trinidad and Tobago")],["TN",T("Tunisia")],["TR",T("Turkey")],["TM",T("Turkmenistan")],["TC",T("Turks and Caicos Islands")],["TV",T("Tuvalu")],["VI",T("U.S. Virgin Islands")],["UG",T("Uganda")],["UA",T("Ukraine")],["AE",T("United Arab Emirates")],["GB",T("United Kingdom (Great Britain)")],["ZZ",T("Unknown or unspecified country")],["UY",T("Uruguay")],["UZ",T("Uzbekistan")],["VU",T("Vanuatu")],["VA",T("Vatican City")],["VE",T("Venezuela")],["VN",T("Vietnam")],["WF",T("Wallis and Futuna")],["EH",T("Western Sahara")],["YE",T("Yemen")],["ZM",T("Zambia")],["ZW",T("Zimbabwe")],["AX",T("Åland Islands")]]},o=256,a="#000000"},46329:function(e,t,n){n.d(t,{Bp:function(){return v},Cb:function(){return b},JX:function(){return f},MX:function(){return S},ZH:function(){return d},b1:function(){return g},fX:function(){return y},uc:function(){return m},vh:function(){return p}});n(16280),n(76918),n(28706),n(51629),n(44114),n(34782),n(23288),n(79432),n(26099),n(27495),n(90906),n(38781),n(25440),n(23500);var r=n(97936),i=/([a-z])([A-Z0-9])/g,o=/([0-9])([a-zA-Z])/g,a=/([^a-zA-Z0-9-])+/g,s=/([a-z])([A-Z])/g,l=/([A-Z]+)([A-Z][a-z])/g,u=/([0-9]+)([^0-9 -_])/g,c=/^-|-$/g;function d(e){return"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1).toLowerCase())}function g(e){return(e||"").replace(/:+\s*$/,"")}function f(e,t){var n=function(e,t,n){return"".concat(t," ").concat(n)},r=e.toString().replace(i,n).replace(o,n).replace(/-/g," ").toLowerCase();return t?_.titleize(r):d(r)}function h(e,t){if(!e)return null;var n=moment(e,"YYYY-MM-DDTHH:mm:ssZZ",!0);if(n.isValid())return n;if((n=moment(e,"YYYY-MM-DDTHH:mm:ss",!0)).isValid())return n;if((n=moment(e,"YYYY-MM-DD",!0)).isValid())return n;if(!_.isString(e))return e;if(3===e.split("-")[0].length)return console.warn("convert: date has a 3-digit year; please fix.",t,e),h("0".concat(e),t);throw new Error("convert: invalid date ".concat(t,": ").concat(e))}function v(e){var t=/_at$/;if(_.isArray(e))for(var n=0,i=e.length;n0&&void 0!==arguments[0]?arguments[0]:"";return null==e?void 0:e.replace(s,"$1_$2").replace(l,"$1-$2").replace(u,"$1-$2").replace(a,"_").replace(/^_|_$/g,"").replace(/-/g,"_").toLowerCase()}function y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return null==e?void 0:e.replace(s,"$1-$2").replace(l,"$1-$2").replace(u,"$1-$2").replace(a,"-").replace(c,"").toLowerCase()}function b(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return null==e?void 0:e.replace(a,"-").replace(l,"$1-$2").replace(u,"$1-$2").replace(s,"$1-$2").replace(c,"").replace(/([a-zA-Z0-9]+)([_-]|$)/g,(function(e,t){return d(t)})).replace(/^[A-Z]/,(function(e){return e.toLowerCase()}))}function S(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return null==e?void 0:e.replace(a,"-").replace(l,"$1-$2").replace(u,"$1-$2").replace(s,"$1-$2").replace(c,"").replace(/([a-zA-Z0-9]+)([-]|$)/g,(function(e,t){return d(t)}))}},21690:function(e,t,n){n.d(t,{Q:function(){return a},x:function(){return s}});n(23792),n(26099),n(47764),n(62953),n(3296),n(27208),n(48408),n(14603),n(47566),n(98721);var r=n(17411),i=n(24601);function o(e){try{localStorage.setItem(i.oP,e)}catch(e){console.error("Could not store FareHarbor customer ID in localStorage.")}}function a(){var e=(0,r.bz)();return o(e),e}function s(){var e,t=(e=new URL(window.location).searchParams.get("u"),((0,r.Ew)(e)?e:null)||function(){try{var e=localStorage.getItem(i.oP);return(0,r.Ew)(e)?e:null}catch(e){return console.error("Could not retrieve FareHarbor customer ID from localStorage."),null}}()||(0,r.bz)());return o(t),t}},82032:function(e,t,n){n.r(t),n.d(t,{BOOKING_FEE_SUBTOTAL_EXPERIMENT_ID:function(){return s},BOOK_FORM_PROGRESS_EXPERIMENT_ID:function(){return a},BOOK_PAY_BUTTON_CTA_EXPERIMENT_ID:function(){return m},BOOK_PAY_CART_BUTTON_CTA_EXPERIMENT_ID:function(){return y},CURRENT_ITEM_IDS_PROPERTY:function(){return o},EXPERIMENTS_PROPERTY:function(){return r},EXPERIMENT_ITEM_IDS_PROPERTY:function(){return i},PRICES_LOADING_STATE_EXPERIMENT_ID:function(){return d},PRICE_SCHEDULES_EXPERIMENT_ID:function(){return c},PROMO_CODE_AUTO_APPLY_V2_EXPERIMENT_ID:function(){return _},PROMO_CODE_POPUP_DISMISSED:function(){return f},PROMO_CODE_POPUP_EXPERIMENT_ID:function(){return g},REMOVE_CLOSE_BUTTON_EXPERIMENT_ID:function(){return h},SATISPAY_EXPERIMENT_ID:function(){return b},SEARCH_BY_DATE_MOBILE_COLLAPSE_AVAILS_EXPERIMENT_ID:function(){return u},SEARCH_BY_DATE_TABS_EXPERIMENT_ID:function(){return l},THREE_COLUMN_AVAIL_EXPERIMENT_ID:function(){return v},TRIP_PROTECTION_UI_EXPERIMENT_ID:function(){return p}});var r="experiments",i="experiment-item-ids",o="current-item-ids",a="LF_BookformProgress_V1",s="TheBand_AbsorbBookingFeeSubtotal_V1",l="UpperFunnel_SearchByDateTabs_V1",u="UpperFunnel_SearchByDateMobileScrollAvails_V1",c="TheBand_PriceSchedules_V1",d="LF_LoadingPrices_V1",g="TheBand_PromoCodePopup",f="promo_code_popup_is_dismissed",_="LF_PromoCodeAutoApply_V2",h="LF_RemoveCloseButton_V1",v="TheBand_3ColumnAvail",p="LF_TripProtectionUI_V1",m="LF_Book_Button_CTA_V1",y="LF_Cart_Book_Button_CTA_V1",b="PayXP_Satispay"},63003:function(e,t,n){n.d(t,{A:function(){return P}});n(52675),n(89463),n(66412),n(2259),n(45700),n(78125),n(16280),n(76918),n(2008),n(51629),n(64346),n(23792),n(44114),n(94490),n(34782),n(89572),n(62010),n(4731),n(60479),n(2892),n(59904),n(67945),n(84185),n(83851),n(81278),n(40875),n(79432),n(63548),n(10287),n(26099),n(3362),n(27495),n(47764),n(71761),n(23500),n(62953);var r=n(5138),i=n(82032),o=n(21690);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function s(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */s=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},l=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,n){return e[t]=n}}function g(e,t,n,r){var o=t&&t.prototype instanceof y?t:y,a=Object.create(o.prototype),s=new M(r||[]);return i(a,"_invoke",{value:D(e,n,s)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=g;var _="suspendedStart",h="suspendedYield",v="executing",p="completed",m={};function y(){}function b(){}function S(){}var E={};d(E,l,(function(){return this}));var T=Object.getPrototypeOf,w=T&&T(T(j([])));w&&w!==n&&r.call(w,l)&&(E=w);var k=S.prototype=y.prototype=Object.create(E);function O(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function I(e,t){function n(i,o,s,l){var u=f(e[i],e,o);if("throw"!==u.type){var c=u.arg,d=c.value;return d&&"object"==a(d)&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,s,l)}),(function(e){n("throw",e,s,l)})):t.resolve(d).then((function(e){c.value=e,s(c)}),(function(e){return n("throw",e,s,l)}))}l(u.arg)}var o;i(this,"_invoke",{value:function(e,r){function i(){return new t((function(t,i){n(e,r,t,i)}))}return o=o?o.then(i,i):i()}})}function D(t,n,r){var i=_;return function(o,a){if(i===v)throw Error("Generator is already running");if(i===p){if("throw"===o)throw a;return{value:e,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var l=C(s,r);if(l){if(l===m)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===_)throw i=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=v;var u=f(t,n,r);if("normal"===u.type){if(i=r.done?p:h,u.arg===m)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=p,r.method="throw",r.arg=u.arg)}}}function C(t,n){var r=n.method,i=t.iterator[r];if(i===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,C(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var o=f(i,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,m;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function j(t){if(t||""===t){var n=t[l];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function n(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(l&&u){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;x(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:j(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t1&&void 0!==o[1]?o[1]:{},e.prev=1,!_){e.next=4;break}return e.abrupt("return");case 4:if(!v){e.next=8;break}return e.next=7,v;case 7:return e.abrupt("return");case 8:if(window.slipstream.isStatsigEnabled){e.next=11;break}return console.log("[Statsig]: initialization stopped. Service is disabled"),e.abrupt("return");case 11:if(window.slipstream.isAnonymous){e.next=14;break}return console.log("[Statsig]: Disabled for authenticated users."),e.abrupt("return");case 14:if(t&&t.userID){e.next=17;break}return console.error("[Statsig]: initialization requires a user object with a userID property."),e.abrupt("return");case 17:if(i="client-Bhpz3dYE9Rlm1Cvbu2dYXwXAXdqzO2ej8aPVZrUcQp2"){e.next=21;break}return console.log("[Statsig]: client key is missing."),e.abrupt("return");case 21:return v=g(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return b.userID=t.userID,b.custom=u(u({},b.custom),t.custom),f=new r.StatsigClient(i,b,u({environment:{tier:D()},loggingIntervalMs:1e3,loggingEnabled:"disabled",disableStorage:!0},n)),e.next=5,f.initializeAsync();case 5:_=!0;case 6:case"end":return e.stop()}}),e)})))(),e.next=24,v;case 24:e.next=29;break;case 26:e.prev=26,e.t0=e.catch(1),console.error("[Statsig]: initialization failed:",e.t0);case 29:return e.prev=29,v=null,e.finish(29);case 32:case"end":return e.stop()}}),e,null,[[1,26,29,32]])}))),function(e){return I.apply(this,arguments)}),initDefault:(O=g(s().mark((function e(){var t;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=void 0,n=window.location.href.match(/^.*\/embeds\/(?:\w+)\/([a-zA-Z0-9-_]*)\/.*$/),null!==(t=n&&n[1]?n[1]:null)){e.next=3;break}return e.abrupt("return");case 3:return console.log("[Statsig]: Initializing with default configuration."),e.next=6,C.init({userID:(0,o.x)(),custom:{shortname:t}});case 6:case"end":return e.stop()}var n}),e)}))),function(){return O.apply(this,arguments)}),enableTracking:(k=g(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v;case 2:if(_){e.next=4;break}return e.abrupt("return");case 4:f.updateRuntimeOptions({loggingEnabled:"browser-only",disableStorage:!1}),h=!0,p();case 7:case"end":return e.stop()}}),e)}))),function(){return k.apply(this,arguments)}),updateUser:(w=g(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,v;case 3:if(_){e.next=5;break}return e.abrupt("return");case 5:if(b.custom=u(u({},b.custom),t.custom),t&&t.userID){e.next=9;break}return console.error("[Statsig]: updateUser requires a user object with a userID property."),e.abrupt("return");case 9:return y=y.then(g(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.updateUserAsync(b);case 2:case"end":return e.stop()}}),e)})))),e.next=12,y;case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(0),console.error("[Statsig]: error updating user",e.t0);case 17:case"end":return e.stop()}}),e,null,[[0,14]])}))),function(e){return w.apply(this,arguments)}),logEvent:(T=g(s().mark((function e(t){var n,r,i=arguments;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=i.length>1&&void 0!==i[1]?i[1]:null,r=i.length>2&&void 0!==i[2]?i[2]:null,e.prev=2,t){e.next=6;break}return console.error("[Statsig]: logEvent requires an eventName."),e.abrupt("return");case 6:return e.next=8,v;case 8:if(_){e.next=10;break}return e.abrupt("return");case 10:return e.next=12,m;case 12:f.logEvent(t,n,r),console.log("[Statsig]: logging event:",t,n,r),e.next=19;break;case 16:e.prev=16,e.t0=e.catch(2),console.error("[Statsig]: logging event:",t,e.t0);case 19:case"end":return e.stop()}}),e,null,[[2,16]])}))),function(e){return T.apply(this,arguments)}),getExperiment:(E=g(s().mark((function e(t){var n;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,v;case 3:if(_){e.next=5;break}return e.abrupt("return",{});case 5:if(!h){e.next=7;break}return e.abrupt("return",f.getExperiment(t));case 7:return n=f.getExperiment(t,{disableExposureLog:!0}),m.then((function(){f.getExperiment(t)})),e.abrupt("return",n);case 12:return e.prev=12,e.t0=e.catch(0),console.error("[Statsig]: Error getting experiment '".concat(t,"':"),e.t0),e.abrupt("return",{});case 16:case"end":return e.stop()}}),e,null,[[0,12]])}))),function(e){return E.apply(this,arguments)}),updateCurrentItemIds:(S=g(s().mark((function e(t,n){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Array.isArray(n)&&0!==n.length){e.next=3;break}return console.error("[Statsig]: updateCurrentItemIds requires an array of item IDs"),e.abrupt("return");case 3:return b.custom=u(u({},b.custom),{},c({},i.CURRENT_ITEM_IDS_PROPERTY,n)),e.next=6,C.updateUser(b);case 6:case"end":return e.stop()}}),e)}))),function(e,t){return S.apply(this,arguments)})};window.fhStatsig||(C.initDefault(),window.fhStatsig=C);var P=window.fhStatsig},97936:function(e,t,n){n.d(t,{C:function(){return a},s:function(){return o}});n(28706),n(27495),n(25440);var r=/([a-z])([A-Z0-9])/g,i=/([0-9])([a-zA-Z])/g;function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"/"===e[0]?e:e.replace(/_([a-z0-9])/g,(function(e,t){return t.toUpperCase()}))}function a(){var e=function(e,t,n){return"".concat(t,"_").concat(n.toLowerCase())};return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").replace(r,e).replace(i,e)}},17411:function(e,t,n){n.d(t,{BO:function(){return p},DX:function(){return y},Ew:function(){return _},Kq:function(){return m},VW:function(){return d},b$:function(){return c},bz:function(){return g},nI:function(){return E},qD:function(){return b},ru:function(){return v},t6:function(){return S},u1:function(){return h}});n(52675),n(89463),n(2259),n(45700),n(16280),n(76918),n(28706),n(2008),n(51629),n(23418),n(25276),n(64346),n(23792),n(62062),n(44114),n(72712),n(34782),n(89572),n(23288),n(62010),n(2892),n(67945),n(84185),n(5506),n(53921),n(83851),n(81278),n(79432),n(26099),n(3362),n(27495),n(90906),n(38781),n(31415),n(47764),n(25440),n(43375),n(39225),n(13972),n(99209),n(25714),n(17561),n(66197),n(42207),n(23500),n(62953),n(55815),n(64979),n(79739);var r=n(46329);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&void 0!==arguments[0]?arguments[0]:[]).filter((function(e){return!e.$pristine})).reduce((function(e,t){var n=t.$name,i=t.$modelValue,o=(0,r.fX)(n);return l(l({},e),{},u({},o,i))}),{})},v=function(e){var t=Object.entries(e),n={};return t.forEach((function(e){var t=o(e,2),i=t[0],a=t[1];n[(0,r.fX)(i)]=a})),n},p=function(e,t,n){return n&&(r=e,i=t,o=new Set,r?r.entries.forEach((function(e){var t=e.sheet.uuid;return!o.has(t)&&o.add(t)})):null!=i&&i.uuid&&o.add(null==i?void 0:i.uuid),o).has(n);var r,i,o},m=function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){try{var e=btoa(encodeURIComponent(r.result));t(e)}catch(e){n(e)}},r.onerror=function(e){n(e)},r.readAsText(e)}))},y="YYYY-MM-DD",b=function(e){return e.map((function(e){return Object.fromEntries(Object.entries(e).map((function(e){var t=o(e,2),n=t[0],r=t[1];return[n,r instanceof Date?moment(r).format(y):r]})))}))},S=function(e,t){return Object.fromEntries(t.filter((function(t){return void 0!==e[t]})).map((function(t){return[t,e[t]]})))},E=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=t||Object.keys(e).filter((function(e){return"cls"!==e&&"pk"!==e})),a={};return o.forEach((function(t){var o=e[t],s="".concat(n).concat((0,r.fX)(t));if("object"===i(o)&&null!==o)if(Array.isArray(o))o.forEach((function(e,i){var o="".concat(n).concat((0,r.fX)(e.cls||t),"-").concat(e.pk||i,"-"),s=E(e,void 0,o);Object.keys(s).forEach((function(e){a[e]=s[e]}))}));else{var l=E(o);Object.keys(l).forEach((function(e){var t=e.indexOf("-")>=0&&e.indexOf("_")>=0,n="".concat(s,"-").concat(t?e:(0,r.uc)(e));a[n]=l[e]}))}else{var u="".concat(n).concat((0,r.uc)(t));a[u]=o}})),a}},43509:function(e,t,n){var r,i,o;Object.defineProperty(t,"__esModule",{value:!0}),t._getInstance=t._getStatsigGlobalFlag=t._getStatsigGlobal=void 0;const a=n(68024);t._getStatsigGlobal=()=>{try{return"undefined"!=typeof __STATSIG__?__STATSIG__:d}catch(e){return d}};t._getStatsigGlobalFlag=e=>(0,t._getStatsigGlobal)()[e];t._getInstance=e=>{const n=(0,t._getStatsigGlobal)();return e?n.instances&&n.instances[e]:(n.instances&&Object.keys(n.instances).length>1&&a.Log.warn("Call made to Statsig global instance without an SDK key but there is more than one client instance. If you are using mulitple clients, please specify the SDK key."),n.firstInstance)};const s="__STATSIG__",l="undefined"!=typeof window?window:{},u=void 0!==n.g?n.g:{},c="undefined"!=typeof globalThis?globalThis:{},d=null!==(o=null!==(i=null!==(r=l[s])&&void 0!==r?r:u[s])&&void 0!==i?i:c[s])&&void 0!==o?o:{instance:t._getInstance};l[s]=d,u[s]=d,c[s]=d},94681:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t._getStorageKey=t._getUserStorageKey=void 0;const r=n(83918);function i(e,t,n){var i;if(n)return n(e,t);const o=t&&t.customIDs?t.customIDs:{},a=[`uid:${null!==(i=null==t?void 0:t.userID)&&void 0!==i?i:""}`,`cids:${Object.keys(o).sort(((e,t)=>e.localeCompare(t))).map((e=>`${e}-${o[e]}`)).join(",")}`,`k:${e}`];return(0,r._DJB2)(a.join("|"))}t._getUserStorageKey=i,t._getStorageKey=function(e,t,n){return t?i(e,t,n):(0,r._DJB2)(`k:${e}`)}},58683:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},85638:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t._makeDataAdapterResult=t.DataAdapterCore=void 0;const i=n(68024),o=n(32626),a=n(81570),s=n(1638),l=n(53705);function u(e,t,n,r){return{source:e,data:t,receivedAt:Date.now(),stableID:n,fullUserHash:(0,a._getFullUserHash)(r)}}t.DataAdapterCore=class{constructor(e,t){this._adapterName=e,this._cacheSuffix=t,this._options=null,this._sdkKey=null,this._lastModifiedStoreKey=`statsig.last_modified_time.${t}`,this._inMemoryCache=new c}attach(e,t,n){this._sdkKey=e,this._options=t}getDataSync(e){const t=e&&(0,a._normalizeUser)(e,this._options),n=this._getCacheKey(t),r=this._inMemoryCache.get(n,t);if(r&&this._getIsCacheValueValid(r))return r;const i=this._loadFromCache(n);return i&&this._getIsCacheValueValid(i)?(this._inMemoryCache.add(n,i),this._inMemoryCache.get(n,t)):null}setData(e,t){const n=t&&(0,a._normalizeUser)(t,this._options),r=this._getCacheKey(n);this._inMemoryCache.add(r,u("Bootstrap",e,null,n))}_getIsCacheValueValid(e){return null==e.stableID||e.stableID===o.StableID.get(this._getSdkKey())}_getDataAsyncImpl(e,t,n){return r(this,void 0,void 0,(function*(){s.Storage.isReady()||(yield s.Storage.isReadyResolver());const r=null!=e?e:this.getDataSync(t),o=[this._fetchAndPrepFromNetwork(r,t,n)];return(null==n?void 0:n.timeoutMs)&&o.push(new Promise((e=>setTimeout(e,n.timeoutMs))).then((()=>(i.Log.debug("Fetching latest value timed out"),null)))),yield Promise.race(o)}))}_prefetchDataImpl(e,t){return r(this,void 0,void 0,(function*(){const n=e&&(0,a._normalizeUser)(e,this._options),r=this._getCacheKey(n),i=yield this._getDataAsyncImpl(null,n,t);i&&this._inMemoryCache.add(r,Object.assign(Object.assign({},i),{source:"Prefetch"}))}))}_fetchAndPrepFromNetwork(e,t,n){return r(this,void 0,void 0,(function*(){var r;const a=null!==(r=null==e?void 0:e.data)&&void 0!==r?r:null,s=null!=e&&this._isCachedResultValidFor204(e,t),c=yield this._fetchFromNetwork(a,t,n,s);if(!c)return i.Log.debug("No response returned for latest value"),null;const d=(0,l._typedJsonParse)(c,"has_updates","Response"),g=this._getSdkKey(),f=o.StableID.get(g);let _=null;if(!0===(null==d?void 0:d.has_updates))_=u("Network",c,f,t);else{if(!a||!1!==(null==d?void 0:d.has_updates))return null;_=u("NetworkNotModified",a,f,t)}const h=this._getCacheKey(t);return this._inMemoryCache.add(h,_),this._writeToCache(h,_),_}))}_getSdkKey(){return null!=this._sdkKey?this._sdkKey:(i.Log.error(`${this._adapterName} is not attached to a Client`),"")}_loadFromCache(e){var t;const n=null===(t=s.Storage.getItem)||void 0===t?void 0:t.call(s.Storage,e);if(null==n)return null;const r=(0,l._typedJsonParse)(n,"source","Cached Result");return r?Object.assign(Object.assign({},r),{source:"Cache"}):null}_writeToCache(e,t){s.Storage.setItem(e,JSON.stringify(t)),this._runLocalStorageCacheEviction(e)}_runLocalStorageCacheEviction(e){var t;const n=null!==(t=(0,s._getObjectFromStorage)(this._lastModifiedStoreKey))&&void 0!==t?t:{};n[e]=Date.now();const r=d(n,10);r&&(delete n[r],s.Storage.removeItem(r)),(0,s._setObjectInStorage)(this._lastModifiedStoreKey,n)}},t._makeDataAdapterResult=u;class c{constructor(){this._data={}}get(e,t){var n;const r=this._data[e],o=null==r?void 0:r.stableID,a=null===(n=null==t?void 0:t.customIDs)||void 0===n?void 0:n.stableID;return a&&o&&a!==o?(i.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):r}add(e,t){const n=d(this._data,9);n&&delete this._data[n],this._data[e]=t}merge(e){this._data=Object.assign(Object.assign({},this._data),e)}}function d(e,t){const n=Object.keys(e);return n.length<=t?null:n.reduce(((t,n)=>{const r=e[t],i=e[n];return"object"==typeof r&&"object"==typeof i?i.receivedAtn.get(e),_markInitOverallStart:e=>{s(e,a({},r,"overall"))},_markInitOverallEnd:(e,t,n)=>{s(e,a({success:t,error:t?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:n},i,"overall"))},_markInitNetworkReqStart:(e,t)=>{s(e,a(t,r,"initialize","network_request"))},_markInitNetworkReqEnd:(e,t)=>{s(e,a(t,i,"initialize","network_request"))},_markInitProcessStart:e=>{s(e,a({},r,"initialize","process"))},_markInitProcessEnd:(e,t)=>{s(e,a(t,i,"initialize","process"))},_clearMarkers:e=>{n.delete(e)},_formatError(e){if(e&&"object"==typeof e)return{code:l(e,"code"),name:l(e,"name"),message:l(e,"message")}},_getDiagnosticsData(e,n,r,i){var o;return{success:!0===(null==e?void 0:e.ok),statusCode:null==e?void 0:e.status,sdkRegion:null===(o=null==e?void 0:e.headers)||void 0===o?void 0:o.get("x-statsig-region"),isDelta:!0===r.includes('"is_delta":true')||void 0,attempt:n,error:t.Diagnostics._formatError(i)}},_enqueueDiagnosticsEvent(e,n,r,i){const a=t.Diagnostics._getMarkers(r);if(null==a||a.length<=0)return-1;const s=a[a.length-1].timestamp-a[0].timestamp;t.Diagnostics._clearMarkers(r);const l=function(e,t){const n={eventName:o,user:e,value:null,metadata:t,time:Date.now()};return n}(e,{context:"initialize",markers:a.slice(),statsigOptions:i});return n.enqueue(l),s}}},60457:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t._fetchTxtRecords=void 0;const r=new Uint8Array([0,0,1,0,0,1,0,0,0,0,0,0,13,102,101,97,116,117,114,101,97,115,115,101,116,115,3,111,114,103,0,0,16,0,1]),i=["i","e","d"],o=200;t._fetchTxtRecords=function(e){return n(this,void 0,void 0,(function*(){const t=yield e("https://cloudflare-dns.com/dns-query",{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:r});if(!t.ok){const e=new Error("Failed to fetch TXT records from DNS");throw e.name="DnsTxtFetchError",e}const n=yield t.arrayBuffer();return function(e){const t=e.findIndex(((t,n)=>n{switch(typeof n){case"number":case"bigint":case"boolean":t[String(e)]=n;break;case"string":n.length<50?t[String(e)]=n:t[String(e)]="set";break;case"object":"environment"===e?t.environment=n:"networkConfig"===e?t.networkConfig=n:t[String(e)]=null!=n?"set":"unset"}})),t}t.ErrorBoundary=class{constructor(e,t,n,r){this._sdkKey=e,this._options=t,this._emitter=n,this._lastSeenError=r,this._seen=new Set}wrap(e){try{const t=e;(function(e){const t=new Set;let n=Object.getPrototypeOf(e);for(;n&&n!==Object.prototype;)Object.getOwnPropertyNames(n).filter((e=>"function"==typeof(null==n?void 0:n[e]))).forEach((e=>t.add(e))),n=Object.getPrototypeOf(n);return Array.from(t)})(t).forEach((n=>{const r=t[n];"$EB"in r||(t[n]=(...t)=>this._capture(n,(()=>r.apply(e,t))),t[n].$EB=!0)}))}catch(e){this._onError("eb:wrap",e)}}logError(e,t){this._onError(e,t)}getLastSeenErrorAndReset(){const e=this._lastSeenError;return this._lastSeenError=void 0,null!=e?e:null}attachErrorIfNoneExists(e){this._lastSeenError||(this._lastSeenError=l(e))}_capture(e,t){try{const n=t();return n&&n instanceof Promise?n.catch((t=>this._onError(e,t))):n}catch(t){return this._onError(e,t),null}}_onError(e,n){try{i.Log.warn(`Caught error in ${e}`,{error:n});(()=>r(this,void 0,void 0,(function*(){var r,i,c,d,g,f,_;const h=n||Error(s),v=h instanceof Error,p=v?h.name:"No Name",m=l(h);if(this._lastSeenError=m,this._seen.has(p))return;if(this._seen.add(p),null===(i=null===(r=this._options)||void 0===r?void 0:r.networkConfig)||void 0===i?void 0:i.preventAllNetworkTraffic)return void(null===(c=this._emitter)||void 0===c||c.call(this,{name:"error",error:n,tag:e}));const y=o.SDKType._get(this._sdkKey),b=a.StatsigMetadataProvider.get(),S=v?h.stack:function(e){try{return JSON.stringify(e)}catch(e){return s}}(h),E=Object.assign({tag:e,exception:p,info:S,statsigOptions:u(this._options)},Object.assign(Object.assign({},b),{sdkType:y})),T=null!==(f=null===(g=null===(d=this._options)||void 0===d?void 0:d.networkConfig)||void 0===g?void 0:g.networkOverrideFunc)&&void 0!==f?f:fetch;yield T(t.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this._sdkKey,"STATSIG-SDK-TYPE":String(y),"STATSIG-SDK-VERSION":String(b.sdkVersion),"Content-Type":"application/json"},body:JSON.stringify(E)}),null===(_=this._emitter)||void 0===_||_.call(this,{name:"error",error:n,tag:e})})))().then((()=>{})).catch((()=>{}))}catch(e){}}}},43194:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},86913:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},85434:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.EventLogger=void 0;const i=n(94681),o=n(83918),a=n(68024),s=n(12610),l=n(414),u=n(37253),c=n(47754),d=n(1638),g=n(88873),f=n(92701),_={},h="startup",v="gained_focus";class p{static _safeFlushAndForget(e){var t;null===(t=_[e])||void 0===t||t.flush().catch((()=>{}))}static _safeRetryFailedLogs(e){var t;null===(t=_[e])||void 0===t||t._retryFailedLogs(v)}constructor(e,t,n,r){var i,o;this._sdkKey=e,this._emitter=t,this._network=n,this._options=r,this._queue=[],this._lastExposureTimeMap={},this._nonExposedChecks={},this._hasRunQuickFlush=!1,this._creationTime=Date.now(),this._loggingEnabled=null!==(i=null==r?void 0:r.loggingEnabled)&&void 0!==i?i:!0===(null==r?void 0:r.disableLogging)?c.LoggingEnabledOption.disabled:c.LoggingEnabledOption.browserOnly,(null==r?void 0:r.loggingEnabled)&&void 0!==r.disableLogging&&a.Log.warn("Detected both loggingEnabled and disableLogging options. loggingEnabled takes precedence - please remove disableLogging."),this._maxQueueSize=null!==(o=null==r?void 0:r.loggingBufferMaxSize)&&void 0!==o?o:100;const l=null==r?void 0:r.networkConfig;this._logEventUrlConfig=new g.UrlConfiguration(s.Endpoint._rgstr,null==l?void 0:l.logEventUrl,null==l?void 0:l.api,null==l?void 0:l.logEventFallbackUrls)}setLogEventCompressionMode(e){this._network.setLogEventCompressionMode(e)}setLoggingEnabled(e){this._loggingEnabled=e}enqueue(e){this._shouldLogEvent(e)&&(this._normalizeAndAppendEvent(e),this._quickFlushIfNeeded(),this._queue.length>this._maxQueueSize&&p._safeFlushAndForget(this._sdkKey))}incrementNonExposureCount(e){var t;const n=null!==(t=this._nonExposedChecks[e])&&void 0!==t?t:0;this._nonExposedChecks[e]=n+1}reset(){this.flush().catch((()=>{})),this._lastExposureTimeMap={}}start(){var e;const t=(0,l._isServerEnv)();t&&"always"!==(null===(e=this._options)||void 0===e?void 0:e.loggingEnabled)||(_[this._sdkKey]=this,t||(0,f._subscribeToVisiblityChanged)((e=>{"background"===e?p._safeFlushAndForget(this._sdkKey):"foreground"===e&&p._safeRetryFailedLogs(this._sdkKey)})),this._retryFailedLogs(h),this._startBackgroundFlushInterval())}stop(){return r(this,void 0,void 0,(function*(){this._flushIntervalId&&(clearInterval(this._flushIntervalId),this._flushIntervalId=null),delete _[this._sdkKey],yield this.flush()}))}flush(){return r(this,void 0,void 0,(function*(){if(this._appendAndResetNonExposedChecks(),0===this._queue.length)return;const e=this._queue;this._queue=[],yield this._sendEvents(e)}))}_quickFlushIfNeeded(){this._hasRunQuickFlush||(this._hasRunQuickFlush=!0,Date.now()-this._creationTime>200||setTimeout((()=>p._safeFlushAndForget(this._sdkKey)),200))}_shouldLogEvent(e){var t;if("always"!==(null===(t=this._options)||void 0===t?void 0:t.loggingEnabled)&&(0,l._isServerEnv)())return!1;if(!(0,u._isExposureEvent)(e))return!0;const n=e.user?e.user:{statsigEnvironment:void 0},r=(0,i._getUserStorageKey)(this._sdkKey,n),o=e.metadata?e.metadata:{},a=[e.eventName,r,o.gate,o.config,o.ruleID,o.allocatedExperiment,o.parameterName,String(o.isExplicitParameter),o.reason].join("|"),s=this._lastExposureTimeMap[a],c=Date.now();return!(s&&c-s<6e5)&&(Object.keys(this._lastExposureTimeMap).length>1e3&&(this._lastExposureTimeMap={}),this._lastExposureTimeMap[a]=c,!0)}_sendEvents(e){return r(this,void 0,void 0,(function*(){var t,n;if("disabled"===this._loggingEnabled)return this._saveFailedLogsToStorage(e),!1;try{const r=(0,f._isUnloading)()&&this._network.isBeaconSupported()&&null==(null===(n=null===(t=this._options)||void 0===t?void 0:t.networkConfig)||void 0===n?void 0:n.networkOverrideFunc);this._emitter({name:"pre_logs_flushed",events:e});return(r?this._sendEventsViaBeacon(e):yield this._sendEventsViaPost(e)).success?(this._emitter({name:"logs_flushed",events:e}),!0):(a.Log.warn("Failed to flush events."),this._saveFailedLogsToStorage(e),!1)}catch(e){return a.Log.warn("Failed to flush events."),!1}}))}_sendEventsViaPost(e){return r(this,void 0,void 0,(function*(){var t;const n=yield this._network.post(this._getRequestData(e)),r=null!==(t=null==n?void 0:n.code)&&void 0!==t?t:-1;return{success:r>=200&&r<300}}))}_sendEventsViaBeacon(e){return{success:this._network.beacon(this._getRequestData(e))}}_getRequestData(e){return{sdkKey:this._sdkKey,data:{events:e},urlConfig:this._logEventUrlConfig,retries:3,isCompressable:!0,params:{[s.NetworkParam.EventCount]:String(e.length)},credentials:"same-origin"}}_saveFailedLogsToStorage(e){for(;e.length>500;)e.shift();const t=this._getStorageKey();try{(0,d._setObjectInStorage)(t,e)}catch(e){a.Log.warn("Unable to save failed logs to storage")}}_retryFailedLogs(e){const t=this._getStorageKey();(()=>r(this,void 0,void 0,(function*(){d.Storage.isReady()||(yield d.Storage.isReadyResolver());const n=(0,d._getObjectFromStorage)(t);if(!n)return;e===h&&d.Storage.removeItem(t);(yield this._sendEvents(n))&&e===v&&d.Storage.removeItem(t)})))().catch((()=>{a.Log.warn("Failed to flush stored logs")}))}_getStorageKey(){return`statsig.failed_logs.${(0,o._DJB2)(this._sdkKey)}`}_normalizeAndAppendEvent(e){e.user&&(e.user=Object.assign({},e.user),delete e.user.privateAttributes);const t={},n=this._getCurrentPageUrl();n&&(t.statsigMetadata={currentPage:n});const r=Object.assign(Object.assign({},e),t);a.Log.debug("Enqueued Event:",r),this._queue.push(r)}_appendAndResetNonExposedChecks(){0!==Object.keys(this._nonExposedChecks).length&&(this._normalizeAndAppendEvent({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:Object.assign({},this._nonExposedChecks)}}),this._nonExposedChecks={})}_getCurrentPageUrl(){var e;if(!1!==(null===(e=this._options)||void 0===e?void 0:e.includeCurrentPageUrlWithEvents))return(0,l._getCurrentPageUrlSafe)()}_startBackgroundFlushInterval(){var e,t;const n=null!==(t=null===(e=this._options)||void 0===e?void 0:e.loggingIntervalMs)&&void 0!==t?t:1e4,r=setInterval((()=>{const e=_[this._sdkKey];e&&e._flushIntervalId===r?p._safeFlushAndForget(this._sdkKey):clearInterval(r)}),n);this._flushIntervalId=r}}t.EventLogger=p},83918:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t._getSortedObject=t._DJB2Object=t._DJB2=void 0;const r=n(90010);t._DJB2=e=>{let t=0;for(let n=0;n>>0)};t._DJB2Object=(e,n)=>(0,t._DJB2)(JSON.stringify((0,t._getSortedObject)(e,n)));t._getSortedObject=(e,n)=>{if(null==e)return null;const i=Object.keys(e).sort(),o={};return i.forEach((i=>{const a=e[i];0!==n&&"object"===(0,r._typeOf)(a)?o[i]=(0,t._getSortedObject)(a,null!=n?n-1:n):o[i]=a})),o}},57061:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},68024:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Log=t.LogLevel=void 0;function n(e){return e.unshift("[Statsig]"),e}t.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class r{static info(...e){r.level>=t.LogLevel.Info&&console.info(" INFO ",...n(e))}static debug(...e){r.level>=t.LogLevel.Debug&&console.debug(" DEBUG ",...n(e))}static warn(...e){r.level>=t.LogLevel.Warn&&console.warn(" WARN ",...n(e))}static error(...e){r.level>=t.LogLevel.Error&&console.error(" ERROR ",...n(e))}}t.Log=r,r.level=t.LogLevel.Warn},40843:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.createMemoKey=t.MemoPrefix=void 0,t.MemoPrefix={_gate:"g",_dynamicConfig:"c",_experiment:"e",_layer:"l",_paramStore:"p"};const n=new Set([]),r=new Set(["userPersistedValues"]);t.createMemoKey=function(e,t,i){let o=`${e}|${t}`;if(!i)return o;for(const e of Object.keys(i)){if(r.has(e))return;n.has(e)?o+=`|${e}=true`:o+=`|${e}=${i[e]}`}return o}},12610:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkParam=t.NetworkDefault=t.Endpoint=void 0,t.Endpoint={_initialize:"initialize",_rgstr:"rgstr",_download_config_specs:"download_config_specs"},t.NetworkDefault={[t.Endpoint._rgstr]:"https://prodregistryv2.org/v1",[t.Endpoint._initialize]:"https://featureassets.org/v1",[t.Endpoint._download_config_specs]:"https://api.statsigcdn.com/v1"},t.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}},44703:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkCore=void 0,n(43509);const i=n(43509),o=n(30882),a=n(68024),s=n(12610),l=n(50052),u=n(95747),c=n(10686),d=n(414),g=n(39839),f=n(32626),_=n(71180),h=n(46512),v=n(47754),p=n(92701),m=new Set([408,500,502,503,504,522,524,599]);t.NetworkCore=class{constructor(e,t){this._emitter=t,this._errorBoundary=null,this._timeout=1e4,this._netConfig={},this._options={},this._leakyBucket={},this._lastUsedInitUrl=null,e&&(this._options=e),this._options.networkConfig&&(this._netConfig=this._options.networkConfig),this._netConfig.networkTimeoutMs&&(this._timeout=this._netConfig.networkTimeoutMs),this._fallbackResolver=new l.NetworkFallbackResolver(this._options),this.setLogEventCompressionMode(this._getLogEventCompressionMode(e))}setLogEventCompressionMode(e){this._options.logEventCompressionMode=e}setErrorBoundary(e){this._errorBoundary=e,this._errorBoundary.wrap(this),this._errorBoundary.wrap(this._fallbackResolver),this._fallbackResolver.setErrorBoundary(e)}isBeaconSupported(){return"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon}getLastUsedInitUrlAndReset(){const e=this._lastUsedInitUrl;return this._lastUsedInitUrl=null,e}beacon(e){if(!y(e))return!1;const t=this._getInternalRequestArgs("POST",e),n=this._getPopulatedURL(t),r=navigator;return r.sendBeacon.bind(r)(n,t.body)}post(e){return r(this,void 0,void 0,(function*(){const t=this._getInternalRequestArgs("POST",e);return this._tryEncodeBody(t),yield this._tryToCompressBody(t),this._sendRequest(t)}))}get(e){const t=this._getInternalRequestArgs("GET",e);return this._sendRequest(t)}_sendRequest(e){return r(this,void 0,void 0,(function*(){var t,n,i,l;if(!y(e))return null;if(this._netConfig.preventAllNetworkTraffic)return null;const{method:u,body:c,retries:d,attempt:g}=e,f=e.urlConfig.endpoint;if(this._isRateLimited(f))return a.Log.warn(`Request to ${f} was blocked because you are making requests too frequently.`),null;const h=null!=g?g:1,v="undefined"!=typeof AbortController?new AbortController:null,b=setTimeout((()=>{null==v||v.abort(`Timeout of ${this._timeout}ms expired.`)}),this._timeout),E=this._getPopulatedURL(e);let T=null;const w=(0,p._isUnloading)();try{const n={method:u,body:c,headers:Object.assign({},e.headers),signal:null==v?void 0:v.signal,priority:e.priority,keepalive:w};!function(e,t){if(e.urlConfig.endpoint!==s.Endpoint._initialize)return;o.Diagnostics._markInitNetworkReqStart(e.sdkKey,{attempt:t})}(e,h);const r=this._leakyBucket[f];r&&(r.lastRequestTime=Date.now(),this._leakyBucket[f]=r);const i=null!==(t=this._netConfig.networkOverrideFunc)&&void 0!==t?t:fetch;if(T=yield i(E,n),clearTimeout(b),!T.ok){const e=yield T.text().catch((()=>"No Text")),t=new Error(`NetworkError: ${E} ${e}`);throw t.name="NetworkError",t}const a=yield T.text();return S(e,T,h,a),this._fallbackResolver.tryBumpExpiryTime(e.sdkKey,e.urlConfig),{body:a,code:T.status}}catch(t){const o=function(e,t){if((null==e?void 0:e.signal.aborted)&&"string"==typeof e.signal.reason)return e.signal.reason;if("string"==typeof t)return t;if(t instanceof Error)return`${t.name}: ${t.message}`;return"Unknown Error"}(v,t),s=(null==(k=v)?void 0:k.signal.aborted)&&"string"==typeof k.signal.reason&&k.signal.reason.includes("Timeout")||!1;S(e,T,h,"",t);if((yield this._fallbackResolver.tryFetchUpdatedFallbackInfo(e.sdkKey,e.urlConfig,o,s))&&(e.fallbackUrl=this._fallbackResolver.getActiveFallbackUrl(e.sdkKey,e.urlConfig)),!d||h>d||!m.has(null!==(n=null==T?void 0:T.status)&&void 0!==n?n:500)){null===(i=this._emitter)||void 0===i||i.call(this,{name:"error",error:t,tag:_.ErrorTag.NetworkError,requestArgs:e});const n=`A networking error occurred during ${u} request to ${E}.`;return a.Log.error(n,o,t),null===(l=this._errorBoundary)||void 0===l||l.attachErrorIfNoneExists(n),null}return yield function(e){return r(this,void 0,void 0,(function*(){yield new Promise((t=>setTimeout(t,Math.min(e*e*500,3e4))))}))}(h),this._sendRequest(Object.assign(Object.assign({},e),{retries:d,attempt:h+1}))}var k}))}_getLogEventCompressionMode(e){let t=null==e?void 0:e.logEventCompressionMode;return t||!0!==(null==e?void 0:e.disableCompression)||(t=v.LogEventCompressionMode.Disabled),t||(t=v.LogEventCompressionMode.Enabled),t}_isRateLimited(e){var t;const n=Date.now(),r=null!==(t=this._leakyBucket[e])&&void 0!==t?t:{count:0,lastRequestTime:n},i=n-r.lastRequestTime,o=Math.floor(.05*i);return r.count=Math.max(0,r.count-o),r.count>=50||(r.count+=1,r.lastRequestTime=n,this._leakyBucket[e]=r,!1)}_getPopulatedURL(e){var t;const n=null!==(t=e.fallbackUrl)&&void 0!==t?t:e.urlConfig.getUrl();e.urlConfig.endpoint!==s.Endpoint._initialize&&e.urlConfig.endpoint!==s.Endpoint._download_config_specs||(this._lastUsedInitUrl=n);const r=Object.assign({[s.NetworkParam.SdkKey]:e.sdkKey,[s.NetworkParam.SdkType]:c.SDKType._get(e.sdkKey),[s.NetworkParam.SdkVersion]:h.SDK_VERSION,[s.NetworkParam.Time]:String(Date.now()),[s.NetworkParam.SessionID]:g.SessionID.get(e.sdkKey)},e.params),i=Object.keys(r).map((e=>`${encodeURIComponent(e)}=${encodeURIComponent(r[e])}`)).join("&");return`${n}${i?`?${i}`:""}`}_tryEncodeBody(e){var t;const n=(0,d._getWindowSafe)(),r=e.body;if(e.isStatsigEncodable&&!this._options.disableStatsigEncoding&&"string"==typeof r&&null==(0,i._getStatsigGlobalFlag)("no-encode")&&(null==n?void 0:n.btoa))try{e.body=n.btoa(r).split("").reverse().join(""),e.params=Object.assign(Object.assign({},null!==(t=e.params)&&void 0!==t?t:{}),{[s.NetworkParam.StatsigEncoded]:"1"})}catch(t){a.Log.warn(`Request encoding failed for ${e.urlConfig.getUrl()}`,t)}}_tryToCompressBody(e){return r(this,void 0,void 0,(function*(){var t;const n=e.body;if("string"==typeof n&&function(e,t){if(!e.isCompressable)return!1;if(null!=(0,i._getStatsigGlobalFlag)("no-compress")||"undefined"==typeof CompressionStream||"undefined"==typeof TextEncoder)return!1;const n=null!=e.urlConfig.customUrl||null!=e.urlConfig.fallbackUrls,r=!0===u.SDKFlags.get(e.sdkKey,"enable_log_event_compression");switch(t.logEventCompressionMode){case v.LogEventCompressionMode.Disabled:return!1;case v.LogEventCompressionMode.Enabled:return!(n&&!r);case v.LogEventCompressionMode.Forced:return!0;default:return!1}}(e,this._options))try{const r=(new TextEncoder).encode(n),i=new CompressionStream("gzip"),o=i.writable.getWriter();o.write(r).catch(a.Log.error),o.close().catch(a.Log.error);const l=i.readable.getReader(),u=[];let c;for(;!(c=yield l.read()).done;)u.push(c.value);const d=u.reduce(((e,t)=>e+t.length),0),g=new Uint8Array(d);let f=0;for(const e of u)g.set(e,f),f+=e.length;e.body=g,e.params=Object.assign(Object.assign({},null!==(t=e.params)&&void 0!==t?t:{}),{[s.NetworkParam.IsGzipped]:"1"})}catch(t){a.Log.warn(`Request compression failed for ${e.urlConfig.getUrl()}`,t)}}))}_getInternalRequestArgs(e,t){const n=this._fallbackResolver.getActiveFallbackUrl(t.sdkKey,t.urlConfig),r=Object.assign(Object.assign({},t),{method:e,fallbackUrl:n});return"data"in t&&b(r,t.data),r}};const y=e=>!!e.sdkKey||(a.Log.warn("Unable to make request without an SDK key"),!1),b=(e,t)=>{const{sdkKey:n,fallbackUrl:r}=e,i=f.StableID.get(n),o=g.SessionID.get(n),a=c.SDKType._get(n);e.body=JSON.stringify(Object.assign(Object.assign({},t),{statsigMetadata:Object.assign(Object.assign({},h.StatsigMetadataProvider.get()),{stableID:i,sessionID:o,sdkType:a,fallbackUrl:r})}))};function S(e,t,n,r,i){e.urlConfig.endpoint===s.Endpoint._initialize&&o.Diagnostics._markInitNetworkReqEnd(e.sdkKey,o.Diagnostics._getDiagnosticsData(t,n,r,i))}},50052:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t._isDomainFailure=t.NetworkFallbackResolver=void 0;const i=n(60457),o=n(83918),a=n(68024),s=n(1638),l=6048e5;function u(e,t){var n;const r=null!==(n=null==e?void 0:e.toLowerCase())&&void 0!==n?n:"";return t||r.includes("uncaught exception")||r.includes("failed to fetch")||r.includes("networkerror when attempting to fetch resource")}function c(e){return`statsig.network_fallback.${(0,o._DJB2)(e)}`}function d(e,t){const n=c(e);t&&0!==Object.keys(t).length?s.Storage.setItem(n,JSON.stringify(t)):s.Storage.removeItem(n)}t.NetworkFallbackResolver=class{constructor(e){var t;this._fallbackInfo=null,this._errorBoundary=null,this._dnsQueryCooldowns={},this._networkOverrideFunc=null===(t=e.networkConfig)||void 0===t?void 0:t.networkOverrideFunc}setErrorBoundary(e){this._errorBoundary=e}tryBumpExpiryTime(e,t){var n;const r=null===(n=this._fallbackInfo)||void 0===n?void 0:n[t.endpoint];r&&(r.expiryTime=Date.now()+l,d(e,Object.assign(Object.assign({},this._fallbackInfo),{[t.endpoint]:r})))}getActiveFallbackUrl(e,t){var n,r;if(null!=t.customUrl&&null!=t.fallbackUrls)return null;let i=this._fallbackInfo;null==i&&(i=null!==(n=function(e){const t=c(e),n=s.Storage.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch(e){return a.Log.error("Failed to parse FallbackInfo"),null}}(e))&&void 0!==n?n:{},this._fallbackInfo=i);const o=i[t.endpoint];return!o||Date.now()>(null!==(r=o.expiryTime)&&void 0!==r?r:0)||t.getChecksum()!==o.urlConfigChecksum?(delete i[t.endpoint],this._fallbackInfo=i,d(e,this._fallbackInfo),null):o.url?o.url:null}tryFetchUpdatedFallbackInfo(e,t,n,i){return r(this,void 0,void 0,(function*(){var r,o;try{if(!u(n,i))return!1;const o=null==t.customUrl&&null==t.fallbackUrls?yield this._tryFetchFallbackUrlsFromNetwork(t):t.fallbackUrls,a=this._pickNewFallbackUrl(null===(r=this._fallbackInfo)||void 0===r?void 0:r[t.endpoint],o);return!!a&&(this._updateFallbackInfoWithNewUrl(e,t,a),!0)}catch(e){return null===(o=this._errorBoundary)||void 0===o||o.logError("tryFetchUpdatedFallbackInfo",e),!1}}))}_updateFallbackInfoWithNewUrl(e,t,n){var r,i,o;const a={urlConfigChecksum:t.getChecksum(),url:n,expiryTime:Date.now()+l,previous:[]},s=t.endpoint,u=null===(r=this._fallbackInfo)||void 0===r?void 0:r[s];u&&a.previous.push(...u.previous),a.previous.length>10&&(a.previous=[]);const c=null===(o=null===(i=this._fallbackInfo)||void 0===i?void 0:i[s])||void 0===o?void 0:o.url;null!=c&&a.previous.push(c),this._fallbackInfo=Object.assign(Object.assign({},this._fallbackInfo),{[s]:a}),d(e,this._fallbackInfo)}_tryFetchFallbackUrlsFromNetwork(e){return r(this,void 0,void 0,(function*(){var t;const n=this._dnsQueryCooldowns[e.endpoint];if(n&&Date.now()1){let e=n[1];e.endsWith("/")&&(e=e.slice(0,-1)),r.push(`https://${e}${a}`)}}return r}))}_pickNewFallbackUrl(e,t){var n;if(null==t)return null;const r=new Set(null!==(n=null==e?void 0:e.previous)&&void 0!==n?n:[]),i=null==e?void 0:e.url;let o=null;for(const e of t){const t=e.endsWith("/")?e.slice(0,-1):e;if(!r.has(e)&&t!==i){o=t;break}}return o}},t._isDomainFailure=u},82509:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},5025:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},95747:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.SDKFlags=void 0;const n={};t.SDKFlags={setFlags:(e,t)=>{n[e]=t},get:(e,t)=>{var r,i;return null!==(i=null===(r=n[e])||void 0===r?void 0:r[t])&&void 0!==i&&i}}},10686:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.SDKType=void 0;const n={};let r;t.SDKType={_get:e=>{var t;return(null!==(t=n[e])&&void 0!==t?t:"js-mono")+(null!=r?r:"")},_setClientType(e,t){n[e]=t},_setBindingType(e){r&&"-react"!==r||(r="-"+e)}}},414:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t._getUnloadEvent=t._getCurrentPageUrlSafe=t._addDocumentEventListenerSafe=t._addWindowEventListenerSafe=t._isServerEnv=t._getDocumentSafe=t._getWindowSafe=void 0;t._getWindowSafe=()=>"undefined"!=typeof window?window:null;t._getDocumentSafe=()=>{var e;const n=(0,t._getWindowSafe)();return null!==(e=null==n?void 0:n.document)&&void 0!==e?e:null};t._isServerEnv=()=>{if(null!==(0,t._getDocumentSafe)())return!1;const e="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node;return"string"==typeof EdgeRuntime||e};t._addWindowEventListenerSafe=(e,n)=>{const r=(0,t._getWindowSafe)();"function"==typeof(null==r?void 0:r.addEventListener)&&r.addEventListener(e,n)};t._addDocumentEventListenerSafe=(e,n)=>{const r=(0,t._getDocumentSafe)();"function"==typeof(null==r?void 0:r.addEventListener)&&r.addEventListener(e,n)};t._getCurrentPageUrlSafe=()=>{var e;try{return null===(e=(0,t._getWindowSafe)())||void 0===e?void 0:e.location.href.split(/[?#]/)[0]}catch(e){return}};t._getUnloadEvent=()=>{const e=(0,t._getWindowSafe)();if(!e)return"beforeunload";return"onpagehide"in e?"pagehide":"beforeunload"}},39839:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigSession=t.SessionID=void 0;const r=n(43509),i=n(94681),o=n(68024),a=n(1638),s=n(37047),l=18e5,u=144e5,c={};function d(e,t){return setTimeout((()=>{var t;const n=null===(t=(0,r._getStatsigGlobal)())||void 0===t?void 0:t.instance(e);n&&n.$emt({name:"session_expired"})}),t)}function g(e){return`statsig.session_id.${(0,i._getStorageKey)(e)}`}t.SessionID={get:e=>t.StatsigSession.get(e).data.sessionID},t.StatsigSession={get:e=>{null==c[e]&&(c[e]=function(e){let t=function(e){const t=g(e);return(0,a._getObjectFromStorage)(t)}(e);const n=Date.now();t||(t={sessionID:(0,s.getUUID)(),startTime:n,lastUpdate:n});return{data:t,sdkKey:e}}(e));return function(e){const t=Date.now(),n=e.data,r=e.sdkKey;if(function({lastUpdate:e}){return Date.now()-e>l}(n)||function({startTime:e}){return Date.now()-e>u}(n)){n.sessionID=(0,s.getUUID)(),n.startTime=t;const e=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instance(r);e&&e.$emt({name:"session_expired"})}n.lastUpdate=t,function(e,t){const n=g(t);try{(0,a._setObjectInStorage)(n,e)}catch(e){o.Log.warn("Failed to save SessionID")}}(n,e.sdkKey),clearTimeout(e.idleTimeoutID),clearTimeout(e.ageTimeoutID);const i=t-n.startTime;return e.idleTimeoutID=d(r,l),e.ageTimeoutID=d(r,u-i),e}(c[e])},overrideInitialSessionID:(e,t)=>{c[t]=function(e,t){const n=Date.now();return{data:{sessionID:e,startTime:n,lastUpdate:n},sdkKey:t}}(e,t)}}},56272:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t._fastApproxSizeOf=void 0;t._fastApproxSizeOf=(e,n)=>{let r=0;const i=Object.keys(e);for(let o=0;o=n)return r}return r}},32626:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.StableID=void 0;const r=n(94681),i=n(68024),o=n(414),a=n(1638),s=n(37047),l={},u={},c={};function d(e){return`statsig.stable_id.${(0,r._getStorageKey)(e)}`}function g(e,t){const n=d(t);try{(0,a._setObjectInStorage)(n,e)}catch(e){i.Log.warn("Failed to save StableID to storage")}}function f(e,t){if(!u[t]||!document)return;const n=new Date;n.setFullYear(n.getFullYear()+1),document.cookie=`${_(t)}=${encodeURIComponent(e)}; expires=${n.toUTCString()}; path=/`}function _(e){return`statsig.stable_id.${(0,r._getStorageKey)(e)}`}t.StableID={cookiesEnabled:!1,randomID:Math.random().toString(36),get:e=>{if(c[e])return null;if(null!=l[e])return l[e];let t=null;return t=function(e){if(!u[e]||null==(0,o._getDocumentSafe)())return null;const t=document.cookie.split(";");for(const n of t){const[t,r]=n.trim().split("=");if(t===_(e))return decodeURIComponent(r)}return null}(e),null!=t?(l[e]=t,g(t,e),t):(t=function(e){const t=d(e);return(0,a._getObjectFromStorage)(t)}(e),null==t&&(t=(0,s.getUUID)()),g(t,e),f(t,e),l[e]=t,t)},setOverride:(e,t)=>{l[t]=e,g(e,t),f(e,t)},_setCookiesEnabled:(e,t)=>{u[e]=t},_setDisabled:(e,t)=>{c[e]=t}}},84351:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigClientBase=void 0,n(43509);const i=n(43509),o=n(14358),a=n(85434),s=n(68024),l=n(40843),u=n(414),c=n(39839),d=n(32626),g=n(47754),f=n(1638);t.StatsigClientBase=class{constructor(e,t,n,r){var l,g,_,h;this.loadingStatus="Uninitialized",this._initializePromise=null,this._listeners={};const v=this.$emt.bind(this);null!=(null==r?void 0:r.logLevel)&&(s.Log.level=r.logLevel),(null==r?void 0:r.disableStorage)&&f.Storage._setDisabled(!0),(null==r?void 0:r.initialSessionID)&&c.StatsigSession.overrideInitialSessionID(r.initialSessionID,e),(null==r?void 0:r.storageProvider)&&f.Storage._setProvider(r.storageProvider),(null==r?void 0:r.enableCookies)&&d.StableID._setCookiesEnabled(e,r.enableCookies),(null==r?void 0:r.disableStableID)&&d.StableID._setDisabled(e,!0),this._sdkKey=e,this._options=null!=r?r:{},this._memoCache={},this.overrideAdapter=null!==(l=null==r?void 0:r.overrideAdapter)&&void 0!==l?l:null,this._logger=new a.EventLogger(e,v,n,r),this._errorBoundary=new o.ErrorBoundary(e,r,v),this._errorBoundary.wrap(this),this._errorBoundary.wrap(t),this._errorBoundary.wrap(this._logger),n.setErrorBoundary(this._errorBoundary),this.dataAdapter=t,this.dataAdapter.attach(e,r,n),this.storageProvider=f.Storage,null===(h=null===(_=null===(g=this.overrideAdapter)||void 0===g?void 0:g.loadFromStorage)||void 0===_?void 0:_.call(g))||void 0===h||h.catch((e=>this._errorBoundary.logError("OA::loadFromStorage",e))),this._primeReadyRipcord(),function(e,t){var n;if((0,u._isServerEnv)())return;const r=(0,i._getStatsigGlobal)(),o=null!==(n=r.instances)&&void 0!==n?n:{},a=t;null!=o[e]&&s.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys.");o[e]=a,r.firstInstance||(r.firstInstance=a);r.instances=o,__STATSIG__=r}(e,this)}updateRuntimeOptions(e){e.loggingEnabled?(this._options.loggingEnabled=e.loggingEnabled,this._logger.setLoggingEnabled(e.loggingEnabled)):null!=e.disableLogging&&(this._options.disableLogging=e.disableLogging,this._logger.setLoggingEnabled(e.disableLogging?"disabled":"browser-only")),null!=e.disableStorage&&(this._options.disableStorage=e.disableStorage,f.Storage._setDisabled(e.disableStorage)),null!=e.enableCookies&&(this._options.enableCookies=e.enableCookies,d.StableID._setCookiesEnabled(this._sdkKey,e.enableCookies)),e.logEventCompressionMode?this._logger.setLogEventCompressionMode(e.logEventCompressionMode):e.disableCompression&&this._logger.setLogEventCompressionMode(g.LogEventCompressionMode.Disabled)}flush(){return this._logger.flush()}shutdown(){return r(this,void 0,void 0,(function*(){this.$emt({name:"pre_shutdown"}),this._setStatus("Uninitialized",null),this._initializePromise=null,yield this._logger.stop()}))}on(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)}off(e,t){if(this._listeners[e]){const n=this._listeners[e].indexOf(t);-1!==n&&this._listeners[e].splice(n,1)}}$on(e,t){t.__isInternal=!0,this.on(e,t)}$emt(e){var t;const n=t=>{try{t(e)}catch(n){if(!0===t.__isInternal)return void this._errorBoundary.logError(`__emit:${e.name}`,n);s.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",e)}};this._listeners[e.name]&&this._listeners[e.name].forEach((e=>n(e))),null===(t=this._listeners["*"])||void 0===t||t.forEach(n)}_setStatus(e,t){this.loadingStatus=e,this._memoCache={},this.$emt({name:"values_updated",status:e,values:t})}_enqueueExposure(e,t,n){!0!==(null==n?void 0:n.disableExposureLog)?this._logger.enqueue(t):this._logger.incrementNonExposureCount(e)}_memoize(e,t){return(n,r)=>{if(this._options.disableEvaluationMemoization)return t(n,r);const i=(0,l.createMemoKey)(e,n,r);return i?(i in this._memoCache||(Object.keys(this._memoCache).length>=3e3&&(this._memoCache={}),this._memoCache[i]=t(n,r)),this._memoCache[i]):t(n,r)}}}},71180:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorTag=void 0,t.ErrorTag={NetworkError:"NetworkError"}},12166:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.DataAdapterCachePrefix=void 0,t.DataAdapterCachePrefix="statsig.cached"},37253:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t._createLayerParameterExposure=t._createConfigExposure=t._mapExposures=t._createGateExposure=t._isExposureEvent=void 0;const n="statsig::config_exposure",r="statsig::gate_exposure",i="statsig::layer_exposure",o=(e,t,n,r,i)=>(n.bootstrapMetadata&&(r.bootstrapMetadata=n.bootstrapMetadata),{eventName:e,user:t,value:null,metadata:s(n,r),secondaryExposures:i,time:Date.now()});t._isExposureEvent=({eventName:e})=>e===r||e===n||e===i;function a(e,t){return e.map((e=>"string"==typeof e?(null!=t?t:{})[e]:e)).filter((e=>null!=e))}t._createGateExposure=(e,t,n)=>{var i,s,l;const u={gate:t.name,gateValue:String(t.value),ruleID:t.ruleID};return null!=(null===(i=t.__evaluation)||void 0===i?void 0:i.version)&&(u.configVersion=t.__evaluation.version),o(r,e,t.details,u,a(null!==(l=null===(s=t.__evaluation)||void 0===s?void 0:s.secondary_exposures)&&void 0!==l?l:[],n))},t._mapExposures=a;t._createConfigExposure=(e,t,r)=>{var i,s,l,u;const c={config:t.name,ruleID:t.ruleID};return null!=(null===(i=t.__evaluation)||void 0===i?void 0:i.version)&&(c.configVersion=t.__evaluation.version),null!=(null===(s=t.__evaluation)||void 0===s?void 0:s.passed)&&(c.rulePassed=String(t.__evaluation.passed)),o(n,e,t.details,c,a(null!==(u=null===(l=t.__evaluation)||void 0===l?void 0:l.secondary_exposures)&&void 0!==u?u:[],r))};t._createLayerParameterExposure=(e,t,n,r)=>{var s,l,u,c,d,g,f;const _=t.__evaluation,h=!0===(null===(s=null==_?void 0:_.explicit_parameters)||void 0===s?void 0:s.includes(n));let v="",p=null!==(l=null==_?void 0:_.undelegated_secondary_exposures)&&void 0!==l?l:[];h&&(v=null!==(u=_.allocated_experiment_name)&&void 0!==u?u:"",p=null!==(c=_.secondary_exposures)&&void 0!==c?c:[]);const m=null===(d=t.__evaluation)||void 0===d?void 0:d.parameter_rule_ids,y={config:t.name,parameterName:n,ruleID:null!==(g=null==m?void 0:m[n])&&void 0!==g?g:t.ruleID,allocatedExperiment:v,isExplicitParameter:String(h)};return null!=(null===(f=t.__evaluation)||void 0===f?void 0:f.version)&&(y.configVersion=t.__evaluation.version),o(i,e,t.details,y,a(p,r))};const s=(e,t)=>(t.reason=e.reason,e.lcut&&(t.lcut=String(e.lcut)),e.receivedAt&&(t.receivedAt=String(e.receivedAt)),t)},46512:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigMetadataProvider=t.SDK_VERSION=void 0,t.SDK_VERSION="3.20.0";let n={sdkVersion:t.SDK_VERSION,sdkType:"js-mono"};t.StatsigMetadataProvider={get:()=>n,add:e=>{n=Object.assign(Object.assign({},n),e)}}},47754:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.LoggingEnabledOption=t.LogEventCompressionMode=void 0,t.LogEventCompressionMode={Disabled:"d",Enabled:"e",Forced:"f"},t.LoggingEnabledOption={disabled:"disabled",browserOnly:"browser-only",always:"always"}},68474:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},9851:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t._makeTypedGet=t._mergeOverride=t._makeLayer=t._makeExperiment=t._makeDynamicConfig=t._makeFeatureGate=void 0;const r=n(68024),i=n(90010);function o(e,t,n,r){var i;return{name:e,details:t,ruleID:null!==(i=null==n?void 0:n.rule_id)&&void 0!==i?i:"",__evaluation:n,value:r}}function a(e,t,n){var r;const i=null!==(r=null==n?void 0:n.value)&&void 0!==r?r:{};return Object.assign(Object.assign({},o(e,t,n,i)),{get:s(e,null==n?void 0:n.value)})}function s(e,t,n){return(o,a)=>{var s;const l=null!==(s=null==t?void 0:t[o])&&void 0!==s?s:null;return null==l?null!=a?a:null:null==a||(0,i._isTypeMatch)(l,a)?(null==n||n(o),l):(r.Log.warn(`Parameter type mismatch. '${e}.${o}' was found to be type '${typeof l}' but fallback/return type is '${typeof a}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),null!=a?a:null)}}t._makeFeatureGate=function(e,t,n){var r;return Object.assign(Object.assign({},o(e,t,n,!0===(null==n?void 0:n.value))),{idType:null!==(r=null==n?void 0:n.id_type)&&void 0!==r?r:null})},t._makeDynamicConfig=a,t._makeExperiment=function(e,t,n){var r;const i=a(e,t,n);return Object.assign(Object.assign({},i),{groupName:null!==(r=null==n?void 0:n.group_name)&&void 0!==r?r:null})},t._makeLayer=function(e,t,n,r){var i,a;return Object.assign(Object.assign({},o(e,t,n,void 0)),{get:s(e,null==n?void 0:n.value,r),groupName:null!==(i=null==n?void 0:n.group_name)&&void 0!==i?i:null,__value:null!==(a=null==n?void 0:n.value)&&void 0!==a?a:{}})},t._mergeOverride=function(e,t,n,r){return Object.assign(Object.assign(Object.assign({},e),t),{get:s(e.name,n,r)})},t._makeTypedGet=s},99652:function(e,t){Object.defineProperty(t,"__esModule",{value:!0})},51148:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.UPDATE_DETAIL_ERROR_MESSAGES=t.createUpdateDetails=void 0;t.createUpdateDetails=(e,t,n,r,i,o)=>({duration:n,source:t,success:e,error:r,sourceUrl:i,warnings:o}),t.UPDATE_DETAIL_ERROR_MESSAGES={NO_NETWORK_DATA:"No data was returned from the network. This may be due to a network timeout if a timeout value was specified in the options or ad blocker error."}},81570:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t._getFullUserHash=t._normalizeUser=void 0;const r=n(83918),i=n(68024);t._normalizeUser=function(e,t,n){try{const r=JSON.parse(JSON.stringify(e));return null!=t&&null!=t.environment?r.statsigEnvironment=t.environment:null!=n&&(r.statsigEnvironment={tier:n}),r}catch(e){return i.Log.error("Failed to JSON.stringify user"),{statsigEnvironment:void 0}}},t._getFullUserHash=function(e){return e?(0,r._DJB2Object)(e):null}},1638:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t._setObjectInStorage=t._getObjectFromStorage=t.Storage=void 0;const r=n(68024),i=n(414),o={},a={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:e=>o[e]?o[e]:null,setItem:(e,t)=>{o[e]=t},removeItem:e=>{delete o[e]},getAllKeys:()=>Object.keys(o)};let s=null;try{const e=(0,i._getWindowSafe)();e&&e.localStorage&&"function"==typeof e.localStorage.getItem&&(s={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:t=>e.localStorage.getItem(t),setItem:(t,n)=>e.localStorage.setItem(t,n),removeItem:t=>e.localStorage.removeItem(t),getAllKeys:()=>Object.keys(e.localStorage)})}catch(e){r.Log.warn("Failed to setup localStorageProvider.")}let l=null!=s?s:a,u=l;function c(e){try{return e()}catch(e){if(e instanceof Error&&"SecurityError"===e.name)return t.Storage._setProvider(a),null;if(e instanceof Error&&"QuotaExceededError"===e.name){const n=t.Storage.getAllKeys().filter((e=>e.startsWith("statsig.")));e.message=`${e.message}. Statsig Keys: ${n.length}`}throw e}}t.Storage={isReady:()=>u.isReady(),isReadyResolver:()=>u.isReadyResolver(),getProviderName:()=>u.getProviderName(),getItem:e=>c((()=>u.getItem(e))),setItem:(e,t)=>c((()=>u.setItem(e,t))),removeItem:e=>u.removeItem(e),getAllKeys:()=>u.getAllKeys(),_setProvider:e=>{l=e,u=e},_setDisabled:e=>{u=e?a:l}},t._getObjectFromStorage=function(e){const n=t.Storage.getItem(e);return JSON.parse(null!=n?n:"null")},t._setObjectInStorage=function(e,n){t.Storage.setItem(e,JSON.stringify(n))}},53705:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t._typedJsonParse=void 0;const r=n(68024);t._typedJsonParse=function(e,t,n){try{const n=JSON.parse(e);if(n&&"object"==typeof n&&t in n)return n}catch(e){}return r.Log.error(`Failed to parse ${n}`),null}},90010:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t._isTypeMatch=t._typeOf=void 0,t._typeOf=function(e){return Array.isArray(e)?"array":typeof e},t._isTypeMatch=function(e,t){const n=e=>Array.isArray(e)?"array":typeof e;return n(e)===n(t)}},37047:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.getUUID=void 0,t.getUUID=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();let e=(new Date).getTime(),t="undefined"!=typeof performance&&performance.now&&1e3*performance.now()||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(4*Math.random())]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,(n=>{let r=16*Math.random();return e>0?(r=(e+r)%16|0,e=Math.floor(e/16)):(r=(t+r)%16|0,t=Math.floor(t/16)),("x"===n?r:7&r|8).toString(16)}))}},88873:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.UrlConfiguration=void 0;const r=n(83918),i=n(12610),o={[i.Endpoint._initialize]:"i",[i.Endpoint._rgstr]:"e",[i.Endpoint._download_config_specs]:"d"};t.UrlConfiguration=class{constructor(e,t,n,r){this.customUrl=null,this.fallbackUrls=null,this.endpoint=e,this.endpointDnsKey=o[e],t&&(this.customUrl=t),!t&&n&&(this.customUrl=n.endsWith("/")?`${n}${e}`:`${n}/${e}`),r&&(this.fallbackUrls=r);const a=i.NetworkDefault[e];this.defaultUrl=`${a}/${e}`}getUrl(){var e;return null!==(e=this.customUrl)&&void 0!==e?e:this.defaultUrl}getChecksum(){var e;const t=(null!==(e=this.fallbackUrls)&&void 0!==e?e:[]).sort().join(",");return(0,r._DJB2)(this.customUrl+t)}}},92701:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t._notifyVisibilityChanged=t._subscribeToVisiblityChanged=t._isUnloading=t._isCurrentlyVisible=void 0;const r=n(414),i="foreground",o="background",a=[];let s=i,l=!1;t._isCurrentlyVisible=()=>s===i;t._isUnloading=()=>l;t._subscribeToVisiblityChanged=e=>{a.unshift(e)};t._notifyVisibilityChanged=e=>{e!==s&&(s=e,a.forEach((t=>t(e))))},(0,r._addWindowEventListenerSafe)("focus",(()=>{l=!1,(0,t._notifyVisibilityChanged)(i)})),(0,r._addWindowEventListenerSafe)("blur",(()=>(0,t._notifyVisibilityChanged)(o))),(0,r._addDocumentEventListenerSafe)("visibilitychange",(()=>{(0,t._notifyVisibilityChanged)("visible"===document.visibilityState?i:o)})),(0,r._addWindowEventListenerSafe)((0,r._getUnloadEvent)(),(()=>{l=!0,(0,t._notifyVisibilityChanged)(o)}))},36978:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.Storage=t.Log=t.EventLogger=t.Diagnostics=void 0,n(43509);const o=n(43509),a=n(30882);Object.defineProperty(t,"Diagnostics",{enumerable:!0,get:function(){return a.Diagnostics}});const s=n(85434);Object.defineProperty(t,"EventLogger",{enumerable:!0,get:function(){return s.EventLogger}});const l=n(68024);Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return l.Log}});const u=n(46512),c=n(1638);Object.defineProperty(t,"Storage",{enumerable:!0,get:function(){return c.Storage}}),i(n(43509),t),i(n(94681),t),i(n(58683),t),i(n(85638),t),i(n(30882),t),i(n(54387),t),i(n(14358),t),i(n(43194),t),i(n(86913),t),i(n(83918),t),i(n(57061),t),i(n(68024),t),i(n(40843),t),i(n(12610),t),i(n(44703),t),i(n(82509),t),i(n(5025),t),i(n(414),t),i(n(10686),t),i(n(39839),t),i(n(56272),t),i(n(32626),t),i(n(84351),t),i(n(71180),t),i(n(12166),t),i(n(37253),t),i(n(46512),t),i(n(47754),t),i(n(68474),t),i(n(9851),t),i(n(99652),t),i(n(81570),t),i(n(1638),t),i(n(53705),t),i(n(90010),t),i(n(88873),t),i(n(37047),t),i(n(92701),t),i(n(51148),t),i(n(95747),t),Object.assign((0,o._getStatsigGlobal)(),{Log:l.Log,SDK_VERSION:u.SDK_VERSION})},65694:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t._resolveDeltasResponse=void 0;const r=n(36978);function i(e,t){null==e||e.forEach((e=>{delete t[e]}))}t._resolveDeltasResponse=function(e,t){const n=(0,r._typedJsonParse)(t,"checksum","DeltasEvaluationResponse");if(!n)return{hadBadDeltaChecksum:!0};const o=function(e){const t=e;return i(e.deleted_gates,t.feature_gates),delete t.deleted_gates,i(e.deleted_configs,t.dynamic_configs),delete t.deleted_configs,i(e.deleted_layers,t.layer_configs),delete t.deleted_layers,t}(function(e,t){return Object.assign(Object.assign(Object.assign({},e),t),{feature_gates:Object.assign(Object.assign({},e.feature_gates),t.feature_gates),layer_configs:Object.assign(Object.assign({},e.layer_configs),t.layer_configs),dynamic_configs:Object.assign(Object.assign({},e.dynamic_configs),t.dynamic_configs)})}(e,n)),a=(0,r._DJB2Object)({feature_gates:o.feature_gates,dynamic_configs:o.dynamic_configs,layer_configs:o.layer_configs},2);return a===n.checksumV2?JSON.stringify(o):{hadBadDeltaChecksum:!0,badChecksum:a,badMergedConfigs:o,badFullResponse:n.deltas_full_response}}},87677:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});const r=n(36978);t.default=class{constructor(e){this._sdkKey=e,this._rawValues=null,this._values=null,this._source="Uninitialized",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings=new Set}reset(){this._values=null,this._rawValues=null,this._source="Loading",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null}finalize(){this._values||(this._source="NoValues")}getValues(){return this._rawValues?(0,r._typedJsonParse)(this._rawValues,"has_updates","EvaluationStoreValues"):null}setValues(e,t){var n;if(!e)return!1;const i=(0,r._typedJsonParse)(e.data,"has_updates","EvaluationResponse");return null!=i&&(this._source=e.source,!0!==(null==i?void 0:i.has_updates)||(this._rawValues=e.data,this._lcut=i.time,this._receivedAt=e.receivedAt,this._values=i,this._bootstrapMetadata=this._extractBootstrapMetadata(e.source,i),e.source&&i.user&&this._setWarningState(t,i),r.SDKFlags.setFlags(this._sdkKey,null!==(n=i.sdk_flags)&&void 0!==n?n:{})),!0)}getWarnings(){if(0!==this._warnings.size)return Array.from(this._warnings)}getGate(e){var t;return this._getDetailedStoreResult(null===(t=this._values)||void 0===t?void 0:t.feature_gates,e)}getConfig(e){var t;return this._getDetailedStoreResult(null===(t=this._values)||void 0===t?void 0:t.dynamic_configs,e)}getLayer(e){var t;return this._getDetailedStoreResult(null===(t=this._values)||void 0===t?void 0:t.layer_configs,e)}getParamStore(e){var t;return this._getDetailedStoreResult(null===(t=this._values)||void 0===t?void 0:t.param_stores,e)}getSource(){return this._source}getExposureMapping(){var e;return null===(e=this._values)||void 0===e?void 0:e.exposures}_extractBootstrapMetadata(e,t){if("Bootstrap"!==e)return null;const n={};return t.user&&(n.user=t.user),t.sdkInfo&&(n.generatorSDKInfo=t.sdkInfo),n.lcut=t.time,n}_getDetailedStoreResult(e,t){let n=null;return e&&(n=e[t]?e[t]:e[(0,r._DJB2)(t)]),{result:n,details:this._getDetails(null==n)}}_setWarningState(e,t){var n,i;const o=r.StableID.get(this._sdkKey);if((null===(n=e.customIDs)||void 0===n?void 0:n.stableID)===o||!(null===(i=e.customIDs)||void 0===i?void 0:i.stableID)&&!o){if("user"in t){const n=t.user,i=Object.assign(Object.assign({},e),{analyticsOnlyMetadata:void 0});(0,r._getFullUserHash)(i)!==(0,r._getFullUserHash)(n)&&this._warnings.add("PartialUserMatch")}}else this._warnings.add("StableIDMismatch")}getCurrentSourceDetails(){if("Uninitialized"===this._source||"NoValues"===this._source)return{reason:this._source};const e={reason:this._source,lcut:this._lcut,receivedAt:this._receivedAt};return this._warnings.size>0&&(e.warnings=Array.from(this._warnings)),e}_getDetails(e){var t,n;const r=this.getCurrentSourceDetails();let i=r.reason;const o=null!==(t=r.warnings)&&void 0!==t?t:[];if("Bootstrap"===this._source&&o.length>0&&(i+=o[0]),"Uninitialized"!==i&&"NoValues"!==i){i=`${i}:${e?"Unrecognized":"Recognized"}`}const a="Bootstrap"===this._source&&null!==(n=this._bootstrapMetadata)&&void 0!==n?n:void 0;return a&&(r.bootstrapMetadata=a),Object.assign(Object.assign({},r),{reason:i})}}},82944:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=n(36978),o=n(65694);class a extends i.NetworkCore{constructor(e,t){super(e,t);const n=null==e?void 0:e.networkConfig;this._option=e,this._initializeUrlConfig=new i.UrlConfiguration(i.Endpoint._initialize,null==n?void 0:n.initializeUrl,null==n?void 0:n.api,null==n?void 0:n.initializeFallbackUrls)}fetchEvaluations(e,t,n,o,a){return r(this,void 0,void 0,(function*(){var r,s,l,u,c,d;const g=t?(0,i._typedJsonParse)(t,"has_updates","InitializeResponse"):null;let f={user:o,hash:null!==(l=null===(s=null===(r=this._option)||void 0===r?void 0:r.networkConfig)||void 0===s?void 0:s.initializeHashAlgorithm)&&void 0!==l?l:"djb2",deltasResponseRequested:!1,full_checksum:null};if(null==g?void 0:g.has_updates){const e=(null==g?void 0:g.hash_used)!==(null!==(d=null===(c=null===(u=this._option)||void 0===u?void 0:u.networkConfig)||void 0===c?void 0:c.initializeHashAlgorithm)&&void 0!==d?d:"djb2");f=Object.assign(Object.assign({},f),{sinceTime:a&&!e?g.time:0,previousDerivedFields:"derived_fields"in g&&a?g.derived_fields:{},deltasResponseRequested:!0,full_checksum:g.full_checksum,partialUserMatchSinceTime:e?0:g.time})}return this._fetchEvaluations(e,g,f,n)}))}_fetchEvaluations(e,t,n,i){return r(this,void 0,void 0,(function*(){var r,a;const s=yield this.post({sdkKey:e,urlConfig:this._initializeUrlConfig,data:n,retries:2,isStatsigEncodable:!0,priority:i});if(204===(null==s?void 0:s.code))return'{"has_updates": false}';if(200!==(null==s?void 0:s.code))return null!==(r=null==s?void 0:s.body)&&void 0!==r?r:null;if(!0!==(null==t?void 0:t.has_updates)||!0!==(null===(a=s.body)||void 0===a?void 0:a.includes('"is_delta":true'))||!0!==n.deltasResponseRequested)return s.body;const l=(0,o._resolveDeltasResponse)(t,s.body);return"string"==typeof l?l:this._fetchEvaluations(e,t,Object.assign(Object.assign(Object.assign({},n),l),{deltasResponseRequested:!1}),i)}))}}t.default=a},79999:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t._makeParamStoreGetter=void 0;const r=n(36978),i={disableExposureLog:!0};function o(e){return null==e||!1===e.disableExposureLog}function a(e,t){return null!=t&&!(0,r._isTypeMatch)(e,t)}t._makeParamStoreGetter=function(e,t,n){return(s,l)=>{if(null==t)return l;const u=t[s];if(null==u||null!=l&&(0,r._typeOf)(l)!==u.param_type)return l;switch(u.ref_type){case"static":return function(e){return e.value}(u);case"gate":return function(e,t,n){return e.getFeatureGate(t.gate_name,o(n)?void 0:i).value?t.pass_value:t.fail_value}(e,u,n);case"dynamic_config":return function(e,t,n,r){const s=e.getDynamicConfig(t.config_name,o(r)?void 0:i).get(t.param_name);return a(s,n)?n:s}(e,u,l,n);case"experiment":return function(e,t,n,r){const s=e.getExperiment(t.experiment_name,o(r)?void 0:i).get(t.param_name);return a(s,n)?n:s}(e,u,l,n);case"layer":return function(e,t,n,r){const s=e.getLayer(t.layer_name,o(r)?void 0:i).get(t.param_name);return a(s,n)?n:s}(e,u,l,n);default:return l}}}},7686:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=n(36978),o=n(87677),a=n(82944),s=n(79999),l=n(42451);class u extends i.StatsigClientBase{static instance(e){const t=(0,i._getStatsigGlobal)().instance(e);return t instanceof u?t:(i.Log.warn((0,i._isServerEnv)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new u(null!=e?e:"",{}))}constructor(e,t,n=null){var r,s;i.SDKType._setClientType(e,"javascript-client");const u=new a.default(n,(e=>{this.$emt(e)}));super(e,null!==(r=null==n?void 0:n.dataAdapter)&&void 0!==r?r:new l.StatsigEvaluationsDataAdapter,u,n),this._possibleFirstTouchMetadata={},this.getFeatureGate=this._memoize(i.MemoPrefix._gate,this._getFeatureGateImpl.bind(this)),this.getDynamicConfig=this._memoize(i.MemoPrefix._dynamicConfig,this._getDynamicConfigImpl.bind(this)),this.getExperiment=this._memoize(i.MemoPrefix._experiment,this._getExperimentImpl.bind(this)),this.getLayer=this._memoize(i.MemoPrefix._layer,this._getLayerImpl.bind(this)),this.getParameterStore=this._memoize(i.MemoPrefix._paramStore,this._getParameterStoreImpl.bind(this)),this._store=new o.default(e),this._network=u,this._user=this._configureUser(t,n),this._sdkInstanceID=(0,i.getUUID)();const c=null!==(s=null==n?void 0:n.plugins)&&void 0!==s?s:[];for(const e of c)e.bind(this)}initializeSync(e){var t;return"Uninitialized"!==this.loadingStatus?(0,i.createUpdateDetails)(!0,this._store.getSource(),-1,null,null,["MultipleInitializations",...null!==(t=this._store.getWarnings())&&void 0!==t?t:[]]):(this._logger.start(),this.updateUserSync(this._user,e))}initializeAsync(e){return r(this,void 0,void 0,(function*(){return this._initializePromise||(this._initializePromise=this._initializeAsyncImpl(e)),this._initializePromise}))}updateUserSync(e,t){const n=performance.now();try{return this._updateUserSyncImpl(e,t,n)}catch(e){const t=e instanceof Error?e:new Error(String(e));return this._createErrorUpdateDetails(t,n)}}_updateUserSyncImpl(e,t,n){var r;const o=[...null!==(r=this._store.getWarnings())&&void 0!==r?r:[]];this._resetForUser(e);const a=this.dataAdapter.getDataSync(this._user);null==a&&o.push("NoCachedValues"),this._store.setValues(a,this._user),this._finalizeUpdate(a);const s=null==t?void 0:t.disableBackgroundCacheRefresh;return!0===s||null==s&&"Bootstrap"===(null==a?void 0:a.source)||this._runPostUpdate(null!=a?a:null,this._user),(0,i.createUpdateDetails)(!0,this._store.getSource(),performance.now()-n,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),o)}updateUserAsync(e,t){return r(this,void 0,void 0,(function*(){const n=performance.now();try{return yield this._updateUserAsyncImpl(e,t)}catch(e){const t=e instanceof Error?e:new Error(String(e));return this._createErrorUpdateDetails(t,n)}}))}_updateUserAsyncImpl(e,t){return r(this,void 0,void 0,(function*(){this._resetForUser(e);const n=this._user;i.Diagnostics._markInitOverallStart(this._sdkKey);let r=this.dataAdapter.getDataSync(n);if(this._store.setValues(r,this._user),this._setStatus("Loading",r),r=yield this.dataAdapter.getDataAsync(r,n,t),n!==this._user)return(0,i.createUpdateDetails)(!1,this._store.getSource(),-1,new Error("User changed during update"),this._network.getLastUsedInitUrlAndReset());let o=!1;null!=r&&(i.Diagnostics._markInitProcessStart(this._sdkKey),o=this._store.setValues(r,this._user),i.Diagnostics._markInitProcessEnd(this._sdkKey,{success:o})),this._finalizeUpdate(r),o||(this._errorBoundary.attachErrorIfNoneExists(i.UPDATE_DETAIL_ERROR_MESSAGES.NO_NETWORK_DATA),this.$emt({name:"initialization_failure"})),i.Diagnostics._markInitOverallEnd(this._sdkKey,o,this._store.getCurrentSourceDetails());const a=i.Diagnostics._enqueueDiagnosticsEvent(this._user,this._logger,this._sdkKey,this._options);return(0,i.createUpdateDetails)(o,this._store.getSource(),a,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),this._store.getWarnings())}))}getContext(){return{sdkKey:this._sdkKey,options:this._options,values:this._store.getValues(),user:JSON.parse(JSON.stringify(this._user)),errorBoundary:this._errorBoundary,session:i.StatsigSession.get(this._sdkKey),stableID:i.StableID.get(this._sdkKey),sdkInstanceID:this._sdkInstanceID}}checkGate(e,t){return this.getFeatureGate(e,t).value}logEvent(e,t,n){const r="string"==typeof e?{eventName:e,value:t,metadata:n}:e;this.$emt({name:"log_event_called",event:r}),this._logger.enqueue(Object.assign(Object.assign({},r),{user:this._user,time:Date.now()}))}updateUserWithAnalyticsOnlyMetadata(e){this._user=this._configureUser(Object.assign(Object.assign({},this._user),{analyticsOnlyMetadata:e}),this._options)}_primeReadyRipcord(){this.$on("error",(()=>{"Loading"===this.loadingStatus&&this._finalizeUpdate(null)}))}_initializeAsyncImpl(e){return r(this,void 0,void 0,(function*(){return i.Storage.isReady()||(yield i.Storage.isReadyResolver()),this._logger.start(),this.updateUserAsync(this._user,e)}))}_createErrorUpdateDetails(e,t){var n;return(0,i.createUpdateDetails)(!1,this._store.getSource(),performance.now()-t,e,null,[...null!==(n=this._store.getWarnings())&&void 0!==n?n:[]])}_finalizeUpdate(e){this._store.finalize(),this._setStatus("Ready",e)}_runPostUpdate(e,t){this.dataAdapter.getDataAsync(e,t,{priority:"low"}).catch((e=>{i.Log.error("An error occurred after update.",e)}))}_resetForUser(e){this._logger.reset(),this._store.reset(),this._user=this._configureUser(e,this._options)}_configureUser(e,t){var n;const r=(0,i._normalizeUser)(e,t),o=null===(n=r.customIDs)||void 0===n?void 0:n.stableID;return o&&i.StableID.setOverride(o,this._sdkKey),r.analyticsOnlyMetadata=Object.assign(Object.assign({},r.analyticsOnlyMetadata),this._possibleFirstTouchMetadata),r}_getFeatureGateImpl(e,t){var n,r;const{result:o,details:a}=this._store.getGate(e),s=(0,i._makeFeatureGate)(e,a,o),l=null===(r=null===(n=this.overrideAdapter)||void 0===n?void 0:n.getGateOverride)||void 0===r?void 0:r.call(n,s,this._user,t),u=null!=l?l:s;return this._enqueueExposure(e,(0,i._createGateExposure)(this._user,u,this._store.getExposureMapping()),t),this.$emt({name:"gate_evaluation",gate:u}),u}_getDynamicConfigImpl(e,t){var n,r;const{result:o,details:a}=this._store.getConfig(e),s=(0,i._makeDynamicConfig)(e,a,o),l=null===(r=null===(n=this.overrideAdapter)||void 0===n?void 0:n.getDynamicConfigOverride)||void 0===r?void 0:r.call(n,s,this._user,t),u=null!=l?l:s;return this._enqueueExposure(e,(0,i._createConfigExposure)(this._user,u,this._store.getExposureMapping()),t),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:u}),u}_getExperimentImpl(e,t){var n,r,o,a;const{result:s,details:l}=this._store.getConfig(e),u=(0,i._makeExperiment)(e,l,s);null!=u.__evaluation&&(u.__evaluation.secondary_exposures=(0,i._mapExposures)(null!==(r=null===(n=u.__evaluation)||void 0===n?void 0:n.secondary_exposures)&&void 0!==r?r:[],this._store.getExposureMapping()));const c=null===(a=null===(o=this.overrideAdapter)||void 0===o?void 0:o.getExperimentOverride)||void 0===a?void 0:a.call(o,u,this._user,t),d=null!=c?c:u;return this._enqueueExposure(e,(0,i._createConfigExposure)(this._user,d,this._store.getExposureMapping()),t),this.$emt({name:"experiment_evaluation",experiment:d}),d}_getLayerImpl(e,t){var n,r,o;const{result:a,details:s}=this._store.getLayer(e),l=(0,i._makeLayer)(e,s,a),u=null===(r=null===(n=this.overrideAdapter)||void 0===n?void 0:n.getLayerOverride)||void 0===r?void 0:r.call(n,l,this._user,t);(null==t?void 0:t.disableExposureLog)&&this._logger.incrementNonExposureCount(e);const c=(0,i._mergeOverride)(l,u,null!==(o=null==u?void 0:u.__value)&&void 0!==o?o:l.__value,(n=>{(null==t?void 0:t.disableExposureLog)||this._enqueueExposure(e,(0,i._createLayerParameterExposure)(this._user,c,n,this._store.getExposureMapping()),t)}));return this.$emt({name:"layer_evaluation",layer:c}),c}_getParameterStoreImpl(e,t){var n,r;const{result:i,details:o}=this._store.getParamStore(e);this._logger.incrementNonExposureCount(e);const a={name:e,details:o,__configuration:i,get:(0,s._makeParamStoreGetter)(this,i,t)},l=null===(r=null===(n=this.overrideAdapter)||void 0===n?void 0:n.getParamStoreOverride)||void 0===r?void 0:r.call(n,a,t);return null!=l&&(a.__configuration=l.config,a.details=l.details,a.get=(0,s._makeParamStoreGetter)(this,l.config,t)),a}}t.default=u},42451:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigEvaluationsDataAdapter=void 0;const i=n(36978),o=n(82944);class a extends i.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this._network=null,this._options=null}attach(e,t,n){super.attach(e,t,n),null!==n&&n instanceof o.default?this._network=n:this._network=new o.default(null!=t?t:{})}getDataAsync(e,t,n){return this._getDataAsyncImpl(e,(0,i._normalizeUser)(t,this._options),n)}prefetchData(e,t){return this._prefetchDataImpl(e,t)}setData(e){const t=(0,i._typedJsonParse)(e,"has_updates","data");t&&"user"in t?super.setData(e,t.user):i.Log.error("StatsigUser not found. You may be using an older server SDK version. Please upgrade your SDK or use setDataLegacy.")}setDataLegacy(e,t){super.setData(e,t)}_fetchFromNetwork(e,t,n,i){return r(this,void 0,void 0,(function*(){var r;const o=yield null===(r=this._network)||void 0===r?void 0:r.fetchEvaluations(this._getSdkKey(),e,null==n?void 0:n.priority,t,i);return null!=o?o:null}))}_getCacheKey(e){var t;const n=(0,i._getStorageKey)(this._getSdkKey(),e,null===(t=this._options)||void 0===t?void 0:t.customUserCacheKeyFunc);return`${i.DataAdapterCachePrefix}.${this._cacheSuffix}.${n}`}_isCachedResultValidFor204(e,t){return null!=e.fullUserHash&&e.fullUserHash===(0,i._getFullUserHash)(t)}}t.StatsigEvaluationsDataAdapter=a},5138:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigClient=void 0;const o=n(36978),a=n(7686);t.StatsigClient=a.default,i(n(36978),t);const s=Object.assign((0,o._getStatsigGlobal)(),{StatsigClient:a.default});t.default=s}},function(e){var t;t=63003,e(e.s=t)}]);;